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
a07a7037
Commit
a07a7037
authored
Jul 26, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增编辑模型打开一个新页面
parent
24837872
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
28 deletions
+18
-28
EditModel.jsx
src/view/Manage/Model/Component/EditModel.jsx
+9
-12
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+1
-1
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+8
-15
No files found.
src/view/Manage/Model/Component/EditModel.jsx
View file @
a07a7037
...
@@ -8,14 +8,14 @@ import { Action, CatalogId, ModelerId, Hints } from '../../../../util/constant';
...
@@ -8,14 +8,14 @@ import { Action, CatalogId, ModelerId, Hints } from '../../../../util/constant';
const
EditModel
=
(
props
)
=>
{
const
EditModel
=
(
props
)
=>
{
const
[
action
,
setAction
]
=
useState
(
''
);
const
[
actionData
,
setActionData
]
=
useState
({
action
:
''
,
catalogId
:
''
,
modelerId
:
''
,
hints
:
[]
});
const
[
catalogId
,
setCatalogId
]
=
useState
(
''
);
const
[
modelerId
,
setModelerId
]
=
useState
(
''
);
const
[
hints
,
setHints
]
=
useState
([]);
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
modelerData
,
setModelerData
]
=
useState
({});
const
[
terms
,
setTerms
]
=
useState
([]);
const
[
terms
,
setTerms
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
{
action
,
catalogId
,
modelerId
,
hints
}
=
actionData
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -29,10 +29,7 @@ const EditModel = (props) => {
...
@@ -29,10 +29,7 @@ const EditModel = (props) => {
_hints
=
_hintsStr
.
split
(
','
);
_hints
=
_hintsStr
.
split
(
','
);
}
}
setAction
(
_action
);
setActionData
({
action
:
_action
,
catalogId
:
_catalogId
,
modelerId
:
_modelerId
,
hints
:
_hints
});
setCatalogId
(
_catalogId
);
setModelerId
(
_modelerId
);
setHints
(
_hints
);
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
},
[])
...
@@ -58,12 +55,12 @@ const EditModel = (props) => {
...
@@ -58,12 +55,12 @@ const EditModel = (props) => {
easyDataModelerDataModelIds
:
data
.
id
||
''
easyDataModelerDataModelIds
:
data
.
id
||
''
}
}
},
},
callback
:
(
data
)
=>
{
callback
:
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
showMessage
(
"success"
,
(
action
===
'add'
)?
'新增模型成功'
:
'保存模型成功'
)
showMessage
(
"success"
,
(
action
===
'add'
)?
'新增模型成功'
:
'保存模型成功'
)
set
ModelerId
(
data
.
id
||
''
);
set
ActionData
({
...
actionData
,
...{
action
:
'detail'
,
modelerId
:
data
.
id
||
''
}
}
);
setAction
(
'detail'
);
},
},
error
:
()
=>
{
error
:
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
...
@@ -83,7 +80,7 @@ const EditModel = (props) => {
...
@@ -83,7 +80,7 @@ const EditModel = (props) => {
}
}
const
edit
=
()
=>
{
const
edit
=
()
=>
{
setAction
(
'edit'
);
setAction
Data
({
...
actionData
,
action
:
'edit'
}
);
}
}
const
onActionChange
=
(
data
)
=>
{
const
onActionChange
=
(
data
)
=>
{
...
...
src/view/Manage/Model/Component/ImportAction.jsx
View file @
a07a7037
...
@@ -21,7 +21,7 @@ const ImportAction = (props) => {
...
@@ -21,7 +21,7 @@ const ImportAction = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
!
action
||
(
action
===
'add'
&&
(
hints
||
[]).
length
===
0
&&
(
ddl
||
''
).
length
===
0
))
return
;
if
(
(
action
||
''
)
===
''
||
(
action
===
'add'
&&
(
hints
||
[]).
length
===
0
&&
(
ddl
||
''
).
length
===
0
))
return
;
//初始化form状态
//初始化form状态
if
(
action
===
'add'
||
action
===
'edit'
)
{
if
(
action
===
'add'
||
action
===
'edit'
)
{
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
a07a7037
...
@@ -478,25 +478,18 @@ const ImportActionTable = (props) => {
...
@@ -478,25 +478,18 @@ const ImportActionTable = (props) => {
dataIndex
:
'datatype'
,
dataIndex
:
'datatype'
,
editable
:
true
,
editable
:
true
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
datatype
,
record
,
index
)
=>
{
render
:
(
datatype
,
_
,
__
)
=>
{
if
(
datatype
)
{
if
(
datatype
)
{
return
(
let
_text
=
`名称:
${
datatype
.
name
||
''
}
`
;
<>
<
span
>
{
`名称: ${datatype.name||''}`
}
</
span
>
(
datatype
.
parameterCnNames
||
[]).
forEach
((
cnName
,
index
)
=>
{
{
(
datatype
.
parameterCnNames
||
[]).
map
((
cnName
,
index
)
=>
{
_text
+=
`
${
cnName
}
: `
+
`
${(
datatype
.
parameterValues
[
index
]?
datatype
.
parameterValues
[
index
]:
0
)}
`
;
return
(
<
div
key=
{
index
}
>
<
span
>
{
`${cnName}: `
}
</
span
>
<
span
style=
{
{
fontWeight
:
'bold'
}
}
>
{
`${(datatype.parameterValues[index]?datatype.parameterValues[index]:0)}`
}
</
span
>
</
div
>
)
})
})
}
</>
return
_text
;
)
}
}
return
''
;
return
''
;
...
...
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