Browse Source

Merge branch 'preview' of http://120.46.222.128:10021/elink-star/epmet-work-pc into bug_mk

feature
mk 2 years ago
parent
commit
a4ca4ddc9e
  1. 71
      src/components/JwTree/nodeWrap.vue
  2. 413
      src/views/dataBoard/organizational/index.vue
  3. 17
      src/views/dataBoard/organizational/jwTree/index.vue

71
src/components/JwTree/nodeWrap.vue

@ -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'|| 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._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,56 @@ 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
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._children = 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 } });

413
src/views/dataBoard/organizational/index.vue

@ -47,419 +47,10 @@ export default {
path: "/organizational/gridTree",
},
],
cardList: [
{
title: "社区党委",
key: "1",
name: "南昌路社区党委 (党委书记:解书记)",
children: [
{
title: "网格党支部",
name: "第一网格党支部(支部书记:王艺发)",
key: "1",
children: [
{
title: "楼院党小组",
name: "第一楼院党小组 (组长:韩文国)",
key: "1",
},
{
title: "楼院党小组",
name: "第二楼院党小组 (组长:褚丽兰)",
key: "2",
},
],
},
{
title: "网格党支部",
name: "第二网格党支部 (支部书记:尤芬紫)",
key: "2",
children: [
{
title: "楼院党小组",
name: "第一楼院党小组 (组长:韩文国)",
key: "1",
},
{
title: "楼院党小组",
name: "第二楼院党小组 (组长:褚丽兰)",
key: "2",
},
],
},
{
title: "网格党支部",
name: "第三网格党支部 (支部书记:凤桥强)",
key: "3",
children: [
{
title: "楼院党小组",
name: "第一楼院党小组 (组长:韩文国)",
key: "1",
},
{
title: "楼院党小组",
name: "第二楼院党小组 (组长:褚丽兰)",
key: "2",
},
{
title: "楼院党小组",
name: "第三楼院党小组 (组长:王丽丽)",
key: "3",
},
],
},
],
},
],
cardList: [],
nowVal: 100,
nodeConfig: {
partyOrgName: "市北区委",
partyOrgLevel: 1,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 1,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 2,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 2,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 3,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 3,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 4,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 4,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 5,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 5,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 6,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 6,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 7,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 7,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 8,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 8,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 9,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 9,
children: [
{
partyOrgName: "市北区委",
partyOrgLevel: 10,
partyOrgPid: "0",
principalName: "栾秀杰",
laneLevel: 10,
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
},
],
// title: "",
// name: "()",
// key: "1",
// children: [
// {
// title: "",
// name: " ",
// type: 2,
// children: [
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// ],
// },
// {
// title: "",
// name: " ",
// type: 3,
// children: [
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// children: [
// {
// title: "",
// type: 5,
// name: "",
// },
// {
// title: "",
// type: 5,
// name: "",
// },
// {
// title: "",
// type: 5,
// name: "",
// },
// {
// title: "",
// type: 5,
// name: "",
// },
// ],
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// ],
// },
// {
// title: "",
// name: " ",
// type: 3,
// children: [
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// {
// title: "",
// type: 3,
// name: " ",
// children: [
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// {
// title: "",
// type: 4,
// name: "",
// },
// ],
// },
// ],
// },
// ],
},
nodeConfig: {},
};
},
computed: {},

17
src/views/dataBoard/organizational/jwTree/index.vue

@ -1,3 +1,4 @@
<!-- 调用树组件 -->
<template>
<div class="wrap">
<!-- v-on:wheel="zoomSize" :style="'transform: scale(' + nowVal / 100 + ');'" -->
@ -10,8 +11,8 @@
<div class="contentList"></div>
</el-col>
<el-col :span="21">
<div class="dingflow-design" :style="{ height: treeHeight + 'px' }" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 21, 64, 0.3)">
<nodeWrapJw :nodeConfig.sync="nodeConfig"></nodeWrapJw>
<div class="dingflow-design overflow-hidden" :style="{ height: treeHeight + 'px' }" v-loading="loading" element-loading-text="加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 21, 64, 0.3)">
<nodeWrapJw :nodeConfig.sync="nodeConfig" ></nodeWrapJw>
</div>
</el-col>
</el-row>
@ -46,6 +47,12 @@ export default {
// if (orgId) {
// this.getTreeData();
// }
this.$EventBus.$on('handelClickJWNode', (val) => {
this.levelArr.push(val[0].level)
const myArray = [...new Set(this.levelArr)];
this.treeHeight = myArray.length * 180 + 220;
this.levelArr = this.getLevelArrNum(myArray);
})
this.getTreeData();
},
methods: {
@ -73,7 +80,6 @@ export default {
}
return arr;
},
//
getDataPLevel(data) {
data.forEach((item) => {
@ -82,7 +88,7 @@ export default {
this.getDataPLevel(item.children);
}
});
const myArray = [...new Set(this.levelArr)];
const myArray = [...new Set(this.levelArr)].filter(item=>item!='village');
this.treeHeight = myArray.length * 180 + 220;
this.levelArr = this.getLevelArrNum(myArray);
},
@ -401,4 +407,7 @@ export default {
}
}
}
.overflow-hidden{
overflow-y: hidden;
}
</style>

Loading…
Cancel
Save