优化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
+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
}