Commit d92f3dc5 authored by afc163's avatar afc163

defaultSetting => defaultSettings

parent 07e3f632
......@@ -2,7 +2,7 @@
const os = require('os');
const pageRoutes = require('./router.config');
const webpackplugin = require('./plugin.config');
const defaultSetting = require('../src/defaultSetting');
const defaultSettings = require('../src/defaultSettings');
export default {
// add for transfer to umi
......@@ -35,7 +35,7 @@ export default {
// Theme for antd
// https://ant.design/docs/react/customize-theme-cn
theme: {
'primary-color': defaultSetting.primaryColor,
'primary-color': defaultSettings.primaryColor,
},
externals: {
'@antv/data-set': 'DataSet',
......
......@@ -167,6 +167,7 @@ export default {
'app.setting.othersettings': 'Other Settings',
'app.setting.weakmode': 'Weak Mode',
'app.setting.copy': 'Copy Setting',
'app.setting.copyinfo': 'copy success,please replace defaultSetting in src/models/setting.js',
'app.setting.production.hint': 'Setting panel show in development enviorment only, please modify src/defaultSetting.js mannually.',
'app.setting.copyinfo': 'copy success,please replace defaultSettings in src/models/setting.js',
'app.setting.production.hint':
'Setting panel show in development enviorment only, please modify src/defaultSettings.js mannually.',
};
......@@ -163,6 +163,7 @@ export default {
'app.setting.othersettings': '其他设置',
'app.setting.weakmode': '色弱模式',
'app.setting.copy': '拷贝设置',
'app.setting.copyinfo': '拷贝成功,请到 src/defaultSetting.js 中替换默认配置',
'app.setting.production.hint': '配置栏只在开发环境用于预览,请拷贝后手动修改 src/defaultSetting.js',
'app.setting.copyinfo': '拷贝成功,请到 src/defaultSettings.js 中替换默认配置',
'app.setting.production.hint':
'配置栏只在开发环境用于预览,请拷贝后手动修改 src/defaultSettings.js',
};
import { message } from 'antd';
import defaultSetting from '../defaultSetting';
import defaultSettings from '../defaultSettings';
let lessNodesAppended;
const updateTheme = primaryColor => {
......@@ -64,7 +64,7 @@ const updateColorWeak = colorWeak => {
export default {
namespace: 'setting',
state: defaultSetting,
state: defaultSettings,
reducers: {
getSetting(state) {
const setting = {};
......@@ -87,7 +87,7 @@ export default {
},
changeSetting(state, { payload }) {
const urlParams = new URL(window.location.href);
Object.keys(defaultSetting).forEach(key => {
Object.keys(defaultSettings).forEach(key => {
if (urlParams.searchParams.has(key)) {
urlParams.searchParams.delete(key);
}
......@@ -100,7 +100,7 @@ export default {
if (value === true) {
value = 1;
}
if (defaultSetting[key] !== value) {
if (defaultSettings[key] !== value) {
urlParams.searchParams.set(key, value);
}
});
......
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