agilebuilder-ui 1.0.70 → 1.0.71-tmp2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +26040 -25707
- package/lib/super-ui.umd.cjs +58 -58
- package/package.json +3 -2
- package/packages/department-tree/src/department-tree.vue +28 -10
- package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
- package/packages/department-user-tree/src/department-user-tree.vue +16 -2
- package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
- package/packages/fs-upload-new/src/fs-button-upload.vue +8 -12
- package/packages/fs-upload-new/src/fs-drag-upload.vue +2 -2
- package/packages/fs-upload-new/src/fs-preview-new.vue +77 -27
- package/packages/super-grid/src/apis.js +6 -6
- package/packages/super-grid/src/search-button.vue +18 -14
- 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.vue +21 -5
- package/src/api/sso-service.js +25 -14
- package/src/i18n/langs/cn.js +2 -1
- package/src/i18n/langs/en.js +2 -1
- package/src/index.js +3 -1
- package/src/permission.js +108 -122
- package/src/styles/theme/green/sidebar.scss +12 -1
- package/src/utils/common-util.js +170 -115
- package/src/utils/jump-page-utils.js +34 -13
- package/src/utils/permissionAuth.js +47 -8
- package/src/utils/util.js +1 -1
package/src/api/sso-service.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import request from '../utils/request'
|
|
2
2
|
import {getLanguage, getTheme} from '../utils/auth'
|
|
3
3
|
import * as Vue from 'vue'
|
|
4
|
+
import { isMobileBrowser } from '../utils/common-util'
|
|
4
5
|
function login(username, password, language) {
|
|
5
6
|
const usernamePasswordToken = {
|
|
6
7
|
username,
|
|
@@ -60,22 +61,26 @@ function logout() {
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
function getCurrentUserPermissionsBySystem(loginName, systemCode) {
|
|
63
|
-
if
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
if(isMobileBrowser()){
|
|
65
|
+
return getCurrentUserMobilePermissions(loginName)
|
|
66
|
+
} else {
|
|
67
|
+
if (!systemCode) {
|
|
68
|
+
if (window.$vueApp.config.globalProperties.customSystem) {
|
|
69
|
+
systemCode = window.$vueApp.config.globalProperties.customSystem
|
|
70
|
+
} else {
|
|
71
|
+
systemCode = window.$vueApp.config.globalProperties.systemCode
|
|
72
|
+
}
|
|
68
73
|
}
|
|
74
|
+
return request.get(
|
|
75
|
+
window.$vueApp.config.globalProperties.baseAPI +
|
|
76
|
+
'/sso/current-users/permissions/with-system?loginName=' +
|
|
77
|
+
encodeURI(loginName) +
|
|
78
|
+
'&systemCode=' +
|
|
79
|
+
systemCode +
|
|
80
|
+
'&_t=' +
|
|
81
|
+
new Date().getTime()
|
|
82
|
+
)
|
|
69
83
|
}
|
|
70
|
-
return request.get(
|
|
71
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
72
|
-
'/sso/current-users/permissions/with-system?loginName=' +
|
|
73
|
-
encodeURI(loginName) +
|
|
74
|
-
'&systemCode=' +
|
|
75
|
-
systemCode +
|
|
76
|
-
'&_t=' +
|
|
77
|
-
new Date().getTime()
|
|
78
|
-
)
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
function isPasswordExpired(username, password) {
|
|
@@ -212,6 +217,12 @@ function getDevPlatformPermissions(roleCodes) {
|
|
|
212
217
|
)
|
|
213
218
|
}
|
|
214
219
|
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
function getCurrentUserMobilePermissions (loginName) {
|
|
223
|
+
return request.get(Vue.prototype.baseAPI + '/sso/current-users/mobile-permissions?loginName=' + encodeURI(loginName) + '&_t=' + new Date().getTime())
|
|
224
|
+
}
|
|
225
|
+
|
|
215
226
|
export default {
|
|
216
227
|
login,
|
|
217
228
|
getCurrentUser,
|
package/src/i18n/langs/cn.js
CHANGED
|
@@ -81,7 +81,8 @@ const cn = {
|
|
|
81
81
|
asyncExport: '正在异步导出,请等待消息通知!',
|
|
82
82
|
selectedWorkingGroup: '已选工作组',
|
|
83
83
|
forbiddenExceptionLinkUrl: '请点击进行权限申请',
|
|
84
|
-
forbiddenExceptionLinkUser: '如有疑问请联系'
|
|
84
|
+
forbiddenExceptionLinkUser: '如有疑问请联系',
|
|
85
|
+
uploadFileTip: '上传的文件不超过{fileSize}M'
|
|
85
86
|
},
|
|
86
87
|
// 列表组件
|
|
87
88
|
superGrid: {
|
package/src/i18n/langs/en.js
CHANGED
|
@@ -83,7 +83,8 @@ 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'
|
|
87
88
|
},
|
|
88
89
|
superGrid: {
|
|
89
90
|
columnConfig: 'Column Config',
|
package/src/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import { openPage } from './utils/jump-page-utils'
|
|
|
34
34
|
// import SecretInfo from '../packages/secret-info'
|
|
35
35
|
import plugins from '../packages/plugins/index'
|
|
36
36
|
import permission from './directives/permission'
|
|
37
|
+
import LoadScript from 'vue-plugin-load-script'
|
|
37
38
|
|
|
38
39
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
39
40
|
const install = function (Vue) {
|
|
@@ -41,6 +42,7 @@ const install = function (Vue) {
|
|
|
41
42
|
permission.install(Vue)
|
|
42
43
|
window.$vueApp.use(customPlugin)
|
|
43
44
|
window.$vueApp.use(plugins)
|
|
45
|
+
window.$vueApp.use(LoadScript)
|
|
44
46
|
if (install.installed) return
|
|
45
47
|
// components.map(component => Vue.component(component.name, component))
|
|
46
48
|
// components.forEach(component => {
|
|
@@ -89,5 +91,5 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
89
91
|
|
|
90
92
|
export default {
|
|
91
93
|
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
|
92
|
-
install
|
|
94
|
+
install
|
|
93
95
|
}
|
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,99 @@ 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) {
|
|
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
|
+
return store.dispatch('getDevPlatformPermissions', devpRoleCodes)
|
|
155
|
+
} else {
|
|
156
|
+
// 开发平台本身的功能或直接平台功能时
|
|
157
|
+
// console.log('开发平台本身的功能或直接平台功能时')
|
|
158
|
+
return store.dispatch('getCurrentUserPermissions', user.loginName)
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
.then((permissions) => {
|
|
162
|
+
return store.dispatch('generateRoutes', permissions)
|
|
163
|
+
})
|
|
164
|
+
.then(() => {
|
|
165
|
+
if (isNeedMenu) {
|
|
166
|
+
// 需要显示左侧菜单 并 不是开发平台时,开发平台的菜单需要在设计项目时获得
|
|
167
|
+
console.log('iMatrix-router.beforeEach2-getPermissionMenus')
|
|
168
|
+
return store.dispatch('getPermissionMenus', window.$vueApp.config.globalProperties.currentSystem)
|
|
169
|
+
} else {
|
|
170
|
+
return new Promise((resolve, reject) => {
|
|
171
|
+
resolve()
|
|
202
172
|
})
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
.then(() => {
|
|
176
|
+
// 根据roles权限生成可访问的路由表
|
|
177
|
+
console.log('router.beforeEach-generateRoutes==to=', to, ',from=', from)
|
|
178
|
+
store.getters.protectedRouters.forEach((item) => {
|
|
179
|
+
router.addRoute(item)
|
|
180
|
+
})
|
|
181
|
+
// 404等错误路由一定要放到受权限保护的路由之后
|
|
182
|
+
// router.addRoutes(errorRouterMap)
|
|
183
|
+
window.sessionStorage.setItem(
|
|
184
|
+
new Date().getTime() + '-name=null-from~~toPath',
|
|
185
|
+
from.path + '~~' + to.path
|
|
186
|
+
)
|
|
187
|
+
next({ ...to, replace: true })
|
|
188
|
+
})
|
|
189
|
+
.catch((err) => {
|
|
190
|
+
store.dispatch('clearToken').then(() => {
|
|
191
|
+
Message.error(err || 'Verification failed, please login again')
|
|
192
|
+
next({ path: '/' })
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
})
|
|
197
|
+
.catch((err) => {
|
|
198
|
+
store.dispatch('clearToken').then(() => {
|
|
199
|
+
Message.error(err || 'Verification failed, please login again')
|
|
200
|
+
next({ path: '/' })
|
|
210
201
|
})
|
|
202
|
+
})
|
|
211
203
|
} else {
|
|
212
|
-
console.log(
|
|
213
|
-
'router.beforeEach-store.getters.name ==',
|
|
214
|
-
store.getters.name
|
|
215
|
-
)
|
|
204
|
+
console.log('router.beforeEach-store.getters.name ==', store.getters.name)
|
|
216
205
|
if (isNeedMenu) {
|
|
217
206
|
// 需要显示左侧菜单
|
|
218
207
|
let systemCode = window.$vueApp.config.globalProperties.currentSystem
|
|
@@ -228,10 +217,7 @@ router.beforeEach((to, from, next) => {
|
|
|
228
217
|
}
|
|
229
218
|
}
|
|
230
219
|
} else {
|
|
231
|
-
if (
|
|
232
|
-
whiteList.indexOf(to.path) !== -1 ||
|
|
233
|
-
store.getters.whiteList.indexOf(to.path) !== -1
|
|
234
|
-
) {
|
|
220
|
+
if (whiteList.indexOf(to.path) !== -1 || store.getters.whiteList.indexOf(to.path) !== -1) {
|
|
235
221
|
next()
|
|
236
222
|
} else {
|
|
237
223
|
// 必须使用to.fullPath,fullPath是带有参数的,to.path没有参数,会导致跳转到的页面参数丢失
|
|
@@ -284,14 +284,25 @@
|
|
|
284
284
|
.router-link-active >.is-active{
|
|
285
285
|
color: $--menu-dont-color;
|
|
286
286
|
}
|
|
287
|
+
|
|
287
288
|
.el-menu-item{
|
|
288
|
-
color:
|
|
289
|
+
color: $--menu-dont-color;
|
|
289
290
|
}
|
|
291
|
+
|
|
290
292
|
.el-menu-item:hover{
|
|
291
293
|
background-color: $--menu-hove-background-color;
|
|
292
294
|
color: #FFFFFF;
|
|
293
295
|
}
|
|
294
296
|
|
|
297
|
+
.el-menu-item.is-active {
|
|
298
|
+
color: $--menu-dont-color;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.el-menu-item.is-active:hover {
|
|
302
|
+
background-color: $--menu-hove-background-color;
|
|
303
|
+
color: #FFFFFF;
|
|
304
|
+
}
|
|
305
|
+
|
|
295
306
|
.el-sub-menu .el-sub-menu__title{
|
|
296
307
|
color: #FFFFFF;
|
|
297
308
|
}
|