index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight">
  5. <el-col :span="24" class="one"> <span>统计</span> </el-col>
  6. <el-col :span="24">
  7. <el-tabs type="border-card">
  8. <el-tab-pane label="年度销售额"><card-1></card-1> </el-tab-pane>
  9. <el-tab-pane label="年度下单数"><card-2></card-2></el-tab-pane>
  10. <el-tab-pane label="年度付款数"><card-3></card-3></el-tab-pane>
  11. <el-tab-pane label="年度退货数"><card-4></card-4></el-tab-pane>
  12. <el-tab-pane label="年度退款数"><card-5></card-5></el-tab-pane>
  13. <el-tab-pane label="年度换货数"><card-6></card-6></el-tab-pane>
  14. </el-tabs>
  15. </el-col>
  16. </el-col>
  17. </el-row>
  18. </div>
  19. </template>
  20. <script>
  21. const _ = require('lodash');
  22. import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
  23. const { mapActions } = createNamespacedHelpers('todo');
  24. export default {
  25. name: 'index',
  26. props: {},
  27. components: {
  28. card1: () => import('./parts/card-1.vue'),
  29. card2: () => import('./parts/card-2.vue'),
  30. card3: () => import('./parts/card-3.vue'),
  31. card4: () => import('./parts/card-4.vue'),
  32. card5: () => import('./parts/card-5.vue'),
  33. card6: () => import('./parts/card-6.vue'),
  34. },
  35. data: function () {
  36. return {
  37. data: {},
  38. };
  39. },
  40. async created() {
  41. await this.search();
  42. },
  43. methods: {
  44. ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
  45. async search({ skip = 0, limit = 10, ...info } = {}) {
  46. let res = await this.query({ skip, limit, ...info });
  47. if (this.$checkRes(res)) {
  48. this.$set(this, 'data', res.data);
  49. }
  50. },
  51. },
  52. computed: {
  53. ...mapState(['user']),
  54. },
  55. metaInfo() {
  56. return { title: this.$route.meta.title };
  57. },
  58. watch: {
  59. test: {
  60. deep: true,
  61. immediate: true,
  62. handler(val) {},
  63. },
  64. },
  65. };
  66. </script>
  67. <style lang="less" scoped>
  68. .main {
  69. .one {
  70. margin: 0 0 10px 0;
  71. span:nth-child(1) {
  72. font-size: 20px;
  73. font-weight: 700;
  74. margin-right: 10px;
  75. }
  76. }
  77. .two {
  78. margin: 0 0 10px 0;
  79. }
  80. .thr {
  81. margin: 0 0 10px 0;
  82. }
  83. }
  84. </style>