mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-15 19:28:11 +00:00
优化复制消息
This commit is contained in:
parent
b20506cfa0
commit
1a1c03b355
10
resources/assets/js/app.js
vendored
10
resources/assets/js/app.js
vendored
@ -11,10 +11,10 @@ import App from './App.vue'
|
||||
import routes from './routes'
|
||||
import VueRouter from 'vue-router'
|
||||
import VueClipboard from 'vue-clipboard2'
|
||||
import ViewUI from 'view-design-hi';
|
||||
import ViewUI from 'view-design-hi'
|
||||
import Language from './language/index'
|
||||
import store from './store/index'
|
||||
import mixin from "./store/mixin";
|
||||
import mixin from "./store/mixin"
|
||||
|
||||
Vue.use(Vuex);
|
||||
Vue.use(ViewUI, {
|
||||
@ -22,7 +22,11 @@ Vue.use(ViewUI, {
|
||||
checkEscClose: true
|
||||
}
|
||||
});
|
||||
Vue.use(VueClipboard);
|
||||
Vue.use(VueClipboard, {
|
||||
config: {
|
||||
autoSetContainer: true
|
||||
}
|
||||
});
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(Language);
|
||||
|
||||
|
||||
@ -1597,12 +1597,7 @@ export default {
|
||||
break;
|
||||
|
||||
case "copy":
|
||||
if (this.operateHasText) {
|
||||
const text = this.operateItem.msg.text.replace(/<[^>]+>/g, "")
|
||||
this.$copyText(text).then(_ => $A.messageSuccess('复制成功')).catch(_ => $A.messageError('复制失败'));
|
||||
} else {
|
||||
$A.messageWarning('不可复制的内容');
|
||||
}
|
||||
this.onCopy()
|
||||
break;
|
||||
|
||||
case "forward":
|
||||
@ -1661,6 +1656,20 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
onCopy() {
|
||||
if (this.operateHasText) {
|
||||
try {
|
||||
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")
|
||||
this.$copyText(text).then(_ => $A.messageSuccess('复制成功')).catch(_ => $A.messageError('复制失败'));
|
||||
return
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
$A.messageWarning('不可复制的内容');
|
||||
},
|
||||
|
||||
onCancelReply() {
|
||||
if (this.replyActiveUpdate) {
|
||||
this.replyActiveUpdate = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user