Merge remote-tracking branch 'origin/master'
commit
205e64892a
|
@ -21,6 +21,14 @@ export function userloginfo(query) {
|
|||
})
|
||||
}
|
||||
|
||||
//查询12个月的总消费
|
||||
export function months() {
|
||||
return request({
|
||||
url: '/system/user/months',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//充值用户记录
|
||||
export function userPayinfo(query) {
|
||||
|
|
|
@ -208,8 +208,6 @@
|
|||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
|
||||
<el-button type="primary" @click="back()">确 定</el-button>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -63,18 +63,22 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {userBalance} from "@/api/system/user"; //
|
||||
import {userBalance,months} from "@/api/system/user"; //
|
||||
import * as echarts from 'echarts' //引用echarts
|
||||
import {checkRealNameAuth} from "@/api/system/user";
|
||||
import item from "@/layout/components/Sidebar/Item.vue";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
charts: "",
|
||||
dialogVisible: false,
|
||||
listDate:[],
|
||||
a:[],
|
||||
b:[],
|
||||
dialogFormVisible: false,
|
||||
formLabelWidth: '120px',
|
||||
opinionData: ["155", "400", "900", "800", "300", "900", "270", "684", "165", "0", "300", "150"], // 数据
|
||||
opinionData: [],
|
||||
userBalanceData: {
|
||||
userBalance: '加载中...'
|
||||
},
|
||||
|
@ -97,11 +101,25 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.fetchUserBalance();
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.drawLine();
|
||||
},
|
||||
methods: {
|
||||
getList(){
|
||||
months().then(response => {
|
||||
const responseDate = response;
|
||||
responseDate.forEach(item => {
|
||||
console.log('月',item.month, '总金额:', item.totalAmount)
|
||||
});
|
||||
this.listDate = responseDate;
|
||||
this.drawLine();
|
||||
this.$nextTick( () => {
|
||||
console.log(JSON.stringify(this.listDate))
|
||||
});
|
||||
});
|
||||
},
|
||||
handleCancel() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
|
@ -172,6 +190,10 @@ export default {
|
|||
// 初始化折线图
|
||||
this.charts = echarts.init(document.getElementById('main'));
|
||||
|
||||
|
||||
this.a = this.listDate.map(item => item.month)
|
||||
this.b = this.listDate.map(item => item.totalAmount)
|
||||
|
||||
// 设置折线图数据和样式
|
||||
this.charts.setOption({
|
||||
title: {
|
||||
|
@ -213,7 +235,7 @@ export default {
|
|||
alignWithLabel: true,
|
||||
},
|
||||
// 自定义标签
|
||||
data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||
data: this.a,
|
||||
},
|
||||
|
||||
// 自定义:设置y轴刻度
|
||||
|
@ -230,7 +252,7 @@ export default {
|
|||
name: "消费金额", // 自定义
|
||||
type: "line",
|
||||
stack: "总量", // 自定义
|
||||
data: this.opinionData, // 自定义
|
||||
data: this.b,
|
||||
areaStyle: {
|
||||
color: {
|
||||
type: "linear",
|
||||
|
|
Loading…
Reference in New Issue