agilebuilder-ui 1.1.41 → 1.1.42
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/{401-deb6f978.js → 401-89fd25ba.js} +1 -1
- package/lib/{404-ca0b33ee.js → 404-4264aeb1.js} +1 -1
- package/lib/{iframe-page-eb39ba95.js → iframe-page-4a8dcdbb.js} +1 -1
- package/lib/{index-a36c91b2.js → index-50fdf8ae.js} +4630 -4580
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +85 -85
- package/lib/{tab-content-iframe-index-094835e7.js → tab-content-iframe-index-16207fb9.js} +1 -1
- package/lib/{tab-content-index-92b24462.js → tab-content-index-8ae8c396.js} +1 -1
- package/lib/{tache-subprocess-history-0d32337a.js → tache-subprocess-history-110e29f2.js} +1 -1
- package/package.json +1 -1
- package/packages/fs-preview/src/fs-preview.vue +38 -29
- package/packages/fs-upload-new/src/fs-button-upload.vue +34 -1
- package/packages/fs-upload-new/src/fs-drag-upload.vue +43 -2
- package/packages/fs-upload-new/src/fs-preview-new.vue +6 -4
- package/packages/super-grid/src/custom-formatter.js +16 -10
- package/packages/super-grid/src/dynamic-input.vue +7 -2
- package/packages/super-grid/src/normal-column.vue +8 -4
- package/packages/super-grid/src/search-form-advancedQuery.vue +1 -1
- package/packages/super-grid/src/search-form-item.vue +23 -23
- package/packages/super-grid/src/search-form-open.vue +164 -158
- package/packages/super-grid/src/super-grid-service.js +141 -153
- package/packages/super-grid/src/super-grid.vue +43 -14
- package/packages/super-nine-grid/src/search-form.vue +465 -659
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +515 -539
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +24 -44
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +626 -665
- package/src/utils/permission.js +86 -9
package/src/utils/permission.js
CHANGED
|
@@ -6,24 +6,24 @@ import { getTotalPermissions, isDevpAccess } from './permissionAuth'
|
|
|
6
6
|
* @returns {Boolean}
|
|
7
7
|
*/
|
|
8
8
|
export default function checkPermission(permission, systemCode) {
|
|
9
|
+
if (permission && permission === 'true') {
|
|
10
|
+
return true
|
|
11
|
+
}
|
|
9
12
|
if (permission) {
|
|
10
13
|
// 是否是预览项目时开发平台用户
|
|
11
|
-
const isDevpPermission= isDevpAccess()
|
|
14
|
+
const isDevpPermission = isDevpAccess()
|
|
12
15
|
// console.log('checkPermission---------permission=', permission, 'isDevpPermission=', isDevpPermission)
|
|
13
|
-
if(isDevpPermission){
|
|
16
|
+
if (isDevpPermission) {
|
|
14
17
|
return true
|
|
15
18
|
}
|
|
16
19
|
let hasPermission = false
|
|
17
20
|
const storeCurrentUserPermissions = getTotalPermissions(systemCode)
|
|
18
|
-
if (
|
|
19
|
-
typeof storeCurrentUserPermissions !== 'undefined' &&
|
|
20
|
-
storeCurrentUserPermissions !== null
|
|
21
|
-
) {
|
|
21
|
+
if (typeof storeCurrentUserPermissions !== 'undefined' && storeCurrentUserPermissions !== null) {
|
|
22
22
|
const permissions = permission.split(',')
|
|
23
|
-
for(let i=0;i<permissions.length;i++){
|
|
23
|
+
for (let i = 0; i < permissions.length; i++) {
|
|
24
24
|
const permissionItem = permissions[i]
|
|
25
25
|
const isPermission = isHasPermission(permissionItem, storeCurrentUserPermissions)
|
|
26
|
-
if(isPermission !== undefined && isPermission === true) {
|
|
26
|
+
if (isPermission !== undefined && isPermission === true) {
|
|
27
27
|
hasPermission = true
|
|
28
28
|
break
|
|
29
29
|
}
|
|
@@ -46,4 +46,81 @@ function isHasPermission(permission, storeCurrentUserPermissions) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
function getPermissionCodes(configure, pageContext) {
|
|
50
|
+
// if (!pageContext || !configure || pageContext.isTest) {
|
|
51
|
+
// // 如果是预览时
|
|
52
|
+
// return 'true'
|
|
53
|
+
// }
|
|
54
|
+
const codes = []
|
|
55
|
+
//默认生成的资源编码 固定为标准
|
|
56
|
+
if (configure.autoPermissions) {
|
|
57
|
+
for (const p of configure.autoPermissions) {
|
|
58
|
+
codes.push(pageContext.code + '.' + p.simpleCode)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//检查是否有手动选择绑定
|
|
62
|
+
if (configure.functionCodes) {
|
|
63
|
+
const sourceTypes = configure.sourceTypes ? configure.sourceTypes : []
|
|
64
|
+
const functionCodes = configure.functionCodes
|
|
65
|
+
for (let i = 0; i < functionCodes.length; i++) {
|
|
66
|
+
const functionCode = functionCodes[i]
|
|
67
|
+
const sourceType = i < sourceTypes.length ? sourceTypes[i] : ''
|
|
68
|
+
//服务时不加前缀
|
|
69
|
+
let newCode = ''
|
|
70
|
+
if (sourceType == 'service') {
|
|
71
|
+
newCode = functionCode
|
|
72
|
+
} else {
|
|
73
|
+
if (sourceType === 'standard') {
|
|
74
|
+
newCode = pageContext.code + '.' + functionCode
|
|
75
|
+
} else {
|
|
76
|
+
const permissionObject = getPagePermissionObjectBySimpleCode(functionCode, pageContext)
|
|
77
|
+
if (permissionObject.type === 'custom') {
|
|
78
|
+
newCode = functionCode
|
|
79
|
+
} else {
|
|
80
|
+
newCode = pageContext.code + '.' + functionCode
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!codes.includes(newCode)) {
|
|
85
|
+
codes.push(newCode)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return codes.join(',')
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function getPagePermissionObjectBySimpleCode(persmissionCode, pageContext) {
|
|
93
|
+
const pagePermissions = pageContext.pagePermissions
|
|
94
|
+
if (pagePermissions && pagePermissions.length > 0) {
|
|
95
|
+
for (let i = 0; i < pagePermissions.length; i++) {
|
|
96
|
+
if (pagePermissions[i].simpleCode === persmissionCode) {
|
|
97
|
+
return pagePermissions[i]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return null
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 检查字段是否有分支字段权限
|
|
106
|
+
* @param {Object} branchFieldsMap - 分支字段权限
|
|
107
|
+
* @param {string} fieldName - 字段名
|
|
108
|
+
* @returns {boolean} - 是否有权限
|
|
109
|
+
*/
|
|
110
|
+
function isFieldHasBranchAuth(branchFieldsMap, fieldName) {
|
|
111
|
+
if (branchFieldsMap) {
|
|
112
|
+
const hasAuthFields = branchFieldsMap.hasAuthFields
|
|
113
|
+
if (hasAuthFields && hasAuthFields.includes(fieldName)) {
|
|
114
|
+
// 说明分支配置了该字段的权限
|
|
115
|
+
return true
|
|
116
|
+
}
|
|
117
|
+
const allAuthFields = branchFieldsMap.allAuthFields
|
|
118
|
+
if (allAuthFields && allAuthFields.includes(fieldName)) {
|
|
119
|
+
// 说明分支没有配置该分支字段权限
|
|
120
|
+
return false
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { checkPermission, getPermissionCodes, isFieldHasBranchAuth }
|