Procházet zdrojové kódy

feat: 数据权限

chenlei před 1 měsícem
rodič
revize
77999c94e4
31 změnil soubory, kde provedl 145 přidání a 50 odebrání
  1. 2 1
      package.json
  2. 12 2
      src/components/ZGaddNow/index.tsx
  3. 5 1
      src/pages/A3_ledger/A32Routing/A32table/index.tsx
  4. 1 1
      src/pages/A3_ledger/C1ledger/index.tsx
  5. 1 1
      src/pages/A3_ledger/ComPage/C8recycleBin/index.tsx
  6. 1 1
      src/pages/A_workbench/A2business/A2table/index.tsx
  7. 2 0
      src/pages/B_enterTibet/B2identify/B2edit/index.tsx
  8. 2 1
      src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx
  9. 2 1
      src/pages/C_goodsManage/C1register/AddGoods/index.tsx
  10. 2 2
      src/pages/C_goodsManage/C1register/C1look/index.tsx
  11. 3 1
      src/pages/C_goodsManage/C21wealth/C21edit/index.tsx
  12. 4 1
      src/pages/C_goodsManage/C22goodEdit/C22look/index.tsx
  13. 1 1
      src/pages/C_goodsManage/C3focus/index.tsx
  14. 1 1
      src/pages/D_storeManage/D1storage/D1goods/index.tsx
  15. 4 2
      src/pages/D_storeManage/D4impStor/D4edit/index.tsx
  16. 9 3
      src/pages/D_storeManage/D5moveStor/D5edit/index.tsx
  17. 9 3
      src/pages/D_storeManage/D6putsStor/D6edit/index.tsx
  18. 9 3
      src/pages/D_storeManage/D8cancel/D8edit/index.tsx
  19. 1 1
      src/pages/E_goodsStorage/E1accident/E1edit/index.tsx
  20. 1 1
      src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx
  21. 9 3
      src/pages/E_goodsStorage/E4repair/E4edit/index.tsx
  22. 8 2
      src/pages/F_exhibition/F1exhibition/F1edit/index.tsx
  23. 1 1
      src/pages/Layout/data.ts
  24. 1 1
      src/pages/Y_goodsDetails/Y1cathet/Y1main.tsx
  25. 1 1
      src/pages/Y_goodsDetails/Y1cathet/Y44com.tsx
  26. 1 1
      src/pages/Y_goodsDetails/Y1cathet/index.tsx
  27. 12 8
      src/pages/Y_goodsDetails/Y2look/index.tsx
  28. 2 2
      src/store/action/C1ledger.ts
  29. 1 1
      src/store/action/D3staff.ts
  30. 13 2
      src/utils/history.ts
  31. 24 0
      yarn.lock

+ 2 - 1
package.json

@@ -29,6 +29,7 @@
     "jszip-utils": "^0.1.0",
     "lodash": "^4.17.21",
     "pizzip": "^3.1.8",
+    "query-string": "^9.2.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
     "react-redux": "^8.0.4",
@@ -74,4 +75,4 @@
     "react-app-rewired": "^2.2.1"
   },
   "homepage": "."
-}
+}

+ 12 - 2
src/components/ZGaddNow/index.tsx

