agilebuilder-ui 1.0.621 → 1.0.962
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.js +115880 -110424
- package/lib/super-ui.umd.cjs +103 -95
- package/package.json +6 -3
- package/packages/department-tree/src/department-tree.vue +27 -10
- package/packages/department-tree-inline/src/department-tree-service.js +20 -41
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-tree-mobile/src/department-tree-inline-app.vue +15 -15
- package/packages/department-user-tree/src/department-user-tree.vue +17 -2
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +61 -26
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +64 -22
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +0 -6
- package/packages/department-user-tree-inline/src/group-user/group-input.vue +162 -0
- package/packages/department-user-tree-inline/src/group-user/group-list.vue +99 -0
- package/packages/department-user-tree-inline/src/group-user/group-user.vue +42 -0
- package/packages/department-user-tree-inline/src/group-user-multiple-tree.vue +304 -0
- package/packages/department-user-tree-inline/src/group-user-single-tree.vue +155 -0
- package/packages/department-user-tree-inline/src/group-user-tree-service.js +74 -0
- package/packages/department-user-tree-inline/src/search-result.vue +34 -36
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +17 -19
- package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +0 -11
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +795 -799
- package/packages/dynamic-source-select/src/events.js +11 -16
- package/packages/fs-upload-list/src/fs-upload-list.vue +183 -122
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +480 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +127 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +246 -0
- package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +255 -0
- package/packages/fs-upload-new/src/fs-button-upload.vue +10 -13
- package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
- package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
- package/packages/fs-upload-new/src/fs-upload-new.vue +160 -13
- package/packages/index.js +11 -2
- package/packages/organization-input/src/organization-input.vue +493 -539
- package/packages/plugins/export-data-new.js +34 -1
- package/packages/rich-editor/index.vue +29 -0
- package/packages/row-form/index.js +7 -0
- package/packages/row-form/index.vue +211 -0
- package/packages/scan-code-input/src/scan-code-input.vue +136 -104
- package/packages/scan-code-input-browser/index.js +6 -0
- package/packages/{scan-code-input/src/scan-code-input-colse.vue → scan-code-input-browser/src/scan-code-input.vue} +1 -28
- package/packages/secret-info/index.vue +2 -2
- package/packages/super-grid/src/apis.js +158 -10
- package/packages/super-grid/src/components/grid-icon.vue +7 -14
- package/packages/super-grid/src/components/hyperlinks.vue +24 -8
- package/packages/super-grid/src/custom-formatter.js +312 -380
- package/packages/super-grid/src/dynamic-input.vue +346 -43
- package/packages/super-grid/src/formValidatorUtil.js +79 -15
- package/packages/super-grid/src/group-column.vue +5 -0
- package/packages/super-grid/src/normal-column-content.vue +1056 -0
- package/packages/super-grid/src/normal-column.vue +57 -740
- package/packages/super-grid/src/row-detail.vue +50 -0
- package/packages/super-grid/src/row-operation.vue +19 -10
- package/packages/super-grid/src/scan-util.ts +243 -0
- package/packages/super-grid/src/search-button.vue +18 -14
- package/packages/super-grid/src/search-form-advancedQuery.vue +9 -2
- package/packages/super-grid/src/search-form-item.vue +10 -3
- package/packages/super-grid/src/search-form-mobile.vue +250 -0
- package/packages/super-grid/src/search-form.vue +159 -82
- package/packages/super-grid/src/super-grid-service.js +51 -6
- package/packages/super-grid/src/super-grid.vue +657 -761
- package/packages/super-grid/src/utils.js +126 -170
- package/packages/super-nine-grid/src/super-nine-grid.vue +1032 -1141
- package/packages/workflow-button/src/workflow-button.vue +6 -1
- package/packages/workgroup-tree/src/workgroup-tree.vue +31 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +28 -0
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +26 -0
- package/packages/workgroup-tree-mobile/index.js +6 -0
- package/packages/workgroup-tree-mobile/src/dept-result.vue +51 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +120 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +375 -0
- package/packages/workgroup-tree-mobile/src/workgroup-tree-service.ts +62 -0
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +15 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +27 -0
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +11 -0
- package/packages/workgroup-user-tree-mobile/index.js +6 -0
- package/packages/workgroup-user-tree-mobile/src/dept-path.vue +36 -0
- package/packages/workgroup-user-tree-mobile/src/dept-result.vue +58 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-app.vue +119 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-inline-app.vue +394 -0
- package/packages/workgroup-user-tree-mobile/src/workgroup-user-tree-service.ts +41 -0
- package/src/api/sso-service.js +44 -15
- package/src/directives/permission/permission.js +4 -3
- package/src/i18n/langs/cn.js +19 -3
- package/src/i18n/langs/en.js +18 -2
- package/src/permission.js +114 -122
- package/src/store/modules/user.js +32 -33
- package/src/styles/index.scss +1 -0
- package/src/styles/table.scss +12 -0
- package/src/styles/theme/dark-blue/button.scss +2 -2
- package/src/styles/theme/dark-blue/index.scss +1 -1
- package/src/styles/theme/dark-blue/sidebar.scss +10 -0
- package/src/styles/theme/dark-blue/table.scss +8 -52
- package/src/styles/theme/green/button.scss +2 -2
- package/src/styles/theme/green/green.scss +1 -1
- package/src/styles/theme/green/index.scss +1 -1
- package/src/styles/theme/green/sidebar.scss +20 -0
- package/src/styles/theme/green/table.scss +7 -51
- package/src/styles/theme/ocean-blue/button.scss +2 -2
- package/src/styles/theme/ocean-blue/index.scss +1 -1
- package/src/styles/theme/ocean-blue/ocean-blue.scss +1 -1
- package/src/styles/theme/ocean-blue/sidebar.scss +10 -0
- package/src/styles/theme/ocean-blue/table.scss +7 -52
- package/src/utils/auth.js +23 -3
- package/src/utils/calculator/calculator-factory.js +4 -4
- package/src/utils/calculator/calculator-util.js +14 -0
- package/src/utils/common-util.js +270 -124
- package/src/utils/i18n-util.js +145 -0
- package/src/utils/jump-page-utils.js +245 -314
- package/src/utils/permission.js +7 -1
- package/src/utils/permissionAuth.js +155 -37
- package/src/utils/request.js +10 -11
- package/src/utils/util.js +154 -205
- package/src/views/layout/EmptyLayout.vue +1 -1
- package/src/views/layout/components/Menubar/Item.vue +27 -4
- package/src/views/layout/components/Menubar/SidebarItem.vue +7 -3
- package/src/views/layout/components/Menubar/index.vue +14 -2
- package/src/views/layout/tab-content-index.vue +1 -1
package/src/i18n/langs/cn.js
CHANGED
|
@@ -81,7 +81,10 @@ const cn = {
|
|
|
81
81
|
asyncExport: '正在异步导出,请等待消息通知!',
|
|
82
82
|
selectedWorkingGroup: '已选工作组',
|
|
83
83
|
forbiddenExceptionLinkUrl: '请点击进行权限申请',
|
|
84
|
-
forbiddenExceptionLinkUser: '如有疑问请联系'
|
|
84
|
+
forbiddenExceptionLinkUser: '如有疑问请联系',
|
|
85
|
+
uploadFileTip: '上传的文件不超过{fileSize}M',
|
|
86
|
+
asyncExportJumpMsg: '或点击我跳转到下载页面',
|
|
87
|
+
mustFill: '{label} 必须填写'
|
|
85
88
|
},
|
|
86
89
|
// 列表组件
|
|
87
90
|
superGrid: {
|
|
@@ -123,7 +126,10 @@ const cn = {
|
|
|
123
126
|
previewTitleWhenNotImg: '非图片格式,使用其它方式预览',
|
|
124
127
|
refresh: '刷新',
|
|
125
128
|
open: '展开',
|
|
126
|
-
fold: '收起'
|
|
129
|
+
fold: '收起',
|
|
130
|
+
prevRow: '上一行',
|
|
131
|
+
nextRow: '下一行',
|
|
132
|
+
detail: '详情'
|
|
127
133
|
},
|
|
128
134
|
// 部门树组件
|
|
129
135
|
departmentTree: {},
|
|
@@ -162,7 +168,14 @@ const cn = {
|
|
|
162
168
|
removeUser: '移除用户',
|
|
163
169
|
email: '邮箱',
|
|
164
170
|
loginName: '登录名',
|
|
165
|
-
|
|
171
|
+
superiorDeptNameFullPath: '组织全路径',
|
|
172
|
+
user: '用户',
|
|
173
|
+
groupName: '名称',
|
|
174
|
+
groupForm: '群组表单',
|
|
175
|
+
groupList: '群组维护',
|
|
176
|
+
group: '群组',
|
|
177
|
+
orgTree: '组织树',
|
|
178
|
+
groupNameNotEmpty: '群组名称必填'
|
|
166
179
|
},
|
|
167
180
|
// 工作组树
|
|
168
181
|
workgroupTree: {
|
|
@@ -173,6 +186,7 @@ const cn = {
|
|
|
173
186
|
workingGroupName: '工作组名称',
|
|
174
187
|
workingGroupNumber: '工作组编号',
|
|
175
188
|
workgroupDescription: '工作组描述',
|
|
189
|
+
selectResultInfo: '{num}个工作组'
|
|
176
190
|
},
|
|
177
191
|
// 流程按钮组件。save、submit等属性名不能随便改,和后台的ButtonType枚举名保持一致
|
|
178
192
|
workflowButton: {
|
|
@@ -257,6 +271,8 @@ const cn = {
|
|
|
257
271
|
operating: '操作',
|
|
258
272
|
uploadSucceeded: '上传成功',
|
|
259
273
|
theNumberOfUploadsExceedsTheLimitTheLimitIs: '上传数量超过限制,限制数量为',
|
|
274
|
+
image: '图片',
|
|
275
|
+
video: '视频'
|
|
260
276
|
},
|
|
261
277
|
messageVideo: {
|
|
262
278
|
attemptingToIdentify: '正在尝试识别....',
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -83,7 +83,10 @@ const en = {
|
|
|
83
83
|
asyncExport: 'Asynchronous export, please wait for message notification!',
|
|
84
84
|
selectedWorkingGroup: 'Selected working group',
|
|
85
85
|
forbiddenExceptionLinkUrl: 'please click to apply',
|
|
86
|
-
forbiddenExceptionLinkUser: 'if you have any questions,please contact'
|
|
86
|
+
forbiddenExceptionLinkUser: 'if you have any questions,please contact',
|
|
87
|
+
uploadFileTip: 'The file size should lower {fileSize}M',
|
|
88
|
+
asyncExportJumpMsg: 'Or click me to jump to download page.',
|
|
89
|
+
mustFill: '{label} must fill'
|
|
87
90
|
},
|
|
88
91
|
superGrid: {
|
|
89
92
|
columnConfig: 'Column Config',
|
|
@@ -128,6 +131,9 @@ const en = {
|
|
|
128
131
|
refresh: 'Refresh',
|
|
129
132
|
open: 'Open',
|
|
130
133
|
fold: 'Fold',
|
|
134
|
+
prevRow: 'Prev Row',
|
|
135
|
+
nextRow: 'Next Row',
|
|
136
|
+
detail: 'Detail'
|
|
131
137
|
},
|
|
132
138
|
departmentTree: {},
|
|
133
139
|
departmentTreeInline: {
|
|
@@ -164,7 +170,14 @@ const en = {
|
|
|
164
170
|
removeUser: 'Remove User',
|
|
165
171
|
email: 'Email',
|
|
166
172
|
loginName: 'Login Name',
|
|
167
|
-
|
|
173
|
+
superiorDeptNameFullPath: 'Department full path',
|
|
174
|
+
user: 'User',
|
|
175
|
+
groupName: 'Name',
|
|
176
|
+
groupForm: 'Group Form',
|
|
177
|
+
groupList: 'Group List',
|
|
178
|
+
group: 'Group',
|
|
179
|
+
orgTree: 'Organization Tree',
|
|
180
|
+
groupNameNotEmpty: 'Group name is required'
|
|
168
181
|
},
|
|
169
182
|
// 工作组树
|
|
170
183
|
workgroupTree: {
|
|
@@ -175,6 +188,7 @@ const en = {
|
|
|
175
188
|
workingGroupName: 'Working Group Name',
|
|
176
189
|
workingGroupNumber: 'Working Group Number',
|
|
177
190
|
workgroupDescription: 'Workgroup Description',
|
|
191
|
+
selectResultInfo: '{num} workgroups'
|
|
178
192
|
},
|
|
179
193
|
// 流程按钮组件。save、submit等属性名不能随便改,和后台的ButtonType枚举名保持一致
|
|
180
194
|
workflowButton: {
|
|
@@ -267,6 +281,8 @@ const en = {
|
|
|
267
281
|
uploadSucceeded: 'Upload succeeded',
|
|
268
282
|
theNumberOfUploadsExceedsTheLimitTheLimitIs:
|
|
269
283
|
'The number of uploads exceeds the limit. The limit is',
|
|
284
|
+
image: 'Image',
|
|
285
|
+
video: 'Video'
|
|
270
286
|
},
|
|
271
287
|
messageVideo: {
|
|
272
288
|
attemptingToIdentify: 'Attempting to identify',
|
package/src/permission.js
CHANGED
|
@@ -8,17 +8,17 @@ import { ElMessage as Message } from 'element-plus'
|
|
|
8
8
|
import * as Vue from 'vue'
|
|
9
9
|
import authApi from './utils/auth-api'
|
|
10
10
|
|
|
11
|
-
import {cacheAllLanguagesUtil, getLocaleByLang, cacheCurrentLanguageUtil} from './utils/common-util'
|
|
11
|
+
import { cacheAllLanguagesUtil, getLocaleByLang, cacheCurrentLanguageUtil } from './utils/common-util'
|
|
12
12
|
|
|
13
13
|
// 首次加载业务系统时,获得用户的语言
|
|
14
14
|
function initUserLanguage() {
|
|
15
15
|
return new Promise((resolve, reject) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
cacheCurrentLanguageUtil(window.$http).then((lang) => {
|
|
17
|
+
const locale = getLocaleByLang(lang)
|
|
18
|
+
// i18n.locale = locale // 关键语句
|
|
19
|
+
window.$locale = locale
|
|
20
|
+
resolve()
|
|
21
|
+
})
|
|
22
22
|
})
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -27,13 +27,7 @@ function cacheAllLanguages() {
|
|
|
27
27
|
return cacheAllLanguagesUtil(window.$http)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const whiteList = [
|
|
31
|
-
'/login',
|
|
32
|
-
'/update-password',
|
|
33
|
-
'/forget-password',
|
|
34
|
-
'/reset-password',
|
|
35
|
-
'/redirect',
|
|
36
|
-
] // 不重定向白名单
|
|
30
|
+
const whiteList = ['/login', '/update-password', '/forget-password', '/reset-password', '/redirect'] // 不重定向白名单
|
|
37
31
|
|
|
38
32
|
let devpJWTKey = '_devpJWT'
|
|
39
33
|
let runDevpJWTKey = '_runDevpJWT'
|
|
@@ -59,12 +53,12 @@ router.beforeEach((to, from, next) => {
|
|
|
59
53
|
let token
|
|
60
54
|
// 是否是开发环境功能
|
|
61
55
|
let isDevp = isDevpSystem()
|
|
62
|
-
if(authApi.getSessionCache(runDevpJWTKey)) {
|
|
56
|
+
if (authApi.getSessionCache(runDevpJWTKey)) {
|
|
63
57
|
// setToken(authApi.getSessionCache(runDevpJWTKey))
|
|
64
58
|
token = authApi.getSessionCache(runDevpJWTKey)
|
|
65
59
|
console.log('router.beforeEach-authApi.getSessionCache(_runDevpJWT)=', authApi.getSessionCache(runDevpJWTKey))
|
|
66
60
|
}
|
|
67
|
-
if(!token) {
|
|
61
|
+
if (!token) {
|
|
68
62
|
token = getToken()
|
|
69
63
|
}
|
|
70
64
|
console.log('router.beforeEach-token=', token)
|
|
@@ -83,10 +77,15 @@ router.beforeEach((to, from, next) => {
|
|
|
83
77
|
setToken(token)
|
|
84
78
|
}
|
|
85
79
|
}
|
|
86
|
-
if (to.query
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
80
|
+
// if (to.query) {
|
|
81
|
+
// if (to.query._systemName_) {
|
|
82
|
+
// window.top.document.title = to.query._systemName_
|
|
83
|
+
// }
|
|
84
|
+
// if (to.query.customSystem) {
|
|
85
|
+
// window.$vueApp.config.globalProperties.currentSystem = to.query.customSystem
|
|
86
|
+
// }
|
|
87
|
+
// // 表示需要设置浏览器页签名
|
|
88
|
+
// }
|
|
90
89
|
// console.log('router.beforeEach-getToken()=', token)
|
|
91
90
|
// 表示需要显示菜单。为了控制是否需要走获得有权限的菜单集合的接口。单点登录跳转到表单页面时不需要请求菜单,提高页面显示速度。
|
|
92
91
|
let isNeedMenu
|
|
@@ -100,14 +99,9 @@ router.beforeEach((to, from, next) => {
|
|
|
100
99
|
}
|
|
101
100
|
console.log('iMatrix-router.beforeEach2-isNeedMenu==', isNeedMenu)
|
|
102
101
|
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
'/reset-password',
|
|
107
|
-
'/redirect',
|
|
108
|
-
].indexOf(to.path) === -1 ||
|
|
109
|
-
store.getters.whiteList.indexOf(to.path) !== -1) &&
|
|
110
|
-
token
|
|
102
|
+
(['/update-password', '/forget-password', '/reset-password', '/redirect'].indexOf(to.path) === -1 ||
|
|
103
|
+
store.getters.whiteList.indexOf(to.path) !== -1) &&
|
|
104
|
+
token
|
|
111
105
|
) {
|
|
112
106
|
if (to.path === '/login') {
|
|
113
107
|
next({ path: '/', query: to.query })
|
|
@@ -115,104 +109,105 @@ router.beforeEach((to, from, next) => {
|
|
|
115
109
|
} else {
|
|
116
110
|
console.log('router.beforeEach-to.path!=login')
|
|
117
111
|
if (store.getters.name === '') {
|
|
112
|
+
if (to.query) {
|
|
113
|
+
if (to.query._systemName_) {
|
|
114
|
+
window.top.document.title = to.query._systemName_
|
|
115
|
+
}
|
|
116
|
+
if (to.query.customSystem && to.query.customSystem !== 'undefined' && to.query.customSystem !== 'null') {
|
|
117
|
+
window.$vueApp.config.globalProperties.currentSystem = to.query.customSystem
|
|
118
|
+
}
|
|
119
|
+
// 表示需要设置浏览器页签名
|
|
120
|
+
}
|
|
118
121
|
// 表示刷新了页面(例如点击了一级菜单)后,会重新走该方法
|
|
119
122
|
console.log('router.beforeEach-store.getters.name === ""')
|
|
120
123
|
store
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
}).then((user)=>{
|
|
138
|
-
return new Promise((resolve, reject) => {
|
|
139
|
-
cacheAllLanguages().then(()=>{
|
|
140
|
-
resolve(user)
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
}).then((user)=>{
|
|
144
|
-
console.log('router.beforeEach-getCurrentUser')
|
|
145
|
-
const devpRoleCodes = authApi.getSessionCache(runCurrentRoleKey)
|
|
146
|
-
if(!isDevp && devpRoleCodes){
|
|
147
|
-
// 表示是开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码,对应运行平台的岗位编码
|
|
148
|
-
// console.log('开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码时,!isDevp && devpRoleCodes')
|
|
149
|
-
return store.dispatch(
|
|
150
|
-
'getDevPlatformPermissions',
|
|
151
|
-
devpRoleCodes
|
|
152
|
-
)
|
|
153
|
-
} else {
|
|
154
|
-
// 开发平台本身的功能或直接平台功能时
|
|
155
|
-
// console.log('开发平台本身的功能或直接平台功能时')
|
|
156
|
-
return store.dispatch(
|
|
157
|
-
'getCurrentUserPermissions',
|
|
158
|
-
user.loginName
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
.then((permissions) => {
|
|
163
|
-
return store.dispatch('generateRoutes', permissions)
|
|
164
|
-
})
|
|
165
|
-
.then(() => {
|
|
166
|
-
if (isNeedMenu) {
|
|
167
|
-
// 需要显示左侧菜单 并 不是开发平台时,开发平台的菜单需要在设计项目时获得
|
|
168
|
-
console.log('iMatrix-router.beforeEach2-getPermissionMenus')
|
|
169
|
-
return store.dispatch('getPermissionMenus', window.$vueApp.config.globalProperties.currentSystem)
|
|
170
|
-
} else {
|
|
171
|
-
return new Promise((resolve, reject) => {
|
|
172
|
-
resolve()
|
|
173
|
-
})
|
|
174
|
-
}
|
|
124
|
+
.dispatch('isLoginTimeOut')
|
|
125
|
+
.then((result) => {
|
|
126
|
+
if (result === true) {
|
|
127
|
+
store.dispatch('clearToken').then(() => {
|
|
128
|
+
next({ path: '/', replace: true })
|
|
129
|
+
NProgress.done()
|
|
130
|
+
})
|
|
131
|
+
} else {
|
|
132
|
+
store
|
|
133
|
+
.dispatch('getCurrentUser')
|
|
134
|
+
.then((user) => {
|
|
135
|
+
return new Promise((resolve, reject) => {
|
|
136
|
+
initUserLanguage().then(() => {
|
|
137
|
+
resolve(user)
|
|
175
138
|
})
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
from
|
|
183
|
-
)
|
|
184
|
-
store.getters.protectedRouters.forEach(item =>{
|
|
185
|
-
router.addRoute(item)
|
|
186
|
-
})
|
|
187
|
-
// 404等错误路由一定要放到受权限保护的路由之后
|
|
188
|
-
// router.addRoutes(errorRouterMap)
|
|
189
|
-
window.sessionStorage.setItem(
|
|
190
|
-
new Date().getTime() + '-name=null-from~~toPath',
|
|
191
|
-
from.path + '~~' + to.path
|
|
192
|
-
)
|
|
193
|
-
next({ ...to, replace: true })
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
.then((user) => {
|
|
142
|
+
return new Promise((resolve, reject) => {
|
|
143
|
+
cacheAllLanguages().then(() => {
|
|
144
|
+
resolve(user)
|
|
194
145
|
})
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
.then((user) => {
|
|
149
|
+
console.log('router.beforeEach-getCurrentUser')
|
|
150
|
+
const devpRoleCodes = authApi.getSessionCache(runCurrentRoleKey)
|
|
151
|
+
if (!isDevp && devpRoleCodes) {
|
|
152
|
+
// 表示是开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码,对应运行平台的岗位编码
|
|
153
|
+
// console.log('开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码时,!isDevp && devpRoleCodes')
|
|
154
|
+
console.log('getDevPlatformPermissions---devpRoleCodes=', devpRoleCodes)
|
|
155
|
+
return store.dispatch('getDevPlatformPermissions', devpRoleCodes)
|
|
156
|
+
} else {
|
|
157
|
+
// 开发平台本身的功能或直接平台功能时
|
|
158
|
+
// console.log('开发平台本身的功能或直接平台功能时')
|
|
159
|
+
let systemCode = to.query ? to.query.customSystem: null
|
|
160
|
+
if (!systemCode) {
|
|
161
|
+
systemCode = window.$vueApp.config.globalProperties.currentSystem
|
|
162
|
+
}
|
|
163
|
+
console.log('3333systemCode=', systemCode)
|
|
164
|
+
return store.dispatch('getCurrentUserPermissions', {loginName:user.loginName, systemCode})
|
|
165
|
+
}
|
|
166
|
+
})
|
|
167
|
+
.then((permissions) => {
|
|
168
|
+
return store.dispatch('generateRoutes', permissions)
|
|
169
|
+
})
|
|
170
|
+
.then(() => {
|
|
171
|
+
if (isNeedMenu) {
|
|
172
|
+
// 需要显示左侧菜单 并 不是开发平台时,开发平台的菜单需要在设计项目时获得
|
|
173
|
+
console.log('iMatrix-router.beforeEach2-getPermissionMenus')
|
|
174
|
+
return store.dispatch('getPermissionMenus', window.$vueApp.config.globalProperties.currentSystem)
|
|
175
|
+
} else {
|
|
176
|
+
return new Promise((resolve, reject) => {
|
|
177
|
+
resolve()
|
|
202
178
|
})
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
.then(() => {
|
|
182
|
+
// 根据roles权限生成可访问的路由表
|
|
183
|
+
console.log('router.beforeEach-generateRoutes==to=', to, ',from=', from)
|
|
184
|
+
store.getters.protectedRouters.forEach((item) => {
|
|
185
|
+
router.addRoute(item)
|
|
186
|
+
})
|
|
187
|
+
// 404等错误路由一定要放到受权限保护的路由之后
|
|
188
|
+
// router.addRoutes(errorRouterMap)
|
|
189
|
+
window.sessionStorage.setItem(
|
|
190
|
+
new Date().getTime() + '-name=null-from~~toPath',
|
|
191
|
+
from.path + '~~' + to.path
|
|
192
|
+
)
|
|
193
|
+
next({ ...to, replace: true })
|
|
194
|
+
})
|
|
195
|
+
.catch((err) => {
|
|
196
|
+
store.dispatch('clearToken').then(() => {
|
|
197
|
+
Message.error(err || 'Verification failed, please login again')
|
|
198
|
+
next({ path: '/' })
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
.catch((err) => {
|
|
204
|
+
store.dispatch('clearToken').then(() => {
|
|
205
|
+
Message.error(err || 'Verification failed, please login again')
|
|
206
|
+
next({ path: '/' })
|
|
210
207
|
})
|
|
208
|
+
})
|
|
211
209
|
} else {
|
|
212
|
-
console.log(
|
|
213
|
-
'router.beforeEach-store.getters.name ==',
|
|
214
|
-
store.getters.name
|
|
215
|
-
)
|
|
210
|
+
console.log('router.beforeEach-store.getters.name ==', store.getters.name)
|
|
216
211
|
if (isNeedMenu) {
|
|
217
212
|
// 需要显示左侧菜单
|
|
218
213
|
let systemCode = window.$vueApp.config.globalProperties.currentSystem
|
|
@@ -228,10 +223,7 @@ router.beforeEach((to, from, next) => {
|
|
|
228
223
|
}
|
|
229
224
|
}
|
|
230
225
|
} else {
|
|
231
|
-
if (
|
|
232
|
-
whiteList.indexOf(to.path) !== -1 ||
|
|
233
|
-
store.getters.whiteList.indexOf(to.path) !== -1
|
|
234
|
-
) {
|
|
226
|
+
if (whiteList.indexOf(to.path) !== -1 || store.getters.whiteList.indexOf(to.path) !== -1) {
|
|
235
227
|
next()
|
|
236
228
|
} else {
|
|
237
229
|
// 必须使用to.fullPath,fullPath是带有参数的,to.path没有参数,会导致跳转到的页面参数丢失
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import ssoService from '../../api/sso-service'
|
|
2
2
|
import {
|
|
3
3
|
getUsername,
|
|
4
|
-
|
|
4
|
+
setUsername, removeUsername, removeCurrentUser, clearPermission,
|
|
5
5
|
removeAllThemes,
|
|
6
|
-
removeCurrentUser,
|
|
7
6
|
removeDevpPermissions,
|
|
8
|
-
removeLanguage,
|
|
9
7
|
removeTheme,
|
|
10
|
-
removePublishControl,
|
|
11
|
-
removeToken,
|
|
12
|
-
removeUsername,
|
|
13
8
|
setCurrentUser,
|
|
14
9
|
setLanguage,
|
|
15
10
|
setToken,
|
|
16
|
-
setUsername,
|
|
17
11
|
removeProjectSettings,
|
|
18
12
|
removeProjectCode,
|
|
19
13
|
setTheme
|
|
@@ -22,10 +16,9 @@ import {
|
|
|
22
16
|
import {
|
|
23
17
|
getMenus,
|
|
24
18
|
getPermissions,
|
|
25
|
-
removeMenus,
|
|
26
|
-
removePermissions,
|
|
27
19
|
setMenus,
|
|
28
|
-
setPermissions
|
|
20
|
+
setPermissions,
|
|
21
|
+
removeAllSystemPermissions
|
|
29
22
|
} from '../../utils/permissionAuth'
|
|
30
23
|
|
|
31
24
|
import {isPlateSys} from '../../utils/common-util'
|
|
@@ -53,6 +46,8 @@ const user = {
|
|
|
53
46
|
actions: {
|
|
54
47
|
// 登录
|
|
55
48
|
login({ commit }, userInfo) {
|
|
49
|
+
// 登录时先清除缓存的登录信息和权限信息
|
|
50
|
+
clearPermission()
|
|
56
51
|
const username = userInfo.username.trim()
|
|
57
52
|
return new Promise((resolve, reject) => {
|
|
58
53
|
ssoService
|
|
@@ -86,6 +81,7 @@ const user = {
|
|
|
86
81
|
},
|
|
87
82
|
// 登录
|
|
88
83
|
loginWithValidateCode({ commit }, userInfo) {
|
|
84
|
+
console.log('loginWithValidateCode----userInfo=', userInfo)
|
|
89
85
|
const username = userInfo.username.trim()
|
|
90
86
|
return new Promise((resolve, reject) => {
|
|
91
87
|
ssoService
|
|
@@ -97,6 +93,7 @@ const user = {
|
|
|
97
93
|
userInfo.imageCodeKey
|
|
98
94
|
)
|
|
99
95
|
.then((data) => {
|
|
96
|
+
console.log('loginWithValidateCode2222----data=', data)
|
|
100
97
|
// const data = response.data
|
|
101
98
|
setToken(data.jwt)
|
|
102
99
|
setLanguage(data.language)
|
|
@@ -140,6 +137,8 @@ const user = {
|
|
|
140
137
|
})
|
|
141
138
|
}
|
|
142
139
|
if (loginName) {
|
|
140
|
+
// 登录时清除缓存的资源
|
|
141
|
+
removeAllSystemPermissions()
|
|
143
142
|
// setToken(tokenInfo.jwt)
|
|
144
143
|
// commit('setToken', tokenInfo.jwt)
|
|
145
144
|
ssoService
|
|
@@ -198,20 +197,11 @@ const user = {
|
|
|
198
197
|
.logout(state.token)
|
|
199
198
|
.then((data) => {
|
|
200
199
|
commit('setToken', '')
|
|
201
|
-
removeToken()
|
|
202
|
-
removeLanguage()
|
|
203
200
|
removeTheme()
|
|
204
|
-
removeAllLanguages()
|
|
205
201
|
removeAllThemes()
|
|
206
202
|
|
|
207
203
|
commit('setName', '')
|
|
208
|
-
|
|
209
|
-
removeCurrentUser()
|
|
210
|
-
|
|
211
|
-
removePermissions()
|
|
212
|
-
|
|
213
|
-
removeMenus()
|
|
214
|
-
removePublishControl()
|
|
204
|
+
clearPermission()
|
|
215
205
|
removeDevpPermissions()
|
|
216
206
|
removeProjectSettings()
|
|
217
207
|
removeProjectCode()
|
|
@@ -227,20 +217,11 @@ const user = {
|
|
|
227
217
|
clearToken({ commit }) {
|
|
228
218
|
return new Promise((resolve) => {
|
|
229
219
|
commit('setToken', '')
|
|
230
|
-
removeToken()
|
|
231
|
-
removeLanguage()
|
|
232
220
|
removeTheme()
|
|
233
|
-
removeAllLanguages()
|
|
234
221
|
removeAllThemes()
|
|
235
222
|
|
|
236
223
|
commit('setName', '')
|
|
237
|
-
|
|
238
|
-
removeCurrentUser()
|
|
239
|
-
|
|
240
|
-
removePermissions()
|
|
241
|
-
|
|
242
|
-
removeMenus()
|
|
243
|
-
removePublishControl()
|
|
224
|
+
clearPermission()
|
|
244
225
|
removeDevpPermissions()
|
|
245
226
|
removeProjectSettings()
|
|
246
227
|
removeProjectCode()
|
|
@@ -250,9 +231,12 @@ const user = {
|
|
|
250
231
|
},
|
|
251
232
|
|
|
252
233
|
// 获得当前用户权限集合
|
|
253
|
-
getCurrentUserPermissions({ commit },
|
|
234
|
+
getCurrentUserPermissions({ commit }, param) {
|
|
254
235
|
return new Promise((resolve, reject) => {
|
|
255
|
-
|
|
236
|
+
const loginName = param.loginName
|
|
237
|
+
const systemCode = param.systemCode
|
|
238
|
+
let storePermissions = getPermissions(systemCode)
|
|
239
|
+
console.log('getCurrentUserPermissions-----systemCode=', systemCode, 'storePermissions=', storePermissions)
|
|
256
240
|
// 这个判断会导致资源不会重新加载??
|
|
257
241
|
if (
|
|
258
242
|
typeof storePermissions === 'undefined' ||
|
|
@@ -264,7 +248,7 @@ const user = {
|
|
|
264
248
|
.then((permissions) => {
|
|
265
249
|
let currentPermissions = ['index']
|
|
266
250
|
currentPermissions = currentPermissions.concat(permissions)
|
|
267
|
-
storePermissions = setPermissions(currentPermissions)
|
|
251
|
+
storePermissions = setPermissions(currentPermissions, systemCode)
|
|
268
252
|
resolve(storePermissions)
|
|
269
253
|
})
|
|
270
254
|
.catch((error) => {
|
|
@@ -323,6 +307,21 @@ const user = {
|
|
|
323
307
|
})
|
|
324
308
|
},
|
|
325
309
|
|
|
310
|
+
// 判断当前用户密码是否过期
|
|
311
|
+
isPasswordExpiredWithValidateCode({ commit }, userInfo) {
|
|
312
|
+
const username = userInfo.username.trim()
|
|
313
|
+
return new Promise((resolve, reject) => {
|
|
314
|
+
ssoService
|
|
315
|
+
.isPasswordExpiredWithValidateCode(username, userInfo.password, userInfo.validCode, userInfo.imageCodeKey )
|
|
316
|
+
.then((message) => {
|
|
317
|
+
resolve(message)
|
|
318
|
+
})
|
|
319
|
+
.catch((error) => {
|
|
320
|
+
reject(error)
|
|
321
|
+
})
|
|
322
|
+
})
|
|
323
|
+
},
|
|
324
|
+
|
|
326
325
|
updatePassword({ commit }, map) {
|
|
327
326
|
return new Promise((resolve, reject) => {
|
|
328
327
|
ssoService
|
package/src/styles/index.scss
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.ocean-blue,.green,.dark-blue{
|
|
2
|
+
.el-table th.el-table__cell {
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
}
|
|
5
|
+
.el-table.is-scrolling-right th.el-table-fixed-column--right{
|
|
6
|
+
background-color: transparent;
|
|
7
|
+
}
|
|
8
|
+
.el-table.is-scrolling-left th.el-table-fixed-column--left{
|
|
9
|
+
background-color: transparent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|