| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <script>
- import api from '@/api/dashboard/apiDashboard'
- import CoreData from "@/components/common/coreData.vue";
- import RestaurantTrendChart from "@/components/dashboard/portrait/restaurant/restaurantTrendChart.vue";
- export default {
- data() {
- return {
- coreData: [
- {
- type: 0,
- title: '餐厅消费金额(元)',
- num: 0,
- historyDesc: '同比',
- historyNum: '0'
- },
- {
- type: 0,
- title: '餐厅消费订单(单)',
- num: 0,
- historyDesc: '同比',
- historyNum: '0'
- },
- {
- type: 0,
- title: '餐厅平均单价(元/单)',
- num: 0,
- historyDesc: '同比',
- historyNum: '0'
- },
- {
- type: 1,
- title: '第三方结算方式 费用(元)',
- content: '0'
- },
- {
- type: 1,
- showStar: true,
- title: '值得关注',
- content: ''
- },
- ]
- }
- },
- props: {
- chartHeight: Number
- },
- components: {
- CoreData,
- RestaurantTrendChart,
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.getCoreData()
- //this.getTrendData()
- },
- getCoreData() {
- api.getRestCoreData().then(res=>{
- this.coreData[0].num = res.list[0].value
- this.coreData[0].historyNum = res.list[0].compare
- this.coreData[1].num = res.list[1].value
- this.coreData[1].historyNum = res.list[1].compare
- this.coreData[2].num = res.list[2].value
- this.coreData[2].historyNum = res.list[2].compare
- this.coreData[3].content = res.list[3].value
- this.coreData[4].content = res.worthAttention
- })
- },
- getTrendData() {
- api.getRestTrendData().then(res=>{
- })
- }
- }
- }
- </script>
- <template>
- <div class="restaurantPortrait">
- <div class="portrait-coreData">
- <CoreData :data-list="coreData"></CoreData>
- </div>
- <div style="padding: 15px">
- <RestaurantTrendChart :height="chartHeight"></RestaurantTrendChart>
- </div>
- </div>
- </template>
- <style lang="less" scoped>
- .restaurantPortrait {
- }
- </style>
|