import { handleData } from 'lz-utils-lib'
const configData = ref()
export const initConfig = () => {
  configData.value = pageConfig({
    search: {
      fileName: { label: '文件名称', clearable: true }
    },
    table: {
      selection: { width: 50 },
      fileName: { label: '文件名称', slot: 'fileName', width: 500 },
      pathname: {
        label: '路径',
        width: 160,
        formatter: (row: any) => row.locations.map((item: any) => item.fileName).join('/')
      },
      modifyTime: {
        label: '修改时间',
        width: 160,
        formatter: (row: any) => handleData.formatTime(row.modifyTime, 'YYYY-MM-DD hh:mm:ss')
      },
      btn: {
        types: ['warning', 'danger', ''],
        names: ['重命名', '删除', '跳转'],
        width: 150
      }
    },
    dialog: {
      parentId: { label: '父级文件夹', slot: 'parentId' },
      files: { label: '上传文件', slot: 'files' }
    }
  })
  return configData
}
