| | |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | wsSocket: null |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.createSocket(); |
| | | setTimeout(() => { |
| | | this.$store.state.mapLayers.msgList.push({ |
| | | msg: "åå卿
é", |
| | | point: "POINT (112.56978672907 37.8558881392881)" |
| | | }) |
| | | |
| | | }, 10000); |
| | | |
| | | }, |
| | | methods: { |
| | | createSocket() { |
| | |
| | | console.log('WebSocketè¿æ¥æå'); |
| | | }; |
| | | this.wsSocket.onmessage = (event) => { |
| | | // console.log('Received message:', event.data); |
| | | |
| | | if (event.data != "è¿æ¥æå") { |
| | | const obj = JSON.parse(event.data) |
| | | |
| | | |
| | | this.leftChartData = { |
| | | type: 'left1', |
| | | val: obj |
| | | } |
| | | |
| | | } |
| | | }; |
| | | } |
| | |
| | | XB: 'ç®±å', |
| | | HW: 'ç¯ç½æ', |
| | | DLZJJT: 'çµç¼ä¸é´æ¥å¤´', |
| | | ZB: 'ZB', |
| | | ZB: 'ç¾å¼ç®±å', |
| | | KG: 'å¼å
³', |
| | | ZSQ: 'æ
éæç¤ºå¨', |
| | | PDS: 'PDS', |
| | |
| | | <div class="msgBox" @click.stop="setShowMenuClick(true)"> |
| | | |
| | | <i style="font-size: 20px;" class="el-icon-chat-line-round"></i> |
| | | <el-badge v-show="$store.state.mapLayers.msgList.length > 0" :value="$store.state.mapLayers.msgList.length" class="item"> |
| | | <el-badge v-show="$store.state.mapLayers.msgList.length > 0" :value="$store.state.mapLayers.msgList.length" |
| | | class="item"> |
| | | </el-badge> |
| | | <el-dialog title="æ
éä¿¡æ¯" :visible.sync="dialogVisible" width="30%" :show-close="false"> |
| | | <el-table :data="$store.state.mapLayers.msgList" style="width: 100%"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | |
| | | import olMap from '@/components/mapOl/index.vue'; |
| | | |
| | | export default { |
| | |
| | | type: 'point', |
| | | isShow: false, |
| | | } |
| | | |
| | | this.parentData = JSON.stringify([obj]) |
| | | this.innerVisible = true |
| | | }, |
| | |
| | | this.wsSocket.onopen = (event) => { |
| | | console.log('WebSocketè¿æ¥æå'); |
| | | }; |
| | | this.wsSocket.onclose = () => { |
| | | console.log('WebSocketè¿æ¥å
³é'); |
| | | this.wsSocket = null |
| | | }; |
| | | this.wsSocket.onmessage = (event) => { |
| | | |
| | | if (event.data != "è¿æ¥æå") { |
| | | const obj = JSON.parse(event.data); |
| | | if (obj.mes) { |
| | | this.setShowMsg(obj) |
| | | if (obj.type == "error") { |
| | | if (this.$store.state.mapLayers.msgList.length == 0) { |
| | | this.$store.state.mapLayers.msgList.push(obj) |
| | | } else { |
| | | |
| | | var rs = this.$store.state.mapLayers.msgList; |
| | | var st = rs.filter(item => { |
| | | if (item.msg == obj.msg && item.point == obj.point && item.line == obj.line) { |
| | | return item |
| | | } |
| | | }) |
| | | if (st.length <= 0) { |
| | | this.$store.state.mapLayers.msgList.push(obj) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | // å¤çæ¥æ¶å°çæ¶æ¯ |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | // if (!this.wsSocket) { |
| | | // this.createSocket(); |
| | | // } |
| | | if (!this.wsSocket) { |
| | | this.createSocket(); |
| | | } |
| | | |
| | | }, |
| | | beforeDestroy() { |
| | | if (this.wsSocket) { |
| | | this.wsSocket.close(); |
| | | |
| | | } |
| | | |
| | | }, |
| | | } |
| | |
| | | initOlMap() { |
| | | const baseLayer = mapData.baseLayer; |
| | | const vecUrl = baseLayer.sUrl + baseLayer.vecLayer + baseLayer.lUrl |
| | | const geo= config.geoServer; |
| | | const geo = config.geoServer; |
| | | var vectorLayer = new TileLayer({ |
| | | source: new XYZ({ |
| | | url: vecUrl + config.tdToken, |
| | |
| | | }), |
| | | }); |
| | | |
| | | console.log(geo.url + geo.wms) |
| | | |
| | | var layer2 = new Image({ |
| | | name: "Wms_Layer", |
| | | source: new ImageWMS({ |
| | |
| | | if (this.parentData) { |
| | | if (this.parentData.indexOf('type') > -1) { |
| | | const data = JSON.parse(this.parentData)[0]; |
| | | |
| | | console.log(data); |
| | | |
| | | this.isShow = data.isShow |
| | | if (data.type == 'point') { |
| | | const obj = mapConfig.getWKTParse(data.val.point) |
| | | |
| | | const obj = data.val.point.split(" "); |
| | | console.log(obj); |
| | | this.formInline = { |
| | | lon: obj.coordinates[0], |
| | | lat: obj.coordinates[1], |
| | | lon: obj[0], |
| | | lat: obj[1], |
| | | } |
| | | this.addPointData(obj); |
| | | } else if (data.type == 'line') { |
| | |
| | | this.mapol.addLayer(vectorLayer); |
| | | this.mapol.getView().fit(extent, { |
| | | size: this.mapol.getSize(), |
| | | padding: [100, 100,200,100], // å个æ¹åçè¾¹è·ï¼å¯é |
| | | padding: [100, 100, 200, 100], // å个æ¹åçè¾¹è·ï¼å¯é |
| | | constrainResolution: false, // æ¯å¦éå¶å辨çï¼å¯é |
| | | }); |
| | | }, |
| | | addPointData(res) { |
| | | const coord = res.coordinates; |
| | | const coord = res; |
| | | |
| | | const urlImg = config.sdkImg + 'Workers/image/mark.png'; |
| | | var geom = transform( |
| | |
| | | layerTree: [], |
| | | defaultLayer: [], |
| | | mapInfo: [], |
| | | msgList:[ ] |
| | | |
| | | msgList: [], |
| | | disasterSnow: { |
| | | title:"éª", |
| | | val:[] |
| | | }, |
| | | disasterRain: { |
| | | title:"é¨", |
| | | val:[] |
| | | }, |
| | | disasterFire: { |
| | | title:"ç«", |
| | | val:[] |
| | | }, |
| | | }; |
| | | |
| | | const mutations = { |
| | |
| | | }, |
| | | CHANGE_MAPINFO: (state, res) => { |
| | | state.mapInfo = res; |
| | | busEvent.$emit('CHANGE_MAPINFO', state.mapInfo); |
| | | |
| | | busEvent.$emit('CHANGE_MAPINFO', state.mapInfo); |
| | | }, |
| | | }; |
| | | |
| | |
| | | address: '广åºåçµç«', |
| | | type: 'rain', |
| | | data: [ |
| | | 23.97957226, 23.67522328, 23.64627646, 23.98678133, 23.7049411, 23.90907715, 23.97135417, 23.93937771, 24.7313574, 23.78658559, 23.86060646, 23.93976822, 23.77442911, 23.70706984, 23.97513076, |
| | | 24.00566013, 23.68618352, 23.62046202, 23.94578353, 23.667424, 23.89900528, 23.84667184, 23.79052521, 23.54961054, |
| | | 23.97957226, 3.67522328, 23.64627646, 23.98678133, 23.7049411, 23.90907715, 23.97135417, 23.93937771, 24.7313574, 23.78658559, 23.86060646, 23.93976822, 23.77442911, 23.70706984, 23.97513076, |
| | | 10.00566013, 23.68618352, 23.62046202, 23.94578353, 23.667424, 23.89900528, 23.84667184, 23.79052521, 23.54961054, |
| | | ], |
| | | source: 'å±±è¥¿çæ°è±¡å±', |
| | | time: '2024 -09 - 26 10:06: 40', |
| | |
| | | <i class="el-icon-chat-dot-square"></i> |
| | | </el-badge> |
| | | </div> |
| | | <div class="msgList" v-show="!showMsgFlag" > |
| | | <div class="msgList" v-show="!showMsgFlag"> |
| | | <msg-list @childData="receiveDataFromChild"></msg-list> |
| | | </div> |
| | | </div> |
| | |
| | | import statistics from '@/views/visual/statistics/index.vue' |
| | | import semanticFunction from '@/views/dataManager/semanticFunction/index.vue' |
| | | import msgList from './msgList.vue'; |
| | | import { point } from '@turf/turf'; |
| | | export default { |
| | | components: { |
| | | mapView, leftMenu, |
| | |
| | | wsSocket: null, |
| | | rightChartData: {}, |
| | | leftChartData: {}, |
| | | showMsgFlag: true |
| | | showMsgFlag: true |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | | if (this.wsSocket) { |
| | | this.wsSocket.close(); |
| | | this.wsSocket.onclose = () => { |
| | | console.log('WebSocketè¿æ¥å
³é'); |
| | | this.wsSocket = null |
| | |
| | | }, |
| | | mounted() { |
| | | if (!this.wsSocket) { |
| | | // this.createSocket(); |
| | | this.createSocket(); |
| | | } |
| | | }, |
| | | methods: { |
| | | receiveDataFromChild(data) { |
| | | console.log(data); |
| | | |
| | | |
| | | this.showMsgFlag = true |
| | | }, |
| | | ShowMenuList() { |
| | |
| | | |
| | | if (event.data != "è¿æ¥æå") { |
| | | const obj = JSON.parse(event.data) |
| | | if (obj.type == "rain") { |
| | | this.$store.state.mapLayers.disasterRain.val = [obj] |
| | | } else if (obj.type == "snow") { |
| | | this.$store.state.mapLayers.disasterSnow.val = [obj] |
| | | } else if (obj.type == "fire") { |
| | | this.$store.state.mapLayers.disasterFire.val = [obj] |
| | | } else if (obj.type == "error") { |
| | | this.$store.state.mapLayers.msgList |
| | | if (this.$store.state.mapLayers.msgList.length == 0) { |
| | | this.$store.state.mapLayers.msgList.push(obj) |
| | | } else { |
| | | var rs = this.$store.state.mapLayers.msgList; |
| | | var st = rs.filter(item => { |
| | | if (item.msg == obj.msg && item.point == obj.point && item.line == obj.line) { |
| | | return item |
| | | } |
| | | }) |
| | | if (st.length <= 0) { |
| | | this.$store.state.mapLayers.msgList.push(obj) |
| | | } |
| | | |
| | | |
| | | this.leftChartData = { |
| | | type: 'left1', |
| | | val: obj |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }; |
| | | }, |
| | |
| | | <template> |
| | | <div class="leftMnu"> |
| | | <div class="menuBox"> |
| | | <chart-vue :childData="childData"></chart-vue> |
| | | <chart-vue></chart-vue> |
| | | </div> |
| | | <div class="menuBox"> |
| | | <chart-vue :childData="childData1"></chart-vue> |
| | | <chart-vue1></chart-vue1> |
| | | </div> |
| | | <div class="menuBox"> |
| | | <chart-vue :childData="childData2"></chart-vue> |
| | | <chart-vue2></chart-vue2> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import chartVue from './list/chart.vue'; |
| | | import chartVue1 from './list/chart1.vue'; |
| | | import chartVue2 from './list/chart2.vue'; |
| | | import data from './data.js'; |
| | | export default { |
| | | components: { |
| | | chartVue |
| | | chartVue, chartVue1, chartVue2 |
| | | }, |
| | | props: { |
| | | leftChartData: { |
| | | type: Object, |
| | | required: true |
| | | }, |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | |
| | | mounted() { |
| | | window.regionWeather = null; |
| | | this.initEchart(); |
| | | |
| | | }, |
| | | methods: { |
| | | initEchart() { |
| | | this.initEchart1(); |
| | | this.initEchart2(); |
| | | this.initEchart3(); |
| | | }, |
| | | initEchart1() { |
| | | var chart1 = data[3]; |
| | | chart1.id = "myChart01"; |
| | | this.childData = chart1 |
| | | }, |
| | | initEchart2() { |
| | | var chart2 = data[4]; |
| | | chart2.id = "myChart02"; |
| | | this.childData1 = chart2 |
| | | }, initEchart3() { |
| | | var chart3 = data[5]; |
| | | chart3.id = "myChart03"; |
| | | this.childData2 = chart3 |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | |
| | | .menuBox { |
| | | width: 100%; |
| | | height: 33%; |
| | |
| | | .aside-title { |
| | | box-sizing: border-box; |
| | | padding-left: 30px; |
| | | |
| | | font-size: 15px; |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular; |
| | | color: #fff; |
| | |
| | | .chartBox { |
| | | width: calc(100% - 10px); |
| | | height: calc(100% - 10px); |
| | | |
| | | position: absolute; |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <div class="chartListBox" :childData="childData"> |
| | | <div class="aside-title">{{ childData.title }}</div> |
| | | <div class="echartBox"> |
| | | <div class="aside-title"> é¨</div> |
| | | <div class="echartBox" v-show="roadItem.address"> |
| | | <table class="chartTable"> |
| | | <tr> |
| | | <th></th> |
| | |
| | | </tr> |
| | | </table> |
| | | <div class="chartEchart"> |
| | | <div :id="chartId" class="myChart"> </div> |
| | | <div class="myChart"> |
| | | <div id="chartRain" class="myChartID"></div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | childData(newValue, oldValue) { |
| | | if (newValue) { |
| | | this.chartId = newValue.id; |
| | | this.title = newValue.title; |
| | | setTimeout(() => { |
| | | this.setEchartChange(newValue.val[0]) |
| | | |
| | | }, 200); |
| | | } |
| | | } |
| | | "$store.state.mapLayers.disasterRain": { |
| | | handler(newVal, oldVal) { |
| | | if (newVal.val) { |
| | | this.setEchartChange(newVal); |
| | | } |
| | | }, |
| | | deep: true |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | created() { |
| | | window.addEventListener('POIDetailDataChange', this.handlePOIDetailDataChange) |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | methods: { |
| | | setCannelItem() { |
| | | this.flagData = null; |
| | |
| | | window.dispatchEvent(event); |
| | | mapWeather.setRegionWeatherType(res); |
| | | }, |
| | | showEchart() { |
| | | |
| | | setEchartChange(res) { |
| | | this.roadItem = res |
| | | if (!this.roadItem) return |
| | | if (!this.roadItem.data) return; |
| | | const data = this.roadItem.data; |
| | | const id = document.getElementById(this.chartId) |
| | | var div = document.getElementsByClassName("chartEchart")[0]; |
| | | if (div.offsetWidth == 0 || div.offsetHeight == 0) return |
| | | document.getElementById("chartRain").style.width = div.offsetWidth + "px" |
| | | document.getElementById("chartRain").style.height = div.offsetHeight + "px" |
| | | var data = this.roadItem.data; |
| | | |
| | | |
| | | const id = document.getElementById("chartRain") |
| | | var std = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var h = i + 1 |
| | |
| | | |
| | | |
| | | option && myChart.setOption(option); |
| | | }, |
| | | setEchartChange(res) { |
| | | |
| | | |
| | | this.roadItem = res.val[0] |
| | | this.showEchart(); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | // justify-content: space-around; |
| | | .chartEchart { |
| | | flex: 1; |
| | | |
| | | } |
| | | |
| | | .myChart { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | |
| | | |
| | | .myChartID { |
| | | position: absolute; |
| | | |
| | | } |
| | | } |
| | | |
| | | .chartTd { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chartListBox" :childData="childData"> |
| | | <div class="aside-title"> éª</div> |
| | | <div class="echartBox" v-show="roadItem.address"> |
| | | <table class="chartTable"> |
| | | <tr> |
| | | <th></th> |
| | | <th> |
| | | 线路 |
| | | </th> |
| | | <th> |
| | | ç±»å |
| | | </th> |
| | | |
| | | <th> |
| | | æä½ |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td class="chartTd" colspan="4"> |
| | | <div class=" elDriver"> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>{{ roadItem.address }}</td> |
| | | <td>{{ roadItem.line }}</td> |
| | | <td style="color:#f56c6c">{{ roadItem.level }}</td> |
| | | <td style="color:#409eff"> |
| | | <el-button v-show="flagData != roadItem.address" class="elButton" type="primary" plain |
| | | size="mini" @click="setChangeItem()">详æ
</el-button> |
| | | <el-button v-show="flagData == roadItem.address" class="elButton" type="danger" plain |
| | | size="mini" @click="setCannelItem()">éç½®</el-button> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <div class="chartEchart"> |
| | | <div class="myChart"> |
| | | <div id="chartSnow" class="myChartID"></div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import mapWeather from './mapWeather'; |
| | | |
| | | export default { |
| | | props: { |
| | | childData: { |
| | | type: Object, |
| | | default: null |
| | | } |
| | | }, |
| | | watch: { |
| | | "$store.state.mapLayers.disasterSnow": { |
| | | handler(newVal, oldVal) { |
| | | if (newVal.val) { |
| | | this.setEchartChange(newVal); |
| | | } |
| | | }, |
| | | deep: true |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | chartId: "", |
| | | title: "", |
| | | flagData: null, |
| | | roadItem: {}, |
| | | } |
| | | }, |
| | | created() { |
| | | window.addEventListener('POIDetailDataChange', this.handlePOIDetailDataChange) |
| | | }, |
| | | mounted() { |
| | | |
| | | |
| | | // this.showEchart(); |
| | | }, |
| | | methods: { |
| | | setCannelItem() { |
| | | this.flagData = null; |
| | | mapWeather.closeRegionWeather() |
| | | }, |
| | | handlePOIDetailDataChange() { |
| | | if (this.flagData == window.regionWeather) return |
| | | this.flagData = window.regionWeather; |
| | | }, |
| | | setChangeItem() { |
| | | var res = this.roadItem; |
| | | window.regionWeather = res.address; |
| | | var event = new Event('POIDetailDataChange'); |
| | | window.dispatchEvent(event); |
| | | mapWeather.setRegionWeatherType(res); |
| | | }, |
| | | showEchart() { |
| | | |
| | | if (!this.roadItem.data) return; |
| | | var div = document.getElementsByClassName("chartEchart")[0]; |
| | | if (div.offsetWidth == 0 || div.offsetHeight == 0) return |
| | | document.getElementById("chartSnow").style.width = div.offsetWidth + "px" |
| | | document.getElementById("chartSnow").style.height = div.offsetHeight + "px" |
| | | var data = this.roadItem.data; |
| | | |
| | | |
| | | const id = document.getElementById("chartSnow") |
| | | var std = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var h = i + 1 |
| | | var t = h > 10 ? h : "0" + h; |
| | | std.push(t + ":00:00") |
| | | } |
| | | const myChart = echarts.init(id); |
| | | var option = { |
| | | title: { |
| | | text: "", |
| | | textStyle: { |
| | | color: "white" |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: std, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: 'WHITE' // 设置åä½é¢è²ä¸ºçº¢è² |
| | | } |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: 'WHITE' // 设置åä½é¢è²ä¸ºçº¢è² |
| | | } |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data, |
| | | type: 'line', |
| | | smooth: true, |
| | | // itemStyle: { |
| | | // normal: { |
| | | |
| | | // lineStyle: { |
| | | // color: ""// 线çé¢è² |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | option && myChart.setOption(option); |
| | | }, |
| | | setEchartChange(res) { |
| | | this.roadItem = res.val[0] |
| | | this.showEchart(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chartListBox { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .aside-title { |
| | | box-sizing: border-box; |
| | | padding-left: 30px; |
| | | font-size: 15px; |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular; |
| | | color: #fff; |
| | | width: 100%; |
| | | height: 45px; |
| | | line-height: 45px; |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | } |
| | | |
| | | .echartBox { |
| | | flex: 1; |
| | | padding: 5px; |
| | | position: relative; |
| | | color: white; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | // justify-content: space-around; |
| | | .chartEchart { |
| | | flex: 1; |
| | | } |
| | | |
| | | .myChart { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | |
| | | |
| | | .myChartID { |
| | | position: absolute; |
| | | |
| | | } |
| | | } |
| | | |
| | | .chartTd { |
| | | width: 100%; |
| | | padding: 0px !important; |
| | | } |
| | | |
| | | .elDriver { |
| | | width: 100%; |
| | | height: 2px; |
| | | background: #409EFF; |
| | | margin: 10px 0px; |
| | | |
| | | } |
| | | |
| | | .chartTable { |
| | | width: 100%; |
| | | |
| | | td { |
| | | text-align: center; |
| | | |
| | | .elButton { |
| | | padding: 5px 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="chartListBox" :childData="childData"> |
| | | <div class="aside-title"> ç«</div> |
| | | <div class="echartBox" v-show="roadItem.address"> |
| | | <table class="chartTable"> |
| | | <tr> |
| | | <th></th> |
| | | <th> |
| | | 线路 |
| | | </th> |
| | | <th> |
| | | ç±»å |
| | | </th> |
| | | |
| | | <th> |
| | | æä½ |
| | | </th> |
| | | </tr> |
| | | <tr> |
| | | <td class="chartTd" colspan="4"> |
| | | <div class=" elDriver"> |
| | | </div> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td>{{ roadItem.address }}</td> |
| | | <td>{{ roadItem.line }}</td> |
| | | <td style="color:#f56c6c">{{ roadItem.level }}</td> |
| | | <td style="color:#409eff"> |
| | | <el-button v-show="flagData != roadItem.address" class="elButton" type="primary" plain |
| | | size="mini" @click="setChangeItem()">详æ
</el-button> |
| | | <el-button v-show="flagData == roadItem.address" class="elButton" type="danger" plain |
| | | size="mini" @click="setCannelItem()">éç½®</el-button> |
| | | </td> |
| | | </tr> |
| | | </table> |
| | | <div class="chartEchart"> |
| | | <div class="myChart"> |
| | | <div id="chartFire" class="myChartID"></div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import mapWeather from './mapWeather'; |
| | | |
| | | export default { |
| | | props: { |
| | | childData: { |
| | | type: Object, |
| | | default: null |
| | | } |
| | | }, |
| | | watch: { |
| | | "$store.state.mapLayers.disasterFire": { |
| | | handler(newVal, oldVal) { |
| | | if (newVal.val) { |
| | | this.setEchartChange(newVal); |
| | | } |
| | | }, |
| | | deep: true |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | chartId: "", |
| | | title: "", |
| | | flagData: null, |
| | | roadItem: {}, |
| | | } |
| | | }, |
| | | created() { |
| | | window.addEventListener('POIDetailDataChange', this.handlePOIDetailDataChange) |
| | | }, |
| | | mounted() { |
| | | |
| | | |
| | | this.showEchart(); |
| | | }, |
| | | methods: { |
| | | setCannelItem() { |
| | | this.flagData = null; |
| | | mapWeather.closeRegionWeather() |
| | | }, |
| | | handlePOIDetailDataChange() { |
| | | if (this.flagData == window.regionWeather) return |
| | | this.flagData = window.regionWeather; |
| | | }, |
| | | setChangeItem() { |
| | | var res = this.roadItem; |
| | | window.regionWeather = res.address; |
| | | var event = new Event('POIDetailDataChange'); |
| | | window.dispatchEvent(event); |
| | | mapWeather.setRegionWeatherType(res); |
| | | }, |
| | | showEchart() { |
| | | |
| | | if (!this.roadItem.data) return; |
| | | var div = document.getElementsByClassName("chartEchart")[0]; |
| | | if (div.offsetWidth == 0 || div.offsetHeight == 0) return |
| | | document.getElementById("chartFire").style.width = div.offsetWidth + "px" |
| | | document.getElementById("chartFire").style.height = div.offsetHeight + "px" |
| | | var data = this.roadItem.data; |
| | | |
| | | |
| | | const id = document.getElementById("chartFire") |
| | | var std = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | var h = i + 1 |
| | | var t = h > 10 ? h : "0" + h; |
| | | std.push(t + ":00:00") |
| | | } |
| | | const myChart = echarts.init(id); |
| | | var option = { |
| | | title: { |
| | | text: "", |
| | | textStyle: { |
| | | color: "white" |
| | | } |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | data: std, |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: 'WHITE' // 设置åä½é¢è²ä¸ºçº¢è² |
| | | } |
| | | } |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | axisLabel: { |
| | | textStyle: { |
| | | color: 'WHITE' // 设置åä½é¢è²ä¸ºçº¢è² |
| | | } |
| | | } |
| | | }, |
| | | tooltip: { |
| | | trigger: 'axis' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data, |
| | | type: 'line', |
| | | smooth: true, |
| | | // itemStyle: { |
| | | // normal: { |
| | | |
| | | // lineStyle: { |
| | | // color: ""// 线çé¢è² |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | option && myChart.setOption(option); |
| | | }, |
| | | setEchartChange(res) { |
| | | this.roadItem = res.val[0] |
| | | this.showEchart(); |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .chartListBox { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .aside-title { |
| | | box-sizing: border-box; |
| | | padding-left: 30px; |
| | | font-size: 15px; |
| | | font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular; |
| | | color: #fff; |
| | | width: 100%; |
| | | height: 45px; |
| | | line-height: 45px; |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | } |
| | | |
| | | .echartBox { |
| | | flex: 1; |
| | | padding: 5px; |
| | | position: relative; |
| | | color: white; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | // justify-content: space-around; |
| | | .chartEchart { |
| | | flex: 1; |
| | | } |
| | | |
| | | .myChart { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: relative; |
| | | |
| | | |
| | | .myChartID { |
| | | position: absolute; |
| | | |
| | | } |
| | | } |
| | | |
| | | .chartTd { |
| | | width: 100%; |
| | | padding: 0px !important; |
| | | } |
| | | |
| | | .elDriver { |
| | | width: 100%; |
| | | height: 2px; |
| | | background: #409EFF; |
| | | margin: 10px 0px; |
| | | |
| | | } |
| | | |
| | | .chartTable { |
| | | width: 100%; |
| | | |
| | | td { |
| | | text-align: center; |
| | | |
| | | .elButton { |
| | | padding: 5px 10px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | </style> |
| | |
| | | }, |
| | | getCoord(res) { |
| | | const coord = res.point.split(','); |
| | | console.log('æµè¯', coord); |
| | | |
| | | |
| | | return coord; |
| | | }, |
| | |
| | | if (item.cnName != "é
ç½çº¿") { |
| | | mapServer.addLayer(item) |
| | | } |
| | | } |
| | | } |
| | | |
| | | }) |
| | | this.$nextTick(() => { |
| | |
| | | }, |
| | | handleClick(item) { |
| | | this.removeLabel(); |
| | | const point = mapConfig.getWKTParse(item.point) |
| | | // const point = mapConfig.getWKTParse(item.point) |
| | | const point = item.point.split(" ") |
| | | this.label = earthCtrl.factory.createLabel({ |
| | | lon: point.coordinates[0], |
| | | lat: point.coordinates[1], |
| | | lon: point[0], |
| | | lat: point[1], |
| | | alt: 40, |
| | | text: item.msg, |
| | | image: config.sdkImg + 'Workers/image/mark.png', |