|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="compareData">
|
|
<div class="compareData">
|
|
<!-- /展示的对比数据的模态框 -->
|
|
<!-- /展示的对比数据的模态框 -->
|
|
- <a-modal v-model="compVisiable" title="数据对比" @ok="handleOk" width="65%" border :footer="null">
|
|
|
|
|
|
+ <a-modal v-model="compVisiable" title="数据对比" @ok="handleOk" width="65%" border :footer="null" @cancel='handleCancel'>
|
|
<div class="clickHandle">
|
|
<div class="clickHandle">
|
|
<a-radio-group v-model="value" @change="radioChange" name="dateGroup">
|
|
<a-radio-group v-model="value" @change="radioChange" name="dateGroup">
|
|
<a-radio-button value="month" defaultChecked>月对比</a-radio-button>
|
|
<a-radio-button value="month" defaultChecked>月对比</a-radio-button>
|
|
@@ -387,6 +387,13 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //关闭
|
|
|
|
+ handleCancel(){
|
|
|
|
+ this.value='month';
|
|
|
|
+ this.tableTab=1;
|
|
|
|
+ this.monthValue = [moment().subtract(1, 'months'), moment()]
|
|
|
|
+ this.dateValue = [moment().subtract(1, 'days'), moment()]
|
|
|
|
+ },
|
|
//单选框选择
|
|
//单选框选择
|
|
radioChange(e) {
|
|
radioChange(e) {
|
|
this.compareSign = e.target.value
|
|
this.compareSign = e.target.value
|
|
@@ -409,7 +416,8 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
tableTabChange(e) {
|
|
tableTabChange(e) {
|
|
- this.tableTab = e.target.value
|
|
|
|
|
|
+ this.tableTab = e.target.value;
|
|
|
|
+ this.tableData=0;
|
|
if (e.target.value == '1') {
|
|
if (e.target.value == '1') {
|
|
this.tableData = this.smallDate
|
|
this.tableData = this.smallDate
|
|
} else {
|
|
} else {
|
|
@@ -434,11 +442,23 @@ export default {
|
|
sectionHttp(params) {
|
|
sectionHttp(params) {
|
|
this.loading = true
|
|
this.loading = true
|
|
this.compareOption = JSON.parse(JSON.stringify(compareOption))
|
|
this.compareOption = JSON.parse(JSON.stringify(compareOption))
|
|
|
|
+ this.costcompare.prev=0
|
|
|
|
+ this.clickcompare.prev=0
|
|
|
|
+ this.showNumcompare.prev=0
|
|
|
|
+ this.costcompare.next=0
|
|
|
|
+ this.clickcompare.next=0
|
|
|
|
+ this.showNumcompare.next=0
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
postAction('/ctop/byteDance/homePage/report/compare', params).then(res => {
|
|
postAction('/ctop/byteDance/homePage/report/compare', params).then(res => {
|
|
// console.log(res)
|
|
// console.log(res)
|
|
if (res.success) {
|
|
if (res.success) {
|
|
- this.loading = false
|
|
|
|
|
|
+ this.loading = false;
|
|
|
|
+ // this.costcompare.prev=0
|
|
|
|
+ // this.clickcompare.prev=0
|
|
|
|
+ // this.showNumcompare.prev=0
|
|
|
|
+ // this.costcompare.next=0
|
|
|
|
+ // this.clickcompare.next=0
|
|
|
|
+ // this.showNumcompare.next=0
|
|
if (this.compareSign == 'day') {
|
|
if (this.compareSign == 'day') {
|
|
this.tabCost = JSON.parse(JSON.stringify(initDay))
|
|
this.tabCost = JSON.parse(JSON.stringify(initDay))
|
|
this.tabClick = JSON.parse(JSON.stringify(initDay))
|
|
this.tabClick = JSON.parse(JSON.stringify(initDay))
|
|
@@ -498,6 +518,7 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
this.smallDate = [...res.result.list.smallDate]
|
|
this.smallDate = [...res.result.list.smallDate]
|
|
|
|
+
|
|
res.result.list.bigDate.forEach((ele,index) => {
|
|
res.result.list.bigDate.forEach((ele,index) => {
|
|
if (!ele.costProportion) {
|
|
if (!ele.costProportion) {
|
|
ele.costProportion = '-'
|
|
ele.costProportion = '-'
|
|
@@ -507,22 +528,24 @@ export default {
|
|
ele.statDate = ele.statDate + ' ' + ele.statHour
|
|
ele.statDate = ele.statDate + ' ' + ele.statHour
|
|
}
|
|
}
|
|
ele.key=index+1
|
|
ele.key=index+1
|
|
- // console.log(ele)
|
|
|
|
|
|
+ console.log(ele.cost)
|
|
this.costcompare.next += ele.cost
|
|
this.costcompare.next += ele.cost
|
|
this.clickcompare.next += ele.click
|
|
this.clickcompare.next += ele.click
|
|
this.showNumcompare.next += ele.showNum
|
|
this.showNumcompare.next += ele.showNum
|
|
})
|
|
})
|
|
|
|
+
|
|
if(res.result.list.bigDate.length<res.result.list.smallDate.length){
|
|
if(res.result.list.bigDate.length<res.result.list.smallDate.length){
|
|
for (let i = 0; i < res.result.list.bigDate.length; i++) {
|
|
for (let i = 0; i < res.result.list.bigDate.length; i++) {
|
|
this.costcompare.prev += res.result.list.smallDate[i].cost
|
|
this.costcompare.prev += res.result.list.smallDate[i].cost
|
|
this.clickcompare.prev += res.result.list.smallDate[i].click
|
|
this.clickcompare.prev += res.result.list.smallDate[i].click
|
|
this.showNumcompare.prev += res.result.list.smallDate[i].showNum
|
|
this.showNumcompare.prev += res.result.list.smallDate[i].showNum
|
|
|
|
+ console.log(res.result.list.smallDate[i].cost)
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
for (let i = 0; i < res.result.list.smallDate.length; i++) {
|
|
for (let i = 0; i < res.result.list.smallDate.length; i++) {
|
|
- this.costcompare.prev += res.result.list.bigDate[i].cost
|
|
|
|
- this.clickcompare.prev += res.result.list.bigDate[i].click
|
|
|
|
- this.showNumcompare.prev += res.result.list.bigDate[i].showNum
|
|
|
|
|
|
+ this.costcompare.prev += res.result.list.smallDate[i].cost
|
|
|
|
+ this.clickcompare.prev += res.result.list.smallDate[i].click
|
|
|
|
+ this.showNumcompare.prev += res.result.list.smallDate[i].showNum
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|