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 { B3_APIgetClueList, B3API_obj } from '@/store/action/Benter/B3auth'
import EditBtn from '@/pages/Zother/EditBtn'
import { B3moreList } from '../data'
import FileArchive from '@/pages/Zother/FileArchive'

const rowArr = [
  {
    name: `鉴定入藏`,
    type: 'txt'
  },
  ...rowArrTemp('入藏', undefined, '藏品鉴定').slice(1)
]

function B3edit() {
  return (
    <InfoProvider>
      <div className={styles.B3edit} id='editBox'>
        <div className='editMain'>
          {/* 顶部 */}
          <EditTop
            pageTxt='藏品鉴定'
            rowArr={rowArr}
            APIobj={B3API_obj}
            fileUpInfo={{ myUrl: 'cms/order/auth/upload', dirCode: 'auth' }}
            // 第二个模块
            moreDom={{
              txt: '鉴定报告',
              API: B3_APIgetClueList,
              domList: B3moreList,
              myUrl: 'cms/order/auth/son/upload',
              dirCode: 'auth'
            }}
          />

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

          {/* 底部按钮 */}
          <EditBtn
            path='/auth'
            APIobj={B3API_obj}
            checkListTxt='请选择关联藏品'
            isTow={true}
            verifyBackFu={info => {
              const res = { flag: false, txt: '' }
              if (!info.member) {
                res.flag = true
                res.txt = '请输入鉴定人员'
              }

              return res
            }}
          />
        </div>
      </div>
    </InfoProvider>
  )
}

const MemoB3edit = React.memo(B3edit)

export default MemoB3edit
