From 55bf797dcc730b37bc691ebab2b51ff9db8ed245 Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周二, 06 5月 2025 17:37:23 +0800
Subject: [PATCH] 修改代码样式

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

diff --git a/HIAWms/web/src/components/BaseDrawer/BaseDrawer.tsx b/HIAWms/web/src/components/BaseDrawer/BaseDrawer.tsx
new file mode 100644
index 0000000..6917bed
--- /dev/null
+++ b/HIAWms/web/src/components/BaseDrawer/BaseDrawer.tsx
@@ -0,0 +1,102 @@
+import { computed, defineComponent, onMounted, ref } from 'vue'
+import styles from './BaseDrawer.module.scss'
+import Icon from '../Icon/Icon'
+//@ts-ignore
+export default defineComponent<{
+  [key: string]: any
+}>({
+  // @ts-ignore
+  name: 'BaseDrawer',
+  props: {
+    // 閬僵鏄惁鍙偣鍑�
+    clickable: {
+      type: Boolean,
+      default: false,
+    },
+    title: {
+      type: String,
+      default: '',
+    },
+    width: {
+      type: String,
+      default: '',
+    },
+    // modelValue: {
+    //   type: Boolean,
+    //   default: false,
+    // },
+  },
+  emits: ['close', 'confirm', 'update:modelValue', 'open', 'beforeClose'],
+  setup(props: any, { emit, slots, attrs }: any) {
+    // const size = computed(() => {
+    //   if (attrs.size.includes('px')) {
+    //     return attrs.size
+    //   }
+    // })
+
+    // const model = computed(() => {
+    //   if (attrs.model.includes('')) {
+    //     return attrs.model
+    //   }
+    // })
+
+    return () => {
+      return (
+        <div
+          class={styles.drawContent}
+          //@ts-ignore
+          // style={props.clickable ? { '--drawer-width': size.value } : {}}
+        >
+          <el-drawer
+            // modal-class={props.clickable ? styles.modal : ''}
+            class={{
+              [styles.informationDrawer]: true,
+              // [styles.informationDrawerPosition]: props.clickable,
+            }}
+            onOpen={() => emit('open')}
+            onClose={() => emit('close')}
+            v-slots={{
+              footer() {
+                return (
+                  <div class={styles.csDialogFooter}>
+                    <el-button
+                      onClick={() => emit('close')}
+                      type="info"
+                      plain
+                      class={{
+                        [styles.dialogBtn]: true,
+                        [styles.csBaseBtn]: true,
+                      }}
+                    >
+                      鍙栨秷
+                    </el-button>
+                    <el-button
+                      onClick={() => emit('confirm')}
+                      type="primary"
+                      class={{
+                        [styles.csBaseBtn]: true,
+                      }}
+                    >
+                      纭
+                    </el-button>
+                  </div>
+                )
+              },
+            }}
+            {...attrs}
+            title={props.title}
+            size={props.width || attrs.size}
+          >
+            <Icon
+              width={167}
+              height={54}
+              class={styles.iconPosition}
+              icon="drawer_bg"
+            />
+            {slots.default?.()}
+          </el-drawer>
+        </div>
+      )
+    }
+  },
+})

--
Gitblit v1.9.3