@@ -13,6 +13,10 @@ import { B3nowSearchType } from './type'
 import { B3baseFormData, B3nowArr1, B3nowArr2 } from './data'
 
 type Props = {
+  /** 菜单权限id,用于数据鉴权 */
+  menuId: number
+  /** 订单id,用于数据鉴权 */
+  orderId?: number
   closeFu: () => void
   nowSta: { key: string; id: string }
   // key:1=入馆 2=入藏 3-登记 4-删除 5-入库 6-出库 7-藏品编辑
@@ -29,6 +33,8 @@ type Props = {
 
 function ZGaddNow({
   nowSta,
+  menuId,
+  orderId,
   closeFu,
   isOne = false,
   dataResFu,
@@ -162,14 +168,18 @@ function ZGaddNow({
         title: '操作',
         render: (item: C1GoodType) => {
           return (
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, menuId, '', orderId)}
+            >
               查看
             </Button>
           )
         }
       }
     ]
-  }, [])
+  }, [menuId, orderId])
 
   // 点击提交
   const btnOk = useCallback(() => {

+ 5 - 1
src/pages/A3_ledger/A32Routing/A32table/index.tsx

@@ -116,7 +116,11 @@ function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
         fixed: 'right',
         render: (item: FourTableType) => {
           return (
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, 602, '', item.id)}
+            >
               查看
             </Button>
           )

+ 1 - 1
src/pages/A3_ledger/C1ledger/index.tsx

@@ -104,7 +104,7 @@ function C1ledger() {
         title: '操作',
         render: (item: FourTableType) => {
           return (
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 601)}>
               查看
             </Button>
           )

+ 1 - 1
src/pages/A3_ledger/ComPage/C8recycleBin/index.tsx

@@ -99,7 +99,7 @@ function C8recycleBin({ closeFu }: Props) {
         render: (item: any) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 9)}>
                 查看
               </Button>
               <MyPopconfirm txtK='恢复' onConfirm={() => regainFu(item.id)} />

+ 1 - 1
src/pages/A_workbench/A2business/A2table/index.tsx

