ソースを参照

fix: BsUi-组件修改1

hanxiaohui 4 ヶ月 前
コミット
e9ecbb9332

+ 4 - 3
src/components/BsUi/Descriptions/index.vue

@@ -15,7 +15,7 @@
       <a-descriptions v-if="!isEmpty(items)" :bordered="false" v-bind="extraProps">
         <a-descriptions-item v-for="(item, index) in items" :key="index" v-bind="item.extraProps">
           <template #label>
-            <slot v-if="item.labelSlot" :name="item.labelSlot"></slot>
+            <slot v-if="item.labelSlot" :name="item.labelSlot" :label="item.label" :value="item.value"></slot>
 
             <div v-else class="help-config">
               <a-tooltip placement="top" v-if="item?.helpConfig?.enable">
@@ -31,7 +31,7 @@
 
           <template v-if="item.valueSlot">
            <div class="value_slot">
-             <slot :name="item.valueSlot"></slot>
+             <slot :name="item.valueSlot" :label="item.label" :value="item.value"></slot>
            </div>
           </template>
           <template v-if="!item.valueSlot">
@@ -141,7 +141,8 @@
     }
     .value_slot {
       position: absolute;
-      top: -5px;
+      bottom: 0;
+      transform: translateY(100%);
     }
   }
 </style>

+ 18 - 0
src/components/BsUi/DicTag/index.vue

@@ -0,0 +1,18 @@
+<template>
+  <div class="dic-tag">
+    <a-space>
+      <a-tag v-for="(tag, idx) in dicts" :key="idx">{{ tag.valueName }}</a-tag>
+    </a-space>
+  </div>
+</template>
+
+<script setup>
+  const props = defineProps({
+    dicts: {
+      required: true,
+      default: [],
+    },
+  });
+</script>
+
+<style lang="scss" scoped></style>

+ 4 - 1
src/components/BsUi/index.js

@@ -11,6 +11,7 @@ import BsDescriptions from "./Descriptions/index.vue"
 import BsContentsWrapper from "./ContentsWrapper/index.vue"
 import BsTabs from "./Tabs/index.vue"
 import BsEllipsisText from "./EllipsisText/index.vue"
+import BsDicTag from "./DicTag/index.vue"
 
 const BsUi = {
   install(app) {
@@ -25,6 +26,7 @@ const BsUi = {
     app.component('BsContentsWrapper', BsContentsWrapper)
     app.component('BsTabs', BsTabs);
     app.component('BsEllipsisText', BsEllipsisText);
+    app.component('BsDicTag', BsDicTag)
   },
 };
 
@@ -47,5 +49,6 @@ export {
   BsDescriptions,
   BsContentsWrapper,
   BsTabs,
-  BsEllipsisText
+  BsEllipsisText,
+  BsDicTag
 };