Sfoglia il codice sorgente

fix:修复消息显示异常

luoxiao 1 mese fa
parent
commit
946ccb4784
2 ha cambiato i file con 7 aggiunte e 12 eliminazioni
  1. 2 1
      src/store/modules/dictionary.ts
  2. 5 11
      src/views/system/message/index.vue

+ 2 - 1
src/store/modules/dictionary.ts

@@ -34,11 +34,12 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "process_state",
     "form_params",
     "bill_type",
-      "flow_ins_state",
+    "flow_ins_state",
     "warehouse_type",
     "signature_type",
     "signature_attribution",
     "accessories_property",
+    "system_message_type",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
 

+ 5 - 11
src/views/system/message/index.vue

@@ -129,6 +129,8 @@ import { addMessage, updateMessage } from "@/api/system/message";
 import { useCommonStoreHook } from "@/store";
 import { getUserList } from "@/api/system/user";
 import { queryDictDataByType } from "@/api/system/dict";
+import { useDictionaryStore } from "@/store";
+const { dicts } = useDictionaryStore();
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const userFormRef = ref(ElForm); // 用户表单
 const message = ref({
@@ -279,10 +281,9 @@ option.value = Object.assign(option.value, {
       overHidden: true,
       type: "select",
       width: 150,
-      dicData: [
-        { label: "系统消息", value: "0" },
-        { label: "用户消息", value: "1" },
-      ],
+      search: true,
+      dicData: dicts.system_message_type,
+      props: { label: "dictLabel", value: "dictValue" },
       rules: [
         {
           required: true,
@@ -291,13 +292,6 @@ option.value = Object.assign(option.value, {
         },
       ],
       html: true,
-      formatter: (val) => {
-        if (val.type === "0") {
-          return '<b class="el-tag el-tag--danger el-tag--light">系统消息</b>';
-        } else if (val.type === "1") {
-          return '<b class="el-tag el-tag--success el-tag--light">用户消息</b>';
-        }
-      },
     },
     {
       label: "状态",