Commit 39363c26 by zhaochengxiang

模型版本增加名称

parent 1915cab8
...@@ -89,9 +89,9 @@ const callback = resp => { ...@@ -89,9 +89,9 @@ const callback = resp => {
if (resp.status === 401) { if (resp.status === 401) {
showMessage('warn', 'session过期,请重新登录!'); showMessage('warn', 'session过期,请重新登录!');
//外网 //外网
window.location.href="/center-home/view/login" // window.location.href="/center-home/view/login"
//内网 //内网
// window.location.href="/api/auth/login" window.location.href="/api/auth/login"
return null; return null;
} }
else if (resp.status !== 200) { else if (resp.status !== 200) {
......
...@@ -40,8 +40,12 @@ const VersionCompare = (props) => { ...@@ -40,8 +40,12 @@ const VersionCompare = (props) => {
const newData = []; const newData = [];
(data||[]).forEach((item, index) => { (data||[]).forEach((item, index) => {
let name = formatVersionDate(item.ts); let name = item.name||'';
if (index === 0) { name = name + '_' + formatVersionDate(item.ts);
if (index === 0 && item.id !== '-1') {
name = name+'(当前版本)';
}
if (index === 1 && data[0].id === '-1') {
name = name+'(当前版本)'; name = name+'(当前版本)';
} }
...@@ -85,7 +89,7 @@ const VersionCompare = (props) => { ...@@ -85,7 +89,7 @@ const VersionCompare = (props) => {
callback: data => { callback: data => {
setLoadingCompare(false); setLoadingCompare(false);
var target = document.getElementById('container'); var target = document.getElementById('model-version-compare-container');
var converter = new showdown.Converter(); var converter = new showdown.Converter();
var html = converter.makeHtml(data||''); var html = converter.makeHtml(data||'');
...@@ -127,7 +131,7 @@ const VersionCompare = (props) => { ...@@ -127,7 +131,7 @@ const VersionCompare = (props) => {
<div className='py-3'> <div className='py-3'>
<Spin spinning={loadingCompare} > <Spin spinning={loadingCompare} >
<div id="container" style={{ }}></div> <div id="model-version-compare-container" style={{ }}></div>
</Spin> </Spin>
</div> </div>
</div> </div>
......
...@@ -52,7 +52,7 @@ class Model extends React.Component { ...@@ -52,7 +52,7 @@ class Model extends React.Component {
hints: [], hints: [],
loadingStates: false, loadingStates: false,
modelStates: [], modelStates: [],
currentModelState: '', currentModelState: '4',
currentView: '', currentView: '',
exportDDLModalReference: 'exportDDL', exportDDLModalReference: 'exportDDL',
currentModel: {}, currentModel: {},
...@@ -79,7 +79,6 @@ class Model extends React.Component { ...@@ -79,7 +79,6 @@ class Model extends React.Component {
loadingStates: false, loadingStates: false,
// modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])] // modelStates: [{ name: 'all', id: '', cnName: '所有状态' }, ...(data?.subCatalogs||[])]
modelStates: data?.subCatalogs||[], modelStates: data?.subCatalogs||[],
currentModelState: '4',
}); });
}, },
error: () => { error: () => {
...@@ -198,13 +197,13 @@ class Model extends React.Component { ...@@ -198,13 +197,13 @@ class Model extends React.Component {
this.setState({ constraintDetailDrawerVisible: true }); this.setState({ constraintDetailDrawerVisible: true });
} }
setFilterData = () => { // setFilterData = () => {
const { tableData, currentModelState } = this.state; // const { tableData, currentModelState } = this.state;
const _filterData = (tableData||[]).filter(item => (currentModelState===''||currentModelState===item.state?.id)); // const _filterData = (tableData||[]).filter(item => (currentModelState===''||currentModelState===item.state?.id));
this.setState({ filterTableData: _filterData }); // this.setState({ filterTableData: _filterData });
} // }
onImportUnconditionBtnClick = () => { onImportUnconditionBtnClick = () => {
const { catalogId } = this.state; const { catalogId } = this.state;
...@@ -589,7 +588,7 @@ class Model extends React.Component { ...@@ -589,7 +588,7 @@ class Model extends React.Component {
this.onModelStateChange(value); this.onModelStateChange(value);
}} }}
loading={loadingStates} loading={loadingStates}
value={currentModelState} value={loadingStates? '': currentModelState}
> >
{ {
(modelStates||[]).map(item => { (modelStates||[]).map(item => {
......
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