预检测
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { getPqDevById } from './../device/index';
|
||||
import type {ReqPage, ResPage} from '@/api/interface'
|
||||
import type { Monitor } from './monitor';
|
||||
|
||||
|
||||
@@ -195,7 +195,6 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
if (testStatus.value !== 'waiting') {
|
||||
switch (newValue.requestId) {
|
||||
case 'yjc_sbtxjy':
|
||||
|
||||
switch (newValue.operateCode) {
|
||||
case 'INIT_GATHER$01':
|
||||
if (newValue.code == 10200) {
|
||||
@@ -238,11 +237,10 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
} else if (newValue.code == 25001) {
|
||||
activeIndex.value = 1
|
||||
step1.value = 'success'
|
||||
step3.value = 'process'
|
||||
step2.value = 'process'
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'yjc_xyjy':
|
||||
switch (newValue.operateCode) {
|
||||
@@ -268,75 +266,75 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
// ts.value = 'error'
|
||||
// step5.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step3InitLog.value = [{
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
}
|
||||
break;
|
||||
case 'INIT_GATHER$02':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '实时数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step3.value = 'process'
|
||||
step3InitLog.value = [{
|
||||
step2.value = 'process'
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '正在进行通讯协议校验.....',
|
||||
}];
|
||||
} else if (newValue.code == 10550) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
// ts.value = 'error'
|
||||
// step5.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
//ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step3InitLog.value = [{
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
}
|
||||
break;
|
||||
case 'INIT_GATHER$03':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '暂态数据协议校验:' + newValue.data + '通讯协议校验成功!',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step3.value = 'process'
|
||||
step2.value = 'process'
|
||||
} else if (newValue.code == 10550) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备连接异常!',
|
||||
})
|
||||
@@ -344,122 +342,143 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
// ts.value = 'error'
|
||||
// step5.value = 'error'
|
||||
} else if (newValue.code == 10551) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: newValue.data + '设备触发报告异常!',
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 10552) {
|
||||
//ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!")
|
||||
step3.value = 'error'
|
||||
step3InitLog.value = [{
|
||||
step2.value = 'error'
|
||||
step2InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
}
|
||||
break;
|
||||
case 'VERIFY_MAPPING$01':
|
||||
if (newValue.code == 25001) {
|
||||
activeIndex.value = 3
|
||||
step3.value = 'success'
|
||||
step4.value = 'process'
|
||||
activeIndex.value = 2
|
||||
step2.value = 'success'
|
||||
step3.value = 'process'
|
||||
} else if (newValue.code == 10200) {
|
||||
let data = JSON.parse(newValue.data)
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: `脚本与icd检验失败! icd名称:${data['icdType']} -> 校验项:${data['dataType']}`,
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 10500) {
|
||||
step3InitLog.value.push({
|
||||
step2InitLog.value.push({
|
||||
type: 'error',
|
||||
log: `装置中未找到该icd!`,
|
||||
})
|
||||
step3.value = 'error'
|
||||
step2.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'YJC_mxyzxjy':
|
||||
switch (newValue.operateCode){
|
||||
case 'DATA_REQUEST$02':
|
||||
if (newValue.code == 10200) {
|
||||
step3InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '模型一致性检验成功!',
|
||||
})
|
||||
}
|
||||
if (newValue.code == 25001) {
|
||||
step3.value = 'success'
|
||||
step4.value = 'process'
|
||||
activeIndex.value = 3
|
||||
}else if (newValue.code == 25004) {
|
||||
step3.value = 'error'
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'YJC_sssjdqjy':
|
||||
switch (newValue.operateCode){
|
||||
case 'OPER_GATHER':
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'YJC_xujy':
|
||||
switch (newValue.operateCode) {
|
||||
case 'OPER_GATHER':
|
||||
if (newValue.code == 10200) {
|
||||
step4InitLog.value.push({
|
||||
step5InitLog.value.push({
|
||||
type: 'info',
|
||||
log: '源参数下发成功,等待校验中.....',
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step4.value = 'process'
|
||||
step4InitLog.value = [{
|
||||
step5.value = 'process'
|
||||
step5InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '源参数下发中.....',
|
||||
}];
|
||||
} else if (newValue.code == 10552) {
|
||||
ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!")
|
||||
step4.value = 'error'
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
ts.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 10520) {
|
||||
step4.value = 'error'
|
||||
step4InitLog.value.push({
|
||||
step5.value = 'error'
|
||||
step5InitLog.value.push({
|
||||
type: 'error',
|
||||
log: '解析报文异常',
|
||||
})
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
}
|
||||
break;
|
||||
|
||||
case 'DATA_REQUEST$02':
|
||||
if (newValue.code == 10200) {
|
||||
let type = 'info'
|
||||
if (newValue.data.includes('不合格')) {
|
||||
type = 'error'
|
||||
}
|
||||
|
||||
newValue.data.split('<br/>')
|
||||
step4InitLog.value.push({
|
||||
step5InitLog.value.push({
|
||||
type: type,
|
||||
log: newValue.data,
|
||||
})
|
||||
|
||||
} else if (newValue.code == 10201) {
|
||||
step4.value = 'process'
|
||||
step4InitLog.value = [{
|
||||
step5.value = 'process'
|
||||
step5InitLog.value = [{
|
||||
type: 'wait',
|
||||
log: '获取数据相序校验数据!',
|
||||
}];
|
||||
} else if (newValue.code == 25003) {
|
||||
step4.value = 'error'
|
||||
step4InitLog.value.push({
|
||||
step5.value = 'error'
|
||||
step5InitLog.value.push({
|
||||
type: 'error',
|
||||
log: '相序校验未通过!',
|
||||
})
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
step6.value = 'error'
|
||||
} else if (newValue.code == 25001) {
|
||||
step4.value = 'success'
|
||||
step5.value = 'success'
|
||||
step4InitLog.value.push({
|
||||
step6.value = 'success'
|
||||
step5InitLog.value.push({
|
||||
type: 'wait',
|
||||
log: '相序校验成功!',
|
||||
})
|
||||
ts.value = 'success'
|
||||
}
|
||||
activeIndex.value = 5
|
||||
console.log("@@@@", ts.value)
|
||||
break
|
||||
}
|
||||
|
||||
break;
|
||||
case 'quit':
|
||||
break;
|
||||
|
||||
237
frontend/src/views/home/components/compareTest.vue
Normal file
237
frontend/src/views/home/components/compareTest.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="dialog" v-bind="dialogBig">
|
||||
<div class="dialog-title">
|
||||
<div class="timeView">
|
||||
<el-icon style="margin: 0px 5px;">
|
||||
<Clock/>
|
||||
</el-icon>
|
||||
<span>检测用时:{{ timeView }}</span>
|
||||
</div>
|
||||
<el-progress style="width: 82%; margin-right: 3%;"/>
|
||||
</div>
|
||||
|
||||
<div class="dialog-content">
|
||||
<!-- 外层 Tabs -->
|
||||
<el-tabs type="card">
|
||||
<el-tab-pane label="被检设备1">
|
||||
<!-- 内层 Tabs 和按钮 -->
|
||||
<div class="form-container">
|
||||
<el-form-item label="被检设备通道号" prop="createId">
|
||||
<el-select v-model="selectedChannel" placeholder="选择通道" style="width: 150px;">
|
||||
<el-option value="1" />
|
||||
<el-option value="2"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="谐波次数" prop="createId">
|
||||
<el-select v-model="selectedChannel2" placeholder="选择通道" style="width: 150px;">
|
||||
<el-option value="2" />
|
||||
<el-option value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="间谐波次数" prop="createId">
|
||||
<el-select v-model="selectedChannel3" placeholder="选择通道" style="width: 150px;">
|
||||
<el-option value="0.5" />
|
||||
<el-option value="1.5"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="频率">
|
||||
<!-- 表格 -->
|
||||
<el-table :data="tableData" style="width: 100%" height="250"
|
||||
:header-cell-style="{ textAlign: 'center',backgroundColor: 'var(--el-color-primary)',color: '#fff' } "
|
||||
:cell-style="{ textAlign: 'center' }">
|
||||
<el-table-column prop="date" label="数据时间" />
|
||||
<el-table-column label="被检设备1-通道1"/>
|
||||
<el-table-column label="标准设备1-通道1" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="电压">
|
||||
<el-table :data="tableData" style="width: 100%" height="250"
|
||||
:header-cell-style="{ textAlign: 'center',backgroundColor: 'var(--el-color-primary)',color: '#fff' } "
|
||||
:cell-style="{ textAlign: 'center' }">
|
||||
<el-table-column prop="date" label="数据时间" />
|
||||
<el-table-column label="被检设备1-通道1">
|
||||
<el-table-column label="A相"/>
|
||||
<el-table-column label="B相"/>
|
||||
<el-table-column label="C相"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="标准设备1-通道1">
|
||||
<el-table-column label="A相"/>
|
||||
<el-table-column label="B相"/>
|
||||
<el-table-column label="C相"/>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="谐波电压">
|
||||
<el-table :data="tableData" style="width: 100%" height="250"
|
||||
:header-cell-style="{ textAlign: 'center',backgroundColor: 'var(--el-color-primary)',color: '#fff' } "
|
||||
:cell-style="{ textAlign: 'center' }">
|
||||
<el-table-column prop="date" label="数据时间" />
|
||||
<el-table-column label="被检设备1-通道1">
|
||||
<el-table-column label="A相"/>
|
||||
<el-table-column label="B相"/>
|
||||
<el-table-column label="C相"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="标准设备1-通道1">
|
||||
<el-table-column label="A相"/>
|
||||
<el-table-column label="B相"/>
|
||||
<el-table-column label="C相"/>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="被检设备2">
|
||||
<p>这是第二个主标签页的内容</p>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup name="test">
|
||||
import { ref } from 'vue';
|
||||
import { dialogBig } from '@/utils/elementBind';
|
||||
import { Clock } from '@element-plus/icons-vue';
|
||||
|
||||
const timeView = ref('00:00:00');
|
||||
const selectedChannel = ref('1'); // 设置默认选中第一个选项
|
||||
const selectedChannel2 = ref('2'); // 设置默认选中第一个选项
|
||||
const selectedChannel3 = ref('0.5'); // 设置默认选中第一个选项
|
||||
|
||||
// 示例表格数据
|
||||
const tableData = ref([
|
||||
{
|
||||
date: '2025-08-06 ',
|
||||
|
||||
},
|
||||
{
|
||||
date: '2023-10-02',
|
||||
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
/* 其他样式保持不变 */
|
||||
|
||||
.form-container {
|
||||
display: flex;
|
||||
gap: 20px; /* 设置元素之间的间距 */
|
||||
margin-bottom: 10px;
|
||||
flex-wrap: wrap; /* 允许换行 */
|
||||
}
|
||||
|
||||
/* 当屏幕宽度较小时,表单项换行显示 */
|
||||
@media (max-width: 768px) {
|
||||
.form-container {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 其他原有样式保持不变 */
|
||||
:deep(.el-table .header-row) {
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
:deep(.el-table .warning-row) {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.el-table .success-row {
|
||||
--el-table-tr-bg-color: var(--el-color-success-light-9);
|
||||
}
|
||||
|
||||
.dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.timeView {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #91cc75;
|
||||
width: 28%;
|
||||
margin-right: 0px;
|
||||
text-align: left;
|
||||
font-size: 26px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.dialog-content {
|
||||
max-height: 450px;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
:deep(.el-collapse-item__header) {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.dialog-log {
|
||||
height: 50px;
|
||||
overflow-y: hidden;
|
||||
|
||||
p {
|
||||
margin: 5px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.drawer-container {
|
||||
:deep(header.el-drawer__header) {
|
||||
color: #fff !important;
|
||||
background-color: var(--el-color-primary) !important;
|
||||
|
||||
.el-drawer__close-btn svg:hover {
|
||||
color: #ccc !important;
|
||||
}
|
||||
|
||||
.el-drawer__title {
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.loading-box {
|
||||
animation: loading 1.5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes loading {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-button--small) {
|
||||
height: 20px !important;
|
||||
width: 20px !important;
|
||||
}
|
||||
|
||||
:deep(.el-table--default td ) {
|
||||
padding: 5px 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -12,10 +12,8 @@
|
||||
|
||||
<ComparePreTest v-if="showComponent&&preTestSelected" v-show="preTestSelected && stepsActiveView==1" ref="preTestRef" v-model:testStatus="preTestStatus"
|
||||
:webMsgSend="webMsgSend"/>
|
||||
<test v-if="showComponent&&testSelected" ref="testRef" v-show="testSelected && stepsActiveView==2" v-model:testStatus="TestStatus" :webMsgSend="webMsgSend"
|
||||
@update:webMsgSend="webMsgSend=$event" @sendPause="sendPause" @sendResume="sendResume" @sendReCheck="sendReCheck" @closeWebSocket="closeWebSocket"
|
||||
<CompareTest v-if="showComponent&&testSelected" ref="testRef" v-show="testSelected && stepsActiveView==2" v-model:testStatus="TestStatus"
|
||||
:stepsActive="stepsActive"/>
|
||||
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmitFast">开始检测</el-button>
|
||||
@@ -65,7 +63,7 @@ import {reactive, ref, watch} from 'vue';
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {Coin, Edit, Key, Odometer, Refresh, Right, SuccessFilled, UploadFilled, VideoPause, VideoPlay} from '@element-plus/icons-vue'
|
||||
import ComparePreTest from './comparePreTest.vue'
|
||||
import test from './test.vue'
|
||||
import CompareTest from './compareTest.vue'
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import {pauseTest, resumeTest, startPreTest} from '@/api/socket/socket'
|
||||
|
||||
@@ -144,7 +144,29 @@ const handleConnect = (params: any) => {
|
||||
ElMessage.warning('只能从被检通道连接到标准通道')
|
||||
return
|
||||
}
|
||||
|
||||
// 过滤掉当前连接,检查是否还有重复的
|
||||
const existingEdges = edges.value.filter(edge =>
|
||||
edge.source === params.source || edge.target === params.target
|
||||
);
|
||||
|
||||
// 如果同源或同目标的连接超过1个,说明有重复
|
||||
if (existingEdges.length > 1) {
|
||||
const duplicateSource = existingEdges.filter(edge => edge.source === params.source).length > 1;
|
||||
const duplicateTarget = existingEdges.filter(edge => edge.target === params.target).length > 1;
|
||||
|
||||
if (duplicateSource) {
|
||||
removeEdge(params);
|
||||
ElMessage.warning('该被检通道已经连接,不能重复连接');
|
||||
return;
|
||||
}
|
||||
|
||||
if (duplicateTarget) {
|
||||
removeEdge(params);
|
||||
ElMessage.warning('该标准通道已经连接,不能重复连接');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除不合法连接
|
||||
|
||||
@@ -1,106 +1,346 @@
|
||||
<template>
|
||||
<el-dialog title="实时数据详情" v-model='dialogVisible' @close="handleClose" v-bind="dialogBig" >
|
||||
<el-dialog title="实时数据详情" v-model='dialogVisible' @close="handleClose" v-bind="dialogBig">
|
||||
<el-tabs v-model="activeTab" type="card">
|
||||
<el-tab-pane label="被检设备1" name="channel1">
|
||||
<el-tab-pane
|
||||
v-for="(device, deviceName, index) in testDataStructure"
|
||||
:key="deviceName"
|
||||
:name="`channel${index + 1}`">
|
||||
<template #label>
|
||||
<span>
|
||||
{{ deviceName }}
|
||||
<el-icon v-if="tabStatus[deviceName]" style="color: red; margin-left: 5px;">
|
||||
<CircleClose />
|
||||
</el-icon>
|
||||
<el-icon v-else style="color: green; margin-left: 5px;">
|
||||
<CircleCheck />
|
||||
</el-icon>
|
||||
</span>
|
||||
</template>
|
||||
<div class="table-toolbar">
|
||||
<el-form-item label="被检设备通道号" prop="createId">
|
||||
<el-select v-model="timeRange" placeholder="选择时间范围" style="width: 150px;">
|
||||
<el-option label="通道1" value="1"></el-option>
|
||||
<el-option label="通道2" value="2"></el-option>
|
||||
<el-option label="通道3" value="3"></el-option>
|
||||
<el-option label="通道4" value="4"></el-option>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-model="selectedChannels[deviceName]"
|
||||
placeholder="选择通道"
|
||||
style="width: 150px;"
|
||||
@change="() => handleDutChannelChange(deviceName)">
|
||||
<el-option
|
||||
v-for="(channelData, channelName) in device.dutData"
|
||||
:key="channelName"
|
||||
:label="channelName.replace('被检', '')"
|
||||
:value="channelName">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-button type="primary" @click="exportData">导出数据</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
:data="tableDataMap[deviceName]"
|
||||
:header-cell-style="{ textAlign: 'center',backgroundColor: 'var(--el-color-primary)',color: '#fff' } "
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
style="width: 100%"
|
||||
:style="{ height: '400px',maxHeight: '400px',overflow:'hidden'}">
|
||||
<el-table-column prop="monitorNum" label="数据时标" width="180"/>
|
||||
<el-table-column label="被检设备1-通道1">
|
||||
<el-table-column prop="Ua" label="A相(V)">
|
||||
<el-table-column :label="`${deviceName}-${selectedChannels[deviceName]?.replace('被检', '') || '通道1'}`">
|
||||
<el-table-column prop="Ua1" label="A相(V)">
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="B相(V)">
|
||||
<el-table-column prop="Ub1" label="B相(V)">
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="C相(V)">
|
||||
<el-table-column prop="Uc1" label="C相(V)">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="标准设备-通道1">
|
||||
<el-table-column prop="Ua" label="A相(V)">
|
||||
<el-table-column :label="`标准设备-${getMappedStandardChannel(deviceName, selectedChannels[deviceName])?.replace('标准', '') || '通道1'}`">
|
||||
<el-table-column prop="Ua2" label="A相(V)">
|
||||
</el-table-column>
|
||||
<el-table-column prop="Ub" label="B相(V)">
|
||||
<el-table-column prop="Ub2" label="B相(V)">
|
||||
</el-table-column>
|
||||
<el-table-column prop="Uc" label="C相(V)">
|
||||
<el-table-column prop="Uc2" label="C相(V)">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="被检设备2" name="channel2"></el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx' name='realTimeDataAlign'>
|
||||
import { dialogBig } from "@/utils/elementBind";
|
||||
import { ref, reactive } from "vue";
|
||||
import { ref } from "vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { CircleCheck, CircleClose } from '@element-plus/icons-vue';
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const activeTab = ref('channel1');
|
||||
const timeRange = ref('1');
|
||||
|
||||
|
||||
// 表格数据示例
|
||||
const tableData = ref([
|
||||
{
|
||||
monitorNum: '2023-05-20 10:30:01',
|
||||
Ua: '220.5V',
|
||||
Ub: '219.8V',
|
||||
Uc: '220.2V',
|
||||
Ia: '4.98A',
|
||||
Ib: '5.01A',
|
||||
Ic: '4.99A'
|
||||
const testDataStructure = ref({
|
||||
// 第一层:多个被检设备
|
||||
'被检设备1': {
|
||||
// 被检设备数据
|
||||
dutData: {
|
||||
'被检通道1': {
|
||||
// 第三层:各个时间点的ABC三相数据
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '1',
|
||||
Ub: '2',
|
||||
Uc: '3',
|
||||
},
|
||||
'2023-05-20 10:30:04': {
|
||||
Ua: '4',
|
||||
Ub: '5',
|
||||
Uc: '6',
|
||||
},
|
||||
'2023-05-20 10:30:07': {
|
||||
Ua: '7',
|
||||
Ub: '8',
|
||||
Uc: '9',
|
||||
},
|
||||
'2023-05-20 10:30:10': {
|
||||
Ua: '10',
|
||||
Ub: '11',
|
||||
Uc: '12',
|
||||
},
|
||||
'2023-05-20 10:30:13': {
|
||||
Ua: '13',
|
||||
Ub: '14',
|
||||
Uc: '15',
|
||||
}
|
||||
},
|
||||
'被检通道2': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '7',
|
||||
Ub: '8',
|
||||
Uc: '9',
|
||||
},
|
||||
'2023-05-20 10:30:04': {
|
||||
Ua: '10',
|
||||
Ub: '11',
|
||||
Uc: '12',
|
||||
},
|
||||
'2023-05-20 10:30:07': {
|
||||
Ua: '13',
|
||||
Ub: '14',
|
||||
Uc: '15',
|
||||
},
|
||||
'2023-05-20 10:30:10': {
|
||||
Ua: '16',
|
||||
Ub: '17',
|
||||
Uc: '18',
|
||||
},
|
||||
'2023-05-20 10:30:13': {
|
||||
Ua: '19',
|
||||
Ub: '20',
|
||||
Uc: '21',
|
||||
}
|
||||
}
|
||||
},
|
||||
// 标准设备数据
|
||||
standardData: {
|
||||
'标准通道1': {
|
||||
'2023-05-20 10:30:00': {
|
||||
Ua: '01',
|
||||
Ub: '02',
|
||||
Uc: '03',
|
||||
},
|
||||
'2023-05-20 10:30:03': {
|
||||
Ua: '04',
|
||||
Ub: '05',
|
||||
Uc: '06',
|
||||
},
|
||||
'2023-05-20 10:30:06': {
|
||||
Ua: '07',
|
||||
Ub: '08',
|
||||
Uc: '09',
|
||||
},
|
||||
'2023-05-20 10:30:09': {
|
||||
Ua: '010',
|
||||
Ub: '011',
|
||||
Uc: '012',
|
||||
},
|
||||
'2023-05-20 10:30:12': {
|
||||
Ua: '013',
|
||||
Ub: '014',
|
||||
Uc: '015',
|
||||
}
|
||||
},
|
||||
'标准通道2': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '07',
|
||||
Ub: '08',
|
||||
Uc: '09',
|
||||
},
|
||||
'2023-05-20 10:30:04': {
|
||||
Ua: '010',
|
||||
Ub: '011',
|
||||
Uc: '012',
|
||||
},
|
||||
'2023-05-20 10:30:07': {
|
||||
Ua: '013',
|
||||
Ub: '014',
|
||||
Uc: '015',
|
||||
},
|
||||
'2023-05-20 10:30:10': {
|
||||
Ua: '016',
|
||||
Ub: '017',
|
||||
Uc: '018',
|
||||
},
|
||||
'2023-05-20 10:30:13': {
|
||||
Ua: '019',
|
||||
Ub: '020',
|
||||
Uc: '021',
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
monitorNum: '2023-05-20 10:30:04',
|
||||
Ua: '220.3V',
|
||||
Ub: '220.1V',
|
||||
Uc: '219.9V',
|
||||
Ia: '5.02A',
|
||||
Ib: '4.99A',
|
||||
Ic: '5.00A'
|
||||
},
|
||||
{
|
||||
monitorNum: '2023-05-20 10:30:07',
|
||||
Ua: '220.5V',
|
||||
Ub: '219.8V',
|
||||
Uc: '220.2V',
|
||||
Ia: '4.98A',
|
||||
Ib: '5.01A',
|
||||
Ic: '4.99A'
|
||||
},
|
||||
{
|
||||
monitorNum: '2023-05-20 10:30:10',
|
||||
Ua: '220.3V',
|
||||
Ub: '220.1V',
|
||||
Uc: '219.9V',
|
||||
Ia: '5.02A',
|
||||
Ib: '4.99A',
|
||||
Ic: '5.00A'
|
||||
'被检设备2': {
|
||||
dutData: {
|
||||
'被检通道1': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '11',
|
||||
Ub: '12',
|
||||
Uc: '13',
|
||||
}
|
||||
},
|
||||
'被检通道2': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '14',
|
||||
Ub: '15',
|
||||
Uc: '16',
|
||||
}
|
||||
}
|
||||
},
|
||||
standardData: {
|
||||
'标准通道1': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '011',
|
||||
Ub: '012',
|
||||
Uc: '013',
|
||||
}
|
||||
},
|
||||
'标准通道2': {
|
||||
'2023-05-20 10:30:01': {
|
||||
Ua: '014',
|
||||
Ub: '015',
|
||||
Uc: '016',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
// 每个设备选中的通道
|
||||
const selectedChannels = ref<Record<string, string>>({});
|
||||
|
||||
// 通道映射关系:被检设备通道 -> 标准设备通道
|
||||
// 格式:被检设备1-被检通道1,标准设备1-标准通道2
|
||||
const channelMapping = ref<Record<string, Record<string, string>>>({
|
||||
'被检设备1': {
|
||||
'被检通道1': '标准通道1',
|
||||
'被检通道2': '标准通道2'
|
||||
},
|
||||
'被检设备2': {
|
||||
'被检通道1': '标准通道2',
|
||||
'被检通道2': '标准通道1'
|
||||
}
|
||||
});
|
||||
|
||||
// 每个设备的表格数据
|
||||
const tableDataMap = ref<Record<string, any[]>>({});
|
||||
|
||||
// 每个tab的状态(true表示有不完整数据,false表示数据完整)
|
||||
const tabStatus = ref<Record<string, boolean>>({});
|
||||
|
||||
// 检查设备数据是否有不完整的行(包含/的行)
|
||||
const hasIncompleteData = (deviceName: string) => {
|
||||
const tableData = tableDataMap.value[deviceName];
|
||||
if (!tableData || tableData.length === 0) return false;
|
||||
|
||||
// 检查每一行是否有缺失数据(包含/的字段)
|
||||
return tableData.some(row => {
|
||||
return row.Ua1 === '/' || row.Ub1 === '/' || row.Uc1 === '/' ||
|
||||
row.Ua2 === '/' || row.Ub2 === '/' || row.Uc2 === '/';
|
||||
});
|
||||
};
|
||||
|
||||
// 获取映射的标准设备通道
|
||||
const getMappedStandardChannel = (deviceName: string, dutChannel: string) => {
|
||||
if (!channelMapping.value[deviceName]) {
|
||||
return '标准通道1'; // 默认值
|
||||
}
|
||||
return channelMapping.value[deviceName][dutChannel] || '标准通道1';
|
||||
};
|
||||
|
||||
// 处理被检设备通道切换
|
||||
const handleDutChannelChange = (deviceName: string) => {
|
||||
// 更新指定设备的表格数据,但不改变tab图标状态
|
||||
updateTableData(deviceName);
|
||||
};
|
||||
|
||||
// 根据 testDataStructure 生成表格数据
|
||||
const generateTableData = (deviceName: string, dutChannel: string) => {
|
||||
const deviceData = testDataStructure.value[deviceName];
|
||||
if (!deviceData) return [];
|
||||
|
||||
const dutData = deviceData.dutData[dutChannel];
|
||||
// 获取映射的标准设备通道
|
||||
const standardChannel = getMappedStandardChannel(deviceName, dutChannel);
|
||||
const standardData = deviceData.standardData[standardChannel];
|
||||
|
||||
if (!dutData || !standardData) return [];
|
||||
|
||||
// 获取所有时间戳并去重排序
|
||||
const dutTimestamps = Object.keys(dutData);
|
||||
const standardTimestamps = Object.keys(standardData);
|
||||
const allTimestamps = Array.from(new Set([...dutTimestamps, ...standardTimestamps])).sort();
|
||||
|
||||
// 生成表格数据
|
||||
return allTimestamps.map(timestamp => {
|
||||
const dutValues = dutData[timestamp];
|
||||
const standardValues = standardData[timestamp];
|
||||
|
||||
return {
|
||||
monitorNum: timestamp,
|
||||
Ua1: dutValues ? dutValues.Ua : '/',
|
||||
Ub1: dutValues ? dutValues.Ub : '/',
|
||||
Uc1: dutValues ? dutValues.Uc : '/',
|
||||
Ua2: standardValues ? standardValues.Ua : '/',
|
||||
Ub2: standardValues ? standardValues.Ub : '/',
|
||||
Uc2: standardValues ? standardValues.Uc : '/'
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
// 更新指定设备的表格数据
|
||||
const updateTableData = (deviceName: string) => {
|
||||
const selectedChannel = selectedChannels.value[deviceName];
|
||||
if (selectedChannel) {
|
||||
const tableData = generateTableData(deviceName, selectedChannel);
|
||||
tableDataMap.value[deviceName] = tableData;
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化所有设备的数据和状态
|
||||
const initAllTableData = () => {
|
||||
Object.keys(testDataStructure.value).forEach(deviceName => {
|
||||
// 默认选择第一个通道
|
||||
const firstChannel = Object.keys(testDataStructure.value[deviceName].dutData)[0];
|
||||
selectedChannels.value[deviceName] = firstChannel;
|
||||
|
||||
// 生成表格数据
|
||||
updateTableData(deviceName);
|
||||
|
||||
// 初始化tab状态(只在初始化时设置一次)
|
||||
if (tabStatus.value[deviceName] === undefined) {
|
||||
tabStatus.value[deviceName] = hasIncompleteData(deviceName);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const open = async () => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
// 刷新数据
|
||||
const refreshData = () => {
|
||||
ElMessage.info('正在刷新数据...');
|
||||
// 这里可以添加实际的数据刷新逻辑
|
||||
// 初始化数据和状态
|
||||
initAllTableData();
|
||||
|
||||
// 设置默认激活的 tab
|
||||
activeTab.value = 'channel1';
|
||||
};
|
||||
|
||||
// 导出数据
|
||||
@@ -120,14 +360,9 @@ defineExpose({ open });
|
||||
<style scoped lang="scss">
|
||||
.table-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between; // 关键修改:将子元素分布到两端
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
// 移除这个样式,避免影响布局
|
||||
// .table-toolbar .el-button {
|
||||
// margin-right: 10px;
|
||||
// }
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 10px 20px 20px 20px;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ import WriteTHPopup from "@/views/home/components/writeTHPopup.vue";
|
||||
import DeviceConnectionPopup from '@/views/home/components/deviceConnectionPopup.vue'
|
||||
import { Plan } from '@/api/plan/interface'
|
||||
import { StandardDevice } from '@/api/device/interface/standardDevice'
|
||||
import {getPlanList } from '@/api/plan/plan.ts'
|
||||
|
||||
import { mount } from 'sortablejs'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
@@ -369,10 +369,14 @@ const props = defineProps({
|
||||
planArray: {
|
||||
type: Array as PropType<Plan.ReqPlan[]>,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
planTable: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
})
|
||||
const appSceneStore = useAppSceneStore()
|
||||
const planTable = ref<any[]>([])
|
||||
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -957,7 +961,8 @@ const handleTest2 = () => {
|
||||
}
|
||||
//选中计划的数据源
|
||||
const dataSources = ref([])
|
||||
const matchedItem = planTable.value.data.find(item => item.name === props.plan.name)
|
||||
|
||||
const matchedItem = props.planTable.data.find(item => item.name === props.plan.name)
|
||||
if (matchedItem) {
|
||||
dataSources.value = matchedItem.datasourceIds
|
||||
}
|
||||
@@ -1324,13 +1329,7 @@ onBeforeMount(async () => {
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
if(modeStore.currentMode != '比对式')
|
||||
return;
|
||||
const patternId2 = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id;
|
||||
|
||||
if (patternId2 !== undefined) {
|
||||
planTable.value = await getPlanList({ 'patternId': patternId2 });
|
||||
}
|
||||
})
|
||||
|
||||
const handleQuitClicked = () => {
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
<span>{{ node.label }}</span>
|
||||
<!-- 子节点右侧图标 + tooltip -->
|
||||
<el-tooltip
|
||||
v-if="node.label!='未检' && node.label!='检测中' && node.label!='检测完成'"
|
||||
v-if="node.label!='未检' && node.label!='检测中' && node.label!='检测完成' && hasChildrenInPlanTable(node.data)"
|
||||
placement="top"
|
||||
:manual="true"
|
||||
content="子计划信息">
|
||||
<Menu
|
||||
<List
|
||||
@click.stop="childDetail(node.data)"
|
||||
style="width: 16px; height: 16px; margin-left: 8px; cursor: pointer; color: var(--el-color-primary)"
|
||||
/>
|
||||
@@ -54,12 +54,15 @@
|
||||
</template>
|
||||
<script lang='ts' setup>
|
||||
import { type Plan } from '@/api/plan/interface';
|
||||
import { Menu, Platform, CircleCheck,Loading } from '@element-plus/icons-vue'
|
||||
import { Menu, Platform ,List} from '@element-plus/icons-vue'
|
||||
import { nextTick, onMounted, PropType, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router'
|
||||
import {useCheckStore} from "@/stores/modules/check";
|
||||
import { ElTooltip } from 'element-plus';
|
||||
import SourceOpen from '@/views/plan/planList/components/childrenPlan.vue'
|
||||
import {getPlanList } from '@/api/plan/plan.ts'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
|
||||
|
||||
const openSourceView = ref()
|
||||
@@ -68,6 +71,8 @@ const checkStore = useCheckStore()
|
||||
const filterText = ref('')
|
||||
const treeRef = ref()
|
||||
const data: any = ref([])
|
||||
const modeStore = useModeStore()
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
@@ -124,12 +129,12 @@ const clickTableToTree = (val: any,id:any) => {
|
||||
}
|
||||
}
|
||||
|
||||
const {updateSelectedTreeNode,width,height,planArray} = defineProps<{
|
||||
const {updateSelectedTreeNode,width,height,planTable} = defineProps<{
|
||||
updateSelectedTreeNode:Function;
|
||||
width: number;
|
||||
height: number;
|
||||
planArray?: Plan.ReqPlan[];
|
||||
}>();
|
||||
planTable?: Array<[]>;
|
||||
}>();
|
||||
|
||||
watch(
|
||||
() => searchForm.value.planName,
|
||||
@@ -141,6 +146,20 @@ watch(
|
||||
},
|
||||
)
|
||||
|
||||
const hasChildrenInPlanTable = (nodeData: Plan.ResPlan) => {
|
||||
try {
|
||||
// 在 planTable 中查找对应的节点数据
|
||||
const foundItem = tableData.value.find((item: any) => item.id === nodeData.id);
|
||||
|
||||
// 检查是否有 children 且 children 数组不为空
|
||||
return foundItem && Array.isArray(foundItem.children) && foundItem.children.length > 0;
|
||||
} catch (error) {
|
||||
console.error('检查子节点时出错:', error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const idd = ref('')
|
||||
const handleNodeClick = (data: Plan.ResPlan) => {
|
||||
|
||||
@@ -170,15 +189,49 @@ const detail = () => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
const childDetail = (data: Plan.ResPlan) => {
|
||||
console.log('planArray',planArray)
|
||||
openSourceView.value.open("检测计划详情",data)
|
||||
const filteredPlans = tableData.value.filter(item => item.id === data.id);
|
||||
|
||||
// 确保有匹配项再访问 [0]
|
||||
if (filteredPlans.length > 0 && openSourceView.value) {
|
||||
openSourceView.value.open("检测计划详情", filteredPlans[0]);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// console.log()
|
||||
|
||||
function buildTree(flatList: any[]): any[] {
|
||||
const map = new Map();
|
||||
const tree: any[] = [];
|
||||
|
||||
// First, create a map of all items by id for fast lookup
|
||||
flatList.forEach(item => {
|
||||
map.set(item.id, { ...item, children: [] });
|
||||
});
|
||||
|
||||
// Then, assign each item to its parent's children array
|
||||
flatList.forEach(item => {
|
||||
if (item.fatherPlanId && map.has(item.fatherPlanId)) {
|
||||
map.get(item.fatherPlanId).children.push(map.get(item.id));
|
||||
} else if (item.fatherPlanId === '0') {
|
||||
// Items with fatherPlanId '0' are root nodes
|
||||
tree.push(map.get(item.id));
|
||||
}
|
||||
});
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const tableData = ref<any[]>([])
|
||||
onMounted(async () => {
|
||||
if(modeStore.currentMode != '比对式')
|
||||
return;
|
||||
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id;
|
||||
const result = await getPlanList({'patternId' : patternId});
|
||||
tableData.value = buildTree(result.data as any[]);
|
||||
})
|
||||
|
||||
defineExpose({ getTreeData ,clickTableToTree})
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-col :lg='4' :xl='4' :md='4' :sm='4'>
|
||||
<div class='left_tree'>
|
||||
<!-- <tree ref='treeRef' :updateSelectedTreeNode='getPieData || (() => {})' /> -->
|
||||
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' :width="viewWidth" :height="viewHeight" :planArray = 'planList2?.data'/>
|
||||
<tree ref='treeRef' :updateSelectedTreeNode='updateData|| (() => {})' :width="viewWidth" :height="viewHeight" :planTable ='planTable'/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :lg='20' :xl='20' :md='20' :sm='20'>
|
||||
@@ -95,7 +95,7 @@
|
||||
<el-tab-pane :label='tabLabel1' :style='{ height: tabPaneHeight}'>
|
||||
<!-- 列表数据 -->
|
||||
<div class='container_table' :style='{ height: tableHeight }'>
|
||||
<Table ref='tableRef1' :id='currentId' :plan ='select_Plan' :planArray = 'planList2?.data' @batchGenerateClicked="handleBatchGenerate"></Table>
|
||||
<Table ref='tableRef1' :id='currentId' :plan ='select_Plan' :planArray = 'planList2?.data' :planTable ='planTable' @batchGenerateClicked="handleBatchGenerate"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -110,7 +110,7 @@ import { useRouter } from 'vue-router'
|
||||
import tree from '../components/tree.vue'
|
||||
import Table from '../components/table.vue'
|
||||
import deviceDataList from '@/api/device/device/deviceData'
|
||||
import { getBoundPqDevList, getPlanListByPattern } from '@/api/plan/plan.ts'
|
||||
import { getBoundPqDevList, getPlanListByPattern,getPlanList } from '@/api/plan/plan.ts'
|
||||
import { onBeforeMount, onUnmounted, ref, watch } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
@@ -119,7 +119,6 @@ import type { CollapseModelValue } from 'element-plus/es/components/collapse/src
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { ResultData } from '@/api/interface'
|
||||
import { useViewSize } from '@/hooks/useViewSize'
|
||||
import { map } from 'lodash'
|
||||
|
||||
const planName = ref('')
|
||||
const dictStore = useDictStore()
|
||||
@@ -151,6 +150,7 @@ const planList = ref<ResultData<Plan.ReqPlan[]>>()
|
||||
const planList2 = ref<ResultData<Plan.ReqPlan[]>>()//备份含子计划的结构
|
||||
const select_Plan = ref<Plan.ReqPlan>()
|
||||
const isLabelLineShow = ref(true)
|
||||
const planTable = ref<any[]>([])
|
||||
const { popupBaseView,viewWidth, viewHeight } = useViewSize()
|
||||
const handleCollapseChange = (val: CollapseModelValue) => {
|
||||
|
||||
@@ -521,12 +521,21 @@ onBeforeMount(async () => {
|
||||
}
|
||||
getTree(planList.value)
|
||||
getPieData(currentId.value)
|
||||
|
||||
if(modeStore.currentMode != '比对式')
|
||||
return;
|
||||
const patternId2 = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id;
|
||||
if (patternId2 !== undefined) {
|
||||
planTable.value = await getPlanList({ 'patternId': patternId2 });
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
onUnmounted(async () => {
|
||||
if (chartsInfoRef.value) {
|
||||
resizeObserver.unobserve(chartsInfoRef.value)
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
const handleBatchGenerate = async () => {
|
||||
|
||||
@@ -50,7 +50,7 @@ import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/int
|
||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev,getPqDevById} from '@/api/device/device/index'
|
||||
import {uploadReportToCloud} from '@/api/device/report/index'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {onBeforeMount, reactive, ref} from 'vue'
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
:title="title"
|
||||
:width="width"
|
||||
:modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<div
|
||||
class="table-box"
|
||||
@@ -109,6 +110,7 @@ import { Device } from '@/api/device/interface/device'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import DevTransfer from '@/views/plan/planList/components/devTransfer.vue'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import router from '@/routers'
|
||||
|
||||
|
||||
const dictStore = useDictStore()
|
||||
@@ -389,8 +391,6 @@ const open = async (textTitle: string,data: Plan.ReqPlan,pattern: string) => {
|
||||
item.isShow = false;
|
||||
}
|
||||
});
|
||||
console.log('弹窗打开方法',planFormContent.value)
|
||||
|
||||
}
|
||||
|
||||
const handleTabClick = (tab:any) => {
|
||||
@@ -416,7 +416,6 @@ const handleTabClick = (tab:any) => {
|
||||
isTabPlanFather.value = false
|
||||
}
|
||||
planId.value = tab.props.name
|
||||
console.log('handleTabClick',tab)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
@@ -521,6 +520,11 @@ const subBatchRemove = async (selectedListIds: string[]) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.value = false
|
||||
router.push('/plan/planList')
|
||||
}
|
||||
|
||||
defineExpose({ open,handleTableDataUpdate })
|
||||
|
||||
interface ChildrenPlanProps {
|
||||
|
||||
@@ -423,7 +423,7 @@ const open = async (sign: string, data: Plan.ReqPlan,currentMode: string,plan:nu
|
||||
};
|
||||
const result = await getDictTreeByCode(resDictTree)
|
||||
const allOptions = convertToOptions(result.data as Dict.ResDictTree[]);
|
||||
// 提取第二层节点
|
||||
// 提取第二层节点
|
||||
allOptions.forEach(option => {
|
||||
if (option.children && option.children.length > 0) {
|
||||
secondLevelOptions.push(...option.children);
|
||||
|
||||
Reference in New Issue
Block a user