Files
his/openhis-ui-vue3/src/views/inpatientNurse/inOut/index.vue
chenqi 803e4d0bb5 refactor(inhospitalnursestation): 优化入院护士站应用的数据库查询性能
- 将CTE查询重构为子查询以提高执行效率
- 为位置和医生查询添加LIMIT 1约束以减少数据量
- 移除不必要的GROUP BY子句以简化查询逻辑
- 在前端组件中实现异步数据加载和错误处理机制
- 使用可选链操作符处理空值情况避免报错
- 添加防抖机制解决单击双击冲突问题
- 优化患者列表和床位列表的并行加载逻辑
- 清理调试用的console.log语句并替换为有意义的信息
2026-01-19 22:36:04 +08:00

81 lines
2.1 KiB
Vue

<!--
* @Author: sjjh
* @Date: 2025-04-09 14:50:04
* @Description:
-->
<template>
<div class="inpatientNurseHome-inOut-container">
<el-tabs v-model="activeTabName" class="inOut-tabs" @tab-click="test">
<el-tab-pane label="入科" name="first">
<BedAllocation v-if="activeTabName === 'first'" ref="firstRef" />
</el-tab-pane>
<el-tab-pane label="转出" name="second">
<TransferOut
v-if="activeTabName === 'second'"
ref="secondRef"
operation-type="transfer"
:visible="activeTabName === 'second'"
/>
</el-tab-pane>
<el-tab-pane label="出院" name="third">
<TransferOut
v-if="activeTabName === 'third'"
ref="thirdRef"
operation-type="discharge"
:visible="activeTabName === 'third'"
/>
</el-tab-pane>
<!-- <el-tab-pane label="出院患者" name="fourth">Config</el-tab-pane> -->
</el-tabs>
</div>
</template>
<script setup lang="ts">
import {nextTick, onBeforeMount, onMounted, reactive, ref} from 'vue';
import BedAllocation from './components/bedAllocation.vue';
import TransferOut from './components/transferOut.vue';
// const { proxy } = getCurrentInstance()
// const emits = defineEmits([])
// const props = defineProps({})
const state = reactive({});
const firstRef = ref();
const secondRef = ref();
const thirdRef = ref();
onBeforeMount(() => {});
onMounted(() => {});
defineExpose({ state });
const test = async () => {
await nextTick();
if (activeTabName.value == 'first') {
await firstRef?.value?.refreshTap();
} else if (activeTabName.value == 'second') {
await secondRef?.value?.refreshTap();
} else if (activeTabName.value == 'third') {
await thirdRef?.value?.refreshTap();
}
};
const activeTabName = ref('first');
</script>
<style lang="scss" scoped>
.inpatientNurseHome-inOut-container {
width: 100%;
height: 100%;
display: flex;
:deep(.inOut-tabs) {
height: 100%;
width: 100%;
.el-tabs__header {
margin: 0;
padding: 0 0 0 8px;
}
.el-tab-pane {
height: 100%;
}
.el-tabs__content {
height: calc(100% - 40px);
}
}
}
</style>