From 11bff3e93067768199bab9bfff37e8eae17d8d92 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周一, 05 5月 2025 16:33:45 +0800 Subject: [PATCH] 库存信息页面 --- HIAWms/web/src/components/ConfirmBox/ConfirmBox.tsx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/HIAWms/web/src/components/ConfirmBox/ConfirmBox.tsx b/HIAWms/web/src/components/ConfirmBox/ConfirmBox.tsx new file mode 100644 index 0000000..7de226d --- /dev/null +++ b/HIAWms/web/src/components/ConfirmBox/ConfirmBox.tsx @@ -0,0 +1,41 @@ +import { createApp, h, ref, nextTick } from 'vue' +import BaseDialog from '@/components/BaseDialog/index.vue' +import styles from './ConfirmBox.module.scss' +export const ConfirmBox = (text: string, title = '纭') => { + return new Promise((resolve, reject) => { + const mountNode = document.createElement('div') + document.body.appendChild(mountNode) + + const visible = ref(true) + const app = createApp({ + render() { + return h( + BaseDialog, + { + modelValue: visible.value, + 'onUpdate:modelValue': (value: boolean) => { + visible.value = value + }, + title: title, + width: '379px', + onConfirm: () => { + resolve(true) + nextTick(() => { + mountNode.remove() + }) + }, + onClose: () => { + reject(false) + nextTick(() => { + mountNode.remove() + }) + }, + }, + h('div', { class: styles.deleteDialog }, text) + ) + }, + }) + + app.mount(mountNode) + }) +} -- Gitblit v1.9.3