更新对接
This commit is contained in:
@@ -10,6 +10,23 @@ const PrinterStatus = {
|
||||
P: '正在打印'
|
||||
}
|
||||
|
||||
// 提交任务报错
|
||||
const submitErros = {
|
||||
'0x00001': '读取任务JSON失败',
|
||||
'0x00003': '新建任务失败',
|
||||
'0x00004': '新建任务文件夹失败',
|
||||
'0x00005': '没有任务数量',
|
||||
'0x00006': '打印参数错误',
|
||||
'0x00007': '刻录参数错误',
|
||||
'0x00008': '没有任务',
|
||||
'0x00009': '模板文件解析失败',
|
||||
'0x0000A': '打印类型错误',
|
||||
'0x0000B': 'csv文件读取失败',
|
||||
'0x0000C': '拷贝路径错误',
|
||||
'0x0000D': '新建ISO文件失败',
|
||||
'0x0000E': '更新任务数据失败',
|
||||
}
|
||||
|
||||
// 错误状态
|
||||
const Error1 = {
|
||||
0: '托盘移动错误',
|
||||
@@ -49,6 +66,8 @@ const CDStatus = {
|
||||
3: '光驱未准备好',
|
||||
4: '光盘状态正常,光盘已插入'
|
||||
}
|
||||
|
||||
// 光盘类型
|
||||
// CD类型:CD:1,DVD:2, DVD_DL:3,BD:4,BD_DL:5,BD_TL:6,BD_QL:7
|
||||
const diskTypes = {
|
||||
1: 'CD',
|
||||
@@ -126,6 +145,7 @@ const defaultData = {
|
||||
// 打印机信息
|
||||
printer_info: {
|
||||
blue_last: 0, //蓝色墨盒遗留
|
||||
calibration_flag: 0, // 是否校验打印机
|
||||
cover_flag: false, //是否盖盖
|
||||
printer_name: '', //打印机名称
|
||||
printer_status: 'I', //打印机状态 数字转成字符为I
|
||||
@@ -201,6 +221,7 @@ const getDefaultState = () => {
|
||||
Error1,
|
||||
Error2,
|
||||
Error3,
|
||||
submitErros,
|
||||
CDName,
|
||||
CDStatus,
|
||||
diskTypes,
|
||||
@@ -246,8 +267,10 @@ const actions = {
|
||||
websocketonmessage({ state, commit, dispatch }, e) {
|
||||
const data = JSON.parse(e.data) // 转json对象
|
||||
if (data.resp_name) {
|
||||
// 作业列表
|
||||
if (data.resp_name === 'task_list') {
|
||||
commit('setData', { name: 'task_list', data: data.resp_info.task_list })
|
||||
// 打印机信息
|
||||
} else if (data.resp_name === 'printer_info') {
|
||||
let info = data.resp_info
|
||||
info.printer_status = String.fromCharCode(info.printer_status)
|
||||
@@ -258,6 +281,7 @@ const actions = {
|
||||
}
|
||||
info.strongList = strong_list
|
||||
commit('setData', { name: 'printer_info', data: info })
|
||||
// 驱动信息
|
||||
} else if (data.resp_name === 'cd_info') {
|
||||
const list = data.resp_info.cd_list
|
||||
let cds = [{}, {}]
|
||||
@@ -279,6 +303,7 @@ const actions = {
|
||||
commit('setData', { name: 'CDTypes', data: types })
|
||||
commit('setData', { name: 'cd_types', data: typeLists })
|
||||
commit('setData', { name: 'cd_list', data: cds })
|
||||
// 新增日志
|
||||
} else if (data.resp_name === 'add_log') {
|
||||
let logs = data.resp_info.add_log
|
||||
let loglist = []
|
||||
@@ -294,6 +319,7 @@ const actions = {
|
||||
}
|
||||
let list = [...loglist, ...logLists]
|
||||
commit('setData', { name: 'logList', data: list })
|
||||
// 全部日志
|
||||
} else if (data.resp_name === 'all_log') {
|
||||
let logs = data.resp_info.add_log
|
||||
let loglist = []
|
||||
@@ -306,6 +332,11 @@ const actions = {
|
||||
})
|
||||
}
|
||||
commit('setData', { name: 'logList', data: loglist })
|
||||
// 提交任务报错处理
|
||||
} 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 + '提交失败:' + this.$store.state.submitErros[error.task_res], message: '' } })
|
||||
// 打印报错处理
|
||||
} else if (data.resp_name === 'printer_error') {
|
||||
let error = data.resp_info
|
||||
let info = {
|
||||
|
||||
Reference in New Issue
Block a user