|
@@ -14,271 +14,201 @@
|
|
|
</div>
|
|
|
|
|
|
<el-main>
|
|
|
- <div class="table1 ">
|
|
|
+ <div class="table1">
|
|
|
<el-row :gutter="40">
|
|
|
- <el-col :span="1" style="color: #4adefe;">Ia:</el-col>
|
|
|
- <el-col :span="1">1</el-col>
|
|
|
- <el-col :span="1">2</el-col>
|
|
|
- <el-col :offset="1" :span="1">3</el-col>
|
|
|
- <el-col :span="1">4</el-col>
|
|
|
- <el-col :offset="1" :span="1">5</el-col>
|
|
|
- <el-col :span="1">6</el-col>
|
|
|
- <el-col :span="1">7</el-col>
|
|
|
- <el-col style="margin-left: 230px" :span="1">8</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">9</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">10</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">11</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">12</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">13</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">14</el-col>
|
|
|
+ <el-col :span="2" style="color: #4adefe; margin-right: -65px"
|
|
|
+ >负荷:</el-col
|
|
|
+ >
|
|
|
+ <el-col :span="1">{{ load[0] }}</el-col>
|
|
|
+ <el-col :span="1">{{ load[1] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ load[2] }}</el-col>
|
|
|
+ <el-col :span="1">{{ load[3] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ load[4] }}</el-col>
|
|
|
+ <el-col :span="1">{{ load[5] }}</el-col>
|
|
|
+ <el-col :span="1">{{ load[6] }}</el-col>
|
|
|
+ <el-col style="margin-left: 230px" :span="1">{{ load[7] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ load[8] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ load[9] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ load[10] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ load[11] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ load[12] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ load[13] }}</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="40" style="margin-top: 20px">
|
|
|
- <el-col :span="1" style="color: #4adefe;">P:</el-col>
|
|
|
- <el-col :span="1">1</el-col>
|
|
|
- <el-col :span="1">2</el-col>
|
|
|
- <el-col :offset="1" :span="1">3</el-col>
|
|
|
- <el-col :span="1">4</el-col>
|
|
|
- <el-col :offset="1" :span="1">5</el-col>
|
|
|
- <el-col :span="1">6</el-col>
|
|
|
- <el-col :span="1">7</el-col>
|
|
|
- <el-col style="margin-left: 230px" :span="1">8</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">9</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">10</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">11</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">12</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">13</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">14</el-col>
|
|
|
+ <el-col :span="2" style="color: #4adefe; margin-right: -65px"
|
|
|
+ >电压:</el-col
|
|
|
+ >
|
|
|
+ <el-col :span="1">{{ voltage[0] }}</el-col>
|
|
|
+ <el-col :span="1">{{ voltage[1] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ voltage[2] }}</el-col>
|
|
|
+ <el-col :span="1">{{ voltage[3] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ voltage[4] }}</el-col>
|
|
|
+ <el-col :span="1">{{ voltage[5] }}</el-col>
|
|
|
+ <el-col :span="1">{{ voltage[6] }}</el-col>
|
|
|
+ <el-col style="margin-left: 230px" :span="1">{{ voltage[7] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ voltage[8] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ voltage[9] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ voltage[10] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ voltage[11] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ voltage[12] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ voltage[13] }}</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="40" style="margin-top: 20px">
|
|
|
- <el-col :span="1" style="color: #4adefe;">Q:</el-col>
|
|
|
- <el-col :span="1">1</el-col>
|
|
|
- <el-col :span="1">2</el-col>
|
|
|
- <el-col :offset="1" :span="1">3</el-col>
|
|
|
- <el-col :span="1">4</el-col>
|
|
|
- <el-col :offset="1" :span="1">5</el-col>
|
|
|
- <el-col :span="1">6</el-col>
|
|
|
- <el-col :span="1">7</el-col>
|
|
|
- <el-col style="margin-left: 230px" :span="1">8</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">9</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">10</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">11</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">12</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">13</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">14</el-col>
|
|
|
+ <el-col :span="2" style="color: #4adefe; margin-right: -65px"
|
|
|
+ >电流:</el-col
|
|
|
+ >
|
|
|
+ <el-col :span="1">{{ current[0] }}</el-col>
|
|
|
+ <el-col :span="1">{{ current[1] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ current[2] }}</el-col>
|
|
|
+ <el-col :span="1">{{ current[3] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ current[4] }}</el-col>
|
|
|
+ <el-col :span="1">{{ current[5] }}</el-col>
|
|
|
+ <el-col :span="1">{{ current[6] }}</el-col>
|
|
|
+ <el-col style="margin-left: 230px" :span="1">{{ current[7] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ current[8] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ current[9] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ current[10] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ current[11] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ current[12] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ current[13] }}</el-col>
|
|
|
</el-row>
|
|
|
<el-row :gutter="40" style="margin-top: 20px">
|
|
|
- <el-col :span="1" style="color: #4adefe;">Cos:</el-col>
|
|
|
- <el-col :span="1">1</el-col>
|
|
|
- <el-col :span="1">2</el-col>
|
|
|
- <el-col :offset="1" :span="1">3</el-col>
|
|
|
- <el-col :span="1">4</el-col>
|
|
|
- <el-col :offset="1" :span="1">5</el-col>
|
|
|
- <el-col :span="1">6</el-col>
|
|
|
- <el-col :span="1">7</el-col>
|
|
|
- <el-col style="margin-left: 230px" :span="1">8</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">9</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">10</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">11</el-col>
|
|
|
- <el-col style="margin-left: 20px" :span="1">12</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">13</el-col>
|
|
|
- <el-col style="margin-left: 30px" :span="1">14</el-col>
|
|
|
+ <el-col :span="2" style="color: #4adefe; margin-right: -65px"
|
|
|
+ >Cos:</el-col
|
|
|
+ >
|
|
|
+ <el-col :span="1">{{ cos[0] }}</el-col>
|
|
|
+ <el-col :span="1">{{ cos[1] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ cos[2] }}</el-col>
|
|
|
+ <el-col :span="1">{{ cos[3] }}</el-col>
|
|
|
+ <el-col :offset="1" :span="1">{{ cos[4] }}</el-col>
|
|
|
+ <el-col :span="1">{{ cos[5] }}</el-col>
|
|
|
+ <el-col :span="1">{{ cos[6] }}</el-col>
|
|
|
+ <el-col style="margin-left: 230px" :span="1">{{ cos[7] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ cos[8] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ cos[9] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ cos[10] }}</el-col>
|
|
|
+ <el-col style="margin-left: 20px" :span="1">{{ cos[11] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ cos[12] }}</el-col>
|
|
|
+ <el-col style="margin-left: 30px" :span="1">{{ cos[13] }}</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <el-row>
|
|
|
- <el-col :offset="6" :span="7"
|
|
|
- ><div class="grid-content bg-purple">
|
|
|
- <table class="table2">
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Ua(KV):<span>{{ four.right.Ua }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Uab(KV):<span>{{ four.right.Uab }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Ub(KV):<span>{{ four.right.Ub }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Ubc(KV):<span>{{ four.right.Ubc }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Uc(KV):<span>{{ four.right.Uc }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Uca(KV):<span>{{ four.right.Uca }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div></el-col
|
|
|
- >
|
|
|
- <el-col :span="8"
|
|
|
- ><div class="grid-content bg-purple">
|
|
|
- <table class="table2">
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Ua(KV):<span>{{ four.left.Ua }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Uab(KV):<span>{{ four.left.Uab }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Ub(KV):<span>{{ four.left.Ub }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Ubc(KV):<span>{{ four.left.Ubc }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr align="left">
|
|
|
- <td>
|
|
|
- Uc(KV):<span>{{ four.left.Uc }}KV</span>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- Uca(KV):<span>{{ four.left.Uca }}KV</span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div></el-col
|
|
|
- >
|
|
|
- </el-row>
|
|
|
</el-main>
|
|
|
+ <el-row style="margin-top: -40px">
|
|
|
+ <el-col :offset="6" :span="7"
|
|
|
+ ><div class="grid-content bg-purple">
|
|
|
+ <table class="table2">
|
|
|
+ <tr align="left">
|
|
|
+ <td>Ua(KV):<span>24KV</span></td>
|
|
|
+ <td>Uab(KV):<span>22KV</span></td>
|
|
|
+ </tr>
|
|
|
+ <tr align="left">
|
|
|
+ <td>Ub(KV):<span>75KV</span></td>
|
|
|
+ <td>Ubc(KV):<span>57KV</span></td>
|
|
|
+ </tr>
|
|
|
+ <tr align="left">
|
|
|
+ <td>Uc(KV):<span>34KV</span></td>
|
|
|
+ <td>Uca(KV):<span>12KV</span></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="8"
|
|
|
+ ><div class="grid-content bg-purple">
|
|
|
+ <table class="table2">
|
|
|
+ <tr align="left">
|
|
|
+ <td>Ua(KV):<span>9KV</span></td>
|
|
|
+ <td>Uab(KV):<span>77KV</span></td>
|
|
|
+ </tr>
|
|
|
+ <tr align="left">
|
|
|
+ <td>Ub(KV):<span>62KV</span></td>
|
|
|
+ <td>Ubc(KV):<span>51KV</span></td>
|
|
|
+ </tr>
|
|
|
+ <tr align="left">
|
|
|
+ <td>Uc(KV):<span>79KV</span></td>
|
|
|
+ <td>Uca(KV):<span>21KV</span></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapState } from "vuex";
|
|
|
export default {
|
|
|
name: "Table",
|
|
|
data() {
|
|
|
return {
|
|
|
- six: {
|
|
|
- transformerOut_1: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- transformerOut_2: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- workshop: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- airCompressor_1: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- out_1: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- busSection: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- out_2: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- transformerOut_3: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- transformerOut_4: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- administration: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- airCompressor_2: {
|
|
|
- p: "",
|
|
|
- q: "",
|
|
|
- cos: "",
|
|
|
- Ia: "",
|
|
|
- duration: "",
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- four: {
|
|
|
- right: {
|
|
|
- Ua: "",
|
|
|
- Uab: "",
|
|
|
- Ub: "",
|
|
|
- Ubc: "",
|
|
|
- Uc: "",
|
|
|
- Uca: "",
|
|
|
- },
|
|
|
- left: {
|
|
|
- Ua: "",
|
|
|
- Uab: "",
|
|
|
- Ub: "",
|
|
|
- Ubc: "",
|
|
|
- Uc: "",
|
|
|
- Uca: "",
|
|
|
- },
|
|
|
- },
|
|
|
+ load: new Array(14).fill("0"),
|
|
|
+ voltage: new Array(14).fill("0"),
|
|
|
+ current: new Array(14).fill("0"),
|
|
|
+ cos: new Array(14).fill("0"),
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- getData() {
|
|
|
- axios
|
|
|
- .get("/table")
|
|
|
- .then((response) => {
|
|
|
- this.six = response.data.six;
|
|
|
- this.four = response.data.four;
|
|
|
- })
|
|
|
- .catch(function (err) {
|
|
|
- console.log(err);
|
|
|
- });
|
|
|
+ getRandomNum(min, max) {
|
|
|
+ return Math.floor(Math.random() * (max - min + 1) + min);
|
|
|
+ },
|
|
|
+ getData(data, type) {
|
|
|
+ console.log(data[0]);
|
|
|
+ this.load.splice(0, 1, data[0]["fuhe_after"]);
|
|
|
+ this.cos.splice(0, 1, data[0]["gonglvyinshu_after"]);
|
|
|
+ this.current.splice(0, 1, data[0]["dianliu_after"]);
|
|
|
+ this.voltage.splice(0, 1, data[0]["dianya_after"]);
|
|
|
+ let data1 = [];
|
|
|
+ let data2 = [];
|
|
|
+ let data3 = [];
|
|
|
+ let data4 = [];
|
|
|
+ for (let i = 0; i < 13; i++) {
|
|
|
+ data1.push(this.getRandomNum(5000, 5200));
|
|
|
+ data2.push(this.getRandomNum(10, 15));
|
|
|
+ data3.push(this.getRandomNum(300, 400));
|
|
|
+ data4.push(Math.random().toFixed(1));
|
|
|
+ }
|
|
|
+ // 伪造数据
|
|
|
+ this.load.splice(1, 13, ...data1);
|
|
|
+
|
|
|
+ this.voltage.splice(1, 13, ...data2);
|
|
|
+
|
|
|
+ this.current.splice(1, 13, ...data3);
|
|
|
+
|
|
|
+ this.cos.splice(1, 13, ...data4);
|
|
|
},
|
|
|
- setTime() {
|
|
|
- this.intervalId = setInterval(() => {
|
|
|
- this.getData();
|
|
|
- }, 1000);
|
|
|
+ initWebSocket(websocket, type) {
|
|
|
+ // 连接错误
|
|
|
+ websocket.onerror = () => {
|
|
|
+ console.log("WebSocket连接发生错误 状态码:" + websocket.readyState);
|
|
|
+ };
|
|
|
+ // 连接成功
|
|
|
+ websocket.onopen = () => {
|
|
|
+ console.log("WebSocket连接成功 状态码:" + websocket.readyState);
|
|
|
+ };
|
|
|
+ // 收到消息的回调
|
|
|
+ websocket.onmessage = (event) => {
|
|
|
+ // console.log("onmessage", event);
|
|
|
+ if (JSON.parse(event.data).length) {
|
|
|
+ this.getData(JSON.parse(event.data), type);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ // 连接关闭的回调
|
|
|
+ websocket.onclose = () => {
|
|
|
+ console.log("WebSocket连接关闭 状态码:" + websocket.readyState);
|
|
|
+ };
|
|
|
// 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
|
|
|
this.$once("hook:beforeDestroy", () => {
|
|
|
- clearInterval(this.intervalId);
|
|
|
+ websocket.close();
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapState(["websocketIP"]),
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- // this.setTime()
|
|
|
+ // websocket
|
|
|
+ // 采泵1
|
|
|
+ let pump1 = new WebSocket(`ws://${this.websocketIP}/hbase/ws/belt/62`);
|
|
|
+ this.initWebSocket(pump1, "pump1");
|
|
|
},
|
|
|
};
|
|
|
</script>
|