|
@@ -19,15 +19,16 @@
|
|
</div>
|
|
</div>
|
|
<OrganizationEdit ref="organizationEditRefs" @refresh="onRefresh"></OrganizationEdit>
|
|
<OrganizationEdit ref="organizationEditRefs" @refresh="onRefresh"></OrganizationEdit>
|
|
<OrganizationAdd ref="organizationAddRefs" @refresh="onRefresh"></OrganizationAdd>
|
|
<OrganizationAdd ref="organizationAddRefs" @refresh="onRefresh"></OrganizationAdd>
|
|
|
|
+ <OrganizationMerge ref="organizationMergeRefs" @refresh="onRefresh"></OrganizationMerge>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import OrganizationEdit from './organizationEdit.vue'
|
|
import OrganizationEdit from './organizationEdit.vue'
|
|
import OrganizationAdd from './organizationAdd.vue'
|
|
import OrganizationAdd from './organizationAdd.vue'
|
|
-
|
|
|
|
|
|
+import OrganizationMerge from './organizationMerge.vue'
|
|
import {
|
|
import {
|
|
- getOrganizationAndEmployeeTree,
|
|
|
|
|
|
+ getOrganizationAtlasAll,
|
|
// getOrganizationAtlasEmployee,
|
|
// getOrganizationAtlasEmployee,
|
|
// importOrganization,
|
|
// importOrganization,
|
|
exportOrganization,
|
|
exportOrganization,
|
|
@@ -42,13 +43,15 @@ export default {
|
|
name: 'organization-structure',
|
|
name: 'organization-structure',
|
|
components: {
|
|
components: {
|
|
OrganizationEdit,
|
|
OrganizationEdit,
|
|
- OrganizationAdd
|
|
|
|
|
|
+ OrganizationAdd,
|
|
|
|
+ OrganizationMerge
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
contextMenuShow: false,
|
|
contextMenuShow: false,
|
|
menus: [
|
|
menus: [
|
|
{ label: '编辑', prop: 'edit' },
|
|
{ label: '编辑', prop: 'edit' },
|
|
|
|
+ { label: '合并机构', prop: 'merge' },
|
|
{ label: '删除', prop: 'delete' }
|
|
{ label: '删除', prop: 'delete' }
|
|
],
|
|
],
|
|
nodes: null,
|
|
nodes: null,
|
|
@@ -166,7 +169,7 @@ export default {
|
|
async onInit () {
|
|
async onInit () {
|
|
this.graph.showLoading()
|
|
this.graph.showLoading()
|
|
try {
|
|
try {
|
|
- const { data } = await getOrganizationAndEmployeeTree({})
|
|
|
|
|
|
+ const { data } = await getOrganizationAtlasAll({})
|
|
return changeChildToChildren(data)
|
|
return changeChildToChildren(data)
|
|
function changeChildToChildren (obj, currentDepth = 1, maxDepth = 2) {
|
|
function changeChildToChildren (obj, currentDepth = 1, maxDepth = 2) {
|
|
const { child, ..._obj } = obj
|
|
const { child, ..._obj } = obj
|
|
@@ -226,6 +229,12 @@ export default {
|
|
if (prop === 'delete') {
|
|
if (prop === 'delete') {
|
|
this.onDelete(this.nodes)
|
|
this.onDelete(this.nodes)
|
|
}
|
|
}
|
|
|
|
+ if (prop === 'merge') {
|
|
|
|
+ this.onMerge(this.nodes)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onMerge (nodes) {
|
|
|
|
+ this.$refs.organizationMergeRefs.open(nodes)
|
|
},
|
|
},
|
|
async editTag (nodes) {
|
|
async editTag (nodes) {
|
|
this.$refs.organizationEditRefs.open(nodes)
|
|
this.$refs.organizationEditRefs.open(nodes)
|