浏览代码

修改账户数据展示,时间段选择

zhuxinbo 5 年之前
父节点
当前提交
ad1b96428c
共有 3 个文件被更改,包括 161 次插入98 次删除
  1. 77 15
      src/views/modules/Statistics/dataDisplayStatistics.vue
  2. 82 81
      src/views/modules/test/Test.vue
  3. 2 2
      vue.config.js

+ 77 - 15
src/views/modules/Statistics/dataDisplayStatistics.vue

@@ -259,6 +259,7 @@ require('echarts/lib/component/graphic')
 require('echarts/lib/component/toolbox')
 require('echarts/lib/component/legend')
 var length = 0
+var active = 1
 const columns = [
   {
     title: '时间',
@@ -281,7 +282,46 @@ const columns = [
       return obj
     }
   },
-  { title: '账户名称', dataIndex: 'accountName', align: 'left' },
+  {
+    title: '账户Id',
+    dataIndex: 'accountId',
+    align: 'center',
+    customRender: function(text, record, index) {
+      const obj = {
+        children: text,
+        attrs: {}
+      }
+      if (active == 1) {
+        for (let i = 0; i < length; i++) {
+          if (index >= length - 3) {
+            obj.attrs.colSpan = 2
+          }
+        }
+      }
+      return obj
+    }
+  },
+  {
+    title: '账户名称',
+    dataIndex: 'accountName',
+    scopedSlots: { customRender: 'cost' },
+    align: 'center',
+    customRender: function(text, record, index) {
+      const obj = {
+        children: text,
+        attrs: {}
+      }
+      if (active == 1) {
+        for (let i = 0; i < length; i++) {
+          if (index >= length - 3) {
+            obj.attrs.colSpan = 0
+          }
+        }
+      }
+
+      return obj
+    }
+  },
   {
     title: '消耗',
     dataIndex: 'cost',
@@ -329,12 +369,12 @@ const columns = [
     align: 'center'
   },
   {
-    title: '表单提交数',
+    title: '转化数',
     dataIndex: 'formCount',
     align: 'center'
   },
   {
-    title: '表单提交单价',
+    title: '转化单价',
     dataIndex: 'formPrice',
     align: 'center'
   },
@@ -505,8 +545,8 @@ export default {
         params.type = that.active
         params.discount = that.discount
         if (that.active == 9) {
-          params.startDate = dateValue[0]
-          params.endDate = dateValue[1]
+          params.startDate = this.allValue[0]
+          params.endDate = this.allValue[1]
         }
 
         getReportList(params).then(res => {
@@ -534,8 +574,8 @@ export default {
       params.statHour = this.statHour
       params.discount = this.discount
       if (this.active == 9) {
-        params.startDate = dateValue[0]
-        params.endDate = dateValue[1]
+        params.startDate = this.allValue[0]
+        params.endDate = this.allValue[1]
       }
       this.data = []
       getStatistics(params).then(res => {
@@ -544,14 +584,18 @@ export default {
           return {
             key: index,
             ...item,
-            accountName: item.accountId,
             photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
             cpm: item.cpm ? '¥' + item.cpm.toFixed(2) : '¥' + 0,
             cost: '¥' + item.cost.toFixed(2),
             cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
             costY: '¥' + (item.cost / this.discount).toFixed(2),
-            formPrice: item.formPrice ? '¥' + (item.formPrice / this.discount).toFixed(2) : '¥' + 0,
-            date: this.statHour ? this.getDate() + '  ' + this.statHour : this.getDate()
+            formPrice: item.formPrice
+              ? '¥' + (item.formPrice / this.discount).toFixed(2)
+              : item.activationPrice
+              ? '¥' + (item.activationPrice / this.discount).toFixed(2)
+              : '¥' + 0,
+            date: this.statHour ? this.getDate() + '  ' + this.statHour : this.getDate(),
+            formCount: item.formCount > 0 ? item.formCount : item.activationCount
           }
         })
         var index = this.data.length
@@ -564,8 +608,13 @@ export default {
             cost: '¥' + res.now.cost.toFixed(2),
             cvr: res.now.cvr ? (res.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
             costY: '¥' + (res.now.cost / this.discount).toFixed(2),
-            accountName: '总计',
-            formPrice: res.now.formPrice ? '¥' + (res.now.formPrice / this.discount).toFixed(2) : '¥' + 0
+            accountId: '总计',
+            formPrice: res.now.formPrice
+              ? '¥' + (res.now.formPrice / this.discount).toFixed(2)
+              : res.now.activationPrice
+              ? '¥' + (res.now.activationPrice / this.discount).toFixed(2)
+              : '¥' + 0,
+            formCount: res.now.formCount > 0 ? res.now.formCount : res.now.activationCount
           }
           var allYesterday = {
             key: index + 2,
@@ -577,8 +626,13 @@ export default {
             cost: '¥' + res.yesterday.cost.toFixed(2),
             cvr: res.yesterday.cvr ? (res.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
             costY: '¥' + (res.yesterday.cost / this.discount).toFixed(2),
-            accountName: '昨日总计',
-            formPrice: res.yesterday.formPrice ? '¥' + (res.yesterday.formPrice / this.discount).toFixed(2) : '¥' + 0
+            accountId: '昨日总计',
+            formPrice: res.yesterday.formPrice
+              ? '¥' + (res.yesterday.formPrice / this.discount).toFixed(2)
+              : res.yesterday.activationPrice
+              ? '¥' + (res.yesterday.activationPrice / this.discount).toFixed(2)
+              : '¥' + 0,
+            formCount: res.yesterday.formCount > 0 ? res.yesterday.formCount : res.yesterday.activationCount
           }
           var chainRatio = {
             key: index + 3,
@@ -594,12 +648,16 @@ export default {
             bClick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
             formCount: res.chainRatio.formCountProportion
               ? (res.chainRatio.formCountProportion * 100).toFixed(2) + '%'
+              : res.chainRatio.activationCountProportion
+              ? (res.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
               : 0 + '%',
             formPrice: res.chainRatio.formPriceProportion
               ? (res.chainRatio.formPriceProportion * 100).toFixed(2) + '%'
+              : res.chainRatio.activationPriceProportion
+              ? (res.chainRatio.activationPriceProportion * 100).toFixed(2) + '%'
               : 0 + '%',
             costY: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-            accountName: '环比'
+            accountId: '环比'
           }
           this.data.push(allNow)
           this.data.push(allYesterday)
@@ -620,6 +678,7 @@ export default {
         this.allValue = []
       }
       this.active = checked
+      active = checked
       this.addUser(checked)
     },
     onTabChange(key, type) {
@@ -971,6 +1030,9 @@ export default {
         },
         {
           wpx: 100
+        },
+        {
+          wpx: 100
         }
       ] //单元格列宽
 

+ 82 - 81
src/views/modules/test/Test.vue

@@ -1,82 +1,83 @@
-<template>
-  <div>
-    <upload-to-ali
-      v-model="url"
-      :customDomain="OSS_CUSTOMDOMAIN()"
-      preview
-      :region="OSS_REGION()"
-      :bucket="OSS_BUCKET()"
-      :multiple="true"
-      :accept="OSS_ACCEPT()"
-      :size="102400"
-      :accessKeyId="OSS_ACCESSKEYID()"
-      :accessKeySecret="OSS_ACCESSKEYSECRET()"
-      :before-upload="file"
-      @loaded="overUpload"
-    ></upload-to-ali>
-  </div>
-</template>
-<script>
-import UploadToAli from '@femessage/upload-to-ali'
-import BMF from 'browser-md5-file'
-import { fileCheck,fileInsert } from '@/api/actor'
-export default {
-  data() {
-    return {
-      url: '',
-      accessKeyId: 'LTAIbNbqWzSOklQV',
-      accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
-      bucket: 'ctop-media',
-      region: 'oss-cn-beijing',
-      md5:""
-    }
-  },
-  components: {
-    UploadToAli
-  },
-  methods: {
-    OSS_CUSTOMDOMAIN() {
-      return ''
-    },
-    OSS_REGION() {
-      return this.region
-    },
-    OSS_BUCKET() {
-      return this.bucket
-    },
-    OSS_ACCESSKEYID() {
-      return this.accessKeyId
-    },
-    OSS_ACCESSKEYSECRET() {
-      return this.accessKeySecret
-    },
-    OSS_ACCEPT() {
-      return 'image/jpeg,image/png,video/mpeg,video/mp4'
-    },
-    file(file) {
-      var bmf = new BMF()
-      var that = this
-      return new Promise(function(resolve, reject) {
-        bmf.md5(file[0], (err, md5) => {
-          console.log(md5, 123123123)
-          that.md5 = md5
-          fileCheck({ code: md5 }).then(res => {
-            console.log(res)
-            if (res.code == 0) {
-              reject()
-            } else {
-              resolve()
-            }
-          })
-        })
-      })
-    },
-    overUpload(url){
-        // console.log(url,this.md5)
-        fileInsert({code:this.md5,url:url[0]}).then(res=>{
-            console.log(res)
-        })
-    }
-  }
-}
+<template>
+  <div>
+    <upload-to-ali
+      v-model="url"
+      :customDomain="OSS_CUSTOMDOMAIN()"
+      preview
+      :region="OSS_REGION()"
+      :bucket="OSS_BUCKET()"
+      :multiple="true"
+      :accept="OSS_ACCEPT()"
+      :size="102400"
+      :accessKeyId="OSS_ACCESSKEYID()"
+      :accessKeySecret="OSS_ACCESSKEYSECRET()"
+      :before-upload="file"
+      @loaded="overUpload"
+    ></upload-to-ali>
+  </div>
+</template>
+<script>
+import UploadToAli from '@femessage/upload-to-ali'
+import BMF from 'browser-md5-file'
+import { fileCheck, fileInsert } from '@/api/actor'
+export default {
+  data() {
+    return {
+      url: '',
+      accessKeyId: 'LTAIbNbqWzSOklQV',
+      accessKeySecret: '1rkPz7JNoXk8sJevPaeYHWqfkQXBGh',
+      bucket: 'ctop-media',
+      region: 'oss-cn-beijing',
+      md5: ''
+    }
+  },
+  components: {
+    UploadToAli
+  },
+  methods: {
+    OSS_CUSTOMDOMAIN() {
+      return ''
+    },
+    OSS_REGION() {
+      return this.region
+    },
+    OSS_BUCKET() {
+      return this.bucket
+    },
+    OSS_ACCESSKEYID() {
+      return this.accessKeyId
+    },
+    OSS_ACCESSKEYSECRET() {
+      return this.accessKeySecret
+    },
+    OSS_ACCEPT() {
+      return 'image/jpeg,image/png,video/mpeg,video/mp4'
+    },
+    file(file) {
+      console.log(file)
+      var bmf = new BMF()
+      var that = this
+      return new Promise(function(resolve, reject) {
+        bmf.md5(file[0], (err, md5) => {
+          console.log(md5, 123123123)
+          that.md5 = md5
+          fileCheck({ code: md5 }).then(res => {
+            console.log(res)
+            if (res.code == 0) {
+              reject()
+            } else {
+              resolve()
+            }
+          })
+        })
+      })
+    },
+    overUpload(url) {
+      // console.log(url,this.md5)
+      fileInsert({ code: this.md5, url: url[0] }).then(res => {
+        console.log(res)
+      })
+    }
+  }
+}
 </script>

+ 2 - 2
vue.config.js

@@ -65,8 +65,8 @@ module.exports = {
        },*/
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
-        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
-        // target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目
+        // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
         ws: false,
         changeOrigin: true