Browse Source

feat: 解决bug

develop
song 4 years ago
parent
commit
155626c4c4
  1. 3
      CHANGELOG.md
  2. 1
      src/components/Info/Info.vue
  3. 7
      src/config/yyInfo.js
  4. 5
      src/pages/index/index.vue
  5. 6
      src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue
  6. 41
      src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue
  7. 2
      src/pagesProject/project/components/Evaluated/EvaluatedNLCP.vue
  8. 8
      src/pagesProject/project/components/TimeLine/component/TimeBoxIn.vue
  9. 72
      src/pagesProject/project/project.vue
  10. 9
      src/pagesYanyuan/assess/assess.vue
  11. 2
      src/pagesYanyuan/assess/components/Test/components/TestMain.vue

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-11-29)
# 0.1.0 (2021-11-30)
### 🌟 新功能
范围|描述|commitId
@ -125,6 +125,7 @@
### 🐛 Bug 修复
范围|描述|commitId
--|--|--
- | 1.任务 角色切换显示加载中... 2.题目图片大小等比例修改 | [22f8cc8](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/22f8cc8)
- | 1.时间轴数据渲染 2.时间基准线 | [d643af2](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/d643af2)
- | api 存storage | [81032ba](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/81032ba)
ID1000343 | 解决向下预加载查询参数时间没+1颗粒度;以及滚动加载颗粒度写死的问题 | [940603a](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/940603a), closes [#ID1000343](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/issues/ID1000343)

1
src/components/Info/Info.vue

@ -434,6 +434,7 @@ export default {
info.showOther = true;
} else {
info.showOther = false;
info.otherValue = null;
}
}
//

7
src/config/yyInfo.js

