123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572 |
- <!--信息中心-->
- <template>
- <div class="visual-con">
- <!--头部-->
- <vheader></vheader>
- <!--主体-->
- <div class="visual-body">
- <!-- 左侧 -->
- <div class="leftbar w-14" :class="indentleft" ref="left">
- <div class="forthis">
- <dv-border-box-13 backgroundColor="rgba(19, 13, 5, 0.9)" :color="['#d5811d', '#ebd033']" style="padding-bottom: 1rem;">
- <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
- <div class="i-list-con h-78">
- <div class="d-l-con-icon">
- <div class="icon-con" :class="{on:iconCurrentIndex==item.resourceTable}"
- v-for="(item,index) in resourcesList"
- v-on:click="indentleftSetMarkers(item.key)">
- <div class="iconfont icon icon-normal" :class="item.icon"></div>
- <div class="icon-text">
- <h6 v-if=" item.count.length > 10">{{ item.count.substring(0,10) }}<br>{{item.count.substring(10)}}</h6>
- <h6 v-else>{{ item.count}}</h6>
- <h5>{{ item.name }}</h5>
- </div>
- </div>
- </div>
- </div>
- </dv-border-box-13>
- </div>
- </div>
- <!-- 地图 -->
- <supermap ref="supermap" style="width: 100%;height: 100vh;" :mapDiv="'forestMap'" class="indexSupermapClass"
- :mapSite="{doubleClickZoom:false}" :codes="['9fa5']" :isSideBySide="false" @showPointDetails="showPointDetails"></supermap>
- <!-- <button @click="showEventInfo1" style="position: absolute; right: 50%;top: 45%;z-index: 1000;">弹层事件演示用按钮-->
- <!-- </button>-->
- <!-- 右侧 -->
- <div class="rightbar" :class="indentright" ref="right">
- <div class="forthis">
- <dv-border-box-13 backgroundColor="rgba(19, 13, 5, 0.9)" :color="['#d5811d', '#ebd033']" style="padding-bottom: 1rem;">
- <img src="../assets/images/integrated/light.png" style="width: 100%; margin-top: .4rem;"/>
- <div class="this-title">
- <span>数据分布</span>
- <dv-decoration-3 style="width:150px;height:15px;margin-right: 1rem;" :color="['#935713', '#ebd033']"/>
- </div>
- <div class="i-list-con h-73">
- <div class="overflow-y" style="height: 39vh">
- <div class="d-l-con" :class="{on:listCurrentIndex==item.deptId}"
- v-for="(item,index) in deptGroupList"
- v-on:click="indentleftByDeptIdSetMarkers(item.deptId)">
- <div class="d-l-l-text">
- <i class="i-small"></i>
- <h4>{{ item.deptName }}</h4>
- </div>
- <div class="d-l-l-count">{{ item.count }}</div>
- <!--<div class="d-l-l-count">{{ item.eventCount }}</div>-->
- </div>
- </div>
- <div class="overflow-y" style="height: 34vh;">
- <div id="data-chart" style="width: 100%;height:34vh;"></div>
- </div>
- </div>
- </dv-border-box-13>
- </div>
- </div>
- <vBottomMenu ref="bottomMenu"></vBottomMenu>
- <!--<el-tooltip :content="indentText" placement="top" :disabled="indentdisabled">-->
- <!--<div class="mascot" ref="mascot" :class="indentStyle" @click="indent"><img-->
- <!--src="@/assets/images/mascot.png"/>-->
- <!--</div>-->
- <!--</el-tooltip>-->
- </div>
- <pointDetails ref="pointDetails"></pointDetails>
- <eventLocation ref="eventLocation"></eventLocation>
- <TVWall ref="TVWall"></TVWall>
- </div>
- </template>
- <script>
- import {
- getResource,
- SumLandInfo,
- getFindAllType,
- getFindAllZhanList
- } from '@/api/datacenter'
- import supermap from '@/components/supermap' //超图
- import vheader from '@/components/v-header.vue' //一体化共用头部
- import vBottomMenu from '@/components/vBottomMenu.vue' //一体化公共底部菜单
- import eventLocation from '@/components/eventLocation.vue' //事件定位弹窗
- import TVWall from '@/components/TVWall.vue' //电视墙弹窗
- import pointDetails from './pointDetails.vue' //点位详情页面
- // import echarts from 'echarts'
- let echarts = require('echarts')
- export default {
- components: {
- supermap,
- vheader,
- vBottomMenu,
- eventLocation,
- TVWall,
- pointDetails
- },
- created() {
- /** ----------------------------------底部按钮公用组件开始------------------------------------- */
- window.showDialog = this.showDialog
- window.choseLayerSwitching = this.choseLayerSwitching
- window.choseLayerSwitchingList = this.choseLayerSwitchingList
- /** ----------------------------------底部按钮公用组件结束------------------------------------- */
- },
- mounted() {
- this.getResource();
- this.bottomMenuList() //获取底部公共组件消息和任务
- },
- data() {
- return {
- iconCurrentIndex: '',
- listCurrentIndex: '',
- markersList: [],
- iframeBoo: true,
- open: false,
- iframeVue: null,
- activeName: 'info',
- radio: '1',
- //类型
- resourceTable: '',
- //左侧资源
- resourcesList: [],
- // resourcesMap: {},
- //右侧资源
- deptGroupList: [],
- supermapDianList: [],//点击左侧数据表获取到的点位数据
- source: [],
- //左右缩进
- indentStyle: '',
- indentleft: '',
- indentright: '',
- indentText: '收起左右栏',
- indentdisabled: false,
- }
- },
- methods: {
- /** ----------------------------------底部按钮公用组件开始------------------------------------- */
- bottomMenuList() {
- this.$refs.bottomMenu.selectTaskList()//获取任务列表
- this.$refs.bottomMenu.selectMessageList()//获取消息列表
- },
- showDialog(click) {
- if (click == 'eventLocation') {
- this.$refs.eventLocation.showEventLocation()
- this.$refs.supermap.isEditableLayers = false
- this.$refs.bottomMenu.showChild = false
- this.$refs.bottomMenu.showBanChild = false
- this.$refs.bottomMenu.showChangChild = false
- } else if (click == 'editableLayers') {
- this.$refs.bottomMenu.showChild = false
- this.$refs.bottomMenu.showBanChild = false
- this.$refs.bottomMenu.showChangChild = false
- if (!this.$refs.supermap.isEditableLayers) {
- this.$refs.supermap.isEditableLayers = true
- } else {
- this.$refs.supermap.isEditableLayers = false
- }
- } else if (click == 'layerSwitching') {
- this.$refs.supermap.isEditableLayers = false
- this.$refs.bottomMenu.showBanChild = false
- this.$refs.bottomMenu.showChangChild = false
- if (!this.$refs.bottomMenu.showChild) {
- this.$refs.bottomMenu.showChild = true
- } else {
- this.$refs.bottomMenu.showChild = false
- }
- } else if (click == 'TVWall') {
- this.$refs.TVWall.showTVWall()
- this.$refs.supermap.isEditableLayers = false
- this.$refs.bottomMenu.showChild = false
- this.$refs.bottomMenu.showBanChild = false
- this.$refs.bottomMenu.showChangChild = false
- } else if (click == 'forestban') {
- this.$refs.supermap.isEditableLayers = false
- this.$refs.bottomMenu.showChild = false
- this.$refs.bottomMenu.showChangChild = false
- if (!this.$refs.bottomMenu.showBanChild) {
- this.$refs.bottomMenu.showBanChild = true
- } else {
- this.$refs.bottomMenu.showBanChild = false
- }
- } else if (click == 'forestchang') {
- this.$refs.supermap.isEditableLayers = false
- this.$refs.bottomMenu.showBanChild = false
- this.$refs.bottomMenu.showChild = false
- if (!this.$refs.bottomMenu.showChangChild) {
- this.$refs.bottomMenu.showChangChild = true
- } else {
- this.$refs.bottomMenu.showChangChild = false
- }
- }
- },
- //选择图层
- choseLayerSwitching(url, isClear) {
- this.$refs.supermap.layerSwitching(url, isClear)
- },
- //选择图层(传递数组)
- choseLayerSwitchingList(urlList) {
- this.$refs.supermap.layerSwitchingList(urlList)
- },
- /** ----------------------------------底部按钮公用组件结束------------------------------------- */
- //数据分布chart
- dataChat() {
- // 基于准备好的dom,初始化echarts实例
- let myChart = echarts.init(document.getElementById('data-chart'))
- // 绘制图表
- const dfColor = ['#92E1FF', '#0097FB', '#30ECA6', '#FFC227', '#FF4848']
- myChart.setOption({
- dataset: {
- source: this.source
- },
- tooltip: {
- trigger: 'item'
- },
- grid: {
- top: '5%',
- left: '2%',
- // right: "4%",
- bottom: '-5%',
- width: '75%',
- containLabel: true
- },
- xAxis: {
- show: false,
- type: 'value'
- },
- yAxis: {
- type: 'category', // 不设置类目轴,抽离的dataset数据展示不出来
- inverse: true,
- axisLabel: {
- show: true,
- textStyle: {
- color: '#5deaff',
- fontSize: '12'
- }
- },
- splitLine: {
- show: false
- },
- axisTick: {
- show: false
- },
- axisLine: {
- show: false
- }
- },
- series: [{
- type: 'bar',
- animationCurve: 'easeOutBack',
- barWidth: 5,
- label: {
- show: true,
- position: 'right',
- offset: [0, 0],
- color: '#88dfd5',
- // fontSize: "12",
- style: {
- fill: '#fff'
- }
- },
- backgroundBar: {
- show: true,
- style: {
- fill: 'rgba(97,152,255,0.20)'
- }
- },
- barStyle: {
- stroke: 'rgba(41,244,236,1)'
- },
- gradient: {
- color: ['rgba(41,244,236,1)', 'rgba(41,244,236,0)']
- },
- itemStyle: {
- label: {
- show: true
- },
- labelLine: {
- show: false
- },
- color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
- offset: 0,
- color: 'rgba(41,244,236,0)'
- },
- {
- offset: 1,
- color: 'rgba(41,244,236,.5)'
- }
- ]),
- borderColor: '#a2f9f7',
- shadowBlur: 16,
- shadowColor: '#a2f9f7'
- }
- }]
- })
- },
- //吉祥物收起左右框
- indent() {
- let list = document.getElementsByClassName('el-tooltip__popper')
- list[list.length - 1].style.display = 'none'
- if (this.indentStyle == '') {
- this.indentStyle = 'indent-style'
- this.indentleft = 'indent-left'
- this.indentright = 'indent-right'
- this.indentText = '展开左右栏'
- } else if (this.indentText == '展开左右栏') {
- this.indentStyle = ''
- this.indentleft = ''
- this.indentright = ''
- this.indentText = '收起左右栏'
- }
- },
- // 弹层方法
- // 弹层方法
- showEventInfo1() {
- this.eventInfoVisible1 = true
- },
- showEventInfo2() {
- this.eventInfoVisible2 = true
- },
- showPointDetails(pointParam){
- //事件信息弹出
- this.$refs.pointDetails.showPointDetails(pointParam);
- },
- getResource() {
- let _this = this
- //获取左侧菜单列表
- getResource().then(res => {
- console.log("获取左侧菜单列表=",res.data)
- let list = res.data;
- for(let i = 0; i < list.length; i++){
- let map = {};
- map.count = list[i].num;
- map.name = list[i].name;
- map.key = list[i].type;
- let type = list[i].type;
- let types = list[i].type.split("_");
- // map.icon = 'sj-icon-' + types[types.length - 1].replace("@", "_");
- map.icon = ('sj-icon-' + types.slice(-2)).replace(",", "").replace("@", "_");
- // map.icon = 'sj-icon-' + list[i].type;
- if(list[i].name == '农业技术推广总站信息'){
- map.name="农业技术推广总站";
- }
- if(list[i].name == '"备案畜禽规模养殖场"'){
- map.name="备案畜禽养殖场";
- }
- if(list[i].name == '"区域性粪污处置中心"'){
- map.name="粪污处置中心";
- }
- if(list[i].name == '肉牛基层翻改站(点)'){
- map.name="肉牛基层翻改站";
- }
- if(list[i].name == '"农机技术推广部门信息"'){
- map.name="农机技术推广部门";
- }
- _this.resourcesList.push(map);
- }
- console.log("_this.resourcesList=",_this.resourcesList)
- })
- },
- // getResource(){
- getResource_废弃() {
- let that = this
- //获取左侧菜单列表
- SumLandInfo().then(res => {
- console.log("获取左侧菜单列表=",res.data)
- const resourcesMap = res.data;
- // const resourcesMap = [];
- // let data = res.data;
- // console.log("data=",data)
- // for(let key in data){
- // if(key == 'getNumByVarieties' ||
- // key == 'getLivestockNumByVarieties' ||
- // key == 'enterpriseStat' ||
- // key == 'getInformation' ||
- // key == 'getSupervise' ||
- // key == 'grainFourSeasons'
- // ){
- // resourcesMap.push({key: data[key]});
- // }
- // }
- for(let key in resourcesMap){
- const map = {};
- map.count=resourcesMap[key];
- if(key == 'buzhu'){map.name="补助次数";}
- if(key == 'gengdi'){map.name="耕地面积";map.count=resourcesMap[key]+"㎡";}
- if(key == 'hezuoshe'){map.name="合作社数量";}//有经纬度
- if(key == 'huafei'){map.name="化肥库存";map.count=resourcesMap[key]+"吨";}
- if(key == 'nongji'){map.name="农机站数量";}//有经纬度
- if(key == 'nongju'){map.name="农具库存";map.count=resourcesMap[key]+"个";}
- if(key == 'xubao'){map.name="畜保站数量";}//有经纬度
- if(key == 'yangzhi'){map.name="养殖及粪污处理点";}//有经纬度
- if(key == 'zhibao'){map.name="植保数量";}//有经纬度
- if(key == 'zhongzhi'){map.name="种植产量";map.count=resourcesMap[key]+"吨";}
- if(key == 'zhongzi'){map.name="种子库存";map.count=resourcesMap[key]+"吨";}
- // 备案畜禽规模养殖场统计 /agricultureBigData/getNumByVarieties
- // 种畜禽养殖场统计 /agricultureBigData/getLivestockNumByVarieties
- // 企业分布统计 /agricultureBigData/enterpriseStat
- // 农药信息统计 /agricultureBigData/getInformation
- // 农资监管统计 /agricultureBigData/getSupervise
- // 粮食四季变化 /agricultureBigData/grainFourSeasons
- if(key == 'getNumByVarieties'){map.name="备案养殖场";map.count=resourcesMap[key]+"";}
- if(key == 'getLivestockNumByVarieties'){map.name="种畜禽养殖场";map.count=resourcesMap[key]+"";}
- if(key == 'enterpriseStat'){map.name="企业数量";map.count=resourcesMap[key]+"";}
- if(key == 'getInformation'){map.name="农药数量";map.count=resourcesMap[key]+"L";}
- if(key == 'getSupervise'){map.name="农资监管数量";map.count=resourcesMap[key]+"";}
- if(key == 'grainFourSeasons'){map.name="粮食数量";map.count=resourcesMap[key]+"吨";}
- map.icon='sj-icon-'+key;
- map.key=key;
- if(key == 'getNumByVarieties' ||
- key == 'getLivestockNumByVarieties' ||
- key == 'enterpriseStat' ||
- key == 'getInformation' ||
- key == 'getSupervise' ||
- key == 'grainFourSeasons'
- ){
- // that.resourcesList.push(map);
- }
- that.resourcesList.push(map);
- }
- })
- },
- indentleftSetMarkers(type) {
- let that = this
- that.resourceTable=type;
- getFindAllType(type).then(res => {
- console.log("点击左侧右侧数据展示及横向柱状图 res.data.lis=",res.data.list)
- that.deptGroupList = res.data.dept;
- that.supermapDianList = res.data.list;
- that.source = [];
- that.markersList = [];
- //点击左侧右侧数据展示及横向柱状图
- if (res.data != null && res.data.dept.length > 0) {
- for (let i = 0; i < res.data.dept.length; i++) {
- let aa = [res.data.dept[i].deptName, res.data.dept[i].count];
- // let aa = [res.data.dept[i].deptName, res.data.dept[i].eventCount];
- that.source.push(aa);
- }
- }
- this.dataChat();
- if (res.data != null && res.data.list.length > 0) {
- if(true){
- // if(type=='hezuoshe'||type=='nongji'||type=='zhibao'||type=='xubao'||type=='yangzhi'){
- for (let i = 0; i < res.data.list.length; i++) {
- let markersMap = {
- lng: res.data.list[i].longitude,
- lat: res.data.list[i].latitude,
- icon: 'marker',
- bindPopupHtml: '' +
- '<div class="map-tip">' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- ' <h4>经纬度:' + res.data.list[i].longitude + ',' + res.data.list[i].latitude + '</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- // ' <h4>地址:' + res.data.list[i].address + '</h4>' +
- ' <h4>名称:' + res.data.list[i].NAME + '</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- // ' <h4>名称:' + res.data.list[i].name +'</h4>' +
- ' <h4>电话:' + res.data.list[i].phone +'</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- '</div>',
- click: 'showPointDetails',
- parameter: {id:res.data.list[i].id,type:type},
- keepBindPopup: false,
- isAggregation: false
- }
- that.markersList.push(markersMap)
- }
- }else{
- that.markersList = [];
- }
- }
- that.$refs.supermap.clearM(false);
- that.$refs.supermap.setMarkers(that.markersList);
- });
- },
- indentleftByDeptIdSetMarkers(deptId) {
- this.listCurrentIndex = deptId
- let that = this;
- let type = that.resourceTable;
- that.markersList = [];
- //点击右侧地图落点
- if(type=='hezuoshe'||type=='nongji'||type=='zhibao'||type=='xubao'||type=='yangzhi'){
- getFindAllZhanList(type,deptId).then(res => {
- if (res.data != null && res.data.length > 0) {
- for (let i = 0; i < res.data.length; i++) {
- let markersMap = {
- lng: res.data[i].longitude,
- lat: res.data[i].latitude,
- icon: 'marker',
- bindPopupHtml: '' +
- '<div class="map-tip">' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- ' <h4>经纬度:' + res.data[i].longitude + ',' + res.data[i].latitude + '</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- ' <h4>地址:' + res.data[i].address + '</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- ' <span>' +
- ' <div class="d-l-con">' +
- ' <div class="d-l-l-text">' +
- ' <h4>名称:' + res.data[i].name +'</h4>' +
- ' </div>' +
- ' </div>' +
- ' </span>' +
- '</div>',
- click: 'showPointDetails',
- parameter: {id:res.data[i].id,type:type},
- keepBindPopup: false,
- isAggregation: false
- }
- that.markersList.push(markersMap)
- }
- }else{
- that.markersList = [];
- }
- that.$refs.supermap.clearM(false)
- that.$refs.supermap.setMarkers(that.markersList)
- })
- }
- that.$refs.supermap.clearM(false)
- }
- }
- }
- </script>
- <style rel="stylesheet/scss" lang="scss" scoped>
- @import '@/assets/styles/base.scss';
- .w-14{
- width:14rem !important;
- }
- </style>
|