谐波次数、弹窗位置

This commit is contained in:
caozehui
2025-01-13 13:57:24 +08:00
parent 4bb4eb80d9
commit 17fe29cb1b
7 changed files with 44 additions and 31 deletions

View File

@@ -46,3 +46,7 @@ export const getTableData = (params: {
}) => { }) => {
return http.post("/result/resultData/", params, {loading: false}); return http.post("/result/resultData/", params, {loading: false});
} }
export const exportRawData= () => {
return http.download("/result/exportRawData", {loading: false});
}

View File

@@ -22,7 +22,7 @@ export const startTest = (params) => {
* @param params * @param params
*/ */
export const pauseTest = () => { export const pauseTest = () => {
return http.get(`/test/closePreTest`, params, {loading: false}) return http.get(`/prepare/closePreTest`, {loading: false})
} }
/** /**

View File

@@ -1,8 +1,8 @@
<template> <template>
<!-- <el-button type="primary" @click="exportData" style="margin-bottom: 10px">导出</el-button>-->
<div class="table-main"> <div class="table-main">
<el-table v-if="tableData.length > 0" :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } " <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%;"> style="width: 100%;">
<el-table-column type="index" label="序号" width="70" fixed="left"/> <el-table-column type="index" label="序号" width="70" fixed="left"/>
<el-table-column prop="time" label="数据时间"/> <el-table-column prop="time" label="数据时间"/>
@@ -20,8 +20,9 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import {CheckData} from "@/api/check/interface"; import {CheckData} from "@/api/check/interface";
import {useDownload} from "@/hooks/useDownload";
import {exportRawData} from "@/api/check/test"
const {tableData} = defineProps<{ const {tableData} = defineProps<{
tableData: CheckData.RawDataItem[] tableData: CheckData.RawDataItem[]
@@ -35,7 +36,9 @@ const phaseT = computed(() => {
return tableData[0].dataT == '/' ? 0 : 1 return tableData[0].dataT == '/' ? 0 : 1
}) })
const exportData = () => {
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
}
</script> </script>
<style scoped> <style scoped>

View File

@@ -16,7 +16,7 @@
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
最大误差{{ scope.row.maxErrorA }} <br/> 误差范围{{ scope.row.maxErrorA }} <br/>
误差值{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }} 误差值{{ scope.row.errorA }} {{ scope.row.errorA !== '/' ? unit : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
@@ -33,7 +33,7 @@
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
最大误差{{ scope.row.maxErrorB }}<br/> 误差范围{{ scope.row.maxErrorB }}<br/>
误差值{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }} 误差值{{ scope.row.errorB }} {{ scope.row.errorB !== '/' ? unit : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
@@ -50,7 +50,7 @@
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
最大误差 {{ scope.row.maxErrorC }}<br/> 误差范围 {{ scope.row.maxErrorC }}<br/>
误差值{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }} 误差值{{ scope.row.errorC }} {{ scope.row.errorC !== '/' ? unit : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
@@ -70,7 +70,7 @@
<template #default="scope"> <template #default="scope">
<el-tooltip effect="dark" placement="bottom"> <el-tooltip effect="dark" placement="bottom">
<template #content> <template #content>
最大误差 {{ scope.row.maxErrorT }}<br/> 误差范围 {{ scope.row.maxErrorT }}<br/>
误差值{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }} 误差值{{ scope.row.errorT }} {{ scope.row.errorT !== '/' ? unit : '' }}
</template> </template>
<el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag> <el-tag type="success" v-if="scope.row.isDataT === 1">符合</el-tag>
@@ -80,7 +80,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="maxError" label="最大误差"/>--> <!-- <el-table-column prop="maxError" label="误差范围"/>-->
<!-- <el-table-column prop="result" label="检测结果">--> <!-- <el-table-column prop="result" label="检测结果">-->
<!-- <template #default="scope">--> <!-- <template #default="scope">-->
<!-- <span v-if="scope.row.result === 1">符合</span>--> <!-- <span v-if="scope.row.result === 1">符合</span>-->

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog :append-to-body="appendToBody" class="dialog" title="数据查询" :model-value='visible' @close="close" <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-dialog">
<div class="data-check-head"> <div class="data-check-head">
<el-form :model='formContent' label-width="auto" class="form-three "> <el-form :model='formContent' label-width="auto" class="form-three ">
@@ -63,7 +63,7 @@
</el-popover> </el-popover>
</span> </span>
</div> </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-select v-model="currentHarmNum">
<el-option v-for="item in harmNumList" :key="item.value" :label="item.label" :value="item.value"/> <el-option v-for="item in harmNumList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select> </el-select>
@@ -341,7 +341,7 @@ const updateTableData = async () => {
} else if (keys1.length != 0) { } else if (keys1.length != 0) {
let tempHarmNumList: { value: string, label: string }[] = [] let tempHarmNumList: { value: string, label: string }[] = []
for (let [key, value] of resTableData.resultData) { 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) Object.assign(harmNumList, tempHarmNumList)
@@ -455,6 +455,14 @@ const setCheckResultData = (data: CheckData.ResCheckResult) => {
Object.assign(checkResultData, result) Object.assign(checkResultData, result)
} }
const formatHarmNum = (num: string) => {
if(num.includes('.5')){
return num
}else{
return num.replace('.0','')
}
}
const setRawData = (data: CheckData.RawDataItem[]) => { const setRawData = (data: CheckData.RawDataItem[]) => {
console.log("原始数据", data) console.log("原始数据", data)
data.forEach((item: CheckData.RawDataItem) => { data.forEach((item: CheckData.RawDataItem) => {
@@ -605,7 +613,7 @@ defineExpose({
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
max-height: 473px; max-height: 495px;
padding: 10px 0.5% 0px 0.5%; padding: 10px 0.5% 0px 0.5%;
border: 1px solid #ccc; border: 1px solid #ccc;

View File

@@ -377,8 +377,6 @@ const sendResume = () => {
userPageId: "cdf", userPageId: "cdf",
devIds: checkStore.devices.map((item) => item.deviceId), devIds: checkStore.devices.map((item) => item.deviceId),
planId: checkStore.planId, planId: checkStore.planId,
errorSysId: 'cb407009f9894a8a8933b5d9b1e2f71d',
scriptId: "a303b2224845fcc6f60198b8ca23dca9",
operateType: '2' // '1'为预检测、2为正式检测 operateType: '2' // '1'为预检测、2为正式检测
}).then(res => { }).then(res => {
Object.assign(webMsgSend.value, { Object.assign(webMsgSend.value, {