index.vue 1.72 KB
<template>
  <Chart :cdata="cdata" />
</template>

<script>
import Chart from "./chart.vue";
export default {
  data() {
    return {
      cdata: {
        category: [],
        lineData: [],
      },
    };
  },
  components: {
    Chart,
  },
  created() {
    this.queryClick();
  },
  mounted() {},
  methods: {
    queryClick() {
      console.log("来了kkksxdx");
      // getDataReportPage({ ...this.form, ...this.pageData }).then((res) => {
      let data = {
        success: true,
        message: "操作成功!",
        code: 200,
        result: [
          {
            AREACODE: "转移登记",
            ywtotal: "2",
          },
          {
            AREACODE: "变更登记",
            ywtotal: "4",
          },
          {
            AREACODE: "注销登记",
            ywtotal: "6",
          },
          {
            AREACODE: "更正登记",
            ywtotal: "2",
          },
          {
            AREACODE: "首次登记",
            ywtotal: "11",
          },
          {
            AREACODE: "预告登记",
            ywtotal: "5",
          },
          {
            AREACODE: "补证",
            ywtotal: "1",
          },
          {
            AREACODE: "换证",
            ywtotal: "2",
          },
          {
            AREACODE: "查封登记",
            ywtotal: "2",
          },
        ],
        timestamp: 1673856701381,
      };
      if (data.code === 200) {
        data.result.filter((item) => {
          return (
            this.cdata.category.push(item.AREACODE),
            this.cdata.lineData.push(item.ywtotal)
          );
        });
        console.log("this.cdata", this.cdata);
      }
      //   });
    },
  },
};
</script>

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