whyczyk
2021-07-19 b9f0dfc4c0c48d65842d417b5babe1304439a735
src/pages/home/topoGraph.vue
@@ -514,7 +514,10 @@
                        this.deviceList.map(item => {
                            switch (item.position) {
                                case 5: // 大功率电源
                                    this.bigPower = item.commStatus
                                    this.bigPower = item.commStatus;
                                    if (this.bigPower == 0) {
                                        diagramStates(diagram, 'bigPower');
                                    }
                                    rectifierPowerInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -527,6 +530,9 @@
                                    break;
                                case 6: // 直流主配电板
                                    this.eleBoard = item.commStatus
                                    if (this.eleBoard == 0) {
                                        diagramStates(diagram, 'eleBoard');
                                    }
                                    centralMonitorSysSTInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -539,6 +545,9 @@
                                    break;
                                case 8: // AFE变频
                                    this.AFEcabinet = item.commStatus
                                    if (this.AFEcabinet == 0) {
                                        diagramStates(diagram, 'AFEcabinet');
                                    }
                                    afeInverterInfoByDeviceId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -551,6 +560,9 @@
                                    break;
                                case 9: // 水站
                                    this.waterStation = item.commStatus
                                    if (this.waterStation == 0) {
                                        diagramStates(diagram, 'waterStation');
                                    }
                                    WaterCommInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -563,6 +575,9 @@
                                    break;
                                case 10: // 油站
                                    this.oilStation = item.commStatus
                                    if (this.oilStation == 0) {
                                        diagramStates(diagram, 'oilStation');
                                    }
                                    OilCommInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -575,6 +590,9 @@
                                    break;
                                case 1: // 5000KV开关
                                    this.switch5000 = item.commStatus;
                                    if (this.switch5000 == 1) {
                                        diagramStates(diagram, 'switch5000');
                                    }
                                    centralMonitorSysInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -587,6 +605,9 @@
                                    break;
                                case 2: // 3200KV1开关
                                    this.switch32001 = item.commStatus
                                    if (this.switch32001 == 1) {
                                        diagramStates(diagram, 'switch32001');
                                    }
                                    centralMonitorSysInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -599,10 +620,13 @@
                                    break;
                                case 3: // 3200KV2开关
                                    this.switch32002 = item.commStatus
                                    if (this.switch32002 == 1) {
                                        diagramStates(diagram, 'switch32002');
                                    }
                                    centralMonitorSysInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
                                        if (res.data.code == 1) {
                                        if (res.data.code == 0) {
                                            this.panel3 = res.data.data
                                        }
                                    }).catch((err) => {
@@ -611,6 +635,9 @@
                                    break;
                                case 4: // 5200KV开关
                                    this.switch5200 = item.commStatus
                                    if (this.switch5200 == 1) {
                                        diagramStates(diagram, 'switch5200');
                                    }
                                    centralMonitorSysInfoByDevId({
                                        devId: item.deviceId
                                    }).then((res) => {
@@ -622,7 +649,7 @@
                                    });
                                    break;
                            }
                            this.setDiagramByType();
                            this.setDiagramByType()
                        })
                    }
                }).catch((err) => {
@@ -681,48 +708,22 @@
            },
            setDiagramByType() {
                this.run = "";
                if (this.bigPower == 1) {
                    diagramStates(diagram, 'bigPower');
                }
                if (this.eleBoard == 1) {
                    diagramStates(diagram, 'eleBoard');
                }
                if (this.speedCabinet == 1) {
                if (this.speedCabinet == 0) {
                    diagramStates(diagram, 'speedCabinet');
                }
                if (this.electric == 1) {
                if (this.electric == 0) {
                    diagramStates(diagram, 'electric');
                }
                if (this.sensor == 1) {
                if (this.sensor == 0) {
                    diagramStates(diagram, 'sensor');
                }
                if (this.dynamometer == 1) {
                if (this.dynamometer == 0) {
                    diagramStates(diagram, 'dynamometer');
                }
                if (this.AFEcabinet == 1) {
                    diagramStates(diagram, 'AFEcabinet');
                }
                if (this.transformer == 1) {
                if (this.transformer == 0) {
                    diagramStates(diagram, 'transformer');
                }
                if (this.waterStation == 1) {
                    diagramStates(diagram, 'waterStation');
                }
                if (this.oilStation == 1) {
                    diagramStates(diagram, 'oilStation');
                }
                if (this.switch5000 == 1) {
                    diagramStates(diagram, 'switch5000');
                }
                if (this.switch32001 == 1) {
                    diagramStates(diagram, 'switch32001');
                }
                if (this.switch32002 == 1) {
                    diagramStates(diagram, 'switch32002');
                }
                if (this.switch5200 == 1) {
                    diagramStates(diagram, 'switch5200');
                }
                if (this.switch5000 == 1) {
                    this.run = 'run1';
                }
@@ -836,9 +837,6 @@
                    }
                }
            }, false)
            // 设置充放电的类型
            this.setDiagramByType();
        },
        destroyed() {
            diagram.stop();