@@ -100,7 +100,7 @@ function A2table() {
   const lookPage = useCallback(
     (name: string, id: number) => {
       const obj = typePageArr.find(v => v.name === name)
-      if (obj) openGoodsInfoFu(id, `#${obj.path}_edit/4/`)
+      if (obj) openGoodsInfoFu(id, 120, `#${obj.path}_edit/4/`)
       else MessageFu.warning('业务类型错误')
     },
     [typePageArr]

+ 2 - 0
src/pages/B_enterTibet/B2identify/B2edit/index.tsx

@@ -513,6 +513,8 @@ function B2edit() {
       {/* 新增弹窗 */}
       {nowSta.id ? (
         <ZGaddNow
+          menuId={220}
+          orderId={topInfo.id}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {

+ 2 - 1
src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx

@@ -83,7 +83,7 @@ function B34edit({ type }: Props) {
       render: (item: C1GoodType) => {
         return item.subNum && item.relatedOrderId ? (
           <span
-            onClick={() => openGoodsInfoFu(item.relatedOrderId, '#/register_edit/4/')}
+            onClick={() => openGoodsInfoFu(item.relatedOrderId, 999, '#/register_edit/4/')}
             className='D1GtNum'
           >
             {item.subNum}
@@ -560,6 +560,7 @@ function B34edit({ type }: Props) {
       {/* 选中藏品弹窗 */}
       {nowSta.id ? (
         <ZGaddNow
+          menuId={9999}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '入藏', id: '' })}
           dataResFu={data => {

+ 2 - 1
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -78,7 +78,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
   // 编辑进来获取详情
   const getInfo = useCallback(
     async (id: number) => {
-      const res = await API_goodsInfo(id)
+      const res = await API_goodsInfo(id, 17)
       if (res.code === 0) {
         // 藏品编辑信息保存
         objOld.current = { ...res.data }
@@ -1007,6 +1007,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
       {/* 从入馆入藏藏品中选择一个 */}
       {selectOne ? (
         <ZGaddNow
+          menuId={17}
           register={true}
           nowSta={{ key: '藏品登记', id: 'cms/register/goods/getList' }}
           closeFu={() => setSelectOne(false)}

+ 2 - 2
src/pages/C_goodsManage/C1register/C1look/index.tsx

@@ -43,7 +43,7 @@ function C1look() {
       const data = res.data
       setTopInfo(data)
       if (data.goodsIds) {
-        const res2 = await API_goodsInfo(data.goodsIds)
+        const res2 = await API_goodsInfo(data.goodsIds, 17)
         if (res2.code === 0) {
           setInfo(res2.data)
         }
@@ -183,7 +183,7 @@ function C1look() {
           藏品详情
           <div className='C1TitRR'>
             更多操作请在详情页中进行
-            <Button type='primary' onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds))}>
+            <Button type='primary' onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 17)}>
               查看详情
             </Button>
           </div>

+ 3 - 1
src/pages/C_goodsManage/C21wealth/C21edit/index.tsx

@@ -233,7 +233,7 @@ function C21edit() {
         render: (item: C1GoodType) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 20)}>
                 查看
               </Button>
               <Button size='small' type='text' onClick={() => downloadBatchZip([item.id])}>
@@ -552,6 +552,8 @@ function C21edit() {
       {/* 新增弹窗 */}
       {nowSta.id ? (
         <ZGaddNow
+          menuId={20}
+          orderId={topInfo.id}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {

+ 4 - 1
src/pages/C_goodsManage/C22goodEdit/C22look/index.tsx

@@ -243,7 +243,10 @@ function C22look() {
         <div className='C22Tit C22Tit2'>
           修改明细
           <div className='C22TitRR'>
-            <Button type='primary' onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds))}>
+            <Button
+              type='primary'
+              onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 18, '', topInfo.id)}
+            >
               藏品详情
             </Button>
           </div>

+ 1 - 1
src/pages/C_goodsManage/C3focus/index.tsx

@@ -94,7 +94,7 @@ function C3focus() {
         render: (item: FourTableType) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 360)}>
                 查看
               </Button>
               <MyPopconfirm

+ 1 - 1
src/pages/D_storeManage/D1storage/D1goods/index.tsx

@@ -136,7 +136,7 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
         title: '操作',
         render: (item: any) => {
           return (
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 410)}>
               查看
             </Button>
           )

+ 4 - 2
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -83,7 +83,7 @@ function D4edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 7)
         if (res2.code === 0) {
           setTopInfo({ ...res.data, storageId: res2.data.storageId })
           setSnaps([res2.data])
@@ -329,7 +329,7 @@ function D4edit() {
         render: (item: C1GoodType) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id, 7)}>
                 查看
               </Button>
               {['3', '4'].includes(key) ? null : (
@@ -744,6 +744,8 @@ function D4edit() {
 
       {nowSta.id ? (
         <ZGaddNow
+          menuId={7}
+          orderId={topInfo.id}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {

+ 9 - 3
src/pages/D_storeManage/D5moveStor/D5edit/index.tsx

@@ -69,7 +69,7 @@ function D5edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 25)
         if (res2.code === 0) {
           setTopInfo({ ...res.data, storageOutId: res2.data.storageId })
           setSnaps([res2.data])
@@ -335,7 +335,11 @@ function D5edit() {
         render: (item: C1GoodType) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+              <Button
+                size='small'
+                type='text'
+                onClick={() => openGoodsInfoFu(item.id, 25, '', topInfo.id)}
+              >
                 查看
               </Button>
               {['3', '4'].includes(key) ? null : (
@@ -353,7 +357,7 @@ function D5edit() {
         }
       }
     ]
-  }, [key, snaps])
+  }, [key, snaps, topInfo.id])
 
   // 点击添加按钮
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -765,6 +769,8 @@ function D5edit() {
 
       {nowSta.id ? (
         <ZGaddNow
+          menuId={25}
+          orderId={topInfo.id}
           canObj={{ storageId: topInfo.storageOutId }}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}

+ 9 - 3
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -67,7 +67,7 @@ function D6edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 8)
         if (res2.code === 0) {
           setTopInfo({ ...res.data, storageId: res2.data.storageId, sonTypeName: '1' })
           setSnaps([res2.data])
@@ -390,7 +390,11 @@ function D6edit() {
       render: (item: C1GoodType) => {
         return (
           <>
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, 8, '', topInfo.id)}
+            >
               查看
             </Button>
             {['3', '4'].includes(key) ? null : (
@@ -409,7 +413,7 @@ function D6edit() {
     })
 
     return arr
-  }, [key, snaps, topInfo.sonTypeName])
+  }, [key, snaps, topInfo.id, topInfo.sonTypeName])
 
   // 点击添加按钮
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -870,6 +874,8 @@ function D6edit() {
 
       {nowSta.id ? (
         <ZGaddNow
+          menuId={8}
+          orderId={topInfo.id}
           canObj={{ storageId: topInfo.storageId }}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}

+ 9 - 3
src/pages/D_storeManage/D8cancel/D8edit/index.tsx

@@ -62,7 +62,7 @@ function D8edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 19)
         if (res2.code === 0) {
           setSnaps([res2.data])
         }
@@ -249,7 +249,11 @@ function D8edit() {
       render: (item: C1GoodType) => {
         return (
           <>
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, 19, '', topInfo.id)}
+            >
               查看
             </Button>
             {['3', '4'].includes(key) ? null : (
@@ -268,7 +272,7 @@ function D8edit() {
     })
 
     return arr
-  }, [key, snaps, tableInputChange])
+  }, [key, snaps, tableInputChange, topInfo.id])
 
   // 点击添加按钮
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -557,6 +561,8 @@ function D8edit() {
 
       {nowSta.id ? (
         <ZGaddNow
+          menuId={19}
+          orderId={topInfo.id}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {

+ 1 - 1
src/pages/E_goodsStorage/E1accident/E1edit/index.tsx

@@ -67,7 +67,7 @@ function E1edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 13)
         if (res2.code === 0) {
           obj.numName = res2.data.numName
           numNameChangeFu(res2.data.numName)

+ 1 - 1
src/pages/E_goodsStorage/E3actuality/E3edit/index.tsx

@@ -81,7 +81,7 @@ function E3edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 12)
         if (res2.code === 0) {
           obj.numName = res2.data.numName
           numNameChangeFu(res2.data.numName)

+ 9 - 3
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -63,7 +63,7 @@ function E4edit() {
       const urlAll = window.location.href
       if (urlAll.includes('?id=')) {
         const urlId = urlAll.split('?id=')[1]
-        const res2 = await API_goodsInfo(Number(urlId))
+        const res2 = await API_goodsInfo(Number(urlId), 14)
         if (res2.code === 0) {
           setSnaps([res2.data])
         }
@@ -281,7 +281,11 @@ function E4edit() {
       render: (item: C1GoodType) => {
         return (
           <>
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, 14, '', topInfo.id)}
+            >
               查看
             </Button>
             {['3', '4'].includes(key) ? null : (
@@ -300,7 +304,7 @@ function E4edit() {
     })
 
     return arr
-  }, [key, snaps, tableInputChange])
+  }, [key, snaps, tableInputChange, topInfo.id])
 
   // 点击添加按钮
   const [nowSta, setNowSta] = useState({ key: '', id: '' })
@@ -632,6 +636,8 @@ function E4edit() {
 
       {nowSta.id ? (
         <ZGaddNow
+          menuId={14}
+          orderId={topInfo.id}
           nowSta={nowSta}
           closeFu={() => setNowSta({ key: '', id: '' })}
           dataResFu={data => {

+ 8 - 2
src/pages/F_exhibition/F1exhibition/F1edit/index.tsx

@@ -159,7 +159,11 @@ function F1edit() {
         title: '操作',
         render: (item: any) => (
           <>
-            <Button size='small' type='text' onClick={() => openGoodsInfoFu(item.id)}>
+            <Button
+              size='small'
+              type='text'
+              onClick={() => openGoodsInfoFu(item.id, 15, '', topInfo.id)}
+            >
               查看
             </Button>
             {pageDisabled ? null : (
@@ -172,7 +176,7 @@ function F1edit() {
         )
       }
     ]
-  }, [pageDisabled, snaps])
+  }, [pageDisabled, snaps, topInfo.id])
 
   // 获取详情
   const getInfoFu = useCallback(
@@ -678,6 +682,8 @@ function F1edit() {
       {/* 新增弹窗 */}
       {nowSta.id ? (
         <ZGaddNow
+          menuId={15}
+          orderId={topInfo.id}
           nowSta={nowSta}
           searchFilterKey={['statusStorage']}
           closeFu={() => setNowSta({ key: '', id: '' })}

+ 1 - 1
src/pages/Layout/data.ts

@@ -304,7 +304,7 @@ const tabLeftArr: RouterType = [
       {
         id: 9901,
         name: '藏品详情',
-        path: '/goodsLook/:id',
+        path: '/goodsLook/:id/:menuId',
         pathLast: '/goodsLook',
         Com: React.lazy(() => import('../Y_goodsDetails/Y2look'))
       }

+ 1 - 1
src/pages/Y_goodsDetails/Y1cathet/Y1main.tsx

@@ -27,7 +27,7 @@ function Y1main({ sId }: Props) {
   const [info, setInfo] = useState({} as C1GoodType)
 
   const getInfoFu = useCallback(async (id: number) => {
-    const res = await API_goodsInfo(id)
+    const res = await API_goodsInfo(id, 9901)
     if (res.code === 0) {
       setInfo(res.data)
     }

+ 1 - 1
src/pages/Y_goodsDetails/Y1cathet/Y44com.tsx

@@ -140,7 +140,7 @@ function Y44com({ isLook, sId }: Props) {
   const lookPage = useCallback(
     (name: string, id: number) => {
       const obj = typePageArr.find(v => v.name === name)
-      if (obj) openGoodsInfoFu(id, `#${obj.path}_edit/4/`)
+      if (obj) openGoodsInfoFu(id, 9901, `#${obj.path}_edit/4/`)
       else MessageFu.warning('业务类型错误')
     },
     [typePageArr]

+ 1 - 1
src/pages/Y_goodsDetails/Y1cathet/index.tsx

@@ -16,7 +16,7 @@ function Y1cathet({ sId, closeFu }: Props) {
         <h2>藏品详情</h2>
         <div>
           <span>更多操作请在详情页中进行</span>&emsp;
-          <Button type='primary' onClick={() => openGoodsInfoFu(sId)}>
+          <Button type='primary' onClick={() => openGoodsInfoFu(sId, 9901)}>
             查看详情
           </Button>
           &emsp;<Button onClick={closeFu}>收起</Button>

+ 12 - 8
src/pages/Y_goodsDetails/Y2look/index.tsx

@@ -15,7 +15,7 @@ import { API_goodFileList } from '@/store/action/C2files'
 import { C3_APIfocus, C3_APIfocusNo } from '@/store/action/C3focus'
 import { MessageFu } from '@/utils/message'
 import C22revamp from '@/pages/C_goodsManage/C22goodEdit/C22revamp'
-import history from '@/utils/history'
+import history, { useQuery } from '@/utils/history'
 import { statusStorageObj } from '@/utils/tableData'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
@@ -27,16 +27,20 @@ function Y2look() {
   const goodsInfoPower = useSelector((state: RootState) => state.A0Layout.goodsInfoPower)
   const downImg = useSelector((state: RootState) => state.A0Layout.downImg)
 
-  const { id: sId } = useParams<any>()
+  const { id: sId, menuId } = useParams<any>()
+  const query = useQuery()
 
   const [info, setInfo] = useState({} as C1GoodType)
 
-  const getInfoFu = useCallback(async (id: number) => {
-    const res = await API_goodsInfo(id)
-    if (res.code === 0) {
-      setInfo(res.data)
-    }
-  }, [])
+  const getInfoFu = useCallback(
+    async (id: number) => {
+      const res = await API_goodsInfo(id, menuId, query.oId)
+      if (res.code === 0) {
+        setInfo(res.data)
+      }
+    },
+    [menuId, query.oId]
+  )
 
   const handleExport = async () => {
     Promise.all([API_goodFileList(sId), API_getGoodsLedger(sId)]).then(res => {

+ 2 - 2
src/store/action/C1ledger.ts

@@ -13,8 +13,8 @@ export const API_goodsAdd = (data: any, type: '新增' | '编辑') => {
 /**
  * 藏品-获取详情
  */
-export const API_goodsInfo = (id: number) => {
-  return http.get(`cms/goods/detail/${id}`)
+export const API_goodsInfo = (id: number, menuId: number, orderId?: unknown) => {
+  return http.get(`cms/goods/detail/${id}/${menuId}`, { params: { orderId } })
 }
 
 /**

+ 1 - 1
src/store/action/D3staff.ts

@@ -69,7 +69,7 @@ export const D3_APIsaveAudit = (data: any) => {
 }
 
 /**
- * 人员出入库-撤回
+ * 人员出入库-撤回订单
  */
 export const D3_APIrevocation = (id: number) => {
   return http.get(`cms/orderMember/revocation/${id}`)

+ 13 - 2
src/utils/history.ts

@@ -8,6 +8,8 @@ import { KuIsTreeType } from '@/pages/D_storeManage/D4impStor/type'
 import { baseURL } from './http'
 import { cascaderArr } from '@/pages/C_goodsManage/C1register/AddGoods/data'
 import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
+import { useLocation } from 'react-router-dom'
+import qs from 'query-string'
 // import dd from 'gdt-jsapi'
 const history = createHashHistory()
 
@@ -31,11 +33,15 @@ export const infoPageBackFu = (url: string) => {
 export default history
 
 // -------------------所有藏品详情 全部新页面打开-------------------
-export const openGoodsInfoFu = (id: number, src?: string) => {
+export const openGoodsInfoFu = (id: number, menuId: number, src?: string, orderId?: unknown) => {
   // const urlArr = window.location
   // const urlQian = urlArr.origin + urlArr.pathname
 
-  history.push(src ? (src + id).replace('#', '') : `/goodsLook/${id}`)
+  history.push(
+    src
+      ? (src + id).replace('#', '')
+      : `/goodsLook/${id}/${menuId}${orderId ? '?oId=' + orderId : ''}`
+  )
 
   // dd.openLink({
   //   url: 'https://sit-yiwubwg.4dage.com/abcd/index.html#/business'
@@ -401,3 +407,8 @@ export const downFileFu = async (url: string, back?: () => void) => {
     console.error('Download failed:', error)
   }
 }
+
+export const useQuery = () => {
+  const { search } = useLocation()
+  return qs.parse(search)
+}

+ 24 - 0
yarn.lock

@@ -4397,6 +4397,11 @@ decimal.js@^10.2.1:
   resolved "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23"
   integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==
 
+decode-uri-component@^0.4.1:
+  version "0.4.1"
+  resolved "https://registry.npmmirror.com/decode-uri-component/-/decode-uri-component-0.4.1.tgz#2ac4859663c704be22bf7db760a1494a49ab2cc5"
+  integrity sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==
+
 dedent@^0.7.0:
   version "0.7.0"
   resolved "https://registry.npmmirror.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
@@ -5476,6 +5481,11 @@ fill-range@^7.0.1:
   dependencies:
     to-regex-range "^5.0.1"
 
+filter-obj@^5.1.0:
+  version "5.1.0"
+  resolved "https://registry.npmmirror.com/filter-obj/-/filter-obj-5.1.0.tgz#5bd89676000a713d7db2e197f660274428e524ed"
+  integrity sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==
+
 finalhandler@1.2.0:
   version "1.2.0"
   resolved "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32"
@@ -8894,6 +8904,15 @@ qs@6.11.0:
   dependencies:
     side-channel "^1.0.4"
 
+query-string@^9.2.1:
+  version "9.2.1"
+  resolved "https://registry.npmmirror.com/query-string/-/query-string-9.2.1.tgz#67bd95f6e2cb64eafecfb0504be7cc38bcd4dd11"
+  integrity sha512-3jTGGLRzlhu/1ws2zlr4Q+GVMLCQTLFOj8CMX5x44cdZG9FQE07x2mQhaNxaKVPNmIDu0mvJ/cEwtY7Pim7hqA==
+  dependencies:
+    decode-uri-component "^0.4.1"
+    filter-obj "^5.1.0"
+    split-on-first "^3.0.0"
+
 querystringify@^2.1.1:
   version "2.2.0"
   resolved "https://registry.npmmirror.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6"
@@ -10173,6 +10192,11 @@ spdy@^4.0.2:
     select-hose "^2.0.0"
     spdy-transport "^3.0.0"
 
+split-on-first@^3.0.0:
+  version "3.0.0"
+  resolved "https://registry.npmmirror.com/split-on-first/-/split-on-first-3.0.0.tgz#f04959c9ea8101b9b0bbf35a61b9ebea784a23e7"
+  integrity sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==
+
 sprintf-js@~1.0.2:
   version "1.0.3"
   resolved "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"