Browse Source

Merge remote-tracking branch 'origin/test' into test

syh 5 years ago
parent
commit
a8d6cc248e

BIN
dist.zip


+ 213 - 0
src/views/modules/Statistics/allDetail.vue

@@ -0,0 +1,213 @@
+<style>
+</style>
+<template>
+  <div class="admin-detail">
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;">
+          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle"
+            :pagination="false">
+            <span slot-scope="text" slot="url">
+              <video class="video" :src="text" controls="controls" style="height:200px">
+                您的浏览器不支持 video 标签。
+              </video>
+            </span>
+
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+  import ChartCard from '@/components/ChartCard'
+  import ACol from 'ant-design-vue/es/grid/Col'
+  import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+  import MiniArea from '@/components/chart/MiniArea'
+  import MiniBar from '@/components/chart/MiniBar'
+  import MiniProgress from '@/components/chart/MiniProgress'
+  import RankList from '@/components/chart/RankList'
+  import Bar from '@/components/chart/Bar'
+  import LineChartMultid from '@/components/chart/LineChartMultid'
+  import HeadInfo from '@/components/tools/HeadInfo.vue'
+
+  import Trend from '@/components/Trend'
+
+  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({
+      x: `${i + 1}月`,
+      y: Math.floor(Math.random() * 1000) + 200
+    })
+  }
+
+  const columns = [{
+      title: '视频',
+      dataIndex: 'url',
+      key: 'url',
+      align: 'center',
+      scopedSlots: {
+        customRender: 'url'
+      },
+      width: 200
+    },
+    {
+      title: '素材名称',
+      dataIndex: 'materialName',
+      key: 'materialName',
+      align: 'center'
+    },
+    {
+      title: '水印素材名称',
+      dataIndex: 'watermarkMaterialName',
+      key: 'watermarkMaterialName',
+      align: 'center'
+    },
+    {
+      title: 'md5',
+      dataIndex: 'code',
+      key: 'code',
+      align: 'center'
+    },
+  ]
+  // 账户名、项目名、优化师姓名、当季消耗、授权名称
+  const columnsYou = [{
+    title: '账户',
+    dataIndex: 'advertiserName',
+    key: 'advertiserName',
+    align: 'center',
+  }, {
+    title: '项目',
+    dataIndex: 'projectName',
+    key: 'projectName',
+    align: 'center',
+  }, {
+    title: '优化师',
+    dataIndex: 'userName',
+    key: 'userName',
+    align: 'center',
+  }, {
+    title: '当季消耗',
+    dataIndex: 'totalCost',
+    key: 'totalCost',
+    align: 'center',
+  }, {
+    title: '授权名称',
+    dataIndex: 'authName',
+    key: 'authName',
+    align: 'center',
+  }]
+  export default {
+    name: 'admin-info',
+    components: {
+      ATooltip,
+      ACol,
+    },
+
+    data: function () {
+      return {
+        title: '工作台',
+        loginfo: {},
+        barData,
+        visitInfo: [],
+        visitFields: ['ip', 'visit'],
+        loading: false,
+        rankList: [],
+        tabListNoTitle: [{
+            key: 'kuaishou',
+            tab: '快手'
+          },
+          {
+            key: 'toutiao',
+            tab: '头条'
+          }
+        ],
+        noTitleKey: 'kuaishou',
+        a: '',
+        columns: columns,
+        dataList: [],
+      }
+    },
+    methods: {
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    },
+    created() {
+      var userId = localStorage.getItem('detailUserId')
+      var appType = localStorage.getItem('appType') == 'kuaishou' ? 2 : 1
+      var type = localStorage.getItem('roleData')
+      var weekDate = localStorage.getItem('weekDate').split('~')
+      if (type == 1) {
+        this.columns = columns
+        postAction('/ctop/performance2/getWeekEffiVideoList', {
+          "startDate": weekDate[0],
+          "endDate": weekDate[1],
+          "userId": userId,
+          "appType": appType
+        }).then(res => {
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      } else if (type == 2) {
+        this.columns = columnsYou
+        if (appType == 2) {
+          postAction('/ctop/performance2/getKuaiShouYouhuaAccountsList', {
+            "startDate": weekDate[0],
+            "endDate": weekDate[1],
+            "userId": userId,
+            "appType": appType
+          }).then(res => {
+            if (res.success) {
+              this.dataList = res.result.map((item, index) => {
+                return {
+                  ...item,
+                  key: index,
+                }
+              })
+            } else {
+              this.$message.error(res.message)
+            }
+          })
+        } else {
+          postAction('/ctop/performance2/getToutiaoYouhuaAccountsList', {
+            "startDate": weekDate[0],
+            "endDate": weekDate[1],
+            "userId": userId,
+            "appType": appType
+          }).then(res => {
+            if (res.success) {
+              this.dataList = res.result.map((item, index) => {
+                return {
+                  ...item,
+                  key: index,
+                }
+              })
+            } else {
+              this.$message.error(res.message)
+            }
+          })
+        }
+
+      }
+
+    }
+  }
+</script>

+ 401 - 0
src/views/modules/Statistics/allStatistics.vue

@@ -0,0 +1,401 @@
+<style>
+  .admin-info .ant-list-item-content {
+    display: flex;
+    justify-content: space-around;
+  }
+
+  .admin-info .ant-table-middle tr.ant-table-expanded-row td>.ant-table-wrapper {
+    margin: -12px -9px -13px;
+  }
+</style>
+<template>
+  <div class="admin-info">
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;" :tabList="tabListNoTitle" :activeTabKey="noTitleKey"
+          @tabChange="key => onTabChange(key, 'noTitleKey')">
+          角色选择:
+          <a-select style="width:300px;margin-bottom:30px" placeholder="请选择角色类型" v-model="type" @change="clearData">
+            <a-select-option :value="1">设计</a-select-option>
+            <a-select-option :value="2">优化</a-select-option>
+          </a-select>
+          时段选择:
+          <a-month-picker placeholder="选择月份" :disabledDate="disabledDate" @change="getTimeData" v-model="mouth" />
+          <a-select style="width:300px;margin-bottom:30px" placeholder="选择时段" v-model="dateRange">
+            <a-select-option :value="item" v-for="(item,index) of options" :key="index">{{item}}</a-select-option>
+          </a-select>
+          <a-button type="primary" style="margin-left:10px" @click="addUser">搜索</a-button>
+          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle">
+            <span slot-scope="text" slot="videoUrl">
+              <video class="video" :src="text" controls="controls" style="height:200px">
+                您的浏览器不支持 video 标签。
+              </video>
+            </span>
+            <span slot="action" slot-scope="text,record">
+              <a :disabled="record.effiVideoCount == 0" @click="toDetail(record)">查看详情</a>
+            </span>
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+  import ChartCard from '@/components/ChartCard'
+  import ACol from 'ant-design-vue/es/grid/Col'
+  import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+  import MiniArea from '@/components/chart/MiniArea'
+  import MiniBar from '@/components/chart/MiniBar'
+  import MiniProgress from '@/components/chart/MiniProgress'
+  import RankList from '@/components/chart/RankList'
+  import Bar from '@/components/chart/Bar'
+  import LineChartMultid from '@/components/chart/LineChartMultid'
+  import HeadInfo from '@/components/tools/HeadInfo.vue'
+
+  import Trend from '@/components/Trend'
+
+  import moment from 'moment';
+
+  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({
+      x: `${i + 1}月`,
+      y: Math.floor(Math.random() * 1000) + 200
+    })
+  }
+
+  const columns = [{
+      title: '姓名',
+      dataIndex: 'realname',
+      key: 'realname',
+      align: 'center',
+      width: 200
+    },
+    {
+      title: '角色',
+      dataIndex: 'roleName',
+      key: 'roleName',
+      align: 'center'
+    },
+    {
+      title: '有效视频数量',
+      dataIndex: 'effiVideoCount',
+      key: 'effiVideoCount',
+      align: 'center'
+    },
+    {
+      title: '总视频数量',
+      dataIndex: 'videoCount',
+      key: 'videoCount',
+      align: 'center'
+    },
+    {
+      title: '消耗',
+      dataIndex: 'cost',
+      key: 'cost',
+      align: 'center'
+    },
+    {
+      title: '操作',
+      dataIndex: 'action',
+      key: 'action',
+      align: 'center',
+      scopedSlots: {
+        customRender: 'action'
+      },
+    },
+  ]
+  const columnsYou = [{
+      title: '姓名',
+      dataIndex: 'realname',
+      key: 'realname',
+      align: 'center',
+      width: 200
+    },
+    {
+      title: '角色',
+      dataIndex: 'roleName',
+      key: 'roleName',
+      align: 'center'
+    },
+    {
+      title: '总消耗',
+      dataIndex: 'cost',
+      key: 'effiVideoCount',
+      align: 'center'
+    },
+    {
+      title: '操作',
+      dataIndex: 'action',
+      key: 'action',
+      align: 'center',
+      scopedSlots: {
+        customRender: 'action'
+      },
+    },
+  ]
+
+
+  Date.prototype.format = function (fmt) {
+    var o = {
+      "M+": this.getMonth() + 1, //月份
+      "d+": this.getDate(), //日
+      "h+": this.getHours(), //小时
+      "m+": this.getMinutes(), //分
+      "s+": this.getSeconds(), //秒
+      "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+      "S": this.getMilliseconds() //毫秒
+    };
+    if (/(y+)/.test(fmt)) {
+      fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+    }
+    for (var k in o) {
+      if (new RegExp("(" + k + ")").test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+      }
+    }
+    return fmt;
+  }
+
+  function allWeeks(now_month) {
+    let week_array = [];
+    let today = new Date(Date.parse(now_month));
+    let year = today.getFullYear();
+    let month = today.getMonth();
+    let i = 0;
+
+    let start = new Date(year, month, 1); // 得到当月第一天
+    let end = new Date(year, month + 1, 0); // 得到当月最后一天
+    let start_day = start.getDay(); // 当月第一天是周几
+    console.log(start.format("yyyy-MM-dd"), end.format("yyyy-MM-dd")); // 每月的起始日期
+    switch (start_day) {
+      case 0:
+        i = 0 - 1;
+        break;
+      case 1:
+        i = 0 - 2;
+        break;
+      case 2:
+        i = 0 - 3;
+        break;
+      case 3:
+        i = 0 - 4;
+        break;
+      case 4:
+        i = 0 - 5;
+        break;
+      case 5:
+        i = 1;
+        break;
+      case 6:
+        i = 0;
+        break;
+    }
+
+    while (new Date(year, month, i + 6) <= end) {
+
+      week_array.push([new Date(year, month, i).format("yyyy-MM-dd"),
+        new Date(year, month, i + 6).format("yyyy-MM-dd")
+      ])
+      i += 7;
+    }
+    return week_array;
+  }
+
+  export default {
+    name: 'admin-info',
+    components: {
+      ATooltip,
+      ACol,
+    },
+
+    data: function () {
+      return {
+        type: 1,
+        title: '工作台',
+        loginfo: {},
+        barData,
+        visitInfo: [],
+        visitFields: ['ip', 'visit'],
+        loading: false,
+        rankList: [],
+        options: [],
+        dateRange: null,
+        mouth: null,
+        tabListNoTitle: [{
+            key: 'kuaishou',
+            tab: '快手'
+          },
+          {
+            key: 'toutiao',
+            tab: '头条'
+          }
+        ],
+        noTitleKey: 'kuaishou',
+        a: '',
+        columns: columns,
+        dataList: [],
+      }
+    },
+    methods: {
+      disabledDate(current) {
+        // Can not select days before today and today
+        return current && current > moment().endOf('day');
+      },
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      clearData() {
+        this.dataList = []
+      },
+      getTimeData(data) {
+        this.dateRange = ""
+        this.options = []
+        this.dataList = []
+        if (data) {
+          var getDate = new Date(data).format("yyyy-MM")
+          this.timeData(getDate)
+        }
+
+      },
+      timeData(data) {
+        var options = allWeeks(data)
+        console.log(options)
+        this.options = []
+        for (let i = 0; i < options.length; i++) {
+          this.options.push(options[i][0] + '~' + options[i][1])
+        }
+      },
+      addUser() {
+        if (this.noTitleKey == 'kuaishou') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getKuaishouList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getKuaishouYouHuaList()
+          }
+
+        } else if (this.noTitleKey == 'toutiao') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getToutiaoList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getToutiaoYouHuaList()
+
+          }
+        }
+      },
+      onTabChange(key, type) {
+        console.log(key, type)
+        this.type = 1
+        this.dateRange = null
+        this.mouth = null
+        this.options = []
+        this.dataList = []
+        this.columns = columns
+        this[type] = key
+
+      },
+      toDetail(item) {
+        localStorage.setItem('detailUserId', item.userId)
+        localStorage.setItem('appType', this.noTitleKey)
+        localStorage.setItem('roleData', this.type)
+        localStorage.setItem('weekDate', this.dateRange)
+        this.$router.replace({
+          path: '/Statistics/allDetail'
+        })
+      },
+      getKuaishouList() {
+        var params = {}
+        var dateRange = this.dateRange.split('~')
+        params.startDate = dateRange[0]
+        params.endDate = dateRange[1]
+        postAction('/ctop/performance2/kuaishouWeekReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+
+      getToutiaoList() {
+        var params = {}
+        var dateRange = this.dateRange.split('~')
+        params.startDate = dateRange[0]
+        params.endDate = dateRange[1]
+        postAction('/ctop/performance2/toutiaoWeekReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+      getKuaishouYouHuaList() {
+        var params = {}
+        var dateRange = this.dateRange.split('~')
+        params.startDate = dateRange[0]
+        params.endDate = dateRange[1]
+        postAction('/ctop/performance2/kuaishouYouhuaWeekReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+      getToutiaoYouHuaList() {
+        var params = {}
+        var dateRange = this.dateRange.split('~')
+        params.startDate = dateRange[0]
+        params.endDate = dateRange[1]
+        postAction('/ctop/performance2/toutiaoYouhuaWeekReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      }
+    },
+    created() {
+      //   this.getKuaishouList()
+    }
+  }
+</script>

+ 327 - 0
src/views/modules/Statistics/quarterStatistics.vue

@@ -0,0 +1,327 @@
+<style>
+  .admin-info .ant-list-item-content {
+    display: flex;
+    justify-content: space-around;
+  }
+
+  .admin-info .ant-table-middle tr.ant-table-expanded-row td>.ant-table-wrapper {
+    margin: -12px -9px -13px;
+  }
+</style>
+<template>
+  <div class="admin-info">
+    <a-row :gutter="10" style="margin-top:10px">
+      <a-col :span="24">
+        <a-card style="width:100%;" :tabList="tabListNoTitle" :activeTabKey="noTitleKey"
+          @tabChange="key => onTabChange(key, 'noTitleKey')">
+          角色选择:
+          <a-select style="width:300px;margin-bottom:30px" placeholder="请选择角色类型" v-model="type" @change="clearData">
+            <a-select-option :value="1">设计</a-select-option>
+            <a-select-option :value="2">优化</a-select-option>
+          </a-select>
+          季度选择:
+          <a-select style="width:100px;margin-bottom:30px" placeholder="选择年" v-model="year">
+            <a-select-option :value="item" v-for="item of options" :key="item">{{item}}</a-select-option>
+          </a-select>
+          <a-select style="width:100px;margin-bottom:30px" placeholder="选择季度" v-model="dateRange">
+            <a-select-option :value="item" v-for="item of 4" :key="item">{{item}}</a-select-option>
+          </a-select>
+          <a-button type="primary" style="margin-left:10px" @click="addUser">搜索</a-button>
+          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle">
+            <span slot-scope="text" slot="videoUrl">
+              <video class="video" :src="text" controls="controls" style="height:200px">
+                您的浏览器不支持 video 标签。
+              </video>
+            </span>
+            <!-- <span slot="action" slot-scope="text,record">
+              <a :disabled="record.effiVideoCount == 0" @click="toDetail(record)">查看详情</a>
+            </span> -->
+          </a-table>
+        </a-card>
+      </a-col>
+    </a-row>
+  </div>
+</template>
+
+<script>
+  import ChartCard from '@/components/ChartCard'
+  import ACol from 'ant-design-vue/es/grid/Col'
+  import ATooltip from 'ant-design-vue/es/tooltip/Tooltip'
+  import MiniArea from '@/components/chart/MiniArea'
+  import MiniBar from '@/components/chart/MiniBar'
+  import MiniProgress from '@/components/chart/MiniProgress'
+  import RankList from '@/components/chart/RankList'
+  import Bar from '@/components/chart/Bar'
+  import LineChartMultid from '@/components/chart/LineChartMultid'
+  import HeadInfo from '@/components/tools/HeadInfo.vue'
+
+  import Trend from '@/components/Trend'
+
+  import moment from 'moment';
+
+  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({
+      x: `${i + 1}月`,
+      y: Math.floor(Math.random() * 1000) + 200
+    })
+  }
+
+  const columns = [{
+      title: '姓名',
+      dataIndex: 'realname',
+      key: 'realname',
+      align: 'center',
+      width: 200
+    },
+    {
+      title: '角色',
+      dataIndex: 'roleName',
+      key: 'roleName',
+      align: 'center'
+    },
+    {
+      title: '有效视频数量',
+      dataIndex: 'effiVideoCount',
+      key: 'effiVideoCount',
+      align: 'center'
+    },
+    {
+      title: '总视频数量',
+      dataIndex: 'videoCount',
+      key: 'videoCount',
+      align: 'center'
+    },
+    {
+      title: '消耗',
+      dataIndex: 'cost',
+      key: 'cost',
+      align: 'center'
+    },
+    // {
+    //   title: '操作',
+    //   dataIndex: 'action',
+    //   key: 'action',
+    //   align: 'center',
+    //   scopedSlots: {
+    //     customRender: 'action'
+    //   },
+    // },
+  ]
+  const columnsYou = [{
+      title: '姓名',
+      dataIndex: 'realname',
+      key: 'realname',
+      align: 'center',
+      width: 200
+    },
+    {
+      title: '角色',
+      dataIndex: 'roleName',
+      key: 'roleName',
+      align: 'center'
+    },
+    {
+      title: '总消耗',
+      dataIndex: 'cost',
+      key: 'cost',
+      align: 'center'
+    },
+    {
+      title: '绩效',
+      dataIndex: 'effiRate',
+      key: 'effiRate',
+      align: 'center'
+    },
+    // {
+    //   title: '操作',
+    //   dataIndex: 'action',
+    //   key: 'action',
+    //   align: 'center',
+    //   scopedSlots: {
+    //     customRender: 'action'
+    //   },
+    // },
+  ]
+
+
+  export default {
+    name: 'admin-info',
+    components: {
+      ATooltip,
+      ACol,
+    },
+
+    data: function () {
+      return {
+        type: 1,
+        title: '工作台',
+        loginfo: {},
+        barData,
+        visitInfo: [],
+        visitFields: ['ip', 'visit'],
+        loading: false,
+        rankList: [],
+        options: [],
+        dateRange: null,
+        year: new Date().getFullYear(),
+        tabListNoTitle: [{
+            key: 'kuaishou',
+            tab: '快手'
+          },
+          {
+            key: 'toutiao',
+            tab: '头条'
+          }
+        ],
+        noTitleKey: 'kuaishou',
+        a: '',
+        columns: columns,
+        dataList: [],
+      }
+    },
+    methods: {
+      disabledDate(current) {
+        // Can not select days before today and today
+        return current && current > moment().endOf('day');
+      },
+      ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      clearData() {
+        this.dataList = []
+      },
+      addUser() {
+        if (this.noTitleKey == 'kuaishou') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getKuaishouList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getKuaishouYouHuaList()
+          }
+
+        } else if (this.noTitleKey == 'toutiao') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getToutiaoList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getToutiaoYouHuaList()
+
+          }
+        }
+      },
+      onTabChange(key, type) {
+        console.log(key, type)
+        this.type = 1
+        this.dateRange = null
+        this.year = '2020'
+        this.options = []
+        this.dataList = []
+        this.columns = columns
+        this[type] = key
+
+      },
+      toDetail(item) {
+        localStorage.setItem('detailUserId', item.userId)
+        localStorage.setItem('appType', this.noTitleKey)
+        localStorage.setItem('roleData', this.type)
+        localStorage.setItem('weekDate', this.dateRange)
+        this.$router.replace({
+          path: '/Statistics/allDetail'
+        })
+      },
+      getKuaishouList() {
+        var params = {}
+        params.year = this.year
+        params.quarter = this.dateRange
+        postAction('/ctop/performance2/kuaishouQuarterReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+
+      getToutiaoList() {
+        var params = {}
+        params.year = this.year
+        params.quarter = this.dateRange
+        postAction('/ctop/performance2/toutiaoQuarterReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+      getKuaishouYouHuaList() {
+        var params = {}
+        params.year = this.year
+        params.quarter = this.dateRange
+        postAction('/ctop/performance2/kuaishouYouhuaQuarterReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+      getToutiaoYouHuaList() {
+        var params = {}
+        params.year = this.year
+        params.quarter = this.dateRange
+        postAction('/ctop/performance2/toutiaoYouhuaQuarterReport', params).then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      }
+    },
+    created() {
+      //   this.getKuaishouList()
+      var myDate = new Date();
+      var startYear = myDate.getFullYear() - 5; //起始年份 
+      var endYear = myDate.getFullYear() + 5; //结束年份 
+      for (var i = startYear; i <= endYear; i++) {
+        this.options.push(i);
+      }
+    }
+  }
+</script>

+ 86 - 15
src/views/modules/achievements/adminDetail.vue

@@ -81,7 +81,33 @@
       align: 'center'
     },
   ]
-
+  // 账户名、项目名、优化师姓名、当季消耗、授权名称
+  const columnsYou = [{
+    title: '账户',
+    dataIndex: 'advertiserName',
+    key: 'advertiserName',
+    align: 'center',
+  }, {
+    title: '项目',
+    dataIndex: 'projectName',
+    key: 'projectName',
+    align: 'center',
+  }, {
+    title: '优化师',
+    dataIndex: 'userName',
+    key: 'userName',
+    align: 'center',
+  }, {
+    title: '当季消耗',
+    dataIndex: 'totalCost',
+    key: 'totalCost',
+    align: 'center',
+  }, {
+    title: '授权名称',
+    dataIndex: 'authName',
+    key: 'authName',
+    align: 'center',
+  }]
   export default {
     name: 'admin-info',
     components: {
@@ -109,7 +135,7 @@
         ],
         noTitleKey: 'kuaishou',
         a: '',
-        columns,
+        columns: columns,
         dataList: [],
       }
     },
