// 过滤表格导出数据
export const filtration = (arr: Array<{ dealFlag?: number; fileFlag?: number; onlineEvaluate?: number }>) => {
    const dealFlagMap: Record<number, string> = {
        0: '未处理',
        1: '已处理',
        2: '已处理,无结果',
        3: '计算失败'
    }
    const fileFlagMap: Record<number, string> = {
        0: '不存在',
        1: '存在'
    }

    arr.forEach((item: any) => {
        if (item.dealFlag !== undefined) {
            item.dealFlag = dealFlagMap[item.dealFlag] || ''
        }
        if (item.fileFlag !== undefined) {
            item.fileFlag = fileFlagMap[item.fileFlag] || ''
        }
        if (item.onlineEvaluate !== undefined) {
            if (item.onlineEvaluate == null) {
            } else if (item.onlineEvaluate == 3.14159) {
                item.onlineEvaluate = '/'
            } else if (item.onlineEvaluate * 100 > 90) {
                item.onlineEvaluate = '优'
            } else if (item.onlineEvaluate * 100 > 60) {
                item.onlineEvaluate = '良'
            } else {
                item.onlineEvaluate = '差'
            }
        }
    })
    return arr
}
