Commit f50feb0c by zhaochengxiang

是否启动OData

parent 4f8c9e47
...@@ -236,6 +236,12 @@ const ModelTable = (props) => { ...@@ -236,6 +236,12 @@ const ModelTable = (props) => {
sortDirections: ['ascend', 'descend'], sortDirections: ['ascend', 'descend'],
}, },
{ {
title: '是否启动OData',
dataIndex: 'supportODataDisable',
width: 120,
render: (supportODataDisable, _, __) => supportODataDisable?'是':'否'
},
{
title: '版本号', title: '版本号',
dataIndex: 'modifiedTs', dataIndex: 'modifiedTs',
width: 170, width: 170,
......
...@@ -53,6 +53,7 @@ class Model extends React.Component { ...@@ -53,6 +53,7 @@ class Model extends React.Component {
loadingStates: false, loadingStates: false,
modelStates: [], modelStates: [],
currentModelState: props.isOnlyEnding?'4_0':'', currentModelState: props.isOnlyEnding?'4_0':'',
currentODataState: '0',
currentView: '', currentView: '',
exportDDLModalReference: 'exportDDL', exportDDLModalReference: 'exportDDL',
currentModel: {}, currentModel: {},
...@@ -130,6 +131,12 @@ class Model extends React.Component { ...@@ -130,6 +131,12 @@ class Model extends React.Component {
}) })
} }
onODataStateChange = (value) => {
this.setState({ currentODataState: value, offset: null }, () => {
this.onTableChange();
})
}
onTreeSelect = (key, offset=null) => { onTreeSelect = (key, offset=null) => {
this.setState({ catalogId: key, keyword: '', offset, currentModelState: (offset!==null)?'':this.state.currentModelState }, () => { this.setState({ catalogId: key, keyword: '', offset, currentModelState: (offset!==null)?'':this.state.currentModelState }, () => {
...@@ -142,7 +149,7 @@ class Model extends React.Component { ...@@ -142,7 +149,7 @@ class Model extends React.Component {
} }
onTableChange = () => { onTableChange = () => {
const { currentView, catalogId, keyword, currentModelState } = this.state; const { currentView, catalogId, keyword, currentModelState, currentODataState } = this.state;
this.setState({ loadingTableData: true }, () => { this.setState({ loadingTableData: true }, () => {
if (keyword === '') { if (keyword === '') {
...@@ -162,7 +169,16 @@ class Model extends React.Component { ...@@ -162,7 +169,16 @@ class Model extends React.Component {
type: 'pds.getServices', type: 'pds.getServices',
payload: params, payload: params,
callback: data => { callback: data => {
this.setState({ loadingTableData: false, tableData: data.pdsdataServices||[], filterTableData: data.pdsdataServices||[] });
const filterData = data.pdsdataServices?.filter(service => {
if (currentODataState === '0') return true;
if (currentODataState === '1') return service.supportODataDisable;
if (currentODataState === '2') return !service.supportODataDisable;
return false;
})
this.setState({ loadingTableData: false, tableData: data.pdsdataServices||[], filterTableData: filterData });
}, },
error: () => { error: () => {
this.setState({ loadingTableData: false }); this.setState({ loadingTableData: false });
...@@ -177,7 +193,15 @@ class Model extends React.Component { ...@@ -177,7 +193,15 @@ class Model extends React.Component {
isExcludeOtherOwner: !this.props.isOnlyEnding isExcludeOtherOwner: !this.props.isOnlyEnding
}, },
callback: data => { callback: data => {
this.setState({ loadingTableData: false, tableData: data.pdsdataServices||[], filterTableData: data.pdsdataServices||[] }); const filterData = data.pdsdataServices?.filter(service => {
if (currentODataState === '0') return true;
if (currentODataState === '1') return service.supportODataDisable;
if (currentODataState === '2') return !service.supportODataDisable;
return false;
})
this.setState({ loadingTableData: false, tableData: data.pdsdataServices||[], filterTableData: filterData });
}, },
error: () => { error: () => {
this.setState({ loadingTableData: false }); this.setState({ loadingTableData: false });
...@@ -200,7 +224,15 @@ class Model extends React.Component { ...@@ -200,7 +224,15 @@ class Model extends React.Component {
type: 'pds.searchService', type: 'pds.searchService',
payload: params, payload: params,
callback: data => { callback: data => {
this.setState({ loadingTableData: false, tableData: data||[], filterTableData: data||[] }); const filterData = data?.filter(service => {
if (currentODataState === '0') return true;
if (currentODataState === '1') return service.supportODataDisable;
if (currentODataState === '2') return !service.supportODataDisable;
return false;
})
this.setState({ loadingTableData: false, tableData: data||[], filterTableData: filterData });
}, },
error: () => { error: () => {
this.setState({ loadingTableData: false }); this.setState({ loadingTableData: false });
...@@ -526,7 +558,7 @@ class Model extends React.Component { ...@@ -526,7 +558,7 @@ class Model extends React.Component {
render() { render() {
const { app, isOnlyEnding } = this.props; const { app, isOnlyEnding } = this.props;
const { importModalVisible, catalogId, loadingTableData, selectModelerIds, keyword, filterTableData, selectModelerNames, exportDDLModalVisible, exportOtherModalVisible, importStockWordDrawerVisible , loadingStates, modelStates, currentModelState, currentView, recatalogModalVisible, exportDDLModalReference, currentModel, offset, historyAndVersionDrawerVisible, modelerId, startFlowModalVisible, expandTree, showDeleteTip, colSettingModalVisible, visibleColNames } = this.state; const { importModalVisible, catalogId, loadingTableData, selectModelerIds, keyword, filterTableData, selectModelerNames, exportDDLModalVisible, exportOtherModalVisible, importStockWordDrawerVisible , loadingStates, modelStates, currentModelState, currentView, recatalogModalVisible, exportDDLModalReference, currentModel, offset, historyAndVersionDrawerVisible, modelerId, startFlowModalVisible, expandTree, showDeleteTip, colSettingModalVisible, visibleColNames, currentODataState } = this.state;
const classes = classNames('data-model', { const classes = classNames('data-model', {
'data-model-collapse': !expandTree 'data-model-collapse': !expandTree
...@@ -633,6 +665,7 @@ class Model extends React.Component { ...@@ -633,6 +665,7 @@ class Model extends React.Component {
<Space> <Space>
{ {
(currentView==='dir'||keyword!=='') && <Space> (currentView==='dir'||keyword!=='') && <Space>
<span>发布状态:</span>
<Select <Select
style={{ width: 120 }} style={{ width: 120 }}
onChange={(value) => { onChange={(value) => {
...@@ -652,6 +685,20 @@ class Model extends React.Component { ...@@ -652,6 +685,20 @@ class Model extends React.Component {
</Space> </Space>
} }
<Space> <Space>
<span>OData状态</span>
<Select
style={{ width: 120 }}
onChange={(value) => {
this.onODataStateChange(value);
}}
value={currentODataState}
>
<Option value='0'>所有状态</Option>
<Option value='1'>已启动</Option>
<Option value='2'>没有启动</Option>
</Select>
</Space>
<Space>
<InputDebounce <InputDebounce
placeholder="通过服务名称全文搜索" placeholder="通过服务名称全文搜索"
allowClear allowClear
......
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