shaogen1995 5 місяців тому
батько
коміт
0be1a6b162

+ 1 - 14
src/pages/B_enterTibet/B3_4page/B3edit/index.module.scss

@@ -10,20 +10,7 @@
     .ant-table-cell {
       padding: 8px !important;
     }
-    .B3eGoodTab {
-      padding-right: 20px;
-      .B3eGtop {
-        display: flex;
-        justify-content: space-between;
-        padding-bottom: 10px;
-        margin-bottom: 17px;
-        .B3eGtop1 {
-          font-size: 18px;
-          font-weight: 700;
-          padding-left: 18px;
-        }
-      }
-    }
+
     .B3eBtn {
       position: absolute;
       bottom: 20px;

+ 1 - 1
src/pages/B_enterTibet/B3_4page/B3edit/look.tsx

@@ -1,7 +1,7 @@
 import React from 'react'
 import B3editMain from './main'
 function look() {
-  return <B3editMain pageSta='审批' />
+  return <B3editMain pageSta='查看' />
 }
 
 const MemoBlook = React.memo(look)

+ 3 - 40
src/pages/B_enterTibet/B3_4page/B3edit/main.tsx

@@ -1,14 +1,13 @@
-import React, { useCallback, useMemo, useRef } from 'react'
+import React, { useCallback, useRef } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
 import B3aTop from '../B3add/B3aTop'
 import { TypeB3PageSta } from '../type'
 import { Button } from 'antd'
-import MyTable from '@/components/MyTable'
-import { B3eTableC } from '@/utils/tableData'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import history from '@/utils/history'
 import { B3TiaoObjUrl, B3TitObjKey } from '../B3add'
+import B3goodsTable from '../../B3goodsTable'
 
 type Props = {
   pageSta: TypeB3PageSta
@@ -20,27 +19,6 @@ function B3editMain({ pageSta }: Props) {
   // 点击按钮调用子组件的方法获取数据
   const topRef = useRef<any>(null)
 
-  // 点击删除
-  const delTableFu = useCallback(async (id: number) => {}, [])
-
-  const tableLastBtn = useMemo(() => {
-    return [
-      {
-        title: '操作',
-        render: (item: any) => {
-          return (
-            <>
-              <Button size='small' type='text'>
-                查看
-              </Button>
-              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
-            </>
-          )
-        }
-      }
-    ]
-  }, [delTableFu])
-
   // 点击保存
   const btnOk = useCallback(async () => {
     // 从顶部组件中拿到数据
@@ -67,22 +45,7 @@ function B3editMain({ pageSta }: Props) {
         Dom={
           <>
             {/* 藏品清单 */}
-            <div className='B3eGoodTab'>
-              <div className='B3eGtop'>
-                <div className='B3eGtop1'>藏品清单</div>
-                <div>
-                  <Button type='primary'>从已鉴定的藏品中新增</Button>&emsp;
-                  <Button type='primary'>新增</Button>
-                </div>
-              </div>
-              {/* 表格 */}
-              <MyTable
-                list={[{ id: 1, thumb: '' }]}
-                columnsTemp={B3eTableC}
-                lastBtn={tableLastBtn}
-                pagingInfo={false}
-              />
-            </div>
+            <B3goodsTable />
           </>
         }
       />

+ 27 - 0
src/pages/B_enterTibet/B3goodsTable/index.module.scss

@@ -0,0 +1,27 @@
+.B3goodsTable {
+  padding-right: 20px;
+  :global {
+    .B3eGtop {
+      display: flex;
+      justify-content: space-between;
+      padding-bottom: 10px;
+      margin-bottom: 17px;
+      .B3eGtop1 {
+        font-size: 18px;
+        font-weight: 700;
+        padding-left: 18px;
+      }
+    }
+    .D1GtNum {
+      cursor: pointer;
+      text-decoration: underline;
+      // &:hover {
+      //   color: var(--themeColor);
+      // }
+    }
+
+    .D1GtNumAc {
+      color: var(--themeColor);
+    }
+  }
+}

+ 83 - 0
src/pages/B_enterTibet/B3goodsTable/index.tsx

@@ -0,0 +1,83 @@
+import React, { useCallback, useMemo, useState } from 'react'
+import styles from './index.module.scss'
+import { Button } from 'antd'
+import MyTable from '@/components/MyTable'
+import { B3eTableC } from '@/utils/tableData'
+import MyPopconfirm from '@/components/MyPopconfirm'
+import classNames from 'classnames'
+import Y1cathet from '@/pages/Y_goodsDetails/Y1cathet'
+
+function B3goodsTable() {
+  // 点击删除
+  const delTableFu = useCallback(async (id: number) => {}, [])
+
+  // 点击查看 新窗口打开 待完善
+  const lookPage = useCallback((id: number) => {
+    window.open('/#/goodsLook/99', '_blank')
+  }, [])
+
+  // 打开侧边栏
+  const [cathet, setCathet] = useState(0)
+
+  const startBtn = useMemo(() => {
+    return [
+      {
+        title: '编号类型',
+        render: (item: any) => {
+          return (
+            <span
+              onClick={() => setCathet(item.id)}
+              className={classNames('D1GtNum', item.id === cathet ? 'D1GtNumAc' : '')}
+            >
+              {item.num}
+            </span>
+          )
+        }
+      }
+    ]
+  }, [cathet])
+
+  const tableLastBtn = useMemo(() => {
+    return [
+      {
+        title: '操作',
+        render: (item: any) => {
+          return (
+            <>
+              <Button size='small' type='text' onClick={() => lookPage(item.id)}>
+                查看
+              </Button>
+              <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
+            </>
+          )
+        }
+      }
+    ]
+  }, [delTableFu, lookPage])
+
+  return (
+    <div className={styles.B3goodsTable}>
+      <div className='B3eGtop'>
+        <div className='B3eGtop1'>藏品清单</div>
+        <div>
+          <Button type='primary'>从已存在的藏品中添加</Button>&emsp;
+          <Button type='primary'>新增</Button>
+        </div>
+      </div>
+      {/* 表格 */}
+      <MyTable
+        list={[{ id: 99, thumb: '', num: '一段编号_可点击' }]}
+        columnsTemp={B3eTableC}
+        startBtn={startBtn}
+        lastBtn={tableLastBtn}
+        pagingInfo={false}
+      />
+      {/* 打开侧边栏 */}
+      <Y1cathet sId={cathet} closeFu={() => setCathet(0)} />
+    </div>
+  )
+}
+
+const MemoB3goodsTable = React.memo(B3goodsTable)
+
+export default MemoB3goodsTable

+ 9 - 0
src/pages/Layout/data.ts

@@ -242,6 +242,14 @@ const tabLeftArr: RouterType = [
         name: '系统日志',
         path: '/log',
         Com: React.lazy(() => import('../Z_system/Z7log'))
+      },
+      // 不需要 高亮的 详情页
+      {
+        id: 9901,
+        name: '查看藏品详情',
+        path: '/goodsLook/:id',
+        pathLast: '/goodsLook',
+        Com: React.lazy(() => import('../Y_goodsDetails/Y2look'))
       }
     ]
   }
@@ -269,6 +277,7 @@ export const routerSon: RouterTypeRow = [
     path: '/storage_look/:id',
     Com: React.lazy(() => import('../Y_goodsDetails/Y2look'))
   },
+
   {
     id: 4,
     name: '藏品入馆-新增',

+ 3 - 2
src/pages/Layout/index.tsx

@@ -43,7 +43,7 @@ function Layout() {
     if (getRoleRes.code === 0) {
       const getRoleArr: TypeZ5Role[] = getRoleRes.data || []
 
-      const isOkIdArr: number[] = []
+      const isOkIdArr: number[] = [9901]
 
       getRoleArr.forEach(v1 => {
         if (v1.children) {
@@ -78,7 +78,7 @@ function Layout() {
       const urlAll = window.location.hash
 
       const isNowPath = urlAll.replace('#', '')
-      const pathArr = tempArr.map(v => v.path)
+      const pathArr = tempArr.map(v => v.pathLast || v.path)
 
       const routerSonArr = routerSon.map(v => v.path)
 
@@ -197,6 +197,7 @@ function Layout() {
               {v.son.map(v2 => (
                 <div
                   key={v2.id}
+                  hidden={v2.id >= 9901}
                   className={classNames('layoutLRowBoxRow', pathAcFu(v2.path) ? 'active' : '')}
                   onClick={() => pathCutFu(v2.path)}
                 >

+ 8 - 3
src/pages/Y_goodsDetails/Y1cathet/Y44com.tsx

@@ -99,21 +99,26 @@ function Y44com({ isLook }: Props) {
   //   [formData]
   // )
 
+  // 点击查看 新窗口打开
+  const lookPage = useCallback((id: number) => {
+    // 根据业务类型打开不同的新页面 待完善
+    window.open('/#/entering_look/1/1', '_blank')
+  }, [])
+
   const tableLastBtn = useMemo(() => {
     return [
       {
         title: '操作',
         render: (item: any) => {
           return (
-            <Button size='small' type='text'>
-              {/* 待完善 新窗口打开 */}
+            <Button size='small' type='text' onClick={() => lookPage(item.id)}>
               查看
             </Button>
           )
         }
       }
     ]
-  }, [])
+  }, [lookPage])
 
   return (
     <div className='Y44com'>

+ 1 - 0
src/types/api/layot.d.ts

@@ -8,6 +8,7 @@ export type RouterTypeRow = {
   id: number
   name: string
   path: string
+  pathLast?: string
   Com: React.LazyExoticComponent<React.MemoExoticComponent<() => JSX.Element>>
 }[]
 

+ 1 - 2
src/utils/tableData.ts

@@ -17,7 +17,6 @@
 // 待完善
 export const B3eTableC = [
   ['img', '封面图', 'thumb'],
-  ['txt', '编号类型', 'description'],
   ['txt', '藏品编号', 'description'],
   ['txt', '藏品名称', 'description'],
   ['txt', '文物级别', 'description'],
@@ -39,7 +38,7 @@ export const D1GtableC = [
   ['txt', '区域名称', 'userName'],
   ['txt', '排架', 'userName'],
   ['txt', '层数', 'userName'],
-  ['txt', '格', 'userName'],
+  ['txt', '格', 'userName'],
   ['txt', '库位说明', 'description']
 ]