Bladeren bron

'账户改'

魏志佳 5 jaren geleden
bovenliggende
commit
701e851f8b
3 gewijzigde bestanden met toevoegingen van 56 en 189 verwijderingen
  1. 44 17
      src/views/modules/Statistics/accountReport.vue
  2. 10 170
      src/views/modules/columnConst/accountConst.js
  3. 2 2
      vue.config.js

+ 44 - 17
src/views/modules/Statistics/accountReport.vue

@@ -129,7 +129,8 @@
            <a-tab-pane key="zhuanhua" tab="转化数">      
             </a-tab-pane>
         </a-tabs>
-        <div id="sectionChart" style='width:100%;height:300px' ref="sectionChart"></div>
+        <div id="sectionChart" style='width:100%;height:300px' ref="sectionChart" ></div>
+        <!-- <div id="noData" v-else style='width:100%;height:300px'>暂无数据</div> -->
      </div>
      <!-- 报表区域 -->
      <div class="tableBox">
@@ -146,13 +147,13 @@
                 :dataSource="tableData"
                 bordered
                 id="outTable"
-                :pagination="ipagination"
+                :pagination="false"
                 :scroll="{ x: scrollX }"
                 :loading="loading"
                 ref="accountTable"
                 :width="tableWidth"
                 @change="sort"
-                style="word-break: break-all;"
+                style="word-break: break-all;font-size:16px;font-weight:500"
               >
                 <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
                 <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
@@ -242,7 +243,7 @@
 <script>
 import moment from 'moment';
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
-import { JeecgListMixin } from '@/mixins/ipagination'
+
 import { TreeSelect } from 'ant-design-vue';
 const SHOW_PARENT = TreeSelect.SHOW_PARENT;
 // const SHOW_PARENT = TreeSelect.SHOW_ALL;
