更新10.16

This commit is contained in:
许允枞 2024-10-16 11:21:02 +08:00
parent 9ad6fcb18d
commit 6f21acbccc

View File

@ -146,10 +146,11 @@
<div class="h-anniu" :class="{'q-anniu' : showTimeShow == false}" @click="showTimeShow = false ">{{ypjyTitle}} <i
class="el-icon-arrow-down el-icon--right"></i></div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="近一周" index="2">近一周</el-dropdown-item>
<el-dropdown-item command="近一月" index="2">本月</el-dropdown-item>
<el-dropdown-item command="近一年" index="2">本季度</el-dropdown-item>
<el-dropdown-item command="近一年" index="2">本年</el-dropdown-item>
<!-- <el-dropdown-item command="近一周" index="2">近一周</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一月" index="2">本月</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一年" index="2">本季度</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一年" index="2">本年</el-dropdown-item>-->
<el-dropdown-item v-for="(item,index) in amountList" :key="index" :command="item">{{item}} </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<div class="h-anniu" :class="{'q-anniu' : showTimeShow == true}" @click="showTimeShow = true"> 自定义
@ -175,10 +176,7 @@
<div class="h-anniu" :class="{'q-anniu' : timeShow == false}" @click="timeShow = false ">{{ygphTitle}} <i
class="el-icon-arrow-down el-icon--right"></i></div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="近一周" index="3">近一周</el-dropdown-item>
<el-dropdown-item command="近一月" index="3">本月</el-dropdown-item>
<el-dropdown-item command="近一年" index="3">本季度</el-dropdown-item>
<el-dropdown-item command="近一年" index="3">本年</el-dropdown-item>
<el-dropdown-item v-for="(item,index) in amountList" :key="index" :command="item">{{item}} </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@ -220,10 +218,11 @@
<div class="h-anniu" :class="{'q-anniu' : countTimeShow == false}" @click="countTimeShow = false ">{{sjtjTitle}} <i
class="el-icon-arrow-down el-icon--right"></i></div>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="近一周" index="1">近一周</el-dropdown-item>
<el-dropdown-item command="近一月" index="1">本月</el-dropdown-item>
<el-dropdown-item command="近一年" index="1">本季度</el-dropdown-item>
<el-dropdown-item command="近一年" index="1">本年</el-dropdown-item>
<!-- <el-dropdown-item command="近一周" index="1">近一周</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一月" index="1">本月</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一年" index="1">本季度</el-dropdown-item>-->
<!-- <el-dropdown-item command="近一年" index="1">本年</el-dropdown-item>-->
<el-dropdown-item v-for="(item,index) in amountList" :key="index" :command="item">{{item}} </el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -267,10 +266,10 @@ export default {
data() {
return {
amountList:[
"今日 " ,
"昨日 " ,
"本周 " ,
"本月 " ,
"今日" ,
"昨日" ,
"本周" ,
"本月" ,
"本季度" ,
"本年"
@ -376,7 +375,7 @@ export default {
start.setSeconds(0)
start.setMilliseconds(0)
this.showValue = [start,new Date()]
} else if (command=='近一周'){
} else if (command=='周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value1 = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -396,8 +395,11 @@ export default {
goList() {
this.$router.push('/notificationList/index')
},
editShow(command){
editShow(e){
this.disabled = true
console.log(e)
this.ypjyTitle = e
let command = e
if (command=='今日'){
let start = new Date();
start.setHours(0)
@ -405,15 +407,15 @@ export default {
start.setSeconds(0)
start.setMilliseconds(0)
this.showValue = [start,new Date()]
} else if (command=='近一周'){
} else if (command=='周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一月'){
} else if (command=='月'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一年'){
} else if (command=='年'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.showValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -422,24 +424,28 @@ export default {
}
this.getDataShow()
},
editCount(command){
editCount(e){
this.disabled = true
this.sjtjTitle = e
console.log("e",e)
let command = e
if (command=='今日'){
let start = new Date();
start.setHours(0)
start.setMinutes(0)
start.setSeconds(0)
start.setMilliseconds(0)
this.showValue = [start,new Date()]
} else if (command=='近一周'){
this.countValue = [start,new Date()]
} else if (command=='周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一月'){
} else if (command=='本月'){
console.log('进入了人本月')
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 30 * 24 * 60 * 60 * 1000)
this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
} else if (command=='近一年'){
} else if (command=='年'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getFullYear() - 1, nowDate.getMonth(), nowDate.getDate())
this.countValue = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -450,6 +456,7 @@ export default {
},
editColor(command){
this.disabled = true
this.ygphTitle = command
if (command=='今日'){
let start = new Date();
start.setHours(0)
@ -457,7 +464,7 @@ export default {
start.setSeconds(0)
start.setMilliseconds(0)
this.value2 = [start,new Date()]
} else if (command=='近一周'){
} else if (command=='周'){
let nowDate = new Date();
let oneWeekAgo = new Date(nowDate.getTime() - 6 * 24 * 60 * 60 * 1000)
this.value2 = [parseTime(oneWeekAgo),parseTime(nowDate)]
@ -640,53 +647,38 @@ export default {
//
const times = this.dataCount.oilData.map(item => item.time);
const count = [];
for (let i = 0; i < this.dataCount.oilNames.length; i++) {
let a = {
name: this.dataCount.oilNames[i],
color: color[i],
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
barGap: '60%',
data: this.dataCount.oilData.map(item => item.money[i])
let c = ['product', ...this.dataCount.oilNames]
let countType = []
count.push(c)
this.dataCount.oilNames.forEach(item => {
let type={
type: 'bar'
}
countType.push(type)
})
this.dataCount.oilData.forEach(item => {
let a =[item.time, ...item.money]
console.log("a",a)
count.push(a)
}
})
//
const showTimes = this.dataShows.oilData.map(item => item.day);
const showCount = [];
for (let i = 0; i < this.dataShows.oilNames.length; i++) {
let a = {
name: this.dataShows.oilNames[i],
color: color[i],
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value;
}
},
barWidth: 13,
itemStyle: {
normal: {
barBorderRadius: [50, 50, 0, 0]
}
},
barGap: '60%',
data: this.dataShows.oilData.map(item => item.oilPrices[i])
// data: oilAmountList
let cshow = ['product', ...this.dataCount.oilNames]
showCount.push(cshow)
let showCountType = []
this.dataCount.oilNames.forEach(item => {
let type={
type: 'bar'
}
showCountType.push(type)
})
this.dataCount.oilData.forEach(item => {
let a =[item.time, ...item.money]
console.log("a",a)
showCount.push(a)
}
})
const option = {
color: [
@ -726,18 +718,6 @@ export default {
name: '',
type: 'pie',
radius: '80%',
// data: [
// // { value: 28, name: '28%' },
// // { value: 72, name: '72%' },
// {
// value: this.countPercentage(Number(this.storeAmount.oilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)),
// name: ""
// },
// {
// value: this.countPercentage(Number(this.storeAmount.noOilNum), Number(this.storeAmount.oilNum) + Number(this.storeAmount.noOilNum)),
// name: ""
// },
//
// ],
data: this.dataAnalysisIfOilList,
emphasis: {
@ -839,8 +819,11 @@ export default {
}
],
dataset: {
source: count
},
series: count,
series: countType,
grid: {
left: '3%',
right: '3%',
@ -848,6 +831,7 @@ export default {
containLabel: true
}
};
console.log("option3",option3)
const option4 = {
tooltip: {
trigger: 'axis',
@ -881,7 +865,10 @@ export default {
}
}
],
series: showCount,
dataset: {
source: showCount
},
series: showCountType,
grid: {
left: '3%',
right: '3%',