Commit 600332e6 authored by huangzheng's avatar huangzheng

lint

parent 281200c3
...@@ -46,7 +46,7 @@ export default (config: any) => { ...@@ -46,7 +46,7 @@ export default (config: any) => {
fileName: 'css/theme-colors.css', fileName: 'css/theme-colors.css',
matchColors: getAntdSerials('#1890ff'), // 主色系列 matchColors: getAntdSerials('#1890ff'), // 主色系列
// 改变样式选择器,解决样式覆盖问题 // 改变样式选择器,解决样式覆盖问题
changeSelector(selector) { changeSelector(selector: string) {
switch (selector) { switch (selector) {
case '.ant-calendar-today .ant-calendar-date': case '.ant-calendar-today .ant-calendar-date':
return ':not(.ant-calendar-selected-date)' + selector; return ':not(.ant-calendar-selected-date)' + selector;
...@@ -103,10 +103,12 @@ export default (config: any) => { ...@@ -103,10 +103,12 @@ export default (config: any) => {
}); });
}; };
function getAntdSerials(color) { const getAntdSerials = (color: string) => {
const lightNum = 9;
const devide10 = 10;
// 淡化(即less的tint) // 淡化(即less的tint)
const lightens = new Array(9).fill().map((t, i) => { const lightens = new Array(lightNum).fill().map((t, i) => {
return ThemeColorReplacer.varyColor.lighten(color, i / 10); return ThemeColorReplacer.varyColor.lighten(color, i / devide10);
}); });
const colorPalettes = generate(color); const colorPalettes = generate(color);
return lightens.concat(colorPalettes); return lightens.concat(colorPalettes);
......
...@@ -12,9 +12,11 @@ export interface SettingModelType { ...@@ -12,9 +12,11 @@ export interface SettingModelType {
}; };
} }
const updateTheme = (newPrimaryColor:string) => { const updateTheme = (newPrimaryColor?: string) => {
const hideMessage = message.loading('正在切换主题!', 0); const timeOut = 0;
themeColorClient.changeColor(newPrimaryColor).finally(() => hideMessage()); const hideMessage = message.loading('正在切换主题!', timeOut);
themeColorClient.changeColor(newPrimaryColor)
.finally(() => hideMessage());
}; };
/* /*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment