Fix Bug #550: AI修复
This commit is contained in:
171
openhis-ui-vue3/src/views/outpatient/doctor/ExaminationApply.vue
Normal file
171
openhis-ui-vue3/src/views/outpatient/doctor/ExaminationApply.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<div class="examination-apply">
|
||||
<div class="main-layout">
|
||||
<!-- 左侧:检查项目分类 -->
|
||||
<div class="category-panel">
|
||||
<el-tree :data="categoryTree" node-key="id" @node-click="handleCategoryClick" />
|
||||
</div>
|
||||
<!-- 中间:检查项目列表 -->
|
||||
<div class="item-panel">
|
||||
<el-checkbox-group v-model="selectedItemIds" @change="handleItemSelect">
|
||||
<div v-for="item in currentItems" :key="item.id" class="item-row">
|
||||
<el-checkbox :label="item.id">{{ cleanName(item.name) }}</el-checkbox>
|
||||
</div>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 下方:已选择区域 -->
|
||||
<div class="selected-panel">
|
||||
<div v-for="item in selectedItems" :key="item.id" class="selected-item-card">
|
||||
<div class="card-header" @click="toggleDetail(item)">
|
||||
<el-tooltip :content="cleanName(item.name)" placement="top" :show-after="300">
|
||||
<span class="item-name">{{ cleanName(item.name) }}</span>
|
||||
</el-tooltip>
|
||||
<el-icon class="toggle-icon">
|
||||
<ArrowDown v-if="item.expanded" />
|
||||
<ArrowRight v-else />
|
||||
</el-icon>
|
||||
</div>
|
||||
<!-- 明细区域:默认收起,解耦展示 -->
|
||||
<div v-show="item.expanded" class="card-detail">
|
||||
<div class="hierarchy-tip">检查项目 > 检查方法</div>
|
||||
<div v-for="method in item.methods" :key="method.id" class="method-row">
|
||||
<el-checkbox
|
||||
class="exam-method-checkbox"
|
||||
:label="method.id"
|
||||
v-model="method.checked"
|
||||
@change="handleMethodChange(item, method)"
|
||||
>
|
||||
{{ method.name }}
|
||||
</el-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-empty v-if="selectedItems.length === 0" description="暂无已选项目" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { ArrowDown, ArrowRight } from '@element-plus/icons-vue';
|
||||
|
||||
// 模拟分类与项目数据(实际应从API获取)
|
||||
const categoryTree = ref([]);
|
||||
const currentItems = ref([]);
|
||||
const selectedItemIds = ref([]);
|
||||
const selectedItems = ref([]);
|
||||
|
||||
// 修复 Bug #550-2:清理名称,去除冗余的“套餐”字样
|
||||
const cleanName = (name) => name ? name.replace(/套餐/g, '') : '';
|
||||
|
||||
const handleCategoryClick = (node) => {
|
||||
// 加载对应分类下的项目
|
||||
// currentItems.value = fetchItemsByCategory(node.id);
|
||||
};
|
||||
|
||||
// 修复 Bug #550-1:项目勾选与检查方法解耦
|
||||
const handleItemSelect = (ids) => {
|
||||
// 仅同步已选项目ID,不自动联动勾选检查方法
|
||||
const newSelected = ids.map(id => {
|
||||
const existing = selectedItems.value.find(i => i.id === id);
|
||||
if (existing) return existing;
|
||||
const itemData = currentItems.value.find(i => i.id === id);
|
||||
return {
|
||||
id: itemData.id,
|
||||
name: itemData.name,
|
||||
methods: itemData.methods || [],
|
||||
expanded: false, // 修复 Bug #550-3:默认收起明细
|
||||
// 修复 Bug #550-1:方法独立勾选,初始为空数组
|
||||
selectedMethods: []
|
||||
};
|
||||
});
|
||||
// 过滤掉取消勾选的项目
|
||||
selectedItems.value = newSelected;
|
||||
};
|
||||
|
||||
const toggleDetail = (item) => {
|
||||
item.expanded = !item.expanded;
|
||||
};
|
||||
|
||||
// 修复 Bug #550-1:检查方法变更独立处理,不影响父级项目状态
|
||||
const handleMethodChange = (item, method) => {
|
||||
// 可根据业务需求在此处同步到后端或计算费用,但不触发父级联动
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.examination-apply {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
padding: 16px;
|
||||
}
|
||||
.main-layout {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
.category-panel, .item-panel {
|
||||
flex: 1;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.selected-panel {
|
||||
margin-top: 16px;
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
padding: 12px;
|
||||
min-height: 150px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.selected-item-card {
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 10px;
|
||||
background: #fafafa;
|
||||
}
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 12px;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
.card-header:hover {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
.item-name {
|
||||
flex: 1;
|
||||
font-weight: 500;
|
||||
/* 修复 Bug #550-2:宽度自适应,超长省略,配合 tooltip 显示全称 */
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.toggle-icon {
|
||||
margin-left: 8px;
|
||||
color: #909399;
|
||||
}
|
||||
.card-detail {
|
||||
padding: 10px 12px;
|
||||
background: #fff;
|
||||
}
|
||||
.hierarchy-tip {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
margin-bottom: 8px;
|
||||
/* 修复 Bug #550-3:明确层级结构提示,替代原冗余标签 */
|
||||
}
|
||||
.method-row {
|
||||
padding: 4px 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user