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.
101 lines
2.2 KiB
101 lines
2.2 KiB
'use strict';
|
|
|
|
import { basicAction } from '@peace/utils'
|
|
import { ApiTable } from '$utils'
|
|
|
|
|
|
export function getProjectList (query) {
|
|
return (dispatch) => basicAction({
|
|
type: 'get',
|
|
query,
|
|
dispatch,
|
|
actionType: 'GET_PROJEECT_LIST',
|
|
url: ApiTable.getProjectList,
|
|
msg: { error: '获取结构物列表失败', },
|
|
});
|
|
}
|
|
|
|
|
|
export function postAddProject (data) {
|
|
return (dispatch) => basicAction({
|
|
type: 'post',
|
|
data,
|
|
dispatch,
|
|
actionType: 'POST_ADD_PROJECT',
|
|
url: ApiTable.postAddProject,
|
|
msg: { option: data?.id ? '编辑结构物' : '新增结构物', },
|
|
});
|
|
}
|
|
|
|
|
|
export function delProject (id) {
|
|
return (dispatch) => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DEL_PROJECT',
|
|
url: ApiTable.delProject.replace('{id}', id),
|
|
msg: {
|
|
option: '删除结构物',
|
|
},
|
|
});
|
|
}
|
|
|
|
|
|
export function addPosition (data, point) {
|
|
return (dispatch) => basicAction({
|
|
type: 'post',
|
|
data,
|
|
dispatch,
|
|
actionType: 'ADD_POSITION',
|
|
url: ApiTable.position,
|
|
msg: { option: point ? '二维码生成' : data?.id ? '编辑点位' : '新增点位', },
|
|
});
|
|
}
|
|
|
|
export function positionList (query) {
|
|
return (dispatch) => basicAction({
|
|
type: 'get',
|
|
query,
|
|
dispatch,
|
|
actionType: 'POSITION_LIST',
|
|
url: ApiTable.position,
|
|
msg: { error: '获取点位列表失败', },
|
|
reducer: { name: 'projectPoints' }
|
|
});
|
|
}
|
|
|
|
|
|
export function delPosition (id) {
|
|
return (dispatch) => basicAction({
|
|
type: 'del',
|
|
dispatch,
|
|
actionType: 'DEL_POSITION',
|
|
url: ApiTable.delPosition.replace('{id}', id),
|
|
msg: {
|
|
option: '删除点位',
|
|
},
|
|
});
|
|
}
|
|
|
|
|
|
export function qrCodeShow (query) {
|
|
return (dispatch) => basicAction({
|
|
type: 'get',
|
|
query,
|
|
dispatch,
|
|
actionType: 'GET_QR_CODE',
|
|
url: ApiTable.qrCodeShow,
|
|
msg: { error: '获取二维码列表失败', },
|
|
});
|
|
}
|
|
|
|
export function q () {
|
|
return (dispatch) => basicAction({
|
|
type: 'get',
|
|
dispatch,
|
|
actionType: 'GET_CODE',
|
|
url: ApiTable.q,
|
|
msg: { error: '获取二维码列表失败', },
|
|
});
|
|
}
|
|
|
|
|