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
9bf17f65
Commit
9bf17f65
authored
Apr 09, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
要素调整
parent
0200a1a6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
ImportModal.jsx
src/view/Manage/Element/Component/ImportModal.jsx
+11
-4
index.jsx
src/view/Manage/Element/index.jsx
+11
-2
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+6
-0
No files found.
src/view/Manage/Element/Component/ImportModal.jsx
View file @
9bf17f65
import
React
,
{
useState
}
from
'react'
;
import
{
Modal
,
Button
,
Upload
}
from
'antd'
;
import
{
Modal
,
Button
,
Upload
,
notification
}
from
'antd'
;
import
{
DownloadOutlined
,
UploadOutlined
}
from
'@ant-design/icons'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
...
...
@@ -27,7 +27,8 @@ const ImportModal = (props) => {
setFileList
([
file
]);
return
false
;
}
},
fileList
:
fileList
||
[]
};
const
handleOk
=
()
=>
{
...
...
@@ -41,9 +42,10 @@ const ImportModal = (props) => {
dispatchLatest
({
type
:
'dataassetelement.importElement'
,
payload
:
{
fileList
},
callback
:
()
=>
{
callback
:
data
=>
{
setConfirmLoading
(
false
);
onCancel
&&
onCancel
(
true
);
reset
();
onCancel
&&
onCancel
(
true
,
data
);
},
error
:
()
=>
{
setConfirmLoading
(
false
);
...
...
@@ -51,6 +53,10 @@ const ImportModal = (props) => {
})
}
const
reset
=
()
=>
{
setFileList
([]);
}
return
(
<
Modal
forceRender
...
...
@@ -60,6 +66,7 @@ const ImportModal = (props) => {
onOk=
{
handleOk
}
onCancel=
{
()
=>
{
setConfirmLoading
(
false
);
reset
();
onCancel
&&
onCancel
();
}
}
>
...
...
src/view/Manage/Element/index.jsx
View file @
9bf17f65
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Button
,
Table
,
Pagination
}
from
'antd'
;
import
{
Button
,
Table
,
Pagination
,
notification
}
from
'antd'
;
import
{
dispatchLatest
}
from
'../../../model'
;
import
ImportModal
from
'./Component/ImportModal'
;
...
...
@@ -77,11 +77,20 @@ const Element = (props) => {
})
}
const
onImportModalCancel
=
(
refresh
=
false
)
=>
{
const
onImportModalCancel
=
(
refresh
=
false
,
tip
=
''
)
=>
{
setImportModalVisible
(
false
);
if
(
refresh
)
{
setPagination
({
pageNum
:
1
,
pageSize
:
20
});
}
if
(
tip
&&
tip
!==
''
)
{
notification
.
config
({
prefixCls
:
"yy-notification"
});
notification
.
open
({
message
:
'导入提示'
,
description
:
<
span
dangerouslySetInnerHTML=
{
{
__html
:
tip
||
''
}
}
/>,
duration
:
0
,
});
}
}
return
(
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
9bf17f65
...
...
@@ -16,6 +16,12 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const
[
parameterCnNames
,
setParameterCnNames
]
=
useState
(
value
.
parameterCnNames
||
[]);
const
[
parameterValues
,
setParameterValues
]
=
useState
(
value
.
parameterValues
||
[]);
useEffect
(()
=>
{
setName
(
value
.
name
||
''
);
setParameterValues
(
value
.
parameterValues
||
[]);
setParameterCnNames
(
value
.
parameterCnNames
||
[]);
},
[
value
])
const
onNameChange
=
(
value
)
=>
{
setName
(
value
);
...
...
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