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
dc0bd3c1
Commit
dc0bd3c1
authored
Apr 09, 2021
by
fanyongjun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://132.232.112.242:7022/zcx/szse
parents
470c8348
afef2f2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
7 deletions
+34
-7
index.js
src/util/index.js
+10
-1
ImportModal.jsx
src/view/Manage/Element/Component/ImportModal.jsx
+11
-4
index.jsx
src/view/Manage/Element/index.jsx
+7
-2
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+6
-0
No files found.
src/util/index.js
View file @
dc0bd3c1
import
React
from
"react"
;
import
{
message
}
from
'antd'
;
import
{
message
,
notification
}
from
'antd'
;
import
{
Redirect
}
from
'react-router-dom'
;
import
{
dispatchLatest
,
action
}
from
'../model'
;
import
{
set_sess_state
}
from
"../model/reducer"
;
...
...
@@ -114,6 +114,15 @@ export const showMessage = function(action, content) {
}
}
export
const
showNotifaction
=
function
(
title
,
tip
)
{
notification
.
config
({
prefixCls
:
"yy-notification"
});
notification
.
open
({
message
:
title
||
'提示'
,
description
:
<
span
dangerouslySetInnerHTML
=
{{
__html
:
tip
||
''
}}
/>
,
duration
:
0
,
});
}
export
function
generateList
(
data
,
dataList
){
if
(
data
[
0
]
===
undefined
)
return
data
...
...
src/view/Manage/Element/Component/ImportModal.jsx
View file @
dc0bd3c1
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 @
dc0bd3c1
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'
;
import
{
showNotifaction
}
from
'../../../util'
;
import
'./index.less'
;
const
Element
=
(
props
)
=>
{
...
...
@@ -77,11 +78,15 @@ const Element = (props) => {
})
}
const
onImportModalCancel
=
(
refresh
=
false
)
=>
{
const
onImportModalCancel
=
(
refresh
=
false
,
tip
=
''
)
=>
{
setImportModalVisible
(
false
);
if
(
refresh
)
{
setPagination
({
pageNum
:
1
,
pageSize
:
20
});
}
if
(
tip
&&
tip
!==
''
)
{
showNotifaction
(
'导入提示'
,
tip
);
}
}
return
(
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
dc0bd3c1
...
...
@@ -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