import React from 'react'
import styles from './index.module.scss'
import EditTop from '@/pages/Zother/EditTop'
import EditBtn from '@/pages/Zother/EditBtn'
import { D1_APIgetClueList, D1_APIgoodsSave, D1API_obj } from '@/store/action/Dmanage/D1register'
import { InfoProvider } from '@/pages/Zother/InfoContext'
import { rowArrTemp } from '@/pages/Zother/data'
import SonGoodsList from '@/pages/Zother/SonGoodsList'
import FileArchive from '@/pages/Zother/FileArchive'

const rowArr = rowArrTemp('登记')

function D1edit() {
  return (
    <InfoProvider>
      <div className={styles.D1edit} id='editBox'>
        <div className='editMain'>
          {/* 顶部 */}
          <EditTop
            pageTxt='藏品登记'
            rowArr={rowArr}
            APIobj={D1API_obj}
            fileUpInfo={{ myUrl: 'cms/order/register/upload', dirCode: 'register' }}
          />

          {/* 藏品清单 */}
          <SonGoodsList
            fileUpInfo={{ myUrl: 'cms/order/register/son/upload', dirCode: 'registerGoods' }}
            selectApi={D1_APIgetClueList}
            addGoodsApi={D1_APIgoodsSave}
            isClueSelect={true}
          />

          {/* 附件归档 */}
          <FileArchive />

          {/* 底部按钮 */}
          <EditBtn path='/register' APIobj={D1API_obj} checkListTxt='请添加藏品' />
        </div>
      </div>
    </InfoProvider>
  )
}

const MemoD1edit = React.memo(D1edit)

export default MemoD1edit