@@ -119,23 +145,68 @@
     created() {
       var userId = localStorage.getItem('detailUserId')
       var appType = localStorage.getItem('appType') == 'kuaishou' ? 2 : 1
-      postAction('/ctop/performance2/getEffiVideoList', {
-        "year": 2019,
-        "quarter": 4,
-        "userId": userId,
-        "appType": appType
-      }).then(res => {
-        if (res.success) {
-          this.dataList = res.result.map((item, index) => {
-            return {
-              ...item,
-              key: index,
+      var type = localStorage.getItem('roleData')
+      if (type == 1) {
+        this.columns = columns
+        postAction('/ctop/performance2/getEffiVideoList', {
+          "year": '',
+          "quarter": '',
+          "userId": userId,
+          "appType": appType
+        }).then(res => {
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      } else if (type == 2) {
+        this.columns = columnsYou
+        if (appType == 2) {
+          postAction('/ctop/performance2/getKuaiShouYouhuaAccountsList', {
+            "startDate": "",
+            "endDate": "",
+            "userId": userId,
+            "appType": appType
+          }).then(res => {
+            if (res.success) {
+              this.dataList = res.result.map((item, index) => {
+                return {
+                  ...item,
+                  key: index,
+                }
+              })
+            } else {
+              this.$message.error(res.message)
             }
           })
         } else {
-          this.$message.error(res.message)
+          postAction('/ctop/performance2/getToutiaoYouhuaAccountsList', {
+            "startDate": "",
+            "endDate": "",
+            "userId": userId,
+            "appType": appType
+          }).then(res => {
+            if (res.success) {
+              this.dataList = res.result.map((item, index) => {
+                return {
+                  ...item,
+                  key: index,
+                }
+              })
+            } else {
+              this.$message.error(res.message)
+            }
+          })
         }
-      })
+
+      }
+
     }
   }
 </script>

+ 107 - 12
src/views/modules/achievements/adminInfo.vue

@@ -14,8 +14,13 @@
       <a-col :span="24">
         <a-card style="width:100%;" :tabList="tabListNoTitle" :activeTabKey="noTitleKey"
           @tabChange="key => onTabChange(key, 'noTitleKey')">
-          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle"
-            :pagination="false">
+          角色选择:
+          <a-select style="width:300px;margin-bottom:30px" placeholder="请选择角色类型" v-model="type" @change="getData">
+            <a-select-option :value="1">设计</a-select-option>
+            <a-select-option :value="2">优化</a-select-option>
+          </a-select>
+          <a-button type="primary" style="margin-left:10px" @click="addUser">搜索</a-button>
+          <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle">
             <span slot-scope="text" slot="videoUrl">
               <video class="video" :src="text" controls="controls" style="height:200px">
                 您的浏览器不支持 video 标签。
@@ -104,6 +109,35 @@
       },
     },
   ]
+  const columnsYou = [{
+      title: '姓名',
+      dataIndex: 'realname',
+      key: 'realname',
+      align: 'center',
+      width: 200
+    },
+    {
+      title: '角色',
+      dataIndex: 'roleName',
+      key: 'roleName',
+      align: 'center'
+    },
+    {
+      title: '总消耗',
+      dataIndex: 'cost',
+      key: 'effiVideoCount',
+      align: 'center'
+    },
+    {
+      title: '操作',
+      dataIndex: 'action',
+      key: 'action',
+      align: 'center',
+      scopedSlots: {
+        customRender: 'action'
+      },
+    },
+  ]
 
   export default {
     name: 'admin-info',
@@ -114,6 +148,7 @@
 
     data: function () {
       return {
+        type: 1,
         title: '工作台',
         loginfo: {},
         barData,
@@ -132,25 +167,55 @@
         ],
         noTitleKey: 'kuaishou',
         a: '',
-        columns,
+        columns: columns,
         dataList: [],
       }
     },
     methods: {
       ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      addUser() {
+        if (this.noTitleKey == 'kuaishou') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getKuaishouList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getKuaishouYouHuaList()
+          }
+
+        } else if (this.noTitleKey == 'toutiao') {
+          if (this.type == 1) {
+            this.columns = columns
+            this.getToutiaoList()
+          } else if (this.type == 2) {
+            this.columns = columnsYou
+            this.getToutiaoYouHuaList()
+
+          }
+        }
+      },
+      getData(data) {
+        this.dataList = []
+      },
       onTabChange(key, type) {
         console.log(key, type)
+        this.type = 1
+        this.columns = columns
         this[type] = key
-        if (key == 'kuaishou') {
-          this.getKuaishouList()
-        } else if (key == 'toutiao') {
-          this.getToutiaoList()
-        }
+        this.dataList = []
+        // if (key == 'kuaishou') {
+        //   this.getKuaishouList()
+        // } else if (key == 'toutiao') {
+        //   this.getToutiaoList()
+        // }
       },
       toDetail(item) {
-          localStorage.setItem('detailUserId',item.userId)
-          localStorage.setItem('appType',this.noTitleKey)
-          this.$router.replace({ path: '/achievements/adminDetail' })
+        localStorage.setItem('detailUserId', item.userId)
+        localStorage.setItem('appType', this.noTitleKey)
+        localStorage.setItem('roleData', this.type)
+        this.$router.replace({
+          path: '/achievements/adminDetail'
+        })
       },
       getKuaishouList() {
         postAction('/ctop/performance2/kuaishouPerformanceInfoNow', '').then(res => {
@@ -182,10 +247,40 @@
             this.$message.error(res.message)
           }
         })
+      },
+      getKuaishouYouHuaList() {
+        postAction('/ctop/performance2/kuaishouYouhuaPerformanceInfoNow', '').then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
+      },
+      getToutiaoYouHuaList() {
+        postAction('/ctop/performance2/toutiaoYouhuaPerformanceInfoNow', "").then(res => {
+          console.log(res)
+          if (res.success) {
+            this.dataList = res.result.map((item, index) => {
+              return {
+                ...item,
+                key: index,
+              }
+            })
+          } else {
+            this.$message.error(res.message)
+          }
+        })
       }
     },
     created() {
-      this.getKuaishouList()
+      //   this.getKuaishouList()
     }
   }
 </script>

