From 9497fb1bb686ea9436106e8bd1cac2b07d520e20 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 14 Dec 2023 14:29:45 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E8=AE=BE=E7=BD=AE=E5=BE=85=E5=8A=9E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/DialogWrapper.vue | 80 +++++++++++++------ 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index db5ac43fe..00e714f79 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -402,29 +402,24 @@ :mask-closable="false">
- + {{$L('所有成员')}} {{$L('指定成员')}} -
- -
-
- - {{$L('自己')}} -
-
-
- -
-
- -
-
-
+
+ + +
+
+ + {{$L('自己')}} +
+
+
+
- +
@@ -642,6 +637,7 @@ export default { todoSettingData: { type: 'all', userids: [], + quick_value: [], }, todoViewLoad: false, @@ -2807,18 +2803,33 @@ export default { }); }, + onTypeChange(val) { + if (val === 'user') { + if (this.todoSettingData.userids.length === 0 && this.todoSettingData.quick_value.length > 0) { + this.todoSettingData.userids = this.todoSettingData.quick_value + } + this.$nextTick(_ => { + this.$refs.userSelect.onSelection() + }) + } + if (val !== 'quick_select') { + this.todoSettingData.quick_value = [] + } + }, + + onQuickChange(val) { + this.todoSettingData.type = val.length === 0 ? 'all' : 'quick_select'; + }, + onTodo(type) { if (this.operateVisible) { return } if (type === 'submit') { const todoData = $A.cloneJSON(this.todoSettingData) - if (todoData.type === 'my') { + if (todoData.type === 'quick_select') { todoData.type = 'user' - todoData.userids = [todoData.my_id] - } else if (todoData.type === 'you') { - todoData.type = 'user' - todoData.userids = [todoData.you_id] + todoData.userids = todoData.quick_value } else if (todoData.type === 'user' && $A.arrayLength(todoData.userids) === 0) { $A.messageWarning("选择指定成员"); return @@ -2833,13 +2844,30 @@ export default { this.todoSettingLoad-- }) } else { - const youId = this.dialogData.dialog_user?.userid + const quickList = {} + quickList[this.userId] = this.userId + const userid = this.dialogData.dialog_user?.userid + if (userid && userid != this.userId && !this.dialogData.bot) { + quickList[userid] = userid + } + if (this.operateItem.type === 'text') { + const atReg = /([^<]+)<\/span>/g + const atList = this.operateItem.msg.text.match(atReg) + if (atList) { + atList.forEach(item => { + const userid = parseInt(item.replace(atReg, '$1')) + if (userid && userid != this.userId) { + quickList[userid] = userid + } + }) + } + } this.todoSettingData = { type: 'all', userids: [], msg_id: this.operateItem.id, - my_id: this.userId, - you_id: youId != this.userId && !this.dialogData.bot ? youId : 0, + quick_value: [], + quick_list: Object.values(quickList), } if (this.operateItem.todo) { $A.modalConfirm({