优化
This commit is contained in:
@@ -37,17 +37,15 @@ const statusLabels: Record<string, string> = {
|
||||
function tenantLabel(tenant: PlatformTenantResource) {
|
||||
const status = statusLabels[tenant.status] || tenant.status
|
||||
const name = tenant.tenantName?.trim()
|
||||
const code = tenant.tenantCode?.trim()
|
||||
const identity = name && code ? `${name}(${code})` : name || code || '未命名客户'
|
||||
return status ? `${identity} · ${status}` : identity
|
||||
return status ? `${name || '未命名客户'} · ${status}` : name || '未命名客户'
|
||||
}
|
||||
|
||||
async function loadTenants() {
|
||||
loading.value = true
|
||||
error.value = ''
|
||||
try {
|
||||
const result = await listPlatformTenants({ page: 1, size: 200 })
|
||||
tenants.value = result.records
|
||||
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))
|
||||
|
||||
Reference in New Issue
Block a user