<template>
  <div style="display:inline">
    <el-button slot="reference" size="small" type="text" :disabled="disabled" @click="open">删 除</el-button>
  </div>
</template>

<script>
export default {
  props: ['data','disabled'],
  methods: {

    open() {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => this.deleteRow())
    },

    deleteRow() {
      this.$api.requested({
        "id": 20221102143602,
        "content": {
          "sat_sharematerialids": [this.data.sat_sharematerialid]
        }
      }).then(res => {
        this.tool.showMessage(res)
        res.code === 1 ? this.$emit('onSuccess') : ''
      })
    },
  }
}

</script>
