wankeda
2025-03-13 a6a33f6916afbf1fc629baecb772939cda2ee981
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
<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>
 
<script>
import axios from "@/api/ajax.js"
import Chart from "./chart.vue";
export default {
  data() {
    return {
      cdata: {
        xData: ["空货位", "锁定货位", "有货货位"],
        seriesData: [
          { value: 600, name: "空货位" },
          { value: 1000, name: "锁定货位" },
          { value: 1000, name: "有货货位" },
        ],
      },
      isSetinterval:true
    };
  },
  components: {
    Chart,
  },
  mounted() {
    this.getLocationlist();
  },
  methods: {
    getLocationlist(){
      axios.post("/api/LED/LEDloctionList", null, "").then((res)=>{
        if(res.data.status){
          var data=res.data.data;
          this.cdata.seriesData=[];
          data.areaBucket.forEach(x=> {
            if(x.name!="总货位"){
              this.cdata.seriesData.push(
                { 
                  value: x.count,
                  name: x.name 
                }
              )
            }
          });
          if(this.isSetinterval){
            setInterval(() => {
              this.getLocationlist();
              this.isSetinterval=false;
            }, 5000);
          }
        }
      })
    }
  }
};
</script>