scorpio 2 years ago
parent
commit
da50637c6f
4 changed files with 73 additions and 36 deletions
  1. 6 5
      src/api/common.js
  2. 29 27
      src/api/index.js
  3. 12 0
      src/api/search/index.js
  4. 26 4
      src/layout/search/index.vue

+ 6 - 5
src/api/common.js

@@ -1,19 +1,20 @@
 import fetch from '../api/fetch.js'
 
 export default {
-  dicList (params) {
+  dicList(params) {
     return fetch('/blade-system/dict-biz/dictionary', params)
   },
-  submit (params) { // 保存上传文件素材
+  submit(params) {
+    // 保存上传文件素材
     return fetch('/wutong-library/library/save', params, 'post', 'json')
   },
-  basicFormRequest (url) {
+  basicFormRequest(url) {
     return fetch(url)
   },
-  region (params) {
+  region(params) {
     return fetch('/blade-system/region/lazy-tree', params)
   },
-  deptList (params) {
+  deptList(params) {
     return fetch('/blade-project-manage-v2/other/v2/deptList', params)
   }
 }

+ 29 - 27
src/api/index.js

@@ -1,27 +1,29 @@
-import login from './login/index.js'
-import system from './system/index.js'
-import project from './project/index.js'
-import common from './common.js'
-import recycle from './recycle/index.js'
-import database from './database/index.js'
-import task from './task/index.js'
-import company from './company/index.js'
-import inspect from './inspect/index.js'
-import params from './params/index.js'
-import invest from './invest/index'
-
-export default {
-  offices: ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'],
-  uploadPath: '/api/wutong-file/minio/file/upload', // 上传
-  login,
-  system,
-  project,
-  common,
-  recycle,
-  database,
-  task,
-  company,
-  inspect,
-  params,
-  invest
-}
+import login from './login/index.js'
+import system from './system/index.js'
+import project from './project/index.js'
+import common from './common.js'
+import recycle from './recycle/index.js'
+import database from './database/index.js'
+import task from './task/index.js'
+import company from './company/index.js'
+import inspect from './inspect/index.js'
+import params from './params/index.js'
+import invest from './invest/index'
+import search from './search/index.js'
+
+export default {
+  offices: ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'],
+  uploadPath: '/api/wutong-file/minio/file/upload', // 上传
+  login,
+  system,
+  project,
+  common,
+  recycle,
+  database,
+  task,
+  company,
+  inspect,
+  params,
+  invest,
+  search
+}

+ 12 - 0
src/api/search/index.js

@@ -0,0 +1,12 @@
+import fetch from '../fetch.js'
+
+export default {
+  /**
+   * 搜索
+   * @returns {Promise<unknown>}
+   */
+  searchList(params) {
+    // 回收站列表
+    return fetch('/blade-project-manage-v2/search/v2/search', params, 'post')
+  }
+}

+ 26 - 4
src/layout/search/index.vue

@@ -4,14 +4,14 @@
       <div class="icon flex flex-center main-bg-color">
         <el-icon size="30px"><Search /></el-icon>
       </div>
-      <el-input placeholder="搜索"></el-input>
-      <el-button type="primary" class="ml-20">搜 索</el-button>
+      <el-input v-model="keyword" placeholder="搜索"></el-input>
+      <el-button type="primary" class="ml-20" @click="search">搜 索</el-button>
     </div>
     <div class="mt-20 padding">
       <span class="bold font-16">文档(393030)</span>
       <div class="flex mt-20">
         <div class="full-width mt-10 list">
-          <div v-for="i in 20" :key="i">
+          <div v-for="i in list" :key="i">
             <div class="padding border-bottom">
               (初设批复)云县火车站站前广场及综合配套工程.pdf
             </div>
@@ -42,7 +42,29 @@
 </template>
 
 <script>
-export default {}
+export default {
+  data() {
+    return {
+      // fixme  测试
+      keyword: '禄丰',
+      page: { current: 1, size: 10 },
+      list: []
+    }
+  },
+  methods: {
+    search(params) {
+      const data = Object.assign(this.page, { keyword: this.keyword })
+      this.$api.search.searchList(data).then(res => {
+        if (res.code === 200) {
+          console.log(res.data)
+          this.list = res.data.records
+        } else {
+          console.log(res.msg)
+        }
+      })
+    }
+  }
+}
 </script>
 
 <style lang="scss" scoped>