<template> <Chart :cdata="cdata" /> </template> <script> import Chart from "./Chart"; 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.map((item) => { return ( this.cdata.category.push(item.areaName), this.cdata.barData.push(item.successCount), this.cdata.lineData.push(item.failureCount) ); }); } catch (error) { // this.$refs.msg.messageShow(); } }, }, }; </script> <style lang="scss" scoped> </style>