import store from '@/store'
import { getDictFu, selectObj } from '@/utils/dataChange'

// 藏品类型
export type GoodsType = {
  ageDictId: string
  ageInfo: string
  born: string
  createTime: string
  creatorId: number
  creatorName?: any
  file: any[]
  fileIds: string
  id: number
  idTemp: string
  inGoodYear: string
  inGoodYearScope: string
  intro: string
  isEdit?: any
  keep: string
  keepInfo: string
  level: string
  makeDate: string
  makeUser: string
  name: string
  num: string
  oldName: string
  orderId?: any
  orderSnapId?: any
  pcs: number
  pcsUnitDictId: string
  pressAuthor: string
  pressFile: string
  pressVersion: string
  quality: string
  qualityLevelDictId: string
  qualityScope: string
  qualityUnitDictId: string
  remark: string
  siteDateIn?: any
  siteDateOut?: any
  siteId?: any
  siteLoc?: any
  siteStatus: number
  sizeH: number
  sizeInfo: string
  sizeL: number
  sizeW: number
  source: string
  status: number
  storyIds: string
  tagDictId: string
  textureDictId: string
  thumb: string
  thumbPc: string
  tornInfo: string
  tornLevel: string
  typeDictId: string
  updateTime: string

  // 不用录数据库，新增和编辑 用这个区分
  isNew: boolean

  // 区分是不是 征集数据-详情还没有入数据库
  pageType?: 'clue'
  clueId: number

  // 库存信息id
  storageId: number

  // 文创标签
  artDictId: string
}

// 选择线索-----------------
export const sgBaseFormData = {
  pageNum: 1,
  pageSize: 10,

  searchKey: '',
  typeDictId: '',
  ageDictId: '',
  tornLevel: ''
}

export const sgTopSelectDom = [
  {
    name: '搜索线索编号、线索名称',
    key: 'searchKey',
    type: 'Input'
  },
  // 待完善sg
  // {
  //   name: '初定类别',
  //   key: 'typeDictId',
  //   type: 'Cascader',
  //   options: getDictFu('藏品类别')
  // },
  {
    name: '初定年代',
    key: 'ageDictId',
    type: 'Cascader',
    options: getDictFu('藏品年代')
  },
  {
    name: '完残程度',
    key: 'tornLevel',
    type: 'Select',
    options: selectObj['完残程度']
  }
]

// 选择藏品-----------------------
export const sgBaseFormDataGood = {
  pageNum: 1,
  pageSize: 10,

  searchKey: '',
  tagIds: '',
  level: '',
  typeDictId: '',
  ageDictId: '',
  textureDictId: '',
  tornLevel: ''
}

export const sgTopSelectDomGood = [
  {
    name: '搜索藏品登记号、藏品名称',
    key: 'searchKey',
    type: 'Input',
    width: 240
  },
  {
    name: '搜索藏品标签',
    key: 'tagIds',
    type: 'Cascader',
    options: store.getState().E1tag.treeData
  },
  {
    name: '级别',
    key: 'level',
    type: 'Select',
    options: selectObj['藏品级别']
  },
  // 待完善sg
  // {
  //   name: '类别',
  //   key: 'typeDictId',
  //   type: 'Cascader',
  //   options: getDictFu('藏品类别')
  // },
  {
    name: '年代',
    key: 'ageDictId',
    type: 'Cascader',
    options: getDictFu('藏品年代')
  },
  {
    name: '质地',
    key: 'textureDictId',
    type: 'Cascader',
    options: getDictFu('质地')
  },
  {
    name: '完残程度',
    key: 'tornLevel',
    type: 'Select',
    options: selectObj['完残程度']
  }
]
