Commit 424b171e0db727f5e0157cbcfd5460f15f8ea609

Authored by 无木
1 parent 9de6ac11

fix(demo): account list fetch loss param

修复账号管理列表发起请求时可能缺少当前选中的部门ID参数的问题

fixed: #830
src/views/demo/system/account/index.vue
1 1 <template>
2 2 <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
3 3 <DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
4   - <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5">
  4 + <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
5 5 <template #toolbar>
6 6 <a-button type="primary" @click="handleCreate">新增账号</a-button>
7 7 </template>
... ... @@ -35,7 +35,7 @@
35 35 </PageWrapper>
36 36 </template>
37 37 <script lang="ts">
38   - import { defineComponent } from 'vue';
  38 + import { defineComponent, reactive } from 'vue';
39 39  
40 40 import { BasicTable, useTable, TableAction } from '/@/components/Table';
41 41 import { getAccountList } from '/@/api/demo/system';
... ... @@ -54,6 +54,7 @@
54 54 setup() {
55 55 const go = useGo();
56 56 const [registerModal, { openModal }] = useModal();
  57 + const searchInfo = reactive<Recordable>({});
57 58 const [registerTable, { reload, updateTableDataRecord }] = useTable({
58 59 title: '账号列表',
59 60 api: getAccountList,
... ... @@ -104,7 +105,8 @@
104 105 }
105 106  
106 107 function handleSelect(deptId = '') {
107   - reload({ searchInfo: { deptId } });
  108 + searchInfo.deptId = deptId;
  109 + reload();
108 110 }
109 111  
110 112 function handleView(record: Recordable) {
... ... @@ -120,6 +122,7 @@
120 122 handleSuccess,
121 123 handleSelect,
122 124 handleView,
  125 + searchInfo,
123 126 };
124 127 },
125 128 });
... ...