Преглед изворни кода

Merge branch 'master' of http://39.106.184.70:3000/ctop/adsp-vue

syh пре 5 година
родитељ
комит
ebd8cbbdeb

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

@@ -59,7 +59,14 @@ export default {
       default() {
         return '2'
       }
-    }
+    },
+    reqUrl: {
+        type: String,
+        default () {
+          return '/ctop/projectMember/participateList'
+        }
+
+      }
   },
   components: { Treeselect },
   watch: {
@@ -93,6 +100,7 @@ export default {
               }
             })
           } else {
+              
           }
         } else {
           new Error('Failed to load options: network error.')
@@ -132,7 +140,7 @@ export default {
     getParticipateList() {
       //我参与的
       //   toutiaoParticipateList
-      getAction('/ctop/projectMember/participateList', { userId: this.userInfo().id }).then(res => {
+      getAction(this.reqUrl, { userId: this.userInfo().id }).then(res => {
         if (res.code == 0) {
           var data = res.result.filter(item => {
             return item.mediaId == this.request

+ 7 - 5
src/views/modules/Statistics/materialRank.vue

@@ -26,7 +26,7 @@
         <a-button type='primary' @click="getData">查询</a-button>
       </div>
     </div>
-    <a-table :columns="columns" :data-source="dataSource" tableLayout='auto' bordered :pagination='false'>
+    <a-table :columns="columns" :data-source="dataSource" tableLayout='auto' bordered :pagination='false' :loading='loading'>
       <div slot="videoU" slot-scope="test,records">
         <img :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'" alt="" style="width:140px"
           @click="openVideo(records.url)">
@@ -51,6 +51,7 @@
   import moment from 'moment'
   import {
     getAction,
+    
     postAction,
     downFile,
     downFilePost
@@ -190,10 +191,11 @@
         pageShow: false,
 
 
-        //是否打开视频
-        Videovisible: false,
-        videoUrl: '',
-      }
+            loading:false,
+            //是否打开视频
+            Videovisible:false,
+            videoUrl:'',
+        }
     },
     methods: {
       moment,

+ 1 - 1
src/views/modules/Statistics/materialStatistics.vue

@@ -448,7 +448,7 @@ export default {
       })
     },
     dianji() {
-      this.$router.replace({ path: '/modules/Statistics/accountMaterStatistics' })
+      this.$router.replace({ path: '/Statistics/accountMaterStatistics' })
     }
   },
   watch: {},

+ 185 - 0
src/views/modules/Statistics/videoStatics/Treeselect.vue

@@ -0,0 +1,185 @@
+<style lang="scss" scoped>
+  .select-project {
+    width: 50%;
+  }
+</style>
+<template>
+  <div class="select-project">
+    <treeselect :options="options"
+     :multiple="multiple"
+      :disable-branch-nodes="!multiple"
+      :load-options="loadOptions"
+      placeholder="请选择项目以及账户"
+      v-model="value"
+      :value-consists-of="valueConsistsOf"
+      :auto-load-root-options="false"
+      @select="update"
+      @input="emitValue"
+      :limit="2"
+      :limitText="
+        count => {
+          return '隐藏' + count + '条'
+        }
+      "
+      noChildrenText="该项目下暂无账号"
+      noOptionsText="loading..."
+    >
+      <div slot="value-label" slot-scope="{ node }">{{ node.raw.customLabel }}</div>
+    </treeselect>
+
+     <!-- <treeselect :options="options" @input="emitValue" placeholder="请选择项目以及账户" v-model="value" :multiple="multiple"  noOptionsText="loading..."  :limit="2"
+      :limitText="
+        count => {
+          return '隐藏' + count + '条'
+        }
+      ">
+  </treeselect> -->
+  </div>
+</template>
+
+<script>
+  // import the component
+  import Treeselect from '@riophae/vue-treeselect'
+  // import the styles
+  import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+  import {
+    LOAD_CHILDREN_OPTIONS
+  } from '@riophae/vue-treeselect'
+
+  import {
+    getAction,
+    postAction
+  } from '@/api/manage'
+  import {
+    mapGetters
+  } from 'vuex'
+  // We just use `setTimeout()` here to simulate an async operation
+  // instead of requesting a real API server for demo purpose.
+  let called = false
+  export default {
+    data: () => ({
+      multiple: true,
+      value: null,
+      options: [],
+      valueConsistsOf: 'LEAF_PRIORITY',
+     
+    }),
+     props: {
+    // multiple: {
+    //   type: Boolean,
+    //   default() {
+    //     return true
+    //   }
+    // },
+    appId: {},
+    // request: {
+    //   type: String,
+    //   default() {
+    //     return '2'
+    //   }
+    // },
+    reqUrl: {
+        type: String,
+        default () {
+          return '/ctop/projectMember/participateList'
+        }
+
+      }
+  },
+    components: {
+      Treeselect
+    },
+    watch: {
+      $route(n, o) {},
+      appId: {
+        handler(n, o) {
+          console.log(n)
+          if (n.length == 0) {
+            if (this.multiple) {
+              this.value = []
+            } else {
+              this.value = ''
+            }
+          }
+        },
+        deep: true
+      }
+    },
+    methods: {
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      emitValue() {
+          console.log(this.value)
+        this.$emit('update:appId', this.value)
+      },
+
+    update(node, id) {
+
+      getAction('/ctop/projectMember/bytedanceProjectParticipateInList', { projectId: node.id }).then(res => {
+        console.log(res)
+        if (res.code == 0) {
+          if (res.result.length > 0) {
+            node.children = res.result.map(item => {
+              return {
+                id: item.accountId,
+                label: item.userName + '         ' + item.authName
+              }
+            })
+          } else {
+              
+          }
+        } else {
+          new Error('Failed to load options: network error.')
+        }
+      })
+    },
+      getChildren() {},
+      getParticipateList() {
+        //我参与的
+        //   toutiaoParticipateList
+        getAction('/ctop/projectMember/bytedanceProjectParticipateInList').then(res => {
+          if (res.code == 0) {
+            this.options = res.result.map(item => {
+              return {
+                id: item.id,
+                label: item.projectName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item
+                  .advertiserName
+              }
+            })
+          }
+        })
+      },
+
+      loadOptions({ action, parentNode, callback }) {
+        console.log({ action, parentNode, callback })
+      // Typically, do the AJAX stuff here.
+      // Once the server has responded,
+      // assign children options to the parent node & call the callback.
+      if (action === LOAD_CHILDREN_OPTIONS) {
+        getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: parentNode.id }).then(res => {
+          console.log(res)
+          if (res.code == 0) {
+            if (res.result.length > 0) {
+              parentNode.children = res.result.map(item => {
+                return {
+                  id: item.accountId,
+                  label: item.userName + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + item.authName
+                }
+              })
+              callback()
+            } else {
+              parentNode.children = []
+              callback()
+            }
+          } else {
+            callback(new Error('Failed to load options: network error.'))
+          }
+        })
+      }
+    },
+    },
+
+    activated() {
+      this.getParticipateList()
+    }
+  }
+</script>

+ 62 - 25
src/views/modules/Statistics/videoStatics/vDay.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="vsummary">
-    <!-- <div class="xiangmuxuanze">
+    <div class="xiangmuxuanze">
       <span>项目选择:</span>
-        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
-          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
-            {{ item }}
-          </a-select-option>
-        </a-select>
-    </div> -->
+       <Treeselect  :appId.sync="appId"  style="display: inline-block;position: relative;top: 10px;"/>
+    </div>
     <div class="timeDiv">
       <div>
         <span >时间范围:</span>
@@ -53,11 +49,11 @@
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
-              <span v-if=" index <5">
+              <span v-if=" index <4">
                 <a-icon type="lock" />
                 <span class="listText">{{item.title}}</span>
               </span>
-              <span v-else-if=" index >4">
+              <span v-else-if=" index >=4">
                 <a-icon type="menu" style="color:#ccc" />
                 <span class="listText">{{item.title}}</span>
                 <a-icon
@@ -88,7 +84,7 @@
       
     >
       <div slot="videoU" slot-scope="test,records">
-        <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt=""  style="width:140px"  @click="openVideo(records.url)">
+        <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt=""  style="width:140px"  @click="openVideo(records.url)" @load="loadShow">
 
       </div>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
@@ -152,7 +148,7 @@ import moment from 'moment'
 import { JeecgListMixin } from '@/mixins/ipagination'
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
 import selectComponent from './selectComponent'
-
+import Treeselect from './Treeselect.vue'
 const columnsFixd = [
   {
     title: '时间',
@@ -257,10 +253,11 @@ let variableCol = [
     sorter: (a, b) => a.convertRate - b.convertRate
   }
 ]
-
+let show = 0
 export default {
   data() {
     return {
+        roleCode: localStorage.getItem('roleCode'),
       //下拉选择框的数据
       projectArr:[],
       selectValue:'',
@@ -298,17 +295,37 @@ export default {
       listNum: [],
 
       //
-      timedata: []
+      timedata: [],
+      appId:[]
 
       //
     }
   },
   components: {
-    selectComponent
+    selectComponent,
+    Treeselect
+  },
+   watch:{
+      'ipagination.current':function(n,o){
+          console.log(n,o)
+          if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+            this.HttpPost()
+          }
+          
+      }
   },
   mixins: [JeecgListMixin],
   methods: {
     moment,
+    loadShow(){
+        show++
+        console.log(show)
+        if(this.data.length>0){
+            if(show == (this.data.length*2)){
+                this.data = [...this.data]
+            }
+        }
+    },
     //select切换---项目
     selectChange(key){
         this.selectValue=key;
@@ -343,34 +360,50 @@ export default {
       this.timedata=moment(yesterday).format('YYYY-MM-DD')
       // this.totalSelect = 1
       // this.daysFlag = true
-      this.HttpPost();
+      if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
+      
     },
     //table数据查询时间
     HttpPost(){
       this.loading = true
       this.date = []
+      show = 0
       postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListDaily', {
         date: this.timedata,
         cost: this.consumeValue,
-        signature:this.videoID
+        signature:this.videoID,
+        pageNo:this.ipagination.current,
+        pageSize:this.ipagination.pageSize,
+        projectIds:this.appId
       }).then(res => {
         let resArr = []
         this.loading = false
         console.log(res)
         if (res.success) {
           let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
+          this.data = result.list.map((item,index)=>{
+              return {
+                  ...item,
+                  key:index
+              }
           })
-          this.data = result
+          this.ipagination.total = result.total
         }
       })
     },
     //查询按钮
     searchRes() {
       console.log(this.timedata[0])
-      this.HttpPost();
+      if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
+      
     },
 
    
@@ -415,7 +448,7 @@ export default {
       }
 
       // console.log(this.columns.length)
-      if (this.columns.length == 4) {
+      if (this.columns.length == 3) {
         // console.log(this.listNum.length)
         this.columns.map((item, index) => {
           item.width = 500
@@ -423,9 +456,9 @@ export default {
         // console.log(1)
       } else {
         this.columns.map((item, index) => {
-          if (index == 1||index==3) {
+          if (index == 1||index==2) {
             item.width = 150
-          } else if (index >= 2 && index < 5 || index == 0) {
+          } else if (index >= 2 && index < 4 || index == 0) {
             item.width = 100
           }
         })
@@ -536,7 +569,11 @@ export default {
   mounted() {
       this.dateRange=moment().subtract(1,'days')  
       this.timedata=moment().subtract(1,'days').format('YYYY-MM-DD')
-      this.HttpPost();
+    if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
   },
 
 }

+ 61 - 25
src/views/modules/Statistics/videoStatics/vMonth.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="vsummary">
-    <!-- <div class="xiangmuxuanze">
+    <div class="xiangmuxuanze">
       <span>项目选择:</span>
-        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
-          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
-            {{ item }}
-          </a-select-option>
-        </a-select>
-    </div> -->
+       <Treeselect  :appId.sync="appId"  style="display: inline-block;position: relative;top: 10px;"/>
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -55,11 +51,11 @@
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
-              <span v-if=" index <6">
+              <span v-if=" index <5">
                 <a-icon type="lock" />
                 <span class="listText">{{item.title}}</span>
               </span>
-              <span v-else-if=" index >5">
+              <span v-else-if=" index >=5">
                 <a-icon type="menu" style="color:#ccc" />
                 <span class="listText">{{item.title}}</span>
                 <a-icon
@@ -96,7 +92,7 @@
       </span>
 
       <div slot="videoU" slot-scope="test,records">
-        <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt="" style="width:140px" @click="openVideo(records.url)">
+        <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt="" style="width:140px" @click="openVideo(records.url)" @load="loadShow">
       </div>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
       <span
@@ -177,6 +173,7 @@ import moment from 'moment'
 import { JeecgListMixin } from '@/mixins/ipagination'
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
 import selectComponent from './selectComponent'
+import Treeselect from './Treeselect.vue'
 const columnsFixd = [
   {
     title: '时间',
@@ -290,7 +287,7 @@ let variableCol = [
   }
 ]
 let length=0
-
+let show=0
 let detailConsum = [
   {
     title: '客户',
@@ -353,6 +350,7 @@ let detailConsum = [
 export default {
   data() {
     return {
+        roleCode: localStorage.getItem('roleCode'),
        //下拉选择框的数据
       projectArr:[],
       selectValue:'',
@@ -399,16 +397,27 @@ export default {
       timedata: [],
 
       //记录点开的视频的md5
-      signature:null
+      signature:null,
+      appId:[]
     }
   },
   components: {
-    selectComponent
+    selectComponent,
+    Treeselect
   },
   props: {
     text: String
   },
   mixins: [JeecgListMixin],
+  watch:{
+      'ipagination.current':function(n,o){
+          console.log(n,o)
+           if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+            this.HttpPost()
+          }
+          
+      }
+  },
   methods: {
     moment,
     //select切换---项目
@@ -446,8 +455,12 @@ export default {
       this.totalSelect = (this.dateRange[1]._d - this.dateRange[0]._d) / (24 * 60 * 60 * 1000) + 1;
       this.timedata=[this.dateRange[0]._i,this.dateRange[1]._i]
       this.daysFlag = true
-     this.HttpPost();
-
+       if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+          this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
+     
     },
 
     consumeOnChange() {},
@@ -455,29 +468,40 @@ export default {
     HttpPost(){
       this.loading=true;
       this.date=[];
+      show = 0
        postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListMonth', {
         startDate: this.timedata[0],
         endDate: this.timedata[1],
         cost: this.consumeValue,
-        signature: this.videoID
+        signature: this.videoID,
+        pageNo:this.ipagination.current,
+        pageSize:this.ipagination.pageSize,
+        projectIds:this.appId
       }).then(res => {
         let resArr = []
         this.loading = false
         console.log(res)
         if (res.success) {
           let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
+         this.data = result.list.map((item,index)=>{
+              return {
+                  ...item,
+                  key:index
+              }
           })
-          this.data = result;
+          this.ipagination.total = result.total
           
         }
       })
     },
     //查询按钮
     searchRes() {
-      this.HttpPost();      
+         if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+            this.HttpPost(); 
+        }else{
+            this.$message.error('请选择项目')
+        }
+           
     },
 
     //导出报表
@@ -546,7 +570,14 @@ export default {
         this.scrollX = 0
       }
     },
-
+    loadShow(){
+        show++
+        if(this.data.length>0){
+            if(show == (this.data.length*2)){
+                this.data = [...this.data]
+            }
+        }
+    },
     //弹出框确定
     handleOk(e) {
       this.loading = false
@@ -564,7 +595,7 @@ export default {
 
       
 
-      if (this.listNum.length == 6) {
+      if (this.listNum.length == 5) {
         this.columns.map((item, index) => {
           item.width = 300
         })
@@ -572,7 +603,7 @@ export default {
         this.columns.map((item, index) => {
           if (index == 1||index==3) {
             item.width = 150
-          } else if (index >= 2 && index < 6 || index == 0) {
+          } else if (index >= 2 && index < 5 || index == 0) {
             item.width = 100
           }
         })
@@ -734,7 +765,12 @@ export default {
       this.totalSelect = (this.dateRange[1]._d - this.dateRange[0]._d) / (24 * 60 * 60 * 1000) + 1;
       this.timedata=[this.dateRange[0]._i,this.dateRange[1]._i]
       this.daysFlag = true
-    this.HttpPost();
+      if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
+
   },
 }
 </script>

+ 73 - 27
src/views/modules/Statistics/videoStatics/vSummary.vue

@@ -1,13 +1,17 @@
 <template>
   <div class="vsummary">
-    <!-- <div class="xiangmuxuanze">
+    <div class="xiangmuxuanze">
       <span>项目选择:</span>
-        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
-          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
-            {{ item }}
-          </a-select-option>
-        </a-select>
-    </div> -->
+       <Treeselect  :appId.sync="appId"  style="display: inline-block;position: relative;top: 10px;"/>
+       <!-- <a-tree-select style="width: 60%"
+       v-model="value"
+      :tree-data="treeData"
+      tree-checkable
+      :show-checked-strategy="SHOW_PARENT"
+      search-placeholder="Please select">
+
+       </a-tree-select> -->
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -60,11 +64,11 @@
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
-              <span v-if=" index <4">
+              <span v-if=" index <3">
                 <a-icon type="lock" />
                 <span class="listText">{{item.title}}</span>
               </span>
-              <span v-else-if=" index >3">
+              <span v-else-if=" index >=3">
                 <a-icon type="menu" style="color:#ccc" />
                 <span class="listText">{{item.title}}</span>
                 <a-icon
@@ -100,6 +104,7 @@
           alt
           style="width:140px"
           @click="openVideo(records.url)"
+          @load="loadShow"
         />
       </div>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
@@ -182,7 +187,7 @@ import moment from 'moment'
 import { JeecgListMixin } from '@/mixins/ipagination'
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
 import selectComponent from './selectComponent'
-
+import Treeselect from './Treeselect.vue'
 const columnsFixd = [
   {
     title: '视频',
@@ -200,7 +205,6 @@ const columnsFixd = [
     width: 100,
     fixed: 'left'
   },
-
   {
     title: '视频描述',
     dataIndex: 'materialDesc',
@@ -277,13 +281,16 @@ let variableCol = [
     sorter: (a, b) => a.convertRate - b.convertRate
   }
 ]
+let show = 0
 
 export default {
   data() {
     return {
+      roleCode: localStorage.getItem('roleCode'),
        //下拉选择框的数据
       projectArr:[],
       selectValue:'',
+      appId:[],
       //设置表格的列宽
       tableWidth: '',
 
@@ -320,7 +327,8 @@ export default {
   },
   mixins: [JeecgListMixin],
   components: {
-    selectComponent
+    selectComponent,
+    Treeselect
   },
   methods: {
     moment,
@@ -347,28 +355,45 @@ export default {
     //查询按钮
     searchRes() {
       this.date = []
-      this.loading = true
-      this.HttpPost();
+      if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
+      
     },
     //网络请求table数据函数
     HttpPost(){
-      
+      this.loading=true;
+      show = 0
       postAction('/toutiao/videoReportDaily/videoInfoListTotal', {
         startDate: this.timedata[0],
         endDate: this.timedata[1],
         cost: this.consumeValue,
-        signature: this.videoID
+        signature: this.videoID,
+        pageNo:this.ipagination.current,
+        pageSize:this.ipagination.pageSize,
+        projectIds:this.appId
       }).then(res => {
         let resArr = []
-        this.loading = false
-        console.log(res)
+        
         if (res.success) {
-          let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
+        //   let result = res.result
+        //   this.data.push({ ...result, key: 1 })
+        //   result.map((item, index) => {
+        //     item.key = index
+        //   })
+          this.data = res.result.list.map((item,index)=>{
+              return {
+                  ...item,
+                  key:index
+              }
           })
-          this.data = result
+          this.ipagination.total = res.result.total
+          this.loading = false
+          
+        }else{
+            this.loading = false
         }
       })
     },
@@ -466,7 +491,7 @@ export default {
         this.columns = [...this.listNum]
       }
 
-      if (this.listNum.length == 4) {
+      if (this.listNum.length == 3) {
         // console.log(this.listNum.length)
         this.scrollX = 0
         this.columns.map((item, index) => {
@@ -477,7 +502,7 @@ export default {
         this.columns.map((item, index) => {
           if (index == 2 || index == 0) {
             item.width = 150
-          } else if (index == 1 || index == 3) {
+          } else if (index == 1 || index == 2) {
             item.width = 100
           }
         })
@@ -490,6 +515,14 @@ export default {
     handleCancel(e) {
       this.visible = false
     },
+    loadShow(){
+        show++
+        if(this.data.length>0){
+            if(show == (this.data.length*2)){
+                this.data = [...this.data]
+            }
+        }
+    },
     //弹出框里的搜索框
     onSearch(value) {
       console.log(value)
@@ -566,6 +599,15 @@ export default {
       }
     }
   },
+  watch:{
+      'ipagination.current':function(n,o){
+          console.log(n,o)
+          if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+            this.HttpPost()
+          }
+          
+      }
+  },
   activated() {
     console.log('activated')
     // this.getParticipateList()
@@ -643,8 +685,12 @@ export default {
     //进入页面默认展示昨天到今天的数据
     this.dateRange=[moment().subtract(1,'days'),moment()]
     this.timedata=[moment().subtract(1,'days').format('YYYY-MM-DD'),moment().format('YYYY-MM-DD')]
-    this.loading=true;
-    this.HttpPost();
+    // this.loading=true;
+    if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
     
   }
 }

+ 63 - 23
src/views/modules/Statistics/videoStatics/vWeek.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="vsummary">
-    <!-- <div class="xiangmuxuanze">
+    <div class="xiangmuxuanze">
       <span>项目选择:</span>
-        <a-select  default-value="" style="width: 500px" @change="selectChange"  placeholder="请选择项目账户">
-          <a-select-option v-for="(item,index) in projectArr" :key="index" :value='item.id'>
-            {{ item }}
-          </a-select-option>
-        </a-select>
-    </div> -->
+       <Treeselect  :appId.sync="appId"  style="display: inline-block;position: relative;top: 10px;"/>
+    </div>
     <div class="timeDiv">
       <div>
         <span>时间范围:</span>
@@ -55,11 +51,11 @@
           <a-button id="btn" type="link" @click="clearAllList">清空全部</a-button>
           <ul class="selectlist">
             <li v-for="(item,index) in listNum" :key="index">
-              <span v-if=" index <6">
+              <span v-if=" index <5">
                 <a-icon type="lock" />
                 <span class="listText">{{item.title}}</span>
               </span>
-              <span v-else-if=" index >5">
+              <span v-else-if=" index >=5">
                 <a-icon type="menu" style="color:#ccc" />
                 <span class="listText">{{item.title}}</span>
                 <a-icon
@@ -96,7 +92,7 @@
       </span>
 
       <div slot="videoU" slot-scope="test,records">
-       <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt="" style="width:140px" @click="openVideo(records.url)">
+       <img  :src="records.url+'?x-oss-process=video/snapshot,t_0,m_fast'"  alt="" style="width:140px" @click="openVideo(records.url)"  @load="loadShow">
       </div>
       <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
       <span
@@ -177,6 +173,7 @@ import moment from 'moment'
 import { JeecgListMixin } from '@/mixins/ipagination'
 import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
 import selectComponent from './selectComponent'
+import Treeselect from './Treeselect.vue'
 const columnsFixd = [
   {
     title: '时间',
@@ -345,9 +342,11 @@ let detailConsum = [
     align: 'center'
   }
 ]
+let show = 0
 export default {
   data() {
     return {
+        roleCode: localStorage.getItem('roleCode'),
        //下拉选择框的数据
       projectArr:[],
       selectValue:'',
@@ -392,11 +391,24 @@ export default {
       timedata: [],
 
       //记录点开的视频的md5
-      signature:''
+      signature:'',
+      appId:[]
     }
   },
+     watch:{
+      'ipagination.current':function(n,o){
+          console.log(n,o)
+         
+          if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+            this.HttpPost()
+          }
+          
+      }
+  },
   components: {
-    selectComponent
+    selectComponent,
+    Treeselect
+    
   },
   props: {
     text: String
@@ -404,6 +416,14 @@ export default {
   mixins: [JeecgListMixin],
   methods: {
     moment,
+    loadShow(){
+        show++
+        if(this.data.length>0){
+            if(show == (this.data.length*2)){
+                this.data = [...this.data]
+            }
+        }
+    },
     //select切换---项目
     selectChange(key){
         this.selectValue=key;
@@ -436,7 +456,12 @@ export default {
       this.totalSelect = 7
       this.daysFlag = true
       this.timedata=[moment(this.dateRange[0]).format('YYYY-MM-DD'),moment(this.dateRange[1]).format('YYYY-MM-DD')]
-      this.HttpPost();
+      
+          if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
 
     },
 
@@ -445,28 +470,38 @@ export default {
     HttpPost(){
       this.date = []
       this.loading = true
+      show = 0
       postAction('/toutiao/videoReportDaily/bytedanceVideoInfoListWeek', {
         startDate: this.timedata[0],
         endDate: this.timedata[1],
         cost: this.consumeValue,
-        signature: this.videoID
+        signature: this.videoID,
+         pageNo:this.ipagination.current,
+        pageSize:this.ipagination.pageSize,
+        projectIds:this.appId
       }).then(res => {
         let resArr = []
         this.loading = false
-        console.log(res)
         if (res.success) {
           let result = res.result
-          this.data.push({ ...result, key: 1 })
-          result.map((item, index) => {
-            item.key = index
+          this.data = result.list.map((item,index)=>{
+              return {
+                  ...item,
+                  key:index
+              }
           })
-          this.data = result
+          this.ipagination.total = result.total
         }
       })
     },
     //查询按钮
     searchRes() {
-      this.HttpPost();
+      
+      if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
     },
 
     //导出报表
@@ -551,7 +586,7 @@ export default {
       }
 
 
-      if (this.listNum.length == 6) {
+      if (this.listNum.length == 5) {
         this.columns.map((item, index) => {
           item.width = 300
         })
@@ -559,7 +594,7 @@ export default {
         this.columns.map((item, index) => {
           if (index == 1||index==3) {
             item.width = 150
-          } else if (index >= 2 && index < 6 || index == 0) {
+          } else if (index >= 2 && index < 5 || index == 0) {
             item.width = 100
           }
         })
@@ -709,7 +744,12 @@ export default {
     }
   },
   mounted() {
-    this.lastWeekHandle();
+    // this.lastWeekHandle();
+    if(this.appId.length>0||this.roleCode=='admin'||this.roleCode=='plane'||this.roleCode=='plan'||this.roleCode=='shot'||this.roleCode=='clip'||this.roleCode=='designTeamLeader'||this.roleCode=='planeLeader'){
+        this.HttpPost();
+      }else{
+          this.$message.error('请选择项目')
+      }
   },
 }
 </script>

+ 2 - 0
src/views/modules/advertiser/ProjectList.vue

@@ -9,6 +9,7 @@
               <a-input placeholder="请输入项目名称" v-model="queryParam.projectName"></a-input>
             </a-form-item>
           </a-col>
+           
           <a-col :md="6" :sm="8">
             <a-form-item label="广告主名称">
               <a-input placeholder="请输入广告主名称" v-model="queryParam.advertiserName"></a-input>
@@ -109,6 +110,7 @@
             align: 'center',
             dataIndex: 'projectName'
           },
+          
           {
             title: '广告主名称',
             align: 'center',

+ 3 - 1
src/views/modules/advertiser/ProjectMemberList.vue

@@ -39,7 +39,7 @@
       <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
         :pagination="ipagination" :loading="loading">
         <span slot="maxBid" slot-scope="maxBid">{{ maxBid / 1000 }}</span>
-        <span slot="mediaId" slot-scope="mediaId">{{ mediaId == 1 ? '头条' : '快手' }}</span>
+        <span slot="mediaId" slot-scope="mediaId">{{ mediaId == 1 ? '头条' :mediaId == 2? '快手':mediaId == 3?'头条内广':'快手内广' }}</span>
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">{{ noTitleKey == 'myProject' ? '查看成员' : '账号绑定' }}</a>
           <a-divider type="vertical" />
@@ -580,6 +580,8 @@
           this.projectId = item.id
           this.getMemberList(item.id)
         } else {
+            console.log(item)
+            this.mode = 'authorization'
           this.loginType = item.mediaId == '1' ? 'bytedance' : 'kuaishou'
           this.record = item
           this.visibleBind = true

+ 24 - 3
src/views/modules/advertiser/modules/ProjectModal.vue

@@ -14,11 +14,26 @@
           <a-radio-group @change="onChange" v-model="model.mediaId">
             <a-radio-button value="1">头条</a-radio-button>
             <a-radio-button value="2">快手</a-radio-button>
+            <a-radio-button value="3">头条内广</a-radio-button>
+            <a-radio-button value="4">快手内广</a-radio-button>
           </a-radio-group>
         </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="项目名称">
           <a-input placeholder="请输入项目名称" v-decorator="['projectName', validatorRules.projectName]" />
         </a-form-item>
+        
+        <a-form-item label="行业" :labelCol="labelCol" :wrapperCol="wrapperCol">
+          <j-tree-select 
+            ref="treeSelect"
+            placeholder="请选择行业"
+            dict="sys_category,name,id"
+            pidField="pid"
+            pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
+            v-decorator="['industryId', validatorRules.industryId]"
+           
+          >
+          </j-tree-select>
+        </a-form-item>
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="广告主名称">
           <a-select
             @change="handleChange"
@@ -116,13 +131,14 @@ import pick from 'lodash.pick'
 import moment from 'moment'
 import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
 import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
-
+import JTreeSelect from '@/components/jeecg/JTreeSelect'
 import { mapGetters } from 'vuex'
 export default {
   name: 'ProjectModal',
   components: {
     JSelectUserByDep,
-    JSelectDepart
+    JSelectDepart,
+    JTreeSelect
   },
   data() {
     return {
@@ -137,11 +153,12 @@ export default {
         xs: { span: 24 },
         sm: { span: 16 }
       },
-
+      industryId:'',
       confirmLoading: false,
       form: this.$form.createForm(this),
       validatorRules: {
         projectName: { rules: [{ required: true, message: '请输入项目名称!' }] },
+        industryId: { rules: [{ required: true, message: '请选择行业!' }] },
         advertiserId: { rules: [{ required: true, message: '请选择广告主!' }] },
         responsibleName: { rules: [{ required: true, message: '请选择负责人!' }] },
         maxBid: { rules: [{ required: true, message: '请输入最高出价!' }, { validator: this.validateInputCode }] },
@@ -190,7 +207,9 @@ export default {
       getAction(this.url.getList, { userId: this.userInfo().id })
         .then(res => {
           if (res.success) {
+            console.log(res)
             this.list = res.result.records
+            
           } else {
             this.$message.warning(res.message)
           }
@@ -216,10 +235,12 @@ export default {
       this.model.maxDeepCpaBid = this.model.maxDeepCpaBid ? this.model.maxDeepCpaBid / 1000 : 0
       this.visible = true
       this.$nextTick(() => {
+        console.log(this.model)
         this.form.setFieldsValue(
           pick(
             this.model,
             'projectName',
+            'industryId',
             'advertiserId',
             'responsibleName',
             'maxBid',

+ 2 - 2
vue.config.js

@@ -64,13 +64,13 @@ 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:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // 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.54:8080', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.1.165:8080', //请求本地 需要jeecg-boot后台项目  毕洁泉
         ws: false,
         changeOrigin: true