bding 1 жил өмнө
parent
commit
c8649e1e38

+ 4 - 0
src/api/modules/rai/YanXuanApi.js

@@ -53,6 +53,10 @@ const YanXuanApi = {
   yanxuan_specialAuthorUpdate: (params) => {
     return http.post("/cygx/yanxuan_special/author/update", params);
   },
+  // 作者模糊查询
+  yanxuan_specialAuthorSearch: (params) => {
+    return http.get("/cygx/yanxuan_special/author/search", params);
+  },
 };
 
 export default YanXuanApi;

+ 27 - 3
src/views/rai_manage/reportManage/yanXuanSpecial.vue

@@ -30,9 +30,9 @@
           <el-input @input="reportTitleHandle" v-model="reportTitle" placeholder="请输入文章标题" clearable style="display: inline-block; width: 240px; margin-right: 20px">
             <i slot="prefix" class="el-input__icon el-icon-search"></i>
           </el-input>
-          <el-input @input="reportTitleHandle" v-model="authorName" placeholder="请输入作者昵称" clearable style="display: inline-block; width: 240px">
+          <el-autocomplete v-model="authorName" :fetch-suggestions="querySearchAsync" placeholder="请输入作者昵称" @select="conditionChange">
             <i slot="prefix" class="el-input__icon el-icon-search"></i>
-          </el-input>
+          </el-autocomplete>
         </div>
       </template>
       <div v-else style="margin-bottom: 20px; display: flex; justify-content: space-between">
@@ -48,9 +48,12 @@
               :value="item.value"
             />
           </el-select>
-          <el-input @input="authorColumnValueHandler" v-model="authorColumnValue" placeholder="请输入专栏名称" clearable style="display: inline-block; width: 240px">
+          <el-input @input="authorColumnValueHandler" v-model="authorColumnValue" placeholder="请输入专栏名称" clearable style="display: inline-block; width: 240px; margin-right: 20px">
             <i slot="prefix" class="el-input__icon el-icon-search"></i>
           </el-input>
+          <el-autocomplete v-model="authorName" :fetch-suggestions="querySearchAsync" placeholder="请输入作者昵称" @select="conditionChange">
+            <i slot="prefix" class="el-input__icon el-icon-search"></i>
+          </el-autocomplete>
         </div>
         <div>
           <el-button type="primary" @click="addAuthorDlgVisible = true">新建作者</el-button>
@@ -181,6 +184,7 @@ export default {
     // 点击了头部的tlble
     tlableClickHandler(item) {
       this.topLableActive = item.value;
+      this.authorName = "";
       this.page_no = 1;
       this.getyanxuanReportSpecial();
     },
@@ -346,6 +350,26 @@ export default {
       this.lookEditRemarkInfo = row;
       this.lookEditRemarkDlgShow = true;
     },
+
+    async querySearchAsync(queryString, cb) {
+      cb([]);
+      if (!queryString) {
+        this.conditionChange();
+      } else {
+        const res = await raiInterface.yanxuan_specialAuthorSearch({
+          KeyWord: queryString,
+        });
+        if (res.Ret === 200) {
+          let arr = res.Data.List.map((item) => {
+            return {
+              ...item,
+              value: item.KeyWord,
+            };
+          });
+          cb(arr);
+        }
+      }
+    },
   },
 };
 </script>