report.js 7.36 KB
Newer Older
陈龙's avatar
陈龙 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
/*
 ** 轻量化报表平台接口
 ** create by ChenLong on 2022/6/24
 ** 功能路径:src\api\service\report.js
 ** 菜单参数列表:*变量名*(变量说明,数据类型,是否必填,取值范围)
 **/
import { request } from '@wisdom-utils/utils';
import * as constants from '../constants';

const BASEURL = '/PandaAssets/Assets/ReportManager';
export const API = {
  GET_REPORT_INFO: `${BASEURL}/GetReportInfo`, // 获取报表信息
  GET_REPORT_FILTER_VALUE: `${BASEURL}/GetReportFilterValue`, // 获取过滤字段的值的枚举
  GET_REPORT_FILTER_VALUES: `${BASEURL}/GetReportFilterValues`, // 获取过滤字段的值的枚举
  GET_REPORT_CONFIG_LIST: `${BASEURL}/GetReportConfigList`, // 获取配置列表
  GET_REPORT_DETAILS_INFO: `${BASEURL}/GetReportDetailsInfo`, // 获取配置详情
  GET_TABLES: `${BASEURL}/GetTables`, // 查询表
  GET_TABLE_FIELDS: `${BASEURL}/GetTableFields`, // 查询表内的字段
  ADD_REPORT_INFO: `${BASEURL}/AddReportInfo`, // 创建报表主表、关联报表子表
  EDIT_REPORT_INFO: `${BASEURL}/AddReportInfo`,
  ADD_REPORT_DETAIL_INFO: `${BASEURL}/AddReportDetailInfo`, // 附加子表字段到主表
  DELETE_REPORT_INFO: `${BASEURL}/DeleteReportInfo`, // 删除报表
  DELETE_REPORT_DETAIL_INFO: `${BASEURL}/DeleteReportDetailInfo`, // 删除字段
  EXPORT_ACCOUNT_DATA: `${BASEURL}/ExportAccountData`, // 导出数据
  SAVE_REPORT_LIST_SORT_FIELDS: `${BASEURL}/SaveReportListSortFields`, // 保存排序
  ADD_REPORT_DETAIL_INFO_INDEX: `${BASEURL}/AddReportDetailInfoIndex`, // 变更接口顺序
  UPDATE_REPORT_DATA: `${BASEURL}/UpdateReportData`, // 更新报表数据
  GET_REPORT_DETAILS: `${BASEURL}/GetReportDetails`, // 获取报表配置
  DEL_REPORT_DATA: `${BASEURL}/DelReportData`, // 删除报表数据
  SET_REPORT_ALLOW: `${BASEURL}/SetReportAllow`, // 设置关注
  ADD_REPORT_DATA: `${BASEURL}/AddReportData`, // 添加报表数据
  EXPORT_JPG: `${BASEURL}/ExportJPGAccountData`,
  EXPORT_REPORT_CONFIG: `${BASEURL}/ExportReportConfig`,
  IMPORT_REPORT_CONFIG: `${BASEURL}/ImportReportConfig`,
  // 多数据源
  GET_DATA_SOURCES: `${BASEURL}/GetDataSources`, // 获取数据源列表
  ADD_DB_CONNECTION: `${BASEURL}/AddDbConnection`, // 新增/编辑数据源
  DELETE_DB_CONNECTION: `${BASEURL}/DeleteDbConnection`, // 删除数据源
  GET_DB_SOURCES: `${BASEURL}/GetDBSources`, // 获取数据库
  TEST_CONNECTION: `${BASEURL}/TestConnection`, // 测试链接
  DEL_REPORT_CHILD: `${BASEURL}/DelReportChlid`, // 删除挂接关系
};
const reportService = {
  getReportInfo: {
    url: API.GET_REPORT_INFO,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  getReportFilterValue: {
    url: API.GET_REPORT_FILTER_VALUE,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  getReportFilterValues: {
    url: API.GET_REPORT_FILTER_VALUES,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  getReportConfigList: {
    url: API.GET_REPORT_CONFIG_LIST,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  getReportDetailsInfo: {
    url: API.GET_REPORT_DETAILS_INFO,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  getTables: {
    url: API.GET_TABLES,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  getTableFields: {
    url: API.GET_TABLE_FIELDS,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  addReportInfo: {
    url: API.ADD_REPORT_INFO,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  editReportInfo: {
    url: API.EDIT_REPORT_INFO,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  addReportDetailInfo: {
    url: API.ADD_REPORT_DETAIL_INFO,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  deleteReportInfo: {
    url: API.DELETE_REPORT_INFO,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  deleteReportDetailInfo: {
    url: API.DELETE_REPORT_DETAIL_INFO,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  saveReportListSortFields: {
    url: API.SAVE_REPORT_LIST_SORT_FIELDS,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  addReportDetailInfoIndex: {
    url: API.ADD_REPORT_DETAIL_INFO_INDEX,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  updateReportData: {
    url: API.UPDATE_REPORT_DATA,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  getReportDetails: {
    url: API.GET_REPORT_DETAILS,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  delReportData: {
    url: API.DEL_REPORT_DATA,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  setReportAllow: {
    url: API.SET_REPORT_ALLOW,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  addReportData: {
    url: API.ADD_REPORT_DATA,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  exportJPG: {
    url: API.EXPORT_JPG,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  exportConfig: {
    url: API.EXPORT_REPORT_CONFIG,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  importConfig: {
    url: API.IMPORT_REPORT_CONFIG,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  getDataSources: {
    url: API.GET_DATA_SOURCES,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  addDbConnection: {
    url: API.ADD_DB_CONNECTION,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  deleteDbConnection: {
    url: API.DELETE_DB_CONNECTION,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
  getDbSources: {
    url: API.GET_DB_SOURCES,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  testConnection: {
    url: API.TEST_CONNECTION,
    method: constants.REQUEST_METHOD_POST,
    type: constants.REQUEST_METHOD_POST,
  },
  delReportChild: {
    url: API.DEL_REPORT_CHILD,
    method: constants.REQUEST_METHOD_GET,
    type: constants.REQUEST_METHOD_GET,
  },
};
export const submitReportData = (params, data) =>
  request({
    url: API.UPDATE_REPORT_DATA,
    method: 'post',
    params,
    data,
  });
export const exportAccountData = (options, params, data) =>
  request({
    url: API.EXPORT_ACCOUNT_DATA,
    method: 'post',
    ...options,
    params,
    data,
  });
export const exportJPG = (options, data) => {
  return request({
    url: API.EXPORT_JPG,
    method: 'post',
    ...options,
    data,
  });
};
export const addReportDetailInfoIndex = (data) =>
  request({
    url: API.ADD_REPORT_DETAIL_INFO_INDEX,
    method: 'post',
    data,
  });
export const importReportConfig = (options, params, data) =>
  request({
    url: API.IMPORT_REPORT_CONFIG,
    method: 'post',
    ...options,
    params,
    data,
  });
export const exportReportConfig = (options, params) =>
  request({
    url: API.EXPORT_REPORT_CONFIG,
    method: 'get',
    ...options,
    params,
  });
export default reportService;