<template>
  <div class="remove">
    <img src="@/assets/remove_btn.png" alt="" @click.stop="dialogVisible=true" slot="icon">
    <el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
      <span>该角色已授权，是否确认删除?</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="removeTarget()">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'removeRole',
  data () {
    return {
      dialogVisible:false
    };
  },
  props:['roleData'],
  computed: {
  },
  watch: {
  },
  methods: {
    async removeTarget() {
      let res = await this.$api.requested({
        "classname": "sale.role.role",
        "method": "delete_role",
        "content": {
            "roleid":this.roleData.roleid
        }
      })
      this.tool.showMessage(res,() => {
        this.$parent.$parent.$parent.$parent.getRoleData()
        this.dialogVisible = false
      })
    },
    handleClose() {
      this.dialogVisible = false
    }
  },
};
</script>

<style scoped>
</style>
