mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-07 09:57:37 +00:00
优化聊天输入框粘贴
This commit is contained in:
parent
2fca82d7c5
commit
3399ea73d0
@ -668,7 +668,6 @@ export default {
|
||||
}
|
||||
delta.ops = delta.ops.map(op => {
|
||||
const obj = {
|
||||
attributes: {},
|
||||
insert: op.insert
|
||||
};
|
||||
try {
|
||||
@ -680,6 +679,9 @@ export default {
|
||||
if (op.attributes) {
|
||||
['bold', 'strike', 'italic', 'underline', 'list', 'blockquote', 'link'].some(item => {
|
||||
if (op.attributes[item]) {
|
||||
if (typeof obj.attributes === "undefined") {
|
||||
obj.attributes = {}
|
||||
}
|
||||
obj.attributes[item] = op.attributes[item]
|
||||
}
|
||||
})
|
||||
|
||||
@ -141,7 +141,7 @@
|
||||
</VirtualList>
|
||||
|
||||
<!--底部输入-->
|
||||
<div class="dialog-footer" :class="footerClass" @click="onActive">
|
||||
<div ref="footer" class="dialog-footer" :class="footerClass" @click="onActive">
|
||||
<div class="dialog-newmsg" @click="onToBottom">{{$L(`有${msgNew}条新消息`)}}</div>
|
||||
<div class="dialog-goto" @click="onToBottom"><i class="taskfont"></i></div>
|
||||
<DialogUpload
|
||||
@ -902,6 +902,9 @@ export default {
|
||||
if (tail <= 10) {
|
||||
requestAnimationFrame(this.onToBottom)
|
||||
}
|
||||
if (this.$refs.input.isFocus) {
|
||||
$A.scrollToView(this.$refs.footer)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -1935,7 +1938,7 @@ export default {
|
||||
case 'text':
|
||||
const copyEl = $A(this.$refs.scroller.$el).find(`[data-id="${this.operateItem.id}"]`).find('.dialog-content')
|
||||
if (copyEl.length > 0) {
|
||||
const text = copyEl[0].innerText.replace(/\n\n/g, "\n")
|
||||
const text = copyEl[0].innerText.replace(/\n\n/g, "\n").replace(/(^\s*)|(\s*$)/g, "")
|
||||
this.$copyText(text).then(_ => $A.messageSuccess('复制成功')).catch(_ => $A.messageError('复制失败'))
|
||||
} else {
|
||||
$A.messageWarning('不可复制的内容');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user