You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
266 lines
8.3 KiB
266 lines
8.3 KiB
<template>
|
|
<div>
|
|
<div class="node-wrap" v-if="nodeConfig.laneLevel === 1">
|
|
<div class="node-wrap-box">
|
|
<div class="node-box-after">
|
|
<div class="nodeBoxTop">
|
|
<nameSplit :item="nodeConfig" areaName="organizationName" peopleName="name" pageName="居委组织架构" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="branch-wrap">
|
|
<div class="branch-box-wrap">
|
|
<div class="branch-box">
|
|
<div class="col-box" v-for="(item, index) in nodeConfig.children" :key="index">
|
|
<div class="condition-node">
|
|
<div class="condition-node-box">
|
|
<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" />
|
|
</div>
|
|
<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" />
|
|
</div>
|
|
<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)" :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.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>
|
|
</div>
|
|
</div>
|
|
<nodeWrapJw v-if="item.children" :nodeConfig.sync="item"></nodeWrapJw>
|
|
<template v-if="index == 0">
|
|
<div class="top-left-cover-line"></div>
|
|
</template>
|
|
<template v-if="index == nodeConfig.children.length - 1">
|
|
<div class="top-right-cover-line"></div>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- <nodeWrapJw v-if="nodeConfig.childNode" :nodeConfig.sync="nodeConfig.childNode"></nodeWrapJw> -->
|
|
</div>
|
|
</template>
|
|
<script>
|
|
import { requestGet } from "@/js/dai/request";
|
|
export default {
|
|
props: ["nodeConfig"],
|
|
data() {
|
|
return {
|
|
homeTypeArr: [],
|
|
sixLevelArr: ["province", "city", "district", "street", "community", "grid_manager"],
|
|
};
|
|
},
|
|
mounted() {
|
|
|
|
},
|
|
computed: {},
|
|
watch: {},
|
|
methods: {
|
|
spliceNameFun(row, num) {
|
|
if (row && row.length > num) {
|
|
return row.substring(0, num) + "...";
|
|
}
|
|
return row;
|
|
},
|
|
|
|
getOnerSixLevelFlag(item) {
|
|
return this.sixLevelArr.includes(item.level);
|
|
},
|
|
|
|
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
|
|
item.children = null
|
|
})
|
|
arr.forEach((element, index) => {
|
|
if (index === idx) {
|
|
if (element.children) {
|
|
console.log(item);
|
|
element.zkFlag = false;
|
|
element.children = null;
|
|
} else {
|
|
element.zkFlag = true;
|
|
element.children = data;
|
|
}
|
|
} else {
|
|
element.children = null;
|
|
element.zkFlag = false;
|
|
}
|
|
});
|
|
}
|
|
}else{
|
|
arr.forEach((element, index) => {
|
|
if (index === idx) {
|
|
if (element.children) {
|
|
element.zkFlag = false;
|
|
element._children = element.children
|
|
element.children = null;
|
|
} else {
|
|
element.zkFlag = true;
|
|
element.children = element._children;
|
|
}
|
|
} else {
|
|
element.children = null;
|
|
element.zkFlag = false;
|
|
}
|
|
});
|
|
}
|
|
|
|
},
|
|
|
|
gotoPersonnel(id, name) {
|
|
if (id) {
|
|
this.$router.push({ path: `/organizational/orgPersonnel/${name}`, query: { user_id: id } });
|
|
} else {
|
|
this.$message({
|
|
message: "无法跳转",
|
|
type: "error",
|
|
});
|
|
}
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped lang="scss">
|
|
@mixin spanLevel {
|
|
font-size: 14px;
|
|
color: #fff;
|
|
word-break: break-all;
|
|
}
|
|
@mixin normalLevel {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
}
|
|
|
|
.name_more {
|
|
span {
|
|
&:hover {
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
.node-box-after {
|
|
.nodeBoxTop {
|
|
font-size: 14px;
|
|
position: relative;
|
|
color: #fff;
|
|
display: inline-block;
|
|
width: 168px;
|
|
height: 164px;
|
|
text-align: center;
|
|
background-image: url(~@/assets/images/home/firstLevel.png);
|
|
background-size: 100%;
|
|
}
|
|
}
|
|
.auto-judge {
|
|
.wgdzb {
|
|
@include spanLevel;
|
|
min-width: 120px;
|
|
height: 126px;
|
|
text-align: center;
|
|
padding-top: 9px;
|
|
background-image: url(~@/assets/images/home/zbbg.png);
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
// background-size: 100%;
|
|
}
|
|
.wgdzbHover {
|
|
@include spanLevel;
|
|
min-width: 120px;
|
|
height: 126px;
|
|
text-align: center;
|
|
padding-top: 9px;
|
|
background-image: url(~@/assets/images/home/zbbgClick.png);
|
|
// background-size: 100%;
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
}
|
|
.lydxz {
|
|
@include spanLevel;
|
|
// @include normalLevel;
|
|
text-align: center;
|
|
min-width: 120px;
|
|
height: 126px;
|
|
padding-top: 25px;
|
|
background-image: url(~@/assets/images/home/lydxzTree.png);
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
}
|
|
.lydxzHover {
|
|
@include spanLevel;
|
|
// @include normalLevel;
|
|
text-align: center;
|
|
min-width: 120px;
|
|
height: 126px;
|
|
padding-top: 25px;
|
|
background-image: url(~@/assets/images/home/lydxzClick.png);
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
}
|
|
.dyzxh {
|
|
@include spanLevel;
|
|
@include normalLevel;
|
|
height: 137px;
|
|
width: 30px;
|
|
writing-mode: tb-rl;
|
|
margin-top: -12px;
|
|
background-image: url(~@/assets/images/home/dyzxhTree.png);
|
|
background-repeat: no-repeat;
|
|
}
|
|
.dyzxhHover {
|
|
@include spanLevel;
|
|
@include normalLevel;
|
|
height: 137px;
|
|
width: 30px;
|
|
writing-mode: tb-rl;
|
|
margin-top: -12px;
|
|
background-image: url(~@/assets/images/home/dyzxhClick.png);
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.lxjt {
|
|
@include spanLevel;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
height: 137px;
|
|
width: 30px;
|
|
writing-mode: tb-rl;
|
|
margin-top: -12px;
|
|
background-image: url(~@/assets/images/home/dyzxhTree.png);
|
|
background-repeat: no-repeat;
|
|
}
|
|
}
|
|
</style>
|
|
|