agilebuilder-ui 1.0.86 → 1.0.87-temp2
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 +3733 -3723
- package/lib/super-ui.umd.cjs +41 -41
- package/package.json +2 -2
- package/packages/super-grid/src/apis.js +26 -0
- package/packages/super-grid/src/custom-formatter.js +5 -3
- package/packages/super-grid/src/normal-column-content.vue +17 -33
- package/packages/super-grid/src/super-grid.vue +1 -0
- package/packages/super-grid/src/utils.js +7 -2
- package/src/permission.js +7 -1
- package/src/store/modules/user.js +4 -1
- package/src/utils/permissionAuth.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agilebuilder-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.87-temp2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./lib/super-ui.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"axios": "^1.5.1",
|
|
29
29
|
"element-plus": "^2.4.1",
|
|
30
30
|
"nprogress": "^0.2.0",
|
|
31
|
-
"sass": "
|
|
31
|
+
"sass": "1.69.4",
|
|
32
32
|
"vite": "^4.4.5",
|
|
33
33
|
"vite-plugin-require-transform": "^1.0.21",
|
|
34
34
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
@@ -1224,6 +1224,26 @@ const apis = {
|
|
|
1224
1224
|
})
|
|
1225
1225
|
return result
|
|
1226
1226
|
},
|
|
1227
|
+
// 获得该列表中,下拉选是选项组的字段信息,返回的key是属性名,value是选项集合
|
|
1228
|
+
getTableSelectOptions(listCode) {
|
|
1229
|
+
const result = {}
|
|
1230
|
+
if (!listCode) {
|
|
1231
|
+
listCode = store.get('_list_code')
|
|
1232
|
+
}
|
|
1233
|
+
const gridParams = store.get(listCode)
|
|
1234
|
+
const columns = gridParams.columns
|
|
1235
|
+
columns.forEach(col => {
|
|
1236
|
+
const prop = col.prop
|
|
1237
|
+
const isDynamicDataSource = isDynamicDataSourceSource(col)
|
|
1238
|
+
if (!isDynamicDataSource && col.valueSet && col.valueSet.length > 0) {
|
|
1239
|
+
result[prop] = {
|
|
1240
|
+
options: col.valueSet,
|
|
1241
|
+
column: col
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
})
|
|
1245
|
+
return result
|
|
1246
|
+
},
|
|
1227
1247
|
// 取消列表的编辑状态
|
|
1228
1248
|
restoreGridEdit(listCode) {
|
|
1229
1249
|
if (!listCode) {
|
|
@@ -1387,6 +1407,12 @@ const apis = {
|
|
|
1387
1407
|
})
|
|
1388
1408
|
}
|
|
1389
1409
|
return defaultValueColumnsMap
|
|
1410
|
+
},
|
|
1411
|
+
// 重新刷新子表数据
|
|
1412
|
+
reloadSubTableData(listCode) {
|
|
1413
|
+
const gridParams = store.get(listCode)
|
|
1414
|
+
gridParams.options['subTableData'] = null
|
|
1415
|
+
this.fetchListData()
|
|
1390
1416
|
}
|
|
1391
1417
|
}
|
|
1392
1418
|
export default apis
|
|
@@ -269,14 +269,14 @@ const customFormatter = {
|
|
|
269
269
|
}
|
|
270
270
|
if (isPromise(canClick)) {
|
|
271
271
|
canClick.then((result) => {
|
|
272
|
-
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
|
|
272
|
+
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
|
|
273
273
|
})
|
|
274
274
|
} else {
|
|
275
|
-
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams)
|
|
275
|
+
this.doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column)
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
},
|
|
279
|
-
doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams) {
|
|
279
|
+
doClickHyperLink(row, listCode, rowIndex, jumpPageSetting, gridParams, column) {
|
|
280
280
|
let parentFormData = null
|
|
281
281
|
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
282
282
|
parentFormData = gridParams.options.extraParam.entityMap
|
|
@@ -311,6 +311,8 @@ const customFormatter = {
|
|
|
311
311
|
openPageParams._rowIndex = rowIndex
|
|
312
312
|
// 行编辑的记录
|
|
313
313
|
openPageParams.row = row
|
|
314
|
+
// 列点击时列属性名
|
|
315
|
+
openPageParams._columnProp = column.prop
|
|
314
316
|
// 通知父页面弹出页面
|
|
315
317
|
$emit(this, 'open-page', openPageParams)
|
|
316
318
|
}
|
|
@@ -655,9 +655,9 @@ export default {
|
|
|
655
655
|
(this.column.componentType === 'multiselect' || this.column.componentType === 'select')
|
|
656
656
|
) {
|
|
657
657
|
const isDynamic = isDynamicDataSourceSource(this.column)
|
|
658
|
+
let beforeColumnValue = param.row[this.column.prop]
|
|
658
659
|
if (!isDynamic) {
|
|
659
660
|
// 选项组保存时将数组处理为字符串
|
|
660
|
-
const beforeColumnValue = param.row[this.column.prop]
|
|
661
661
|
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
662
662
|
// 如果是数组才需要转换
|
|
663
663
|
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
@@ -678,54 +678,38 @@ export default {
|
|
|
678
678
|
}
|
|
679
679
|
if (selectDataKey) {
|
|
680
680
|
// beforeColumnValue是数组值,如果是单选则是字符串
|
|
681
|
-
let beforeColumnValue = param.row[this.column.prop]
|
|
682
681
|
if (this.column.componentType === 'select') {
|
|
683
682
|
if (selectDataKey !== temp.valueAttribute) {
|
|
684
683
|
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
684
|
+
// 当前字段映射的是工厂名称,
|
|
685
|
+
// 筛选动态数据源选项值字段对应的当前字段所映射的字段, 例如 根据工厂编码找工厂编码对应的工厂名称
|
|
686
|
+
// 找出名称后赋值给当前字段
|
|
687
|
+
const filterValue = temp.optionItems.find((item) => item[temp.valueAttribute] === beforeColumnValue)
|
|
688
|
+
if (filterValue) {
|
|
689
|
+
beforeColumnValue = filterValue[selectDataKey]
|
|
690
|
+
}
|
|
692
691
|
}
|
|
693
|
-
// 如果是单选
|
|
694
|
-
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
695
|
-
// temp.optionItems.forEach(optionItem => {
|
|
696
|
-
// if (optionItem[temp.valueAttribute] === beforeColumnValue) {
|
|
697
|
-
// this.$set(param.row, this.column.prop, optionItem[selectDataKey])
|
|
698
|
-
// }
|
|
699
|
-
// })
|
|
700
692
|
param.row[this.column.prop] = beforeColumnValue
|
|
701
693
|
} else {
|
|
702
|
-
|
|
703
|
-
// 现在选择时已经赋值,不再需要这里进行赋值
|
|
704
|
-
// const afterColumnValue = []
|
|
705
|
-
// temp.optionItems.forEach(optionItem => {
|
|
706
|
-
// beforeColumnValue.forEach(value => {
|
|
707
|
-
// if (optionItem[temp.valueAttribute] === value) {
|
|
708
|
-
// afterColumnValue.push(optionItem[selectDataKey])
|
|
709
|
-
// }
|
|
710
|
-
// })
|
|
711
|
-
// })
|
|
712
|
-
if (beforeColumnValue && selectDataKey !== temp.valueAttribute) {
|
|
694
|
+
if (beforeColumnValue && selectDataKey !== temp.valueAttribute && Array.isArray(beforeColumnValue)) {
|
|
713
695
|
// 解决当前字段不是动态数据源选项值所映射的字段的问题 例如当前字段是工厂名称, 动态数据源选项值是工厂编码
|
|
714
696
|
const t = []
|
|
715
697
|
beforeColumnValue.forEach((selectItem) => {
|
|
716
698
|
if (selectDataKey !== temp.valueAttribute) {
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
699
|
+
const filterValue = temp.optionItems.find((option) => option[temp.valueAttribute] === selectItem)
|
|
700
|
+
if (filterValue) {
|
|
701
|
+
t.push(filterValue[selectDataKey])
|
|
702
|
+
}
|
|
720
703
|
}
|
|
721
704
|
})
|
|
722
|
-
|
|
705
|
+
if (t.length > 0) {
|
|
706
|
+
beforeColumnValue = t
|
|
707
|
+
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
708
|
+
}
|
|
723
709
|
}
|
|
724
|
-
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
725
710
|
}
|
|
726
711
|
}
|
|
727
712
|
} else {
|
|
728
|
-
const beforeColumnValue = param.row[this.column.prop]
|
|
729
713
|
if (beforeColumnValue && Object.prototype.toString.apply(beforeColumnValue) === '[object Array]') {
|
|
730
714
|
// 如果是数组才需要转换
|
|
731
715
|
param.row[this.column.prop] = beforeColumnValue.join(',')
|
|
@@ -3071,6 +3071,7 @@ export default {
|
|
|
3071
3071
|
listCode: popPageSetting._listCode,
|
|
3072
3072
|
rowIndex: popPageSetting._rowIndex,
|
|
3073
3073
|
row: popPageSetting.row,
|
|
3074
|
+
columnProp: popPageSetting._columnProp,
|
|
3074
3075
|
id: row?(row.ID?row.ID:row.id):null,
|
|
3075
3076
|
isMobile,
|
|
3076
3077
|
gridData: isSubTableShowPage
|
|
@@ -817,11 +817,16 @@ export function getHeaderAlign(column, gridParams){
|
|
|
817
817
|
|
|
818
818
|
|
|
819
819
|
export function getHeaderLable(column) {
|
|
820
|
+
let label = column.label
|
|
820
821
|
if (!column.titleValueSet) {
|
|
821
|
-
|
|
822
|
+
label = label.replace(/\\n/g, '</br>')
|
|
822
823
|
} else {
|
|
823
|
-
|
|
824
|
+
label = formatHeader(column)
|
|
824
825
|
}
|
|
826
|
+
if (label === null || label === undefined || label === '') {
|
|
827
|
+
label = column.prop
|
|
828
|
+
}
|
|
829
|
+
return label
|
|
825
830
|
}
|
|
826
831
|
|
|
827
832
|
function formatHeader(column) {
|
package/src/permission.js
CHANGED
|
@@ -151,11 +151,17 @@ router.beforeEach((to, from, next) => {
|
|
|
151
151
|
if (!isDevp && devpRoleCodes) {
|
|
152
152
|
// 表示是开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码,对应运行平台的岗位编码
|
|
153
153
|
// console.log('开发环境设计时生成的运行平台的JWT,且缓存了项目权限编码时,!isDevp && devpRoleCodes')
|
|
154
|
+
console.log('getDevPlatformPermissions---devpRoleCodes=', devpRoleCodes)
|
|
154
155
|
return store.dispatch('getDevPlatformPermissions', devpRoleCodes)
|
|
155
156
|
} else {
|
|
156
157
|
// 开发平台本身的功能或直接平台功能时
|
|
157
158
|
// console.log('开发平台本身的功能或直接平台功能时')
|
|
158
|
-
|
|
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})
|
|
159
165
|
}
|
|
160
166
|
})
|
|
161
167
|
.then((permissions) => {
|
|
@@ -231,9 +231,12 @@ const user = {
|
|
|
231
231
|
},
|
|
232
232
|
|
|
233
233
|
// 获得当前用户权限集合
|
|
234
|
-
getCurrentUserPermissions({ commit },
|
|
234
|
+
getCurrentUserPermissions({ commit }, param) {
|
|
235
235
|
return new Promise((resolve, reject) => {
|
|
236
|
+
const loginName = param.loginName
|
|
237
|
+
const systemCode = param.systemCode
|
|
236
238
|
let storePermissions = getPermissions()
|
|
239
|
+
console.log('getCurrentUserPermissions-----systemCode=', systemCode, 'storePermissions=', storePermissions)
|
|
237
240
|
// 这个判断会导致资源不会重新加载??
|
|
238
241
|
if (
|
|
239
242
|
typeof storePermissions === 'undefined' ||
|
|
@@ -218,7 +218,7 @@ export function isDevpAccess() {
|
|
|
218
218
|
const postManagementCodes = getPostManagementCodes()
|
|
219
219
|
// console.log("isDevAccess----postManagementCodes=",postManagementCodes);
|
|
220
220
|
if(postManagementCodes && postManagementCodes.indexOf(DEV_ROLE_PROJECT_ADMIN_CODE) >= 0 ||
|
|
221
|
-
postManagementCodes.
|
|
221
|
+
postManagementCodes.indexOf(DEV_ROLE_PROJECT_VIEWER_CODE) >= 0){
|
|
222
222
|
// 表示是项目负责人岗位或观察者岗位或平台管理员,且当前登录用户是 devp的应用id
|
|
223
223
|
return true
|
|
224
224
|
}
|