Browse Source

修改回显

zhuxinbo 5 years ago
parent
commit
4b423b1b69

+ 3 - 3
src/api/manage.js

@@ -148,9 +148,9 @@ export function postFile(URL,parameter) {
     return axios({
         url: URL,
         method: 'post',
-        headers: {
-            'Content-Type': 'multipart/form-data;charset=utf-8',
-        },
+        // headers: {
+        //     'Content-Type': 'multipart/form-data;charset=utf-8',
+        // },
         data: parameter
     })
 }

+ 0 - 12
src/api/statistics.js

@@ -62,18 +62,6 @@ export function getKuaiShouChainRatio(parameter) {
 }
 
 
-// /materialReport/getMaterialAccount
-// userId:
-// 查看当前账户下绑定账号
-export function getMaterialAccount(parameter) {
-    return axios({
-      url: "/materialReport/getMaterialAccount",
-      method: 'post',
-      data: parameter
-    })
-}
-
-
 // /materialReport/getMaterialReportByAccount
 // userId:
 // 分账户

+ 60 - 55
src/views/modules/Statistics/Statistics.vue

@@ -295,7 +295,7 @@ import ACol from 'ant-design-vue/es/grid/Col'
 import moment from 'moment'
 import countTo from 'vue-count-to'
 import lifting from './components/lifting'
-import { getAccountReport, getKsAccountReport, getKsDetail, getReportList } from '@api/video.js'
+import {  getKsAccountReport, getKsDetail, getReportList } from '@api/video.js'
 import { getAction, postAction } from '@/api/manage'
 
 import timeCheck from './components/timeCheck'
