import { B1listType } from '@/pages/B1ledger/data'
import { pcsPingFu, selectChange, sizeChange, timeChange } from '@/utils/deriveFu'
import { dictSelect } from '@/utils/select'

export const pageShowArr1 = [
  { name: '藏品编号', key: 'num' },
  { name: '原编号', key: 'formerNum' },
  { name: '藏品标题', key: 'name', full: true },
  { name: '入馆日期', key: 'inHouseTime', fu: (item: B1listType) => timeChange(item.inHouseTime) },
  {
    name: '登记日期',
    key: 'registerTime',
    fu: (item: B1listType) => timeChange(item.registerTime)
  },
  {
    name: '来源类型',
    key: 'sourceDictId',
    fu: (item: B1listType) => selectChange(dictSelect('藏品来源'), item.sourceDictId)
  },
  { name: '来源详情', key: 'sourceInfo' }
]

export const pageShowArr2 = [
  { name: '藏品简介', key: 'intro', full: true },
  {
    name: '年代',
    key: 'ageDictId',
    fu: (item: B1listType) => selectChange(dictSelect('藏品年代'), item.ageDictId)
  },
  {
    name: '类型',
    key: 'typeDictId',
    fu: (item: B1listType) => selectChange(dictSelect('藏品类型'), item.typeDictId)
  },
  { name: '级别', key: 'level' },
  {
    name: '材质',
    key: 'textureDictId',
    fu: (item: B1listType) => selectChange(dictSelect('藏品材质'), item.textureDictId)
  },
  { name: '完残程度', key: 'torn' },
  {
    name: '数量',
    key: 'pcs',
    fu: (item: B1listType) => pcsPingFu(dictSelect('数量单位'), item.pcs, item.pcsUnitDictId)
  },
  {
    name: '重量',
    key: 'quality',
    fu: (item: B1listType) => pcsPingFu(dictSelect('数量单位'), item.quality, item.qualityUnit)
  },
  { name: '有无说明牌', key: 'isNote' },
  {
    name: '尺寸',
    key: 'sizeL',
    full: true,
    fu: (item: B1listType) => sizeChange(item.sizeL, item.sizeW, item.sizeH, item.sizeUnit)
  },
  { name: '备注', key: 'remark', full: true }
]
