修复点击消息的菜单无效的情况

This commit is contained in:
kuaifan 2022-06-04 20:14:05 +08:00
parent ddbef0172f
commit 4ecb1995b8

View File

@ -853,48 +853,51 @@ export default {
}, },
onOperate(name, value = null) { onOperate(name, value = null) {
switch (name) { this.operateVisible = false;
case "copy": this.$nextTick(_ => {
if (this.operateHasText) { switch (name) {
this.$copyText(this.operateItem.msg.text.replace(/<[^>]+>/g, "")).then(_ => { case "copy":
$A.messageSuccess('复制成功'); if (this.operateHasText) {
}).catch(_ => { this.$copyText(this.operateItem.msg.text.replace(/<[^>]+>/g, "")).then(_ => {
$A.messageError('复制失败'); $A.messageSuccess('复制成功');
}); }).catch(_ => {
} else { $A.messageError('复制失败');
$A.messageWarning('不可复制的内容'); });
} } else {
break; $A.messageWarning('不可复制的内容');
}
break;
case "newTask": case "newTask":
if (this.operateHasText) { if (this.operateHasText) {
Store.set('addTask', { Store.set('addTask', {
owner: [this.userId], owner: [this.userId],
name: this.operateItem.msg.text.replace(/<[^>]+>/g, "") name: this.operateItem.msg.text.replace(/<[^>]+>/g, "")
}); });
} }
break; break;
case "forward": case "forward":
this.onForward('open') this.onForward('open')
break; break;
case "withdraw": case "withdraw":
this.$refs[`msg_${this.operateItem.id}`].withdraw() this.$refs[`msg_${this.operateItem.id}`].withdraw()
break; break;
case "view": case "view":
this.$refs[`msg_${this.operateItem.id}`].viewFile() this.$refs[`msg_${this.operateItem.id}`].viewFile()
break; break;
case "down": case "down":
this.$refs[`msg_${this.operateItem.id}`].downFile() this.$refs[`msg_${this.operateItem.id}`].downFile()
break; break;
case "emoji": case "emoji":
this.$refs[`msg_${this.operateItem.id}`].setEmoji(value) this.$refs[`msg_${this.operateItem.id}`].setEmoji(value)
break; break;
} }
})
}, },
} }
} }