deleteGroup.vue 2.42 KB
Newer Older
wengjianling's avatar
wengjianling committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
<template>
  <div class="ct">
    <el-dialog
      title="删除子部门"
      :visible.sync="deleteDialog"
      width="30%"
      :show-close="false"
      :close-on-click-modal="false"
    >
      <div v-if="nowNode.children.length > 0 ? true : false">删除"{{nowNode.label}}"请先删除其下所有子部门</div>
      <div v-else>部门"{{nowNode.label}}"删除后,该部门下的用户会被分配至“未分组列表”,是否删除?</div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleDeleteCancel" size="small">取 消</el-button>
        <el-button v-if="nowNode.children.length > 0 ? false : true" type="primary" @click="handleDeleteFinish" size="small"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <div></div>
  </div>
</template>

<script>
import { deleteGroup } from "@/api/in/mail";
import { log } from "util";

export default {
  props: {
    deleteDialog: {
      type: Boolean,
      default: true
    },
    nowNode: {
      type: Object,
35
      default: () =>({})
wengjianling's avatar
wengjianling committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
    }
  },
  data() {
    return {

    };
  },
  created() {
    console.log(this.nowNode)
  },
  methods: {
    handleDeleteCancel() {
      this.$emit('handleDeleteCancel')
    },
    handleDeleteFinish() {
      deleteGroup({id: this.nowNode.id}).then(res => {
        console.log(res)
      })
      this.$emit('handleDeleteFinish')
    }
  }
};
</script>

<style scoped>
.tree >>> .is-leaf + .el-checkbox .el-checkbox__inner {
  display: inline-block;
}
.tree >>> .el-checkbox .el-checkbox__inner {
  display: none;
}

.choose {
  padding: 16px;
  font-size: 16px;
  font-weight: bold;
  color: rgba(56, 56, 56, 1);
  box-sizing: border-box;
}
.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* border-bottom: 1px solid #f8f8f8; */
  padding-bottom: 10px;
}
.transfer-footer {
  margin-left: 20px;
  padding: 6px 5px;
}
.ct >>> .el-dialog__header {
  border-bottom: 1px solid #f8f8f8;
}
.ct >>> .el-dialog__body {
  padding: 20px 40px;
}
.ct >>> .el-transfer-panel {
  width: 250px;
}
.circle {
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(208, 2, 27, 1);
  position: relative;
}
.circle >>> .icon {
  width: 28px;
  height: 28px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.br {
  border-top: 1px solid #f8f8f8;
  border-bottom: 1px solid #f8f8f8;
  padding: 24px 0;
}
</style>