Commit f50feb0c by zhaochengxiang

是否启动OData

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