优化
This commit is contained in:
@@ -47,9 +47,8 @@ async function loadTenants() {
|
||||
try {
|
||||
const result = await listPlatformTenants({ page: 1, size: 200, status: 'ACTIVE' })
|
||||
tenants.value = result.records.filter((tenant) => tenant.status === 'ACTIVE')
|
||||
if (!props.modelValue && result.records.length) {
|
||||
const preferred = result.records.find((tenant) => String(tenant.id) === '10001') || result.records[0]
|
||||
emit('update:modelValue', String(preferred.id))
|
||||
if (!props.modelValue && tenants.value.length) {
|
||||
emit('update:modelValue', String(tenants.value[0].id))
|
||||
}
|
||||
} catch (reason) {
|
||||
error.value = reason instanceof Error ? reason.message : '客户列表加载失败,请重试'
|
||||
|
||||
Reference in New Issue
Block a user