Browse Source

perf(时间轴显示修改): 时间轴显示修改

develop
song 4 years ago
parent
commit
40fa028479
  1. 3
      CHANGELOG.md
  2. 3
      src/apis/yanyuan.js
  3. 4
      src/common/styles/tailwind.scss
  4. 2
      src/config/yyInfo.js
  5. 165
      src/pagesProject/project/components/ConfigInfo/components/Medicine.vue
  6. 264
      src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue
  7. 25
      src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue
  8. 17
      src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue
  9. 17
      src/pagesProject/project/components/TimeLine/TimeLine.vue
  10. 75
      src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue
  11. 2
      src/pagesProject/project/project.vue
  12. 3
      src/store/task/mutations.js

3
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)

3
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 };

4
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;
}

2
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 = [
{

165
src/pagesProject/project/components/ConfigInfo/components/Medicine.vue

@ -1,77 +1,45 @@
<template>
<view style="border: 1px solid #e5e5e5">
<view v-for="(item, index) in medicineInfo" :key="index">
<view class="pl-4 py-3 font-bold border-b">{{ item.title }}</view>
<template v-for="(colItem, itemIndex) in item.date">
<view :key="itemIndex" class="flex justify-between items-center text-sm border-b">
<view class="ml-4 my-3">{{ colItem.name }}</view>
<!-- 单选 -->
<view v-if="colItem.type === 1">
<u-radio-group v-model="colItem.value" class="flex items-center">
<u-radio
@change="change(radioIndex, index, itemIndex, colItem.type)"
v-for="(radioItem, radioIndex) in colItem.radioList"
:key="radioIndex"
:name="radioItem"
>
{{ radioItem }}
</u-radio>
</u-radio-group>
<view class="px-3 bg-white">
<MedicineDetail @showToast="showToast" v-if="show" />
<view v-else>
<view v-for="(item, index) in itemList" :key="index" :style="headStyle" class="py-3">
<!-- 头部 -->
<view class="w-full flex flex-row items-center justify-between text-sm text-gray-500">
<view class="flex flex-row items-center">
药物使用记录
<text v-if="item.testAt">{{ item.testAt }}</text>
</view>
<!-- 数字输入框 -->
<view v-if="colItem.type === 3" class="pr-7">
<u-input
v-model="colItem.value"
type="number"
:clearable="false"
input-align="right"
@blur="change(colItem.value, index, itemIndex, colItem.type)"
/>
</view>
<!-- 数字输入框+单选 -->
<view v-if="colItem.type === 4" class="flex flex-nowrap items-center">
<u-input
:clearable="false"
class="flex-1 mr-3"
v-model="colItem.value"
placeholder="每日总剂量(单位: mg)"
type="number"
input-align="center"
@focus="cancelChecked(index, itemIndex)"
@blur="change(colItem.value, index, itemIndex, colItem.type)"
/>
<u-checkbox-group @change="change($event, index, itemIndex, 99)">
<u-checkbox v-model="colItem.checked" shape="circle">未服用</u-checkbox>
</u-checkbox-group>
<view class="flex flex-row">
<u-icon name="arrow-up" v-if="item.open" @click="changeOpen(index)"></u-icon>
<u-icon name="arrow-down" v-else @click="changeOpen(index)"></u-icon>
</view>
</view>
</template>
<view class="w-full h-2 bg-gray-100" v-if="index !== medicineInfo.length - 1"></view>
</view>
<view class="p-4">
<u-button type="primary" v-if="show" @click="addMedicine">添加</u-button>
<!-- 内容区 -->
<view v-if="item.open" class="w-full mt-3">
<MedicineDetail :detail="item" @showToast="showToast" />
</view>
</view>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
import { medicineInfo } from '@/config/yyInfo';
import MedicineDetail from './MedicineDetail';
export default {
name: 'Info',
components: { MedicineDetail },
data() {
return {
show: true,
itemList: [],
headStyle: {
backgroundColor: '#fff',
height: '46px',
paddingLeft: '1rem',
fontSize: '0.875rem',
borderBottom: '1px solid #f8f8f8',
fontSize: '16px',
width: '100%',
},
bodyStyle: { paddingLeft: '1rem' },
medicineInfo,
show: true,
params: {},
patientName: '传小控',
};
},
@ -82,20 +50,20 @@ export default {
},
methods: {
cancelChecked(index, itemIndex) {
this.medicineInfo[index].date[itemIndex].checked = false;
//
changeOpen(index) {
this.itemList.forEach((item, i) => {
if (i === index) {
item.open = !item.open;
} else {
item.open = false;
}
});
},
change(e, index, itemIndex, type) {
let item = this.medicineInfo[index].date[itemIndex];
if (type === 99) {
item.checked = true;
item.value = null;
this.params[item.label] = '未服用';
} else {
item.value = e;
this.params[item.label] = item.value;
}
//
showToast(type, title) {
this.$emit('showToast', type, title);
},
/**
@ -105,62 +73,25 @@ export default {
async queryMedicine() {
try {
const params = { projectId: this.projectId };
const data = await this.$u.api.queryMedicine(params);
if (!data || !data.id) {
const date = await this.$u.api.queryMedicine(params);
if (!date.length) {
this.show = true;
} else {
this.show = false;
date.forEach((item, index) => {
if (index === 0) {
item.open = true;
} else {
item.open = false;
}
});
this.itemList = date;
}
this.setDate(date);
} catch (error) {
console.error('error: ', error);
}
},
/**
* 添加药物使用
* @param { Object } params
*/
async addMedicine() {
try {
const params = this.params;
if (!this.validationRequired(params)) return;
params.projectId = this.projectId;
await this.$u.api.addMedicine(params);
this.$emit('showToast', 'success', '药物使用添加成功');
this.show = false;
} catch (error) {
console.error('error: ', error);
this.$emit('showToast', 'error', '药物使用添加失败');
}
},
//
validationRequired() {
let isComplete = true;
for (let i = 0; i < this.medicineInfo.length; i++) {
const info = this.medicineInfo[i];
for (let j = 0; j < info.date.length; j++) {
const item = info.date[j];
if (item.type !== 4) {
if (!item.value) {
this.$t.ui.showToast(`请填写${item.name}`);
isComplete = false;
break;
}
} else {
if (!item.value && !item.checked) {
this.$t.ui.showToast(`请填写${item.name}`);
isComplete = false;
break;
}
}
}
if (!isComplete) {
break;
}
}
if (isComplete) return true;
},
},
};
</script>

264
src/pagesProject/project/components/ConfigInfo/components/MedicineDetail.vue

@ -0,0 +1,264 @@
<template>
<view style="border: 1px solid #e5e5e5">
<view v-for="(item, index) in medicineInfo" :key="index">
<view class="pl-4 py-3 font-bold border-b">{{ item.title }}</view>
<template v-for="(colItem, itemIndex) in item.date">
<view :key="itemIndex" class="flex justify-between items-center text-sm border-b">
<view class="ml-4 my-3">{{ colItem.name }}</view>
<!-- 单选 -->
<view v-if="colItem.type === 1">
<u-radio-group v-model="colItem.value" class="flex items-center">
<u-radio
@change="change(radioIndex, index, itemIndex, colItem.type)"
v-for="(radioItem, radioIndex) in colItem.radioList"
:key="radioIndex"
:name="radioItem"
>
{{ radioItem }}
</u-radio>
</u-radio-group>
</view>
<!-- 数字输入框 -->
<view v-if="colItem.type === 3" class="pr-7">
<u-input
v-model="colItem.value"
type="number"
:clearable="false"
input-align="right"
@blur="change(colItem.value, index, itemIndex, colItem.type)"
/>
</view>
<!-- 数字输入框+单选 -->
<view v-if="colItem.type === 4" class="flex flex-nowrap items-center">
<u-input
:clearable="false"
class="flex-1 mr-3"
v-model="colItem.value"
placeholder="每日总剂量(单位: mg)"
type="number"
input-align="center"
@focus="cancelChecked(index, itemIndex)"
@blur="change(colItem.value, index, itemIndex, colItem.type)"
/>
<u-checkbox-group @change="change($event, index, itemIndex, 99)">
<u-checkbox v-model="colItem.checked" shape="circle">未服用</u-checkbox>
</u-checkbox-group>
</view>
</view>
</template>
<view class="w-full h-2 bg-gray-100" v-if="index !== medicineInfo.length - 1"></view>
</view>
<view class="flex flex-nowrap border-b py-1">
<u-input
:clearable="false"
class="pl-4"
style="width: 100px"
placeholder="其他药物"
v-model="otherName.value"
@blur="changeOther(otherName)"
/>
<u-input
:clearable="false"
class="flex-1"
placeholder="每日总剂量(单位: mg)"
type="number"
v-model="otherMedicine.value"
@blur="changeOther(otherMedicine)"
/>
</view>
<view class="p-4">
<u-button type="primary" @click="addMedicine" v-if="show">添加</u-button>
</view>
</view>
</template>
<script>
import { mapGetters } from 'vuex';
import { medicineInfo } from '@/config/yyInfo';
export default {
name: 'Info',
data() {
return {
medicineInfo,
show: true,
params: {},
otherName: {
label: 'sevName',
value: '',
name: '其他药物',
},
otherMedicine: {
label: 'sevMedicine',
value: '',
name: '其他药物服用情况',
},
};
},
computed: mapGetters('project', ['projectId']),
mounted() {
this.queryMedicine();
},
methods: {
cancelChecked(index, itemIndex) {
this.medicineInfo[index].date[itemIndex].checked = false;
},
change(e, index, itemIndex, type) {
let item = this.medicineInfo[index].date[itemIndex];
if (type === 99) {
item.checked = true;
item.value = null;
if (!this.show) {
this.updateMedicine(item);
} else {
this.params[item.label] = '未服用';
}
} else {
item.value = e;
if (!this.show) {
this.updateMedicine(item);
} else {
this.params[item.label] = item.value;
}
}
},
changeOther(item) {
if (!this.show) {
this.updateMedicine(item);
} else {
this.params[item.label] = item.value;
}
},
/**
* 查询药物使用
* @param { String } projectId 项目id
*/
async queryMedicine() {
try {
const params = { projectId: this.projectId };
const date = await this.$u.api.queryMedicine(params);
if (!date.length) {
this.show = true;
} else {
this.show = false;
}
this.setDate(date);
} catch (error) {
console.error('error: ', error);
}
},
/**
* 添加药物使用
* @param { Object } params
*/
async addMedicine() {
try {
const params = this.params;
if (!this.validationRequired(params)) return;
params.projectId = this.projectId;
await this.$u.api.addMedicine(params);
this.$emit('showToast', 'success', '药物使用添加成功');
this.show = false;
} catch (error) {
console.error('error: ', error);
this.$emit('showToast', 'error', '药物使用添加失败');
}
},
//
validationRequired() {
let isComplete = true;
for (let i = 0; i < this.medicineInfo.length; i++) {
const info = this.medicineInfo[i];
for (let j = 0; j < info.date.length; j++) {
const item = info.date[j];
if (item.type !== 4) {
if (!item.value) {
this.$t.ui.showToast(`请填写${item.name}`);
isComplete = false;
break;
}
} else {
if (!item.value && !item.checked) {
this.$t.ui.showToast(`请填写${item.name}`);
isComplete = false;
break;
}
}
}
if (!isComplete) {
break;
}
}
if (!this.otherName.value) {
this.$t.ui.showToast(`请填写${this.otherName.name}`);
isComplete = false;
return;
}
if (!this.otherMedicine.value) {
this.$t.ui.showToast(`请填写${this.otherMedicine.name}`);
isComplete = false;
return;
}
if (isComplete) return true;
},
//
setDate(date) {
if (!date || !date.id) return;
const { medicineInfo, otherName, otherMedicine } = this;
otherName.value = date[otherName.label];
otherMedicine.value = date[otherMedicine.label];
for (let i = 0; i < medicineInfo.length; i++) {
const info = medicineInfo[i];
for (let j = 0; j < info.date.length; j++) {
const item = info.date[j];
switch (item.type) {
case 1:
item.value = date[item.label] === '0' ? '未作测评' : '已测评';
break;
case 3:
item.value = date[item.label];
break;
default:
if (date[item.label] !== '未服用') {
item.value = date[item.label];
} else {
item.value = null;
item.checked = true;
}
break;
}
}
}
},
/**
* 修改药物使用
* @param { Object } params
*/
async updateMedicine(item) {
try {
const params = { projectId: this.projectId };
params[item.label] = item.value;
console.log('params: ', params);
await this.$u.api.updateMedicine(params);
} catch (error) {
console.error('error: ', error);
this.$emit('showToast', 'error', '修改失败');
}
},
},
};
</script>
<style lang="scss" scoped></style>

25
src/pagesProject/project/components/Evaluated/EvaluatedXLJH.vue

@ -32,8 +32,8 @@
轻松完成
</view>
</view>
<u-icon name="arrow-up" color="#909399" v-if="task.data.showDetail" @click="changeShowState"></u-icon>
<u-icon name="arrow-down" color="#909399" v-else @click="changeShowState"></u-icon>
<u-icon name="arrow-up" color="#909399" v-if="task.data.showDetail" @click="changeShowState(task.data.showDetail)"></u-icon>
<u-icon name="arrow-down" color="#909399" v-else @click="changeShowState(task.data.showDetail)"></u-icon>
</view>
<!-- 详情 -->
<view v-if="task.data.showDetail">
@ -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);
}
},
},
};
</script>

