zhuxinbo 5 rokov pred
rodič
commit
1dece37a15

+ 118 - 101
src/views/modules/headerLibrary/index.vue

@@ -16,26 +16,50 @@
   <a-row :gutter="10">
     <a-col :sm="10" style="margin-bottom: 20px;z-index: 10">
       <a-card class="search-box" style="min-height:500px">
-        <div>
-
-          <span style="width:100px;display:inline-block">行业</span>
-          <a-cascader style="margin-top: 1rem;width:300px" :options="options" :showSearch="{ filter }"
-            expandTrigger="hover" @change="onChange" placeholder="请选择行业">
+        <div style="margin-bottom:30px">
+          <span style="display:inline-block;width:80px">行业</span>
+          <a-cascader
+            style="margin-top: 1rem;width:300px"
+            :options="options"
+            :showSearch="{ filter }"
+            expandTrigger="hover"
+            @change="onChange"
+            placeholder="请选择行业"
+          >
             <a-icon type="smile" slot="suffixIcon" class="test" />
           </a-cascader>
         </div>
-
-        <span style="width:100px;display:inline-block">关键词</span>
-        <a-select style="width: 300px" @change="handleChange" @search="fetchUser" :filterOption="true">
-          <a-select-opt-group>
-            <span slot="label">Manager</span>
-            <a-select-option v-for="d in data" :key="d">{{d}}</a-select-option>
-          </a-select-opt-group>
-        </a-select>
+        <div style="margin-bottom:30px">
+          <span style="display:inline-block;width:80px">关键词</span>
+          <a-select
+            showSearch
+            :value="value"
+            placeholder="input search text"
+            style="width: 300px"
+            :defaultActiveFirstOption="false"
+            :showArrow="false"
+            :filterOption="false"
+            @search="handleSearch"
+            @change="handleChange"
+            :notFoundContent="null"
+            allowClear
+          >
+            <!-- <a-select-opt-group>
+               -->
+            <a-select-option v-for="d in data" :key="d.value" :value="d.value">{{ d.text }}</a-select-option>
+            <!-- </a-select-opt-group> -->
+          </a-select>
+        </div>
+        <span style="display:inline-block;width:80px"></span>
+        <a-button type="primary" @click="searchQuery" :disabled="value == undefined">生成</a-button>
       </a-card>
     </a-col>
     <a-col :sm="14" style="margin-bottom: 20px;z-index: 10">
-      <a-card class="search-box" style="min-height:800px"> </a-card>
+      <a-card class="search-box" style="over-flow:auto">
+        <a-list size="large" bordered :dataSource="title">
+          <a-list-item slot="renderItem" slot-scope="item">{{ item }}</a-list-item>
+        </a-list>
+      </a-card>
     </a-col>
   </a-row>
 </template>
@@ -49,94 +73,87 @@
   import $ from 'jquery'
   import qs from 'qs'
 
