zhuxinbo пре 5 година
родитељ
комит
232a00511b

+ 1 - 1
src/views/dashboard/Analysis.vue

@@ -147,7 +147,7 @@
     <statistics v-else-if="roleCode == 'kuaishouOperationManager'" />
     <statistics v-else-if="roleCode == 'admin'" />
     <Workbench v-else-if="roleCode == 'clip'" />
-    <statistics v-else-if="roleCode == 'plane'" />
+    <Workbench v-else-if="roleCode == 'plane'" />
   </div>
 </template>
 

+ 5 - 1
src/views/dashboard/Workbench.vue

@@ -57,7 +57,11 @@
         <chart-card
           :loading="loading"
           title="运营审核通过率"
-          :total="((dataCount.passAudit / (dataCount.refuseAudit + dataCount.passAudit)) * 100).toFixed(2) + '%'"
+          :total="
+            dataCount.refuseAudit + dataCount.passAudit > 0
+              ? ((dataCount.passAudit / (dataCount.refuseAudit + dataCount.passAudit)) * 100).toFixed(2) + '%'
+              : '0%'
+          "
         >
           <a-tooltip title="指标说明" slot="action">
             <a-icon type="info-circle-o" />

+ 25 - 21
src/views/modules/Statistics/accountMaterStatistics.vue

@@ -47,7 +47,7 @@ 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
+          <!-- <a-select
             v-model="appId"
             showSearch
             allowClear
@@ -64,17 +64,22 @@ th div {
           >
             <a-select-option
               v-for="appModel in options"
-              :key="appModel.id+new Date().getTime()"
+              :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>
+              >{{ 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
             type="primary"
             icon="reload"
             @click="getDataReset"
             style="background-color:#67c23a;border-color:#67c23a"
-          >刷新</a-button>
+            >刷新</a-button
+          >
         </div>
       </a-row>
       <a-row>
@@ -98,22 +103,16 @@ th div {
             :loading="loading"
           >
             <div slot="url" slot-scope="url">
-              <video
-                class="video"
-                :src="url"
-                controls="controls"
-                style="height:200px;width:112.5px"
-              >您的浏览器不支持 video 标签。</video>
+              <video class="video" :src="url" controls="controls" style="height:200px;width:112.5px">
+                您的浏览器不支持 video 标签。
+              </video>
             </div>
-            <span slot="photoClickRatio" slot-scope="photoClickRatio">{{photoClickRatio|getBo}}</span>
-            <span slot="actionRatio" slot-scope="actionRatio">{{actionRatio|getBo}}</span>
-            <span
-              slot="impression1kCost"
-              slot-scope="impression1kCost"
-            >{{impression1kCost|toFixtwo}}</span>
-            <span slot="photoClickCost" slot-scope="photoClickCost">{{photoClickCost|toFixtwo}}</span>
-            <span slot="actionCost" slot-scope="actionCost">{{actionCost|toFixtwo}}</span>
-            <span slot="conversionPrice" slot-scope="conversionPrice">{{conversionPrice|toFixtwo}}</span>
+            <span slot="photoClickRatio" slot-scope="photoClickRatio">{{ photoClickRatio | getBo }}</span>
+            <span slot="actionRatio" slot-scope="actionRatio">{{ actionRatio | getBo }}</span>
+            <span slot="impression1kCost" slot-scope="impression1kCost">{{ impression1kCost | toFixtwo }}</span>
+            <span slot="photoClickCost" slot-scope="photoClickCost">{{ photoClickCost | toFixtwo }}</span>
+            <span slot="actionCost" slot-scope="actionCost">{{ actionCost | toFixtwo }}</span>
+            <span slot="conversionPrice" slot-scope="conversionPrice">{{ conversionPrice | toFixtwo }}</span>
           </a-table>
         </a-card>
       </a-col>
@@ -133,6 +132,10 @@ import lifting from './components/lifting'
 import timeCheck from './components/timeCheck'
 import ratioModal from './components/ratioModal'
 import { mapGetters } from 'vuex'
+
+// import the component
+import Treeselect from './components/Treeselect.vue'
+
 // 引入基本模板
 let echarts = require('echarts/lib/echarts')
 // 引入柱状图组件
@@ -343,7 +346,8 @@ export default {
     countTo,
     lifting,
     timeCheck,
-    ratioModal
+    ratioModal,
+    Treeselect
   },
 
   data: function() {

+ 138 - 0
src/views/modules/Statistics/components/Treeselect.vue

@@ -0,0 +1,138 @@
+<style lang="scss" scoped>
+.select-project {
+  width: 50%;
+}
+</style>
+<template>
+  <div class="select-project">
+    <treeselect
+      :multiple="true"
+      :options="options"
+      :load-options="loadOptions"
+      placeholder="请选择项目以及账户"
+      v-model="value"
+      :value-consists-of="valueConsistsOf"
+      @select="update"
+      @input="emitValue"
+    />
+  </div>
+</template>
+
+<script>
+// import the component
+import Treeselect from '@riophae/vue-treeselect'
+// import the styles
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
+
+import { getAction, postAction } from '@/api/manage'
+import { mapGetters } from 'vuex'
+// We just use `setTimeout()` here to simulate an async operation
+// instead of requesting a real API server for demo purpose.
+
+export default {
+  data: () => ({
+    value: null,
+    valueConsistsOf: 'LEAF_PRIORITY',
+    options: [
+      {
+        id: 'success',
+        label: 'With children',
+        // Declare an unloaded branch node.
+        children: null
+      },
+      {
+        id: 'no-children',
+        label: 'With no children',
+        children: null
+      },
+      {
+        id: 'failure',
+        label: 'Demonstrates error handling',
+        children: null
+      }
+    ]
+  }),
+  components: { Treeselect },
+  methods: {
+    ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    update(node, id) {
+      console.log(node, id)
+      if (node.children == null) {
+        getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: node.id }).then(res => {
+          console.log(res)
+          if (res.code == 0) {
+            if (res.result.length > 0) {
+              node.children = res.result.map(item => {
+                return {
+                  id: item.accountId,
+                  label: item.authName + '         ' + item.userName
+                }
+              })
+              this.value = res.result.map(item => {
+                return item.accountId
+              })
+            } else {
+              this.$message.error('该项目下无账号')
+              this.value = []
+            }
+          } else {
+            new Error('Failed to load options: network error.')
+          }
+        })
+      }
+    },
+    emitValue() {
+      this.$emit('update:appId', this.value)
+    },
+    getChildren() {},
+    loadOptions({ action, parentNode, callback }) {
+      // Typically, do the AJAX stuff here.
+      // Once the server has responded,
+      // assign children options to the parent node & call the callback.
+      console.log(action)
+      if (action === LOAD_CHILDREN_OPTIONS) {
+        getAction('/ctop/userAllocation/getAccountListByProjectId', { projectId: parentNode.id }).then(res => {
+          console.log(res)
+          if (res.code == 0) {
+            if (res.result.length > 0) {
+              parentNode.children = res.result.map(item => {
+                return {
+                  id: item.accountId,
+                  label: item.authName + '         ' + item.userName
+                }
+              })
+              callback()
+            } else {
+              parentNode.children = []
+              callback()
+            }
+          } else {
+            callback(new Error('Failed to load options: network error.'))
+          }
+        })
+      }
+    },
+    getParticipateList() {
+      //我参与的
+      getAction('/ctop/projectMember/participateList', { userId: this.userInfo().id }).then(res => {
+        if (res.code == 0) {
+          console.log(res.result)
+          this.options = res.result.map(item => {
+            return {
+              id: item.projectId,
+              label: item.projectName,
+              children: null
+            }
+          })
+        }
+      })
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getParticipateList()
+    })
+  }
+}
+</script>

+ 6 - 4
src/views/modules/Statistics/dataDisplayStatistics.vue

@@ -70,7 +70,7 @@ 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
+          <!-- <a-select
             v-model="appId"
             showSearch
             allowClear
@@ -93,7 +93,8 @@ th div {
                 appModel.authName
               }}&#12288;&#12288;{{ appModel.operationName }}</a-select-option
             >
-          </a-select>
+          </a-select> -->
+          <treeselect :appId.sync="appId" />
           <span style="margin-left:10px">返点比例:</span>
           <a-input-number
             :min="1"
@@ -212,7 +213,7 @@ import { getAdvertiserList, getReportList, getStatistics } from '@api/statistics
 import axios from 'axios'
 import lifting from './components/lifting'
 import timeCheck from './components/timeCheck'
-
+import Treeselect from './components/Treeselect.vue'
 // 引入基本模板
 let echarts = require('echarts/lib/echarts')
 // 引入柱状图组件
@@ -383,7 +384,8 @@ export default {
     ARow,
     countTo,
     lifting,
-    timeCheck
+    timeCheck,
+    Treeselect
   },
 
   data: function() {

+ 18 - 25
src/views/modules/Statistics/refuseData.vue

@@ -1,4 +1,3 @@
-
 <style>
 /* .data-display-statistics .ant-col-6 {
   margin: 10px 0;
@@ -55,9 +54,10 @@ th div {
     <a-row class="image-list-heading vm-panel">
       <div class="panel-heading" style="display:flex;justify-content: space-between;">{{ title }}</div>
       <a-row type="flex" align="middle" justify="space-between" class="panel-body">
-        <div class="search-bar" style="width:100%">
-          <span>账户选择:</span>
-          <a-select
+        <div class="search-bar" style="width:100%;display:flex">
+          <span style="line-height:35px">账户选择:</span>
+          <treeselect :appId.sync="appId" />
+          <!-- <a-select
             v-model="appId"
             showSearch
             allowClear
@@ -70,8 +70,8 @@ th div {
               :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>
-          <a-button type="primary" style="margin:10px" @click="addUser">搜索</a-button>
+          </a-select> -->
+          <a-button type="primary" style="margin-left:10px" @click="addUser">搜索</a-button>
         </div>
       </a-row>
     </a-row>
@@ -85,12 +85,9 @@ th div {
 
           <a-table :columns="columns" :dataSource="dataList" bordered :loading="loading">
             <div slot="videoUrl" slot-scope="videoUrl">
-              <video
-                class="video"
-                :src="videoUrl"
-                controls="controls"
-                style="height:200px;width:112.5px"
-              >您的浏览器不支持 video 标签。</video>
+              <video class="video" :src="videoUrl" controls="controls" style="height:200px;width:112.5px">
+                您的浏览器不支持 video 标签。
+              </video>
             </div>
             <div slot="coverUrl" slot-scope="coverUrl">
               <img :src="coverUrl" controls="controls" style="height:200px;width:112.5px" />
@@ -98,23 +95,15 @@ th div {
             <template slot="creativeName" slot-scope="text, record">
               <!-- <editable-cell :text="text" @change="onCellChange(record, 'creativeName', $event)" /> -->
               <div>
-                {{text}}
-                <a-icon
-                  type="edit"
-                  style="cursor: pointer;"
-                  @click="onCellChange(record, 'creativeName')"
-                />
+                {{ text }}
+                <a-icon type="edit" style="cursor: pointer;" @click="onCellChange(record, 'creativeName')" />
               </div>
             </template>
             <template slot="description" slot-scope="text, record">
               <!-- <editable-cell :text="text" @change="onCellChange(record, 'description', $event)" /> -->
               <div>
-                {{text}}
-                <a-icon
-                  type="edit"
-                  style="cursor: pointer;"
-                  @click="onCellChange(record, 'description')"
-                />
+                {{ text }}
+                <a-icon type="edit" style="cursor: pointer;" @click="onCellChange(record, 'description')" />
               </div>
             </template>
           </a-table>
@@ -139,6 +128,9 @@ import { getMaterialAccount, getRefuseCreative, updateCreative, selectByCreateNa
 import axios from 'axios'
 import EditableCell from './components/EditableCell'
 import { mapGetters } from 'vuex'
+
+import Treeselect from './components/Treeselect.vue'
+
 import { stopOtherVideo, closeAllVideoFun } from '@/utils/videoControl' // 停止除当前外的其他视频播放,及停止所有视频播放的方法
 const columns = [
   {
@@ -205,7 +197,8 @@ const columns = [
 export default {
   name: 'refuse-data',
   components: {
-    EditableCell
+    EditableCell,
+    Treeselect
   },
 
   data: function() {

+ 1 - 0
src/views/modules/kuaishouapp/creativeCreate.vue

@@ -30,6 +30,7 @@
           :loadData="loadData"
           placeholder="Please select"
           changeOnSelect
+          multiple
         />
       </a-form-item>
 

+ 6 - 7
src/views/modules/material/materialList.vue

@@ -242,10 +242,11 @@ a {
                         style="height:200px;max-width:100%;position:absolute;z-index:10;"
                       />
                       <img
-                        src="https://gss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/zhidao/pic/item/b2de9c82d158ccbf377ec8b41fd8bc3eb0354179.jpg"
-                        v-show="!items.showVideo"
+                        src="./timg.gif"
+                        v-if="!items.showVideo"
                         alt=""
                         style="height:200px;max-width:100%;position:absolute;z-index:11;"
+                        @click.stop
                       />
                     </div>
                   </div>
@@ -534,7 +535,7 @@ a {
     </a-modal>
 
     <a-modal title="素材详情" v-model="visibleDetail" width="70%">
-      <div style="display:flex;height:600px">
+      <div style="display:flex;height:700px">
         <div
           style="width:50%;padding:10px;box-sizing:border-box;display:flex;justify-content:center;border-right:1px solid #f2f2f2"
         >
@@ -1123,8 +1124,7 @@ export default {
       this.watermarkUrl = { url: '', md5: '', name: '' }
       this.tags = []
     },
-    onChange(date, dateString) {
-    },
+    onChange(date, dateString) {},
     callback(key) {
       this.checkAll = false
       this.checkArr = []
@@ -1143,8 +1143,7 @@ export default {
       this.queryParam.status = key
       this.loadData()
     },
-    overUpload(urlAll) {
-    },
+    overUpload(urlAll) {},
     file(file) {
       var bmf = new BMF()
       var that = this

BIN
src/views/modules/material/timg.gif