peng.peng
2 years ago
4 changed files with 65 additions and 8 deletions
@ -0,0 +1,56 @@ |
|||
'use strict'; |
|||
|
|||
import { basicAction } from '@peace/utils' |
|||
import { ApiTable } from '$utils' |
|||
|
|||
export function addTask(params, msg) { |
|||
return (dispatch) => basicAction({ |
|||
type: 'post', |
|||
data: params, |
|||
dispatch, |
|||
actionType: 'ADD_DATSOURCE', |
|||
url: ApiTable.addTask, |
|||
msg: { |
|||
option: msg || '新增采集任务', |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
export function getTasks(query) { |
|||
return dispatch => basicAction({ |
|||
type: 'get', |
|||
dispatch: dispatch, |
|||
query: query || {}, |
|||
actionType: 'GET_ACQ_TASKS', |
|||
url: `${ApiTable.getTasks}`, |
|||
msg: { error: '获取采集任务列表失败' }, |
|||
reducer: { name: 'tasks' } |
|||
}); |
|||
} |
|||
|
|||
export function deleteTask(id) { |
|||
return (dispatch) => basicAction({ |
|||
type: 'del', |
|||
dispatch, |
|||
actionType: 'DELETE_ACQ_TASK', |
|||
url: ApiTable.modifyTask.replace('{id}', id), |
|||
msg: { |
|||
option: '采集任务删除', |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
export function modifyTask(id, params, msg) { |
|||
return (dispatch) => basicAction({ |
|||
type: 'put', |
|||
data: params, |
|||
dispatch, |
|||
actionType: 'MODIFY_ACQ_TASK', |
|||
url: ApiTable.modifyTask.replace('{id}', id), |
|||
msg: { |
|||
option: msg || '采集任务编辑', |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
|
Loading…
Reference in new issue