Commit 9235bcb5 by zhaochengxiang

服务导出

parent 9b5bc4b6
......@@ -160,3 +160,7 @@ export function* importConfirm(payload) {
export function* getImportLogs(payload) {
return yield call(pds.getImportLogs, payload);
}
export function* exportAll(payload) {
return yield call(pds.exportAll, payload);
}
\ No newline at end of file
import { PostJSON, GetJSON, PostFile, Post, Get, callFetchRaw } from "../util/axios"
import { PostJSON, GetJSON, PostFile, Post, Get, callFetchRawByFormData } from "../util/axios"
export function importElement(payload) {
return PostFile("/dataassetmanager/elementApi/import", payload);
......@@ -297,7 +297,7 @@ export function deleteStandardBatchMetadata(payload) {
}
export function exportIndicator(payload) {
return callFetchRaw('post', '/standard/indicator/exportData', payload)
return callFetchRawByFormData('post', '/standard/indicator/exportData', payload)
}
export function importIndicator(payload) {
......
import { GetJSON, PostJSON, callFetchRaw, PostFile } from "../util/axios"
import { GetJSON, PostJSON, callFetchRawByFormData, PostFile } from "../util/axios"
export function queryDatabase(payload) {
return GetJSON("/metadatarepo/rest/tag/getDatabaseBySystemCode", payload);
......@@ -25,7 +25,7 @@ export function getAttributes(payload) {
}
export function exportAttributes(payload) {
return callFetchRaw('post', '/metadatarepo/rest/download/exportAssetInfo', payload)
return callFetchRawByFormData('post', '/metadatarepo/rest/download/exportAssetInfo', payload)
}
export function importAttributes(payload) {
......
import { PostFile, GetJSON, PostJSON, Post, Get, GetJSONRaw, callFetchRaw } from "../util/axios"
import { PostFile, GetJSON, PostJSON, Post, Get, GetJSONRaw, callFetchRawByFormData, callFetchRaw } from "../util/axios"
import { ContextPath } from "../util";
export function refreshCatalog() {
......@@ -146,7 +146,7 @@ export function getJdbcInformation() {
}
export function subscribe(payload) {
return callFetchRaw('post', '/pdataservice/pdsSub/subscribeMsg', payload);
return callFetchRawByFormData('post', '/pdataservice/pdsSub/subscribeMsg', payload);
}
export function addImportWithConfirm(payload) {
......@@ -160,3 +160,7 @@ export function importConfirm(payload) {
export function getImportLogs(payload) {
return GetJSON("/pdataservice/pdsCURD/log", payload);
}
export function exportAll(payload) {
return callFetchRaw('post', '/pdataservice/pdsCURD/export/all', payload)
}
\ No newline at end of file
......@@ -207,17 +207,37 @@ export function PostFile(url, payload) {
)
}
let config = {
export const callFetchRaw = (method, url, options) => {
const { params, ...reqConfig } = options;
const config = {
baseURL,
headers: {
'Content-Type': 'multipart/form-data',
},
timeout: 300000,
cache: 'no-cache',
}
const templateType = getTemplateType();
return axios.request({
method,
url,
...config,
...options
})
}
export const callFetchRaw = (method, url, options) => {
export const callFetchRawByFormData = (method, url, options) => {
const { params, ...reqConfig } = options;
const config = {
baseURL,
timeout: 300000,
headers: {
'Content-Type': 'multipart/form-data',
},
cache: 'no-cache',
}
const templateType = getTemplateType();
var bodyFormData = new FormData();
......
......@@ -25,6 +25,7 @@ import StartAuthorize from './Component/StartAuthorize';
import StartRelease from './Component/StartRelease';
import Offline from './Component/Offline';
import ImportServices from './Component/ImportServices';
import download from '../../../util/download';
import './index.less';
......@@ -359,7 +360,20 @@ class Model extends React.Component {
title: '提示',
content: '是否确认导表格中所有数据?',
onOk: () => {
window.open(`/api/pdataservice/pdsCURD/export/all?pdsDataServiceCatalogId=${catalogId}&namespace=${this.props.app?.env?.domainId}&isExcludeOtherOwner=${this.props.isOnlyEnding}`);
dispatch({
type: 'pds.exportAll',
payload: {
responseType: 'blob',
params: {
pdsDataServiceCatalogId: catalogId,
namespace: this.props.app?.env?.domainId,
isExcludeOtherOwner: this.props.isOnlyEnding
}
},
callback: (res) => {
download(res)
}
})
},
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment