From ba32df2fb83e44042dd43a9b0dde7d788fc22b96 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 23 Dec 2021 23:20:54 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=AE=A2=E6=88=B7=E7=AB=AF=E5=9C=A8?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A1=B5=E9=9D=A2=E6=94=AF=E6=8C=81=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/ProjectList.vue | 43 ++++++++++++++++++- .../sass/pages/components/project-list.scss | 13 ++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/pages/manage/components/ProjectList.vue b/resources/assets/js/pages/manage/components/ProjectList.vue index 785a1ce8..55df592a 100644 --- a/resources/assets/js/pages/manage/components/ProjectList.vue +++ b/resources/assets/js/pages/manage/components/ProjectList.vue @@ -364,6 +364,7 @@

{{$L('移除成员负责的任务将变成无负责人,')}}

{{$L('注意此操作不可逆!')}}

+
    +
  • {{$L('即将移除')}}:
  • +
  • + +
  • +
+ @@ -482,6 +490,12 @@ export default { this.projectDialogsubscribe = Store.subscribe('onProjectDialogBack', () => { this.$store.dispatch('toggleTablePanel', 'chat'); }); + // + document.addEventListener('keydown', this.shortcutAdd); + }, + + beforeDestroy () { + document.removeEventListener('keydown', this.shortcutAdd); }, destroyed() { @@ -508,6 +522,20 @@ export default { ...mapGetters(['projectData', 'tablePanel']), + userWaitRemove() { + const {userids, useridbak} = this.userData; + if (!userids) { + return []; + } + let wait = []; + useridbak.some(id => { + if (!userids.includes(id)) { + wait.push(id) + } + }) + return wait; + }, + msgUnread() { const {dialogs, projectData} = this; const dialog = dialogs.find(({id}) => id === projectData.dialog_id); @@ -1082,7 +1110,9 @@ export default { break; case "user": - this.$set(this.userData, 'userids', this.projectData.project_user.map(({userid}) => userid)); + const userids = this.projectData.project_user.map(({userid}) => userid); + this.$set(this.userData, 'userids', userids); + this.$set(this.userData, 'useridbak', userids); this.$set(this.userData, 'uncancelable', [this.projectData.owner_userid]); this.userShow = true; break; @@ -1149,6 +1179,17 @@ export default { this.completeJust = []; }, + shortcutAdd(e) { + if (this.projectId && this.projectId == this.$route.params.id) { + if (e.keyCode === 75 || e.keyCode === 78) { + if (e.metaKey || e.ctrlKey) { + e.preventDefault(); + this.addTaskOpen(0); + } + } + } + }, + formatTime(date) { let time = Math.round($A.Date(date).getTime() / 1000), string = ''; diff --git a/resources/assets/sass/pages/components/project-list.scss b/resources/assets/sass/pages/components/project-list.scss index e5bc755c..88a3c5eb 100644 --- a/resources/assets/sass/pages/components/project-list.scss +++ b/resources/assets/sass/pages/components/project-list.scss @@ -797,6 +797,19 @@ } } +.project-list-wait-remove { + margin-top: 6px; + > li { + display: flex; + align-items: center; + list-style: none; + line-height: 26px; + &:first-child { + font-weight: 600; + } + } +} + @media (max-width: 768px) { .project-list { .project-head {