Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
d5978ce5
Commit
d5978ce5
authored
Oct 12, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
状态视角下新增模型问题
parent
1ecf1813
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
22 deletions
+34
-22
index.js
src/util/index.js
+14
-0
VersionHistory.jsx
src/view/Manage/Model/Component/VersionHistory.jsx
+12
-6
index.jsx
src/view/Manage/Model/index.jsx
+8
-16
No files found.
src/util/index.js
View file @
d5978ce5
...
...
@@ -298,4 +298,17 @@ export function formatVersionDate(t) {
var
mm
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
'-'
;
var
ss
=
(
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
());
return
YY
+
MM
+
DD
+
"_"
+
hh
+
mm
+
ss
;
}
export
function
formatVersionHistoryDate
(
t
)
{
if
(
t
===
null
)
return
''
;
var
date
=
new
Date
(
t
);
var
YY
=
date
.
getFullYear
()
+
'/'
;
var
MM
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'/'
;
var
DD
=
(
date
.
getDate
()
<
10
?
'0'
+
(
date
.
getDate
())
:
date
.
getDate
());
var
hh
=
(
date
.
getHours
()
<
10
?
'0'
+
date
.
getHours
()
:
date
.
getHours
())
+
':'
;
var
mm
=
(
date
.
getMinutes
()
<
10
?
'0'
+
date
.
getMinutes
()
:
date
.
getMinutes
())
+
':'
;
var
ss
=
(
date
.
getSeconds
()
<
10
?
'0'
+
date
.
getSeconds
()
:
date
.
getSeconds
());
return
YY
+
MM
+
DD
+
" "
+
hh
+
mm
+
ss
;
}
\ No newline at end of file
src/view/Manage/Model/Component/VersionHistory.jsx
View file @
d5978ce5
...
...
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import
{
Timeline
,
Spin
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
formatVersionDate
}
from
'../../../../util'
;
import
{
formatVersion
History
Date
}
from
'../../../../util'
;
import
{
Action
,
ModelerId
,
VersionId
}
from
'../../../../util/constant'
;
const
VersionHistory
=
(
props
)
=>
{
...
...
@@ -48,7 +48,6 @@ const VersionHistory = (props) => {
{
(
versions
||
[]).
map
((
version
,
index
)
=>
{
let
name
=
version
.
name
||
''
;
name
=
name
+
'_'
+
formatVersionDate
(
version
.
ts
);
if
(
index
===
0
&&
version
.
id
!==
'-1'
)
{
name
=
name
+
'(当前版本)'
;
}
...
...
@@ -56,10 +55,17 @@ const VersionHistory = (props) => {
name
=
name
+
'(当前版本)'
;
}
return
<
Timeline
.
Item
key=
{
index
}
>
<
a
onClick=
{
()
=>
{
onVersionItemClick
(
version
);
}
}
>
{
name
}
</
a
>
return
<
Timeline
.
Item
key=
{
index
}
color=
{
version
.
id
===
'-1'
?
'red'
:
'blue'
}
>
<
div
>
<
div
>
<
a
onClick=
{
()
=>
{
onVersionItemClick
(
version
);
}
}
>
{
name
}
</
a
>
</
div
>
<
div
className=
'pt-2'
>
<
span
>
{
formatVersionHistoryDate
(
version
.
ts
)
}
</
span
>
</
div
>
</
div
>
</
Timeline
.
Item
>
})
}
...
...
src/view/Manage/Model/index.jsx
View file @
d5978ce5
...
...
@@ -197,18 +197,10 @@ class Model extends React.Component {
this.setState({ constraintDetailDrawerVisible: true });
}
// setFilterData = () => {
// const { tableData, currentModelState } = this.state;
// const _filterData = (tableData||[]).filter(item => (currentModelState===''||currentModelState===item.state?.id));
// this.setState({ filterTableData: _filterData });
// }
onImportUnconditionBtnClick = () => {
const { catalogId } = this.state;
const { catalogId
, currentView
} = this.state;
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{
catalogId
||
''
}
`);
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{
(
currentView
===
'dir'
)?(
catalogId
||
''
):
''
}
`);
}
onImportExcelBtnClick = () => {
...
...
@@ -220,9 +212,9 @@ class Model extends React.Component {
}
onImportWordBtnClick = () => {
const { catalogId } = this.state;
const { catalogId
, currentView
} = this.state;
if ((catalogId||'') === '') {
if (
currentView!=='dir' ||
(catalogId||'') === '') {
showMessage('info', '请先选择模型目录');
return;
}
...
...
@@ -231,7 +223,7 @@ class Model extends React.Component {
}
onImportModelBtnClick = () => {
const { catalogId, selectModelerIds } = this.state;
const { catalogId, selectModelerIds
, currentView
} = this.state;
if ((selectModelerIds||[]).length === 0) {
showMessage('info', '请先选择一个模型');
...
...
@@ -243,7 +235,7 @@ class Model extends React.Component {
return;
}
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{
catalogId
||
''
}
&
$
{
ModelerId
}
=
$
{
selectModelerIds
[
0
]}
`);
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{
(
currentView
===
'dir'
)?(
catalogId
||
''
):
''
}
&
$
{
ModelerId
}
=
$
{
selectModelerIds
[
0
]}
`);
}
onImportDDLBtnClick = () => {
...
...
@@ -362,12 +354,12 @@ class Model extends React.Component {
}
onImportModalCancel = (hints = []) => {
const { catalogId, importModalAction } = this.state;
const { catalogId, importModalAction
, currentView
} = this.state;
this.setState({ importModalVisible: false }, () => {
if ((hints||[]).length > 0) {
setTimeout(() => {
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
$
{
importModalAction
}
&
$
{
CatalogId
}
=
$
{
catalogId
}
&
$
{
Hints
}
=
$
{
encodeURIComponent
((
hints
||
[]).
join
(
','
))}
`);
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
$
{
importModalAction
}
&
$
{
CatalogId
}
=
$
{
(
currentView
===
'dir'
)?(
catalogId
||
''
):
''
}
&
$
{
Hints
}
=
$
{
encodeURIComponent
((
hints
||
[]).
join
(
','
))}
`);
}, 1000);
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment