|
@@ -22,12 +22,14 @@
|
|
|
<span>返点比例:</span>
|
|
|
<a-input-number :min="0" :max="10" :step="0.1" v-model="rebateProp" />
|
|
|
</div>
|
|
|
- <div class="optItem">
|
|
|
-
|
|
|
+ <div class="time" @click="opendate">
|
|
|
+ <DatePicker :openOptions='openOptions'/>
|
|
|
</div>
|
|
|
|
|
|
<div class="btn">
|
|
|
- <a-button type="primary" @click="getData">查询</a-button>
|
|
|
+ <a-button type="primary" @click="searchgetData" :disabled='searchDisabled'>查询</a-button>
|
|
|
+ <a-button type="primary" @click="refreshgetData" :disabled='refreshDisabled'>刷新</a-button>
|
|
|
+ <a-button type="primary" @click="resetgetData" :disabled='resetDisabled'>重置</a-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -66,6 +68,17 @@ export default {
|
|
|
discount:1.0,
|
|
|
//返点比例
|
|
|
rebateProp:1.0,
|
|
|
+ //日期矿打开
|
|
|
+ openOptions:false,
|
|
|
+ //子元素的数据存储
|
|
|
+
|
|
|
+ type:1,
|
|
|
+ dateValue:[moment(),moment()],
|
|
|
+
|
|
|
+ //处理按钮禁用
|
|
|
+ searchDisabled:false,
|
|
|
+ refreshDisabled:false,
|
|
|
+ resetDisabled:false,
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -100,14 +113,82 @@ export default {
|
|
|
return current && current > moment().subtract(1, 'day')
|
|
|
},
|
|
|
|
|
|
- //确定按钮的事件
|
|
|
- getData(){
|
|
|
+ //查询按钮的事件
|
|
|
+ searchgetData(){
|
|
|
|
|
|
console.log();
|
|
|
this.loading=true;
|
|
|
+ this.searchDisabled=true;
|
|
|
// this.HttpPost()
|
|
|
|
|
|
},
|
|
|
+ //刷新
|
|
|
+ refreshgetData(){
|
|
|
+ this.loading=true;
|
|
|
+ this.refreshDisabled=true;
|
|
|
+ },
|
|
|
+ //重置
|
|
|
+ resetgetData(){
|
|
|
+ this.loading=true;
|
|
|
+ this.resetDisabled=true;
|
|
|
+ },
|
|
|
+ //打开日期框
|
|
|
+ opendate(){
|
|
|
+ this.openOptions=!this.openOptions;
|
|
|
+ // console.log(this.openOptions)
|
|
|
+ },
|
|
|
+
|
|
|
+ HttpPost(params){
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ postAction('/ctop/byteDance/homePage/report/week', {}).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ if (res.success) {
|
|
|
+ this.loading = false
|
|
|
+ this.refreshDisabled=false;
|
|
|
+ this.resetDisabled=false;
|
|
|
+ this.searchDisabled=false;
|
|
|
+ this.cost = res.result.costWeekLink
|
|
|
+ this.click = res.result.clickWeekLink
|
|
|
+ this.showNum = res.result.showNumWeekLink
|
|
|
+ res.result.top.top7.forEach((element, index) => {
|
|
|
+ this.topOption.xAxis[0].data.push(element.authName)
|
|
|
+ this.topOption.series[0].data.push(element.cost)
|
|
|
+ })
|
|
|
+
|
|
|
+ for (let [key, value] of Object.entries(res.result.costWeek)) {
|
|
|
+ this.costOption.xAxis[0].data.push(key)
|
|
|
+ this.costOption.series[0].data.push(value)
|
|
|
+ }
|
|
|
+ for (let [key, value] of Object.entries(res.result.clickWeek)) {
|
|
|
+ this.clickOption.xAxis[0].data.push(key)
|
|
|
+ this.clickOption.series[0].data.push(value)
|
|
|
+ }
|
|
|
+ for (let [key, value] of Object.entries(res.result.showNumWeek)) {
|
|
|
+ this.showOption.xAxis[0].data.push(key)
|
|
|
+ this.showOption.series[0].data.push(value)
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getEchartData('topChart', this.topOption)
|
|
|
+ this.getEchartData('costChart', this.costOption)
|
|
|
+ this.getEchartData('clickChart', this.clickOption)
|
|
|
+ this.getEchartData('showChart', this.showOption)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //获取echart的值
|
|
|
+ getEchartData(idName, optionName) {
|
|
|
+ const chart = this.$refs[idName]
|
|
|
+ // console.log(chart)
|
|
|
+ if (chart) {
|
|
|
+ const myChart = echarts.init(document.getElementById(idName))
|
|
|
+ myChart.setOption(optionName)
|
|
|
+ window.addEventListener('resize', function() {
|
|
|
+ myChart.resize()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|