|
|
@ -1,14 +1,10 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="node-wrap" v-if="nodeConfig.laneLevel === 1"> |
|
|
|
<div class="node-wrap" v-if="nodeConfig.orgType == '3'"> |
|
|
|
<div class="node-wrap-box"> |
|
|
|
<div class="node-box-after"> |
|
|
|
<div class="nodeBoxTop"> |
|
|
|
<nameSplit |
|
|
|
:item="nodeConfig" |
|
|
|
areaName="organizationName" |
|
|
|
peopleName="name" |
|
|
|
/> |
|
|
|
<nameSplit :item="nodeConfig" areaName="name" peopleName="name" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -24,7 +20,7 @@ |
|
|
|
<div class="condition-node"> |
|
|
|
<div class="condition-node-box"> |
|
|
|
<div class="auto-judge"> |
|
|
|
<div v-if="getOnerSixLevelFlag(item)"> |
|
|
|
<div v-if="item.orgType != '6' && item.orgType != '7'"> |
|
|
|
<div |
|
|
|
:class="[ |
|
|
|
item.children && item.children.length > 0 |
|
|
@ -34,7 +30,7 @@ |
|
|
|
> |
|
|
|
<nameSplit |
|
|
|
:item="item" |
|
|
|
areaName="organizationName" |
|
|
|
areaName="name" |
|
|
|
peopleName="name" |
|
|
|
/> |
|
|
|
</div> |
|
|
@ -57,7 +53,7 @@ |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="item.level === 'building_chief'"> |
|
|
|
<div v-if="item.orgType == '6'"> |
|
|
|
<div |
|
|
|
:class="[ |
|
|
|
item.children && item.children.length > 0 |
|
|
@ -67,18 +63,19 @@ |
|
|
|
> |
|
|
|
<nameSplit |
|
|
|
:item="item" |
|
|
|
areaName="organizationName" |
|
|
|
areaName="name" |
|
|
|
peopleName="name" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<div |
|
|
|
v-if="item._children" |
|
|
|
style="text-align: center; cursor: pointer" |
|
|
|
@click="getChildrenData(item, index, nodeConfig.children)" |
|
|
|
@click=" |
|
|
|
getChildrenDataPople(item, index, nodeConfig.children) |
|
|
|
" |
|
|
|
> |
|
|
|
<img |
|
|
|
style="width: 16px; height: 16px; margin-left: 50px" |
|
|
|
v-if="item.children && item.children.length > 0" |
|
|
|
v-if="item.id == currentId" |
|
|
|
:src="require('@/assets/images/home/sh-red.png')" |
|
|
|
alt="" |
|
|
|
/> |
|
|
@ -90,8 +87,7 @@ |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="item.level === 'unit_chief'"> |
|
|
|
<!-- @click="gotoPersonnel(item)" --> |
|
|
|
<div v-if="item.orgType == '7'"> |
|
|
|
<div |
|
|
|
:class="[ |
|
|
|
item.categoryWarn === 'red' |
|
|
@ -105,17 +101,16 @@ |
|
|
|
? 'dyzxhHover' |
|
|
|
: 'dyzxh', |
|
|
|
]" |
|
|
|
:title="item.organizationName" |
|
|
|
:title="item.name" |
|
|
|
> |
|
|
|
<!-- {{ spliceNameFun(item.organizationName, 3) }} --> |
|
|
|
<div class="dyzxhDian" v-if="index === 0"></div> |
|
|
|
<div class="dyzxhDian1" v-else></div> |
|
|
|
{{ item.organizationName }} |
|
|
|
{{ item.name }} |
|
|
|
</div> |
|
|
|
<div |
|
|
|
<!-- <div |
|
|
|
v-if="item._children" |
|
|
|
style="text-align: center; cursor: pointer" |
|
|
|
@click="getChildrenData(item, index, nodeConfig.children)" |
|
|
|
@click="getChildrenDataPople(item, index, nodeConfig.children)" |
|
|
|
> |
|
|
|
<img |
|
|
|
style="width: 16px; height: 16px; margin-left: 50px" |
|
|
@ -129,7 +124,7 @@ |
|
|
|
:src="require('@/assets/images/home/zk-red.png')" |
|
|
|
alt="" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -152,57 +147,59 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { partyMemberCenListByOrg } from '@/api/hsyf' |
|
|
|
export default { |
|
|
|
props: ["nodeConfig"], |
|
|
|
props: ['nodeConfig'], |
|
|
|
data () { |
|
|
|
return { |
|
|
|
homeTypeArr: [], |
|
|
|
currentId: null, |
|
|
|
sixLevelArr: [ |
|
|
|
"province", |
|
|
|
"city", |
|
|
|
"district", |
|
|
|
"street", |
|
|
|
"community", |
|
|
|
"grid_manager", |
|
|
|
], |
|
|
|
}; |
|
|
|
'province', |
|
|
|
'city', |
|
|
|
'district', |
|
|
|
'street', |
|
|
|
'community', |
|
|
|
'grid_manager' |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () {}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
methods: { |
|
|
|
getAllName (item) { |
|
|
|
return item; |
|
|
|
return item |
|
|
|
}, |
|
|
|
|
|
|
|
getItemNameArr (str) { |
|
|
|
return str.split(",").slice(0, 2); |
|
|
|
return str.split(',').slice(0, 2) |
|
|
|
}, |
|
|
|
|
|
|
|
spliceNameFun (row, num) { |
|
|
|
if (row && row.length > num) { |
|
|
|
return row.substring(0, num) + "..."; |
|
|
|
return row.substring(0, num) + '...' |
|
|
|
} |
|
|
|
return row; |
|
|
|
return row |
|
|
|
}, |
|
|
|
|
|
|
|
getOnerSixLevelFlag (item) { |
|
|
|
return this.sixLevelArr.includes(item.level); |
|
|
|
return this.sixLevelArr.includes(item.level) |
|
|
|
}, |
|
|
|
|
|
|
|
findParentParentId (nodeConfig, pid) { |
|
|
|
let parentParentId = ""; |
|
|
|
let parentParentId = '' |
|
|
|
if (nodeConfig.id === pid) { |
|
|
|
return nodeConfig.pid; |
|
|
|
return nodeConfig.pid |
|
|
|
} else { |
|
|
|
if (nodeConfig.children && nodeConfig.children.length > 0) { |
|
|
|
for (let i = 0; i < nodeConfig.children.length; i++) { |
|
|
|
parentParentId = this.findParentParentId( |
|
|
|
nodeConfig.children[i], |
|
|
|
pid |
|
|
|
); |
|
|
|
) |
|
|
|
if (parentParentId) { |
|
|
|
return parentParentId; |
|
|
|
return parentParentId |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -212,27 +209,44 @@ export default { |
|
|
|
arr.forEach((element, index) => { |
|
|
|
if (index === idx) { |
|
|
|
if (element.children) { |
|
|
|
element._children = element.children; |
|
|
|
element.children = null; |
|
|
|
element._children = element.children |
|
|
|
element.children = null |
|
|
|
} else { |
|
|
|
element.children = element._children |
|
|
|
} |
|
|
|
} else { |
|
|
|
element.children = element._children; |
|
|
|
element.children = null |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getChildrenDataPople (item, idx, arr) { |
|
|
|
partyMemberCenListByOrg({ orgId: item.id }).then((res) => { |
|
|
|
arr.forEach((element, index) => { |
|
|
|
if (element.children) { |
|
|
|
element._children = element.children |
|
|
|
element.children = null |
|
|
|
this.currentId = null |
|
|
|
} else { |
|
|
|
element.children = null; |
|
|
|
element.children = res.data.map(item => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
orgType: 7 |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
this.currentId = item.id |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
gotoPersonnel (item) { |
|
|
|
const grandPid = this.findParentParentId(this.nodeConfig, item.pid); |
|
|
|
const name = item.organizationName |
|
|
|
? item.organizationName |
|
|
|
: "四号楼二单元302"; |
|
|
|
const grandPid = this.findParentParentId(this.nodeConfig, item.pid) |
|
|
|
const name = item.name ? item.name : '四号楼二单元302' |
|
|
|
this.$router.push( |
|
|
|
`/organizational/microgrid/${item.id}/${grandPid}/${name}` |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
|
|
@import "~@/assets/css/workflow.scss"; |
|
|
@ -325,10 +339,11 @@ export default { |
|
|
|
text-align: center; |
|
|
|
min-width: 120px; |
|
|
|
height: 81px; |
|
|
|
padding-top: 28px; |
|
|
|
margin-bottom: 12px; |
|
|
|
padding-top: 42px; |
|
|
|
background-image: url(~@/assets/images/home/lydxzTree-red.png); |
|
|
|
background-repeat: no-repeat; |
|
|
|
background-position: center; |
|
|
|
background-position: center 28px; |
|
|
|
} |
|
|
|
.lydxzHover { |
|
|
|
@include spanLevel; |
|
|
@ -336,10 +351,11 @@ export default { |
|
|
|
text-align: center; |
|
|
|
min-width: 120px; |
|
|
|
height: 81px; |
|
|
|
padding-top: 28px; |
|
|
|
margin-bottom: 12px; |
|
|
|
padding-top: 42px; |
|
|
|
background-image: url(~@/assets/images/home/lydxzTree-red.png); |
|
|
|
background-repeat: no-repeat; |
|
|
|
background-position: center; |
|
|
|
background-position: center 28px; |
|
|
|
} |
|
|
|
.dyzxh { |
|
|
|
@include lastLevel; |
|
|
|