zhuxinbo 5 年之前
父节点
当前提交
1474335a42

+ 74 - 16
src/views/modules/headerLibrary/index.vue

@@ -15,8 +15,8 @@
   <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>
-          行业
+        <div style="margin-bottom:30px">
+          <span style="display:inline-block;width:80px">行业</span>
           <a-cascader
             style="margin-top: 1rem;width:300px"
             :options="options"
@@ -28,12 +28,37 @@
             <a-icon type="smile" slot="suffixIcon" class="test" />
           </a-cascader>
         </div>
-
-        关键词
+        <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>
@@ -48,11 +73,28 @@ export default {
   name: 'online-training-list',
   data() {
     return {
-      options: []
+      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)
@@ -67,29 +109,45 @@ export default {
                   : [{ label: '不限', value: 0 }]
             }
           })
+          this.options = [{ label: '不限', value: 0 }].concat(this.options)
         }
       })
     },
     onChange(value, selectedOptions) {
       console.log(value, selectedOptions)
+      this.dataOne = value
+      this.value = undefined
     },
-    getTitle() {
-      // /ctop/creativeTitle/titleSearch
-      getAction('/ctop/creativeTitle/titleSearch', { firstCategory: 1, secondCategory: 0, keywords: '游戏' }).then(
-        res => {
-          console.log(res)
-        }
-      )
-      // firstCategory,secondCategory,keywords
-    },
+
     filter(inputValue, path) {
       return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1)
+    },
+
+    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
+      }
+    },
+    handleChange(value) {
+      console.log(value)
+      this.value = value
     }
   },
   mounted() {
     this.$nextTick(() => {
       this.getHangye()
-      this.getTitle()
     })
   },
   created() {}

文件差异内容过多而无法显示
+ 880 - 897
src/views/modules/material/excellentMaterial.vue


+ 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 {