弹窗优化,设置盘仓优化

This commit is contained in:
24kycj
2025-03-16 10:28:12 +08:00
parent a3d2f3f1b9
commit b1a711a5ab
3 changed files with 78 additions and 50 deletions
+21 -11
View File
@@ -424,7 +424,8 @@ export default {
showAll: false,
workShow: false,
isNew: true,
saveWorkList: {}
saveWorkList: {},
is_set_cddev: false
}
},
watch: {
@@ -482,15 +483,18 @@ export default {
}
this.default_cd = data.strongList
this.printer_info = { ...data }
if (that.printer_info.is_set_cddev == 1) {
if (this.printer_info.is_set_cddev == 1) {
if (this.is_set_cddev) return
this.is_set_cddev = true
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.is_set_cddev = false
this.goSet('/manage')
}).catch(() => {
this.is_set_cddev = false
});
}
},
@@ -535,10 +539,10 @@ export default {
'$store.state.chat.isConnect': {
handler(val) {
if (val) {
this.$message({
message: '服务已连接',
type: 'success'
})
// this.$message({
// message: '服务已连接',
// type: 'success'
// })
this.serviceLoading = false
}
this.isConnect = val
@@ -866,14 +870,17 @@ export default {
return
}
if (that.printer_info.is_set_cddev == 1) {
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
if (that.is_set_cddev) return
that.is_set_cddev = true
that.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.is_set_cddev = false
that.goSet('/manage')
}).catch(() => {
that.is_set_cddev = false
});
return
}
@@ -893,14 +900,17 @@ export default {
return
}
if (that.printer_info.is_set_cddev == 1) {
this.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
if (that.is_set_cddev) return
that.is_set_cddev = true
that.$confirm('上下光驱未设置,请前往设置', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
that.is_set_cddev = false
that.goSet('/manage')
}).catch(() => {
that.is_set_cddev = false
});
return
}
+56 -39
View File
@@ -527,51 +527,68 @@ export default {
this.cdShow = false
},
cdSubmit() {
let top = this.cdList.filter((item) => item.cdType === 2)
let bottom = this.cdList.filter((item) => item.cdType === 3)
if (!top || top.length === 0) {
this.$message({
message: '请设置上光驱',
type: 'error'
})
return
}
if (!bottom || bottom.length === 0) {
this.$message({
message: '请设置光驱',
type: 'error'
})
return
}
if (top.length > 1) {
this.$message({
message: '上光驱只能设置一个',
type: 'error'
})
return
}
if (bottom.length > 1) {
this.$message({
message: '光驱只能设置一个',
type: 'error'
})
return
let device_list = [
{
device_path: this.cdList[0].dev_path,
device_pos: 2
}
]
if (this.$store.state.chat.printer_info.printer_name !== 'SE3') {
let top = this.cdList.filter((item) => item.cdType === 2)
let bottom = this.cdList.filter((item) => item.cdType === 3)
if (!top || top.length === 0) {
this.$message({
message: '请设置光驱',
type: 'error'
})
return
}
if (!bottom || bottom.length === 0) {
this.$message({
message: '请设置下光驱',
type: 'error'
})
return
}
if (top.length > 1) {
this.$message({
message: '光驱只能设置一个',
type: 'error'
})
return
}
if (bottom.length > 1) {
this.$message({
message: '下光驱只能设置一个',
type: 'error'
})
return
}
device_list = [
{
device_path: top[0].dev_path,
device_pos: 2
},
{
device_path: bottom[0].dev_path,
device_pos: 1
}
]
} else {
if (!this.cdList[0].cdType) {
this.$message({
message: '请设置光驱',
type: 'error'
})
return
}
}
this.$store
.dispatch('chat/websocketsend', {
req_name: 'setCDDevice',
req_type: 2,
req_info: {
device_list: [
{
device_path: top[0].dev_path,
device_pos: 2
},
{
device_path: bottom[0].dev_path,
device_pos: 1
}
]
device_list: device_list
}
})
.then(() => {