wankeda
2025-06-24 1caea0fdc7ed1788d854a2aba8853984b4494e01
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
<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("http://192.168.2.51:9290/api/Task/LEDloctionList ", null, "").then((res)=>{
              // axios.post("http://127.0.0.1:9290/api/Task/LEDloctionList ", null, "").then((res)=>{
        if(res.data.status){
          var data=res.data.data;
          this.cdata.seriesData=[];
          data.areaProduct.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>
 
<style lang="scss" scoped>
</style>