diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b97c0..61874c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.0 (2021-11-22) +# 0.1.0 (2021-11-23) ### 🌟 新功能 范围|描述|commitId @@ -60,6 +60,7 @@ - | 添加已测评页面,压缩代码 | [551e5ea](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/551e5ea) - | 添加引导页 | [4293f5a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/4293f5a) - | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2b81bbc) + - | 添加药物使用记录api | [7ce9b7b](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7ce9b7b) - | 添加药物使用记录界面 | [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) diff --git a/src/apis/yanyuan.js b/src/apis/yanyuan.js index 3c2366d..12c47bd 100644 --- a/src/apis/yanyuan.js +++ b/src/apis/yanyuan.js @@ -40,6 +40,9 @@ const install = (Vue, vm) => { vm.$u.api.queryMedicine = param => vm.$u.post(`${yanyuan}/medicine/query`, param); // 修改药物使用 vm.$u.api.updateMedicine = param => vm.$u.post(`${yanyuan}/medicine/update`, param); + + // 查询训练计划详情 + vm.$u.api.getTrainDetail = param => vm.$u.post(`${yanyuan}/trainPlan/detail`, param); }; export default { install }; diff --git a/src/common/styles/tailwind.scss b/src/common/styles/tailwind.scss index 4b986fd..1e489d8 100644 --- a/src/common/styles/tailwind.scss +++ b/src/common/styles/tailwind.scss @@ -327,6 +327,10 @@ border-bottom: 1px solid #f8f8f8; } +.border-l { + border-left: 2px solid #d9dde2; +} + .box-border { box-sizing: border-box; } diff --git a/src/config/yyInfo.js b/src/config/yyInfo.js index d50591f..849dba2 100644 --- a/src/config/yyInfo.js +++ b/src/config/yyInfo.js @@ -375,7 +375,7 @@ export const infoList = [ /** * 药物使用记录 * 展示类型: showType: 1 标题+折叠, 2 直接展示 - * 试题类型, type:1 单选, 3 数字输入框,4 数字输入框+单选 + * 试题类型, type:1 单选, 3 数字输入框,4 数字输入框+单选,5 其他药物 */ export const medicineInfo = [ { diff --git a/src/pagesProject/project/components/ConfigInfo/components/Medicine.vue b/src/pagesProject/project/components/ConfigInfo/components/Medicine.vue index d305e08..b3c6d1c 100644 --- a/src/pagesProject/project/components/ConfigInfo/components/Medicine.vue +++ b/src/pagesProject/project/components/ConfigInfo/components/Medicine.vue @@ -1,77 +1,45 @@ diff --git a/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue b/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue new file mode 100644 index 0000000..f81d158 --- /dev/null +++ b/src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue @@ -0,0 +1,264 @@ + + + + + diff --git a/src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue b/src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue index 1525182..f8cb052 100644 --- a/src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue +++ b/src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue @@ -32,8 +32,8 @@ 轻松完成 - - + + @@ -73,12 +73,15 @@ export default { ...mapMutations('task', ['setShowDetail']), // 修改展开状态 - changeShowState() { + async changeShowState(type) { + let train = await this.getTrainDetail(type); + // 修改展开状态 const { itemIndex, taskId } = this; const taskIndex = this.tasks.findIndex(item => item.id === taskId); const options = { taskIndex, itemIndex, + train, }; this.setShowDetail(options); @@ -87,6 +90,7 @@ export default { } }, + // 设置休息图片高度 setPicHeight() { this.$nextTick(() => { const query = uni.createSelectorQuery().in(this); @@ -100,6 +104,21 @@ export default { .exec(); }); }, + + /** + * 查询训练计划详情 + * @param { String } recordId 训练计划ID + */ + async getTrainDetail(type) { + try { + if (type) return; + const params = { recordId: this.task.id }; + const data = await this.$u.api.getTrainDetail(params); + return data; + } catch (error) { + console.error('error: ', error); + } + }, }, }; diff --git a/src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue b/src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue index 7e31ec0..95f58de 100644 --- a/src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue +++ b/src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue @@ -1,17 +1,17 @@ @@ -30,11 +30,11 @@ import { mapState, mapMutations, mapGetters } from 'vuex'; import { setPlaceholderTasks } from '@/utils/task'; import TimeBoxIn from './component/TimeBoxIn.vue'; -import TimeBoxOut from './component/TimeBoxOut.vue'; +// import TimeBoxOut from './component/TimeBoxOut.vue'; export default { name: 'TimeLine', - components: { TimeBoxIn, TimeBoxOut }, + components: { TimeBoxIn }, data() { return { top: 0 }; @@ -166,6 +166,7 @@ export default { diff --git a/src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue b/src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue index d3875eb..c2ddf1e 100644 --- a/src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue +++ b/src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue @@ -9,44 +9,46 @@ {{ $moment(+task.array[0].planStart).format('YYYY年MM月DD日') }} - - - - - - - - + + + + + + + + + + - - + - - - - - - - + + + + + + + + - - + + @@ -108,8 +110,8 @@ export default { * @param {string} taskId 任务id */ onClickTask(planStart, taskId) { - const param = { roleId: this.roleId, timeNode: planStart, timeUnit: this.timeUnit }; - this.getGlobal(param); + // const param = { roleId: this.roleId, timeNode: planStart, timeUnit: this.timeUnit }; + // this.getGlobal(param); this.$t.storage.setStorageSync('taskId', taskId); this.$t.storage.setStorageSync('roleId', this.roleId); }, @@ -128,7 +130,6 @@ export default { .plugin { margin-top: 8px; margin-bottom: 8px; - margin-left: 15px; } ::v-deep .ml-2 { margin-left: 16px; diff --git a/src/pagesProject/project/project.vue b/src/pagesProject/project/project.vue index 4d5cae2..36a9bbb 100644 --- a/src/pagesProject/project/project.vue +++ b/src/pagesProject/project/project.vue @@ -275,12 +275,10 @@ export default { if (arr && arr.length) { item.id = arr[0].id; item.array = [...arr]; - // oldTasks.splice(index, 1, [...arr]); // 这里加入的数据是array类型的, [{},{},[],[],{}] oldTasks.splice(index, 1, item); // 这里加入的数据是array类型的, [{},{},[],[],{}] } }); - // oldTasks = flatten(oldTasks); // 1维拍平 this.clearTasks(); // setUpTasks setUpTasks 的限制 需要清空 type === 0 ? this.setUpTasks(oldTasks) : this.setDownTasks(oldTasks); }, diff --git a/src/store/task/mutations.js b/src/store/task/mutations.js index f145852..130f1d4 100644 --- a/src/store/task/mutations.js +++ b/src/store/task/mutations.js @@ -217,6 +217,9 @@ const mutations = { * @param {Boolean} data */ setShowDetail(state, data) { + if (data.train) { + state.tasks[data.taskIndex].array[data.itemIndex].data.train = data.train; + } state.tasks[data.taskIndex].array[data.itemIndex].data.showDetail = !state.tasks[data.taskIndex].array[data.itemIndex].data.showDetail; }, };