From 225d3cc5d1bbd3b8363d725242350ddcb5ab5f5d Mon Sep 17 00:00:00 2001 From: lucky Date: Fri, 23 Jul 2021 13:28:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=97=B6=E9=97=B4=E8=BD=B4=E6=8F=92?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/components/Plugin/Plugin.vue | 4 +-- src/components/TimeLine/TimeLine.vue | 13 +++---- src/components/TimeLine/component/TimeBox.vue | 36 +++++++++---------- src/pages/project/project.vue | 9 +++-- src/store/home/state.js | 21 ++++++++++- 6 files changed, 53 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a50dde..9ace166 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - | 角色栏实现 | [94cd671](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/94cd671) - | 模拟接口测试 | [69e7931](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/69e7931) - | 配置默认插件接口 | [f0c177d](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/f0c177d) + - | 全局插件及默认插件位置修改 | [6c80d08](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/6c80d08) - | 时间基准线,默认插件 | [a33ba1e](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/a33ba1e) - | 时间轴界面 | [33927e9](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/33927e9) - | 时间轴修改状态时提示框增加 | [e841392](https://dd.tall.wiki/gitea/wally/TALL-MUI-3/commits/e841392) diff --git a/src/components/Plugin/Plugin.vue b/src/components/Plugin/Plugin.vue index 53b2180..f58ab23 100644 --- a/src/components/Plugin/Plugin.vue +++ b/src/components/Plugin/Plugin.vue @@ -1,5 +1,5 @@ diff --git a/src/components/TimeLine/TimeLine.vue b/src/components/TimeLine/TimeLine.vue index c4c137f..67659fe 100644 --- a/src/components/TimeLine/TimeLine.vue +++ b/src/components/TimeLine/TimeLine.vue @@ -84,12 +84,13 @@ export default { if (tasks && tasks.length) { let tasksHeight = 0; const scrollHeight = document.getElementById('scroll').clientHeight; - for (let i = 0; i < 3; i++) { - // TODO: 高度不对 - // if (tasks[i].panel && tasks[i].panel.height) { - // tasksHeight += +tasks[i].panel.height + 42; - // } - } + // for (let i = 0; i < 3; i++) { + // if (tasks[i].panel && tasks[i].panel.height) { + // tasksHeight += +tasks[i].panel.height + 42; + // } else { + // tasksHeight += (width / 20) * 4 + 42; + // } + // } this.top = tasksHeight - scrollHeight / 2; console.log('this.top: ', this.top); } diff --git a/src/components/TimeLine/component/TimeBox.vue b/src/components/TimeLine/component/TimeBox.vue index 555e9e3..4c05c8f 100644 --- a/src/components/TimeLine/component/TimeBox.vue +++ b/src/components/TimeLine/component/TimeBox.vue @@ -28,28 +28,19 @@ - - + + + + - @@ -91,6 +82,11 @@ export default { changeTimeNode(time) { this.setTimeNode(time); }, + + // 设置网格布局 + getClass(col, row) { + return [`row-span-${row}`, `col-span-${col}`]; + }, }, }; diff --git a/src/pages/project/project.vue b/src/pages/project/project.vue index 4ba08a9..118faf8 100644 --- a/src/pages/project/project.vue +++ b/src/pages/project/project.vue @@ -173,15 +173,20 @@ export default { try { await this.getTasks({ queryType: 0 }); await this.getTasks({ queryType: 1 }); - // 查上下的任务 + // 查上页的任务 const upQuery = { timeNode: +this.tasks[0].planStart, queryType: 0, queryNum: 6, }; await this.getTasks(upQuery); + + // 查下页的任务 + // 时间基准点=最后一个任务的开始时间+当前时间颗粒度 + const cycle = this.$t.time.computeCycle('天'); + const timeNode = this.$t.time.add(+this.tasks[this.tasks.length - 1].planStart, 1, cycle).valueOf(); const downQuery = { - timeNode: +this.tasks[this.tasks.length - 1].planStart, + timeNode, queryType: 1, queryNum: 6, }; diff --git a/src/store/home/state.js b/src/store/home/state.js index 9b2d85d..4de6820 100644 --- a/src/store/home/state.js +++ b/src/store/home/state.js @@ -14,7 +14,26 @@ const state = { roleId: '', // 当前展示查看的角色id timeNode: new Date().getTime(), // 时间基准点 timeUnit: 4, // // 时间颗粒度 - tasks: [], // 定期任务 + tasks: [ + { + panel: {}, + plugins: [], + planStart: new Date().getTime(), + planDuration: 0, + }, + { + panel: {}, + plugins: [], + planStart: new Date().getTime(), + planDuration: 0, + }, + { + panel: {}, + plugins: [], + planStart: new Date().getTime(), + planDuration: 0, + }, + ], // 定期任务 topEnd: false, // 时间轴向上查任务到顶了 bottomEnd: false, // 时间轴向下查任务到底了 dailyTasks: [], // 日常任务