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 {
|
export enum ChnCheckResultEnum {
|
||||||
UNKNOWN = -1,
|
UNKNOWN = -1,
|
||||||
FAIL = 0,
|
LOADING = 0,
|
||||||
SUCCESS = 1,
|
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 {
|
export interface ButtonResult {
|
||||||
resultType: 'info' | 'success' | 'danger',
|
color: ButtonColorEnum
|
||||||
resultValue: '-' | '√' | '×'
|
icon: 'Minus' | 'Loading' | 'Close' | 'CircleCheckFilled' | 'Link' | 'WarnTriangleFilled'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,7 +107,7 @@ export namespace CheckData {
|
|||||||
* 定义检测日志类型
|
* 定义检测日志类型
|
||||||
*/
|
*/
|
||||||
export interface LogItem {
|
export interface LogItem {
|
||||||
type: 'info' | 'error'
|
type: 'info' | 'warning' | 'error'
|
||||||
log: string
|
log: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
import http from "@/api";
|
import http from "@/api";
|
||||||
|
|
||||||
export const getCheckItemDetail = (params: { deviceId: string, chnNum: number, checkItemId?: string }) => {
|
export const getFormData = (params: { deviceId: string, chnNum: number}) => {
|
||||||
return http.post<any>("/check/test/detail/", params, {loading: false});
|
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-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.monitorIdx" @change="handleChnNumChange">
|
<el-select v-model="formContent.monitorIdx" @change="handleChnChange">
|
||||||
<el-option v-for="item in chnList" :key="item.value" :label="item.value"
|
<el-option v-for="item in chnList" :key="item.value" :label="item.label"
|
||||||
:value="item.value"/>
|
:value="item.value"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -34,8 +34,10 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div class="content-tree">
|
<div class="content-tree">
|
||||||
<el-tree :default-expanded-keys="defaultExpandedKeys" node-key="id" :data="treeData"
|
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="id"
|
||||||
:props="defaultProps" @node-click="handleNodeClick"/>
|
: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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -66,6 +68,8 @@ import {reactive, ref} from 'vue'
|
|||||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||||
import {CheckData} from "@/api/check/interface";
|
import {CheckData} from "@/api/check/interface";
|
||||||
|
import {getFormData, getTreeData, getCheckData} from "@/api/check/test";
|
||||||
|
import {useDictStore} from "@/stores/modules/dict";
|
||||||
|
|
||||||
const {appendToBody} = withDefaults(defineProps<{
|
const {appendToBody} = withDefaults(defineProps<{
|
||||||
appendToBody: boolean
|
appendToBody: boolean
|
||||||
@@ -76,6 +80,10 @@ const defaultProps = {
|
|||||||
children: "children",
|
children: "children",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const dictStore = useDictStore()
|
||||||
|
|
||||||
|
const visible = ref(false)
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formContent = reactive<CheckData.DataCheck>({
|
const formContent = reactive<CheckData.DataCheck>({
|
||||||
scriptName: '',
|
scriptName: '',
|
||||||
@@ -84,13 +92,14 @@ const formContent = reactive<CheckData.DataCheck>({
|
|||||||
deviceName: '',
|
deviceName: '',
|
||||||
monitorIdx: '',
|
monitorIdx: '',
|
||||||
})
|
})
|
||||||
|
let deviceId: string = ''
|
||||||
|
let scriptType: string = ''
|
||||||
|
|
||||||
// 通道下拉列表
|
// 通道下拉列表
|
||||||
let chnList: number[] = []
|
let chnList: any[] = []
|
||||||
|
|
||||||
// 不符合测试项、全部测试项切换
|
// 不符合测试项、全部测试项切换
|
||||||
const switchItem = ref<number>(-1)
|
const switchItem = ref<number>(-1)
|
||||||
// 左侧树数据(仅用于展示)
|
|
||||||
const treeData=reactive<CheckData.ScriptItem[]>([])
|
|
||||||
// 左侧树数据-不符合测试项
|
// 左侧树数据-不符合测试项
|
||||||
let treeDataUnQualified: CheckData.ScriptItem[] = []
|
let treeDataUnQualified: CheckData.ScriptItem[] = []
|
||||||
// 左侧树数据-全部测试项
|
// 左侧树数据-全部测试项
|
||||||
@@ -99,12 +108,58 @@ let treeDataAll: CheckData.ScriptItem[] = []
|
|||||||
const checkedScriptId = ref<string>('')
|
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选中项
|
// 右侧Tab选中项
|
||||||
const activeTab = ref<string>('resultTab')
|
const activeTab = ref<string>('resultTab')
|
||||||
// 检测结果表格数据
|
// 检测结果表格数据
|
||||||
const checkResultTableData = reactive<CheckData.CheckResult[]>([
|
const checkResultTableData = reactive<CheckData.CheckResult[]>([])
|
||||||
{
|
// 原始数据表格数据
|
||||||
|
const rawTableData = reactive<CheckData.RawDataItem[]>([])
|
||||||
|
|
||||||
|
const resultTableRef = ref()
|
||||||
|
const rawDataTableRef = ref()
|
||||||
|
|
||||||
|
// 左侧树默认展开节点id
|
||||||
|
let defaultExpandedKeys: string[] = []
|
||||||
|
|
||||||
|
// 监控通道号下拉框
|
||||||
|
const handleChnChange = (data: any) => {
|
||||||
|
|
||||||
|
console.log("通道号下拉框", data);
|
||||||
|
|
||||||
|
// 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
|
||||||
|
// const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
|
||||||
|
// 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);
|
||||||
|
// 发起请求,查询该测试项的检测结果
|
||||||
|
// const result = await getCheckData({deviceId, formContent.monitorIdx, scriptType})
|
||||||
|
Object.assign(checkResultTableData, [{
|
||||||
chnNum: '1',
|
chnNum: '1',
|
||||||
standardValue: 57.74,
|
standardValue: 57.74,
|
||||||
L1: 57.73,
|
L1: 57.73,
|
||||||
@@ -115,10 +170,8 @@ const checkResultTableData = reactive<CheckData.CheckResult[]>([
|
|||||||
L3_errValue: 0.01,
|
L3_errValue: 0.01,
|
||||||
maxErrVaule: 0.05774,
|
maxErrVaule: 0.05774,
|
||||||
result: '合格',
|
result: '合格',
|
||||||
}
|
}])
|
||||||
])
|
Object.assign(rawTableData, [
|
||||||
// 原始数据表格数据
|
|
||||||
const rawTableData = reactive<CheckData.RawDataItem[]>([
|
|
||||||
{
|
{
|
||||||
updateTime: "2024-10-10 09:30:00",
|
updateTime: "2024-10-10 09:30:00",
|
||||||
L1: 57.73,
|
L1: 57.73,
|
||||||
@@ -240,109 +293,55 @@ const rawTableData = reactive<CheckData.RawDataItem[]>([
|
|||||||
L3: 57.73,
|
L3: 57.73,
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const resultTableRef = ref()
|
|
||||||
const rawDataTableRef = ref()
|
|
||||||
|
|
||||||
// 左侧树默认展开节点id
|
|
||||||
const defaultExpandedKeys = computed(() => {
|
|
||||||
return [getDefaultId(treeData)]
|
|
||||||
})
|
|
||||||
|
|
||||||
// 改变通道号下拉框触发事件
|
|
||||||
const handleChnNumChange = (data: any) => {
|
|
||||||
formContent.monitorIdx = data.value
|
|
||||||
}
|
|
||||||
watch(() => formContent.monitorIdx, (newVal, oldVal) => {
|
|
||||||
if (newVal) {
|
|
||||||
console.log("通道号下拉框", newVal, oldVal);
|
|
||||||
|
|
||||||
// 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
|
|
||||||
// treeDataUnQualified=[]
|
|
||||||
// treeDataAll=[]
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// 点击左侧树节点触发事件
|
|
||||||
const handleNodeClick = (data: any) => {
|
|
||||||
if (!data.children) {
|
|
||||||
checkedScriptId.value = data.id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(checkedScriptId, (newVal, oldVal) => {
|
|
||||||
if (newVal) {
|
|
||||||
console.log("左侧树被选中的叶子节点id", newVal, oldVal);
|
|
||||||
// checkResultTableData
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 切换不合格测试项、全部测试项 触发事件
|
// 切换不合格测试项、全部测试项 触发事件
|
||||||
// const handleSwitch = (data: any) => {
|
|
||||||
// if (data === 0) {
|
|
||||||
// //Object.assign(treeData, treeDataUnQualified)
|
|
||||||
// } else {
|
|
||||||
// //Object.assign(treeData, treeDataAll)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
watch(switchItem, (newVal, oldVal) => {
|
watch(switchItem, (newVal, oldVal) => {
|
||||||
if (switchItem.value === 0) {
|
let node = null
|
||||||
Object.assign(treeData, treeDataUnQualified)
|
if (newVal === 0) {
|
||||||
|
node = getDefaultNode(treeDataUnQualified)
|
||||||
}
|
}
|
||||||
if (switchItem.value === 1) {
|
if (newVal === 1) {
|
||||||
Object.assign(treeData, treeDataAll)
|
node = getDefaultNode(treeDataAll)
|
||||||
}
|
}
|
||||||
},{immediate:true})
|
|
||||||
|
|
||||||
|
currentScriptDsc.value = node?.scriptName
|
||||||
const visible = ref(false)
|
checkedScriptId.value = node?.id
|
||||||
|
defaultExpandedKeys = [node?.id]
|
||||||
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, _scriptType?: string) => {
|
||||||
};
|
console.log(_deviceId, chnNum, _scriptType);
|
||||||
|
deviceId = _deviceId
|
||||||
const open = async (deviceId: string, chnNum: number, checkItemId?: string) => {
|
scriptType = _scriptType ?? ''
|
||||||
switchItem.value = 0
|
switchItem.value = 0
|
||||||
// 发起后端请求,查询详细信息
|
// 发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号
|
||||||
// 当checkItemId为空时,默认显示全部测试项、全部不合格测试项
|
//const result1 = await getFormData({deviceId, chnNum})
|
||||||
// 当checkItemId不为空时,默认显示当前checkItemId的测试项、属于当前checkItemId的不合格测试项
|
|
||||||
checkItemId = checkItemId ?? ''
|
|
||||||
console.log(deviceId, chnNum, checkItemId);
|
|
||||||
//const result = await getCheckItemDetail({deviceId, chnNum, checkItemId})
|
|
||||||
|
|
||||||
|
|
||||||
// 数据处理
|
// 数据处理
|
||||||
chnList = [
|
let resFormContent = {
|
||||||
{value: '1',},
|
|
||||||
{
|
|
||||||
value: '2 (不合格)',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: '4 (不合格)',
|
|
||||||
},]
|
|
||||||
Object.assign(formContent, {
|
|
||||||
scriptName: 'Q/GDW 10650.4-2021 模拟式',
|
scriptName: 'Q/GDW 10650.4-2021 模拟式',
|
||||||
errorSysName: 'Q/GDW 10650.2-2021',
|
errorSysName: 'Q/GDW 10650.2-2021',
|
||||||
dataRule: '所有值',
|
dataRule: '505f063f9f91ab108d895a9fe96b5dce',
|
||||||
deviceName: '被检设备1',
|
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}(不符合)`
|
||||||
|
}))
|
||||||
|
|
||||||
|
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 = [{
|
treeDataAll = [{
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"pid": "0",
|
"pid": "0",
|
||||||
@@ -411,28 +410,6 @@ const open = async (deviceId: string, chnNum: number, checkItemId?: string) => {
|
|||||||
"pid": "0",
|
"pid": "0",
|
||||||
"scriptName": "频率准确度检测",
|
"scriptName": "频率准确度检测",
|
||||||
"children": [
|
"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",
|
"id": "1-2",
|
||||||
"pid": "1",
|
"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;
|
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) {
|
if (!node.children || node.children.length === 0) {
|
||||||
return node.id;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
return findFirstLeafNode(node.children[0]);
|
return findFirstLeafNode(node.children[0]);
|
||||||
}
|
}
|
||||||
const getDefaultId = (data: any[]): string | null => {
|
const getDefaultNode = (data: any[]) => {
|
||||||
if (!data || data.length === 0) {
|
if (!data || data.length === 0) {
|
||||||
return null;
|
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>
|
<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>
|
<timeTest v-if="stepsActiveIndex === 1 && isTimeCheck" v-model:testStatus="timeTestStatus"></timeTest>
|
||||||
<!-- <channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest> -->
|
<!-- <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>
|
<template #footer>
|
||||||
<div>
|
<div>
|
||||||
@@ -146,18 +146,20 @@ const detectionOptions = ref([
|
|||||||
const dialogTitle = ref('');
|
const dialogTitle = ref('');
|
||||||
const isTimeCheck = ref(false)
|
const isTimeCheck = ref(false)
|
||||||
const preTestRef = ref(null);
|
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 open = (selection: Device.ResPqDev[],title: string,time:boolean) => {
|
||||||
|
|
||||||
|
|
||||||
const checkStates = selection.map(item => item.checkState);
|
const checkStates = selection.map(item => item.checkState);
|
||||||
devIdArr.value = selection.map(item => item.id);
|
// devIdArr.value = selection.map(item => item.id);
|
||||||
planId.value =selection[0].planId
|
// planId.value =selection[0].planId
|
||||||
console.log('wwwwwwwwwwwwwwwww',selection)
|
// console.log('wwwwwwwwwwwwwwwww',selection)
|
||||||
|
|
||||||
const allCheckStatesEqual = new Set(checkStates).size <= 1;
|
const allCheckStatesEqual = new Set(checkStates).size <= 1;
|
||||||
|
|
||||||
@@ -206,13 +208,18 @@ const detectionOptions = ref([
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let loading;
|
let loading;
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
skipDisabled.value = true
|
skipDisabled.value = true
|
||||||
console.log('=============',stepsActiveIndex.value)
|
console.log('=============',stepsActiveIndex.value)
|
||||||
|
|
||||||
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
let deviceIds = checkStore.devices.map((item) => item.deviceId)
|
||||||
|
let planId = checkStore.planId
|
||||||
|
|
||||||
switch (stepsActiveIndex.value) {
|
switch (stepsActiveIndex.value) {
|
||||||
case 0:
|
case 0:
|
||||||
preTestStatus.value = 'start'
|
preTestStatus.value = 'start'
|
||||||
@@ -225,8 +232,9 @@ const detectionOptions = ref([
|
|||||||
})*/
|
})*/
|
||||||
startPreTest({
|
startPreTest({
|
||||||
userPageId: "cdf",
|
userPageId: "cdf",
|
||||||
devIds:devIdArr.value,
|
devIds:deviceIds,
|
||||||
planId:planId.value
|
planId:planId,
|
||||||
|
operateType:'0' // '0'为预检测、‘1‘为正式检测
|
||||||
}).then(res=>{
|
}).then(res=>{
|
||||||
|
|
||||||
|
|
||||||
@@ -243,27 +251,32 @@ const detectionOptions = ref([
|
|||||||
// startTest({deviceIds}).then(res => {
|
// startTest({deviceIds}).then(res => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
// if (res.code === 20000) {
|
// if (res.code === 20000) {
|
||||||
// TestStatus.value = 'process'
|
// TestStatus.value = 'start'
|
||||||
|
// webMsgSend.value = ''
|
||||||
// } else {
|
// } else {
|
||||||
// ElMessage.error(res.message)
|
// ElMessage.error(res.message)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
TestStatus.value = 'start'
|
TestStatus.value = 'start'
|
||||||
} else if (TestStatus.value == 'process') {
|
} else if (TestStatus.value == 'process') {
|
||||||
|
// 发送暂停指令
|
||||||
// pauseTest({deviceIds}).then(res => {
|
// pauseTest({deviceIds}).then(res => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
// if (res.code === 20000) {
|
// if (res.code === 20000) {
|
||||||
// TestStatus.value = 'paused'
|
// TestStatus.value = 'paused'
|
||||||
|
// webMsgSend.value = ''
|
||||||
// } else {
|
// } else {
|
||||||
// ElMessage.error(res.message)
|
// ElMessage.error(res.message)
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
TestStatus.value = 'paused'
|
TestStatus.value = 'paused'
|
||||||
} else if (TestStatus.value == 'paused') {
|
} else if (TestStatus.value == 'paused') {
|
||||||
|
// 发送继续指令
|
||||||
// resumeTest({deviceIds}).then(res => {
|
// resumeTest({deviceIds}).then(res => {
|
||||||
// console.log(res)
|
// console.log(res)
|
||||||
// if (res.code === 20000) {
|
// if (res.code === 20000) {
|
||||||
// TestStatus.value = 'process'
|
// TestStatus.value = 'process'
|
||||||
|
// webMsgSend.value = ''
|
||||||
// } else {
|
// } else {
|
||||||
// ElMessage.error(res.message)
|
// ElMessage.error(res.message)
|
||||||
// }
|
// }
|
||||||
@@ -316,6 +329,14 @@ const detectionOptions = ref([
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const sendPause = () => {
|
||||||
|
console.log('发送暂停指令')
|
||||||
|
|
||||||
|
}
|
||||||
|
const sendResume = () => {
|
||||||
|
console.log('发送继续检测指令')
|
||||||
|
}
|
||||||
|
|
||||||
const getIcon = (index: number) => {
|
const getIcon = (index: number) => {
|
||||||
if (stepsActiveIndex.value > index) return SuccessFilled;
|
if (stepsActiveIndex.value > index) return SuccessFilled;
|
||||||
switch (index) {
|
switch (index) {
|
||||||
@@ -393,7 +414,7 @@ const getIcon = (index: number) => {
|
|||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
// clearData()
|
// clearData()
|
||||||
// emit('update:visible', false); // 关闭对话框
|
// emit('update:visible', false); // 关闭对话框
|
||||||
|
testRef.value?.clear()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user