更新10.16

This commit is contained in:
许允枞 2024-10-16 11:43:39 +08:00
parent 1da831fd2b
commit e677e8cc5d

View File

@ -374,7 +374,11 @@ export default {
start.setMinutes(0) start.setMinutes(0)
start.setSeconds(0) start.setSeconds(0)
start.setMilliseconds(0) start.setMilliseconds(0)
this.showValue = [start,new Date()] this.value1 = [parseTime(new Date()),parseTime(new Date())]
}else if (command=='昨日'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
} else if (command=='本周'){ } else if (command=='本周'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
@ -383,7 +387,14 @@ export default {
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)] this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='本年'){ }else if (command=='本季度'){
let nowDate = new Date();
let quarterStartMonth = Math.floor((nowDate.getMonth() + 1) / 3) * 3 - 2;
let quarterEndMonth = quarterStartMonth + 2;
let startDate = new Date(nowDate.getFullYear(), quarterStartMonth, 1);
let endDate = new Date(nowDate.getFullYear(), quarterEndMonth + 1, 0);
this.value1 = [parseTime(startDate), parseTime(endDate)];
} else if (command=='本年'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate()) let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)] this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -406,7 +417,11 @@ export default {
start.setMinutes(0) start.setMinutes(0)
start.setSeconds(0) start.setSeconds(0)
start.setMilliseconds(0) start.setMilliseconds(0)
this.showValue = [start,new Date()] this.showValue = [parseTime(new Date()),parseTime(new Date())]
}else if (command=='昨日'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
this.showValue = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
} else if (command=='本周'){ } else if (command=='本周'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
@ -415,7 +430,14 @@ export default {
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)] this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='本年'){ }else if (command=='本季度'){
let nowDate = new Date();
let quarterStartMonth = Math.floor((nowDate.getMonth() + 1) / 3) * 3 - 2;
let quarterEndMonth = quarterStartMonth + 2;
let startDate = new Date(nowDate.getFullYear(), quarterStartMonth, 1);
let endDate = new Date(nowDate.getFullYear(), quarterEndMonth + 1, 0);
this.showValue = [parseTime(startDate), parseTime(endDate)];
} else if (command=='本年'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate()) let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)] this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -435,16 +457,27 @@ export default {
start.setMinutes(0) start.setMinutes(0)
start.setSeconds(0) start.setSeconds(0)
start.setMilliseconds(0) start.setMilliseconds(0)
this.countValue = [start,new Date()] // this.countValue = [start,new Date()]
this.countValue = [parseTime(new Date()),parseTime(new Date())]
}else if (command=='昨日'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 1 * 24 * 60 * 60 * 1000)
this.countValue = [parseTime(oneWeekAgo),parseTime(oneWeekAgo)]
} else if (command=='本周'){ } else if (command=='本周'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)] this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='本月'){ } else if (command=='本月'){
console.log('进入了人本月')
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)] this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
}else if (command=='本季度'){
let nowDate = new Date();
let quarterStartMonth = Math.floor((nowDate.getMonth() + 1) / 3) * 3 - 2;
let quarterEndMonth = quarterStartMonth + 2;
let startDate = new Date(nowDate.getFullYear(), quarterStartMonth, 1);
let endDate = new Date(nowDate.getFullYear(), quarterEndMonth + 1, 0);
this.countValue = [parseTime(startDate), parseTime(endDate)];
} else if (command=='本年'){ } else if (command=='本年'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate()) let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
@ -468,14 +501,21 @@ export default {
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一月'){ } else if (command=='月'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000) let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一年'){ }else if (command=='本季度'){
let nowDate = new Date();
let quarterStartMonth = Math.floor((nowDate.getMonth() + 1) / 3) * 3 - 2;
let quarterEndMonth = quarterStartMonth + 2;
let startDate = new Date(nowDate.getFullYear(), quarterStartMonth, 1);
let endDate = new Date(nowDate.getFullYear(), quarterEndMonth + 1, 0);
this.value2 = [parseTime(startDate), parseTime(endDate)];
} else if (command=='本年'){
let nowDate = new Date(); let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate()) let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)] this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
}else if (command=='自定义'){ }else if (command=='自定义'){
this.disabled = false this.disabled = false
} }
@ -658,27 +698,30 @@ export default {
}) })
this.dataCount.oilData.forEach(item => { this.dataCount.oilData.forEach(item => {
let a =[item.time, ...item.money] let a =[item.time, ...item.money]
console.log("a",a)
count.push(a) count.push(a)
}) })
// //
const showTimes = this.dataShows.oilData.map(item => item.day); const showTimes = this.dataShows.oilData.map(item => item.day);
const showCount = []; const showCount = [];
let cshow = ['product', ...this.dataCount.oilNames] let cshow = ['product', ...this.dataShows.oilNames]
showCount.push(cshow) showCount.push(cshow)
let showCountType = [] let showCountType = []
this.dataCount.oilNames.forEach(item => { console.log("看看执行")
this.dataShows.oilNames.forEach(item => {
let type={ let type={
type: 'bar' type: 'bar'
} }
showCountType.push(type) showCountType.push(type)
}) })
this.dataCount.oilData.forEach(item => { console.log(this.dataShows.oilData)
let a =[item.time, ...item.money] this.dataShows.oilData.forEach(item => {
console.log("a",a) let a =[item.day, ...item.oilPrices]
showCount.push(a) showCount.push(a)
console.log("showCount",a)
}) })
console.log("showCount",showCount)
console.log("showCountType",showCountType)
const option = { const option = {
color: [ color: [
@ -831,7 +874,6 @@ export default {
containLabel: true containLabel: true
} }
}; };
console.log("option3",option3)
const option4 = { const option4 = {
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',