From d7902b4d0865a4e681b09bc6d889ed2dd794904c Mon Sep 17 00:00:00 2001 From: kuaifan Date: Mon, 7 Apr 2025 13:40:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/js/components/DropdownMenu.vue | 4 +- .../pages/manage/components/DialogWrapper.vue | 33 ++++---- .../js/pages/manage/components/TaskDetail.vue | 81 +++++++++++++++++-- .../sass/pages/components/dialog-wrapper.scss | 4 +- .../sass/pages/components/task-detail.scss | 30 ++++++- 5 files changed, 126 insertions(+), 26 deletions(-) diff --git a/resources/assets/js/components/DropdownMenu.vue b/resources/assets/js/components/DropdownMenu.vue index eebbeb392..4a5d0b90d 100644 --- a/resources/assets/js/components/DropdownMenu.vue +++ b/resources/assets/js/components/DropdownMenu.vue @@ -17,7 +17,7 @@ :key="key" :command="item.value" :divided="!!item.divided" - :disabled="active === item.value || !!item.disabled"> + :disabled="(active === item.value && !activeClick) || !!item.disabled">
{{item.label}}
@@ -40,6 +40,7 @@ export default { list: [], // 数据列表: [{label: '', value: ''}] active: '', // 当前选中的值 + activeClick: false, // 当前选中的值是否可以被点击 onUpdate: null, // 选中后的回调函数 scrollHide: true, // 滚动立即隐藏 tickShow: true, // 是否显示打勾 @@ -81,6 +82,7 @@ export default { } this.list = data.list; this.active = data.active && this.list.find(item => item.value === data.active) ? data.active : ''; + this.activeClick = typeof data.activeClick === "boolean" ? data.activeClick : false; this.onUpdate = typeof data.onUpdate === "function" ? data.onUpdate : null; this.scrollHide = typeof data.scrollHide === "boolean" ? data.scrollHide : true; this.tickShow = typeof data.tickShow === "boolean" ? data.tickShow : true; diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 0ab6c765a..110db78f2 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -54,9 +54,9 @@ {{$L(dialogData.online_state === true ? '在线' : dialogData.online_state)}} -
    +
    • - {{$L(item.label)}} + {{item.label}}
@@ -972,33 +972,33 @@ export default { return '发送文件' }, - msgTags({dialogData}) { + msgTypes({dialogData}) { const array = [ - {type: '', label: '消息'}, + {type: '', label: this.$L('消息')}, ]; if (dialogData.has_tag) { - array.push({type: 'tag', label: '标注'}) + array.push({type: 'tag', label: this.$L('标注')}) } if (dialogData.has_todo) { - array.push({type: 'todo', label: '事项'}) + array.push({type: 'todo', label: this.$L('事项')}) } if (dialogData.has_image) { - array.push({type: 'image', label: '图片'}) + array.push({type: 'image', label: this.$L('图片')}) } if (dialogData.has_file) { - array.push({type: 'file', label: '文件'}) + array.push({type: 'file', label: this.$L('文件')}) } if (dialogData.has_link) { - array.push({type: 'link', label: '链接'}) + array.push({type: 'link', label: this.$L('链接')}) } if (dialogData.group_type === 'project') { - array.push({type: 'project', label: '打开项目'}) + array.push({type: 'project', label: this.$L('打开项目')}) } if (dialogData.group_type === 'task') { - array.push({type: 'task', label: '打开任务'}) + array.push({type: 'task', label: this.$L('打开任务')}) } if (dialogData.group_type === 'okr') { - array.push({type: 'okr', label: '打开OKR'}) + array.push({type: 'okr', label: this.$L('打开OKR')}) } return array }, @@ -1032,8 +1032,8 @@ export default { return this.todoList.length > 0 && this.isDefaultSize && this.quoteId === 0 }, - tagShow() { - return this.msgTags.length > 1 && this.isDefaultSize && !this.searchShow + typeShow() { + return this.msgTypes.length > 1 && this.isDefaultSize && !this.searchShow }, topShow() { @@ -1050,7 +1050,7 @@ export default { navClass() { return { 'completed': $A.dialogCompleted(this.dialogData), - 'tagged': this.tagShow + 'tagged': this.typeShow } }, @@ -1261,6 +1261,7 @@ export default { msgType() { this.onGetMsgClear() + this.$emit('on-type-change', this.msgType) }, searchKey(key) { diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 0f1e2cffa..e5972173a 100755 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -435,16 +435,26 @@ class="task-resize" placement="right" v-model="taskDialogWidth" - :min="220" + :min="300" :max="900" :reverse="true"/>