日志显示内容微调

This commit is contained in:
GYYM
2024-12-11 19:12:04 +08:00
parent 47883ce426
commit 726f7841e8

View File

@@ -11,8 +11,8 @@
<!-- v-if="!isPause && activeIndex < activeTotalNum" -->
<el-button
type="primary"
:disabled="activeIndex===0 && activeIndex >= activeTotalNum"
v-if="!isPause"
:disabled="activeIndex===0 || activeIndex >= activeTotalNum"
:icon="VideoPause"
@click="handlePauseTest"
>暂停检测</el-button
@@ -227,7 +227,7 @@
</el-table-column> -->
</el-table>
</div>
<div style="height: 98px;">
<div style="height: 80px;">
<el-collapse model-value="1" accordion>
<el-collapse-item title="检测项进度" name="1">
<div ref="scrollContainer" class="dialog-log">
@@ -628,7 +628,6 @@ const updateLog = () => {
})
break;
}
scrollToBottom();
}
const testLogList = ref([
@@ -732,10 +731,27 @@ const handleReCheck = () => {
};
let timer: any = ref("");
const handlePauseTest = () => {
const currentTime = ref(new Date().toLocaleString());
if (!isPause.value) {
endData.value = new Date();
const Pausetime = endData.value.getTime() - startData.value.getTime();
timeDifference.value += Pausetime
testLogList.value.push({
type: 'info',
log:currentTime.value + ':暂停检测',
})
pauseTimer()
} else {
startData.value = new Date();
testLogList.value.push({
type: 'info',
log:currentTime.value + ':继续检测',
})
resumeTimer()
}
isPause.value = !isPause.value;
@@ -2205,19 +2221,28 @@ watch(ts, function (newValue, oldValue) {
margin-right:10px;
margin-bottom:10px;
}
.dialog-content{
max-height: 450px;
overflow-y: auto;
}
:deep(.el-collapse-item__header){
height: 30px;
}
.dialog-log{
max-height: 50px;
height: 50px;
overflow-y: auto;
// flex-grow: 1;
// display: flex;
// flex-direction: column-reverse;
}
p {
margin: 5px 0;
font-size: 14px;
}
}
</style>
<style lang="scss" scoped>