2024-11-18 22:04:59 +08:00
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class = "test-dialog">
|
|
|
|
|
<div class="dialog-left">
|
2024-12-03 17:13:47 +08:00
|
|
|
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus" finish-status="success">
|
2024-12-05 11:21:10 +08:00
|
|
|
<el-step title="开始检测" :description="startTime"/>
|
|
|
|
|
<el-step title="GPS完成上送" :description="gpsTime"/>
|
|
|
|
|
<el-step title="设备开始上送时刻" :description="devStartTime"/>
|
|
|
|
|
<el-step title="设备最晚上送时刻" :description="devEndTime"/>
|
|
|
|
|
<el-step title="检测完成" :description="finishTime"/>
|
2024-12-03 17:13:47 +08:00
|
|
|
</el-steps>
|
|
|
|
|
<!-- <el-timeline style="max-width: 600px">
|
2024-11-21 23:02:43 +08:00
|
|
|
<el-timeline-item
|
|
|
|
|
v-for="(activity, index) in activities"
|
|
|
|
|
:key="index"
|
|
|
|
|
:icon="activity.icon"
|
|
|
|
|
:type="activity.type"
|
|
|
|
|
:color="activity.color"
|
|
|
|
|
:size="activity.size"
|
|
|
|
|
:hollow="activity.hollow"
|
|
|
|
|
:timestamp="activity.timestamp"
|
|
|
|
|
>
|
|
|
|
|
{{ activity.content }}
|
|
|
|
|
</el-timeline-item>
|
2024-12-03 17:13:47 +08:00
|
|
|
</el-timeline> -->
|
2024-11-18 22:04:59 +08:00
|
|
|
</div>
|
|
|
|
|
<div class="dialog-right">
|
|
|
|
|
<div class="right-title">
|
2024-11-21 23:02:43 +08:00
|
|
|
<!-- <div>设备上送时刻表</div> -->
|
2024-11-18 22:04:59 +08:00
|
|
|
<div>
|
2024-11-21 23:02:43 +08:00
|
|
|
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
|
|
|
|
|
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button>
|
2024-11-18 22:04:59 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right-content">
|
2024-11-21 23:02:43 +08:00
|
|
|
<el-table :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
2024-11-18 22:04:59 +08:00
|
|
|
<el-table-column prop="deviceName" label="设备名" />
|
|
|
|
|
<el-table-column prop="updataTime" label="上送时刻" />
|
|
|
|
|
<el-table-column prop="ErrorValue" label="守时误差(ms)" />
|
2024-11-21 23:02:43 +08:00
|
|
|
<el-table-column prop="Result" label="检测结果">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag :type="scope.row.Result === '合格' ? 'success' : 'danger'">{{ scope.row.Result }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-18 22:04:59 +08:00
|
|
|
</el-table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="tsx" setup name="timeTest">
|
|
|
|
|
import { SuccessFilled } from '@element-plus/icons-vue'
|
|
|
|
|
|
|
|
|
|
const activeIndex = ref(0)
|
|
|
|
|
const activeTotalNum = ref(5)
|
2024-12-05 11:21:10 +08:00
|
|
|
const startTime = ref('')
|
|
|
|
|
const gpsTime = ref('')
|
|
|
|
|
const devStartTime = ref('')
|
|
|
|
|
const devEndTime = ref('')
|
|
|
|
|
const finishTime = ref('')
|
2024-11-18 22:04:59 +08:00
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
interface Activity {
|
|
|
|
|
content: string;
|
|
|
|
|
hollow?: boolean;
|
|
|
|
|
timestamp?: string;
|
|
|
|
|
size?: string;
|
|
|
|
|
color?: string;
|
|
|
|
|
icon?: any;
|
|
|
|
|
}
|
|
|
|
|
const activities = ref<Activity[]>([
|
2024-11-18 22:04:59 +08:00
|
|
|
{
|
|
|
|
|
content: '开始检测',
|
|
|
|
|
hollow: true,
|
2024-11-21 23:02:43 +08:00
|
|
|
},])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const deviceOperatorData = ref([
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备1',
|
|
|
|
|
updataTime: '—',
|
|
|
|
|
ErrorValue:'—',
|
|
|
|
|
Result: '—',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备2',
|
|
|
|
|
updataTime: '—',
|
|
|
|
|
ErrorValue:'—',
|
|
|
|
|
Result: '—',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备3',
|
|
|
|
|
updataTime: '—',
|
|
|
|
|
ErrorValue:'—',
|
|
|
|
|
Result: '—',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备4',
|
|
|
|
|
updataTime: '—',
|
|
|
|
|
ErrorValue:'—',
|
|
|
|
|
Result: '—',
|
|
|
|
|
},
|
|
|
|
|
])
|
2024-11-18 22:04:59 +08:00
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
const deviceData = ref([
|
2024-11-18 22:04:59 +08:00
|
|
|
{
|
|
|
|
|
deviceName: '被检设备1',
|
|
|
|
|
updataTime: '10:30:08.136',
|
|
|
|
|
ErrorValue:'148',
|
|
|
|
|
Result: '合格',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备2',
|
|
|
|
|
updataTime: '10:30:08.136',
|
|
|
|
|
ErrorValue:'136',
|
|
|
|
|
Result: '合格',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备3',
|
|
|
|
|
updataTime: '10:30:09.006',
|
|
|
|
|
ErrorValue:'1006',
|
|
|
|
|
Result: '不合格',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deviceName: '被检设备4',
|
|
|
|
|
updataTime: '10:30:08.736',
|
|
|
|
|
ErrorValue:'736',
|
|
|
|
|
Result: '合格',
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process'>('finish');
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
testStatus: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: 'wait'
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const testStatus = toRef(props, 'testStatus');
|
|
|
|
|
const ts = ref('');
|
2024-11-21 23:02:43 +08:00
|
|
|
//监听testStatus的变化
|
2024-11-18 22:04:59 +08:00
|
|
|
watch(testStatus, function (newValue, oldValue) {
|
|
|
|
|
ts.value = props.testStatus;
|
|
|
|
|
if(ts.value==='start')
|
|
|
|
|
{
|
|
|
|
|
ts.value = 'process'
|
|
|
|
|
|
|
|
|
|
let timer = setInterval(() => {
|
|
|
|
|
if(activeIndex.value < activeTotalNum.value - 2)
|
|
|
|
|
activeIndex.value++
|
|
|
|
|
else if(activeIndex.value === activeTotalNum.value -2)
|
|
|
|
|
{
|
|
|
|
|
activeIndex.value++
|
|
|
|
|
activeIndex.value++
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
clearInterval(timer)
|
|
|
|
|
ts.value = 'success'
|
|
|
|
|
}
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-11-21 23:02:43 +08:00
|
|
|
watch(activeIndex, function (newValue, oldValue) {
|
|
|
|
|
|
|
|
|
|
if(activeIndex.value === 1)
|
|
|
|
|
{
|
|
|
|
|
activities.value.length = 0;
|
|
|
|
|
activities.value.push({
|
|
|
|
|
content: '开始检测',
|
|
|
|
|
timestamp: '2018-04-12 20:46',
|
|
|
|
|
size: 'large',
|
|
|
|
|
color: '#0bbd87',
|
|
|
|
|
icon: SuccessFilled,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(activeIndex.value === 2)
|
|
|
|
|
{
|
|
|
|
|
activities.value.push({
|
|
|
|
|
content: 'GPS上送时刻',
|
|
|
|
|
timestamp: '2018-04-03 20:46',
|
|
|
|
|
color: '#0bbd87',
|
|
|
|
|
icon: SuccessFilled,
|
|
|
|
|
size: 'large',
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if(activeIndex.value === 3)
|
|
|
|
|
{
|
|
|
|
|
activities.value.push({
|
|
|
|
|
content: '设备最早上送时刻',
|
|
|
|
|
timestamp: '2018-04-03 20:46',
|
|
|
|
|
color: '#0bbd87',
|
|
|
|
|
icon: SuccessFilled,
|
|
|
|
|
size: 'large',
|
|
|
|
|
});
|
2024-11-18 22:04:59 +08:00
|
|
|
|
2024-11-21 23:02:43 +08:00
|
|
|
deviceOperatorData.value.length = 0;
|
|
|
|
|
deviceOperatorData.value = deviceData.value;
|
|
|
|
|
}
|
|
|
|
|
if(activeIndex.value > 3)
|
|
|
|
|
{
|
|
|
|
|
activities.value.push({
|
|
|
|
|
content: '设备最晚上送时刻',
|
|
|
|
|
timestamp: '2018-04-03 20:46',
|
|
|
|
|
color: '#0bbd87',
|
|
|
|
|
icon: SuccessFilled,
|
|
|
|
|
size: 'large',
|
|
|
|
|
});
|
|
|
|
|
activities.value.push({
|
|
|
|
|
content: '检测结束',
|
|
|
|
|
timestamp: '2018-04-03 20:46',
|
|
|
|
|
color: '#0bbd87',
|
|
|
|
|
icon: SuccessFilled,
|
|
|
|
|
size: 'large',
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-11-18 22:04:59 +08:00
|
|
|
const emit = defineEmits(['update:testStatus']);
|
|
|
|
|
//监听sn
|
|
|
|
|
watch(ts, function (newValue, oldValue) {
|
|
|
|
|
//修改父组件
|
|
|
|
|
emit('update:testStatus',ts.value)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
|
|
.test-dialog{
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
flex-direction: row; /* 横向排列 */
|
2024-12-05 11:07:54 +08:00
|
|
|
/* margin-top: 20px; */
|
|
|
|
|
/* min-height: 300px; */
|
|
|
|
|
height: 472px;
|
2024-11-18 22:04:59 +08:00
|
|
|
/* .dialog-left{
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
} */
|
|
|
|
|
}
|
|
|
|
|
.dialog-left{
|
|
|
|
|
margin-left: 20px;
|
2024-11-21 23:02:43 +08:00
|
|
|
width: 20%;
|
2024-11-18 22:04:59 +08:00
|
|
|
}
|
|
|
|
|
.dialog-right{
|
2024-11-21 23:02:43 +08:00
|
|
|
margin-top: 25px;
|
2024-11-18 22:04:59 +08:00
|
|
|
margin-left: 20px;
|
2024-11-21 23:02:43 +08:00
|
|
|
width: 80%;
|
2024-11-18 22:04:59 +08:00
|
|
|
}
|
|
|
|
|
.right-title{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row; /* 横向排列 */
|
2024-11-21 23:02:43 +08:00
|
|
|
justify-content: flex-end;
|
2024-11-18 22:04:59 +08:00
|
|
|
margin-bottom: 10px;
|
|
|
|
|
}
|
|
|
|
|
/* width: 100%;
|
|
|
|
|
height: auto;
|
|
|
|
|
background: #fff;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
display: flex;
|
|
|
|
|
// justify-content: space-around;
|
|
|
|
|
// justify-content: space-evenly;
|
|
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
padding: 10px 20px 10px 20px;
|
|
|
|
|
box-sizing: border-box; */
|
|
|
|
|
</style>
|