This commit is contained in:
张成
2025-10-10 00:13:11 +08:00
parent f86ee00e3b
commit b39b206c4c
4 changed files with 27 additions and 38 deletions

View File

@@ -110,24 +110,15 @@ export default class uiTool {
}
static delConfirm(callback) {
try {
const Modal = (window.framework && window.framework.ViewUI && window.framework.ViewUI.Modal) || window.$Modal
if (Modal) {
Modal.confirm({
title: '温馨提示',
content: '<p>你确定删除吗?</p>',
onOk: () => {
callback && callback()
}
})
} else {
// 如果 Modal 不存在,使用原生确认框
if (confirm('你确定删除吗?')) {
const Modal = (window.framework && window.framework.ViewUI && window.framework.ViewUI.Modal) || window.$Modal
if (Modal) {
Modal.confirm({
title: '温馨提示',
content: '<p>你确定删除吗?</p>',
onOk: () => {
callback && callback()
}
}
} catch (error) {
console.error('delConfirm error:', error)
})
}
}