From 9bec4dcae002f36aa23231da11cb03a156b40110 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周三, 30 4月 2025 16:24:16 +0800 Subject: [PATCH] 222 --- PipeLineLems/web/src/components/ConfirmBox/ConfirmBox.tsx | 68 ++++++++++++++++++++++------------ 1 files changed, 44 insertions(+), 24 deletions(-) diff --git a/PipeLineLems/web/src/components/ConfirmBox/ConfirmBox.tsx b/PipeLineLems/web/src/components/ConfirmBox/ConfirmBox.tsx index 7de226d..c8587f7 100644 --- a/PipeLineLems/web/src/components/ConfirmBox/ConfirmBox.tsx +++ b/PipeLineLems/web/src/components/ConfirmBox/ConfirmBox.tsx @@ -1,37 +1,57 @@ -import { createApp, h, ref, nextTick } from 'vue' +import { createApp, h, ref, nextTick, Component } from 'vue' import BaseDialog from '@/components/BaseDialog/index.vue' +import { ElConfigProvider } from 'element-plus' import styles from './ConfirmBox.module.scss' -export const ConfirmBox = (text: string, title = '纭') => { +import { _t } from '@/libs/Language/Language' +export const ConfirmBox = ( + text: string | any, + title = '纭', + attrs: any = {} +) => { return new Promise((resolve, reject) => { const mountNode = document.createElement('div') document.body.appendChild(mountNode) const visible = ref(true) + const RenderProvider = (Widget: any) => { + return ( + <el-config-provider namespace="cs"> + <Widget /> + </el-config-provider> + ) + } const app = createApp({ render() { - return h( - BaseDialog, - { - modelValue: visible.value, - 'onUpdate:modelValue': (value: boolean) => { - visible.value = value + return RenderProvider( + h( + BaseDialog, + { + class: styles.ConfirmBox, + modelValue: visible.value, + 'onUpdate:modelValue': (value: boolean) => { + visible.value = value + }, + title: _t(title), + width: '379px', + onConfirm: () => { + resolve(true) + nextTick(() => { + mountNode.remove() + }) + }, + onClose: () => { + reject(false) + nextTick(() => { + mountNode.remove() + }) + }, + ...attrs, }, - title: title, - width: '379px', - onConfirm: () => { - resolve(true) - nextTick(() => { - mountNode.remove() - }) - }, - onClose: () => { - reject(false) - nextTick(() => { - mountNode.remove() - }) - }, - }, - h('div', { class: styles.deleteDialog }, text) + { + default: h('div', { class: styles.confirmDialog }, text), + footer: attrs.footer ? attrs.footer : null, + } + ) ) }, }) -- Gitblit v1.9.3