diff --git a/CHANGELOG.md b/CHANGELOG.md index 730aeff..8c04c31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-09-10) +# 0.1.0 (2021-09-13) ### 🌟 新功能 范围|描述|commitId @@ -154,6 +154,7 @@ - | 时间轴骨架屏修改 | [ca78d02](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/ca78d02) - | 检查交付物传参修改 | [ebe0031](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/ebe0031) - | 检查交付物传参修改 | [37b51bc](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/37b51bc) + - | 添加页面返回功能 解决角色滚动bug | [87ce0f7](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/87ce0f7) - | 滚动id函数优化 | [b351b67](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/b351b67) - | 监听时间基本点 | [033fca0](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/033fca0) - | 角色显示状态修改 | [7d3b906](https://dd.tall.wiki/gitea/wally/tall-mui-3-project/commits/7d3b906) diff --git a/rest/project.http b/rest/project.http index 24f1392..35ef7ec 100644 --- a/rest/project.http +++ b/rest/project.http @@ -1,14 +1,14 @@ ### login # @name login -POST https://test.tall.wiki/gateway/tall/v1.0/users/signin +POST https://www.tall.wiki/gateway/tall/v1.0/users/signin content-type: application/json;charset=utf-8 { "client": 1, "data": { "credential": "123456", - "identifier": "mazhuang" + "identifier": "zy" }, "scene": 0, "type": 3 diff --git a/src/components/TimeLine/TimeLine.vue b/src/components/TimeLine/TimeLine.vue index 8896223..f0abcb9 100644 --- a/src/components/TimeLine/TimeLine.vue +++ b/src/components/TimeLine/TimeLine.vue @@ -53,7 +53,7 @@ export default { async handleScrollTop() { if (!this.tasks || !this.tasks.length || this.showSkeleton) return; const startTime = this.tasks[0].planStart - 0; - if ((this.tasks[0].plugins && this.tasks[0].plugins.length === 0) || this.topEnd) { + if (this.topEnd) { // 没有数据时 自动加载数据 console.warn('滚动到顶部没有数据时: '); const addTasks = setPlaceholderTasks(startTime, true, this.timeGranularity); @@ -61,8 +61,10 @@ export default { } else { // 有数据时 console.warn('滚动到顶部有数据时: '); + const detailId = this.tasks.findIndex(task => task.detailId); + const timeNode = this.tasks[detailId].planStart - 0; const upQuery = { - timeNode: startTime, + timeNode, queryType: 0, queryNum: 6, }; @@ -75,7 +77,7 @@ export default { if (!this.tasks || !this.tasks.length || this.showSkeleton) return; const { tasks, timeGranularity } = this; const startTime = tasks[tasks.length - 1].planStart - 0; - if ((tasks[0].plugins && tasks[0].plugins.length === 0) || this.bottomEnd) { + if (this.bottomEnd) { // 没有数据时 自动加载数据 console.warn('滚动到底部没有数据时: '); const addTasks = setPlaceholderTasks(startTime, false, this.timeGranularity); @@ -83,9 +85,15 @@ export default { } else { // 时间基准点=最后一个任务的开始时间+当前时间颗粒度 console.warn('滚动到底部有数据时: '); - const timeNode = this.$t.time.add(startTime, 1, timeGranularity).valueOf(); + const arr = []; + this.tasks.forEach(task => { + if (task.detailId) { + arr.push(task); + } + }); + const nextQueryTime = +this.$t.time.add(+arr[arr.length - 1].planStart, 1, timeGranularity); const downQuery = { - timeNode, + timeNode: nextQueryTime, queryType: 1, queryNum: 6, }; diff --git a/src/components/TimeLine/component/TimeBox.vue b/src/components/TimeLine/component/TimeBox.vue index 4378346..9ce1ac0 100644 --- a/src/components/TimeLine/component/TimeBox.vue +++ b/src/components/TimeLine/component/TimeBox.vue @@ -85,7 +85,7 @@ export default { computed: { ...mapState('role', ['roleId']), - ...mapState('task', ['timeUnit', 'tasks', 'taskLoading', 'topEnd', 'bottomEnd', 'showSkeleton']), + ...mapState('task', ['timeUnit', 'tasks', 'taskLoading', 'showSkeleton']), ...mapGetters('task', ['startTimeFormat']), }, diff --git a/src/pages/project/project.vue b/src/pages/project/project.vue index 17f3ae1..8855fae 100644 --- a/src/pages/project/project.vue +++ b/src/pages/project/project.vue @@ -130,15 +130,21 @@ export default { // 预加载 上下的定期任务 function preloadFn(that) { const detailId = that.tasks.findIndex(task => task.detailId); + const arr = []; + that.tasks.forEach(task => { + if (task.detailId) { + arr.push(task); + } + }); if (detailId !== -1) { // 只要有1个真实的任务 就预加载上下周期的任务 const { pageCount } = that.$t.task; that.$nextTick(() => { // 向上拿数据 const { tasks, timeGranularity } = that; - that.getTasks({ timeNode: +tasks[0].planStart, queryType: 0, queryNum: pageCount }); + that.getTasks({ timeNode: +tasks[detailId].planStart, queryType: 0, queryNum: pageCount }); // 向下拿数据 - const nextQueryTime = +that.$t.time.add(+tasks[tasks.length - 1].planStart, 1, timeGranularity); + const nextQueryTime = +that.$t.time.add(+arr[arr.length - 1].planStart, 1, timeGranularity); that.getTasks({ timeNode: nextQueryTime, queryType: 1, queryNum: pageCount }); }); } else { @@ -179,13 +185,11 @@ export default { // 没有数据 继续加载刻度 if (data && data.length) { this.replacePrevData(data, params.queryType); + params.queryType === 0 ? this.setTopEnd(false) : this.setBottomEnd(false); + } else { + // TODO: 0 -> 向上 1 -> 向下 + params.queryType === 0 ? this.setPrevPlaceholderTasks() : this.setNextPlaceholderTasks(); } - - // else { - // TODO: 0 -> 向上 1 -> 向下 - - // params.queryType === 0 ? this.setPrevPlaceholderTasks() : this.setNextPlaceholderTasks(); - // } if (this.tasks.length && fn) { fn(this); }