|
|
@ -20,25 +20,27 @@ |
|
|
|
<div class="d-flex flex-row justify-space-between align-center" slot="title"> |
|
|
|
<div> |
|
|
|
{{ itemA.pname }} |
|
|
|
<a-tag color="blue" class="ml-2" v-for="tag in itemA.roleList" :key="tag.rid"> |
|
|
|
<a-tag color="blue" class="ml-2" v-for="tag in itemA.roleList" :key="tag.rid" @click="changeRole(itemA.pid)"> |
|
|
|
{{ tag.rname }} |
|
|
|
</a-tag> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<a-icon |
|
|
|
<!-- <a-icon |
|
|
|
class="mr-2" |
|
|
|
:style="{ fontSize: '20px' }" |
|
|
|
v-if="isSelect === item.did + itemA.pid" |
|
|
|
type="plus" |
|
|
|
@click="showAddMember(itemA.did)" |
|
|
|
></a-icon> |
|
|
|
<a-icon |
|
|
|
class="mr-2" |
|
|
|
:style="{ fontSize: '20px' }" |
|
|
|
v-if="isSelect === item.did + itemA.pid" |
|
|
|
type="more" |
|
|
|
@click="showEditMember(itemA)" |
|
|
|
/> |
|
|
|
></a-icon> --> |
|
|
|
<a-popover v-model="itemA.show" placement="topRight" trigger="click"> |
|
|
|
<a-icon class="mr-2" :style="{ fontSize: '20px' }" v-if="isSelect === item.did + itemA.pid" type="more" /> |
|
|
|
<template slot="content"> |
|
|
|
<div class="d-flex align-center"> |
|
|
|
<a-button type="primary" class="mr-2" @click="editPositionModal(itemA)"> 修改 </a-button> |
|
|
|
<a-button type="danger" @click="delPositionInfo(itemA)"> 删除 </a-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</a-popover> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-tree-node> |
|
|
@ -57,7 +59,17 @@ |
|
|
|
type="plus" |
|
|
|
@click="showAddItem(item.did)" |
|
|
|
></a-icon> |
|
|
|
<a-icon class="mr-2" :style="{ fontSize: '20px' }" v-if="isSelect === item.did" type="more" @click="showEditItem(item)" /> |
|
|
|
<!-- <a-icon class="mr-2" :style="{ fontSize: '20px' }" v-if="isSelect === item.did" type="m |
|
|
|
ore" @click="showEditItem(item)" /> --> |
|
|
|
<a-popover v-model="item.departmentIsShow" placement="topRight" trigger="click"> |
|
|
|
<a-icon class="mr-2" :style="{ fontSize: '20px' }" v-if="isSelect === item.did" type="more" /> |
|
|
|
<template slot="content"> |
|
|
|
<div class="d-flex align-center"> |
|
|
|
<a-button type="primary" class="mr-2" @click="editDepartmentModal(item)"> 修改 </a-button> |
|
|
|
<a-button type="danger" @click="delpartment(item)"> 删除 </a-button> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</a-popover> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<TreeNode |
|
|
@ -68,6 +80,9 @@ |
|
|
|
@showEditItem="showEditItem" |
|
|
|
@showAddMember="showAddMember" |
|
|
|
@showEditMember="showEditMember" |
|
|
|
@changeRole="changeRole" |
|
|
|
@editPositionModal="editPositionModal" |
|
|
|
@editDepartmentModal="editDepartmentModal" |
|
|
|
/> |
|
|
|
</a-tree-node> |
|
|
|
</a-tree> |
|
|
@ -87,6 +102,7 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
visible: false, |
|
|
|
isSelect: '', |
|
|
|
expandedKeys: [], |
|
|
|
autoExpandParent: true, |
|
|
@ -115,6 +131,27 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 显示修改部门信息 |
|
|
|
editDepartmentModal(item) { |
|
|
|
console.log('item: ', item); |
|
|
|
this.$emit('editDepartmentModal', item); |
|
|
|
}, |
|
|
|
// 显示修改职位信息 |
|
|
|
editPositionModal(item) { |
|
|
|
this.$emit('editPositionModal', item); |
|
|
|
}, |
|
|
|
// 删除部门 |
|
|
|
delpartment(item) { |
|
|
|
console.log('item: ', item); |
|
|
|
}, |
|
|
|
// 删除职位信息 |
|
|
|
delPositionInfo(item) { |
|
|
|
console.log('item: ', item); |
|
|
|
}, |
|
|
|
// 显示修改关联角色 |
|
|
|
changeRole(id) { |
|
|
|
this.$emit('changeRole', id); |
|
|
|
}, |
|
|
|
onSelect(selectedKeys, info) { |
|
|
|
console.log('selected', selectedKeys, info); |
|
|
|
this.isSelect = selectedKeys[0]; |
|
|
@ -129,7 +166,8 @@ export default { |
|
|
|
this.$emit('showAddMember', id); |
|
|
|
}, |
|
|
|
showEditMember(item) { |
|
|
|
this.$emit('showEditMember', item); |
|
|
|
this.visible = true; |
|
|
|
// this.$emit('showEditMember', item); |
|
|
|
}, |
|
|
|
onExpand(expandedKeys) { |
|
|
|
this.expandedKeys = expandedKeys; |
|
|
|