|
@@ -1,39 +1,78 @@
|
|
|
/* 问题区 */
|
|
|
<template>
|
|
|
- <gy-card
|
|
|
- title="问题区"
|
|
|
- area-style="problem"
|
|
|
- circle-style="green"
|
|
|
- content-style="89"
|
|
|
- @parentRun="run">
|
|
|
- <div v-for="mc in datas" :key="mc">
|
|
|
- <MatrixCard title="故障"></MatrixCard>
|
|
|
- </div>
|
|
|
- </gy-card>
|
|
|
+ <gy-card
|
|
|
+ title="问题区"
|
|
|
+ area-style="problem"
|
|
|
+ circle-style="green"
|
|
|
+ content-style="89"
|
|
|
+ @parentRun="run"
|
|
|
+ >
|
|
|
+ <MatrixCard title="故障" :datas="ls.malfunction"></MatrixCard>
|
|
|
+ <MatrixCard title="维护" :datas="ls.maintain"></MatrixCard>
|
|
|
+ <MatrixCard title="离线" :datas="ls.offline"></MatrixCard>
|
|
|
+ <MatrixCard title="挂牌" :datas="ls.lockd"></MatrixCard>
|
|
|
+ </gy-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import MatrixCard from "./windturbine/MatrixCard.vue";
|
|
|
+import MatrixCard from "./windturbine/MatrixCard.vue";
|
|
|
+import MessageBridge from "../../assets/script/MessageBridge";
|
|
|
|
|
|
- export default {
|
|
|
- name: "ProblemArea",
|
|
|
- components: {
|
|
|
- MatrixCard
|
|
|
- },
|
|
|
- props:{
|
|
|
- datas:Array,
|
|
|
- values:Array,
|
|
|
- },
|
|
|
- methods: {
|
|
|
- run() {
|
|
|
- },
|
|
|
- addCard() {
|
|
|
- }
|
|
|
- },
|
|
|
- created: function () {
|
|
|
- this.addCard({
|
|
|
- cardStyle: "card-style-1"
|
|
|
- });
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: "ProblemArea",
|
|
|
+ components: {
|
|
|
+ MatrixCard,
|
|
|
+ },
|
|
|
+ props: {},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ ls: {
|
|
|
+ maintain: { key: "维护", value: [] },
|
|
|
+ malfunction: { key: "故障", value: [] },
|
|
|
+ offline: { key: "离线", value: [] },
|
|
|
+ lockd: { key: "挂牌", value: [] },
|
|
|
+ },
|
|
|
+ datas: new Array(),
|
|
|
};
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+ this.initData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initData: function () {
|
|
|
+ var mb = MessageBridge.getInstance();
|
|
|
+ var vs = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
|
|
|
+ mb.register(vs);
|
|
|
+ },
|
|
|
+ windturbineMessage(msg) {
|
|
|
+ var ll = {
|
|
|
+ maintain: { key: "维护", value: [] },
|
|
|
+ malfunction: { key: "故障", value: [] },
|
|
|
+ offline: { key: "离线", value: [] },
|
|
|
+ lockd: { key: "挂牌", value: [] },
|
|
|
+ }
|
|
|
+ var mmsg = JSON.parse(msg);
|
|
|
+ for (var id in mmsg) {
|
|
|
+ var val = mmsg[id];
|
|
|
+ if (val.status == 6) {
|
|
|
+ // 维护
|
|
|
+ ll.maintain.value.push(val);
|
|
|
+ } else if (val.status == 7) {
|
|
|
+ // 离线
|
|
|
+ ll.offline.value.push(val);
|
|
|
+ } else if (val.status == 5) {
|
|
|
+ // 故障
|
|
|
+ ll.malfunction.value.push(val);
|
|
|
+ } else if (val.lockValue > 0) {
|
|
|
+ // 挂牌
|
|
|
+ ll.lockd.value.push(val);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.ls=ll;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|