2024-11-18 22:04:59 +08:00
|
|
|
|
<template>
|
2024-11-29 13:45:48 +08:00
|
|
|
|
<el-dialog :title="dialogTitle" :model-value="visible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
|
2024-11-18 22:04:59 +08:00
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<div class="steps-container">
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<!-- simple -->
|
2024-12-06 15:06:38 +08:00
|
|
|
|
<!-- :style="{color:node.label=='未检'?'#F56C6C':node.label=='检测中'?'#E6A23C':'#67C23A'}" -->
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<el-steps class="test-head-steps" simple :active="stepsActiveIndex" process-status="finish" finish-status="success" >
|
2024-11-20 21:30:05 +08:00
|
|
|
|
<!-- style="height:100px" -->
|
2024-11-25 21:11:10 +08:00
|
|
|
|
<!-- <el-step title="预检测" :icon="getIcon(0)" /> -->
|
|
|
|
|
|
<el-step title="预检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :Edit" />
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<el-step title="守时检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :UploadFilled"/>
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<el-step title="系数校准" :icon="stepsActiveIndex > 2 ? SuccessFilled :Odometer" />
|
|
|
|
|
|
<el-step title="正式检测" :icon="stepsActiveIndex > 3 ? SuccessFilled :Coin" />
|
|
|
|
|
|
<el-step title="检测完成" :icon="stepsActiveIndex > 4 ? SuccessFilled :Key" />
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</el-steps>
|
2024-11-21 23:02:43 +08:00
|
|
|
|
</div>
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<preTest v-if="stepsActiveIndex === 0" v-model:testStatus="preTestStatus"></preTest>
|
|
|
|
|
|
<timeTest v-if="stepsActiveIndex === 1" v-model:testStatus="timeTestStatus"></timeTest>
|
|
|
|
|
|
<channelsTest v-if="stepsActiveIndex === 2" v-model:testStatus="channelsTestStatus"></channelsTest>
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<test v-if="stepsActiveIndex >= 3" v-model:testStatus="TestStatus"></test>
|
|
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<template #footer>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
<!-- <el-button @click="handleCancel">取 消</el-button> -->
|
2024-11-25 21:11:10 +08:00
|
|
|
|
<el-button type="primary" :icon="DArrowRight" v-if="stepsActiveIndex < 2 && ActiveStatue != 'success'" :disabled="skipDisabled" @click="nextStep">跳过</el-button>
|
2024-11-18 22:04:59 +08:00
|
|
|
|
<el-button type="primary" :icon="VideoPlay" v-if="ActiveStatue === 'waiting'" @click="handleSubmit">开始检测</el-button>
|
|
|
|
|
|
<el-button type="danger" :icon="Close" v-if="ActiveStatue === 'process'" @click="handleSubmit">停止检测</el-button>
|
|
|
|
|
|
<el-button type="primary" :icon="Refresh" v-if="ActiveStatue === 'error'" @click="handleSubmit">重新检测</el-button>
|
|
|
|
|
|
<el-button type="primary" :icon="Right" v-if="ActiveStatue === 'success'" @click="nextStep">{{nextStepText}}</el-button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2024-11-25 21:11:10 +08:00
|
|
|
|
<script lang="tsx" setup name="testPopup">
|
|
|
|
|
|
import { h } from 'vue';
|
2024-11-18 22:04:59 +08:00
|
|
|
|
import{ElMessage, ElSelectV2, FormInstance,FormItemRule}from'element-plus'
|
|
|
|
|
|
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
|
|
|
|
|
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
|
|
|
|
|
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
2024-11-21 23:02:43 +08:00
|
|
|
|
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument,Edit, Picture, UploadFilled, SuccessFilled,VideoPlay,Right,Refresh,Close, Odometer,Coin,Key, DArrowRight} from '@element-plus/icons-vue'
|
2024-11-18 22:04:59 +08:00
|
|
|
|
import { useDictStore } from '@/stores/modules/dict'
|
|
|
|
|
|
import preTest from './preTest.vue'
|
|
|
|
|
|
import timeTest from './timeTest.vue'
|
|
|
|
|
|
import channelsTest from './channelsTest.vue'
|
2024-11-25 21:11:10 +08:00
|
|
|
|
//import SvgIcon from '@/components/SvgIcon.vue';
|
|
|
|
|
|
|
|
|
|
|
|
// import preTestIcon from '@/assets/icons/preTest.svg'
|
2024-11-18 22:04:59 +08:00
|
|
|
|
|
2024-11-25 21:11:10 +08:00
|
|
|
|
// const preTestIcon = `
|
|
|
|
|
|
// <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
|
|
|
|
|
|
// </svg>
|
|
|
|
|
|
// `;
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const props = defineProps<{
|
|
|
|
|
|
visible: boolean;
|
|
|
|
|
|
dialogTitle: string;
|
|
|
|
|
|
|
|
|
|
|
|
formData: {
|
|
|
|
|
|
id: string;//误差体系表Id
|
|
|
|
|
|
name: string;//误差体系名称
|
|
|
|
|
|
standard_Name:string;//参照标准名称
|
|
|
|
|
|
standard_Time:string;//标准推行时间
|
|
|
|
|
|
dev_Level:string;//使用设备等级
|
|
|
|
|
|
enable:number;//状态:0-不启用 1-启用
|
|
|
|
|
|
state:number;//0-删除 1-正常
|
|
|
|
|
|
};
|
|
|
|
|
|
}>();
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
|
(e: 'update:visible', value: boolean): void;
|
|
|
|
|
|
(e: 'submit', data: any): void;
|
|
|
|
|
|
}>();
|
|
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
const skipDisabled = ref(false);
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const nextStepText = ref('下一步');
|
|
|
|
|
|
//定义与预检测配置数组
|
|
|
|
|
|
const detectionOptions = ref([
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 0,
|
|
|
|
|
|
name: "源通讯检测",//判断源通讯是否正常
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 1,
|
|
|
|
|
|
name: "设备通讯检测",//判断设备的IP、Port、识别码、秘钥是否正常
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 2,
|
|
|
|
|
|
name: "协议校验",//ICD报告触发测试
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 3,
|
|
|
|
|
|
name: "相序校验",//判断装置的接线是否正确
|
|
|
|
|
|
selected: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
// {
|
|
|
|
|
|
// id: 4,
|
|
|
|
|
|
// name: "守时校验",//判断装置24小时内的守时误差是否小于1s
|
|
|
|
|
|
// selected: true,
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// id: 5,
|
|
|
|
|
|
// name: "通道系数校准",//通过私有协议与装置进行通讯,校准三相电压电流的通道系数
|
|
|
|
|
|
// selected: true,
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// id: 6,
|
|
|
|
|
|
// name: "实时数据比对",
|
|
|
|
|
|
// },
|
|
|
|
|
|
// {
|
|
|
|
|
|
// id: 7,
|
|
|
|
|
|
// name: "录波数据比对",
|
|
|
|
|
|
// },
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
const stepsTotalNum = ref(5);//步骤总数
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const stepsActiveIndex = ref(0); //当前正在执行的步骤索引
|
|
|
|
|
|
const ActiveStatue = ref('waiting');//当前步骤状态
|
|
|
|
|
|
const preTestStatus = ref('waiting');//预检测执行状态
|
|
|
|
|
|
const timeTestStatus = ref('waiting');//守时校验执行状态
|
|
|
|
|
|
const channelsTestStatus = ref('waiting');//通道系数校准执行状态
|
|
|
|
|
|
const TestStatus = ref('waiting');//正式检测执行状态
|
|
|
|
|
|
|
|
|
|
|
|
watch(preTestStatus,function(newValue,oldValue){
|
|
|
|
|
|
console.log(newValue,oldValue);
|
|
|
|
|
|
|
|
|
|
|
|
ActiveStatue.value = newValue
|
|
|
|
|
|
})
|
|
|
|
|
|
watch(timeTestStatus,function(newValue,oldValue){
|
|
|
|
|
|
console.log(newValue,oldValue);
|
|
|
|
|
|
|
|
|
|
|
|
ActiveStatue.value = newValue
|
|
|
|
|
|
})
|
|
|
|
|
|
watch(channelsTestStatus,function(newValue,oldValue){
|
|
|
|
|
|
console.log(newValue,oldValue);
|
|
|
|
|
|
|
|
|
|
|
|
ActiveStatue.value = newValue
|
|
|
|
|
|
})
|
|
|
|
|
|
watch(TestStatus,function(newValue,oldValue){
|
|
|
|
|
|
console.log(newValue,oldValue);
|
|
|
|
|
|
|
|
|
|
|
|
ActiveStatue.value = newValue
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
watch(ActiveStatue,function(newValue,oldValue){
|
|
|
|
|
|
|
|
|
|
|
|
if(newValue === 'success' || newValue === 'error')
|
|
|
|
|
|
skipDisabled.value = false
|
|
|
|
|
|
|
|
|
|
|
|
if(newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2)
|
|
|
|
|
|
{
|
|
|
|
|
|
stepsActiveIndex.value++;
|
|
|
|
|
|
stepsActiveIndex.value++;
|
|
|
|
|
|
nextStepText.value = '检测完成'
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-11-25 21:11:10 +08:00
|
|
|
|
const getIcon = (index: number) => {
|
|
|
|
|
|
if (stepsActiveIndex.value > index) return SuccessFilled;
|
|
|
|
|
|
switch (index) {
|
|
|
|
|
|
case 0: return h(<svg-icon name="preTest"></svg-icon>);
|
|
|
|
|
|
case 1: return UploadFilled;
|
|
|
|
|
|
case 2: return Odometer;
|
|
|
|
|
|
case 3: return Coin;
|
|
|
|
|
|
case 4: return Key;
|
|
|
|
|
|
default: return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2024-11-21 23:02:43 +08:00
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const nextStep = () => {
|
|
|
|
|
|
if(stepsActiveIndex.value < stepsTotalNum.value )
|
|
|
|
|
|
{
|
2024-11-21 23:02:43 +08:00
|
|
|
|
stepsActiveIndex.value++
|
|
|
|
|
|
ActiveStatue.value = 'waiting'
|
2024-11-18 22:04:59 +08:00
|
|
|
|
}
|
2024-11-21 23:02:43 +08:00
|
|
|
|
else if(stepsActiveIndex.value === stepsTotalNum.value)
|
2024-11-18 22:04:59 +08:00
|
|
|
|
{
|
2024-11-21 23:02:43 +08:00
|
|
|
|
emit('update:visible', false); // 关闭对话框
|
|
|
|
|
|
clearData()
|
|
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function clearData(){
|
|
|
|
|
|
stepsActiveIndex.value = 0;
|
|
|
|
|
|
preTestStatus.value = "waiting"
|
|
|
|
|
|
timeTestStatus.value = "waiting"
|
|
|
|
|
|
channelsTestStatus.value = "waiting"
|
|
|
|
|
|
TestStatus.value = "waiting"
|
|
|
|
|
|
nextStepText.value = "下一步"
|
|
|
|
|
|
}
|
2024-11-29 13:45:48 +08:00
|
|
|
|
const beforeClose = (done: () => void) => {
|
|
|
|
|
|
console.log(stepsActiveIndex.value,stepsTotalNum.value)
|
|
|
|
|
|
if(stepsActiveIndex.value < stepsTotalNum.value)
|
|
|
|
|
|
{
|
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
|
'检测未完成,是否退出当前检测流程?',
|
|
|
|
|
|
'提示',
|
|
|
|
|
|
{
|
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
type: 'warning',
|
|
|
|
|
|
}
|
|
|
|
|
|
)
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
clearData()
|
|
|
|
|
|
emit('update:visible', false); // 关闭对话框
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
clearData()
|
|
|
|
|
|
emit('update:visible', false); // 关闭对话框
|
|
|
|
|
|
}
|
|
|
|
|
|
// ElMessageBox.confirm('Are you sure to close this dialog?')
|
|
|
|
|
|
// .then(() => {
|
|
|
|
|
|
// done()
|
|
|
|
|
|
// })
|
|
|
|
|
|
// .catch(() => {
|
|
|
|
|
|
// // catch error
|
|
|
|
|
|
// })
|
|
|
|
|
|
}
|
2024-11-18 22:04:59 +08:00
|
|
|
|
const handleCancel = () => {
|
2024-11-29 13:45:48 +08:00
|
|
|
|
// clearData()
|
|
|
|
|
|
// emit('update:visible', false); // 关闭对话框
|
2024-11-18 22:04:59 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSubmit = () => {
|
2024-11-21 23:02:43 +08:00
|
|
|
|
skipDisabled.value = true
|
2024-11-18 22:04:59 +08:00
|
|
|
|
switch (stepsActiveIndex.value) {
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
preTestStatus.value = 'start'
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
timeTestStatus.value = 'start'
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
channelsTestStatus.value = 'start'
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
TestStatus.value = 'start'
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 当 props.visible 改变时,更新 formData
|
|
|
|
|
|
watch(() => props.visible, (newVal) => {
|
|
|
|
|
|
if (!newVal) {
|
|
|
|
|
|
// 这里可以重置表单数据,如果需要的话
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//选中
|
|
|
|
|
|
// 处理选择变化
|
|
|
|
|
|
const handleSelectionChange = (selection: any[]) => {
|
|
|
|
|
|
multipleSelection.value = selection.map(row => row.id); // 更新选中的行
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
const openAddDialog = () => {
|
|
|
|
|
|
tableData.value.push({
|
|
|
|
|
|
id: tableData.value.length + 1,
|
|
|
|
|
|
type: '',
|
|
|
|
|
|
startSelect: '',
|
|
|
|
|
|
startRange: '',
|
|
|
|
|
|
endSelect: '',
|
|
|
|
|
|
endRange: '',
|
|
|
|
|
|
unit:'',
|
|
|
|
|
|
maxErrorValue:'',
|
|
|
|
|
|
errorType:''
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
<style scoped lang="scss">
|
2024-11-20 21:30:05 +08:00
|
|
|
|
|
2024-11-22 10:46:10 +08:00
|
|
|
|
:deep(.dialog-big .el-dialog__body){
|
|
|
|
|
|
max-height: 840px !important;
|
|
|
|
|
|
}
|
|
|
|
|
|
// :deep(.dialog-big){
|
|
|
|
|
|
// max-height: 840px !important;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// :deep(.el-dialog__body){
|
|
|
|
|
|
// max-height: 840px !important;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
.steps-container :deep(.test-head-steps){
|
|
|
|
|
|
height: 80px;
|
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
|
}
|
2024-11-20 11:22:05 +08:00
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
.steps-container :deep(.el-step__title) {
|
|
|
|
|
|
font-size: 20px !important; /* 设置标题字体大小 */
|
2024-11-25 21:11:10 +08:00
|
|
|
|
vertical-align:baseline !important;
|
|
|
|
|
|
display: inline-block; /* 确保文字和图标在同一行 */
|
|
|
|
|
|
line-height: 1; /* 调整行高以确保底部对齐 */
|
2024-11-18 22:04:59 +08:00
|
|
|
|
}
|
2024-11-21 23:02:43 +08:00
|
|
|
|
|
|
|
|
|
|
.steps-container :deep(.el-step__icon-inner) {
|
2024-11-25 21:11:10 +08:00
|
|
|
|
font-size: 18px !important;
|
|
|
|
|
|
vertical-align:baseline !important;
|
|
|
|
|
|
display: inline-block; /* 确保文字和图标在同一行 */
|
|
|
|
|
|
line-height: 1; /* 调整行高以确保底部对齐 */
|
2024-11-21 23:02:43 +08:00
|
|
|
|
}
|
2024-11-18 22:04:59 +08:00
|
|
|
|
|
2024-11-25 21:11:10 +08:00
|
|
|
|
.steps-container :deep(.el-step__icon) {
|
|
|
|
|
|
font-size: 18px !important;
|
|
|
|
|
|
vertical-align:baseline !important;
|
|
|
|
|
|
display: inline-block; /* 确保文字和图标在同一行 */
|
|
|
|
|
|
line-height: 1; /* 调整行高以确保底部对齐 */
|
|
|
|
|
|
}
|
2024-11-18 22:04:59 +08:00
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
// :deep(.test-head-steps){
|
|
|
|
|
|
// height: 100px;
|
|
|
|
|
|
// margin-bottom: 20px;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// .el-step__icon.is-text {
|
|
|
|
|
|
// border-radius: 50%;
|
|
|
|
|
|
// border: 4px solid;
|
|
|
|
|
|
// width: 50px;
|
|
|
|
|
|
// height: 50px;
|
|
|
|
|
|
// border-color: inherit;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// .el-step__icon.is-icon {
|
|
|
|
|
|
// border-radius: 50%;
|
|
|
|
|
|
// border: 4px solid;
|
|
|
|
|
|
// width: 50px;
|
|
|
|
|
|
// height: 50px;
|
|
|
|
|
|
// border-color: inherit;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// .test-head-steps .el-step__line{
|
|
|
|
|
|
// height:50px !important;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// .test-head-steps .el-step__icon-inner{
|
|
|
|
|
|
// width: 40px !important;
|
|
|
|
|
|
// height:40px !important;
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// .test-head-steps .el-step__icon{
|
|
|
|
|
|
// width: 48px !important;
|
|
|
|
|
|
// height:48px !important;
|
|
|
|
|
|
// font-size: 48px !important; /* 调整图标大小 */
|
|
|
|
|
|
// line-height: 80px !important; /* 使图标居中 */
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// :deep(.el-step__title) {
|
|
|
|
|
|
// font-size: 24px !important; /* 设置标题字体大小 */
|
|
|
|
|
|
// margin-top: 10px !important; /* 调整标题与图标的间距 */
|
|
|
|
|
|
// }
|
2024-11-20 11:22:05 +08:00
|
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
|
// :deep(.el-step__icon-inner) {
|
|
|
|
|
|
// font-size: 24px !important;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// .test-head-steps .el-step__description {
|
|
|
|
|
|
// font-size: 20px !important; /* 设置描述字体大小 */
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
2024-11-18 22:04:59 +08:00
|
|
|
|
</style>
|