import {ADD_LABEL,SEARCH_LIST,SET_LABEL,FILL_ACTIVE,FILL_ACTIVE_DETAIL,GET_EXCEL,CHECK_VALUE_IS_CHANGE,CLEAR_LABEL,RESET_LABEL,CLEAR_ALL_LABEL,DEL_PART_ITEM,DEL_EXCEL_LIST} from '../types/inspect';

export const searchList = (list,val) => ({         //初始化数据
    type:SEARCH_LIST,
    list,
    val
})

export const setLabel = (idx,sign) => ({          //搜索后点击选中的结果
    type:SET_LABEL,
    idx,
    sign
})
export const addLabel = (lis) => ({          //右侧开单
    type:ADD_LABEL,
    lis
})
export const resetLabel = (list) => ({          //搜索后点击选中的结果重组
    type:RESET_LABEL,
    list
})

export const fillActived = (id,idx) => ({
    type:FILL_ACTIVE,                          //选中的标签的填写单
    id,
    idx
})

export const fillActiveDetail = (idx,val) => ({
    type:FILL_ACTIVE_DETAIL,                       //填写数据更新
    idx,
    val
})
export const getExcelList = (data) => ({                 //获取导入数据
    type:GET_EXCEL,
    data
})
export const checkValueIsChange = (idx,time,arr) => ({                 //检查值是否变化
    type:CHECK_VALUE_IS_CHANGE,
    idx,
    time,
    arr
})
export const clearLabel = (idx) => ({                  //清空
    type:CLEAR_LABEL,
    idx
})
export const delPartItem = (idx) => ({                  //删除部分
    type:DEL_PART_ITEM,
    idx
})
export const delExcelLis = (idx) => ({                  //删除导入的数据
    type:DEL_EXCEL_LIST,
    idx
})
export const clearAllLabel = (data,dataExcel,saveTextData) => ({                  //清空所有
    type:CLEAR_ALL_LABEL,
    data,
    dataExcel,
    saveTextData
})
