Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -51,8 +51,11 @@ export namespace CheckData {
|
||||
// 用来描述 通道检测结果
|
||||
export enum ChnCheckResultEnum {
|
||||
UNKNOWN = -1,
|
||||
FAIL = 0,
|
||||
LOADING = 0,
|
||||
SUCCESS = 1,
|
||||
FAIL = 2,
|
||||
UNCONNECTED = 3,
|
||||
ERRORDATA = 4
|
||||
}
|
||||
|
||||
//用来描述 某个脚本测试项对所有通道的检测结果
|
||||
@@ -68,12 +71,20 @@ export namespace CheckData {
|
||||
}>
|
||||
}
|
||||
|
||||
export enum ButtonColorEnum {
|
||||
INFO = '#909399',
|
||||
LOADING = '#607eab',
|
||||
SUCCESS = '#67c23a',
|
||||
WARNING ='#e6a23c',
|
||||
DANGER = '#f56c6c',
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于描述 (设备)通道检测结果展示的按钮类型
|
||||
*/
|
||||
export interface ButtonResult {
|
||||
resultType: 'info' | 'success' | 'danger',
|
||||
resultValue: '-' | '√' | '×'
|
||||
color: ButtonColorEnum
|
||||
icon: 'Minus' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +107,7 @@ export namespace CheckData {
|
||||
* 定义检测日志类型
|
||||
*/
|
||||
export interface LogItem {
|
||||
type: 'info' | 'error'
|
||||
type: 'info' | 'warning' | 'error'
|
||||
log: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import http from "@/api";
|
||||
|
||||
export const getCheckItemDetail = (params: { deviceId: string, chnNum: number, checkItemId?: string }) => {
|
||||
return http.post<any>("/check/test/detail/", params, {loading: false});
|
||||
export const getFormData = (params: { deviceId: string, chnNum: number}) => {
|
||||
return http.post<any>("/check/detail/", params, {loading: false});
|
||||
}
|
||||
|
||||
export const getTreeData = (params: { deviceId: string, chnNum: number, checkItemId: string }) => {
|
||||
return http.post<any>("/check/treeData/", params, {loading: false});
|
||||
}
|
||||
|
||||
export const getCheckData = (params: { deviceId: string, chnNum: number, checkItemId: string }) => {
|
||||
return http.post<any>("/check/data/", params, {loading: false});
|
||||
}
|
||||
@@ -17,8 +17,8 @@
|
||||
<el-input v-model='formContent.deviceName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='通道号'>
|
||||
<el-select v-model="formContent.monitorIdx" @change="handleChnNumChange">
|
||||
<el-option v-for="item in chnList" :key="item.value" :label="item.value"
|
||||
<el-select v-model="formContent.monitorIdx" @change="handleChnChange">
|
||||
<el-option v-for="item in chnList" :key="item.value" :label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -34,8 +34,10 @@
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="content-tree">
|
||||
<el-tree :default-expanded-keys="defaultExpandedKeys" node-key="id" :data="treeData"
|
||||
:props="defaultProps" @node-click="handleNodeClick"/>
|
||||
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="id"
|
||||
:data="treeDataUnQualified" :props="defaultProps" @node-click="handleNodeClick"/>
|
||||
<el-tree v-if="switchItem === 1" :default-expanded-keys="defaultExpandedKeys" node-key="id"
|
||||
:data="treeDataAll" :props="defaultProps" @node-click="handleNodeClick"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -66,6 +68,8 @@ import {reactive, ref} from 'vue'
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
import {CheckData} from "@/api/check/interface";
|
||||
import {getFormData, getTreeData, getCheckData} from "@/api/check/test";
|
||||
import {useDictStore} from "@/stores/modules/dict";
|
||||
|
||||
const {appendToBody} = withDefaults(defineProps<{
|
||||
appendToBody: boolean
|
||||
@@ -76,6 +80,10 @@ const defaultProps = {
|
||||
children: "children",
|
||||
};
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
// 表单数据
|
||||
const formContent = reactive<CheckData.DataCheck>({
|
||||
scriptName: '',
|
||||
@@ -84,13 +92,14 @@ const formContent = reactive<CheckData.DataCheck>({
|
||||
deviceName: '',
|
||||
monitorIdx: '',
|
||||
})
|
||||
let deviceId: string = ''
|
||||
let scriptType: string = ''
|
||||
|
||||
// 通道下拉列表
|
||||
let chnList: number[] = []
|
||||
let chnList: any[] = []
|
||||
|
||||
// 不符合测试项、全部测试项切换
|
||||
const switchItem = ref<number>(-1)
|
||||
// 左侧树数据(仅用于展示)
|
||||
const treeData=reactive<CheckData.ScriptItem[]>([])
|
||||
// 左侧树数据-不符合测试项
|
||||
let treeDataUnQualified: CheckData.ScriptItem[] = []
|
||||
// 左侧树数据-全部测试项
|
||||
@@ -99,314 +108,241 @@ let treeDataAll: CheckData.ScriptItem[] = []
|
||||
const checkedScriptId = ref<string>('')
|
||||
|
||||
|
||||
const currentScriptDsc = ref('电压准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const currentScriptDsc = ref('');
|
||||
// 右侧Tab选中项
|
||||
const activeTab = ref<string>('resultTab')
|
||||
// 检测结果表格数据
|
||||
const checkResultTableData = reactive<CheckData.CheckResult[]>([
|
||||
{
|
||||
chnNum: '1',
|
||||
standardValue: 57.74,
|
||||
L1: 57.73,
|
||||
L1_errValue: 0.01,
|
||||
L2: 57.73,
|
||||
L2_errValue: 0.01,
|
||||
L3: 57.73,
|
||||
L3_errValue: 0.01,
|
||||
maxErrVaule: 0.05774,
|
||||
result: '合格',
|
||||
}
|
||||
])
|
||||
const checkResultTableData = reactive<CheckData.CheckResult[]>([])
|
||||
// 原始数据表格数据
|
||||
const rawTableData = reactive<CheckData.RawDataItem[]>([
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:00",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:03",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:06",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:09",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:12",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:15",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:18",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:21",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:24",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:27",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:30",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:33",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:36",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:39",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:42",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:45",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:48",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:51",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:54",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:57",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
}
|
||||
])
|
||||
const rawTableData = reactive<CheckData.RawDataItem[]>([])
|
||||
|
||||
const resultTableRef = ref()
|
||||
const rawDataTableRef = ref()
|
||||
|
||||
// 左侧树默认展开节点id
|
||||
const defaultExpandedKeys = computed(() => {
|
||||
return [getDefaultId(treeData)]
|
||||
})
|
||||
let defaultExpandedKeys: string[] = []
|
||||
|
||||
// 监控通道号下拉框
|
||||
const handleChnChange = (data: any) => {
|
||||
|
||||
console.log("通道号下拉框", data);
|
||||
|
||||
// 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
|
||||
// const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
|
||||
// treeDataUnQualified=[]
|
||||
// treeDataAll=[]
|
||||
|
||||
|
||||
// 改变通道号下拉框触发事件
|
||||
const handleChnNumChange = (data: any) => {
|
||||
formContent.monitorIdx = data.value
|
||||
}
|
||||
watch(() => formContent.monitorIdx, (newVal, oldVal) => {
|
||||
if (newVal) {
|
||||
console.log("通道号下拉框", newVal, oldVal);
|
||||
|
||||
// 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
|
||||
// treeDataUnQualified=[]
|
||||
// treeDataAll=[]
|
||||
|
||||
}
|
||||
})
|
||||
// watch(() => formContent.monitorIdx, (newVal, oldVal) => {
|
||||
// if (newVal) {
|
||||
// console.log("通道号下拉框", newVal, oldVal);
|
||||
//
|
||||
// // 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
|
||||
// // const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
|
||||
// // treeDataUnQualified=[]
|
||||
// // treeDataAll=[]
|
||||
//
|
||||
// }
|
||||
// })
|
||||
|
||||
// 点击左侧树节点触发事件
|
||||
const handleNodeClick = (data: any) => {
|
||||
if (!data.children) {
|
||||
checkedScriptId.value = data.id
|
||||
currentScriptDsc.value = data.scriptName
|
||||
}
|
||||
};
|
||||
|
||||
watch(checkedScriptId, (newVal, oldVal) => {
|
||||
if (newVal) {
|
||||
console.log("左侧树被选中的叶子节点id", newVal, oldVal);
|
||||
// checkResultTableData
|
||||
console.log("左侧树被选中的叶子节点id", newVal);
|
||||
// 发起请求,查询该测试项的检测结果
|
||||
// const result = await getCheckData({deviceId, formContent.monitorIdx, scriptType})
|
||||
Object.assign(checkResultTableData, [{
|
||||
chnNum: '1',
|
||||
standardValue: 57.74,
|
||||
L1: 57.73,
|
||||
L1_errValue: 0.01,
|
||||
L2: 57.73,
|
||||
L2_errValue: 0.01,
|
||||
L3: 57.73,
|
||||
L3_errValue: 0.01,
|
||||
maxErrVaule: 0.05774,
|
||||
result: '合格',
|
||||
}])
|
||||
Object.assign(rawTableData, [
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:00",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:03",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:06",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:09",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:12",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:15",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:18",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:21",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:24",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:27",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:30",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:33",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:36",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:39",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:42",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:45",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:48",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:51",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:54",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
},
|
||||
{
|
||||
updateTime: "2024-10-10 09:30:57",
|
||||
L1: 57.73,
|
||||
L2: 57.73,
|
||||
L3: 57.73,
|
||||
}
|
||||
])
|
||||
}
|
||||
})
|
||||
|
||||
// 切换不合格测试项、全部测试项 触发事件
|
||||
// const handleSwitch = (data: any) => {
|
||||
// if (data === 0) {
|
||||
// //Object.assign(treeData, treeDataUnQualified)
|
||||
// } else {
|
||||
// //Object.assign(treeData, treeDataAll)
|
||||
// }
|
||||
// }
|
||||
watch(switchItem, (newVal, oldVal) => {
|
||||
if (switchItem.value === 0) {
|
||||
Object.assign(treeData, treeDataUnQualified)
|
||||
let node = null
|
||||
if (newVal === 0) {
|
||||
node = getDefaultNode(treeDataUnQualified)
|
||||
}
|
||||
if (switchItem.value === 1) {
|
||||
Object.assign(treeData, treeDataAll)
|
||||
if (newVal === 1) {
|
||||
node = getDefaultNode(treeDataAll)
|
||||
}
|
||||
},{immediate:true})
|
||||
|
||||
currentScriptDsc.value = node?.scriptName
|
||||
checkedScriptId.value = node?.id
|
||||
defaultExpandedKeys = [node?.id]
|
||||
})
|
||||
|
||||
const visible = ref(false)
|
||||
|
||||
const close = () => {
|
||||
//数据清空
|
||||
Object.assign(formContent, {
|
||||
scriptName: '',
|
||||
errorSysName: '',
|
||||
dataRule: '',
|
||||
deviceName: '',
|
||||
monitorIdx: '',
|
||||
})
|
||||
checkedScriptId.value = ''
|
||||
activeTab.value = 'rawDataTab'
|
||||
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const open = async (deviceId: string, chnNum: number, checkItemId?: string) => {
|
||||
const open = async (_deviceId: string, chnNum: number, _scriptType?: string) => {
|
||||
console.log(_deviceId, chnNum, _scriptType);
|
||||
deviceId = _deviceId
|
||||
scriptType = _scriptType ?? ''
|
||||
switchItem.value = 0
|
||||
// 发起后端请求,查询详细信息
|
||||
// 当checkItemId为空时,默认显示全部测试项、全部不合格测试项
|
||||
// 当checkItemId不为空时,默认显示当前checkItemId的测试项、属于当前checkItemId的不合格测试项
|
||||
checkItemId = checkItemId ?? ''
|
||||
console.log(deviceId, chnNum, checkItemId);
|
||||
//const result = await getCheckItemDetail({deviceId, chnNum, checkItemId})
|
||||
|
||||
// 发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号
|
||||
//const result1 = await getFormData({deviceId, chnNum})
|
||||
|
||||
// 数据处理
|
||||
chnList = [
|
||||
{value: '1',},
|
||||
{
|
||||
value: '2 (不合格)',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
},
|
||||
{
|
||||
value: '4 (不合格)',
|
||||
},]
|
||||
Object.assign(formContent, {
|
||||
let resFormContent = {
|
||||
scriptName: 'Q/GDW 10650.4-2021 模拟式',
|
||||
errorSysName: 'Q/GDW 10650.2-2021',
|
||||
dataRule: '所有值',
|
||||
dataRule: '505f063f9f91ab108d895a9fe96b5dce',
|
||||
deviceName: '被检设备1',
|
||||
monitorIdx: chnList[0].value,
|
||||
})
|
||||
chnList:[
|
||||
{value: '1', label: '1'},
|
||||
{value: '2', label: '0'},
|
||||
{value: '3', label: '1'},
|
||||
{value: '4', label: '0'}],
|
||||
}
|
||||
chnList = resFormContent.chnList.map(item => ({
|
||||
value: item.value,
|
||||
label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)`
|
||||
}))
|
||||
|
||||
treeDataAll=[{
|
||||
"id": "1",
|
||||
"pid": "0",
|
||||
"scriptName": "频率准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-1",
|
||||
"pid": "1",
|
||||
"scriptName": "额定工作条件下的检测",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-1-1",
|
||||
"pid": "1-1",
|
||||
"scriptName": "输入:频率 42.5Hz..."
|
||||
},
|
||||
{
|
||||
"id": "1-1-2",
|
||||
"pid": "1-1",
|
||||
"scriptName": "输入:频率 50.0Hz..."
|
||||
},
|
||||
{
|
||||
"id": "1-1-3",
|
||||
"pid": "1-1",
|
||||
"scriptName": "输入:频率 50.05Hz...."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1-2",
|
||||
"pid": "1",
|
||||
"scriptName": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "1-2-2",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1-3",
|
||||
"pid": "1",
|
||||
"scriptName": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-3-1",
|
||||
"pid": "1-3",
|
||||
"scriptName": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}]
|
||||
treeDataUnQualified=[{
|
||||
let dataRuleName = dictStore.getDictData('Data_Rule').find(item=>item.id==resFormContent.dataRule)?.name
|
||||
|
||||
Object.assign(formContent, {...resFormContent,dataRule:dataRuleName,monitorIdx: chnList[0].value})
|
||||
|
||||
|
||||
// const result2 = await getTreeData({deviceId, formContent.monitorIdx, checkItemId})
|
||||
treeDataAll = [{
|
||||
"id": "1",
|
||||
"pid": "0",
|
||||
"scriptName": "频率准确度检测",
|
||||
@@ -433,6 +369,47 @@ const open = async (deviceId: string, chnNum: number, checkItemId?: string) => {
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1-2",
|
||||
"pid": "1",
|
||||
"scriptName": "电压对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "1-2-1",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
},
|
||||
{
|
||||
"id": "1-2-2",
|
||||
"pid": "1-2",
|
||||
"scriptName": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "1-3",
|
||||
"pid": "1",
|
||||
"scriptName": "谐波对频率测量的影响",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-3-1",
|
||||
"pid": "1-3",
|
||||
"scriptName": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}]
|
||||
treeDataUnQualified = [{
|
||||
"id": "1",
|
||||
"pid": "0",
|
||||
"scriptName": "频率准确度检测",
|
||||
"children": [
|
||||
{
|
||||
"id": "1-2",
|
||||
"pid": "1",
|
||||
@@ -458,211 +435,36 @@ const open = async (deviceId: string, chnNum: number, checkItemId?: string) => {
|
||||
]
|
||||
}]
|
||||
|
||||
// Object.assign(treeData, [
|
||||
// {
|
||||
// "id": "1",
|
||||
// "pid": "0",
|
||||
// "scriptName": "频率准确度检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "1-1",
|
||||
// "pid": "1",
|
||||
// "scriptName": "额定工作条件下的检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "1-1-1",
|
||||
// "pid": "1-1",
|
||||
// "scriptName": "输入:频率 42.5Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "1-1-2",
|
||||
// "pid": "1-1",
|
||||
// "scriptName": "输入:频率 50.0Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "1-1-3",
|
||||
// "pid": "1-1",
|
||||
// "scriptName": "输入:频率 50.05Hz...."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "1-2",
|
||||
// "pid": "1",
|
||||
// "scriptName": "电压对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "1-2-1",
|
||||
// "pid": "1-2",
|
||||
// "scriptName": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "1-2-1",
|
||||
// "pid": "1-2",
|
||||
// "scriptName": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "1-2-2",
|
||||
// "pid": "1-2",
|
||||
// "scriptName": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "1-3",
|
||||
// "pid": "1",
|
||||
// "scriptName": "谐波对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "1-3-1",
|
||||
// "pid": "1-3",
|
||||
// "scriptName": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "2",
|
||||
// "pid": "0",
|
||||
// "scriptName": "电压准确度检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "pid": "2",
|
||||
// "id": "2-1",
|
||||
// "scriptName": "额定工作条件下的检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "2-1-1",
|
||||
// "pid": "2-1",
|
||||
// "scriptName": "输入:频率 42.5Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "2-1-2",
|
||||
// "pid": "2-1",
|
||||
// "scriptName": "输入:频率 50.0Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "2-1-3",
|
||||
// "pid": "2-1",
|
||||
// "scriptName": "输入:频率 50.05Hz..."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "pid": "2",
|
||||
// "id": "2-2",
|
||||
// "scriptName": "电压对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "2-2-1",
|
||||
// "pid": "2-2",
|
||||
// "scriptName": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "2-2-1",
|
||||
// "pid": "2-2",
|
||||
// "scriptName": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "2-2-2",
|
||||
// "pid": "2-2",
|
||||
// "scriptName": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "pid": "2",
|
||||
// "id": "2-3",
|
||||
// "scriptName": "谐波对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "2-3-1",
|
||||
// "pid": "2-3",
|
||||
// "scriptName": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "3",
|
||||
// "pid": "0",
|
||||
// "scriptName": "谐波准确度检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "3-1",
|
||||
// "pid": "3",
|
||||
// "scriptName": "额定工作条件下的检测",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "3-1-1",
|
||||
// "pid": "3-1",
|
||||
// "scriptName": "输入:频率 42.5Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "3-1-2",
|
||||
// "pid": "3-1",
|
||||
// "scriptName": "输入:频率 50.0Hz..."
|
||||
// },
|
||||
// {
|
||||
// "id": "3-1-3",
|
||||
// "pid": "3-1",
|
||||
// "scriptName": "输入:频率 50.05Hz..."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "3-2",
|
||||
// "pid": "3",
|
||||
// "scriptName": "电压对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "3-2-1",
|
||||
// "pid": "3-2",
|
||||
// "scriptName": "输入:频率 50.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "3-2-1",
|
||||
// "pid": "3-2",
|
||||
// "scriptName": "输入:频率 51.05Hz Ua =10%Un..."
|
||||
// },
|
||||
// {
|
||||
// "id": "3-2-2",
|
||||
// "pid": "3-2",
|
||||
// "scriptName": "输入:频率 52.05Hz Ua =10%Un..."
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// "id": "3-3",
|
||||
// "pid": "3",
|
||||
// "scriptName": "谐波对频率测量的影响",
|
||||
// "children": [
|
||||
// {
|
||||
// "id": "3-3-1",
|
||||
// "pid": "3-3",
|
||||
// "name": "输入:频率 50.05Hz Ua =100%Un..."
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ])
|
||||
|
||||
checkedScriptId.value = defaultExpandedKeys.value[0] ?? ''
|
||||
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
const findFirstLeafNode = (node: any): string => {
|
||||
const close = () => {
|
||||
//数据清空
|
||||
Object.assign(formContent, {
|
||||
scriptName: '',
|
||||
errorSysName: '',
|
||||
dataRule: '',
|
||||
deviceName: '',
|
||||
monitorIdx: '',
|
||||
})
|
||||
treeDataAll = []
|
||||
treeDataUnQualified = []
|
||||
checkedScriptId.value = ''
|
||||
activeTab.value = 'rawDataTab'
|
||||
currentScriptDsc.value = ''
|
||||
switchItem.value = -1
|
||||
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const findFirstLeafNode = (node: any): any => {
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return node.id;
|
||||
return node;
|
||||
}
|
||||
|
||||
return findFirstLeafNode(node.children[0]);
|
||||
}
|
||||
const getDefaultId = (data: any[]): string | null => {
|
||||
const getDefaultNode = (data: any[]) => {
|
||||
if (!data || data.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@
|
||||
<preTest ref="preTestRef" v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus" :webMsgSend="webMsgSend"></preTest>
|
||||
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
|
||||
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
|
||||
<test v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event"></test>
|
||||
<test ref="testRef" v-if="stepsActiveIndex >= 2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend" @update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume"></test>
|
||||
|
||||
<template #footer>
|
||||
<div>
|
||||
@@ -146,18 +146,20 @@ const detectionOptions = ref([
|
||||
const dialogTitle = ref('');
|
||||
const isTimeCheck = ref(false)
|
||||
const preTestRef = ref(null);
|
||||
const testRef = ref(null);
|
||||
|
||||
// const devIdArr = ref([])
|
||||
// const planId = ref('')
|
||||
|
||||
const devIdArr = ref([])
|
||||
const planId = ref('')
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (selection: Device.ResPqDev[],title: string,time:boolean) => {
|
||||
|
||||
|
||||
const checkStates = selection.map(item => item.checkState);
|
||||
devIdArr.value = selection.map(item => item.id);
|
||||
planId.value =selection[0].planId
|
||||
console.log('wwwwwwwwwwwwwwwww',selection)
|
||||
// devIdArr.value = selection.map(item => item.id);
|
||||
// planId.value =selection[0].planId
|
||||
// console.log('wwwwwwwwwwwwwwwww',selection)
|
||||
|
||||
const allCheckStatesEqual = new Set(checkStates).size <= 1;
|
||||
|
||||
@@ -206,13 +208,18 @@ const detectionOptions = ref([
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
let loading;
|
||||
const handleSubmit = () => {
|
||||
skipDisabled.value = true
|
||||
console.log('=============',stepsActiveIndex.value)
|
||||
|
||||
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||
let planId = checkStore.planId
|
||||
|
||||
switch (stepsActiveIndex.value) {
|
||||
case 0:
|
||||
preTestStatus.value = 'start'
|
||||
@@ -225,8 +232,9 @@ const detectionOptions = ref([
|
||||
})*/
|
||||
startPreTest({
|
||||
userPageId: "cdf",
|
||||
devIds:devIdArr.value,
|
||||
planId:planId.value
|
||||
devIds:deviceIds,
|
||||
planId:planId,
|
||||
operateType:'0' // '0'为预检测、‘1‘为正式检测
|
||||
}).then(res=>{
|
||||
|
||||
|
||||
@@ -243,27 +251,32 @@ const detectionOptions = ref([
|
||||
// startTest({deviceIds}).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'process'
|
||||
// TestStatus.value = 'start'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
// })
|
||||
TestStatus.value = 'start'
|
||||
} else if (TestStatus.value == 'process') {
|
||||
// 发送暂停指令
|
||||
// pauseTest({deviceIds}).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'paused'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
// })
|
||||
TestStatus.value = 'paused'
|
||||
} else if (TestStatus.value == 'paused') {
|
||||
// 发送继续指令
|
||||
// resumeTest({deviceIds}).then(res => {
|
||||
// console.log(res)
|
||||
// if (res.code === 20000) {
|
||||
// TestStatus.value = 'process'
|
||||
// webMsgSend.value = ''
|
||||
// } else {
|
||||
// ElMessage.error(res.message)
|
||||
// }
|
||||
@@ -316,6 +329,14 @@ const detectionOptions = ref([
|
||||
}
|
||||
})
|
||||
|
||||
const sendPause = () => {
|
||||
console.log('发送暂停指令')
|
||||
|
||||
}
|
||||
const sendResume = () => {
|
||||
console.log('发送继续检测指令')
|
||||
}
|
||||
|
||||
const getIcon = (index: number) => {
|
||||
if (stepsActiveIndex.value > index) return SuccessFilled;
|
||||
switch (index) {
|
||||
@@ -393,7 +414,7 @@ const getIcon = (index: number) => {
|
||||
const handleCancel = () => {
|
||||
// clearData()
|
||||
// emit('update:visible', false); // 关闭对话框
|
||||
|
||||
testRef.value?.clear()
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user