@@ -163,7 +163,7 @@ function generateCode() {
163163  const   ID =  props .historyCaseID  
164164  if  (isHistoryTestCase .value  ==  true ){ 
165165    API .HistoryGenerateCode ({ 
166-       ID : ID , 
166+       id : ID , 
167167      generator: currentCodeGenerator .value  
168168    }, (e ) =>  { 
169169      ElMessage ({ 
@@ -401,6 +401,9 @@ function setTestCaseWithSuite(e, suite) {
401401    suiteName: suite , 
402402    data: e  
403403  } as  TestCaseWithSuite ; 
404+     if  (isHistoryTestCase .value  ==  true ){  
405+       testCaseWithSuite .value .data .request .api  =  ` ${testCaseWithSuite .value .data .suiteApi }${testCaseWithSuite .value .data .request .api } `   
406+     } 
404407} 
405408
406409load ()
@@ -515,14 +518,28 @@ function openHistoryDialog(){
515518  }) 
516519} 
517520
521+ function  handleDialogClose(){
522+   caseRevertLoading .value  =  false  
523+   historyDialogOpened .value  =  false  
524+   historyForm .value .selectedID  =  ' '  
525+   const   target =  document .getElementById (' compareView'  ); 
526+   target .innerHTML  =  ' '  
527+ } 
528+ 
518529function  handleHistoryChange(value ) {
519530  selectedHistory .value  =  historyRecords .value .find (record  =>  record .ID  ===  value ); 
520531  const   { 
521532  caseName : name, 
522533  suiteName, 
523534  request, 
524-   response 
535+   response, 
536+   historyHeader, 
525537  } =  selectedHistory .value ; 
538+   request .header  =  historyHeader  
539+   request .header .push ({ 
540+         key: ' '  , 
541+         value: ' '  
542+   }) 
526543  formatHistoryCase .value  =  { 
527544    name , 
528545    suiteName , 
@@ -573,11 +590,7 @@ const submitForm = async (formEl) => {
573590          load () 
574591        } 
575592      }, UIAPI .ErrorTip , saveLoading ) 
576-       caseRevertLoading .value  =  false  
577-       historyDialogOpened .value  =  false  
578-       historyForm .value .selectedID  =  ' '  
579-       const   target =  document .getElementById (' compareView'  ); 
580-       target .innerHTML  =  ' '  ; 
593+       handleDialogClose () 
581594    } 
582595  }) 
583596} 
@@ -587,25 +600,17 @@ const goToHistory = async (formEl) => {
587600  await  formEl .validate ((valid :  boolean , fields ) =>  { 
588601    if  (valid ) { 
589602      caseRevertLoading .value  =  true  
590-       emit (' toHistoryPanel'  , { ID: selectedHistory .value .ID , panelName: ' history'   }); 
591-       caseRevertLoading .value  =  false  
592-       historyDialogOpened .value  =  false  
593-       historyForm .value .selectedID  =  ' '  
594-       const   target =  document .getElementById (' compareView'  ); 
595-       target .innerHTML  =  ' '  ; 
603+       emit (' toHistoryPanel'  , { ID: selectedHistory .value .ID , panelName: ' history'   }) 
604+       handleDialogClose () 
596605    } 
597606  }) 
598607} 
599608
600609const   deleteAllHistory =  async  (formEl ) =>  {
601610  if  (! formEl ) return  
602611  caseRevertLoading .value  =  true  
603-   API .DeleteAllHistoryTestCase (props .suite , props .name , handleDeleteResponse ); 
604-   caseRevertLoading .value  =  false  
605-   historyDialogOpened .value  =  false  
606-   historyForm .value .selectedID  =  ' '  
607-   const   target =  document .getElementById (' compareView'  ); 
608-   target .innerHTML  =  ' '  ; 
612+   API .DeleteAllHistoryTestCase (props .suite , props .name , handleDeleteResponse ) 
613+   handleDialogClose () 
609614} 
610615
611616const   options =  GetHTTPMethods ()
@@ -1107,7 +1112,7 @@ Magic.Keys(() => {
11071112        </template >
11081113      </el-drawer >
11091114
1110-       <el-dialog  v-model =" historyDialogOpened"   :title =" t('button.viewHistory')"   width =" 60%"   draggable >
1115+       <el-dialog  @close = " handleDialogClose "   v-model =" historyDialogOpened"   :title =" t('button.viewHistory')"   width =" 60%"   draggable >
11111116        <el-form 
11121117          ref =" viewHistoryRef" 
11131118          :model =" historyForm" 
0 commit comments