diff --git a/app/Http/Controllers/Api/DialogController.php b/app/Http/Controllers/Api/DialogController.php
index 2fbe76c20..92bcf1caf 100755
--- a/app/Http/Controllers/Api/DialogController.php
+++ b/app/Http/Controllers/Api/DialogController.php
@@ -1042,6 +1042,36 @@ class DialogController extends AbstractController
return $msg->toggleTodoMsg($user->userid);
}
+ /**
+ * @api {get} api/dialog/msg/todolist 14. 获取消息待办情况
+ *
+ * @apiDescription 需要token身份
+ * @apiVersion 1.0.0
+ * @apiGroup dialog
+ * @apiName msg__todolist
+ *
+ * @apiParam {Number} msg_id 消息ID
+ *
+ * @apiSuccess {Number} ret 返回状态码(1正确、0错误)
+ * @apiSuccess {String} msg 返回信息(错误描述)
+ * @apiSuccess {Object} data 返回数据
+ */
+ public function msg__todolist()
+ {
+ User::auth();
+ //
+ $msg_id = intval(Request::input('msg_id'));
+ //
+ $msg = WebSocketDialogMsg::whereId($msg_id)->first();
+ if (empty($msg)) {
+ return Base::retError("消息不存在或已被删除");
+ }
+ WebSocketDialog::checkDialog($msg->dialog_id);
+ //
+ $todo = WebSocketDialogMsgTodo::whereMsgId($msg_id)->get();
+ return Base::retSuccess('success', $todo ?: []);
+ }
+
/**
* @api {get} api/dialog/msg/done 23. 完成待办
*
diff --git a/resources/assets/js/pages/manage/components/DialogItem.vue b/resources/assets/js/pages/manage/components/DialogItem.vue
index 076ad7885..4a1b5ca04 100644
--- a/resources/assets/js/pages/manage/components/DialogItem.vue
+++ b/resources/assets/js/pages/manage/components/DialogItem.vue
@@ -24,6 +24,7 @@
:hide-reply="hideReply"
:operate-visible="operateVisible"
:operate-action="operateVisible && source.id === operateItem.id"
+ :is-right-msg="isRightMsg"
@on-longpress="onLongpress"
@on-view-reply="onViewReply"
@on-view-text="onViewText"
@@ -88,10 +89,14 @@ export default {
computed: {
...mapState(['userId']),
+ isRightMsg() {
+ return !this.isReply && this.source.userid == this.userId
+ },
+
classArray() {
return {
'dialog-item': true,
- 'self': !this.isReply && this.source.userid == this.userId,
+ 'self': this.isRightMsg,
}
}
},
diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue
index f7e31da07..ee7b76ac8 100644
--- a/resources/assets/js/pages/manage/components/DialogView.vue
+++ b/resources/assets/js/pages/manage/components/DialogView.vue
@@ -92,8 +92,30 @@
-
-
+
@@ -109,27 +131,27 @@
+ :placement="isRightMsg ? 'bottom-end' : 'bottom-start'">
-
+
-
+
@@ -177,15 +199,24 @@ export default {
type: Boolean,
default: false
},
+ isRightMsg: {
+ type: Boolean,
+ default: false
+ },
},
data() {
return {
- popperLoad: 0,
- popperShow: false,
timeShow: false,
operateEnter: false,
- allList: [],
+
+ percentageLoad: 0,
+ percentageShow: false,
+ percentageList: [],
+
+ todoLoad: 0,
+ todoShow: false,
+ todoList: [],
}
},
@@ -223,11 +254,19 @@ export default {
},
readList() {
- return this.allList.filter(({read_at}) => read_at)
+ return this.percentageList.filter(({read_at}) => read_at)
},
unreadList() {
- return this.allList.filter(({read_at}) => !read_at)
+ return this.percentageList.filter(({read_at}) => !read_at)
+ },
+
+ todoDoneList() {
+ return this.todoList.filter(({done_at}) => done_at)
+ },
+
+ todoUndoneList() {
+ return this.todoList.filter(({done_at}) => !done_at)
},
headClass() {
@@ -266,9 +305,7 @@ export default {
operateAction(val) {
this.operateEnter = false;
if (val) {
- setTimeout(_ => {
- this.operateEnter = true;
- }, 500)
+ setTimeout(_ => this.operateEnter = true, 500)
}
}
},
@@ -278,28 +315,54 @@ export default {
this.$emit("on-longpress", {event, el, msgData: this.msgData})
},
+ openTodo() {
+ if (this.todoLoad > 0) {
+ return;
+ }
+ if (this.todoShow) {
+ this.todoShow = false;
+ return;
+ }
+ this.todoLoad++;
+ this.$store.dispatch("call", {
+ url: 'dialog/msg/todolist',
+ data: {
+ msg_id: this.msgData.id,
+ },
+ }).then(({data}) => {
+ this.todoList = data;
+ }).catch(() => {
+ this.todoList = [];
+ }).finally(_ => {
+ setTimeout(() => {
+ this.todoLoad--;
+ this.todoShow = true
+ }, 100)
+ });
+ },
+
openReadPercentage() {
- if (this.popperLoad > 0) {
+ if (this.percentageLoad > 0) {
return;
}
- if (this.popperShow) {
- this.popperShow = false;
+ if (this.percentageShow) {
+ this.percentageShow = false;
return;
}
- this.popperLoad++;
+ this.percentageLoad++;
this.$store.dispatch("call", {
url: 'dialog/msg/readlist',
data: {
msg_id: this.msgData.id,
},
}).then(({data}) => {
- this.allList = data;
+ this.percentageList = data;
}).catch(() => {
- this.allList = [];
+ this.percentageList = [];
}).finally(_ => {
setTimeout(() => {
- this.popperLoad--;
- this.popperShow = true
+ this.percentageLoad--;
+ this.percentageShow = true
}, 100)
});
},
diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss
index 08782a274..631ef67f6 100644
--- a/resources/assets/sass/pages/components/dialog-wrapper.scss
+++ b/resources/assets/sass/pages/components/dialog-wrapper.scss
@@ -764,6 +764,15 @@
height: 10px;
}
+ .popover-reference {
+ position: absolute;
+ left: 65%;
+ bottom: 0;
+ width: 0;
+ height: 100%;
+ pointer-events: none;
+ }
+
.tag,
.todo,
.reply,
@@ -776,6 +785,17 @@
}
}
+ .todo {
+ position: relative;
+ cursor: pointer;
+ .common-loading {
+ margin: 0 3px 0 0;
+ }
+ > i {
+ color: $primary-color;
+ }
+ }
+
.reply {
font-size: 12px;
color: $primary-color;
@@ -802,6 +822,7 @@
display: none;
margin-left: 4px;
align-items: center;
+ position: relative;
cursor: pointer;
}
}