index.vue 1008 Bytes
<template>
<!-- 登记类型总量 -->
  <Chart :cdata="cdata"  />
</template>

<script>
import Chart from "./Chart";
import work from "@/api/work";
export default {
  data () {
    return {
      cdata: {
        category: [],
        lineData: [],
      },
    };
  },
  components: {
    Chart,
  },
  mounted () {
    this.getDjlxtotal();
  },
  methods: {
    /**
     * @description: getDjlxtotal
     * @author: renchao
     */
    getDjlxtotal () {
       return new Promise(async (resolve) => {
          try {
          let p = {
            DJLX: "",
            QLLX: "",
            XZQDM: "",
          };
          let res = await work.getDjlxtotal(p);
          res.result.map((item) => {
            return (
              this.cdata.category.push(item.AREACODE),
              this.cdata.lineData.push(item.ywtotal)
            );
          });
        } catch (error) {
          this.$refs.msg.messageShow();
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped>
</style>