File diff suppressed because it is too large
+ 1294 - 0
src/views/modules/material/scriptMaterial.vue


+ 94 - 11
src/views/modules/material/videoMaterial.vue

@@ -150,6 +150,23 @@
     -webkit-box-orient: vertical;
   }
 
+  .bhShow {
+    height: 100px;
+    line-height: 25px;
+    text-align: center;
+  }
+
+  .bhShow span {
+    font-size: 14px
+  }
+
+  .show-data {
+    width: 50%;
+    display: flex;
+    flex-direction: column;
+    align-items: flex-start;
+  }
+
   a {
     font-size: 14px;
   }
@@ -242,7 +259,7 @@
                   <a-icon type="close-circle" @click="deleteData(items.id)" v-show="active == '0'"
                     v-if="items.userId == userInfo().id" />
                 </a-badge>
-                <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative">
+                <div style="display:flex;justify-content:center;width:100%;height:200px;position:relative;">
                   <!-- <video
                     :src="items.url"
                     @canplay="a(items)"
@@ -254,20 +271,19 @@
                         <span>{{items.kuaishouEffiType==1?'快手有效视频':'已经同步到快手平台'}}</span>
                       </template>
                       <img style="width:30px;height:30px;" v-if="items.kuaishouVideoIsUp==1"
