doum
2025-12-10 559f6fcd685d2144e931d2c4e56cbe38c2308d70
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
  <TableLayout>
    <div slot="search-form" class="data">
        <div class="item-title">数据看板</div>
        <div class="data-summary">
          <div class="data-item">
            <div>会员数量</div>
            <div class="data-num">{{ countData.users }}</div>
          </div>
          <div class="parting"></div>
          <div class="data-item">
            <div>今日活跃用户</div>
            <div class="data-num">{{ countData.activeUsers }}</div>
          </div>
          <div class="parting"></div>
          <div class="data-item">
            <div>订单总数</div>
            <div class="data-num">{{ countData.orders }}</div>
          </div>
          <div class="parting"></div>
          <div class="data-item">
            <div>订单总金额</div>
            <div class="data-num">{{ countData.money }}</div>
          </div>
          <div class="parting"></div>
          <div class="data-item">
            <div>本月订单数</div>
            <div class="data-num">{{ countData.mouthOrders }}</div>
          </div>
          <div class="parting"></div>
          <div class="data-item">
            <div>本月订单总金额</div>
            <div class="data-num">{{ countData.mouthMoney }}</div>
          </div>
        </div>
      </div>
    <template v-slot:table-wrap>
      <div class="change-style">
        <div class="item-title">订单金额趋势</div>
        <div style="display: flex;">
          <el-button type="text" @click="changeCount(7)">7日</el-button>
          <div style="margin: 0 5px;">|</div>
          <el-button type="text" @click="changeCount(30)">30日</el-button>
        </div>
      </div>
      <div ref="orderChange" class="bottom">
        
      </div>
    </template>
    
  </TableLayout>
</template>
 
<script>
import TableLayout from '@/layouts/TableLayout'
import * as echarts from 'echarts';
import { findAllList, createCoffeeTask } from '@/api/business/taskRule'
export default {
  components: {
    TableLayout
  },
  data() {
    return {
      countData: {
        users: 1000,
        activeUsers: 1000,
        mouthOrders: 10,
        mouthMoney: 100000,
        orders: 10,
        money: 100000
      },
      orderCorderCount: [10,10,20,10,40,10,30],
      opinionData: ['3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26'],
      myChart: null
    }
  },
  mounted() {
    this.myChart = echarts.init(this.$refs.orderChange)
    window.addEventListener('resize', () => {
      this.myChart.resize()
    })
    this.renderOrderChange()
    findAllList({})
 
  },
  methods: {
    renderOrderChange() {
      this.myChart.setOption({
        tooltip: {
          trigger: 'axis'
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        toolbox: {
          feature: {
            
          }
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: this.opinionData
        },
        yAxis: {
          type: 'value'
        },
        series: [{
          name: '订单',
          type: 'line',
          stack: '总量',
          data: this.orderCorderCount
        }]
      })
      
    },
    changeCount(page) {
      if (page == 7) {
        this.orderCorderCount = [10,10,20,10,40,10,30]
        this.opinionData = ['3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26']
      } else {
        this.orderCorderCount = [11,10,20,10,40,10,30,20,10,20,10,40,10,30,10,10,20,10,40,10,30,10,10,20,10,40,10,30,20,40]
        this.opinionData = ['3.01','3.02','3.03','3.04','3.05','3.06','3.07','3.08','3.09','3.10','3.11','3.12','3.13','3.14','3.15','3.16','3.17','3.18','3.19','3.20', '3.21', '3.22', '3.23', '3.24', '3.25', '3.26', '3.27','3.28','3.28','3.30',]
      }
      // this.orderCorderCount.push(1)
      // this.opinionData.push(1)
      this.renderOrderChange()
 
    }
  },
}
</script>
 
<style lang="scss" scoped>
.data {
  padding-bottom: 10px;
}
.item-title {
  font-weight: 500;
  
}
.data-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  .data-item {
    flex: 1;
    height: 80px;
    box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.1) ;
    box-sizing: border-box;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .data-num {
      font-size: 20px;
      font-weight: 700;
      color:aqua
    }
  }
  .parting {
    width: 20px;
  }
}
.change-style {
  display: flex;
  justify-content: space-between;
  line-height: 31px;
}
.bottom {
  height: 500px;
}
</style>