-  export default {
-    name: 'online-training-list',
-    data() {
-      return {
-        options: [],
-        fetching: false,
-        value: [],
-        data: []
-      }
+export default {
+  name: 'online-training-list',
+  data() {
+    return {
+      options: [],
+      data: [],
+      value: undefined,
+      dataOne: [],
+      title: []
+    }
+  },
+  components: {},
+  methods: {
+    searchQuery() {
+      // /ctop/creativeTitle/titleSuggestion
+      console.log(this.value)
+      getAction('/ctop/creativeTitle/titleSearch', {
+        firstCategory: this.dataOne[0],
+        secondCategory: this.dataOne[1],
+        keywords: this.value
+      }).then(res => {
+        console.log(res)
+        this.title = res.result ? res.result : []
+      })
+      // firstCategory,secondCategory,keywords
+    },
+    getHangye() {
+      getAction('/ctop/creativeTitle/getTitleLabel', '').then(res => {
+        console.log(res)
+        if (res.success) {
+          this.options = res.result.map(item => {
+            return {
+              label: item.label,
+              value: item.value,
+              children:
+                item.children.length > 0
+                  ? [{ label: '不限', value: 0 }].concat(item.children)
+                  : [{ label: '不限', value: 0 }]
+            }
+          })
+          this.options = [{ label: '不限', value: 0 }].concat(this.options)
+        }
+      })
+    },
+    onChange(value, selectedOptions) {
+      console.log(value, selectedOptions)
+      this.dataOne = value
+      this.value = undefined
     },
-    components: {},
-    methods: {
-      getHangye() {
-        getAction('/ctop/creativeTitle/getTitleLabel', '').then(res => {
-          console.log(res)
-          if (res.success) {
-            this.options = res.result.map(item => {
-              return {
-                label: item.label,
-                value: item.value,
-                children: item.children.length > 0 ? [{
-                  label: '不限',
-                  value: 0
-                }].concat(item.children) : [{
-                  label: '不限',
-                  value: 0
-                }]
-              }
-            })
-          }
-        })
-      },
-      onChange(value, selectedOptions) {
-        console.log(value, selectedOptions)
-      },
-      getTitle() {
-        // /ctop/creativeTitle/titleSuggestion
-        getAction('/ctop/creativeTitle/titleSearch', {
-          firstCategory: 1,
-          secondCategory: 0,
-          keywords: '游戏'
-        }).then(
-          res => {
-            console.log(res)
-          }
-        )
-        // firstCategory,secondCategory,keywords
-      },
-      getHangyeTitle() {
-        getAction('/ctop/creativeTitle/titleSuggestion', {
-          firstCategory: 1,
-          secondCategory: 0,
-          keywords: '游戏'
-        }).then(
-          res => {
-            console.log(res)
-          }
-        )
-      },
-      fetchUser(value) {
-        console.log('fetching user', value);
-        this.data = [];
-        this.fetching = true;
 
-        getAction('/ctop/creativeTitle/titleSuggestion', {
-          firstCategory: 1,
-          secondCategory: 0,
-          keywords: '游戏'
-        }).then(
-          res => {
-            this.data = res.result;
-            this.fetching = false;
-          }
-        )
-      },
-      handleChange(value) {
-        console.log(`selected ${value}`);
-      },
-      filter(inputValue, path) {
-        return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
-      }
+    filter(inputValue, path) {
+      return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
     },
-    mounted() {
-      this.$nextTick(() => {
-        this.getHangye()
-        this.getHangyeTitle()
-      })
+
+    handleSearch(value) {
+      if (this.dataOne.length > 0) {
+        const str = { firstCategory: this.dataOne[0], secondCategory: this.dataOne[1], keyword: value }
+        getAction('/ctop/creativeTitle/titleSuggestion', str).then(d => {
+          const result = d.result ? d.result : []
+          this.data = result.map(item => {
+            return {
+              value: item,
+              text: item
+            }
+          })
+        })
+      } else {
+        this.data = []
+        return
+      }
     },
-    created() {}
-  }
-</script>
+    handleChange(value) {
+      console.log(value)
+      this.value = value
+    }
+  },
+  mounted() {
+    this.$nextTick(() => {
+      this.getHangye()
+    })
+  },
+  created() {}
+}
+</script>

+ 36 - 107
src/views/modules/material/excellentMaterial.vue

@@ -9,7 +9,7 @@
   }
 
   #material-card .ant-badge-count {
-    top: -10px;
+    top: 0px;
   }
 
   .detail .ant-form-item {
@@ -160,12 +160,31 @@
 </style>
 <template>
   <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="24">
+          <a-col :md="8" :sm="8">
+            <!-- <a-form-item label="项目名称"> -->
+            <selectTable :projectId.sync="queryParam.projectId"></selectTable>
+          </a-col>
+          <a-col :md="8" :sm="8">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
     <a-tabs @change="callbackTwo" v-model="active" id="material-card" type="card">
       <a-tab-pane :tab="item.tab" v-for="item of examinelList" :key="item.value">
         <div v-if="dataSource.length > 0">
+          <a-button @click="onCheckAllChange">{{ checkAll ? '取消  (  ' + checkArr.length + '  )' : '全选' }}</a-button>
+
+          <a-button :disabled="checkArr.length == 0" v-if="queryParam.projectId" @click="tongbu">一键同步</a-button>
           <a-checkbox-group @change="onChangeCheck" v-model="checkArr" class="home-card">
             <div class="home-item" v-for="(items, index) in dataSource" :key="index" @click="showDetail(items)">
-              <span v-if="items.excellent==0"></span>
+              <span v-if="items.excellent == 0"></span>
               <span v-else
                 style="position:absolute;top:30px;right:-105px;display:block;width:300px;height:30px;text-align:center;line-height;30px;background:red;transform:rotate(45deg);z-index:1000">优秀素材</span>
 
@@ -196,43 +215,10 @@
                     style="height:200px;max-width:100%;position:absolute;z-index:10;" />
                 </div>
 
-                <div v-if="active == '2'" class="bh">驳回原因:{{ items.refuseReason }}</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'"
-                    v-if="items.userId == userInfo().id">
-                    修改</a>
-                  <a-popconfirm @confirm="okEditShow(items, '2')" v-show="active != '2'" v-if="
-                      role.roleCode == 'operator' ||
-                        role.roleCode == 'kuaishouOperationManager' ||
-                        role.roleCode == 'admin' ||
-                        role.roleCode == 'touTiaoOperationManager'
-                    ">
-                    <div slot="title">
-                      <div>
-                        驳回原因:
-                        <a-textarea placeholder="请输入原因" v-model="refuseReason"
-                          :autosize="{ minRows: 3, maxRows: 10 }" />
-                      </div>
-                      <div>
-                        截图:
-                        <upload-to-ali v-model="refuseFile" :customDomain="customDomain" multiple preview
-                          :region="region" :bucket="bucket" :accept="acceptImage" :max="10" :size="1024000"
-                          :accessKeyId="accessKeyId" :accessKeySecret="accessKeySecret" :dir="dirImg"></upload-to-ali>
-                      </div>
-                    </div>
-                    <a href="javascript:;" style="margin-left:20px">驳回</a>
-                  </a-popconfirm>
-                  <a @click="okEditShow(items, '1')" href="javascript:;" style="margin-left:20px" v-show="active != '1'"
-                    v-if="
-                      role.roleCode == 'operator' ||
-                        role.roleCode == 'kuaishouOperationManager' ||
-                        role.roleCode == 'admin' ||
-                        role.roleCode == 'touTiaoOperationManager'
-                    ">
-                    通过审核</a>
 
-                  <a-checkbox :value="items.url" v-show="active == '1'" style="float:right"></a-checkbox>
+                  <a-checkbox :value="items.url" style="float:right"></a-checkbox>
                 </span>
               </div>
             </div>
@@ -252,7 +238,7 @@
     <a-modal title="素材详情" v-model="visibleDetail" width="70%">
       <div style="width:100%">
         <a-button type="primary" @click="setSuccess" style="float:right">
-          {{excellent==0?'标记为优秀素材':'取消标记'}}
+          {{ excellent == 0 ? '标记为优秀素材' : '取消标记' }}
         </a-button>
       </div>
       <div style="display:flex;height:700px">
@@ -361,6 +347,7 @@
     data() {
       return {
         inputVisible: false,
+        projectId: undefined,
         inputValue: '',
         labelCol: {
           xs: {
@@ -399,7 +386,7 @@
           {
             value: 'VIDEO',
             tab: '优秀视频'
-          },
+          }
         ],
         // 表头
         columns: [],
@@ -449,7 +436,7 @@
         noList: [],
         material: [],
         excellent: 0,
-        code: ""
+        code: ''
       }
     },
     filters: {
@@ -492,7 +479,7 @@
       //   this.active = localStorage.getItem('key') ? localStorage.getItem('key') : '0'
       // this.queryParam.status = key
       this.ipagination.pageSize = 8
-      //   this.getParticipateList()
+      this.getParticipateList()
       //   // /sys/user/getRoleInfo
       //   getAction('/sys/user/getRoleInfo', {
       //     userId: this.userInfo().id
@@ -500,7 +487,13 @@
       //     this.role = res
       //   })
     },
-    watch: {},
+    watch: {
+      'queryParam.projectId': function (n, o) {
+        if (n != '') {
+          this.getList(n)
+        }
+      }
+    },
     methods: {
       setSuccess() {
         var params = {}
@@ -532,75 +525,12 @@
       a(item) {
         item.showVideo = true
       },
-      tongbuImage() {
+      tongbu() {
         this.$refs.check.getData('/ctop/userAllocation/getAccountList', {
           userId: this.userInfo().id,
           projectId: this.queryParam.projectId
         })
       },
-      tongbu() {
-        if (this.checkArr.length > 1) {
-          downFilePost('/download/zip', {
-            urls: this.checkArr
-          }).then(res => {
-            let blob = new Blob([res], {
-              type: 'application/zip'
-            })
-            let downloadElement = document.createElement('a')
-            let href = window.URL.createObjectURL(blob) //创建下载的链接
-            downloadElement.href = href
-            downloadElement.download = '批量下载' //下载后文件名
-            document.body.appendChild(downloadElement)
-            downloadElement.click() //点击下载
-            document.body.removeChild(downloadElement) //下载完成移除元素
-            window.URL.revokeObjectURL(href) //释放掉blob对象
-          })
-        } else {
-          let image = new Image()
-          image.setAttribute('crossOrigin', 'anonymous')
-          image.src = this.checkArr[0]
-          image.onload = () => {
-            let canvas = document.createElement('canvas')
-            canvas.width = image.width
-            canvas.height = image.height
-            let ctx = canvas.getContext('2d')
-            ctx.drawImage(image, 0, 0, image.width, image.height)
-            canvas.toBlob(blob => {
-              let url = URL.createObjectURL(blob)
-              let eleLink = document.createElement('a')
-              eleLink.download = '封面下载'
-              eleLink.href = url
-              eleLink.click()
-              eleLink.remove()
-              // 用完释放URL对象
-              URL.revokeObjectURL(url)
-            })
-          }
-        }
-
-        //   for (var i = 0; i < this.checkArr.length; i++) {
-        //     let image = new Image()
-        //     image.setAttribute('crossOrigin', 'anonymous')
-        //     image.src = this.checkArr[i]
-        //     image.onload = () => {
-        //       let canvas = document.createElement('canvas')
-        //       canvas.width = image.width
-        //       canvas.height = image.height
-        //       let ctx = canvas.getContext('2d')
-        //       ctx.drawImage(image, 0, 0, image.width, image.height)
-        //       canvas.toBlob(blob => {
-        //         let url = URL.createObjectURL(blob)
-        //         let eleLink = document.createElement('a')
-        //         eleLink.download = '封面下载'
-        //         eleLink.href = url
-        //         eleLink.click()
-        //         eleLink.remove()
-        //         // 用完释放URL对象
-        //         URL.revokeObjectURL(url)
-        //       })
-        //     }
-        //   }
-      },
       implement(data) {
         var params = {}
         var dataJson = []
@@ -693,8 +623,7 @@
             }
           })[0].mediaId
         }
-
-        this.loadData()
+        console.log(this.mediaId)
       },
       onChangeCheck(checkedList) {
         if (checkedList.length == 0) {

+ 4 - 4
src/views/modules/material/materialList.vue

@@ -9,7 +9,7 @@
 }
 
 #material-card .ant-badge-count {
-  top: -10px;
+  top: 0px;
 }
 
 .detail .ant-form-item {
@@ -21,9 +21,9 @@
 }
 </style>
 <style lang="scss" scoped>
-// .home-item {
-//   overflow: hidden;
-// }
+.home-item {
+  overflow: hidden;
+}
 
 @media (min-width: 1024px) {
   .home-item {

+ 4 - 4
src/views/modules/material/videoMaterial.vue

@@ -12,7 +12,7 @@
 }
 
 #material-card .ant-badge-count {
-  top: -10px;
+  top: 0px;
 }
 
 .detail .ant-form-item {
@@ -85,9 +85,9 @@
   color: #fff;
   background-color: rgba(0, 0, 0, 0.3);
 }
-// .home-item {
-//   overflow: hidden;
-// }
+.home-item {
+  overflow: hidden;
+}
 
 @media (min-width: 1024px) {
   .home-item {