@@ -284,7 +285,7 @@ let sectionOption={
     xAxis: [
         {
             type: 'category',
-            data:  ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+            data:  [],
             axisTick: {
                 alignWithLabel: true
             }
@@ -301,7 +302,7 @@ let sectionOption={
             name: '总消耗',
             type: 'line',
             smooth: true,
-            data:  [820, 932, 901, 934, 1290, 1330, 1320],
+            data:  [],
             color:'#32CD32'
         },
         {
@@ -430,7 +431,7 @@ export default {
         DatePicker,
        customColumn,
     },
-  mixins: [JeecgListMixin],
+
   data() {
     return {
       
@@ -489,6 +490,9 @@ export default {
         order:'desc',//默认降序
 
         listNum:[],
+
+        myChart:{},
+        chartData:[],
     }
   },
   watch:{
@@ -623,7 +627,7 @@ export default {
 
     //查询按钮的事件
     searchgetData(){
-           
+      if(this.accountId.length>0){
         // console.log();
         this.loading=true;
         this.searchDisabled=true;
@@ -640,7 +644,9 @@ export default {
           endDate:this.dateValue[1].format('YYYY-MM-DD')
         })
         this.tableHttp();
-            
+      }else{
+        this.$message.error('请选择账户后再查询!');
+      }
     },
     //刷新
     refreshgetData(){
@@ -682,8 +688,10 @@ export default {
       this.costLink={};
       this.convertNumLink={};
 
-      this.sectionOption=JSON.parse(JSON.stringify(sectionOption));
-      this.getEchartData('sectionChart', this.sectionOption)
+      
+      this.myChart.clear()
+     
+     this.dateValue=[moment(),moment()]
 
     },
     //打开日期框
@@ -721,7 +729,7 @@ export default {
               this.tabShowNum=JSON.parse(JSON.stringify(initDay))
               this.tabDiscountCost=JSON.parse(JSON.stringify(initDay))
               this.tabconvertNum=JSON.parse(JSON.stringify(initDay))
-            let chartData=res.result.chartData;
+              let chartData=res.result.chartData;
             
               
               chartData.map((item,index)=>{
@@ -843,11 +851,13 @@ export default {
       const chart = this.$refs[idName]
       //   console.log(chart)
       if (chart) {
-        const myChart = echarts.init(document.getElementById(idName))
-        myChart.setOption(optionName)
+        var myChart = echarts.init(document.getElementById(idName))
+        myChart.clear()
+        myChart.setOption(optionName,true)
         window.addEventListener('resize', function() {
           myChart.resize()
         })
+        this.myChart=myChart
       }
     },
 
@@ -858,7 +868,7 @@ export default {
         this.sectionOption=JSON.parse(JSON.stringify(sectionOption))
         if(key=='cost'){
             if(this.dateValue[0].format('YYYY-MM-DD')==moment().format('YYYY-MM-DD')){
-                this.sectionOption.legend.data=['今天','昨天'];
+                this.sectionOption.legend.data=['今天','昨天','环比'];
                 this.sectionOption.xAxis[0].data=this.tabCost.x;
                 this.sectionOption.series[0].data=this.tabCost.today.y;
                 this.sectionOption.series[0].name=this.tabCost.today.name;
@@ -1048,10 +1058,15 @@ export default {
           console.log(pagination, filters, sorter)
           if(sorter.order == 'ascend'){            
               this.order='asc'
+              this.target=sorter.columnKey;
           }else if(sorter.order == 'descend'){
               this.order='desc'    
+              this.target=sorter.columnKey;
+          }else{
+              this.order='desc'
+              this.target='cost';
           }
-          this.target=sorter.columnKey;
+          
           this.tableHttp();
     },
   
@@ -1075,7 +1090,19 @@ export default {
         }else{
           this.scrollX=0
         }
-    }
+    },
+    tableHandle() {
+        // this.listNum = [...this.columns]
+        //   console.log(this.listNum.length, this.columns)
+
+        if (this.listNum.length >= 9 || this.columns.length >= 9) {
+          this.tableWidth = 120
+          this.scrollX = this.columns.length * 120
+          // console.log(this.scrollX)
+        } else {
+          this.scrollX = 0
+        }
+    },
   },
   mounted() {
     this.accountHttp()

+ 10 - 170
src/views/modules/columnConst/accountConst.js

@@ -80,8 +80,7 @@ let customFields=  [
           title: '转化成本',
           dataIndex: 'convertCost',
           tip: '广告主为每个转化所付出的平均成本,计算方式:总花费/转化数。当天数据可能会有波动',
-          align: 'center',
-         
+          align: 'center',         
           scopedSlots: { customRender: 'convertCost' },
           sorter: (a, b) => a.convertCost - b.convertCost
         },
@@ -295,38 +294,7 @@ let customFields=  [
           scopedSlots: { customRender: 'nextDayOpenRate' },
           sorter: (a, b) => a.nextDayOpenRate - b.nextDayOpenRate
         },
-        // {
-        //   title: '次留回传数',
-        //   dataIndex: 'nextDayOpenEcho',
-        //   tip: '根据您通过api或sdk回传给我们的时间为准,将次留数披露在回传时间',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'nextDayOpenEcho' },
-        //   sorter: (a, b) => a.nextDayOpenEcho - b.nextDayOpenEcho
-        // },
-        // {
-        //   title: '首次付费数',
-        //   dataIndex: 'firstPayment',
-        //   tip: '用户在应用内首次完成付费的次数',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'firstPayment' },
-        //   sorter: (a, b) => a.firstPayment - b.firstPayment
-        // },
-        // {
-        //   title: '首次付费成本',
-        //   dataIndex: 'firstPaymentCost',
-        //   tip: '用户在应用内首次完成付费的成本,计算方式:消耗/首次付费数',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'firstPaymentCost' },
-        //   sorter: (a, b) => a.firstPaymentCost - b.firstPaymentCost
-        // },
-        // {
-        //   title: '首次付费率',
-        //   dataIndex: 'firstPaymentRate',
-        //   tip: '计算方式:首次付费数/激活数',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'firstPaymentRate' },
-        //   sorter: (a, b) => a.firstPaymentRate - b.firstPaymentRate
-        // },
+        
         {
           title: '付费数',
           dataIndex: 'activePayAmount',
@@ -343,135 +311,7 @@ let customFields=  [
           scopedSlots: { customRender: 'activePayCost' },
           sorter: (a, b) => a.activePayCost - b.activePayCost
         },
-        // {
-        //   title: '7日付费次数(激活时间)',
-        //   dataIndex: 'activePayAmountBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的总次数,并将付费次数披露在每个用户的激活时间上',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountBetween7days - b.activePayAmountBetween7days
-        // },
-        // {
-        //   title: '7日付费成本(激活时间)',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '7日人均付费次数(激活时间)',
-        //   dataIndex: 'activePayAmountAverageBetween7days',
-        //   tip:
-        //     '7天内用户的平均付费次数,计算方式:7日付费次数(激活时间)/7日首次付费数(激活时间),对首次付费数的统计仅在计划内去重且披露在每个用户的激活时间上',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountAverageBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountAverageBetween7days - b.activePayAmountAverageBetween7days
-        // },
-        // {
-        //   title: 'app内访问',
-        //   dataIndex: 'ithinTheAppToAccess',
-        //   tip: '用户调起APP后到达的次数,一般在DPA广告中使用',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'ithinTheAppToAccess' },
-        //   sorter: (a, b) => a.ithinTheAppToAccess - b.ithinTheAppToAccess
-        // },
-        // {
-        //   title: 'app内访问详情页',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: 'app内加入购物车',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: 'app内下单',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: 'app内付费',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '完件数',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '完件成本',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '完件率',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '预授信数',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '预授信成本',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '授信数',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '授信成本',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // },
-        // {
-        //   title: '授信率',
-        //   dataIndex: 'activePayAmountCostBetween7days',
-        //   tip: '用户激活应用后的7天内,在应用内完成付费的平均成本,计算方式:消耗/7日付费次数(激活时间)',
-        //   align: 'center',
-        //   scopedSlots: { customRender: 'activePayAmountCostBetween7days' },
-        //   sorter: (a, b) => a.activePayAmountCostBetween7days - b.activePayAmountCostBetween7days
-        // }
+        
       ]
     },
     {
@@ -882,14 +722,14 @@ let customFields=  [
           scopedSlots: { customRender: 'play25FeedBreak' },
           sorter: (a, b) => a.play25FeedBreak - b.play25FeedBreak
         },
-        {
-          title: '25%进度播放率',
-          dataIndex: 'play25FeedBreakRate',
-          align: 'center',
+        // {
+        //   title: '25%进度播放率',
+        //   dataIndex: 'play25FeedBreakRate',
+        //   align: 'center',
           
-          scopedSlots: { customRender: 'play25FeedBreakRate' },
-          sorter: (a, b) => a.play25FeedBreakRate - b.play25FeedBreakRate
-        },
+        //   scopedSlots: { customRender: 'play25FeedBreakRate' },
+        //   sorter: (a, b) => a.play25FeedBreakRate - b.play25FeedBreakRate
+        // },
         {
           title: '50%进度播放数',
           dataIndex: 'play50FeedBreak',

+ 2 - 2
vue.config.js

@@ -64,7 +64,7 @@ module.exports = {
          }
        },*/
       '/jeecg-boot': {
-        target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
+        // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.13:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.1.22:8080', //请求本地 需要jeecg-boot后台项目  英豪
@@ -72,7 +72,7 @@ module.exports = {
         // target: 'http://192.168.1.103:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.1.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
-        // target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        target: 'http://192.168.1.165:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.1.251:80', //请求本地 需要jeecg-boot后台项目 
         ws: false,
         changeOrigin: true