agilebuilder-ui 1.1.40 → 1.1.41-rc1
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-7bd60242.js → 401-57a2eb33.js} +1 -1
- package/lib/{404-d2daf8d0.js → 404-63bcf1b1.js} +1 -1
- package/lib/{iframe-page-4c181c23.js → iframe-page-0abc41bb.js} +1 -1
- package/lib/{index-e9efe5c2.js → index-ea84c751.js} +35461 -35339
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +1 -1
- package/lib/super-ui.umd.cjs +94 -101
- package/lib/{tab-content-iframe-index-77bf55ca.js → tab-content-iframe-index-64207b54.js} +1 -1
- package/lib/{tab-content-index-8157438c.js → tab-content-index-e42e1938.js} +1 -1
- package/lib/{tache-subprocess-history-bc9f1bea.js → tache-subprocess-history-85f0573c.js} +1 -1
- package/package.json +1 -1
- package/packages/fs-preview/src/fs-preview.vue +194 -89
- package/packages/fs-upload-list/src/fs-upload-list.vue +60 -204
- package/packages/fs-upload-new/src/fs-upload-new.vue +1 -1
- package/packages/super-grid/src/dynamic-input.vue +10 -28
- package/packages/super-grid/src/normal-column-content.vue +8 -6
- 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 +1 -1
- package/packages/super-grid/src/search-methods.js +489 -577
- package/packages/super-grid/src/super-grid-service.js +141 -153
- package/packages/super-grid/src/super-grid.vue +14 -12
- package/src/utils/permission.js +86 -9
|
@@ -3,6 +3,7 @@ import { $emit } from '../../utils/gogocodeTransfer'
|
|
|
3
3
|
import Sortable from 'sortablejs'
|
|
4
4
|
import { packageEnumAndBeanColumnValueSets } from '../../utils/value-set'
|
|
5
5
|
import store from './store'
|
|
6
|
+
import { checkPermission, isFieldHasBranchAuth } from '../../../src/utils/permission'
|
|
6
7
|
import { isHasOptionFunction } from './utils'
|
|
7
8
|
|
|
8
9
|
const superGridService = {
|
|
@@ -25,8 +26,7 @@ const superGridService = {
|
|
|
25
26
|
resolve()
|
|
26
27
|
} else {
|
|
27
28
|
let additionalParams
|
|
28
|
-
const additionalParamMap =
|
|
29
|
-
window.sessionStorage.getItem('additionalParamMap')
|
|
29
|
+
const additionalParamMap = window.sessionStorage.getItem('additionalParamMap')
|
|
30
30
|
if (additionalParamMap) {
|
|
31
31
|
console.log('进入判断', additionalParamMap)
|
|
32
32
|
if (additionalParamMap && typeof additionalParamMap === 'object') {
|
|
@@ -35,20 +35,14 @@ const superGridService = {
|
|
|
35
35
|
additionalParams = additionalParamMap
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
39
|
-
this.options.additionalParamMap &&
|
|
40
|
-
typeof this.options.additionalParamMap === 'object'
|
|
41
|
-
) {
|
|
38
|
+
if (this.options.additionalParamMap && typeof this.options.additionalParamMap === 'object') {
|
|
42
39
|
const optionParam = JSON.stringify(this.options.additionalParamMap)
|
|
43
40
|
if (additionalParams) {
|
|
44
41
|
Object.assign(additionalParams, optionParam)
|
|
45
42
|
} else {
|
|
46
43
|
additionalParams = optionParam
|
|
47
44
|
}
|
|
48
|
-
} else if (
|
|
49
|
-
this.options.additionalParamMap &&
|
|
50
|
-
this.options.additionalParamMap !== ''
|
|
51
|
-
) {
|
|
45
|
+
} else if (this.options.additionalParamMap && this.options.additionalParamMap !== '') {
|
|
52
46
|
const optionParam = this.options.additionalParamMap
|
|
53
47
|
if (additionalParams) {
|
|
54
48
|
Object.assign(additionalParams, optionParam)
|
|
@@ -67,9 +61,18 @@ const superGridService = {
|
|
|
67
61
|
this.isLoadCompleteQuery(data.columns)
|
|
68
62
|
// 行编辑设置所有字段的默认值null时使用,优化行编辑性能
|
|
69
63
|
let allColumns = []
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
64
|
+
// if (structuredClone) {
|
|
65
|
+
// structuredClone
|
|
66
|
+
// allColumns = structuredClone(data.columns)
|
|
67
|
+
// } else {
|
|
68
|
+
allColumns.concat(JSON.parse(JSON.stringify(data.columns)))
|
|
69
|
+
// }
|
|
70
|
+
if (data.branchFieldsMap && Object.keys(data.branchFieldsMap).length > 0) {
|
|
71
|
+
if (data.branchFieldsMap.allAuthFields && data.branchFieldsMap.allAuthFields.length > 0) {
|
|
72
|
+
gridParams.branchFieldsMap = data.branchFieldsMap
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
data.columns = this.filterHasAuthColumns(data.columns, gridParams, data.basicInfo?.systemCode)
|
|
73
76
|
// 根据this.options.showColumns设置显示的字段
|
|
74
77
|
this.getShowColumns(data)
|
|
75
78
|
// 将列表信息存入store缓存中,用来导出时获取国际化名
|
|
@@ -101,14 +104,14 @@ const superGridService = {
|
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
// 需要多个组件共享的数据放到store中,避免组件定义一堆props来接收这些共享数据
|
|
104
|
-
packageEnumAndBeanColumnValueSets(
|
|
107
|
+
packageEnumAndBeanColumnValueSets(
|
|
108
|
+
data.columns,
|
|
109
|
+
this.code,
|
|
110
|
+
gridParams.additionalParamMap,
|
|
111
|
+
this.parentFormData
|
|
112
|
+
)
|
|
105
113
|
.then(() => {
|
|
106
|
-
return this.getDynamicColumnByBean(
|
|
107
|
-
additionalParams,
|
|
108
|
-
data.dynamicColumnInfo,
|
|
109
|
-
data.columns,
|
|
110
|
-
gridParams
|
|
111
|
-
)
|
|
114
|
+
return this.getDynamicColumnByBean(additionalParams, data.dynamicColumnInfo, data.columns, gridParams)
|
|
112
115
|
})
|
|
113
116
|
.then((dynamicColumns) => {
|
|
114
117
|
const b = new Date().getTime()
|
|
@@ -117,21 +120,13 @@ const superGridService = {
|
|
|
117
120
|
showColumns = this.options.showColumns.split(',')
|
|
118
121
|
}
|
|
119
122
|
let customDynamicColumns = dynamicColumns
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
customDynamicColumns.length === 0
|
|
123
|
-
) {
|
|
124
|
-
if (
|
|
125
|
-
this.options.dynamicColumns &&
|
|
126
|
-
this.options.dynamicColumns.length > 0
|
|
127
|
-
) {
|
|
123
|
+
if (!customDynamicColumns || customDynamicColumns.length === 0) {
|
|
124
|
+
if (this.options.dynamicColumns && this.options.dynamicColumns.length > 0) {
|
|
128
125
|
customDynamicColumns = this.options.dynamicColumns
|
|
129
126
|
}
|
|
130
127
|
}
|
|
131
128
|
if (customDynamicColumns && customDynamicColumns.length > 0) {
|
|
132
|
-
allColumns = allColumns.concat(
|
|
133
|
-
JSON.parse(JSON.stringify(customDynamicColumns))
|
|
134
|
-
)
|
|
129
|
+
allColumns = allColumns.concat(JSON.parse(JSON.stringify(customDynamicColumns)))
|
|
135
130
|
if (showColumns && showColumns.length > 0) {
|
|
136
131
|
for (let i = 0; i < customDynamicColumns.length; i++) {
|
|
137
132
|
const prop = customDynamicColumns[i].prop
|
|
@@ -145,9 +140,7 @@ const superGridService = {
|
|
|
145
140
|
}
|
|
146
141
|
data.columns = data.columns.concat(customDynamicColumns)
|
|
147
142
|
// 按照排序字段的值升序排列字段
|
|
148
|
-
data.columns = data.columns.sort(
|
|
149
|
-
(col1, col2) => col1.displayOrder - col2.displayOrder
|
|
150
|
-
)
|
|
143
|
+
data.columns = data.columns.sort((col1, col2) => col1.displayOrder - col2.displayOrder)
|
|
151
144
|
}
|
|
152
145
|
Object.assign(this, data)
|
|
153
146
|
if (this.options && typeof isSqlSetting === 'undefined') {
|
|
@@ -177,22 +170,21 @@ const superGridService = {
|
|
|
177
170
|
gridParams.pageContext = this.pageContext
|
|
178
171
|
gridParams.configureObj = this.configureObj
|
|
179
172
|
this.tableName = this.basicInfo.tableName
|
|
180
|
-
gridParams.hiddenColumns = this.options.hiddenColumns
|
|
173
|
+
gridParams.hiddenColumns = this.options.hiddenColumns
|
|
174
|
+
? JSON.parse(JSON.stringify(this.options.hiddenColumns))
|
|
175
|
+
: []
|
|
181
176
|
if (this.pagination) {
|
|
182
177
|
// 监控每行显示多少条变量使用
|
|
183
178
|
this.pageSize = this.pagination.pageSize
|
|
184
179
|
}
|
|
185
180
|
gridParams.query = this.query
|
|
186
181
|
gridParams.dynamicColumnInfo = this.dynamicColumnInfo
|
|
187
|
-
gridParams.mainDefaultValueColumns =
|
|
188
|
-
this.mainDefaultValueColumns
|
|
182
|
+
gridParams.mainDefaultValueColumns = this.mainDefaultValueColumns
|
|
189
183
|
gridParams.contextParameter = this.contextParameter
|
|
190
184
|
// 是否显示分页区域
|
|
191
185
|
this.isShowPage = this.isShowPageArea()
|
|
192
186
|
// 子表是否分页
|
|
193
|
-
this.isSubTableShowPage = this.isFormSubTable
|
|
194
|
-
? this.isShowPage
|
|
195
|
-
: false
|
|
187
|
+
this.isSubTableShowPage = this.isFormSubTable ? this.isShowPage : false
|
|
196
188
|
gridParams.isSubTableShowPage = this.isSubTableShowPage
|
|
197
189
|
this.getDetailColumn()
|
|
198
190
|
this.hasLoadedColumns = true
|
|
@@ -213,8 +205,7 @@ const superGridService = {
|
|
|
213
205
|
// 表示是页面展示模式
|
|
214
206
|
} else if (typeof this.options.initSearch === 'undefined') {
|
|
215
207
|
if (
|
|
216
|
-
typeof gridParams.basicInfo.initializationQuery ===
|
|
217
|
-
'undefined' ||
|
|
208
|
+
typeof gridParams.basicInfo.initializationQuery === 'undefined' ||
|
|
218
209
|
gridParams.basicInfo.initializationQuery
|
|
219
210
|
) {
|
|
220
211
|
// console.log('fetchData-----this.loadCompleteQuery=', this.loadCompleteQuery, '1111111')
|
|
@@ -256,35 +247,35 @@ const superGridService = {
|
|
|
256
247
|
if (this.isFormSubTable && this.options.showRowForm) {
|
|
257
248
|
// 显示详情列
|
|
258
249
|
const detailColumn = {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
250
|
+
prop: '$detail',
|
|
251
|
+
orgProp: '$detail',
|
|
252
|
+
label: '详情',
|
|
253
|
+
dataType: 'TEXT',
|
|
254
|
+
width: 80,
|
|
255
|
+
show: true,
|
|
256
|
+
exportable: false,
|
|
257
|
+
sortable: 'false',
|
|
258
|
+
filterable: false,
|
|
259
|
+
fixed: 'left',
|
|
260
|
+
span: false,
|
|
261
|
+
queryType: 'no',
|
|
262
|
+
querySetting: '{}',
|
|
263
|
+
editable: false,
|
|
264
|
+
componentType: 'input',
|
|
265
|
+
titleAlign: 'center',
|
|
266
|
+
contAlign: 'center',
|
|
267
|
+
showType: 'default',
|
|
268
|
+
exportType: 'default',
|
|
269
|
+
displayOrderType: 'default',
|
|
270
|
+
displayOrder: 5,
|
|
271
|
+
widthType: 'default',
|
|
272
|
+
ifMultiData: true,
|
|
273
|
+
dynamic: false,
|
|
274
|
+
total: false,
|
|
275
|
+
custom: true,
|
|
276
|
+
remoteEnum: false,
|
|
277
|
+
fuzzy: true,
|
|
278
|
+
groupHeader: false
|
|
288
279
|
}
|
|
289
280
|
detailColumn.label = this.$t('superGrid.detail')
|
|
290
281
|
this.detailColumn = detailColumn
|
|
@@ -297,10 +288,7 @@ const superGridService = {
|
|
|
297
288
|
if (this.settings) {
|
|
298
289
|
resolve(this.settings)
|
|
299
290
|
} else {
|
|
300
|
-
const url =
|
|
301
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
302
|
-
'/component/super-grids/' +
|
|
303
|
-
this.code
|
|
291
|
+
const url = window.$vueApp.config.globalProperties.baseAPI + '/component/super-grids/' + this.code
|
|
304
292
|
const param = {}
|
|
305
293
|
const isSqlSetting = this.options.isSql
|
|
306
294
|
if (this.options && typeof isSqlSetting !== 'undefined') {
|
|
@@ -324,7 +312,8 @@ const superGridService = {
|
|
|
324
312
|
.post(url, param)
|
|
325
313
|
.then((data) => {
|
|
326
314
|
resolve(data)
|
|
327
|
-
})
|
|
315
|
+
})
|
|
316
|
+
.catch((error) => {
|
|
328
317
|
reject(error)
|
|
329
318
|
})
|
|
330
319
|
}
|
|
@@ -334,13 +323,17 @@ const superGridService = {
|
|
|
334
323
|
if (columns !== null) {
|
|
335
324
|
let queryParameterSize = 0
|
|
336
325
|
columns.forEach((column) => {
|
|
337
|
-
if (
|
|
338
|
-
column.hasOwnProperty('queryType') &&
|
|
339
|
-
column.hasOwnProperty('prop')
|
|
340
|
-
) {
|
|
326
|
+
if (column.hasOwnProperty('queryType') && column.hasOwnProperty('prop')) {
|
|
341
327
|
if (column.prop !== '$index' && column.prop !== '$selection') {
|
|
342
|
-
if (
|
|
343
|
-
column.
|
|
328
|
+
if (
|
|
329
|
+
column.queryType &&
|
|
330
|
+
column.queryType !== 'no' &&
|
|
331
|
+
column.componentType &&
|
|
332
|
+
(column.componentType === 'date' ||
|
|
333
|
+
column.componentType === 'dateSection' ||
|
|
334
|
+
column.componentType === 'timePicker' ||
|
|
335
|
+
column.componentType === 'dateTimePicker')
|
|
336
|
+
) {
|
|
344
337
|
// 配置了默认值
|
|
345
338
|
if (column.controlConfig && column.controlConfig.timeDefaultQueryRange) {
|
|
346
339
|
queryParameterSize++
|
|
@@ -372,24 +365,12 @@ const superGridService = {
|
|
|
372
365
|
}
|
|
373
366
|
})
|
|
374
367
|
},
|
|
375
|
-
getDynamicColumnByBean(
|
|
376
|
-
additionalParams,
|
|
377
|
-
dynamicColumnInfos,
|
|
378
|
-
columns,
|
|
379
|
-
gridParams
|
|
380
|
-
) {
|
|
368
|
+
getDynamicColumnByBean(additionalParams, dynamicColumnInfos, columns, gridParams) {
|
|
381
369
|
return new Promise((resolve, reject) => {
|
|
382
|
-
if (
|
|
383
|
-
gridParams.options.extraParam &&
|
|
384
|
-
gridParams.options.extraParam.entityMap
|
|
385
|
-
) {
|
|
370
|
+
if (gridParams.options.extraParam && gridParams.options.extraParam.entityMap) {
|
|
386
371
|
this.parentFormData = gridParams.options.extraParam.entityMap
|
|
387
372
|
}
|
|
388
|
-
if (
|
|
389
|
-
!this.options.isPageInfo &&
|
|
390
|
-
dynamicColumnInfos &&
|
|
391
|
-
dynamicColumnInfos.length > 0
|
|
392
|
-
) {
|
|
373
|
+
if (!this.options.isPageInfo && dynamicColumnInfos && dynamicColumnInfos.length > 0) {
|
|
393
374
|
const totalDynamicColumns = []
|
|
394
375
|
this.getDynamicColumnByBeanWithOneSet(
|
|
395
376
|
additionalParams,
|
|
@@ -422,58 +403,48 @@ const superGridService = {
|
|
|
422
403
|
) {
|
|
423
404
|
return new Promise((resolve, reject) => {
|
|
424
405
|
if (dynamicColumnInfo && dynamicColumnInfo.beanName) {
|
|
425
|
-
const url =
|
|
426
|
-
window.$vueApp.config.globalProperties.baseURL +
|
|
427
|
-
'/common/dynamic-columns'
|
|
406
|
+
const url = window.$vueApp.config.globalProperties.baseURL + '/common/dynamic-columns'
|
|
428
407
|
const param = {
|
|
429
408
|
additionalParams, // 附加参数对象
|
|
430
409
|
listCode: this.code,
|
|
431
410
|
columns,
|
|
432
|
-
beanName: dynamicColumnInfo.beanName
|
|
411
|
+
beanName: dynamicColumnInfo.beanName
|
|
433
412
|
}
|
|
434
413
|
if (this.parentFormData) {
|
|
435
414
|
// 初始化表单时,加载动态列需要
|
|
436
415
|
if (gridParams.dynamicTemp) {
|
|
437
416
|
param.parent = gridParams.dynamicTemp.parent
|
|
438
|
-
param.watchParentAttrValues =
|
|
439
|
-
gridParams.dynamicTemp.watchParentAttrValues
|
|
417
|
+
param.watchParentAttrValues = gridParams.dynamicTemp.watchParentAttrValues
|
|
440
418
|
} else {
|
|
441
419
|
param.parent = this.parentFormData
|
|
442
420
|
}
|
|
443
421
|
// 监听主表字段的值
|
|
444
422
|
if (dynamicColumnInfo.watchParentAttr) {
|
|
445
|
-
const watchParentAttrs =
|
|
446
|
-
dynamicColumnInfo.watchParentAttr.split(',')
|
|
423
|
+
const watchParentAttrs = dynamicColumnInfo.watchParentAttr.split(',')
|
|
447
424
|
watchParentAttrs.forEach((watchParentAttr) => {
|
|
448
425
|
if (watchParentAttr) {
|
|
449
426
|
// 存储属性对应的值
|
|
450
427
|
if (!param.watchParentAttrValues) {
|
|
451
428
|
param.watchParentAttrValues = {}
|
|
452
429
|
}
|
|
453
|
-
param.watchParentAttrValues[watchParentAttr] =
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
430
|
+
param.watchParentAttrValues[watchParentAttr] = this.parentFormData[watchParentAttr]
|
|
431
|
+
const unWatch = this.$watch('parentFormData.' + watchParentAttr, function (newValue, oldValue) {
|
|
432
|
+
// 重新加载表格及表格数据
|
|
433
|
+
if (!gridParams.dynamicTemp) {
|
|
434
|
+
gridParams.dynamicTemp = {}
|
|
435
|
+
}
|
|
436
|
+
gridParams.dynamicTemp.parent = this.parentFormData
|
|
437
|
+
if (!gridParams.dynamicTemp.watchParentAttrValues) {
|
|
438
|
+
gridParams.dynamicTemp.watchParentAttrValues = {}
|
|
439
|
+
}
|
|
440
|
+
gridParams.dynamicTemp.watchParentAttrValues[watchParentAttr] = newValue
|
|
441
|
+
if (this.$refs && this.$refs.superGrid) {
|
|
442
|
+
// 手动注销watch,否则会调用多次watch
|
|
443
|
+
unWatch()
|
|
458
444
|
// 重新加载表格及表格数据
|
|
459
|
-
|
|
460
|
-
gridParams.dynamicTemp = {}
|
|
461
|
-
}
|
|
462
|
-
gridParams.dynamicTemp.parent = this.parentFormData
|
|
463
|
-
if (!gridParams.dynamicTemp.watchParentAttrValues) {
|
|
464
|
-
gridParams.dynamicTemp.watchParentAttrValues = {}
|
|
465
|
-
}
|
|
466
|
-
gridParams.dynamicTemp.watchParentAttrValues[
|
|
467
|
-
watchParentAttr
|
|
468
|
-
] = newValue
|
|
469
|
-
if (this.$refs && this.$refs.superGrid) {
|
|
470
|
-
// 手动注销watch,否则会调用多次watch
|
|
471
|
-
unWatch()
|
|
472
|
-
// 重新加载表格及表格数据
|
|
473
|
-
$emit(this, 'reload-grid')
|
|
474
|
-
}
|
|
445
|
+
$emit(this, 'reload-grid')
|
|
475
446
|
}
|
|
476
|
-
)
|
|
447
|
+
})
|
|
477
448
|
}
|
|
478
449
|
})
|
|
479
450
|
}
|
|
@@ -530,10 +501,7 @@ const superGridService = {
|
|
|
530
501
|
// return listColumn.listColumnFixed === 'left' || listColumn.listColumnFixed === 'right'
|
|
531
502
|
// })
|
|
532
503
|
for (var r = 0; r < vm.columns.length; r++) {
|
|
533
|
-
if (
|
|
534
|
-
vm.columns[r].fixed === 'left' ||
|
|
535
|
-
vm.columns[r].fixed === 'right'
|
|
536
|
-
) {
|
|
504
|
+
if (vm.columns[r].fixed === 'left' || vm.columns[r].fixed === 'right') {
|
|
537
505
|
frozenArr.push(r)
|
|
538
506
|
}
|
|
539
507
|
}
|
|
@@ -579,12 +547,7 @@ const superGridService = {
|
|
|
579
547
|
}
|
|
580
548
|
}
|
|
581
549
|
}
|
|
582
|
-
vm.indexAfterTheChangeUpdateDisplayOrder(
|
|
583
|
-
vm.columns,
|
|
584
|
-
oldIndex,
|
|
585
|
-
newIndex,
|
|
586
|
-
'displayOrder'
|
|
587
|
-
)
|
|
550
|
+
vm.indexAfterTheChangeUpdateDisplayOrder(vm.columns, oldIndex, newIndex, 'displayOrder')
|
|
588
551
|
let splitArr = []
|
|
589
552
|
if (oldIndex > newIndex) {
|
|
590
553
|
// 从后往前
|
|
@@ -595,14 +558,10 @@ const superGridService = {
|
|
|
595
558
|
}
|
|
596
559
|
const params = {
|
|
597
560
|
listCode: vm.code,
|
|
598
|
-
columns: splitArr
|
|
561
|
+
columns: splitArr
|
|
599
562
|
}
|
|
600
563
|
vm.$http
|
|
601
|
-
.post(
|
|
602
|
-
window.$vueApp.config.globalProperties.baseAPI +
|
|
603
|
-
'/component/super-grids/drag-columns',
|
|
604
|
-
params
|
|
605
|
-
)
|
|
564
|
+
.post(window.$vueApp.config.globalProperties.baseAPI + '/component/super-grids/drag-columns', params)
|
|
606
565
|
.then((data) => {
|
|
607
566
|
console.log('移动成功')
|
|
608
567
|
})
|
|
@@ -627,7 +586,7 @@ const superGridService = {
|
|
|
627
586
|
// vm.$set(targetItem, 'displayOrder', currentDisplayOrder)
|
|
628
587
|
// vm.$set(targetItem, 'displayOrderType', 'custom')
|
|
629
588
|
// })
|
|
630
|
-
}
|
|
589
|
+
}
|
|
631
590
|
})
|
|
632
591
|
}
|
|
633
592
|
}
|
|
@@ -652,7 +611,7 @@ const superGridService = {
|
|
|
652
611
|
that.columns.splice(oldIndex, 1)
|
|
653
612
|
that.columns.splice(newIndex, 0, oldItem)
|
|
654
613
|
$emit(this, 'columnDrop', oldIndex, newIndex)
|
|
655
|
-
}
|
|
614
|
+
}
|
|
656
615
|
})
|
|
657
616
|
}
|
|
658
617
|
}
|
|
@@ -705,11 +664,7 @@ const superGridService = {
|
|
|
705
664
|
}
|
|
706
665
|
},
|
|
707
666
|
getDisplayOrder(column, dragIndex) {
|
|
708
|
-
if (
|
|
709
|
-
column &&
|
|
710
|
-
column.displayOrder !== undefined &&
|
|
711
|
-
column.displayOrder !== null
|
|
712
|
-
) {
|
|
667
|
+
if (column && column.displayOrder !== undefined && column.displayOrder !== null) {
|
|
713
668
|
return column.displayOrder
|
|
714
669
|
} else {
|
|
715
670
|
return dragIndex + 1
|
|
@@ -771,13 +726,13 @@ const superGridService = {
|
|
|
771
726
|
if (width !== undefined) {
|
|
772
727
|
const params = {
|
|
773
728
|
prop: prop,
|
|
774
|
-
width: width + ''
|
|
729
|
+
width: width + ''
|
|
775
730
|
}
|
|
776
731
|
this.$http
|
|
777
732
|
.post(
|
|
778
733
|
window.$vueApp.config.globalProperties.baseAPI +
|
|
779
|
-
|
|
780
|
-
|
|
734
|
+
'/component/super-grids/setting-column-widths/' +
|
|
735
|
+
this.code,
|
|
781
736
|
params
|
|
782
737
|
)
|
|
783
738
|
.then((data) => {
|
|
@@ -791,5 +746,38 @@ const superGridService = {
|
|
|
791
746
|
}
|
|
792
747
|
})
|
|
793
748
|
},
|
|
749
|
+
filterHasAuthColumns(columns, gridParams, systemCode) {
|
|
750
|
+
if(!this.pageContext || !this.configureObj) {
|
|
751
|
+
return columns
|
|
752
|
+
}
|
|
753
|
+
const prop = this.configureObj.code ? this.configureObj.code : this.code
|
|
754
|
+
if (!this.pageContext.subTablePageInfo) {
|
|
755
|
+
this.pageContext.subTablePageInfo = {}
|
|
756
|
+
}
|
|
757
|
+
if (!this.pageContext.subTablePageInfo[prop]) {
|
|
758
|
+
this.pageContext.subTablePageInfo[prop] = {}
|
|
759
|
+
}
|
|
760
|
+
this.pageContext.subTablePageInfo[prop].fields = []
|
|
761
|
+
return columns.filter((column) => {
|
|
762
|
+
// 如果有 functionCode,则检查权限
|
|
763
|
+
let hasAuth = true
|
|
764
|
+
if (gridParams.branchFieldsMap) {
|
|
765
|
+
// 检查分支权限
|
|
766
|
+
hasAuth = isFieldHasBranchAuth(gridParams.branchFieldsMap, column.prop)
|
|
767
|
+
}
|
|
768
|
+
if (column.functionCode) {
|
|
769
|
+
hasAuth = checkPermission(column.functionCode, systemCode)
|
|
770
|
+
}
|
|
771
|
+
if (hasAuth) {
|
|
772
|
+
if (column.prop !== '$index' && column.prop !== '$selection') {
|
|
773
|
+
this.pageContext.subTablePageInfo[prop].fields.push(column.prop)
|
|
774
|
+
}
|
|
775
|
+
return true
|
|
776
|
+
} else {
|
|
777
|
+
// 如果没有权限,则不显示该列
|
|
778
|
+
return false
|
|
779
|
+
}
|
|
780
|
+
})
|
|
781
|
+
}
|
|
794
782
|
}
|
|
795
783
|
export default superGridService
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
|
|
140
140
|
<columns-config
|
|
141
141
|
v-if="showColumnConfig"
|
|
142
|
-
:columns="
|
|
142
|
+
:columns="visibleColumns"
|
|
143
143
|
:list-code="code"
|
|
144
144
|
:is-sql="isSql"
|
|
145
145
|
@close="closeCustomConfig($event)"
|
|
@@ -220,7 +220,6 @@ import events from './events'
|
|
|
220
220
|
import publicMethods from './public-methods'
|
|
221
221
|
import superGridService from './super-grid-service'
|
|
222
222
|
import formValidatorService from './formValidatorUtil'
|
|
223
|
-
import { getSystemCode } from '../../../src/utils/permissionAuth'
|
|
224
223
|
import apis from './apis'
|
|
225
224
|
import headerContextMenu from './header-context-menu.vue'
|
|
226
225
|
import { isMobileBrowser, isPromise } from '../../../src/utils/common-util'
|
|
@@ -488,13 +487,11 @@ export default {
|
|
|
488
487
|
const gridParams = store.get(this.code)
|
|
489
488
|
const operations = this.getOptionOperations()
|
|
490
489
|
gridParams.canntEdit = false
|
|
491
|
-
|
|
492
490
|
const setAttrs = (data) => data.map((item) => ({ property: item.prop, ...item }))
|
|
493
|
-
|
|
494
491
|
if (operations && operations.operation && operations.operation.length > 0) {
|
|
495
492
|
operations.operation.forEach((buttonInfo) => {
|
|
496
493
|
if (buttonInfo.props.code === 'lineEditUpdate') {
|
|
497
|
-
if (checkPermission(buttonInfo.props.functionCode)) {
|
|
494
|
+
if (checkPermission(buttonInfo.props.functionCode, this.basicInfo.systemCode)) {
|
|
498
495
|
gridParams.canntEdit = true
|
|
499
496
|
}
|
|
500
497
|
}
|
|
@@ -603,15 +600,17 @@ export default {
|
|
|
603
600
|
},
|
|
604
601
|
scrollbarAlwaysOn() {
|
|
605
602
|
// 检查全局 Vue 应用配置中是否有 scrollbarAlwaysOn 属性
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
603
|
+
if (
|
|
604
|
+
window.$vueApp &&
|
|
605
|
+
window.$vueApp.config &&
|
|
606
|
+
window.$vueApp.config.globalProperties &&
|
|
607
|
+
window.$vueApp.config.globalProperties.scrollbarAlwaysOn !== undefined
|
|
608
|
+
) {
|
|
610
609
|
// 返回全局配置的值
|
|
611
|
-
return window.$vueApp.config.globalProperties.scrollbarAlwaysOn
|
|
610
|
+
return window.$vueApp.config.globalProperties.scrollbarAlwaysOn
|
|
612
611
|
}
|
|
613
612
|
// 默认返回 false
|
|
614
|
-
return false
|
|
613
|
+
return false
|
|
615
614
|
}
|
|
616
615
|
// ,
|
|
617
616
|
// hasLoadMainTable() {
|
|
@@ -1726,7 +1725,7 @@ export default {
|
|
|
1726
1725
|
// 父级字段名,例如:parentId 或 fk_parent_id
|
|
1727
1726
|
param['parentProp'] = this.parentProp
|
|
1728
1727
|
// 传入系统code
|
|
1729
|
-
param.systemCode =
|
|
1728
|
+
param.systemCode = this.basicInfo.systemCode
|
|
1730
1729
|
|
|
1731
1730
|
requestUrl = this.options.subRowUrl
|
|
1732
1731
|
}
|
|
@@ -3394,6 +3393,9 @@ export default {
|
|
|
3394
3393
|
},
|
|
3395
3394
|
getSuperGridRef() {
|
|
3396
3395
|
return this.$refs.superGrid
|
|
3396
|
+
},
|
|
3397
|
+
getColumns() {
|
|
3398
|
+
return this.columns
|
|
3397
3399
|
}
|
|
3398
3400
|
},
|
|
3399
3401
|
emits: [
|