fix: 看班告警统计判断修复,超时30秒

This commit is contained in:
TsMask
2024-02-05 15:21:08 +08:00
parent 16661c8513
commit c1de94bc9d
2 changed files with 19 additions and 10 deletions

View File

@@ -303,6 +303,7 @@ export async function origGet() {
params: {
SQL: totalSQL,
},
timeout: 30_000,
});
////
@@ -340,6 +341,7 @@ export async function top3Sel(filterFlag?: string) {
params: {
SQL: top3SQL,
},
timeout: 30_000,
});
// 解析数据

View File

@@ -17,6 +17,7 @@ import { BarChart, PieChart } from 'echarts/charts';
import { CanvasRenderer } from 'echarts/renderers';
import { LabelLayout } from 'echarts/features';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
const { t } = useI18n();
@@ -96,18 +97,24 @@ function initPicture() {
let pieArr: any = [];
let testArr: any = [];
if (resArr[0].status === 'fulfilled') {
testArr = completeData(resArr[0].value.data, wantArr);
testArr.map((item: any) => {
item.name = t('views.index.' + item.name) + ': ' + item.value;
pieArr.push(item);
});
const res0 = resArr[0].value;
if (res0.code === RESULT_CODE_SUCCESS) {
testArr = completeData(res0.data, wantArr);
testArr.map((item: any) => {
item.name = t('views.index.' + item.name) + ': ' + item.value;
pieArr.push(item);
});
}
}
if (resArr[1].status === 'fulfilled') {
const res1 = resArr[1].value;
if (res1.code === RESULT_CODE_SUCCESS) {
res1.data.map((item: any) => {
barArr.push(item);
});
}
}
if (resArr[1].status === 'fulfilled') {
resArr[1].value.data.map((item: any) => {
barArr.push(item);
});
}
let firstThreeItems = barArr
.sort((a: any, b: any) => {
return b.value - a.value;