<template>
  <div style="display:inline;margin:0 16px">
    <el-popconfirm title="确定删除当前数据吗？" @confirm="deleteRow()">
      <el-button slot="reference" size="small" type="text">删 除</el-button>
    </el-popconfirm>
  </div>
</template>

<script>
export default {
  props: ['type','id'],
  methods: {
    async deleteRow() {
      let res = await this.$api.requested({
          "id": this.type == 'unit' ? '20220922084903' : '20220922084603',
          "version":1,
          "content": {
            [this.type == 'unit' ? 'unitid' : 'unitgroupid']:this.id
          }
      })

      console.log(res);
      this.tool.showMessage(res,() => {
        this.$emit('deleteSuccess')
      })
    },
  }
}

</script>
