2021-03-03 18:35:51 +08:00
|
|
|
import request from '@/utils/request'
|
2022-03-10 10:38:33 +08:00
|
|
|
import store from '@/store'
|
|
|
|
import { queryPanelComponents } from '@/api/panel/panel'
|
2021-03-03 18:35:51 +08:00
|
|
|
|
2022-03-30 10:14:45 +08:00
|
|
|
export function post(url, data, loading = false) {
|
2021-03-03 18:35:51 +08:00
|
|
|
return request({
|
|
|
|
url: url,
|
|
|
|
method: 'post',
|
2022-03-30 10:14:45 +08:00
|
|
|
loading: loading,
|
2021-03-03 18:35:51 +08:00
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
2021-05-18 16:07:19 +08:00
|
|
|
|
|
|
|
export function getChartTree(data) {
|
|
|
|
return request({
|
|
|
|
url: 'api',
|
|
|
|
method: 'post',
|
2022-03-10 10:38:33 +08:00
|
|
|
loading: false,
|
2021-05-18 16:07:19 +08:00
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
2021-06-29 13:44:30 +08:00
|
|
|
|
2022-02-14 18:57:35 +08:00
|
|
|
export function chartCopy(id, panelId) {
|
2021-06-29 13:44:30 +08:00
|
|
|
return request({
|
2022-02-14 18:57:35 +08:00
|
|
|
url: '/chart/view/chartCopy/' + id + '/' + panelId,
|
2021-06-29 13:44:30 +08:00
|
|
|
method: 'post',
|
2022-02-14 18:57:35 +08:00
|
|
|
loading: false
|
2021-06-29 13:44:30 +08:00
|
|
|
})
|
|
|
|
}
|
2021-07-06 18:34:01 +08:00
|
|
|
export function chartGroupTree(data) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/group/tree',
|
|
|
|
method: 'post',
|
2021-11-29 14:54:24 +08:00
|
|
|
loading: false,
|
2021-07-06 18:34:01 +08:00
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function searchAdviceSceneId(panelId) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/view/searchAdviceSceneId/' + panelId,
|
|
|
|
method: 'get',
|
2022-03-10 10:38:33 +08:00
|
|
|
loading: false
|
2021-07-06 18:34:01 +08:00
|
|
|
})
|
|
|
|
}
|
2021-11-15 16:24:03 +08:00
|
|
|
|
|
|
|
export function checkSameDataSet(viewIdSource, viewIdTarget) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/view/checkSameDataSet/' + viewIdSource + '/' + viewIdTarget,
|
|
|
|
method: 'get',
|
|
|
|
loading: false
|
|
|
|
})
|
|
|
|
}
|
2021-11-24 18:14:41 +08:00
|
|
|
|
2022-02-28 11:17:26 +08:00
|
|
|
export function ajaxGetDataOnly(id, panelId, data) {
|
2021-11-24 18:14:41 +08:00
|
|
|
return request({
|
2022-02-28 11:17:26 +08:00
|
|
|
url: '/chart/view/getData/' + id + '/' + panelId,
|
2021-11-24 18:14:41 +08:00
|
|
|
method: 'post',
|
2022-03-10 10:38:33 +08:00
|
|
|
loading: false,
|
2021-11-24 18:14:41 +08:00
|
|
|
hideMsg: true,
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
2022-02-10 18:17:41 +08:00
|
|
|
|
|
|
|
export function pluginTypes() {
|
|
|
|
return request({
|
|
|
|
url: '/plugin/view/types',
|
|
|
|
method: 'post'
|
|
|
|
})
|
|
|
|
}
|
2022-02-28 18:01:14 +08:00
|
|
|
|
|
|
|
export function deleteCircle(id) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/group/deleteCircle/' + id,
|
|
|
|
method: 'post',
|
|
|
|
loading: true
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-03-10 10:38:33 +08:00
|
|
|
export function getChartDetails(id, panelId, data) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/view/get/' + id + '/' + panelId,
|
|
|
|
method: 'post',
|
|
|
|
loading: false,
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function save2Cache(panelId, data) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/view/save2Cache/' + panelId,
|
|
|
|
method: 'post',
|
|
|
|
loading: false,
|
|
|
|
data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resetViewCacheCallBack(viewId, panelId, callback) {
|
|
|
|
// 加载仪表板组件视图数据
|
|
|
|
resetViewCache(viewId, panelId).then(rep => {
|
|
|
|
callback(rep)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
export function resetViewCache(viewId, panelId) {
|
|
|
|
return request({
|
|
|
|
url: '/chart/view/resetViewCache/' + viewId + '/' + panelId,
|
|
|
|
method: 'post',
|
|
|
|
loading: false
|
|
|
|
})
|
|
|
|
}
|