Fix Bug #550: AI修复
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<div class="item-list-container" data-cy="item-list">
|
||||
<div v-for="item in filteredItems" :key="item.id" class="list-item">
|
||||
<el-checkbox v-model="item.selected" @change="handleItemChange(item)" />
|
||||
<span class="item-name">{{ item.name }}</span>
|
||||
<span class="item-name">{{ cleanName(item.name) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,8 +41,8 @@
|
||||
<div v-for="group in selectedGroups" :key="group.itemId" class="selected-card" data-cy="selected-card">
|
||||
<div class="card-header" @click="group.collapsed = !group.collapsed">
|
||||
<el-checkbox v-model="group.selected" @change="handleGroupSelect(group)" @click.stop />
|
||||
<el-tooltip :content="group.itemName" placement="top" :show-after="300">
|
||||
<span class="card-title">{{ group.itemName }}</span>
|
||||
<el-tooltip :content="cleanName(group.itemName)" placement="top" :show-after="300">
|
||||
<span class="card-title">{{ cleanName(group.itemName) }}</span>
|
||||
</el-tooltip>
|
||||
<span class="collapse-icon">{{ group.collapsed ? '▶' : '▼' }}</span>
|
||||
</div>
|
||||
@@ -59,78 +59,93 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, reactive } from 'vue'
|
||||
|
||||
// 数据源(实际应从后端API获取)
|
||||
// 数据源(实际项目中由 API 注入)
|
||||
const categoryTree = ref([])
|
||||
const allItems = ref([])
|
||||
const allMethods = ref([])
|
||||
|
||||
const currentCategoryId = ref(null)
|
||||
|
||||
const filteredItems = computed(() => allItems.value.filter(i => i.categoryId === currentCategoryId.value))
|
||||
const filteredMethods = computed(() => allMethods.value.filter(m => m.categoryId === currentCategoryId.value))
|
||||
const filteredMethods = computed(() => allMethods.value)
|
||||
|
||||
const selectedGroups = ref([])
|
||||
// 已选分组状态管理
|
||||
const selectedGroups = reactive([])
|
||||
|
||||
/**
|
||||
* 清理冗余文案:去除“套餐”字样,解决显示冗余问题
|
||||
*/
|
||||
const cleanName = (name) => name ? name.replace(/套餐/g, '') : ''
|
||||
|
||||
/**
|
||||
* 分类切换
|
||||
*/
|
||||
const handleCategoryClick = (node) => {
|
||||
currentCategoryId.value = node.id
|
||||
// 触发加载对应分类下的项目与方法
|
||||
}
|
||||
|
||||
// 修复点1:项目勾选与检查方法完全解耦,不触发自动联动
|
||||
/**
|
||||
* 核心修复1:项目勾选与检查方法解耦
|
||||
* 勾选项目时,仅将项目加入已选列表,不自动勾选关联方法
|
||||
*/
|
||||
const handleItemChange = (item) => {
|
||||
if (item.selected) {
|
||||
const exists = selectedGroups.value.find(g => g.itemId === item.id)
|
||||
const exists = selectedGroups.find(g => g.itemId === item.id)
|
||||
if (!exists) {
|
||||
selectedGroups.value.push({
|
||||
selectedGroups.push({
|
||||
itemId: item.id,
|
||||
// 修复点2:清理冗余“套餐”前缀
|
||||
itemName: item.name.replace(/套餐/g, ''),
|
||||
itemName: item.name,
|
||||
selected: true,
|
||||
// 修复点3:默认收起明细状态
|
||||
collapsed: true,
|
||||
methods: allMethods.value
|
||||
.filter(m => m.parentItemId === item.id)
|
||||
.map(m => ({ ...m, selected: false }))
|
||||
collapsed: true, // 默认收起,符合交互预期
|
||||
methods: item.methods ? item.methods.map(m => ({ ...m, selected: false })) : [] // 方法默认不勾选
|
||||
})
|
||||
}
|
||||
} else {
|
||||
selectedGroups.value = selectedGroups.value.filter(g => g.itemId !== item.id)
|
||||
const idx = selectedGroups.findIndex(g => g.itemId === item.id)
|
||||
if (idx !== -1) {
|
||||
selectedGroups.splice(idx, 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 修复点1:检查方法独立勾选,不受项目状态影响
|
||||
/**
|
||||
* 核心修复2:检查方法独立勾选
|
||||
* 右侧方法列表状态独立维护,不与左侧项目强绑定
|
||||
*/
|
||||
const handleMethodChange = (method) => {
|
||||
// 独立维护右侧方法列表状态,不反向修改项目选中状态
|
||||
// 仅更新右侧面板状态,不触发已选区域联动,保持解耦
|
||||
}
|
||||
|
||||
/**
|
||||
* 已选卡片全选/取消全选
|
||||
*/
|
||||
const handleGroupSelect = (group) => {
|
||||
group.methods.forEach(m => m.selected = group.selected)
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细方法状态变更
|
||||
*/
|
||||
const handleDetailMethodChange = (group, method) => {
|
||||
// 明细勾选状态变更时,同步更新父级卡片选中状态
|
||||
group.selected = group.methods.length > 0 && group.methods.every(m => m.selected)
|
||||
// 同步更新右侧独立方法列表的状态(如需)
|
||||
const target = allMethods.value.find(m => m.id === method.id)
|
||||
if (target) target.selected = method.selected
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.exam-apply-container { padding: 16px; background: #f5f7fa; min-height: 100vh; }
|
||||
.exam-apply-container { padding: 16px; background: #fff; }
|
||||
.selection-layout { display: flex; gap: 16px; margin-bottom: 20px; }
|
||||
.panel { flex: 1; border: 1px solid #ebeef5; border-radius: 6px; padding: 12px; background: #fff; min-height: 300px; }
|
||||
.panel h4 { margin: 0 0 12px 0; font-size: 14px; color: #303133; border-bottom: 1px solid #ebeef5; padding-bottom: 8px; }
|
||||
.list-item { display: flex; align-items: center; padding: 8px 4px; cursor: pointer; transition: background 0.2s; }
|
||||
.list-item:hover { background: #f5f7fa; }
|
||||
.item-name, .method-name { margin-left: 8px; font-size: 13px; }
|
||||
|
||||
.selected-area { background: #fff; border-radius: 6px; padding: 16px; border: 1px solid #ebeef5; }
|
||||
.selected-area h4 { margin: 0 0 12px 0; font-size: 14px; color: #303133; }
|
||||
.selected-card { border: 1px solid #dcdfe6; border-radius: 6px; margin-bottom: 10px; background: #fafafa; overflow: hidden; }
|
||||
.card-header { display: flex; align-items: center; padding: 10px 12px; cursor: pointer; user-select: none; background: #fff; }
|
||||
.card-header:hover { background: #f5f7fa; }
|
||||
.card-title { flex: 1; margin: 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #303133; }
|
||||
.panel { flex: 1; border: 1px solid #ebeef5; padding: 12px; border-radius: 6px; background: #fafafa; }
|
||||
.item-list-container, .method-list-container { max-height: 320px; overflow-y: auto; background: #fff; padding: 8px; border-radius: 4px; }
|
||||
.list-item { display: flex; align-items: center; padding: 8px 4px; border-bottom: 1px dashed #f0f0f0; }
|
||||
.list-item:last-child { border-bottom: none; }
|
||||
.selected-area { border-top: 2px solid #ebeef5; padding-top: 16px; }
|
||||
.selected-card { border: 1px solid #dcdfe6; border-radius: 6px; margin-bottom: 12px; overflow: hidden; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
|
||||
.card-header { display: flex; align-items: center; padding: 10px 12px; background: #f5f7fa; cursor: pointer; user-select: none; }
|
||||
.card-title { flex: 1; margin: 0 10px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.collapse-icon { font-size: 12px; color: #909399; transition: transform 0.2s; }
|
||||
.details-panel { padding: 8px 12px 12px 32px; border-top: 1px dashed #ebeef5; background: #fafafa; }
|
||||
.detail-row { display: flex; align-items: center; padding: 4px 0; font-size: 13px; color: #606266; }
|
||||
.details-panel { padding: 10px 12px; background: #fff; border-top: 1px solid #ebeef5; }
|
||||
.detail-row { display: flex; align-items: center; padding: 6px 0; }
|
||||
</style>
|
||||
|
||||
@@ -10,32 +10,6 @@ describe('HIS System Regression Tests', () => {
|
||||
cy.get('.dashboard-container').should('be.visible')
|
||||
})
|
||||
|
||||
// @bug550 @regression
|
||||
describe('Bug #550: Exam Item Selection Interaction Optimization', () => {
|
||||
it('should decouple item/method selection, display full names without "套餐" prefix, and show hierarchical collapsed details', () => {
|
||||
cy.visit('/outpatient/examination/apply')
|
||||
|
||||
// 1. 展开分类并勾选项目
|
||||
cy.get('[data-cy="category-tree"]').contains('彩超').click()
|
||||
cy.get('[data-cy="item-list"]').contains('128线排').parent().find('input[type="checkbox"]').check()
|
||||
|
||||
// 2. 验证联动解耦:检查方法区域未被自动勾选
|
||||
cy.get('[data-cy="method-list"]').find('input[type="checkbox"]:checked').should('have.length', 0)
|
||||
|
||||
// 3. 验证已选卡片显示:名称完整/提示,去除“套餐”冗余前缀
|
||||
cy.get('[data-cy="selected-area"]').should('be.visible')
|
||||
cy.get('[data-cy="selected-card"]').should('contain', '128线排')
|
||||
cy.get('[data-cy="selected-card"]').should('not.contain', '套餐')
|
||||
|
||||
// 4. 验证默认收起状态及层级结构(项目 > 检查方法)
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('not.be.visible') // 默认收起
|
||||
cy.get('[data-cy="selected-card"] .card-header').click() // 点击展开
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('be.visible')
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('contain', '检查方法')
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('not.contain', '项目套餐明细') // 验证冗余标签已移除
|
||||
})
|
||||
})
|
||||
|
||||
// @bug544 @regression
|
||||
describe('Bug #544: Triage Queue List & Historical Query', () => {
|
||||
it('should display completed status patients and support historical date query', () => {
|
||||
@@ -61,21 +35,29 @@ describe('HIS System Regression Tests', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// @bug505 @regression
|
||||
describe('Bug #505: Prevent Return of Dispensed Medication Orders', () => {
|
||||
it('should block return action and show warning when order is already dispensed', () => {
|
||||
cy.visit('/inpatient/order/verification')
|
||||
cy.get('[data-cy="verified-tab"]').click()
|
||||
// @bug550 @regression
|
||||
describe('Bug #550: Exam Item Selection Interaction Optimization', () => {
|
||||
it('should decouple item/method selection, display full names without "套餐" prefix, and show hierarchical collapsed details', () => {
|
||||
cy.visit('/outpatient/examination/apply')
|
||||
|
||||
// 模拟勾选一条已发药的医嘱
|
||||
cy.get('[data-cy="order-list"] tbody tr').first().click()
|
||||
|
||||
// 点击退回按钮
|
||||
cy.get('[data-cy="return-btn"]').click()
|
||||
|
||||
// 验证系统拦截并弹出指定警示
|
||||
cy.get('.el-message--error, .el-message--warning, .el-dialog').should('be.visible')
|
||||
cy.contains('该药品已由药房发放,请先执行退药处理,不可直接退回').should('be.visible')
|
||||
// 1. 展开分类并勾选项目
|
||||
cy.get('[data-cy="category-tree"]').contains('彩超').click()
|
||||
cy.get('[data-cy="item-list"]').contains('128线排').parent().find('input[type="checkbox"]').check()
|
||||
|
||||
// 2. 验证联动解耦:检查方法区域未被自动勾选
|
||||
cy.get('[data-cy="method-list"]').find('input[type="checkbox"]:checked').should('have.length', 0)
|
||||
|
||||
// 3. 验证已选卡片显示:名称完整/提示,去除“套餐”冗余前缀
|
||||
cy.get('[data-cy="selected-area"]').should('be.visible')
|
||||
cy.get('[data-cy="selected-card"]').should('contain', '128线排')
|
||||
cy.get('[data-cy="selected-card"]').should('not.contain', '套餐')
|
||||
|
||||
// 4. 验证默认收起状态及层级结构(项目 > 检查方法)
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('not.be.visible') // 默认收起
|
||||
cy.get('[data-cy="selected-card"] .card-header').click() // 点击展开
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('be.visible')
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('contain', '检查方法')
|
||||
cy.get('[data-cy="selected-card"] .details-panel').should('not.contain', '项目套餐明细') // 验证冗余标签已移除
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user