修改黄金指标接口

This commit is contained in:
lai
2023-12-05 19:54:16 +08:00
parent dfc4a849f6
commit 97e453d880
2 changed files with 36 additions and 68 deletions

View File

@@ -116,6 +116,7 @@ function findTitleByKey(key: string): string | undefined {
const item = state.designTreeData.find(item => item.key === key);
return item ? item.title : undefined;
}
/**筛选条件进行制图 */
function fnDesign() {
if (!queryRangePicker.value) {
@@ -128,10 +129,11 @@ function fnDesign() {
let goldYData: any = [];
let hideAllArr: any = [];
goldData(queryParams).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
if (res.rows.length > 0) {
goldXDate = res.rows.map(item => item.timeInterval);
goldYData = Object.keys(res.rows[0])
console.log(res.data)
if (res.code === RESULT_CODE_SUCCESS) {
if (res.data.length > 0) {
goldXDate = res.data.map((item:any) => item.timeInterval);
goldYData = Object.keys(res.data[0])
.filter(key => key !== 'timeInterval')
.map(key => {
if (!queryParams.goldArr.includes(key)) hideAllArr[key] = false;
@@ -139,15 +141,17 @@ function fnDesign() {
if (queryParams.goldArr.includes(key))
return {
name: title,
data: res.rows.map((item: any) => parseInt(item[key])),
data: res.data.map((item: any) => parseInt(item[key])),
};
});
} else {
state.designTreeData.forEach((item: any) => {
goldYData.push({name:item.title,data:[]});
});
message.warning({
content: t('views.perfManage.goldTarget.nullTip'),
duration: 2,
});
return false;
}
// 图标参数
@@ -255,23 +259,20 @@ onMounted(() => {
<a-row :gutter="16">
<a-col :span="8">
<!-- 命令导航 -->
<a-card
size="small"
:bordered="false"
>
<a-card size="small" :bordered="false">
<a-form name="queryParamsFrom" layout="horizontal">
<a-form-item
name="neType"
:label="t('views.traceManage.task.neType')"
>
<a-cascader
v-model:value="queryParams.neType"
:options="neCascaderOptions"
@change="fnNeChange"
:allow-clear="false"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
<a-form-item
name="neType"
:label="t('views.traceManage.task.neType')"
>
<a-cascader
v-model:value="queryParams.neType"
:options="neCascaderOptions"
@change="fnNeChange"
:allow-clear="false"
:placeholder="t('common.selectPlease')"
/>
</a-form-item>
<a-form-item
:label="t('views.perfManage.goldTarget.timeFrame')"
@@ -330,7 +331,10 @@ onMounted(() => {
<a-col :span="16">
<a-card :bordered="false" :body-style="{ marginBottom: '24px' }">
<!-- 插槽-卡片左侧侧 -->
<template #title>{{ t('views.perfManage.goldTarget.kpiTitle') }}</template>
<template #title>{{
t('views.perfManage.goldTarget.kpiTitle')
}}</template>
<div class="chart">
<ChartLine
:option="chartsOption.perfChart"