zoukankan      html  css  js  c++  java
  • Element ui 分页记录选中框

        getTableList() {
          //列表数据查询
          queryRoomAudit(this.tableParameter).then(response => {
            this.tableData = response.data
            this.returnTotal = response.total
            this.toggleSelection(this.multipleSelectionAll[this.tableParameter.pageIndex], this.tableData, 'FJSH_ZJ') //当前页选中的list,(注意)需使用当前页tableData,才能选中,比对选中唯一值key
          })
        },
        handleCurrentChange(currentPage) {
          //页面索引改变时
          if (this.multipleSelection.length) {
            //页面改变前赋值
            this.$set(this.multipleSelectionAll, this.tableParameter.pageIndex, this.multipleSelection)
          }
          this.tableParameter.pageIndex = currentPage - 1
          this.getTableList()
        },
        toggleSelection(rows, tableData, key) {
          //记录值list,当前页list,用来比较的唯一值key
          var _this = this
          if (rows) {
            this.$nextTick(() => {
              for (const row of rows) {
                for (const item of tableData) {
                  if (row[key] === item[key]) {
                    _this.$refs.multipleTable.toggleRowSelection(item, true)
                  }
                }
              }
            })
          } else {
            _this.$refs.multipleTable.clearSelection()
          }
        }
  • 相关阅读:
    自定义文书思路
    传输
    Netty的组件和设计
    第一款Netty应用程序
    Netty异步和事件驱动
    初识MQTT
    TCP/IP协议分层模型
    uni原生插件的开发(安卓)
    uniapp离线打包记录
    日常问题处理:Linux通过设备名称如何查看硬盘SN
  • 原文地址:https://www.cnblogs.com/HCXiao/p/14945211.html
Copyright © 2011-2022 走看看