-                      :style="{filter:items.kuaishouEffiType==1?'grayscale(0%)':'grayscale(100%)'}"
-                      src="./kuaishou.jpg">
+                        :style="{filter:items.kuaishouEffiType==1?'grayscale(0%)':'grayscale(100%)'}"
+                        src="./kuaishou.jpg">
                     </a-tooltip>
                     <a-tooltip placement="top">
                       <template slot="title">
                         <span>{{items.toutiaoEffiType==1?'抖音有效视频':'已经同步到抖音平台'}}</span>
                       </template>
                       <img v-if="items.toutiaoVideoIsUp==1&&items.toutiaoEffiType==1"
-                      
-                      style="width:30px;height:30px;margin-left:5px;" src="./douyin.jpg" alt="">
+                        style="width:30px;height:30px;margin-left:5px;" src="./douyin.jpg" alt="">
                       <img v-else-if="items.toutiaoVideoIsUp==1&&items.toutiaoEffiType==0"
-                      style="width:30px;height:30px;margin-left:5px;" src="./douyinhui.jpg" alt="">
+                        style="width:30px;height:30px;margin-left:5px;" src="./douyinhui.jpg" alt="">
                     </a-tooltip>
-                    
+
                   </div>
                   <img :src="items.url + '?x-oss-process=video/snapshot,t_00000,m_fast'" alt=""
                     style="height:200px;max-width:100%;position:absolute;z-index:10;" />
