import React from 'react'
import styles from './index.module.scss'
import { rowArrTemp } from '@/pages/Zother/data'
import { InfoProvider } from '@/pages/Zother/InfoContext'
import EditTop from '@/pages/Zother/EditTop'
import { B2_APIgetClueList, B2_APIgoodsSave, B2API_obj } from '@/store/action/Benter/B2enterGuan'
import EditBtn from '@/pages/Zother/EditBtn'
import SonGoodsList from '@/pages/Zother/SonGoodsList'
import FileArchive from '@/pages/Zother/FileArchive'

const rowArr = rowArrTemp('入馆')

function B2edit() {
  return (
    <InfoProvider>
      <div className={styles.B2edit} id='editBox'>
        <div className='editMain'>
          {/* 顶部 */}
          <EditTop
            pageTxt='藏品入馆'
            rowArr={rowArr}
            APIobj={B2API_obj}
            fileUpInfo={{ myUrl: 'cms/order/house/upload', dirCode: 'enterGuan' }}
          />

          {/* 藏品清单 */}
          <SonGoodsList
            fileUpInfo={{ myUrl: 'cms/order/house/son/upload', dirCode: 'enterGuanGoods' }}
            selectApi={B2_APIgetClueList}
            addGoodsApi={B2_APIgoodsSave}
            isClueSelect={true}
          />
          {/* 附件归档 */}
          <FileArchive />
          {/* 底部按钮 */}
          <EditBtn path='/enterGuan' APIobj={B2API_obj} checkListTxt='请添加藏品' />
        </div>
      </div>
    </InfoProvider>
  )
}

const MemoB2edit = React.memo(B2edit)

export default MemoB2edit
