From 053695d38fa25baab303625ddfc2481eea0ab02b Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周三, 07 5月 2025 11:45:21 +0800
Subject: [PATCH] 添加可空
---
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