Explorar o código

fix: 字典加入前缀颜色

Tong %!s(int64=2) %!d(string=hai) anos
pai
achega
a9be30febd

+ 17 - 0
src/views/sys/sysDict/category/data.ts

@@ -24,6 +24,11 @@ export const columns: BasicColumn[] = [
     dataIndex: 'bgColor',
     width: 120,
   },
+  {
+    title: '前缀颜色',
+    dataIndex: 'prefixColor',
+    width: 120,
+  },
   {
     title: '排序',
     dataIndex: 'sort',
@@ -143,6 +148,18 @@ export const dataFormSchema: FormSchema[] = [
       };
     },
   },
+  {
+    field: 'prefixColor',
+    label: '前缀颜色',
+    component: 'FormColorPicker',
+    componentProps: ({ formModel }) => {
+      return {
+        onChange: e => {
+          formModel.prefixColor = e;
+        },
+      };
+    },
+  },
   {
     field: 'sort',
     label: '排序',

+ 5 - 0
src/views/sys/sysDict/category/index.vue

@@ -28,6 +28,11 @@
               {{ record.bgColor }}
             </Tag>
           </template>
+          <template v-if="column.key === 'prefixColor'">
+            <Tag :color="record.prefixColor || '#000'">
+              {{ record.prefixColor }}
+            </Tag>
+          </template>
           <template v-if="column.key === 'action'">
             <TableAction
               :actions="[