Commit d92f3dc5 authored by afc163's avatar afc163

defaultSetting => defaultSettings

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