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

添加任务时给按钮添加加载动画

zhuliu 1 год назад
Родитель
Сommit
deb7510936

+ 10 - 2
src/views/components/dialog/examine.vue

@@ -23,7 +23,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="handleCloseTask">取 消</el-button>
-        <el-button type="primary" @click="submitTask">确 定</el-button>
+        <el-button type="primary" :loading="btnLoading" @click="submitTask">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -88,6 +88,7 @@ export default {
         name: '',
         data: [],
       },
+      btnLoading:false
     }
   },
   computed: {},
@@ -122,14 +123,21 @@ export default {
               this.form.handlerType = 0
             }
           }
+          this.showBtnLoading()
           this.$emit('save',this.form)
         }
       })
     },
 
-
+    showBtnLoading(){
+      this.btnLoading = true
+    },
+    cancelBtnLoading(){
+      this.btnLoading = false
+    },
     // 取消
     handleCloseTask() {
+      this.cancelBtnLoading()
       this.$refs.form.resetFields()
       this.form = {}
       this.showTask = false

+ 2 - 0
src/views/report/components/allocationTask/components/allocationTask.vue

@@ -313,6 +313,8 @@ export default {
           this.$refs.examine.handleCloseTask()
           this.dialogVisible = true
         }
+      }).catch(error=>{
+        this.$refs.examine.cancelBtnLoading()
       })
     },