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