fix(login): 修复获取用户绑定租户列表时用户名为空导致的URL错误
确保username参数存在,避免因为空值造成接口调用失败 feat(editor): 重构富文本编辑器组件并优化图片上传逻辑 - 使用 Composition API 重构代码结构,提升可维护性 - 改进图片上传功能,增强对 quill 实例的安全访问 - 更新样式排版,提高组件可读性和一致性 refactor(file-upload): 移除旧代理引用,使用 modern Vue API 替换 `proxy` 调用为 `modal` 插件直接调用,提升代码清晰度与健壮性 refactor(image-upload): 替换旧实例调用方式,强化错误提示机制 统一使用 `modal` 进行消息提示和加载状态控制,改善用户体验 refactor(tree-select): 引入 Composition API 优化节点操作逻辑 移除 `getCurrentInstance` 的不必要使用,改为明确的模板引用管理 chore(main): 添加 util._extend 补丁以消除 Node.js 环境警告 解决开发环境下由于 Node.js 内建模块缺失造成的运行时警告问题 feat(template): 完善跌倒/坠床评估护理记录单模板 - 增加详细注释说明各部分作用,便于后续维护 - 明确组件名称为中文,利于业务识别 - 丰富表单交互细节及数据处理逻辑,支持动态打分、措施选择等功能 refactor(template-index): 加强模板组件自动注册逻辑 增加组件 name 属性校验,防止无效或匿名组件被注册到全局
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<!-- 跌倒/坠床评估护理记录单主容器 -->
|
||||
<div>
|
||||
<div class="business">
|
||||
<!-- 已有记录展示表格 -->
|
||||
<el-table
|
||||
:data="tableDataSource"
|
||||
border
|
||||
@@ -8,10 +10,15 @@
|
||||
fit
|
||||
:header-cell-style="{ background: '#f2f2f2', color: 'black' }"
|
||||
>
|
||||
<!-- 记录时间列 -->
|
||||
<el-table-column prop="content.recordTime" label="记录时间" />
|
||||
<!-- 评估分数列 -->
|
||||
<el-table-column prop="content.totalScore" label="评估分数" />
|
||||
<!-- 护理措施列 -->
|
||||
<el-table-column prop="content.patientCareSessionsTableList" label="护理措施" />
|
||||
<!-- 责任护士列 -->
|
||||
<el-table-column prop="content.nurseSignature" label="责任护士" />
|
||||
<!-- 操作列:编辑和删除按钮 -->
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
@@ -36,9 +43,12 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 跌倒/坠床评估护理记录单表单区域 -->
|
||||
<div name="跌倒/坠床评估护理记录单" class="changeMajor" style="width: 99.9%">
|
||||
<div>
|
||||
<!-- 表单主体 -->
|
||||
<el-form ref="formRef" :model="form" style="width: 99.9%">
|
||||
<!-- 标题行 -->
|
||||
<el-form-item style="text-align: center">
|
||||
<div
|
||||
style="
|
||||
@@ -54,10 +64,12 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 日期时间选择器 -->
|
||||
<el-form-item label="日期:" class="changeMajorFromItem" style="width: 100%">
|
||||
<el-row :span="20">
|
||||
<el-col :span="8" style="padding-left: 0px !important">
|
||||
<el-form-item>
|
||||
<!-- 日期时间选择器 -->
|
||||
<el-date-picker
|
||||
v-model="form.ZKDATE"
|
||||
type="datetime"
|
||||
@@ -67,6 +79,7 @@
|
||||
style="width: 800px"
|
||||
:disabled="admissionDataForm !== undefined"
|
||||
/>
|
||||
<!-- 时间选择器被注释掉 -->
|
||||
<!-- <span style="margin-left: 5px">时间:</span>
|
||||
<el-time-picker
|
||||
v-model="form.ZKTIME"
|
||||
@@ -77,6 +90,7 @@
|
||||
/> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 新增/保存按钮 -->
|
||||
<el-col :span="5">
|
||||
<el-button
|
||||
v-if="!updateFlag"
|
||||
@@ -100,6 +114,7 @@
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 危险因素评估表格 -->
|
||||
<el-form-item style="padding-top: 10px; margin: 0px !important">
|
||||
<el-table
|
||||
:data="dangerData"
|
||||
@@ -107,6 +122,7 @@
|
||||
:span-method="handleSpan"
|
||||
style="text-align: center"
|
||||
>
|
||||
<!-- 动态生成表格列 -->
|
||||
<el-table-column
|
||||
v-for="column in dangerColumns"
|
||||
:key="column.key"
|
||||
@@ -115,6 +131,7 @@
|
||||
:label="column.title"
|
||||
align="center"
|
||||
/>
|
||||
<!-- 选择列(复选框) -->
|
||||
<el-table-column prop="id" label="选择" width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.checked" @change="handleDangerChange(row)" />
|
||||
@@ -123,6 +140,7 @@
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 总分显示 -->
|
||||
<el-form-item
|
||||
style="text-align: center; margin-bottom: 0px; padding: 0px"
|
||||
class="changeMajorFromItem"
|
||||
@@ -135,6 +153,7 @@
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 护理措施表格 -->
|
||||
<el-form-item style="padding-top: 10px">
|
||||
<el-table
|
||||
:data="nursingData"
|
||||
@@ -142,6 +161,7 @@
|
||||
:span-method="arraySpanMethod"
|
||||
style="width: 100%"
|
||||
>
|
||||
<!-- 动态生成表格列 -->
|
||||
<el-table-column
|
||||
v-for="column in nursingColumns"
|
||||
:key="column.key"
|
||||
@@ -150,6 +170,7 @@
|
||||
:label="column.title"
|
||||
align="center"
|
||||
/>
|
||||
<!-- 选择列(复选框) -->
|
||||
<el-table-column prop="id" label="选择" width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-checkbox v-model="row.checked" @change="handleNursingChange(row)" />
|
||||
@@ -158,6 +179,7 @@
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 护士签字输入框 -->
|
||||
<el-form-item
|
||||
style="text-align: center; margin-bottom: 0px; padding: 0px"
|
||||
class="changeMajorFromItem"
|
||||
@@ -177,6 +199,7 @@
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 备注信息 -->
|
||||
<el-form-item>
|
||||
<el-row :span="20">
|
||||
<el-col :span="5">
|
||||
@@ -197,22 +220,24 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 组件选项定义
|
||||
defineOptions({
|
||||
name: 'FallBedFallAssessment',
|
||||
name: '跌倒/坠床评估护理记录单',
|
||||
});
|
||||
|
||||
// 导入所需模块
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
// import { webapp_ws_ajax_run, urlAddRandomNo } from '@/utils/grwebapp';
|
||||
// import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
// 响应式数据
|
||||
// 使用路由相关功能
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
// 定义引用变量
|
||||
const queryRef = ref();
|
||||
const formRef = ref();
|
||||
|
||||
// 基本数据变量
|
||||
const wardCode = ref('');
|
||||
const patientId = ref('');
|
||||
const visitId = ref('');
|
||||
@@ -226,17 +251,18 @@ const totalScore = ref(0);
|
||||
const lastSubmit = ref('');
|
||||
const admissionDataForm = ref(route.params.admissionData);
|
||||
|
||||
// 表单数据模型
|
||||
const form = reactive({
|
||||
ZKDATE: '',
|
||||
ZKTIME: '',
|
||||
recordTime: '',
|
||||
totalScore: 0,
|
||||
bedFallRiskAssessmentList: [],
|
||||
nurseSignature: '',
|
||||
patientCareSessionsCheckedList: [],
|
||||
ZKDATE: '', // 日期
|
||||
ZKTIME: '', // 时间
|
||||
recordTime: '', // 记录时间
|
||||
totalScore: 0, // 总分
|
||||
bedFallRiskAssessmentList: [], // 跌倒风险评估列表
|
||||
nurseSignature: '', // 护士签名
|
||||
patientCareSessionsCheckedList: [], // 护理措施选中列表
|
||||
});
|
||||
|
||||
// 危险因素表格列
|
||||
// 危险因素表格列配置
|
||||
const dangerColumns = [
|
||||
{
|
||||
key: 'content',
|
||||
@@ -301,7 +327,7 @@ const dangerData = ref([
|
||||
{ id: '27', evalContent: '麻醉止痛剂', score: 2, checked: false },
|
||||
]);
|
||||
|
||||
// 护理措施表格列
|
||||
// 护理措施表格列配置
|
||||
const nursingColumns = [
|
||||
{
|
||||
key: 'content',
|
||||
@@ -338,21 +364,21 @@ const instructions = [
|
||||
'3.评分≥5,高度风险,每周至少评估一次,需采取适宜的预防措施,同时填写《预防患者跌倒/坠床知情告知书》',
|
||||
];
|
||||
|
||||
// 计算属性
|
||||
// 计算属性:计算选中的危险因素总分
|
||||
const calculate = computed(() => {
|
||||
return dangerData.value
|
||||
.filter((option) => option.checked)
|
||||
.reduce((total, option) => total + option.score, 0);
|
||||
});
|
||||
|
||||
// 计算属性:判断表单是否为空
|
||||
const isFormEmpty = computed(() => {
|
||||
return (
|
||||
form.ZKDATE === '' && form.ZKTIME === '' && form.recordTime === '' && form.nurseSignature === ''
|
||||
);
|
||||
});
|
||||
|
||||
// 方法 - 不再需要handleData方法,通过表单输入和按钮加载数据
|
||||
|
||||
// 危险因素选择变化处理函数
|
||||
const handleDangerChange = (row) => {
|
||||
totalScore.value = calculate.value;
|
||||
form.bedFallRiskAssessmentList = dangerData.value
|
||||
@@ -360,12 +386,14 @@ const handleDangerChange = (row) => {
|
||||
.map((item) => item.id);
|
||||
};
|
||||
|
||||
// 护理措施选择变化处理函数
|
||||
const handleNursingChange = (row) => {
|
||||
form.patientCareSessionsCheckedList = nursingData.value
|
||||
.filter((item) => item.checked)
|
||||
.map((item) => item.id);
|
||||
};
|
||||
|
||||
// 初始化函数:加载模拟数据
|
||||
const init = async () => {
|
||||
// 使用模拟数据,不再调用后端API
|
||||
try {
|
||||
@@ -427,6 +455,7 @@ const init = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 危险因素表格合并单元格处理函数
|
||||
const handleSpan = ({ row, column, rowIndex, columnIndex }) => {
|
||||
if (columnIndex === 0) {
|
||||
if (rowIndex === 0) {
|
||||
@@ -473,6 +502,7 @@ const handleSpan = ({ row, column, rowIndex, columnIndex }) => {
|
||||
return [1, 1];
|
||||
};
|
||||
|
||||
// 护理措施表格合并单元格处理函数
|
||||
const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
// 护理措施
|
||||
if (columnIndex === 0) {
|
||||
@@ -489,8 +519,9 @@ const arraySpanMethod = ({ row, column, rowIndex, columnIndex }) => {
|
||||
return [1, 1];
|
||||
};
|
||||
|
||||
// 提交表单处理函数
|
||||
const onSubmit = async () => {
|
||||
// 检查上次提交时间
|
||||
// 检查上次提交时间,防止重复提交
|
||||
if (lastSubmit.value && new Date() - lastSubmit.value < 2000) {
|
||||
ElMessage.error('禁止重复提交!');
|
||||
return;
|
||||
@@ -562,6 +593,7 @@ const onSubmit = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 编辑记录处理函数
|
||||
const handleUpdate = (row) => {
|
||||
const loginUser = JSON.parse(window.localStorage.getItem('loginUser'));
|
||||
|
||||
@@ -591,6 +623,7 @@ const handleUpdate = (row) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 重置表单函数
|
||||
const reset = () => {
|
||||
Object.assign(form, {
|
||||
ZKDATE: '',
|
||||
@@ -623,6 +656,7 @@ const reset = () => {
|
||||
}
|
||||
};
|
||||
|
||||
// 删除记录处理函数
|
||||
const handleDelete = (row) => {
|
||||
const loginUser = JSON.parse(window.localStorage.getItem('loginUser'));
|
||||
|
||||
@@ -646,6 +680,7 @@ const handleDelete = (row) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 打印预览函数(暂未实现)
|
||||
const dc_ajax_preview = () => {
|
||||
var args = {
|
||||
report: urlAddRandomNo('./grf/NurseRecord_Pressure_208.grf'),
|
||||
@@ -656,6 +691,7 @@ const dc_ajax_preview = () => {
|
||||
webapp_ws_ajax_run(args);
|
||||
};
|
||||
|
||||
// 数据转换函数,用于报表打印
|
||||
const transformData = () => {
|
||||
const jsonDate = [...tableDataSource.value];
|
||||
|
||||
@@ -802,7 +838,7 @@ const transformData = () => {
|
||||
return transformedData;
|
||||
};
|
||||
|
||||
// 生命周期钩子
|
||||
// 组件挂载后执行的生命周期函数
|
||||
onMounted(() => {
|
||||
try {
|
||||
// 安全获取用户信息
|
||||
@@ -831,6 +867,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面样式定义 */
|
||||
.business {
|
||||
background: white;
|
||||
border-radius: 5px;
|
||||
@@ -894,4 +931,10 @@ onMounted(() => {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
/* 备注信息列表样式 */
|
||||
.instructions-list {
|
||||
list-style-type: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,17 +1,42 @@
|
||||
// 动态引入 template 目录下的所有 .vue 文件
|
||||
/**
|
||||
* 模板组件注册模块
|
||||
* 动态引入 template 目录下的所有 .vue 文件,并将它们注册为全局组件
|
||||
*/
|
||||
|
||||
// 动态引入 template 目录下的所有 .vue 文件(包括中文命名的文件)
|
||||
// 使用 { eager: true } 表示立即加载所有匹配的文件
|
||||
const templates = import.meta.glob('./*.vue', { eager: true });
|
||||
|
||||
// 存储所有加载的组件
|
||||
const components = [];
|
||||
|
||||
// 遍历所有引入的文件
|
||||
for (const path in templates) {
|
||||
const component = templates[path].default;
|
||||
components.push(component);
|
||||
try {
|
||||
// 获取组件的默认导出
|
||||
const component = templates[path].default;
|
||||
|
||||
// 检查组件是否有 name 属性,如果没有则跳过
|
||||
if (component && component.name) {
|
||||
components.push(component);
|
||||
} else {
|
||||
console.warn(`组件 ${path} 缺少 name 属性,将不会被注册`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`加载组件 ${path} 时出错:`, error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册所有组件到 Vue 应用实例
|
||||
* @param {Object} app - Vue 应用实例
|
||||
*/
|
||||
const registerComponents = (app) => {
|
||||
components.forEach((component) => {
|
||||
// 使用组件的 name 属性作为组件名称进行注册
|
||||
app.component(component.name, component);
|
||||
})
|
||||
}
|
||||
export { components, registerComponents };
|
||||
});
|
||||
};
|
||||
|
||||
// 导出组件数组和注册函数
|
||||
export { components, registerComponents };
|
||||
@@ -5,13 +5,11 @@
|
||||
-->
|
||||
<template>
|
||||
<div class="container">
|
||||
<!-- 页面头部标题 -->
|
||||
<div class="header">
|
||||
<h2 class="title">乾安县人民医院</h2>
|
||||
<h3 class="subtitle">患者护理记录单</h3>
|
||||
</div>
|
||||
|
||||
<!-- 护理记录表单 -->
|
||||
<el-form :model="state.formData" label-position="top" class="nursing-form">
|
||||
<!-- 患者基本信息 -->
|
||||
<div class="patient-info">
|
||||
@@ -60,11 +58,9 @@
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 生命体征记录表格 -->
|
||||
<!-- 基本信息记录表格 -->
|
||||
<div class="vital-signs-table">
|
||||
<!-- 护理记录详细信息表格 -->
|
||||
<el-table :data="state.formData.vitalSigns" border style="width: 100%">
|
||||
<!-- 记录日期列 -->
|
||||
<el-table-column label="日期" width="100">
|
||||
<template #default="scope">
|
||||
<el-date-picker
|
||||
@@ -77,7 +73,6 @@
|
||||
></el-date-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 记录时间列 -->
|
||||
<el-table-column label="时间" width="100">
|
||||
<template #default="scope">
|
||||
<el-time-picker
|
||||
@@ -89,9 +84,7 @@
|
||||
></el-time-picker>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 基本信息列组 -->
|
||||
<el-table-column label="基本信息">
|
||||
<!-- 意识状态 -->
|
||||
<el-table-column label="意识" width="80">
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.consciousness" placeholder="选择">
|
||||
@@ -101,46 +94,38 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 体温测量值 -->
|
||||
<el-table-column label="体温℃" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.temperature" placeholder="体温"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 心率测量值 -->
|
||||
<el-table-column label="心率次/分" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.heartRate" placeholder="心率"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 脉搏测量值 -->
|
||||
<el-table-column label="脉搏次/分" width="100">
|
||||
<el-table-column label="脉搏次/分" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.heartRate" placeholder="心率"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 呼吸频率 -->
|
||||
<el-table-column label="呼吸次/分" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.respiratoryRate" placeholder="呼吸"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 血压测量值 -->
|
||||
<el-table-column label="血压mmHg" width="120">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.bloodPressure" placeholder="血压"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 血氧饱和度 -->
|
||||
<el-table-column label="血氧饱和度" width="120">
|
||||
<el-table-column label="血氧饱和度" width="120">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.bloodPressure" placeholder="血压"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 氧疗相关信息 -->
|
||||
<el-table-column label="氧疗L/min" width="200">
|
||||
<!-- 氧疗方式 -->
|
||||
<el-table-column label="方式" >
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.intake" placeholder="选择">
|
||||
@@ -150,16 +135,13 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 氧流量 -->
|
||||
<el-table-column label="流量" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 入量记录 -->
|
||||
<el-table-column label="入量" width="200">
|
||||
<!-- 入量名称 -->
|
||||
<el-table-column label="入量" width="200">
|
||||
<el-table-column label="名称" >
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.intake" placeholder="选择">
|
||||
@@ -169,22 +151,18 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 入量毫升数 -->
|
||||
<el-table-column label="ml" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 入量途径 -->
|
||||
<el-table-column label="途径" width="80">
|
||||
<el-table-column label="途径" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 出量记录 -->
|
||||
<el-table-column label="出量" width="200">
|
||||
<!-- 出量名称 -->
|
||||
<el-table-column label="出量" width="200">
|
||||
<el-table-column label="名称" >
|
||||
<template #default="scope">
|
||||
<el-select v-model="scope.row.intake" placeholder="选择">
|
||||
@@ -194,38 +172,32 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 出量毫升数 -->
|
||||
<el-table-column label="ml" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<!-- 皮肤情况记录 -->
|
||||
<el-table-column label="皮肤情况" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
<el-table-column label="皮肤情况" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 管路护理记录 -->
|
||||
<el-table-column label="管路护理" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 病情与措施记录 -->
|
||||
<el-table-column label="病情与措施" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 护士签名 -->
|
||||
</el-table-column>
|
||||
<el-table-column label="管路护理" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="病情与措施" width="80">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.flowRate" placeholder="流量"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="护士签名" width="100">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.nurseSignature" placeholder="签名"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 操作列:提供删除功能 -->
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="danger" size="small" @click="removeVitalSign(scope.$index)"
|
||||
@@ -234,13 +206,12 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 添加新记录按钮 -->
|
||||
<div class="add-row">
|
||||
<el-button type="primary" @click="addVitalSign">添加记录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表单底部说明信息 -->
|
||||
<!-- 表单底部按钮 -->
|
||||
<div class="form-actions">
|
||||
<div>
|
||||
一、意识:①清醒;②嗜睡;③意识模糊;④昏睡;⑤谗妄;⑥浅昏迷;⑦中度昏迷;⑧深昏迷;⑨全麻未醒;⑩镇静。
|
||||
@@ -260,21 +231,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// 定义组件选项
|
||||
defineOptions({
|
||||
name: 'NursingRecordSheet',
|
||||
});
|
||||
|
||||
// 导入所需Vue功能
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
// 获取组件实例代理
|
||||
import { getCurrentInstance, onBeforeMount, onMounted, reactive } from 'vue';
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
// 定义组件发射事件
|
||||
const emits = defineEmits([]);
|
||||
|
||||
// 定义组件接收的属性
|
||||
const props = defineProps({
|
||||
patientId: {
|
||||
type: String,
|
||||
@@ -282,28 +244,28 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
// 表单数据状态管理
|
||||
// 表单数据
|
||||
const state = ref({
|
||||
formData: {
|
||||
name: '', // 患者姓名
|
||||
age: '', // 年龄
|
||||
gender: '', // 性别
|
||||
ward: '', // 病区
|
||||
bedNumber: '', // 床号
|
||||
hospitalNumber: '', // 住院号
|
||||
diagnosis: '', // 入院诊断
|
||||
vitalSigns: [ // 生命体征记录数组
|
||||
name: '',
|
||||
age: '',
|
||||
gender: '',
|
||||
ward: '',
|
||||
bedNumber: '',
|
||||
hospitalNumber: '',
|
||||
diagnosis: '',
|
||||
vitalSigns: [
|
||||
{
|
||||
date: new Date().toISOString().split('T')[0], // 默认当天日期
|
||||
time: new Date().toTimeString().slice(0, 5), // 默认当前时间
|
||||
consciousness: '清醒', // 意识状态默认值
|
||||
temperature: '', // 体温
|
||||
heartRate: '', // 心率
|
||||
respiratoryRate: '', // 呼吸频率
|
||||
bloodPressure: '', // 血压
|
||||
intake: '', // 入量
|
||||
flowRate: '', // 流量
|
||||
nurseSignature: '', // 护士签名
|
||||
date: new Date().toISOString().split('T')[0],
|
||||
time: new Date().toTimeString().slice(0, 5),
|
||||
consciousness: '清醒',
|
||||
temperature: '',
|
||||
heartRate: '',
|
||||
respiratoryRate: '',
|
||||
bloodPressure: '',
|
||||
intake: '',
|
||||
flowRate: '',
|
||||
nurseSignature: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -311,7 +273,7 @@ const state = ref({
|
||||
|
||||
});
|
||||
|
||||
// 添加生命体征记录方法
|
||||
// 添加生命体征记录
|
||||
const addVitalSign = () => {
|
||||
state.value.formData.vitalSigns.push({
|
||||
date: new Date().toISOString().split('T')[0],
|
||||
@@ -328,16 +290,17 @@ const addVitalSign = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 删除指定索引的生命体征记录
|
||||
// 删除生命体征记录
|
||||
const removeVitalSign = (index) => {
|
||||
state.value.formData.vitalSigns.splice(index, 1);
|
||||
// 如果删除后没有记录,则自动添加一条空记录
|
||||
if (state.value.formData.vitalSigns.length === 0) {
|
||||
addVitalSign();
|
||||
}
|
||||
};
|
||||
|
||||
// 重置整个表单数据
|
||||
|
||||
|
||||
// 重置表单
|
||||
const resetForm = () => {
|
||||
state.value.formData = {
|
||||
name: '',
|
||||
@@ -352,44 +315,34 @@ const resetForm = () => {
|
||||
|
||||
};
|
||||
|
||||
// 组件挂载前执行的逻辑
|
||||
onBeforeMount(() => {
|
||||
// 如果有传入患者ID,则可以在此处加载患者数据
|
||||
// 如果有patientId,可以在这里加载患者数据
|
||||
if (props.patientId) {
|
||||
// 加载患者数据的逻辑
|
||||
}
|
||||
});
|
||||
|
||||
// 组件挂载完成后执行的逻辑
|
||||
onMounted(() => {
|
||||
// 组件挂载后的逻辑
|
||||
});
|
||||
|
||||
// 表单提交方法
|
||||
const submit = () => {
|
||||
// 触发submitOk事件,传递表单数据给父组件
|
||||
// ElMessage.success('提交成功');
|
||||
emits('submitOk', state.formData);
|
||||
};
|
||||
|
||||
// 设置表单数据方法(供父组件调用)
|
||||
const setFormData = (data) => {
|
||||
if (data) {
|
||||
state.value.formData = data;
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露组件内部属性和方法给父组件使用
|
||||
defineExpose({ state, submit, setFormData });
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// 容器样式
|
||||
.container {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
// 头部标题样式
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
@@ -406,7 +359,6 @@ defineExpose({ state, submit, setFormData });
|
||||
}
|
||||
}
|
||||
|
||||
// 护理表单样式
|
||||
.nursing-form {
|
||||
.patient-info {
|
||||
padding: 15px;
|
||||
@@ -435,4 +387,4 @@ defineExpose({ state, submit, setFormData });
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -64,13 +64,14 @@
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<!-- <el-input v-model="formData.onsetDate" type="date" /> -->
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 病史信息区域标题 -->
|
||||
<h4 class="section-title">病史信息</h4>
|
||||
<!-- 2. 病史信息:单行自适应排列 -->
|
||||
<!-- 2. 病史信息:单行自适应排列(新增调整) -->
|
||||
<el-form-item class="form-section">
|
||||
<div class="single-row-layout">
|
||||
<!-- 现病史输入项 -->
|
||||
@@ -180,6 +181,14 @@ defineOptions({
|
||||
components: { ElInput, ElMessage, ElForm, ElFormItem },
|
||||
});
|
||||
|
||||
// // Props与事件,去掉props.patientInfo改为直接从store获取
|
||||
// const props = defineProps({
|
||||
// patientInfo: {
|
||||
// type: Object,
|
||||
// required: true,
|
||||
// },
|
||||
// });
|
||||
|
||||
// 定义组件接收的属性(目前为空)
|
||||
const props = defineProps({});
|
||||
|
||||
@@ -197,20 +206,20 @@ const formRef = ref(null);
|
||||
// 表单数据(全部字符类型)
|
||||
// 存储门诊病历表单的所有字段数据
|
||||
const formData = reactive({
|
||||
height: '', // 身高(cm)
|
||||
weight: '', // 体重(kg)
|
||||
temperature: '', // 体温(℃)
|
||||
pulse: '', // 脉搏(次/分)
|
||||
onsetDate: '', // 发病日期
|
||||
complaint: '', // 主诉(必填项)
|
||||
presentIllness: '', // 现病史
|
||||
pastIllness: '', // 既往史
|
||||
personalHistory: '', // 个人史
|
||||
allergyHistory: '', // 过敏史
|
||||
physicalExam: '', // 查体结果
|
||||
treatment: '', // 处理方案
|
||||
auxiliaryExam: '', // 辅助检查结果
|
||||
familyHistory: '', // 家族史
|
||||
height: '', // 身高(cm)
|
||||
weight: '', // 体重(kg)
|
||||
temperature: '', // 体温(℃)
|
||||
pulse: '', // 脉搏(次/分)
|
||||
onsetDate: '', // 发病日期
|
||||
complaint: '', // 主诉(必填项)
|
||||
presentIllness: '', // 现病史
|
||||
pastIllness: '', // 既往史
|
||||
personalHistory: '', // 个人史
|
||||
allergyHistory: '', // 过敏史
|
||||
physicalExam: '', // 查体结果
|
||||
treatment: '', // 处理方案
|
||||
auxiliaryExam: '', // 辅助检查结果
|
||||
familyHistory: '', // 家族史
|
||||
});
|
||||
|
||||
// 表单校验规则
|
||||
|
||||
@@ -1,21 +1,50 @@
|
||||
// 导入 API 函数,用于从服务器获取带有选项列表的数据
|
||||
import { getListWithOptionList } from '@/views/basicmanage/caseTemplatesStatistics/api';
|
||||
// 导入 Vue 3 的组合式 API:onMounted(组件挂载后执行)和 ref(响应式数据)
|
||||
import { onMounted, ref } from 'vue';
|
||||
|
||||
// 创建响应式数据:统计选项列表,初始为空数组
|
||||
const statisticsOptionList = ref([]);
|
||||
|
||||
/**
|
||||
* 初始化统计选项列表数据
|
||||
* 异步函数,通过 API 获取数据并更新到响应式变量中
|
||||
*/
|
||||
const initStatic = async () => {
|
||||
try {
|
||||
// 调用 API 获取数据
|
||||
const res = await getListWithOptionList();
|
||||
// 将获取到的数据赋值给响应式变量
|
||||
statisticsOptionList.value = res.data;
|
||||
} catch (error) {
|
||||
// 错误处理:打印错误信息到控制台
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Vue 3 组合式函数:用于获取和管理统计选项列表
|
||||
* @returns {Object} 返回包含响应式数据和方法的对象
|
||||
*/
|
||||
export default function useOptionsList() {
|
||||
initStatic();
|
||||
// 组件挂载后自动初始化数据
|
||||
onMounted(() => {
|
||||
initStatic();
|
||||
});
|
||||
|
||||
/**
|
||||
* 根据代码获取对应的选项列表
|
||||
* @param {string} code - 统计类型代码
|
||||
* @returns {Array} 返回匹配的选项列表,如果没有匹配则返回空数组
|
||||
*/
|
||||
const getStatisticsOptionList = (code) => {
|
||||
// 在统计选项列表中查找匹配代码的项,然后返回其 optionList 属性,如果没有找到则返回空数组
|
||||
return statisticsOptionList.value.find((item) => item.code === code)?.optionList || [];
|
||||
};
|
||||
|
||||
// 返回响应式数据和方法供组件使用
|
||||
return {
|
||||
statisticsOptionList,
|
||||
getStatisticsOptionList,
|
||||
statisticsOptionList, // 完整的统计选项列表
|
||||
getStatisticsOptionList, // 根据代码获取选项列表的方法
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="template-content">
|
||||
<div class="template-header">
|
||||
<h3>股骨头坏死(模板1)</h3>
|
||||
<h3>股骨头坏死(模板11111111)</h3>
|
||||
</div>
|
||||
<div class="template-body">
|
||||
<p>主诉:左侧髋部疼痛X个月,加重1周。</p>
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<script setup>
|
||||
defineOptions({
|
||||
name: 'Template1'
|
||||
name: '股骨头坏死(模板11111111)'
|
||||
})
|
||||
// 可以在这里添加组件逻辑
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user