fix: restore tenant filter on search reset in IM pages
BasicForm resetFields clears tenantId along with other fields, so the auto-query after reset hit the empty-list guard (or was rejected by the backend). Add a shared imSearchReset handler in imTenantOptions.ts that refills the tenant select with its first option (bound users keep their own tenant) before reloading, and wire it into the 9 IM list pages whose reset did not already refill the tenant condition.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
ref="searchFormRef"
|
||||
@register="register"
|
||||
@submit="reloadTable"
|
||||
@reset="reloadTable"
|
||||
@reset="onSearchReset"
|
||||
/>
|
||||
<BasicTable
|
||||
ref="actionRef"
|
||||
@@ -31,6 +31,7 @@
|
||||
import { BasicForm, useForm } from '@/components/Form/index';
|
||||
import { List, Review } from '@/api/imRealname';
|
||||
import { columns, loadOptions, loadTenantOptions, schemas, State, tenantOptions } from './model';
|
||||
import { imSearchReset } from '../imTenantOptions';
|
||||
import { adaTableScrollX } from '@/utils/hotgo';
|
||||
import ViewModal from './view.vue';
|
||||
|
||||
@@ -94,6 +95,9 @@
|
||||
actionRef.value?.reload();
|
||||
}
|
||||
|
||||
// 重置后回填商户下拉第一个选项再查询(避免 tenantId 被清空导致列表为空)
|
||||
const onSearchReset = imSearchReset(searchFormRef, tenantOptions, reloadTable);
|
||||
|
||||
function handleReview(record: State, status: string, reviewReason = '') {
|
||||
Review({ tenantId: record.tenantId, id: record.id, status, reviewReason }).then(() => {
|
||||
message.success('操作成功');
|
||||
|
||||
Reference in New Issue
Block a user