import { BaseDefine, MultipleQuery, MultipleResult } from './base'

/** meta data  基础数据导入配置 */
export namespace System {
  /** 评卷数据导入 */
  interface MarkingDataImport {
    dayNumber?: number
    file?: File
    mainNumber?: number | string
    packageTaskCount?: number
    separator: string
    subjectCode: string
    dayWeight: any
  }

  type ImportMarkingData = BaseDefine<MarkingDataImport>

  type ExportStudentTask = BaseDefine<{ subjectCode: string; mainNumber: number | string; dayNumber?: number }>

  /** 获取导入文件路径 */
  type GetImportFilePath = BaseDefine<
    {
      filePathType: 'SLICE' | 'SAMPLE_A' | 'SAMPLE_B' | 'RF' | 'MARK_STANDARD'
      mainNumber?: number | string
      subjectCode: string
    },
    { rfPath: string; sampleAPath: string; sampleBPath: string; markStandardPath: string }
  >

  interface SamplePaperImport {
    file?: File
    /** 大题号 */
    mainNumber?: number | string
    /** 试卷类型 */
    paperType?: SamplePaperType
    /** 试卷密码前缀 */
    prefix: string
    /** 分隔符 */
    separator: string
    /** 科目代码 */
    subjectCode: string
    clear?: boolean
  }

  type ImportSamplePaper = BaseDefine<SamplePaperImport>

  interface RfPaperImport {
    file?: File
    /** 试卷密码前缀 */
    prefix: string
    /** 大题号 */
    mainNumber?: number | string
    /** 科目代码 */
    subjectCode: string
    /** 分隔符 */
    separator: string
    clear?: boolean
    paperType?: string
  }

  type ImportRfPaper = BaseDefine<RfPaperImport>

  type ImportCheck = BaseDefine<any, any>

  interface importOrExportItem {
    filePath: string
    id: number
    spentTime: string
    status: string
    statusMsg: string
    statusName: string
    taskTypeName: string
  }

  interface ScoreListItem {
    /** 作文评卷员代码 */
    compositionMarker: string
    /** 作文雷同标记 */
    compositionSame: string
    /** 作文分 */
    compositionScore: string
    /** 作文评卷标志 */
    compositionTag: string
    /** 准考证号 */
    examNumber: string
    id: number
    /** 科目代码 */
    subjectCode: string
    /** 主观分 */
    subjectScore: string
    /** 翻译评卷员代码 */
    translateMarker: string
    /** 翻译雷同标记 */
    translateSame: string
    /** 翻译分 */
    translateScore: string
    /** 翻译评卷标志 */
    translateTag: string
  }

  type GetCetScoreList = BaseDefine<MultipleQuery<{ subjectCode: string }>, MultipleResult<ScoreListItem>>

  type ExportCetScoreList = BaseDefine<{ subjectCode: string; exportFileType?: string }, null>

  /** 任务设置 - 按评卷员设置 */
  type MarkerSetCount = BaseDefine<{ markDayCount?: number; markTotalCount?: number; userId: number[] }>

  /** 任务设置 - 按小组追加 */
  type MarkGroupUpdateCount = BaseDefine<{
    markCount?: number
    markingGroupNumbers?: any
    mainNumber?: number | string
    subjectCode?: string
  }>

  /** 任务设置-获取任务计划 */
  interface TaskDetail {
    finishCount: number
    markCount: number
    markingGroupNumber: number | string
  }
  type GetTaskDetail = BaseDefine<
    {
      mainNumber?: number | string
      markingGroupNumbers?: any
      subjectCode?: string
    },
    TaskDetail[]
  >
  /** 任务设置-获取剩余任务 */
  type GetUnMarkTasks = BaseDefine<
    {
      mainNumber?: number | string
      markingGroupNumbers?: number | string
      subjectCode?: string
    },
    {
      unmarkCount: 0
    }
  >
  /** 考生数据导入状态 */
  type GetStudentImportStatus = BaseDefine<null, { importing: boolean; progress: number }>
  type imortAndExportList = BaseDefine<MultipleQuery<{ taskType?: string }>, MultipleResult<importOrExportItem>>
  type removeImportOrExport = BaseDefine<{ id: string }>
  type AdminGetMarkers = BaseDefine<any, any>
  export interface ApiMap {
    importMarkingData: ImportMarkingData
    /** 创建评卷分配表 */
    exportStudentTask: ExportStudentTask
    getImportFilePath: GetImportFilePath
    importSamplePaper: ImportSamplePaper
    importRfPaper: ImportRfPaper
    importCheck: ImportCheck
    getCetScoreList: GetCetScoreList
    exportCetScoreList: ExportCetScoreList
    /** 任务设置 - 按评卷员设置 */
    markerSetCount: MarkerSetCount
    /** 任务设置 - 按小组追加 */
    markGroupUpdateCount: MarkGroupUpdateCount
    /** 任务设置-获取任务计划 */
    getTaskDetail: GetTaskDetail
    /** 任务设置-获取剩余任务 */
    getUnMarkTasks: GetUnMarkTasks
    /** 考生数据导入状态 */
    getStudentImportStatus: GetStudentImportStatus
    /** 数据导入导出记录 */
    imortAndExportList: imortAndExportList
    /** 删除单条导入导出记录 */
    removeImportOrExport: removeImportOrExport
    adminGetMarkers: AdminGetMarkers
  }
}
