imatrix-ui 2.8.2-dw → 2.8.2-tmp2
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/lib/super-ui.css +1 -1
- package/lib/super-ui.umd.min.js +5 -35
- package/package.json +4 -2
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +10 -5
- package/src/i18n/langs/en.js +10 -5
- package/src/permission.js +7 -3
- package/src/plugins.js +3 -3
- package/src/router/index.js +24 -0
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/store/modules/permission.js +5 -0
- package/src/store/modules/user.js +50 -19
- package/src/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +53 -0
- package/src/styles/theme/dark-blue/button.scss +9 -0
- package/src/styles/theme/dark-blue/card.scss +64 -0
- package/src/styles/theme/dark-blue/checkbox.scss +10 -0
- package/src/styles/theme/dark-blue/dark-blue-var.scss +8 -0
- package/src/styles/theme/dark-blue/dialog.scss +21 -0
- package/src/styles/theme/dark-blue/element-variables.scss +7 -0
- package/src/styles/theme/dark-blue/font.scss +71 -0
- package/src/styles/theme/dark-blue/form.scss +51 -0
- package/src/styles/theme/dark-blue/index.scss +247 -0
- package/src/styles/theme/dark-blue/input.scss +15 -0
- package/src/styles/theme/dark-blue/pagination.scss +14 -0
- package/src/styles/theme/dark-blue/scrollbar-style.scss +32 -0
- package/src/styles/theme/dark-blue/sidebar.scss +296 -0
- package/src/styles/theme/dark-blue/tab.scss +83 -0
- package/src/styles/theme/dark-blue/table.scss +60 -0
- package/src/styles/theme/dark-blue/tree.scss +31 -0
- package/src/styles/theme/dark-blue/var.scss +1028 -0
- package/src/styles/theme/gray/form-style.scss +2 -2
- package/src/styles/theme/gray/input-style.scss +8 -0
- package/src/utils/auth-api.js +115 -0
- package/src/utils/auth.js +43 -30
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/common-util.js +34 -0
- package/src/utils/jump-page-utils.js +29 -5
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/permissionAuth.js +48 -1
- package/src/utils/request.js +18 -2
- package/src/utils/util.js +23 -6
- package/src/views/404.vue +14 -10
- package/src/views/dsc-component/Sidebar/Item.vue +3 -3
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -21
- package/src/views/dsc-component/Sidebar/index.vue +12 -7
- package/src/views/dsc-component/tabs/tab-content.vue +11 -0
- package/src/views/error-page/404.vue +6 -6
- package/src/views/layout/components/Menubar/index.vue +5 -3
- package/src/views/login/index.vue +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
background: rgb(255, 255, 255);
|
|
6
6
|
line-height: 72px;
|
|
7
7
|
height: 72px;
|
|
8
|
-
position:
|
|
8
|
+
position: absolute;
|
|
9
9
|
z-index: 100;
|
|
10
10
|
top: 0px;
|
|
11
11
|
left: 0px;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
background: rgb(255, 255, 255);
|
|
18
18
|
line-height: 72px;
|
|
19
19
|
height: 72px;
|
|
20
|
-
position:
|
|
20
|
+
position: absolute;
|
|
21
21
|
bottom: 0px;
|
|
22
22
|
z-index: 100;
|
|
23
23
|
left: 0px;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import Cookies from 'js-cookie'
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
|
|
4
|
+
const jwtKey = 'JWT'
|
|
5
|
+
const currentUserNameKey = 'USERNAME'
|
|
6
|
+
const currentUserInfoKey = 'CURRENT_USER'
|
|
7
|
+
|
|
8
|
+
function getToken() {
|
|
9
|
+
let token = getCookieCache(jwtKey)
|
|
10
|
+
const projectModel = Vue.prototype.projectModel
|
|
11
|
+
if (!token && projectModel && projectModel === 'developing.model') {
|
|
12
|
+
// 如果是开发环境从sessionStorage中获得token
|
|
13
|
+
token = getSessionCache(jwtKey)
|
|
14
|
+
}
|
|
15
|
+
return token
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function setToken(token) {
|
|
19
|
+
setCookieCache(jwtKey, token)
|
|
20
|
+
setSessionCache(jwtKey, token)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function removeToken() {
|
|
24
|
+
removeCookieCache(jwtKey)
|
|
25
|
+
removeSessionCache(jwtKey)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getUsername() {
|
|
29
|
+
let username = getCookieCache(currentUserNameKey)
|
|
30
|
+
if (!username) {
|
|
31
|
+
username = getSessionCache(currentUserNameKey)
|
|
32
|
+
}
|
|
33
|
+
return username
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function setUsername(username) {
|
|
37
|
+
setSessionCache(currentUserNameKey, username)
|
|
38
|
+
setCookieCache(currentUserNameKey, username)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function removeUsername() {
|
|
42
|
+
removeSessionCache(currentUserNameKey)
|
|
43
|
+
removeCookieCache(currentUserNameKey)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function getCurrentUser() {
|
|
47
|
+
let userJson = getCookieCache(currentUserInfoKey)
|
|
48
|
+
if (!userJson) {
|
|
49
|
+
userJson = getSessionCache(currentUserInfoKey)
|
|
50
|
+
}
|
|
51
|
+
if (userJson) {
|
|
52
|
+
return JSON.parse(userJson)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function setCurrentUser(userInfo) {
|
|
57
|
+
if (userInfo) {
|
|
58
|
+
if (userInfo.password) {
|
|
59
|
+
userInfo.password = null
|
|
60
|
+
}
|
|
61
|
+
const userinfoStr = JSON.stringify(userInfo)
|
|
62
|
+
setSessionCache(currentUserInfoKey, userinfoStr)
|
|
63
|
+
setCookieCache(currentUserInfoKey, userinfoStr)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function removeCurrentUser() {
|
|
68
|
+
removeSessionCache(currentUserInfoKey)
|
|
69
|
+
removeCookieCache(currentUserInfoKey)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getCookieCache(key) {
|
|
73
|
+
return Cookies.get(key)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function setCookieCache(key, value) {
|
|
77
|
+
Cookies.set(key, value, {
|
|
78
|
+
path: '/'
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function removeCookieCache(key) {
|
|
83
|
+
Cookies.remove(key, {
|
|
84
|
+
path: '/'
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getSessionCache(key) {
|
|
89
|
+
return sessionStorage.getItem(key)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function setSessionCache(key, value) {
|
|
93
|
+
return sessionStorage.setItem(key, value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function removeSessionCache(key) {
|
|
97
|
+
sessionStorage.removeItem(key)
|
|
98
|
+
}
|
|
99
|
+
export default {
|
|
100
|
+
getToken,
|
|
101
|
+
setToken,
|
|
102
|
+
removeToken,
|
|
103
|
+
getUsername,
|
|
104
|
+
setUsername,
|
|
105
|
+
removeUsername,
|
|
106
|
+
getCurrentUser,
|
|
107
|
+
setCurrentUser,
|
|
108
|
+
removeCurrentUser,
|
|
109
|
+
getCookieCache,
|
|
110
|
+
setCookieCache,
|
|
111
|
+
removeCookieCache,
|
|
112
|
+
getSessionCache,
|
|
113
|
+
setSessionCache,
|
|
114
|
+
removeSessionCache
|
|
115
|
+
}
|
package/src/utils/auth.js
CHANGED
|
@@ -1,48 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Cookies from 'js-cookie'
|
|
3
|
-
import Vue from 'vue'
|
|
4
|
-
|
|
5
|
-
const jwtKey = 'JWT'
|
|
6
|
-
const currentUserNameKey = 'USERNAME'
|
|
1
|
+
import authApi from './auth-api'
|
|
7
2
|
|
|
8
3
|
export function getToken() {
|
|
9
|
-
|
|
10
|
-
// console.log('auth-sessionStorage.getToken=', jwt)
|
|
11
|
-
if (!jwt) {
|
|
12
|
-
jwt = Cookies.get(jwtKey)
|
|
13
|
-
// console.log('auth-Cookies.getToken=', jwt)
|
|
14
|
-
}
|
|
15
|
-
return jwt
|
|
4
|
+
return authApi.getToken()
|
|
16
5
|
}
|
|
17
6
|
|
|
18
7
|
export function setToken(token) {
|
|
19
|
-
|
|
20
|
-
// 如果是开发模式,需要设置cookie。不设置expires,就是session cookie,表示关闭浏览器,cookie即失效
|
|
21
|
-
// console.log('auth-Cookies.setToken=', token)
|
|
22
|
-
// 必须是“/”否则无法移除token
|
|
23
|
-
Cookies.set(jwtKey, token, { path: '/' })
|
|
24
|
-
} else {
|
|
25
|
-
// console.log('auth-sessionStorage.setToken=', token)
|
|
26
|
-
return sessionStorage.setItem(jwtKey, token)
|
|
27
|
-
}
|
|
8
|
+
authApi.setToken(token)
|
|
28
9
|
}
|
|
29
10
|
|
|
30
11
|
export function removeToken() {
|
|
31
|
-
|
|
32
|
-
// console.log('auth-sessionStorage.removeToken=', getToken())
|
|
33
|
-
// 必须和setToken中的path“/”一致,否则无法移除token
|
|
34
|
-
Cookies.remove(jwtKey, { path: '/' })
|
|
35
|
-
// console.log('auth-Cookies.removeToken=', getToken())
|
|
12
|
+
authApi.removeToken()
|
|
36
13
|
}
|
|
37
14
|
|
|
38
15
|
export function getUsername() {
|
|
39
|
-
return
|
|
16
|
+
return authApi.getUsername()
|
|
40
17
|
}
|
|
41
18
|
|
|
42
19
|
export function setUsername(username) {
|
|
43
|
-
|
|
20
|
+
authApi.setUsername(username)
|
|
44
21
|
}
|
|
45
22
|
|
|
46
23
|
export function removeUsername() {
|
|
47
|
-
|
|
24
|
+
authApi.removeUsername()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function getCurrentUser() {
|
|
28
|
+
return authApi.getCurrentUser()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function setCurrentUser(userInfo) {
|
|
32
|
+
authApi.setCurrentUser(userInfo)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function removeCurrentUser() {
|
|
36
|
+
authApi.removeCurrentUser()
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function getCookieCache(key) {
|
|
40
|
+
return authApi.getCookieCache(key)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function setCookieCache(key, value) {
|
|
44
|
+
authApi.setCookieCache(key, value)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function removeCookieCache(key) {
|
|
48
|
+
authApi.removeCookieCache(key)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getSessionCache(key) {
|
|
52
|
+
return authApi.getSessionCache(key)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setSessionCache(key, value) {
|
|
56
|
+
return authApi.setSessionCache(key, value)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function removeSessionCache(key) {
|
|
60
|
+
authApi.removeSessionCache(key)
|
|
48
61
|
}
|
|
@@ -45,7 +45,7 @@ class NumberCalculator extends CalculatorFactory {
|
|
|
45
45
|
this.result = true
|
|
46
46
|
} else if (this.isEQEmptyValue(leftVale, operator, rightValue)) {
|
|
47
47
|
this.result = true
|
|
48
|
-
} else if (leftVale === null) {
|
|
48
|
+
} else if (leftVale === undefined || leftVale === null) {
|
|
49
49
|
this.result = false
|
|
50
50
|
} else {
|
|
51
51
|
const preOperand = Number(leftVale + '')
|
|
@@ -81,7 +81,7 @@ class TextCalculator extends CalculatorFactory {
|
|
|
81
81
|
this.result = true
|
|
82
82
|
} else if (this.isNotNullValue(leftVale, operator)) {
|
|
83
83
|
this.result = true
|
|
84
|
-
} else if (leftVale === null) {
|
|
84
|
+
} else if (leftVale === undefined || leftVale === null) {
|
|
85
85
|
this.result = false
|
|
86
86
|
} else {
|
|
87
87
|
if (operator === 'NET') {
|
package/src/utils/common-util.js
CHANGED
|
@@ -189,3 +189,37 @@ export function getServerConfigUtil(http) {
|
|
|
189
189
|
})
|
|
190
190
|
})
|
|
191
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* postmessage跨域传message时获得orign路径使用
|
|
194
|
+
* @returns orign路径
|
|
195
|
+
*/
|
|
196
|
+
export function getOrignUrl() {
|
|
197
|
+
const url = window.location.href
|
|
198
|
+
let orignUrl
|
|
199
|
+
if (url && url.indexOf('/') > 0) {
|
|
200
|
+
const urls = url.split('/')
|
|
201
|
+
orignUrl = urls[0] + '//' + urls[2]
|
|
202
|
+
}
|
|
203
|
+
return orignUrl
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function isPromise(p) {
|
|
207
|
+
return p && Object.prototype.toString.call(p) === '[object Promise]'
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* 获得UTC时区
|
|
211
|
+
* @returns 时区
|
|
212
|
+
*/
|
|
213
|
+
export function getTimeZone() {
|
|
214
|
+
const dateStr = new Date() + ''
|
|
215
|
+
let timeZone = ''
|
|
216
|
+
if (dateStr.indexOf('GMT') > 0) {
|
|
217
|
+
const timeZoneSuffix = dateStr.substring(dateStr.indexOf('GMT') + 3, dateStr.indexOf('(')).trim()
|
|
218
|
+
const partPrefix = timeZoneSuffix.substring(0, timeZoneSuffix.length - 2)
|
|
219
|
+
const partSuffix = timeZoneSuffix.substring(timeZoneSuffix.length - 2)
|
|
220
|
+
timeZone = 'UTC' + partPrefix + ':' + partSuffix
|
|
221
|
+
} else if (dateStr.indexOf('UTC') > 0) {
|
|
222
|
+
timeZone = 'UTC' + dateStr.substring(dateStr.indexOf('UTC') + 3, dateStr.indexOf('(')).trim()
|
|
223
|
+
}
|
|
224
|
+
return timeZone
|
|
225
|
+
}
|
|
@@ -243,7 +243,8 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode, isHasId
|
|
|
243
243
|
const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
|
|
244
244
|
path = frontendUrl + '/#' + path
|
|
245
245
|
}
|
|
246
|
-
|
|
246
|
+
const systemName = getSystemNameWithLanguage(system)
|
|
247
|
+
jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPageSetting, ids, buttonCode, isHasIdParam, systemName)
|
|
247
248
|
resolve()
|
|
248
249
|
}
|
|
249
250
|
})
|
|
@@ -255,16 +256,20 @@ function jumpToPageTwo(jumpPageSetting, system, dataId, ids, buttonCode, isHasId
|
|
|
255
256
|
* @param {*} additionalParameterStr
|
|
256
257
|
* @param {*} jumpPage
|
|
257
258
|
*/
|
|
258
|
-
function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage, ids, buttonCode, isHasIdParam) {
|
|
259
|
+
function jumpToPageWithFullPath(dataId, path, additionalParameterStr, jumpPage, ids, buttonCode, isHasIdParam, systemName) {
|
|
259
260
|
path = packagePathParams(dataId, path, jumpPage, ids, buttonCode, isHasIdParam)
|
|
260
261
|
// 保持这种情况参数传递,是为了解决不同域时获得不到sessionStorage中存的附加参数问题
|
|
261
262
|
if (additionalParameterStr && additionalParameterStr !== '') {
|
|
263
|
+
let systemNameParam = ''
|
|
264
|
+
if (systemName) {
|
|
265
|
+
systemNameParam = '&_systemName_=' + encodeURI(systemName)
|
|
266
|
+
}
|
|
262
267
|
if (path.indexOf('?') !== -1) {
|
|
263
268
|
path += '&'
|
|
264
|
-
path += additionalParameterStr
|
|
269
|
+
path += additionalParameterStr + systemNameParam
|
|
265
270
|
} else {
|
|
266
271
|
path += '?'
|
|
267
|
-
path += additionalParameterStr
|
|
272
|
+
path += additionalParameterStr + systemNameParam
|
|
268
273
|
}
|
|
269
274
|
}
|
|
270
275
|
let jumpMode = 'refresh'
|
|
@@ -421,6 +426,7 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
|
|
|
421
426
|
popPageSetting.jumpPageHeight = jumpPageSetting.jumpPageHeight
|
|
422
427
|
popPageSetting.valueMappings = jumpPageSetting.valueMappings
|
|
423
428
|
popPageSetting.updateValueEvent = jumpPageSetting.updateValueEvent
|
|
429
|
+
popPageSetting.closeEvent = jumpPageSetting.closeEvent
|
|
424
430
|
}
|
|
425
431
|
// 是否是自定义系统
|
|
426
432
|
let isDsc = false
|
|
@@ -447,10 +453,28 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
|
|
|
447
453
|
|
|
448
454
|
function packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam) {
|
|
449
455
|
const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
|
|
450
|
-
|
|
456
|
+
let path = frontendUrl + '/#/dsc-full-screen/page?customSystem=' + system.code + '&pageCode=' + pageCode + '&jumpMode=' + jumpMode
|
|
457
|
+
const systemName = getSystemNameWithLanguage(system)
|
|
458
|
+
if (systemName) {
|
|
459
|
+
path += '&_systemName_=' + encodeURI(systemName)
|
|
460
|
+
}
|
|
451
461
|
return packagePathParams(dataId, path, jumpPageSetting, ids, buttonCode, isHasIdParam)
|
|
452
462
|
}
|
|
453
463
|
|
|
464
|
+
function getSystemNameWithLanguage(system) {
|
|
465
|
+
if (system) {
|
|
466
|
+
let locale = 'cn'
|
|
467
|
+
if (window.$locale) {
|
|
468
|
+
locale = window.$locale
|
|
469
|
+
}
|
|
470
|
+
if (locale === 'cn') {
|
|
471
|
+
return system.name
|
|
472
|
+
} else {
|
|
473
|
+
return system.enName
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
454
478
|
// 解析跳转页面附带参数
|
|
455
479
|
function analysisAdditionalParameter(paramStoreId) {
|
|
456
480
|
const additionalParamMap = sessionStorage.getItem(paramStoreId)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getLanguageWithLocale } from './util'
|
|
2
|
+
|
|
3
|
+
export function getI18nName(menu) {
|
|
4
|
+
if (!menu) {
|
|
5
|
+
return
|
|
6
|
+
}
|
|
7
|
+
if (menu.i18Names) {
|
|
8
|
+
const language = getLanguageWithLocale()
|
|
9
|
+
const i18Names = JSON.parse(menu.i18Names)
|
|
10
|
+
if (i18Names[language]) {
|
|
11
|
+
return i18Names[language]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (menu.i18nValue) {
|
|
15
|
+
return menu.i18nValue
|
|
16
|
+
} else {
|
|
17
|
+
return menu.name
|
|
18
|
+
}
|
|
19
|
+
}
|
package/src/utils/permission.js
CHANGED
|
@@ -2,24 +2,35 @@ import sessionStorage from 'sessionstorage'
|
|
|
2
2
|
import Vue from 'vue'
|
|
3
3
|
|
|
4
4
|
const permissionKey = 'PERMISSION-'
|
|
5
|
+
const permissionMenuKey = 'PERMISSION_MENU-'
|
|
5
6
|
export function getSystemCode() {
|
|
6
|
-
let systemCode
|
|
7
|
+
let systemCode
|
|
7
8
|
if (Vue.prototype.customSystem) {
|
|
8
9
|
systemCode = Vue.prototype.customSystem
|
|
10
|
+
} else {
|
|
11
|
+
systemCode = Vue.prototype.systemCode
|
|
9
12
|
}
|
|
13
|
+
// let systemCode = Vue.prototype.systemCode
|
|
14
|
+
// if (Vue.prototype.customSystem) {
|
|
15
|
+
// systemCode = Vue.prototype.customSystem
|
|
16
|
+
// }
|
|
10
17
|
return systemCode
|
|
11
18
|
}
|
|
12
19
|
|
|
13
20
|
export function getPermissions() {
|
|
21
|
+
const a = new Date().getTime()
|
|
14
22
|
const systemCode = getSystemCode()
|
|
15
23
|
const permissions = sessionStorage.getItem(permissionKey + systemCode)
|
|
16
24
|
if (permissions) {
|
|
17
25
|
return JSON.parse(permissions)
|
|
18
26
|
}
|
|
27
|
+
const b = new Date().getTime()
|
|
28
|
+
sessionStorage.setItem('====getPermissions===>'+new Date().getTime()+'-执行时间=',(b-a)+'')
|
|
19
29
|
return null
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
export function setPermissions(permissions) {
|
|
33
|
+
const a = new Date().getTime()
|
|
23
34
|
const systemCode = getSystemCode()
|
|
24
35
|
const permissionObjs = {}
|
|
25
36
|
for (let i = 0; i < permissions.length; i++) {
|
|
@@ -27,6 +38,8 @@ export function setPermissions(permissions) {
|
|
|
27
38
|
permissionObjs[permission] = true
|
|
28
39
|
}
|
|
29
40
|
sessionStorage.setItem(permissionKey + systemCode, JSON.stringify(permissionObjs))
|
|
41
|
+
const b = new Date().getTime()
|
|
42
|
+
sessionStorage.setItem('====setPermissions===>'+new Date().getTime()+'-执行时间=',(b-a)+'')
|
|
30
43
|
return permissionObjs
|
|
31
44
|
}
|
|
32
45
|
|
|
@@ -41,3 +54,37 @@ export function removePermissions() {
|
|
|
41
54
|
}
|
|
42
55
|
}
|
|
43
56
|
|
|
57
|
+
export function getMenus(systemCode) {
|
|
58
|
+
if (!systemCode) {
|
|
59
|
+
systemCode = getSystemCode()
|
|
60
|
+
}
|
|
61
|
+
const permissions = sessionStorage.getItem(permissionMenuKey + systemCode)
|
|
62
|
+
if (permissions) {
|
|
63
|
+
return JSON.parse(permissions)
|
|
64
|
+
}
|
|
65
|
+
return null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function setMenus(menus, systemCode) {
|
|
69
|
+
if (menus) {
|
|
70
|
+
if (!systemCode) {
|
|
71
|
+
systemCode = getSystemCode()
|
|
72
|
+
}
|
|
73
|
+
sessionStorage.setItem(permissionMenuKey + systemCode, JSON.stringify(menus))
|
|
74
|
+
return menus
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function removeMenus(systemCode) {
|
|
79
|
+
if (!systemCode) {
|
|
80
|
+
systemCode = getSystemCode()
|
|
81
|
+
}
|
|
82
|
+
sessionStorage.removeItem(permissionMenuKey + systemCode)
|
|
83
|
+
for (var i = 0; i < sessionStorage.length; i++) {
|
|
84
|
+
var key = sessionStorage.key(i)
|
|
85
|
+
if (key.indexOf(permissionMenuKey) >= 0) {
|
|
86
|
+
sessionStorage.removeItem(key)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
package/src/utils/request.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios'
|
|
2
2
|
import {
|
|
3
3
|
Message
|
|
4
|
-
} from '
|
|
4
|
+
} from 'element-ui'
|
|
5
5
|
import {
|
|
6
6
|
getToken,
|
|
7
7
|
removeToken
|
|
@@ -13,7 +13,8 @@ import {
|
|
|
13
13
|
getI18n
|
|
14
14
|
} from './util'
|
|
15
15
|
import {
|
|
16
|
-
getRelativeBaseUrl
|
|
16
|
+
getRelativeBaseUrl,
|
|
17
|
+
getTimeZone
|
|
17
18
|
} from './common-util'
|
|
18
19
|
// 创建axios实例
|
|
19
20
|
const service = axios.create({
|
|
@@ -27,6 +28,8 @@ service.interceptors.request.use(
|
|
|
27
28
|
config => {
|
|
28
29
|
// 防止重复发送ajax请求
|
|
29
30
|
store.commit('togglePreventReclick', true)
|
|
31
|
+
const timeZone = getTimeZone()
|
|
32
|
+
config.headers['timeZone'] = timeZone
|
|
30
33
|
const token = getToken()
|
|
31
34
|
if (token) {
|
|
32
35
|
config.headers['Authorization'] = token // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
@@ -112,6 +115,10 @@ service.interceptors.response.use(
|
|
|
112
115
|
}
|
|
113
116
|
console.log(message)
|
|
114
117
|
let errorMsg = getI18n().t('imatrixUIMessage.internalServerError')
|
|
118
|
+
if (message && message !== 'Internal Server Error') {
|
|
119
|
+
// 表示显示原始异常
|
|
120
|
+
errorMsg = message
|
|
121
|
+
}
|
|
115
122
|
if (message && (message === 'gateway.timeout' || message === 'gateway.callFailed')) {
|
|
116
123
|
// 网关的fallback返回的异常信息“接口调用超时”、“接口调用失败”
|
|
117
124
|
errorMsg = getI18n().t(message)
|
|
@@ -124,6 +131,15 @@ service.interceptors.response.use(
|
|
|
124
131
|
})
|
|
125
132
|
return Promise.reject(error)
|
|
126
133
|
}
|
|
134
|
+
} else {
|
|
135
|
+
const errorMsg = getI18n().t('imatrixUIMessage.internalServerError')
|
|
136
|
+
Message({
|
|
137
|
+
showClose: true,
|
|
138
|
+
message: errorMsg,
|
|
139
|
+
type: 'error',
|
|
140
|
+
duration: 5 * 1000
|
|
141
|
+
})
|
|
142
|
+
return Promise.reject(error)
|
|
127
143
|
}
|
|
128
144
|
}
|
|
129
145
|
)
|
package/src/utils/util.js
CHANGED
|
@@ -218,7 +218,7 @@ function parseCondition(entity, conditionList, isSql, tableName, additionalParam
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
conditions += conditionResult + ' '
|
|
221
|
-
if (
|
|
221
|
+
if (rightBracket && rightBracket !== null && rightBracket !== '') {
|
|
222
222
|
conditions = conditions + rightBracket
|
|
223
223
|
conditions = conditions + (' ')
|
|
224
224
|
// conditions.append(rightBracket).append(' ')
|
|
@@ -237,8 +237,12 @@ function parseCondition(entity, conditionList, isSql, tableName, additionalParam
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
console.log('parseCondition----conditions=', conditions)
|
|
240
|
-
|
|
241
|
-
|
|
240
|
+
if (conditions) {
|
|
241
|
+
// eslint-disable-next-line no-eval
|
|
242
|
+
return eval('(' + conditions + ')')
|
|
243
|
+
} else {
|
|
244
|
+
return true
|
|
245
|
+
}
|
|
242
246
|
}
|
|
243
247
|
const REPLACE_DOT = '__'
|
|
244
248
|
|
|
@@ -393,7 +397,7 @@ export function analysisValue(conditionValue, entity, additionalParameter, conte
|
|
|
393
397
|
}
|
|
394
398
|
|
|
395
399
|
/**
|
|
396
|
-
* 设置entity
|
|
400
|
+
* 设置entity中某属性的值,处理子对象的情况。使用该方法,性能可能有问题
|
|
397
401
|
* @param {*} entity
|
|
398
402
|
* @param {*} prop
|
|
399
403
|
* @param {*} value
|
|
@@ -403,10 +407,23 @@ export function setEntityFieldValue(entity, prop, value) {
|
|
|
403
407
|
if (prop && prop.indexOf('.') > 0) {
|
|
404
408
|
const parentObj = getParentObjectUtil(prop, entity)
|
|
405
409
|
if (parentObj) {
|
|
406
|
-
|
|
410
|
+
const subProp = prop.substring(prop.lastIndexOf('.') + 1)
|
|
411
|
+
if (parentObj[subProp] === undefined) {
|
|
412
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
413
|
+
Vue.set(parentObj, prop.substring(prop.lastIndexOf('.') + 1), value)
|
|
414
|
+
} else {
|
|
415
|
+
// 静态对象属性赋值,提高性能
|
|
416
|
+
parentObj[subProp] = value
|
|
417
|
+
}
|
|
407
418
|
}
|
|
408
419
|
} else {
|
|
409
|
-
|
|
420
|
+
if (entity[prop] === undefined) {
|
|
421
|
+
// 动态对象属性赋值,防止属性不存在,导致属性无法赋值问题
|
|
422
|
+
Vue.set(entity, prop, value)
|
|
423
|
+
} else {
|
|
424
|
+
// 静态对象属性赋值,提高性能
|
|
425
|
+
entity[prop] = value
|
|
426
|
+
}
|
|
410
427
|
}
|
|
411
428
|
}
|
|
412
429
|
}
|
package/src/views/404.vue
CHANGED
|
@@ -2,26 +2,30 @@
|
|
|
2
2
|
<div class="wscn-http404-container">
|
|
3
3
|
<div class="wscn-http404">
|
|
4
4
|
<div class="pic-404">
|
|
5
|
-
<img class="pic-404__parent" src="
|
|
6
|
-
<img class="pic-404__child left" src="
|
|
7
|
-
<img class="pic-404__child mid" src="
|
|
8
|
-
<img class="pic-404__child right" src="
|
|
5
|
+
<img class="pic-404__parent" src="../../assets/404/404.png" alt="404">
|
|
6
|
+
<img class="pic-404__child left" src="../../assets/404/404-cloud.png" alt="404">
|
|
7
|
+
<img class="pic-404__child mid" src="../../assets/404/404-cloud.png" alt="404">
|
|
8
|
+
<img class="pic-404__child right" src="../../assets/404/404-cloud.png" alt="404">
|
|
9
9
|
</div>
|
|
10
10
|
<div class="bullshit">
|
|
11
|
-
<div class="bullshit__oops">
|
|
11
|
+
<!-- <div class="bullshit__oops">
|
|
12
12
|
OOPS!
|
|
13
13
|
</div>
|
|
14
14
|
<div class="bullshit__info">
|
|
15
15
|
版权所有
|
|
16
|
-
<a class="link-type" href="https://wallstreetcn.com" target="_blank"
|
|
17
|
-
|
|
16
|
+
<a class="link-type" href="https://wallstreetcn.com" target="_blank">
|
|
17
|
+
华尔街见闻
|
|
18
|
+
</a>
|
|
19
|
+
</div> -->
|
|
18
20
|
<div class="bullshit__headline">
|
|
19
21
|
{{ message }}
|
|
20
22
|
</div>
|
|
21
23
|
<div class="bullshit__info">
|
|
22
|
-
|
|
24
|
+
请检查您输入的网址是否正确
|
|
23
25
|
</div>
|
|
24
|
-
<a href="" class="bullshit__return-home"
|
|
26
|
+
<!-- <a href="" class="bullshit__return-home">
|
|
27
|
+
返回首页
|
|
28
|
+
</a> -->
|
|
25
29
|
</div>
|
|
26
30
|
</div>
|
|
27
31
|
</div>
|
|
@@ -33,7 +37,7 @@ export default {
|
|
|
33
37
|
name: 'Page404',
|
|
34
38
|
computed: {
|
|
35
39
|
message() {
|
|
36
|
-
return '
|
|
40
|
+
return '页面不存在'
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -29,13 +29,13 @@ export default {
|
|
|
29
29
|
if (icon.indexOf('fa-') === 0) {
|
|
30
30
|
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
31
31
|
icon = 'fa ' + icon
|
|
32
|
-
vnodes.push(<div style='display: inline-block;'><i class={icon}/></div>)
|
|
32
|
+
vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon}/></div>)
|
|
33
33
|
} else if (icon.indexOf('svg-') === 0) {
|
|
34
34
|
icon = icon.substring(icon.indexOf('svg-') + 4)
|
|
35
|
-
vnodes.push(<div style='display: inline-block;'><svg-icon icon-class={icon}/></div>)
|
|
35
|
+
vnodes.push(<div style='display: inline-block;overflow:hidden;'><svg-icon icon-class={icon}/></div>)
|
|
36
36
|
} else {
|
|
37
37
|
icon += ' svg-icon'
|
|
38
|
-
vnodes.push(<div style='display: inline-block;'><i class={icon}/></div>)
|
|
38
|
+
vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon}/></div>)
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|