Pārlūkot izejas kodu

档案查询分页调接口

duy 2 gadi atpakaļ
vecāks
revīzija
dbe3a62f4e
2 mainītis faili ar 90 papildinājumiem un 20 dzēšanām
  1. 14 0
      src/api/modules/using/query.js
  2. 76 20
      src/views/using/query.vue

+ 14 - 0
src/api/modules/using/query.js

@@ -0,0 +1,14 @@
+import {httpApi} from "../../request/httpApi";
+
+export default {
+  //分页
+async getarchiveQueryPage(form, msg = true) {
+    return httpApi({
+        url: '/api/blade-archive/archivesauto/pageByArchivesAuto',
+        method: 'get',
+        params: form,
+      
+    }, msg);
+  },
+ 
+}

+ 76 - 20
src/views/using/query.vue

@@ -2,7 +2,7 @@
     <div class="hc-page-box" id="carry-spot-checks-layout-target">
         <HcCard ui="hc-query-card-box" v-show="!isCarrySpotChecksDrawer">
             <div class="hc-query-input-box">
-                <el-input placeholder="可按关键字模糊搜索,多个关键字用“,” 隔开">
+                <el-input placeholder="可按关键字模糊搜索,多个关键字用“,” 隔开" v-model="searchInput">
                     <template #prepend>
                         <div class="prepend-filtering" @click="filteringClick">
                             <span class="name">条件筛选</span>
@@ -12,12 +12,12 @@
                     </template>
                     <template #append>
                         <div class="append-search-btn-box">
-                            <el-button type="primary" class="search-btn" @click="searchFileClick">
-                                按文件查询
-                            </el-button>
-                            <el-button type="primary" class="search-btn" @click="searchCaseClick">
+                            <el-button type="primary" class="search-btn" @click="searchCaseClick('1')">
                                 按案卷查询
                             </el-button>
+                            <el-button type="primary" class="search-btn" @click="searchFileClick('2')">
+                                按文件查询
+                            </el-button>
                         </div>
                     </template>
                 </el-input>
@@ -28,10 +28,7 @@
                     <el-collapse-item name="show">
                         <div class="hc-search-hot-key">
                             <span>热门搜索词汇:</span>
-                            <span class="text-hover ml-4">文件名</span>
-                            <span class="text-hover ml-4">案卷名</span>
-                            <span class="text-hover ml-4">档号</span>
-                            <span class="text-hover ml-4">单位</span>
+                            <span class="text-hover ml-4"  v-for="item in hotInputlist" @click="clickHottitle(item)">{{ item.name }}</span>
                         </div>
                         <div class="hc-search-screening-item">
                             <div class="title">年度:</div>
@@ -254,6 +251,7 @@ import MetaTable from "../transfer/components/meta-table.vue"
 import HcNodeTree from "~src/components/tree/hc-tree-1.vue"
 import { getIndex, isIndex } from "vue-utils-plus"
 import website from '~src/config/index'
+import archiveQueryApi from "~api/using/query.js";
 
 //变量
 const useAppState = useAppStore()
