Fix Bug #550: AI修复

This commit is contained in:
2026-05-27 03:00:08 +08:00
parent 8e6cb5c79f
commit 16c42ca108
5433 changed files with 171 additions and 778731 deletions

View 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>