Commit 9235bcb5 by zhaochengxiang

服务导出

parent 9b5bc4b6
...@@ -159,4 +159,8 @@ export function* importConfirm(payload) { ...@@ -159,4 +159,8 @@ export function* importConfirm(payload) {
export function* getImportLogs(payload) { export function* getImportLogs(payload) {
return yield call(pds.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) { export function importElement(payload) {
return PostFile("/dataassetmanager/elementApi/import", payload); return PostFile("/dataassetmanager/elementApi/import", payload);
...@@ -297,7 +297,7 @@ export function deleteStandardBatchMetadata(payload) { ...@@ -297,7 +297,7 @@ export function deleteStandardBatchMetadata(payload) {
} }
export function exportIndicator(payload) { export function exportIndicator(payload) {
return callFetchRaw('post', '/standard/indicator/exportData', payload) return callFetchRawByFormData('post', '/standard/indicator/exportData', payload)
} }
export function importIndicator(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) { export function queryDatabase(payload) {
return GetJSON("/metadatarepo/rest/tag/getDatabaseBySystemCode", payload); return GetJSON("/metadatarepo/rest/tag/getDatabaseBySystemCode", payload);
...@@ -25,7 +25,7 @@ export function getAttributes(payload) { ...@@ -25,7 +25,7 @@ export function getAttributes(payload) {
} }
export function exportAttributes(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) { 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"; import { ContextPath } from "../util";
export function refreshCatalog() { export function refreshCatalog() {
...@@ -146,7 +146,7 @@ export function getJdbcInformation() { ...@@ -146,7 +146,7 @@ export function getJdbcInformation() {
} }
export function subscribe(payload) { export function subscribe(payload) {
return callFetchRaw('post', '/pdataservice/pdsSub/subscribeMsg', payload); return callFetchRawByFormData('post', '/pdataservice/pdsSub/subscribeMsg', payload);
} }
export function addImportWithConfirm(payload) { export function addImportWithConfirm(payload) {
...@@ -159,4 +159,8 @@ export function importConfirm(payload) { ...@@ -159,4 +159,8 @@ export function importConfirm(payload) {
export function getImportLogs(payload) { export function getImportLogs(payload) {
return GetJSON("/pdataservice/pdsCURD/log", 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) { ...@@ -207,17 +207,37 @@ export function PostFile(url, payload) {
) )
} }
let config = { export const callFetchRaw = (method, url, options) => {
baseURL, const { params, ...reqConfig } = options;
headers: {
'Content-Type': 'multipart/form-data', const config = {
}, baseURL,
cache: 'no-cache', 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 { params, ...reqConfig } = options;
const config = {
baseURL,
timeout: 300000,
headers: {
'Content-Type': 'multipart/form-data',
},
cache: 'no-cache',
}
const templateType = getTemplateType(); const templateType = getTemplateType();
var bodyFormData = new FormData(); var bodyFormData = new FormData();
......
...@@ -25,6 +25,7 @@ import StartAuthorize from './Component/StartAuthorize'; ...@@ -25,6 +25,7 @@ import StartAuthorize from './Component/StartAuthorize';
import StartRelease from './Component/StartRelease'; import StartRelease from './Component/StartRelease';
import Offline from './Component/Offline'; import Offline from './Component/Offline';
import ImportServices from './Component/ImportServices'; import ImportServices from './Component/ImportServices';
import download from '../../../util/download';
import './index.less'; import './index.less';
...@@ -359,7 +360,20 @@ class Model extends React.Component { ...@@ -359,7 +360,20 @@ class Model extends React.Component {
title: '提示', title: '提示',
content: '是否确认导表格中所有数据?', content: '是否确认导表格中所有数据?',
onOk: () => { 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