瀏覽代碼

优化缺陷抽屉页面更改不刷新主页数据bug

qinzhipeng_v 5 年之前
父節點
當前提交
1fa4098933

+ 3 - 3
src/views/projectManage/bugList/bugindex.vue

@@ -254,10 +254,10 @@
 </template>
 
 <script>
-import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog'
-import createdBug from '@/views/projectManage/bugList/file/createdBug'
+import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷主页表格
+import createdBug from '@/views/projectManage/bugList/file/createdBug' // 新建缺陷
 import normalDialog from '@/components/dialog/normalDialog'
-import filterList from '@/views/projectManage/bugList/details/filterList'
+import filterList from '@/views/projectManage/bugList/details/filterList' // 筛选过滤器
 import { deepClone } from '@/utils/global'
 import searchPeople from '@/components/select/searchPeople' // 人员select
 import '@/styles/PublicStyle/index.scss'

+ 11 - 2
src/views/projectManage/bugList/details/bugTableDialog.vue

@@ -56,8 +56,8 @@
           :type="'drawer'"
           :drawer-show="drawerShow"
           @close="drawerShow = false"
-          @delete="drawerShow = false;type === 'page'?this.$emit('getBugList'):this.$emit('getBugSelfList')"
-          @update="type === 'page'?this.$emit('getBugList'):this.$emit('getBugSelfList')"
+          @delete="getBugSelfList"
+          @update="getBugList"
         />
       </div>
     </el-drawer>
@@ -160,6 +160,15 @@ export default {
         }
       })
     },
+    getBugList() {
+      this.bugGetTableList(this.queryData, false)
+    },
+    getBugSelfList() {
+      this.bugGetTableList(this.queryData, false)
+      this.$nextTick(() => {
+        this.drawerShow = false
+      })
+    },
     handleCurrentChange(val) { // 分页
       this.curIndex = val
       this.bugGetTableList(this.queryData, false)

+ 2 - 5
src/views/projectManage/bugList/details/index.vue

@@ -977,6 +977,7 @@ export default {
         if (res.code === 200) {
           this.describeEditorVisible = false
           this.bugGet(this.bug.id)
+          this.$emit('update', false)
         }
       })
     },
@@ -987,6 +988,7 @@ export default {
     },
     updateBugStatus() {
       this.bugGet(this.bug.id)
+      this.$emit('update', false)
     },
     bugGet(id, isLoading) {
       this.loading.fullscreen = isLoading
@@ -995,11 +997,6 @@ export default {
           if (this.num === 0) {
             document.getElementsByClassName('scop')[0].scrollTop = 0
           }
-          // if (this.type !== 'page') {
-          //   if (res.data.bizId !== Number(localStorage.getItem('bizId'))) {
-          //     Utils.$emit('demo', res.data.bizId)
-          //   }
-          // }
           this.bug = res.data
           this.bug.currentHandler = res.data.currentHandler.split(',')
           this.bug.assigner = res.data.assigner.split(',')

+ 2 - 1
src/views/projectManage/bugList/file/createdBug.vue

@@ -435,10 +435,11 @@ export default {
             this.modalShow = false
             this.$message({ message: res.msg, type: 'success', duration: 1000, offset: 150 })
             this.$emit('father')
+            this.$emit('getBugList')
             if (this.getBugList) {
               this.getBugList()
             }
-            this.$emit('reloadList')
+            this.$emit('getBugList')
           })
         }
       })

+ 11 - 3
src/views/workbench/bugTableList.vue

@@ -66,8 +66,8 @@
           :type="'drawer'"
           :drawer-show="drawerShow"
           @close="drawerShow = false"
-          @delete="drawerShow = false;type === 'page'?this.$emit('getBugList'):this.$emit('getBugSelfList')"
-          @update="type === 'page'?this.$emit('getBugList'):this.$emit('getBugSelfList')"
+          @delete="getBugSelfList"
+          @update="getBugList"
         />
       </div>
     </el-drawer>
@@ -122,7 +122,6 @@ export default {
     }
   },
   created() {
-    // this.bugGetTableList()
     this.getBugSelect()
   },
   methods: {
@@ -174,6 +173,15 @@ export default {
         }
       }
     },
+    getBugList() {
+      this.bugGetTableList()
+    },
+    getBugSelfList() {
+      this.bugGetTableList()
+      this.$nextTick(() => {
+        this.drawerShow = false
+      })
+    },
     handleSizeChange(val) {
       this.pageSize = val
     },