优化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
+4 -7
View File
@@ -32,14 +32,15 @@ export default {
}
if (val.confirm) {
this.$confirm(val.confirm, '温馨提示', {
confirmButtonText: '确定',
confirmButtonText: '重试',
closeOnClickModal: false,
closeOnPressEscape: false,
showClose: false,
showCancelButton: false,
type: 'warning'
}).then(() => {
if (val.req && val.req === 'continue_task') {
// 下一个任务
this.$store.dispatch('websocketsend', {
this.$store.dispatch('chat/websocketsend', {
req_name: 'continue_task',
req_type: 1,
req_info: {}
@@ -52,10 +53,6 @@ export default {
}).catch(() => {
});
this.$messageBox({
message: val.messageBox,
type: val.type,
})
}
},
deep: true,
@@ -3,11 +3,11 @@
<div class="btn-group" v-show="false">
<div class="btn" @click="addFolder()" style="color: #67c23a">
<i class="el-icon-folder" />
{{ $t("file.addFolder") }}
添加文件夹
</div>
<div class="btn" @click="addFile()" style="color: #67c23a">
<i class="el-icon-files" />
{{ $t("file.addFile") }}
添加文件
</div>
</div>
<fileEmpty v-if="allNumber == 0" />
@@ -142,7 +142,7 @@ export default {
const _this = this;
dialog
.showOpenDialog({
properties: ["multiSelections"],
properties: ["openFile", "multiSelections"],
})
.then(async (res) => {
for (const item of res.filePaths) {
+1 -2
View File
@@ -539,7 +539,6 @@ export default {
task.task_size += fileList[i].size
if (i === fileList.length - 1) that.form.ass_task.push(task)
}
console.log(that.form.ass_task)
} else {
let task = {
ass_task_index: 1,
@@ -559,7 +558,7 @@ export default {
item.val = that.$refs[item.origin_name][0].files[0].path
}
if (!item.val) {
item.val = item.default
item.val = item.default || ''
}
})
let csv1 = that.soonList.map(item => item.origin_name).join(',')
+37 -36
View File
@@ -12,38 +12,38 @@ const PrinterStatus = {
// 打印机报错
const printer_errors = {
'0x00011': '从盘仓到光驱时,光盘仓为空',
'0x00012': '从盘仓到光驱时,抓取光盘错误',
'0x00013': '从盘仓到光驱时,其他错误',
'0x00014': '从盘仓到打印托盘时,光盘仓为空',
'0x00015': '从盘仓到打印托盘时,抓取光盘错误',
'0x00016': '从盘仓到打印托盘时,其他错误',
'0x00017': '从光驱到打印托盘时,光盘仓为空',
'0x00018': '从光驱到打印托盘时,抓取光盘错误',
'0x00019': '从光驱到打印托盘时,其他错误',
'0x0001A': '从打印托盘到弃置位时,光盘仓为空',
'0x0001B': '从打印托盘到弃置位时,抓取光盘错误',
'0x0001C': '从打印托盘到弃置位时,其他错误',
'0x0001D': '从光驱到弃置位时,光盘仓为空',
'0x0001E': '从光驱到弃置位时,抓取光盘错误',
'0x0001F': '从光驱到弃置位时,其他错误',
'0x11': '从盘仓到光驱时,光盘仓为空',
'0x12': '从盘仓到光驱时,抓取光盘错误',
'0x13': '从盘仓到光驱时,其他错误',
'0x14': '从盘仓到打印托盘时,光盘仓为空',
'0x15': '从盘仓到打印托盘时,抓取光盘错误',
'0x16': '从盘仓到打印托盘时,其他错误',
'0x17': '从光驱到打印托盘时,光盘仓为空',
'0x18': '从光驱到打印托盘时,抓取光盘错误',
'0x19': '从光驱到打印托盘时,其他错误',
'0x1a': '从打印托盘到弃置位时,光盘仓为空',
'0x1b': '从打印托盘到弃置位时,抓取光盘错误',
'0x1c': '从打印托盘到弃置位时,其他错误',
'0x1d': '从光驱到弃置位时,光盘仓为空',
'0x1e': '从光驱到弃置位时,抓取光盘错误',
'0x1f': '从光驱到弃置位时,其他错误',
}
// 提交任务报错
const submitErros = {
'0x00001': '读取任务JSON失败',
'0x00003': '新建任务失败',
'0x00004': '新建任务文件夹失败',
'0x00005': '没有任务数量',
'0x00006': '打印参数错误',
'0x00007': '刻录参数错误',
'0x00008': '没有任务',
'0x00009': '模板文件解析失败',
'0x0000A': '打印类型错误',
'0x0000B': 'csv文件读取失败',
'0x0000C': '拷贝路径错误',
'0x0000D': '新建ISO文件失败',
'0x0000E': '更新任务数据失败',
'0x1': '读取任务JSON失败',
'0x3': '新建任务失败',
'0x4': '新建任务文件夹失败',
'0x5': '没有任务数量',
'0x6': '打印参数错误',
'0x7': '刻录参数错误',
'0x8': '没有任务',
'0x9': '模板文件解析失败',
'0xa': '打印类型错误',
'0xb': 'csv文件读取失败',
'0xc': '拷贝路径错误',
'0xd': '新建ISO文件失败',
'0xe': '更新任务数据失败',
}
@@ -145,9 +145,8 @@ const defaultData = {
// 任务列表
task_list: [
// {
// task_uuid: '20204215',
// task_uuid: '202042152',
// task_name: '复制任务',
// task_size: 100000,
// finish_freq: 2,
// total_freq: 10,
// task_status: 2,
@@ -354,7 +353,8 @@ const actions = {
// 提交任务报错处理
} else if (data.resp_name === 'submit_task_res') {
let error = data.resp_info
commit('setData', { name: 'printer_error', data: {type: 'error', notify: '任务' + error.task_uuid + '提交失败:' + submitErros[error.task_res], message: '' } })
let task_res = "0x" + error.task_res.toString(16)
commit('setData', { name: 'printer_error', data: {type: 'error', notify: '任务' + error.task_uuid + '提交失败:' + submitErros[task_res], } })
// 打印报错处理
} else if (data.resp_name === 'printer_error') {
let error = data.resp_info
@@ -364,7 +364,7 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error1[i] } })
commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error1[i], req: 'continue_task' } })
}, 500);
}
}
@@ -374,7 +374,7 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error2[i] } })
commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error2[i], req: 'continue_task' } })
}, 500);
}
}
@@ -384,12 +384,13 @@ const actions = {
for (let i = 0; i < errors.length; i++) {
if (errors[i] == 1) {
setTimeout(() => {
commit('setData', { name: 'printer_error', data: {type: 'error', notify: Error3[i] } })
commit('setData', { name: 'printer_error', data: {type: 'error', confirm: Error3[i], req: 'continue_task' } })
}, 500);
}
}
}
if (error.printer_error) {
error.printer_error = "0x" + error.printer_error.toString(16)
commit('setData', { name: 'printer_error', data: {type: 'error', confirm: printer_errors[error.printer_error], req: 'continue_task' } })
}
}
@@ -413,12 +414,12 @@ const actions = {
websocketsend({ commit, dispatch }, res) {
return new Promise((resolve, reject) => {
if (!state.serviceStatus) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '服务连接中,请耐心等待', notify: '' } })
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '服务连接中,请耐心等待' } })
reject()
return
}
if (!state.isConnect) {
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '请先打开服务', notify: '' } })
commit('setData', { name: 'printer_error', data: {type: 'warning', message: '请先打开服务' } })
reject()
return
}
+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