From 409f7cde307af675bda894a2b9830f5be18888e9 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Wed, 27 May 2026 04:17:40 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20Bug=20#550:=20AI=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examination/ExaminationApplication.vue | 152 ++++++++---------- .../tests/e2e/specs/bug-regression.spec.ts | 37 ++--- 2 files changed, 82 insertions(+), 107 deletions(-) diff --git a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue index ae29086b7..85b273688 100644 --- a/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue +++ b/openhis-ui-vue3/src/views/outpatient/examination/ExaminationApplication.vue @@ -34,16 +34,12 @@
- {{ cleanName(item.name) }} {{ item.expanded ? '▲' : '▼' }}
-
-
- {{ method.name }}
@@ -60,133 +56,122 @@ 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 254bbaf4f..0b1a8e621 100755 --- a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts +++ b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts @@ -59,30 +59,23 @@ describe('Bug #550: 门诊医生站-检查申请项目选择交互优化', { tag cy.login('doctor1', '123456') cy.visit('/outpatient/examination-application') - // 1. 选择分类 - cy.contains('.category-list li', '彩超').click() + // 1. 选择分类并勾选项目 + cy.contains('检查项目分类').should('be.visible') + cy.contains('彩超').click() + cy.contains('128线排').parent().find('input[type="checkbox"]').check() - // 2. 勾选项目 - cy.get('.item-list').contains('128线排').parent().find('input[type="checkbox"]').check() + // 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') - // 3. 验证已选择区域显示 - cy.get('[data-cy="selected-card-128"]').should('be.visible') + // 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') - // 4. 验证默认收起 & 名称清理(无“套餐”前缀,完整名称提示) - cy.get('[data-cy="selected-card-128"] .item-title').should('not.contain', '套餐') - cy.get('[data-cy="selected-card-128"] .item-title').should('have.attr', 'title') - cy.get('[data-cy="details-panel"]').should('not.be.visible') - - // 5. 展开明细 - cy.get('[data-cy="expand-btn"]').click() - cy.get('[data-cy="details-panel"]').should('be.visible') - - // 6. 验证检查方法未自动勾选(解耦) - cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('not.be.checked') - - // 7. 手动勾选方法,验证独立控制 - cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').check() - cy.get('[data-cy="method-item"]').first().find('input[type="checkbox"]').should('be.checked') - cy.get('[data-cy="method-item"]').eq(1).find('input[type="checkbox"]').should('not.be.checked') + // 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线排') }) })