import React, { useCallback, useMemo, 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' type Props = { pageSta: TypeB3PageSta } function B3editMain({ pageSta }: Props) { const { key, id } = useParams() // 点击按钮调用子组件的方法获取数据 const topRef = useRef(null) // 点击删除 const delTableFu = useCallback(async (id: number) => {}, []) const tableLastBtn = useMemo(() => { return [ { title: '操作', render: (item: any) => { return ( <> delTableFu(item.id)} /> ) } } ] }, [delTableFu]) // 点击保存 const btnOk = useCallback(async () => { // 从顶部组件中拿到数据 // const resData = topRef.current?.resData() }, []) // 点击取消 const btnX = useCallback(() => { let url = '/entering' if (key === '2') url = '/enterTibet' else if (key === '3') url = '/register' history.push(url) }, [key]) return (
藏品{key === '1' ? '入馆' : key === '2' ? '入藏' : '登记'}-{pageSta} {id}
{/* 藏品清单 */}
藏品清单
{/* 表格 */}
} /> {/* 底部按钮 */}
btnX()} />
) } const MemoB3editMain = React.memo(B3editMain) export default MemoB3editMain