|
@@ -1,9 +1,19 @@
|
|
|
<template>
|
|
|
<div class="staff-tree">
|
|
|
<div v-if="list && list.length > 0">
|
|
|
- <div class="staff">
|
|
|
+ <div class="staff" v-for="(item, index) in list" :key="'user' + index">
|
|
|
<i class="el-icon-s-custom user-box"></i>
|
|
|
- <!-- <span class="staff-name">{{ item.name }}</span> -->
|
|
|
+ <span class="staff-name">{{ item.nickname }}</span>
|
|
|
+ <span class="btn-list" @click="(e) => e.stopPropagation()">
|
|
|
+ <el-button
|
|
|
+ v-if="powers.some((item) => item == '005')"
|
|
|
+ :type="item.position === '1' ? 'primary' : 'info'"
|
|
|
+ size="mini"
|
|
|
+ @click="setUpEdit($event, item.id, item.position)"
|
|
|
+ >
|
|
|
+ 设为负责人
|
|
|
+ </el-button></span
|
|
|
+ >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -11,14 +21,13 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
name: "staffTree",
|
|
|
- components: {
|
|
|
- },
|
|
|
+ components: {},
|
|
|
props: ["list", "level"],
|
|
|
computed: {
|
|
|
powers() {
|
|
|
let tran =
|
|
|
this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "staff"
|
|
|
+ (item) => item.menu_route == "organize"
|
|
|
) || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
@@ -31,39 +40,11 @@ export default {
|
|
|
return {
|
|
|
newlist: "",
|
|
|
index: 0, // icon 箭头
|
|
|
- iconFont: [
|
|
|
- {
|
|
|
- down: "el-icon-arrow-up",
|
|
|
- up: "el-icon-arrow-down",
|
|
|
- },
|
|
|
- {
|
|
|
- down: "el-icon-folder-remove",
|
|
|
- up: "el-icon-folder-add",
|
|
|
- },
|
|
|
- {
|
|
|
- down: "el-icon-minus",
|
|
|
- up: "el-icon-plus",
|
|
|
- },
|
|
|
- {
|
|
|
- down: "iconfont icon-jiantouxia",
|
|
|
- up: "iconfont icon-up",
|
|
|
- },
|
|
|
- ],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- addEdit(id, pid, level, isDetail, isAdd, formData) {
|
|
|
- this.$emit("addEdit", id, pid, level, isDetail, isAdd, formData);
|
|
|
- },
|
|
|
- openChildren(id, pid, level, isOpen) {
|
|
|
- if (level === 3) return false;
|
|
|
- this.$emit("openChildren", id, pid, level, isOpen);
|
|
|
- },
|
|
|
- remove(id, pid, level, status) {
|
|
|
- this.$emit("remove", id, pid, level, status);
|
|
|
- },
|
|
|
- del(id, pid, level, status) {
|
|
|
- this.$emit("del", id, pid, level, status);
|
|
|
+ setUpEdit(e, id, position) {
|
|
|
+ this.$emit("setUpEdit", id, position);
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -91,50 +72,37 @@ export default {
|
|
|
.staff-tree-node:nth-of-type(even) {
|
|
|
background: rgba(249, 168, 110, 0.1);
|
|
|
}
|
|
|
- .staff-tree-node {
|
|
|
- display: block;
|
|
|
- margin: 5px 0 5px 5px;
|
|
|
- padding-left: 5px;
|
|
|
- line-height: 35px;
|
|
|
- i {
|
|
|
- font-size: 22px;
|
|
|
- width: 22px;
|
|
|
- margin: auto;
|
|
|
- }
|
|
|
- .label {
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
+
|
|
|
+ .staff {
|
|
|
+ // padding:0 0 0 5px;
|
|
|
+ // background: #eee;
|
|
|
.btn-list {
|
|
|
display: block;
|
|
|
float: right;
|
|
|
}
|
|
|
- .staff {
|
|
|
- // padding:0 0 0 5px;
|
|
|
- // background: #eee;
|
|
|
- .user-box {
|
|
|
- display: inline-block;
|
|
|
- vertical-align: top;
|
|
|
- width: 25px;
|
|
|
- height: 25px;
|
|
|
- line-height: 25px;
|
|
|
- font-size: 15px;
|
|
|
- text-align: center;
|
|
|
- border-radius: 50%;
|
|
|
- overflow: hidden;
|
|
|
- background: #63cbe7;
|
|
|
- color: #fff;
|
|
|
- margin: 6px 5px 0 3px;
|
|
|
- small {
|
|
|
- font-size: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
- .staff-name {
|
|
|
- display: inline-block;
|
|
|
- height: 38px;
|
|
|
- line-height: 38px;
|
|
|
- vertical-align: top;
|
|
|
+ .user-box {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: top;
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ line-height: 25px;
|
|
|
+ font-size: 15px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ overflow: hidden;
|
|
|
+ background: #63cbe7;
|
|
|
+ color: #fff;
|
|
|
+ margin: 6px 5px 0 3px;
|
|
|
+ small {
|
|
|
+ font-size: 8px;
|
|
|
}
|
|
|
}
|
|
|
+ .staff-name {
|
|
|
+ display: inline-block;
|
|
|
+ height: 38px;
|
|
|
+ line-height: 38px;
|
|
|
+ vertical-align: top;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|