|
|
@ -18,28 +18,29 @@ |
|
|
|
<div class="auto-judge"> |
|
|
|
<div v-if="getOnerSixLevelFlag(item)"> |
|
|
|
<div :class="[item.children && item.children.length > 0 ? 'wgdzbHover' : 'wgdzb']"> |
|
|
|
<nameSplit :item="item" areaName="organizationName" peopleName="name" pageName="居委组织架构" /> |
|
|
|
<nameSplit :item="item" areaName="organizationName" peopleName="name" /> |
|
|
|
</div> |
|
|
|
<div v-if="item._children" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if="item.children && item.children.length > 0" :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<div v-if="item.childCount>0" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if=" item.zkFlag" :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<img v-else :src="require('@/assets/images/home/zk.png')" alt="" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="item.level === 'building_chief'"> |
|
|
|
<div :class="[item.children && item.children.length > 0 ? 'lydxzHover' : 'lydxz']"> |
|
|
|
<nameSplit :item="item" areaName="organizationName" peopleName="name" pageName="居委组织架构" /> |
|
|
|
<nameSplit :item="item" areaName="organizationName" peopleName="name" /> |
|
|
|
</div> |
|
|
|
<div v-if="item._children" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if="item.children && item.children.length > 0" :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<div v-if="item.childCount>0" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if=" item.zkFlag " :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<img v-else :src="require('@/assets/images/home/zk.png')" alt="" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="item.level === 'unit_chief' || item.level === 'public_welfare_post'"> |
|
|
|
<div @click="gotoPersonnel(item.resiId, '居委组织架构')" :class="[item.children && item.children.length > 0 ? 'dyzxhHover' : 'dyzxh', 'gotoDesc']" :title="item.organizationName"> |
|
|
|
{{ spliceNameFun(item.organizationName, 3) }} |
|
|
|
<div v-if="item.level === 'unit_chief'"> |
|
|
|
<div @click="gotoPersonnel(item)" :class="[item.categoryWarn === 'red' ? 'dyzxhRed' : item.categoryWarn === 'yellow' ? 'dyzxhYellow' : item.categoryWarn === 'green' ? 'dyzxhGreen' : '', item.children && item.children.length > 0 ? 'dyzxhHover' : 'dyzxh']" :title="item.organizationName"> |
|
|
|
<!-- {{ spliceNameFun(item.organizationName, 3) }} --> |
|
|
|
{{ item.organizationName }} |
|
|
|
</div> |
|
|
|
<div v-if="item._children" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if="item.children && item.children.length > 0" :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<div v-if="item.childCount>0" style="text-align: center; cursor: pointer" @click="getChildrenData(item, index, nodeConfig.children)"> |
|
|
|
<img v-if=" item.zkFlag" :src="require('@/assets/images/home/sh.png')" alt="" /> |
|
|
|
<img v-else :src="require('@/assets/images/home/zk.png')" alt="" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -61,6 +62,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
import { requestGet } from "@/js/dai/request"; |
|
|
|
export default { |
|
|
|
props: ["nodeConfig"], |
|
|
|
data() { |
|
|
@ -69,7 +71,9 @@ export default { |
|
|
|
sixLevelArr: ["province", "city", "district", "street", "community", "grid_manager"], |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() {}, |
|
|
|
mounted() { |
|
|
|
|
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
methods: { |
|
|
@ -84,21 +88,54 @@ export default { |
|
|
|
return this.sixLevelArr.includes(item.level); |
|
|
|
}, |
|
|
|
|
|
|
|
getChildrenData(item, idx, arr) { |
|
|
|
arr.forEach((element, index) => { |
|
|
|
async getChildrenData(item, idx, arr) { |
|
|
|
if(item.level != "street"){ |
|
|
|
let url = '/gov/org/organizational/neighborhood/getNeighborhoodCommitteeOrgTreeListByLevel' |
|
|
|
let parm = { |
|
|
|
orgId:item.id, |
|
|
|
level:item.level |
|
|
|
} |
|
|
|
const {data,code,msg} = await requestGet(url,parm) |
|
|
|
if(code === 0){ |
|
|
|
this.$EventBus.$emit('handelClickJWNode',data) |
|
|
|
data.forEach(item=>{ |
|
|
|
item.zkFlag = !item.childCount>0 |
|
|
|
}) |
|
|
|
arr.forEach((element, index) => { |
|
|
|
if (index === idx) { |
|
|
|
if (element.children) { |
|
|
|
console.log('element存在的话',element); |
|
|
|
element.zkFlag = true; |
|
|
|
element.children = null; |
|
|
|
} else { |
|
|
|
element.zkFlag = false; |
|
|
|
console.log('element不存在的话',element); |
|
|
|
element.children = data; |
|
|
|
} |
|
|
|
} else { |
|
|
|
element.children = null; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
arr.forEach((element, index) => { |
|
|
|
if (index === idx) { |
|
|
|
console.log(element.zkFlag); |
|
|
|
if (element.children) { |
|
|
|
element._children = element.children; |
|
|
|
element.zkFlag = true; |
|
|
|
element.children = null; |
|
|
|
} else { |
|
|
|
element.children = element._children; |
|
|
|
} |
|
|
|
} else { |
|
|
|
element.zkFlag = false; |
|
|
|
element.children = null; |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
gotoPersonnel(id, name) { |
|
|
|
if (id) { |
|
|
|
this.$router.push({ path: `/organizational/orgPersonnel/${name}`, query: { user_id: id } }); |
|
|
|