@@ -279,8 +295,33 @@
                     @click.stop
                   /> -->
                 </div>
-
+                <div style="width:100%;height:1px;border-bottom:1px solid #f2f2f2;margin-top:5px"></div>
                 <div v-if="active == '2'" class="bh">驳回原因:{{ items.refuseReason }}</div>
+
+
+                <div v-if="active == '1'" class="bhShow" style="display:flex;justify-content:space-between;"
+                  @click.stop="showData(items)">
+
+                  <div v-if="items.byteDance" class="show-data">
+                    <span>抖音</span>
+                    <span>消耗:{{items.byteDance.cost}}</span>
+                    <span>封面点击:{{items.byteDance.click}}</span>
+                    <span>封面展示:{{items.byteDance.showNum}}</span>
+                  </div>
+                  <div v-else style="line-height:100px;" class="show-data">
+                    <span>抖音:无</span>
+                  </div>
+                  <div v-if="items.kuaiShou" class="show-data">
+                    <span>快手</span>
+                    <span>消耗:{{items.kuaiShou.charge}}</span>
+                    <span>封面点击:{{items.kuaiShou.photoClick}}</span>
+                    <span>封面展示:{{items.kuaiShou.photoShow}}</span>
+                  </div>
+                  <div v-else style="line-height:100px;" class="show-data">
+                    <span>快手:无</span>
+                  </div>
+                </div>
+                <div style="width:100%;height:1px;border-bottom:1px solid #f2f2f2;margin-top:5px" v-if="active != '0'"></div>
                 <span style="color: black; fontSize: 16px;padding-top:10px;display:block;width:100%" @click.stop>
                   {{ items.createTime | getDate }}
                   <a href="javascript:;" style="margin-left:20px" @click="edit(items, '2')" v-show="active == '2'"
