perf: 媒体账户健康状态调整
This commit is contained in:
@ -146,7 +146,7 @@ const dataSource = ref([]);
|
|||||||
const selectedItems = ref([]);
|
const selectedItems = ref([]);
|
||||||
const healthData = ref({});
|
const healthData = ref({});
|
||||||
|
|
||||||
const isAbNormalStatus = computed(() => healthData.value?.abnormal_number > 0);
|
const isAbNormalStatus = computed(() => healthData.value?.total_abnormal_number > 0);
|
||||||
|
|
||||||
const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length);
|
const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length);
|
||||||
const indeterminate = computed(
|
const indeterminate = computed(
|
||||||
@ -159,23 +159,25 @@ const tipLabel = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
abnormal_number = 0,
|
total_abnormal_number = 0,
|
||||||
login_invalid_number = 0,
|
login_invalid_number = 0,
|
||||||
too_many_requests_number = 0,
|
too_many_requests_number = 0,
|
||||||
account_frozen_number = 0,
|
account_frozen_number = 0,
|
||||||
|
miss_data_number = 0,
|
||||||
} = healthData.value;
|
} = healthData.value;
|
||||||
|
|
||||||
// 定义异常类型映射
|
// 定义异常类型映射
|
||||||
const abnormalTypes = [
|
const abnormalTypes = [
|
||||||
{ count: login_invalid_number, label: 'cookie过期' },
|
{ count: login_invalid_number, label: 'cookie过期' },
|
||||||
{ count: too_many_requests_number, label: '已请求频繁' },
|
{ count: too_many_requests_number, label: '请求频繁' },
|
||||||
{ count: account_frozen_number, label: '账号被封' },
|
{ count: account_frozen_number, label: '账号被封' },
|
||||||
|
{ count: miss_data_number, label: '数据缺失' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 过滤出有异常的项并格式化
|
// 过滤出有异常的项并格式化
|
||||||
const abnormalLabels = abnormalTypes.filter(({ count }) => count > 0).map(({ count, label }) => `${count}个${label}`);
|
const abnormalLabels = abnormalTypes.filter(({ count }) => count > 0).map(({ count, label }) => `${count}个${label}`);
|
||||||
|
|
||||||
return `共有 ${abnormal_number} 个账号存在授权异常,其中:${abnormalLabels.join(',')}。`;
|
return `共有 ${total_abnormal_number} 个账号存在授权异常,其中:${abnormalLabels.join(',')}。`;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@ -122,7 +122,7 @@ const dataSource = ref([]);
|
|||||||
const selectedItems = ref([]);
|
const selectedItems = ref([]);
|
||||||
const healthData = ref({});
|
const healthData = ref({});
|
||||||
|
|
||||||
const isAbNormalStatus = computed(() => healthData.value?.abnormal_number > 0);
|
const isAbNormalStatus = computed(() => healthData.value?.total_abnormal_number > 0);
|
||||||
|
|
||||||
const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length);
|
const checkedAll = computed(() => selectedItems.value.length === dataSource.value.length);
|
||||||
const indeterminate = computed(
|
const indeterminate = computed(
|
||||||
@ -135,23 +135,25 @@ const tipLabel = computed(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
abnormal_number = 0,
|
total_abnormal_number = 0,
|
||||||
login_invalid_number = 0,
|
login_invalid_number = 0,
|
||||||
too_many_requests_number = 0,
|
too_many_requests_number = 0,
|
||||||
account_frozen_number = 0,
|
account_frozen_number = 0,
|
||||||
|
miss_data_number = 0,
|
||||||
} = healthData.value;
|
} = healthData.value;
|
||||||
|
|
||||||
// 定义异常类型映射
|
// 定义异常类型映射
|
||||||
const abnormalTypes = [
|
const abnormalTypes = [
|
||||||
{ count: login_invalid_number, label: 'cookie过期' },
|
{ count: login_invalid_number, label: 'cookie过期' },
|
||||||
{ count: too_many_requests_number, label: '已请求频繁' },
|
{ count: too_many_requests_number, label: '请求频繁' },
|
||||||
{ count: account_frozen_number, label: '账号被封' },
|
{ count: account_frozen_number, label: '账号被封' },
|
||||||
|
{ count: miss_data_number, label: '数据缺失' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 过滤出有异常的项并格式化
|
// 过滤出有异常的项并格式化
|
||||||
const abnormalLabels = abnormalTypes.filter(({ count }) => count > 0).map(({ count, label }) => `${count}个${label}`);
|
const abnormalLabels = abnormalTypes.filter(({ count }) => count > 0).map(({ count, label }) => `${count}个${label}`);
|
||||||
|
|
||||||
return `共有 ${abnormal_number} 个账号存在授权异常,其中:${abnormalLabels.join(',')}。`;
|
return `共有 ${total_abnormal_number} 个账号存在授权异常,其中:${abnormalLabels.join(',')}。`;
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user