移风店大屏前端
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.

423 lines
12 KiB

2 years ago
<template>
<div>
1 year ago
<div class="node-wrap" v-if="nodeConfig.orgType == '3'">
2 years ago
<div class="node-wrap-box">
<div class="node-box-after">
<div class="nodeBoxTop">
1 year ago
<nameSplit :item="nodeConfig" areaName="name" peopleName="name" />
2 years ago
</div>
</div>
</div>
</div>
<div class="branch-wrap">
<div class="branch-box-wrap">
<div class="branch-box">
1 year ago
<div
class="col-box"
v-for="(item, index) in nodeConfig.children"
:key="index"
>
2 years ago
<div class="condition-node">
<div class="condition-node-box">
<div class="auto-judge">
1 year ago
<div v-if="item.orgType != '6' && item.orgType != '7'">
1 year ago
<div
:class="[
item.children && item.children.length > 0
? 'wgdzbHover'
: 'wgdzb',
]"
>
<nameSplit
:item="item"
1 year ago
areaName="name"
1 year ago
peopleName="name"
/>
2 years ago
</div>
1 year ago
<div
v-if="item._children"
style="text-align: center; cursor: pointer"
@click="getChildrenData(item, index, nodeConfig.children)"
>
<img
style="width: 16px; height: 16px; margin-left: 50px"
v-if="item.children && item.children.length > 0"
:src="require('@/assets/images/home/sh-red.png')"
alt=""
/>
<img
style="width: 16px; height: 16px; margin-left: 50px"
v-else
:src="require('@/assets/images/home/zk-red.png')"
alt=""
/>
2 years ago
</div>
</div>
1 year ago
<div v-if="item.orgType == '6'">
1 year ago
<div
:class="[
item.children && item.children.length > 0
? 'lydxzHover'
: 'lydxz',
]"
>
<nameSplit
:item="item"
1 year ago
areaName="name"
1 year ago
peopleName="name"
/>
2 years ago
</div>
1 year ago
<div
style="text-align: center; cursor: pointer"
1 year ago
@click="
getChildrenDataPople(item, index, nodeConfig.children)
"
1 year ago
>
<img
style="width: 16px; height: 16px; margin-left: 50px"
1 year ago
v-if="item.id == currentId"
1 year ago
:src="require('@/assets/images/home/sh-red.png')"
alt=""
/>
<img
style="width: 16px; height: 16px; margin-left: 50px"
v-else
:src="require('@/assets/images/home/zk-red.png')"
alt=""
/>
2 years ago
</div>
</div>
1 year ago
<div v-if="item.orgType == '7'">
1 year ago
<div
:class="[
item.categoryWarn === 'red'
? 'dyzxhRed'
: item.categoryWarn === 'yellow'
? 'dyzxhYellow'
: item.categoryWarn === 'green'
? 'dyzxhGreen'
: '',
item.children && item.children.length > 0
? 'dyzxhHover'
: 'dyzxh',
]"
1 year ago
:title="item.name"
1 year ago
>
1 year ago
<div class="dyzxhDian" v-if="index === 0"></div>
1 year ago
<div class="dyzxhDian1" v-else></div>
1 year ago
{{ item.name }}
2 years ago
</div>
1 year ago
<!-- <div
1 year ago
v-if="item._children"
style="text-align: center; cursor: pointer"
1 year ago
@click="getChildrenDataPople(item, index, nodeConfig.children)"
1 year ago
>
<img
style="width: 16px; height: 16px; margin-left: 50px"
v-if="item.children && item.children.length > 0"
:src="require('@/assets/images/home/sh-red.png')"
alt=""
/>
<img
style="width: 16px; height: 16px; margin-left: 50px"
v-else
:src="require('@/assets/images/home/zk-red.png')"
alt=""
/>
1 year ago
</div> -->
2 years ago
</div>
</div>
</div>
</div>
1 year ago
<nodeWrapGrid
v-if="item.children"
:nodeConfig.sync="item"
></nodeWrapGrid>
<template v-if="index != 0">
2 years ago
<div class="top-left-cover-line"></div>
</template>
1 year ago
<template v-if="index != nodeConfig.children.length - 1">
2 years ago
<div class="top-right-cover-line"></div>
</template>
</div>
</div>
</div>
</div>
<!-- <nodeWrapGrid v-if="nodeConfig.childNode" :nodeConfig.sync="nodeConfig.childNode"></nodeWrapGrid> -->
</div>
</template>
<script>
1 year ago
import { partyMemberCenListByOrg } from '@/api/hsyf'
2 years ago
export default {
1 year ago
props: ['nodeConfig'],
data () {
2 years ago
return {
homeTypeArr: [],
1 year ago
currentId: null,
1 year ago
sixLevelArr: [
1 year ago
'province',
'city',
'district',
'street',
'community',
'grid_manager'
]
}
2 years ago
},
1 year ago
mounted () {},
2 years ago
computed: {},
watch: {},
methods: {
1 year ago
getAllName (item) {
return item
2 years ago
},
1 year ago
getItemNameArr (str) {
return str.split(',').slice(0, 2)
2 years ago
},
1 year ago
spliceNameFun (row, num) {
2 years ago
if (row && row.length > num) {
1 year ago
return row.substring(0, num) + '...'
2 years ago
}
1 year ago
return row
2 years ago
},
1 year ago
getOnerSixLevelFlag (item) {
return this.sixLevelArr.includes(item.level)
2 years ago
},
1 year ago
findParentParentId (nodeConfig, pid) {
let parentParentId = ''
2 years ago
if (nodeConfig.id === pid) {
1 year ago
return nodeConfig.pid
2 years ago
} else {
if (nodeConfig.children && nodeConfig.children.length > 0) {
for (let i = 0; i < nodeConfig.children.length; i++) {
1 year ago
parentParentId = this.findParentParentId(
nodeConfig.children[i],
pid
1 year ago
)
2 years ago
if (parentParentId) {
1 year ago
return parentParentId
2 years ago
}
}
}
}
},
1 year ago
getChildrenData (item, idx, arr) {
2 years ago
arr.forEach((element, index) => {
if (index === idx) {
if (element.children) {
1 year ago
element._children = element.children
element.children = null
2 years ago
} else {
1 year ago
element.children = element._children
2 years ago
}
} else {
1 year ago
element.children = null
2 years ago
}
1 year ago
})
2 years ago
},
1 year ago
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 = 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.name ? item.name : '四号楼二单元302'
1 year ago
this.$router.push(
`/organizational/microgrid/${item.id}/${grandPid}/${name}`
1 year ago
)
}
}
}
2 years ago
</script>
<style scoped lang="scss">
@import "~@/assets/css/workflow.scss";
@mixin spanLevel {
font-size: 14px;
color: #fff;
word-break: break-all;
}
@mixin normalLevel {
display: flex;
align-items: center;
justify-content: space-around;
}
@mixin lastLevel {
@include spanLevel;
@include normalLevel;
height: 137px;
width: 30px;
margin-top: -12px;
background-size: 100%;
cursor: pointer;
writing-mode: tb-rl;
text-orientation: upright;
}
.name_more {
span {
&:hover {
font-weight: bold;
cursor: pointer;
}
}
}
.node-box-after {
.nodeBoxTop {
font-size: 14px;
cursor: pointer;
position: relative;
color: #fff;
display: inline-block;
width: 168px;
height: 164px;
padding-top: 10px;
text-align: center;
1 year ago
background: url(~@/assets/images/home/firstLevelRed.png) no-repeat;
background-size: 118px 98px;
background-position: center 46px;
2 years ago
div:nth-child(2) {
cursor: pointer;
}
1 year ago
.node-com {
// padding: 0 12px;
.nodeTitle {
font-family: MF LangQian (Noncommercial);
font-weight: 400;
font-size: 24px !important;
color: #ffffff;
line-height: 22px;
}
}
2 years ago
}
}
.auto-judge {
.wgdzb {
@include spanLevel;
min-width: 120px;
1 year ago
height: 94px;
2 years ago
text-align: center;
padding-top: 9px;
1 year ago
background-image: url(~@/assets/images/home/zbbg-red.png);
2 years ago
background-repeat: no-repeat;
1 year ago
background-position: center 0;
2 years ago
// background-size: 100%;
}
.wgdzbHover {
@include spanLevel;
min-width: 120px;
1 year ago
height: 94px;
2 years ago
text-align: center;
1 year ago
padding-top: 19px;
background-image: url(~@/assets/images/home/zbbg-red.png);
2 years ago
// background-size: 100%;
background-repeat: no-repeat;
1 year ago
background-position: center 0;
2 years ago
}
.lydxz {
@include spanLevel;
// @include normalLevel;
text-align: center;
min-width: 120px;
1 year ago
height: 81px;
1 year ago
margin-bottom: 12px;
padding-top: 42px;
1 year ago
background-image: url(~@/assets/images/home/lydxzTree-red.png);
2 years ago
background-repeat: no-repeat;
1 year ago
background-position: center 28px;
2 years ago
}
.lydxzHover {
@include spanLevel;
// @include normalLevel;
text-align: center;
min-width: 120px;
1 year ago
height: 81px;
1 year ago
margin-bottom: 12px;
padding-top: 42px;
1 year ago
background-image: url(~@/assets/images/home/lydxzTree-red.png);
2 years ago
background-repeat: no-repeat;
1 year ago
background-position: center 28px;
2 years ago
}
.dyzxh {
@include lastLevel;
1 year ago
background-image: url(~@/assets/images/home/dyzxh-red.png);
justify-content: flex-start;
2 years ago
background-repeat: no-repeat;
1 year ago
background-position: center 24px;
height: 180px;
.dyzxhDian {
width: 12px;
height: 12px;
margin-top: 24px;
margin-bottom: 6px;
border-radius: 8px;
background-image: radial-gradient(
circle at center,
rgba(255, 197, 35, 1),
rgba(255, 197, 35, 0.1)
);
}
.dyzxhDian1 {
width: 12px;
height: 12px;
margin-top: 24px;
margin-bottom: 6px;
}
2 years ago
}
.dyzxhHover {
@include lastLevel;
1 year ago
background-image: url(~@/assets/images/home/dyzxh-red.png);
justify-content: flex-start;
2 years ago
background-repeat: no-repeat;
1 year ago
background-position: center;
2 years ago
}
.dyzxhGreen {
@include lastLevel;
background-image: url(~@/assets/images/home/gridGreen.png);
background-repeat: no-repeat;
}
.dyzxhRed {
@include lastLevel;
background-image: url(~@/assets/images/home/gridRed.png);
background-repeat: no-repeat;
}
.dyzxhYellow {
@include lastLevel;
background-image: url(~@/assets/images/home/gridYellow.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>