@@ -275,13 +273,25 @@ watch(() => [
 onMounted(() => {
     setAnnuals()
     setMonths()
+    getTableData()
 })
 
 //搜索表单
 const searchForm = ref({
-    current: 1, size: 20, total: 0
+    current: 1, size: 20, total: 0,searchType:"1"
 })
+//热门搜索词汇
+const hotInputlist=ref([
+    {name:'文件名'},
+    {name:'案卷名'},
+    {name:'档号'},
+    {name:'单位'},
+])
+const clickHottitle=(item)=>{
+    searchInput.value=item.name
+    searchForm.value.queryValue=item.name
 
+}
 //年度
 const annuals = ref([])
 const setAnnuals = () => {
@@ -299,6 +309,13 @@ const setAnnuals = () => {
 const annual = ref([{key: 'all', name: '所有'}])
 const annualClick = (item) => {
     annual.value = setQueryFiltering(annual.value, item)
+    console.log(item,'item');
+    searchForm.value.year=item.name
+    // let arr=[]
+    // annual.value.forEach((item)=>{
+    //     arr.push(item.name)
+    // })
+    // searchForm.value.year=arr+''
 }
 
 
@@ -308,7 +325,7 @@ const setMonths = () => {
     let monthArr = [{key: 'all', name: '所有'}]
     for (let i = 0; i < 12; i++) {
         let item = (i + 1) + ''
-        item.length === 1 && (item = '0' + item)
+        item.length === 1 && (item =  item)
         monthArr.push({
             key: item,
             name: item + '月'
@@ -319,18 +336,28 @@ const setMonths = () => {
 const month = ref([{key: 'all', name: '所有'}])
 const monthClick = (item) => {
     month.value = setQueryFiltering(month.value, item)
+    let arr=[]
+    month.value.forEach((item)=>{
+        arr.push(item.key)
+    })
+    searchForm.value.month=arr+''
 }
 
 //期限
 const deadline = ref([{key: 'all', name: '所有'}])
 const deadlines = ref([
     {key: 'all', name: '所有'},
-    {key: 'for', name: '永久'},
+    {key: '9999', name: '永久'},
     {key: '30', name: '30年'},
     {key: '10', name: '10年'}
 ])
 const deadlineClick = (item) => {
     deadline.value = setQueryFiltering(deadline.value, item)
+    let arr=[]
+    deadline.value.forEach((item)=>{
+        arr.push(item.key)
+    })
+    searchForm.value.storageTime=arr+''
 }
 
 
@@ -338,12 +365,18 @@ const deadlineClick = (item) => {
 const security = ref([{key: 'all', name: '所有'}])
 const securitys = ref([
     {key: 'all', name: '所有'},
-    {key: '1',name: '秘密'},
-    {key: '2',name: '机密'},
-    {key: '3',name: '绝密'}
+    {key: '1',name: '机密'},
+    {key: '2',name: '绝密'},
+    {key: '3',name: '秘密'},
+    {key: '3',name: '公开'},
 ])
 const securityClick = (item) => {
     security.value = setQueryFiltering(security.value, item)
+    let arr=[]
+    security.value.forEach((item)=>{
+        arr.push(item.key)
+    })
+    searchForm.value.secretLevel=arr+''
 }
 
 
@@ -361,6 +394,11 @@ const classess = ref([
 ])
 const classesClick = (item) => {
     classes.value = setQueryFiltering(classes.value, item)
+    let arr=[]
+    classes.value.forEach((item)=>{
+        arr.push(item.name)
+    })
+    searchForm.value.carrierType=arr+''
 }
 
 
@@ -417,15 +455,19 @@ const filteringClick = () => {
         filteringShow.value = 'show'
     }
 }
-
+const searchInput=ref('')
 //按文件查询
-const searchFileClick = () => {
+const searchFileClick = (type) => {
     filteringShow.value = ''
+    searchForm.value.searchType=type
+    getTableData()
 }
 
 //按案卷查询
-const searchCaseClick = () => {
+const searchCaseClick = (type) => {
     filteringShow.value = ''
+    searchForm.value.searchType=type
+    getTableData()
 }
 
 
@@ -489,9 +531,23 @@ const tableData = ref([
 
 const tableLoading = ref(false)
 const getTableData = async () => {
-
+    tableLoading.value = true
+    searchForm.value.queryValue=searchInput.value
+    console.log(searchForm.value,'searchForm.value');
+    const { error, code, data } = await archiveQueryApi.getarchiveQueryPage({
+        ...searchForm.value,
+        projectId: projectId.value,
+      
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data['records'])
+        searchForm.value.total = data['total'] || 0
+    } else {
+        tableData.value = []
+        searchForm.value.total = 0
+    }
 }
-
 //多选
 const tableKeys = ref([]);
 const tableSelection = (rows) => {