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