<template>
  <div class="app-container">
    <el-card>
      <div style="margin-top: 5px">
        <el-table
          v-loading="loading"
          ref="multipleTable"
          :data="tableData"
          :header-cell-style="{background:'#eef1f6',color:'#606266'}"
          :expand-row-keys="expandsDetail"
          :row-key="getRowKeys"
          element-loading-text="数据加载中"
          element-loading-spinner="el-icon-loading"
          element-loading-background="rgba(0, 0, 0, 0.2)"
          class="main"
          tooltip-effect="dark"
          height="650px"
          style="width: 100%"
          border
          size="mini"
          @expand-change="selectParams">
          <el-table-column align="center" type="expand" label="" fixed width="35">
            <template slot-scope="scope" >
              <div style="margin: 5px 10px;z-index: 99;">
                <el-table
                  :data="tableDataParams"
                  :header-cell-style="{ background: '#e5e7f8', color: '#606266' }"
                  element-loading-text="数据加载中"
                  element-loading-spinner="el-icon-loading"
                  element-loading-background="rgba(0, 0, 0, 0.2)"
                  class="main"
                  tooltip-effect="dark"
                  style="width: 100%;z-index: 99;"
                  max-height="400px"
                  border
                  size="mini">
                  <el-table-column type="index" align="center" label="序号" width="80px"/>
                  <el-table-column :render-header="renderHeader_interFaceParamsName" align="center" label="参数名称" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.参数名称 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="参数说明" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.参数说明 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="参数类型" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.参数类型 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="操作类型" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.操作类型 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="测试环境默认值" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.测试默认值 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="正式环境默认值" width="150px">
                    <template slot-scope="scope">
                      {{ scope.row.正式默认值 }}
                    </template>
                  </el-table-column>
                  <el-table-column align="center" label="操作" width="100">
                    <template slot-scope="scope">
                      <el-button type="text" icon="el-icon-edit" size="small" @click="editInformation(scope.row)"/>
                      <el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteInterfaceParamsInformation(scope.row)"/>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </template>
          </el-table-column>
          <el-table-column type="index" width="60" label="序号" align="center"/>
          <el-table-column :render-header="renderHeader_interFaceName" align="center" label="接口名称">
            <template slot-scope="scope">
              {{ scope.row.接口名称 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="接口说明" width="140">
            <template slot-scope="scope">
              {{ scope.row.接口说明 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="测试环境地址" width="200">
            <template slot-scope="scope">
              {{ scope.row.测试地址 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="正式环境地址" width="200">
            <template slot-scope="scope">
              {{ scope.row.正式地址 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="当前模式" width="100">
            <template slot-scope="scope">
              <el-tag v-if="scope.row.测试模式 === 1" size="mini" type="warning">测试环境</el-tag>
              <el-tag v-if="scope.row.测试模式 === 2" size="mini" type="success">正式环境</el-tag>
            </template>
          </el-table-column>
          <el-table-column align="center" label="授权账号" width="130">
            <template slot-scope="scope">
              {{ scope.row.授权账号 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="授权密码" width="130">
            <template slot-scope="scope">
              {{ scope.row.授权密码 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="超时时间" width="100">
            <template slot-scope="scope">
              {{ scope.row.超时时间 }}
            </template>
          </el-table-column>
          <el-table-column align="center" label="操作" width="100">
            <template slot-scope="scope">
              <el-button type="text" icon="el-icon-edit" size="small" @click="editInterface(scope.row)"/>
              <el-button type="text" icon="el-icon-delete" size="small" style="color: #ff0000" @click="deleteInterfaceInformation(scope.row)"/>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-card>
    <el-dialog :visible.sync="dialogFormVisible_AddOrEditInterface" :title="title_interface" center style="min-height: 230px;" width="400px">
      <el-form ref="form_AddOrEditInterface" :model="form_AddOrEditInterface" :rules="rules_AddOrEditInterface" label-position="right" label-width="110px">
        <el-form-item label="接口名称" prop="接口名称" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.接口名称" :readonly="title_interface === '修改接口'" :class="title_interface === '修改接口' ? 'myReadOnly-input' : ''" clearable size="small" placeholder="请输入接口名称" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="接口说明" prop="接口说明" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.接口说明" clearable size="small" placeholder="请输入接口说明" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="测试地址" prop="测试地址" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.测试地址" clearable size="small" placeholder="请输入测试地址" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="正式地址" prop="正式地址" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.正式地址" clearable size="small" placeholder="请输入正式地址" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="测试模式" prop="测试模式" style="display: inline-block">
          <el-select v-model="form_AddOrEditInterface.测试模式" size="small" placeholder="请选择测试模式">
            <el-option
              v-for="item in testMode"
              :key="item.value"
              :label="item.label"
              :value="item.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="授权账号" prop="授权账号" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.授权账号" clearable size="small" placeholder="请输入授权账号" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="授权密码" prop="授权密码" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterface.授权密码" show-password size="small" placeholder="请输入授权密码" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="超时时间" prop="超时时间" style="display: inline-block">
          <el-input-number v-model="form_AddOrEditInterface.超时时间" :min="0" :step="1" size="small" style="width: 230px"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="callOff_AddOrEditInterface('form_AddOrEditInterface')">取消</el-button>
        <el-button v-if="title_interface === '添加接口'" type="primary" size="small" @click="submitAdd_Interface('form_AddOrEditInterface')">确定</el-button>
        <el-button v-if="title_interface === '修改接口'" type="primary" size="small" @click="submitEdit_Interface('form_AddOrEditInterface')">确定</el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogFormVisible_AddOrEditInterfaceParams" :title="title_interfaceParams" center style="min-height: 230px;" width="400px">
      <el-form ref="form_AddOrEditInterfaceParams" :model="form_AddOrEditInterfaceParams" :rules="rules_AddOrEditInterfaceParams" label-position="right" label-width="110px">
        <el-form-item label="接口名称" prop="接口名称" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterfaceParams.接口名称" :readonly="true" class="myReadOnly-input" clearable size="small" placeholder="请输入接口名称" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="参数名称" prop="参数名称" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterfaceParams.参数名称" :readonly="title_interfaceParams === '修改参数'" :class="title_interfaceParams === '修改参数' ? 'myReadOnly-input' : ''" clearable size="small" placeholder="请输入参数名称" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="参数说明" prop="参数说明" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterfaceParams.参数说明" clearable size="small" placeholder="请输入参数说明" style="width: 230px"/>
        </el-form-item>
        <el-form-item label="参数类型" prop="参数类型" style="display: inline-block">
          <el-select v-model="form_AddOrEditInterfaceParams.参数类型" size="small" placeholder="请选择参数类型">
            <el-option
              v-for="item in paramsType"
              :key="item.value"
              :label="item.label"
              :value="item.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="操作类型" prop="操作类型" style="display: inline-block">
          <el-select v-model="form_AddOrEditInterfaceParams.操作类型" size="small" placeholder="请选择操作类型">
            <el-option
              v-for="item in paramsOperationType"
              :key="item.value"
              :label="item.label"
              :value="item.value"/>
          </el-select>
        </el-form-item>
        <el-form-item v-if="form_AddOrEditInterfaceParams.操作类型 === '可配置'" label="测试默认值" prop="测试默认值" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterfaceParams.测试默认值" clearable size="small" placeholder="请输入测试环境默认值" style="width: 230px"/>
        </el-form-item>
        <el-form-item v-if="form_AddOrEditInterfaceParams.操作类型 === '可配置'" label="正式默认值" prop="正式默认值" style="display: inline-block">
          <el-input v-model="form_AddOrEditInterfaceParams.正式默认值" clearable size="small" placeholder="请输入正式环境默认值" style="width: 230px"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button size="small" @click="callOff_AddOrEditInterfaceParams('form_AddOrEditInterfaceParams')">取消</el-button>
        <el-button v-if="title_interfaceParams === '添加参数'" type="primary" size="small" @click="submitAdd_InterfaceParams('form_AddOrEditInterfaceParams')">确定</el-button>
        <el-button v-if="title_interfaceParams === '修改参数'" type="primary" size="small" @click="submitEdit_InterfaceParams('form_AddOrEditInterfaceParams')">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      paramsType: [
        {
          value: 'string',
          label: 'string'
        },
        {
          value: '枚举',
          label: '枚举'
        },
        {
          value: 'array',
          label: 'array'
        }
      ],
      paramsOperationType: [
        {
          value: '可配置',
          label: '可配置'
        },
        {
          value: '输入',
          label: '输入'
        }
      ],
      testMode: [
        {
          value: 1,
          label: '测试环境'
        },
        {
          value: 2,
          label: '正式环境'
        }
      ],
      title_interface: '添加接口',
      title_interfaceParams: '添加参数',
      dialogFormVisible_AddOrEditInterface: false,
      dialogFormVisible_AddOrEditInterfaceParams: false,
      form_AddOrEditInterface: {
        接口名称: '',
        接口说明: '',
        测试地址: '',
        正式地址: '',
        测试模式: 1,
        授权账号: '',
        授权密码: '',
        超时时间: 50000
      },
      rules_AddOrEditInterface: {
        接口名称: [{ required: true, message: '请输入接口名称', trigger: 'blur' }],
        接口说明: [{ required: true, message: '请输入接口说明', trigger: 'blur' }],
        测试地址: [{ required: true, message: '请输入测试环境地址', trigger: 'blur' }],
        正式地址: [{ required: true, message: '请输入正式环境地址', trigger: 'blur' }],
        测试模式: [{ required: true, message: '请选择当前模式', trigger: 'change' }],
        授权账号: [{ required: true, message: '请输入授权账号', trigger: 'blur' }],
        授权密码: [{ required: true, message: '请输入授权密码', trigger: 'blur' }],
        超时时间: [{ required: true, message: '请输入超时时间', trigger: 'blur' }]
      },
      form_AddOrEditInterfaceParams: {
        接口名称: '',
        参数名称: '',
        参数说明: '',
        参数类型: '',
        操作类型: '',
        测试默认值: '',
        正式默认值: ''
      },
      rules_AddOrEditInterfaceParams: {
        接口名称: [{ required: true, message: '请选择接口名称', trigger: 'change' }],
        参数名称: [{ required: true, message: '请输入参数名称', trigger: 'blur' }],
        参数说明: [{ required: true, message: '请输入参数说明', trigger: 'blur' }],
        参数类型: [{ required: true, message: '请选择参数类型', trigger: 'change' }],
        操作类型: [{ required: true, message: '请选择操作类型', trigger: 'change' }]
      },
      loading: false,
      tableData: [],
      tableDataParams: [],
      expandsDetail: [],
      expandedRows: null
    }
  },
  created() {
    this.getTableData()
  },
  methods: {
    renderHeader_interFaceName(h) {
      return (
        <div>
          <span>接口名称</span>
          <el-button
            type='text'
            style='padding:3px;margin-left:5px'
            size='mini'
            icon='el-icon-circle-plus'
            onClick={() => this.addInterface()}
          ></el-button></div>
      )
    },
    renderHeader_interFaceParamsName(h) {
      return (
        <div>
          <span>参数名称</span>
          <el-button
            type='text'
            style='padding:3px;margin-left:5px'
            size='mini'
            icon='el-icon-circle-plus'
            onClick={() => this.addInterfaceParams()}
          ></el-button></div>
      )
    },
    getTableData() {
      this.tableData = []
      this.loading = true
      var param = []
      var Data = this.CreateData('11', 'MOM_基础数据_接口列表_查询', param)
      this.ExecDatabase(Data).then(response => {
        if (response.data.length !== 0) {
          this.tableData = response.data
        }
        this.loading = false
      }).catch(error => {
        this.loading = false
        this.$message.error('数据加载失败，请稍后重试！')
        console.error('Error fetching interface data:', error)
      })
    },
    // 获取展开列的工单号
    getRowKeys(row) {
      return row.接口名称
    },
    // 控制展开列
    selectParams(row, expandedRows) {
      if (expandedRows.length) {
        this.expandedRows = row
        this.expandsDetail = []
        if (row) {
          this.tableDataParams = []
          var param = []
          param[0] = ['接口名称', row.接口名称]
          var Data = this.CreateData('11', 'MOM_基础数据_接口参数_获取基本参数', param)
          this.ExecDatabase(Data).then(response => {
            if (response.data.length !== 0) {
              this.tableDataParams = response.data
            }
            this.expandsDetail.push(row.接口名称)
          })
        }
      } else {
        this.expandsDetail = []
      }
    },
    // **************************************************************
    addInterface() {
      this.title_interface = '添加接口'
      this.form_AddOrEditInterface.接口名称 = ''
      this.form_AddOrEditInterface.接口说明 = ''
      this.form_AddOrEditInterface.测试地址 = ''
      this.form_AddOrEditInterface.正式地址 = ''
      this.form_AddOrEditInterface.测试模式 = 1
      this.form_AddOrEditInterface.授权账号 = ''
      this.form_AddOrEditInterface.授权密码 = ''
      this.form_AddOrEditInterface.超时时间 = 5000
      this.dialogFormVisible_AddOrEditInterface = true
    },
    submitAdd_Interface(form) {
      this.$refs[form].validate(valid => {
        if (valid) {
          var param = []
          param[0] = ['接口名称', this.form_AddOrEditInterface.接口名称]
          param[1] = ['接口说明', this.form_AddOrEditInterface.接口说明]
          param[2] = ['测试地址', this.form_AddOrEditInterface.测试地址]
          param[3] = ['正式地址', this.form_AddOrEditInterface.正式地址]
          param[4] = ['测试模式', this.form_AddOrEditInterface.测试模式]
          param[5] = ['授权账号', this.form_AddOrEditInterface.授权账号]
          param[6] = ['授权密码', this.form_AddOrEditInterface.授权密码]
          param[7] = ['超时时间', this.form_AddOrEditInterface.超时时间]
          var Data = this.CreateData('12', 'MOM_基础数据_接口列表_新增', param)
          this.ExecDatabase(Data).then(response => {
            if (response.data[0].result === '1') {
              this.$message({
                message: '添加成功',
                type: 'success'
              })
              this.getTableData()
              this.$refs['form_AddOrEditInterface'].resetFields()
            } else {
              this.$message.error('添加失败！')
            }
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    submitEdit_Interface(form) {
      this.$refs[form].validate(valid => {
        if (valid) {
          var param = []
          param[0] = ['接口名称', this.form_AddOrEditInterface.接口名称]
          param[1] = ['接口说明', this.form_AddOrEditInterface.接口说明]
          param[2] = ['测试地址', this.form_AddOrEditInterface.测试地址]
          param[3] = ['正式地址', this.form_AddOrEditInterface.正式地址]
          param[4] = ['测试模式', this.form_AddOrEditInterface.测试模式]
          param[5] = ['授权账号', this.form_AddOrEditInterface.授权账号]
          param[6] = ['授权密码', this.form_AddOrEditInterface.授权密码]
          param[7] = ['超时时间', this.form_AddOrEditInterface.超时时间]
          param[7] = ['超时时间', this.form_AddOrEditInterface.超时时间]
          var Data = this.CreateData('12', 'MOM_基础数据_接口列表_编辑', param)
          this.ExecDatabase(Data).then(response => {
            if (response.data[0].result === '1') {
              this.$message({
                message: '修改成功',
                type: 'success'
              })
              this.getTableData()
              this.callOff_AddOrEditInterface('form_AddOrEditInterface')
            } else {
              this.$message.error('修改失败！')
            }
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    editInterface(row) {
      this.title_interface = '修改接口'
      this.form_AddOrEditInterface.接口名称 = row['接口名称']
      this.form_AddOrEditInterface.接口说明 = row['接口说明']
      this.form_AddOrEditInterface.测试地址 = row['测试地址']
      this.form_AddOrEditInterface.正式地址 = row['正式地址']
      this.form_AddOrEditInterface.测试模式 = row['测试模式']
      this.form_AddOrEditInterface.授权账号 = row['授权账号']
      this.form_AddOrEditInterface.授权密码 = row['授权密码']
      this.form_AddOrEditInterface.超时时间 = row['超时时间']
      this.dialogFormVisible_AddOrEditInterface = true
    },
    callOff_AddOrEditInterface(form) {
      this.dialogFormVisible_AddOrEditInterface = false
      this.$refs[form].resetFields()
    },
    deleteInterfaceInformation(row) {
      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var param = []
        param[0] = ['接口名称', row['接口名称']]
        var Data = this.CreateData('12', 'MOM_基础数据_接口列表_删除', param)
        this.ExecDatabase(Data).then(response => {
          if (response.data[0].result === '1') {
            this.$message({
              message: '删除成功',
              type: 'success'
            })
            this.getTableData()
          } else {
            this.$message.error('删除失败！')
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    // **************************************************************
    addInterfaceParams() {
      console.log(this.expandedRows)
      this.title_interfaceParams = '添加参数'
      this.form_AddOrEditInterfaceParams.接口名称 = this.expandedRows['接口名称']
      this.form_AddOrEditInterfaceParams.参数名称 = ''
      this.form_AddOrEditInterfaceParams.参数说明 = ''
      this.form_AddOrEditInterfaceParams.参数类型 = ''
      this.form_AddOrEditInterfaceParams.操作类型 = ''
      this.form_AddOrEditInterfaceParams.测试默认值 = ''
      this.form_AddOrEditInterfaceParams.正式默认值 = ''
      this.dialogFormVisible_AddOrEditInterfaceParams = true
    },
    submitAdd_InterfaceParams(form) {
      this.$refs[form].validate(valid => {
        if (valid) {
          var param = []
          param[0] = ['接口名称', this.form_AddOrEditInterfaceParams.接口名称]
          param[1] = ['参数名称', this.form_AddOrEditInterfaceParams.参数名称]
          param[2] = ['参数说明', this.form_AddOrEditInterfaceParams.参数说明]
          param[3] = ['参数类型', this.form_AddOrEditInterfaceParams.参数类型]
          param[4] = ['操作类型', this.form_AddOrEditInterfaceParams.操作类型]
          param[5] = ['测试默认值', this.form_AddOrEditInterfaceParams.测试默认值]
          param[6] = ['正式默认值', this.form_AddOrEditInterfaceParams.正式默认值]
          var Data = this.CreateData('12', 'MOM_基础数据_接口参数_新增', param)
          this.ExecDatabase(Data).then(response => {
            if (response.data[0].result === '1') {
              this.$message({
                message: '添加成功',
                type: 'success'
              })
              this.selectParams(this.expandedRows, [this.expandedRows])
              this.$refs['form_AddOrEditInterfaceParams'].resetFields()
            } else {
              this.$message.error('添加失败！')
            }
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    submitEdit_InterfaceParams(form) {
      this.$refs[form].validate(valid => {
        if (valid) {
          var param = []
          param[0] = ['接口名称', this.form_AddOrEditInterfaceParams.接口名称]
          param[1] = ['参数名称', this.form_AddOrEditInterfaceParams.参数名称]
          param[2] = ['参数说明', this.form_AddOrEditInterfaceParams.参数说明]
          param[3] = ['参数类型', this.form_AddOrEditInterfaceParams.参数类型]
          param[4] = ['操作类型', this.form_AddOrEditInterfaceParams.操作类型]
          param[5] = ['测试默认值', this.form_AddOrEditInterfaceParams.测试默认值]
          param[6] = ['正式默认值', this.form_AddOrEditInterfaceParams.正式默认值]
          var Data = this.CreateData('12', 'MOM_基础数据_接口参数_编辑', param)
          this.ExecDatabase(Data).then(response => {
            if (response.data[0].result === '1') {
              this.$message({
                message: '修改成功',
                type: 'success'
              })
              this.selectParams(this.expandedRows, [this.expandedRows])
              this.callOff_AddOrEditInterfaceParams('form_AddOrEditInterfaceParams')
            } else {
              this.$message.error('修改失败！')
            }
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    editInformation(row) {
      this.title_interfaceParams = '修改参数'
      this.form_AddOrEditInterfaceParams.接口名称 = row['接口名称']
      this.form_AddOrEditInterfaceParams.参数名称 = row['参数名称']
      this.form_AddOrEditInterfaceParams.参数说明 = row['参数说明']
      this.form_AddOrEditInterfaceParams.参数类型 = row['参数类型']
      this.form_AddOrEditInterfaceParams.操作类型 = row['操作类型']
      this.form_AddOrEditInterfaceParams.测试默认值 = row['测试默认值']
      this.form_AddOrEditInterfaceParams.正式默认值 = row['正式默认值']
      this.dialogFormVisible_AddOrEditInterfaceParams = true
    },
    callOff_AddOrEditInterfaceParams(form) {
      this.dialogFormVisible_AddOrEditInterfaceParams = false
      this.$refs[form].resetFields()
    },
    deleteInterfaceParamsInformation(row) {
      this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        var param = []
        param[0] = ['接口名称', row['接口名称']]
        param[1] = ['参数名称', row['参数名称']]
        var Data = this.CreateData('12', 'MOM_基础数据_接口参数_删除', param)
        this.ExecDatabase(Data).then(response => {
          if (response.data[0].result === '1') {
            this.$message({
              message: '删除成功',
              type: 'success'
            })
            this.selectParams(row, [row])
          } else {
            this.$message.error('删除失败！')
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    }
  }
}
</script>

<style>

</style>
