vue2-client 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +15 -15
- package/CHANGELOG.md +31 -1
- package/Components.md +60 -0
- package/index.js +39 -30
- package/package.json +4 -2
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +316 -316
- package/src/base-client/components/common/CitySelect/CitySelect.vue +247 -247
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +669 -667
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +735 -733
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +466 -468
- package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +510 -508
- package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +144 -146
- package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +165 -165
- package/src/base-client/components/common/JSONToTree/jsontotree.vue +275 -275
- package/src/base-client/components/common/Upload/Upload.vue +168 -168
- package/src/base-client/components/common/XAddForm/XAddForm.vue +72 -325
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +365 -279
- package/src/base-client/components/common/XAddNativeForm/index.md +96 -56
- package/src/base-client/components/common/XCard/XCard.vue +64 -64
- package/src/base-client/components/common/XDataDrawer/XDataDrawer.vue +180 -0
- package/src/base-client/components/common/XDataDrawer/index.js +3 -0
- package/src/base-client/components/common/XDataDrawer/index.md +41 -0
- package/src/base-client/components/common/XForm/XForm.vue +178 -180
- package/src/base-client/components/common/XForm/XFormItem.vue +521 -513
- package/src/base-client/components/common/XForm/XTreeSelect.vue +184 -184
- package/src/base-client/components/common/XFormCol/XFormCol.vue +38 -38
- package/src/base-client/components/common/XFormTable/XFormTable.vue +356 -344
- package/src/base-client/components/common/XFormTable/index.md +97 -97
- package/src/base-client/components/common/XImportExcel/XImportExcel.vue +132 -132
- package/src/base-client/components/common/XTable/XTable.vue +519 -506
- package/src/base-client/components/common/XTreeOne/XTreeOne.vue +111 -111
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +231 -231
- package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +281 -281
- package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +807 -807
- package/src/base-client/components/ticket/TicketDetailsView/index.md +29 -29
- package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +260 -260
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +532 -532
- package/src/base-client/components/ticket/TicketSubmitSuccessView/index.md +29 -29
- package/src/base-client/plugins/AppData.js +76 -76
- package/src/base-client/plugins/GetLoginInfoService.js +179 -179
- package/src/base-client/plugins/PagedList.js +177 -177
- package/src/base-client/plugins/compatible/LoginServiceOA.js +20 -20
- package/src/base-client/plugins/i18n-extend.js +32 -32
- package/src/components/Ellipsis/Ellipsis.vue +65 -65
- package/src/components/Ellipsis/index.md +38 -38
- package/src/components/NumberInfo/index.md +43 -43
- package/src/components/STable/README.md +341 -341
- package/src/components/STable/index.js +318 -318
- package/src/components/Trend/index.md +45 -45
- package/src/components/checkbox/ColorCheckbox.vue +157 -157
- package/src/components/checkbox/ImgCheckbox.vue +163 -163
- package/src/components/exception/ExceptionPage.vue +70 -70
- package/src/components/form/FormRow.vue +52 -52
- package/src/components/index.js +36 -36
- package/src/components/menu/SideMenu.vue +62 -62
- package/src/components/menu/menu.js +273 -273
- package/src/components/page/header/index.less +40 -40
- package/src/components/setting/Setting.vue +235 -235
- package/src/components/table/StandardTable.vue +141 -141
- package/src/components/table/advance/ActionColumns.vue +158 -158
- package/src/components/table/advance/SearchArea.vue +355 -355
- package/src/components/tool/AStepItem.vue +60 -60
- package/src/components/tool/AvatarList.vue +68 -68
- package/src/components/tool/Drawer.vue +142 -142
- package/src/components/tool/TagSelect.vue +83 -83
- package/src/components/transition/PageToggleTransition.vue +97 -97
- package/src/config/CreateQueryConfig.js +307 -307
- package/src/config/default/admin.config.js +18 -18
- package/src/config/default/setting.config.js +3 -1
- package/src/config/replacer/resolve.config.js +67 -67
- package/src/layouts/CommonLayout.vue +42 -42
- package/src/layouts/ComponentLayoutOne.vue +47 -47
- package/src/layouts/PageLayout.vue +151 -151
- package/src/layouts/SinglePageView.vue +116 -116
- package/src/layouts/footer/PageFooter.vue +49 -49
- package/src/layouts/header/AdminHeader.vue +134 -134
- package/src/layouts/header/HeaderAvatar.vue +64 -64
- package/src/layouts/header/HeaderNotice.vue +176 -176
- package/src/layouts/header/HeaderSearch.vue +67 -67
- package/src/layouts/header/InstitutionDetail.vue +181 -181
- package/src/layouts/header/index.less +92 -92
- package/src/layouts/tabs/TabsHead.vue +190 -190
- package/src/layouts/tabs/TabsView.vue +379 -379
- package/src/mock/goods/index.js +108 -108
- package/src/pages/CreateQueryPage.vue +84 -84
- package/src/pages/login/Login.vue +369 -369
- package/src/pages/report/ReportTable.js +124 -124
- package/src/pages/report/ReportTableHome.vue +28 -28
- package/src/pages/resourceManage/orgListManage.vue +98 -98
- package/src/pages/system/dictionary/index.vue +43 -43
- package/src/pages/system/file/index.vue +317 -317
- package/src/pages/system/monitor/loginInfor/index.vue +36 -36
- package/src/pages/system/monitor/operLog/index.vue +36 -36
- package/src/pages/system/settings/index.vue +126 -126
- package/src/pages/system/settings/modifyPassword.vue +109 -109
- package/src/router/async/config.async.js +28 -28
- package/src/router/async/router.map.js +66 -66
- package/src/router/guards.js +52 -12
- package/src/router/index.js +27 -27
- package/src/services/api/DictionaryDetailsViewApi.js +6 -6
- package/src/services/api/LogDetailsViewApi.js +10 -10
- package/src/services/api/QueryParamsDetailsViewApi.js +6 -6
- package/src/services/api/TicketDetailsViewApi.js +34 -34
- package/src/services/api/cas.js +79 -79
- package/src/services/api/common.js +137 -137
- package/src/services/api/commonTempTable.js +10 -10
- package/src/services/api/index.js +17 -17
- package/src/services/api/logininfor/index.js +6 -6
- package/src/services/api/manage.js +8 -8
- package/src/services/apiService.js +14 -14
- package/src/services/user.js +67 -67
- package/src/store/modules/index.js +4 -4
- package/src/theme/default/nprogress.less +76 -76
- package/src/theme/default/style.less +58 -58
- package/src/utils/EncryptUtil.js +53 -53
- package/src/utils/colors.js +107 -107
- package/src/utils/excel/Blob.js +180 -180
- package/src/utils/excel/Export2Excel.js +141 -141
- package/src/utils/formatter.js +68 -68
- package/src/utils/i18n.js +80 -80
- package/src/utils/login.js +138 -0
- package/src/utils/map-utils.js +37 -37
- package/src/utils/theme-color-replacer-extend.js +91 -91
- package/src/utils/themeUtil.js +100 -100
- package/src/utils/util.js +230 -230
- package/vue.config.js +106 -106
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
const { cssResolve } = require('../config/replacer')
|
|
2
|
-
// 修正 webpack-theme-color-replacer 插件提取的 css 结果
|
|
3
|
-
function resolveCss (output, srcArr) {
|
|
4
|
-
const regExps = []
|
|
5
|
-
// 提取 resolve 配置中所有的正则配置
|
|
6
|
-
Object.keys(cssResolve).forEach(key => {
|
|
7
|
-
let isRegExp
|
|
8
|
-
let reg = {}
|
|
9
|
-
try {
|
|
10
|
-
reg = eval(key)
|
|
11
|
-
isRegExp = reg instanceof RegExp
|
|
12
|
-
} catch (e) {
|
|
13
|
-
isRegExp = false
|
|
14
|
-
}
|
|
15
|
-
if (isRegExp) {
|
|
16
|
-
regExps.push([reg, cssResolve[key]])
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
// 去重
|
|
21
|
-
srcArr = dropDuplicate(srcArr)
|
|
22
|
-
|
|
23
|
-
// 处理 css
|
|
24
|
-
const outArr = []
|
|
25
|
-
srcArr.forEach(text => {
|
|
26
|
-
// 转换为 css 对象
|
|
27
|
-
const cssObj = parseCssObj(text)
|
|
28
|
-
// 根据selector匹配配置,匹配成功,则按配置处理 css
|
|
29
|
-
if (cssResolve[cssObj.selector] !== undefined) {
|
|
30
|
-
const cfg = cssResolve[cssObj.selector]
|
|
31
|
-
if (cfg) {
|
|
32
|
-
outArr.push(cfg.resolve(text, cssObj))
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
let cssText = ''
|
|
36
|
-
// 匹配不成功,则测试是否有匹配的正则配置,有则按正则对应的配置处理
|
|
37
|
-
for (const regExp of regExps) {
|
|
38
|
-
if (regExp[0].test(cssObj.selector)) {
|
|
39
|
-
const cssCfg = regExp[1]
|
|
40
|
-
cssText = cssCfg ? cssCfg.resolve(text, cssObj) : ''
|
|
41
|
-
break
|
|
42
|
-
}
|
|
43
|
-
// 未匹配到正则,则设置 cssText 为默认的 css(即不处理)
|
|
44
|
-
cssText = text
|
|
45
|
-
}
|
|
46
|
-
if (cssText !== '') {
|
|
47
|
-
outArr.push(cssText)
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
})
|
|
51
|
-
output = outArr.join('\n')
|
|
52
|
-
return output
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// 数组去重
|
|
56
|
-
function dropDuplicate (arr) {
|
|
57
|
-
const map = {}
|
|
58
|
-
const r = []
|
|
59
|
-
for (const s of arr) {
|
|
60
|
-
if (!map[s]) {
|
|
61
|
-
r.push(s)
|
|
62
|
-
map[s] = 1
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return r
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* 从字符串解析 css 对象
|
|
70
|
-
* @param cssText
|
|
71
|
-
* @returns {{
|
|
72
|
-
* name: String,
|
|
73
|
-
* rules: Array[String],
|
|
74
|
-
* toText: function
|
|
75
|
-
* }}
|
|
76
|
-
*/
|
|
77
|
-
function parseCssObj (cssText) {
|
|
78
|
-
const css = {}
|
|
79
|
-
const ruleIndex = cssText.indexOf('{')
|
|
80
|
-
css.selector = cssText.substring(0, ruleIndex)
|
|
81
|
-
const ruleBody = cssText.substring(ruleIndex + 1, cssText.length - 1)
|
|
82
|
-
css.rules = ruleBody.split(';')
|
|
83
|
-
css.toText = function () {
|
|
84
|
-
let body = ''
|
|
85
|
-
this.rules.forEach(item => { body += item + ';' })
|
|
86
|
-
return `${this.selector}{${body}}`
|
|
87
|
-
}
|
|
88
|
-
return css
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
module.exports = { resolveCss }
|
|
1
|
+
const { cssResolve } = require('../config/replacer')
|
|
2
|
+
// 修正 webpack-theme-color-replacer 插件提取的 css 结果
|
|
3
|
+
function resolveCss (output, srcArr) {
|
|
4
|
+
const regExps = []
|
|
5
|
+
// 提取 resolve 配置中所有的正则配置
|
|
6
|
+
Object.keys(cssResolve).forEach(key => {
|
|
7
|
+
let isRegExp
|
|
8
|
+
let reg = {}
|
|
9
|
+
try {
|
|
10
|
+
reg = eval(key)
|
|
11
|
+
isRegExp = reg instanceof RegExp
|
|
12
|
+
} catch (e) {
|
|
13
|
+
isRegExp = false
|
|
14
|
+
}
|
|
15
|
+
if (isRegExp) {
|
|
16
|
+
regExps.push([reg, cssResolve[key]])
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
// 去重
|
|
21
|
+
srcArr = dropDuplicate(srcArr)
|
|
22
|
+
|
|
23
|
+
// 处理 css
|
|
24
|
+
const outArr = []
|
|
25
|
+
srcArr.forEach(text => {
|
|
26
|
+
// 转换为 css 对象
|
|
27
|
+
const cssObj = parseCssObj(text)
|
|
28
|
+
// 根据selector匹配配置,匹配成功,则按配置处理 css
|
|
29
|
+
if (cssResolve[cssObj.selector] !== undefined) {
|
|
30
|
+
const cfg = cssResolve[cssObj.selector]
|
|
31
|
+
if (cfg) {
|
|
32
|
+
outArr.push(cfg.resolve(text, cssObj))
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
let cssText = ''
|
|
36
|
+
// 匹配不成功,则测试是否有匹配的正则配置,有则按正则对应的配置处理
|
|
37
|
+
for (const regExp of regExps) {
|
|
38
|
+
if (regExp[0].test(cssObj.selector)) {
|
|
39
|
+
const cssCfg = regExp[1]
|
|
40
|
+
cssText = cssCfg ? cssCfg.resolve(text, cssObj) : ''
|
|
41
|
+
break
|
|
42
|
+
}
|
|
43
|
+
// 未匹配到正则,则设置 cssText 为默认的 css(即不处理)
|
|
44
|
+
cssText = text
|
|
45
|
+
}
|
|
46
|
+
if (cssText !== '') {
|
|
47
|
+
outArr.push(cssText)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
output = outArr.join('\n')
|
|
52
|
+
return output
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 数组去重
|
|
56
|
+
function dropDuplicate (arr) {
|
|
57
|
+
const map = {}
|
|
58
|
+
const r = []
|
|
59
|
+
for (const s of arr) {
|
|
60
|
+
if (!map[s]) {
|
|
61
|
+
r.push(s)
|
|
62
|
+
map[s] = 1
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return r
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 从字符串解析 css 对象
|
|
70
|
+
* @param cssText
|
|
71
|
+
* @returns {{
|
|
72
|
+
* name: String,
|
|
73
|
+
* rules: Array[String],
|
|
74
|
+
* toText: function
|
|
75
|
+
* }}
|
|
76
|
+
*/
|
|
77
|
+
function parseCssObj (cssText) {
|
|
78
|
+
const css = {}
|
|
79
|
+
const ruleIndex = cssText.indexOf('{')
|
|
80
|
+
css.selector = cssText.substring(0, ruleIndex)
|
|
81
|
+
const ruleBody = cssText.substring(ruleIndex + 1, cssText.length - 1)
|
|
82
|
+
css.rules = ruleBody.split(';')
|
|
83
|
+
css.toText = function () {
|
|
84
|
+
let body = ''
|
|
85
|
+
this.rules.forEach(item => { body += item + ';' })
|
|
86
|
+
return `${this.selector}{${body}}`
|
|
87
|
+
}
|
|
88
|
+
return css
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module.exports = { resolveCss }
|
package/src/utils/themeUtil.js
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
const client = require('webpack-theme-color-replacer/client')
|
|
2
|
-
const { theme } = require('../config')
|
|
3
|
-
const { getMenuColors, getAntdColors, getThemeToggleColors, getFunctionalColors } = require('../utils/colors')
|
|
4
|
-
const { ANTD } = require('../config/default')
|
|
5
|
-
|
|
6
|
-
function getThemeColors (color, $theme) {
|
|
7
|
-
const _color = color || theme.color
|
|
8
|
-
const mode = $theme || theme.mode
|
|
9
|
-
const replaceColors = getThemeToggleColors(_color, mode)
|
|
10
|
-
return [
|
|
11
|
-
...replaceColors.mainColors,
|
|
12
|
-
...replaceColors.subColors,
|
|
13
|
-
...replaceColors.menuColors,
|
|
14
|
-
...replaceColors.contentColors,
|
|
15
|
-
...replaceColors.rgbColors,
|
|
16
|
-
...replaceColors.functionalColors.success,
|
|
17
|
-
...replaceColors.functionalColors.warning,
|
|
18
|
-
...replaceColors.functionalColors.error
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function changeThemeColor (newColor, $theme) {
|
|
23
|
-
return client.changer.changeColor({ newColors: getThemeColors(newColor, $theme) })
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function modifyVars (color) {
|
|
27
|
-
const _color = color || theme.color
|
|
28
|
-
const palettes = getAntdColors(_color, theme.mode)
|
|
29
|
-
const menuColors = getMenuColors(_color, theme.mode)
|
|
30
|
-
const { success, warning, error } = getFunctionalColors(theme.mode)
|
|
31
|
-
const primary = palettes[5]
|
|
32
|
-
return {
|
|
33
|
-
'primary-color': primary,
|
|
34
|
-
'primary-1': palettes[0],
|
|
35
|
-
'primary-2': palettes[1],
|
|
36
|
-
'primary-3': palettes[2],
|
|
37
|
-
'primary-4': palettes[3],
|
|
38
|
-
'primary-5': palettes[4],
|
|
39
|
-
'primary-6': palettes[5],
|
|
40
|
-
'primary-7': palettes[6],
|
|
41
|
-
'primary-8': palettes[7],
|
|
42
|
-
'primary-9': palettes[8],
|
|
43
|
-
'primary-10': palettes[9],
|
|
44
|
-
'info-color': primary,
|
|
45
|
-
'success-color': success[5],
|
|
46
|
-
'warning-color': warning[5],
|
|
47
|
-
'error-color': error[5],
|
|
48
|
-
'alert-info-bg-color': palettes[0],
|
|
49
|
-
'alert-info-border-color': palettes[2],
|
|
50
|
-
'alert-success-bg-color': success[0],
|
|
51
|
-
'alert-success-border-color': success[2],
|
|
52
|
-
'alert-warning-bg-color': warning[0],
|
|
53
|
-
'alert-warning-border-color': warning[2],
|
|
54
|
-
'alert-error-bg-color': error[0],
|
|
55
|
-
'alert-error-border-color': error[2],
|
|
56
|
-
'processing-color': primary,
|
|
57
|
-
'menu-dark-submenu-bg': menuColors[0],
|
|
58
|
-
'layout-header-background': menuColors[1],
|
|
59
|
-
'layout-trigger-background': menuColors[2],
|
|
60
|
-
'btn-danger-bg': error[4],
|
|
61
|
-
'btn-danger-border': error[4],
|
|
62
|
-
...ANTD.theme[theme.mode]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function loadLocalTheme (localSetting) {
|
|
67
|
-
if (localSetting && localSetting.theme) {
|
|
68
|
-
let { color, mode } = localSetting.theme
|
|
69
|
-
color = color || theme.color
|
|
70
|
-
mode = mode || theme.mode
|
|
71
|
-
changeThemeColor(color, mode)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* 获取本地保存的配置
|
|
77
|
-
* @returns {Object}
|
|
78
|
-
* @param loadTheme
|
|
79
|
-
*/
|
|
80
|
-
function getLocalSetting (loadTheme) {
|
|
81
|
-
let localSetting = {}
|
|
82
|
-
try {
|
|
83
|
-
const localSettingStr = localStorage.getItem(process.env.VUE_APP_SETTING_KEY)
|
|
84
|
-
localSetting = JSON.parse(localSettingStr)
|
|
85
|
-
} catch (e) {
|
|
86
|
-
console.error(e)
|
|
87
|
-
}
|
|
88
|
-
if (loadTheme) {
|
|
89
|
-
loadLocalTheme(localSetting)
|
|
90
|
-
}
|
|
91
|
-
return localSetting
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
module.exports = {
|
|
95
|
-
getThemeColors,
|
|
96
|
-
changeThemeColor,
|
|
97
|
-
modifyVars,
|
|
98
|
-
loadLocalTheme,
|
|
99
|
-
getLocalSetting
|
|
100
|
-
}
|
|
1
|
+
const client = require('webpack-theme-color-replacer/client')
|
|
2
|
+
const { theme } = require('../config')
|
|
3
|
+
const { getMenuColors, getAntdColors, getThemeToggleColors, getFunctionalColors } = require('../utils/colors')
|
|
4
|
+
const { ANTD } = require('../config/default')
|
|
5
|
+
|
|
6
|
+
function getThemeColors (color, $theme) {
|
|
7
|
+
const _color = color || theme.color
|
|
8
|
+
const mode = $theme || theme.mode
|
|
9
|
+
const replaceColors = getThemeToggleColors(_color, mode)
|
|
10
|
+
return [
|
|
11
|
+
...replaceColors.mainColors,
|
|
12
|
+
...replaceColors.subColors,
|
|
13
|
+
...replaceColors.menuColors,
|
|
14
|
+
...replaceColors.contentColors,
|
|
15
|
+
...replaceColors.rgbColors,
|
|
16
|
+
...replaceColors.functionalColors.success,
|
|
17
|
+
...replaceColors.functionalColors.warning,
|
|
18
|
+
...replaceColors.functionalColors.error
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function changeThemeColor (newColor, $theme) {
|
|
23
|
+
return client.changer.changeColor({ newColors: getThemeColors(newColor, $theme) })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function modifyVars (color) {
|
|
27
|
+
const _color = color || theme.color
|
|
28
|
+
const palettes = getAntdColors(_color, theme.mode)
|
|
29
|
+
const menuColors = getMenuColors(_color, theme.mode)
|
|
30
|
+
const { success, warning, error } = getFunctionalColors(theme.mode)
|
|
31
|
+
const primary = palettes[5]
|
|
32
|
+
return {
|
|
33
|
+
'primary-color': primary,
|
|
34
|
+
'primary-1': palettes[0],
|
|
35
|
+
'primary-2': palettes[1],
|
|
36
|
+
'primary-3': palettes[2],
|
|
37
|
+
'primary-4': palettes[3],
|
|
38
|
+
'primary-5': palettes[4],
|
|
39
|
+
'primary-6': palettes[5],
|
|
40
|
+
'primary-7': palettes[6],
|
|
41
|
+
'primary-8': palettes[7],
|
|
42
|
+
'primary-9': palettes[8],
|
|
43
|
+
'primary-10': palettes[9],
|
|
44
|
+
'info-color': primary,
|
|
45
|
+
'success-color': success[5],
|
|
46
|
+
'warning-color': warning[5],
|
|
47
|
+
'error-color': error[5],
|
|
48
|
+
'alert-info-bg-color': palettes[0],
|
|
49
|
+
'alert-info-border-color': palettes[2],
|
|
50
|
+
'alert-success-bg-color': success[0],
|
|
51
|
+
'alert-success-border-color': success[2],
|
|
52
|
+
'alert-warning-bg-color': warning[0],
|
|
53
|
+
'alert-warning-border-color': warning[2],
|
|
54
|
+
'alert-error-bg-color': error[0],
|
|
55
|
+
'alert-error-border-color': error[2],
|
|
56
|
+
'processing-color': primary,
|
|
57
|
+
'menu-dark-submenu-bg': menuColors[0],
|
|
58
|
+
'layout-header-background': menuColors[1],
|
|
59
|
+
'layout-trigger-background': menuColors[2],
|
|
60
|
+
'btn-danger-bg': error[4],
|
|
61
|
+
'btn-danger-border': error[4],
|
|
62
|
+
...ANTD.theme[theme.mode]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function loadLocalTheme (localSetting) {
|
|
67
|
+
if (localSetting && localSetting.theme) {
|
|
68
|
+
let { color, mode } = localSetting.theme
|
|
69
|
+
color = color || theme.color
|
|
70
|
+
mode = mode || theme.mode
|
|
71
|
+
changeThemeColor(color, mode)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 获取本地保存的配置
|
|
77
|
+
* @returns {Object}
|
|
78
|
+
* @param loadTheme
|
|
79
|
+
*/
|
|
80
|
+
function getLocalSetting (loadTheme) {
|
|
81
|
+
let localSetting = {}
|
|
82
|
+
try {
|
|
83
|
+
const localSettingStr = localStorage.getItem(process.env.VUE_APP_SETTING_KEY)
|
|
84
|
+
localSetting = JSON.parse(localSettingStr)
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error(e)
|
|
87
|
+
}
|
|
88
|
+
if (loadTheme) {
|
|
89
|
+
loadLocalTheme(localSetting)
|
|
90
|
+
}
|
|
91
|
+
return localSetting
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
module.exports = {
|
|
95
|
+
getThemeColors,
|
|
96
|
+
changeThemeColor,
|
|
97
|
+
modifyVars,
|
|
98
|
+
loadLocalTheme,
|
|
99
|
+
getLocalSetting
|
|
100
|
+
}
|