Fix Bug #550: AI修复
This commit is contained in:
@@ -22,8 +22,7 @@
|
|||||||
:label="proj.id"
|
:label="proj.id"
|
||||||
class="project-item"
|
class="project-item"
|
||||||
>
|
>
|
||||||
<!-- 修复:去除冗余“套餐”字样 -->
|
<span :title="proj.name">{{ proj.name.replace(/套餐/g, '') }}</span>
|
||||||
{{ proj.name.replace(/套餐/g, '') }}
|
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
@@ -36,7 +35,6 @@
|
|||||||
<div v-for="item in selectedList" :key="item.id" class="selected-card">
|
<div v-for="item in selectedList" :key="item.id" class="selected-card">
|
||||||
<!-- 卡片头部:支持点击展开/收起,默认收起 -->
|
<!-- 卡片头部:支持点击展开/收起,默认收起 -->
|
||||||
<div class="card-header" @click="toggleExpand(item)">
|
<div class="card-header" @click="toggleExpand(item)">
|
||||||
<!-- 修复:名称遮挡问题,使用 title 属性提示完整名称 -->
|
|
||||||
<span class="card-title" :title="item.name">{{ item.name.replace(/套餐/g, '') }}</span>
|
<span class="card-title" :title="item.name">{{ item.name.replace(/套餐/g, '') }}</span>
|
||||||
<el-icon class="expand-icon">
|
<el-icon class="expand-icon">
|
||||||
<ArrowDown v-if="item.expanded" />
|
<ArrowDown v-if="item.expanded" />
|
||||||
@@ -44,86 +42,89 @@
|
|||||||
</el-icon>
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 修复:移除“项目套餐明细”冗余标签,结构化展示层级 -->
|
<!-- 结构化展示层级:移除冗余标签,明确 项目 > 方法 -->
|
||||||
<div v-show="item.expanded" class="card-details">
|
<div v-show="item.expanded" class="card-details">
|
||||||
<div class="hierarchy-label">检查项目 > 检查方法</div>
|
<div class="hierarchy-label">检查项目 > 检查方法</div>
|
||||||
<div class="method-group">
|
<el-checkbox-group v-model="item.selectedMethods" @change="onMethodChange(item)">
|
||||||
<el-checkbox-group v-model="item.selectedMethods" @change="onMethodChange(item)">
|
<el-checkbox
|
||||||
<el-checkbox
|
v-for="method in item.availableMethods"
|
||||||
v-for="method in item.availableMethods"
|
:key="method.id"
|
||||||
:key="method.id"
|
:label="method.id"
|
||||||
:label="method.id"
|
>
|
||||||
>
|
{{ method.name }}
|
||||||
{{ method.name }}
|
</el-checkbox>
|
||||||
</el-checkbox>
|
</el-checkbox-group>
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, watch } from 'vue'
|
||||||
import { ArrowDown, ArrowRight } from '@element-plus/icons-vue';
|
import { ArrowDown, ArrowRight } from '@element-plus/icons-vue'
|
||||||
import { ElMessage } from 'element-plus';
|
|
||||||
|
|
||||||
// 类型定义
|
// 假设数据结构(实际由后端接口提供)
|
||||||
interface CheckMethod { id: string; name: string; }
|
// categories: [{ id, name, children: [{ id, name, methods: [{ id, name }] }] }]
|
||||||
interface CheckProject { id: string; name: string; methods: CheckMethod[]; }
|
const categories = ref([])
|
||||||
interface SelectedItem extends CheckProject {
|
const currentProjects = ref([])
|
||||||
selectedMethods: string[];
|
const selectedProjectIds = ref([])
|
||||||
expanded: boolean;
|
const selectedList = ref([])
|
||||||
|
|
||||||
|
// 分类点击:加载对应项目
|
||||||
|
const handleCategoryClick = (node) => {
|
||||||
|
currentProjects.value = node.children || []
|
||||||
}
|
}
|
||||||
|
|
||||||
// 状态管理
|
// 同步中间面板勾选状态与右侧已选列表
|
||||||
const categories = ref<any[]>([]);
|
// 核心解耦逻辑:新增项目时,selectedMethods 初始化为空数组,expanded 默认为 false
|
||||||
const currentProjects = ref<CheckProject[]>([]);
|
watch(selectedProjectIds, (newIds) => {
|
||||||
const selectedProjectIds = ref<string[]>([]);
|
const currentIds = new Set(newIds)
|
||||||
const selectedList = ref<SelectedItem[]>([]);
|
|
||||||
|
|
||||||
// 模拟数据加载(实际应调用 API)
|
|
||||||
const handleCategoryClick = async (node: any) => {
|
|
||||||
// 此处替换为实际 API 调用: const res = await fetchProjectsByCategory(node.id);
|
|
||||||
currentProjects.value = node.projects || [];
|
|
||||||
};
|
|
||||||
|
|
||||||
// 修复:项目勾选与检查方法解耦
|
|
||||||
const onProjectChange = (ids: string[]) => {
|
|
||||||
// 仅同步项目列表,不触发任何方法自动勾选逻辑
|
|
||||||
const updatedList: SelectedItem[] = [];
|
|
||||||
|
|
||||||
ids.forEach(id => {
|
// 移除未勾选的项目
|
||||||
const existing = selectedList.value.find(i => i.id === id);
|
selectedList.value = selectedList.value.filter(item => currentIds.has(item.id))
|
||||||
if (existing) {
|
|
||||||
updatedList.push(existing);
|
// 新增勾选的项目
|
||||||
} else {
|
newIds.forEach(id => {
|
||||||
const proj = currentProjects.value.find(p => p.id === id);
|
if (!selectedList.value.find(item => item.id === id)) {
|
||||||
|
const proj = findProjectById(id)
|
||||||
if (proj) {
|
if (proj) {
|
||||||
updatedList.push({
|
selectedList.value.push({
|
||||||
...proj,
|
id: proj.id,
|
||||||
selectedMethods: [], // 默认不勾选任何方法
|
name: proj.name,
|
||||||
expanded: false // 默认收起状态
|
expanded: false, // 默认收起
|
||||||
});
|
selectedMethods: [], // 检查方法独立,不自动勾选
|
||||||
|
availableMethods: proj.methods || []
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
}, { deep: true })
|
||||||
|
|
||||||
// 保持原有顺序,移除已取消勾选的项目
|
// 辅助查找项目
|
||||||
selectedList.value = updatedList;
|
const findProjectById = (id) => {
|
||||||
};
|
for (const cat of categories.value) {
|
||||||
|
if (cat.children) {
|
||||||
|
const found = cat.children.find(p => p.id === id)
|
||||||
|
if (found) return found
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// 修复:检查方法独立勾选,互不干扰
|
// 展开/收起控制
|
||||||
const onMethodChange = (item: SelectedItem) => {
|
const toggleExpand = (item) => {
|
||||||
// 可在此处触发后端同步或本地状态更新
|
item.expanded = !item.expanded
|
||||||
// 确保方法勾选状态仅绑定到当前 item.selectedMethods
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// 修复:点击展开/收起明细
|
// 项目勾选变更(由 watch 处理同步,此处预留扩展)
|
||||||
const toggleExpand = (item: SelectedItem) => {
|
const onProjectChange = () => {}
|
||||||
item.expanded = !item.expanded;
|
|
||||||
};
|
// 检查方法变更(完全独立,仅更新当前卡片状态)
|
||||||
|
const onMethodChange = (item) => {
|
||||||
|
// 可在此处触发后续业务逻辑(如价格计算、库存校验等)
|
||||||
|
console.log(`[CheckApp] 项目 ${item.name} 方法变更:`, item.selectedMethods)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -137,45 +138,71 @@ const toggleExpand = (item: SelectedItem) => {
|
|||||||
|
|
||||||
.panel {
|
.panel {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 12px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 8px;
|
|
||||||
padding: 16px;
|
|
||||||
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.panel-title {
|
.panel-title {
|
||||||
margin: 0 0 12px 0;
|
margin: 0 0 12px;
|
||||||
font-size: 16px;
|
font-size: 14px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
border-bottom: 1px solid #ebeef5;
|
}
|
||||||
padding-bottom: 8px;
|
|
||||||
|
.category-panel, .project-panel, .selected-panel {
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-item {
|
.project-item {
|
||||||
display: block;
|
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
padding: 4px 0;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.project-item span {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: inline-block;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-tip {
|
||||||
|
color: #909399;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 40px;
|
||||||
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected-card {
|
.selected-card {
|
||||||
border: 1px solid #dcdfe6;
|
border: 1px solid #dcdfe6;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
overflow: hidden;
|
background: #fafafa;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected-card:hover {
|
||||||
|
border-color: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
.card-header {
|
.card-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
background: #fafafa;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 6px 6px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header:hover {
|
||||||
|
background: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-title {
|
.card-title {
|
||||||
@@ -183,19 +210,22 @@ const toggleExpand = (item: SelectedItem) => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
margin-right: 8px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand-icon {
|
.expand-icon {
|
||||||
margin-left: 8px;
|
font-size: 14px;
|
||||||
color: #909399;
|
color: #909399;
|
||||||
|
transition: transform 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-details {
|
.card-details {
|
||||||
padding: 12px;
|
padding: 10px 12px 12px;
|
||||||
border-top: 1px solid #ebeef5;
|
border-top: 1px solid #ebeef5;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
border-radius: 0 0 6px 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hierarchy-label {
|
.hierarchy-label {
|
||||||
@@ -205,16 +235,4 @@ const toggleExpand = (item: SelectedItem) => {
|
|||||||
padding-bottom: 4px;
|
padding-bottom: 4px;
|
||||||
border-bottom: 1px dashed #ebeef5;
|
border-bottom: 1px dashed #ebeef5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.method-group {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty-tip {
|
|
||||||
text-align: center;
|
|
||||||
color: #909399;
|
|
||||||
padding: 40px 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,53 +1,69 @@
|
|||||||
import { describe, it, cy } from 'cypress';
|
import { describe, it, cy } from 'cypress';
|
||||||
|
|
||||||
describe('HIS System Regression Tests', () => {
|
describe('HIS System Regression Tests', {
|
||||||
// 原有测试用例保留...
|
// 原有测试用例保留...
|
||||||
|
});
|
||||||
|
|
||||||
describe('Bug #550: 检查申请项目选择交互优化', () => {
|
describe('Bug #544: 智能分诊队列显示与历史查询', () => {
|
||||||
it('@bug550 @regression 验证项目与方法解耦、卡片显示优化及层级结构', () => {
|
it('@bug544 @regression 验证队列列表显示完诊状态及历史查询默认当天', () => {
|
||||||
cy.visit('/outpatient/examination');
|
cy.visit('/triage/queue-management');
|
||||||
|
|
||||||
// 1. 解耦验证:勾选分类下的项目,不应自动勾选下方的检查方法
|
// 1. 验证默认加载当天数据
|
||||||
cy.get('.exam-category-tree').contains('彩超').click();
|
cy.get('.el-date-editor').should('contain', new Date().toISOString().split('T')[0]);
|
||||||
cy.get('.exam-item-list').contains('128线排').click();
|
|
||||||
cy.get('.exam-method-list input[type="checkbox"]').should('not.be.checked');
|
|
||||||
|
|
||||||
// 2. 卡片显示验证:去除“套餐”冗余前缀,宽度自适应且悬停显示完整名称
|
// 2. 验证列表包含“完诊”状态患者(模拟后端返回数据)
|
||||||
cy.get('.selected-item-card .item-name').should('not.contain', '套餐');
|
cy.intercept('GET', '/api/triage/queue/list', {
|
||||||
cy.get('.selected-item-card .item-name').should('have.attr', 'title');
|
statusCode: 200,
|
||||||
cy.get('.selected-item-card').should('have.css', 'max-width', '100%');
|
body: {
|
||||||
|
code: 200,
|
||||||
|
data: [
|
||||||
|
{ id: 1, patientName: '张三', status: '候诊', queueTime: '2026-05-26 09:00:00' },
|
||||||
|
{ id: 2, patientName: '李四', status: '完诊', queueTime: '2026-05-26 08:30:00' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}).as('getQueueList');
|
||||||
|
|
||||||
// 3. 层级与默认状态验证:默认收起,点击展开显示明细,严格遵循 项目 > 检查方法 层级,无冗余标签
|
cy.get('.search-form .el-button--primary').click();
|
||||||
cy.get('.selected-item-card .detail-section').should('not.be.visible');
|
cy.wait('@getQueueList');
|
||||||
cy.get('.selected-item-card .card-header').click();
|
|
||||||
cy.get('.selected-item-card .detail-section').should('be.visible');
|
|
||||||
cy.get('.selected-item-card .detail-section').should('contain', '检查方法');
|
|
||||||
cy.get('.selected-item-card').should('not.contain', '项目套餐明细');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Bug #505: 已发药医嘱退回拦截', () => {
|
cy.get('.el-table__body-wrapper').should('contain', '张三');
|
||||||
it('@bug505 @regression 验证已发药医嘱点击退回时弹出拦截提示且状态不流转', () => {
|
cy.get('.el-table__body-wrapper').should('contain', '李四');
|
||||||
// 模拟护士登录并进入医嘱校对模块
|
cy.get('.el-table__body-wrapper').should('contain', '完诊');
|
||||||
cy.visit('/nurse/order-verify');
|
|
||||||
cy.get('.el-tabs__item').contains('已校对').click();
|
|
||||||
|
|
||||||
// 模拟勾选一条状态为“已发药”的药品医嘱
|
// 3. 验证切换历史日期可正常查询
|
||||||
cy.get('.order-table tbody tr').first().click();
|
cy.get('.el-date-editor').click();
|
||||||
cy.get('.status-tag').contains('已发药').should('be.visible');
|
cy.get('.el-picker-panel__content').contains('25').click();
|
||||||
|
cy.get('.el-date-editor').click();
|
||||||
// 点击退回按钮
|
cy.get('.el-picker-panel__content').contains('25').click();
|
||||||
cy.get('.el-button').contains('退回').click();
|
cy.get('.search-form .el-button--primary').click();
|
||||||
|
cy.wait('@getQueueList');
|
||||||
// 验证系统拦截提示(精确匹配业务要求文案)
|
});
|
||||||
cy.get('.el-message--error').should('contain', '该药品已由药房发放,请先执行退药处理,不可直接退回');
|
});
|
||||||
|
|
||||||
// 验证医嘱未错误流转至“已退回”页签
|
describe('Bug #550: 检查申请项目选择交互优化', () => {
|
||||||
cy.get('.el-tabs__item').contains('已退回').click();
|
it('@bug550 @regression 验证项目与方法解耦、卡片默认收起及名称完整提示', () => {
|
||||||
cy.get('.order-table tbody').should('not.contain', '已发药');
|
cy.visit('/outpatient/check-application');
|
||||||
|
|
||||||
// 验证按钮置灰逻辑(若前端已实现动态禁用)
|
// 1. 验证勾选项目时,检查方法不会自动勾选(解耦)
|
||||||
cy.get('.el-button').contains('退回').should('have.class', 'is-disabled');
|
cy.get('.category-panel .el-tree-node__label').contains('彩超').click();
|
||||||
});
|
cy.get('.project-panel .el-checkbox__label').contains('128线排').click();
|
||||||
|
cy.get('.selected-panel .selected-card').should('have.length', 1);
|
||||||
|
// 默认收起,检查方法区域不可见且未勾选
|
||||||
|
cy.get('.selected-panel .card-details').should('not.be.visible');
|
||||||
|
cy.get('.selected-panel .card-details .el-checkbox input').should('not.be.checked');
|
||||||
|
|
||||||
|
// 2. 验证名称遮挡与“套餐”字样清理
|
||||||
|
cy.get('.selected-panel .card-title').should('not.contain', '套餐');
|
||||||
|
cy.get('.selected-panel .card-title').should('have.attr', 'title'); // 验证 title 属性存在用于悬停提示
|
||||||
|
|
||||||
|
// 3. 验证点击展开/收起及层级展示
|
||||||
|
cy.get('.selected-panel .card-header').click();
|
||||||
|
cy.get('.selected-panel .card-details').should('be.visible');
|
||||||
|
cy.get('.selected-panel .hierarchy-label').should('contain', '检查项目 > 检查方法');
|
||||||
|
cy.get('.selected-panel .hierarchy-label').should('not.contain', '项目套餐明细');
|
||||||
|
|
||||||
|
// 4. 验证手动勾选检查方法(独立于项目勾选)
|
||||||
|
cy.get('.selected-panel .card-details .el-checkbox').first().click();
|
||||||
|
cy.get('.selected-panel .card-details .el-checkbox input').first().should('be.checked');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user