Ver Fonte

素材大盘与下单制新增功能

朱鑫波 há 4 anos atrás
pai
commit
da28d63e6f

+ 39 - 3
src/filters.js

@@ -76,6 +76,42 @@ const filters = {
         s = s < 10 ? '0' + s : s
         return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s
     },
+    //时间秒转化为时间格式
+    formatS: function (s) {
+        var sTime = parseInt(s);// 秒
+        var mTime = 0;// 分
+        var hTime = 0;// 时
+        if (sTime > 60) {//如果秒数大于60,将秒数转换成整数
+            //获取分钟,除以60取整数,得到整数分钟
+            mTime = parseInt(sTime / 60);
+            //获取秒数,秒数取佘,得到整数秒数
+            sTime = parseInt(sTime % 60);
+            //如果分钟大于60,将分钟转换成小时
+            if (mTime > 60) {
+                //获取小时,获取分钟除以60,得到整数小时
+                hTime = parseInt(mTime / 60);
+                //获取小时后取佘的分,获取分钟除以60取佘的分
+                mTime = parseInt(mTime % 60);
+            }
+        }
+        var result = '';
+        if (sTime >= 0 && sTime < 10) {
+            result = "0" + parseInt(sTime) + "";
+        } else {
+            result = "" + parseInt(sTime) + "";
+        }
+        if (mTime >= 0 && mTime < 10) {
+            result = "0" + parseInt(mTime) + ":" + result;
+        } else {
+            result = "" + parseInt(mTime) + ":" + result;
+        }
+        if (hTime >= 0 && hTime < 10) {
+            result = "0" + parseInt(hTime) + ":" + result;
+        } else {
+            result = "" + parseInt(hTime) + ":" + result;
+        }
+        return result;
+    },
     //bidType类型
     bidType(sta) {
         var data = {
@@ -107,9 +143,9 @@ const filters = {
             324: '唤起应用',
             715: '微信复制优化目标',
             716: '多转化事件',
-            396:'注册优化目标',
-            731:'广告观看5次',
-            732:'广告观看10次',
+            396: '注册优化目标',
+            731: '广告观看5次',
+            732: '广告观看10次',
         }
         return data[sta]
     },

+ 294 - 97
src/views/modules/Statistics/materialReport/marterialDetail.vue

@@ -14,16 +14,27 @@
 .info-detail table tr td {
   border: 0;
 }
-.show-data span {
+.show-data p {
+  color: black;
+  font-weight: 600;
+}
+.show-data p span {
   display: inline-block;
   width: 85px;
+  color: slategrey;
+  font-weight: 500;
 }
 </style>
 <template>
   <a-row :gutter="10">
     <a-spin :spinning="spinning">
       <a-col :sm="6" style="margin-bottom: 20px; z-index: 10">
-        <a-card class="search-box" style="min-height: 500px">
+        <a-card
+          style="min-height: 100px"
+          :style="{
+            width: (clientWidth / 24) * 6 - 10 + 'px',
+          }"
+        >
           <video class="video" :src="materialInfo.url" controls="controls" style="width: 100%" v-if="materialInfo">
             您的浏览器不支持 video 标签。
           </video>
@@ -31,186 +42,209 @@
         </a-card>
       </a-col>
       <a-col :sm="18" style="margin-bottom: 20px; z-index: 10">
-        <a-card class="search-box info-detail" style="min-height: 300px">
+        <a-card class="info-detail" style="min-height: 300px">
           <a-descriptions title="视频信息" v-if="materialInfo">
-            <a-descriptions-item label="素材标题" :span="3"> {{ materialInfo.materialName }} </a-descriptions-item>
-            <a-descriptions-item label="素材ID"> {{ materialInfo.materialId }} </a-descriptions-item>
+            <a-descriptions-item label="素材标题" :span="3">
+              {{ materialInfo.materialName ? materialInfo.materialName : '-' }}
+            </a-descriptions-item>
+            <a-descriptions-item label="素材ID">
+              {{ materialInfo.materialId ? materialInfo.materialId : '-' }}
+            </a-descriptions-item>
             <a-descriptions-item label="上线时间">
-              {{ materialInfo.createTime ? materialInfo.createTime.split(' ')[0] : '无' }}
+              {{ materialInfo.createTime ? materialInfo.createTime.split(' ')[0] : '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="素材类型">
-              {{ materialInfo.materialType == '' ? '无' : materialInfo.materialType }}
+              {{
+                materialInfo.materialType ? (materialInfo.materialType == '' ? '无' : materialInfo.materialType) : '-'
+              }}
+            </a-descriptions-item>
+            <a-descriptions-item label="视频时长">
+              <span v-if="materialInfo.second">
+                {{ materialInfo.second | formatS }}
+              </span>
+              <span v-else>-</span>
             </a-descriptions-item>
-            <a-descriptions-item label="视频时长"> {{ materialInfo.second }}s </a-descriptions-item>
             <a-descriptions-item label="视频大小">
-              {{ materialInfo.size }}
+              {{ materialInfo.size ? materialInfo.size : '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="视频尺寸">
-              {{ materialInfo.width }}*{{ materialInfo.height }}
+              {{ materialInfo.width ? materialInfo.width + '*' + materialInfo.height : '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="投放媒体">
-              {{ materialInfo.madia }}
+              {{ materialInfo.madia || '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="素材渠道">
-              {{ materialInfo.channelType }}
+              {{ materialInfo.channelType || '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="供应商">
-              {{ materialInfo.supplier }}
+              {{ materialInfo.supplier || '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="关联项目">
-              {{ materialInfo.projectName }}
+              {{ materialInfo.projectName || '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="唯一编码" :span="2">
-              {{ materialInfo.code }}
+              {{ materialInfo.code || '-' }}
             </a-descriptions-item>
 
             <a-descriptions-item label="设计组长" :span="3" style="margin-top: 10px">
-              {{ materialInfo.leaderName }}
+              {{ materialInfo.leaderName || '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="编导">
-              {{ materialInfo.planName == '' ? '无' : materialInfo.planName }}
+              {{ materialInfo.planName ? (materialInfo.planName == '' ? '无' : materialInfo.planName) : '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="拍摄">
-              {{ materialInfo.shotName == '' ? '无' : materialInfo.shotName }}
+              {{ materialInfo.shotName ? (materialInfo.shotName == '' ? '无' : materialInfo.shotName) : '-' }}
             </a-descriptions-item>
             <a-descriptions-item label="剪辑">
-              {{ materialInfo.clipName == '' ? '无' : materialInfo.clipName }}
+              {{ materialInfo.clipName ? (materialInfo.clipName == '' ? '无' : materialInfo.clipName) : '-' }}
             </a-descriptions-item>
           </a-descriptions>
         </a-card>
-        <!-- <a-card
-          class="search-box"
-          style="min-height: 300px; margin: 20px 0"
-          title="数据概览"
-          v-if="dataView && $route.query.mediaId == 2"
-        >
+        <a-card style="min-height: 300px; margin: 10px 0" v-if="dataView && mediaId == 2">
+          <div
+            style="
+              margin-bottom: 20px;
+              color: rgba(0, 0, 0, 0.85);
+              font-weight: bold;
+              font-size: 16px;
+              line-height: 1.5;
+            "
+          >
+            数据概览
+          </div>
           <a-row :gutter="15">
             <a-col :xl="6" class="show-data">
               <h3>素材消耗</h3>
               <p
-                :style="{ color: dataView.charge[0].charge > dataView.charge[2].charge ? '#F66C6D' : '#67C239' }"
+                :style="{ color: dataView.charge[0].charge >= dataView.charge[2].charge ? '#F66C6D' : '#67C239' }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.charge[0].charge | decimalsHandle }}
               </p>
               <p><span>项目top</span>{{ dataView.charge[1].charge | decimalsHandle }}</p>
-              <p><span>数据库均值</span>{{ dataView.charge[2].charge | decimalsHandle }}</p>
+              <p><span>素材库均值</span>{{ dataView.charge[2].charge | decimalsHandle }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>封面曝光数</h3>
               <p
                 :style="{
-                  color: dataView.photoShow[0].photoShow > dataView.photoShow[2].photoShow ? '#F66C6D' : '#67C239',
+                  color: dataView.photoShow[0].photoShow >= dataView.photoShow[2].photoShow ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.photoShow[0].photoShow }}
               </p>
               <p><span>项目top</span>{{ dataView.photoShow[1].photoShow }}</p>
-              <p><span>数据库均值</span>{{ dataView.photoShow[2].photoShow }}</p>
+              <p><span>素材库均值</span>{{ dataView.photoShow[2].photoShow }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>封面点击数</h3>
               <p
                 :style="{
-                  color: dataView.photoClick[0].photoClick > dataView.photoClick[2].photoClick ? '#F66C6D' : '#67C239',
+                  color: dataView.photoClick[0].photoClick >= dataView.photoClick[2].photoClick ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.photoClick[0].photoClick }}
               </p>
               <p><span>项目top</span>{{ dataView.photoClick[1].photoClick }}</p>
-              <p><span>数据库均值</span>{{ dataView.photoClick[2].photoClick }}</p>
+              <p><span>素材库均值</span>{{ dataView.photoClick[2].photoClick }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>素材曝光数</h3>
               <p
-                :style="{ color: dataView.aclick[0].aclick > dataView.aclick[2].aclick ? '#F66C6D' : '#67C239' }"
+                :style="{ color: dataView.aclick[0].aclick >= dataView.aclick[2].aclick ? '#F66C6D' : '#67C239' }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.aclick[0].aclick }}
               </p>
               <p><span>项目top</span>{{ dataView.aclick[1].aclick }}</p>
-              <p><span>数据库均值</span>{{ dataView.aclick[2].aclick }}</p>
+              <p><span>素材库均值</span>{{ dataView.aclick[2].aclick }}</p>
             </a-col>
           </a-row>
           <a-row :gutter="15" style="margin-top: 20px">
             <a-col :xl="6" class="show-data">
               <h3>行为数</h3>
               <p
-                :style="{ color: dataView.bclick[0].bclick > dataView.bclick[2].bclick ? '#F66C6D' : '#67C239' }"
+                :style="{ color: dataView.bclick[0].bclick >= dataView.bclick[2].bclick ? '#F66C6D' : '#67C239' }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.bclick[0].bclick }}
               </p>
               <p><span>项目top</span>{{ dataView.bclick[1].bclick }}</p>
-              <p><span>数据库均值</span>{{ dataView.bclick[2].bclick }}</p>
+              <p><span>素材库均值</span>{{ dataView.bclick[2].bclick }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>激活数</h3>
               <p
                 :style="{
-                  color: dataView.activation[0].activation > dataView.activation[2].activation ? '#F66C6D' : '#67C239',
+                  color: dataView.activation[0].activation >= dataView.activation[2].activation ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.activation[0].activation }}
               </p>
               <p><span>项目top</span>{{ dataView.activation[1].activation }}</p>
-              <p><span>数据库均值</span>{{ dataView.activation[2].activation }}</p>
+              <p><span>素材库均值</span>{{ dataView.activation[2].activation }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>3s播放率</h3>
               <p
                 :style="{
-                  color: dataView.play3sRate[0].play3sRate > dataView.play3sRate[2].play3sRate ? '#F66C6D' : '#67C239',
+                  color: dataView.play3sRate[0].play3sRate >= dataView.play3sRate[2].play3sRate ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ (dataView.play3sRate[0].play3sRate * 100).toFixed(2) + '%' }}
               </p>
               <p><span>项目top</span>{{ (dataView.play3sRate[1].play3sRate * 100).toFixed(2) + '%' }}</p>
-              <p><span>数据库均值</span>{{ (dataView.play3sRate[2].play3sRate * 100).toFixed(2) + '%' }}</p>
+              <p><span>素材库均值</span>{{ (dataView.play3sRate[2].play3sRate * 100).toFixed(2) + '%' }}</p>
             </a-col>
           </a-row>
         </a-card>
-        <a-card
-          class="search-box"
-          style="min-height: 300px; margin: 20px 0"
-          title="数据概览"
-          v-if="dataView && $route.query.mediaId == 1"
-        >
+        <a-card style="min-height: 300px; margin: 10px 0" v-if="dataView && mediaId == 1">
+          <div
+            style="
+              margin-bottom: 20px;
+              color: rgba(0, 0, 0, 0.85);
+              font-weight: bold;
+              font-size: 16px;
+              line-height: 1.5;
+            "
+          >
+            数据概览
+          </div>
           <a-row :gutter="15">
             <a-col :xl="6" class="show-data">
               <h3>素材消耗</h3>
               <p
-                :style="{ color: dataView.cost[0].cost > dataView.cost[2].cost ? '#F66C6D' : '#67C239' }"
+                :style="{ color: dataView.cost[0].cost >= dataView.cost[2].cost ? '#F66C6D' : '#67C239' }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.cost[0].cost | decimalsHandle }}
               </p>
               <p><span>项目top</span>{{ dataView.cost[1].cost | decimalsHandle }}</p>
-              <p><span>数据库均值</span>{{ dataView.cost[2].cost | decimalsHandle }}</p>
+              <p><span>素材库均值</span>{{ dataView.cost[2].cost | decimalsHandle }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>点击数</h3>
               <p
                 :style="{
-                  color: dataView.click[0].click > dataView.click[2].click ? '#F66C6D' : '#67C239',
+                  color: dataView.click[0].click >= dataView.click[2].click ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.click[0].click }}
               </p>
               <p><span>项目top</span>{{ dataView.click[1].click }}</p>
-              <p><span>数据库均值</span>{{ dataView.click[2].click }}</p>
+              <p><span>素材库均值</span>{{ dataView.click[2].click }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>曝光数</h3>
               <p
                 :style="{
                   color:
-                    dataView.materialShow[0].materialShow > dataView.materialShow[2].materialShow
+                    dataView.materialShow[0].materialShow >= dataView.materialShow[2].materialShow
                       ? '#F66C6D'
                       : '#67C239',
                 }"
@@ -219,21 +253,21 @@
                 {{ dataView.materialShow[0].materialShow }}
               </p>
               <p><span>项目top</span>{{ dataView.materialShow[1].materialShow }}</p>
-              <p><span>数据库均值</span>{{ dataView.materialShow[2].materialShow }}</p>
+              <p><span>素材库均值</span>{{ dataView.materialShow[2].materialShow }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>完播率</h3>
               <p
                 :style="{
                   color:
-                    dataView.play100Rate[0].play100Rate > dataView.play100Rate[2].play100Rate ? '#F66C6D' : '#67C239',
+                    dataView.play100Rate[0].play100Rate >= dataView.play100Rate[2].play100Rate ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ (dataView.play100Rate[0].play100Rate * 100).toFixed(2) + '%' }}
               </p>
               <p><span>项目top</span>{{ (dataView.play100Rate[1].play100Rate * 100).toFixed(2) + '%' }}</p>
-              <p><span>数据库均值</span>{{ (dataView.play100Rate[2].play100Rate * 100).toFixed(2) + '%' }}</p>
+              <p><span>素材库均值</span>{{ (dataView.play100Rate[2].play100Rate * 100).toFixed(2) + '%' }}</p>
             </a-col>
           </a-row>
           <a-row :gutter="15" style="margin-top: 20px">
@@ -242,7 +276,7 @@
               <p
                 :style="{
                   color:
-                    dataView.likeMaterial[0].likeMaterial > dataView.likeMaterial[2].likeMaterial
+                    dataView.likeMaterial[0].likeMaterial >= dataView.likeMaterial[2].likeMaterial
                       ? '#F66C6D'
                       : '#67C239',
                 }"
@@ -251,14 +285,14 @@
                 {{ dataView.likeMaterial[0].likeMaterial }}
               </p>
               <p><span>项目top</span>{{ dataView.likeMaterial[1].likeMaterial }}</p>
-              <p><span>数据库均值</span>{{ dataView.likeMaterial[2].likeMaterial }}</p>
+              <p><span>素材库均值</span>{{ dataView.likeMaterial[2].likeMaterial }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>评论数</h3>
               <p
                 :style="{
                   color:
-                    dataView.commentMaterial[0].commentMaterial > dataView.commentMaterial[2].commentMaterial
+                    dataView.commentMaterial[0].commentMaterial >= dataView.commentMaterial[2].commentMaterial
                       ? '#F66C6D'
                       : '#67C239',
                 }"
@@ -267,14 +301,14 @@
                 {{ dataView.commentMaterial[0].commentMaterial }}
               </p>
               <p><span>项目top</span>{{ dataView.commentMaterial[1].commentMaterial }}</p>
-              <p><span>数据库均值</span>{{ dataView.commentMaterial[2].commentMaterial }}</p>
+              <p><span>素材库均值</span>{{ dataView.commentMaterial[2].commentMaterial }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>转发数</h3>
               <p
                 :style="{
                   color:
-                    dataView.shareMaterial[0].shareMaterial > dataView.shareMaterial[2].shareMaterial
+                    dataView.shareMaterial[0].shareMaterial >= dataView.shareMaterial[2].shareMaterial
                       ? '#F66C6D'
                       : '#67C239',
                 }"
@@ -283,24 +317,35 @@
                 {{ dataView.shareMaterial[0].shareMaterial }}
               </p>
               <p><span>项目top</span>{{ dataView.shareMaterial[1].shareMaterial }}</p>
-              <p><span>数据库均值</span>{{ dataView.shareMaterial[2].shareMaterial }}</p>
+              <p><span>素材库均值</span>{{ dataView.shareMaterial[2].shareMaterial }}</p>
             </a-col>
             <a-col :xl="6" class="show-data">
               <h3>关注数</h3>
               <p
                 :style="{
-                  color: dataView.follow[0].follow > dataView.follow[2].follow ? '#F66C6D' : '#67C239',
+                  color: dataView.follow[0].follow >= dataView.follow[2].follow ? '#F66C6D' : '#67C239',
                 }"
                 style="font-size: 18px; font-weight: 700"
               >
                 {{ dataView.follow[0].follow }}
               </p>
               <p><span>项目top</span>{{ dataView.follow[1].follow }}</p>
-              <p><span>数据库均值</span>{{ dataView.follow[2].follow }}</p>
+              <p><span>素材库均值</span>{{ dataView.follow[2].follow }}</p>
             </a-col>
           </a-row>
-        </a-card> -->
-        <a-card class="search-box" style="min-height: 300px" title="数据消耗趋势">
+        </a-card>
+        <a-card style="min-height: 300px">
+          <div
+            style="
+              margin-bottom: 20px;
+              color: rgba(0, 0, 0, 0.85);
+              font-weight: bold;
+              font-size: 16px;
+              line-height: 1.5;
+            "
+          >
+            数据消耗趋势
+          </div>
           <div
             id="echartCircular"
             ref="echartCircular"
@@ -332,12 +377,22 @@ export default {
       dataView: null,
       clientWidth: 1920,
       spinning: false,
+      scrollTopAll: 0,
+      scrollTop: 124,
+      mediaId: 0,
     }
   },
   components: {
     UploadToAli,
     uploadFile,
   },
+  watch: {
+    $route: function (n, o) {
+      if (n.query.md5 != o.query.md5 || n.path != o.path) {
+        this.getMaterialInfo()
+      }
+    },
+  },
   methods: {
     handlerEchartOption(data) {
       var option = {
@@ -419,6 +474,7 @@ export default {
         },
         series: [
           {
+            smooth: true,
             name: '消耗',
             type: 'line',
             stack: '总量',
@@ -426,7 +482,7 @@ export default {
               return item.cost.toFixed(3)
             }),
             symbol: 'circle',
-            symbolSize: 10,
+            symbolSize: 6,
             lineStyle: {
               normal: {
                 width: 2,
@@ -461,9 +517,10 @@ export default {
       }
     },
     getKuaishou() {
+      var data = JSON.parse(localStorage.getItem('videoInfo'))
       var params = {
-        mediaId: this.$route.query.mediaId,
-        md5: this.$route.query.md5,
+        mediaId: data.mediaId,
+        md5: data.md5,
       }
       var that = this
       var getProjectIdByMd5 = new Promise(function (resolve, reject) {
@@ -471,7 +528,7 @@ export default {
           if (res.success) {
             var materialDetailCharge = new Promise(function (resolve, reject) {
               that
-                .postDataAction('/overView/materialDetailCharge', { md5: that.$route.query.md5, projectId: res.result })
+                .postDataAction('/overView/materialDetailCharge', { md5: data.md5, projectId: res.result })
                 .then((res) => {
                   if (res.success) {
                     resolve(res.result)
@@ -481,7 +538,7 @@ export default {
             var materialDetailPhotoShow = new Promise(function (resolve, reject) {
               that
                 .postDataAction('/overView/materialDetailPhotoShow', {
-                  md5: that.$route.query.md5,
+                  md5: data.md5,
                   projectId: res.result,
                 })
                 .then((res) => {
@@ -493,7 +550,7 @@ export default {
             var materialDetailPhotoClick = new Promise(function (resolve, reject) {
               that
                 .postDataAction('/overView/materialDetailPhotoClick', {
-                  md5: that.$route.query.md5,
+                  md5: data.md5,
                   projectId: res.result,
                 })
                 .then((res) => {
@@ -504,7 +561,7 @@ export default {
             })
             var materialDetailAClick = new Promise(function (resolve, reject) {
               that
-                .postDataAction('/overView/materialDetailAClick', { md5: that.$route.query.md5, projectId: res.result })
+                .postDataAction('/overView/materialDetailAClick', { md5: data.md5, projectId: res.result })
                 .then((res) => {
                   if (res.success) {
                     resolve(res.result)
@@ -513,7 +570,7 @@ export default {
             })
             var materialDetailBClick = new Promise(function (resolve, reject) {
               that
-                .postDataAction('/overView/materialDetailBClick', { md5: that.$route.query.md5, projectId: res.result })
+                .postDataAction('/overView/materialDetailBClick', { md5: data.md5, projectId: res.result })
                 .then((res) => {
                   if (res.success) {
                     resolve(res.result)
@@ -523,7 +580,7 @@ export default {
             var materialDetailActivation = new Promise(function (resolve, reject) {
               that
                 .postDataAction('/overView/materialDetailActivation', {
-                  md5: that.$route.query.md5,
+                  md5: data.md5,
                   projectId: res.result,
                 })
                 .then((res) => {
@@ -535,7 +592,7 @@ export default {
             var materialDetailPlay3sRate = new Promise(function (resolve, reject) {
               that
                 .postDataAction('/overView/materialDetailPlay3sRate', {
-                  md5: that.$route.query.md5,
+                  md5: data.md5,
                   projectId: res.result,
                 })
                 .then((res) => {
@@ -544,45 +601,179 @@ export default {
                   }
                 })
             })
-            Promise
-              .all([
-                materialDetailPlay3sRate,
-                materialDetailCharge,
-                materialDetailPhotoShow,
-                materialDetailPhotoClick,
-                materialDetailAClick,
-                materialDetailBClick,
-                materialDetailActivation,
-               
-              ])
-              .then((item) => {
-                // dataView
-                console.log(item)
-              })
+            Promise.all([
+              materialDetailPlay3sRate,
+              materialDetailCharge,
+              materialDetailPhotoShow,
+              materialDetailPhotoClick,
+              materialDetailAClick,
+              materialDetailBClick,
+              materialDetailActivation,
+            ]).then((item) => {
+              // dataView
+              that.spinning = false
+              that.dataView = {}
+              for (let i = 0; i < item.length; i++) {
+                for (const key in item[i]) {
+                  that.dataView[key] = item[i][key]
+                }
+              }
+            })
+          }
+        })
+      })
+    },
+    getToutiao() {
+      var data = JSON.parse(localStorage.getItem('videoInfo'))
+      var params = {
+        mediaId: data.mediaId,
+        md5: data.md5,
+      }
+      var that = this
+      var getProjectIdByMd5 = new Promise(function (resolve, reject) {
+        that.postDataAction('/overView/getProjectIdByMd5', params).then((res) => {
+          if (res.success) {
+            var materialDetailMaterialShow = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailMaterialShow', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailCost = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailCost', { md5: data.md5, projectId: res.result })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailClick = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailClick', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailPlay100Rate = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailPlay100Rate', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailLikeMaterial = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailLikeMaterial', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailCommentMaterial = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailCommentMaterial', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailShareMaterial = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailShareMaterial', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            var materialDetailFollow = new Promise(function (resolve, reject) {
+              that
+                .postDataAction('/overView/materialDetailFollow', {
+                  md5: data.md5,
+                  projectId: res.result,
+                })
+                .then((res) => {
+                  if (res.success) {
+                    resolve(res.result)
+                  }
+                })
+            })
+            Promise.all([
+              materialDetailCost,
+              materialDetailClick,
+              materialDetailMaterialShow,
+              materialDetailPlay100Rate,
+              materialDetailLikeMaterial,
+              materialDetailCommentMaterial,
+              materialDetailShareMaterial,
+              materialDetailFollow,
+            ]).then((item) => {
+              // dataView
+              console.log(item)
+              that.spinning = false
+              that.dataView = {}
+              for (let i = 0; i < item.length; i++) {
+                for (const key in item[i]) {
+                  that.dataView[key] = item[i][key]
+                }
+              }
+            })
           }
         })
       })
     },
     getMaterialInfo() {
-      // this.spinning = true
+      var data = JSON.parse(localStorage.getItem('videoInfo'))
+      this.spinning = true
       var params = {
-        mediaId: this.$route.query.mediaId,
-        md5: this.$route.query.md5,
+        mediaId: data.mediaId,
+        md5: data.md5,
       }
-      var data = []
       this.postDataAction('/overView/materialDetailInfo', params).then((res) => {
         if (res.success) {
           if (res.result) {
             this.materialInfo = res.result
           } else {
-            this.$error({
-              title: '页面数据加载出错',
-              content: '该视频未上传公司素材库,请重新上传之后,可展示视频信息',
-            })
+            // this.$error({
+            //   title: '页面数据加载出错',
+            //   content: '该视频未上传公司素材库,请重新上传之后,可展示视频信息',
+            // })
           }
         }
       })
-      this.getKuaishou()
+      if (data.mediaId == 1) {
+        this.getToutiao()
+      } else if (data.mediaId == 2) {
+        this.getKuaishou()
+      }
 
       this.postDataAction('/overView/materialDetailChat', params).then((res) => {
         if (res.success) {
@@ -590,9 +781,15 @@ export default {
         }
       })
     },
+    handleScroll() {
+      var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
+      this.scrollTop = scrollTop
+    },
   },
   mounted() {
     this.$nextTick(() => {
+      this.mediaId = JSON.parse(localStorage.getItem('videoInfo')).mediaId
+      window.addEventListener('scroll', this.handleScroll)
       this.clientWidth = document.documentElement.clientWidth - 224
       //   this.$route.query.mediaId
       //   this.$route.query.md5

+ 109 - 31
src/views/modules/Statistics/materialReport/marterialList.vue

@@ -35,14 +35,14 @@
       <div class="option" style="justify-content: space-between">
         <div class="option" style="padding: 0">
           <div class="item">
-            <span>素材ID</span>
+            <span>唯一编码</span>
             <a-input style="width: 300px" v-model="md5"></a-input>
           </div>
         </div>
 
         <div class="item" style="float: right">
-          <a-button @click="handleSubmit" type="primary" :loading="loading">搜索</a-button>
-          <a-button @click="resetSubmit" style="margin-left: 15px" :loading="loading">重置</a-button>
+          <a-button @click="handleSubmit" type="primary" :loading="videoloading">搜索</a-button>
+          <a-button @click="resetSubmit" style="margin-left: 15px" :loading="resetLoading">重置</a-button>
         </div>
       </div>
     </div>
@@ -50,7 +50,14 @@
       <a-col :xl="24">
         <a-card title="数据列表" style="width: 100%; min-height: 700px" :bordered="false">
           <div class="tableTop" style="text-align: end; margin: 0 0 15px 0">
-            <!-- <a-button type="primary" class="export" @click="exportExcel">导出报表</a-button> -->
+            <a-button
+              type="primary"
+              class="export"
+              @click="exportExcel"
+              style="margin-right: 10px"
+              :loading="excelLoading"
+              >导出报表</a-button
+            >
             <a-button type="primary" class="add" @click="customColumns">自定义列</a-button>
           </div>
           <a-table
@@ -69,7 +76,15 @@
             style="word-break: break-all; font-size: 16px; font-weight: 600"
           >
             <span slot="coverUrl" slot-scope="text, records">
-              <img :src="text || noImg" alt="" style="width: 100%; height: auto" />
+              <img
+                :src="text || noImg"
+                alt=""
+                style="width: 100%; height: auto"
+                @click.stop="
+                  visibleVideo = true
+                  videoUrlShow = records.url
+                "
+              />
             </span>
             <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
             <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
@@ -194,6 +209,13 @@ const columnsFixd = [
     fixed: 'left',
   },
   {
+    title: '唯一编码',
+    dataIndex: 'signature',
+    align: 'center',
+    width: 100,
+    fixed: 'left',
+  },
+  {
     title: '素材名称',
     dataIndex: 'materialName',
     align: 'center',
@@ -321,6 +343,7 @@ export default {
   },
   data() {
     return {
+      excelLoading: false,
       tableData: [],
       designTopLoading: false,
       noImg: require('@/assets/noImg.png'),
@@ -380,6 +403,8 @@ export default {
       listNum: [],
       scrollX: 1500,
       tableWidth: '', //设置表格的列宽
+      resetLoading: false,
+      videoloading: false,
     }
   },
   watch: {
@@ -402,8 +427,10 @@ export default {
       return {
         on: {
           click: (e) => {
+            var params = { md5: record.signature, mediaId: 2 }
+            localStorage.setItem('videoInfo', JSON.stringify(params))
             this.$router.push({
-              path: '/materialReport/marterialDetail?md5=' + record.signature + '&mediaId=2',
+              path: '/materialReport/marterialDetail',
             })
           },
         },
@@ -418,8 +445,13 @@ export default {
       if (this.columns.length > this.columnsFixd.length && this.columns.length < 8) {
         this.columns.forEach((element, index) => {
           if (index < this.columns.length - 1) {
-            element.width = 'auto'
-            element.fixed = false
+            if (element.dataIndex == 'coverUrl') {
+              element.width = 100
+              element.fixed = false
+            } else {
+              element.width = 'auto'
+              element.fixed = false
+            }
           }
         })
 
@@ -427,7 +459,7 @@ export default {
       } else if (this.columns.length >= 8) {
         this.columns.forEach((element, index) => {
           if (index < this.columnsFixd.length) {
-            element.width = 200
+            element.width = 100
             element.fixed = 'left'
           }
         })
@@ -436,10 +468,24 @@ export default {
       } else {
         this.scrollX = 0
         this.columns.forEach((element) => {
-          element.width = 'auto'
-          element.fixed = false
+          console.log(element)
+          if (element.dataIndex == 'coverUrl') {
+            element.width = 100
+            element.fixed = false
+          } else {
+            element.width = 'auto'
+            element.fixed = false
+          }
         })
       }
+
+      let arr = JSON.stringify(this.columns)
+      this.postDataAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
+        json: arr,
+        columnType: 12,
+      }).then((res) => {
+        // console.log(res)
+      })
     },
     customColumns() {
       this.visible = true
@@ -492,6 +538,8 @@ export default {
       params.pageNo = this.ipagination.current
       this.postDataAction('/overView/materialTopViewMore', params).then((res) => {
         this.loading = false
+        this.resetLoading = false
+        this.videoloading = false
         if (res.success) {
           this.tableData = res.result.list
           this.ipagination.total = res.result.total
@@ -524,8 +572,7 @@ export default {
             params.order = 'asc'
           }
         } else {
-          params.target = this.target
-          params.order = this.order == 'descend' ? 'desc' : 'asc'
+          params.target = this.params.order = this.order == 'descend' ? 'desc' : 'asc'
         }
         this.postDataAction('/overView/designTop', params).then((res) => {
           this.designTopLoading = false
@@ -541,37 +588,38 @@ export default {
     },
 
     handleSubmit() {
-      this.spinning = true
+      this.videoloading = true
       this.ipagination.current = 1
       this.getData()
     },
     resetSubmit() {
-      this.dateValue = [moment().subtract(7, 'days'), moment()]
-      this.dataDimension = 'a'
-      this.mediaDimension = 'b'
-      this.dataDimensionValue = []
       this.ipagination.current = 1
+      this.resetLoading = true
       this.md5 = ''
       this.getData()
     },
     //导出报表
     exportExcel() {
-      
+      this.excelLoading = true
       let column = this.columns.map((item, index) => {
         return item.dataIndex
       })
-      let columns = column.splice(3)
-      
-      downFilePost('/ctop/kuaishou/dailyPage/report/excel', {
-        mediaId: this.mediaId,
-        discount: this.discount,
-        accountIds: this.accountId,
-        startDate: this.dateValue[0].format('YYYY-MM-DD'),
-        endDate: this.dateValue[1].format('YYYY-MM-DD'),
-        hour: this.timeSelectValue,
-        target: this.target,
-        order: this.order,
+      let columns = column.splice(4)
+      // "mediaId":"",
+      // "projects":[],
+      // "columns":"",
+      // "startDate":"",
+      // "endDate":"",
+      // "channelType":"",
+      // "md5":"",
+      // "target":"",
+      // "order":""
+      downFilePost('/overView/excel', {
+        ...this.materialData,
         columns,
+        target: this.target,
+        order: this.order == 'descend' ? 'desc' : 'asc',
+        md5: this.md5,
       }).then((res) => {
         let blob = new Blob([res], {
           type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
@@ -579,11 +627,12 @@ export default {
         let downloadElement = document.createElement('a')
         let href = window.URL.createObjectURL(blob) //创建下载的链接
         downloadElement.href = href
-        downloadElement.download = moment().format('YYYY-MM-DD') + '账户报表.xlsx' //下载后文件名
+        downloadElement.download = this.materialData.startDate + '~' + this.materialData.endDate + '素材报表.xlsx' //下载后文件名
         document.body.appendChild(downloadElement)
         downloadElement.click() //点击下载
         document.body.removeChild(downloadElement) //下载完成移除元素
         window.URL.revokeObjectURL(href) //释放掉blob对象
+        this.excelLoading = false
       })
     },
     tableChange(data) {
@@ -608,6 +657,35 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
+      this.postDataAction('/toutiao/videoReportDaily/getColumnJson', {
+        columnType: 12,
+      }).then((res) => {
+        // console.log(res)
+        if (res.success) {
+          // console.log(JSON.parse(res.result))
+          if (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) {}
+                  }
+                })
+                columns = columns.slice(columnsFixd.length)
+                this.columns = [...columnsFixd, ...columns]
+
+                // this.tableHandle()
+              }
+
+              // console.log(this.columns)
+            }
+          }
+
+          this.changeColumn(this.columns)
+        }
+      })
+
       this.materialData = JSON.parse(localStorage.getItem('materialParams'))
       this.getMoreVideoList(this.materialData)
     })

+ 103 - 30
src/views/modules/Statistics/materialReport/marterialTtList.vue

@@ -35,14 +35,14 @@
       <div class="option" style="justify-content: space-between">
         <div class="option" style="padding: 0">
           <div class="item">
-            <span>素材ID</span>
+            <span>唯一编码</span>
             <a-input style="width: 300px" v-model="md5"></a-input>
           </div>
         </div>
 
         <div class="item" style="float: right">
-          <a-button @click="handleSubmit" type="primary" :loading="spinning">搜索</a-button>
-          <a-button @click="resetSubmit" style="margin-left: 15px" :loading="spinning">重置</a-button>
+          <a-button @click="handleSubmit" type="primary" :loading="videoLoading">搜索</a-button>
+          <a-button @click="resetSubmit" style="margin-left: 15px" :loading="resetLoading">重置</a-button>
         </div>
       </div>
     </div>
@@ -50,7 +50,7 @@
       <a-col :xl="24">
         <a-card title="数据列表" style="width: 100%; min-height: 700px" :bordered="false">
           <div class="tableTop" style="text-align: end; margin: 0 0 15px 0">
-            <!-- <a-button type="primary" class="export" @click="exportExcel">导出报表</a-button> -->
+            <a-button type="primary" class="export" @click="exportExcel" style="margin-right: 10px">导出报表</a-button>
             <a-button type="primary" class="add" @click="customColumns">自定义列</a-button>
           </div>
           <a-table
@@ -69,7 +69,15 @@
             style="word-break: break-all; font-size: 16px; font-weight: 600"
           >
             <span slot="coverUrl" slot-scope="text, records">
-              <img :src="text || noImg" alt="" style="width: 100%; height: auto" />
+              <img
+                :src="text || noImg"
+                alt=""
+                style="width: 100%; height: auto"
+                @click.stop="
+                  visibleVideo = true
+                  videoUrlShow = records.url
+                "
+              />
             </span>
             <span slot="ctr" slot-scope="ctr">{{ ctr | toPercentage }}</span>
             <span slot="cost" slot-scope="cost">{{ cost | decimalsHandle }}</span>
@@ -165,7 +173,7 @@
       :visible="visible"
       :listNum="listNum"
       :fiexColumn="columnsFixd"
-      :mediaType="2"
+      :mediaType="1"
       @closeCustomColumn="closeCustomColumn"
       @changeColumn="changeColumn"
     />
@@ -194,6 +202,13 @@ const columnsFixd = [
     fixed: 'left',
   },
   {
+    title: '唯一编码',
+    dataIndex: 'signature',
+    align: 'center',
+    width: 100,
+    fixed: 'left',
+  },
+  {
     title: '素材名称',
     dataIndex: 'materialName',
     align: 'center',
@@ -277,6 +292,8 @@ export default {
     return {
       tableData: [],
       designTopLoading: false,
+      resetLoading: false,
+      videoLoading: false,
       noImg: require('@/assets/noImg.png'),
       visibleVideo: false,
       videoUrlShow: '',
@@ -320,7 +337,7 @@ export default {
         近半年: [moment().subtract(6, 'months'), moment()],
         近一年: [moment().subtract(12, 'months'), moment()],
       },
-      dateValue: [moment().subtract(7, 'days'), moment()],
+      dateValue: [moment().subtract(6, 'days'), moment()],
       dataDimension: 'a',
       mediaDimension: 'b',
       dataDimensionValue: [],
@@ -356,8 +373,10 @@ export default {
       return {
         on: {
           click: (e) => {
+            var params = { md5: record.signature, mediaId: 1 }
+            localStorage.setItem('videoInfo', JSON.stringify(params))
             this.$router.push({
-              path: '/materialReport/marterialDetail?md5=' + record.signature + '&mediaId=1',
+              path: '/materialReport/marterialDetail',
             })
           },
         },
@@ -370,11 +389,17 @@ export default {
     },
     changeColumn(val) {
       this.columns = [...val]
+
       if (this.columns.length > this.columnsFixd.length && this.columns.length < 8) {
         this.columns.forEach((element, index) => {
           if (index < this.columns.length - 1) {
-            element.width = 'auto'
-            element.fixed = false
+            if (element.dataIndex == 'coverUrl') {
+              element.width = 100
+              element.fixed = false
+            } else {
+              element.width = 'auto'
+              element.fixed = false
+            }
           }
         })
 
@@ -382,7 +407,7 @@ export default {
       } else if (this.columns.length >= 8) {
         this.columns.forEach((element, index) => {
           if (index < this.columnsFixd.length) {
-            element.width = 200
+            element.width = 100
             element.fixed = 'left'
           }
         })
@@ -390,11 +415,24 @@ export default {
         this.scrollX = 1000 + 200 * (this.columns.length - this.columnsFixd.length)
       } else {
         this.scrollX = 0
+
         this.columns.forEach((element) => {
-          element.width = 'auto'
-          element.fixed = false
+          if (element.dataIndex == 'coverUrl') {
+            element.width = 100
+            element.fixed = false
+          } else {
+            element.width = 'auto'
+            element.fixed = false
+          }
         })
       }
+      let arr = JSON.stringify(this.columns)
+      this.postDataAction('/toutiao/videoReportDaily/saveOrUpdateColumnJson', {
+        json: arr,
+        columnType: 11,
+      }).then((res) => {
+        // console.log(res)
+      })
     },
     customColumns() {
       this.visible = true
@@ -447,6 +485,8 @@ export default {
       params.pageNo = this.ipagination.current
       this.postDataAction('/overView/materialTopViewMore', params).then((res) => {
         this.loading = false
+        this.resetLoading = false
+        this.videoLoading = false
         if (res.success) {
           this.tableData = res.result.list
           this.ipagination.total = res.result.total
@@ -496,35 +536,38 @@ export default {
     },
 
     handleSubmit() {
+      this.videoLoading = true
       this.ipagination.current = 1
       this.getData()
     },
     resetSubmit() {
-      this.dateValue = [moment().subtract(7, 'days'), moment()]
-      this.dataDimension = 'a'
-      this.mediaDimension = 'b'
-      this.dataDimensionValue = []
+      this.resetLoading = true
       this.ipagination.current = 1
       this.md5 = ''
       this.getData()
     },
     //导出报表
     exportExcel() {
+      this.excelLoading = true
       let column = this.columns.map((item, index) => {
         return item.dataIndex
       })
-      let columns = column.splice(3)
-      // console.log(columns)
-      downFilePost('/ctop/kuaishou/dailyPage/report/excel', {
-        mediaId: this.mediaId,
-        discount: this.discount,
-        accountIds: this.accountId,
-        startDate: this.dateValue[0].format('YYYY-MM-DD'),
-        endDate: this.dateValue[1].format('YYYY-MM-DD'),
-        hour: this.timeSelectValue,
-        target: this.target,
-        order: this.order,
+      let columns = column.splice(4)
+      // "mediaId":"",
+      // "projects":[],
+      // "columns":"",
+      // "startDate":"",
+      // "endDate":"",
+      // "channelType":"",
+      // "md5":"",
+      // "target":"",
+      // "order":""
+      downFilePost('/overView/excel', {
+        ...this.materialData,
         columns,
+        target: this.target,
+        order: this.order == 'descend' ? 'desc' : 'asc',
+        md5: this.md5,
       }).then((res) => {
         let blob = new Blob([res], {
           type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
@@ -532,11 +575,12 @@ export default {
         let downloadElement = document.createElement('a')
         let href = window.URL.createObjectURL(blob) //创建下载的链接
         downloadElement.href = href
-        downloadElement.download = moment().format('YYYY-MM-DD') + '账户报表.xlsx' //下载后文件名
+        downloadElement.download = this.materialData.startDate + '~' + this.materialData.endDate + '素材报表.xlsx' //下载后文件名
         document.body.appendChild(downloadElement)
         downloadElement.click() //点击下载
         document.body.removeChild(downloadElement) //下载完成移除元素
         window.URL.revokeObjectURL(href) //释放掉blob对象
+        this.excelLoading = false
       })
     },
     tableChange(data) {
@@ -561,7 +605,36 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      this.materialData = JSON.parse(localStorage.getItem('materialParams'))
+      this.postDataAction('/toutiao/videoReportDaily/getColumnJson', {
+        columnType: 11,
+      }).then((res) => {
+        // console.log(res)
+        if (res.success) {
+          // console.log(JSON.parse(res.result))
+          if (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) {}
+                  }
+                })
+                columns = columns.slice(columnsFixd.length)
+                this.columns = [...columnsFixd, ...columns]
+
+                // this.tableHandle()
+              }
+
+              // console.log(this.columns)
+            }
+          }
+
+          this.changeColumn(this.columns)
+        }
+      })
+
+      this.materialData = JSON.parse(localStorage.getItem('TtmaterialParams'))
       this.getMoreVideoList(this.materialData)
     })
   },

+ 99 - 36
src/views/modules/Statistics/materialReport/materialReport.vue

@@ -4,6 +4,22 @@
 }
 </style>
 <style scoped>
+.bg {
+  width: 100%;
+  height: 100%;
+}
+.bg:after {
+  content: '';
+  width: 110%;
+  height: 110%;
+  position: absolute;
+  left: -5%;
+  top: -5%;
+  background: inherit;
+  filter: blur(10px);
+  z-index: 2;
+  background: rgba(0, 0, 0, 0.8);
+}
 .top-ul-style {
   width: 100%;
   padding-left: 0;
@@ -35,7 +51,7 @@
       <a-tabs type="card">
         <a-tab-pane key="1">
           <span slot="tab">
-            <a-icon type="apple" />
+            <a-icon type="unordered-list" />
             大盘
           </span>
         </a-tab-pane>
@@ -86,7 +102,7 @@
               showSearch
               :filterOption="filterOption"
             >
-              <a-select-option value="no" disabled v-if="dataDimensionList.length==0&&specificLoading">
+              <a-select-option value="no" disabled v-if="dataDimensionList.length == 0 && specificLoading">
                 数据请求中,请稍后。。。
               </a-select-option>
               <a-select-option v-for="(item, index) in dataDimensionList" :key="index" :value="item.projectId">
@@ -97,10 +113,12 @@
         </div>
 
         <div class="item" style="float: right">
-          <a-button @click="handleSubmit" type="primary" :loading="spinning" :disabled="dateValue.length == 0"
+          <a-button @click="handleSubmit" type="primary" :loading="searchLoading" :disabled="dateValue.length == 0"
             >搜索</a-button
           >
-          <a-button @click="resetSubmit" style="margin-left: 15px" :loading="spinning">重置</a-button>
+          <a-button @click="resetSubmit" style="margin-left: 15px" :disabled="spinning" :loading="resetLoading"
+            >重置</a-button
+          >
         </div>
       </div>
     </div>
@@ -108,7 +126,7 @@
       <a-row :gutter="24" style="margin-top: 20px">
         <a-col :sm="24" :md="12" :xl="6">
           <chart-card :loading="loading" title="总消耗" :total="cost | decimalsHandle">
-            <a-tooltip title="当前时间段的总消耗" slot="action">
+            <a-tooltip title="筛选时段内总消耗数据" slot="action">
               <a-icon type="info-circle-o" />
             </a-tooltip>
             <div slot="percentage">
@@ -129,7 +147,7 @@
         </a-col>
         <a-col :sm="24" :md="12" :xl="6">
           <chart-card :loading="loading" title="视频总数" :total="videoTotal + ''">
-            <a-tooltip title="当前时间段上新" slot="action">
+            <a-tooltip title="筛选时段内上新视频总数" slot="action">
               <a-icon type="info-circle-o" />
             </a-tooltip>
             <div slot="percentage">
@@ -146,7 +164,7 @@
         </a-col>
         <a-col :sm="24" :md="12" :xl="6">
           <chart-card :loading="loading" title="爆款视频" total="-">
-            <a-tooltip title="当前时间段爆款视频" slot="action">
+            <a-tooltip title="筛选时段内双周消耗大于等于5w的视频总数" slot="action">
               <a-icon type="info-circle-o" />
             </a-tooltip>
 
@@ -164,7 +182,7 @@
         </a-col>
         <a-col :sm="24" :md="12" :xl="6">
           <chart-card :loading="loading" title="有效视频" total="-">
-            <a-tooltip title="当前时间段有效视频" slot="action">
+            <a-tooltip title="筛选时段内一周消耗大于等于5000的视频总数" slot="action">
               <a-icon type="info-circle-o" />
             </a-tooltip>
             <div slot="percentage">
@@ -204,14 +222,15 @@
           <a-card title="标签占比" style="width: 100%" :bordered="false">
             <div class="echart">
               <div class="echartBody">
-                <div
+                <a-empty style="height: 350px; position: relative" />
+                <!-- <div
                   id="echartCircular"
                   ref="echartCircular"
                   style="height: 350px"
                   :style="{ width: (clientWidth / 24) * 6 - 48 - 24 + 'px' }"
                 >
-                  <!-- <a-empty style="position: relative; top: 50%; margin-top: -65px" /> -->
-                </div>
+                 
+                </div> -->
               </div>
             </div>
           </a-card>
@@ -224,32 +243,59 @@
             <a slot="extra" @click="getMoreVideoList">查看更多</a>
             <ul class="top-ul-style" v-if="videoList.length > 0">
               <li v-for="(item, index) in videoList" :key="index">
-                <div style="display: flex; position: relative; width: 80%">
+                <div style="display: flex; position: relative; width: 80%; cursor: pointer">
                   <span style="position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px"
                     ><img :src="require('./image/' + (index + 1) + '.png')" alt="" style="width: 25px; height: auto"
                   /></span>
                   <div
-                    style="width: 25%; height: 100%; text-align: center; background: #f2f2f2; margin-left: 40px"
-                    class="showShare"
-                    @click="
-                      visibleVideo = true
-                      videoUrlShow = item.url
+                    style="
+                      width: 25%;
+                      height: 100%;
+                      text-align: center;
+                      background: #f2f2f2;
+                      margin-left: 40px;
+                      border-radius: 5px;
+                      position: relative;
                     "
                   >
+                    <div
+                      :style="{
+                        backgroundImage: 'url(' + (item.coverUrl || noImg) + ')',
+                        backgroundSize: 'cover',
+                        backgroundRepeat: 'no-repeat',
+                        backgroundPosition: 'center center',
+                        overflow: 'hidden',
+                        position: 'absolute',
+                        top: '0',
+                        zIndex: '0',
+                      }"
+                      class="showShare bg"
+                      @click="
+                        visibleVideo = true
+                        videoUrlShow = item.url
+                      "
+                    ></div>
                     <img
                       :src="item.coverUrl || noImg"
-                      style="width: auto; height: 100%; max-width: 100%"
+                      style="width: auto; height: 100%; max-width: 100%; position: relative; z-index: 2"
                       alt=""
                       srcset=""
+                      @click="
+                        visibleVideo = true
+                        videoUrlShow = item.url
+                      "
                     />
                   </div>
+
                   <div
                     style="display: flex; flex-flow: column; justify-content: space-between; width: 60%"
                     @click.stop="toDetail(item.signature)"
                   >
-                    <p style="margin-left: 10px">{{ item.materialName ? item.materialName : '无素材名称' }}</p>
+                    <p style="margin-left: 10px; color: #1890ff">
+                      {{ item.materialName ? item.materialName : '无素材名称' }}
+                    </p>
                     <p style="margin-left: 10px; margin-bottom: 0" v-if="item.tag">
-                      <a-tag v-for="(items, index) in item.tag.split(',')" :key="index" style="margin-right: 5px">{{
+                      <a-tag v-for="(items, index) in item.tag.split(',')" :key="index" style="margin-right: 5px" v-if="index<=3">{{
                         items
                       }}</a-tag>
                     </p>
@@ -372,14 +418,17 @@ export default {
       },
 
       dateRanges: {
-        今天: [moment(), moment()],
         昨天: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
-        近一周: [moment().subtract(7, 'days'), moment()],
-        近一月: [moment().subtract(1, 'months'), moment()],
-        近半年: [moment().subtract(6, 'months'), moment()],
-        近一年: [moment().subtract(12, 'months'), moment()],
+        // 今天: [moment(), moment()],
+
+        近三天: [moment().subtract(3, 'days'), moment().subtract(1, 'days')],
+        近一周: [moment().subtract(7, 'days'), moment().subtract(1, 'days')],
+        近14天: [moment().subtract(14, 'days'), moment().subtract(1, 'days')],
+        近一月: [moment().subtract(1, 'months'), moment().subtract(1, 'days')],
+        近半年: [moment().subtract(6, 'months'), moment().subtract(1, 'days')],
+        近一年: [moment().subtract(12, 'months'), moment().subtract(1, 'days')],
       },
-      dateValue: [moment().subtract(7, 'days'), moment()],
+      dateValue: [moment().subtract(7, 'days'), moment().subtract(1, 'days')],
       dataDimension: 'a',
       mediaDimension: 'b',
       dataDimensionValue: [],
@@ -388,6 +437,8 @@ export default {
       order: 'descend',
       target: 'cost',
       clientWidth: 0,
+      resetLoading: false,
+      searchLoading: false,
     }
   },
   watch: {
@@ -420,7 +471,7 @@ export default {
     },
     getData() {
       this.spinning = true
-      this.initEchart('echartCircular', this.handlerAgeOption([]))
+      // this.initEchart('echartCircular', this.handlerAgeOption([]))
       Promise.all([
         this.getSumData(),
         this.getChartDataList(),
@@ -430,9 +481,13 @@ export default {
       ])
         .then((res) => {
           this.spinning = false
+          this.resetLoading = false
+          this.searchLoading = false
         })
         .catch((error) => {
           this.spinning = false
+          this.resetLoading = false
+          this.searchLoading = false
           this.$error({
             title: '页面数据加载出错',
             content: '请刷新重试或联系管理员查询',
@@ -545,17 +600,21 @@ export default {
         projects: this.dataDimensionValue,
       }
       params = JSON.stringify(params)
-      localStorage.setItem('materialParams', params)
+
       if (this.mediaDimension == 'a') {
+        localStorage.setItem('TtmaterialParams', params)
         this.$router.push({ path: '/materialReport/marterialTtList' })
       } else {
+        localStorage.setItem('materialParams', params)
         this.$router.push({ path: '/materialReport/marterialList' })
       }
     },
     toDetail(md5) {
       // /materialReport/marterialDetail
+      var params = { md5: md5, mediaId: this.mediaDimension == 'a' ? 1 : 2 }
+      localStorage.setItem('videoInfo', JSON.stringify(params))
       this.$router.push({
-        path: '/materialReport/marterialDetail?md5=' + md5 + '&mediaId=' + (this.mediaDimension == 'a' ? 1 : 2),
+        path: '/materialReport/marterialDetail',
       })
     },
     getDesignTopList(data) {
@@ -619,10 +678,13 @@ export default {
     },
 
     handleSubmit() {
+      this.spinning = true
+      this.searchLoading = true
       this.ipagination.current = 1
       this.getData()
     },
     resetSubmit() {
+      this.resetLoading = true
       this.dateValue = [moment().subtract(7, 'days'), moment()]
       this.dataDimension = 'a'
       this.mediaDimension = 'b'
@@ -731,6 +793,7 @@ export default {
         },
         series: [
           {
+            smooth: true,
             name: '消耗',
             type: 'line',
             stack: '总量',
@@ -738,7 +801,7 @@ export default {
               return item.cost.toFixed(3)
             }),
             symbol: 'circle',
-            symbolSize: 10,
+            symbolSize: 6,
             lineStyle: {
               normal: {
                 width: 2,
@@ -882,30 +945,30 @@ export default {
 </style>
 <style>
 .materialReport .card-containers {
-  overflow: hidden!important;
+  overflow: hidden !important;
   /* padding: 24px; */
 }
 .materialReport .card-containers > .ant-tabs-card > .ant-tabs-content {
   /* height: 120px; */
-  margin-top: -16px!important;
+  margin-top: -16px !important;
 }
 
 .materialReport .card-containers > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
-  background: #fff!important;
+  background: #fff !important;
   /* padding: 16px; */
 }
 
 .materialReport .card-containers > .ant-tabs-card > .ant-tabs-bar {
-  border-color: #fff!important;
+  border-color: #fff !important;
 }
 
 .materialReport .card-containers > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
-  border-color: transparent!important;
+  border-color: transparent !important;
   background: transparent !important;
 }
 
 .materialReport .card-containers > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
-  border-color: #fff!important;
+  border-color: #fff !important;
   background: #fff !important;
 }
 </style>

+ 2 - 9
src/views/modules/workBench/designLeader/platForm.vue

@@ -208,13 +208,12 @@ export default {
     },
     methods: {
         orderDetail(item){
-            console.log(item)
+            
             this.$parent.currentTabComponent='orderDetail';
             this.$parent.orderId=item.id
         },
         goOrderList(val){
-            console.log(val);
-            // console.log(this.$parent)
+            
             this.$parent.currentTabComponent='orderList';
             this.$parent.orderStatus=val
             
@@ -242,7 +241,6 @@ export default {
                 pageSize:8,
             }
             getAction('/platform/order/listByCreatorOrDesignLeader',params).then(res=>{
-                console.log(res);
                 this.loading=false;
                 this.orderProgressSpinning=false;
                 if(res.success){
@@ -256,14 +254,12 @@ export default {
         getOperationRecord(){
             this.spinning=true;
             getAction('/platform/operateRecord/createDesc').then(res=>{
-                console.log(res)
                  this.spinning=false;
                 if(res.success){
                     this.operateRecordList=res.result.list.map((item,index)=>{
                        
                             let time='';
                             let startTime=moment(item.createTime)
-                            console.log() 
                             if(moment().diff(startTime,'hours')>24){
                                 time=item.createTime.split(/[ ]+/)[0]
                                 return {
@@ -299,7 +295,6 @@ export default {
         },
         
         scrollRecord(){
-            console.log(this.$refs.scrollRecord);
             this.TimerObj=setInterval(()=>{
                 this.getOperationRecord()
 
@@ -309,7 +304,6 @@ export default {
         // 获取工作台内容
         getPlantformInfo(){
             getAction('/platform/query/jobContent').then(res=>{
-                console.log(res)
                 if(res.success){
                     if(this.$parent.role=='operator'){
                         this.countInfo=res.result.operatorJobContent
@@ -350,7 +344,6 @@ export default {
 
         getidentity(){
             getAction('/platform/query/identity',{}).then(res=>{
-                console.log(res);
                 if(res.success){
                     this.roleInfo=res.result
                 }

+ 85 - 22
src/views/modules/workBench/orderDetail.vue

@@ -507,15 +507,23 @@
                         
                     
                     <div class="section-box">
+
+                        <a-tabs v-model="activeType" @change="callback">
+                            <a-tab-pane key="1" tab="真人"></a-tab-pane>
+                            <a-tab-pane key="2" tab="剪辑" force-render></a-tab-pane>
+                        </a-tabs>
+                        <a-button type="primary" @click="getTemplate"  :disabled="selectedRowKeys.length==0"> 批量指派</a-button>
                          <a-table
                             size="middle"
                             :columns="columns"
                             :dataSource="data"
                             id="outTable"
+                            rowKey="id"
                             :pagination="ipagination"
                             :loading="loading"
                             @change="sort"
                             style="word-break: break-all;"
+                            :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,getCheckboxProps:getCheckboxProps }"
                             >
                             <div slot="materialStatus" slot-scope="text" >
                                 <!-- <a-spin :spinning="record.spin" size="small" >
@@ -966,7 +974,7 @@
                                 </a-select>
                             </a-form-model-item>
                             <!-- {{currentMaterial.materialType==1?true:false}} -->
-                            <a-form-model-item  label="拍摄"  ref="shot"  prop="shot" :rules='[{ required: currentMaterial.materialType==1, message: "拍摄人员必须指派" ,trigger: "change" }]'>
+                            <a-form-model-item  label="拍摄"  ref="shot"  prop="shot" :rules="[{ required: currentMaterial.materialType==1||activeType=='1', message: '拍摄人员必须指派' ,trigger: 'change' }]">
                                 <a-select                                   
                                     v-model="formPerson.shot"
                                     showSearch
@@ -1142,6 +1150,7 @@ export default {
     },
     data() {
         return {
+            activeType:'1',
             descriptionlength:'',
             viewImgUrl:'',
             viewImgVisiable:false,
@@ -1191,7 +1200,8 @@ export default {
             userInfo:{},
             roleCode:'',
             tabKey:1,
-
+            selectedRowKeys:[],
+            selectionRows:[],
             columns:[...realColumns],
             data:[],
             loading:false,
@@ -1317,9 +1327,39 @@ export default {
 
             },
             imageinfo:[],
+            batch:false
         }
     },
     methods: {
+        getTemplate(){
+            this.batch = true
+            this.assignVisible=true;
+            this.formPerson={
+                plan:'',
+                shot:'',
+                clip:'',
+            }
+            this.currentMaterial={}
+            this.getProjectId(this.selectionRows[0].projectId)
+        },
+        onSelectChange(selectedRowKeys, selectionRows) {
+            this.selectedRowKeys = selectedRowKeys
+            this.selectionRows = selectionRows
+        },
+        getCheckboxProps(record) {
+        return {
+            props: {
+                disabled: record.materialStatus==2||record.materialStatus==3||record.materialStatus==4||record.materialStatus==5||record.materialStatus==6||record.materialStatus==7
+            },
+        }
+        },
+        //切换页签
+        callback(key) {
+            this.ipagination.current = 1
+            this.selectedRowKeys = []
+            this.selectionRows = []
+            this.materialHttp()
+        },
         //获取表单的某一个属性值
         getFormData(className) {
             return this.form.getFieldValue(className)
@@ -1451,25 +1491,47 @@ export default {
                     console.log(this.formPerson)
                     this.loadingElse=true;
                     if(this.currentMaterial.clip&&this.currentMaterial.plan&&this.currentMaterial.shot){
-                        postAction('/platform/designer/assignAgain',{
-                            id:this.currentMaterial.id,
-                            ...this.formPerson
-                        }).then(res=>{
-                            this.loadingElse=false;
-                            this.assignVisible = false;
-                            this.$message.success(res.message);
-                            this.materialHttp(this.activeKey)
-                        })
+                        
+                            postAction('/platform/designer/assignAgain',{
+                                id:this.currentMaterial.id,
+                                ...this.formPerson
+                            }).then(res=>{
+                                this.loadingElse=false;
+                                this.assignVisible = false;
+                                this.selectedRowKeys=[]
+                                this.selectionRows=[]
+                                this.$message.success(res.message);
+                                this.materialHttp(this.activeKey)
+                            })
+         
+                       
                     }else{
-                        postAction(this.url.assgin,{
-                            id:this.currentMaterial.id,
-                            ...this.formPerson
-                        }).then(res=>{
-                            this.loadingElse=false;
-                            this.assignVisible = false;
-                            this.$message.success(res.message);
-                            this.materialHttp(this.activeKey)
-                        })
+                        if(!this.batch){
+                            postAction(this.url.assgin,{
+                                id:this.currentMaterial.id,
+                                ...this.formPerson
+                            }).then(res=>{
+                                this.loadingElse=false;
+                                this.assignVisible = false;
+                                this.selectedRowKeys=[]
+                                this.selectionRows=[]
+                                this.$message.success(res.message);
+                                this.materialHttp(this.activeKey)
+                            })
+                        }else{
+                            postAction('/platform/designer/batchAssign',{
+                                id:this.selectedRowKeys,
+                                ...this.formPerson
+                            }).then(res=>{
+                                this.loadingElse=false;
+                                this.assignVisible = false;
+                                this.batch = false
+                                this.$message.success(res.message);
+                                this.materialHttp(this.activeKey)
+                                this.selectedRowKeys = []
+                                this.selectionRows = []
+                            })
+                        }
                     }
                    
                 } else {
@@ -1640,12 +1702,13 @@ export default {
             getAction(this.url.materialList,{
                 orderCode:this.currentOrderInfo.orderCode,
                 pageNo:this.ipagination.current,
-                pageSize:this.ipagination.pageSize
+                pageSize:this.ipagination.pageSize,
+                materialType:this.activeType
             }).then(res=>{
                 console.log(res);
                 this.data=[]
                 if(res.success){
-                    this.data=res.result.list;
+                    this.data=res.result.list
                     // this.data=res.result.list.filter(item=>item.materialType==this.tabKey);
                     this.ipagination.total=res.result.total
                     // this.ipagination.total=this.data.length

+ 3 - 3
src/views/modules/workBench/placeOrder.vue

@@ -294,7 +294,7 @@
                         </div>
                         <div class="input-item"> 
                             <a-form-model-item ref="materialAmount"  prop="materialAmount">
-                                <a-input-number :min="1" :max="500"  @change="materialAmountChange" v-model="form.materialAmount" />
+                                <a-input-number :min="1" :max="99"  @change="materialAmountChange" v-model="form.materialAmount" />
                             </a-form-model-item>
                         </div>
                     </div>
@@ -335,7 +335,7 @@
                         </div>
                         <div class="input-item"> 
                             <a-form-model-item ref="realAmount"  prop="realAmount">
-                                 <a-input-number :min="1" :max="500"  @change="realAmountChange" v-model="form.realAmount" />
+                                 <a-input-number :min="1" :max="99"  @change="realAmountChange" v-model="form.realAmount" />
                             </a-form-model-item>
                         </div>
                     </div>
@@ -347,7 +347,7 @@
                         </div>
                         <div class="input-item"> 
                             <a-form-model-item ref="cutAmount"  prop="cutAmount">
-                                 <a-input-number :min="1" :max="500"  @change="cutAmountChange" v-model="form.cutAmount" />
+                                 <a-input-number :min="1" :max="99"  @change="cutAmountChange" v-model="form.cutAmount" />
                             </a-form-model-item>
                         </div>
                     </div>