3.30需求修改
This commit is contained in:
@@ -287,6 +287,7 @@ const defaultData = {
|
||||
|
||||
const getDefaultState = () => {
|
||||
return {
|
||||
firstConnect: false,
|
||||
isConnect: false,
|
||||
connecting: false,
|
||||
serviceStatus: false,
|
||||
@@ -575,15 +576,17 @@ const actions = {
|
||||
for (let key in defaultData) {
|
||||
commit('setData', { name: key, data: defaultData[key] })
|
||||
}
|
||||
const refreshTime = parseInt(state.refreshTime) * 1000
|
||||
setTimeout(() => {
|
||||
dispatch('initWebSocket')
|
||||
}, refreshTime)
|
||||
if (state.workStatus) {
|
||||
const refreshTime = parseInt(state.refreshTime) * 1000
|
||||
setTimeout(() => {
|
||||
dispatch('initWebSocket')
|
||||
}, refreshTime)
|
||||
|
||||
}
|
||||
},
|
||||
// 链接错误之后执行的方法
|
||||
websocketonerror({ state, commit, dispatch }, res) {
|
||||
commit('setData', { name: 'firstConnect', data: true })
|
||||
commit('setData', { name: 'connecting', data: false })
|
||||
commit('setData', { name: 'isConnect', data: false })
|
||||
commit('setData', { name: 'serviceStatus', data: false })
|
||||
|
||||
@@ -371,17 +371,9 @@ export default {
|
||||
value: 2,
|
||||
label: '清除错误'
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: '自动匹配光驱'
|
||||
},
|
||||
{
|
||||
value: 6,
|
||||
label: '设置光盘桶'
|
||||
},
|
||||
{
|
||||
value: 7,
|
||||
label: '进入运输模式'
|
||||
}
|
||||
],
|
||||
// 剩余容量
|
||||
@@ -436,10 +428,11 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.user.oneLogin': {
|
||||
'$store.state.chat.firstConnect': {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
if (val && this.$store.state.user.oneLogin) {
|
||||
this.$store.dispatch('setDatas', { name: 'oneLogin', data: false })
|
||||
this.$store.dispatch('chat/setDatas', { name: 'firstConnect', data: false })
|
||||
this.startService()
|
||||
}
|
||||
},
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- 手动校准驱动 -->
|
||||
<el-dialog center title="手动校准驱动" :visible.sync="cdShow" width="1000px">
|
||||
<el-dialog center title="手动设置光驱" :visible.sync="cdShow" width="1000px">
|
||||
<div class="cd_box" v-loading="cdList.length === 0">
|
||||
<div class="cd_title">请通过点击按钮弹出光驱托盘判断并设置光驱。</div>
|
||||
<div class="cd_desc">需对光驱进行手动设置!</div>
|
||||
@@ -282,7 +282,7 @@ export default {
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
},
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let type = this.$route.query.type
|
||||
@@ -322,51 +322,85 @@ export default {
|
||||
break
|
||||
case 2:
|
||||
// 校准上光驱
|
||||
that
|
||||
.$confirm('请在上光驱放入一张光盘,点击确定后将自动校准上光驱', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
if (that.printer_info.is_set_cddev == 1) {
|
||||
that.$message('请先设置上下光驱')
|
||||
setTimeout(() => {
|
||||
this.handleAction(this.actionList[0])
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'openCDDevByPath',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
dev_path: that.$store.state.chat.cd_list[0].dev_path
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
cali_num: 0
|
||||
}
|
||||
that
|
||||
.$confirm('请在上光驱放入一张光盘,点击确定后将自动校准上光驱', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
cali_num: 0
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
break
|
||||
case 3:
|
||||
// 校准下光驱
|
||||
that
|
||||
.$confirm('请在下光驱放入一张光盘,点击确定后将自动校准下光驱', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
if (that.printer_info.is_set_cddev == 1) {
|
||||
that.$message('请先设置上下光驱')
|
||||
setTimeout(() => {
|
||||
this.handleAction(this.actionList[0])
|
||||
}, 1000)
|
||||
return
|
||||
}
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'openCDDevByPath',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
dev_path: that.$store.state.chat.cd_list[1].dev_path
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
cali_num: 1
|
||||
}
|
||||
that
|
||||
.$confirm('请在下光驱放入一张光盘,点击确定后将自动校准下光驱', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'CaliPrinter',
|
||||
req_type: 2,
|
||||
req_info: {
|
||||
cali_num: 1
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
break
|
||||
@@ -541,8 +575,9 @@ export default {
|
||||
this.$set(this.cdList, index, { ...item })
|
||||
},
|
||||
cdOpen(e) {
|
||||
let item = this.cdList[e]
|
||||
this.$store
|
||||
let that = this
|
||||
let item = that.cdList[e]
|
||||
that.$store
|
||||
.dispatch('chat/websocketsend', {
|
||||
req_name: 'openCDDevByPath',
|
||||
req_type: 2,
|
||||
@@ -551,7 +586,10 @@ export default {
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
setTimeout(() => {
|
||||
that.cdClose(e)
|
||||
}, 5000)
|
||||
that.$message({
|
||||
message: '执行成功',
|
||||
type: 'success'
|
||||
})
|
||||
@@ -896,4 +934,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .el-dialog__title {
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user