restaurantPortrait.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <script>
  2. import api from '@/api/dashboard/apiDashboard'
  3. import CoreData from "@/components/common/coreData.vue";
  4. import RestaurantTrendChart from "@/components/dashboard/portrait/restaurant/restaurantTrendChart.vue";
  5. export default {
  6. data() {
  7. return {
  8. coreData: [
  9. {
  10. type: 0,
  11. title: '餐厅消费金额(元)',
  12. num: 0,
  13. historyDesc: '同比',
  14. historyNum: '0'
  15. },
  16. {
  17. type: 0,
  18. title: '餐厅消费订单(单)',
  19. num: 0,
  20. historyDesc: '同比',
  21. historyNum: '0'
  22. },
  23. {
  24. type: 0,
  25. title: '餐厅平均单价(元/单)',
  26. num: 0,
  27. historyDesc: '同比',
  28. historyNum: '0'
  29. },
  30. {
  31. type: 1,
  32. title: '第三方结算方式 费用(元)',
  33. content: '0'
  34. },
  35. {
  36. type: 1,
  37. showStar: true,
  38. title: '值得关注',
  39. content: ''
  40. },
  41. ]
  42. }
  43. },
  44. props: {
  45. chartHeight: Number
  46. },
  47. components: {
  48. CoreData,
  49. RestaurantTrendChart,
  50. },
  51. mounted() {
  52. this.init();
  53. },
  54. methods: {
  55. init() {
  56. this.getCoreData()
  57. //this.getTrendData()
  58. },
  59. getCoreData() {
  60. api.getRestCoreData().then(res=>{
  61. this.coreData[0].num = res.list[0].value
  62. this.coreData[0].historyNum = res.list[0].compare
  63. this.coreData[1].num = res.list[1].value
  64. this.coreData[1].historyNum = res.list[1].compare
  65. this.coreData[2].num = res.list[2].value
  66. this.coreData[2].historyNum = res.list[2].compare
  67. this.coreData[3].content = res.list[3].value
  68. this.coreData[4].content = res.worthAttention
  69. })
  70. },
  71. getTrendData() {
  72. api.getRestTrendData().then(res=>{
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <template>
  79. <div class="restaurantPortrait">
  80. <div class="portrait-coreData">
  81. <CoreData :data-list="coreData"></CoreData>
  82. </div>
  83. <div style="padding: 15px">
  84. <RestaurantTrendChart :height="chartHeight"></RestaurantTrendChart>
  85. </div>
  86. </div>
  87. </template>
  88. <style lang="less" scoped>
  89. .restaurantPortrait {
  90. }
  91. </style>