魏志佳 5 роки тому
батько
коміт
dea4e0cc50

+ 1 - 0
src/components/DatePicker.vue

@@ -182,6 +182,7 @@ export default {
     border-right: 1px solid #999;
     box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
     cursor: pointer;
+    z-index: 3;
     div {
       height: 43px;
       padding: 10px 15px;

Різницю між файлами не показано, бо вона завелика
+ 560 - 144
src/views/modules/Statistics/accountReport.vue


+ 10 - 10
src/views/modules/Statistics/components/customColumn.vue

@@ -14,7 +14,7 @@
             <selectComponent
               :showCol="mylistNum"
               @getshowlist="getshowlist"
-              :fixedColLength="fiexColumn.length"
+              :fixedCol="fiexColumn"
             />
           </div>
         </div>
@@ -46,7 +46,7 @@
 </template>
 
 <script>
-import selectComponent from '../videoStatics/selectComponent'
+import selectComponent from './selectComponent'
 export default {
   components: {
     selectComponent
@@ -114,37 +114,37 @@ export default {
             }
           })
 
-          this.listNum = [...this.listNum, ...newArr]
+          this.mylistNum = [...this.mylistNum, ...newArr]
         } else {
           //取消全选  清楚listNum中的val里的值
           val.arr.map((item, index) => {
-            var result = this.listNum.some(items => {
+            var result = this.mylistNum.some(items => {
               if (items.dataIndex == item.dataIndex) {
                 return true
               }
             })
             // console.log(result)
             if (result) {
-              this.listNum.splice(index, 1)
+              this.mylistNum.splice(index, 1)
             }
           })
         }
       } else {
-        arr = this.listNum.filter((item, index) => {
+        arr = this.mylistNum.filter((item, index) => {
           return item.dataIndex == val.dataIndex
         })
       }
       if (arr.length) {
         var index
-        this.listNum.map((item, ind) => {
+        this.mylistNum.map((item, ind) => {
           if (item.dataIndex == val.dataIndex) {
             index = ind
           }
         })
         console.log(index)
-        this.listNum.splice(index, 1)
+        this.mylistNum.splice(index, 1)
       } else {
-        this.listNum.push(val)
+        this.mylistNum.push(val)
       }
     }
   },
@@ -227,7 +227,7 @@ export default {
         position: absolute;
         top: 2;
         left: 10;
-        width: 40%;
+        width: 60%;
         overflow: hidden;
         white-space: nowrap;
         text-overflow: ellipsis;

+ 220 - 0
src/views/modules/Statistics/components/selectComponent.vue

@@ -0,0 +1,220 @@
+<template>
+  <div>
+    <div v-for="(item,index) in customFields" :key="index">
+      <div class="leibie">
+        <p class="leiName">{{item.title}}</p>
+        <!-- <span class="jutixiang">
+          <a-checkbox
+            :value="index"
+            name="type"
+            @change="isSelectAll($event,index)"
+            :checked="item.checkall"
+          >全选</a-checkbox>
+        </span> -->
+        <!-- {{item.form}} -->
+        <a-checkbox-group v-model="item.form" >
+          <span class="jutixiang" v-for="(zhi,num) in item.specificFields " :key="num">
+            <a-checkbox :value="zhi.dataIndex" name="type" @change="checkboxClick(zhi)">
+              <a-tooltip
+                class="select-component"
+                placement="top"
+                :title="zhi.tip"
+                :overlayClassName="tooltipShow"
+              >{{zhi.title}}</a-tooltip>
+            </a-checkbox>
+          </span>
+        </a-checkbox-group>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import  customFields  from '../../columnConst/accountConst'
+// let customFields=customFields
+export default {
+  props: ['showCol','fixedCol'],
+  data() {
+    return {
+        // customFields,
+      customFields:[...customFields],
+      quanxuanflag: [],
+      hovered: false,
+      tooltipShow: 'tooltipShow',
+      toParentArr: []
+    }
+  },
+  watch: {
+    
+    showCol(n) {
+      console.log(n)
+      //
+      if (this.showCol.length == this.fixedCol.length) {
+
+        for (let i = 0; i < this.customFields.length; i++) {
+          this.customFields[i].form=[]          
+        }
+        this.showCol.map((item, index) => {
+          this.customFields.map((it, ind) => {
+            it.specificFields.map((i, d) => {
+              if (i.dataIndex === item.dataIndex) {
+                it.form.push(item.dataIndex)
+              }else{
+
+              }
+            })
+          })
+        })
+      } else {
+        
+       for (let i = 0; i < this.customFields.length; i++) {
+          this.customFields[i].form=[]
+          
+        }
+        n.map((item, index) => {
+          this.customFields.map((it, ind) => {
+            it.specificFields.map((i, d) => {
+              if (i.dataIndex === item.dataIndex) {
+                it.form.push(item.dataIndex)
+              }else{
+
+              }
+            })
+          })
+        })
+      }
+      // console.log(this.form)
+    }
+  },
+  mounted() {
+    for (let i = 0; i < customFields.length; i++) {
+      this.customFields[i].form=[]
+    }
+    // console.log(1)
+    this.showCol.map((item, index) => {
+      this.customFields.map((it, ind) => {
+        it.specificFields.map((i, d) => {
+          if (i.dataIndex === item.dataIndex) {
+            it.form.push(item.dataIndex)
+          }
+        })
+      })
+    })
+
+    // console.log(this.customFields)
+  },
+  methods: {
+    hide() {
+      this.clicked = false
+      this.hovered = false
+    },
+    handleHoverChange(visible) {
+      this.clicked = false
+      this.hovered = visible
+    },
+    getPopupContainer() {
+      console.log(this)
+    },
+
+    //全选框   判断是否全选
+    isSelectAll(e, val) {
+      //像父元素传递
+      console.log(e, val)
+      let arr=JSON.parse(JSON.stringify(this.customFields[val].specificFields))
+      let valArr={
+        flag:true,
+        arr
+      }
+      this.customFields[val].checkall = e.target.checked
+      console.log(this.customFields[val].checkall)
+
+      if (this.customFields[val].checkall) {
+       
+        this.customFields[val].form=[]
+ 
+        this.customFields[val].specificFields.map((item, index) => {
+
+          this.customFields[val].form.push(item.dataIndex)
+
+        })
+        valArr.flag=true;
+        this.$emit('getshowlist', valArr)
+      } else {
+        console.log(this.customFields[val])
+        this.customFields[val].form=[];
+        valArr.flag=false;
+        console.log(this.customFields[val].form=[])
+        this.$emit('getshowlist', valArr)
+      }
+
+      console.log(this.form[val])
+    },
+
+    onChange(){
+        
+    },
+
+    //复选框的点击事件
+    checkboxClick(val) {
+      // console.log(val)
+    //   this.$emit('update:count',)
+      this.$emit('getshowlist', val)
+      // console.log(val,this.customFields[0].form)
+      // this.customFields[val].checkall=!this.customFields[val].checkall
+      // for (let i = 0; i < this.customFields.length; i++) {
+      //   // console.log(this.customFields[0].form,this.customFields[i].specificFields.length)
+      //   if(this.customFields[i].form.length==this.customFields[i].specificFields.length-1){
+      //       this.customFields[i].checkall=true;
+      //   }else{
+      //     this.customFields[i].checkall=false;
+      //   }
+          
+      //   }
+    }
+  }
+}
+</script>
+<style>
+.tooltipShow {
+  max-width: 30%;
+}
+.tooltipShow .ant-tooltip-content .ant-tooltip-inner {
+  background: white;
+  font-size: 10px;
+  color: #333;
+}
+.ant-tooltip-content .ant-tooltip-arrow::before {
+  background-color: white;
+}
+</style>
+<style lang="scss" scoped>
+.leibie {
+  width: 100%;
+  margin-bottom: 10px;
+  .leiName {
+    font-size: 20px;
+    text-align: left;
+    margin-bottom: 5px;
+    margin-top: 0px;
+  }
+}
+.jutixiang {
+  display: inline-block;
+  width: 32%;
+  box-sizing: border-box;
+  padding: 8px 3px;
+  height: 30px;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+
+.ant-tooltip-content .tooltipShow {
+  background: #eee;
+  font-size: 10px;
+  color: #333;
+}
+
+.ant-checkbox-group {
+  width: 100%;
+}
+</style>

+ 197 - 0
src/views/modules/Statistics/performanceRelated/performanceRelated.vue

@@ -0,0 +1,197 @@
+<template>
+    <div class="jixiao">
+        <div class="top">
+            <div class="company">
+                <span>公司:</span>
+                <a-select default-value="" style="width: 120px" @change="handleChange">
+                    <a-select-option value="huabei">
+                        华北
+                    </a-select-option>
+                    <a-select-option value="huanan">
+                        华南
+                    </a-select-option>
+                    <a-select-option value="huadong">
+                        华东
+                    </a-select-option>
+                </a-select>
+            </div>
+            <div>
+                <span>媒体类型:</span>
+                <a-select default-value="" style="width: 120px" @change="handleChange">
+                    <a-select-option value="huabei">
+                        华北
+                    </a-select-option>
+                    <a-select-option value="huanan">
+                        华南
+                    </a-select-option>
+                    <a-select-option value="huadong">
+                        华东
+                    </a-select-option>
+                </a-select>
+            </div>
+            <div>
+                <span>季度:</span>
+                <a-select default-value="" style="width: 120px" @change="handleChange">
+                    <a-select-option value="huabei">
+                        华北
+                    </a-select-option>
+                    <a-select-option value="huanan">
+                        华南
+                    </a-select-option>
+                    <a-select-option value="huadong">
+                        华东
+                    </a-select-option>
+                </a-select>
+            </div>
+            <div>
+                <span>姓名:</span>
+                <a-select default-value="" style="width: 120px" @change="handleChange">
+                    <a-select-option value="huabei">
+                        华北
+                    </a-select-option>
+                    <a-select-option value="huanan">
+                        华南
+                    </a-select-option>
+                    <a-select-option value="huadong">
+                        华东
+                    </a-select-option>
+                </a-select>
+            </div>
+            <div>
+                <span>职位:</span>
+                <a-select default-value="" style="width: 120px" @change="handleChange">
+                    <a-select-option value="huabei">
+                        华北
+                    </a-select-option>
+                    <a-select-option value="huanan">
+                        华南
+                    </a-select-option>
+                    <a-select-option value="huadong">
+                        华东
+                    </a-select-option>
+                </a-select>
+            </div>
+        </div>
+        <div class="optionBTN">
+            <a-button class="search" type='primary' @click="search">查询</a-button>
+            <a-button type="default" @click="exportExcel" id="mybtn">导出报表</a-button>
+        </div>
+        <div class="tableBox">
+
+        </div>
+    </div>
+</template>
+
+
+<script>
+import moment from 'moment';
+import { getAction, postAction, downFile, downFilePost } from '@/api/manage';
+import { JeecgListMixin } from '@/mixins/ipagination'
+
+const columnsFixd = [
+  {
+    title: '时间',
+    dataIndex: 'statDatetime',
+    align: 'center',
+    width: 120,
+    fixed: 'left',
+    scopedSlots: { customRender: 'statDatetime' }
+  },
+  {
+    title: '视频',
+    dataIndex: 'videoU',
+    align: 'center',
+    width: 150,
+    fixed: 'left',
+    key: 'videoU',
+    scopedSlots: { customRender: 'videoU' }
+  },
+  {
+    title: '视频ID',
+    dataIndex: 'signature',
+    align: 'center',
+    width: 100,
+    fixed: 'left'
+  },
+   {
+    title: '项目名称',
+    dataIndex: 'projectName',
+    align: 'center',
+    width: 100,
+    fixed: 'left'
+  },
+//   {
+//     title: '视频链接',
+//     dataIndex: 'videoUrl',
+//     align: 'center',
+//     width: 150,
+//     fixed: 'left'
+//   },
+
+  {
+    title: '视频描述',
+    dataIndex: 'materialDesc',
+    align: 'center',
+    width: 100,
+    fixed: 'left'
+  },
+  {
+    title: '操作',
+    dataIndex: 'operation',
+    align: 'center',
+    scopedSlots: { customRender: 'operation' },
+    width: 80,
+    fixed: 'left'
+  }
+]
+
+
+export default {
+    data() {
+        return {
+            
+        }
+    },
+    methods: {
+        moment,
+        //chaxun anniu 
+        search(){
+
+        },
+         //导出报表
+        exportExcel() {
+            // var params = {}
+            // params.projectId = this.projectId
+            // params.disCount = this.discount
+            // params.statDate = this.statDate.format('YYYY-MM-DD')
+            var name = this.data.filter(item => {
+                return item.signature == this.signature
+            })[0].projectName
+            downFilePost('/toutiao/videoReportDaily/bytedanceVideoInfoListDetailExportExcel', {
+                startDate: this.timedata[0],
+                endDate: this.timedata[1],
+                signature: this.signature
+            }).then(res => {
+                let blob = new Blob([res], {
+                type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+                })
+                let downloadElement = document.createElement('a')
+                let href = window.URL.createObjectURL(blob) //创建下载的链接
+                downloadElement.href = href
+                downloadElement.download = name + '-' +this.timedata[0] + '-' + this.timedata[1]+'.xlsx'    //下载后文件名
+                document.body.appendChild(downloadElement)
+                downloadElement.click() //点击下载
+                document.body.removeChild(downloadElement) //下载完成移除元素
+                window.URL.revokeObjectURL(href) //释放掉blob对象
+            })
+        },
+    },
+    mounted() {
+        
+    },
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 14 - 3
src/views/modules/Statistics/videoStatics/selectComponent.vue

@@ -1127,7 +1127,7 @@ const customFields = [
   }
 ]
 export default {
-  props: ['showCol','fixedColLength'],
+  props: ['showCol','fixedCol'],
   data() {
     return {
       customFields:[...customFields],
@@ -1142,18 +1142,29 @@ export default {
     showCol(n) {
       console.log(n)
       //
-      if (this.showCol.length == this.fixedColLength) {
+      if (this.showCol.length == this.fixedCol.length) {
 
         for (let i = 0; i < this.customFields.length; i++) {
           this.customFields[i].form=[]          
         }
+        this.showCol.map((item, index) => {
+          this.customFields.map((it, ind) => {
+            it.specificFields.map((i, d) => {
+              if (i.dataIndex === item.dataIndex) {
+                it.form.push(item.dataIndex)
+              }else{
+
+              }
+            })
+          })
+        })
       } else {
         
        for (let i = 0; i < this.customFields.length; i++) {
           this.customFields[i].form=[]
           
         }
-        this.showCol.map((item, index) => {
+        n.map((item, index) => {
           this.customFields.map((it, ind) => {
             it.specificFields.map((i, d) => {
               if (i.dataIndex === item.dataIndex) {

+ 1 - 1
src/views/modules/Statistics/videoStatics/vDay.vue

@@ -41,7 +41,7 @@
           <p>可添加的列</p>
           <div class="selectionList">
             <!--  v-for="(item,index) in addColumns" :key="index" -->
-            <selectComponent :showCol="listNum" @getshowlist="getshowlist" :fixedColLength='columnsFixd.length' />
+            <selectComponent :showCol="listNum" @getshowlist="getshowlist" :fixedCol='columnsFixd' />
           </div>
         </div>
         <div class="listNum">

+ 1 - 1
src/views/modules/Statistics/videoStatics/vMonth.vue

@@ -43,7 +43,7 @@
           <p>可添加的列</p>
           <div class="selectionList">
             <!--  v-for="(item,index) in addColumns" :key="index" -->
-            <selectComponent :showCol="listNum" @getshowlist="getshowlist"  :fixedColLength='columnsFixd.length'/>
+            <selectComponent :showCol="listNum" @getshowlist="getshowlist"  :fixedCol='columnsFixd'/>
           </div>
         </div>
         <div class="listNum">

+ 1 - 1
src/views/modules/Statistics/videoStatics/vSummary.vue

@@ -47,7 +47,7 @@
             <selectComponent
               :showCol="listNum"
               @getshowlist="getshowlist"
-              :fixedColLength="columnsFixd.length"
+              :fixedCol="columnsFixd"
             />
           </div>
         </div>

+ 1 - 1
src/views/modules/Statistics/videoStatics/vWeek.vue

@@ -43,7 +43,7 @@
           <p>可添加的列</p>
           <div class="selectionList">
             <!--  v-for="(item,index) in addColumns" :key="index" -->
-            <selectComponent :showCol="listNum" @getshowlist="getshowlist" :fixedColLength='columnsFixd.length' />
+            <selectComponent :showCol="listNum" @getshowlist="getshowlist" :fixedCol='columnsFixd' />
           </div>
         </div>
         <div class="listNum">

Різницю між файлами не показано, бо вона завелика
+ 1053 - 0
src/views/modules/columnConst/accountConst.js


+ 0 - 0
src/views/modules/columnConst/videoConst.js