首页、守时检测页样式调整
This commit is contained in:
@@ -324,6 +324,41 @@ const scrollToBottom = () => {
|
||||
function getRandomInt(max: number): number {
|
||||
return Math.floor(Math.random() * max);
|
||||
}
|
||||
|
||||
//判断该检测项(例如 频率准确度检测)是否全部合格(所有设备所有通道所有子检测项目全部合格为合格,否则为不合格)
|
||||
function getItemCheckResult(index:number):boolean{
|
||||
|
||||
let items = columnList?.value.filter((item) => item === index.toString())
|
||||
|
||||
if(items.length > 0)
|
||||
{
|
||||
return false
|
||||
}
|
||||
else
|
||||
return true
|
||||
}
|
||||
//测试项开始检测时间(或继续检测时间)
|
||||
const startData = ref(new Date())
|
||||
//测试项检测结束时间(或暂停时的时间)
|
||||
const endData= ref(new Date())
|
||||
|
||||
let timeDifference = ref(0)
|
||||
|
||||
function getTimeDifference(timeDifference:number): string {
|
||||
// 将时间差转换为天、小时、分钟、秒
|
||||
const millisecondsPerDay = 1000 * 60 * 60 * 24;
|
||||
const millisecondsPerHour = 1000 * 60 * 60;
|
||||
const millisecondsPerMinute = 1000 * 60;
|
||||
const millisecondsPerSecond = 1000;
|
||||
|
||||
const days = Math.floor(timeDifference / millisecondsPerDay);
|
||||
const hours = Math.floor((timeDifference % millisecondsPerDay) / millisecondsPerHour);
|
||||
const minutes = Math.floor((timeDifference % millisecondsPerHour) / millisecondsPerMinute);
|
||||
const seconds = Math.floor((timeDifference % millisecondsPerMinute) / millisecondsPerSecond);
|
||||
|
||||
return `时间差: ${days} 天, ${hours} 小时, ${minutes} 分钟, ${seconds} 秒`
|
||||
}
|
||||
|
||||
const updateLog = () => {
|
||||
const currentTime = ref(new Date().toLocaleString());
|
||||
|
||||
@@ -335,14 +370,23 @@ const updateLog = () => {
|
||||
type: 'info',
|
||||
log: currentTime.value + ':频率准确度检测开始',
|
||||
})
|
||||
|
||||
break;
|
||||
case 2:
|
||||
|
||||
testLogList.value.push({
|
||||
if(getItemCheckResult(activeIndex.value - 1))
|
||||
{
|
||||
testLogList.value.push({
|
||||
type: 'info',
|
||||
log:currentTime.value + ':频率准确度检测完成',
|
||||
log:currentTime.value + ':频率准确度检测合格',
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
testLogList.value.push({
|
||||
type: 'error',
|
||||
log:currentTime.value + ':频率准确度检测不合格',
|
||||
})
|
||||
}
|
||||
|
||||
testLogList.value.push({
|
||||
type: 'info',
|
||||
log:currentTime.value + ':电压准确度检测开始',
|
||||
|
||||
Reference in New Issue
Block a user