feat: 统一IM后台商户文案和默认选择

This commit is contained in:
richjohnrambo
2026-09-09 14:28:44 +08:00
parent da60b52be2
commit 27a368b386
76 changed files with 272 additions and 186 deletions
+15 -3
View File
@@ -267,7 +267,12 @@
View,
} from '@/api/imSecurityPolicy';
import { columns, ipColumns, loadOptions, schemas } from './model';
import { loadPolicyTenantOptions, parseJSON } from '@/views/imPolicyShared';
import {
getDefaultTenantValue,
loadPolicyTenantOptions,
parseJSON,
policyTenantOptions,
} from '@/views/imPolicyShared';
const dict = useDictStore(),
message = useMessage(),
dialog = useDialog(),
@@ -368,7 +373,11 @@
const ipRules = { ipCidr: { required: true, message: '请输入IP或CIDR' } };
const tenantSchema = schemas.value.find((v) => v.field === 'tenantId');
if (tenantSchema) tenantSchema.ifShow = () => userStore.isCompanyDept;
const [register] = useForm({ gridProps: { cols: '1 s:1 m:2 l:3' }, labelWidth: 90, schemas });
const [register, { setFieldsValue }] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3' },
labelWidth: 90,
schemas,
});
const loadTable = (res) => List({ ...searchFormRef.value?.formModel, ...res }),
loadIPTable = (res) => IPRuleList({ tenantId: tenantId(), ...res });
const reloadAll = () => {
@@ -562,7 +571,10 @@
}
onMounted(async () => {
loadOptions();
if (userStore.isCompanyDept) await loadPolicyTenantOptions(true);
if (userStore.isCompanyDept) {
await loadPolicyTenantOptions(true);
await setFieldsValue({ tenantId: getDefaultTenantValue(policyTenantOptions.value) });
}
reloadAll();
});
</script>