提交 424b171e 编写于 作者: 无木

fix(demo): account list fetch loss param

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

fixed: #830
上级 9de6ac11
<template> <template>
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> <PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" /> <DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5"> <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate">新增账号</a-button> <a-button type="primary" @click="handleCreate">新增账号</a-button>
</template> </template>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent } from 'vue'; import { defineComponent, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { getAccountList } from '/@/api/demo/system'; import { getAccountList } from '/@/api/demo/system';
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
setup() { setup() {
const go = useGo(); const go = useGo();
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const searchInfo = reactive<Recordable>({});
const [registerTable, { reload, updateTableDataRecord }] = useTable({ const [registerTable, { reload, updateTableDataRecord }] = useTable({
title: '账号列表', title: '账号列表',
api: getAccountList, api: getAccountList,
...@@ -104,7 +105,8 @@ ...@@ -104,7 +105,8 @@
} }
function handleSelect(deptId = '') { function handleSelect(deptId = '') {
reload({ searchInfo: { deptId } }); searchInfo.deptId = deptId;
reload();
} }
function handleView(record: Recordable) { function handleView(record: Recordable) {
...@@ -120,6 +122,7 @@ ...@@ -120,6 +122,7 @@
handleSuccess, handleSuccess,
handleSelect, handleSelect,
handleView, handleView,
searchInfo,
}; };
}, },
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册