谐波次数、弹窗位置
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});
|
||||
}
|
||||
@@ -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,8 +1,8 @@
|
||||
<template>
|
||||
|
||||
<!-- <el-button 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="300px"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
||||
<el-table-column prop="time" label="数据时间"/>
|
||||
@@ -20,8 +20,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {useDownload} from "@/hooks/useDownload";
|
||||
import {exportRawData} from "@/api/check/test"
|
||||
|
||||
const {tableData} = defineProps<{
|
||||
tableData: CheckData.RawDataItem[]
|
||||
@@ -35,7 +36,9 @@ const phaseT = computed(() => {
|
||||
return tableData[0].dataT == '/' ? 0 : 1
|
||||
})
|
||||
|
||||
|
||||
const exportData = () => {
|
||||
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<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>
|
||||
@@ -33,7 +33,7 @@
|
||||
<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>
|
||||
@@ -50,7 +50,7 @@
|
||||
<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>
|
||||
@@ -70,7 +70,7 @@
|
||||
<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>
|
||||
@@ -341,7 +341,7 @@ 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)
|
||||
@@ -455,6 +455,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 +613,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;
|
||||
|
||||
@@ -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