From dade6a8b4772abc113383246d05ab59162630e7c Mon Sep 17 00:00:00 2001
From: zhangwei <1504152376@qq.com>
Date: 星期三, 27 八月 2025 17:21:21 +0800
Subject: [PATCH] '上传变更公告获取详情与删除'

---
 src/components/ReDialog/index.vue |   49 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/src/components/ReDialog/index.vue b/src/components/ReDialog/index.vue
index fb3abaf..ec9143d 100644
--- a/src/components/ReDialog/index.vue
+++ b/src/components/ReDialog/index.vue
@@ -17,11 +17,56 @@
 
 const sureBtnMap = ref({});
 const fullscreen = ref(false);
-
+const isPush = (footerButtons, options) => {
+  let arr = [
+    {
+      label: "鍙栨秷",
+      text: true,
+      bg: true,
+      btnClick: ({ dialog: { options, index } }) => {
+        const done = () => closeDialog(options, index, { command: "cancel" });
+        if (options?.beforeCancel && isFunction(options?.beforeCancel)) {
+          options.beforeCancel(done, { options, index });
+        } else {
+          done();
+        }
+      }
+    },
+    {
+      label: "纭畾",
+      type: "primary",
+      text: true,
+      bg: true,
+      popconfirm: options?.popconfirm,
+      btnClick: ({ dialog: { options, index } }) => {
+        if (options?.sureBtnLoading) {
+          sureBtnMap.value[index] = Object.assign({}, sureBtnMap.value[index], {
+            loading: true
+          });
+        }
+        const closeLoading = () => {
+          if (options?.sureBtnLoading) {
+            sureBtnMap.value[index].loading = false;
+          }
+        };
+        const done = () => {
+          closeLoading();
+          closeDialog(options, index, { command: "sure" });
+        };
+        if (options?.beforeSure && isFunction(options?.beforeSure)) {
+          options.beforeSure(done, { options, index, closeLoading });
+        } else {
+          done();
+        }
+      }
+    }
+  ];
+  return [...footerButtons, ...arr];
+};
 const footerButtons = computed(() => {
   return (options: DialogOptions) => {
     return options?.footerButtons?.length > 0
-      ? options.footerButtons
+      ? isPush(options.footerButtons, options)
       : ([
           {
             label: "鍙栨秷",

--
Gitblit v1.9.1