From b39af0f5e4e440f87ed40a03bd5e5cba255fe405 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周三, 30 4月 2025 17:13:02 +0800
Subject: [PATCH] 前端页面修改

---
 HIAWms/web/src/components/BaseDialog/BaseDialog.tsx |  106 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/HIAWms/web/src/components/BaseDialog/BaseDialog.tsx b/HIAWms/web/src/components/BaseDialog/BaseDialog.tsx
new file mode 100644
index 0000000..bdfe8a0
--- /dev/null
+++ b/HIAWms/web/src/components/BaseDialog/BaseDialog.tsx
@@ -0,0 +1,106 @@
+import {
+  defineComponent,
+  SetupContext,
+  computed,
+  useSlots,
+  Fragment,
+} from 'vue'
+import { _t } from '@/libs/Language/Language'
+import Icon from '../Icon/Icon'
+import './BaseDialog.scss'
+
+export default defineComponent({
+  emits: ['close', 'confirm', 'open'],
+  props: [],
+  setup(props, { emit, attrs, slots }: SetupContext) {
+    const footer = !!useSlots().footer
+    const className = computed(() => {
+      if (attrs.class) {
+        return `without-cs-dialog ${attrs.class}`
+      }
+      return 'without-cs-dialog'
+    })
+
+    // 鍏抽棴寮圭獥閮戒細璋冭繖涓柟娉曪紝鏈変簺鏃跺�欑偣鍑籧onfirm鐨勬椂鍊欎笉鑳藉悓鏃惰Е鍙慶lose鐨勶紝鍔犱釜鍙傛暟锛岀敤浜庡尯鍒嗘槸鐐瑰嚮鎸夐挳鍏抽棴鐨勪簨浠惰繕鏄痗lose浜嬩欢
+    const onClose = (isClose = true) => emit('close', isClose)
+
+    const onConfirm = () => emit('confirm')
+
+    const onOpen = () => emit('open')
+
+    const currentHeight = computed(() => {
+      return attrs.height || 'auto'
+    })
+    return () => {
+      return (
+        <el-dialog
+          class={className.value}
+          width="525px"
+          v-bind="attrs"
+          show-close={false}
+          onClose={() => onClose(false)}
+          onOpen={onOpen}
+          v-slots={{
+            header: () => (
+              <div class="cs-dialog-content">
+                <p>{_t(attrs.title)}</p>
+                {!attrs.hideClose ? (
+                  <Icon
+                    style="cursor: pointer"
+                    width={16}
+                    height={16}
+                    icon="X"
+                    onClick={onClose}
+                  />
+                ) : null}
+              </div>
+            ),
+            footer: () =>
+              attrs.isHideFooter ? null : (
+                <div class="cs-dialog-footer">
+                  {footer ? (
+                    // <slot name="footer"></slot>
+                    slots?.footer?.()
+                  ) : (
+                    <Fragment>
+                      {slots?.customBtn?.()}
+                      {/* <slot name="custom-btn"></slot> */}
+                      <el-button
+                        onClick={onClose}
+                        type="info"
+                        plain
+                        class="dialog-btn cs-base-btn"
+                      >
+                        {_t('鍙栨秷')}
+                      </el-button>
+                      {!attrs.hideSubmit ? (
+                        <el-button
+                          v-if=""
+                          disabled={attrs.submitDisabled}
+                          onClick={onConfirm}
+                          type="primary"
+                          class="cs-base-btn"
+                        >
+                          {_t('纭')}
+                        </el-button>
+                      ) : null}
+                    </Fragment>
+                  )}
+                </div>
+              ),
+          }}
+        >
+          <div
+            style={`
+              height: ${currentHeight};
+              overflow: ${attrs.height ? 'auto' : 'initial'};
+              padding-right: 20px;
+              `}
+          >
+            {slots?.default?.()}
+          </div>
+        </el-dialog>
+      )
+    }
+  },
+})

--
Gitblit v1.9.3