imatrix-ui 2.8.21-dw → 2.8.21
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/packages/breadcrumb/index.js +6 -0
- package/packages/breadcrumb/src/breadcrumb.vue +71 -0
- package/packages/department-tree/index.js +6 -0
- package/packages/department-tree/src/department-tree.vue +108 -0
- package/packages/department-tree-inline/index.js +6 -0
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +402 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +284 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +245 -0
- package/packages/department-tree-inline/src/search-result.vue +176 -0
- package/packages/department-user-tree/index.js +6 -0
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +116 -0
- package/packages/department-user-tree/src/department-user-single-tree.vue +76 -0
- package/packages/department-user-tree/src/department-user-tree.vue +101 -0
- package/packages/department-user-tree-inline/index.js +6 -0
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +626 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +269 -0
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +79 -0
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +230 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +122 -0
- package/packages/department-user-tree-inline/src/search-result.vue +197 -0
- package/packages/directives/prevent-reclick.js +19 -0
- package/packages/dynamic-source-select/index.js +6 -0
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +70 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +440 -0
- package/packages/dynamic-source-select/src/events.js +55 -0
- package/packages/fs-preview/index.js +6 -0
- package/packages/fs-preview/src/fs-preview.vue +226 -0
- package/packages/fs-upload/index.js +6 -0
- package/packages/fs-upload/src/fs-upload-multi.vue +420 -0
- package/packages/fs-upload/src/fs-upload-single.vue +312 -0
- package/packages/fs-upload/src/fs-upload.vue +189 -0
- package/packages/fs-upload/src/see-big-picture.vue +55 -0
- package/packages/fs-upload-list/index.js +6 -0
- package/packages/fs-upload-list/src/fs-upload-list.vue +287 -0
- package/packages/hamburger/index.js +6 -0
- package/packages/hamburger/src/hamburger.vue +38 -0
- package/packages/index.js +121 -0
- package/packages/multipart-upload/index.js +6 -0
- package/packages/multipart-upload/src/index.vue +73 -0
- package/packages/multipart-upload/src/multipart-upload-form.vue +297 -0
- package/packages/multipart-upload/src/multipart-upload-list.vue +378 -0
- package/packages/organization-input/index.js +6 -0
- package/packages/organization-input/src/organization-input.vue +542 -0
- package/packages/plugins/export-data-new.js +453 -0
- package/packages/plugins/export-data.js +361 -0
- package/packages/plugins/index.js +15 -0
- package/packages/plugins/public-method.js +43 -0
- package/packages/remove-department/index.js +6 -0
- package/packages/remove-department/src/remove-department.vue +172 -0
- package/packages/remove-department/src/remove-dept-service.js +20 -0
- package/packages/remove-user/index.js +6 -0
- package/packages/remove-user/src/remove-user-service.js +20 -0
- package/packages/remove-user/src/remove-user.vue +195 -0
- package/packages/remove-workgroup/index.js +6 -0
- package/packages/remove-workgroup/src/remove-workgroup-service.js +20 -0
- package/packages/remove-workgroup/src/remove-workgroup.vue +159 -0
- package/packages/rich-editor/index.js +7 -0
- package/packages/rich-editor/index.vue +278 -0
- package/packages/rich-editor/langs/zh-Hans.js +1 -0
- package/packages/rich-editor/viewer.vue +103 -0
- package/packages/scan-code-input/index.js +6 -0
- package/packages/scan-code-input/src/events.js +33 -0
- package/packages/scan-code-input/src/scan-code-input-colse.vue +131 -0
- package/packages/scan-code-input/src/scan-code-input.vue +116 -0
- package/packages/secret-info/index.js +7 -0
- package/packages/secret-info/index.vue +90 -0
- package/packages/super-grid/index.js +7 -0
- package/packages/super-grid/src/apis.js +763 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +250 -0
- package/packages/super-grid/src/dynamic-input.vue +1279 -0
- package/packages/super-grid/src/eventBus.js +2 -0
- package/packages/super-grid/src/events.js +55 -0
- package/packages/super-grid/src/formValidatorUtil.js +226 -0
- package/packages/super-grid/src/formatter.js +181 -0
- package/packages/super-grid/src/group-column.vue +100 -0
- package/packages/super-grid/src/header-context-menu.vue +87 -0
- package/packages/super-grid/src/index-column.vue +51 -0
- package/packages/super-grid/src/normal-column.vue +769 -0
- package/packages/super-grid/src/public-methods.js +31 -0
- package/packages/super-grid/src/row-operation.vue +161 -0
- package/packages/super-grid/src/search-button.vue +66 -0
- package/packages/super-grid/src/search-condition-input.vue +61 -0
- package/packages/super-grid/src/search-condition-list.vue +59 -0
- package/packages/super-grid/src/search-form-advancedQuery.vue +653 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +386 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +162 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +188 -0
- package/packages/super-grid/src/search-form.vue +634 -0
- package/packages/super-grid/src/search-methods.js +387 -0
- package/packages/super-grid/src/selection-column.vue +43 -0
- package/packages/super-grid/src/store.js +3 -0
- package/packages/super-grid/src/super-grid-service.js +561 -0
- package/packages/super-grid/src/super-grid.vue +2793 -0
- package/packages/super-grid/src/utils.js +763 -0
- package/packages/super-grid/src/view-image-dialog.vue +130 -0
- package/packages/super-nine-grid/index.js +7 -0
- package/packages/super-nine-grid/src/apis.js +103 -0
- package/packages/super-nine-grid/src/custom-formatter.js +66 -0
- package/packages/super-nine-grid/src/formatter.js +132 -0
- package/packages/super-nine-grid/src/search-form-number.vue +38 -0
- package/packages/super-nine-grid/src/search-form.vue +430 -0
- package/packages/super-nine-grid/src/search-methods.js +134 -0
- package/packages/super-nine-grid/src/store.js +3 -0
- package/packages/super-nine-grid/src/super-grid-service.js +91 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +872 -0
- package/packages/super-nine-grid/src/utils.js +261 -0
- package/packages/svg-icon/index.js +6 -0
- package/packages/svg-icon/src/svg-icon.vue +43 -0
- package/packages/utils/utils.js +152 -0
- package/packages/utils/value-set.js +86 -0
- package/packages/valid-code/index.js +7 -0
- package/packages/valid-code/src/valid-code.vue +95 -0
- package/packages/workflow-button/index.js +6 -0
- package/packages/workflow-button/src/workflow-button.vue +325 -0
- package/packages/workflow-history-list/index.js +6 -0
- package/packages/workflow-history-list/src/api.js +7 -0
- package/packages/workflow-history-list/src/workflow-history-list.vue +185 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +76 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +317 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +43 -0
- package/packages/workgroup-user-tree/index.js +6 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +100 -0
- package/packages/workgroup-user-tree-inline/index.js +6 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +163 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +436 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +4 -2
- package/src/i18n/langs/en.js +4 -2
- package/src/index.js +93 -0
- 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/styles/display-layout.scss +34 -0
- package/src/styles/index.scss +32 -4
- 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 +34 -42
- 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/request.js +18 -2
- package/src/utils/util.js +7 -3
- package/src/views/dsc-component/Sidebar/Item.vue +4 -4
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +36 -20
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +16 -1
- 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,69 +1,61 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Cookies from 'js-cookie'
|
|
3
|
-
import Vue from 'vue'
|
|
4
|
-
|
|
5
|
-
const jwtKey = 'JWT'
|
|
6
|
-
const currentUserNameKey = 'USERNAME'
|
|
7
|
-
const currentUserInfoKey = 'CURRENT_USER'
|
|
1
|
+
import authApi from './auth-api'
|
|
8
2
|
|
|
9
3
|
export function getToken() {
|
|
10
|
-
|
|
11
|
-
// console.log('auth-sessionStorage.getToken=', jwt)
|
|
12
|
-
if (!jwt) {
|
|
13
|
-
jwt = Cookies.get(jwtKey)
|
|
14
|
-
// console.log('auth-Cookies.getToken=', jwt)
|
|
15
|
-
}
|
|
16
|
-
return jwt
|
|
4
|
+
return authApi.getToken()
|
|
17
5
|
}
|
|
18
6
|
|
|
19
7
|
export function setToken(token) {
|
|
20
|
-
|
|
21
|
-
// 如果是开发模式,需要设置cookie。不设置expires,就是session cookie,表示关闭浏览器,cookie即失效
|
|
22
|
-
// console.log('auth-Cookies.setToken=', token)
|
|
23
|
-
// 必须是“/”否则无法移除token
|
|
24
|
-
Cookies.set(jwtKey, token, { path: '/' })
|
|
25
|
-
} else {
|
|
26
|
-
// console.log('auth-sessionStorage.setToken=', token)
|
|
27
|
-
return sessionStorage.setItem(jwtKey, token)
|
|
28
|
-
}
|
|
8
|
+
authApi.setToken(token)
|
|
29
9
|
}
|
|
30
10
|
|
|
31
11
|
export function removeToken() {
|
|
32
|
-
|
|
33
|
-
// console.log('auth-sessionStorage.removeToken=', getToken())
|
|
34
|
-
// 必须和setToken中的path“/”一致,否则无法移除token
|
|
35
|
-
Cookies.remove(jwtKey, { path: '/' })
|
|
36
|
-
// console.log('auth-Cookies.removeToken=', getToken())
|
|
12
|
+
authApi.removeToken()
|
|
37
13
|
}
|
|
38
14
|
|
|
39
15
|
export function getUsername() {
|
|
40
|
-
return
|
|
16
|
+
return authApi.getUsername()
|
|
41
17
|
}
|
|
42
18
|
|
|
43
19
|
export function setUsername(username) {
|
|
44
|
-
|
|
20
|
+
authApi.setUsername(username)
|
|
45
21
|
}
|
|
46
22
|
|
|
47
23
|
export function removeUsername() {
|
|
48
|
-
|
|
24
|
+
authApi.removeUsername()
|
|
49
25
|
}
|
|
50
26
|
|
|
51
27
|
export function getCurrentUser() {
|
|
52
|
-
|
|
53
|
-
if (userJson) {
|
|
54
|
-
return JSON.parse(userJson)
|
|
55
|
-
}
|
|
28
|
+
return authApi.getCurrentUser()
|
|
56
29
|
}
|
|
57
30
|
|
|
58
31
|
export function setCurrentUser(userInfo) {
|
|
59
|
-
|
|
60
|
-
if (userInfo.password) {
|
|
61
|
-
userInfo.password = null
|
|
62
|
-
}
|
|
63
|
-
sessionStorage.setItem(currentUserInfoKey, JSON.stringify(userInfo))
|
|
64
|
-
}
|
|
32
|
+
authApi.setCurrentUser(userInfo)
|
|
65
33
|
}
|
|
66
34
|
|
|
67
35
|
export function removeCurrentUser() {
|
|
68
|
-
|
|
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)
|
|
69
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
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
|
|
|
@@ -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
|
|
|
@@ -52,7 +52,7 @@ export default {
|
|
|
52
52
|
</div>)
|
|
53
53
|
} else {
|
|
54
54
|
// 有子菜单时
|
|
55
|
-
vnodes.push(<div slot
|
|
55
|
+
vnodes.push(<div v-slot:title style='display: inline-block'>
|
|
56
56
|
<div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
57
57
|
</div>)
|
|
58
58
|
}
|
|
@@ -6,9 +6,12 @@
|
|
|
6
6
|
<slot />
|
|
7
7
|
</a> -->
|
|
8
8
|
|
|
9
|
-
<router-link :to="to">
|
|
9
|
+
<router-link v-if="!isOpenNewTab" :to="to">
|
|
10
10
|
<slot />
|
|
11
11
|
</router-link>
|
|
12
|
+
<div v-else>
|
|
13
|
+
<slot />
|
|
14
|
+
</div>
|
|
12
15
|
</div>
|
|
13
16
|
</template>
|
|
14
17
|
|
|
@@ -23,8 +26,14 @@ export default {
|
|
|
23
26
|
},
|
|
24
27
|
data() {
|
|
25
28
|
const isExter = this.to.isExternal
|
|
29
|
+
const openWay = this.to.openWay
|
|
30
|
+
let isOpenNewTab = false
|
|
31
|
+
if (openWay && openWay === 'NEW_PAGE_OPEN') {
|
|
32
|
+
isOpenNewTab = true
|
|
33
|
+
}
|
|
26
34
|
return {
|
|
27
|
-
isExter
|
|
35
|
+
isExter,
|
|
36
|
+
isOpenNewTab
|
|
28
37
|
}
|
|
29
38
|
}
|
|
30
39
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
<template v-if="!item.children || item.children.lenght === 0">
|
|
4
4
|
<app-link :to="toPath(item)" @click.native="clickMenu(toPath(item))">
|
|
5
5
|
<el-menu-item :index="resolvePath(item.code,item.path,item.pageType)" :class="{'submenu-title-noDropdown':!isNest}">
|
|
6
|
-
<item :icon="item.iconName" :title="item
|
|
6
|
+
<item :icon="item.iconName" :title="getI18nName(item)" :is-root="true" />
|
|
7
7
|
</el-menu-item>
|
|
8
8
|
</app-link>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<el-submenu v-else :index="resolvePath(item.code,item.path,item.pageType)" :show-timeout="0" :hide-timeout="50" popper-class="sidebar-container-popper">
|
|
12
|
-
<template slot
|
|
13
|
-
<item :icon="item.iconName" :title="item
|
|
12
|
+
<template v-slot:title>
|
|
13
|
+
<item :icon="item.iconName" :title="getI18nName(item)" :has-children="item.children.length > 0?true:false" />
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<template v-for="child in item.children">
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/>
|
|
24
24
|
<app-link v-else :key="child.code" :to="toPath(child)" @click.native="clickMenu(toPath(child))">
|
|
25
25
|
<el-menu-item :index="resolvePath(child.code,child.path,child.pageType)">
|
|
26
|
-
<item :icon="child.iconName" :title="child
|
|
26
|
+
<item :icon="child.iconName" :title="getI18nName(child)" />
|
|
27
27
|
</el-menu-item>
|
|
28
28
|
</app-link>
|
|
29
29
|
</template>
|
|
@@ -37,6 +37,8 @@ import Item from './Item'
|
|
|
37
37
|
import AppLink from './Link'
|
|
38
38
|
import Vue from 'vue'
|
|
39
39
|
import tabJs from '../../../api/tab'
|
|
40
|
+
import { getI18nName } from '../../../utils/menu'
|
|
41
|
+
// import { SidebarItemChild } from './SidebarItemChild.vue'
|
|
40
42
|
export default {
|
|
41
43
|
name: 'SidebarItem',
|
|
42
44
|
components: { Item, AppLink },
|
|
@@ -90,23 +92,17 @@ export default {
|
|
|
90
92
|
toPath(menu) {
|
|
91
93
|
const toPathObj = {}
|
|
92
94
|
const routePath = menu.path
|
|
95
|
+
toPathObj.openWay = menu.openWay
|
|
93
96
|
if (this.isExternalLink(menu.pageType)) {
|
|
94
97
|
toPathObj.path = '/dsc-index/iframe-page'
|
|
95
98
|
toPathObj.tabPath = '/dsc/iframe-page'
|
|
96
99
|
toPathObj.query = {}
|
|
97
100
|
toPathObj.query.src = routePath
|
|
98
101
|
toPathObj.isExternal = true
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
102
|
-
}
|
|
103
|
-
|
|
102
|
+
// 如果路径中没有拼系统编码,才需要把系统编码放到参数中
|
|
103
|
+
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
104
104
|
toPathObj.query._menuCode = menu.code
|
|
105
|
-
|
|
106
|
-
toPathObj.query._menuName = menu.i18nValue
|
|
107
|
-
} else {
|
|
108
|
-
toPathObj.query._menuName = menu.name
|
|
109
|
-
}
|
|
105
|
+
toPathObj.query._menuName = getI18nName(menu)
|
|
110
106
|
} else {
|
|
111
107
|
const pageCode = routePath
|
|
112
108
|
toPathObj.path = '/dsc-index/page'
|
|
@@ -115,11 +111,7 @@ export default {
|
|
|
115
111
|
toPathObj.query.pageCode = pageCode
|
|
116
112
|
toPathObj.query.customSystem = Vue.prototype.customSystem
|
|
117
113
|
toPathObj.query._menuCode = menu.code
|
|
118
|
-
|
|
119
|
-
toPathObj.query._menuName = menu.i18nValue
|
|
120
|
-
} else {
|
|
121
|
-
toPathObj.query._menuName = menu.name
|
|
122
|
-
}
|
|
114
|
+
toPathObj.query._menuName = getI18nName(menu)
|
|
123
115
|
}
|
|
124
116
|
return toPathObj
|
|
125
117
|
},
|
|
@@ -140,13 +132,37 @@ export default {
|
|
|
140
132
|
},
|
|
141
133
|
clickMenu(toPathObj) {
|
|
142
134
|
// console.log('clickMenu----toPathObj=', toPathObj)
|
|
143
|
-
|
|
135
|
+
if (toPathObj.openWay && toPathObj.openWay === 'NEW_PAGE_OPEN' && toPathObj.query) {
|
|
136
|
+
// 新页签打开菜单
|
|
137
|
+
let url = toPathObj.query.src
|
|
138
|
+
if (url && url.indexOf('?') > 0) {
|
|
139
|
+
url += '&'
|
|
140
|
+
} else {
|
|
141
|
+
url += '?'
|
|
142
|
+
}
|
|
143
|
+
if (toPathObj.query.customSystem) {
|
|
144
|
+
url += 'customSystem=' + toPathObj.query.customSystem
|
|
145
|
+
}
|
|
146
|
+
if (toPathObj.query._menuCode) {
|
|
147
|
+
url += '_menuCode=' + toPathObj.query._menuCode
|
|
148
|
+
}
|
|
149
|
+
if (toPathObj.query._menuCode) {
|
|
150
|
+
url += '_menuName=' + toPathObj.query._menuName
|
|
151
|
+
}
|
|
152
|
+
window.open(url, toPathObj.query._menuCode)
|
|
153
|
+
} else {
|
|
154
|
+
// 刷新页签打开菜单
|
|
155
|
+
this.addTabs(toPathObj.query, this.$store.state.tabContent.openTab, toPathObj.tabPath)
|
|
156
|
+
}
|
|
144
157
|
},
|
|
145
158
|
isExternalLink(pageType) {
|
|
146
159
|
if (pageType && pageType === 'iframe') {
|
|
147
160
|
return true
|
|
148
161
|
}
|
|
149
162
|
return false
|
|
163
|
+
},
|
|
164
|
+
getI18nName(menu) {
|
|
165
|
+
return getI18nName(menu)
|
|
150
166
|
}
|
|
151
167
|
}
|
|
152
168
|
}
|