点击各个按钮,在执行操作之前出现确认提示框

需求分析:点击各个按钮,在执行操作之前出现确认提示框
有的按钮是携带参数的,需要传两个参数判断,所以handDilog函数接受两个参数,第一个是储存他代表哪个方法,第二个参数是这个按钮获取的数据
点击弹框的确认按钮将执行对应的方法,用switch函数判断是哪个方法

  <el-button type="primary" size="mini" @click="handDilog('lldw',scope.row)">链路定位</el-button>
// 打开提示框

​    handDilog(done,data){

​      this.dialogVisible = true

​      this.execute = done

​      this.rowData = data

​      console.log(this.execute,this.rowData);

​    },
  // 确认按钮

​    confirm(){

​      this.dialogVisible = false

​      switch(this.execute){

​        case 'plcl':

​        this.handleSelection()

​        break;

​          case 'tz':

​        this.errorHandler(this.rowData)

​        break;

​          case 'lldw':

​        this.ErrorGraph(this.rowData)

​        break;

​      }

​    },
posted @ 2022-04-26 23:54  张尊娟  阅读(164)  评论(0编辑  收藏  举报