@lambo-design/shared 1.0.0-beta.219 → 1.0.0-beta.220
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/package.json +1 -1
- package/utils/platform.js +12 -3
- package/utils/theme.js +25 -25
package/package.json
CHANGED
package/utils/platform.js
CHANGED
|
@@ -1259,14 +1259,23 @@ export const changeSystemInfo = async (systemInfo) => {
|
|
|
1259
1259
|
let showTheme = systemInfo.showTheme
|
|
1260
1260
|
let split = showTheme.split('-')
|
|
1261
1261
|
let systemForm = null
|
|
1262
|
-
|
|
1263
|
-
|
|
1262
|
+
let themeId = split[0];
|
|
1263
|
+
let status = split[1];
|
|
1264
|
+
let filterStatus = split[2];
|
|
1265
|
+
if (themeId) {
|
|
1266
|
+
let res = await ajax.get(config.upmsServerContext + '/anon/system/themeInfo?themeId=' + split[0])
|
|
1264
1267
|
if (res.data.code == 1) {
|
|
1265
1268
|
systemForm = res.data.data[0]
|
|
1269
|
+
if (!status && systemForm.status) {
|
|
1270
|
+
status = systemForm.status;
|
|
1271
|
+
}
|
|
1272
|
+
if (!filterStatus && systemForm.filterStatus) {
|
|
1273
|
+
filterStatus = systemForm.filterStatus;
|
|
1274
|
+
}
|
|
1266
1275
|
}
|
|
1267
1276
|
}
|
|
1268
1277
|
if (systemForm) {
|
|
1269
|
-
changeThemeByThemeId(
|
|
1278
|
+
changeThemeByThemeId(themeId, status, filterStatus, systemForm)
|
|
1270
1279
|
}
|
|
1271
1280
|
}
|
|
1272
1281
|
if (!systemInfo.rightTopOptButtonList || systemInfo.rightTopOptButtonList.length <= 0) {
|
package/utils/theme.js
CHANGED
|
@@ -57,32 +57,32 @@ const changeByTheme = (theme) => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
const changeThemeByThemeId = (themeId, status, filterStatus, systemForm) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
} else if (status === '1') {
|
|
83
|
-
background_image = 'url(' + background_image + ')'
|
|
60
|
+
// 主题切换方式(区分新旧两种:1-旧 2-新)
|
|
61
|
+
if (typeof window !== 'undefined') {
|
|
62
|
+
localStorage.setItem('themeInStyle', '2')
|
|
63
|
+
}
|
|
64
|
+
// 一键滤镜功能 - 灰度状态;
|
|
65
|
+
let grayscaleVal = '0%'
|
|
66
|
+
if (filterStatus && filterStatus === '1') {
|
|
67
|
+
grayscaleVal = '100%'
|
|
68
|
+
}
|
|
69
|
+
// 记录当前主题
|
|
70
|
+
if (typeof window !== 'undefined') {
|
|
71
|
+
// localStorage.setItem('themeIdCurrent', themeId)
|
|
72
|
+
localStorage.setItem('themeIdCurrent', themeId)
|
|
73
|
+
}
|
|
74
|
+
// 顶部栏背景图处理
|
|
75
|
+
let background_image = config.upmsServerContext + '/anon/oss/file/getImage/' + systemForm.topBkImg + '?height=64&width=1920'
|
|
76
|
+
if (!status || status === '2') {
|
|
77
|
+
if (background_image.includes('lan_navigator')) {
|
|
78
|
+
background_image = 'url(' + lan_navigator + ')'
|
|
79
|
+
} else if (background_image.includes('lv_navigator')) {
|
|
80
|
+
background_image = 'url(' + lv_navigator + ')'
|
|
84
81
|
}
|
|
85
|
-
|
|
82
|
+
} else if (status === '1') {
|
|
83
|
+
background_image = 'url(' + background_image + ')'
|
|
84
|
+
}
|
|
85
|
+
handleSystemColor(grayscaleVal, systemForm, background_image)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
const getThemeConfig = (themeKey = 'default') =>{
|