优化代码

This commit is contained in:
24kycj
2025-10-19 21:46:39 +08:00
parent c88db2eab3
commit 705c16bfae
+41 -1
View File
@@ -423,7 +423,8 @@ export default {
name: '文件大小', name: '文件大小',
desc: '按照文件大小进行排序分盘' desc: '按照文件大小进行排序分盘'
} }
] ],
cdList: [],
} }
}, },
watch: { watch: {
@@ -448,6 +449,30 @@ export default {
deep: true, deep: true,
immediate: true immediate: true
}, },
'$store.state.chat.cdList': {
handler(val) {
if (!val || val.length === 0) {
this.cdList = []
// 手动设置光驱
this.$store
.dispatch('chat/websocketsend', {
req_name: 'get_all_cd',
req_type: 2,
req_info: {}
})
.then(() => {
})
return
}
this.cdList = val.map((item) => {
item.cdType = 1
return item
})
},
deep: true,
immediate: true
},
isNew: { isNew: {
immediate: true, immediate: true,
handler(val) { handler(val) {
@@ -661,6 +686,21 @@ export default {
return return
} }
if (that.form.copy_type == 3) { if (that.form.copy_type == 3) {
if(that.cdList.length > 0) {
that.$store
.dispatch('chat/websocketsend', {
req_name: 'openCDDevByPath',
req_type: 2,
req_info: {
dev_path: that.cdList[0].dev_path
}
})
.then(() => {
// setTimeout(() => {
// that.cdClose(e)
// }, 5000)
})
}
that.$alert('请将光盘装入打开的驱动器,然后手动关闭托盘后点击确定', '温馨提示', { that.$alert('请将光盘装入打开的驱动器,然后手动关闭托盘后点击确定', '温馨提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
showCancelButton: true, showCancelButton: true,