• 项目element-ui checkbox里面获取选中项 实现批量删除 修改


    <el-table :data="tableData" stripe border style=" 100%" @selection-change="changeFun">    //这里做一个事件 checkbox发生改变时触发
    <el-table-column type="selection" width="55" ref="multipleTable"></el-table-column>
    <el-table-column prop="index" label="序号" width="180"></el-table-column>
    <el-table-column prop="flowmeterType" label="设备类型"></el-table-column>
    <el-table-column prop="flowmeterNo" label="设备编号"></el-table-column>
    <el-table-column prop="flowmeterModel" label="设备型号"></el-table-column>
    <el-table-column prop="userName" label="用户姓名"></el-table-column>
    <el-table-column prop="phone" label="联系方式"></el-table-column>
    <el-table-column prop="installationLocation" label="所属小区"></el-table-column>
    <el-table-column prop="regionMap.level1" label="所属二级分区"></el-table-column>
    <el-table-column prop="regionMap.level2" label="所属一级分区"></el-table-column>
    <el-table-column label="操作">
    <template slot-scope="scope">
    <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
    <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
    </template>
    </el-table-column>
    </el-table>
     
     
    data{
      return {
        multipleSelection: [] //返回的是选中的列的数组集合   这里接收用户选中的id  默认放在这个数组里面 
    }
    }
     
     
    methods: {
    changeFun(val) { //获取用户的选中
    console.log(val);
    //this.multipleSelection = val // 返回的是选中的列的数组集合
    val.forEach(item => {
    this.multipleSelection.push(item.flowmeterId);   //把所有的id放进multipleSelection
    })
    console.log(this.multipleSelection)
     
    },
    PLdelete() { //批量删除流量计
    console.log(this.multipleSelection)
    this.$ajax.delete("/dataManagement/basic/deletedBatch",{flowmeterIds:this.multipleSelection})
    .then(res => {
    console.log(res);
    })
    },
  • 相关阅读:
    Mininet学习指南
    Docker and OverlayFS in practice
    (OK) dnf——install docker on Fedora23
    Running Docker Swarm inside LXC
    ERROR——running docker in CORE on Fedora23
    (OK) dnf
    (OK) simply running CORE & docker on Fedora 23
    北京大学互联网信息工程研发中心(深圳)
    nload
    (OK) CORE
  • 原文地址:https://www.cnblogs.com/xiaoxiaoxun/p/11213201.html
Copyright © 2020-2023  润新知