修改正式监测返回结果
This commit is contained in:
@@ -6,7 +6,7 @@ export namespace CheckData {
|
|||||||
deviceName: string
|
deviceName: string
|
||||||
chnNum: string
|
chnNum: string
|
||||||
deviceId: string
|
deviceId: string
|
||||||
num?: string | number | null
|
num?: string | number
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PhaseCheckResult {
|
export interface PhaseCheckResult {
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export const getContrastResult = (params: {
|
|||||||
chnNum: string | number
|
chnNum: string | number
|
||||||
num: number | string | null
|
num: number | string | null
|
||||||
}) => {
|
}) => {
|
||||||
return http.post('/result/getContrastResult', params, { loading: false })
|
return http.post('/result/getContrastResult', params, { loading: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,80 +1,40 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="table-main" max-height="282px">
|
<div class="table-main" max-height="282px">
|
||||||
<el-table :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } "
|
<el-table
|
||||||
:cell-style="{ textAlign: 'center' }" max-height="282px"
|
:data="prop.tableData"
|
||||||
style="width: 100%;">
|
stripe
|
||||||
<el-table-column type="index" label="序号" width="70" fixed="left"/>
|
border
|
||||||
|
:header-cell-style="{ textAlign: 'center' }"
|
||||||
<el-table-column prop="dataA" :label="'被检设备'">
|
:cell-style="{ textAlign: 'center' }"
|
||||||
<el-table-column prop="time" label="数据时间" width="200"/>
|
max-height="282px"
|
||||||
<el-table-column prop="dataA" :label="'A相'"/>
|
style="width: 100%"
|
||||||
<el-table-column prop="dataA" :label="'B相'"/>
|
>
|
||||||
<el-table-column prop="dataA" :label="'C相'"/>
|
<el-table-column type="index" label="序号" width="70" fixed="left" />
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="dataA" :label="'标准设备'">
|
|
||||||
<el-table-column prop="time" label="数据时间" width="200"/>
|
|
||||||
<el-table-column prop="dataA" :label="'A相'"/>
|
|
||||||
<el-table-column prop="dataA" :label="'B相'"/>
|
|
||||||
<el-table-column prop="dataA" :label="'C相'"/>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<el-table-column prop="dataA" :label="'被检设备'">
|
||||||
|
<el-table-column prop="timeDev" label="数据时间" width="200" />
|
||||||
|
<el-table-column prop="uaDev" :label="'A相'" />
|
||||||
|
<el-table-column prop="ubDev" :label="'B相'" />
|
||||||
|
<el-table-column prop="ucDev" :label="'C相'" />
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dataA" :label="'标准设备'">
|
||||||
|
<el-table-column prop="timeStdDev" label="数据时间" width="200" />
|
||||||
|
<el-table-column prop="uaStdDev" :label="'A相'" />
|
||||||
|
<el-table-column prop="ubStdDev" :label="'B相'" />
|
||||||
|
<el-table-column prop="ucStdDev" :label="'C相'" />
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="tsx" setup>
|
<script lang="tsx" setup>
|
||||||
|
import { CheckData } from '@/api/check/interface'
|
||||||
// 模拟数据数组
|
const prop = defineProps({
|
||||||
const tableData = [
|
tableData: {
|
||||||
{
|
type: Array as () => CheckData.TableRow[],
|
||||||
time: "2023-10-25 14:30:00",
|
default: []
|
||||||
dataA: "220.12",
|
}
|
||||||
isDataA: "220.05",
|
})
|
||||||
dataB: "219.98",
|
|
||||||
isDataB: "220.02",
|
|
||||||
dataC: "220.05",
|
|
||||||
isDataC: "220.10"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time: "2023-10-25 14:30:03",
|
|
||||||
dataA: "219.85",
|
|
||||||
isDataA: "220.00",
|
|
||||||
dataB: "220.15",
|
|
||||||
isDataB: "220.08",
|
|
||||||
dataC: "220.20",
|
|
||||||
isDataC: "220.18"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time: "2023-10-25 14:30:06",
|
|
||||||
dataA: "220.03",
|
|
||||||
isDataA: "219.95",
|
|
||||||
dataB: "220.10",
|
|
||||||
isDataB: "220.00",
|
|
||||||
dataC: "219.90",
|
|
||||||
isDataC: "220.05"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time: "2023-10-25 14:30:09",
|
|
||||||
dataA: "220.25",
|
|
||||||
isDataA: "220.15",
|
|
||||||
dataB: "219.80",
|
|
||||||
isDataB: "219.90",
|
|
||||||
dataC: "220.10",
|
|
||||||
isDataC: "220.00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
time: "2023-10-25 14:30:12",
|
|
||||||
dataA: "219.95",
|
|
||||||
isDataA: "220.05",
|
|
||||||
dataB: "220.20",
|
|
||||||
isDataB: "220.15",
|
|
||||||
dataC: "220.05",
|
|
||||||
isDataC: "219.98"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
:header-cell-style="{ textAlign: 'center' }"
|
:header-cell-style="{ textAlign: 'center' }"
|
||||||
:cell-style="{ textAlign: 'center' }"
|
:cell-style="{ textAlign: 'center' }"
|
||||||
>
|
>
|
||||||
<el-table-column label="A相" v-if="prop.tableData[0].dataT ==null">
|
<el-table-column label="A相" v-if="prop.tableData[0].dataA ">
|
||||||
<el-table-column prop="stdA" :label="'被检值'">
|
<el-table-column prop="stdA" :label="'被检值'">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.dataA.data }}
|
{{ row.dataA.data }}
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="B相" v-if="prop.tableData[0].dataT==null">
|
<el-table-column label="B相" v-if="prop.tableData[0].dataB">
|
||||||
<el-table-column prop="stdB" :label="'被检值'">
|
<el-table-column prop="stdB" :label="'被检值'">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.dataB.data }}
|
{{ row.dataB.data }}
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="C相" v-if="prop.tableData[0].dataT==null">
|
<el-table-column label="C相" v-if="prop.tableData[0].dataC">
|
||||||
<el-table-column prop="stdC" :label="'被检值'" >
|
<el-table-column prop="stdC" :label="'被检值'" >
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ row.dataC.data }}
|
{{ row.dataC.data }}
|
||||||
|
|||||||
@@ -34,10 +34,20 @@
|
|||||||
<el-input v-model="formContent.deviceName" :disabled="true" />
|
<el-input v-model="formContent.deviceName" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="通道号">
|
<el-form-item label="通道号">
|
||||||
<el-select v-model="formContent.chnNum">
|
<el-select v-model="formContent.chnNum" @change="getResults">
|
||||||
<el-option v-for="item in chnList" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in chnList" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="检测次数">
|
||||||
|
<el-select v-model="formContent.num" clearable @change="getResults">
|
||||||
|
<el-option
|
||||||
|
v-for="item in chnMapList[formContent.chnNum]"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="checkStore.showDetailType === 1">
|
<el-form-item v-if="checkStore.showDetailType === 1">
|
||||||
<el-button type="primary" :icon="Postcard">报告生成</el-button>
|
<el-button type="primary" :icon="Postcard">报告生成</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -78,7 +88,7 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="原始数据" name="rawDataTab">
|
<el-tab-pane label="原始数据" name="rawDataTab">
|
||||||
<CompareDataCheckRawDataTable
|
<CompareDataCheckRawDataTable
|
||||||
:tableData="rawTableData[currentCheckItem]"
|
:tableData="currentRawTableData"
|
||||||
:currentScriptTypeName="currentScriptTypeName"
|
:currentScriptTypeName="currentScriptTypeName"
|
||||||
@exportRawDataHandler="exportRawDataHandler"
|
@exportRawDataHandler="exportRawDataHandler"
|
||||||
/>
|
/>
|
||||||
@@ -125,6 +135,7 @@ let scriptType: string | null = null
|
|||||||
watch(searchValue, val => {
|
watch(searchValue, val => {
|
||||||
treeRef.value!.filter(val)
|
treeRef.value!.filter(val)
|
||||||
})
|
})
|
||||||
|
const chnMapList: any = ref({})
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formContent = reactive<CheckData.DataCheck>({
|
const formContent = reactive<CheckData.DataCheck>({
|
||||||
@@ -134,7 +145,7 @@ const formContent = reactive<CheckData.DataCheck>({
|
|||||||
deviceName: '',
|
deviceName: '',
|
||||||
chnNum: '',
|
chnNum: '',
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
num: null
|
num: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
// 通道下拉列表
|
// 通道下拉列表
|
||||||
@@ -153,6 +164,10 @@ const currentCheckResultData = computed(() => {
|
|||||||
const data = checkResultData.value[currentCheckItem.value]
|
const data = checkResultData.value[currentCheckItem.value]
|
||||||
return Array.isArray(data) ? data : []
|
return Array.isArray(data) ? data : []
|
||||||
})
|
})
|
||||||
|
const currentRawTableData = computed(() => {
|
||||||
|
const data = rawTableData.value[currentCheckItem.value]
|
||||||
|
return Array.isArray(data) ? data : []
|
||||||
|
})
|
||||||
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
|
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
|
||||||
if (source == 1) {
|
if (source == 1) {
|
||||||
// 正式检测进入页面
|
// 正式检测进入页面
|
||||||
@@ -186,6 +201,7 @@ const getBasicInformation = async () => {
|
|||||||
formContent.dataRule = res.data.dataRule
|
formContent.dataRule = res.data.dataRule
|
||||||
formContent.deviceName = res.data.deviceName
|
formContent.deviceName = res.data.deviceName
|
||||||
formContent.errorSysId = res.data.errorSysId
|
formContent.errorSysId = res.data.errorSysId
|
||||||
|
chnMapList.value = res.data.chnMap
|
||||||
let chnMap: string[] = []
|
let chnMap: string[] = []
|
||||||
for (let key in res.data.chnMap) {
|
for (let key in res.data.chnMap) {
|
||||||
chnMap.push(key)
|
chnMap.push(key)
|
||||||
@@ -204,12 +220,15 @@ const getTestItem = async () => {
|
|||||||
}
|
}
|
||||||
// 获取结果
|
// 获取结果
|
||||||
const getResults = async () => {
|
const getResults = async () => {
|
||||||
|
checkResultData.value = []
|
||||||
|
rawTableData.value = []
|
||||||
|
|
||||||
getContrastResult({
|
getContrastResult({
|
||||||
planId: checkStore.plan.id,
|
planId: checkStore.plan.id,
|
||||||
scriptType: rowList.value.scriptType,
|
scriptType: rowList.value.scriptType,
|
||||||
deviceId: formContent.deviceId,
|
deviceId: formContent.deviceId,
|
||||||
chnNum: formContent.chnNum,
|
chnNum: formContent.chnNum,
|
||||||
num: formContent.num ?? null
|
num: formContent.num == '' ? null : formContent.num
|
||||||
}).then((res: any) => {
|
}).then((res: any) => {
|
||||||
let list: string[] = []
|
let list: string[] = []
|
||||||
for (let key in res.data.resultMap) {
|
for (let key in res.data.resultMap) {
|
||||||
|
|||||||
Reference in New Issue
Block a user