浏览代码

fix: 藏品详情数据权限

chenlei 1 月之前
父节点
当前提交
1de82452fa

+ 4 - 2
src/pages/A3_ledger/A32Routing/A32table/index.tsx

@@ -13,13 +13,15 @@ import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
 import { baseURL } from '@/utils/http'
 
 type Props = {
+  ordrerId?: number
+  menuId: number
   pageNum: number
   pageSize: number
   pageChangeFu: (pageNum: number, pageSize: number) => void
   advanced: boolean
 }
 
-function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
+function A32table({ pageNum, pageSize, pageChangeFu, ordrerId, menuId, advanced }: Props) {
   // 打开侧边栏
   const [cathet, setCathet] = useState(0)
 
@@ -185,7 +187,7 @@ function A32table({ pageNum, pageSize, pageChangeFu, advanced }: Props) {
       />
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={menuId} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 2 - 0
src/pages/A3_ledger/A32Routing/index.tsx

@@ -428,6 +428,7 @@ function A32Routing() {
           {/* 表格 */}
           <A32table
             advanced={advanced}
+            menuId={602}
             pageNum={formData.pageNum}
             pageSize={formData.pageSize}
             pageChangeFu={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
@@ -438,6 +439,7 @@ function A32Routing() {
       {/* 回收站 */}
       {recycleBin ? (
         <C8recycleBin
+          menuId={602}
           closeFu={flag => {
             if (flag) getListFu()
             setRecycleBin(false)

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

@@ -314,11 +314,12 @@ function C1ledger() {
       />
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={601} closeFu={() => setCathet(0)} />
 
       {/* 回收站 */}
       {recycleBin ? (
         <C8recycleBin
+          menuId={601}
           closeFu={flag => {
             if (flag) getListFu()
             setRecycleBin(false)

+ 3 - 2
src/pages/A3_ledger/ComPage/C8recycleBin/index.tsx

@@ -16,10 +16,11 @@ import { MessageFu } from '@/utils/message'
 import { RootState } from '@/store'
 
 type Props = {
+  menuId: number
   closeFu: (falg: boolean) => void
 }
 
-function C8recycleBin({ closeFu }: Props) {
+function C8recycleBin({ menuId, closeFu }: Props) {
   const dispatch = useDispatch()
 
   const [formData, setFormData] = useState(C8baseFormData)
@@ -208,7 +209,7 @@ function C8recycleBin({ closeFu }: Props) {
       />
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={menuId} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 1 - 1
src/pages/B_enterTibet/B2identify/B2edit/index.tsx

@@ -508,7 +508,7 @@ function B2edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={220} orderId={id} closeFu={() => setCathet(0)} />
 
       {/* 新增弹窗 */}
       {nowSta.id ? (

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

@@ -555,7 +555,7 @@ function B34edit({ type }: Props) {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={9901} closeFu={() => setCathet(0)} />
 
       {/* 选中藏品弹窗 */}
       {nowSta.id ? (

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

@@ -245,7 +245,7 @@ function C22look() {
           <div className='C22TitRR'>
             <Button
               type='primary'
-              onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 18, '', topInfo.id)}
+              onClick={() => openGoodsInfoFu(Number(topInfo.goodsIds), 350, '', topInfo.id)}
             >
               藏品详情
             </Button>

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

@@ -375,7 +375,7 @@ function C22goodEdit() {
       />
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={350} closeFu={() => setCathet(0)} />
 
       {isEdit.id ? (
         <div className='C22revampBox'>

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

@@ -261,7 +261,7 @@ function C3focus() {
       />
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={360} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 3 - 2
src/pages/D_storeManage/D1storage/D1goods/index.tsx

@@ -24,9 +24,10 @@ type Props = {
   lookData: D1canType
   TreeDom: React.ReactNode
   tableId: number
+  menuId: number
 }
 
-function D1goods({ lookData, TreeDom, tableId }: Props) {
+function D1goods({ lookData, menuId, TreeDom, tableId }: Props) {
   const siteCan = useRef({} as D1canType)
 
   useEffect(() => {
@@ -224,7 +225,7 @@ function D1goods({ lookData, TreeDom, tableId }: Props) {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={menuId} closeFu={() => setCathet(0)} />
     </div>
   )
 }

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

@@ -179,7 +179,7 @@ function D1storage() {
           />
         ) : null}
         {topAc === '按藏品查看' ? (
-          <D1goods TreeDom={TreeDom} tableId={acShu} lookData={lookData.current} />
+          <D1goods TreeDom={TreeDom} tableId={acShu} menuId={410} lookData={lookData.current} />
         ) : null}
       </div>
     </div>

+ 1 - 1
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -740,7 +740,7 @@ function D4edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={440} orderId={id} closeFu={() => setCathet(0)} />
 
       {nowSta.id ? (
         <ZGaddNow

+ 1 - 1
src/pages/D_storeManage/D5moveStor/D5edit/index.tsx

@@ -765,7 +765,7 @@ function D5edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} orderId={id} menuId={450} closeFu={() => setCathet(0)} />
 
       {nowSta.id ? (
         <ZGaddNow

+ 1 - 1
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -878,7 +878,7 @@ function D6edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={460} orderId={id} closeFu={() => setCathet(0)} />
 
       {nowSta.id ? (
         <ZGaddNow

+ 1 - 1
src/pages/D_storeManage/D8cancel/D8edit/index.tsx

@@ -557,7 +557,7 @@ function D8edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={320} orderId={id} closeFu={() => setCathet(0)} />
 
       {nowSta.id ? (
         <ZGaddNow

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

@@ -332,7 +332,7 @@ function E1accident() {
         onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={510} closeFu={() => setCathet(0)} />
     </div>
   )
 }

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

@@ -336,7 +336,7 @@ function E3actuality() {
         onChange={(pageNum, pageSize) => paginationChange(pageNum, pageSize)}
       />
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} menuId={530} closeFu={() => setCathet(0)} />
     </div>
   )
 }

+ 1 - 1
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -632,7 +632,7 @@ function E4edit() {
       </div>
 
       {/* 打开侧边栏 */}
-      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+      <Y1cathet sId={cathet} orderId={id} menuId={540} closeFu={() => setCathet(0)} />
 
       {nowSta.id ? (
         <ZGaddNow

+ 12 - 7
src/pages/Y_goodsDetails/Y1cathet/Y1main.tsx

@@ -16,9 +16,11 @@ export const Y1tabArr: Y1TabArrType[] = ['藏品信息', '库存信息', '藏品
 
 type Props = {
   sId: number
+  menuId: number
+  orderId?: number
 }
 
-function Y1main({ sId }: Props) {
+function Y1main({ sId, menuId, orderId }: Props) {
   // 获取权限数据
   const goodsInfoPower = useSelector((state: RootState) => state.A0Layout.goodsInfoPower)
 
@@ -26,12 +28,15 @@ function Y1main({ sId }: Props) {
 
   const [info, setInfo] = useState({} as C1GoodType)
 
-  const getInfoFu = useCallback(async (id: number) => {
-    const res = await API_goodsInfo(id, 9901)
-    if (res.code === 0) {
-      setInfo(res.data)
-    }
-  }, [])
+  const getInfoFu = useCallback(
+    async (id: number) => {
+      const res = await API_goodsInfo(id, menuId, orderId)
+      if (res.code === 0) {
+        setInfo(res.data)
+      }
+    },
+    [menuId, orderId]
+  )
 
   useEffect(() => {
     getInfoFu(sId)

+ 5 - 3
src/pages/Y_goodsDetails/Y1cathet/index.tsx

@@ -6,23 +6,25 @@ import { openGoodsInfoFu } from '@/utils/history'
 
 type Props = {
   sId: number
+  menuId: number
+  orderId?: number
   closeFu: () => void
 }
 
-function Y1cathet({ sId, closeFu }: Props) {
+function Y1cathet({ sId, menuId, orderId, closeFu }: Props) {
   return (
     <div className={styles.Y1cathet} style={{ right: sId ? '0px' : '-900px' }}>
       <div className='Y1top'>
         <h2>藏品详情</h2>
         <div>
           <span>更多操作请在详情页中进行</span>&emsp;
-          <Button type='primary' onClick={() => openGoodsInfoFu(sId, 9901)}>
+          <Button type='primary' onClick={() => openGoodsInfoFu(sId, menuId, '', orderId)}>
             查看详情
           </Button>
           &emsp;<Button onClick={closeFu}>收起</Button>
         </div>
       </div>
-      {sId ? <Y1main sId={sId} key={sId} /> : null}
+      {sId ? <Y1main sId={sId} menuId={menuId} orderId={orderId} key={sId} /> : null}
     </div>
   )
 }