diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b60933..7d69f1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# 0.1.0 (2021-11-18)
+# 0.1.0 (2021-11-19)
### 🌟 新功能
范围|描述|commitId
@@ -60,6 +60,7 @@
- | 添加引导页 | [4293f5a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4293f5a)
- | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2b81bbc)
- | 添加药物使用记录界面 | [425cb63](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/425cb63)
+ - | 添加训练计划详情 | [49f64ca](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/49f64ca)
- | 添加设置界面 | [7ca0c59](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7ca0c59)
- | 添加输入工具码界面 | [8c120bc](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/8c120bc)
- | 添加项目排序 | [a0b491b](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/a0b491b)
diff --git a/src/components/Evaluated/components/EvaluatedDetail.vue b/src/components/Evaluated/components/EvaluatedDetail.vue
index ad3049e..63516d0 100644
--- a/src/components/Evaluated/components/EvaluatedDetail.vue
+++ b/src/components/Evaluated/components/EvaluatedDetail.vue
@@ -29,8 +29,14 @@
-
- 过程记录
+
+ 训练结果
+
+
+
+ 过程还原
+
+
@@ -38,9 +44,10 @@
diff --git a/src/components/Evaluated/components/ProcessRestore.vue b/src/components/Evaluated/components/ProcessRestore.vue
new file mode 100644
index 0000000..2c78a38
--- /dev/null
+++ b/src/components/Evaluated/components/ProcessRestore.vue
@@ -0,0 +1,9 @@
+
+ 过程还原
+
+
+
+
+
diff --git a/src/components/Evaluated/components/ResultLevel.vue b/src/components/Evaluated/components/ResultLevel.vue
index d706746..d75bff6 100644
--- a/src/components/Evaluated/components/ResultLevel.vue
+++ b/src/components/Evaluated/components/ResultLevel.vue
@@ -1,6 +1,6 @@
-
-
+
+
- {{ resultIndex + 1 }}
- 1分钟50秒
+
+ {{ resultIndex + 1 }}
+ {{ $moment(trains.finishTime - 0).format('m分钟ss秒') }}
@@ -31,10 +31,6 @@ export default {
data() {
return {
- // trains: {
- // finishResult: 3,
- // finishTime: 15,
- // },
levels: [
{
value: 0.5,
@@ -74,8 +70,10 @@ export default {
query
.selectAll('.box')
.boundingClientRect(data => {
- this.width = data[0].width;
- this.setLevel();
+ if (data && data.length) {
+ this.width = data[0].width;
+ this.setLevel();
+ }
})
.exec();
});
@@ -160,10 +158,10 @@ export default {
}
.num {
- width: 40rpx;
- height: 40rpx;
+ width: 30rpx;
+ height: 30rpx;
text-align: center;
- line-height: 40rpx;
+ line-height: 30rpx;
border-radius: 50%;
border: 1px solid $uni-bg-color-blue;
color: $uni-bg-color-blue;
diff --git a/src/components/TimeLine/TimeLine.vue b/src/components/TimeLine/TimeLine.vue
index 9fef7ed..328c0d1 100644
--- a/src/components/TimeLine/TimeLine.vue
+++ b/src/components/TimeLine/TimeLine.vue
@@ -45,6 +45,7 @@ export default {
// 滚动
scroll(e) {
+ console.log('e: ', e);
this.top = e.detail.scrollTop;
this.setShrink(this.top > this.scrollTop);
this.setScrollTop(this.top);
@@ -55,7 +56,7 @@ export default {
if (!this.tasks || !this.tasks.length || this.showSkeleton) return;
let startTime = null;
if (this.tasks[0].length) {
- startTime = this.tasks[0][0].planStart - 0;
+ startTime = this.tasks[0].array[0].planStart - 0;
} else {
startTime = this.tasks[0].planStart - 0;
}
@@ -77,7 +78,7 @@ export default {
let index = null;
let itemIndex = null;
for (let i = 0; i < this.tasks.length; i++) {
- const task = this.tasks[i];
+ const task = this.tasks[i].array;
if (task && task.length) {
index = i;
itemIndex = task.findIndex(item => item.detailId);
@@ -86,7 +87,7 @@ export default {
}
}
}
- timeNode = this.tasks[index][itemIndex].planStart - 0;
+ timeNode = this.tasks[index].array[itemIndex].planStart - 0;
}
const upQuery = {
timeNode,
@@ -102,8 +103,8 @@ export default {
if (!this.tasks || !this.tasks.length || this.showSkeleton) return;
const { tasks, timeGranularity } = this;
let startTime = null;
- if (tasks[tasks.length - 1].length) {
- startTime = tasks[tasks.length - 1][0].planStart - 0;
+ if (tasks[tasks.length - 1].array && tasks[tasks.length - 1].array.length) {
+ startTime = tasks[tasks.length - 1].array[0].planStart - 0;
} else {
startTime = tasks[tasks.length - 1].planStart - 0;
}
@@ -157,7 +158,7 @@ export default {
// 没有本地记录的taskId
// 找到当前时间基准线的任务id 记录 并滚动到当前时间基准线
for (let i = 0; i < this.tasks.length; i++) {
- const task = this.tasks[i];
+ const task = this.tasks[i].array;
if (task && task.length) {
item = task.find(item => this.$moment(+item.planStart).isSame(this.timeNode, this.timeGranularity));
if (item) {
@@ -165,6 +166,7 @@ export default {
}
}
}
+ console.log('跳转: ', `a${item.id}`);
item && this.setScrollToTaskId(`a${item.id}`); // 有这个task 就记录他的id
// const task = this.tasks.find(item => this.$moment(+item.planStart).isSame(this.timeNode, this.timeGranularity));
// task && this.setScrollToTaskId(`a${task.id}`); // 有这个task 就记录他的id
diff --git a/src/components/TimeLine/component/TimeBox.vue b/src/components/TimeLine/component/TimeBox.vue
index 9fd93e9..91f2416 100644
--- a/src/components/TimeLine/component/TimeBox.vue
+++ b/src/components/TimeLine/component/TimeBox.vue
@@ -3,12 +3,65 @@
+ AAA
+
+
+
+
+
+ {{ $moment(+task.array[0].planStart).format(startTimeFormat) }}
+ {{ $moment(+task.array[0].planStart).format('D日') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
- {{ $moment(+task.planStart).format(startTimeFormat) }}
+ {{ $moment(+task.planStart).format(startTimeFormat) }}
{{ $moment(+task.planStart).format('D日') }}
@@ -53,58 +106,6 @@
-
-
-
-
-
- {{ $moment(+task[0].planStart).format(startTimeFormat) }}
- {{ $moment(+task[0].planStart).format('D日') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -131,11 +132,9 @@ export default {
};
},
- watch: {},
-
computed: {
...mapState('role', ['roleId']),
- ...mapState('task', ['timeUnit', 'tasks', 'taskLoading', 'showSkeleton', 'isEvaluated']),
+ ...mapState('task', ['timeUnit', 'tasks', 'taskLoading', 'showSkeleton', 'isEvaluated', 'scrollToTaskId']),
...mapGetters('task', ['startTimeFormat']),
},
diff --git a/src/components/UCharts/UCharts.vue b/src/components/UCharts/UCharts.vue
index ef96e64..ff90657 100644
--- a/src/components/UCharts/UCharts.vue
+++ b/src/components/UCharts/UCharts.vue
@@ -101,8 +101,8 @@ export default {
},
touchStart(e) {
canvases[this.canvasId].showToolTip(e, {
- format: function (item, category) {
- return category + ' ' + item.name + ':' + item.data;
+ format: function (item) {
+ return item.data;
},
});
canvases[this.canvasId].scrollStart(e);
@@ -114,7 +114,7 @@ export default {
canvases[this.canvasId].scrollEnd(e);
},
error(e) {
- console.log(e);
+ console.log('e: ', e);
},
},
};
diff --git a/src/pagesProject/project/project copy.vue b/src/pagesProject/project/project copy.vue
deleted file mode 100644
index 26f75b7..0000000
--- a/src/pagesProject/project/project copy.vue
+++ /dev/null
@@ -1,439 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pagesProject/project/project.vue b/src/pagesProject/project/project.vue
index b8c15c8..8d3fd8b 100644
--- a/src/pagesProject/project/project.vue
+++ b/src/pagesProject/project/project.vue
@@ -42,7 +42,16 @@ export default {
computed: {
...mapState('user', ['user', 'token']),
...mapState('role', ['visibleRoles', 'roleId']),
- ...mapState('task', ['timeNode', 'timeUnit', 'tasks', 'regularTask', 'newProjectInfo', 'showSkeleton', 'showScrollTo']),
+ ...mapState('task', [
+ 'timeNode',
+ 'timeUnit',
+ 'tasks',
+ 'regularTask',
+ 'newProjectInfo',
+ 'showSkeleton',
+ 'showScrollTo',
+ 'scrollToTaskId',
+ ]),
...mapState('project', ['project']),
...mapGetters('task', ['timeGranularity']),
...mapGetters('project', ['projectId']),
@@ -239,7 +248,6 @@ export default {
} else {
startTime = +this.tasks[this.tasks.length - 1].planStart;
}
- console.log('startTime设置时间轴向下的空数据: ', startTime);
const initData = setPlaceholderTasks(startTime, false, this.timeGranularity);
this.setDownTasks(initData);
},
@@ -255,12 +263,15 @@ export default {
const { timeGranularity } = this;
let oldTasks = this.fillPlaceholderTask({ tasks: this.tasks, data, timeGranularity }); // 已经上下补齐时间刻度的
// 遍历对比 用任务替换刻度
- // TODO: tasks越来越多 遍历越来越多 需要优化
+ // TODO: tasks越来越多 遍历越来越多 需要优化.
oldTasks.forEach((taskItem, index) => {
+ let item = {};
const arr = data.filter(dataItem => this.$moment(+dataItem.planStart).isSame(+taskItem.planStart, timeGranularity));
-
if (arr && arr.length) {
- oldTasks.splice(index, 1, [...arr]); // 这里加入的数据是array类型的, [{},{},[],[],{}]
+ item.id = arr[0].id;
+ item.array = [...arr];
+ // oldTasks.splice(index, 1, [...arr]); // 这里加入的数据是array类型的, [{},{},[],[],{}]
+ oldTasks.splice(index, 1, item); // 这里加入的数据是array类型的, [{},{},[],[],{}]
}
});
@@ -269,6 +280,15 @@ export default {
type === 0 ? this.setUpTasks(oldTasks) : this.setDownTasks(oldTasks);
},
+ // 生成指定位数随机数
+ randomNum(n) {
+ var t = '';
+ for (var i = 0; i < n; i++) {
+ t += Math.floor(Math.random() * 10);
+ }
+ return t;
+ },
+
/**
* 超出旧数据上、下限 补齐时间刻度到新数据的起始时间颗粒度
*/
diff --git a/src/store/task/mutations.js b/src/store/task/mutations.js
index 50161b9..f145852 100644
--- a/src/store/task/mutations.js
+++ b/src/store/task/mutations.js
@@ -217,7 +217,7 @@ const mutations = {
* @param {Boolean} data
*/
setShowDetail(state, data) {
- state.tasks[data.taskIndex][data.itemIndex].data.showDetail = !state.tasks[data.taskIndex][data.itemIndex].data.showDetail;
+ state.tasks[data.taskIndex].array[data.itemIndex].data.showDetail = !state.tasks[data.taskIndex].array[data.itemIndex].data.showDetail;
},
};