浏览代码

fixbug: 修复第三方检测事项 状态筛选页码不重置的bug

yunxing 4 年之前
父节点
当前提交
b75b696f2c
共有 3 个文件被更改,包括 8 次插入3 次删除
  1. 1 0
      src/views/other/zhsxOtherTable2.vue
  2. 3 1
      src/views/room/detail.vue
  3. 4 2
      src/views/room/room3.vue

+ 1 - 0
src/views/other/zhsxOtherTable2.vue

@@ -145,6 +145,7 @@ export default {
             // console.log(resetPage)
             if (resetPage !== false) {
                 this.page = 1
+                this.total = 0
             }
             let getParams = {
                 plazaId: this.$store.state.plazaId,

+ 3 - 1
src/views/room/detail.vue

@@ -217,12 +217,14 @@ export default {
         row: {
             deep: true,
             handler: function (newV, oldV) {
+                // 不需要初始化了,在room3.vue页面中,执行了key修改,会重新渲染页面
+                // this.initPage()
                 if (newV != oldV) {
-                    this.initPage()
                     this.queryDetail()
                     this.query()
                 }
             },
+            immediate: true,
         },
     },
     methods: {

+ 4 - 2
src/views/room/room3.vue

@@ -37,13 +37,13 @@
                 layout='prev, pager, next'
                 :total='total'
                 :page-size='size'
-                :current-page.sync="page"
+                :current-page.sync='page'
                 @prev-click='pageChanged'
                 @next-click='pageChanged'
                 @current-change='pageChanged'
             ></el-pagination>
         </div>
-        <el-dialog width='90%' :title='`${systemName}-${row.type_name}`' :visible.sync='innerVisible' append-to-body>
+        <el-dialog width='90%' :title='`${systemName}-${row.type_name}`' :key='dialogKey' :visible.sync='innerVisible' append-to-body>
             <detail v-if='row' :row='row' :location='location' :floorChange='floorChange'></detail>
         </el-dialog>
     </div>
@@ -61,6 +61,7 @@ export default {
             innerVisible: false,
             row: {},
             tableMaxHeight: 0,
+            dialogKey: `dialog_${new Date().getTime()}`,
         }
     },
 
@@ -76,6 +77,7 @@ export default {
             this.$emit('Index2Emit', page)
         },
         innerTable(row) {
+            this.dialogKey = `dialog_${new Date().getTime()}`
             this.row = row
             this.innerVisible = true
         },