wenbobowen 4 years ago
parent
commit
85145acf41
1 changed files with 7 additions and 6 deletions
  1. 7 6
      src/views/projectManage/bugList/file/createdBug.vue

+ 7 - 6
src/views/projectManage/bugList/file/createdBug.vue

@@ -165,7 +165,7 @@
       <el-button id="pasteUpload" type="primary" style="display: none" @click.stop="pasteUpload">upload</el-button>
       <div slot="footer">
         <el-button @click="modalShow = false">取 消</el-button>
-        <el-button :disabled="dis" type="primary" @click="bug_createds(formInline)">创 建</el-button>
+        <el-button :disabled="dis" :loading="createLoading" type="primary" @click="bug_created(formInline)">创 建</el-button>
       </div>
     </modal>
     <normal-dialog :show-dialog="showCopyFile" :title="'上传截图'" :width="'40%'" :submit-button="'上传'" :top="'5vh'" @confirm="confirmUpload()" @cancel="showCopyFile=false">
@@ -274,6 +274,7 @@ export default {
       test: [], // 人员查询
       form: {},
       formInline: {},
+      createLoading: false,
       userInformation: localStorage.getItem('username'),
       userNames: localStorage.getItem('realname'),
       rules: {
@@ -366,6 +367,7 @@ export default {
     },
     init(e, ele) {
       this.modalShow = true
+      this.createLoading = false
       this.$nextTick(() => {
         this.$refs['formInline'].clearValidate()
       })
@@ -500,11 +502,6 @@ export default {
       // 文件上传时的钩子
       this.dis = true
     },
-
-    bug_createds: _.throttle(function() {
-      this.bug_created(this.formInline)
-    }, 2000),
-
     bug_created(e) {
       // 创建(提交)
       this.$refs['formInline'].validate(valid => {
@@ -517,6 +514,7 @@ export default {
             ename: this.userInformation,
             id: ''
           }
+          this.createLoading = true
           bugCreate({ bugBaseInfo: {
             ...data,
             assigner: data.assigner.join(),
@@ -535,8 +533,11 @@ export default {
                 this.getBugList()
               }
               this.$emit('getBugList')
+              this.createLoading = false
             }
             this.modalShow = res.code !== 200
+          }).catch(() => {
+            this.createLoading = false
           })
         }
       })