@ -45,7 +45,6 @@ export const infoList = [
radioList: [
{ id: 1, value: '男' },
{ id: 2, value: '女' },
{ id: 0, value: '未知' },
],
value: null,
show: true,
@ -484,7 +483,7 @@ export const medicineInfo = [
/**
* 照顾者信息
* 展示类型: showType: 1 标题+折叠, 2 直接展示
* 试题类型, type:1 单选, 3 数字输入框, 8 文本输入框
* 试题类型, type:1 单选, 3 数字输入框, 4 带小数点的数字键盘, 8 文本输入框
*/
export const careInfo = [
[
@ -512,6 +511,7 @@ export const careInfo = [
type: 3,
value: null,
show: false,
placeholder: '请输入年龄',
},
{
name: '职业',
@ -539,9 +539,10 @@ export const careInfo = [
name: '持续照顾时间',
label: 'carePeriod',
showType: 2,
type: 3,
type: 4,
value: null,
show: false,
placeholder: '请输入照顾时长(月)',
},
{
name: '与患者关系',

5
src/pages/index/index.vue

@ -44,6 +44,7 @@ export default {
if (!this.token) return;
this.getProjects();
this.handleFindPoint();
this.setProject();
},
onReady() {
@ -51,7 +52,7 @@ export default {
},
methods: {
...mapMutations('project', ['setProjects', 'setDotList']),
...mapMutations('project', ['setProjects', 'setDotList', 'setProject']),
//
getProjects(start = this.$moment().startOf('day').valueOf(), end = this.$moment().endOf('day').valueOf()) {
@ -80,7 +81,7 @@ export default {
const data = await this.$u.api.findRedPoint(startTime, endTime);
this.setDotList(data);
} catch (error) {
console.log('error: ', error);
console.error('error: ', error);
}
},

6
src/pagesProject/project/components/ConfigInfo/ConfigInfo.vue

@ -53,7 +53,7 @@ export default {
data() {
return {
itemList: [
{ head: '基本信息', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' },
{ head: '基本信息', open: true, img: 'https://www.tall.wiki/staticrec/yanyuan/menu1.png' },
{ head: '药物使用记录', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu2.png' },
{ head: 'Zarit照顾者负担量表', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu3.png' },
{ head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' },
@ -81,6 +81,9 @@ export default {
this.itemList.forEach((item, i) => {
if (i === index) {
item.open = !item.open;
if (index === 0 && item.open) {
this.handlePersonalInfo();
}
} else {
item.open = false;
}
@ -118,7 +121,6 @@ export default {
const params = { projectId: this.projectId };
const data = await this.$u.api.queryTrainee(params);
this.personalInfo = data;
this.itemList[0].open = true;
} catch (error) {
console.error('error: ', error);
}

41
src/pagesProject/project/components/ConfigInfo/components/CaregiverDetail.vue

@ -41,10 +41,28 @@
v-model="colItem.value"
type="number"
:clearable="false"
:placeholder="colItem.placeholder"
input-align="right"
@blur="change($event, index, itemIndex, colItem.type)"
/>
</view>
<!-- 带小数点的数字键盘 -->
<view v-if="colItem.type === 4" class="pr-7">
<view @click="change($event, index, itemIndex, colItem.type)" class="w-24 text-right" v-if="colItem.value">
{{ colItem.value }}
</view>
<view @click="change($event, index, itemIndex, colItem.type)" class="w-full text-right text-gray-350" v-else>
{{ colItem.placeholder }}
</view>
<u-keyboard
mode="number"
:mask="false"
:show-tips="false"
v-model="colItem.show"
@change="changeVal($event, index, itemIndex)"
@backspace="backspace($event, index, itemIndex)"
></u-keyboard>
</view>
<!-- input 文本输入框 -->
<view v-if="colItem.type === 8" class="pr-7">
<u-input
@ -109,6 +127,17 @@ export default {
...mapMutations('yanyuan', ['setCode', 'setReportId']),
...mapActions('yanyuan', ['handleQuestion']),
changeVal(e, index, itemIndex) {
const info = this.careInfo[index][itemIndex];
info.value += e;
},
// 退
backspace(e, index, itemIndex) {
const info = this.careInfo[index][itemIndex];
// value
if (info.value.length) info.value = info.value.substr(0, info.value.length - 1);
},
changeShow(index, itemIndex) {
this.careInfo[index][itemIndex].show = !this.careInfo[index][itemIndex].show;
},
@ -116,22 +145,21 @@ export default {
change(e, index, itemIndex, type) {
const info = this.careInfo[index][itemIndex];
switch (type) {
case 4: {
info.show = !info.show;
break;
}
case 99: {
info.otherValue = e;
// this.params[info.label] = e;
break;
}
default: {
if (info.label === 'careSex') {
// this.params[info.label] = e === '' ? 1 : 2;
}
if (e === '其他') {
info.showOther = true;
} else {
info.showOther = false;
}
info.value = e;
// this.params[info.label] = e;
break;
}
}
@ -235,8 +263,7 @@ export default {
reportId: id,
num: '1',
};
const data = await this.handleQuestion(params);
console.log('data: ', data);
await this.handleQuestion(params);
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });
} catch (error) {
console.error('error: ', error);

2
src/pagesProject/project/components/Evaluated/EvaluatedNLCP.vue

@ -2,6 +2,7 @@
<view class="charts-box">
<view class="flex justify-between">
<view>
<text class="mr-2 font-bold">{{ task.name }}</text>
<u-rate
:count="task.data.mentalTest.gradeResult"
v-model="task.data.mentalTest.gradeResult"
@ -12,7 +13,6 @@
>
<!-- v-if="!task.data.showDetail" -->
</u-rate>
<text class="mx-2 font-bold">{{ task.name }}</text>
</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>

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

@ -14,7 +14,7 @@
<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
<!-- <u-card
:show-foot="false"
:show-head="false"
:style="{ height: setHeight(item.panel) }"
@ -27,7 +27,7 @@
<skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
</view>
</view>
</u-card>
</u-card> -->
<u-card
@click="onClickTask(item.planStart - 0, item.id)"
@ -59,7 +59,7 @@
<script>
import { mapState, mapMutations, mapGetters, mapActions } from 'vuex';
import Skeleton from '../../Skeleton/Skeleton';
// import Skeleton from '../../Skeleton/Skeleton';
import EvaluatedNLCP from '../../Evaluated/EvaluatedNLCP';
import EvaluatedXLJH from '../../Evaluated/EvaluatedXLJH';
import Tips from '../../Tips/Tips';
@ -68,7 +68,7 @@ import TimeStatus from './TimeStatus.vue';
export default {
name: 'TimeBox',
components: { TimeStatus, Skeleton, EvaluatedNLCP, EvaluatedXLJH, Tips, NotEvaluated },
components: { TimeStatus, EvaluatedNLCP, EvaluatedXLJH, Tips, NotEvaluated },
props: {
task: {

72
src/pagesProject/project/project.vue

@ -79,6 +79,7 @@ export default {
* 永久日常任务不发生改变
*/
timeNode(val) {
console.log('timeNode: ', val);
if (val && this.roleId) {
this.clearTasksData();
this.getGlobalData(); //
@ -159,8 +160,8 @@ export default {
//
async initPlanTasks() {
this.setPrevPlaceholderTasks(); //
this.setNextPlaceholderTasks(); //
// this.setPrevPlaceholderTasks(); //
// this.setNextPlaceholderTasks(); //
await this.getInitTasks(); //
//
let timer = null;
@ -169,7 +170,7 @@ export default {
clearInterval(timer);
this.$nextTick(() => this.$refs.timeLine.setScrollPosition());
}
}, 500);
}, 2000);
},
// ||
@ -202,11 +203,13 @@ export default {
//
//
if (data && data.length) {
this.replacePrevData(data, params.queryType);
// this.replacePrevData(data, params.queryType);
this.setData(data, params.queryType);
params.queryType === 0 ? this.setTopEnd(false) : this.setBottomEnd(false);
} else {
// TODO: 0 -> 1 ->
params.queryType === 0 ? this.setPrevPlaceholderTasks() : this.setNextPlaceholderTasks();
// params.queryType === 0 ? this.setPrevPlaceholderTasks() : this.setNextPlaceholderTasks();
params.queryType === 0 ? this.setTopEnd(true) : this.setBottomEnd(true);
}
}
});
@ -233,28 +236,28 @@ export default {
//
setPrevPlaceholderTasks() {
this.setTopEnd(true);
let startTime = '';
const { tasks } = this;
if (!tasks || !tasks.length) {
startTime = Date.now(); //
} else {
startTime = tasks[0].planStart - 0; //
}
const placeholderTasks = setPlaceholderTasks(startTime, true, this.timeGranularity, 3);
this.setUpTasks(placeholderTasks);
// let startTime = '';
// const { tasks } = this;
// if (!tasks || !tasks.length) {
// startTime = Date.now(); //
// } else {
// startTime = tasks[0].planStart - 0; //
// }
// const placeholderTasks = setPlaceholderTasks(startTime, true, this.timeGranularity, 3);
// this.setUpTasks(placeholderTasks);
},
//
setNextPlaceholderTasks() {
this.setBottomEnd(true);
let startTime = '';
if (!this.tasks || !this.tasks.length) {
startTime = Date.now();
} else {
startTime = +this.tasks[this.tasks.length - 1].planStart;
}
const initData = setPlaceholderTasks(startTime, false, this.timeGranularity);
this.setDownTasks(initData);
// let startTime = '';
// if (!this.tasks || !this.tasks.length) {
// startTime = Date.now();
// } else {
// startTime = +this.tasks[this.tasks.length - 1].planStart;
// }
// const initData = setPlaceholderTasks(startTime, false, this.timeGranularity);
// this.setDownTasks(initData);
},
/**
@ -283,6 +286,31 @@ export default {
type === 0 ? this.setUpTasks(oldTasks) : this.setDownTasks(oldTasks);
},
//
setData(data, type) {
let tasks = [];
for (let index = 0; index < data.length; index++) {
let taskItem = { id: '', array: [] };
const item = data[index];
if (index === 0) {
taskItem.id = item.id;
taskItem.array.push(item);
tasks.push(taskItem);
}
if (index > 0) {
if (item.planStart === data[index - 1].planStart) {
tasks[tasks.length - 1].array.push({ ...item });
} else {
taskItem.id = item.id;
taskItem.array.push({ ...item });
tasks.push(taskItem);
}
}
}
this.clearTasks(); // setUpTasks setUpTasks
type === 0 ? this.setUpTasks(tasks) : this.setDownTasks(tasks);
},
//
randomNum(n) {
var t = '';

9
src/pagesYanyuan/assess/assess.vue

@ -45,7 +45,7 @@ export default {
},
methods: {
...mapMutations('task', ['setIsEvaluated']),
...mapMutations('task', ['setIsEvaluated', 'setTimeNode']),
...mapMutations('yanyuan', ['setQuestionInfo', 'setAssessResult', 'setOptionId', 'setIsTest']),
...mapActions('yanyuan', ['handleQuestion']),
@ -123,6 +123,7 @@ export default {
});
setTimeout(() => {
this.backProject();
this.setTimeNode(Date.now());
}, 3000);
} catch (error) {
console.error('error: ', error);
@ -141,10 +142,8 @@ export default {
duration: '3000',
});
setTimeout(() => {
if (this.code === 'ZARIT') {
this.setIsTest(true);
this.$t.page.back();
}
this.setIsTest(true);
this.$t.page.back();
}, 3000);
} catch (error) {
console.error('error: ', error);

2
src/pagesYanyuan/assess/components/Test/components/TestMain.vue

@ -10,7 +10,7 @@
:class="[`col-span-${item.col}`]"
>
<text v-if="item.showType === 0">{{ item.content }}</text>
<image style="width: 260px" :src="item.content" mode="widthFix" v-else />
<image style="width: 200px" :src="item.content" mode="widthFix" v-else />
</u-radio>
</u-radio-group>
</view>

Loading…
Cancel
Save