添加错误处理
This commit is contained in:
@@ -677,79 +677,86 @@ const generateMetrics = async () => {
|
||||
type: form.type,
|
||||
})
|
||||
.then((res: any) => {
|
||||
tabList.value[activeName.value].dynamicData = res.data.responsibilities;
|
||||
let [min, max] = yMethod(
|
||||
res.data.datas.map((item: any) => item.valueDatas).flat()
|
||||
);
|
||||
let series: any[] = [];
|
||||
let time: any[] = res.data.timeDatas.map((item: any) => timeFormat(item));
|
||||
res.data.datas.forEach((item: any) => {
|
||||
series.push({
|
||||
name: item.customerName,
|
||||
data: item.valueDatas.map((k: any, i: number) => [
|
||||
time[i],
|
||||
Math.floor(k * 10000) / 10000,
|
||||
]),
|
||||
type: "line",
|
||||
smooth: true,
|
||||
symbol: "none",
|
||||
if (res.code == "A0000") {
|
||||
tabList.value[activeName.value].dynamicData = res.data.responsibilities;
|
||||
let [min, max] = yMethod(
|
||||
res.data.datas.map((item: any) => item.valueDatas).flat()
|
||||
);
|
||||
let series: any[] = [];
|
||||
let time: any[] = res.data.timeDatas.map((item: any) =>
|
||||
timeFormat(item)
|
||||
);
|
||||
res.data.datas.forEach((item: any) => {
|
||||
series.push({
|
||||
name: item.customerName,
|
||||
data: item.valueDatas.map((k: any, i: number) => [
|
||||
time[i],
|
||||
Math.floor(k * 10000) / 10000,
|
||||
]),
|
||||
type: "line",
|
||||
smooth: true,
|
||||
symbol: "none",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
tabList.value[activeName.value].dynamicOptions = {
|
||||
title: {
|
||||
text: "",
|
||||
},
|
||||
xAxis: {
|
||||
type: "time",
|
||||
name: "时间",
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: "{MM}-{dd}",
|
||||
month: "{MM}",
|
||||
year: "{yyyy}",
|
||||
tabList.value[activeName.value].dynamicOptions = {
|
||||
title: {
|
||||
text: "",
|
||||
},
|
||||
xAxis: {
|
||||
type: "time",
|
||||
name: "时间",
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: "{MM}-{dd}",
|
||||
month: "{MM}",
|
||||
year: "{yyyy}",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
formatter(params: any) {
|
||||
let str = params[0].value[0] + "<br/>";
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
str =
|
||||
str +
|
||||
params[i].marker +
|
||||
params[i].seriesName +
|
||||
":" +
|
||||
params[i].value[1] +
|
||||
"<br/>";
|
||||
}
|
||||
tooltip: {
|
||||
formatter(params: any) {
|
||||
let str = params[0].value[0] + "<br/>";
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
str =
|
||||
str +
|
||||
params[i].marker +
|
||||
params[i].seriesName +
|
||||
":" +
|
||||
params[i].value[1] +
|
||||
"<br/>";
|
||||
}
|
||||
|
||||
return str;
|
||||
return str;
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: 30,
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
name: form.type == 1 ? "%" : "A",
|
||||
min: min,
|
||||
max: max,
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: 30,
|
||||
},
|
||||
legend: {
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
name: form.type == 1 ? "%" : "A",
|
||||
min: min,
|
||||
max: max,
|
||||
},
|
||||
toolbox: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
options: {
|
||||
series: series,
|
||||
},
|
||||
};
|
||||
options: {
|
||||
series: series,
|
||||
},
|
||||
};
|
||||
|
||||
tabList.value[activeName.value].showDynamic = true;
|
||||
tabList.value[activeName.value].showDynamic = true;
|
||||
} else {
|
||||
ElMessage.warning(res.message);
|
||||
loading1.value = false;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
.catch((error) => {
|
||||
loading1.value = false;
|
||||
});
|
||||
loading1.value = false;
|
||||
@@ -971,7 +978,7 @@ defineExpose({
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep(.el-tag__content){
|
||||
::v-deep(.el-tag__content) {
|
||||
max-width: 90px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user