mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-08 15:35:36 +00:00
perf: 优化文本信息复制
This commit is contained in:
parent
94932c7486
commit
e32a3887cd
@ -3134,6 +3134,14 @@ export default {
|
|||||||
value: '',
|
value: '',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (msgData.msg.type === 'md') {
|
||||||
|
this.operateCopys.push({
|
||||||
|
type: 'md',
|
||||||
|
icon: '',
|
||||||
|
label: '复制原文',
|
||||||
|
value: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const rect = el.getBoundingClientRect();
|
const rect = el.getBoundingClientRect();
|
||||||
@ -3563,12 +3571,19 @@ export default {
|
|||||||
case 'text':
|
case 'text':
|
||||||
const copyEl = $A(this.$refs.scroller.$el).find(`[data-id="${this.operateItem.id}"]`).find('.dialog-content')
|
const copyEl = $A(this.$refs.scroller.$el).find(`[data-id="${this.operateItem.id}"]`).find('.dialog-content')
|
||||||
if (copyEl.length > 0) {
|
if (copyEl.length > 0) {
|
||||||
const text = copyEl[0].innerText.replace(/\n\n/g, "\n").replace(/(^\s*)|(\s*$)/g, "")
|
let copyText = copyEl[0].innerText;
|
||||||
this.copyText(text)
|
if ($A.getObject(this.operateItem.msg, 'type') !== 'md') {
|
||||||
|
copyText = copyText.replace(/\n\n/g, "\n").replace(/(^\s*)|(\s*$)/g, "")
|
||||||
|
}
|
||||||
|
this.copyText(copyText)
|
||||||
} else {
|
} else {
|
||||||
$A.messageWarning('不可复制的内容');
|
$A.messageWarning('不可复制的内容');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'md':
|
||||||
|
this.copyText(this.operateItem.msg.text)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user