更新信息
This commit is contained in:
@@ -4,10 +4,54 @@
|
|||||||
let timeouter = null
|
let timeouter = null
|
||||||
let websock = null
|
let websock = null
|
||||||
let isConnect = false
|
let isConnect = false
|
||||||
|
|
||||||
|
// 状态JSON
|
||||||
|
// 打印机状态
|
||||||
|
const PrinterStatus = {
|
||||||
|
'I': '空闲',
|
||||||
|
'B': '忙碌',
|
||||||
|
'P': '正在打印'
|
||||||
|
}
|
||||||
|
|
||||||
|
// 错误状态
|
||||||
|
const Error1 = {
|
||||||
|
'0': '托盘移动错误',
|
||||||
|
'1': '墨盒类型错误',
|
||||||
|
'2': '抓取光盘时未检测到光盘光盘已用完',
|
||||||
|
'3': '光盘掉落',
|
||||||
|
'4': '墨水车空警告',
|
||||||
|
'5': '光盘抓手错误',
|
||||||
|
'6': '抓取多张光盘错误',
|
||||||
|
'7': '机械臂挂钩错误或者机械臂归位错误',
|
||||||
|
}
|
||||||
|
|
||||||
|
const Error2 = {
|
||||||
|
'0': '墨水车伺服系统错误',
|
||||||
|
'1': '墨水车失速错误',
|
||||||
|
'2': '墨盒数据读取错误',
|
||||||
|
'3': '打印图像超出范围',
|
||||||
|
'4': '环境温度超出正常使用范围',
|
||||||
|
'5': '墨盒短路',
|
||||||
|
'6': '型号错误',
|
||||||
|
'7': '缓冲区溢出错误',
|
||||||
|
}
|
||||||
|
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
reconnections: 0,
|
reconnections: 0,
|
||||||
taskList: []
|
PrinterStatus,
|
||||||
|
task_list: [],
|
||||||
|
printer_info: {
|
||||||
|
blue_last: 33, //蓝色墨盒遗留
|
||||||
|
cover_flag: false, //是否盖盖
|
||||||
|
left_strong_cd_num: 99, //左盘仓剩余盘数量
|
||||||
|
printer_name: '', //打印机名称
|
||||||
|
printer_status: 73, //打印机状态 数字转成字符为I
|
||||||
|
printer_tray: 73, //打印机托盘状态 数字转成字符为I
|
||||||
|
red_last: 29, //红色墨盒遗留
|
||||||
|
rigth_strong_cd_num: 99, //右盘仓剩余盘数量
|
||||||
|
yellow_last: 27 //黄色墨盒遗留
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,7 +60,7 @@ const state = getDefaultState()
|
|||||||
const mutations = {
|
const mutations = {
|
||||||
setData: (state, obj) => {
|
setData: (state, obj) => {
|
||||||
state[obj.name] = obj.data
|
state[obj.name] = obj.data
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
@@ -46,7 +90,12 @@ const actions = {
|
|||||||
const data = JSON.parse(e.data) // 转json对象
|
const data = JSON.parse(e.data) // 转json对象
|
||||||
if (data.resp_name) {
|
if (data.resp_name) {
|
||||||
if (data.resp_name === 'task_list') {
|
if (data.resp_name === 'task_list') {
|
||||||
commit('chat/setData', { name: 'taskList', data: data.resp_info.task_list })
|
commit('chat/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)
|
||||||
|
info.printer_tray = String.fromCharCode(info.printer_tray)
|
||||||
|
commit('chat/setData', { name: 'printer_info', data: info })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data.type === 'init') {
|
if (data.type === 'init') {
|
||||||
@@ -123,7 +172,6 @@ const actions = {
|
|||||||
// showCancelButton: true
|
// showCancelButton: true
|
||||||
// })
|
// })
|
||||||
// .then(() => {
|
// .then(() => {
|
||||||
|
|
||||||
// })
|
// })
|
||||||
// .catch(() => {})
|
// .catch(() => {})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@
|
|||||||
<div class="flex_box work_top">
|
<div class="flex_box work_top">
|
||||||
<div class="work_top_text">作业列表</div>
|
<div class="work_top_text">作业列表</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table max-height="250" class="work_table" :data="taskList" empty-text="暂无作业列表">
|
<el-table max-height="250" class="work_table" :data="task_list" empty-text="暂无作业列表">
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-table max-height="250" :data="scope.row.ass_task">
|
<el-table max-height="250" :data="scope.row.ass_task">
|
||||||
@@ -305,7 +305,7 @@ export default {
|
|||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
// 作业列表
|
// 作业列表
|
||||||
taskList: [],
|
task_list: [],
|
||||||
typeList: ['', 'CD', 'DVD', 'DVD_DL', 'BD', 'BD_DL', 'BD_TL', 'BD_QL'],
|
typeList: ['', 'CD', 'DVD', 'DVD_DL', 'BD', 'BD_DL', 'BD_TL', 'BD_QL'],
|
||||||
statusList: {
|
statusList: {
|
||||||
'0': '新建',
|
'0': '新建',
|
||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.chat.taskList': {
|
'$store.state.chat.task_list': {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val && val.length) {
|
if (val && val.length) {
|
||||||
let list = []
|
let list = []
|
||||||
@@ -332,7 +332,7 @@ export default {
|
|||||||
item.task_size = task_size
|
item.task_size = task_size
|
||||||
list.push(item)
|
list.push(item)
|
||||||
})
|
})
|
||||||
this.taskList = list
|
this.task_list = list
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user