wui-components-v2 1.2.97 → 1.2.98
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.
|
@@ -21,7 +21,6 @@ const props = defineProps<{
|
|
|
21
21
|
pageType?: string
|
|
22
22
|
data: Entities
|
|
23
23
|
rowActions?: rowActions[]
|
|
24
|
-
actions?: rowActions[]
|
|
25
24
|
ractions?: rowActions[]
|
|
26
25
|
zpaging?: any
|
|
27
26
|
enumColumn?: Enums
|
|
@@ -76,12 +75,6 @@ const ractions = computed(() => {
|
|
|
76
75
|
return list.filter(isActionVisible)
|
|
77
76
|
})
|
|
78
77
|
|
|
79
|
-
// actions按钮
|
|
80
|
-
const actions = computed(() => {
|
|
81
|
-
const actions = props.actions || []
|
|
82
|
-
return [...actions.filter(isActionVisible)]
|
|
83
|
-
})
|
|
84
|
-
|
|
85
78
|
// 跳转编辑页面
|
|
86
79
|
function edit() {
|
|
87
80
|
if (props.item.classEditConfigs && props.item.classEditConfigs.length > 0) {
|
|
@@ -398,20 +391,8 @@ const morebutns = computed(() => {
|
|
|
398
391
|
})
|
|
399
392
|
)
|
|
400
393
|
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
actions.value
|
|
404
|
-
// 列表级批量 action(multible === true)只在底部批量操作条展示,不渲染到行上
|
|
405
|
-
.filter(item => item.multible !== true)
|
|
406
|
-
.map(item => {
|
|
407
|
-
return {
|
|
408
|
-
actionType: 'rowActions',
|
|
409
|
-
name: item.title,
|
|
410
|
-
...item,
|
|
411
|
-
}
|
|
412
|
-
})
|
|
413
|
-
)
|
|
414
|
-
}
|
|
394
|
+
// 只有 row 开头的字段(rowActions / ractions / rowCustomButtons)渲染到行上;
|
|
395
|
+
// actions / customButtons 属列表级,分别在底部批量操作条展示,不进每行
|
|
415
396
|
return buts
|
|
416
397
|
})
|
|
417
398
|
|
|
@@ -427,9 +408,16 @@ function goShowWindow(item: rowActions) {
|
|
|
427
408
|
if (!safePath.startsWith('/') && !safePath.startsWith('./') && !safePath.startsWith('../')) {
|
|
428
409
|
safePath = `/${safePath}`
|
|
429
410
|
}
|
|
430
|
-
// 拼接当前列表的 sourceId 与当前行数据 code
|
|
431
|
-
const
|
|
432
|
-
|
|
411
|
+
// 拼接当前列表的 sourceId 与当前行数据 code;path 配置里已携带的参数以配置为准,缺失的才补
|
|
412
|
+
const hasSourceId = /[?&]sourceId=/.test(safePath)
|
|
413
|
+
const hasId = /[?&]id=/.test(safePath)
|
|
414
|
+
const params: string[] = []
|
|
415
|
+
if (!hasSourceId) params.push(`sourceId=${props.sourceId}`)
|
|
416
|
+
if (!hasId) params.push(`id=${props.code}`)
|
|
417
|
+
if (params.length) {
|
|
418
|
+
const sep = safePath.includes('?') ? '&' : '?'
|
|
419
|
+
safePath = `${safePath}${sep}${params.join('&')}`
|
|
420
|
+
}
|
|
433
421
|
console.log('[show_window] 跳转 path:', safePath)
|
|
434
422
|
try {
|
|
435
423
|
router.push(safePath)
|
|
@@ -232,16 +232,16 @@ const selectMode = ref(false)
|
|
|
232
232
|
/**
|
|
233
233
|
* 批量 action 按钮列表:
|
|
234
234
|
* 1. 优先使用 props.batchActions(调用方显式指定);
|
|
235
|
-
* 2.
|
|
235
|
+
* 2. 否则收集列表配置里的 customButtons(全部)与 actions(仅 multible === true),按 id 去重。
|
|
236
236
|
*/
|
|
237
237
|
const batchActionButtons = computed(() => {
|
|
238
238
|
if (props.batchActions && props.batchActions.length) {
|
|
239
239
|
return props.batchActions
|
|
240
240
|
}
|
|
241
|
-
const
|
|
241
|
+
const customs = config.value.customButtons || []
|
|
242
|
+
const actions = (config.value.actions || []).filter(item => item.multible === true)
|
|
242
243
|
const seen = new Set<string>()
|
|
243
|
-
|
|
244
|
-
return merged.filter(item => item.multible === true && (seen.has(item.id) ? false : (seen.add(item.id), true)))
|
|
244
|
+
return [...customs, ...actions].filter(item => (seen.has(item.id) ? false : (seen.add(item.id), true)))
|
|
245
245
|
})
|
|
246
246
|
/** 已选 code 的逗号分隔字符串,供批量接口与弹窗透传 */
|
|
247
247
|
const selectedCodesStr = computed(() => Array.from(selectedCodes.value).join(','))
|
|
@@ -688,7 +688,6 @@ function tabSearchClick(data: any) {
|
|
|
688
688
|
:detail-button-handle="detailButtonHandle"
|
|
689
689
|
:zpaging="Zpaging"
|
|
690
690
|
:enum-column="enumColumn"
|
|
691
|
-
:actions="config.actions"
|
|
692
691
|
:row-actions="config.rowActions"
|
|
693
692
|
:ractions="config.ractions"
|
|
694
693
|
:source-id="internalSourceId"
|
|
@@ -741,7 +740,6 @@ function tabSearchClick(data: any) {
|
|
|
741
740
|
:detail-button-handle="detailButtonHandle"
|
|
742
741
|
:zpaging="Zpaging"
|
|
743
742
|
:enum-column="enumColumn"
|
|
744
|
-
:actions="config.actions"
|
|
745
743
|
:row-actions="config.rowActions"
|
|
746
744
|
:ractions="config.ractions"
|
|
747
745
|
:source-id="internalSourceId"
|