whycwx
2021-07-22 4bfe87304988cfa2338bb58210ee227b917a9247
src/pages/dynamometerMmotor/dynamometerMmotor.vue
@@ -1,16 +1,16 @@
<template>
<div class="body_box">
    <div class="tipTitle">测功机监测</div>
    <div class="tipTitle">测功电机监测</div>
    <div class="content_box">
        <div class="content_top">
            <p class="title_into">当前运行情况</p>
            <el-form ref="form" label-width="100px">
            <el-form ref="form" label-width="120px">
                <el-form-item label="受试电机状态:">
                    <el-input size="mini" v-model="formData.thisInfo.ssdjzt" style="width:65px"></el-input>
                </el-form-item>
                <el-form-item label="直流调速柜:">
                <!-- <el-form-item label="直流调速柜:">
                    <el-input size="mini" v-model="formData.thisInfo.zltsg" style="width:65px"></el-input>
                </el-form-item>
                </el-form-item> -->
                <el-form-item label="受试侧轴联器:">
                    <el-input size="mini" v-model="formData.thisInfo.ssczlq" style="width:65px"></el-input>
@@ -75,25 +75,29 @@
            <div class="clear"></div>
        </div>
        <!-- 轴承温度 -->
        <div class="content_bottom" ref="temperature"></div>
        <div class="content_bottom">
            <p class="title_into">定子轴承温度</p>
            <div ref="temperature" class="temperature"></div>
        </div>
    </div>
    <div class="left_Box">
        <!-- <div class="tipTitle">AFE变频驱动柜监控</div> -->
        <div class="content_cent canvs_box">
        <div class="content_cent canvs_box" style="position:relative;">
            <div class="diagram-content">
                    <div class="diagram-stc" ref="static"></div>
                    <div class="diagram-flush" ref="flush"></div>
            </div>
            <abs-panel class="diagramPanel2" title="受试电机" :list="underTestMotor"></abs-panel>
        </div>
        <div class="content_bottom list_box">
            <p class="title_into">告警情况</p>
            <p class="title_into">报警情况</p>
            <!-- 表单 -->
            <div class="flex-page-content">
                <div class="batteryrHistoryquery" style="width: 100%;height: 100%;">
                    <el-table :data="tableData" style="width: 100%" max-height="145px"> 
                        <el-table-column prop="date" label="告警时间"></el-table-column>
                        <el-table-column prop="name" label="告警名称"></el-table-column>
                        <el-table-column prop="address" label="告警描述"></el-table-column>
                        <el-table-column prop="date" label="报警时间"></el-table-column>
                        <el-table-column prop="name" label="报警名称"></el-table-column>
                        <el-table-column prop="address" label="报警描述"></el-table-column>
                    </el-table>
                </div>
            </div>
@@ -117,12 +121,35 @@
import getWsUrl from "@/assets/js/getWsUrl";
import * as echarts from 'echarts';
import gridCircuitDiagram from '@/pages/dynamometerMmotor/js/gridCircuitDiagram'
import absPanel from '@/components/smallModule/absPanel.vue';
let diagram;
export default {
    chart: {},
    data(){
        return {
            isOpen:false,
            tableData:[],
            underTestMotor: [{
                    label: '电压:',
                    value: 690,
                    unit: "V",
                },
                {
                    label: '频率:',
                    value: 44.5,
                    unit: "Hz",
                },
                {
                    label: '转速:',
                    value: 89,
                    unit: "r/min",
                },
                {
                    label: '输出功率:',
                    value: 980,
                    unit: "kW",
                },
            ],
            formData:{
                thisInfo:{
                    ssdjzt:"运行中",
@@ -150,6 +177,7 @@
        }
    },
    components:{
        absPanel
        // ContentBox
    },
    mounted() {
@@ -188,12 +216,14 @@
                this.socket.onopen = this.onOpen;
                this.socket.onerror = this.onError;
                this.socket.onclose = this.close;
            }
        },
        onMessage(res) {
            let self = this;
            let result = JSON.parse(res.data)
            if(result.code == 1){
                this.isOpen = true;
                // 表单赋值
                self.formData.thisInfo.cxFivePanelCurr = result.data.screenRTList[0].panelCurr + "A";
                self.echartsList[0].echartsCurr.push(result.data.screenRTList[0].panelCurr);
@@ -224,7 +254,6 @@
                self.setOption(item,true);
            });
            self.setEcharts();
            console.log(result)
        },
        getTime(){
            var myDate = new Date(); //实例一个时间对象;
@@ -248,7 +277,7 @@
            // 关闭websocket
            if (this.isOpen) {
                // 打印关闭信息
                console.log("关闭电源实时告警WebSocket");
                console.log("关闭电源实时报警WebSocket");
                this.socket.close();
            }
        },
@@ -302,6 +331,7 @@
                        // xAxisIndex: 0,
                        yAxisIndex: 0,//使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用。
                        type: 'line',
                        symbol: 'none',
                        step: false,
                        smooth: true
                    },{
@@ -309,6 +339,7 @@
                        // xAxisIndex: 0,
                        yAxisIndex: 1,//使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用。
                        type: 'line',
                        symbol: 'none',
                        // step: false,
                        smooth: true
                    },]
@@ -386,7 +417,7 @@
                    // ratio: 87.3
                },
                { month: "13",value: 60,},{ month: "14",value: 55 },{month: "15",value: 44,}];
            var bkData = [100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100];
            var bkData = [300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300];
            var xData = [],
                yData = [];
            var min = 50;
@@ -398,7 +429,7 @@
                    yData.push(a.value);
                }
            });
        let option = {
            let option = {
                backgroundColor: "#111c4e",
                color: ['#3398DB'],
                tooltip: {
@@ -447,7 +478,7 @@
                            show: false
                        },
                        // min: min,
                        max: 100,
                        max: 300,
                        axisLine: {
                            lineStyle: {
                                // color: 'rgba(255,255,255,0)'
@@ -456,7 +487,7 @@
                        axisLabel: {
                            color: '#95a2aa',
                            fontSize: 14,
                            formatter: '{value}%'
                            formatter: '{value}℃'
                        },
                        splitLine: {
                            lineStyle: {
@@ -474,7 +505,6 @@
                        itemStyle: {
                            normal: {
                                color: function(value){
                                    console.log(value);
                                    let  color = "rgb(255,199,28)";
                                    if(value.data >=80){
                                        color = "red";
@@ -529,6 +559,10 @@
}
.batteryrHistoryquery{
    overflow: auto;
}
.temperature{
    width: 100%;
    height: 90%;
}
.echarts-right{
    width: 100%;
@@ -596,6 +630,10 @@
    width: 40%;
    /* padding: 0.75rem 1rem; */
}
.canvs_box{
    width: 100%;
    height: 65%;
}
.diagram-content{
    height: 100%;
    /* width: 100%; */
@@ -603,7 +641,7 @@
}
.diagram-stc {
        width: 100%;
        /* height: 100%; */
        height: 100%;
        overflow: hidden;
    }
@@ -616,13 +654,15 @@
    z-index: 9;
    overflow: hidden;
}
.diagram-stc /deep/ canvas,.diagram-flush /deep/ canvas{
/* .diagram-stc /deep/ canvas,.diagram-flush /deep/ canvas{
    object-fit:fill !important;
}
.canvs_box{
    height: 65%;
}
} */
.list_box{
    height: 33.5%;
}
.diagramPanel2 {
    left: 350px;
    top: 230px;
}
</style>