This commit is contained in:
sjl
2024-12-17 13:38:59 +08:00
parent 68df3d5e23
commit d20cab57be
2 changed files with 36 additions and 33 deletions

View File

@@ -115,7 +115,7 @@ import Table from "../components/table.vue";
//import { data } from "@/api/plan/static.json";
import deviceDataList from '@/api/device/device/deviceData'
import {getPlanListByPattern } from '@/api/plan/plan.ts'
import { onMounted, onUnmounted, ref, watch } from "vue";
import { onBeforeMount, onMounted, onUnmounted, ref, watch } from "vue";
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
import { useDictStore } from '@/stores/modules/dict'
import { type Plan } from "@/api/plan/interface";
@@ -272,13 +272,10 @@ const getPieData = async (id: string) => {
currentId.value = id; // 设置当前ID
//handleCheckFunction(0)//切换左侧树默认css功能是设备检测
const boundPqDevList=ref<Device.ResPqDev[]>([])//根据检测计划id查询出所有已绑定的设备
<<<<<<< HEAD
const pqDevList_Result2 = await getBoundPqDevList({'planId': id,'checkStateList':[0,1,2,3]});
=======
const pqDevList_Result2 = await getBoundPqDevList({'planId': id,'checkStateList':[0,1,2]});
>>>>>>> 07d02307e2507c32fc2b3c8b745b074d7a9bb74d
boundPqDevList.value = pqDevList_Result2.data as Device.ResPqDev[];
console.log('饼图列',boundPqDevList)
console.log('饼图列',boundPqDevList)
// 初始化计数对象
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 };
// 遍历 boundPqDevList 并更新计数对象
@@ -314,14 +311,14 @@ console.log('饼图列',boundPqDevList)
{ value: checkStateCount[3], name: "归档", itemStyle: { color: '#5470c6' } },
];
chartsData2.value = [
{ value: checkResultCount[0], name: "未检" , itemStyle: { color: '#fac858' } },
{ value: checkResultCount[1], name: "不符合" , itemStyle: { color: '#ee6666' } },
{ value: checkResultCount[2], name: "符合", itemStyle: { color: '#91cc75' } },
{ value: checkResultCount[2], name: "未检" , itemStyle: { color: '#fac858' } },
{ value: checkResultCount[0], name: "不符合" , itemStyle: { color: '#ee6666' } },
{ value: checkResultCount[1], name: "符合", itemStyle: { color: '#91cc75' } },
];
chartsData3.value = [
{ value: reportStateCount[0], name: "未检" , itemStyle: { color: '#fac858' } },
{ value: reportStateCount[1], name: "未生成" , itemStyle: { color: '#ee6666' } },
{ value: reportStateCount[2], name: "已生成", itemStyle: { color: '#91cc75' } },
{ value: reportStateCount[2], name: "未检" , itemStyle: { color: '#fac858' } },
{ value: reportStateCount[0], name: "未生成" , itemStyle: { color: '#ee6666' } },
{ value: reportStateCount[1], name: "已生成", itemStyle: { color: '#91cc75' } },
];
pieRef1.value.init();
@@ -425,15 +422,12 @@ onBeforeMount(async () => {
code: 0,
state: 0
};
<<<<<<< HEAD
const planList = await getPlanListByPattern(reqPlan);
=======
// debugger;
const planList = await getPlanListByPattern(reqPlan);
if (planList.data[0].children[0]) {
currentId.value = planList.data[0].children[0].id;
}
>>>>>>> 07d02307e2507c32fc2b3c8b745b074d7a9bb74d
if (chartsInfoRef.value) {
resizeObserver.observe(chartsInfoRef.value);
}