From 5707a498a5012dca578e511a857f762f86366782 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Wed, 27 May 2026 03:47:25 +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 --- .../src/views/outpatient/ExaminationApply.vue | 128 ++++++++---------- .../tests/e2e/specs/bug-regression.spec.ts | 33 +++++ 2 files changed, 92 insertions(+), 69 deletions(-) diff --git a/openhis-ui-vue3/src/views/outpatient/ExaminationApply.vue b/openhis-ui-vue3/src/views/outpatient/ExaminationApply.vue index 9bb0a02d3..44712face 100644 --- a/openhis-ui-vue3/src/views/outpatient/ExaminationApply.vue +++ b/openhis-ui-vue3/src/views/outpatient/ExaminationApply.vue @@ -57,61 +57,63 @@ @@ -119,8 +121,8 @@ const handleMethodSelect = (item) => { .examination-apply-container { display: flex; gap: 16px; - padding: 16px; height: 100%; + padding: 16px; background: #f5f7fa; } .panel { @@ -128,53 +130,41 @@ const handleMethodSelect = (item) => { border-radius: 6px; padding: 12px; background: #fff; - box-shadow: 0 2px 4px rgba(0,0,0,0.05); + display: flex; + flex-direction: column; } -.category-panel { width: 22%; } -.item-panel { width: 28%; } -.selected-panel { flex: 1; overflow-y: auto; } +.category-panel { width: 20%; } +.item-panel { width: 35%; overflow-y: auto; } +.selected-panel { width: 45%; overflow-y: auto; } .panel-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #303133; } -.empty-tip { color: #909399; text-align: center; padding: 20px 0; } .item-row, .method-row { padding: 8px 0; border-bottom: 1px dashed #f0f0f0; } -.item-row:last-child, .method-row:last-child { border-bottom: none; } - .selected-card { - border: 1px solid #dcdfe6; + margin-bottom: 12px; + border: 1px solid #e4e7ed; border-radius: 6px; - margin-bottom: 10px; - background: #fafafa; - transition: all 0.2s; + overflow: hidden; + transition: box-shadow 0.2s; } -.selected-card:hover { border-color: #409eff; } +.selected-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.05); } .card-header { display: flex; align-items: center; - padding: 10px 12px; + padding: 10px; cursor: pointer; + background: #fafafa; gap: 8px; user-select: none; } .card-name { flex: 1; - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; font-weight: 500; color: #303133; } -.toggle-icon { - color: #909399; - transition: transform 0.2s; -} -.card-detail { - padding: 0 12px 12px 36px; - border-top: 1px dashed #ebeef5; - background: #fff; -} -.detail-title { - font-size: 12px; - color: #909399; - margin: 8px 0 4px; - font-weight: 500; -} +.toggle-icon { margin-left: auto; color: #909399; } +.card-detail { padding: 10px; background: #fff; border-top: 1px solid #ebeef5; } +.detail-title { font-size: 13px; color: #909399; margin-bottom: 8px; } +.empty-tip { color: #909399; text-align: center; padding: 30px 0; } 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 9ba20a16a..66830be6c 100755 --- a/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts +++ b/openhis-ui-vue3/tests/e2e/specs/bug-regression.spec.ts @@ -26,4 +26,37 @@ describe('Bug Regression Tests', () => { cy.get('.el-pagination').should('be.visible') cy.get('[data-cy="pending-record-table"] tbody tr').should('have.length.greaterThan', 0) }) + + // @bug550 @regression + it('Bug #550: 检查申请项目选择交互应解耦、卡片默认收起且名称完整', () => { + cy.login('doctor1', '123456') + cy.visit('/outpatient/examination-apply') + + // 1. 模拟选择分类和项目 + cy.get('[data-cy="category-tree"]').contains('彩超').click() + cy.get('[data-cy="item-list"]').find('[data-cy="item-checkbox-128"]').check() + + // 2. 验证已选择区域卡片默认收起,且方法未被自动勾选 + cy.get('[data-cy="selected-panel"]').within(() => { + cy.get('.selected-card').should('have.length', 1) + cy.get('[data-cy="selected-card-detail"]').should('not.be.visible') + cy.get('[data-cy^="method-checkbox-"]').should('not.be.checked') + }) + + // 3. 验证名称清理(去除“套餐”冗余字样) + cy.get('[data-cy="selected-card-name"]').should('not.contain', '套餐') + + // 4. 验证点击展开/收起交互 + cy.get('.card-header').first().click() + cy.get('[data-cy="selected-card-detail"]').should('be.visible') + cy.get('.card-header').first().click() + cy.get('[data-cy="selected-card-detail"]').should('not.be.visible') + + // 5. 验证项目与方法勾选完全解耦 + cy.get('.card-header').first().click() // 展开 + cy.get('[data-cy^="method-checkbox-"]').first().check() + cy.get('.card-header .el-checkbox').first().should('be.checked') // 项目状态独立 + cy.get('.card-header .el-checkbox').first().uncheck() + cy.get('[data-cy^="method-checkbox-"]').first().should('be.checked') // 取消项目不影响已选方法 + }) })