@@ -360,6 +401,34 @@
         </div>
       </a-tab-pane>
     </a-tabs>
+
+    <a-modal title="数据详情" v-model="showDataBool" :footer="null">
+      <div class="bhShow" style="display:flex;justify-content:space-between;height:400px">
+        <div v-if="douyinData" class="show-data">
+          <span style="color:black;font-size:18px;text-align:center;width:100%">抖音</span>
+          <span>消耗:{{douyinData.cost}}</span>
+          <span>封面点击:{{douyinData.click}}</span>
+          <span>封面展示:{{douyinData.showNum}}</span>
+          <span>激活:{{douyinData.active}}</span>
+          <span>转化量:{{douyinData.convertNum}}</span>
+          <span>表单提交:{{douyinData.form}}</span>
+          <span>下载注册:{{douyinData.register}}</span>
+          <span>视频总播放:{{douyinData.totalPlay}}</span>
+          <span>视频有效播放:{{douyinData.validPlay}}</span>
+        </div>
+        <div v-if="kuaishouData" class="show-data">
+          <span style="color:black;font-size:18px;text-align:center;width:100%">快手</span>
+          <span>消耗:{{kuaishouData.charge}}</span>
+          <span>封面点击:{{kuaishouData.photoClick}}</span>
+          <span>封面展示:{{kuaishouData.photoShow}}</span>
+          <span>素材曝光数:{{kuaishouData.aclick}}</span>
+          <span>激活数:{{kuaishouData.activation}}</span>
+          <span>行为数:{{kuaishouData.bclick}}</span>
+          <span>表单提交数:{{kuaishouData.formCount}}</span>
+        </div>
+      </div>
+    </a-modal>
+
     <a-modal title="添加素材" v-model="visible" :maskClosable="false" :width="800">
       <template slot="footer">
         <a-button key="back" @click="close">取消</a-button>
