index.vue 832 Bytes
<template>
  <Chart :cdata="cdata" />
</template>

<script>
import Chart from "./chart.vue";
import work from "@/api/work";
export default {
  data () {
    return {
      cdata: {
        category: [],
        lineData: [],
        barData: [],
      },
    };
  },
  components: {
    Chart,
  },
  mounted () {
    this.submitViews();
  },
  methods: {
    async submitViews () {
      try {
        let { result: res } = await work.submitViews("A20");
        res.filter((item) => {
          return (
            this.cdata.category.push(item.areaName),
            this.cdata.lineData.push(item.successCount),
            this.cdata.barData.push(item.failureCount)
          );
        });
      } catch (error) {
        // this.$refs.msg.messageShow();
      }
    },
  },
};
</script>

<style lang="scss" scoped>

</style>