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 范围|描述|commitId
@ -125,6 +125,7 @@
### 🐛 Bug 修复 ### 🐛 Bug 修复
范围|描述|commitId 范围|描述|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) - | 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) - | 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) 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; info.showOther = true;
} else { } else {
info.showOther = false; info.showOther = false;
info.otherValue = null;
} }
} }
// //

7
src/config/yyInfo.js

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

5
src/pages/index/index.vue

@ -44,6 +44,7 @@ export default {
if (!this.token) return; if (!this.token) return;
this.getProjects(); this.getProjects();
this.handleFindPoint(); this.handleFindPoint();
this.setProject();
}, },
onReady() { onReady() {
@ -51,7 +52,7 @@ export default {
}, },
methods: { methods: {
...mapMutations('project', ['setProjects', 'setDotList']), ...mapMutations('project', ['setProjects', 'setDotList', 'setProject']),
// //
getProjects(start = this.$moment().startOf('day').valueOf(), end = this.$moment().endOf('day').valueOf()) { 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); const data = await this.$u.api.findRedPoint(startTime, endTime);
this.setDotList(data); this.setDotList(data);
} catch (error) { } 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() { data() {
return { return {
itemList: [ 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: '药物使用记录', 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: 'Zarit照顾者负担量表', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu3.png' },
{ head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' }, { head: '家属成员', open: false, img: 'https://www.tall.wiki/staticrec/yanyuan/menu4.png' },
@ -81,6 +81,9 @@ export default {
this.itemList.forEach((item, i) => { this.itemList.forEach((item, i) => {
if (i === index) { if (i === index) {
item.open = !item.open; item.open = !item.open;
if (index === 0 && item.open) {
this.handlePersonalInfo();
}
} else { } else {
item.open = false; item.open = false;
} }
@ -118,7 +121,6 @@ export default {
const params = { projectId: this.projectId }; const params = { projectId: this.projectId };
const data = await this.$u.api.queryTrainee(params); const data = await this.$u.api.queryTrainee(params);
this.personalInfo = data; this.personalInfo = data;
this.itemList[0].open = true;
} catch (error) { } catch (error) {
console.error('error: ', error); console.error('error: ', error);
} }

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

@ -41,10 +41,28 @@
v-model="colItem.value" v-model="colItem.value"
type="number" type="number"
:clearable="false" :clearable="false"
:placeholder="colItem.placeholder"
input-align="right" input-align="right"
@blur="change($event, index, itemIndex, colItem.type)" @blur="change($event, index, itemIndex, colItem.type)"
/> />
</view> </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 文本输入框 --> <!-- input 文本输入框 -->
<view v-if="colItem.type === 8" class="pr-7"> <view v-if="colItem.type === 8" class="pr-7">
<u-input <u-input
@ -109,6 +127,17 @@ export default {
...mapMutations('yanyuan', ['setCode', 'setReportId']), ...mapMutations('yanyuan', ['setCode', 'setReportId']),
...mapActions('yanyuan', ['handleQuestion']), ...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) { changeShow(index, itemIndex) {
this.careInfo[index][itemIndex].show = !this.careInfo[index][itemIndex].show; this.careInfo[index][itemIndex].show = !this.careInfo[index][itemIndex].show;
}, },
@ -116,22 +145,21 @@ export default {
change(e, index, itemIndex, type) { change(e, index, itemIndex, type) {
const info = this.careInfo[index][itemIndex]; const info = this.careInfo[index][itemIndex];
switch (type) { switch (type) {
case 4: {
info.show = !info.show;
break;
}
case 99: { case 99: {
info.otherValue = e; info.otherValue = e;
// this.params[info.label] = e;
break; break;
} }
default: { default: {
if (info.label === 'careSex') {
// this.params[info.label] = e === '' ? 1 : 2;
}
if (e === '其他') { if (e === '其他') {
info.showOther = true; info.showOther = true;
} else { } else {
info.showOther = false; info.showOther = false;
} }
info.value = e; info.value = e;
// this.params[info.label] = e;
break; break;
} }
} }
@ -235,8 +263,7 @@ export default {
reportId: id, reportId: id,
num: '1', num: '1',
}; };
const data = await this.handleQuestion(params); await this.handleQuestion(params);
console.log('data: ', data);
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' }); uni.navigateTo({ url: '/pagesYanyuan/assess/assess' });
} catch (error) { } catch (error) {
console.error('error: ', error); console.error('error: ', error);

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

@ -2,6 +2,7 @@
<view class="charts-box"> <view class="charts-box">
<view class="flex justify-between"> <view class="flex justify-between">
<view> <view>
<text class="mr-2 font-bold">{{ task.name }}</text>
<u-rate <u-rate
:count="task.data.mentalTest.gradeResult" :count="task.data.mentalTest.gradeResult"
v-model="task.data.mentalTest.gradeResult" v-model="task.data.mentalTest.gradeResult"
@ -12,7 +13,6 @@
> >
<!-- v-if="!task.data.showDetail" --> <!-- v-if="!task.data.showDetail" -->
</u-rate> </u-rate>
<text class="mx-2 font-bold">{{ task.name }}</text>
</view> </view>
<u-icon name="arrow-up" color="#909399" v-if="task.data.showDetail" @click="changeShowState"></u-icon> <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-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="plugin">
<view class="h-3" v-if="item.process === 4"></view> <view class="h-3" v-if="item.process === 4"></view>
<view class="ml-3 overflow-hidden shadow-lg task-box"> <view class="ml-3 overflow-hidden shadow-lg task-box">
<u-card <!-- <u-card
:show-foot="false" :show-foot="false"
:show-head="false" :show-head="false"
:style="{ height: setHeight(item.panel) }" :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> <skeleton :banner="false" :loading="true" :row="4" animate class="mt-2 u-line-2 skeleton"></skeleton>
</view> </view>
</view> </view>
</u-card> </u-card> -->
<u-card <u-card
@click="onClickTask(item.planStart - 0, item.id)" @click="onClickTask(item.planStart - 0, item.id)"
@ -59,7 +59,7 @@
<script> <script>
import { mapState, mapMutations, mapGetters, mapActions } from 'vuex'; import { mapState, mapMutations, mapGetters, mapActions } from 'vuex';
import Skeleton from '../../Skeleton/Skeleton'; // import Skeleton from '../../Skeleton/Skeleton';
import EvaluatedNLCP from '../../Evaluated/EvaluatedNLCP'; import EvaluatedNLCP from '../../Evaluated/EvaluatedNLCP';
import EvaluatedXLJH from '../../Evaluated/EvaluatedXLJH'; import EvaluatedXLJH from '../../Evaluated/EvaluatedXLJH';
import Tips from '../../Tips/Tips'; import Tips from '../../Tips/Tips';
@ -68,7 +68,7 @@ import TimeStatus from './TimeStatus.vue';
export default { export default {
name: 'TimeBox', name: 'TimeBox',
components: { TimeStatus, Skeleton, EvaluatedNLCP, EvaluatedXLJH, Tips, NotEvaluated }, components: { TimeStatus, EvaluatedNLCP, EvaluatedXLJH, Tips, NotEvaluated },
props: { props: {
task: { task: {

72
src/pagesProject/project/project.vue

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

9
src/pagesYanyuan/assess/assess.vue

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

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

@ -10,7 +10,7 @@
:class="[`col-span-${item.col}`]" :class="[`col-span-${item.col}`]"
> >
<text v-if="item.showType === 0">{{ item.content }}</text> <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>
</u-radio-group> </u-radio-group>
</view> </view>

Loading…
Cancel
Save