@@ -456,7 +525,7 @@
       </a-form>
     </a-modal>
 
-    <a-modal title="素材详情" v-model="visibleDetail" width="70%">
+    <a-modal title="素材详情" v-model="visibleDetail" width="70%" :footer="null">
       <div style="width:100%">
         <a-button type="primary" @click="setSuccess" style="float:right">
           {{excellent==0?'标记为优秀素材':'取消标记'}}
@@ -721,7 +790,10 @@
         size: 4,
         repeat: false,
         excellent: 0,
-        code: ""
+        code: "",
+        showDataBool: false,
+        kuaishouData: null,
+        douyinData: null
       }
     },
     filters: {
@@ -797,6 +869,17 @@
       }
     },
     methods: {
+      showData(item) {
+        if (item.byteDance || item.kuaiShou) {
+          this.showDataBool = true
+          this.kuaishouData = item.kuaiShou
+          this.douyinData = item.byteDance
+        } else {
+          this.$message.error('抖音和快手都无数据')
+          return
+        }
+
+      },
       setSuccess() {
         var params = {}
         params.id = this.code
@@ -1209,7 +1292,7 @@
           })
         }
         this.queryParam.status = key
-        this.loadData()
+        this.loadData(1)
       },
       overUpload(urlAll) {
         this.confirmLoading = true

+ 2 - 2
vue.config.js

@@ -65,9 +65,9 @@ module.exports = {
        },*/
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
-        // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.143:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
-        target: 'http://192.168.2.110:8080', //请求本地 需要jeecg-boot后台项目  英豪
+        // target: 'http://192.168.2.110:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震