This commit is contained in:
张成
2025-10-10 00:08:35 +08:00
parent 88cd8d6e72
commit f86ee00e3b
15 changed files with 72 additions and 403 deletions

View File

@@ -110,20 +110,31 @@ export default class uiTool {
}
static delConfirm(callback) {
if (window.rootVue && window.rootVue.$Modal) {
window.rootVue.$Modal.confirm({
title: '温馨提示',
content: '<p>你确定删除吗?</p>',
onOk: () => {
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('你确定删除吗?')) {
callback && callback()
}
})
}
} catch (error) {
console.error('delConfirm error:', error)
}
}
static showConfirm({ title = '温馨提示', content = '内容' }, callback) {
if (window.rootVue && window.rootVue.$Modal) {
window.rootVue.$Modal.confirm({
const Modal = (window.framework && window.framework.ViewUI && window.framework.ViewUI.Modal) || window.$Modal
if (Modal) {
Modal.confirm({
title,
content,
onOk: () => {