imatrix-ui 2.8.39-dw → 2.8.39-pvtmp
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 +6 -4
- 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 +411 -0
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +293 -0
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -0
- package/packages/department-tree-inline/src/department-tree-service.js +275 -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 +639 -0
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +274 -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 +248 -0
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +142 -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 +75 -0
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +586 -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 +468 -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 +825 -0
- package/packages/super-grid/src/columns-config.vue +335 -0
- package/packages/super-grid/src/custom-formatter.js +280 -0
- package/packages/super-grid/src/dynamic-input.vue +1286 -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 +775 -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 +654 -0
- package/packages/super-grid/src/search-form-dialog.vue +79 -0
- package/packages/super-grid/src/search-form-item.vue +405 -0
- package/packages/super-grid/src/search-form-number.vue +38 -0
- package/packages/super-grid/src/search-form-open.vue +170 -0
- package/packages/super-grid/src/search-form-ordinarySearch.vue +196 -0
- package/packages/super-grid/src/search-form.vue +642 -0
- package/packages/super-grid/src/search-methods.js +448 -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 +595 -0
- package/packages/super-grid/src/super-grid.vue +2936 -0
- package/packages/super-grid/src/utils.js +782 -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 +131 -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 +93 -0
- package/packages/super-nine-grid/src/super-nine-grid.vue +883 -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/memory-cache-utils.js +90 -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 +197 -0
- package/packages/workgroup-tree/index.js +6 -0
- package/packages/workgroup-tree/src/workgroup-tree.vue +77 -0
- package/packages/workgroup-tree-inline/index.js +6 -0
- package/packages/workgroup-tree-inline/src/search-result.vue +168 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +458 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +71 -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/search-result.vue +197 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +192 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +584 -0
- package/packages/year-range-picker/index.js +6 -0
- package/packages/year-range-picker/src/year-range-picker.vue +51 -0
- package/src/api/sso-service.js +9 -1
- package/src/api/tab.js +3 -3
- package/src/i18n/i18n.js +1 -1
- package/src/i18n/langs/cn.js +15 -5
- package/src/i18n/langs/en.js +15 -5
- package/src/index.js +93 -0
- package/src/permission.js +51 -17
- package/src/plugins.js +3 -3
- package/src/store/getters.js +2 -1
- package/src/store/modules/app.js +10 -1
- package/src/store/modules/user.js +11 -18
- 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/input-style.scss +8 -0
- package/src/styles/theme/gray/sidebar.scss +14 -2
- package/src/utils/auth-api.js +171 -0
- package/src/utils/auth.js +75 -41
- package/src/utils/calculator/calculator-factory.js +2 -2
- package/src/utils/calculator/calculator-util.js +7 -7
- package/src/utils/common-util.js +134 -1
- package/src/utils/jump-page-utils.js +36 -10
- package/src/utils/menu.js +19 -0
- package/src/utils/permission.js +4 -0
- package/src/utils/permissionAuth.js +46 -25
- package/src/utils/request.js +65 -8
- package/src/utils/util.js +77 -29
- package/src/views/dsc-component/Sidebar/Item.vue +5 -5
- package/src/views/dsc-component/Sidebar/Link.vue +11 -2
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +37 -21
- package/src/views/dsc-component/Sidebar/index.vue +24 -12
- package/src/views/dsc-component/tabs/tab-content.vue +18 -2
- package/src/views/layout/components/Breadcrumb/index.vue +1 -1
- package/src/views/login/index.vue +1 -1
|
@@ -79,8 +79,11 @@
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
.el-menu {
|
|
82
|
+
position: static;
|
|
82
83
|
border: none;
|
|
83
|
-
height: 100%;
|
|
84
|
+
// height: 100%;
|
|
85
|
+
height: auto;
|
|
86
|
+
max-height: 100vh;
|
|
84
87
|
width: 100% !important;
|
|
85
88
|
background-color: #FFF;
|
|
86
89
|
color: #000D1F
|
|
@@ -188,13 +191,22 @@
|
|
|
188
191
|
}
|
|
189
192
|
}
|
|
190
193
|
|
|
194
|
+
.sidebar-container-popper .el-menu{
|
|
195
|
+
// height: 100vh;
|
|
196
|
+
height: auto;
|
|
197
|
+
max-height: 100vh;
|
|
198
|
+
overflow-y: auto;
|
|
199
|
+
overflow-x: hidden;
|
|
200
|
+
scroll-behavior: smooth;
|
|
201
|
+
}
|
|
202
|
+
|
|
191
203
|
.sidebar-container-popper .el-submenu__title:not(.is-disabled):hover {
|
|
192
204
|
background: #F7F7F8;
|
|
193
205
|
color: rgba(0, 13, 31, 0.85);
|
|
194
206
|
font-weight: 500;
|
|
195
207
|
}
|
|
196
208
|
|
|
197
|
-
.sidebar-container-popper .el-menu .el-submenu.is-active>.el-submenu__title {
|
|
209
|
+
.sidebar-container-popper .el-menu-item.is-active,.sidebar-container-popper .el-menu .el-submenu.is-active>.el-submenu__title {
|
|
198
210
|
background-color: #EBECFF !important;
|
|
199
211
|
color: #3D4CF2;
|
|
200
212
|
font-weight: 500;
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
const versionEnv = 'VERSION_ENVIRONMENT'
|
|
8
|
+
const userVersion = 'CURRENT_USER_SYSTEM_VERSION'
|
|
9
|
+
const langKey = 'CURRENT_LANGUAGE'
|
|
10
|
+
const allLangKey = 'AMB_LANG_INFO'
|
|
11
|
+
|
|
12
|
+
function getToken() {
|
|
13
|
+
let token = getCookieCache(jwtKey)
|
|
14
|
+
const projectModel = Vue.prototype.projectModel
|
|
15
|
+
if (!token && projectModel && projectModel === 'developing.model') {
|
|
16
|
+
// 如果是开发环境从sessionStorage中获得token
|
|
17
|
+
token = getSessionCache(jwtKey)
|
|
18
|
+
}
|
|
19
|
+
return token
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function setToken(token) {
|
|
23
|
+
setCookieCache(jwtKey, token)
|
|
24
|
+
setSessionCache(jwtKey, token)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function removeToken() {
|
|
28
|
+
removeCookieCache(jwtKey)
|
|
29
|
+
removeSessionCache(jwtKey)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getUsername() {
|
|
33
|
+
let username = getCookieCache(currentUserNameKey)
|
|
34
|
+
if (!username) {
|
|
35
|
+
username = getSessionCache(currentUserNameKey)
|
|
36
|
+
}
|
|
37
|
+
return username
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function setUsername(username) {
|
|
41
|
+
setSessionCache(currentUserNameKey, username)
|
|
42
|
+
setCookieCache(currentUserNameKey, username)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function removeUsername() {
|
|
46
|
+
removeSessionCache(currentUserNameKey)
|
|
47
|
+
removeCookieCache(currentUserNameKey)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getCurrentUser() {
|
|
51
|
+
let userJson = getCookieCache(currentUserInfoKey)
|
|
52
|
+
if (!userJson) {
|
|
53
|
+
userJson = getSessionCache(currentUserInfoKey)
|
|
54
|
+
}
|
|
55
|
+
if (userJson) {
|
|
56
|
+
return JSON.parse(userJson)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function setCurrentUser(userInfo) {
|
|
61
|
+
if (userInfo) {
|
|
62
|
+
if (userInfo.password) {
|
|
63
|
+
userInfo.password = null
|
|
64
|
+
}
|
|
65
|
+
const userinfoStr = JSON.stringify(userInfo)
|
|
66
|
+
setSessionCache(currentUserInfoKey, userinfoStr)
|
|
67
|
+
setCookieCache(currentUserInfoKey, userinfoStr)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function removeCurrentUser() {
|
|
72
|
+
removeSessionCache(currentUserInfoKey)
|
|
73
|
+
removeCookieCache(currentUserInfoKey)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function getCookieCache(key) {
|
|
77
|
+
return Cookies.get(key)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function setCookieCache(key, value) {
|
|
81
|
+
Cookies.set(key, value, {
|
|
82
|
+
path: '/'
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function removeCookieCache(key) {
|
|
87
|
+
Cookies.remove(key, {
|
|
88
|
+
path: '/'
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function getSessionCache(key) {
|
|
93
|
+
return sessionStorage.getItem(key)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function setSessionCache(key, value) {
|
|
97
|
+
return sessionStorage.setItem(key, value)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function removeSessionCache(key) {
|
|
101
|
+
sessionStorage.removeItem(key)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function removePublishControl() {
|
|
105
|
+
removeCookieCache(versionEnv)
|
|
106
|
+
removeCookieCache(userVersion)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function getLanguage() {
|
|
110
|
+
let language = getCookieCache(langKey)
|
|
111
|
+
const projectModel = Vue.prototype.projectModel
|
|
112
|
+
if (!language && projectModel && projectModel === 'developing.model') {
|
|
113
|
+
// 如果是开发环境从sessionStorage中获得token
|
|
114
|
+
language = getSessionCache(langKey)
|
|
115
|
+
}
|
|
116
|
+
return language
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function setLanguage(lang) {
|
|
120
|
+
setCookieCache(langKey, lang)
|
|
121
|
+
setSessionCache(langKey, lang)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function removeLanguage() {
|
|
125
|
+
removeCookieCache(langKey)
|
|
126
|
+
removeSessionCache(langKey)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getAllLanguages() {
|
|
130
|
+
let allLanguages = getCookieCache(allLangKey)
|
|
131
|
+
const projectModel = Vue.prototype.projectModel
|
|
132
|
+
if (!allLanguages && projectModel && projectModel === 'developing.model') {
|
|
133
|
+
// 如果是开发环境从sessionStorage中获得token
|
|
134
|
+
allLanguages = getSessionCache(allLangKey)
|
|
135
|
+
}
|
|
136
|
+
return allLanguages
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function setAllLanguages(langs) {
|
|
140
|
+
setCookieCache(allLangKey, langs)
|
|
141
|
+
setSessionCache(allLangKey, langs)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function removeAllLanguages() {
|
|
145
|
+
removeCookieCache(allLangKey)
|
|
146
|
+
removeSessionCache(allLangKey)
|
|
147
|
+
}
|
|
148
|
+
export default {
|
|
149
|
+
getToken,
|
|
150
|
+
setToken,
|
|
151
|
+
removeToken,
|
|
152
|
+
getUsername,
|
|
153
|
+
setUsername,
|
|
154
|
+
removeUsername,
|
|
155
|
+
getCurrentUser,
|
|
156
|
+
setCurrentUser,
|
|
157
|
+
removeCurrentUser,
|
|
158
|
+
getCookieCache,
|
|
159
|
+
setCookieCache,
|
|
160
|
+
removeCookieCache,
|
|
161
|
+
getSessionCache,
|
|
162
|
+
setSessionCache,
|
|
163
|
+
removeSessionCache,
|
|
164
|
+
removePublishControl,
|
|
165
|
+
getLanguage,
|
|
166
|
+
setLanguage,
|
|
167
|
+
removeLanguage,
|
|
168
|
+
getAllLanguages,
|
|
169
|
+
setAllLanguages,
|
|
170
|
+
removeAllLanguages
|
|
171
|
+
}
|
package/src/utils/auth.js
CHANGED
|
@@ -1,69 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Cookies from 'js-cookie'
|
|
3
|
-
import Vue from 'vue'
|
|
1
|
+
import authApi from './auth-api'
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
const currentUserNameKey = 'USERNAME'
|
|
7
|
-
const currentUserInfoKey = 'CURRENT_USER'
|
|
3
|
+
import { removeAllSystemPermissions } from './permissionAuth'
|
|
8
4
|
|
|
9
5
|
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
|
|
6
|
+
return authApi.getToken()
|
|
17
7
|
}
|
|
18
8
|
|
|
19
9
|
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
|
-
}
|
|
10
|
+
authApi.setToken(token)
|
|
29
11
|
}
|
|
30
12
|
|
|
31
13
|
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())
|
|
14
|
+
authApi.removeToken()
|
|
37
15
|
}
|
|
38
16
|
|
|
39
17
|
export function getUsername() {
|
|
40
|
-
return
|
|
18
|
+
return authApi.getUsername()
|
|
41
19
|
}
|
|
42
20
|
|
|
43
21
|
export function setUsername(username) {
|
|
44
|
-
|
|
22
|
+
authApi.setUsername(username)
|
|
45
23
|
}
|
|
46
24
|
|
|
47
25
|
export function removeUsername() {
|
|
48
|
-
|
|
26
|
+
authApi.removeUsername()
|
|
49
27
|
}
|
|
50
28
|
|
|
51
29
|
export function getCurrentUser() {
|
|
52
|
-
|
|
53
|
-
if (userJson) {
|
|
54
|
-
return JSON.parse(userJson)
|
|
55
|
-
}
|
|
30
|
+
return authApi.getCurrentUser()
|
|
56
31
|
}
|
|
57
32
|
|
|
58
33
|
export function setCurrentUser(userInfo) {
|
|
59
|
-
|
|
60
|
-
if (userInfo.password) {
|
|
61
|
-
userInfo.password = null
|
|
62
|
-
}
|
|
63
|
-
sessionStorage.setItem(currentUserInfoKey, JSON.stringify(userInfo))
|
|
64
|
-
}
|
|
34
|
+
authApi.setCurrentUser(userInfo)
|
|
65
35
|
}
|
|
66
36
|
|
|
67
37
|
export function removeCurrentUser() {
|
|
68
|
-
|
|
38
|
+
authApi.removeCurrentUser()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getCookieCache(key) {
|
|
42
|
+
return authApi.getCookieCache(key)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function setCookieCache(key, value) {
|
|
46
|
+
authApi.setCookieCache(key, value)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function removeCookieCache(key) {
|
|
50
|
+
authApi.removeCookieCache(key)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function getSessionCache(key) {
|
|
54
|
+
return authApi.getSessionCache(key)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function setSessionCache(key, value) {
|
|
58
|
+
return authApi.setSessionCache(key, value)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function removeSessionCache(key) {
|
|
62
|
+
authApi.removeSessionCache(key)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function removePublishControl() {
|
|
66
|
+
authApi.removePublishControl()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function getLanguage() {
|
|
70
|
+
return authApi.getLanguage()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function setLanguage(language) {
|
|
74
|
+
authApi.setLanguage(language)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function removeLanguage() {
|
|
78
|
+
authApi.removeLanguage()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function getAllLanguages() {
|
|
82
|
+
return authApi.getAllLanguages()
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function setAllLanguages(langs) {
|
|
86
|
+
authApi.setAllLanguages(langs)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function removeAllLanguages() {
|
|
90
|
+
authApi.removeAllLanguages()
|
|
91
|
+
}
|
|
92
|
+
// 清空token时需要清除的缓存信息
|
|
93
|
+
export function clearPermission() {
|
|
94
|
+
removeToken()
|
|
95
|
+
removeLanguage()
|
|
96
|
+
removeAllLanguages()
|
|
97
|
+
|
|
98
|
+
removeUsername()
|
|
99
|
+
removeCurrentUser()
|
|
100
|
+
|
|
101
|
+
removeAllSystemPermissions()
|
|
102
|
+
removePublishControl()
|
|
69
103
|
}
|
|
@@ -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') {
|
|
@@ -31,10 +31,10 @@ export function parseSubTablePermissionCondition(express, dataTypeMap, parentEnt
|
|
|
31
31
|
const OR = '||'
|
|
32
32
|
let temp = express
|
|
33
33
|
const strs = splitExpression(express)
|
|
34
|
-
console.log('分割后的原子表达式为:', strs)
|
|
34
|
+
// console.log('分割后的原子表达式为:', strs)
|
|
35
35
|
let result = false
|
|
36
36
|
for (let i = 0; i < strs.length; i++) {
|
|
37
|
-
console.log('开始分析原子表达式:', strs[i])
|
|
37
|
+
// console.log('开始分析原子表达式:', strs[i])
|
|
38
38
|
const atomicExpress = strs[i]
|
|
39
39
|
if (atomicExpress && atomicExpress.trim()) {
|
|
40
40
|
const name = atomicExpress.substring(atomicExpress.indexOf(SQUARE_BRACKETS_LEFT) + SQUARE_BRACKETS_LEFT.length, atomicExpress.indexOf(SQUARE_BRACKETS_RIGHT))
|
|
@@ -44,9 +44,9 @@ export function parseSubTablePermissionCondition(express, dataTypeMap, parentEnt
|
|
|
44
44
|
dataType = dataTypeMap[name]
|
|
45
45
|
}
|
|
46
46
|
result = parseFieldCondition(atomicExpress, dataType, parentEntity, subEntity, additionalParamMap, task, contextParameterMap)
|
|
47
|
-
console.log('原子表达式:', atomicExpress, '的分析结果为 ', result)
|
|
47
|
+
// console.log('原子表达式:', atomicExpress, '的分析结果为 ', result)
|
|
48
48
|
temp = temp.replace(atomicExpress.trim(), result + '')
|
|
49
|
-
console.log('将原子表达式替换为它的结果后:', temp)
|
|
49
|
+
// console.log('将原子表达式替换为它的结果后:', temp)
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
temp = temp.replace(/condition.operator.and/g, AND)
|
|
@@ -57,7 +57,7 @@ export function parseSubTablePermissionCondition(express, dataTypeMap, parentEnt
|
|
|
57
57
|
if (temp.trim().endsWith(AND)) {
|
|
58
58
|
temp = temp.substring(0, temp.lastIndexOf(AND))
|
|
59
59
|
}
|
|
60
|
-
console.log('最终该流向的表达式为:', temp)
|
|
60
|
+
// console.log('最终该流向的表达式为:', temp)
|
|
61
61
|
// eslint-disable-next-line no-eval
|
|
62
62
|
return eval('(' + temp + ')')
|
|
63
63
|
}
|
|
@@ -97,12 +97,12 @@ function parseFieldCondition(atomicExpress, dataType, parentEntity, subEntity, a
|
|
|
97
97
|
return false
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
console.log('对应值为:', value)
|
|
100
|
+
// console.log('对应值为:', value)
|
|
101
101
|
const CalculatorWf = getAbstractUserFactoryWf(dataType)
|
|
102
102
|
const subExpression = atomicExpress.replace(fieldInfo, value)
|
|
103
103
|
const calculatorObj = new CalculatorWf(subExpression)
|
|
104
104
|
const result = calculatorObj.result
|
|
105
|
-
console.log('判断结果为:', result)
|
|
105
|
+
// console.log('判断结果为:', result)
|
|
106
106
|
return result
|
|
107
107
|
}
|
|
108
108
|
|
package/src/utils/common-util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import sessionStorage from 'sessionstorage'
|
|
2
2
|
import Vue from 'vue'
|
|
3
|
+
import { getToken, getLanguage, getAllLanguages, setAllLanguages } from './auth'
|
|
3
4
|
/**
|
|
4
5
|
* 获得相对地址
|
|
5
6
|
*/
|
|
@@ -169,7 +170,7 @@ export function isPlateSys(systemCode) {
|
|
|
169
170
|
systemCode === 'mms' || systemCode === 'task' ||
|
|
170
171
|
systemCode === 'wf' || systemCode === 'dc' ||
|
|
171
172
|
systemCode === 'mc' || systemCode === 'mobile' ||
|
|
172
|
-
systemCode === 'acs' || systemCode === 'bs')) {
|
|
173
|
+
systemCode === 'acs' || systemCode === 'bs' || systemCode === 'pcm')) {
|
|
173
174
|
return true
|
|
174
175
|
} else {
|
|
175
176
|
return false
|
|
@@ -202,3 +203,135 @@ export function getOrignUrl() {
|
|
|
202
203
|
}
|
|
203
204
|
return orignUrl
|
|
204
205
|
}
|
|
206
|
+
|
|
207
|
+
export function isPromise(p) {
|
|
208
|
+
return p && Object.prototype.toString.call(p) === '[object Promise]'
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* 获得UTC时区
|
|
212
|
+
* @returns 时区
|
|
213
|
+
*/
|
|
214
|
+
export function getTimeZone() {
|
|
215
|
+
const dateStr = new Date() + ''
|
|
216
|
+
let timeZone = ''
|
|
217
|
+
if (dateStr.indexOf('GMT') > 0) {
|
|
218
|
+
const timeZoneSuffix = dateStr.substring(dateStr.indexOf('GMT') + 3, dateStr.indexOf('(')).trim()
|
|
219
|
+
const partPrefix = timeZoneSuffix.substring(0, timeZoneSuffix.length - 2)
|
|
220
|
+
const partSuffix = timeZoneSuffix.substring(timeZoneSuffix.length - 2)
|
|
221
|
+
timeZone = 'UTC' + partPrefix + ':' + partSuffix
|
|
222
|
+
} else if (dateStr.indexOf('UTC') > 0) {
|
|
223
|
+
timeZone = 'UTC' + dateStr.substring(dateStr.indexOf('UTC') + 3, dateStr.indexOf('(')).trim()
|
|
224
|
+
}
|
|
225
|
+
return timeZone
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function isMobileBrowser() {
|
|
229
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Opera Mobi|Windows CE|Symbian|Windows Phone|POLARIS|lgtelecom|nokia|SonyEricsson|LG|SAMSUNG|Samsung/i
|
|
230
|
+
.test(navigator.userAgent)) {
|
|
231
|
+
// 移动端浏览器
|
|
232
|
+
return true
|
|
233
|
+
} else {
|
|
234
|
+
// PC浏览器
|
|
235
|
+
return false
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export function getLocaleByLang(lang) {
|
|
240
|
+
let locale = 'cn'
|
|
241
|
+
if (lang && lang.indexOf('_') > 0) {
|
|
242
|
+
const language = lang.substring(0, lang.indexOf('_'))
|
|
243
|
+
locale = language
|
|
244
|
+
}
|
|
245
|
+
if (locale === 'zh') {
|
|
246
|
+
locale = 'cn'
|
|
247
|
+
}
|
|
248
|
+
return locale
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export function cacheLangs(langs) {
|
|
252
|
+
let langResult
|
|
253
|
+
if (langs) {
|
|
254
|
+
langResult = JSON.stringify(langs)
|
|
255
|
+
}
|
|
256
|
+
return setAllLanguages(langResult)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function getLangs() {
|
|
260
|
+
return getAllLanguages()
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* @param {*} langShort 例如:cn或en
|
|
265
|
+
* @returns 例如:zh_CN或en_US
|
|
266
|
+
*/
|
|
267
|
+
export function getLangByShort(langShort) {
|
|
268
|
+
let lang
|
|
269
|
+
const langResultJson = getLangs()
|
|
270
|
+
if (langResultJson) {
|
|
271
|
+
const langObj = JSON.parse(langResultJson)
|
|
272
|
+
lang = langObj[langShort]
|
|
273
|
+
}
|
|
274
|
+
if (!lang) {
|
|
275
|
+
lang = 'zh_CN'
|
|
276
|
+
}
|
|
277
|
+
return lang
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// 首次加载业务系统时,缓存所有语言
|
|
281
|
+
export function cacheAllLanguagesUtil(http) {
|
|
282
|
+
return new Promise((resolve, reject) => {
|
|
283
|
+
const token = getToken()
|
|
284
|
+
if (token) {
|
|
285
|
+
const cookieCacheLangs = getLangs()
|
|
286
|
+
if (cookieCacheLangs) {
|
|
287
|
+
setAllLanguages(cookieCacheLangs)
|
|
288
|
+
resolve()
|
|
289
|
+
} else {
|
|
290
|
+
http.get(Vue.prototype.baseAPI + '/component/all-languages').then((langList) => {
|
|
291
|
+
const langResult = {}
|
|
292
|
+
if (langList) {
|
|
293
|
+
langList.forEach(item => {
|
|
294
|
+
// 例如:zh_CN、en_US
|
|
295
|
+
const lang = item.value
|
|
296
|
+
let langShort
|
|
297
|
+
if (lang.indexOf('_') > 0) {
|
|
298
|
+
langShort = lang.substring(0, lang.indexOf('_'))
|
|
299
|
+
}
|
|
300
|
+
if (langShort && langShort === 'zh') {
|
|
301
|
+
// 中文处理,为了兼容历史逻辑
|
|
302
|
+
langShort = 'cn'
|
|
303
|
+
}
|
|
304
|
+
if (langShort) {
|
|
305
|
+
langResult[langShort] = lang
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}
|
|
309
|
+
cacheLangs(langResult)
|
|
310
|
+
resolve()
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
resolve()
|
|
315
|
+
}
|
|
316
|
+
})
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// 首次加载业务系统时,缓存当前用户语言
|
|
320
|
+
export function cacheCurrentLanguageUtil(http) {
|
|
321
|
+
return new Promise((resolve, reject) => {
|
|
322
|
+
const token = getToken()
|
|
323
|
+
if (token) {
|
|
324
|
+
const currentLanguage = getLanguage()
|
|
325
|
+
if (currentLanguage) {
|
|
326
|
+
resolve(currentLanguage)
|
|
327
|
+
} else {
|
|
328
|
+
http.get(Vue.prototype.baseAPI + '/acs/user-languages').then((currentLanguage) => {
|
|
329
|
+
resolve(currentLanguage)
|
|
330
|
+
})
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
// 默认是中文
|
|
334
|
+
resolve('zh_CN')
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
}
|
|
@@ -148,7 +148,7 @@ export function jumpToPage(jumpPageSetting, system, dataId, entity, additionalPa
|
|
|
148
148
|
// 表单页面
|
|
149
149
|
paramMap.entity = entity
|
|
150
150
|
paramMap.additionalParamMap = additionalParamMap
|
|
151
|
-
console.log('paramMap.parentFormData', parentFormData)
|
|
151
|
+
// console.log('paramMap.parentFormData', parentFormData)
|
|
152
152
|
paramMap.parentFormData = parentFormData
|
|
153
153
|
const isHasIdParam = isHasIdAdditionalParam(jumpPageSetting.jumpPageAdditional)
|
|
154
154
|
|
|
@@ -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'
|
|
@@ -326,12 +331,14 @@ function packagePathParams(dataId, path, jumpPage, ids, buttonCode, isHasIdParam
|
|
|
326
331
|
}
|
|
327
332
|
}
|
|
328
333
|
if (ids && ids.length > 0) {
|
|
334
|
+
const idsStr = ids.join(',')
|
|
335
|
+
const idsPath = 'ids=' + idsStr + '&_idsStr=' + idsStr
|
|
329
336
|
if (path.indexOf('?') !== -1) {
|
|
330
337
|
path += '&'
|
|
331
|
-
path +=
|
|
338
|
+
path += idsPath
|
|
332
339
|
} else {
|
|
333
340
|
path += '?'
|
|
334
|
-
path +=
|
|
341
|
+
path += idsPath
|
|
335
342
|
}
|
|
336
343
|
}
|
|
337
344
|
if (buttonCode) {
|
|
@@ -355,7 +362,7 @@ function getPageCode(jumpPageUrl) {
|
|
|
355
362
|
function jumpWithSuperPage(jumpPageUrl, system, dataId, jumpPageSetting, ids, buttonCode, isHasIdParam) {
|
|
356
363
|
return new Promise((resolve, reject) => {
|
|
357
364
|
// 表示是自定义系统跳转页面编码
|
|
358
|
-
console.log('----jumpWithSuperPage---', jumpPageUrl, system, dataId, jumpPageSetting)
|
|
365
|
+
// console.log('----jumpWithSuperPage---', jumpPageUrl, system, dataId, jumpPageSetting)
|
|
359
366
|
const pageCode = getPageCode(jumpPageUrl)
|
|
360
367
|
let jumpMode = 'refresh'
|
|
361
368
|
if (jumpPageSetting) {
|
|
@@ -422,6 +429,7 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
|
|
|
422
429
|
popPageSetting.valueMappings = jumpPageSetting.valueMappings
|
|
423
430
|
popPageSetting.updateValueEvent = jumpPageSetting.updateValueEvent
|
|
424
431
|
popPageSetting.closeEvent = jumpPageSetting.closeEvent
|
|
432
|
+
popPageSetting.isRefreshWhenClosePopup = jumpPageSetting.isRefreshWhenClosePopup
|
|
425
433
|
}
|
|
426
434
|
// 是否是自定义系统
|
|
427
435
|
let isDsc = false
|
|
@@ -448,10 +456,28 @@ function openDialogWhenPopup(jumpPageSetting, system, pageCode, dataId, jumpMode
|
|
|
448
456
|
|
|
449
457
|
function packageOpenUrl(system, pageCode, dataId, jumpPageSetting, jumpMode, ids, buttonCode, isHasIdParam) {
|
|
450
458
|
const frontendUrl = getSystemFrontendUrl(system.frontendUrl)
|
|
451
|
-
|
|
459
|
+
let path = frontendUrl + '/#/dsc-full-screen/page?customSystem=' + system.code + '&pageCode=' + pageCode + '&jumpMode=' + jumpMode
|
|
460
|
+
const systemName = getSystemNameWithLanguage(system)
|
|
461
|
+
if (systemName) {
|
|
462
|
+
path += '&_systemName_=' + encodeURI(systemName)
|
|
463
|
+
}
|
|
452
464
|
return packagePathParams(dataId, path, jumpPageSetting, ids, buttonCode, isHasIdParam)
|
|
453
465
|
}
|
|
454
466
|
|
|
467
|
+
function getSystemNameWithLanguage(system) {
|
|
468
|
+
if (system) {
|
|
469
|
+
let locale = 'cn'
|
|
470
|
+
if (window.$locale) {
|
|
471
|
+
locale = window.$locale
|
|
472
|
+
}
|
|
473
|
+
if (locale === 'cn') {
|
|
474
|
+
return system.name
|
|
475
|
+
} else {
|
|
476
|
+
return system.enName
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
|
|
455
481
|
// 解析跳转页面附带参数
|
|
456
482
|
function analysisAdditionalParameter(paramStoreId) {
|
|
457
483
|
const additionalParamMap = sessionStorage.getItem(paramStoreId)
|
|
@@ -464,7 +490,7 @@ function analysisAdditionalParameterWithMap(additionalParamMap) {
|
|
|
464
490
|
if (additionalParamMap) {
|
|
465
491
|
const additionalParameterMap = JSON.parse(additionalParamMap)
|
|
466
492
|
const keys = Object.keys(additionalParameterMap)
|
|
467
|
-
console.log('analysisAdditionalParameterWithMap--Object.keys(additionalParameterMap)=', keys)
|
|
493
|
+
// console.log('analysisAdditionalParameterWithMap--Object.keys(additionalParameterMap)=', keys)
|
|
468
494
|
for (let i = 0; i < keys.length; i++) {
|
|
469
495
|
if (additionalParameterStr !== '') {
|
|
470
496
|
additionalParameterStr += '&'
|