Explorar o código

fix-所有搜索模块pageNum问题修复

shaogen1995 hai 1 mes
pai
achega
0d332143a1

+ 5 - 5
README.md

@@ -1,11 +1,11 @@
 1.使用 yarn。 npm 有问题
 
-git 地址:http://192.168.0.115:3000/shaogen1995/liuShaoQi-houTai
+git 地址:http://192.168.0.115:3000/lanxin/KLMYMuseum
 
-测试地址:https://sit-liushaoqibwg.4dage.com/backstage
+测试地址:
 
-堡垒机位置:/227/data/data/museum_hunan_liushaoqi_data/backstage
+堡垒机位置:
 
-线下接口:192.168.20.61:8072/api/doc.html#/home
+线下接口:
 
-测试接口:https://sit-liushaoqibwg.4dage.com/api/doc.html#/home
+测试接口:

+ 7 - 3
src/pages/A4news/index.tsx

@@ -26,9 +26,13 @@ function A4news() {
   const [pageData, setPageData] = useState(pageDataBase)
   const [title, setTitle] = useState('')
   const getListFu = useCallback(
-    (title?: string) => {
+    (title?: string, pageNum?: number) => {
+      const obj = { ...pageData, status: -1, title }
+
+      if (pageNum) obj.pageNum = 1
+
       // status: -1 全部 0 未发布 1 已发布
-      dispatch(A4_APIgetList({ ...pageData, status: -1, title }))
+      dispatch(A4_APIgetList(obj))
     },
     [dispatch, pageData]
   )
@@ -137,7 +141,7 @@ function A4news() {
       <div className='A4top'>
         <div className='A4topLeft'>
           <Input placeholder='请输入标题' onChange={e => setTitle(e.target.value)} value={title} />
-          <Button type='primary' onClick={() => getListFu(title)}>
+          <Button type='primary' onClick={() => getListFu(title, 1)}>
             搜索
           </Button>
           <Button

+ 6 - 3
src/pages/A5activity/index.tsx

@@ -26,9 +26,12 @@ function A5activity() {
   const [pageData, setPageData] = useState(pageDataBase)
   const [title, setTitle] = useState('')
   const getListFu = useCallback(
-    (title?: string) => {
+    (title?: string, pageNum?: number) => {
+      const obj = { ...pageData, status: -1, title }
+
+      if (pageNum) obj.pageNum = 1
       // status: -1 全部 0 未发布 1 已发布
-      dispatch(A5_APIgetList({ ...pageData, status: -1, title }))
+      dispatch(A5_APIgetList(obj))
     },
     [dispatch, pageData]
   )
@@ -137,7 +140,7 @@ function A5activity() {
       <div className='A5top'>
         <div className='A5topLeft'>
           <Input placeholder='请输入标题' onChange={e => setTitle(e.target.value)} value={title} />
-          <Button type='primary' onClick={() => getListFu(title)}>
+          <Button type='primary' onClick={() => getListFu(title, 1)}>
             搜索
           </Button>
           <Button

+ 6 - 3
src/pages/A6exhibition/index.tsx

@@ -27,9 +27,12 @@ function A6exhibition() {
   const [title, setTitle] = useState('')
   const [type, setType] = useState(0)
   const getListFu = useCallback(
-    (title?: string) => {
+    (title?: string, pageNum?: number) => {
+      const obj = { ...pageData, status: -1, title, type }
+
+      if (pageNum) obj.pageNum = 1
       // status: -1 全部 0 未发布 1 已发布
-      dispatch(A6_APIgetList({ ...pageData, status: -1, title, type }))
+      dispatch(A6_APIgetList(obj))
     },
     [dispatch, pageData, type]
   )
@@ -145,7 +148,7 @@ function A6exhibition() {
             maxLength={10}
           />
 
-          <Button type='primary' onClick={() => getListFu(title)}>
+          <Button type='primary' onClick={() => getListFu(title, 1)}>
             搜索
           </Button>
           <Button

+ 7 - 4
src/pages/B1reserve1/index.tsx

@@ -13,7 +13,6 @@ import B1look from './B1look'
 import { MessageFu } from '@/utils/message'
 import { B_APIgetServe } from '@/store/action/Breserve'
 import dayjs from 'dayjs'
-import { start } from 'repl'
 
 // import { exportExcelFile } from '@/utils/xlsxExport'
 
@@ -37,8 +36,12 @@ function B1reserve1() {
   const [serverOptions, setServerOptions] = useState<{ label: string; value: number }[]>([])
 
   const getListFu = useCallback(
-    (name?: string) => {
-      dispatch(B_APIgetList({ ...pageData, name: name || '', type: 1, ...queryData }))
+    (name?: string, pageNum?: number) => {
+      const obj = { ...pageData, name: name || '', type: 1, ...queryData }
+
+      if (pageNum) obj.pageNum = 1
+
+      dispatch(B_APIgetList(obj))
     },
     [dispatch, pageData, queryData]
   )
@@ -158,7 +161,7 @@ function B1reserve1() {
             onChange={e => setName(e.target.value)}
             value={name}
           />
-          <Button type='primary' onClick={() => getListFu(name)}>
+          <Button type='primary' onClick={() => getListFu(name, 1)}>
             搜索
           </Button>
           <Button

+ 7 - 3
src/pages/B2reserve2/index.tsx

@@ -32,8 +32,12 @@ function B2reserve2() {
   }>({})
 
   const getListFu = useCallback(
-    (name?: string) => {
-      dispatch(B_APIgetList({ ...pageData, name: name || '', type: 2, ...queryData }))
+    (name?: string, pageNum?: number) => {
+      const obj = { ...pageData, name: name || '', type: 2, ...queryData }
+
+      if (pageNum) obj.pageNum = 1
+
+      dispatch(B_APIgetList(obj))
     },
     [dispatch, pageData, queryData]
   )
@@ -135,7 +139,7 @@ function B2reserve2() {
             onChange={e => setName(e.target.value)}
             value={name}
           />
-          <Button type='primary' onClick={() => getListFu(name)}>
+          <Button type='primary' onClick={() => getListFu(name, 1)}>
             搜索
           </Button>
           <Button

+ 6 - 3
src/pages/D1feedback/index.tsx

@@ -32,8 +32,11 @@ function D1feedback() {
   const [pageData, setPageData] = useState(pageDataBase)
 
   const getListFu = useCallback(
-    (search?: string) => {
-      dispatch(D1_APIgetList({ ...pageData, search, ...queryData }))
+    (search?: string, pageNum?: number) => {
+      const obj = { ...pageData, search, ...queryData }
+
+      if (pageNum) obj.pageNum = 1
+      dispatch(D1_APIgetList(obj))
     },
     [dispatch, pageData, queryData]
   )
@@ -130,7 +133,7 @@ function D1feedback() {
             onChange={e => setSearch(e.target.value)}
             value={search}
           />
-          <Button type='primary' onClick={() => getListFu(search)}>
+          <Button type='primary' onClick={() => getListFu(search, 1)}>
             搜索
           </Button>
           <Button