diff --git a/resources/assets/js/pages/manage/components/DialogItem.vue b/resources/assets/js/pages/manage/components/DialogItem.vue index c2b0321be..f9150420f 100644 --- a/resources/assets/js/pages/manage/components/DialogItem.vue +++ b/resources/assets/js/pages/manage/components/DialogItem.vue @@ -138,7 +138,7 @@ export default { }, isUnreadStart() { - return this.unreadOne === this.source.id + return this.unreadOne === this.source.id && this.source.id > 0 }, hidePercentage() { diff --git a/resources/assets/js/pages/manage/components/ReportReceive.vue b/resources/assets/js/pages/manage/components/ReportReceive.vue index 2b4828854..39f8d525e 100644 --- a/resources/assets/js/pages/manage/components/ReportReceive.vue +++ b/resources/assets/js/pages/manage/components/ReportReceive.vue @@ -88,14 +88,14 @@
- -
@@ -122,6 +122,7 @@ :confirm-placeholder="$L('附言')" :multiple-max="50" :before-submit="onShare" + :msg-detail="forwardMsgPreview" sender-hidden/>
@@ -239,7 +240,7 @@ export default { keys: {}, keyIs: false, - selectIds: [], + selected: [], selectAction: '', reportTypeList: [ @@ -255,6 +256,8 @@ export default { ], departmentList: [], + + forwardMsgPreview: null, } }, async mounted() { @@ -313,26 +316,29 @@ export default { }, selectChange(items) { - this.selectIds = items.map(({id}) => id); + this.selected = items.map(item => { + return { + id: item.id, + title: item.title, + } + }); }, selectClick() { - if (this.selectIds.length === 0) { + if (this.selected.length === 0) { $A.messageWarning('请选择线路'); return; } switch (this.selectAction) { case 'read': case 'unread': - this.readReport(this.selectIds, this.selectAction) + this.readReport(this.selected.map(({id}) => id), this.selectAction) break; + case 'share': - if (this.selectIds.length > 20) { - $A.messageWarning('每次最多分享20个'); - return; - } - this.$refs.forwarder.onSelection() + this.selectShare() break; + default: $A.messageWarning('请选择执行方式'); break; @@ -366,12 +372,41 @@ export default { }); }, + selectShare() { + if (this.selected.length > 20) { + $A.messageWarning('每次最多分享20个'); + return; + } + // + const previewTag = this.selected.length > 1 ? 'li' : 'p'; + const previewAttr = previewTag === 'li' ? ' data-list="ordered"' : ''; + const msg = { + text: this.selected.map(({title}) => { + const previewContent = `%${title}`; + return `<${previewTag}${previewAttr}>${previewContent}`; + }).join(''), + } + if (previewTag === 'li') { + msg.text = `
    ${msg.text}
`; + } + this.forwardMsgPreview = { + id: 0, + dialog_id: 0, + reply_id: 0, + type: 'text', + userid: this.userId, + msg, + } + // + this.$refs.forwarder.onSelection() + }, + onShare({dialogids, userids, message}) { return new Promise((resolve, reject) => { this.$store.dispatch("call", { url: 'report/share', data: { - id: this.selectIds, + id: this.selected.map(({id}) => id), dialogids, userids, leave_message: message,