zhuxinbo 5 år sedan
förälder
incheckning
8fe6fad712

+ 2 - 2
src/views/modules/Statistics/videoStatics/selectComponent.vue

@@ -331,8 +331,8 @@ const customFields = [
         dataIndex: 'nextDayOpen',
         tip: '在次留行为发生或回传后,将次留数匹配到相应的激活时间上,用来查看当天在第二天的次留数。当天数据不产出',
         align: 'center',
-        scopedSlots: { customRender: 'playOverRate' },
-        sorter: (a, b) => a.playOverRate - b.playOverRate
+        scopedSlots: { customRender: 'nextDayOpen' },
+        sorter: (a, b) => a.nextDayOpen - b.nextDayOpen
       },
       {
         title: '次留成本',

+ 6 - 4
src/views/modules/Statistics/videoStatics/vDay.vue

@@ -41,7 +41,7 @@
           </div>
         </div>
         <div class="listNum">
-          <p>已选{{columns.length}}列</p>
+          <p>已选{{listNum.length}}列</p>
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
@@ -112,7 +112,8 @@
       <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
       <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
-      <span slot="cpm" slot-scope="cpm">{{ cpm | toPercentage }}</span>
+      <span slot="cpc" slot-scope="cpm">{{ cpm | tofixed }}</span>
+      <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
       <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
       <span slot="installFinishRate" slot-scope="installFinishRate">{{ installFinishRate | toPercentage }}</span>
       <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
@@ -124,6 +125,7 @@
       <span slot="downloadFinishCost" slot-scope="downloadFinishCost">{{ downloadFinishCost | tofixed }}</span>
       <span slot="downloadStartCost" slot-scope="downloadStartCost">{{ downloadStartCost | tofixed }}</span>
       <span slot="installFinishCost" slot-scope="installFinishCost">{{ installFinishCost | tofixed }}</span>
+      <span slot="convertCost" slot-scope="convertCost">{{ convertCost | tofixed }}</span>
     </a-table>
     <a-modal v-model="Videovisible" title="视频详情" @ok="videoOk" :footer="null" width='50%'>
         <video
@@ -383,8 +385,8 @@ export default {
     tableHandle(){
       // this.listNum = [...this.columns]
       console.log(this.listNum.length,this.columns)
-
-      if(this.listNum.length > 12|| this.columns.length>12){
+      this.scrollX=0;
+      if(this.listNum.length >= 12|| this.columns.length>=12){
           this.tableWidth=120;
           this.scrollX=this.columns.length*140
           console.log(this.scrollX)

+ 26 - 24
src/views/modules/Statistics/videoStatics/vMonth.vue

@@ -43,7 +43,7 @@
           </div>
         </div>
         <div class="listNum">
-          <p>已选{{columns.length}}列</p>
+          <p>已选{{listNum.length}}列</p>
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
@@ -120,7 +120,8 @@
        <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
       <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
-      <span slot="cpm" slot-scope="cpm">{{ cpm | toPercentage }}</span>
+      <span slot="cpc" slot-scope="cpm">{{ cpm | tofixed }}</span>
+      <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
       <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
       <span slot="installFinishRate" slot-scope="installFinishRate">{{ installFinishRate | toPercentage }}</span>
       <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
@@ -132,6 +133,7 @@
       <span slot="downloadFinishCost" slot-scope="downloadFinishCost">{{ downloadFinishCost | tofixed }}</span>
       <span slot="downloadStartCost" slot-scope="downloadStartCost">{{ downloadStartCost | tofixed }}</span>
       <span slot="installFinishCost" slot-scope="installFinishCost">{{ installFinishCost | tofixed }}</span>
+      <span slot="convertCost" slot-scope="convertCost">{{ convertCost | tofixed }}</span>
     </a-table>
     <!-- 明细表 -->
 
@@ -535,8 +537,8 @@ export default {
     tableHandle(){
       // this.listNum = [...this.columns]
       console.log(this.listNum.length,this.columns)
-
-      if(this.listNum.length > 12|| this.columns.length>12){
+      this.scrollX=0;
+      if(this.listNum.length >= 9|| this.columns.length>=9){
           this.tableWidth=120;
           this.scrollX=this.columns.length*140
           console.log(this.scrollX)
@@ -670,31 +672,31 @@ export default {
     this.statDate = moment().subtract(1, 'day')
     moment().format('YYYY-MM-DD_HH:mm')
 
-    // postAction('/toutiao/videoReportDaily/getColumnJson', {
-    //   columnType:4,
-    // }).then((res)=>{
-    //   // console.log(res)
-    //   if(res.success){
-    //   // console.log(JSON.parse(res.result))
-    //   let columns=JSON.parse(res.result)
-    //   if(columns.length){
-    //     if(columns.length>=columnsFixd.length){
-    //         columns.map((item,index)=>{
-    //          if(index>columnsFixd.length-1){
-    //              item.sorter=function(a,b){  return a[item.dataIndex]-b[item.dataIndex]}
-    //          }})
-    //          columns=columns.slice(columnsFixd.length);
-    //         this.columns=[...columnsFixd,...columns]
+    postAction('/toutiao/videoReportDaily/getColumnJson', {
+      columnType:4,
+    }).then((res)=>{
+      // console.log(res)
+      if(res.success){
+      // console.log(JSON.parse(res.result))
+      let columns=JSON.parse(res.result)
+      if(columns.length){
+        if(columns.length>=columnsFixd.length){
+            columns.map((item,index)=>{
+             if(index>columnsFixd.length-1){
+                 item.sorter=function(a,b){  return a[item.dataIndex]-b[item.dataIndex]}
+             }})
+             columns=columns.slice(columnsFixd.length);
+            this.columns=[...columnsFixd,...columns]
             this.tableHandle()
-        // }
+        }
            
         
-    //     // console.log(this.columns)
-    //   }
+        // console.log(this.columns)
+      }
      
-    //   }
+      }
 
-    // })
+    })
   },
   deactivated() {
       let arr = JSON.stringify(this.columns)

+ 37 - 33
src/views/modules/Statistics/videoStatics/vSummary.vue

@@ -50,7 +50,7 @@
             <selectComponent :showCol="listNum" @getshowlist="getshowlist" :fixedColLength='columnsFixd.length' />
           </div>
         </div>
-        <div class=" listNum">
+        <div class="listNum">
           <p>已选{{listNum.length}}列</p>
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
@@ -84,7 +84,8 @@
       <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
       <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
-      <span slot="cpm" slot-scope="cpm">{{ cpm | toPercentage }}</span>
+      <span slot="cpc" slot-scope="cpm">{{ cpm | tofixed }}</span>
+      <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
       <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
       <span slot="installFinishRate" slot-scope="installFinishRate">{{ installFinishRate | toPercentage }}</span>
       <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
@@ -436,57 +437,60 @@
         }
       },
 
+      tableHandle() {
+        // this.listNum = [...this.columns]
+        console.log(this.listNum.length, this.columns)
+        this.scrollX = 0;
+        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
+          console.log('scroll==0')
+        }
+      },
+
       //弹出框确定
       handleOk(e) {
         this.loading = false
-        // this.columns = [...this.listNum]
+
         this.visible = false
 
-        // console.log(this.columns)
 
-        this.tableHandle()
 
-        if (this.listNum.length >= 10) {
+        let newlist = this.listNum.slice(columnsFixd.length)
+        console.log(newlist)
+        this.columns = [...columnsFixd, ...newlist]
 
-          let newlist = this.listNum.slice(columnsFixd.length)
-          console.log(newlist)
-          this.columns = [...columnsFixd, ...newlist]
-        } else {
-          this.columns = [...this.listNum]
-        }
 
+        // if (this.listNum.length == 4) {
+        //   //   // console.log(this.listNum.length)
+        //   this.columns.map((item, index) => {
+        //     item.width = 500
+        //   })
+        //   //   // console.log(1)
+        // } else {
 
         if (this.listNum.length == 4) {
-          //   // console.log(this.listNum.length)
+          // console.log(this.listNum.length)
+          this.scrollX = 0
           this.columns.map((item, index) => {
             item.width = 500
           })
-          //   // console.log(1)
+          // console.log(1)
         } else {
 
           this.columns.map((item, index) => {
-            item.width = 150
-            if (index <= 4) {
-              item.width = 120
+            if (index == 2 || index == 0) {
+              item.width = 150
+            } else if (index == 1 || index == 3) {
+              item.width = 100
             }
           })
+          // console.log(2)
+          //   }
         }
-        // if (this.listNum.length == 4) {
-        //   // console.log(this.listNum.length)
-        //   this.columns.map((item, index) => {
-        //     item.width = 500
-        //   })
-        //   // console.log(1)
-        // } else {
-        //   this.columns.map((item, index) => {
-        //     // if (index < 2) {
-        //     item.width = 300
-        //     // } else if (index >= 2 && index < 4) {
-        //     //   item.width = 100
-        //     // }
-        //   })
-        // console.log(2)
-        //   }
       },
       //弹出框取消按钮
       handleCancel(e) {

+ 7 - 5
src/views/modules/Statistics/videoStatics/vWeek.vue

@@ -43,7 +43,7 @@
           </div>
         </div>
         <div class="listNum">
-          <p>已选{{columns.length}}列</p>
+          <p>已选{{listNum.length}}列</p>
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
@@ -117,10 +117,11 @@
       <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
        <span slot="statDatetime" slot-scope="">{{ timedata[0]+'~'+timedata[1]}}</span>
 
-       <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
+      <span slot="convertRate" slot-scope="convertRate">{{ convertRate | toPercentage }}</span>
       <span slot="nextDayOpenRate" slot-scope="nextDayOpenRate">{{ nextDayOpenRate | toPercentage }}</span>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
-      <span slot="cpm" slot-scope="cpm">{{ cpm | toPercentage }}</span>
+      <span slot="cpc" slot-scope="cpm">{{ cpm | tofixed }}</span>
+      <span slot="cpm" slot-scope="cpm">{{ cpm | tofixed }}</span>
       <span slot="activeRate" slot-scope="activeRate">{{ activeRate | toPercentage }}</span>
       <span slot="installFinishRate" slot-scope="installFinishRate">{{ installFinishRate | toPercentage }}</span>
       <span slot="validPlayRate" slot-scope="validPlayRate">{{ validPlayRate | tofixed }}</span>
@@ -132,6 +133,7 @@
       <span slot="downloadFinishCost" slot-scope="downloadFinishCost">{{ downloadFinishCost | tofixed }}</span>
       <span slot="downloadStartCost" slot-scope="downloadStartCost">{{ downloadStartCost | tofixed }}</span>
       <span slot="installFinishCost" slot-scope="installFinishCost">{{ installFinishCost | tofixed }}</span>
+      <span slot="convertCost" slot-scope="convertCost">{{ convertCost | tofixed }}</span>
     </a-table>
     <!-- 明细表 -->
 
@@ -526,8 +528,8 @@ export default {
     tableHandle(){
       // this.listNum = [...this.columns]
       console.log(this.listNum.length,this.columns)
-
-      if(this.listNum.length > 12|| this.columns.length>12){
+      this.scrollX=0;
+      if(this.listNum.length >= 12|| this.columns.length>=12){
           this.tableWidth=120;
           this.scrollX=this.columns.length*140
           console.log(this.scrollX)