manageApi.js 6.89 KB
import request from '@/utils/request'
// let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
let SERVER = window.config ? window.config : JSON.parse(localStorage.getItem('ApiUrl'))
const workflow = '/workflow'
const log = '/log'
const crud = '/crud'
export const api = {
  userInfo: SERVER.MANAGEMENTAPI + '/rest/user-info', // 登录用户信息
  permissionsUser: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户权限
  baseDataCategory: SERVER.MANAGEMENTAPI + '/rest/base-data-category', // 数据字典类别
  baseData: SERVER.MANAGEMENTAPI + '/rest/base-data', // 数据字典
  districts: SERVER.MANAGEMENTAPI + '/rest/districts', // 行政区划
  districtsAll: SERVER.MANAGEMENTAPI + '/rest/districts/parent-tree', // 条件查询所有行政区划
  organizations: SERVER.MANAGEMENTAPI + '/rest/organizations', // 组织机构
  departments: SERVER.MANAGEMENTAPI + '/rest/departments', // 部门
  users: SERVER.MANAGEMENTAPI + '/rest/users', // 人员用户
  roles: SERVER.MANAGEMENTAPI + '/rest/roles', // 角色
  userRoles: SERVER.MANAGEMENTAPI + '/rest/user-roles', // 角色对应人员关系
  productCategory: SERVER.MANAGEMENTAPI + '/rest/product-category', // 业务分类
  resourceCategory: SERVER.MANAGEMENTAPI + '/rest/resource-category', // 资源分类
  resources: SERVER.MANAGEMENTAPI + '/rest/resources', // 资源详情列表
  subsystem: SERVER.MANAGEMENTAPI + '/rest/products', // 子系统管理
  operations: SERVER.MANAGEMENTAPI + '/rest/operations', // 操作
  menus: SERVER.MANAGEMENTAPI + '/rest/menus', // 菜单
  organizationPermissions: SERVER.MANAGEMENTAPI + '/rest/organization-permissions', // 机构授权
  departmentPermissions: SERVER.MANAGEMENTAPI + '/rest/department-permissions', // 部门授权
  rolePermissions: SERVER.MANAGEMENTAPI + '/rest/role-permissions', // 角色授权
  peoPermissions: SERVER.MANAGEMENTAPI + '/rest/user-permissions', // 用户授权
  resourcePermissions: SERVER.MANAGEMENTAPI + '/rest/resource-permissions', // 资源授权查询
  menuPermissions: SERVER.MANAGEMENTAPI + '/rest/menu-permissions', // 菜单授权查询
  serviceCategory: SERVER.MANAGEMENTAPI + '/rest/service-category', // 服务分类
  service: SERVER.MANAGEMENTAPI + '/rest/service', // 服务详情列表
  databaseServer: workflow + '/rest/database-server', // 数据库服务器
  materialCategory: workflow + '/rest/material-category', // 材料分类
  material: workflow + '/rest/material', // 材料
  function: workflow + '/rest/function', // 功能属性
  eventCategory: workflow + '/rest/event-category', // 服务事件分类
  event: workflow + '/rest/event', // 服务事件
  formCategorys: workflow + '/rest/forms-category', // 表单分类
  forms: workflow + '/rest/forms', // 表单
  metadata: workflow + '/rest/metadata', // 元数据
  dataObjectCategory: workflow + '/rest/data-object-category', // 对象管理类别
  dataObject: workflow + '/rest/data-object', // 对象管理
  workflowBusiness: workflow + '/rest/businesses', // 业务流程
  // workflowModel: workflow+'/rest/workflow/model',//流程模型
  modelcategorys: workflow + '/rest/model-categories', // 模型分类
  models: workflow + '/rest/models', // 工作流模型表
  businessesModels: workflow + '/rest/businesses-models', // 业务流程关系
  pluginCategory: workflow + '/rest/plugin-category', // 流程插件分类管理
  plugin: workflow + '/rest/plugins', // 流程插件分类管理
  groups: workflow + '/rest/groups', // 用户组分类
  groupUsers: workflow + '/rest/group-users', // 用户组人员
  saveWorkflowGroupUser: workflow + '/rest/groups/sug', // 工作流设计器增加用户组
  validate: workflow + '/rest/models/validate', // 流程验证
  tokens: SERVER.MANAGEMENTAPI + '/rest/tokens', // token
  session: '/rest/session', // session
  pwdSetting: SERVER.MANAGEMENTAPI + '/rest/password-setting', //
  singleSign: '/cas/rest/services', // 单点登录管理
  attachments: SERVER.MANAGEMENTAPI + '/rest/attachments', // 文件上传服务
  instances: workflow + '/rest/workflow/instances', // 实例
  workflowTask: workflow + '/rest/workflow-task', // 任务
  definitions: workflow + '/rest/workflow/definitions', // 流程实例
  systemAccessLogs: log + '/rest/system-access-logs', // 系统访问日志
  errorLogs: log + '/rest/common-log-statistics', // 错误日志
  appAccess: log + '/rest/system-access-logs/count-app-access', // 系统访问数
  userAccess: log + '/rest/system-access-logs/count-user-access', // 用户访问数
  statisticMenus: log + '/rest/system-access-logs/statistic-menus', // 统计菜单访问数
  statisticUsers: log + '/rest/system-access-logs/statistic-users', // 统计用户访问数
  abnormal: log + '/rest/abnormal', // 统计平台报警
  monitorConfig: log + '/rest/monitor-alert-config', // 监控预警配置
  statisticTimes: log + '/rest/system-access-logs/statistic-times', // 监控预警配置
  server: log + '/rest/server', // 服务器监控
  serverStatistics: log + '/rest/server-statistics', // 服务器监控信息统计
  avgTimes: log + '/rest/services-statistics/avg-times', // 根据时间查响应时间和访问次数
  statisticDepts: log + '/rest/system-access-logs/statistic-depts', // 访问部门统计
  crudHead: crud + '/rest/head', // crudhead
  crudGet: crud + '/rest/get', // crudget
  crudPost: crud + '/rest/post', // crudPost
  crudPut: crud + '/rest/put', // crudPut
  crudDel: crud + '/rest/delete', // crudDel
  crudMetadata: crud + '/rest/metadata', //crudMetadata
  crudBusiness: crud + '/rest/business', // crudBusiness
  crudDatasources: crud + '/rest/datasources', // crudDatasources
}

// 根据code获取字典 params={isTree:true})
export function getDictItems (code, params = {}) {
  return request({
    url: `${api.baseDataCategory}/${code}/base-datas`,
    method: 'get',
    params
  })
}
// 获取一级字典值下级接口
export function getDictItemsChild (id) {
  return request({
    url: `${api.baseData}/dict/${id}`,
    method: 'get'
  })
}
// 获取传入字段的所有级别字典值
export function getAllDictItems (name) {
  return request({
    url: `${api.baseDataCategory}/${name}/base-datas`,
    method: 'get'
  })
}
// get公共方法
export function getAction (url, params = {}) {
  return request({
    url,
    method: 'get',
    params
  })
}
// post公共方法
export function postAction (url, data = null) {
  return request({
    url,
    method: 'post',
    data
  })
}
// method= {post | put}
export function httpAction (url, data, method) {
  return request({
    url,
    method,
    data
  })
}
// put公共方法
export function putAction (url, data = null) {
  return request({
    url,
    method: 'put',
    data
  })
}
// delete
export function deleteAction (url, data = null) {
  return request({
    url,
    method: 'delete',
    data
  })
}

// 批量删除
export function deleteBranch (url, data) {
  return request({
    url,
    method: 'delete',
    data
  })
}