This commit is contained in:
sjl
2025-01-14 19:05:08 +08:00
parent 876c06ef54
commit 1c452b5574
4 changed files with 55 additions and 36 deletions

View File

@@ -243,7 +243,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4); firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) { if (!isNaN(parseFloat(newValue.data.aVuXi)) && isFinite(newValue.data.aVuXi)) {
firstCoefficientVO.aVuXi = parseFloat((parseFloat(newValue.data.aVuXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.aVuXi = (parseFloat(newValue.data.aVuXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.aVuXi = newValue.data.aVuXi; firstCoefficientVO.aVuXi = newValue.data.aVuXi;
} }
@@ -251,7 +251,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4); firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) { if (!isNaN(parseFloat(newValue.data.bVuXi)) && isFinite(newValue.data.bVuXi)) {
firstCoefficientVO.bVuXi = parseFloat((parseFloat(newValue.data.bVuXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.bVuXi = (parseFloat(newValue.data.bVuXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.bVuXi = newValue.data.bVuXi; firstCoefficientVO.bVuXi = newValue.data.bVuXi;
} }
@@ -259,7 +259,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4); firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) { if (!isNaN(parseFloat(newValue.data.cVuXi)) && isFinite(newValue.data.cVuXi)) {
firstCoefficientVO.cVuXi = parseFloat((parseFloat(newValue.data.cVuXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.cVuXi = (parseFloat(newValue.data.cVuXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.cVuXi = newValue.data.cVuXi; firstCoefficientVO.cVuXi = newValue.data.cVuXi;
} }
@@ -267,7 +267,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4); firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) { if (!isNaN(parseFloat(newValue.data.aIeXi)) && isFinite(newValue.data.aIeXi)) {
firstCoefficientVO.aIeXi = parseFloat((parseFloat(newValue.data.aIeXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.aIeXi = (parseFloat(newValue.data.aIeXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.aIeXi = newValue.data.aIeXi; firstCoefficientVO.aIeXi = newValue.data.aIeXi;
} }
@@ -275,7 +275,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4); firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) { if (!isNaN(parseFloat(newValue.data.bIeXi)) && isFinite(newValue.data.bIeXi)) {
firstCoefficientVO.bIeXi = parseFloat((parseFloat(newValue.data.bIeXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.bIeXi = (parseFloat(newValue.data.bIeXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.bIeXi = newValue.data.bIeXi; firstCoefficientVO.bIeXi = newValue.data.bIeXi;
} }
@@ -283,7 +283,7 @@ watch(webMsgSend,function (newValue,oldValue){
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4); firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) { if (!isNaN(parseFloat(newValue.data.cIeXi)) && isFinite(newValue.data.cIeXi)) {
firstCoefficientVO.cIeXi = parseFloat((parseFloat(newValue.data.cIeXi) / 10000).toFixed(4)).toString(); firstCoefficientVO.cIeXi = (parseFloat(newValue.data.cIeXi) / 10000).toFixed(4);
} else { } else {
firstCoefficientVO.cIeXi = newValue.data.cIeXi; firstCoefficientVO.cIeXi = newValue.data.cIeXi;
} }

View File

@@ -452,12 +452,12 @@ const getTableList = async (params: any) => {
'name':form.value.search 'name':form.value.search
}); });
}else{//点击树根节点,表格显示无数据 }else{//点击树根节点,表格显示无数据
return getBoundPqDevList({'planId': '', // return getBoundPqDevList({'planId': '',
'checkStateList': [0], // 'checkStateList': [0],
'checkResult': form.value.checkResult, // 'checkResult': form.value.checkResult,
'reportState': form.value.checkReportStatus, // 'reportState': form.value.checkReportStatus,
'name':form.value.search // 'name':form.value.search
}); // });
} }
}; };

View File

@@ -69,6 +69,7 @@ const getTreeData = (val: any) => {
// 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey // 使用 nextTick 确保在 DOM 更新后调用 setCurrentKey
nextTick(() => { nextTick(() => {
treeRef.value?.setCurrentKey(node.id); treeRef.value?.setCurrentKey(node.id);
idd.value = node.id
}); });
//console.log(checkStore.planId,checkStore.planCode,checkStore.scriptId,checkStore.errorSysId) //console.log(checkStore.planId,checkStore.planCode,checkStore.scriptId,checkStore.errorSysId)
} }
@@ -87,7 +88,22 @@ watch(
deep: true, deep: true,
}, },
) )
const idd = ref('')
const handleNodeClick = (data: Plan.ResPlan) => { const handleNodeClick = (data: Plan.ResPlan) => {
if (data.name === '未检' || data.name === '检测中' || data.name === '检测完成') {
// 如果是父节点,不执行任何操作
//console.log('父节点不执行任何操作');
// 设置当前高亮节点
nextTick(() => {
treeRef.value?.setCurrentKey(idd.value);
});
return;
}
idd.value = data.id
checkStore.setPlanId(data.id) checkStore.setPlanId(data.id)
checkStore.setPlanCode(data.code) checkStore.setPlanCode(data.code)
checkStore.setScriptId(data.scriptId) checkStore.setScriptId(data.scriptId)

View File

@@ -43,6 +43,7 @@
:customData="{ :customData="{
title: '设备检测状态', title: '设备检测状态',
textAlign: 'left', textAlign: 'left',
}" }"
:legendData="{ :legendData="{
icon: 'circle', icon: 'circle',
@@ -302,36 +303,38 @@ const getPieData = async (id: string) => {
} }
}) })
// 检查 checkStateCount 是否全为 0
const allZero = Object.values(checkStateCount).every(count => count === 0);
chartsData1.value = [
{ value: allZero ? 0 : checkStateCount[0] === 0 ? null : checkStateCount[0], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZero ? 0 : checkStateCount[1] === 0 ? null : checkStateCount[1], name: '检测中', itemStyle: { color: '#ee6666' } },
{ value: allZero ? 0 : checkStateCount[2] === 0 ? null : checkStateCount[2], name: '检测完成', itemStyle: { color: '#91cc75' } },
{ value: allZero ? 0 : checkStateCount[3] === 0 ? null : checkStateCount[3], name: '归档', itemStyle: { color: '#5470c6' } },
];
// 同样处理 chartsData2 和 chartsData3
const allZeroResult = Object.values(checkResultCount).every(count => count === 0);
chartsData2.value = [
{ value: allZeroResult ? 0 : checkResultCount[2] === 0 ? null : checkResultCount[2], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZeroResult ? 0 : checkResultCount[0] === 0 ? null : checkResultCount[0], name: '不符合', itemStyle: { color: '#ee6666' } },
{ value: allZeroResult ? 0 : checkResultCount[1] === 0 ? null : checkResultCount[1], name: '符合', itemStyle: { color: '#91cc75' } },
];
// 检查 reportStateCount 是否全为 0
const allZeroReport = Object.values(reportStateCount).every(count => count === 0);
chartsData3.value = [
{ value: allZeroReport ? 0 : reportStateCount[2] === 0 ? null : reportStateCount[2], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZeroReport ? 0 : reportStateCount[0] === 0 ? null : reportStateCount[0], name: '未生成', itemStyle: { color: '#ee6666' } },
{ value: allZeroReport ? 0 : reportStateCount[1] === 0 ? null : reportStateCount[1], name: '已生成', itemStyle: { color: '#91cc75' } },
];
}else{ }else{
planName.value = '所选计划:' planName.value = '所选计划:'
} }
// 检查 checkStateCount 是否全为 0
const allZero = Object.values(checkStateCount).every(count => count === 0);
chartsData1.value = [
{ value: allZero ? 0 : checkStateCount[0] === 0 ? null : checkStateCount[0], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZero ? 0 : checkStateCount[1] === 0 ? null : checkStateCount[1], name: '检测中', itemStyle: { color: '#ee6666' } },
{ value: allZero ? 0 : checkStateCount[2] === 0 ? null : checkStateCount[2], name: '检测完成', itemStyle: { color: '#91cc75' } },
{ value: allZero ? 0 : checkStateCount[3] === 0 ? null : checkStateCount[3], name: '归档', itemStyle: { color: '#5470c6' } },
];
// 同样处理 chartsData2 和 chartsData3
const allZeroResult = Object.values(checkResultCount).every(count => count === 0);
chartsData2.value = [
{ value: allZeroResult ? 0 : checkResultCount[2] === 0 ? null : checkResultCount[2], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZeroResult ? 0 : checkResultCount[0] === 0 ? null : checkResultCount[0], name: '不符合', itemStyle: { color: '#ee6666' } },
{ value: allZeroResult ? 0 : checkResultCount[1] === 0 ? null : checkResultCount[1], name: '符合', itemStyle: { color: '#91cc75' } },
];
// 检查 reportStateCount 是否全为 0
const allZeroReport = Object.values(reportStateCount).every(count => count === 0);
chartsData3.value = [
{ value: allZeroReport ? 0 : reportStateCount[2] === 0 ? null : reportStateCount[2], name: '未检', itemStyle: { color: '#fac858' } },
{ value: allZeroReport ? 0 : reportStateCount[0] === 0 ? null : reportStateCount[0], name: '未生成', itemStyle: { color: '#ee6666' } },
{ value: allZeroReport ? 0 : reportStateCount[1] === 0 ? null : reportStateCount[1], name: '已生成', itemStyle: { color: '#91cc75' } },
];
pieRef1.value.init() pieRef1.value.init()
pieRef2.value.init() pieRef2.value.init()