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
<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>
 
<script>
import Chart from "./chart.vue";
import axios from "@/api/ajax.js";
export default {
  data() {
    return {
      isProductQuality: true,
      cdata: {
        category: ["2/1", "2/2", "2/3", "2/4", "2/5", "2/6", "2/7"],
        sideData: [], //测漏合格率
        pressData: [], //压机合格率
      },
    };
  },
  components: {
    Chart,
  },
  mounted() {
    this.GetProductQuality();
    setInterval(() => {
      this.GetProductQuality();
    }, 5000);
  },
  methods: {
    GetProductQuality() {
        axios.post("/api/dt_qualitycheck/GetRate", null, "").then((x) => {
        if (x.data.status) {
          this.cdata.category = [];
          for (let index = 0; index < x.data.data.key.length; index++) {
            this.cdata.category.push(x.data.data.key[index]);
            this.cdata.pressData.push(x.data.data.r_RressAct1[index]);
            this.cdata.sideData.push(x.data.data.leak_detection[index]);
          }
          
        }
      });
    },
  },
};
</script>
<style lang="scss" scoped>
</style>