Commit c3460df2 by zhaochengxiang

服务样本数据

parent 965249bc
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="16" viewBox="0 0 124 103">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="20" viewBox="0 0 300 229">
<metadata><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c138 79.159824, 2016/09/14-01:09:01 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
......@@ -10,26 +10,23 @@
<style>
.cls-1 {
fill: #fff;
stroke: #302624;
stroke: #000;
stroke-linejoin: round;
stroke-width: 1px;
stroke-width: 8px;
fill-rule: evenodd;
filter: url(#filter);
}
</style>
<filter id="filter" x="49" y="40" width="125" height="104" filterUnits="userSpaceOnUse">
<feOffset result="offset" dx="-3.464" dy="2" in="SourceAlpha"/>
<feGaussianBlur result="blur" stdDeviation="2.449"/>
<feFlood result="flood" flood-opacity="0.32"/>
<filter id="filter" x="-2" y="37" width="305" height="229" filterUnits="userSpaceOnUse">
<feOffset result="offset" dy="1" in="SourceAlpha"/>
<feGaussianBlur result="blur" stdDeviation="4.899"/>
<feFlood result="flood" flood-opacity="0.78"/>
<feComposite result="composite" operator="in" in2="blur"/>
<feBlend result="blend" in="SourceGraphic"/>
<feFlood result="flood-2" flood-color="#fff"/>
<feComposite result="composite-2" operator="in" in2="SourceGraphic"/>
<feBlend result="blend-2" in2="blend"/>
</filter>
</defs>
<g transform="translate(-49.5 -40.5)" style="fill: #fff; filter: url(#filter)">
<path id="形状_2" data-name="形状 2" class="cls-1" d="M141.723,135.147a29.367,29.367,0,0,1-28.506-36.052L99,95.9V136H81.857V95.9L57,101.018,89.571,43,117.7,89A29.31,29.31,0,1,1,141.723,135.147ZM131.464,120.3a2.374,2.374,0,0,0,2.379,2.369h0.01a2.374,2.374,0,0,0,2.379-2.369V106.666a2.373,2.373,0,0,0-2.379-2.368h-0.01a2.373,2.373,0,0,0-2.379,2.368V120.3Zm-1.1-20.775a3.295,3.295,0,1,0,3.295-3.306A3.3,3.3,0,0,0,130.366,99.525ZM156,99.35a10.487,10.487,0,0,0-10.511-10.463H133.661v5.582a5.179,5.179,0,0,1,.763-0.062H144.6a5.133,5.133,0,1,1,0,10.265h-7.871l0,0h-0.141l2.338,3.444,1.082,1.7h0.07l8.223,12.114h7.32l-8.57-12.243A10.471,10.471,0,0,0,156,99.354v0Z" style="stroke: inherit; filter: none; fill: inherit"/>
<g transform="translate(0 -37)" style="fill: #fff; filter: url(#filter)">
<path id="形状_1" data-name="形状 1" class="cls-1" d="M203,236a76,76,0,1,1,76-76A76,76,0,0,1,203,236Zm-30.4-38.422a6.334,6.334,0,0,0,12.667,0V163.8a6.334,6.334,0,0,0-12.667,0v33.778Zm-1.689-52.356a8.023,8.023,0,1,0,8.022-8.022A8.022,8.022,0,0,0,170.911,145.222Zm64.178,0v-1.689a26.6,26.6,0,0,0-26.6-26.6H179.778c-0.142,0-.281.009-0.422,0.011v15.444a12.726,12.726,0,0,1,2.533-.255h26.178a12.667,12.667,0,0,1,0,25.334H186.481l9.869,14.355h0.385l20.621,29.556h18.577l-21.785-30.165A26.606,26.606,0,0,0,235.089,145.222ZM88,59L21,174l50-10v77h33V163l51,13Z" style="stroke: inherit; filter: none; fill: inherit"/>
</g>
<use transform="translate(-49.5 -40.5)" xlink:href="#形状_2" style="stroke: #302624; filter: none; fill: none"/>
<use transform="translate(0 -37)" xlink:href="#形状_1" style="stroke: #000; filter: none; fill: none"/>
</svg>
......@@ -73,6 +73,10 @@ export function* getDataServiceLocation(payload) {
return yield call(pds.getDataServiceLocation, payload)
}
export function* getSample(payload) {
return yield call(pds.getSample, payload)
}
export function* enableOData(payload) {
return yield call(pds.enableOData, payload)
}
......
......@@ -72,6 +72,10 @@ export function getDataServiceLocation(payload) {
return GetJSON("/pdataservice/pdsCURD/getDataServiceLocation", payload)
}
export function getSample(payload) {
return PostJSON("/pdataservice/pdsCURD/getSample", payload)
}
export function enableOData(payload) {
return Post("/pdataservice/pdsOData/enableOData", payload)
}
......
......@@ -8,6 +8,7 @@ import { useContextMenu, Menu as RcMenu, Item as RcItem } from "react-contexify"
import ResizeObserver from 'rc-resize-observer';
import ServiceDetail from './ServiceDetailModal';
import ODataConfigModal from './ODataConfigModal';
import SampleModal from './SampleModal';
import { dispatch } from '../../../../model';
import { showMessage, getQueryParam, paginate, isSzseEnv, formatDate, getDataModelerRole } from '../../../../util';
......@@ -146,6 +147,8 @@ const ModelTable = (props) => {
const [ subData, setSubData ] = useState([]);
const [ serviceDetailParams, setServiceDetailParams ] = useState({ visible: false, id: '' })
const [ oDataConfigParams, setODataConfigParams ] = useState({ visible: false, service: undefined });
const [ sampleParams, setSampleParams ] = useState({ visible: false, service: undefined });
const app = useContext(AppContext);
......@@ -705,6 +708,8 @@ const ModelTable = (props) => {
editItem(currentItem);
} else if (key === 'delete') {
deleteItem(currentItem);
} else if (key === 'sample') {
setSampleParams({visible: true, service: currentItem})
} else if (key === 'history') {
historyItem(currentItem);
} else if (key === 'copy') {
......@@ -735,6 +740,10 @@ const ModelTable = (props) => {
}
}
const onSampleClose = () => {
setSampleParams({ visible: false, service: undefined });
}
const mergedColumns = () => {
let newColumns = [...columns];
// if ((modelId||'')==='' && (view==='state'||(keyword||'')!=='')) {
......@@ -847,6 +856,9 @@ const ModelTable = (props) => {
</Tooltip>
</RcItem>
}
<RcItem id="sample" onClick={handleItemClick}>
样本数据
</RcItem>
<RcItem id="history" onClick={handleItemClick}>
历史版本
</RcItem>
......@@ -888,6 +900,8 @@ const ModelTable = (props) => {
</RcMenu>
<ServiceDetail visible={serviceDetailParams.visible} id={serviceDetailParams.id} onClose={onServiceDetailClose} />
<ODataConfigModal visible={oDataConfigParams.visible} service={oDataConfigParams.service} onCancel={onODataConfigClose} />
<SampleModal visible={sampleParams.visible} service={sampleParams.service} onCancel={onSampleClose} />
{ contextHolder }
</div>
);
......
import React, { useEffect, useState } from 'react';
import { Modal, Button, Form, Input } from 'antd';
import { dispatch } from '../../../../model';
import Table from '../../ResizeableTable';
const FC = (props) => {
const {visible, service, onCancel} = props;
const [loading, setLoading] = useState(false);
const [data, setData] = useState(undefined);
const columns = [
{
title: 'catalog_id',
dataIndex: 'catalog_id'
},
{
title: 'catalog_name',
dataIndex: 'catalog_name'
},
{
title: 'display_order',
dataIndex: 'display_order'
},
]
useEffect(() => {
if (visible) {
getSample();
}
}, [visible])
const getSample = () => {
setLoading(true)
dispatch({
type: 'pds.getSample',
payload: {
params: {
pdsDataServiceId: service?.id,
}
},
callback: data => {
setLoading(false);
setData(data?.content||[]);
},
error: () => {
setLoading(false);
}
});
}
const cancel = () => {
setLoading(false);
setData(undefined);
onCancel?.();
}
const footer = [
<Button
key="0"
onClick={() => {cancel()}}
>
取消
</Button>,
];
return (
<Modal
forceRender
visible={visible}
title={`${service?.name}的样本数据`}
width={540}
onCancel={() => {cancel()}}
footer={footer}
>
<Table
loading={loading}
rowKey={'catalog_id'}
columns={columns}
dataSource={data||[]}
size='small'
style={{ maxHeight: 300, overflow: 'auto' }}
pagination={false}
/>
</Modal>
)
}
export default FC;
\ No newline at end of file
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