You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
2.0 KiB

'use strict';
import { basicAction } from '@peace/utils'
import { ApiTable } from '$utils'
export function getPatrolPlan() {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_PATROL_PLAN',
url: ApiTable.patrolPlan,
msg: { error: '获取巡检计划失败' },
});
}
export function createPatrolPlan(data) {
return dispatch => basicAction({
type: 'post',
data,
dispatch: dispatch,
actionType: 'CREATE_PATROL_PLAN',
url: ApiTable.patrolPlan,
msg: { error: '新增巡检计划失败' },
});
}
export function delPatrolPlan(id) {
return dispatch => basicAction({
type: 'del',
dispatch: dispatch,
actionType: 'DEL_PATROL_PLAN',
url: ApiTable.delPatrolPlan.replace('{id}', id),
msg: { error: '删除巡检计划失败' },
});
}
export function updatePatrolPlan(data) {
return dispatch => basicAction({
type: 'put',
data,
dispatch: dispatch,
actionType: 'UPDATE_PATROL_PLAN',
url: ApiTable.patrolPlan,
msg: { error: '修改巡检计划失败' },
});
}
export function getUserList() {
return dispatch => basicAction({
type: 'get',
dispatch: dispatch,
actionType: 'GET_USER_LIST',
url: ApiTable.getDepUser.replace('{depId}', null),
msg: { error: '获取人员列表失败' },
reducer: { name: 'userList' }
});
}
export function getProjectList(query) {
return (dispatch) => basicAction({
type: 'get',
query,
dispatch,
actionType: 'GET_PROJEECT_LIST',
url: ApiTable.getProjectList,
msg: { error: '获取结构物列表失败', },
reducer: { name: 'structureList' }
});
}
export function positionList(query) {
return (dispatch) => basicAction({
type: 'get',
query,
dispatch,
actionType: 'POSITION_LIST',
url: ApiTable.position,
msg: { error: '获取点位列表失败', },
});
}