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

<script>
export default {
  name: '',
  data() {
    return {
      dialogVisible:false
    };
  },
  props:['data'],
  computed:{
  },
  watch:{
  },
  methods: {
    async remove () {
      let param = {
        "classname": "webmanage.saletool.sharematerial.sharematerial",
        "method": "delete",
        "content": {
          "sat_sharematerialid": [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>
