<template>
  <div class="inline-16">
    <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','detailId'],
  methods: {
    async deleteRow () {
      let res
      if (this.type == 'group') {
        res = await this.$api.requested({
          "id": "20220922164503",
          "version": 1,
          "content": {
            "sa_itemgroupid": this.id
          }
        })
      } else {
        res = await this.$api.requested({
          "id": "20220923105103",
          "version": 1,
          "content": {
            "sa_itemgroupid": this.id,
            "sa_itemgroupmxid": this.detailId
          }
        })
      }
      console.log(res);
      this.tool.showMessage(res, () => {
        this.$emit('deleteSuccess')
      })
    },
  }
}

</script>
