From 97f29024ce18babeb4b635c5d73f907ac493976e Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期五, 22 八月 2025 16:15:48 +0800
Subject: [PATCH] fix: 签约

---
 src/views/DictionaryManage/DataDictionary.vue |   26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/src/views/DictionaryManage/DataDictionary.vue b/src/views/DictionaryManage/DataDictionary.vue
index de06a45..96df848 100644
--- a/src/views/DictionaryManage/DataDictionary.vue
+++ b/src/views/DictionaryManage/DataDictionary.vue
@@ -1,7 +1,7 @@
 <template>
   <LoadingLayout :loading="state.loading">
     <AppContainer>
-      <ProTableQueryFilterBar @on-reset="reset">
+      <ProTableQueryFilterBar @on-reset="handleReset">
         <template #query>
           <QueryFilterItem>
             <FieldSelect
@@ -43,9 +43,6 @@
             :before-change="() => setCategoryVis(row)"
           />
         </template>
-        <template #category="{ row }">
-          {{ row.category?.name }}
-        </template>
       </ProTableV2>
     </AppContainer>
     <AddOrEditDictionaryDialog v-bind="dialogProps" />
@@ -86,10 +83,9 @@
   operationBtnMap,
 });
 
-const { dictionaryCategoryList, ensureQueryData, getDictionaryCategoryNameByCode } =
-  useGetDictionaryCategorySelect();
+const { dictionaryCategoryList, ensureQueryData } = useGetDictionaryCategorySelect();
 
-const { getDictionaryDataNameByCode } = useDictionaryDataSelect({
+const { getDictionaryDataNameByCode, updateDictionaryDataSelect } = useDictionaryDataSelect({
   categoryCode: CategoryCode.IndustryCategory,
 });
 
@@ -162,7 +158,9 @@
       sort: row.sort,
       isDisabled: row.isDisabled,
       field1: row.field1,
+      field3: row.field3,
       field2: convertApi2FormUrlOnlyOne(row.field2),
+      field4: row.field4,
     });
   } else {
     handleAdd({
@@ -182,7 +180,11 @@
     isDisabled: false,
     field1: '',
     field2: [] as UploadUserFile[],
+    field3: '',
+    field4: '',
+    title: '鏂板瀛楀吀',
   },
+  editTitle: '缂栬緫瀛楀吀',
 });
 
 async function handleAddOrEdit() {
@@ -195,6 +197,7 @@
       isDisabled: editForm.isDisabled,
       field1: editForm.field1,
       field2: editForm.field2?.[0]?.path ?? '',
+      field3: editForm.field3,
     };
     if (editForm.id) {
       params.id = editForm.id;
@@ -202,6 +205,7 @@
     let res = await dictionaryServices.saveDictionaryData(params);
     if (res) {
       Message.successMessage('鎿嶄綔鎴愬姛');
+      updateDictionaryDataSelect(editForm.categoryId);
       getList(paginationState.pageIndex);
       dialogState.dialogVisible = false;
     }
@@ -216,8 +220,16 @@
       isDisabled: !row.isDisabled,
     };
     let res = await dictionaryServices.setDictionaryDataIsDisabled(params);
+    updateDictionaryDataSelect(row.categoryId);
     getList(paginationState.pageIndex);
     return !!res;
   } catch (error) {}
 }
+
+async function handleReset() {
+  try {
+    const dictionaryCategoryList = await ensureQueryData();
+    reset({ categoryId: dictionaryCategoryList[0].value });
+  } catch (error) {}
+}
 </script>

--
Gitblit v1.9.1