样式调整

This commit is contained in:
sjl
2024-12-18 15:49:29 +08:00
parent 53ead0e62f
commit 4cfca89895
9 changed files with 280 additions and 156 deletions

View File

@@ -1,5 +1,5 @@
<template>
<el-dialog :title="dialogTitle" :model-value="visible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
<el-dialog :title="dialogTitle" :model-value="dialogVisible" :before-close="beforeClose" @close="handleCancel" width="1200px" height="1000px" draggable>
<div class="steps-container">
<!-- simple -->
@@ -8,16 +8,16 @@
<!-- style="height:100px" -->
<!-- <el-step title="预检测" :icon="getIcon(0)" /> -->
<el-step title="预检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :Edit" />
<el-step title="守时检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :UploadFilled"/>
<el-step title="系数校准" :icon="stepsActiveIndex > 2 ? SuccessFilled :Odometer" />
<el-step title="守时检测" :icon="stepsActiveIndex > 1 ? SuccessFilled :UploadFilled" v-if="isTimeCheck"/>
<!-- <el-step title="系数校准" :icon="stepsActiveIndex > 2 ? SuccessFilled :Odometer" /> -->
<el-step title="正式检测" :icon="stepsActiveIndex > 3 ? SuccessFilled :Coin" />
<el-step title="检测完成" :icon="stepsActiveIndex > 4 ? SuccessFilled :Key" />
</el-steps>
</div>
<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>
<test v-if="stepsActiveIndex >= 3" v-model:testStatus="TestStatus"></test>
<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"></test>
<template #footer>
<div>
@@ -36,7 +36,7 @@
<script lang="tsx" setup name="testPopup">
import { h } from 'vue';
import{ElMessage, ElSelectV2, FormInstance,FormItemRule}from'element-plus'
import{ElMessage, ElMessageBox, 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"; // 导入子组件
@@ -53,28 +53,29 @@
// <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
// </svg>
// `;
const props = defineProps<{
visible: boolean;
dialogTitle: string;
// 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-正常
};
}>();
// 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;
}>();
// const emit = defineEmits<{
// (e: 'update:visible', value: boolean): void;
// (e: 'submit', data: any): void;
// }>();
const skipDisabled = ref(false);
const nextStepText = ref('下一步');
const dialogVisible = ref(false)
//定义与预检测配置数组
const detectionOptions = ref([
{
@@ -117,13 +118,22 @@ const detectionOptions = ref([
// },
]);
const stepsTotalNum = ref(5);//步骤总数
const stepsTotalNum = ref(4);//步骤总数
const stepsActiveIndex = ref(0); //当前正在执行的步骤索引
const ActiveStatue = ref('waiting');//当前步骤状态
const preTestStatus = ref('waiting');//预检测执行状态
const timeTestStatus = ref('waiting');//守时校验执行状态
const channelsTestStatus = ref('waiting');//通道系数校准执行状态
const TestStatus = ref('waiting');//正式检测执行状态
const dialogTitle = ref('');
const isTimeCheck = ref(false)
// 打开弹窗,可能是新增,也可能是编辑
const open = (title: string,time:boolean) => {
dialogTitle.value = title;
dialogVisible.value = true;
isTimeCheck.value = time
}
watch(preTestStatus,function(newValue,oldValue){
console.log(newValue,oldValue);
@@ -148,9 +158,10 @@ const detectionOptions = ref([
watch(ActiveStatue,function(newValue,oldValue){
if(newValue === 'success' || newValue === 'error')
skipDisabled.value = false
if(newValue === 'success' || newValue === 'error'){
skipDisabled.value = false
}
if(newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value - 2)
{
stepsActiveIndex.value++;
@@ -175,13 +186,17 @@ const getIcon = (index: number) => {
if(stepsActiveIndex.value < stepsTotalNum.value )
{
stepsActiveIndex.value++
if(!isTimeCheck.value){//不具备守时检测,预检测后直接跳正式检测
stepsActiveIndex.value++
}
ActiveStatue.value = 'waiting'
}
else if(stepsActiveIndex.value === stepsTotalNum.value)
{
emit('update:visible', false); // 关闭对话框
//emit('update:visible', false); // 关闭对话框
clearData()
dialogVisible.value = false;
}
};
@@ -208,14 +223,15 @@ const getIcon = (index: number) => {
)
.then(() => {
clearData()
emit('update:visible', false); // 关闭对话框
//emit('update:visible', false); // 关闭对话框
dialogVisible.value = false;
})
}
else
{
clearData()
emit('update:visible', false); // 关闭对话框
//emit('update:visible', false); // 关闭对话框
dialogVisible.value = false;
}
// ElMessageBox.confirm('Are you sure to close this dialog?')
// .then(() => {
@@ -228,6 +244,7 @@ const getIcon = (index: number) => {
const handleCancel = () => {
// clearData()
// emit('update:visible', false); // 关闭对话框
};
const handleSubmit = () => {
@@ -239,10 +256,10 @@ const getIcon = (index: number) => {
case 1:
timeTestStatus.value = 'start'
break;
// case 2:
// channelsTestStatus.value = 'start'
// break;
case 2:
channelsTestStatus.value = 'start'
break;
case 3:
TestStatus.value = 'start'
break;
default:
@@ -252,38 +269,16 @@ const getIcon = (index: number) => {
};
// 当 props.visible 改变时,更新 formData
watch(() => props.visible, (newVal) => {
if (!newVal) {
// 这里可以重置表单数据,如果需要的话
// // 当 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:''
});
};
// }
// });
// 对外映射
defineExpose({ open })
</script>
<style scoped lang="scss">