zhuxinbo 5 سال پیش
والد
کامیت
d7f99ed151

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: 'url',
+    key: 'url',
+    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>

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

@@ -0,0 +1,321 @@
+<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: 'effiVideoCount',
+      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'
       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: 'url',
+    key: 'url',
+    align: 'center',
+  }, {
+    title: '授权名称',
+    dataIndex: 'authName',
+    key: 'authName',
+    align: 'center',
+  }]
   export default {
   export default {
     name: 'admin-info',
     name: 'admin-info',
     components: {
     components: {
@@ -109,7 +135,7 @@
         ],
         ],
         noTitleKey: 'kuaishou',
         noTitleKey: 'kuaishou',
         a: '',
         a: '',
-        columns,
+        columns: columns,
         dataList: [],
         dataList: [],
       }
       }
     },
     },
@@ -119,23 +145,68 @@
     created() {
     created() {
       var userId = localStorage.getItem('detailUserId')
       var userId = localStorage.getItem('detailUserId')
       var appType = localStorage.getItem('appType') == 'kuaishou' ? 2 : 1
       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 {
         } 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>
 </script>

+ 96 - 6
src/views/modules/achievements/adminInfo.vue

@@ -14,8 +14,12 @@
       <a-col :span="24">
       <a-col :span="24">
         <a-card style="width:100%;" :tabList="tabListNoTitle" :activeTabKey="noTitleKey"
         <a-card style="width:100%;" :tabList="tabListNoTitle" :activeTabKey="noTitleKey"
           @tabChange="key => onTabChange(key, '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-table :columns="columns" :dataSource="dataList" bordered :loading="loading" size="middle">
             <span slot-scope="text" slot="videoUrl">
             <span slot-scope="text" slot="videoUrl">
               <video class="video" :src="text" controls="controls" style="height:200px">
               <video class="video" :src="text" controls="controls" style="height:200px">
                 您的浏览器不支持 video 标签。
                 您的浏览器不支持 video 标签。
@@ -104,6 +108,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 {
   export default {
     name: 'admin-info',
     name: 'admin-info',
@@ -114,6 +147,7 @@
 
 
     data: function () {
     data: function () {
       return {
       return {
+        type: 1,
         title: '工作台',
         title: '工作台',
         loginfo: {},
         loginfo: {},
         barData,
         barData,
@@ -132,14 +166,37 @@
         ],
         ],
         noTitleKey: 'kuaishou',
         noTitleKey: 'kuaishou',
         a: '',
         a: '',
-        columns,
+        columns: columns,
         dataList: [],
         dataList: [],
       }
       }
     },
     },
     methods: {
     methods: {
       ...mapGetters(['nickname', 'avatar', 'userInfo']),
       ...mapGetters(['nickname', 'avatar', 'userInfo']),
+      getData(data) {
+        if (this.noTitleKey == 'kuaishou') {
+          if (data == 1) {
+            this.columns = columns
+            this.getKuaishouList()
+          } else if (data == 2) {
+            this.columns = columnsYou
+            this.getKuaishouYouHuaList()
+          }
+
+        } else if (this.noTitleKey == 'toutiao') {
+          if (data == 1) {
+            this.columns = columns
+            this.getToutiaoList()
+          } else if (data == 2) {
+            this.columns = columnsYou
+            this.getToutiaoYouHuaList()
+
+          }
+        }
+      },
       onTabChange(key, type) {
       onTabChange(key, type) {
         console.log(key, type)
         console.log(key, type)
+        this.type = 1
+        this.columns = columns
         this[type] = key
         this[type] = key
         if (key == 'kuaishou') {
         if (key == 'kuaishou') {
           this.getKuaishouList()
           this.getKuaishouList()
@@ -148,9 +205,12 @@
         }
         }
       },
       },
       toDetail(item) {
       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() {
       getKuaishouList() {
         postAction('/ctop/performance2/kuaishouPerformanceInfoNow', '').then(res => {
         postAction('/ctop/performance2/kuaishouPerformanceInfoNow', '').then(res => {
@@ -182,6 +242,36 @@
             this.$message.error(res.message)
             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() {
     created() {

+ 2 - 2
vue.config.js

@@ -65,9 +65,9 @@ module.exports = {
        },*/
        },*/
       '/jeecg-boot': {
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
-        // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
+        target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.143: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.132:8080', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目  孙震