<template>
  <div>
    <!-- <i style="font-weight:bold" class="el-icon-delete" @click="() => append()"></i> -->
    <el-button size="small" icon="el-icon-delete" @click="() => append()">删 除</el-button>
  </div>
</template>

<script>
export default {
  props:['data'],
  data () {
    return {
    }
  },
  methods:{
    append () {
      this.$confirm('是否删除当前部门?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await this.$api.requested({
          "classname": "webmanage.department.department",
          "method": "delete_department",
          "content": {
            "departmentid":this.data.departmentid
          }
        })
        this.tool.showMessage(res,()=>{
          this.$emit('onSuccess')
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });          
      });
    }
  }
}

</script>
<style>
</style>
<style scoped>
.item_width-full{
  width:100%
}
.dialog-footer{
  margin-top:32px;
  text-align: center;
}
</style>