优化bug

This commit is contained in:
24kycj
2024-11-30 17:29:57 +08:00
parent c2dc433d87
commit ba2579642d
5 changed files with 61 additions and 102 deletions
+16 -54
View File
@@ -174,7 +174,7 @@
<div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[0].copy_scheduler + '%' }"></div>
</div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[0].use_size) }}{{ $filterSize(cd_list[0].total_size) }}<span v-if="cd_list[0].burn_speed">速度{{ cd_list[0].burn_speed }}X</span></div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[0].use_size) }}{{ $filterSize(cd_list[0].total_size) }}<span v-if="cd_list[0].burn_speed">速度{{ cd_list[0].burn_speed.toFixed(2) }}X</span></div>
</template>
<div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[0].cd_status] }}</div>
<div class="device_right_top_text">任务{{ cd_list[0].cd_taskid && cd_list[0].copy_scheduler ? cd_list[0].cd_taskid : '' }}</div>
@@ -195,7 +195,7 @@
<div class="flex_box device_right_top_progress">
<div class="device_right_top_progress_box" :style="{ 'width': cd_list[1].copy_scheduler + '%' }"></div>
</div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[1].use_size) }}{{ $filterSize(cd_list[1].total_size) }}<span v-if="cd_list[1].burn_speed">速度{{ cd_list[1].burn_speed }}X</span></div>
<div class="device_right_top_text">已刻录{{ $filterSize(cd_list[1].use_size) }}{{ $filterSize(cd_list[1].total_size) }}<span v-if="cd_list[1].burn_speed">速度{{ cd_list[1].burn_speed.toFixed(2) }}X</span></div>
</template>
<div class="device_right_top_text">状态{{ $store.state.chat.CDStatus[cd_list[1].cd_status] }}</div>
<div class="device_right_top_text">任务{{ cd_list[1].cd_taskid && cd_list[1].copy_scheduler ? cd_list[1].cd_taskid : '' }}</div>
@@ -242,57 +242,14 @@
<div class="flex_box work_top">
<div class="work_top_text">作业列表</div>
</div>
<el-table default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table class="child_table" :show-header="false" :data="scope.row.ass_task">
<el-table-column width="48" label=""></el-table-column>
<el-table-column type="index" width="80" label="序号">
<template slot-scope="child">
<div>{{ scope.$index + 1 }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column prop="task_uuid" label="作业ID">
<template slot-scope="child">
<div>{{ scope.row.task_uuid }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column prop="task_name" label="子任务名称">
<template slot-scope="child">
<div>{{ scope.row.task_name }}_{{ child.$index + 1 }}</div>
</template>
</el-table-column>
<el-table-column label="类型">
<template slot-scope="child">
<div>{{ CDTypes[child.row.cd_type] }}</div>
</template>
</el-table-column>
<el-table-column prop="task_size" label="大小">
<template slot-scope="child">
<div>{{ $filterSize(child.row.task_size) }}</div>
</template>
</el-table-column>
<el-table-column prop="start_time" label="开始时间"></el-table-column>
<el-table-column prop="finish_time" label="结束时间"></el-table-column>
<el-table-column label="完成"></el-table-column>
<el-table-column prop="task_status" label="状态">
<template slot-scope="child">
<div class="flex_box work_status_box">
<div>{{ statusList[child.row.task_status] }}</div>
<!-- <i class="el-icon-caret-bottom"></i> -->
</div>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column type="index" width="80" label="序号"></el-table-column>
<el-table row-key="task_uuid" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{children: 'ass_task', hasChildren: 'hasChildren'}">
<!-- <el-table-column type="index" width="80" label="序号"></el-table-column> -->
<el-table-column prop="task_uuid" label="作业ID"></el-table-column>
<el-table-column prop="task_name" label="任务名称"></el-table-column>
<!-- <el-table-column prop="DataSource" label="来源"></el-table-column> -->
<el-table-column label="类型">
<template slot-scope="scope">
<div>{{ CDTypes[scope.row.ass_task[0].cd_type] }}</div>
<div>{{ scope.row.ass_task&&scope.row.ass_task[0]&&CDTypes[scope.row.ass_task[0].cd_type] }}</div>
</template>
</el-table-column>
<el-table-column prop="task_size" label="大小">
@@ -435,13 +392,18 @@ export default {
'$store.state.chat.task_list': {
handler(val) {
if (val && val.length) {
let tasks = [...val]
let list = []
val.forEach((item) => {
let task_size = 0
item.ass_task.forEach((item2) => {
task_size = this.$accAdd(task_size, item2.task_size)
})
item.task_size = task_size
tasks.forEach((item, index) => {
if (item.ass_task&&item.ass_task.length) {
let task_size = 0
item.ass_task.forEach((item2, idx) => {
item2.task_uuid = item.task_uuid+'_'+(idx+1)
item2.task_name = item.task_name+'_'+(idx+1)
task_size = this.$accAdd(task_size, item2.task_size)
})
item.task_size = task_size
}
list.push(item)
})
this.task_list = list