<template>
<div class="delete">
  <el-button :disabled="!disabled" type="text" size="mini" @click.stop="dialogVisible = true">删除</el-button>
  <el-dialog append-to-body title="提示" :visible.sync="dialogVisible" width="30%">
    <span>是否永久删除素材?</span>
    <span slot="footer" class="dialog-footer">
      <el-button size="small" @click.stop="dialogVisible = false">取 消</el-button>
      <el-button  size="small" type="primary" @click.stop="remove()">确 定</el-button>
    </span>
  </el-dialog>
</div>
  
</template>

<script>
export default {
  name: '',
  data() {
    return {
      dialogVisible:false
    };
  },
  props:['data','disabled'],
  computed:{
  },
  watch:{
  },
  methods: {
    async remove () {
      let param = {
        "id": 20221102143602,
        "content": {
          "sat_sharematerialids": [this.data.sat_sharematerialid]
        }
      }
      let res = this.$api.requested(param)
      this.tool.showMessage(res,() => {
        this.$emit('removeSuccess')
        this.dialogVisible = false
      })
    },
    handleClose() {
      this.dialogVisible = false
    }
  },
};
</script>

<style scoped>
  /deep/.el-dialog__close {
    display: none;
  }
</style>
