Browse Source

feat: 添加药物使用记录界面

develop
song 4 years ago
parent
commit
425cb63805
  1. 3
      CHANGELOG.md
  2. 62
      src/components/ConfigInfo/components/Medicine.vue
  3. 48
      src/components/ConfigInfo/components/config.js

3
CHANGELOG.md

@ -1,4 +1,4 @@
# 0.1.0 (2021-11-03)
# 0.1.0 (2021-11-04)
### 🌟 新功能
范围|描述|commitId
@ -53,6 +53,7 @@
- | 添加 环境变量,动态控制webview project的path | [8a40481](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/8a40481)
- | 添加子任务插件 子项目插件 | [7bda7e2](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7bda7e2)
- | 添加时间轴上下滚动 | [2b81bbc](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/2b81bbc)
- | 添加设置界面 | [7ca0c59](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/7ca0c59)
- | 添加项目排序 | [a0b491b](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/a0b491b)
- | 点击日历日期查询项目列表 | [c458385](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/c458385)
- | 登录提示是否合并账号 | [6a9b054](https://dd.tall.wiki/gitea/binbin0314/yanyuan_js/commits/6a9b054)

62
src/components/ConfigInfo/components/Medicine.vue

@ -1,44 +1,45 @@
<template>
<view style="border: 1px solid #e5e5e5">
<view v-for="(item, index) in medicineInfo" :key="index">
<template v-for="(colItem, itemIndex) in item">
<u-collapse
v-if="colItem.showType === 1"
:key="itemIndex"
:head-style="headStyle"
:body-style="bodyStyle"
:accordion="false"
style="border-bottom: 1px solid #f8f8f8"
>
<u-collapse-item :title="colItem.name" :open="false">
<!-- 单选 -->
<view v-if="colItem.type === 1">
<u-radio-group v-model="colItem.value">
<u-radio
class="mb-2"
@change="change($event, index, itemIndex, colItem.type)"
v-for="(radioItem, radioIndex) in colItem.radioList"
:key="radioIndex"
:name="radioItem"
>
{{ radioItem }}
</u-radio>
</u-radio-group>
</view>
</u-collapse-item>
</u-collapse>
<view v-else :key="itemIndex" class="flex justify-between items-center text-sm" style="border-bottom: 1px solid #f8f8f8">
<view class="pl-4 py-3 font-bold" style="border-bottom: 1px solid #f8f8f8">{{ item.title }}</view>
<template v-for="(colItem, itemIndex) in item.date">
<view :key="itemIndex" class="flex justify-between items-center text-sm" style="border-bottom: 1px solid #f8f8f8">
<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($event, 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" input-align="right" />
</view>
<!-- input 文本输入框 -->
<view v-if="colItem.type === 8" class="pr-7">
<u-input v-model="colItem.value" input-align="right" />
<!-- 数字输入框+单选 -->
<view v-if="colItem.type === 4" class="flex flex-nowrap">
<u-input
:clearable="false"
class="flex-1 mr-3"
v-model="colItem.value"
placeholder="每日总剂量(单位: mg)"
type="number"
input-align="center"
@focus="colItem.checked = false"
/>
<u-checkbox-group @change="change($event, index, itemIndex, colItem.type)">
<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>
<u-button type="primary" class="m-4">开始填表</u-button>
</view>
@ -63,6 +64,7 @@ export default {
},
methods: {
change(e, index, itemIndex, type) {
console.log('e: ', e);
console.log('type: ', type);
this.medicineInfo[index][itemIndex].value = e;
},

48
src/components/ConfigInfo/components/config.js

@ -286,7 +286,7 @@ export const infoList = [
/**
* 药物使用记录
* 展示类型: showType: 1 标题+折叠, 2 直接展示
* 试题类型, type:1 单选,2 日期(年月日),3 数字输入框,4 单列下拉框,5 多选,6 日期(年月日时),7 多列下拉选框, 8 文本输入框 9 多列地区选择 11 吸烟 12 饮酒 13 饮茶
* 试题类型, type:1 单选, 3 数字输入框,4 文本输入框+单选
*/
export const medicineInfo = [
{
@ -294,38 +294,32 @@ export const medicineInfo = [
date: [
{
name: '是否测评',
showType: 2,
type: 3,
type: 1,
value: null,
radioList: ['已测评', '未测评'],
radioList: ['已测评', '未测评'],
},
{
name: 'Mmse得分',
showType: 2,
type: 3,
value: null,
},
{
name: 'Moca得分',
showType: 2,
type: 3,
value: null,
},
{
name: 'Adi得分',
showType: 2,
type: 3,
value: null,
},
{
name: 'Npi得分',
showType: 2,
type: 3,
value: null,
},
{
name: '总分',
showType: 2,
type: 3,
value: null,
},
@ -335,10 +329,40 @@ export const medicineInfo = [
title: '药物使用情况',
date: [
{
name: '年龄',
showType: 2,
type: 3,
name: '多奈哌齐',
type: 4,
value: null,
checked: false,
},
{
name: '卡巴拉汀',
type: 4,
value: null,
checked: false,
},
{
name: '石杉碱甲',
type: 4,
value: null,
checked: false,
},
{
name: '盐酸美金刚片',
type: 4,
value: null,
checked: false,
},
{
name: '奥拉西坦',
type: 4,
value: null,
checked: false,
},
{
name: '银杏片叶',
type: 4,
value: null,
checked: false,
},
],
},

Loading…
Cancel
Save