diff --git a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue index 85b273688..128b65952 100644 --- a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue +++ b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue @@ -34,12 +34,15 @@
+ {{ cleanName(item.name) }} {{ item.expanded ? '▲' : '▼' }}
+
+ {{ method.name }}
@@ -54,165 +57,89 @@ diff --git a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts index 0b1a8e621..eca1c3868 100755 --- a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts +++ b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts @@ -59,23 +59,30 @@ describe('Bug #550: 门诊医生站-检查申请项目选择交互优化', { tag cy.login('doctor1', '123456') cy.visit('/outpatient/examination-application') - // 1. 选择分类并勾选项目 + // 1. 选择分类 cy.contains('检查项目分类').should('be.visible') - cy.contains('彩超').click() - cy.contains('128线排').parent().find('input[type="checkbox"]').check() + cy.get('.category-list li').contains('彩超').click() - // 2. 验证已选卡片显示:去除“套餐”前缀,默认收起 - cy.get('[data-cy^="selected-card-"]').first().as('selectedCard') - cy.get('@selectedCard').find('.item-title').should('not.contain', '套餐') - cy.get('@selectedCard').find('[data-cy="details-panel"]').should('not.be.visible') + // 2. 勾选项目(模拟数据中存在 128线排彩超套餐) + cy.get('.item-list li').contains('128线排彩超套餐').click() - // 3. 验证解耦:展开后检查方法未被自动勾选 - cy.get('@selectedCard').find('[data-cy="expand-btn"]').click() - cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked') + // 3. 验证已选择区域出现卡片,且默认收起 + cy.get('[data-cy="selected-card-101"]').should('be.visible') + cy.get('[data-cy="selected-card-101"] .item-title').should('have.text', '128线排彩超') // 验证去除“套餐” + cy.get('[data-cy="details-panel"]').should('not.be.visible') // 验证默认收起 - // 4. 验证独立勾选与层级结构 - cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').check() - cy.get('@selectedCard').find('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('be.checked') - cy.get('@selectedCard').find('.card-header').should('contain.text', '128线排') + // 4. 验证检查方法未自动勾选 + cy.get('[data-cy="expand-btn"]').click() // 展开查看 + cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked') + + // 5. 独立勾选检查方法 + cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').click() + cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('be.checked') + // 再次点击取消,验证独立控制 + cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').click() + cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked') + + // 6. 验证名称完整显示(hover 或 title 属性) + cy.get('[data-cy="selected-card-101"] .item-title').should('have.attr', 'title', '128线排彩超') }) })