<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from "./chart.vue";
import { httpPost, httpGet } from "../../../../api";
import RegisterDevice from "../../../../api/allFun.js";
export default {
  data() {
    return {
      cdata: [
        {
          // 名字需要与 “common/map/fujian.js” 地图数据文件里面定义的一一对应，不能是 “福州” 或者 “闽” 之类的缩写
          name: "深圳市",
          value: 0,
          elseData: {
            // 这里放置地图 tooltip 里想显示的数据
          },
        },
        {
          name: "光明区深圳理工",
          value: 0,
        },
      ],
    };
  },
  components: {
    Chart,
  },
  mounted() {
    setTimeout(() => {
      this.cdata[0].value = this.$store.state.seriesData.operationTotal;
      this.cdata[1].value = this.$store.state.seriesData.operationTotal;
    }, 500);
  },
  methods: {
    getcard() {
		RegisterDevice.getAnalysis("",-1,(callback)=>{
			this.cdata[1].value = callback.operationTotal;
			this.cdata[0].value = callback.operationTotal;			
		})
    },
  },
};
</script>

<style lang="scss" scoped>
</style>