2021-06-11 23:00:33 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* @author 陈劲松
|
|
|
|
|
|
* @date 2021/6/11
|
2021-06-22 21:19:04 +08:00
|
|
|
|
* @description 1.定义api;2.定义通用查询方法,函数名应为 获取详情getItem、获取列表getItemList。例如getUser、getUserList
|
2021-06-11 23:00:33 +08:00
|
|
|
|
*/
|
2021-06-22 21:19:04 +08:00
|
|
|
|
import { get, post } from '@/utils/http'
|
2021-10-16 15:50:12 +08:00
|
|
|
|
import axios from 'axios'
|
2021-06-22 21:19:04 +08:00
|
|
|
|
import { sortByOrderNum } from '@/permission'
|
2021-08-11 22:14:23 +08:00
|
|
|
|
import { storageKey } from '@/utils/constants'
|
2021-06-11 23:00:33 +08:00
|
|
|
|
|
2021-06-15 09:25:10 +08:00
|
|
|
|
export const api = {
|
2021-06-22 21:19:04 +08:00
|
|
|
|
// 系统相关
|
|
|
|
|
|
permission: '/sys/user/permissions',
|
|
|
|
|
|
dict: '/sys/dict',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
logout: '/logout',
|
|
|
|
|
|
pin: 'sys/user/pin',
|
|
|
|
|
|
appearance: '/sys/appearance',
|
|
|
|
|
|
permissions: '/sys/user/permissions',
|
|
|
|
|
|
operationLog: '/sys/log',
|
2022-04-14 17:22:48 +08:00
|
|
|
|
login: '/sys/login',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
// user
|
2021-09-02 17:12:27 +08:00
|
|
|
|
user: '/sys/user',
|
2023-03-24 18:44:02 +08:00
|
|
|
|
timezone: '/sys/timezones',
|
2022-09-15 15:51:00 +08:00
|
|
|
|
// 获取配置
|
|
|
|
|
|
config: '/sys/config',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
// role
|
2021-09-02 17:12:27 +08:00
|
|
|
|
role: '/sys/role',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
menu: '/sys/role/menu/',
|
|
|
|
|
|
sysMenu: '/sys/menu/',
|
|
|
|
|
|
// i18n
|
2022-04-14 17:22:48 +08:00
|
|
|
|
i18nLang: '/sys/i18n/lang',
|
|
|
|
|
|
i18nSys: '/sys/i18n',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
// chart
|
2021-10-15 16:42:15 +08:00
|
|
|
|
chartList: '/visual/chart/list',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
// galaxyProxy
|
|
|
|
|
|
galaxyProxy: '/galaxy/setting',
|
2023-02-23 18:12:20 +08:00
|
|
|
|
// 知识库
|
2023-03-02 20:37:21 +08:00
|
|
|
|
knowledgeBase: '/knowledge',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
|
2022-04-12 18:00:01 +08:00
|
|
|
|
// 报告相关
|
2022-04-14 15:52:07 +08:00
|
|
|
|
reportJob: '/report/job',
|
2022-06-06 17:37:01 +08:00
|
|
|
|
reportJobCount: '/report/job/count',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
reportTemp: '/report/temp',
|
2022-06-06 17:37:01 +08:00
|
|
|
|
reportCategory: '/report/category',
|
2022-04-14 15:52:07 +08:00
|
|
|
|
reportBatchDownloadPdf: '/report/job/batchDownloadPdf',
|
|
|
|
|
|
reportDownloadPdf: '/report/job/downloadPdf',
|
|
|
|
|
|
reportView: '/report/job/view',
|
2021-06-22 21:19:04 +08:00
|
|
|
|
// 业务
|
2021-06-15 09:25:10 +08:00
|
|
|
|
panel: '/visual/panel',
|
2021-07-07 22:58:52 +08:00
|
|
|
|
chart: '/visual/chart',
|
2021-12-31 10:55:49 +08:00
|
|
|
|
entityList: '/interface/entity/list/basic',
|
2022-01-05 20:24:02 +08:00
|
|
|
|
entityListTotal: '/interface/entity/list/total',
|
2021-08-11 22:14:23 +08:00
|
|
|
|
entityCount: '/interface/entity/total',
|
2021-12-31 10:55:49 +08:00
|
|
|
|
entityFilter: '/interface/entity/filter/count',
|
|
|
|
|
|
entityFilterTop: '/interface/entity/filter/top',
|
2021-09-30 00:50:11 +08:00
|
|
|
|
ipThroughput: '/interface/entity/ip/detail/throughput',
|
|
|
|
|
|
domainThroughput: '/interface/entity/domain/detail/throughput',
|
2021-12-23 17:17:06 +08:00
|
|
|
|
appThroughput: '/interface/entity/app/detail/throughput',
|
2021-12-31 10:40:37 +08:00
|
|
|
|
filterTop: '/interface/entity/filter/top',
|
|
|
|
|
|
entityTotal: '/interface/entity/index/total',
|
|
|
|
|
|
entityNew: '/interface/entity/index/new',
|
|
|
|
|
|
entityActive: '/interface/entity/index/active',
|
|
|
|
|
|
entityTraffic: '/interface/entity/list/traffic',
|
|
|
|
|
|
ipBytes: '/interface/entity/detail/ip/bytes',
|
|
|
|
|
|
domainBytes: '/interface/entity/detail/domain/bytes',
|
2022-01-04 14:54:26 +08:00
|
|
|
|
appBytes: '/interface/entity/detail/app/bytes',
|
|
|
|
|
|
// app detail
|
|
|
|
|
|
entityAppDetailTraffic: '/interface/entity/detail/overview/app/traffic',
|
|
|
|
|
|
entityAppDetailRelation: '/interface/entity/detail/overview/app/relation',
|
2022-02-13 23:20:24 +08:00
|
|
|
|
entityAppDetailNetworkQuantity: '/interface/entity/detail/overview/app/networkQuantity',
|
|
|
|
|
|
entityAppDetailLinkIn: '/interface/entity/detail/overview/app/linkIn',
|
|
|
|
|
|
entityAppDetailLinkOut: '/interface/entity/detail/overview/app/linkOut',
|
2022-03-18 16:23:55 +08:00
|
|
|
|
entityAppDetailPerformance: '/interface/entity/detail/overview/app/performanceEvent',
|
2022-03-18 15:49:53 +08:00
|
|
|
|
entityAppDetailSecurity: '/interface/entity/detail/overview/app/securityEvent',
|
2022-02-16 18:19:58 +08:00
|
|
|
|
entityAppRelatedServerDomain: '/interface/entity/detail/overview/app/relatedDomain',
|
|
|
|
|
|
entityAppRelatedServerIp: '/interface/entity/detail/overview/app/relatedServerIp',
|
2022-05-21 17:42:08 +08:00
|
|
|
|
entityAppRelatedServerAppOverview: '/interface/entity/detail/app/serviceOverview',
|
|
|
|
|
|
entityAppDetailBasic: '/interface/entity/detail/app/basic',
|
2022-01-04 14:54:26 +08:00
|
|
|
|
// domain detail
|
|
|
|
|
|
entityDomainDetailBasic: '/interface/entity/detail/overview/domain/basic',
|
|
|
|
|
|
entityDomainDetailTraffic: '/interface/entity/detail/overview/domain/traffic',
|
|
|
|
|
|
entityDomainDetailRelation: '/interface/entity/detail/overview/domain/relation',
|
|
|
|
|
|
entityDomainDetailNetworkQuantity: '/interface/entity/detail/overview/domain/networkQuantity',
|
|
|
|
|
|
entityDomainDetailLinkIn: '/interface/entity/detail/overview/domain/linkIn',
|
|
|
|
|
|
entityDomainDetailLinkOut: '/interface/entity/detail/overview/domain/linkOut',
|
2022-03-18 16:23:55 +08:00
|
|
|
|
entityDomainDetailPerformance: '/interface/entity/detail/overview/domain/performanceEvent',
|
2022-03-18 15:49:53 +08:00
|
|
|
|
entityDomainDetailSecurity: '/interface/entity/detail/overview/domain/securityEvent',
|
2022-02-16 18:19:58 +08:00
|
|
|
|
entityDomainRelatedServerIp: '/interface/entity/detail/overview/domain/relatedServerIp',
|
|
|
|
|
|
entityDomainRelatedServerApp: '/interface/entity/detail/overview/domain/relatedApp',
|
2022-04-01 14:06:09 +08:00
|
|
|
|
entityDetectionsIp: '/interface/entity/detail/overview/ip/dnsInfo',
|
|
|
|
|
|
entityDetectionsIpQueryRate: '/interface/entity/detail/overview/ip/dnsQueryRate',
|
2022-05-21 17:42:08 +08:00
|
|
|
|
entityDomainRelatedServerDomainOverview: '/interface/entity/detail/domain/serviceOverview',
|
2022-01-04 14:54:26 +08:00
|
|
|
|
// ip detail
|
|
|
|
|
|
entityIpDetailTraffic: '/interface/entity/detail/overview/ip/traffic',
|
2022-01-21 21:03:39 +08:00
|
|
|
|
entityIpDetailTrafficMap: '/interface/entity/detail/ip/trafficMap',
|
2022-01-26 14:39:17 +08:00
|
|
|
|
entityDomainDetailTrafficMap: '/interface/entity/detail/domain/trafficMap',
|
|
|
|
|
|
entityAppDetailTrafficMap: '/interface/entity/detail/app/trafficMap',
|
2022-01-04 14:54:26 +08:00
|
|
|
|
entityIpDetailRelation: '/interface/entity/detail/overview/ip/relation',
|
2022-02-13 23:20:24 +08:00
|
|
|
|
entityIpDetailNetworkQuantity: '/interface/entity/detail/overview/ip/networkQuantity',
|
|
|
|
|
|
entityIpDetailLinkIn: '/interface/entity/detail/overview/ip/linkIn',
|
|
|
|
|
|
entityIpDetailLinkOut: '/interface/entity/detail/overview/ip/linkOut',
|
2022-03-18 16:23:55 +08:00
|
|
|
|
entityIpDetailPerformance: '/interface/entity/detail/overview/ip/performanceEvent',
|
2022-03-18 15:49:53 +08:00
|
|
|
|
entityIpDetailSecurity: '/interface/entity/detail/overview/ip/securityEvent',
|
2022-02-16 18:19:58 +08:00
|
|
|
|
entityIpRelatedServerDomain: '/interface/entity/detail/overview/ip/relatedDomain',
|
2022-02-17 19:28:48 +08:00
|
|
|
|
entityIpRelatedServerApp: '/interface/entity/detail/overview/ip/relatedApp',
|
2022-05-21 17:42:08 +08:00
|
|
|
|
entityIpRelatedServerIpOverview: '/interface/entity/detail/ip/serviceOverview',
|
|
|
|
|
|
entityIpDetailBasic: '/interface/entity/detail/ip/basic',
|
2022-02-18 18:09:44 +08:00
|
|
|
|
// detection
|
2022-02-25 13:33:54 +08:00
|
|
|
|
detection: {
|
|
|
|
|
|
securityEvent: {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
eventSeverityTrend: '/interface/detection/security/filter/severityTrend',
|
|
|
|
|
|
securityType: '/interface/detection/security/filter/securityType',
|
|
|
|
|
|
offenderIp: '/interface/detection/security/filter/offenderIp',
|
|
|
|
|
|
offenderLocation: '/interface/detection/security/filter/offenderLocation',
|
|
|
|
|
|
victimIp: '/interface/detection/security/filter/victimIp',
|
|
|
|
|
|
victimLocation: '/interface/detection/security/filter/victimLocation',
|
|
|
|
|
|
eventSeverity: '/interface/detection/security/filter/severity',
|
|
|
|
|
|
listBasic: '/interface/detection/security/list/basic',
|
2022-03-05 20:25:03 +08:00
|
|
|
|
listCount: '/interface/detection/security/list/count',
|
2022-02-28 11:53:37 +08:00
|
|
|
|
overviewBasic: '/interface/detection/security/detail/overview/basic',
|
|
|
|
|
|
overviewEvent: '/interface/detection/security/detail/overview/event'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
},
|
|
|
|
|
|
performanceEvent: {
|
2022-02-28 11:53:37 +08:00
|
|
|
|
eventSeverityTrend: '/interface/detection/performance/filter/severityTrend',
|
2022-03-04 15:46:30 +08:00
|
|
|
|
eventType: '/interface/detection/performance/filter/eventType',
|
2022-02-28 11:53:37 +08:00
|
|
|
|
eventSeverity: '/interface/detection/performance/filter/severity',
|
|
|
|
|
|
activeEntity: '/interface/detection/performance/filter/activeEntity',
|
|
|
|
|
|
listBasic: '/interface/detection/performance/list/basic',
|
2022-03-05 20:25:03 +08:00
|
|
|
|
listCount: '/interface/detection/performance/list/count',
|
2022-03-18 18:25:50 +08:00
|
|
|
|
overviewBasic: '/interface/detection/performance/detail/overview/basic',
|
2022-05-27 18:22:23 +08:00
|
|
|
|
dnsErrorMetric: '/interface/detection/performance/detail/overview/metric/dnsError',
|
|
|
|
|
|
httpErrorMetric: '/interface/detection/performance/detail/overview/metric/httpError',
|
|
|
|
|
|
highDnsResponseTimeMetric: '/interface/detection/performance/detail/overview/metric/highDnsResponseTime'
|
2022-02-25 13:33:54 +08:00
|
|
|
|
}
|
2022-04-14 15:52:07 +08:00
|
|
|
|
},
|
|
|
|
|
|
// Dashboard
|
|
|
|
|
|
dashboard: {
|
|
|
|
|
|
DnsServiceInsights: {
|
|
|
|
|
|
alarmInfoCount: '/interface/dns/alarmInfoCount'
|
|
|
|
|
|
}
|
2022-08-02 20:17:47 +08:00
|
|
|
|
},
|
|
|
|
|
|
// networkOverview
|
|
|
|
|
|
netWorkOverview: {
|
2022-08-05 15:50:54 +08:00
|
|
|
|
totalTrafficAnalysis: '/interface/overview/totalTrafficAnalysis',
|
2022-08-02 20:17:47 +08:00
|
|
|
|
eventSeverity: '/interface/overview/eventSeverity',
|
|
|
|
|
|
eventType: '/interface/overview/eventType',
|
|
|
|
|
|
ddosEventAnalysis: '/interface/overview/ddosEventAnalysis',
|
2022-08-05 15:50:54 +08:00
|
|
|
|
applicationCycleTrafficTotal: '/interface/overview/applicationCycleTrafficTotal',
|
2022-08-05 17:40:39 +08:00
|
|
|
|
applicationTrafficAnalysis: '/interface/overview/applicationTrafficAnalysis',
|
|
|
|
|
|
appCompanyTrafficAnalysis: '/interface/overview/appCompanyTrafficAnalysis',
|
|
|
|
|
|
appCompanyCycleTrafficTotal: '/interface/overview/appCompanyCycleTrafficTotal'
|
2022-08-08 17:45:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
npm: {
|
|
|
|
|
|
overview: {
|
|
|
|
|
|
tcpSessionDelay: '/interface/application/performance/overview/tcpSessionDelay',
|
|
|
|
|
|
httpResponseDelay: '/interface/application/performance/overview/httpResponseDelay',
|
|
|
|
|
|
sslConDelay: '/interface/application/performance/overview/sslConDelay',
|
|
|
|
|
|
tcpLostlenPercent: '/interface/application/performance/overview/tcpLostlenPercent',
|
2022-08-09 21:19:21 +08:00
|
|
|
|
packetRetransPercent: '/interface/application/performance/overview/packetRetransPercent',
|
|
|
|
|
|
// app类别评分
|
|
|
|
|
|
appTrafficAnalysis: '/interface/application/performance/overview/appTrafficAnalysis',
|
|
|
|
|
|
appTcpSessionDelay: '/interface/application/performance/overview/appTcpSessionDelay',
|
|
|
|
|
|
appHttpResponseDelay: '/interface/application/performance/overview/appHttpResponseDelay',
|
|
|
|
|
|
appSslConDelay: '/interface/application/performance/overview/appSslConDelay',
|
|
|
|
|
|
appTcpLostlenPercent: '/interface/application/performance/overview/appTcpLostlenPercent',
|
2022-08-12 15:25:54 +08:00
|
|
|
|
appPacketRetransPercent: '/interface/application/performance/overview/appPacketRetransPercent',
|
2022-11-02 19:28:11 +08:00
|
|
|
|
// 整体流量折线图
|
|
|
|
|
|
totalTrafficAnalysis: '/interface/application/performance/overview/totalTrafficAnalysis',
|
|
|
|
|
|
totalNetworkAnalysis: '/interface/application/performance/overview/totalNetworkAnalysis',
|
|
|
|
|
|
totalHttpResponseDelay: '/interface/application/performance/overview/totalHttpResponseDelay',
|
|
|
|
|
|
totalSslConDelay: '/interface/application/performance/overview/totalSslConDelay',
|
2022-08-12 15:25:54 +08:00
|
|
|
|
// 各维度下钻会话统计
|
|
|
|
|
|
relatedSessions: '/interface/application/performance/relatedSessions',
|
|
|
|
|
|
// 各维度下钻流量曲线图
|
2022-08-23 21:42:42 +08:00
|
|
|
|
trafficGraph: '/interface/application/performance/overview/drilldown/drilldown/dimension/trafficGraph',
|
2022-08-30 19:08:29 +08:00
|
|
|
|
// 各维度下钻网络性能
|
|
|
|
|
|
networkAnalysis: '/interface/application/performance/overview/drilldown/dimension/networkAnalysis',
|
2022-11-25 16:08:32 +08:00
|
|
|
|
// 各维度下钻网络性能 三级菜单
|
|
|
|
|
|
allNetworkAnalysis: '/interface/application/performance/overview/drilldown/dimension/allNetworkAnalysis',
|
2022-08-23 21:42:42 +08:00
|
|
|
|
// 下钻地图
|
|
|
|
|
|
map: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/trafficAnalysis',
|
|
|
|
|
|
mapTcp: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/tcpSessionDelay',
|
|
|
|
|
|
mapHttp: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/httpResponseDelay',
|
|
|
|
|
|
mapSsl: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/sslConDelay',
|
|
|
|
|
|
mapPacketLoss: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/tcpSessionDelay',
|
|
|
|
|
|
mapPacketRetrans: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/tcpSessionDelay'
|
2022-08-08 17:45:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
location: {
|
2022-08-11 16:45:48 +08:00
|
|
|
|
// 折线图
|
2022-08-19 10:06:27 +08:00
|
|
|
|
map: '/interface/application/performance/location/networkMap',
|
|
|
|
|
|
mapTcp: '/interface/application/performance/location/tcpSessionDelay',
|
|
|
|
|
|
mapHttp: '/interface/application/performance/location/httpResponseDelay',
|
|
|
|
|
|
mapSsl: '/interface/application/performance/location/sslConDelay',
|
|
|
|
|
|
mapPacketLoss: '/interface/application/performance/location/tcpLostlenPercent',
|
|
|
|
|
|
mapPacketRetrans: '/interface/application/performance/location/packetRetransPercent',
|
2022-08-11 16:45:48 +08:00
|
|
|
|
thoughput: '/interface/application/performance/location/thoughput',
|
|
|
|
|
|
tcpConnectionEstablishLatency: '/interface/application/performance/location/tcpConnectionEstablishLatency',
|
|
|
|
|
|
httpResponseLatency: '/interface/application/performance/location/httpResponseLatency',
|
|
|
|
|
|
sslHandshakeLatency: '/interface/application/performance/location/sslHandshakeLatency',
|
|
|
|
|
|
packetsLoss: '/interface/application/performance/location/packetsLoss',
|
2022-08-12 15:25:54 +08:00
|
|
|
|
packetsRetrains: '/interface/application/performance/location/packetsRetrains'
|
2022-08-08 17:45:50 +08:00
|
|
|
|
},
|
|
|
|
|
|
events: {
|
2022-08-11 16:45:48 +08:00
|
|
|
|
list: '/interface/overview/event/list',
|
|
|
|
|
|
recentEvents: '/interface/overview/event/recentEvents',
|
2022-08-24 16:58:34 +08:00
|
|
|
|
recentEventsD: '/interface/application/performance/overview/drilldown/dimension/recentEvents',
|
2022-08-11 16:45:48 +08:00
|
|
|
|
dimensionEvents: '/interface/overview/event/dimensionEvents'
|
2022-08-08 17:45:50 +08:00
|
|
|
|
}
|
2022-09-10 23:13:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
linkMonitor: {
|
2022-09-15 15:51:00 +08:00
|
|
|
|
links: '/interface/linkMonitor/links',
|
2022-09-27 17:47:17 +08:00
|
|
|
|
totalTrafficAnalysis: '/interface/link/overview/drilldown/totalTrafficAnalysis',
|
|
|
|
|
|
networkAnalysis: '/interface/link/overview/drilldown/networkAnalysis',
|
2022-09-26 15:53:57 +08:00
|
|
|
|
linkTrafficDirection: '/interface/linkMonitor/linkTrafficDirection',
|
|
|
|
|
|
quadrupleIngressAnalysis: '/interface/link/overview/quadrupleIngressAnalysis', // 入口
|
2022-09-28 15:35:03 +08:00
|
|
|
|
quadrupleEgressAnalysis: '/interface/link/overview/quadrupleEgressAnalysis', // 出口
|
|
|
|
|
|
bigramAnalysis: '/interface/link/overview/bigramAnalysis',
|
|
|
|
|
|
bigramNextHopAnalysis: '/interface/link/overview/bigramNextHopAnalysis',
|
2022-09-30 14:16:23 +08:00
|
|
|
|
analysis: '/interface/link/overview/analysis',
|
|
|
|
|
|
nextHopAnalysis: '/interface/link/overview/nextHopAnalysis',
|
|
|
|
|
|
// todo 以下几个接口因接口返回数据为空,故造模拟接口平替
|
2022-09-28 15:35:03 +08:00
|
|
|
|
bigramAnalysis1: 'interface/linkMonitor/bigramAnalysis1',
|
2022-09-30 14:16:23 +08:00
|
|
|
|
bigramNextHopAnalysis1: '/interface/linkMonitor/bigramNextHopAnalysis1',
|
2022-10-13 15:43:48 +08:00
|
|
|
|
drilldownQuadrupleIngressAnalysis: '/interface/link/overview/drilldown/quadrupleIngressAnalysis',
|
|
|
|
|
|
drilldownQquadrupleEgressAnalysis: '/interface/link/overview/drilldown/quadrupleEgressAnalysis',
|
2022-09-30 14:16:23 +08:00
|
|
|
|
analysis1: '/interface/linkMonitor/analysis1',
|
|
|
|
|
|
nextHopAnalysis1: '/interface/linkMonitor/nextHopAnalysis1'
|
2022-09-15 16:29:42 +08:00
|
|
|
|
},
|
|
|
|
|
|
dnsInsight: {
|
|
|
|
|
|
recentEvents: '/interface/dnsInsight/recentEvents',
|
2022-09-20 17:20:48 +08:00
|
|
|
|
activeMaliciousDomain: '/interface/dnsInsight/activeMaliciousDomain',
|
2022-09-21 10:42:19 +08:00
|
|
|
|
totalTrafficAnalysis: '/interface/dns/overview/totalTrafficAnalysis',
|
2022-10-18 19:14:08 +08:00
|
|
|
|
eventChart: '/interface/dnsInsight/eventChart',
|
|
|
|
|
|
drilldownTrafficAnalysis: '/interface/dns/overview/drilldown/trafficAnalysis'
|
2022-03-07 17:27:55 +08:00
|
|
|
|
}
|
2021-06-15 09:25:10 +08:00
|
|
|
|
}
|
2021-08-13 09:39:02 +08:00
|
|
|
|
|
2021-06-20 13:31:55 +08:00
|
|
|
|
/* panel */
|
2021-06-11 23:00:33 +08:00
|
|
|
|
export async function getPanelList (params) {
|
2021-06-15 09:25:10 +08:00
|
|
|
|
return await getData(api.panel, params, true)
|
2021-06-11 23:00:33 +08:00
|
|
|
|
}
|
2021-06-20 13:31:55 +08:00
|
|
|
|
export async function getPanel (id) {
|
|
|
|
|
|
return await getData(`${api.chart}/${id}`)
|
|
|
|
|
|
}
|
|
|
|
|
|
/* chart */
|
|
|
|
|
|
export async function getChartList (params) {
|
|
|
|
|
|
return await getData(api.chart, params, true)
|
|
|
|
|
|
}
|
|
|
|
|
|
export async function getChart (id) {
|
|
|
|
|
|
return await getData(`${api.chart}/${id}`)
|
2021-06-11 23:00:33 +08:00
|
|
|
|
}
|
2021-08-11 22:14:23 +08:00
|
|
|
|
/* entity列表 */
|
|
|
|
|
|
export async function getEntityList (params) {
|
|
|
|
|
|
return await getData(api.entityList, params, true)
|
2021-07-07 22:58:52 +08:00
|
|
|
|
}
|
2021-08-11 22:14:23 +08:00
|
|
|
|
/* entity总数 */
|
|
|
|
|
|
export async function getEntityCount (params) {
|
|
|
|
|
|
return await getData(api.entityCount, params)
|
2021-07-09 10:10:06 +08:00
|
|
|
|
}
|
2021-08-11 22:14:23 +08:00
|
|
|
|
/* ip类型entity过滤器数据 */
|
|
|
|
|
|
export async function getEntityFilter (params) {
|
|
|
|
|
|
return await getData(api.entityFilter, params, true)
|
2021-07-09 10:10:06 +08:00
|
|
|
|
}
|
2021-06-22 21:19:04 +08:00
|
|
|
|
/* 字典 */
|
|
|
|
|
|
export async function getDictList (params) {
|
|
|
|
|
|
return await getData(api.dict, params, true)
|
|
|
|
|
|
}
|
2022-03-12 16:56:46 +08:00
|
|
|
|
function handleResult (response) {
|
|
|
|
|
|
if (response.data.list || response.data.result) {
|
|
|
|
|
|
return response.data.list || response.data.result
|
|
|
|
|
|
} else if (response.data.result === 0) {
|
|
|
|
|
|
return response.data.result
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return response.data
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-06-20 13:31:55 +08:00
|
|
|
|
export async function getData (url, params = {}, isQueryList) {
|
2021-08-11 22:14:23 +08:00
|
|
|
|
const request = new Promise((resolve, reject) => {
|
|
|
|
|
|
try {
|
|
|
|
|
|
get(url, params).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
2022-03-12 16:56:46 +08:00
|
|
|
|
resolve(handleResult(response))
|
2021-08-11 22:14:23 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
reject(response)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
reject(e)
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(response => {
|
|
|
|
|
|
console.error(response)
|
2021-06-11 23:00:33 +08:00
|
|
|
|
})
|
|
|
|
|
|
return await request
|
|
|
|
|
|
}
|
2021-06-22 21:19:04 +08:00
|
|
|
|
|
|
|
|
|
|
export async function getPermission () {
|
|
|
|
|
|
const request = new Promise(resolve => {
|
2022-04-14 15:52:07 +08:00
|
|
|
|
post(api.permission, { token: localStorage.getItem(storageKey.token) }).then(response => {
|
2021-06-22 21:19:04 +08:00
|
|
|
|
resolve({
|
|
|
|
|
|
menuList: sortByOrderNum(response.data.menus),
|
|
|
|
|
|
buttonList: response.data.buttons,
|
|
|
|
|
|
roleList: response.data.roles
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
return await request
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function getI18n () {
|
2022-02-21 10:52:14 +08:00
|
|
|
|
const dictData = await getDictList({ type: 'lang' })
|
2021-06-22 21:19:04 +08:00
|
|
|
|
const langs = dictData.map(d => d.value).join(',')
|
2022-01-03 22:46:22 +08:00
|
|
|
|
localStorage.setItem(storageKey.languages, langs)
|
2021-06-22 21:19:04 +08:00
|
|
|
|
const request = new Promise(resolve => {
|
2022-04-14 17:22:48 +08:00
|
|
|
|
get(api.i18nLang, { l: langs }).then(response => {
|
2021-07-21 16:02:44 +08:00
|
|
|
|
response.data.cn = response.data.zh
|
2021-06-22 21:19:04 +08:00
|
|
|
|
resolve(response.data)
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
return await request
|
|
|
|
|
|
}
|
2021-07-01 15:39:48 +08:00
|
|
|
|
|
2021-07-05 17:40:43 +08:00
|
|
|
|
/* 获得原始的3611-2 json字符串数据 */
|
|
|
|
|
|
export async function getIso36112JsonData (suffix) {
|
2023-02-03 11:08:35 +08:00
|
|
|
|
const url = `${window.location.protocol}//${window.location.host}/geojson/${suffix}.json`
|
2021-07-05 17:40:43 +08:00
|
|
|
|
const request = new Promise(resolve => {
|
2023-02-03 11:08:35 +08:00
|
|
|
|
axios({ url }).then(response => {
|
2021-10-16 15:50:12 +08:00
|
|
|
|
resolve(response.data || response || null)
|
2023-02-03 11:08:35 +08:00
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
console.error(err)
|
2021-07-05 17:40:43 +08:00
|
|
|
|
})
|
2021-07-01 15:39:48 +08:00
|
|
|
|
})
|
2021-07-05 17:40:43 +08:00
|
|
|
|
return await request
|
2021-07-01 15:39:48 +08:00
|
|
|
|
}
|