Commit e7c4693e by zhaochengxiang

模型状态增加所有状态

parent fcb5aadc
......@@ -39,20 +39,30 @@ export class App extends React.Component {
if (message === 'showDataModelDetail') {
return (
<ImportAction
modelerId={id}
action='detail'
terms={terms}
/>
<AppContext.Provider value={{
setGlobalState,
onGlobalStateChange
}}>
<ImportAction
modelerId={id}
action='detail'
terms={terms}
/>
</AppContext.Provider>
);
}
if (message === 'showAssetDetail') {
return (
<AssetDetail
id={id}
terms={terms}
/>
<AppContext.Provider value={{
setGlobalState,
onGlobalStateChange
}}>
<AssetDetail
id={id}
terms={terms}
/>
</AppContext.Provider>
);
}
......
......@@ -182,7 +182,7 @@ const AttributeRelationModal = (props) => {
<Space>
<Button onClick={() => {
reset();
onCancel && onCancel();
onCancel && onCancel();
}}>返回</Button>
{
!readOnly && <Button type="primary" onClick={ onOk } loading={ confirmLoading }>确定</Button>
......
......@@ -83,7 +83,7 @@ const ImportActionHeader = (props) => {
setAutoTranslate((modelerData.name||'')==='');
if (modelerData) {
form.setFieldsValue(modelerData);
form?.setFieldsValue(modelerData);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
......@@ -159,7 +159,7 @@ const ImportActionHeader = (props) => {
},
callback: data => {
if ((data?.translated||'') !== '') {
form.setFieldsValue({ name: data?.translated||'' });
form?.setFieldsValue({ name: data?.translated||'' });
}
onChange && onChange(changedValues, allValues);
}
......
......@@ -45,7 +45,7 @@ class Model extends React.Component {
hints: [],
loadingStates: false,
modelStates: [],
currentModelState: '4',
currentModelState: '',
currentView: '',
exportDDLModalReference: 'exportDDL',
currentModel: {},
......@@ -72,8 +72,7 @@ class Model extends React.Component {
callback: data => {
this.setState({
loadingStates: false,
// modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
modelStates: data?.subCatalogs||[],
modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
});
},
error: () => {
......@@ -93,9 +92,9 @@ class Model extends React.Component {
})
}
onTreeSelect = (key, offset) => {
onTreeSelect = (key, offset=null) => {
this.setState({ catalogId: key, keyword: '', offset }, () => {
this.setState({ catalogId: key, keyword: '', offset, currentModelState: (offset!==null)?'':this.state.currentModelState }, () => {
if (!key || key==='') {
this.setState({ tableData: [], filterTableData: [] });
} else {
......@@ -110,12 +109,18 @@ class Model extends React.Component {
this.setState({ loadingTableData: true }, () => {
if (keyword === '') {
if (currentView === 'dir') {
const params = {
easyDataModelerCatalogId: catalogId,
};
if (currentModelState !== '') {
params.stateId = currentModelState;
}
dispatchLatestHomepage({
type: 'datamodel.getCurrentDataModelCatalog',
payload: {
easyDataModelerCatalogId: catalogId,
stateId: currentModelState
},
payload: params,
callback: data => {
this.setState({ loadingTableData: false, tableData: data.easyDataModelerDataModels||[], filterTableData: data.easyDataModelerDataModels||[] });
},
......@@ -138,12 +143,18 @@ class Model extends React.Component {
})
}
} else {
const params = {
term: keyword,
};
if (currentModelState !== '') {
params.stateId = currentModelState;
}
dispatchLatestHomepage({
type: 'datamodel.searchModel',
payload: {
term: keyword,
stateId: currentModelState
},
payload: params,
callback: data => {
this.setState({ loadingTableData: false, tableData: data||[], filterTableData: data||[] });
},
......
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