zhuliu 1 year ago
parent
commit
a07b3c7d87

+ 6 - 4
src/utils/model/RichText/index.vue

@@ -95,12 +95,14 @@ export default {
       
     })
     window.onkeydown = this.checkKeyPress
-    if(this.autoFocus){
-      this.$refs.myEditBox.focus()
-    }
+    
   },
   methods: {
-
+    setFocus(){
+      if(this.autoFocus){
+        this.$refs.myEditBox.focus()
+      }
+    },
 
     clickBtn(method){
      

+ 3 - 1
src/views/report/InvalidResponse/components/reasonsAndEvidence/common.js

@@ -443,7 +443,9 @@ export default {
         }).catch(error=>{
           message.close()
           this.$message.success('编辑失败')
-          this.closeEdit()
+          if(this.$refs[field.field+row.proofGroupId] && this.$refs[field.field+row.proofGroupId][0]){
+            this.$refs[field.field+row.proofGroupId][0].setFocus()
+          }
         })
       },
       //添加特征

+ 1 - 1
src/views/report/InvalidResponse/components/reasonsAndEvidence/details_2.vue

@@ -20,7 +20,7 @@
                                     <el-option label="基于修改后权要维持有效"  value="基于修改后权要维持有效"></el-option>
                                     <el-option label="全部无效"  value="全部无效"></el-option>
                                 </el-select>
-                                <my-RichText v-else :autoFocus="true" :value="getColumnData(scope.row,item)" @blur="(value)=>changeMessage(item,scope.row,value)"></my-RichText>
+                                <my-RichText v-else :ref="item.field + scope.row.proofGroupId" :autoFocus="true" :value="getColumnData(scope.row,item)" @blur="(value)=>changeMessage(item,scope.row,value)"></my-RichText>
                             </div>
                             
                             <div class="text" v-else >