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/Tag/Tag.tsx |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/PipeLineLems/web/src/components/Tag/Tag.tsx b/PipeLineLems/web/src/components/Tag/Tag.tsx
index 45430ae..295b216 100644
--- a/PipeLineLems/web/src/components/Tag/Tag.tsx
+++ b/PipeLineLems/web/src/components/Tag/Tag.tsx
@@ -12,6 +12,7 @@
 import Empty from '../Empty/Empty'
 import Icon from '../Icon/Icon'
 import isNil from 'lodash/isNil'
+import { _t } from '@/libs/Language/Language'
 interface OptionType {
   label: string
   value: string
@@ -34,7 +35,7 @@
   [key: string]: any
 }
 
-export default defineComponent<TagProps>({
+export default defineComponent<any>({
   // @ts-ignore
   name: 'Tag',
   emits: ['click', 'update:modelValue', 'change', 'mouseenter', 'update:data'],
@@ -73,13 +74,21 @@
     },
     // 榛樿鍊�
     defaultValue: {
-      type: String,
+      type: [String, Number],
       default: '',
     },
     // 榛樿鍊�
     max: {
       type: Number,
       default: 999,
+    },
+    className: {
+      type: String,
+      default: '',
+    },
+    width: {
+      type: String,
+      default: '180px',
     },
   },
   setup(props: TagProps, { attrs, slots, emit }: SetupContext) {
@@ -243,8 +252,6 @@
     }
 
     return () => {
-      // showTip
-      // 澶歵ag鎯呭喌锛屼紶data[]
       if (Array.isArray(props.data)) {
         const msg = (item: DataType) =>
           item[label] ||
@@ -256,7 +263,12 @@
         return (
           // @ts-ignore
           <Tip showTip={props.showTip} v={v}>
-            <div class={styles.flex}>
+            <div
+              class={{
+                [styles.flex]: true,
+                [props.className]: props.className,
+              }}
+            >
               <DRender />
             </div>
           </Tip>
@@ -291,12 +303,13 @@
                     })}
                   </el-dropdown-menu>
                 ) : (
-                  <Empty />
+                  <Empty text={_t('鏆傛棤鏁版嵁')} />
                 ),
             }}
           >
             <div
               onMouseenter={onMouseenter}
+              style={{ width: props.width }}
               class={{
                 [styles.tagSelect]: true,
                 [styles.isSelectTag]: visible.value,
@@ -307,7 +320,7 @@
                   {currentName.value}
                 </span>
               ) : (
-                <div class={styles.pl}>璇烽�夋嫨</div>
+                <div class={styles.pl}>{_t('璇烽�夋嫨')}</div>
               )}
               <Icon
                 class={styles.iconDown}

--
Gitblit v1.9.3