perf: 媒体账户健康状态调整

This commit is contained in:
rd
2025-07-11 15:25:36 +08:00
parent aef2d5f310
commit 2fc1f64f5e
2 changed files with 12 additions and 8 deletions

View File

@ -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(() => {

View File

@ -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(() => {