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
573cedac
Commit
573cedac
authored
Aug 23, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🉑
可取消编辑模型
parent
e53e80b1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+28
-9
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+2
-2
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
573cedac
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Form
,
Button
}
from
'antd'
;
import
{
Form
,
Button
,
Space
}
from
'antd'
;
import
ImportAction
from
'./ImportAction'
;
import
ImportAction
from
'./ImportAction'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
...
@@ -8,7 +8,7 @@ import { Action, CatalogId, ModelerId, Hints, ModelerData } from '../../../../ut
...
@@ -8,7 +8,7 @@ import { Action, CatalogId, ModelerId, Hints, ModelerData } from '../../../../ut
const
EditModel
=
(
props
)
=>
{
const
EditModel
=
(
props
)
=>
{
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[],
roughModelerData
:
{}
});
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[],
roughModelerData
:
null
});
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
terms
,
setTerms
]
=
useState
([]);
const
[
terms
,
setTerms
]
=
useState
([]);
...
@@ -30,7 +30,7 @@ const EditModel = (props) => {
...
@@ -30,7 +30,7 @@ const EditModel = (props) => {
_hints
=
_hintsStr
.
split
(
','
);
_hints
=
_hintsStr
.
split
(
','
);
}
}
let
_roughModelerData
=
{}
;
let
_roughModelerData
=
null
;
if
((
_modelerDataStr
||
''
)
!==
''
)
{
if
((
_modelerDataStr
||
''
)
!==
''
)
{
_roughModelerData
=
JSON
.
parse
(
_modelerDataStr
);
_roughModelerData
=
JSON
.
parse
(
_modelerDataStr
);
}
}
...
@@ -93,6 +93,10 @@ const EditModel = (props) => {
...
@@ -93,6 +93,10 @@ const EditModel = (props) => {
setActionData
({
...
actionData
,
action
:
'edit'
});
setActionData
({
...
actionData
,
action
:
'edit'
});
}
}
const
cancelEdit
=
()
=>
{
setActionData
({
...
actionData
,
action
:
'detail'
});
}
const
onActionChange
=
(
data
)
=>
{
const
onActionChange
=
(
data
)
=>
{
setModelerData
(
data
);
setModelerData
(
data
);
}
}
...
@@ -106,10 +110,10 @@ const EditModel = (props) => {
...
@@ -106,10 +110,10 @@ const EditModel = (props) => {
title
=
'模型详情'
;
title
=
'模型详情'
;
}
}
let
actionBtn
=
null
;
let
action
s
Btn
=
null
;
if
(
action
===
'add'
||
action
===
'edit'
)
{
if
(
action
===
'add'
)
{
actionBtn
=
(
action
s
Btn
=
(
<
Button
<
Button
type=
'primary'
type=
'primary'
onClick=
{
save
}
onClick=
{
save
}
...
@@ -118,12 +122,27 @@ const EditModel = (props) => {
...
@@ -118,12 +122,27 @@ const EditModel = (props) => {
保存
保存
</
Button
>
</
Button
>
)
)
}
else
if
(
action
===
'detail'
)
{
}
else
if
(
action
===
'detail'
)
{
actionBtn
=
(
action
s
Btn
=
(
<
Button
type=
'primary'
onClick=
{
edit
}
>
<
Button
type=
'primary'
onClick=
{
edit
}
>
编辑
编辑
</
Button
>
</
Button
>
);
);
}
else
if
(
action
===
'edit'
)
{
actionsBtn
=
(
<
Space
>
<
Button
onClick=
{
cancelEdit
}
>
取消
</
Button
>
<
Button
type=
'primary'
onClick=
{
save
}
loading=
{
confirmLoading
}
>
保存
</
Button
>
</
Space
>
)
}
}
return
(
return
(
...
@@ -143,7 +162,7 @@ const EditModel = (props) => {
...
@@ -143,7 +162,7 @@ const EditModel = (props) => {
}
}
}
}
>
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#000'
}
}
>
{
title
}
</
span
>
<
span
style=
{
{
fontSize
:
16
,
fontWeight
:
'bold'
,
color
:
'#000'
}
}
>
{
title
}
</
span
>
{
actionBtn
}
{
action
s
Btn
}
</
div
>
</
div
>
<
div
className=
'position-absolute'
style=
{
{
top
:
64
,
width
:
'100%'
}
}
>
<
div
className=
'position-absolute'
style=
{
{
top
:
64
,
width
:
'100%'
}
}
>
<
div
className=
'position-relative'
style=
{
{
margin
:
15
}
}
>
<
div
className=
'position-relative'
style=
{
{
margin
:
15
}
}
>
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
573cedac
...
@@ -50,11 +50,11 @@ const ImportAction = (props) => {
...
@@ -50,11 +50,11 @@ const ImportAction = (props) => {
getDraftUsingDDL
((
data
.
constraints
||
[]).
length
>
0
?
data
.
constraints
[
0
]:{},
{}
,
ddl
);
getDraftUsingDDL
((
data
.
constraints
||
[]).
length
>
0
?
data
.
constraints
[
0
]:{},
{}
,
ddl
);
}
else
if
((
modelerId
||
''
)
!==
''
)
{
}
else
if
((
modelerId
||
''
)
!==
''
)
{
getCurrentDataModel
();
getCurrentDataModel
();
}
else
if
(
roughModelerData
!==
{}
)
{
}
else
if
(
roughModelerData
)
{
setLoading
(
false
);
setLoading
(
false
);
getExtraData
(
roughModelerData
);
getExtraData
(
roughModelerData
);
}
else
{
}
else
{
setLoading
(
false
);
getDraft
((
data
.
constraints
||
[]).
length
>
0
?
data
.
constraints
[
0
]:{},
{}
,[]
);
}
}
}
else
if
(
action
===
'edit'
||
action
===
'detail'
)
{
}
else
if
(
action
===
'edit'
||
action
===
'detail'
)
{
getCurrentDataModel
();
getCurrentDataModel
();
...
...
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