From 2b70ff5a09dcefc959bfe85ec6c7bebe37c43a5b Mon Sep 17 00:00:00 2001 From: aBin Date: Tue, 12 Oct 2021 17:25:11 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E8=A7=92=E8=89=B2=E6=A0=8F=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/components/Experience/Experience.vue | 3 +- src/components/Globals/Globals.vue | 2 +- src/components/Roles/Roles.vue | 93 +++++++++++++++++++----- src/pages/project/project.vue | 4 +- 5 files changed, 82 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 276380f..cbdbe1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -136,6 +136,7 @@ - | 平车演示临时去掉项目快捷方式的toast提示 | [e0b2c23](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/e0b2c23) - | 切换到默认项目角色没有激活状态的bug | [438d448](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/438d448) - | 切换日历时查询小红点 | [7091789](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/7091789) + - | 请求到任务时,自动滚动功能修改 | [a1e0742](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/a1e0742) - | 全局任务点击时保存角色id到本地 | [e1a17c5](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/e1a17c5) - | 任务开始时间延迟插件 | [992a313](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/992a313) - | 日常任务插件遍历时的key值修改 | [cd26285](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/cd26285) diff --git a/src/components/Experience/Experience.vue b/src/components/Experience/Experience.vue index b2ed4be..fb66b30 100644 --- a/src/components/Experience/Experience.vue +++ b/src/components/Experience/Experience.vue @@ -28,7 +28,8 @@ export default { watch: { visibleRoles(val) { if (val && val.length) { - this.roles = [...this.visibleRoles, ...this.invisibleRoles]; + this.roles = [...this.visibleRoles]; + // this.roles = [...this.visibleRoles, ...this.invisibleRoles]; } }, }, diff --git a/src/components/Globals/Globals.vue b/src/components/Globals/Globals.vue index 68b5acf..630a634 100644 --- a/src/components/Globals/Globals.vue +++ b/src/components/Globals/Globals.vue @@ -64,7 +64,7 @@ export default { ...mapGetters('task', ['globals']), globalsHeight: function () { - let h = ((this.sysHeight - 44 - 30 - 10) / 5) * 3; + let h = ((this.sysHeight - 44 - 30 - 10) / 3) * 3; return h; }, }, diff --git a/src/components/Roles/Roles.vue b/src/components/Roles/Roles.vue index 8731662..4700e54 100644 --- a/src/components/Roles/Roles.vue +++ b/src/components/Roles/Roles.vue @@ -8,26 +8,50 @@ default-tab-item 是 我的角色 && 当前不展示 tab-choice 不是我的 && 当前展示 --> - + + + + + @@ -48,7 +72,9 @@ export default { { id: 1, name: '项目经理', mine: 0, pm: 1, sequence: 1 }, { id: 2, name: '运维', mine: 0, pm: 0, sequence: 2 }, ], + allRoles: [], roleLeft: 0, + isActive: false, }; }, @@ -60,10 +86,30 @@ export default { watch: { visibleRoles(val) { if (val && val.length) { - this.roles = [...this.visibleRoles, ...this.invisibleRoles]; + // this.roles = [...this.visibleRoles, ...this.invisibleRoles]; + this.roles = [...this.visibleRoles]; + this.allRoles = [...this.visibleRoles, ...this.invisibleRoles]; this.loading = false; } }, + roleId(val) { + let list = [...this.allRoles]; + let newRoleList = [...this.roles]; + let newList = []; + for (var i = 0; i < list.length; i++) { + if (val === list[i].id && list[i].name !== '平车') { + newList.push(list[i]); + newRoleList[0] = list[i]; + list.splice(i, 1); + break; + } + } + for (var j = 0; j < list.length; j++) { + newList.push(list[j]); + } + this.roles = [...newRoleList]; + this.allRoles = [...newList]; + }, }, mounted() { @@ -71,6 +117,7 @@ export default { this.loading = true; } else { this.roles = [...this.visibleRoles]; + this.allRoles = [...this.visibleRoles, ...this.invisibleRoles]; } this.$nextTick(() => { @@ -158,6 +205,18 @@ export default {