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.
55 lines
1.3 KiB
55 lines
1.3 KiB
'use strict';
|
|
|
|
import { basicAction } from '@peace/utils'
|
|
import { ApiTable } from '$utils'
|
|
|
|
export function getReportList (query) {
|
|
return dispatch => basicAction({
|
|
type: 'get',
|
|
query,
|
|
dispatch: dispatch,
|
|
actionType: 'GET_REPORT_LIST',
|
|
url: ApiTable.getReportList,
|
|
msg: { error: '获取报表配置列表失败' },
|
|
});
|
|
}
|
|
|
|
|
|
export function postReport (data = {}) {
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_REPORT',
|
|
url: `${ApiTable.postReport}`,
|
|
msg: { option: data?.id ? '编辑报表生成规则' : "新增报表生成规则" },
|
|
});
|
|
}
|
|
|
|
|
|
export function delReport (id) {//删除报表文件
|
|
return dispatch => basicAction({
|
|
type: 'del',
|
|
dispatch: dispatch,
|
|
actionType: 'DEL_REPORT',
|
|
url: `${ApiTable.delReport.replace('{id}', id)}`,
|
|
msg: { option: '删除报表规则' },
|
|
|
|
|
|
});
|
|
}
|
|
|
|
export function postGenerateReport (data = {}) { //生成报表
|
|
return dispatch => basicAction({
|
|
type: 'post',
|
|
data,
|
|
dispatch: dispatch,
|
|
actionType: 'POST_GENERATE_REPORT',
|
|
url: `${ApiTable.generateReport}`,
|
|
msg: { option: "生成报表" },
|
|
reducer: {
|
|
name: "generateReport",
|
|
params: { noClear: true }
|
|
}
|
|
});
|
|
}
|