/**
 * 返回群发原始数据
 * @param data 
 */
export const getGroupChatSendData = (data: { [x: string]: any }) => {
    const { groupSendName, strategyList } = data
    return {
        groupSendName,
        strategyList: strategyList.map(item => {
            const { taskDetail, ...its } = item
            return {
                ...its,
                sendData: taskDetail.map(td => {
                    const { externalUserFilterName, externalUserFilter, ...itsd } = td
                    const detail: { [x: string]: any } = {
                        ...itsd,
                        sendGroupName: externalUserFilterName
                    }
                    if (externalUserFilter) {
                        detail.externalUserType = 'specify'
                        const { configName, ...configContent } = externalUserFilter
                        detail.externalUserFilter = {
                            configName,
                            configContent
                        }
                    } else {
                        detail.externalUserType = 'all'
                    }
                    return detail
                })
            }
        })
    }
}