三项不平衡原始数据表头修改

This commit is contained in:
caozehui
2025-01-22 14:03:50 +08:00
parent f22b4e7fb8
commit 68aa4c409b
2 changed files with 16 additions and 47 deletions

View File

@@ -6,14 +6,17 @@
style="width: 100%;">
<el-table-column type="index" label="序号" width="70" fixed="left"/>
<el-table-column prop="time" label="数据时间"/>
<template v-if="phaseT === 0">
<template v-if="!isThreePhase && phaseT === 0">
<el-table-column prop="dataA" :label="'A相'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataB" :label="'B相'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':''+unit+'')"/>
</template>
<template v-if="phaseT === 1">
<template v-if="!isThreePhase && phaseT === 1">
<el-table-column prop="dataT" :label="tableHeader+(unit==''?'':''+unit+'')"/>
</template>
<template v-if="isThreePhase">
<el-table-column prop="dataB" :label="'负序不平衡度'+(unit==''?'':''+unit+'')"/>
</template>
</el-table>
</div>
@@ -46,6 +49,10 @@ const tableHeader = computed(() => {
return currentScriptTypeName
})
const isThreePhase = computed(() => {
return currentScriptTypeName.includes('三相电压不平衡度') || currentScriptTypeName.includes('三相电流不平衡度')
})
const exportData = () => {
emit('exportRawDataHandler')
}

View File

@@ -80,7 +80,7 @@
<DataCheckResultTable :tableData="checkResultData" :currentScriptTypeName="currentScriptTypeName"/>
</el-tab-pane>
<el-tab-pane label="原始数据" name="rawDataTab">
<DataCheckRawDataTable :tableData="rawTableData" :currentScriptTypeName="currentScriptTypeName"/>
<DataCheckRawDataTable :tableData="rawTableData" :currentScriptTypeName="currentScriptTypeName" @exportRawDataHandler="exportRawDataHandler"/>
</el-tab-pane>
</el-tabs>
</div>
@@ -173,6 +173,7 @@ const popoverWidth: ComputedRef<string> = computed(() => {
return `${940 - (currentScriptTypeName.value.length + 7) * 14 - (checkList.length ? 220 : 0)}px`
})
// 原始数据表格数据
const rawTableData = reactive<CheckData.RawDataItem[]>([])
@@ -194,6 +195,7 @@ const handleNodeClick = async (data: any) => {
if (checkIndex.value) {
await updateTableData()
activeTab.value = 'resultTab'
}
}
};
@@ -241,20 +243,14 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
watch(currentCheckItem, (newVal, oldVal) => {
// console.log("当前检测项", newVal);
console.log("当前检测项", newVal);
if (newVal) {
doCurrentCheckItemUpdate(newVal)
} else {
activeTab.value = 'resultTab'
}
activeTab.value = 'resultTab'
})
// const handleSwitchChange = async (data: any) => {
// console.log("切换不合格测试项、全部测试项", data);
//
// defaultOperate()
// await updateTableData()
// }
// 默认操作
const defaultOperate = () => {
let node = getDefaultNode(treeDataAll)
@@ -320,47 +316,13 @@ const updateTableData = async () => {
resCheckResult = resTableData.resultData.get(keys1[0])
resRawData = resTableData.rawData.get(keys2[0])
// Object.assign(harmNumList, [])
// currentHarmNum.value = '-1'
resRawData = (resRawData == null || resRawData == undefined ? [] : resRawData)
resCheckResult = (resCheckResult == null || resCheckResult == undefined ? {} : resCheckResult)
setCheckResultData(resCheckResult)
setRawData(resRawData)
checkList.length = 0
currentCheckItem.value = ''
} else
// if (resTableData.resultData.get('电压幅值') || resTableData.resultData.get('持续时间')) {
// let tempCheckList = []
// if (resTableData.resultData.get('电压幅值')) {
// tempCheckList.push({value: 'Voltage', label: '电压幅值'})
// //resCheckResult = resTableData.resultData.get('电压幅值')
// }
// if (resTableData.resultData.get('持续时间')) {
// tempCheckList.push({value: 'Duration', label: '持续时间'})
// //resCheckResult = resTableData.resultData.get('持续时间')
// }
//
// Object.assign(checkList, tempCheckList)
// currentCheckItem.value = checkList[0].value
//
// Object.assign(harmNumList, [])
// currentHarmNum.value = '-1'
//
// //setCheckResultData(resCheckResult)
// } else
if (keys1.length != 0) {
// let tempHarmNumList: { value: string, label: string }[] = []
// for (let [key, value] of resTableData.resultData) {
// tempHarmNumList.push({
// value: key,
// label: value.isData === 1 ? key : value.isData === 4 ? `${formatHarmNum(key)}/` : `${formatHarmNum(key)}(不符合)`
// })
// }
//
// Object.assign(harmNumList, tempHarmNumList)
// currentHarmNum.value = harmNumList.length > 0 ? harmNumList[0].value : '-1'
} else if (keys1.length != 0) {
let tempCheckList = []
for (let [key, value] of resTableData.resultData) {
let hum = formatHarmNum(key)