Pārlūkot izejas kodu

'改人群分析'

魏志佳 4 gadi atpakaļ
vecāks
revīzija
860ad60bb3

+ 5 - 2
src/views/modules/Statistics/components/Treeselect.vue

@@ -183,7 +183,8 @@ export default {
         postAction(this.reqUrl, params).then((res) => {
           if (res.success) {
             this.options = res.result.map((item) => {
-              return {
+              
+                return {
                 id: item.projectId + 'projectId',
                 label: item.projectName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.advertiserName,
                 children: item.accountList
@@ -203,7 +204,9 @@ export default {
                       }
                     })
                   : [],
-              }
+                }
+              
+              
             })
             if (this.oneData) {
               var data = this.options.filter((item) => {

+ 92 - 16
src/views/modules/kuaishouapp/populationAnalysis/index.vue

@@ -271,6 +271,67 @@ const regionColumns = [
   //   },
 ]
 
+const province =[
+  {
+    title: '省份',
+    dataIndex: 'province',
+    key: 'province',
+    align: 'center',
+    scopedSlots: { customRender: 'province' },
+   
+  },
+]
+const city =[
+  {
+    title: '城市',
+    dataIndex: 'city',
+    key: 'city',
+    align: 'center',
+    scopedSlots: { customRender: 'city' },
+    
+  },
+]
+const ageSegment =[
+  {
+    title: '年龄',
+    dataIndex: 'ageSegment',
+    key: 'ageSegment',
+    align: 'center',
+    scopedSlots: { customRender: 'ageSegment' },
+    
+  },
+]
+const gender =[
+  {
+    title: '性别',
+    dataIndex: 'gender',
+    key: 'gender',
+    align: 'center',
+    scopedSlots: { customRender: 'gender' },
+   
+  },
+]
+const businessInterestTags =[
+  {
+    title: '商业兴趣',
+    dataIndex: 'businessInterestTags',
+    key: 'businessInterestTags',
+    align: 'center',
+    scopedSlots: { customRender: 'businessInterestTags' },
+    
+  }
+]
+const client =[
+  {
+    title: '系统',
+    dataIndex: 'client',
+    key: 'client',
+    align: 'center',
+    scopedSlots: { customRender: 'client' },
+    
+  },
+]
+
 export default {
   components: {
     Treeselect,
@@ -311,11 +372,11 @@ export default {
       accountList: [],
       directionalId: undefined,
       value: 1,
-      columns: regionColumns,
+      columns: [...province,...regionColumns],
       tableData: [],
       dateRange: [moment().subtract(2, 'day'), moment().subtract(2, 'day')],
       topOption: JSON.parse(JSON.stringify(option)),
-      scrollX: 2500,
+      scrollX: 0,
       materialipagination: {
         current: 1,
         pageSize: 10,
@@ -362,13 +423,22 @@ export default {
     },
     tableTypeChange(e) {
       //   console.log('radio checked', e.target.value)
-      //   if (e.target.value == 2) {
-      //     this.columns = [...sexColumns, ...publicColumns]
-      //   } else if (e.target.value == 1) {
-      //     this.columns = [...regionColumns, ...publicColumns]
-      //   } else if (e.target.value == 3) {
-      //     this.columns = [...ageColumns, ...publicColumns]
-      //   }
+        if (e.target.value == 'province') {
+          this.columns = [...province, ...regionColumns]
+        } else if (e.target.value == 'city') {
+          this.columns = [...city, ...regionColumns]
+        } else if (e.target.value == 'gender') {
+          this.columns = [...gender, ...regionColumns]
+        }
+         else if (e.target.value == 'ageSegment') {
+          this.columns = [...ageSegment, ...regionColumns]
+        }
+         else if (e.target.value == 'clientId') {
+          this.columns = [...client, ...regionColumns]
+        }
+         else if (e.target.value == 'businessInterestTags') {
+          this.columns = [...businessInterestTags, ...regionColumns]
+        }
       this.ipagination.current = 1
       this.getDetailTableData()
     },
@@ -926,9 +996,11 @@ export default {
     },
 
     getRelativeData() {
-      this.spinning = true
+      
       let params = this.handlerParams()
       // params.dataType=this.tableValue
+      if(params.accountIds){
+      this.spinning = true
       getAction('/audienceReport/queryAllReportForm', params).then((res) => {
         console.log(res)
         this.spinning = false
@@ -961,6 +1033,8 @@ export default {
           this.initEchart('systemEchart', this.handlerSystemOption(this.systemData))
         }
       })
+      
+      }
     },
     getTableData() {
       
@@ -1002,12 +1076,14 @@ export default {
       } else {
         params.accountIds ='';
         this.accountIds.forEach((item,index)=>{
-          if(index!=this.accountIds.length-1){
-            params.accountIds+=`${item},`
-          }else{
-            params.accountIds+=`${item}`
-          }
           
+            if(index!=this.accountIds.length-1){
+              params.accountIds+=`${item},`
+            }else{
+              params.accountIds+=`${item}`
+            }
+          
+
         })
       }
 
@@ -1150,7 +1226,7 @@ export default {
       }
     },
   },
-  mou
+  
 }
 </script>