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:
@@ -6,7 +6,7 @@
|
||||
ref="searchFormRef"
|
||||
@register="register"
|
||||
@submit="reloadTable"
|
||||
@reset="reloadTable"
|
||||
@reset="onSearchReset"
|
||||
@keyup.enter="reloadTable"
|
||||
/>
|
||||
<n-alert type="info" :show-icon="true" class="whitelist-summary">
|
||||
@@ -241,6 +241,7 @@
|
||||
parseJSON,
|
||||
policyTenantOptions,
|
||||
} from '@/views/imPolicyShared';
|
||||
import { imSearchReset } from '../imTenantOptions';
|
||||
|
||||
const dict = useDictStore(),
|
||||
message = useMessage(),
|
||||
@@ -298,6 +299,11 @@
|
||||
actionRef.value?.reload();
|
||||
refreshLoginIPSummary();
|
||||
};
|
||||
// 重置后回填商户下拉再查询;回填跳过「全局默认」(value=0),与初始加载 getDefaultTenantValue 行为一致
|
||||
const resetTenantOptions = computed(() =>
|
||||
policyTenantOptions.value.filter((v) => Number(v.value) > 0)
|
||||
);
|
||||
const onSearchReset = imSearchReset(searchFormRef, resetTenantOptions, reloadTable);
|
||||
const actionColumn = reactive({
|
||||
width: 300,
|
||||
title: '操作',
|
||||
|
||||
Reference in New Issue
Block a user