微调
This commit is contained in:
@@ -46,3 +46,7 @@ export const getTableData = (params: {
|
||||
}) => {
|
||||
return http.post("/result/resultData/", params, {loading: false});
|
||||
}
|
||||
|
||||
export const exportRawData= () => {
|
||||
return http.download("/result/exportRawData", {loading: false});
|
||||
}
|
||||
@@ -74,3 +74,8 @@ export const downloadTemplate = () => {
|
||||
export const importPlan=(params: Device.ReqPqDevParams)=>{
|
||||
return http.upload(`/adPlan/import`, params)
|
||||
}
|
||||
|
||||
//导出被检设备
|
||||
export const downloadDevData=(params: Device.ReqPqDevParams)=>{
|
||||
return http.download(`/report/generateReport`, params)
|
||||
}
|
||||
@@ -22,7 +22,7 @@ export const startTest = (params) => {
|
||||
* @param params
|
||||
*/
|
||||
export const pauseTest = () => {
|
||||
return http.get(`/test/closePreTest`, params, {loading: false})
|
||||
return http.get(`/prepare/closePreTest`, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
<template>
|
||||
|
||||
<el-button v-if="tableData.length > 0" type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>
|
||||
<div class="table-main">
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }" height="335px"
|
||||
:cell-style="{ textAlign: 'center' }" height="315px"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||
<el-table-column prop="time" label="数据时间"/>
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column prop="dataA" :label="`A(${unit})`"/>
|
||||
<el-table-column prop="dataB" :label="`B(${unit})`"/>
|
||||
<el-table-column prop="dataC" :label="`C(${unit})`"/>
|
||||
<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">
|
||||
<el-table-column prop="dataT" :label="`T(${unit})`"/>
|
||||
<el-table-column prop="dataT" :label="'T'+(unit==''?'':'('+unit+')')"/>
|
||||
</template>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -20,9 +20,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import { computed } from "vue";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportRawData} from "@/api/check/test"
|
||||
|
||||
const {tableData} = defineProps<{
|
||||
tableData: CheckData.RawDataItem[]
|
||||
@@ -36,7 +37,9 @@ const phaseT = computed(() => {
|
||||
return tableData[0].dataT == '/' ? 0 : 1
|
||||
})
|
||||
|
||||
|
||||
const exportData = () => {
|
||||
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
|
||||
<div class="table-main">
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" height="335px" :header-cell-style="{ textAlign: 'center' } "
|
||||
<el-table v-if="tableData.length > 0" :data="tableData" height="357px" :header-cell-style="{ textAlign: 'center' } "
|
||||
:cell-style="{ textAlign: 'center' }">
|
||||
<!-- <el-table-column prop="chnNum" label="通道号" width="80">-->
|
||||
<!-- <template #default="{row}">-->
|
||||
@@ -9,14 +9,14 @@
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<template v-if="phaseT === 0">
|
||||
<el-table-column :label="`A(${unit})`">
|
||||
<el-table-column :label="'A'+(unit==''?'':'('+unit+')')">
|
||||
<el-table-column prop="stdA" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataA" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataA" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差:{{ scope.row.maxErrorA }} <br/>
|
||||
误差范围:{{ scope.row.maxErrorA }} <br/>
|
||||
误差值:{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
|
||||
@@ -26,14 +26,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`B(${unit})`">
|
||||
<el-table-column :label="'B'+(unit==''?'':'('+unit+')')">
|
||||
<el-table-column prop="stdB" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataB" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataB" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差:{{ scope.row.maxErrorB }}<br/>
|
||||
误差范围:{{ scope.row.maxErrorB }}<br/>
|
||||
误差值:{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
|
||||
@@ -43,14 +43,14 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column :label="`C(${unit})`">
|
||||
<el-table-column :label="'C'+(unit==''?'':'('+unit+')')">
|
||||
<el-table-column prop="stdC" width="100" label="标准值"/>
|
||||
<el-table-column prop="dataC" width="100" label="被检值"/>
|
||||
<el-table-column prop="isDataC" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差: {{ scope.row.maxErrorC }}<br/>
|
||||
误差范围: {{ scope.row.maxErrorC }}<br/>
|
||||
误差值:{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
|
||||
@@ -63,14 +63,14 @@
|
||||
</template>
|
||||
|
||||
<template v-if="phaseT === 1">
|
||||
<el-table-column :label="`T(${unit})`">
|
||||
<el-table-column :label="'T'+(unit==''?'':'('+unit+')')">
|
||||
<el-table-column prop="stdT" label="标准值"/>
|
||||
<el-table-column prop="dataT" label="被检值"/>
|
||||
<el-table-column prop="isDataT" label="检测结果">
|
||||
<template #default="scope">
|
||||
<el-tooltip effect="dark" placement="bottom">
|
||||
<template #content>
|
||||
最大误差: {{ scope.row.maxErrorT }}<br/>
|
||||
误差范围: {{ scope.row.maxErrorT }}<br/>
|
||||
误差值:{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }}
|
||||
</template>
|
||||
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
|
||||
@@ -80,7 +80,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="maxError" label="最大误差"/>-->
|
||||
<!-- <el-table-column prop="maxError" label="误差范围"/>-->
|
||||
<!-- <el-table-column prop="result" label="检测结果">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <span v-if="scope.row.result === 1">符合</span>-->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="appendToBody" class="dialog" title="数据查询" :model-value='visible' @close="close"
|
||||
v-bind="dialogBig" :draggable="false" style="margin-left: 20%;">
|
||||
v-bind="dialogBig" :draggable="false">
|
||||
<div class="data-check-dialog">
|
||||
<div class="data-check-head">
|
||||
<el-form :model='formContent' label-width="auto" class="form-three ">
|
||||
@@ -63,7 +63,7 @@
|
||||
</el-popover>
|
||||
</span>
|
||||
</div>
|
||||
<el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 210px;" v-if="harmNumList.length" label='谐波次数'>
|
||||
<el-form-item style="margin-left: 0px;margin-bottom:0px !important;width: 210px;" v-if="harmNumList.length" label='次数'>
|
||||
<el-select v-model="currentHarmNum">
|
||||
<el-option v-for="item in harmNumList" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
@@ -202,7 +202,7 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
|
||||
scriptId: checkStore.scriptId,
|
||||
devId: deviceId,
|
||||
devNum: formContent.chnNum + '',
|
||||
scriptType: scriptType,
|
||||
scriptType,
|
||||
code: parseInt(checkStore.planCode)
|
||||
})
|
||||
updateTreeFly(resTreeDataTemp, 2)
|
||||
@@ -267,7 +267,7 @@ const defaultOperate = () => {
|
||||
defaultExpandedKeys = [node.index]
|
||||
|
||||
treeRef.value?.setCurrentKey(node.index);
|
||||
|
||||
scriptType = node.scriptType ?? scriptType
|
||||
} else {
|
||||
currentScriptTypeName.value = ''
|
||||
currentDesc.value = ''
|
||||
@@ -341,7 +341,10 @@ const updateTableData = async () => {
|
||||
} 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' ? `${key}(/)` : `${key}(不符合)`})
|
||||
tempHarmNumList.push({
|
||||
value: key,
|
||||
label: value.isData === 1 ? key : value.isData === 4 ? `${formatHarmNum(key)}(/)` : `${formatHarmNum(key)}(不符合)`
|
||||
})
|
||||
}
|
||||
|
||||
Object.assign(harmNumList, tempHarmNumList)
|
||||
@@ -357,7 +360,6 @@ const updateTableData = async () => {
|
||||
}
|
||||
|
||||
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
|
||||
// console.log(checkStore.scriptId, _deviceId, chnNum, _scriptType);
|
||||
deviceId = _deviceId
|
||||
scriptType = _scriptType
|
||||
|
||||
@@ -455,6 +457,14 @@ const setCheckResultData = (data: CheckData.ResCheckResult) => {
|
||||
Object.assign(checkResultData, result)
|
||||
}
|
||||
|
||||
const formatHarmNum = (num: string) => {
|
||||
if (num.includes('.5')) {
|
||||
return num
|
||||
} else {
|
||||
return num.replace('.0', '')
|
||||
}
|
||||
}
|
||||
|
||||
const setRawData = (data: CheckData.RawDataItem[]) => {
|
||||
console.log("原始数据", data)
|
||||
data.forEach((item: CheckData.RawDataItem) => {
|
||||
@@ -605,7 +615,7 @@ defineExpose({
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
max-height: 473px;
|
||||
max-height: 495px;
|
||||
|
||||
padding: 10px 0.5% 0px 0.5%;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
@@ -260,6 +260,8 @@ import {CheckData} from '@/api/check/interface'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import auth from "@/directives/modules/auth";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import {downloadDevData} from '@/api/plan/plan.ts'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
const checkStore = useCheckStore()
|
||||
@@ -1004,7 +1006,8 @@ const openDrawer = (title: string, row: any) => {
|
||||
|
||||
if(title === '生成')
|
||||
{
|
||||
reportDialogVisible.value = true;
|
||||
//reportDialogVisible.value = true;
|
||||
useDownload(downloadDevData,'调试报告'+formatDate(new Date()), {planId:checkStore.planId,devId:row.id}, false,'.docx')
|
||||
}
|
||||
|
||||
if(title === '检测数据查询')
|
||||
@@ -1031,6 +1034,17 @@ const openDrawer = (title: string, row: any) => {
|
||||
}
|
||||
}
|
||||
|
||||
function formatDate(date : Date) {
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const hours = String(date.getHours()).padStart(2, '0');
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0');
|
||||
const seconds = String(date.getSeconds()).padStart(2, '0');
|
||||
|
||||
return `${year}年${month}月${day}日${hours}时${minutes}分${seconds}秒`;
|
||||
}
|
||||
|
||||
// 监听 props.id 的变化
|
||||
watch(
|
||||
() => props.id,
|
||||
|
||||
@@ -306,7 +306,7 @@ watch(testStatus, function (newValue, oldValue) {
|
||||
percentage.value = 0
|
||||
}
|
||||
emit('update:testStatus', 'test_init')
|
||||
// startTimer() // todo 可移除
|
||||
//startTimer() // todo 可移除
|
||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
|
||||
}
|
||||
})
|
||||
@@ -414,7 +414,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
percentage.value = 3
|
||||
|
||||
activeIndex = getNextActiveIndex() + 2
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
|
||||
emit('update:testStatus', 'process')
|
||||
}
|
||||
@@ -448,7 +448,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('FREQ')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'V_Start':
|
||||
@@ -462,7 +462,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('V')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'HV_Start':
|
||||
@@ -476,7 +476,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('HV')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'HI_Start':
|
||||
@@ -490,7 +490,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('HI')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'HP_Start':
|
||||
@@ -504,7 +504,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('HP')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'HSV_Start':
|
||||
@@ -518,7 +518,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('HSV')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'HSI_Start':
|
||||
@@ -532,7 +532,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('HSI')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'VOLTAGE_Start':
|
||||
@@ -546,7 +546,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('VOLTAGE')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'I_Start':
|
||||
@@ -560,7 +560,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('I')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'IMBV_Start':
|
||||
@@ -574,7 +574,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('IMBV')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'IMBA_Start':
|
||||
@@ -588,7 +588,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('IMBA')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'F_Start':
|
||||
@@ -602,7 +602,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
updateLog(false)
|
||||
if (testStatus.value != 'paused') {
|
||||
activeIndex = getNextActiveIndex('F')
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
}
|
||||
break;
|
||||
case 'Quit':
|
||||
@@ -1222,7 +1222,7 @@ const handleResumeTest = () => {
|
||||
type: 'info',
|
||||
log: `${new Date().toLocaleString()}:继续检测`,
|
||||
})
|
||||
// startTimer()
|
||||
//startTimer()
|
||||
console.log('开始继续检测')
|
||||
};
|
||||
|
||||
|
||||
@@ -377,8 +377,6 @@ const sendResume = () => {
|
||||
userPageId: "cdf",
|
||||
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||
planId: checkStore.planId,
|
||||
errorSysId: 'cb407009f9894a8a8933b5d9b1e2f71d',
|
||||
scriptId: "a303b2224845fcc6f60198b8ca23dca9",
|
||||
operateType: '2' // '1'为预检测、‘2‘为正式检测
|
||||
}).then(res => {
|
||||
Object.assign(webMsgSend.value, {
|
||||
|
||||
Reference in New Issue
Block a user