|
|
@@ -24,10 +24,13 @@ const selectedTenantCode = ref<string | null>(null);
|
|
|
async function loadTenantOptions() {
|
|
|
const { data } = await fetchGetTenantOptions();
|
|
|
if (data) {
|
|
|
- tenantOptions.value = (data as any[]).map((item: any) => ({
|
|
|
- label: item.tenantName,
|
|
|
- value: item.tenantCode
|
|
|
- }));
|
|
|
+ tenantOptions.value = [
|
|
|
+ { label: '无', value: '' },
|
|
|
+ ...(data as any[]).map((item: any) => ({
|
|
|
+ label: item.tenantName,
|
|
|
+ value: item.tenantCode
|
|
|
+ }))
|
|
|
+ ];
|
|
|
}
|
|
|
}
|
|
|
loadTenantOptions();
|
|
|
@@ -68,7 +71,7 @@ const rules = computed<Record<keyof FormModel, App.Global.FormRule[]>>(() => {
|
|
|
const captchaKey = ref('');
|
|
|
async function handleSubmit() {
|
|
|
await validate();
|
|
|
- if (!selectedTenantCode.value) {
|
|
|
+ if (selectedTenantCode.value === null || selectedTenantCode.value === undefined) {
|
|
|
window.$message?.error('请选择租户');
|
|
|
return;
|
|
|
}
|