Browse Source

[Fix 0000] 区队管理由ID驱动改为CODE驱动,修复了数据读取失败的问题

houzekong 1 week ago
parent
commit
3068870724
1 changed files with 8 additions and 5 deletions
  1. 8 5
      src/views/system/dict/components/DistrictTeam.vue

+ 8 - 5
src/views/system/dict/components/DistrictTeam.vue

@@ -14,13 +14,13 @@
   <DictItemModal @register="registerModal" @success="reload" :dictId="dictId" />
   <DictItemModal @register="registerModal" @success="reload" :dictId="dictId" />
 </template>
 </template>
 <script lang="ts" setup>
 <script lang="ts" setup>
-  import { onMounted, ref, unref } from 'vue';
+  import { onMounted, ref } from 'vue';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { useModal } from '/@/components/Modal';
   import { useModal } from '/@/components/Modal';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useDesign } from '/@/hooks/web/useDesign';
   import DictItemModal from './DictItemModal.vue';
   import DictItemModal from './DictItemModal.vue';
   import { dictItemColumns, dictItemSearchFormSchema } from '../dict.data';
   import { dictItemColumns, dictItemSearchFormSchema } from '../dict.data';
-  import { itemList, deleteItem } from '../dict.api';
+  import { itemList, deleteItem, list } from '../dict.api';
   import { ColEx } from '/@/components/Form/src/types';
   import { ColEx } from '/@/components/Form/src/types';
 
 
   const { prefixCls } = useDesign('row-invalid');
   const { prefixCls } = useDesign('row-invalid');
@@ -120,9 +120,12 @@
   }
   }
 
 
   onMounted(() => {
   onMounted(() => {
-    dictId.value = '1826791852479107073';
-    setProps({ searchInfo: { dictId: unref(dictId) } });
-    reload();
+    list({ dictCode: 'districtTeam' }).then((r) => {
+      if (!r.records.length) return;
+      dictId.value = r.records[0].id;
+      setProps({ searchInfo: { dictId: dictId.value } });
+      reload();
+    });
   });
   });
 </script>
 </script>
 <style scoped lang="less">
 <style scoped lang="less">