Compare commits
No commits in common. "6dee7e0e78efa46b1439a0625903ecb42b153e79" and "ed74e2a8869e2454c13bb782a5bfc18ced3ae31a" have entirely different histories.
6dee7e0e78
...
ed74e2a886
|
@ -21,14 +21,6 @@ export function userloginfo(query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询12个月的总消费
|
|
||||||
export function months() {
|
|
||||||
return request({
|
|
||||||
url: '/system/user/months',
|
|
||||||
method: 'get',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//充值用户记录
|
//充值用户记录
|
||||||
export function userPayinfo(query) {
|
export function userPayinfo(query) {
|
||||||
|
|
|
@ -63,22 +63,18 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {userBalance,months} from "@/api/system/user"; //
|
import {userBalance} from "@/api/system/user"; //
|
||||||
import * as echarts from 'echarts' //引用echarts
|
import * as echarts from 'echarts' //引用echarts
|
||||||
import {checkRealNameAuth} from "@/api/system/user";
|
import {checkRealNameAuth} from "@/api/system/user";
|
||||||
import item from "@/layout/components/Sidebar/Item.vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
charts: "",
|
charts: "",
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
listDate:[],
|
|
||||||
a:[],
|
|
||||||
b:[],
|
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
opinionData: [],
|
opinionData: ["155", "400", "900", "800", "300", "900", "270", "684", "165", "0", "300", "150"], // 数据
|
||||||
userBalanceData: {
|
userBalanceData: {
|
||||||
userBalance: '加载中...'
|
userBalance: '加载中...'
|
||||||
},
|
},
|
||||||
|
@ -101,25 +97,11 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.fetchUserBalance();
|
this.fetchUserBalance();
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.drawLine();
|
this.drawLine();
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
handleCancel() {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
},
|
},
|
||||||
|
@ -190,10 +172,6 @@ export default {
|
||||||
// 初始化折线图
|
// 初始化折线图
|
||||||
this.charts = echarts.init(document.getElementById('main'));
|
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({
|
this.charts.setOption({
|
||||||
title: {
|
title: {
|
||||||
|
@ -235,7 +213,7 @@ export default {
|
||||||
alignWithLabel: true,
|
alignWithLabel: true,
|
||||||
},
|
},
|
||||||
// 自定义标签
|
// 自定义标签
|
||||||
data: this.a,
|
data: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
|
||||||
},
|
},
|
||||||
|
|
||||||
// 自定义:设置y轴刻度
|
// 自定义:设置y轴刻度
|
||||||
|
@ -252,7 +230,7 @@ export default {
|
||||||
name: "消费金额", // 自定义
|
name: "消费金额", // 自定义
|
||||||
type: "line",
|
type: "line",
|
||||||
stack: "总量", // 自定义
|
stack: "总量", // 自定义
|
||||||
data: this.b,
|
data: this.opinionData, // 自定义
|
||||||
areaStyle: {
|
areaStyle: {
|
||||||
color: {
|
color: {
|
||||||
type: "linear",
|
type: "linear",
|
||||||
|
|
Loading…
Reference in New Issue