3.30需求修改

This commit is contained in:
24kycj
2025-04-01 19:36:08 +08:00
parent 1589efc667
commit f4884d14f2
3 changed files with 88 additions and 51 deletions
+4 -1
View File
@@ -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] })
} }
if (state.workStatus) {
const refreshTime = parseInt(state.refreshTime) * 1000 const refreshTime = parseInt(state.refreshTime) * 1000
setTimeout(() => { setTimeout(() => {
dispatch('initWebSocket') dispatch('initWebSocket')
}, refreshTime) }, refreshTime)
if (state.workStatus) {
} }
}, },
// 链接错误之后执行的方法 // 链接错误之后执行的方法
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 })
+3 -10
View File
@@ -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()
} }
}, },
+46 -5
View File
@@ -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,6 +322,22 @@ export default {
break break
case 2: case 2:
// 校准上光驱 // 校准上光驱
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 that
.$confirm('请在上光驱放入一张光盘,点击确定后将自动校准上光驱', '温馨提示', { .$confirm('请在上光驱放入一张光盘,点击确定后将自动校准上光驱', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -344,9 +360,26 @@ export default {
}) })
}) })
}) })
})
break break
case 3: case 3:
// 校准下光驱 // 校准下光驱
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 that
.$confirm('请在下光驱放入一张光盘,点击确定后将自动校准下光驱', '温馨提示', { .$confirm('请在下光驱放入一张光盘,点击确定后将自动校准下光驱', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -369,6 +402,7 @@ export default {
}) })
}) })
}) })
})
break break
case 4: case 4:
// 校准光盘桶 // 校准光盘桶
@@ -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>