修复用户管理外部邮箱绑定状态误显示关闭
This commit is contained in:
parent
39e65eb9f4
commit
29a1d58461
@ -18,10 +18,7 @@ export function recoveryCodeMeta(configured) {
|
|||||||
: { label: '未开启', type: 'info' }
|
: { label: '未开启', type: 'info' }
|
||||||
}
|
}
|
||||||
|
|
||||||
export function externalEmailMeta(enabled, configured) {
|
export function externalEmailMeta(configured) {
|
||||||
if (!enabled) {
|
|
||||||
return { label: '已关闭', type: 'warning' }
|
|
||||||
}
|
|
||||||
return configured
|
return configured
|
||||||
? { label: '已绑定', type: 'success' }
|
? { label: '已绑定', type: 'success' }
|
||||||
: { label: '未绑定', type: 'info' }
|
: { label: '未绑定', type: 'info' }
|
||||||
|
|||||||
@ -37,12 +37,12 @@
|
|||||||
<el-table-column label="外部邮箱" width="76">
|
<el-table-column label="外部邮箱" width="76">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tag
|
<el-tag
|
||||||
:type="externalEmailMeta(scope.row.ExternalEmailEnabled, scope.row.ExternalEmailConfigured).type"
|
:type="externalEmailMeta(scope.row.ExternalEmailConfigured).type"
|
||||||
size="small"
|
size="small"
|
||||||
effect="plain"
|
effect="plain"
|
||||||
class="status-tag"
|
class="status-tag"
|
||||||
>
|
>
|
||||||
{{ externalEmailMeta(scope.row.ExternalEmailEnabled, scope.row.ExternalEmailConfigured).label }}
|
{{ externalEmailMeta(scope.row.ExternalEmailConfigured).label }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -165,7 +165,6 @@
|
|||||||
<strong>外部邮箱</strong>
|
<strong>外部邮箱</strong>
|
||||||
<span>
|
<span>
|
||||||
{{ externalEmailMeta(
|
{{ externalEmailMeta(
|
||||||
selectedUser?.ExternalEmailEnabled,
|
|
||||||
selectedUser?.ExternalEmailConfigured
|
selectedUser?.ExternalEmailConfigured
|
||||||
).label }}
|
).label }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -33,9 +33,8 @@ test('用户管理状态映射使用明确的中文文案', () => {
|
|||||||
assert.equal(roleMeta('').label, '未知权限')
|
assert.equal(roleMeta('').label, '未知权限')
|
||||||
assert.equal(recoveryCodeMeta(true).label, '已开启')
|
assert.equal(recoveryCodeMeta(true).label, '已开启')
|
||||||
assert.equal(recoveryCodeMeta(false).label, '未开启')
|
assert.equal(recoveryCodeMeta(false).label, '未开启')
|
||||||
assert.equal(externalEmailMeta(true, true).label, '已绑定')
|
assert.equal(externalEmailMeta(true).label, '已绑定')
|
||||||
assert.equal(externalEmailMeta(true, false).label, '未绑定')
|
assert.equal(externalEmailMeta(false).label, '未绑定')
|
||||||
assert.equal(externalEmailMeta(false, true).label, '已关闭')
|
|
||||||
assert.equal(accountStatusMeta(0).label, '正常')
|
assert.equal(accountStatusMeta(0).label, '正常')
|
||||||
assert.equal(accountStatusMeta(1).label, '已禁用')
|
assert.equal(accountStatusMeta(1).label, '已禁用')
|
||||||
})
|
})
|
||||||
@ -50,8 +49,9 @@ test('用户管理页面可编译并展示权限与安全状态列', () => {
|
|||||||
}
|
}
|
||||||
assert.match(source, /scope\.row\.Role/)
|
assert.match(source, /scope\.row\.Role/)
|
||||||
assert.match(source, /scope\.row\.RecoveryCodeConfigured/)
|
assert.match(source, /scope\.row\.RecoveryCodeConfigured/)
|
||||||
assert.match(source, /scope\.row\.ExternalEmailEnabled/)
|
assert.doesNotMatch(source, /ExternalEmailEnabled/)
|
||||||
assert.match(source, /scope\.row\.ExternalEmailConfigured/)
|
assert.match(source, /scope\.row\.ExternalEmailConfigured/)
|
||||||
|
assert.match(source, /selectedUser\?\.ExternalEmailConfigured/)
|
||||||
assert.match(source, /管理安全码/)
|
assert.match(source, /管理安全码/)
|
||||||
assert.match(source, /编辑外部邮箱/)
|
assert.match(source, /编辑外部邮箱/)
|
||||||
assert.match(source, /RecoveryCodeDialog/)
|
assert.match(source, /RecoveryCodeDialog/)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user