优化代码
This commit is contained in:
@@ -423,7 +423,8 @@ export default {
|
||||
name: '文件大小',
|
||||
desc: '按照文件大小进行排序分盘'
|
||||
}
|
||||
]
|
||||
],
|
||||
cdList: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -448,6 +449,30 @@ export default {
|
||||
deep: 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: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
@@ -661,6 +686,21 @@ export default {
|
||||
return
|
||||
}
|
||||
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('请将光盘装入打开的驱动器,然后手动关闭托盘后点击确定', '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
showCancelButton: true,
|
||||
|
||||
Reference in New Issue
Block a user