ui设计
This commit is contained in:
@@ -23,12 +23,24 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
seriesData: [],
|
||||
num: 0
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initChart();
|
||||
|
||||
|
||||
this.getTkhostdetail();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
if (!this.$refs.chart) {
|
||||
console.error('DOM element not found');
|
||||
return;
|
||||
}
|
||||
const myChart = echarts.init(this.$refs.chart);
|
||||
const option = {
|
||||
title: {
|
||||
@@ -36,17 +48,17 @@ export default {
|
||||
},
|
||||
tooltip: {},
|
||||
legend: {
|
||||
data: ['销量']
|
||||
data: [this.title]
|
||||
},
|
||||
xAxis: {
|
||||
data: ['2025-03-29', '2025-03-30', '2025-03-31', '2025-04-01', '2025-04-02', '2025-04-03']
|
||||
data: [this.getCurrentDate()[0].slice(4), this.getCurrentDate()[1].slice(4), this.getCurrentDate()[2].slice(4), this.getCurrentDate()[3].slice(4), this.getCurrentDate()[4].slice(4), this.getCurrentDate()[5].slice(4), this.getCurrentDate()[6].slice(4)]
|
||||
},
|
||||
yAxis: {},
|
||||
series: [
|
||||
{
|
||||
name: '金币数',
|
||||
name: this.title,
|
||||
type: 'line',
|
||||
data: [23266, 12144, 44467, 86686, 35637, 34534],
|
||||
data: [this.seriesData[0], this.seriesData[1], this.seriesData[2], this.seriesData[3], this.seriesData[4], this.seriesData[5], this.seriesData[6]],
|
||||
smooth: true
|
||||
|
||||
}
|
||||
@@ -61,7 +73,33 @@ export default {
|
||||
searchTimeStart: this.getCurrentDate()[0],
|
||||
searchTimeEnd: this.getCurrentDate()[6]
|
||||
}).then(res => {
|
||||
res[0]
|
||||
// console.log("返回数据", res[0][this.getCurrentDate()[2]])
|
||||
//echarts 数据初始化
|
||||
this.seriesData = [
|
||||
res[0][this.getCurrentDate()[0]] == null ? 0 : Number(res[0][this.getCurrentDate()[0]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[1]] == null ? 0 : Number(res[0][this.getCurrentDate()[1]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[2]] == null ? 0 : Number(res[0][this.getCurrentDate()[2]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[3]] == null ? 0 : Number(res[0][this.getCurrentDate()[3]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[4]] == null ? 0 : Number(res[0][this.getCurrentDate()[4]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[5]] == null ? 0 : Number(res[0][this.getCurrentDate()[5]][this.dataType]),
|
||||
res[0][this.getCurrentDate()[6]] == null ? 0 : Number(res[0][this.getCurrentDate()[6]][this.dataType]),
|
||||
]
|
||||
|
||||
// this.seriesData = {
|
||||
// [this.getCurrentDate()[0]]: res[0][this.getCurrentDate()[0]] == null ? 0 : res[0][this.getCurrentDate()[0]][this.dataType],
|
||||
// [this.getCurrentDate()[1]]: res[0][this.getCurrentDate()[1]] == null ? 0 : res[0][this.getCurrentDate()[1]][this.dataType],
|
||||
// [this.getCurrentDate()[2]]: res[0][this.getCurrentDate()[2]] == null ? 0 : res[0][this.getCurrentDate()[2]][this.dataType],
|
||||
// [this.getCurrentDate()[3]]: res[0][this.getCurrentDate()[3]] == null ? 0 : res[0][this.getCurrentDate()[3]][this.dataType],
|
||||
// [this.getCurrentDate()[4]]: res[0][this.getCurrentDate()[4]] == null ? 0 : res[0][this.getCurrentDate()[4]][this.dataType],
|
||||
// [this.getCurrentDate()[5]]: res[0][this.getCurrentDate()[5]] == null ? 0 : res[0][this.getCurrentDate()[5]][this.dataType],
|
||||
// [this.getCurrentDate()[6]]: res[0][this.getCurrentDate()[6]] == null ? 0 : res[0][this.getCurrentDate()[6]][this.dataType],
|
||||
// }
|
||||
|
||||
this.initChart();
|
||||
this.num++
|
||||
console.log("返回数据", this.seriesData)
|
||||
console.log("返回数据", this.num)
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user