17
src/pagesProject/project/components/Evaluated/components/EvaluatedDetail.vue

@ -1,17 +1,17 @@
<template>
<view class="my-2">
<!-- 工具箱 -->
<view v-if="train.tools.length">
<view v-if="train.tools.length" class="mb-2">
<u-radio-group v-model="radioDefaultValue">
<u-radio @change="radioChange(tool)" v-for="(tool, index) in train.tools" :key="index" :name="item.toolId">
{{ item.toolCode }}
<u-radio @change="radioChange(tool)" v-for="(tool, index) in train.tools" :key="index" :name="tool.toolId">
{{ tool.toolCode }}
</u-radio>
</u-radio-group>
</view>
<view v-if="train.contentDetails.length" class="text-xs">
<!-- 训练目标 训练元素 训练原理 训练步骤 -->
<view v-for="(purpose, purposeIndex) in train.contentDetails" :key="purposeIndex">
<view class="font-bold">{{
<view class="font-bold my-1">{{
purpose.type === 0
? '训练目标'
: purpose.type === 1
@ -22,11 +22,11 @@
? '训练步骤'
: ''
}}</view>
<view v-for="detail in purpose.details" :key="detail.id">
<view v-if="detail.content" class="text-gray-200">
<view v-for="detail in purpose.details" :key="detail.id" style="line-height: 1.25rem">
<view v-if="detail.content" class="text-gray-400">
{{ detail.content }}
</view>
<view v-if="detail.supplementaries" class="text-gray-200">
<view v-if="detail.supplementaries" class="text-gray-400">
<view v-for="(img, imgIndex) in detail.supplementaries" :key="imgIndex">
<img :src="img.src" class="w-full" />
</view>
@ -85,8 +85,7 @@ export default {
radioDefaultValue() {
if (this.train && this.train.tools && this.train.tools.length) {
const index = this.train.tools.findIndex(tool => tool.useStatus === 1);
console.log('index: ', index);
if (index) {
if (index !== -1) {
return this.train.tools[index].toolId;
}
}

17
src/pagesProject/project/components/TimeLine/TimeLine.vue

@ -9,19 +9,19 @@
:upper-threshold="50"
:scroll-into-view="scrollToTaskId"
@scroll="scroll"
@scrolltolower="handleScrollBottom"
@scrolltoupper="handleScrollTop"
id="scroll"
@scrolltoupper="handleScrollTop"
@scrolltolower="handleScrollBottom"
>
<!-- 时间轴 -->
<!-- <u-divider bg-color="#f3f4f6" class="pt-5" fontSize="14px" v-if="topEnd">已到顶部</u-divider> -->
<view class="w-full bg-gray text-gray-200 text-center py-4" v-if="topEnd">----------已到顶部----------</view>
<view class="column">
<view :key="task.id" v-for="task in tasks" :id="`a${task.id}`">
<TimeBoxIn :task="task" :taskId="task.id" v-if="task.array && task.array.length" />
<TimeBoxOut :task="task" :taskId="task.id" v-else />
<!-- <TimeBoxOut :task="task" :taskId="task.id" v-else /> -->
</view>
</view>
<!-- <u-divider bg-color="#f3f4f6" class="pb-5" fontSize="14px" v-if="bottomEnd">我也是有底线的</u-divider> -->
<view class="w-full bg-gray text-gray-200 text-center pt-4 pb-12" v-if="bottomEnd">----------我也是有底线的----------</view>
</scroll-view>
</template>
@ -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 {
<style scoped lang="scss">
.column {
padding: 24px 14px;
// padding: 24px 14px;
padding: 0 14px;
}
</style>

75
src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue

@ -9,44 +9,46 @@
<view v-else>{{ $moment(+task.array[0].planStart).format('YYYY年MM月DD日') }}</view>
</view>
</view>
<view v-for="(item, itemIndex) in task.array" :key="item.id">
<view class="border-l-2 border-gray-300 plugin">
<view class="h-3" v-if="item.process === 4"></view>
<view class="ml-3 overflow-hidden shadow-lg task-box">
<u-card
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
class="h-16"
margin="0"
v-if="showSkeleton"
>
<view slot="body">
<view>
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
<view class="border-l" style="margin-left: 15px">
<view v-for="(item, itemIndex) in task.array" :key="item.id">
<view class="plugin">
<view class="h-3" v-if="item.process === 4"></view>
<view class="ml-3 overflow-hidden shadow-lg task-box">
<u-card
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
class="h-16"
margin="0"
v-if="showSkeleton"
>
<view slot="body">
<view>
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
</view>
</view>
</view>
</u-card>
</u-card>
<u-card
@click="onClickTask(item.planStart - 0, item.id)"
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
class="h-16"
margin="0"
v-if="task.array && task.array.length && item.process !== 4 && !showSkeleton"
>
<view slot="body">
<view class="p-0 u-col-between">
<NotEvaluated :task="item" v-if="item.data.mentalTest.finishStatus === 0" />
<view v-else>
<EvaluatedNLCP :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 0" />
<EvaluatedXLJH :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 1" />
<u-card
@click="onClickTask(item.planStart - 0, item.id)"
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
class="h-16"
margin="0"
v-if="task.array && task.array.length && item.process !== 4 && !showSkeleton"
>
<view slot="body">
<view class="p-0 u-col-between">
<NotEvaluated :task="item" v-if="item.data.mentalTest.finishStatus === 0" />
<view v-else>
<EvaluatedNLCP :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 0" />
<EvaluatedXLJH :task="item" :taskId="taskId" :itemIndex="itemIndex" v-if="item.data.type === 1" />
</view>
</view>
</view>
</view>
</u-card>
</u-card>
</view>
</view>
</view>
</view>
@ -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;

2
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);
},

3
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;
},
};

Loading…
Cancel
Save