From 925667d84036e863067dbf9d063cd83f2dd7b3cc Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 11 Jul 2023 14:12:04 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E5=8F=AF=E8=A7=81=E6=80=A7=E9=80=89=E9=A1=B9=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Api/SystemController.php | 4 ++- .../js/pages/manage/components/TaskDetail.vue | 29 +++++++++++++++++-- .../setting/components/SystemSetting.vue | 8 +++++ resources/assets/js/pages/pro.vue | 12 ++------ resources/assets/js/store/actions.js | 7 +++++ resources/assets/js/store/state.js | 3 ++ .../sass/pages/components/task-detail.scss | 4 +-- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/Api/SystemController.php b/app/Http/Controllers/Api/SystemController.php index e8f098f9f..030af0bfd 100755 --- a/app/Http/Controllers/Api/SystemController.php +++ b/app/Http/Controllers/Api/SystemController.php @@ -38,7 +38,7 @@ class SystemController extends AbstractController * @apiParam {String} type * - get: 获取(默认) * - all: 获取所有(需要管理员权限) - * - save: 保存设置(参数:['reg', 'reg_identity', 'reg_invite', 'login_code', 'password_policy', 'project_invite', 'chat_information', 'anon_message', 'auto_archived', 'archived_day', 'all_group_mute', 'all_group_autoin', 'image_compress', 'image_save_local', 'start_home', 'home_footer']) + * - save: 保存设置(参数:['reg', 'reg_identity', 'reg_invite', 'login_code', 'password_policy', 'project_invite', 'chat_information', 'anon_message', 'auto_archived', 'archived_day', 'task_visible', 'all_group_mute', 'all_group_autoin', 'image_compress', 'image_save_local', 'start_home', 'home_footer']) * @apiSuccess {Number} ret 返回状态码(1正确、0错误) * @apiSuccess {String} msg 返回信息(错误描述) @@ -65,6 +65,7 @@ class SystemController extends AbstractController 'anon_message', 'auto_archived', 'archived_day', + 'task_visible', 'all_group_mute', 'all_group_autoin', 'image_compress', @@ -104,6 +105,7 @@ class SystemController extends AbstractController $setting['anon_message'] = $setting['anon_message'] ?: 'open'; $setting['auto_archived'] = $setting['auto_archived'] ?: 'close'; $setting['archived_day'] = floatval($setting['archived_day']) ?: 7; + $setting['task_visible'] = $setting['task_visible'] ?: 'close'; $setting['all_group_mute'] = $setting['all_group_mute'] ?: 'open'; $setting['all_group_autoin'] = $setting['all_group_autoin'] ?: 'yes'; $setting['image_compress'] = $setting['image_compress'] ?: 'open'; diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 0d5e04d20..df85aaf95 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -201,7 +201,7 @@ :add-icon="false" :before-submit="onAssist"/> - +
@@ -511,6 +511,8 @@ export default { assistData: {}, assistLoad: 0, + visibleForce: false, + addsubForce: false, addsubShow: false, addsubName: "", @@ -605,12 +607,16 @@ export default { computed: { ...mapState([ + 'systemConfig', + 'cacheProjects', 'cacheColumns', 'cacheTasks', + 'taskContents', 'taskFiles', 'taskPriority', + 'dialogId', ]), @@ -751,6 +757,13 @@ export default { name: '协助人员', }); } + if (taskDetail.is_all_visible <= 1 && !this.visibleKeep) { + list.push({ + command: 'visible', + icon: '', + name: '可见性', + }); + } if (!taskDetail.end_at) { list.push({ command: 'times', @@ -794,7 +807,11 @@ export default { }) } return text - } + }, + + visibleKeep() { + return this.systemConfig.task_visible === 'open' // 可见性保持显示 + }, }, watch: { @@ -819,6 +836,7 @@ export default { this.timeForce = false; this.loopForce = false; this.assistForce = false; + this.visibleForce = false; this.addsubForce = false; this.receiveShow = false; this.$refs.chatInput && this.$refs.chatInput.hidePopover(); @@ -1249,6 +1267,13 @@ export default { }); break; + case 'visible': + this.visibleForce = true; + this.$nextTick(() => { + this.showCisibleDropdown(); + }); + break; + case 'times': this.timeForce = true; this.$nextTick(() => { diff --git a/resources/assets/js/pages/manage/setting/components/SystemSetting.vue b/resources/assets/js/pages/manage/setting/components/SystemSetting.vue index b09243213..c653a36b1 100644 --- a/resources/assets/js/pages/manage/setting/components/SystemSetting.vue +++ b/resources/assets/js/pages/manage/setting/components/SystemSetting.vue @@ -78,6 +78,14 @@
{{$L('任务完成 (*) 天后自动归档。', formDatum.archived_day)}}
+ + + {{$L('保持')}} + {{$L('自动')}} + +
{{$L('保持:任务详情页可见性选项保持显示。')}}
+
{{$L('自动:默认值情况下显示在合并项目,设置时保持显示。')}}
+
diff --git a/resources/assets/js/pages/pro.vue b/resources/assets/js/pages/pro.vue index e5c25c821..38127067a 100644 --- a/resources/assets/js/pages/pro.vue +++ b/resources/assets/js/pages/pro.vue @@ -897,6 +897,7 @@