懒羊羊
2023-12-12 776fbe36aec576c164c9edfe6be13d833eaef7b9
提交 | 用户 | 时间
776fbe 1 <template>
2   <div>
3     <Chart :cdata="cdata" />
4   </div>
5 </template>
6
7 <script>
8 import Chart from './chart.vue';
9 export default {
10   data () {
11     return {
12       cdata: {
13         xData: ["MC10S-01", "MC10S-02", "MC10S-03", "MZ207"],
14         seriesData: [
15           { value: 5, name: "MC10S-01" },
16           { value: 2, name: "MC10S-02" },
17           { value: 4, name: "MC10S-03" },
18           { value: 8, name: "MZ207" },
19           // { value: 20, name: "data5" },
20           // { value: 35, name: "data6" }
21         ]
22       }
23     }
24   },
25   components: {
26     Chart,
27   },
28   mounted () {
29     this.tops();
30   },
31   methods: {
32     tops(){
33       this.$http.get('http://192.168.0.249:8083/equipmentInfo/centerLeft1')
34           .then((response)=>{
35             this.cdata = {
36               xData: response.data.data.xData,
37               seriesData : response.data.data.seriesData
38             }
39             console.log(response.data.data.seriesData)
40           })
41     },
42     changeTiming() {
43       setInterval(() => {
44         this.tops();
45       }, 60000)
46     },
47   }
48 }
49 </script>
50
51 <style lang="scss" scoped>
52 </style>