Просмотр исходного кода

刷新指标先退出编辑模式,使文本框失焦

hbchen 5 месяцев назад
Родитель
Сommit
7eda4b01bc
1 измененных файлов с 23 добавлено и 18 удалено
  1. 23 18
      src/views/datasheet_manage/customAnalysis/list.vue

+ 23 - 18
src/views/datasheet_manage/customAnalysis/list.vue

@@ -446,6 +446,7 @@ export default {
       this.sheetAllcellData = [],//全部单元格数据 分页push
       this.dataToalPage = 0;
       this.sheetConfigOpt.data = null;
+      this.hasChange=false
       newval && this.getDetailHandle();
     },
 
@@ -863,27 +864,31 @@ export default {
     },
 
     /* 刷新表格 */
-    refreshSheet: _.debounce(async function() {
+    refreshSheet: _.debounce(function() {
       if(this.isEdbReFreshLoading) return
-      
-      this.isEdbReFreshLoading = true;
-      let res={}
-      // 内容有改变 刷新前需要先保存
-      if(this.hasChange){
-        let saveSuccess = await this.saveApi()
-        if(!saveSuccess){
-          // 没保存成功
-          this.isEdbReFreshLoading = false;
-          return
+      //退出编辑模式,让文本框失焦 
+      luckysheet.exitEditMode();
+      // 保存逻辑延后 让hasChange取得正确的值
+      setTimeout(async()=>{
+        this.isEdbReFreshLoading = true;
+        let res={}
+        // 内容有改变 刷新前需要先保存
+        if(this.hasChange){
+          let saveSuccess = await this.saveApi()
+          if(!saveSuccess){
+            // 没保存成功
+            this.isEdbReFreshLoading = false;
+            return
+          }
+          res = await sheetInterface.sheetAnalysisInterface.sheetRefresh({ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,closableErrMsg123:true})
+        }else{
+          res = await sheetInterface.sheetAnalysisInterface.sheetRefresh({ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,closableErrMsg123:true})
         }
-        res = await sheetInterface.sheetAnalysisInterface.sheetRefresh({ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,closableErrMsg123:true})
-      }else{
-        res = await sheetInterface.sheetAnalysisInterface.sheetRefresh({ExcelInfoId: this.sheetDetailInfo.ExcelInfoId,closableErrMsg123:true})
-      }
 
-      this.isEdbReFreshLoading = false;
-      if(res.Ret !== 200) return 
-      this.shouldClosedHintshow(res.Msg)
+        this.isEdbReFreshLoading = false;
+        if(res.Ret !== 200) return 
+        this.shouldClosedHintshow(res.Msg)
+      })
     },300),
 
     /* 重绘右侧区域宽度 */