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.
58 lines
1.5 KiB
58 lines
1.5 KiB
'use strict';
|
|
import { basicAction } from '@peace/utils'
|
|
import { ApiTable } from '$utils'
|
|
|
|
export function getProjectType () {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
dispatch: dispatch,
|
|
actionType: 'GET_PORJECT_TYPE',
|
|
url: `${ApiTable.projectType}`,
|
|
msg: { error: '获取项目类型失败' },
|
|
reducer: { name: 'projectType' }
|
|
});
|
|
}
|
|
|
|
export function getProjectPublishList (query = {}) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
query,
|
|
dispatch: dispatch,
|
|
actionType: 'GET_PROJECT_PUBLISH_LIST',
|
|
url: `${ApiTable.projectPublishList}`,
|
|
msg: { error: '获取项目发布列表失败' },
|
|
reducer: { name: 'publishList' }
|
|
});
|
|
}
|
|
|
|
export function postProjectPublish (data = {}) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
dispatch: dispatch,
|
|
data,
|
|
actionType: 'POST_PROJECT_PUBLISH',
|
|
url: `${ApiTable.projectPublishList}`,
|
|
msg: { option: data?.isCode ? '修改地址' : (data?.replacement ? '重置密码' : (data?.id ? "编辑项目" : '新增项目')) },
|
|
reducer: { name: 'anxinyunProject' }
|
|
});
|
|
}
|
|
|
|
|
|
|
|
export function delProjectPublish (id) {
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch: dispatch,
|
|
actionType: 'DEL_RELATION',
|
|
url: ApiTable.delProjectPublish.replace('{id}', id),
|
|
msg: { option: '删除项目' },
|
|
});
|
|
}
|
|
|
|
|
|
export default {
|
|
getProjectType,
|
|
getProjectPublishList,
|
|
postProjectPublish,
|
|
delProjectPublish
|
|
}
|