formData: {
taskInfoId: '',
userGroupAuthId: '',
departmentId: '',
taskName: '',
smsType: '',
runType: '',
runLevel: '',
tempClassifyId: '',
tempId: '',
sumRunNum: 1,
sentDate: '',
sentTime: '',
runTimeList: [],
groupArr: [],
createUserId: '',
// todo 接口调用额外参数
timeList: [],
departmentName: '',
tempContentText: '', // 模板内容
sentClock: '', // 推送时间
setIsOpen: true
}
// 过滤的方法
filterParams(params) {
// props为只想要params里面对象的参数
const props = [
'taskInfoId',
'userGroupAuthId',
'departmentId',
'taskName',
'smsType',
'runType',
'runLevel',
'tempClassifyId',
'tempId',
'sumRunNum',
'runTimeList',
'groupArr',
'createUserId'
]
const dataObj = {}
props.forEach(v => {
dataObj[v] = params[v]
})
return dataObj
}
// 调用方法去掉formData多余参数
this.filterParams(this.formData)
// 只打印出方法filterParams()里面定义的props参数返回