联调 正式检测结果页面
This commit is contained in:
@@ -1,127 +1,149 @@
|
|||||||
export namespace CheckData {
|
export namespace CheckData {
|
||||||
export interface DataCheck {
|
export interface DataCheck {
|
||||||
scriptName: string,
|
scriptName: string
|
||||||
errorSysId: string,
|
errorSysId: string
|
||||||
dataRule: string,
|
dataRule: string
|
||||||
deviceName: string,
|
deviceName: string
|
||||||
chnNum: string,
|
chnNum: string
|
||||||
|
deviceId: string
|
||||||
|
num?: string | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PhaseCheckResult {
|
export interface PhaseCheckResult {
|
||||||
// 检测源定值-标准值
|
// 检测源定值-标准值
|
||||||
resultData: number,
|
resultData: number
|
||||||
// 装置原始数据-被检值
|
// 装置原始数据-被检值
|
||||||
data: number,
|
data: number
|
||||||
|
|
||||||
// 误差值
|
// 误差值
|
||||||
errorData: number,
|
errorData: number
|
||||||
// 第几次谐波
|
// 第几次谐波
|
||||||
num?: number,
|
num?: number
|
||||||
//符合、不符合
|
//符合、不符合
|
||||||
isData?: number,
|
isData?: number
|
||||||
//最大误差值
|
//最大误差值
|
||||||
radius?: string,
|
radius?: string
|
||||||
unit?: string,
|
unit?: string
|
||||||
|
}
|
||||||
|
export interface DataItem {
|
||||||
|
num: number
|
||||||
|
isData: number
|
||||||
|
data: number
|
||||||
|
resultData: number
|
||||||
|
radius: string
|
||||||
|
errorData: number
|
||||||
|
unit: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TableRow {
|
||||||
|
isData: number
|
||||||
|
harmNum: number
|
||||||
|
radius: string
|
||||||
|
dataA: DataItem
|
||||||
|
dataB: DataItem
|
||||||
|
dataC: DataItem
|
||||||
|
dataT: DataItem | null
|
||||||
|
unit: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于定义 查看(设备)通道检测结果响应数据 类型
|
* 用于定义 查看(设备)通道检测结果响应数据 类型
|
||||||
*/
|
*/
|
||||||
export interface ResCheckResult {
|
export interface ResCheckResult {
|
||||||
dataA?: PhaseCheckResult | null,
|
dataA?: PhaseCheckResult | null
|
||||||
dataB?: PhaseCheckResult | null,
|
dataB?: PhaseCheckResult | null
|
||||||
dataC?: PhaseCheckResult | null,
|
dataC?: PhaseCheckResult | null
|
||||||
dataT?: PhaseCheckResult | null,
|
dataT?: PhaseCheckResult | null
|
||||||
|
|
||||||
// 第几次谐波
|
// 第几次谐波
|
||||||
//num: number | null,
|
//num: number | null,
|
||||||
//符合、不符合
|
//符合、不符合
|
||||||
isData?: number,
|
isData?: number
|
||||||
//最大误差值
|
//最大误差值
|
||||||
radius?: string,
|
radius?: string
|
||||||
//单位
|
//单位
|
||||||
unit?: string,
|
unit?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
|
* 用于定义 查看(设备)通道检测结果表格展示数据 类型
|
||||||
*/
|
*/
|
||||||
export interface CheckResult {
|
export interface CheckResult {
|
||||||
stdA?: string,
|
stdA?: string
|
||||||
dataA?: string,
|
dataA?: string
|
||||||
errorA?: string,
|
errorA?: string
|
||||||
maxErrorA?: string,
|
maxErrorA?: string
|
||||||
isDataA?: number,
|
isDataA?: number
|
||||||
unitA?: string,
|
unitA?: string
|
||||||
stdB?: string,
|
stdB?: string
|
||||||
dataB?: string,
|
dataB?: string
|
||||||
errorB?: string,
|
errorB?: string
|
||||||
maxErrorB?: string,
|
maxErrorB?: string
|
||||||
isDataB?: number,
|
isDataB?: number
|
||||||
unitB?: string,
|
unitB?: string
|
||||||
stdC?: string,
|
stdC?: string
|
||||||
dataC?: string,
|
dataC?: string
|
||||||
errorC?: string,
|
errorC?: string
|
||||||
maxErrorC?: string,
|
maxErrorC?: string
|
||||||
isDataC?: number,
|
isDataC?: number
|
||||||
unitC?: string,
|
unitC?: string
|
||||||
stdT?: string,
|
stdT?: string
|
||||||
dataT?: string,
|
dataT?: string
|
||||||
errorT?: string,
|
errorT?: string
|
||||||
maxErrorT?: string,
|
maxErrorT?: string
|
||||||
isDataT?: number,
|
isDataT?: number
|
||||||
unitT?: string,
|
unitT?: string
|
||||||
|
|
||||||
//最大误差值
|
//最大误差值
|
||||||
maxError?: string,
|
maxError?: string
|
||||||
unit?: string,
|
unit?: string
|
||||||
//符合、不符合
|
//符合、不符合
|
||||||
result?: number,
|
result?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于定义 具体通道的原始数据类型
|
* 用于定义 具体通道的原始数据类型
|
||||||
*/
|
*/
|
||||||
export interface RawDataItem {
|
export interface RawDataItem {
|
||||||
time?: string,
|
time?: string
|
||||||
harmNum?: number | null,
|
harmNum?: number | null
|
||||||
dataA?: string,
|
dataA?: string
|
||||||
dataB?: string,
|
dataB?: string
|
||||||
dataC?: string,
|
dataC?: string
|
||||||
dataT?: string,
|
dataT?: string
|
||||||
unit?: string | null
|
unit?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Device {
|
export interface Device {
|
||||||
deviceId: string; //装置序号Id
|
deviceId: string //装置序号Id
|
||||||
deviceName: string; //设备名称
|
deviceName: string //设备名称
|
||||||
chnNum: number; //设备通道数
|
chnNum: number //设备通道数
|
||||||
|
|
||||||
planId: string; //计划Id
|
planId: string //计划Id
|
||||||
devType: string; //设备类型
|
devType: string //设备类型
|
||||||
devVolt: number; //设备电压
|
devVolt: number //设备电压
|
||||||
devCurr: number; //设备电流
|
devCurr: number //设备电流
|
||||||
factorFlag: number; //是否支持系数校准
|
factorFlag: number //是否支持系数校准
|
||||||
checkResult:number; //检测结果
|
checkResult: number //检测结果
|
||||||
chnNumList: object[]; //连线存储数据
|
chnNumList: string[] //连线存储数据
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用来描述检测脚本类型
|
// 用来描述检测脚本类型
|
||||||
export interface ScriptItem {
|
export interface ScriptItem {
|
||||||
id: string,
|
id: string
|
||||||
code: string,
|
code: string
|
||||||
scriptName: string,
|
scriptName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用来描述 检测数据-左侧树结构
|
// 用来描述 检测数据-左侧树结构
|
||||||
export interface TreeItem {
|
export interface TreeItem {
|
||||||
id: string | null,
|
id: string | null
|
||||||
scriptTypeName: string | null,
|
scriptTypeName: string | null
|
||||||
sourceDesc: string | null,
|
sourceDesc: string | null
|
||||||
harmNum: number | null,
|
harmNum: number | null
|
||||||
index: number | null,
|
index: number | null
|
||||||
fly: number | null,
|
fly: number | null
|
||||||
children: TreeItem[] | null,
|
children: TreeItem[] | null
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用来描述 通道检测结果
|
// 用来描述 通道检测结果
|
||||||
@@ -136,8 +158,8 @@ export namespace CheckData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceCheckResult {
|
export interface DeviceCheckResult {
|
||||||
deviceId: string,
|
deviceId: string
|
||||||
deviceName: string,
|
deviceName: string
|
||||||
chnResult: ChnCheckResultEnum[] //通道检测结果
|
chnResult: ChnCheckResultEnum[] //通道检测结果
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +177,7 @@ export namespace CheckData {
|
|||||||
LOADING = 'var(--el-color-primary)',
|
LOADING = 'var(--el-color-primary)',
|
||||||
SUCCESS = '#91cc75',
|
SUCCESS = '#91cc75',
|
||||||
WARNING = '#e6a23c',
|
WARNING = '#e6a23c',
|
||||||
DANGER = '#f56c6c',
|
DANGER = '#f56c6c'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,18 +192,17 @@ export namespace CheckData {
|
|||||||
* 用于描述 脚本检测结果展示的按钮类型
|
* 用于描述 脚本检测结果展示的按钮类型
|
||||||
*/
|
*/
|
||||||
export interface ScriptChnViewItem {
|
export interface ScriptChnViewItem {
|
||||||
scriptType: string,
|
scriptType: string
|
||||||
scriptName?: string //脚本项名称,可以不要该属性,有点多余
|
scriptName?: string //脚本项名称,可以不要该属性,有点多余
|
||||||
|
|
||||||
// 设备
|
// 设备
|
||||||
devices: Array<{
|
devices: Array<{
|
||||||
deviceId: string,
|
deviceId: string
|
||||||
deviceName: string,
|
deviceName: string
|
||||||
chnResult: ButtonResult[],
|
chnResult: ButtonResult[]
|
||||||
}>
|
}>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定义检测日志类型
|
* 定义检测日志类型
|
||||||
*/
|
*/
|
||||||
@@ -194,21 +215,16 @@ export namespace CheckData {
|
|||||||
* 定义手动检测时,勾选的测试项
|
* 定义手动检测时,勾选的测试项
|
||||||
*/
|
*/
|
||||||
export interface SelectTestItem {
|
export interface SelectTestItem {
|
||||||
preTest: boolean,
|
preTest: boolean
|
||||||
timeTest: boolean,
|
timeTest: boolean
|
||||||
channelsTest: boolean,
|
channelsTest: boolean
|
||||||
test: boolean
|
test: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//描述比对式检测项描述
|
//描述比对式检测项描述
|
||||||
export interface CompareTestItem {
|
export interface CompareTestItem {
|
||||||
id: string,
|
id: string
|
||||||
code: string,
|
code: string
|
||||||
name: string,
|
name: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { pa } from 'element-plus/es/locale/index.mjs';
|
import { pa } from 'element-plus/es/locale/index.mjs'
|
||||||
import http from "@/api";
|
import http from '@/api'
|
||||||
import {CheckData} from "@/api/check/interface";
|
import { CheckData } from '@/api/check/interface'
|
||||||
|
|
||||||
export const getBigTestItem = (params: {
|
export const getBigTestItem = (params: {
|
||||||
reCheckType: number,
|
reCheckType: number
|
||||||
planId: string,
|
planId: string
|
||||||
devIds: string[],
|
devIds: string[]
|
||||||
patternId: string
|
patternId: string
|
||||||
}) => {
|
}) => {
|
||||||
return http.post(`/adPlan/getBigTestItem`, params, {loading: false});
|
return http.post(`/adPlan/getBigTestItem`, params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,12 +16,12 @@ export const getBigTestItem = (params: {
|
|||||||
* @param params 当为scriptType为null时,表示查询所有脚本类型,否则只查询指定脚本类型。当为chnNum为-1时,表示查询所有通道,否则只查询指定通道。
|
* @param params 当为scriptType为null时,表示查询所有脚本类型,否则只查询指定脚本类型。当为chnNum为-1时,表示查询所有通道,否则只查询指定通道。
|
||||||
*/
|
*/
|
||||||
export const getFormData = (params: {
|
export const getFormData = (params: {
|
||||||
planId: string,
|
planId: string
|
||||||
deviceId: string,
|
deviceId: string
|
||||||
chnNum: string,
|
chnNum: string
|
||||||
scriptType: string | null
|
scriptType: string | null
|
||||||
}) => {
|
}) => {
|
||||||
return http.post("/result/formContent/", params, {loading: false});
|
return http.post('/result/formContent/', params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,13 +29,13 @@ export const getFormData = (params: {
|
|||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const getTreeData = (params: {
|
export const getTreeData = (params: {
|
||||||
scriptId?: string,
|
scriptId?: string
|
||||||
devId?: string,
|
devId?: string
|
||||||
devNum?: string,
|
devNum?: string
|
||||||
scriptType?: string | null,
|
scriptType?: string | null
|
||||||
code?: string,
|
code?: string
|
||||||
}) => {
|
}) => {
|
||||||
return http.post<CheckData.TreeItem[]>("/result/treeData/", params, {loading: false});
|
return http.post<CheckData.TreeItem[]>('/result/treeData/', params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,25 +43,25 @@ export const getTreeData = (params: {
|
|||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const getTableData = (params: {
|
export const getTableData = (params: {
|
||||||
scriptType: string | null,
|
scriptType: string | null
|
||||||
scriptId: string,
|
scriptId: string
|
||||||
devId: string,
|
devId: string
|
||||||
devNum: string,
|
devNum: string
|
||||||
code: string,
|
code: string
|
||||||
index: number,
|
index: number
|
||||||
}) => {
|
}) => {
|
||||||
return http.post("/result/resultData/", params, {loading: false});
|
return http.post('/result/resultData/', params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const exportRawData = (params: {
|
export const exportRawData = (params: {
|
||||||
scriptType: string | null,
|
scriptType: string | null
|
||||||
scriptId: string,
|
scriptId: string
|
||||||
devId: string,
|
devId: string
|
||||||
devNum: string,
|
devNum: string
|
||||||
code: string,
|
code: string
|
||||||
index: number,
|
index: number
|
||||||
}) => {
|
}) => {
|
||||||
return http.download("/result/exportRawData", params, {loading: false});
|
return http.download('/result/exportRawData', params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -69,13 +69,39 @@ export const exportRawData = (params: {
|
|||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const reCalculate = (params: {
|
export const reCalculate = (params: {
|
||||||
planId: string,
|
planId: string
|
||||||
scriptId: string,
|
scriptId: string
|
||||||
errorSysId: string,
|
errorSysId: string
|
||||||
deviceId: string,
|
deviceId: string
|
||||||
code: string
|
code: string
|
||||||
}) => {
|
}) => {
|
||||||
return http.post("/result/reCalculate", params, {loading: true});
|
return http.post('/result/reCalculate', params, { loading: true })
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取数据获取基本信息
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getContrastFormContent = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptType: string
|
||||||
|
deviceId: string
|
||||||
|
chnNum: string | number
|
||||||
|
num: number | string | null
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/getContrastFormContent', params, { loading: false })
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取检测结果
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getContrastResult = (params: {
|
||||||
|
planId: string
|
||||||
|
scriptType: string
|
||||||
|
deviceId: string
|
||||||
|
chnNum: string | number
|
||||||
|
num: number | string | null
|
||||||
|
}) => {
|
||||||
|
return http.post('/result/getContrastResult', params, { loading: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,13 +109,13 @@ export const reCalculate = (params: {
|
|||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const changeErrorSystem = (params: {
|
export const changeErrorSystem = (params: {
|
||||||
planId: string,
|
planId: string
|
||||||
scriptId: string,
|
scriptId: string
|
||||||
errorSysId: string,
|
errorSysId: string
|
||||||
deviceId: string,
|
deviceId: string
|
||||||
code: string
|
code: string
|
||||||
}) => {
|
}) => {
|
||||||
return http.post("/result/changeErrorSystem", params, {loading: true});
|
return http.post('/result/changeErrorSystem', params, { loading: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,94 +1,165 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="table-main">
|
<div class="table-main">
|
||||||
<el-table :data="mockTableData" height="357px" :header-cell-style="{ textAlign: 'center' } "
|
<el-table
|
||||||
:cell-style="{ textAlign: 'center' }">
|
:data="prop.tableData"
|
||||||
<el-table-column label="A相" >
|
height="357px"
|
||||||
<el-table-column prop="stdA" :label="'被检值'"/>
|
:header-cell-style="{ textAlign: 'center' }"
|
||||||
<el-table-column prop="dataA" :label="'标准值'"/>
|
:cell-style="{ textAlign: 'center' }"
|
||||||
|
>
|
||||||
|
<el-table-column label="A相" v-if="prop.tableData[0].dataT ==null">
|
||||||
|
<el-table-column prop="stdA" :label="'被检值'">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataA.data }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dataA" :label="'标准值'">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataA.resultData }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="isDataA" label="检测结果">
|
<el-table-column prop="isDataA" label="检测结果">
|
||||||
<template #default="scope">
|
<template #default="{ row }">
|
||||||
<el-tooltip effect="dark" placement="bottom">
|
<el-tooltip effect="dark" placement="bottom">
|
||||||
<el-tag type="success" v-if="scope.row.isDataA === 1">符合</el-tag>
|
<template #content>
|
||||||
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
|
误差范围:{{ addPercentSigns(row.dataA.radius,row.dataA.unit) }}
|
||||||
<el-tag type="warning" v-if="scope.row.isDataA === 4">/</el-tag>
|
<br />
|
||||||
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
误差值:{{ row.dataA.errorData }}
|
||||||
|
</template>
|
||||||
|
<el-tag type="success" v-if="row.dataA.isData === 1">符合</el-tag>
|
||||||
|
<el-tag type="danger" v-if="row.dataA.isData === 2">不符合</el-tag>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="B相" >
|
<el-table-column label="B相" v-if="prop.tableData[0].dataT==null">
|
||||||
<el-table-column prop="stdB" :label="'被检值'"/>
|
<el-table-column prop="stdB" :label="'被检值'">
|
||||||
<el-table-column prop="dataB" :label="'标准值'"/>
|
<template #default="{ row }">
|
||||||
|
{{ row.dataB.data }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dataB" :label="'标准值'">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataB.resultData }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="isDataB" label="检测结果">
|
<el-table-column prop="isDataB" label="检测结果">
|
||||||
<template #default="scope">
|
<template #default="{ row }">
|
||||||
<el-tooltip effect="dark" placement="bottom">
|
<el-tooltip effect="dark" placement="bottom">
|
||||||
<el-tag type="success" v-if="scope.row.isDataB === 1">符合</el-tag>
|
<template #content>
|
||||||
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
|
误差范围:{{ addPercentSigns(row.dataB.radius,row.dataB.unit) }}
|
||||||
<el-tag type="warning" v-if="scope.row.isDataB === 4">/</el-tag>
|
<br />
|
||||||
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
误差值:{{ row.dataB.errorData }}
|
||||||
|
</template>
|
||||||
|
<el-tag type="success" v-if="row.dataB.isData === 1">符合</el-tag>
|
||||||
|
<el-tag type="danger" v-if="row.dataB.isData === 2">不符合</el-tag>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="C相" >
|
<el-table-column label="C相" v-if="prop.tableData[0].dataT==null">
|
||||||
<el-table-column prop="stdC" :label="'被检值'"/>
|
<el-table-column prop="stdC" :label="'被检值'" >
|
||||||
<el-table-column prop="dataC" :label="'标准值'"/>
|
<template #default="{ row }">
|
||||||
|
{{ row.dataC.data }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dataC" :label="'标准值'">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataC.resultData }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="isDataC" label="检测结果">
|
<el-table-column prop="isDataC" label="检测结果">
|
||||||
<template #default="scope">
|
<template #default="{ row }">
|
||||||
<el-tooltip effect="dark" placement="bottom">
|
<el-tooltip effect="dark" placement="bottom">
|
||||||
<el-tag type="success" v-if="scope.row.isDataC === 1">符合</el-tag>
|
<template #content>
|
||||||
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
|
误差范围:{{ addPercentSigns(row.dataC.radius,row.dataC.unit) }}
|
||||||
<el-tag type="warning" v-if="scope.row.isDataC === 4">/</el-tag>
|
<br />
|
||||||
<el-tag type="info" v-if="scope.row.isDataA === 5">-</el-tag>
|
误差值:{{ row.dataC.errorData }}
|
||||||
|
</template>
|
||||||
|
<el-tag type="success" v-if="row.dataC.isData === 1">符合</el-tag>
|
||||||
|
<el-tag type="danger" v-if="row.dataC.isData === 2">不符合</el-tag>
|
||||||
|
</el-tooltip>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="T相" v-if="prop.tableData[0].dataT">
|
||||||
|
<el-table-column prop="stdT" :label="'被检值'" >
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataT.data }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dataT" :label="'标准值'">
|
||||||
|
<template #default="{ row }">
|
||||||
|
{{ row.dataT.resultData }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="isDataT" label="检测结果">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-tooltip effect="dark" placement="bottom">
|
||||||
|
<template #content>
|
||||||
|
误差范围:{{ addPercentSigns(row.dataT.radius,row.dataT.unit) }}
|
||||||
|
<br />
|
||||||
|
误差值:{{ row.dataT.errorData }}
|
||||||
|
</template>
|
||||||
|
<el-tag type="success" v-if="row.dataT.isData === 1">符合</el-tag>
|
||||||
|
<el-tag type="danger" v-if="row.dataT.isData === 2">不符合</el-tag>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="tsx" setup>
|
<script lang="tsx" setup>
|
||||||
|
import {} from 'vue'
|
||||||
|
import { CheckData } from '@/api/check/interface'
|
||||||
|
|
||||||
|
const prop = defineProps({
|
||||||
|
tableData: {
|
||||||
|
type: Array as () => CheckData.TableRow[],
|
||||||
|
default: []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加单位
|
||||||
|
const addPercentSigns = (text: string,unit: string) => {
|
||||||
|
return text
|
||||||
|
.split('~')
|
||||||
|
.map(part => `${part}${unit}`)
|
||||||
|
.join('~')
|
||||||
|
}
|
||||||
const mockTableData = [
|
const mockTableData = [
|
||||||
{
|
{
|
||||||
stdA: "220.00",
|
stdA: '220.00',
|
||||||
dataA: "219.85",
|
dataA: '219.85',
|
||||||
isDataA: 1,
|
isDataA: 1,
|
||||||
maxErrorA: "±0.5%",
|
maxErrorA: '±0.5%',
|
||||||
errorA: "0.068%",
|
errorA: '0.068%',
|
||||||
unitA: "%",
|
unitA: '%',
|
||||||
stdB: "220.00",
|
stdB: '220.00',
|
||||||
dataB: "220.12",
|
dataB: '220.12',
|
||||||
isDataB: 1,
|
isDataB: 1,
|
||||||
maxErrorB: "±0.5%",
|
maxErrorB: '±0.5%',
|
||||||
errorB: "0.055%",
|
errorB: '0.055%',
|
||||||
unitB: "%",
|
unitB: '%',
|
||||||
stdC: "220.00",
|
stdC: '220.00',
|
||||||
dataC: "219.95",
|
dataC: '219.95',
|
||||||
isDataC: 1,
|
isDataC: 1,
|
||||||
maxErrorC: "±0.5%",
|
maxErrorC: '±0.5%',
|
||||||
errorC: "0.023%",
|
errorC: '0.023%',
|
||||||
unitC: "%",
|
unitC: '%',
|
||||||
stdT: "0.15",
|
stdT: '0.15',
|
||||||
dataT: "0.12",
|
dataT: '0.12',
|
||||||
isDataT: 1,
|
isDataT: 1,
|
||||||
maxErrorT: "±0.2",
|
maxErrorT: '±0.2',
|
||||||
errorT: "0.03",
|
errorT: '0.03',
|
||||||
unitT: "",
|
unitT: '',
|
||||||
unit: "V"
|
unit: 'V'
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.form-grid {
|
.form-grid {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row; /* 横向排列 */
|
flex-direction: row; /* 横向排列 */
|
||||||
@@ -114,8 +185,8 @@ const mockTableData = [
|
|||||||
margin-bottom: 20px; /* 添加底部边距 */
|
margin-bottom: 20px; /* 添加底部边距 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table th, .el-table td {
|
.el-table th,
|
||||||
|
.el-table td {
|
||||||
text-align: center; /* 所有单元格文字居中 */
|
text-align: center; /* 所有单元格文字居中 */
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@@ -1,28 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :append-to-body="appendToBody" class="dialog" title="数据查询" :model-value='visible' @close="close"
|
<el-dialog
|
||||||
v-bind="dialogBig" :draggable="false" width="1400px">
|
:append-to-body="appendToBody"
|
||||||
|
class="dialog"
|
||||||
|
title="数据查询"
|
||||||
|
:model-value="visible"
|
||||||
|
@close="close"
|
||||||
|
v-bind="dialogBig"
|
||||||
|
:draggable="false"
|
||||||
|
width="1400px"
|
||||||
|
>
|
||||||
<div class="data-check-dialog">
|
<div class="data-check-dialog">
|
||||||
<div>
|
<div>
|
||||||
<el-form :model='formContent' label-width="auto" class="form-three ">
|
<el-form :model="formContent" label-width="auto" class="form-three">
|
||||||
<el-form-item label="误差体系">
|
<el-form-item label="误差体系">
|
||||||
<el-select :disabled="checkStore.showDetailType===2 || checkStore.showDetailType===0" v-model="formContent.errorSysId" placeholder="请选择误差体系" autocomplete="off"
|
<el-select
|
||||||
@change="handleErrorSysChange">
|
:disabled="checkStore.showDetailType === 2 || checkStore.showDetailType === 0"
|
||||||
|
v-model="formContent.errorSysId"
|
||||||
|
placeholder="请选择误差体系"
|
||||||
|
autocomplete="off"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(option) in pqErrorList"
|
v-for="option in pqErrorList"
|
||||||
:key="option.id"
|
:key="option.id"
|
||||||
:label="option.name"
|
:label="option.name"
|
||||||
:value="option.id"/>
|
:value="option.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="数据原则">
|
<el-form-item label="数据原则">
|
||||||
<el-input v-model='formContent.dataRule' :disabled="true"/>
|
<el-input v-model="formContent.dataRule" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="设备名称">
|
<el-form-item label="设备名称">
|
||||||
<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">
|
||||||
<el-option v-for="item in chnList" :key="item.value" :label="item.label" :value="item.value"/>
|
<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 v-if="checkStore.showDetailType === 1">
|
<el-form-item v-if="checkStore.showDetailType === 1">
|
||||||
@@ -36,22 +49,39 @@
|
|||||||
<div class="data-check-body">
|
<div class="data-check-body">
|
||||||
<div class="content-right">
|
<div class="content-right">
|
||||||
<div class="content-right-title">
|
<div class="content-right-title">
|
||||||
<div style="width: 840px;">
|
<div style="width: 840px">
|
||||||
<span class="content-right-title-text">当前检测项目:</span>
|
<span class="content-right-title-text">当前检测项目:</span>
|
||||||
<span style="color: var(--el-color-primary);">频率</span>
|
<span style="color: var(--el-color-primary)">{{ rowList.scriptName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-form-item style="margin-left: 280px;margin-bottom:0px !important;width: 280px;" label='测试项'>
|
<el-form-item
|
||||||
<el-cascader v-model="currentCheckItem" :options="options" clearable />
|
style="margin-left: 280px; margin-bottom: 0px !important; width: 280px"
|
||||||
|
label="测试项"
|
||||||
|
>
|
||||||
|
<el-select v-model="currentCheckItem">
|
||||||
|
<el-option
|
||||||
|
v-for="item in tesList"
|
||||||
|
:key="item"
|
||||||
|
:label="item.replace(/\.0$/, '')"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content-right-Tabs">
|
<div class="content-right-Tabs">
|
||||||
<el-tabs type="border-card" v-model="activeTab">
|
<el-tabs type="border-card" v-model="activeTab">
|
||||||
<el-tab-pane label="检测结果" name="resultTab">
|
<el-tab-pane label="检测结果" name="resultTab">
|
||||||
<CompareDataCheckResultTable :tableData="checkResultData" :currentScriptTypeName="currentScriptTypeName"/>
|
<CompareDataCheckResultTable
|
||||||
|
:tableData="currentCheckResultData"
|
||||||
|
:currentScriptTypeName="currentScriptTypeName"
|
||||||
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="原始数据" name="rawDataTab">
|
<el-tab-pane label="原始数据" name="rawDataTab">
|
||||||
<CompareDataCheckRawDataTable :tableData="rawTableData" :currentScriptTypeName="currentScriptTypeName" @exportRawDataHandler="exportRawDataHandler"/>
|
<CompareDataCheckRawDataTable
|
||||||
|
:tableData="rawTableData[currentCheckItem]"
|
||||||
|
:currentScriptTypeName="currentScriptTypeName"
|
||||||
|
@exportRawDataHandler="exportRawDataHandler"
|
||||||
|
/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,36 +89,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang='ts'>
|
<script setup lang="ts">
|
||||||
import { dialogBig } from '@/utils/elementBind'
|
import { dialogBig } from '@/utils/elementBind'
|
||||||
import {reactive, ref, watch} from 'vue'
|
import { reactive, ref, watch, computed } from 'vue'
|
||||||
import CompareDataCheckResultTable from './compareDataCheckResultTable.vue'
|
import CompareDataCheckResultTable from './compareDataCheckResultTable.vue'
|
||||||
import CompareDataCheckRawDataTable from './compareDataCheckRawDataTable.vue'
|
import CompareDataCheckRawDataTable from './compareDataCheckRawDataTable.vue'
|
||||||
import {CheckData} from "@/api/check/interface";
|
import { CheckData } from '@/api/check/interface'
|
||||||
import {useCheckStore} from "@/stores/modules/check";
|
import { useCheckStore } from '@/stores/modules/check'
|
||||||
import {Histogram, Postcard} from "@element-plus/icons-vue";
|
import { Histogram, Postcard } from '@element-plus/icons-vue'
|
||||||
import { getPqErrSysList } from '@/api/plan/plan'
|
import { getPqErrSysList } from '@/api/plan/plan'
|
||||||
import { getFormData} from "@/api/check/test";
|
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||||
|
import { useDictStore } from '@/stores/modules/dict'
|
||||||
|
import { getContrastFormContent, getContrastResult, getBigTestItem } from '@/api/check/test'
|
||||||
|
|
||||||
const {appendToBody} = withDefaults(defineProps<{
|
const { appendToBody } = withDefaults(
|
||||||
|
defineProps<{
|
||||||
appendToBody: boolean
|
appendToBody: boolean
|
||||||
}>(), {appendToBody: true})
|
}>(),
|
||||||
|
{ appendToBody: true }
|
||||||
|
)
|
||||||
|
|
||||||
const checkStore = useCheckStore()
|
const checkStore = useCheckStore()
|
||||||
|
const modeStore = useModeStore()
|
||||||
|
const dictStore = useDictStore()
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const treeRef = ref()
|
const treeRef = ref()
|
||||||
const searchValue = ref<string>('')
|
const searchValue = ref<string>('')
|
||||||
const pqErrorList = reactive<{ id: string; name: string; }[]>([])
|
const pqErrorList = reactive<{ id: string; name: string }[]>([])
|
||||||
const activeTab = ref('resultTab')
|
const activeTab = ref('resultTab')
|
||||||
const currentCheckItem = ref<any>()
|
const currentCheckItem = ref<any>()
|
||||||
let deviceId: string = ''
|
const rowList: any = ref([])
|
||||||
let scriptType: string | null = null
|
let scriptType: string | null = null
|
||||||
|
|
||||||
watch(searchValue, (val) => {
|
watch(searchValue, val => {
|
||||||
treeRef.value!.filter(val)
|
treeRef.value!.filter(val)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -99,70 +133,100 @@ const formContent = reactive<CheckData.DataCheck>({
|
|||||||
dataRule: '',
|
dataRule: '',
|
||||||
deviceName: '',
|
deviceName: '',
|
||||||
chnNum: '',
|
chnNum: '',
|
||||||
|
deviceId: '',
|
||||||
|
num: null
|
||||||
})
|
})
|
||||||
|
|
||||||
// 通道下拉列表
|
// 通道下拉列表
|
||||||
let chnList: any[] = []
|
const chnList: any = ref([])
|
||||||
|
|
||||||
|
|
||||||
// 当前检测项目名称
|
// 当前检测项目名称
|
||||||
const currentScriptTypeName = ref('')
|
const currentScriptTypeName = ref('')
|
||||||
// 检测结果表格数据
|
// 检测结果表格数据
|
||||||
const checkResultData = reactive<CheckData.CheckResult[]>([])
|
const checkResultData = ref<CheckData.CheckResult[]>([])
|
||||||
|
|
||||||
// 原始数据表格数据
|
// 原始数据表格数据
|
||||||
const rawTableData = reactive<CheckData.RawDataItem[]>([])
|
const rawTableData = ref<CheckData.RawDataItem[]>([])
|
||||||
|
const tesList: any = ref([])
|
||||||
|
// 检测结果
|
||||||
|
const currentCheckResultData = computed(() => {
|
||||||
|
const data = checkResultData.value[currentCheckItem.value]
|
||||||
|
return Array.isArray(data) ? data : []
|
||||||
|
})
|
||||||
|
const open = async (row: any, chnNum: string, deviceId: string | null, source: number) => {
|
||||||
|
if (source == 1) {
|
||||||
|
// 正式检测进入页面
|
||||||
|
rowList.value = row
|
||||||
|
formContent.chnNum = chnNum
|
||||||
|
formContent.deviceId = deviceId || ''
|
||||||
|
}
|
||||||
|
visible.value = true
|
||||||
|
|
||||||
|
|
||||||
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
|
|
||||||
visible.value = true;
|
|
||||||
deviceId = _deviceId
|
|
||||||
scriptType = null
|
scriptType = null
|
||||||
// 设置默认选中第一个选项
|
|
||||||
if (options.length > 0) {
|
|
||||||
const firstOption = options[0];
|
|
||||||
currentCheckItem.value = [firstOption.value];
|
|
||||||
|
|
||||||
// 如果第一个选项有子选项,默认也选中第一个子选项
|
|
||||||
if (firstOption.children && firstOption.children.length > 0) {
|
|
||||||
currentCheckItem.value.push(firstOption.children[0].value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
formContent.errorSysId = checkStore.plan.errorSysId
|
formContent.errorSysId = checkStore.plan.errorSysId
|
||||||
|
|
||||||
pqErrorList.length = 0
|
pqErrorList.length = 0
|
||||||
|
// 获取误差体系
|
||||||
let { data: resPqErrorList } = await getPqErrSysList()
|
let { data: resPqErrorList } = await getPqErrSysList()
|
||||||
Object.assign(pqErrorList, resPqErrorList)
|
Object.assign(pqErrorList, resPqErrorList)
|
||||||
|
// 获取基本信息
|
||||||
|
await getBasicInformation()
|
||||||
|
await getTestItem()
|
||||||
|
await getResults()
|
||||||
|
}
|
||||||
|
//获取基本信息
|
||||||
|
const getBasicInformation = async () => {
|
||||||
|
getContrastFormContent({
|
||||||
|
planId: checkStore.plan.id,
|
||||||
|
scriptType: rowList.value.scriptType,
|
||||||
|
deviceId: formContent.deviceId,
|
||||||
|
chnNum: formContent.chnNum,
|
||||||
|
num: formContent.num ?? null
|
||||||
|
}).then((res: any) => {
|
||||||
|
formContent.dataRule = res.data.dataRule
|
||||||
|
formContent.deviceName = res.data.deviceName
|
||||||
|
formContent.errorSysId = res.data.errorSysId
|
||||||
|
let chnMap: string[] = []
|
||||||
|
for (let key in res.data.chnMap) {
|
||||||
|
chnMap.push(key)
|
||||||
|
}
|
||||||
|
chnList.value = chnMap
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取测试项
|
||||||
|
const getTestItem = async () => {
|
||||||
|
getBigTestItem({
|
||||||
|
reCheckType: 1,
|
||||||
|
planId: checkStore.plan.id,
|
||||||
|
devIds: [formContent.deviceId],
|
||||||
|
patternId: dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
|
||||||
|
}).then((res: any) => {})
|
||||||
|
}
|
||||||
|
// 获取结果
|
||||||
|
const getResults = async () => {
|
||||||
|
getContrastResult({
|
||||||
|
planId: checkStore.plan.id,
|
||||||
|
scriptType: rowList.value.scriptType,
|
||||||
|
deviceId: formContent.deviceId,
|
||||||
|
chnNum: formContent.chnNum,
|
||||||
|
num: formContent.num ?? null
|
||||||
|
}).then((res: any) => {
|
||||||
|
let list: string[] = []
|
||||||
|
for (let key in res.data.resultMap) {
|
||||||
|
list.push(key)
|
||||||
|
}
|
||||||
|
currentCheckItem.value = list[0]
|
||||||
|
tesList.value = list
|
||||||
|
checkResultData.value = res.data.resultMap
|
||||||
|
rawTableData.value = res.data.rawDataMap
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
visible.value = false;
|
visible.value = false
|
||||||
// 可以在这里添加其他清理逻辑
|
// 可以在这里添加其他清理逻辑
|
||||||
}
|
}
|
||||||
|
|
||||||
const options = [
|
|
||||||
{
|
|
||||||
value: 'guide',
|
|
||||||
label: '谐波电压',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
value: 'disciplines',
|
|
||||||
label: '2次',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: 'disciplines',
|
|
||||||
label: '3次',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
})
|
})
|
||||||
@@ -175,7 +239,6 @@ defineExpose({
|
|||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
|
|
||||||
.data-check-dialog {
|
.data-check-dialog {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="(chnItem, index2) in checkStore.chnNumList"
|
v-for="(chnItem, index2) in checkStore.chnNumList"
|
||||||
:key="`${item.deviceId}${chnItem}`"
|
:key="`${item.deviceId}${chnItem}`"
|
||||||
:label="'通道' + chnItem.label"
|
:label="'通道' + chnItem"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
"
|
"
|
||||||
:color="row.devices[index1].chnResult[index2].color"
|
:color="row.devices[index1].chnResult[index2].color"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleClick(item, chnItem, row.scriptType)"
|
@click="handleClick(row, chnItem, row.scriptType)"
|
||||||
style="align-self: center"
|
style="align-self: center"
|
||||||
>
|
>
|
||||||
<el-icon
|
<el-icon
|
||||||
@@ -329,6 +329,8 @@ watch(
|
|||||||
// 失败
|
// 失败
|
||||||
if (newValue.data != undefined) return
|
if (newValue.data != undefined) return
|
||||||
setLogList('error', str + '失败!')
|
setLogList('error', str + '失败!')
|
||||||
|
emit('update:testStatus', 'error')
|
||||||
|
stopTimeCount()
|
||||||
if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!')
|
if (newValue.requestId == 'YJC_xujy') setLogList('info', '初始化失败!')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -361,17 +363,16 @@ watch(
|
|||||||
Object.assign(checkResult, result)
|
Object.assign(checkResult, result)
|
||||||
setLogList('info', '检测完成!')
|
setLogList('info', '检测完成!')
|
||||||
stopTimeCount()
|
stopTimeCount()
|
||||||
|
updatePercentage()
|
||||||
break
|
break
|
||||||
case 25003:
|
case 25003:
|
||||||
setLogList('error', '检测失败!')
|
setLogList('error', '检测失败!')
|
||||||
|
|
||||||
stopTimeCount()
|
stopTimeCount()
|
||||||
|
updatePercentage()
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
if (newValue.code != 10201) {
|
if (newValue.code != 10201) {
|
||||||
setLogList(newValue.code == 10200 ? 'info' : 'error', newValue.data)
|
setLogList(newValue.code == 10200 ? 'info' : 'error', newValue.data)
|
||||||
|
|
||||||
updatePercentage()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
@@ -382,6 +383,7 @@ watch(
|
|||||||
switch (newValue.operateCode) {
|
switch (newValue.operateCode) {
|
||||||
case 'Contrast_Dev':
|
case 'Contrast_Dev':
|
||||||
setLogList('error', '设备服务端连接失败!')
|
setLogList('error', '设备服务端连接失败!')
|
||||||
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@@ -393,6 +395,7 @@ watch(
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
setLogList('error', '当前流程存在异常结束!')
|
setLogList('error', '当前流程存在异常结束!')
|
||||||
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
case 'socket_timeout':
|
case 'socket_timeout':
|
||||||
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
ElMessageBox.alert(`设备连接异常,请检查设备连接情况!`, '检测失败', {
|
||||||
@@ -400,6 +403,7 @@ watch(
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
setLogList('error', '设备连接异常,请检查设备连接情况!')
|
setLogList('error', '设备连接异常,请检查设备连接情况!')
|
||||||
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
case 'server_error':
|
case 'server_error':
|
||||||
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
|
ElMessageBox.alert('服务端主动关闭连接!', '初始化失败', {
|
||||||
@@ -407,6 +411,7 @@ watch(
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
setLogList('error', '服务端主动关闭连接!')
|
setLogList('error', '服务端主动关闭连接!')
|
||||||
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
case 'device_error':
|
case 'device_error':
|
||||||
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
|
ElMessageBox.alert('设备主动关闭连接!', '初始化失败', {
|
||||||
@@ -414,6 +419,7 @@ watch(
|
|||||||
type: 'error'
|
type: 'error'
|
||||||
})
|
})
|
||||||
setLogList('error', '设备主动关闭连接!')
|
setLogList('error', '设备主动关闭连接!')
|
||||||
|
stopTimeCount()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -501,6 +507,7 @@ const showTestLog = () => {
|
|||||||
|
|
||||||
// 初始化检测脚本数据
|
// 初始化检测脚本数据
|
||||||
const initScriptData = async () => {
|
const initScriptData = async () => {
|
||||||
|
scriptData = []
|
||||||
const pattern = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
|
const pattern = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''
|
||||||
let response: any = await getBigTestItem({
|
let response: any = await getBigTestItem({
|
||||||
reCheckType: checkStore.reCheckType,
|
reCheckType: checkStore.reCheckType,
|
||||||
@@ -675,41 +682,41 @@ const getResult = (devices: CheckData.DeviceCheckResult[] = []) => {
|
|||||||
|
|
||||||
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
// 点击查看(设备)通道检测详情。参数1:设备信息,参数2:通道号,-1:代表查看全部通道
|
||||||
const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
||||||
// let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
let checkResultItem = checkResult.find(obj => obj.scriptType === scriptType)
|
||||||
// let flag = -1
|
let flag = -1
|
||||||
// if (checkResultItem) {
|
if (checkResultItem) {
|
||||||
// let device = checkResultItem.devices.find(obj => obj.deviceId === item.deviceId)
|
let device = checkResultItem.devices.find(obj => obj.deviceId === item.deviceId)
|
||||||
// if (device) {
|
if (device) {
|
||||||
// let chnResult = device.chnResult
|
let chnResult = device.chnResult
|
||||||
// if (chnNum === -1) {
|
if (chnNum === -1) {
|
||||||
// if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.TIMEOUT) !== -1) {
|
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.TIMEOUT) !== -1) {
|
||||||
// flag = 0
|
flag = 0
|
||||||
// }
|
}
|
||||||
// if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
|
if (chnResult.findIndex(obj => obj === CheckData.ChnCheckResultEnum.ERRORDATA) !== -1) {
|
||||||
// flag = 1
|
flag = 1
|
||||||
// }
|
}
|
||||||
// } else {
|
} else {
|
||||||
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
|
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.TIMEOUT) {
|
||||||
// flag = 0
|
flag = 0
|
||||||
// }
|
}
|
||||||
// if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
|
if (chnResult[chnNum - 1] === CheckData.ChnCheckResultEnum.ERRORDATA) {
|
||||||
// flag = 1
|
flag = 1
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (flag === 0) {
|
if (flag === 0) {
|
||||||
// ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
|
ElMessageBox.alert('连接超时,请检查设备通讯是否正常', '连接超时', {
|
||||||
// confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
// type: 'warning',
|
type: 'warning',
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// if (flag === -1 || flag === 1) {
|
if (flag === -1 || flag === 1) {
|
||||||
// checkStore.setShowDetailType(2)
|
checkStore.setShowDetailType(2)
|
||||||
console.log('handleTest', item.deviceId, chnNum, scriptType)
|
|
||||||
dataCheckSingleChannelSingleTestPopupRef.value?.open(item.deviceId, chnNum + '', scriptType)
|
dataCheckSingleChannelSingleTestPopupRef.value?.open(item, chnNum+'', item.devices[0].deviceId,1)
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePause = () => {
|
const handlePause = () => {
|
||||||
@@ -723,9 +730,9 @@ const initializeParameters = async () => {
|
|||||||
await initScriptData()
|
await initScriptData()
|
||||||
initDeviceList()
|
initDeviceList()
|
||||||
initCheckResult()
|
initCheckResult()
|
||||||
|
|
||||||
percentage.value = 0
|
percentage.value = 0
|
||||||
|
timeCount.value = 0
|
||||||
|
timeView.value = '00:00:00'
|
||||||
testLogList.splice(0, testLogList.length, {
|
testLogList.splice(0, testLogList.length, {
|
||||||
type: 'info',
|
type: 'info',
|
||||||
log: checkStore.selectTestItems.preTest ? '正在检测,请稍等...' : '暂无数据,等待检测开始'
|
log: checkStore.selectTestItems.preTest ? '正在检测,请稍等...' : '暂无数据,等待检测开始'
|
||||||
@@ -754,9 +761,10 @@ const handleResumeTest = () => {
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(123123)
|
if (!checkStore.selectTestItems.preTest) {
|
||||||
|
// 判断是否预检测
|
||||||
initializeParameters()
|
initializeParameters()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
@@ -63,12 +63,12 @@
|
|||||||
>
|
>
|
||||||
开始检测
|
开始检测
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" v-if="TestStatus === 'test_init'" disabled>
|
<!-- <el-button type="primary" v-if="TestStatus === 'test_init'" disabled>
|
||||||
<el-icon class="loading-box" style="color: #fff; margin-right: 8px">
|
<el-icon class="loading-box" style="color: #fff; margin-right: 8px">
|
||||||
<component :is="Refresh" />
|
<component :is="Refresh" />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
初始化中
|
初始化中
|
||||||
</el-button>
|
</el-button> -->
|
||||||
<el-button type="primary" v-if="TestStatus == 'process'" :icon="VideoPause" @click="handlePause()">
|
<el-button type="primary" v-if="TestStatus == 'process'" :icon="VideoPause" @click="handlePause()">
|
||||||
停止检测
|
停止检测
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -81,7 +81,6 @@
|
|||||||
<el-button type="warning" v-if="TestStatus == 'paused'" :icon="VideoPlay" @click="sendResume">
|
<el-button type="warning" v-if="TestStatus == 'paused'" :icon="VideoPlay" @click="sendResume">
|
||||||
继续检测
|
继续检测
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
:icon="VideoPlay"
|
:icon="VideoPlay"
|
||||||
@@ -259,9 +258,17 @@ const open = async (
|
|||||||
|
|
||||||
//预检测-重新检测
|
//预检测-重新检测
|
||||||
const handleSubmitAgain = async () => {
|
const handleSubmitAgain = async () => {
|
||||||
|
console.log("🚀 ~ handleSubmitAgain ~ stepsActive.value:", stepsActiveIndex.value,stepsActiveView.value , stepsActive.value)
|
||||||
|
if(checkStore.selectTestItems.preTest){
|
||||||
stepsActiveIndex.value = 1
|
stepsActiveIndex.value = 1
|
||||||
stepsActiveView.value = 1
|
stepsActiveView.value = 1
|
||||||
stepsActive.value = 1
|
stepsActive.value = 1
|
||||||
|
}else{
|
||||||
|
stepsActiveIndex.value = 1
|
||||||
|
stepsActiveView.value = 2
|
||||||
|
stepsActive.value = 2
|
||||||
|
}
|
||||||
|
|
||||||
let count = 0
|
let count = 0
|
||||||
for (let key in checkStore.selectTestItems) {
|
for (let key in checkStore.selectTestItems) {
|
||||||
if (checkStore.selectTestItems[key]) {
|
if (checkStore.selectTestItems[key]) {
|
||||||
@@ -319,6 +326,8 @@ const handleSubmitFast = async () => {
|
|||||||
})
|
})
|
||||||
preTestStatus.value = 'start'
|
preTestStatus.value = 'start'
|
||||||
if (checkStore.selectTestItems.test) {
|
if (checkStore.selectTestItems.test) {
|
||||||
|
console.log(111111);
|
||||||
|
|
||||||
testRef.value.initializeParameters()
|
testRef.value.initializeParameters()
|
||||||
testRef.value.showTestLog()
|
testRef.value.showTestLog()
|
||||||
}
|
}
|
||||||
@@ -369,7 +378,6 @@ watch(TestStatus, function (newValue, oldValue) {
|
|||||||
watch(stepsActiveIndex, function (newValue, oldValue) {
|
watch(stepsActiveIndex, function (newValue, oldValue) {
|
||||||
if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2) {
|
if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log(1);
|
|
||||||
|
|
||||||
testRef.value.initializeParameters()
|
testRef.value.initializeParameters()
|
||||||
testRef.value.showTestLog()
|
testRef.value.showTestLog()
|
||||||
|
|||||||
@@ -214,15 +214,12 @@ const handleNext = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// const sourceKey = edge.source.replace('被检通道-', '').replace('-', '_');
|
// const sourceKey = edge.source.replace('被检通道-', '').replace('-', '_');
|
||||||
let chnNumList: object[] = []
|
let chnNumList: string[] = []
|
||||||
await edges.value.forEach(edge => {
|
await edges.value.forEach(edge => {
|
||||||
const match = edge.source.split('-')
|
const match = edge.source.split('-')
|
||||||
|
|
||||||
if (match) {
|
if (match) {
|
||||||
chnNumList.push({
|
chnNumList.push(match[2])
|
||||||
deviceId: match[1],
|
|
||||||
label: match[2]
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user