From 4628301183286157fa5b9c0aa725f8684b545243 Mon Sep 17 00:00:00 2001 From: song Date: Wed, 8 Sep 2021 21:20:09 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=97=A5=E5=B8=B8=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +- src/components/Globals/Globals.vue | 13 ++---- src/components/Plugin/Plugin.vue | 11 +++-- src/components/Title/Title.vue | 3 +- .../Title/components/CreateTask.vue | 46 ++++++++++++++++++- src/pages/project/project.vue | 3 -- src/store/task/mutations.js | 45 +++++------------- 7 files changed, 72 insertions(+), 52 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3432451..ba39ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-09-07) +# 0.1.0 (2021-09-08) ### 🌟 新功能 范围|描述|commitId @@ -50,6 +50,7 @@ - | 标题栏角色栏全局任务组件新建 | [0500cb4](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/0500cb4) - | 检查交付物 | [9d92be5](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/9d92be5) - | 模拟接口测试 | [69e7931](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/69e7931) + - | 添加任务对接口 | [7fc959d](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/7fc959d) - | 添加内置插件-交付物 | [6e0bc46](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/6e0bc46) - | 添加子任务插件 子项目插件 | [7bda7e2](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/7bda7e2) - | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/2b81bbc) diff --git a/src/components/Globals/Globals.vue b/src/components/Globals/Globals.vue index 2d95005..65bd82f 100644 --- a/src/components/Globals/Globals.vue +++ b/src/components/Globals/Globals.vue @@ -1,15 +1,10 @@ diff --git a/src/pages/project/project.vue b/src/pages/project/project.vue index d225c58..741f8d7 100644 --- a/src/pages/project/project.vue +++ b/src/pages/project/project.vue @@ -86,7 +86,6 @@ export default { methods: { ...mapActions('user', ['getToken']), ...mapActions('task', ['getRegulars', 'getPermanent', 'getGlobal']), - ...mapActions('role', ['getAllMembers']), ...mapMutations('user', ['setToken']), ...mapMutations('project', ['setProject', 'setProjectName']), ...mapMutations('role', ['setInvisibleRoles', 'setVisibleRoles', 'setRoleId']), @@ -335,8 +334,6 @@ export default { this.setProject(data); // 根据项目id获取角色列表 this.getRoles(params); - // 根据项目id获取成员列表 - this.getAllMembers(params); } catch (error) { console.log('error: ', error || '获取项目信息失败'); } diff --git a/src/store/task/mutations.js b/src/store/task/mutations.js index d6df8c3..337f069 100644 --- a/src/store/task/mutations.js +++ b/src/store/task/mutations.js @@ -105,40 +105,17 @@ const mutations = { * @param {Object} state * @param {Array} data 新添加的task */ - addNewTasks(state, data) { - let res = data.data; - // 判断有没有选择上道工序 - if (data.processTaskId) { - const index = state.tasks.find(item => item.detailId === data.processTaskId); - if (index) { - state.tasks.splice(index + 1, 0, res); - } - } else { - console.log('res.planStart: ', res.planStart); - console.log('state.tasks[0].planStart: ', state.tasks[0].planStart); - if (res.planStart - 0 < state.tasks[0].planStart - 0) { - // 开始时间小于列表的第一个 插入最前面 - state.tasks.splice(0, 0, res); - } else if (res.planStart - 0 === state.tasks[0].planStart - 0) { - // 开始时间等于列表的第一个 插入第二 - state.tasks.splice(1, 0, res); - } else if (res.planStart - 0 >= state.tasks[state.tasks.length - 1].planStart - 0) { - // 开始时间大等于列表的最后一个 插入最后 - state.tasks.splice(-1, 0, res); - } else { - // 判断开始时间在列表中的哪个位置 - for (let i = 0; i < state.tasks.length; i++) { - const item = state.tasks[i]; - if (res.planStart - 0 > item.planStart - 0) { - if (res.planStart - 0 <= state.tasks[i + 1].planStart - 0) { - state.tasks.splice(i + 1, 0, res); - console.log('res: ', res); - return; - } - } - } - } - } + updateTasks(state, data) { + state.tasks = [...data]; + }, + + /** + * 设置添加任务的位置 + * @param {*} state + * @param {*} data + */ + setAddPosition(state, data) { + console.log('data: ', data); }, /**