From ba2579642dfdfe4b25c75771dbd3abce74698031 Mon Sep 17 00:00:00 2001 From: 24kycj <1637269896@qq.com> Date: Sat, 30 Nov 2024 17:29:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/App.vue | 11 +-- .../components/workAdd/files/file.vue | 6 +- src/renderer/components/workAdd/workAdd.vue | 3 +- src/renderer/store/modules/chat.js | 73 ++++++++++--------- src/renderer/views/dashboard/index.vue | 70 ++++-------------- 5 files changed, 61 insertions(+), 102 deletions(-) diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 09602ca..d554583 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -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, diff --git a/src/renderer/components/workAdd/files/file.vue b/src/renderer/components/workAdd/files/file.vue index ff8e083..f4afecb 100644 --- a/src/renderer/components/workAdd/files/file.vue +++ b/src/renderer/components/workAdd/files/file.vue @@ -3,11 +3,11 @@
- {{ $t("file.addFolder") }} + 添加文件夹
- {{ $t("file.addFile") }} + 添加文件
@@ -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) { diff --git a/src/renderer/components/workAdd/workAdd.vue b/src/renderer/components/workAdd/workAdd.vue index 80ae7b0..4c98a00 100644 --- a/src/renderer/components/workAdd/workAdd.vue +++ b/src/renderer/components/workAdd/workAdd.vue @@ -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(',') diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index 54cbad3..6385060 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -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 } diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index 9174105..928008c 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -174,7 +174,7 @@
-
已刻录{{ $filterSize(cd_list[0].use_size) }},共{{ $filterSize(cd_list[0].total_size) }},速度{{ cd_list[0].burn_speed }}X
+
已刻录{{ $filterSize(cd_list[0].use_size) }},共{{ $filterSize(cd_list[0].total_size) }},速度{{ cd_list[0].burn_speed.toFixed(2) }}X
状态:{{ $store.state.chat.CDStatus[cd_list[0].cd_status] }}
任务:{{ cd_list[0].cd_taskid && cd_list[0].copy_scheduler ? cd_list[0].cd_taskid : '' }}
@@ -195,7 +195,7 @@
-
已刻录{{ $filterSize(cd_list[1].use_size) }},共{{ $filterSize(cd_list[1].total_size) }},速度{{ cd_list[1].burn_speed }}X
+
已刻录{{ $filterSize(cd_list[1].use_size) }},共{{ $filterSize(cd_list[1].total_size) }},速度{{ cd_list[1].burn_speed.toFixed(2) }}X
状态:{{ $store.state.chat.CDStatus[cd_list[1].cd_status] }}
任务:{{ cd_list[1].cd_taskid && cd_list[1].copy_scheduler ? cd_list[1].cd_taskid : '' }}
@@ -242,57 +242,14 @@
作业列表
- - - - - + + @@ -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