20260831223203
This commit is contained in:
1 parent
4d46ce6c53
commit
3bbcafc5be
91 files changed
+20921
-584
No files matched your search
@@ -45,7 +45,7 @@ function actionButton(action, row, triggerAction, className = 'fms-action-btn')
|
||||
// 确认弹窗:状态化渲染(替代 antdv 的 Modal.confirm 命令式调用),
|
||||
// 由内部 Modal 承载;okType=danger(默认)时用 danger 按钮定制 footer。
|
||||
function createConfirmDialog(state, close) {
|
||||
const { action, row } = state
|
||||
const { action, row } = state.value
|
||||
const config = typeof action.confirm === 'string' ? { title: action.confirm } : action.confirm || {}
|
||||
const title = config.title || '确认操作'
|
||||
const description = config.description ?? config.content ?? '确定要执行此操作吗?'
|
||||
@@ -132,6 +132,9 @@ function createActionsCell(actions) {
|
||||
.filter((action) => isActionVisible(action, row))
|
||||
.map((action) => actionButton(action, row, triggerAction))
|
||||
const visibleMoreItems = (moreAction?.items || []).filter((item) => isActionVisible(item, row))
|
||||
// 确认弹窗必须先于「无更多项」的提前 return 渲染——否则仅内联操作(如删除)点击后
|
||||
// confirmState 已设置但弹窗永远不会出现(表现为「删除按钮没有反应」)。
|
||||
if (confirmState.value) children.push(createConfirmDialog(confirmState, closeConfirm))
|
||||
if (!visibleMoreItems.length) return h('span', { class: 'fms-actions-cell' }, children)
|
||||
|
||||
const menuItems = visibleMoreItems.map((item, index) => ({
|
||||
@@ -200,7 +203,6 @@ function createActionsCell(actions) {
|
||||
)
|
||||
}
|
||||
|
||||
if (confirmState.value) children.push(createConfirmDialog(confirmState, closeConfirm))
|
||||
return h('span', { class: 'fms-actions-cell' }, children)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user