suerprisePlus
2024-10-23 559f0776123a2205863b5787d5b8e1e012d397d3
src/views/visualization/index.vue
@@ -25,7 +25,7 @@
                    <atlas v-if="isShow == '知识图谱'"></atlas>
                    <analysis v-if="isShow == '数据分析'"></analysis>
                    <statistics v-if="isShow == '数据统计'"></statistics>
                    <line-loss v-if="isShow == '数字线损'"></line-loss>
                    <line-loss v-if="isShow == '配网运检'"></line-loss>
                    <semanticFunction v-if="isShow == '语义功能'"></semanticFunction>
                </div>
@@ -37,7 +37,7 @@
                <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>
@@ -54,6 +54,7 @@
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,
@@ -73,11 +74,12 @@
            wsSocket: null,
            rightChartData: {},
            leftChartData: {},
            showMsgFlag: true
            showMsgFlag: true
        }
    },
    beforeDestroy() {
        if (this.wsSocket) {
            this.wsSocket.close();
            this.wsSocket.onclose = () => {
                console.log('WebSocket连接关闭');
                this.wsSocket = null
@@ -87,13 +89,13 @@
    },
    mounted() {
        if (!this.wsSocket) {
            // this.createSocket();
            this.createSocket();
        }
    },
    methods: {
        receiveDataFromChild(data) {
            console.log(data);
            this.showMsgFlag = true
        },
        ShowMenuList() {
@@ -111,12 +113,31 @@
                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
                        }
                    }
                }
            };
        },
@@ -152,7 +173,7 @@
    }
    .leftMenu {
        width: 15%;
        width: 12%;
        top: 90px;
        left: 10px;
        height: calc(100% - 180px);
@@ -161,7 +182,7 @@
    }
    .rightMenu {
        width: 15%;
        width: 12%;
        top: 90px;
        right: 10px;
        height: calc(100% - 180px);