@@ -481,11 +481,13 @@ export default {
         { title: '素材曝光数', dataIndex: 'aclick', align: 'center' }
       ]
       getKsAccountReport(params).then(res => {
-        if (res.compared) {
-          this.contrastDataAll = res
-          //   this.drawPieAll(res)
-        } else {
-          this.contrastDataAll = null
+        if (res.success) {
+          if (res.result.compared) {
+            this.contrastDataAll = res.result
+            //   this.drawPieAll(res)
+          } else {
+            this.contrastDataAll = null
+          }
         }
       })
       getKsDetail(params).then(res => {
@@ -493,34 +495,36 @@ export default {
         this.drawSearchLine(this.noTitleKeyTwo, res)
       })
       getReportList(params).then(res => {
-        this.tableCard = [
-          {
-            key: 'small',
-            tab: res[0].beStatDate
-          },
-          {
-            key: 'big',
-            tab: res[0].statDate
-          }
-        ]
-        this.noTitleKeyTableTwo = 'small'
-        if (this.value == 'day') {
-          this.dataAllTableTwo = res[0]
-          this.dataTableTwo = res[0].beComparedDetail.map((item, index) => {
-            return {
-              ...item,
-              statDate: item.statDate + ' ' + item.statHour + '时',
-              key: index
-            }
-          })
-        } else {
-          this.dataAllTableTwo = res[0]
-          this.dataTableTwo = res[0].beComparedDetail.map((item, index) => {
-            return {
-              ...item,
-              key: index
+        if (res.success) {
+          this.tableCard = [
+            {
+              key: 'small',
+              tab: res.result[0].beStatDate
+            },
+            {
+              key: 'big',
+              tab: res.result[0].statDate
             }
-          })
+          ]
+          this.noTitleKeyTableTwo = 'small'
+          if (this.value == 'day') {
+            this.dataAllTableTwo = res.result[0]
+            this.dataTableTwo = res.result[0].beComparedDetail.map((item, index) => {
+              return {
+                ...item,
+                statDate: item.statDate + ' ' + item.statHour + '时',
+                key: index
+              }
+            })
+          } else {
+            this.dataAllTableTwo = res.result[0]
+            this.dataTableTwo = res.result[0].beComparedDetail.map((item, index) => {
+              return {
+                ...item,
+                key: index
+              }
+            })
+          }
         }
       })
     },
@@ -535,31 +539,31 @@ export default {
       this.loading = true
       if (this.active == 1) {
         getReportList(params).then(res => {
-          if (res[0].now.length > 0) {
-            for (let i = 0; i < res[0].now.length; i++) {
-              for (let j = 0; j < res[0].yesterday.length; j++) {
-                if (res[0].now[i].statHour == res[0].yesterday[j].statHour) {
-                  res[0].now[i].yesCost =
-                    (((res[0].now[i].cost - res[0].yesterday[j].cost) / res[0].yesterday[j].cost) * 100).toFixed(2) +
+          if (res.result[0].now.length > 0) {
+            for (let i = 0; i < res.result[0].now.length; i++) {
+              for (let j = 0; j < res.result[0].yesterday.length; j++) {
+                if (res.result[0].now[i].statHour == res.result[0].yesterday[j].statHour) {
+                  res.result[0].now[i].yesCost =
+                    (((res.result[0].now[i].cost - res.result[0].yesterday[j].cost) / res.result[0].yesterday[j].cost) * 100).toFixed(2) +
                     '%'
-                  res[0].now[i].yesPhotoClick =
+                  res.result[0].now[i].yesPhotoClick =
                     (
-                      ((res[0].now[i].photoClick - res[0].yesterday[j].photoClick) / res[0].yesterday[j].photoClick) *
+                      ((res.result[0].now[i].photoClick - res.result[0].yesterday[j].photoClick) / res.result[0].yesterday[j].photoClick) *
                       100
                     ).toFixed(2) + '%'
-                  res[0].now[i].yesPhotoShow =
+                  res.result[0].now[i].yesPhotoShow =
                     (
-                      ((res[0].now[i].photoShow - res[0].yesterday[j].photoShow) / res[0].yesterday[j].photoShow) *
+                      ((res.result[0].now[i].photoShow - res.result[0].yesterday[j].photoShow) / res.result[0].yesterday[j].photoShow) *
                       100
                     ).toFixed(2) + '%'
-                  res[0].now[i].yesAclick =
-                    (((res[0].now[i].aclick - res[0].yesterday[j].aclick) / res[0].yesterday[j].aclick) * 100).toFixed(
+                  res.result[0].now[i].yesAclick =
+                    (((res.result[0].now[i].aclick - res.result[0].yesterday[j].aclick) / res.result[0].yesterday[j].aclick) * 100).toFixed(
                       2
                     ) + '%'
                 }
               }
             }
-            this.dataTable = res[0].now.map((item, index) => {
+            this.dataTable = res.result[0].now.map((item, index) => {
               return {
                 key: index,
                 ...item,
@@ -567,7 +571,7 @@ export default {
                   this.active == 1 || this.active == 2 ? item.statDate + ' ' + item.statHour + '时' : item.statDate
               }
             })
-            this.dataAllTableYester = res[0].yesterday.map((item, index) => {
+            this.dataAllTableYester = res.result[0].yesterday.map((item, index) => {
               return {
                 key: index,
                 ...item,
@@ -580,13 +584,13 @@ export default {
           } else {
             this.dataAllTable = null
             this.dataTable = []
-            this.dataAllTableYester = res[0].yesterday
+            this.dataAllTableYester = res.result[0].yesterday
             this.loading = false
           }
         })
       } else {
         getReportList(params).then(res => {
-          this.dataTable = res.map((item, index) => {
+          this.dataTable = res.result.map((item, index) => {
             return {
               key: index,
               ...item,
@@ -1184,7 +1188,7 @@ export default {
       this.getReportList(checked, this.allValue)
       this.drawLine(checked, this.allValue)
       this.getKsDetail(checked, this.allValue).then(res => {
-        this.drawPie(this.noTitleKey, res)
+        this.drawPie(this.noTitleKey, res.result)
       })
     },
     getKsDetail(type, dateValue) {
@@ -1214,13 +1218,14 @@ export default {
         getKsAccountReport(params).then(res => {
           var dataNew = []
           var dataX = []
-          if (res == '') {
+          if (res.success) {
+            that.kuaishou = res.result
+            //   this.drawPieAll(res)
+          } else {
             that.kuaishou.aclick = 0
             that.kuaishou.cost = 0
             that.kuaishou.photoClick = 0
             that.kuaishou.photoShow = 0
-          } else {
-            that.kuaishou = res
           }
           resolve()
         })
@@ -1468,14 +1473,14 @@ export default {
       var that = this
       that.drawLine(1)
       that.getKsDetail(1).then(res => {
-        that.drawPie('cost', res)
+        that.drawPie('cost', res.result)
       })
       that.getReportList(1, that.allValue)
       upDate = window.setInterval(() => {
         setTimeout(() => {
           that.drawLine(that.active)
           that.getKsDetail(that.active).then(res => {
-            that.drawPie('cost', res)
+            that.drawPie('cost', res.result)
           })
           that.getReportList(that.active, that.allValue)
         }, 0)

+ 29 - 87
src/views/modules/Statistics/accountMaterStatistics.vue

@@ -47,30 +47,6 @@ th div {
       <a-row type="flex" align="middle" justify="space-between" class="panel-body">
         <div class="search-bar" style="width:100%">
           <span>账户选择:</span>
-          <!-- <a-select
-            v-model="appId"
-            showSearch
-            allowClear
-            mode="multiple"
-            placeholder="请选择账户"
-            optionFilterProp="children"
-            style="width: 50%"
-            @focus="handleFocus"
-            @blur="handleBlur"
-            @change="handleChange"
-            :filterOption="true"
-            @search="search"
-            :maxTagCount="1"
-          >
-            <a-select-option
-              v-for="appModel in options"
-              :key="appModel.id + new Date().getTime()"
-              :value="appModel.accountId"
-              >{{ appModel.advertiserName }}&#12288;&#12288;{{ appModel.accountId }}&#12288;&nbsp;&#12288;{{
-                appModel.authName
-              }}&#12288;&#12288;{{ appModel.operationName }}</a-select-option
-            >
-          </a-select> -->
           <treeselect :appId.sync="appId" />
           <a-button type="primary" style="margin:10px" @click="addUser">搜索</a-button>
           <a-button
@@ -80,12 +56,18 @@ th div {
             style="background-color:#67c23a;border-color:#67c23a"
             >刷新</a-button
           >
+          <a-button type="primary" style="margin:10px" @click="getDataResetAll">重置</a-button>
         </div>
       </a-row>
       <a-row>
         <a-col :span="24">
           <a-card :bordered="false" class="search-box">
-            <time-check @getAdd="getAdd" :startValue.sync="startValue" :timeList="timeList"></time-check>
+            <time-check
+              @getAdd="getAdd"
+              :startValue.sync="startValue"
+              :timeList="timeList"
+              ref="timeCheck"
+            ></time-check>
           </a-card>
         </a-col>
       </a-row>
@@ -128,7 +110,7 @@ import ARow from 'ant-design-vue/es/grid/Row'
 import ACol from 'ant-design-vue/es/grid/Col'
 import countTo from 'vue-count-to'
 import moment from 'moment'
-import { getMaterialReportByAccount, getMaterialAccount } from '@api/statistics'
+import { getMaterialReportByAccount } from '@api/statistics'
 import axios from 'axios'
 import lifting from './components/lifting'
 import timeCheck from './components/timeCheck'
@@ -373,22 +355,11 @@ export default {
       data: [],
       columns,
       columnsDetail,
-      options: [],
       list: [],
       appId: [],
       startValue: [],
       allValue: [],
       loading: false,
-      //   pagination: {
-      //     // 分页配置器
-      //     pageSize: 10, // 一页的数据限制
-      //     current: 1, // 当前页
-      //     onChange: current => {
-      //       // 切换分页时的回调,
-      //       // 当在页面定义change事件时,切记要把此处的事件清除,因为这两个事件重叠了,可能到时候会导致一些莫名的bug
-      //       this.pagination.current = current
-      //     }
-      //   },
       rowClick: record => ({
         // 事件
         on: {
@@ -450,51 +421,18 @@ export default {
     handleBlur() {
       console.log('blur')
     },
-    handleFocus() {
-      console.log('focus')
-      if (this.appId.length > 0) {
-        this.options = []
-        for (let i = 0; i < this.list.length; i++) {
-          for (let j = 0; j < this.appId.length; j++) {
-            if (this.list[i].accountId == this.appId[j]) {
-              this.options.push(this.list[i])
-            }
-          }
-        }
-      } else {
-        this.options = this.list
-      }
-    },
-    search(value) {
-      //   console.log(value)
-      this.options = []
-      if (value != '') {
-        this.options = this.list.filter(item => {
-          var data = item.accountId + ' ' + item.authName + ' ' + item.advertiserName + ' ' + item.operationName
-          return data.toLowerCase().indexOf(value.toLowerCase()) > -1
-        })
-        this.options = [...this.options]
-        console.log(this.options)
-      } else {
-        if (this.appId.length > 0) {
-          this.options = []
-          for (let i = 0; i < this.list.length; i++) {
-            for (let j = 0; j < this.appId.length; j++) {
-              if (this.list[i].accountId == this.appId[j]) {
-                this.options.push(this.list[i])
-              }
-            }
-          }
-        } else {
-          this.options = this.list
-        }
-      }
-    },
     getDataReset() {
       this.active = 1
       this.allValue = []
       this.addUser()
     },
+    getDataResetAll() {
+      this.active = 1
+      this.$refs.timeCheck.active = 1
+      this.allValue = []
+      this.appId = []
+      this.data = []
+    },
     addUser() {
       this.loading = true
       var that = this
@@ -511,9 +449,18 @@ export default {
         return
       }
       getMaterialReportByAccount(params).then(res => {
-        this.data = res
-        this.ipagination.total = res.length
-        this.loading = false
+        if (res.success) {
+          if (res.result.length > 0) {
+            this.data = res.result
+            this.ipagination.total = res.result.length
+          } else {
+            this.$message.error('选择的账户无数据')
+          }
+          this.loading = false
+        } else {
+          this.$message.error(res.message)
+          this.loading = false
+        }
       })
     },
     getStatistics() {
@@ -540,7 +487,7 @@ export default {
       }
       this.active = checked
       active = checked
-      this.pagination.current = 1
+      this.ipagination.current = 1
       this.addUser(checked)
     },
     dianji() {
@@ -550,12 +497,7 @@ export default {
   watch: {},
   distoryed() {},
   mounted: function() {
-    this.$nextTick(() => {
-      getMaterialAccount({ userId: this.userInfo().id }).then(res => {
-        this.list = res
-        this.options = res
-      })
-    })
+    this.$nextTick(() => {})
   }
 }
 </script>

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

@@ -51,11 +51,25 @@ export default {
       default() {
         return true
       }
-    }
+    },
+    appId: {}
   },
   components: { Treeselect },
   watch: {
-    $route(n, o) {}
+    $route(n, o) {},
+    appId: {
+      handler(n, o) {
+        console.log(n)
+        if (n.length == 0) {
+          if (this.multiple) {
+            this.value = []
+          } else {
+            this.value = ''
+          }
+        }
+      },
+      deep: true
+    }
   },
   methods: {
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
@@ -124,6 +138,7 @@ export default {
       })
     }
   },
+
   mounted() {
     this.getParticipateList()
   }

+ 38 - 34
src/views/modules/Statistics/components/ratioModal.vue

@@ -195,40 +195,44 @@ export default {
         params.accountId = md5.accountId
       }
       getKuaiShouChainRatio(params).then(res => {
-        if (res.contrast) {
-          var now = {
-            key: 1,
-            ...res.contrast,
-            statDate:
-              active == 1 || active == 2 ? res.contrast.statDate : res.contrast.startDate + ' ~ ' + res.contrast.endDate
-          }
-          var yesterday = {
-            key: 2,
-            ...res.beContrast,
-            statDate:
-              active == 1 || active == 2
-                ? res.beContrast.statDate
-                : res.beContrast.startDate + ' ~ ' + res.beContrast.endDate
-          }
-          var chainRatio = {
-            key: 3,
-            statDate: '环比',
-            photoClickRatio: res.chainRatio.photoClickRatioProportion,
-            conversions: (res.chainRatio.conversionsProportion * 100).toFixed(2) + '%',
-            cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-            impression1kCost: res.chainRatio.impression1kCostProportion,
-            photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
-            bclick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
-            aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
-            photoClickCost: res.chainRatio.photoClickCostProportion,
-            conversionPrice: res.chainRatio.conversionPriceProportion,
-            actionRatio: res.chainRatio.actionRatioProportion,
-            actionCost: res.chainRatio.actionCostProportion,
-            photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%'
-          }
-          this.dataDetail.push(now)
-          this.dataDetail.push(yesterday)
-          this.dataDetail.push(chainRatio)
+        if (res.success) {
+          if (res.result.contrast) {
+            var now = {
+              key: 1,
+              ...res.result.contrast,
+              statDate:
+                active == 1 || active == 2
+                  ? res.result.contrast.statDate
+                  : res.result.contrast.startDate + ' ~ ' + res.result.contrast.endDate
+            }
+            var yesterday = {
+              key: 2,
+              ...res.result.beContrast,
+              statDate:
+                active == 1 || active == 2
+                  ? res.result.beContrast.statDate
+                  : res.result.beContrast.startDate + ' ~ ' + res.result.beContrast.endDate
+            }
+            var chainRatio = {
+              key: 3,
+              statDate: '环比',
+              photoClickRatio: res.result.chainRatio.photoClickRatioProportion,
+              conversions: (res.result.chainRatio.conversionsProportion * 100).toFixed(2) + '%',
+              cost: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
+              impression1kCost: res.result.chainRatio.impression1kCostProportion,
+              photoClick: (res.result.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
+              bclick: (res.result.chainRatio.bClickProportion * 100).toFixed(2) + '%',
+              aclick: (res.result.chainRatio.aClickProportion * 100).toFixed(2) + '%',
+              photoClickCost: res.result.chainRatio.photoClickCostProportion,
+              conversionPrice: res.result.chainRatio.conversionPriceProportion,
+              actionRatio: res.result.chainRatio.actionRatioProportion,
+              actionCost: res.result.chainRatio.actionCostProportion,
+              photoShow: (res.result.chainRatio.showProportion * 100).toFixed(2) + '%'
+            }
+            this.dataDetail.push(now)
+            this.dataDetail.push(yesterday)
+            this.dataDetail.push(chainRatio)
+          } 
           this.loading = false
         } else {
           this.visible = true

+ 167 - 140
src/views/modules/Statistics/dataDisplayStatistics.vue

@@ -104,6 +104,7 @@ th div {
             style="width:100px"
           />
           <a-button type="primary" style="margin:10px" @click="addUser">搜索</a-button>
+
           <a-button
             type="primary"
             icon="reload"
@@ -111,6 +112,7 @@ th div {
             style="background-color:#67c23a;border-color:#67c23a"
             >刷新</a-button
           >
+          <a-button type="primary" @click="getDataResetAll" style="color:white;margin-left:10px">重置</a-button>
         </div>
       </a-row>
       <a-row>
@@ -532,6 +534,20 @@ export default {
       this.$refs.timeCheck.active = 1
       this.addUser()
     },
+    getDataResetAll() {
+      this.active = 1
+      this.allValue = []
+      this.$refs.timeCheck.active = 1
+      var that = this
+      that.kuaishou.aclick = 0
+      that.kuaishou.cost = 0
+      that.kuaishou.photoClick = 0
+      that.kuaishou.photoShow = 0
+      that.kuaishou.discountCost = 0
+      this.data = []
+      this.appId = []
+      this.drawPie(1, [])
+    },
     addUser() {
       var that = this
       if (this.appId.length > 0) {
@@ -545,16 +561,18 @@ export default {
         }
 
         getReportList(params).then(res => {
-          if (res == '') {
-            that.kuaishou.aclick = 0
-            that.kuaishou.cost = 0
-            that.kuaishou.photoClick = 0
-            that.kuaishou.photoShow = 0
-            that.kuaishou.discountCost = 0
-          } else {
-            that.kuaishou = res.summary
-            that.dataDetail = res.trend
-            that.drawPie(that.noTitleKey, res.trend)
+          if (res.success) {
+            if (res.result) {
+              that.kuaishou = res.result.summary
+              that.dataDetail = res.result.trend
+              that.drawPie(that.noTitleKey, res.result.trend)
+            } else {
+              that.kuaishou.aclick = 0
+              that.kuaishou.cost = 0
+              that.kuaishou.photoClick = 0
+              that.kuaishou.photoShow = 0
+              that.kuaishou.discountCost = 0
+            }
           }
         })
         that.getStatistics()
@@ -575,141 +593,150 @@ export default {
       this.data = []
       getStatistics(params).then(res => {
         console.log(res)
-        if (res.accountDetail) {
-          this.data = res.accountDetail.map((item, index) => {
-            return {
-              key: index,
-              ...item,
-              photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
-              cpm: item.cpm ? item.cpm.toFixed(2) : 0,
-              cost: item.cost.toFixed(2),
-              cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
-              costY: (item.cost / this.discount).toFixed(2),
-              beforeFormPrice: item.formPrice
-                ? item.formPrice.toFixed(2)
-                : item.activationPrice
-                ? item.activationPrice.toFixed(2)
-                : 0,
-              afterFormPrice: item.formPrice
-                ? (item.formPrice / this.discount).toFixed(2)
-                : item.activationPrice
-                ? (item.activationPrice / this.discount).toFixed(2)
-                : 0,
-              date: this.statHour ? res.statDate + '  ' + this.statHour : res.statDate,
-              formCount: item.formCount > 0 ? item.formCount : item.activationCount
-            }
-          })
-          var index = this.data.length
-          if (this.active == 1) {
-            var allNow = {
-              key: index + 1,
-              ...res.now,
-              photoClickRatio: res.now.photoClickRatio ? (res.now.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
-              cpm: res.now.cpm ? res.now.cpm.toFixed(2) : 0,
-              cost: res.now.cost.toFixed(2),
-              cvr: res.now.cvr ? (res.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
-              costY: (res.now.cost / this.discount).toFixed(2),
-              accountId: '总计',
-              beforeFormPrice: res.now.formPrice
-                ? res.now.formPrice.toFixed(2)
-                : res.now.activationPrice
-                ? res.now.activationPrice.toFixed(2)
-                : 0,
-              afterFormPrice: res.now.formPrice
-                ? (res.now.formPrice / this.discount).toFixed(2)
-                : res.now.activationPrice
-                ? (res.now.activationPrice / this.discount).toFixed(2)
-                : 0,
-              formCount: res.now.formCount > 0 ? res.now.formCount : res.now.activationCount
-            }
-            var allYesterday = {
-              key: index + 2,
-              ...res.yesterday,
-              photoClickRatio: res.yesterday.photoClickRatio
-                ? (res.yesterday.photoClickRatio * 100).toFixed(2) + '%'
-                : 0 + '%',
-              cpm: res.yesterday.cpm ? res.yesterday.cpm.toFixed(2) : 0,
-              cost: res.yesterday.cost.toFixed(2),
-              cvr: res.yesterday.cvr ? (res.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
-              costY: (res.yesterday.cost / this.discount).toFixed(2),
-              accountId: '昨日总计',
-              beforeFormPrice: res.yesterday.formPrice
-                ? res.yesterday.formPrice.toFixed(2)
-                : res.yesterday.activationPrice
-                ? res.yesterday.activationPrice.toFixed(2)
-                : 0,
-              afterFormPrice: res.yesterday.formPrice
-                ? (res.yesterday.formPrice / this.discount).toFixed(2)
-                : res.yesterday.activationPrice
-                ? (res.yesterday.activationPrice / this.discount).toFixed(2)
-                : 0,
-              formCount: res.yesterday.formCount > 0 ? res.yesterday.formCount : res.yesterday.activationCount
-            }
-            var chainRatio = {
-              key: index + 3,
-              cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-              photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%',
-              photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
-              aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
-              photoClickRatio: res.chainRatio.photoClickRatioProportion
-                ? (res.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
-                : 0.0 + '%',
-              cvr: (res.chainRatio.cvrProportion * 100).toFixed(2) + '%',
-              cpm: (res.chainRatio.cpmProportion * 100).toFixed(2) + '%',
-              bClick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
-              formCount: res.chainRatio.formCountProportion
-                ? (res.chainRatio.formCountProportion * 100).toFixed(2) + '%'
-                : res.chainRatio.activationCountProportion
-                ? (res.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
-                : 0.0 + '%',
-              beforeFormPrice: res.chainRatio.beforeFormPriceProportion
-                ? (res.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
-                : res.chainRatio.beforeActivationPriceProportion
-                ? (res.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
-                : 0.0 + '%',
+        if (res.success) {
+          if (res.result.accountDetail) {
+            this.data = res.result.accountDetail.map((item, index) => {
+              return {
+                key: index,
+                ...item,
+                photoClickRatio: item.photoClickRatio ? (item.photoClickRatio * 100).toFixed(2) + '%' : 0 + '%',
+                cpm: item.cpm ? item.cpm.toFixed(2) : 0,
+                cost: item.cost.toFixed(2),
+                cvr: item.cvr ? (item.cvr * 100).toFixed(2) + '%' : 0 + '%',
+                costY: (item.cost / this.discount).toFixed(2),
+                beforeFormPrice: item.formPrice
+                  ? item.formPrice.toFixed(2)
+                  : item.activationPrice
+                  ? item.activationPrice.toFixed(2)
+                  : 0,
+                afterFormPrice: item.formPrice
+                  ? (item.formPrice / this.discount).toFixed(2)
+                  : item.activationPrice
+                  ? (item.activationPrice / this.discount).toFixed(2)
+                  : 0,
+                date: this.statHour ? res.result.statDate + '  ' + this.statHour : res.result.statDate,
+                formCount: item.formCount > 0 ? item.formCount : item.activationCount
+              }
+            })
+            var index = this.data.length
+            if (this.active == 1) {
+              var allNow = {
+                key: index + 1,
+                ...res.result.now,
+                photoClickRatio: res.result.now.photoClickRatio
+                  ? (res.result.now.photoClickRatio * 100).toFixed(2) + '%'
+                  : 0 + '%',
+                cpm: res.result.now.cpm ? res.result.now.cpm.toFixed(2) : 0,
+                cost: res.result.now.cost.toFixed(2),
+                cvr: res.result.now.cvr ? (res.result.now.cvr * 100).toFixed(2) + '%' : 0 + '%',
+                costY: (res.result.now.cost / this.discount).toFixed(2),
+                accountId: '总计',
+                beforeFormPrice: res.result.now.formPrice
+                  ? res.result.now.formPrice.toFixed(2)
+                  : res.result.now.activationPrice
+                  ? res.result.now.activationPrice.toFixed(2)
+                  : 0,
+                afterFormPrice: res.result.now.formPrice
+                  ? (res.result.now.formPrice / this.discount).toFixed(2)
+                  : res.result.now.activationPrice
+                  ? (res.result.now.activationPrice / this.discount).toFixed(2)
+                  : 0,
+                formCount: res.result.now.formCount > 0 ? res.result.now.formCount : res.result.now.activationCount
+              }
+              var allYesterday = {
+                key: index + 2,
+                ...res.result.yesterday,
+                photoClickRatio: res.result.yesterday.photoClickRatio
+                  ? (res.result.yesterday.photoClickRatio * 100).toFixed(2) + '%'
+                  : 0 + '%',
+                cpm: res.result.yesterday.cpm ? res.result.yesterday.cpm.toFixed(2) : 0,
+                cost: res.result.yesterday.cost.toFixed(2),
+                cvr: res.result.yesterday.cvr ? (res.result.yesterday.cvr * 100).toFixed(2) + '%' : 0 + '%',
+                costY: (res.result.yesterday.cost / this.discount).toFixed(2),
+                accountId: '昨日总计',
+                beforeFormPrice: res.result.yesterday.formPrice
+                  ? res.result.yesterday.formPrice.toFixed(2)
+                  : res.result.yesterday.activationPrice
+                  ? res.result.yesterday.activationPrice.toFixed(2)
+                  : 0,
+                afterFormPrice: res.result.yesterday.formPrice
+                  ? (res.result.yesterday.formPrice / this.discount).toFixed(2)
+                  : res.result.yesterday.activationPrice
+                  ? (res.result.yesterday.activationPrice / this.discount).toFixed(2)
+                  : 0,
+                formCount:
+                  res.result.yesterday.formCount > 0
+                    ? res.result.yesterday.formCount
+                    : res.result.yesterday.activationCount
+              }
+              var chainRatio = {
+                key: index + 3,
+                cost: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
+                photoShow: (res.result.chainRatio.showProportion * 100).toFixed(2) + '%',
+                photoClick: (res.result.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
+                aclick: (res.result.chainRatio.aClickProportion * 100).toFixed(2) + '%',
+                photoClickRatio: res.result.chainRatio.photoClickRatioProportion
+                  ? (res.result.chainRatio.photoClickRatioProportion * 100).toFixed(2) + '%'
+                  : 0.0 + '%',
+                cvr: (res.result.chainRatio.cvrProportion * 100).toFixed(2) + '%',
+                cpm: (res.result.chainRatio.cpmProportion * 100).toFixed(2) + '%',
+                bClick: (res.result.chainRatio.bClickProportion * 100).toFixed(2) + '%',
+                formCount: res.result.chainRatio.formCountProportion
+                  ? (res.result.chainRatio.formCountProportion * 100).toFixed(2) + '%'
+                  : res.result.chainRatio.activationCountProportion
+                  ? (res.result.chainRatio.activationCountProportion * 100).toFixed(2) + '%'
+                  : 0.0 + '%',
+                beforeFormPrice: res.result.chainRatio.beforeFormPriceProportion
+                  ? (res.result.chainRatio.beforeFormPriceProportion * 100).toFixed(2) + '%'
+                  : res.result.chainRatio.beforeActivationPriceProportion
+                  ? (res.result.chainRatio.beforeActivationPriceProportion * 100).toFixed(2) + '%'
+                  : 0.0 + '%',
 
-              afterFormPrice: res.chainRatio.afterFormPriceProportion
-                ? (res.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
-                : res.chainRatio.afterActivationPriceProportion
-                ? (res.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
-                : 0 + '%',
+                afterFormPrice: res.result.chainRatio.afterFormPriceProportion
+                  ? (res.result.chainRatio.afterFormPriceProportion * 100).toFixed(2) + '%'
+                  : res.result.chainRatio.afterActivationPriceProportion
+                  ? (res.result.chainRatio.afterActivationPriceProportion * 100).toFixed(2) + '%'
+                  : 0 + '%',
 
-              costY: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-              accountId: '环比'
+                costY: (res.result.chainRatio.costProportion * 100).toFixed(2) + '%',
+                accountId: '环比'
+              }
+              this.data.push(allNow)
+              this.data.push(allYesterday)
+              this.data.push(chainRatio)
+            } else {
+              var allNow = {
+                key: index + 1,
+                ...res.result.ratioJson,
+                photoClickRatio: res.result.ratioJson.photoClickRatio
+                  ? (res.result.ratioJson.photoClickRatio * 100).toFixed(2) + '%'
+                  : 0 + '%',
+                cpm: res.result.ratioJson.cpm ? res.result.ratioJson.cpm.toFixed(2) : 0,
+                cost: res.result.ratioJson.cost.toFixed(2),
+                cvr: res.result.ratioJson.cvr ? (res.result.ratioJson.cvr * 100).toFixed(2) + '%' : 0 + '%',
+                costY: (res.result.ratioJson.cost / this.discount).toFixed(2),
+                accountId: '总计',
+                beforeFormPrice: res.result.ratioJson.formPrice
+                  ? res.result.ratioJson.formPrice.toFixed(2)
+                  : res.result.ratioJson.activationPrice
+                  ? res.result.ratioJson.activationPrice.toFixed(2)
+                  : 0,
+                afterFormPrice: res.result.ratioJson.formPrice
+                  ? (res.result.ratioJson.formPrice / this.discount).toFixed(2)
+                  : res.result.ratioJson.activationPrice
+                  ? (res.result.ratioJson.activationPrice / this.discount).toFixed(2)
+                  : 0,
+                formCount: res.result.ratioJson.conversions,
+                beforeFormPrice: res.result.ratioJson.conversionPrice.toFixed(2),
+                afterFormPrice: res.result.ratioJson.discountConversionPrice.toFixed(2)
+              }
+              this.data.push(allNow)
             }
-            this.data.push(allNow)
-            this.data.push(allYesterday)
-            this.data.push(chainRatio)
+
+            length = this.data.length
           } else {
-            var allNow = {
-              key: index + 1,
-              ...res.ratioJson,
-              photoClickRatio: res.ratioJson.photoClickRatio
-                ? (res.ratioJson.photoClickRatio * 100).toFixed(2) + '%'
-                : 0 + '%',
-              cpm: res.ratioJson.cpm ? res.ratioJson.cpm.toFixed(2) : 0,
-              cost: res.ratioJson.cost.toFixed(2),
-              cvr: res.ratioJson.cvr ? (res.ratioJson.cvr * 100).toFixed(2) + '%' : 0 + '%',
-              costY: (res.ratioJson.cost / this.discount).toFixed(2),
-              accountId: '总计',
-              beforeFormPrice: res.ratioJson.formPrice
-                ? res.ratioJson.formPrice.toFixed(2)
-                : res.ratioJson.activationPrice
-                ? res.ratioJson.activationPrice.toFixed(2)
-                : 0,
-              afterFormPrice: res.ratioJson.formPrice
-                ? (res.ratioJson.formPrice / this.discount).toFixed(2)
-                : res.ratioJson.activationPrice
-                ? (res.ratioJson.activationPrice / this.discount).toFixed(2)
-                : 0,
-              formCount: res.ratioJson.conversions,
-              beforeFormPrice: res.ratioJson.conversionPrice.toFixed(2),
-              afterFormPrice: res.ratioJson.discountConversionPrice.toFixed(2)
-            }
-            this.data.push(allNow)
+            this.$message.error('暂无数据')
           }
-
-          length = this.data.length
         }
       })
     },

+ 5 - 55
src/views/modules/Statistics/materialStatistics.vue

@@ -119,7 +119,7 @@
 import ARow from 'ant-design-vue/es/grid/Row'
 import ACol from 'ant-design-vue/es/grid/Col'
 import moment from 'moment'
-import { getKuaiShouMaterialMarket, getKuaiShouChainRatio, getMaterialAccount } from '@api/statistics'
+import { getKuaiShouMaterialMarket, getKuaiShouChainRatio } from '@api/statistics'
 import axios from 'axios'
 import { mapGetters } from 'vuex'
 import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
@@ -432,68 +432,21 @@ export default {
         params.endDate = this.allValue[1]
       }
       getKuaiShouMaterialMarket(params).then(res => {
-        if (res.length > 0) {
-          this.data = res.map((item, index) => {
+        if (res.success) {
+          this.data = res.result.map((item, index) => {
             return {
               key: index,
               ...item
             }
           })
           this.loading = false
-          this.ipagination.total = res.length
+          this.ipagination.total = res.result.length
         } else {
+          this.$message.error(res.message)
           this.loading = false
         }
       })
     },
-    getMineList(md5) {
-      this.dataDetail = []
-      this.showVideo = false
-      var params = {}
-      params.type = this.active
-      params.signature = md5
-      getKuaiShouChainRatio(params).then(res => {
-        if (res.contrast) {
-          var now = {
-            key: 1,
-            ...res.contrast,
-            statDate:
-              this.active == 1 || this.active == 2
-                ? res.contrast.statDate
-                : res.contrast.startDate + ' ~ ' + res.contrast.endDate
-          }
-          var yesterday = {
-            key: 2,
-            ...res.beContrast,
-            statDate:
-              this.active == 1 || this.active == 2
-                ? res.beContrast.statDate
-                : res.beContrast.startDate + ' ~ ' + res.beContrast.endDate
-          }
-          var chainRatio = {
-            key: 3,
-            statDate: '环比',
-            photoClickRatio: res.chainRatio.photoClickRatioProportion,
-            conversions: (res.chainRatio.conversionsProportion * 100).toFixed(2) + '%',
-            cost: (res.chainRatio.costProportion * 100).toFixed(2) + '%',
-            impression1kCost: res.chainRatio.impression1kCostProportion,
-            photoClick: (res.chainRatio.photoClickProportion * 100).toFixed(2) + '%',
-            bclick: (res.chainRatio.bClickProportion * 100).toFixed(2) + '%',
-            aclick: (res.chainRatio.aClickProportion * 100).toFixed(2) + '%',
-            photoClickCost: res.chainRatio.photoClickCostProportion,
-            conversionPrice: res.chainRatio.conversionPriceProportion,
-            actionRatio: res.chainRatio.actionRatioProportion,
-            actionCost: res.chainRatio.actionCostProportion,
-            photoShow: (res.chainRatio.showProportion * 100).toFixed(2) + '%'
-          }
-          this.dataDetail.push(now)
-          this.dataDetail.push(yesterday)
-          this.dataDetail.push(chainRatio)
-        } else {
-          this.visible = true
-        }
-      })
-    },
     dianji() {
       this.$router.replace({ path: '/modules/Statistics/accountMaterStatistics' })
     }
@@ -506,9 +459,6 @@ export default {
   mounted: function() {
     this.$nextTick(() => {
       this.getList()
-      getMaterialAccount({ userId: this.userInfo().id }).then(res => {
-        console.log(res)
-      })
     })
   }
 }

+ 1 - 6
src/views/modules/Statistics/refuseData.vue

@@ -64,7 +64,7 @@
 
 <script>
 import moment from 'moment'
-import { getMaterialAccount, getRefuseCreative, updateCreative, selectByCreateName } from '@api/statistics'
+import {  getRefuseCreative, updateCreative, selectByCreateName } from '@api/statistics'
 import axios from 'axios'
 import EditableCell from './components/EditableCell'
 import { mapGetters } from 'vuex'
@@ -145,7 +145,6 @@ export default {
     return {
       title: '被拒创意列表',
       appId: null,
-      options: [],
       loading: false,
       columns,
       dataList: [],
@@ -158,7 +157,6 @@ export default {
       ipagination: {
         current: 1,
         pageSize: 10,
-        //   pageSizeOptions: ['10', '20', '30'],
         showTotal: (total, range) => {
           return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
@@ -242,9 +240,6 @@ export default {
   },
   mounted: function() {
     this.$nextTick(() => {
-      getMaterialAccount({ userId: this.userInfo().id }).then(res => {
-        this.options = res
-      })
     })
   }
 }

+ 110 - 80
src/views/modules/achievements/design.vue

@@ -15,16 +15,6 @@
           <a-tooltip title="指标说明" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
-          <!-- <div>
-            <trend flag="up" style="margin-right: 16px;">
-              <span slot="term">周同比</span>
-              12%
-            </trend>
-            <trend flag="down">
-              <span slot="term">日同比</span>
-              11%
-            </trend>
-          </div> -->
           <template slot="footer"> </template>
         </chart-card>
       </a-col>
@@ -33,16 +23,6 @@
           <a-tooltip title="指标说明" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
-          <!-- <div>
-            <trend flag="up" style="margin-right: 16px;">
-              <span slot="term">周同比</span>
-              12%
-            </trend>
-            <trend flag="down">
-              <span slot="term">日同比</span>
-              11%
-            </trend>
-          </div> -->
           <template slot="footer"> </template>
         </chart-card>
       </a-col>
@@ -51,16 +31,6 @@
           <a-tooltip title="指标说明" slot="action">
             <a-icon type="info-circle-o" />
           </a-tooltip>
-          <!-- <div>
-            <trend flag="up" style="margin-right: 16px;">
-              <span slot="term">周同比</span>
-              12%
-            </trend>
-            <trend flag="down">
-              <span slot="term">日同比</span>
-              11%
-            </trend>
-          </div> -->
           <template slot="footer"> </template>
         </chart-card>
       </a-col>
@@ -99,13 +69,21 @@
             :loading="loading"
             size="middle"
             :pagination="false"
+            @expand="expand"
           >
             <span slot-scope="text" slot="videoUrl">
               <video class="video" :src="text" controls="controls" style="height:200px">
                 您的浏览器不支持 video 标签。
               </video>
             </span>
-            <a-table slot="expandedRowRender" :columns="innerColumns" :dataSource="innerData" :pagination="false">
+            <a-table
+              slot="expandedRowRender"
+              slot-scope="record"
+              :columns="innerColumns"
+              :dataSource="record.innerData"
+              :pagination="false"
+              :loading="childrenLoading"
+            >
             </a-table>
           </a-table>
           <template class="ant-card-actions" slot="actions" v-if="dataList.length > 3">
@@ -118,7 +96,7 @@
       <a-col :span="8">
         <a-card :loading="loading" :bordered="false" title="当前可获得绩效" :style="{ marginTop: '24px' }">
           <div style="height:250px;text-align:center;line-height:230px;font-size:80px">
-            {{ dataCount.performance }}
+            {{ performance.toFixed(2) }}
           </div>
         </a-card>
       </a-col>
@@ -128,8 +106,10 @@
             <a-list itemLayout="horizontal" :dataSource="data">
               <a-list-item slot="renderItem" slot-scope="item, index">
                 <a-list-item-meta style="width:50%">
-                  <div slot="description">有效率{{ item.effiRate + '%' }}</div>
-                  <a slot="title" href="https://vue.ant.design/">{{ item.name }}</a>
+                  <a slot="title" style="font-size:16px">
+                    <span style="display:inline-block;width:80px">{{ item.realname }}</span
+                    ><span style="margin-left:20px">有效率:{{ item.effiRate + '%' }}</span>
+                  </a>
                   <a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
                 </a-list-item-meta>
                 <div></div>
@@ -163,14 +143,14 @@
       </a-col>
     </a-row>
     <a-modal title="人员排名" :visible="visible" @ok="handleOk('visible')" @cancel="handleCancel('visible')">
-      <a-list itemLayout="horizontal" :dataSource="data">
+      <a-list itemLayout="horizontal" :dataSource="dataTop" :loading="loadingList">
         <a-list-item slot="renderItem" slot-scope="item, index">
           <a-list-item-meta style="width:50%">
-            <div slot="description">有效率{{ index }}%</div>
-            <a slot="title" href="https://vue.ant.design/">{{ item.title }}</a>
+            <div slot="description">有效率{{ item.effiRate }}%</div>
+            <a slot="title" href="https://vue.ant.design/">{{ item.realname }}</a>
             <a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
           </a-list-item-meta>
-          <div></div>
+          <div style="text-align:center;width:100%;font-size:16px">{{ index + 1 }}</div>
         </a-list-item>
       </a-list>
     </a-modal>
@@ -200,8 +180,11 @@ import HeadInfo from '@/components/tools/HeadInfo.vue'
 
 import Trend from '@/components/Trend'
 
-import { getAction } from '@/api/manage'
+import { getAction, postAction } from '@/api/manage'
 import { mapGetters } from 'vuex'
+
+import qs from 'qs'
+
 const barData = []
 for (let i = 0; i < 12; i += 1) {
   barData.push({
@@ -221,8 +204,8 @@ const columns = [
   },
   {
     title: '素材跑量',
-    dataIndex: 'videoCost',
-    key: 'videoCost',
+    dataIndex: 'totalCost',
+    key: 'totalCost',
     align: 'center'
   },
   {
@@ -238,6 +221,12 @@ const columns = [
     align: 'center'
   },
   {
+    title: '素材曝光数',
+    dataIndex: 'materialExposureCount',
+    key: 'materialExposureCount',
+    align: 'center'
+  },
+  {
     title: '行为数',
     dataIndex: 'behaviorCount',
     key: 'behaviorCount',
@@ -282,11 +271,11 @@ export default {
       ],
       noTitleKey: 'kuaishou',
       dataCount: {
-        effiVideoCount: 70, //有效数
-        videoCount: 200, //素材总数
-        effiRate: 40, //有效率
-        performance: 20000, //当前绩效
-        cost: 20000 // 总消耗
+        effiVideoCount: 0, //有效数
+        videoCount: 0, //素材总数
+        effiRate: 0, //有效率
+        performance: 0, //当前绩效
+        cost: 0 // 总消耗
       },
       a: '',
       columns,
@@ -295,7 +284,7 @@ export default {
           key: 1,
           videoUrl:
             'https://ctop-media.oss-cn-beijing.aliyuncs.com/video/2019-12-14/%E9%AB%98%E6%B8%85-1576318874426.mp4',
-          videoCost: 34.56,
+          materialExposureCount: 34.56,
           pageClickCount: 1200,
           pageExposureCount: 3939,
           behaviorCount: 5000
@@ -304,49 +293,36 @@ export default {
       innerColumns: [
         {
           title: '素材账户',
-          dataIndex: 'videoAccount',
-          key: 'videoAccount',
-          align: 'center'
-        },
-        {
-          title: '投放账户',
-          dataIndex: 'servingAccount',
-          key: 'servingAccount',
+          dataIndex: 'accountName',
+          key: 'accountName',
           align: 'center'
         },
         {
           title: '跑量',
-          dataIndex: 'cost',
-          key: 'cost',
+          dataIndex: 'totalCost',
+          key: 'totalCost',
           align: 'center'
         }
       ],
-      innerData: [
-        { key: 1, videoAccount: 'aabbcc', servingAccount: 'ttyyhh', cost: 34234.43 },
-        { key: 2, videoAccount: 'aabbcc', servingAccount: 'ttyyhh', cost: 34234.43 }
-      ],
-      data: [
-        // {
-        //   title: '人员1'
-        // },
-        // {
-        //   title: '人员2'
-        // },
-        // {
-        //   title: '人员3'
-        // },
-        { name: 'pipi', effiRate: 50 },
-        { name: 'pipixia', effiRate: 40 },
-        { name: 'pipiqiu', effiRate: 30 }
-      ],
+      innerData: [],
+      data: [],
+      dataTop: [],
       visible: false,
-      visibleVideo: false
+      visibleVideo: false,
+      childrenLoading: false,
+      performance: 0,
+      loadingList: false
     }
   },
   methods: {
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
     getAll(item) {
       this[item] = true
+      if (item == 'visible') {
+        this.loadingList = true
+        this.getTopMany(10, 'dataTop')
+      }
+      //   dataTop
     },
     handleOk(item) {
       this[item] = false
@@ -358,13 +334,67 @@ export default {
     onTabChange(key, type) {
       console.log(key, type)
       this[type] = key
+    },
+    expand(expanded, record) {
+      var params = qs.stringify({
+        materialId: record.id
+      })
+      this.childrenLoading = true
+      if (expanded) {
+        postAction('/ctop/performance2/materialAccountInfo', params).then(res => {
+          if (res.success) {
+            record.innerData = res.result.designMaterialInfoList.map((item, index) => {
+              return {
+                ...item,
+                key: index
+              }
+            })
+            this.childrenLoading = false
+          }
+          if (res.code === 510) {
+            this.$message.warning(res.message)
+          }
+          this.childrenLoading = false
+        })
+      } else {
+        record.innerData = []
+      }
+    },
+    getTopMany(size, list) {
+      var params = qs.stringify({
+        pageSize: size
+      })
+      postAction('/ctop/performance2/effiRateRank', params).then(res => {
+        if (res.success) {
+          this[list] = res.result.userRoleList
+          this.performance = res.result.performance
+          this.loadingList = false
+        }
+      })
     }
   },
   created() {
-    // getAction('/ctop/materialInfo/report', { userId: this.userInfo().id }).then(res => {
-    //   this.dataCount = res
-    // })
-    //   /ctop/materialInfo/report
+    postAction('/ctop/performance2/getPerformanceInfo').then(res => {
+      console.log(res)
+      if (res.success) {
+        this.dataCount = res.result
+      } else {
+        this.$message.error(res.message)
+      }
+    })
+    postAction('/ctop/performance2/materialInfoList', { pageSize: 3 }).then(res => {
+      console.log(res)
+      if (res.success) {
+        this.dataList = res.result.designMaterialInfoList.map((item, index) => {
+          return {
+            ...item,
+            key: index,
+            innerData: []
+          }
+        })
+      }
+    })
+    this.getTopMany(3, 'data')
   }
 }
 </script>

+ 12 - 8
src/views/modules/achievements/optimize.vue

@@ -147,9 +147,9 @@
               </a-list-item>
             </a-list>
           </div>
-          <template class="ant-card-actions" slot="actions">
+          <!-- <template class="ant-card-actions" slot="actions">
             <div @click="getAll('visible')">查看更多</div>
-          </template>
+          </template> -->
         </a-card>
       </a-col>
     </a-row>
@@ -194,6 +194,8 @@ import Trend from '@/components/Trend'
 
 import { getAction } from '@/api/manage'
 import { mapGetters } from 'vuex'
+import qs from 'qs'
+
 const barData = []
 for (let i = 0; i < 12; i += 1) {
   barData.push({
@@ -269,11 +271,11 @@ export default {
       ],
       noTitleKey: 'kuaishou',
       dataCount: {
-        effiVideoCount: 70, //有效数
-        videoCount: 200, //素材总数
-        effiRate: 40, //有效率
-        performance: 20000, //当前绩效
-        cost: 20000 // 总消耗
+        personalTask: 0,
+        royaltyRatio: null,
+        mediaTask: 0,
+        totalCost: 0,
+        totalRoyalty: 0
       },
       a: '',
       columns,
@@ -355,7 +357,9 @@ export default {
   created() {
     getAction('/ctop/performanceOptimizer/detail', { mediaType: 2 }).then(res => {
       console.log(res)
-      this.dataCount = res.userDetail
+      if (res.success) {
+        this.dataCount = res.userDetail
+      }
     })
     getAction('/ctop/performanceOptimizer/ranking/list').then(res => {
       console.log(res)

+ 0 - 5
src/views/modules/kuaishouapp/account/accountIndex.vue

@@ -116,7 +116,6 @@ import countTo from 'vue-count-to'
 import { mapGetters } from 'vuex'
 import { deleteAction, getAction, postAction } from '@/api/manage'
 
-import { getMaterialAccount } from '@api/statistics'
 
 import Treeselect from '@/views/modules/Statistics/components/Treeselect.vue'
 
@@ -200,7 +199,6 @@ export default {
       columns,
       dataList: [],
       appId: '',
-      options: [],
       selectedRowKeys: [],
       selectedRowKeysValue: [],
       allMoney: null,
@@ -423,9 +421,6 @@ export default {
   computed: {},
   activated() {
     this.manyTwo = this.many
-    getMaterialAccount({ userId: this.userInfo().id }).then(res => {
-      this.options = res
-    })
   }
 }
 </script>

+ 94 - 5
src/views/modules/kuaishouapp/account/stepForm/Step2.vue

@@ -188,8 +188,69 @@
           </div>
         </div>
       </a-form-item>
+      <div style="text-align:center;font-size:16px">
+        目标人群
+      </div>
       <targeted-population ref="population" />
-      
+      <div style="text-align:center;font-size:16px">
+        预算和排期
+      </div>
+
+      <a-form-item
+        label="单日预算"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <a-radio-group buttonStyle="solid" v-model="allForm.dayBudget">
+          <a-radio-button value="0">不限</a-radio-button>
+          <a-radio-button value="1">统一预算</a-radio-button>
+        </a-radio-group>
+      </a-form-item>
+      <a-form-item
+        label=" "
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+        class="else-label"
+        v-if="allForm.dayBudget == '1'"
+      >
+        <a-input
+          placeholder="不小于100,不超过100000000,仅支持输入自然数"
+          v-decorator="[
+            'day_budget',
+            {
+              rules: [{ required: true, message: '请填写预算' }, { validator: budgetValue }]
+            }
+          ]"
+        />
+      </a-form-item>
+      <a-form-item
+        label="投放方式"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <a-radio-group buttonStyle="solid" v-decorator="['speed', { initialValue: '1' }]">
+          <a-radio-button value="1">正常投放</a-radio-button>
+          <a-radio-button value="2">平滑投放</a-radio-button>
+        </a-radio-group>
+        <br />
+        <span>
+          {{ getData('speed') == '2' ? '平滑匀速投放' : '尽快展示广告消耗预算' }}
+        </span>
+      </a-form-item>
+      <a-form-item
+        label="排期"
+        :labelCol="{ lg: { span: 7 }, sm: { span: 7 } }"
+        :wrapperCol="{ lg: { span: 10 }, sm: { span: 17 } }"
+      >
+        <!-- v-decorator="['speed', { initialValue: '1' }]" -->
+        <a-radio-group buttonStyle="solid" v-model="allForm.time" @change="setTime">
+          <a-radio-button value="1">从今天开始长期投放</a-radio-button>
+          <a-radio-button value="2">设置开始和结束日期</a-radio-button>
+        </a-radio-group>
+        <br />
+        <a-range-picker v-if="allForm.time == '2'" v-model="timeRange" format="YYYY-MM-DD" :allowClear="false" />
+      </a-form-item>
+      <selectCheckAll style="width:100%"/>
       <a-form-item :wrapperCol="{ span: 20 }" style="text-align: center">
         <a-button htmlType="submit" type="primary" :loading="loading">下一步</a-button>
         <a-button style="margin-left: 8px" @click="prevStep" v-show="step == 1">上一步</a-button>
@@ -207,6 +268,8 @@ import jq from 'jquery'
 import creatApplication from './stepModule/creatApplication.vue'
 import targetedPopulation from './stepModule/targetedPopulation.vue'
 
+import selectCheckAll from './stepModule/test'
+
 let dateQuantumRangeConst = ''
 const columns = [
   {
@@ -250,11 +313,13 @@ const columns = [
     sorter: (a, b) => a.create_time - b.create_time
   }
 ]
+
 export default {
   name: 'BaseForm',
   components: {
     creatApplication,
-    targetedPopulation
+    targetedPopulation,
+    selectCheckAll
   },
   props: {
     campaignId: {
@@ -267,6 +332,7 @@ export default {
 
   data() {
     return {
+      timeRange: [],
       form: this.$form.createForm(this),
       step: 0,
       people: '2',
@@ -293,11 +359,14 @@ export default {
       appId: '',
       loading: false,
       campaignTemplateId: '',
-      campaignType: '2'
+      campaignType: '2',
+      allForm: { dayBudget: '0', time: '1' }
     }
   },
   computed: {
-    count() {}
+    count() {
+      return moment().startOf('day')
+    }
   },
   filters: {
     getDate(value) {
@@ -342,6 +411,16 @@ export default {
     }
   },
   methods: {
+    setTime(e) {
+      //   console.log(moment('2019-12-27'))
+      if (e.target.value == '2') {
+        this.timeRange[0] = moment().startOf('day')
+        this.timeRange[1] = moment().add(1, 'months')
+      }
+    },
+    getData(className) {
+      return this.form.getFieldValue(className)
+    },
     handleConfirmValue(rule, value, callback) {
       if (this.campaignType == '3') {
         if (value == '') {
@@ -361,6 +440,12 @@ export default {
         }
       }
     },
+    budgetValue(rule, value, callback) {
+      if (value < 100 || value > 100000000) {
+        callback('不小于100,不超过100000000,仅支持输入自然数')
+      }
+      callback()
+    },
     handleConfirmBid(rule, value, callback) {
       if (this.bid == 0 || this.bid <= 0.2 || this.bid >= 100) {
         callback('不得低于0.2元,不得高于100元')
@@ -501,7 +586,11 @@ export default {
       return this.form.getFieldValue(className)
     }
   },
-  //   watch
+  watch: {
+    timeSeries(val) {
+      console.log(val)
+    }
+  },
   activated: function() {
     this.$nextTick(() => {
       this.step = localStorage.getItem('step')

+ 453 - 0
src/views/modules/kuaishouapp/account/stepForm/stepModule/selectCheckAll.vue

@@ -0,0 +1,453 @@
+<template>
+  <div class="calendar">
+    <div
+      ref="Tbody"
+      class="schedule"
+      :style="scheduleStyle"
+      @mousemove="onMousemove"
+      @mousedown="onMousedown"
+      @mouseup="onMouseup"
+    ></div>
+    <table class="calendar-table">
+      <thead class="calendar-head">
+        <tr>
+          <th rowspan="8" class="week-td">星期/时间</th>
+          <th :colspan="12 / step">00:00 - 12:00</th>
+          <th :colspan="12 / step">12:00 - 24:00</th>
+        </tr>
+        <tr>
+          <td :colspan="1 / step" v-for="i in 24" :key="i">{{ i }}</td>
+        </tr>
+      </thead>
+      <tbody class="calendar-body" @mousemove="onMousemove" @mousedown="onMousedown" @mouseup="onMouseup">
+        <tr>
+          <td>星期一</td>
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon1"
+            :key="'1,' + i.label"
+            :data-id="'1,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期二</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon2"
+            :key="'2,' + i.label"
+            :data-id="'2,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期三</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon3"
+            :key="'3,' + i.label"
+            :data-id="'3,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期四</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon4"
+            :key="'4,' + i.label"
+            :data-id="'4,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期五</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon5"
+            :key="'5,' + i.label"
+            :data-id="'5,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期六</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon6"
+            :key="'6,' + i.label"
+            :data-id="'6,' + i.label"
+          ></td>
+        </tr>
+        <tr>
+          <td>星期日</td>
+
+          <td
+            class="calendar-time"
+            :class="{ bg: i.value == 1 }"
+            @click="itemClick"
+            v-for="i in dataMon7"
+            :key="'7,' + i.label"
+            :data-id="'7,' + i.label"
+          ></td>
+        </tr>
+      </tbody>
+    </table>
+    <ul>
+      <li v-for="(item, index) in viewDateArr" :key="index">
+        <h2>
+          {{ item.title }}
+        </h2>
+        <p>
+          <span v-for="(it, index) in item.arr" :key="index">{{ item.arr[index + 1] }}</span>
+        </p>
+      </li>
+    </ul>
+  </div>
+</template>
+<script>
+export default {
+  name: 'calendar-table',
+  data() {
+    return {
+      left: 0,
+      top: 0,
+      clientX: 0,
+      clientY: 0,
+      isMousedown: false, // 为true时,才出发mousemove
+      scheduleStyle: {},
+      dateTime: [],
+      viewDateArr: [],
+      step: 0.5,
+      time: 48,
+      dataMon1: [],
+      dataMon2: [],
+      dataMon3: [],
+      dataMon4: [],
+      dataMon5: [],
+      dataMon6: [],
+      dataMon7: []
+    }
+  },
+
+  computed: {},
+  created: {},
+  methods: {
+    //点击事件
+    itemClick(e) {
+      e.preventDefault()
+
+      let dom = e.target
+      //获取class
+      let classListData = Array.from(e.target.classList)
+      let timeId = dom.getAttribute('data-id')
+      if (classListData.includes('bg')) {
+        //选择取消高亮
+        dom.classList.remove('bg')
+        this.dateTime = this.dateTime.filter(e => {
+          return e !== timeId
+        })
+      } else {
+        //添加高亮
+        dom.classList.add('bg')
+        this.dateTime.push(timeId)
+      }
+    },
+    onMousemove(e) {
+      e.preventDefault()
+
+      const { clientX, clientY } = e
+      if (this.isMousedown) {
+        let left = this.left,
+          top = this.top,
+          width = 0,
+          height = 0
+        //判断滑动方向
+
+        width = clientX - this.clientX
+        height = clientY - this.clientY
+        //x轴向左
+        if (clientX < this.clientX) {
+          width = this.clientX - clientX
+          left = this.left - width
+        }
+        if (clientY < this.clientY) {
+          height = this.clientY - clientY
+          top = this.top - height
+        }
+        this.scheduleStyle = {
+          width: `${width}px`,
+          height: `${height}px`,
+          display: 'block',
+          opacity: 0.6,
+          left: `${left}px`,
+          top: `${top}px`
+        }
+        //getBoundingClientRect
+        //节点位置
+
+        let domPoction = this.$refs.Tbody.getBoundingClientRect()
+        let time = document.querySelectorAll('.calendar-time')
+
+        //位置对比
+        // Array.from(time).forEach(ele => {
+        //   let itemPoction = ele.getBoundingClientRect();
+        //   if (
+        //     itemPoction.top + 10 - domPoction.top >= 0 &&
+        //     domPoction.bottom + 10 - itemPoction.bottom >= 0 &&
+        //     itemPoction.left + 5 - domPoction.left >= 0 &&
+        //     domPoction.right + 5 - itemPoction.right >= 0
+        //   ) {
+        //     //在范围内的节点进行操作
+        //     let timeId = ele.getAttribute("data-id");
+        //     ele.classList.add("bg");
+        //     if (!this.dateTime.includes(timeId)) {
+        //       this.dateTime.push(timeId);
+        //     }
+        //   }
+        // });
+      }
+    },
+    // 鼠标按下事件
+    onMousedown(e) {
+      e.preventDefault()
+        
+      const { clientX, clientY } = e
+      this.left = e.pageX
+      this.top = e.pageY
+      this.isMousedown = true
+      this.clientX = clientX
+      this.clientY = clientY
+      //判断滑动方向
+      this.scheduleStyle = {
+        width: `0px`,
+        height: `0px`,
+        display: 'block',
+        opacity: 0.6,
+        left: `${clientX}px`,
+        top: `${clientY}px`
+      }
+    },
+    onMouseup(e) {
+      e.preventDefault()
+
+      this.isMousedown = false
+      this.scheduleStyle = {
+        width: `0px`,
+        height: `0px`,
+        display: 'none',
+        opacity: 0
+      }
+
+      let domPoction = this.$refs.Tbody.getBoundingClientRect()
+      let time = document.querySelectorAll('.calendar-time')
+
+      //位置对比
+      Array.from(time).forEach((ele, index) => {
+        let itemPoction = ele.getBoundingClientRect()
+        if (
+          itemPoction.top + 15 - domPoction.top >= 0 &&
+          domPoction.bottom + 15 - itemPoction.bottom >= 0 &&
+          itemPoction.left + 10 - domPoction.left >= 0 &&
+          domPoction.right + 10 - itemPoction.right >= 0
+        ) {
+          //在范围内的节点进行操作
+          let timeId = ele.getAttribute('data-id')
+          //   ele.classList.remove("bg");
+          var dataArr = timeId.split(',')
+
+          console.log(ele)
+          if (ele.classList.contains('bg')) {
+            this['dataMon' + dataArr[0] + ''][dataArr[1] - 1].value = 0
+          } else {
+            this['dataMon' + dataArr[0] + ''][dataArr[1] - 1].value = 1
+          }
+          if (!this.dateTime.includes(timeId)) {
+            this.dateTime.push(timeId)
+          }
+        }
+      })
+    },
+    setItemDate(sum) {
+      let count = sum / 2
+      let mCount = Math.ceil(count)
+      if (sum % 2 == 0) {
+        return `${count - 1}:30~${count}:00    `
+      } else {
+        return `${mCount - 1}:00~${mCount - 1}:30   `
+      }
+    },
+    screen(key) {
+      switch (key) {
+        case '1':
+          return '星期一'
+          break
+        case '2':
+          return '星期二'
+          break
+        case '3':
+          return '星期三'
+          break
+
+        case '4':
+          return '星期四'
+          break
+
+        case '5':
+          return '星期五'
+          break
+
+        case '6':
+          return '星期六'
+          break
+        case '7':
+          return '星期日'
+          break
+        default:
+          return ''
+          break
+      }
+    }
+  },
+  created() {
+    this.$nextTick(() => {
+      for (let i = 1; i <= this.time; i++) {
+        this.dataMon1.push({ value: 0, label: i })
+        this.dataMon2.push({ value: 0, label: i })
+        this.dataMon3.push({ value: 0, label: i })
+        this.dataMon4.push({ value: 0, label: i })
+        this.dataMon5.push({ value: 0, label: i })
+        this.dataMon6.push({ value: 0, label: i })
+        this.dataMon7.push({ value: 0, label: i })
+      }
+    })
+  },
+  //监听
+  watch: {
+    dateTime(val) {
+      let viewDate = {}
+      let viewDateArr = []
+      val.map(e => {
+        let arr = e.split(',')
+        if (!viewDate.hasOwnProperty(this.screen(arr[0]))) {
+          viewDate[this.screen(arr[0])] = [arr[0], this.setItemDate(arr[1])]
+        } else {
+          if (!viewDate[this.screen(arr[0])].includes(this.setItemDate(arr[1]))) {
+            viewDate[this.screen(arr[0])].push(this.setItemDate(arr[1]))
+          }
+        }
+      })
+      let dataArr = Object.keys(viewDate)
+        .map(k => viewDate[k])
+        .sort((a, b) => Number(a[0]) - Number(b[0]))
+
+      dataArr.forEach(ele => {
+        viewDateArr.push({
+          title: this.screen(ele[0]),
+          arr: ele
+        })
+      })
+      this.viewDateArr = viewDateArr
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+*,
+:after,
+:before {
+  box-sizing: border-box;
+  margin: 0;
+  padding: 0;
+}
+
+table {
+  border-spacing: 0;
+}
+
+.calendar {
+  background-color: #fff;
+  position: relative;
+  display: inline-block;
+
+  .schedule {
+    position: fixed;
+    width: 0;
+    height: 0;
+    top: 0;
+    left: 0;
+    display: block;
+    background: #2f88ff;
+    pointer-events: none;
+    transition: all 400ms ease;
+  }
+
+  .calendar-table {
+    border-collapse: collapse;
+    border-radius: 4px;
+
+    tr,
+    td,
+    th {
+      border: 1px solid #e4e9ed;
+      font-size: 12px;
+      text-align: center;
+      min-width: 11px;
+      height: 21px;
+      transition: background 200ms ease;
+    }
+
+    thead {
+      th,
+      td {
+        background: #f8f9fa;
+      }
+    }
+
+    .calendar-body {
+      tr {
+        td {
+          border: 1px solid #e4e9ed;
+
+          &:hover {
+            background-color: #f1f1f1;
+          }
+
+          &.selected {
+            background-color: #2f88ff;
+          }
+        }
+
+        & > td:first-child {
+          background-color: #f8f9fa;
+        }
+      }
+    }
+  }
+}
+
+td::selection {
+  background: rgba(0, 0, 0, 0);
+}
+
+th::selection {
+  background: rgba(0, 0, 0, 0);
+}
+
+.bg {
+  background: #0099ff;
+}
+</style>

+ 276 - 0
src/views/modules/kuaishouapp/account/stepForm/stepModule/test.vue

@@ -0,0 +1,276 @@
+<template>
+  <div class="calendar">
+    <table class="time_table table" v-on:mouseleave="mouseleave">
+      <thead>
+        <tr>
+          <th rowspan="2">日期/时间</th>
+        </tr>
+        <tr>
+          <th class="unselectable" v-for="(num, index) in numData" :key="index">{{ num }}</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr v-for="(options, index) in timeData" :key="index">
+          <th scope="row">{{ options.date }}</th>
+          <td
+            v-for="(timeItem, key) in options.time"
+            :key="key"
+            :class="[{ active_select: timeItem.isSelected, active_select_move: timeItem.show }]"
+            v-on:mousedown="mousedown(index, key)"
+            v-on:mouseover="mouseover(index, key)"
+            v-on:mouseup="mouseup(index, key)"
+            @click="showOne(index, key)"
+          ></td>
+        </tr>
+      </tbody>
+    </table>
+  </div>
+</template>
+<script>
+export default {
+  name: 'calendar-table',
+  data() {
+    return {
+      numData: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
+      timeData: [
+        {
+          date: '周一',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周二',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周三',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周四',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周五',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周六',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        },
+        {
+          date: '周日',
+          time: [
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false },
+            { isSelected: false, move: false }
+          ]
+        }
+      ],
+      selectFlag: false,
+      max: {
+        x: 0,
+        y: 0
+      }
+    }
+  },
+
+  computed: {},
+  created: {},
+  methods: {
+    showOne(index, key) {
+      this.timeData[index].time[key].isSelected = !this.timeData[index].time[key].isSelected
+    },
+    mousedown: function(index, key) {
+      this.selectStart = []
+      this.selectFlag = true
+      if (this.timeData[index].time[key].value == false) {
+        if (this.timeData[index].time[key].isSelected) {
+          this.timeData[index].time[key].isSelected = false
+        } else {
+          this.$set(this.timeData[index].time[key], 'isSelected', true)
+        }
+      }
+      this.selectStart.push({
+        index: index,
+        key: key
+      })
+    },
+    mouseover: function(index, key) {
+      // x 垂直方向  y 水平方向
+      if (this.selectFlag) {
+        if (index >= this.max.x) {
+          this.max.x = index
+        }
+        if (key >= this.max.y) {
+          this.max.y = key
+        }
+        var start = {
+          x: this.selectStart[0].index,
+          y: this.selectStart[0].key
+        }
+        var end = {
+          x: index,
+          y: key
+        }
+        // for (var i = end.x; i <= this.max.x; i++) {
+        //   for (var j = end.y; j <= this.max.y; j++) {
+        //     this.$set(this.timeData[i].time[j], 'isSelected', false)
+        //   }
+        // }
+        /* 渲染选中的区域 */
+        for (var i = start.x; i <= end.x; i++) {
+          for (var j = start.y; j <= end.y; j++) {
+            // this.$set(this.timeData[i].time[j], 'isSelected', true)
+            this.$set(this.timeData[i].time[j], 'show', true)
+          }
+        }
+      }
+    },
+    mouseup: function(index, key) {
+      var start = {
+        x: this.selectStart[0].index,
+        y: this.selectStart[0].key
+      }
+      var end = {
+        x: index,
+        y: key
+      }
+      //   for (var i = end.x; i <= this.max.x; i++) {
+      //     for (var j = end.y; j <= this.max.y; j++) {
+      //       this.$set(this.timeData[i].time[j], 'isSelected', false)
+      //     }
+      //   }
+      /* 渲染选中的区域 */
+      for (let i = 0; i < this.timeData.length; i++) {
+        for (let j = 0; j < this.timeData[i].time.length; j++) {
+          this.timeData[i].time[j].show = false
+        }
+      }
+      for (var i = start.x; i <= end.x; i++) {
+        for (var j = start.y; j <= end.y; j++) {
+          this.timeData[i].time[j].isSelected = !this.timeData[i].time[j].isSelected
+        }
+      }
+      this.selectFlag = false
+      this.max = {
+        x: 0,
+        y: 0
+      }
+    },
+    mouseleave: function() {
+      this.selectFlag = false
+    }
+  },
+  created() {
+    this.$nextTick(() => {})
+  },
+  //监听
+  watch: {}
+}
+</script>
+
+<style lang="scss" scoped>
+.time_table {
+  border: 1px solid #ccc;
+  border-collapse: collapse;
+}
+.time_table th,
+.time_table td {
+  border: 1px solid #ccc;
+  width: 30px;
+  height: 40px;
+}
+.active_select {
+  background: cornflowerblue;
+}
+.active_select_move {
+  background: aqua;
+}
+* {
+  -webkit-touch-callout: none;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+</style>

+ 292 - 0
src/views/modules/kuaishouapp/account/stepForm/stepModule/timeDivSelect.vue

@@ -0,0 +1,292 @@
+<style scoped>
+.timecontainer {
+  width: 780px;
+  overflow: hidden;
+  padding-top: 30px;
+}
+.swrap {
+  width: 780px;
+  overflow: hidden;
+}
+.leftweek {
+  display: inline-block;
+  width: 50px;
+  vertical-align: top;
+  margin-top: 5px;
+}
+.leftweek .weekname {
+  display: inline-block;
+  width: 50px;
+  height: 29px;
+  line-height: 29px;
+  text-align: center;
+  font-size: 12px;
+}
+.mainbox {
+  display: inline-block;
+  vertical-align: middle;
+  padding: 10px 0px 2px 10px;
+  width: 710px;
+  overflow: hidden;
+  background-color: #eee;
+}
+.boxlist {
+  overflow: hidden;
+}
+.boxlist .list {
+  float: left;
+  height: 20px;
+  width: 10px;
+  border: 1px solid #999;
+  border-radius: 2px;
+  margin: 0 1px 7px;
+  cursor: pointer;
+  background-color: #fff;
+}
+.boxlist .list:nth-of-type(12n) {
+  margin-right: 10px;
+}
+.boxlist .list.selected {
+  background-color: #0099ff;
+  border-color: #0099ff;
+}
+.selectall {
+  float: left;
+  font-size: 12px;
+  margin-left: 50px;
+}
+.righttips {
+  font-size: 12px;
+  float: right;
+}
+.righttips .tiplist {
+  display: inline-block;
+  margin-right: 10px;
+}
+.righttips .tiplist span {
+  display: inline-block;
+  width: 20px;
+  height: 10px;
+  border: 1px solid #999;
+  margin-right: 3px;
+}
+.righttips .tiplist span.current {
+  background: #43a9ed;
+  border-color: #43a9ed;
+}
+.timeList {
+  display: inline-block;
+  vertical-align: middle;
+  font-size: 12px;
+  width: 175px;
+  text-align: center;
+}
+</style>
+
+<template>
+  <div>
+    <div class="timecontainer" id="timecontainer" @mousedown="mousedownfn">
+      <div class="selectall">
+        <input type="checkbox" id="selectAllid" @click="selectAllornot" /><label
+          for="selectAllid"
+          style="cursor:pointer;padding-left:5px;"
+          >全选</label
+        >
+      </div>
+      <div class="righttips">
+        <div class="tiplist"><span class="current"></span>投放</div>
+        <div class="tiplist"><span></span>不投放</div>
+      </div>
+      <div class="swrap">
+        <div class="leftweek">
+          <div class="weekname" v-for="(item, index) in weekName" :key="index">{{ item }}</div>
+        </div>
+        <div class="mainbox">
+          <div class="boxlist">
+            <div
+              class="list"
+              :title="`${timeSetp}小时`"
+              v-for="(item, index) in timeList"
+              :class="{ selected: item == 1 }"
+              @click="setcurrent(item, index)"
+              :key="index"
+            ></div>
+          </div>
+          <div class="bottomtime">
+            <div class="timeList" v-for="(item, index) in timeName" :key="index">{{ item }}</div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+export default {
+  data() {
+    return {
+      weekName: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期日'],
+      timeName: ['00:00~06:00', '06:00~12:00', '12:00~18:00', '18:00~24:00'],
+      timeList: this.timeString.split(''),
+      isSelect: true,
+      selectBoxDashed: null,
+      startX: null,
+      startY: null,
+      initx: null,
+      scrollX: null,
+      scrollY: null,
+      inity: null
+    }
+  },
+  props: {
+    timeSetp: {
+      type: Number,
+      default() {
+        return 0.5
+      }
+    },
+    timeString: {
+      type: String,
+      default() {
+        let _timeArray = []
+        for (let i = 0; i < (24 / this.timeSetp) * 7; i++) {
+          _timeArray.push('0')
+        }
+        return _timeArray.join('')
+      }
+    }
+  },
+  model: {
+    prop: 'timeString',
+    event: 'triggertime'
+  },
+  mounted() {},
+  methods: {
+    clearBubble(e) {
+      if (e.stopPropagation) {
+        e.stopPropagation()
+      } else {
+        e.cancelBubble = true
+      }
+      if (e.preventDefault) {
+        e.preventDefault()
+      } else {
+        e.returnValue = false
+      }
+    },
+    mousedownfn(e) {
+      //  创建选框节点
+      this.$nextTick(() => {
+        this.selectBoxDashed = document.createElement('div')
+        this.selectBoxDashed.className = 'select-box-dashed'
+
+        document.body.appendChild(this.selectBoxDashed)
+        this.scrollX = document.documentElement.scrollLeft || document.body.scrollLeft
+        this.scrollY = document.documentElement.scrollTop || document.body.scrollTop
+        //  设置选框的初始位置
+        this.startX = e.x + this.scrollX || e.clientX + this.scrollX
+        this.startY = e.y + this.scrollY || e.clientY + this.scrollY
+        this.selectBoxDashed.style.cssText = `left:${this.startX}px;top:${this.startY}px`
+        //  清除事件冒泡、捕获
+        console.log(this.startX ,this.startY)
+        this.clearBubble(e)
+        document.getElementById('timecontainer').addEventListener('mousemove', this.mousemovefn)
+        document.body.addEventListener('mouseup', this.mouseUpfn)
+      })
+    },
+    mousemovefn(e) {
+      this.$nextTick(() => {
+        //  设置选框可见
+        this.selectBoxDashed.style.display = 'block'
+        //  根据鼠标移动,设置选框的位置、宽高
+        this.initx = e.x + this.scrollX || e.clientX + this.scrollX
+        this.inity = e.y + this.scrollY || e.clientY + this.scrollY
+        //  暂存选框的位置及宽高,用于将 select-item 选中
+        this.left = Math.min(this.initx, this.startX)
+        this.top = Math.min(this.inity, this.startY)
+        this.width = Math.abs(this.initx - this.startX)
+        this.height = Math.abs(this.inity - this.startY)
+        this.selectBoxDashed.style.left = `${this.left}px`
+        this.selectBoxDashed.style.top = `${this.top}px`
+        this.selectBoxDashed.style.width = `${this.width}px`
+        this.selectBoxDashed.style.height = `${this.height}px`
+        let fileDivs = document.getElementsByClassName('list')
+        for (let i = 0; i < fileDivs.length; i++) {
+          let itemX_pos = fileDivs[i].offsetWidth + fileDivs[i].offsetLeft
+          let itemY_pos = fileDivs[i].offsetHeight + fileDivs[i].offsetTop
+          let condition1 = itemX_pos > this.left
+          let condition2 = itemY_pos > this.top
+          let condition3 = fileDivs[i].offsetLeft < this.left + this.width
+          let condition4 = fileDivs[i].offsetTop < this.top + this.height
+          if (condition1 && condition2 && condition3 && condition4) {
+            fileDivs[i].classList.add('temp-selected')
+          } else {
+            fileDivs[i].classList.remove('temp-selected')
+          }
+        }
+        this.clearBubble(e)
+      })
+    },
+    mouseUpfn(e) {
+      this.$nextTick(() => {
+        document.getElementById('timecontainer').removeEventListener('mousemove', this.mousemovefn)
+        let selectDom = document.getElementsByClassName('temp-selected')
+        ;[].slice.call(selectDom).forEach(item => {
+          if (item.classList.contains('selected')) {
+            item.classList.remove('selected')
+          } else {
+            item.classList.add('selected')
+          }
+          item.classList.remove('temp-selected')
+        })
+        if (this.selectBoxDashed) {
+          try {
+            this.selectBoxDashed.parentNode.removeChild(this.selectBoxDashed)
+          } catch (err) {
+            // console.log(err)
+          }
+        }
+        let fileDivs = document.getElementsByClassName('list')
+        for (let i = 0; i < fileDivs.length; i++) {
+          if (fileDivs[i].classList.contains('selected')) {
+            this.timeList[i] = '1'
+          } else {
+            this.timeList[i] = '0'
+          }
+        }
+        this.$emit('triggertime', this.timeList.join(''))
+        this.clearBubble(e)
+      })
+    },
+    setcurrent(item, index) {
+      if (item == 0) {
+        this.timeList.splice(index, 1, '1')
+      } else {
+        this.timeList.splice(index, 1, '0')
+      }
+    },
+    selectAllornot(e) {
+      this.timeList.forEach((item, index) => {
+        this.timeList.splice(index, 1, Number(e.target.checked))
+      })
+      this.$emit('triggertime', this.timeList.join(''))
+    }
+  }
+}
+</script>
+
+<style>
+.select-box-dashed {
+  position: absolute;
+  display: none;
+  width: 0px;
+  height: 0px;
+  padding: 0px;
+  margin: 0px;
+  border: 1px dashed #0099ff;
+  background-color: #c3d5ed;
+  opacity: 0.5;
+  filter: alpha(opacity=50);
+  font-size: 0px;
+  z-index: 99999;
+}
+</style>

+ 109 - 42
src/views/modules/material/materialList.vue

@@ -12,6 +12,9 @@
 .detail .ant-form-item {
   margin-bottom: 10px !important;
 }
+.add-image-material .draggable-list {
+  display: block !important;
+}
 </style>
 <style lang="scss" scoped>
 @media (min-width: 1024px) {
@@ -145,7 +148,14 @@ a {
         <a-row :gutter="24">
           <a-col :md="6" :sm="8">
             <a-form-item label="项目名称">
-              <a-select placeholder="请输入项目名称" v-model="queryParam.projectId" @change="getList">
+              <a-select
+                placeholder="请输入项目名称"
+                showSearch
+                optionFilterProp="children"
+                :filterOption="filterOption"
+                v-model="queryParam.projectId"
+                @change="getList"
+              >
                 <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
                   {{ item.projectName }}
                 </a-select-option>
@@ -191,10 +201,9 @@ a {
         checkAll ? '取消  (  ' + checkArr.length + '  )' : '全选'
       }}</a-button>
       <a-button v-if="queryParam.projectId && active == '1'" :disabled="checkArr.length == 0" @click="tongbu"
-        >一键同步</a-button
+        >一键下载</a-button
       >
     </div>
-
     <a-tabs @change="callbackTwo" v-model="active" id="material-card" type="card">
       <a-tab-pane :tab="item.tab" v-for="item of examinelList" :key="item.value">
         <div v-if="dataSource.length > 0">
@@ -202,7 +211,7 @@ a {
             <div class="home-item" v-for="(items, index) in dataSource" :key="index" @click="showDetail(items)">
               <div class="home-right">
                 <a-badge
-                  :count="checkArr.indexOf(items.id) > -1 ? checkArr.indexOf(items.id) + 1 : 0"
+                  :count="checkArr.indexOf(items.url) > -1 ? checkArr.indexOf(items.url) + 1 : 0"
                   :numberStyle="{ backgroundColor: '#52c41a' }"
                   style="width:100%"
                 >
@@ -317,7 +326,7 @@ a {
                       通过审核</a
                     >
                   </a-popconfirm>
-                  <a-checkbox :value="items.id" style="float:right"></a-checkbox
+                  <a-checkbox :value="items.url" v-show="active == '1'" style="float:right"></a-checkbox
                 ></span>
               </div>
             </div>
@@ -357,10 +366,12 @@ a {
             </a-select-option>
           </a-select>
         </a-form-item>
-        <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="图片素材上传">
+        <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="图片素材上传" class="add-image-material">
           <upload-to-ali
+            style="width:160%"
             v-model="urlList.url"
             :customDomain="customDomain"
+            :multiple="add"
             preview
             :region="region"
             :bucket="bucket"
@@ -374,23 +385,6 @@ a {
             @loaded="overUpload"
           ></upload-to-ali>
         </a-form-item>
-        <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="水印素材上传">
-          <upload-to-ali
-            v-model="watermarkUrl.url"
-            :customDomain="customDomain"
-            preview
-            :region="region"
-            :bucket="bucket"
-            :accept="activeKey == 'image' ? acceptImage : acceptVideo"
-            :max="10"
-            :size="1024000"
-            :accessKeyId="accessKeyId"
-            :accessKeySecret="accessKeySecret"
-            :before-upload="fileWater"
-            :dir="activeKey == 'image' ? dirImg : dirVideo"
-            @loaded="overUpload"
-          ></upload-to-ali>
-        </a-form-item>
 
         <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" :label="role.roleName">
           <span>{{ userInfo().realname }}</span>
@@ -586,7 +580,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import UploadToAli from '@femessage/upload-to-ali'
 import { fileCheck, fileInsert, fileEdit } from '@/api/actor'
-import { getAction, postAction, postFile } from '@/api/manage'
+import { getAction, postAction, postFile, downFile, downFilePost } from '@/api/manage'
 
 import { mapGetters } from 'vuex'
 import moment from 'moment'
@@ -636,7 +630,8 @@ export default {
       ],
       // 表头
       columns: [],
-      urlList: { url: '', md5: '', name: '' },
+      urlList: { url: [], md5: [], name: [] },
+      imageArr: [],
       watermarkUrl: { url: '', md5: '', name: '' },
       url: {
         list: '/ctop/materialInfo/list'
@@ -726,14 +721,76 @@ export default {
   },
   methods: {
     moment,
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
     a(item) {
       item.showVideo = true
     },
     tongbu() {
-      this.$refs.check.getData('/ctop/userAllocation/getAccountList', {
-        userId: this.userInfo().id,
-        projectId: this.queryParam.projectId
-      })
+      //   this.$refs.check.getData('/ctop/userAllocation/getAccountList', {
+      //     userId: this.userInfo().id,
+      //     projectId: this.queryParam.projectId
+      //   })
+      if (this.checkArr.length > 1) {
+        downFilePost('/download/zip', { urls: this.checkArr }).then(res => {
+          let blob = new Blob([res], {
+            type: 'application/zip'
+          })
+          let downloadElement = document.createElement('a')
+          let href = window.URL.createObjectURL(blob) //创建下载的链接
+          downloadElement.href = href
+          downloadElement.download = '批量下载' //下载后文件名
+          document.body.appendChild(downloadElement)
+          downloadElement.click() //点击下载
+          document.body.removeChild(downloadElement) //下载完成移除元素
+          window.URL.revokeObjectURL(href) //释放掉blob对象
+        })
+      } else {
+        let image = new Image()
+        image.setAttribute('crossOrigin', 'anonymous')
+        image.src = this.checkArr[0]
+        image.onload = () => {
+          let canvas = document.createElement('canvas')
+          canvas.width = image.width
+          canvas.height = image.height
+          let ctx = canvas.getContext('2d')
+          ctx.drawImage(image, 0, 0, image.width, image.height)
+          canvas.toBlob(blob => {
+            let url = URL.createObjectURL(blob)
+            let eleLink = document.createElement('a')
+            eleLink.download = '封面下载'
+            eleLink.href = url
+            eleLink.click()
+            eleLink.remove()
+            // 用完释放URL对象
+            URL.revokeObjectURL(url)
+          })
+        }
+      }
+
+      //   for (var i = 0; i < this.checkArr.length; i++) {
+      //     let image = new Image()
+      //     image.setAttribute('crossOrigin', 'anonymous')
+      //     image.src = this.checkArr[i]
+      //     image.onload = () => {
+      //       let canvas = document.createElement('canvas')
+      //       canvas.width = image.width
+      //       canvas.height = image.height
+      //       let ctx = canvas.getContext('2d')
+      //       ctx.drawImage(image, 0, 0, image.width, image.height)
+      //       canvas.toBlob(blob => {
+      //         let url = URL.createObjectURL(blob)
+      //         let eleLink = document.createElement('a')
+      //         eleLink.download = '封面下载'
+      //         eleLink.href = url
+      //         eleLink.click()
+      //         eleLink.remove()
+      //         // 用完释放URL对象
+      //         URL.revokeObjectURL(url)
+      //       })
+      //     }
+      //   }
     },
     implement(data) {
       var params = {}
@@ -797,9 +854,10 @@ export default {
       if (this.checkAll) {
         this.checkArr = []
       } else {
-        this.checkArr = this.dataSource.map(item => {
-          return item.id
+        var data = this.dataSource.map(item => {
+          return item.url
         })
+        this.checkArr.push(...data)
       }
       this.checkAll = !this.checkAll
     },
@@ -973,12 +1031,13 @@ export default {
             }
           }
           params.id = this.add ? null : this.id
-          params.code = this.urlList.md5
-          params.url = this.urlList.url
-          params.materialName = this.urlList.name
-          params.watermarkCode = this.watermarkUrl.md5
-          params.watermarkUrl = this.watermarkUrl.url
-          params.watermarkMaterialName = this.watermarkUrl.name
+          //   params.code = this.urlList.md5
+          params.url = this.add ? null : this.urlList.url[0]
+          //   params.materialName = this.urlList.name
+          params.imageArr = this.add ? this.urlList.url : null
+          //   params.watermarkCode = this.watermarkUrl.md5
+          //   params.watermarkUrl = this.watermarkUrl.url
+          //   params.watermarkMaterialName = this.watermarkUrl.name
           params.userId = this.userInfo().id
           params.projectId = values.projectId
           params.materialDescribe = values.materialDescribe
@@ -1002,11 +1061,12 @@ export default {
                   this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
                 }
               }
+              this.$message.success('素材上传成功')
             })
           } else {
             fileEdit({ ...params, status: '0' }).then(res => {
               this.form.resetFields()
-              this.urlList = { url: '', md5: '', name: '' }
+              this.urlList = { url: [], md5: '', name: '' }
               this.watermarkUrl = { url: '', md5: '', name: '' }
               this.tags = []
               this.loadData()
@@ -1017,6 +1077,7 @@ export default {
                   this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
                 }
               }
+              this.$message.success('素材修改成功')
             })
           }
         }
@@ -1038,14 +1099,20 @@ export default {
       this.queryParam.status = key
       this.loadData()
     },
-    overUpload(urlAll) {},
+    overUpload(urlAll) {
+      console.log(urlAll, this.urlList)
+      var index = this.urlList.url.findIndex(item => item === urlAll[0])
+      var data = { url: urlAll[0], code: this.urlList.md5[index], name: this.urlList.name[index] }
+      this.imageArr.push(data)
+      console.log(this.imageArr)
+    },
     file(file) {
       var bmf = new BMF()
       var that = this
       return new Promise(function(resolve, reject) {
         bmf.md5(file[0], (err, md5) => {
-          that.urlList.name = file[0].name
-          that.urlList.md5 = md5
+          //   that.urlList.name.push(file[0].name)
+          //   that.urlList.md5.push(md5)
           fileCheck({ code: md5 }).then(res => {
             if (res.code == 0) {
               that.$message.error('此素材已经上传')
@@ -1111,7 +1178,7 @@ export default {
     },
     getDataSource(page, pageSize) {
       this.ipagination.current = page
-      this.checkArr = []
+      //   this.checkArr = []
       this.checkAll = false
       this.loadData()
     }

+ 112 - 22
src/views/modules/material/videoMaterial.vue

@@ -145,7 +145,14 @@ a {
         <a-row :gutter="24">
           <a-col :md="6" :sm="8">
             <a-form-item label="项目名称">
-              <a-select placeholder="请输入项目名称" v-model="queryParam.projectId" @change="getList">
+              <a-select
+                placeholder="请输入项目名称"
+                showSearch
+                optionFilterProp="children"
+                :filterOption="filterOption"
+                v-model="queryParam.projectId"
+                @change="getList"
+              >
                 <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
                   {{ item.projectName }}
                 </a-select-option>
@@ -188,13 +195,24 @@ a {
     <!-- 操作按钮区域 -->
 
     <div class="table-operator" style="position:relative;z-index:100">
-      <a-button @click="visible = true" type="primary" icon="plus">新增</a-button>
+      <a-button
+        @click="
+          visible = true
+          confirmLoading = false
+        "
+        type="primary"
+        icon="plus"
+        >新增</a-button
+      >
       <a-button
         @click="onCheckAllChange"
         v-if="
           queryParam.projectId &&
             active == '1' &&
-            (role.roleCode == 'operator' || role.roleCode == 'kuaishouOperationManager' || role.roleCode == 'admin')
+            (role.roleCode == 'operator' ||
+              role.roleCode == 'kuaishouOperationManager' ||
+              role.roleCode == 'admin' ||
+              role.roleCode == 'operationAssistant')
         "
         >{{ checkAll ? '取消  (  ' + checkArr.length + '  )' : '全选' }}</a-button
       >
@@ -202,7 +220,10 @@ a {
         v-if="
           queryParam.projectId &&
             active == '1' &&
-            (role.roleCode == 'operator' || role.roleCode == 'kuaishouOperationManager' || role.roleCode == 'admin')
+            (role.roleCode == 'operator' ||
+              role.roleCode == 'kuaishouOperationManager' ||
+              role.roleCode == 'admin' ||
+              role.roleCode == 'operationAssistant')
         "
         :disabled="checkArr.length == 0"
         @click="tongbu"
@@ -273,7 +294,8 @@ a {
                     v-if="
                       role.roleCode == 'operator' ||
                         role.roleCode == 'kuaishouOperationManager' ||
-                        role.roleCode == 'admin'
+                        role.roleCode == 'admin' ||
+                        role.roleCode == 'operationAssistant'
                     "
                   >
                     <div slot="title">
@@ -312,7 +334,8 @@ a {
                     v-if="
                       role.roleCode == 'operator' ||
                         role.roleCode == 'kuaishouOperationManager' ||
-                        role.roleCode == 'admin'
+                        role.roleCode == 'admin' ||
+                        role.roleCode == 'operationAssistant'
                     "
                   >
                     <div slot="title">
@@ -332,7 +355,8 @@ a {
                       v-if="
                         role.roleCode == 'operator' ||
                           role.roleCode == 'kuaishouOperationManager' ||
-                          role.roleCode == 'admin'
+                          role.roleCode == 'admin' ||
+                          role.roleCode == 'operationAssistant'
                       "
                     >
                       通过审核</a
@@ -363,7 +387,13 @@ a {
         </div>
       </a-tab-pane>
     </a-tabs>
-    <a-modal title="添加素材" v-model="visible" @ok="handleOk" @cancel="close" :maskClosable="false">
+    <a-modal title="添加素材" v-model="visible" :maskClosable="false">
+      <template slot="footer">
+        <a-button key="back" @click="close">取消</a-button>
+        <a-button key="submit" type="primary" :disabled="!confirmLoading" @click="handleOk">
+          确定
+        </a-button>
+      </template>
       <a-form :form="form">
         <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="项目选择">
           <a-select
@@ -541,9 +571,12 @@ a {
             <a-form-item label="标签" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.tag">
               <a-tag v-for="(item, index) of detail.tag" :key="index">{{ item }}</a-tag>
             </a-form-item>
+            <a-form-item label="无水印素材下载" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="name">
+              <a-button type="primary" @click="downloadByBlobShowUrl">下载</a-button>
+            </a-form-item>
             <a-form-item label="水印素材下载" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="name">
               <a-button type="primary" @click="downloadByBlob" v-if="showUrlWater">下载</a-button>
-              <span v-else>水印素材生成中......</span>
+              <span v-else>水印素材生成中,请一分钟后刷新</span>
             </a-form-item>
             <a-form-item label="水印素材链接" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="showUrlWater">
               <a-input v-model="showUrlWater" type="text" readonly />
@@ -597,13 +630,29 @@ a {
                 active != '2' &&
                   (role.roleCode == 'operator' ||
                     role.roleCode == 'kuaishouOperationManager' ||
-                    role.roleCode == 'admin')
+                    role.roleCode == 'admin' ||
+                    role.roleCode == 'operationAssistant')
               "
             >
-              <a-button type="primary" @click="edit(null, '0', '1')" v-if="active == '0'" style="margin-right:10px"
-                >通过审核</a-button
+              <a-popconfirm
+                @confirm="edit(null, '0', '1')"
+                v-show="active != '1'"
+                v-if="
+                  role.roleCode == 'operator' ||
+                    role.roleCode == 'kuaishouOperationManager' ||
+                    role.roleCode == 'admin' ||
+                    role.roleCode == 'operationAssistant'
+                "
               >
-              <a-popconfirm @confirm="okEdit">
+                <div slot="title">
+                  <div>
+                    广告语:
+                    <a-textarea placeholder="请输入" v-model="refuseReason" :autosize="{ minRows: 3, maxRows: 10 }" />
+                  </div>
+                </div>
+                <a-button type="primary" v-if="active == '0'" style="margin-right:10px">通过审核</a-button>
+              </a-popconfirm>
+              <a-popconfirm @confirm="okEdit" v-show="active != '2'">
                 <div slot="title">
                   <div>
                     驳回原因:
@@ -631,7 +680,7 @@ a {
                     ></upload-to-ali>
                   </div>
                 </div>
-                <a-button type="primary">驳回</a-button>
+                <a-button type="primary" v-show="active != '2'">驳回</a-button>
                 <!-- @click="edit(null, '0', '2')" -->
               </a-popconfirm>
             </a-form-item>
@@ -690,6 +739,7 @@ export default {
       show: true,
       visible: false,
       visibleDetail: false,
+      confirmLoading: false,
       activeKey: 'video',
       active: '0',
       examinelList: [
@@ -721,6 +771,7 @@ export default {
       checkAll: false,
       showUrl: '',
       showUrlWater: '',
+      materialName: '',
       materialDescribe: '',
       name: '',
       detail: null,
@@ -799,6 +850,9 @@ export default {
     }
   },
   methods: {
+    filterOption(input, option) {
+      return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+    },
     moment,
     a(item) {
       item.showVideo = true
@@ -822,6 +876,26 @@ export default {
       })
       //   /ctop/materialUpload/uploadAccount
     },
+
+    downloadByBlobShowUrl() {
+      console.log(this.showUrl)
+      fetch(this.showUrl)
+        .then(res => res.blob())
+        .then(blob => {
+          const a = document.createElement('a')
+          document.body.appendChild(a)
+          a.style.display = 'none'
+          // 使用获取到的blob对象创建的url
+          const url = window.URL.createObjectURL(blob)
+          a.href = url
+          // 指定下载的文件名
+          a.download = this.materialName
+          a.click()
+          document.body.removeChild(a)
+          // 移除blob对象的url
+          window.URL.revokeObjectURL(url)
+        })
+    },
     downloadByBlob() {
       fetch(this.showUrlWater)
         .then(res => res.blob())
@@ -923,8 +997,7 @@ export default {
     showDetail(item) {
       this.visibleDetail = true
       this.showUrl = item.url
-      this.showUrlWater = item.watermarkUrl ? item.watermarkUrl : null
-      this.name = item.watermarkCode ? item.watermarkCode : null
+
       this.id = item.id
       if (this.active == '2') {
         this.refuseReason = item.refuseReason
@@ -940,6 +1013,16 @@ export default {
       getAction('/ctop/materialInfo/getDetail', { materialId: item.id }).then(res => {
         this.detail = res
       })
+      getAction('/ctop/materialInfo/queryById', { id: item.id }).then(res => {
+        if (res.success) {
+          this.showUrlWater = res.result.watermarkUrl
+          this.name = res.result.watermarkCode
+          this.materialName = res.result.materialName
+        } else {
+          this.showUrlWater = null
+          this.name = null
+        }
+      })
     },
     okEditShow(item, editStatus) {
       if (editStatus == '2') {
@@ -991,7 +1074,12 @@ export default {
             this.visibleDetail = false
           })
         } else {
-          fileEdit({ id: this.id, status: editStatus, auditorId: this.userInfo().id }).then(res => {
+          fileEdit({
+            id: this.id,
+            status: editStatus,
+            auditorId: this.userInfo().id,
+            creativeCopywriter: this.refuseReason
+          }).then(res => {
             this.refuseFile = []
             this.refuseReason = ''
             this.loadData()
@@ -1109,7 +1197,9 @@ export default {
       this.queryParam.status = key
       this.loadData()
     },
-    overUpload(urlAll) {},
+    overUpload(urlAll) {
+      this.confirmLoading = true
+    },
     file(file) {
       var bmf = new BMF()
       var that = this
@@ -1155,21 +1245,21 @@ export default {
       })
     },
     getProjectId(items) {
-      this.form.resetFields(["clipId","planId","shotId"])
+      this.form.resetFields(['clipId', 'planId', 'shotId'])
       getAction('/ctop/projectMember/getMemberList', { projectId: items }).then(res => {
         if (res.code == 0) {
           this.ascription.clipId = res.result.filter(item => {
-            if (item.roleCode == 'clip' || item.roleCode == 'plan') {
+            if (item.roleCode == 'clip' || item.roleCode == 'plan' || item.roleCode == 'designTeamLeader') {
               return { userId: item.userId, userName: item.userName }
             }
           })
           this.ascription.shotId = res.result.filter(item => {
-            if (item.roleCode == 'shot' || item.roleCode == 'plan') {
+            if (item.roleCode == 'shot' || item.roleCode == 'plan' || item.roleCode == 'designTeamLeader') {
               return { userId: item.userId, userName: item.userName }
             }
           })
           this.ascription.planId = res.result.filter(item => {
-            if (item.roleCode == 'plan') {
+            if (item.roleCode == 'plan' || item.roleCode == 'designTeamLeader') {
               return { userId: item.userId, userName: item.userName }
             }
           })

+ 2 - 0
vue.config.js

@@ -70,6 +70,8 @@ module.exports = {
         // target: 'http://192.168.2.133:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.174:8080', //请求本地 需要jeecg-boot后台项目  祚云
+        // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震
+        
         ws: false,
         changeOrigin: true
       },