const aliasOfFetchTwoWorks = 'getTwoStudy'; export const FetchTwoWorks = `@${aliasOfFetchTwoWorks}`; // 删除Study的alias const aliasOfDeleteStudy = 'deleteStudy'; export const DeleteStudy = `@${aliasOfDeleteStudy}`; // 原有的mock函数 export function mockFetchTwoWorks() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { "code": "0x000000", "description": "Success", "solution": "", "data": { "@type": "type.googleapis.com/dr.study.StudyList", "count": 1992, "studies": [ { "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635", "study_id": "20250912135259444", "public_study_id": "", "specific_character_set": "ISO_IR 192", "accession_number": "ACC0012345", "ref_physician": "Dr. Smith (Vet)", "patient_id": "PET007", "patient_name": "乾隆-==皇上", "patient_english_name": "Buddy en", "patient_former_name": "Buddy f", "patient_size": "Large", "other_patient_ids": "", "other_patient_names": "", "patient_age": "5Y", "patient_dob": "2025-06-10T03:12:36.181739Z", "patient_sex": "M", "sex_neutered": "", "pregnancy_status": "", "patient_state": "", "admitting_time": null, "priority": "", "reg_source": "", "study_description": "", "study_start_datetime": "2025-09-12T05:52:59.699143Z", "study_end_datetime": null, "scheduled_procedure_step_start_date": null, "performed_physician": "", "study_lock": "Unlocked", "folder_path": "", "operator_name": "OP987", "modality": "DX", "weight": 25, "thickness": 15, "length": 60, "patient_type": "Human", "study_type": "Normal", "owner_name": "owner1", "chip_number": "CHIP123456789", "variety": "Golden Retriever", "is_anaesthesia": true, "is_sedation": true, "mwl": "", "is_exported": false, "is_edited": false, "is_appended": false, "department": "", "mapped_status": false, "qc_result": false, "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四", "study_status": "Arrived", "sort": 0, "product": "DROS", "series": [] }, { "study_instance_uid": "2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627", "study_id": "20250912135259265", "public_study_id": "", "specific_character_set": "ISO_IR 192", "accession_number": "ACC0012345", "ref_physician": "Dr. Smith (Vet)", "patient_id": "PET007", "patient_name": "Buddy (Dog)", "patient_english_name": "Buddy en", "patient_former_name": "Buddy f", "patient_size": "Large", "other_patient_ids": "", "other_patient_names": "", "patient_age": "5Y", "patient_dob": "2025-06-10T03:12:36.181739Z", "patient_sex": "M", "sex_neutered": "", "pregnancy_status": "", "patient_state": "", "admitting_time": null, "priority": "", "reg_source": "", "study_description": "", "study_start_datetime": "2025-09-12T05:52:59.573182Z", "study_end_datetime": null, "scheduled_procedure_step_start_date": null, "performed_physician": "", "study_lock": "Unlocked", "folder_path": "", "operator_name": "OP987", "modality": "DX", "weight": 25, "thickness": 15, "length": 60, "patient_type": "Human", "study_type": "Normal", "owner_name": "owner1", "chip_number": "CHIP123456789", "variety": "Golden Retriever", "is_anaesthesia": true, "is_sedation": true, "mwl": "", "is_exported": false, "is_edited": false, "is_appended": false, "department": "", "mapped_status": false, "qc_result": false, "comment": "一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四", "study_status": "Arrived", "sort": 0, "product": "DROS", "series": [] }, ] } } }).as(aliasOfFetchTwoWorks); } /** * Mock: 返回2条记录,第一条未锁定 */ const aliasOfFetchTwoWorksWithUnlocked = 'getTwoWorksUnlocked'; export const FetchTwoWorksWithUnlocked = `@${aliasOfFetchTwoWorksWithUnlocked}`; export function mockFetchTwoWorksWithUnlocked() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 2, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635', study_id: '20250912135259444', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'ACC0012345', ref_physician: 'Dr. Smith (Vet)', patient_id: 'PET007', patient_name: '测试患者1', patient_english_name: 'Test Patient 1', patient_former_name: '', patient_size: 'Large', other_patient_ids: '', other_patient_names: '', patient_age: '5Y', patient_dob: '2025-06-10T03:12:36.181739Z', patient_sex: 'M', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-12T05:52:59.699143Z', study_end_datetime: null, scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP987', modality: 'DX', weight: 25, thickness: 15, length: 60, patient_type: 'Human', study_type: 'Normal', owner_name: 'owner1', chip_number: 'CHIP123456789', variety: 'Golden Retriever', is_anaesthesia: true, is_sedation: true, mwl: '', is_exported: false, is_edited: false, is_appended: false, department: '', mapped_status: false, qc_result: false, comment: '测试记录1', study_status: 'Arrived', sort: 0, product: 'DROS', series: [], }, { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627', study_id: '20250912135259265', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'ACC0012346', ref_physician: 'Dr. Smith (Vet)', patient_id: 'PET008', patient_name: '测试患者2', patient_english_name: 'Test Patient 2', patient_former_name: '', patient_size: 'Large', other_patient_ids: '', other_patient_names: '', patient_age: '3Y', patient_dob: '2025-06-10T03:12:36.181739Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-12T05:52:59.573182Z', study_end_datetime: null, scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP987', modality: 'DX', weight: 25, thickness: 15, length: 60, patient_type: 'Human', study_type: 'Normal', owner_name: 'owner1', chip_number: 'CHIP123456789', variety: 'Golden Retriever', is_anaesthesia: true, is_sedation: true, mwl: '', is_exported: false, is_edited: false, is_appended: false, department: '', mapped_status: false, qc_result: false, comment: '测试记录2', study_status: 'Arrived', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchTwoWorksWithUnlocked); } /** * Mock: 返回2条记录,第一条已锁定 */ const aliasOfFetchTwoWorksWithLocked = 'getTwoWorksLocked'; export const FetchTwoWorksWithLocked = `@${aliasOfFetchTwoWorksWithLocked}`; export function mockFetchTwoWorksWithLocked() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 2, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100635', study_id: '20250912135259444', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'ACC0012345', ref_physician: 'Dr. Smith (Vet)', patient_id: 'PET007', patient_name: '测试患者1', patient_english_name: 'Test Patient 1', patient_former_name: '', patient_size: 'Large', other_patient_ids: '', other_patient_names: '', patient_age: '5Y', patient_dob: '2025-06-10T03:12:36.181739Z', patient_sex: 'M', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-12T05:52:59.699143Z', study_end_datetime: null, scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Locked', // 已锁定 folder_path: '', operator_name: 'OP987', modality: 'DX', weight: 25, thickness: 15, length: 60, patient_type: 'Human', study_type: 'Normal', owner_name: 'owner1', chip_number: 'CHIP123456789', variety: 'Golden Retriever', is_anaesthesia: true, is_sedation: true, mwl: '', is_exported: false, is_edited: false, is_appended: false, department: '', mapped_status: false, qc_result: false, comment: '测试记录1-已锁定', study_status: 'Arrived', sort: 0, product: 'DROS', series: [], }, { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627', study_id: '20250912135259265', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'ACC0012346', ref_physician: 'Dr. Smith (Vet)', patient_id: 'PET008', patient_name: '测试患者2', patient_english_name: 'Test Patient 2', patient_former_name: '', patient_size: 'Large', other_patient_ids: '', other_patient_names: '', patient_age: '3Y', patient_dob: '2025-06-10T03:12:36.181739Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-12T05:52:59.573182Z', study_end_datetime: null, scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP987', modality: 'DX', weight: 25, thickness: 15, length: 60, patient_type: 'Human', study_type: 'Normal', owner_name: 'owner1', chip_number: 'CHIP123456789', variety: 'Golden Retriever', is_anaesthesia: true, is_sedation: true, mwl: '', is_exported: false, is_edited: false, is_appended: false, department: '', mapped_status: false, qc_result: false, comment: '测试记录2', study_status: 'Arrived', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchTwoWorksWithLocked); } /** * Mock: 删除后返回1条记录 */ const aliasOfFetchWorklistAfterDelete = 'getWorklistAfterDelete'; export const FetchWorklistAfterDelete = `@${aliasOfFetchWorklistAfterDelete}`; export function mockFetchWorklistAfterDelete() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 1, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.100627', study_id: '20250912135259265', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'ACC0012346', ref_physician: 'Dr. Smith (Vet)', patient_id: 'PET008', patient_name: '测试患者2', patient_english_name: 'Test Patient 2', patient_former_name: '', patient_size: 'Large', other_patient_ids: '', other_patient_names: '', patient_age: '3Y', patient_dob: '2025-06-10T03:12:36.181739Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-12T05:52:59.573182Z', study_end_datetime: null, scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', folder_path: '', operator_name: 'OP987', modality: 'DX', weight: 25, thickness: 15, length: 60, patient_type: 'Human', study_type: 'Normal', owner_name: 'owner1', chip_number: 'CHIP123456789', variety: 'Golden Retriever', is_anaesthesia: true, is_sedation: true, mwl: '', is_exported: false, is_edited: false, is_appended: false, department: '', mapped_status: false, qc_result: false, comment: '测试记录2', study_status: 'Arrived', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchWorklistAfterDelete); } /** * Mock: 删除Study成功 */ export function mockDeleteStudySuccess() { cy.intercept('DELETE', '/dr/api/v1/auth/study', { statusCode: 200, body: { code: '0x000000', description: '删除成功', solution: '', data: {}, }, }).as(aliasOfDeleteStudy); } /** * Mock: 删除Study失败 */ export function mockDeleteStudyFailure() { cy.intercept('DELETE', '/dr/api/v1/auth/study', { statusCode: 200, body: { code: '0x000001', description: '删除失败', solution: '请稍后重试', data: {}, }, }).as(aliasOfDeleteStudy); } /** * Mock: History数据 - 2条记录,第一条未锁定 */ const aliasOfFetchHistoryDataWithUnlocked = 'getHistoryUnlocked'; export const FetchHistoryDataWithUnlocked = `@${aliasOfFetchHistoryDataWithUnlocked}`; export function mockFetchHistoryDataWithUnlocked() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 2, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200001', study_id: 'HIST20250912001', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'HIST001', ref_physician: 'Dr. Johnson', patient_id: 'HIST001', patient_name: 'History患者1', patient_english_name: 'History Patient 1', patient_former_name: '', patient_size: 'Medium', other_patient_ids: '', other_patient_names: '', patient_age: '40Y', patient_dob: '1985-01-01T00:00:00Z', patient_sex: 'M', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-01T08:00:00Z', study_end_datetime: '2025-09-01T09:00:00Z', scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP001', modality: 'DX', weight: 70, thickness: 20, length: 175, patient_type: 'Human', study_type: 'Normal', owner_name: '', chip_number: '', variety: '', is_anaesthesia: false, is_sedation: false, mwl: '', is_exported: true, is_edited: false, is_appended: false, department: '', mapped_status: true, qc_result: true, comment: 'History测试记录1', study_status: 'Completed', sort: 0, product: 'DROS', series: [], }, { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002', study_id: 'HIST20250912002', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'HIST002', ref_physician: 'Dr. Johnson', patient_id: 'HIST002', patient_name: 'History患者2', patient_english_name: 'History Patient 2', patient_former_name: '', patient_size: 'Medium', other_patient_ids: '', other_patient_names: '', patient_age: '35Y', patient_dob: '1990-01-01T00:00:00Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-02T08:00:00Z', study_end_datetime: '2025-09-02T09:00:00Z', scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP001', modality: 'DX', weight: 65, thickness: 18, length: 165, patient_type: 'Human', study_type: 'Normal', owner_name: '', chip_number: '', variety: '', is_anaesthesia: false, is_sedation: false, mwl: '', is_exported: true, is_edited: false, is_appended: false, department: '', mapped_status: true, qc_result: true, comment: 'History测试记录2', study_status: 'Completed', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchHistoryDataWithUnlocked); } /** * Mock: History数据 - 2条记录,第一条已锁定 */ const aliasOfFetchHistoryDataWithLocked = 'getHistoryLocked'; export const FetchHistoryDataWithLocked = `@${aliasOfFetchHistoryDataWithLocked}`; export function mockFetchHistoryDataWithLocked() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 2, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200001', study_id: 'HIST20250912001', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'HIST001', ref_physician: 'Dr. Johnson', patient_id: 'HIST001', patient_name: 'History患者1', patient_english_name: 'History Patient 1', patient_former_name: '', patient_size: 'Medium', other_patient_ids: '', other_patient_names: '', patient_age: '40Y', patient_dob: '1985-01-01T00:00:00Z', patient_sex: 'M', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-01T08:00:00Z', study_end_datetime: '2025-09-01T09:00:00Z', scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Locked', // 已锁定 folder_path: '', operator_name: 'OP001', modality: 'DX', weight: 70, thickness: 20, length: 175, patient_type: 'Human', study_type: 'Normal', owner_name: '', chip_number: '', variety: '', is_anaesthesia: false, is_sedation: false, mwl: '', is_exported: true, is_edited: false, is_appended: false, department: '', mapped_status: true, qc_result: true, comment: 'History测试记录1-已锁定', study_status: 'Completed', sort: 0, product: 'DROS', series: [], }, { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002', study_id: 'HIST20250912002', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'HIST002', ref_physician: 'Dr. Johnson', patient_id: 'HIST002', patient_name: 'History患者2', patient_english_name: 'History Patient 2', patient_former_name: '', patient_size: 'Medium', other_patient_ids: '', other_patient_names: '', patient_age: '35Y', patient_dob: '1990-01-01T00:00:00Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-02T08:00:00Z', study_end_datetime: '2025-09-02T09:00:00Z', scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', // 未锁定 folder_path: '', operator_name: 'OP001', modality: 'DX', weight: 65, thickness: 18, length: 165, patient_type: 'Human', study_type: 'Normal', owner_name: '', chip_number: '', variety: '', is_anaesthesia: false, is_sedation: false, mwl: '', is_exported: true, is_edited: false, is_appended: false, department: '', mapped_status: true, qc_result: true, comment: 'History测试记录2', study_status: 'Completed', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchHistoryDataWithLocked); } /** * Mock: History删除后返回1条记录 */ const aliasOfFetchHistoryAfterDelete = 'getHistoryAfterDelete'; export const FetchHistoryAfterDelete = `@${aliasOfFetchHistoryAfterDelete}`; export function mockFetchHistoryAfterDelete() { cy.intercept('GET', '/dr/api/v1/auth/study*', { statusCode: 200, body: { code: '0x000000', description: 'Success', solution: '', data: { '@type': 'type.googleapis.com/dr.study.StudyList', count: 1, studies: [ { study_instance_uid: '2.25.156.999999.0000.1.2.2831189249.819691.1757656379.200002', study_id: 'HIST20250912002', public_study_id: '', specific_character_set: 'ISO_IR 192', accession_number: 'HIST002', ref_physician: 'Dr. Johnson', patient_id: 'HIST002', patient_name: 'History患者2', patient_english_name: 'History Patient 2', patient_former_name: '', patient_size: 'Medium', other_patient_ids: '', other_patient_names: '', patient_age: '35Y', patient_dob: '1990-01-01T00:00:00Z', patient_sex: 'F', sex_neutered: '', pregnancy_status: '', patient_state: '', admitting_time: null, priority: '', reg_source: '', study_description: '', study_start_datetime: '2025-09-02T08:00:00Z', study_end_datetime: '2025-09-02T09:00:00Z', scheduled_procedure_step_start_date: null, performed_physician: '', study_lock: 'Unlocked', folder_path: '', operator_name: 'OP001', modality: 'DX', weight: 65, thickness: 18, length: 165, patient_type: 'Human', study_type: 'Normal', owner_name: '', chip_number: '', variety: '', is_anaesthesia: false, is_sedation: false, mwl: '', is_exported: true, is_edited: false, is_appended: false, department: '', mapped_status: true, qc_result: true, comment: 'History测试记录2', study_status: 'Completed', sort: 0, product: 'DROS', series: [], }, ], }, }, }).as(aliasOfFetchHistoryAfterDelete); }