1
huangxiaoqiang
2025-04-16 9757426ed62d7d4b1479dc0a431002f676983d6b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<template>
  <div id="centerLeft1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <icon
            name="chart-bar"
            class="text-icon"
            style="color: #ffffff"
          ></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2" style="font-size: 20px"
            >设备运行状态</span
          >
          <dv-decoration-3 class="dv-dec-3" />
        </div>
      </div>
      <div class="d-flex" style="margin-left: 10px; margin-top: 10px">
        <div class="d-flex jc-center body-box">
          <dv-scroll-board class="dv-scr-board" :config="config" />
        </div>
      </div>
    </div>
  </div>
</template>
  
  <script>
import CenterLeft1Chart from "@/components/echart/centerLeft/centerLeft1Chart";
import axios from "@/api/ajax.js";
export default {
  props: {
    Housetype: {
      type: String,
      default: "SC1",
    },
  },
  data() {
    return {
      config: {
        header: ["设备编号", "设备名称", "运行状态"],
        data: [
          ["0000001", "底板翻转", "40"],
          ["0000002", "压机", "40"],
          ["0000003", "弹簧翻转", "40"],
          ["0000004", "测漏", "40"],
        ],
        rowNum: 11, //表格行数
        waitTime: 10000,
        headerHeight: 28,
        // headerBGC: "#002B46", //表头
        // oddRowBGC: "#002B46", //奇数行
        // evenRowBGC: "#042B53", //偶数行
        // index: true,
        columnWidth: [180, 150, 120],
        align: ["center"],
      },
    };
  },
  components: {
    CenterLeft1Chart,
  },
  mounted() {
    this.GetEquipmentStatus();
    setInterval(() => {
      this.GetEquipmentStatus();
    }, 5000);
  },
  methods: {
    GetEquipmentStatus() {
      axios.post("/api/dt_equipment/GetEquipmentStatus", null, "").then((x) => {
        if (x.data.status) {
          var data = x.data.data;
          var arr = []; //存储需要的数据
          this.config.data = []; //清空原数据
          var that = this;
          for (let index = 0; index < data.length; index++) {
            arr.push(data[index].equipNo); //设备编号
            arr.push(data[index].equipName); //设备名称
            arr.push(data[index].equipState); //运行状态
            that.config.data.push(arr);
            arr = []; //清空
          }
          this.config = {
            header: ["设备编号", "设备名称", "运行状态"],
            data: that.config.data,
            rowNum: 11, //表格行数
            waitTime: 10000,
            headerHeight: 28,
            columnWidth: [180, 150, 120],
            align: ["center"],
          };
        }
      });
    },
  },
};
</script>
  
<style lang="scss" scoped>
$box-height: 320px;
#centerLeft1 {
  padding: 16px;
  height: $box-height;
  border-radius: 10px;
  .bg-color-black {
    height: $box-height - 30px;
    border-radius: 10px;
  }
  .text {
    color: #c3cbde;
  }
  .dv-dec-3 {
    position: relative;
    width: 100px;
    height: 20px;
    top: -3px;
  }
  .body-box {
    border-radius: 10px;
    overflow: hidden;
    .dv-scr-board {
      width: 650px;
      height: 245px;
    }
  }
  .bottom-data {
    .item-box {
      & > div {
        padding-right: 5px;
      }
      font-size: 14px;
      float: right;
      position: relative;
      width: 50%;
      color: #d3d6dd;
      .dv-digital-flop {
        width: 120px;
        height: 30px;
      }
      // 金币
      .coin {
        position: relative;
        top: 6px;
        padding-left: 28px;
        font-size: 20px;
        color: #ffc107;
      }
      .colorYellow {
        color: yellowgreen;
      }
      p {
        text-align: center;
      }
    }
  }
}
</style>