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
6b3d874f
Commit
6b3d874f
authored
Apr 01, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加提示
parent
a4fb5a9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
3 deletions
+46
-3
index.js
src/util/index.js
+18
-1
ImportModal.jsx
src/view/Manage/Model/Component/ImportModal.jsx
+28
-2
No files found.
src/util/index.js
View file @
6b3d874f
...
@@ -73,7 +73,7 @@ export class GetSession extends React.Component {
...
@@ -73,7 +73,7 @@ export class GetSession extends React.Component {
export
const
Assert
=
function
(
arg
,
msg
)
{
export
const
Assert
=
function
(
arg
,
msg
)
{
if
(
!
arg
)
{
if
(
!
arg
)
{
message
.
warning
(
msg
)
this
.
showMessage
(
'warn'
,
msg
);
throw
msg
throw
msg
}
}
}
}
...
@@ -96,3 +96,20 @@ export const generateUUID = function() {
...
@@ -96,3 +96,20 @@ export const generateUUID = function() {
});
});
return
uuid
;
return
uuid
;
}
}
export
const
showMessage
=
function
(
action
,
content
)
{
//https://github.com/ant-design/ant-design/issues/22269
message
.
config
({
prefixCls
:
"yy-message"
});
if
(
action
===
'success'
)
{
message
.
success
(
content
);
}
if
(
action
===
'error'
)
{
message
.
error
(
content
);
}
if
(
action
===
'info'
)
{
message
.
info
(
content
);
}
if
(
action
===
'warn'
)
{
message
.
warn
(
content
);
}
}
src/view/Manage/Model/Component/ImportModal.jsx
View file @
6b3d874f
import
React
,
{
useState
}
from
'react'
;
import
React
,
{
useState
}
from
'react'
;
import
{
Modal
,
Radio
,
Button
,
Form
}
from
'antd'
;
import
{
Modal
,
Radio
,
Button
,
Form
,
message
}
from
'antd'
;
import
ImportLog
from
'./ImportLog'
;
import
ImportLog
from
'./ImportLog'
;
import
ImportExcel
from
'./ImportExcel'
;
import
ImportExcel
from
'./ImportExcel'
;
...
@@ -7,6 +7,7 @@ import ImportMetadata from './ImportMetadata';
...
@@ -7,6 +7,7 @@ import ImportMetadata from './ImportMetadata';
import
ImportAction
from
'./ImportAction'
;
import
ImportAction
from
'./ImportAction'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
dispatchLatest
}
from
'../../../../model'
;
import
{
showMessage
}
from
'../../../../util'
;
const
modes
=
[
const
modes
=
[
{
{
...
@@ -47,15 +48,26 @@ const ImportModal = (props) => {
...
@@ -47,15 +48,26 @@ const ImportModal = (props) => {
const
next
=
()
=>
{
const
next
=
()
=>
{
if
(
step
===
0
)
{
if
(
radioValue
===
''
)
{
showMessage
(
'warn'
,
'请先选择创建方式'
);
}
else
{
setStep
(
step
+
1
);
}
return
;
}
if
(
step
===
1
&&
radioValue
===
0
)
{
if
(
step
===
1
&&
radioValue
===
0
)
{
if
((
excelFiles
||
[]).
length
===
0
)
{
if
((
excelFiles
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先选择文件上传'
);
}
else
{
}
else
{
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
dispatchLatest
({
dispatchLatest
({
type
:
'datamodel.extractExcelContent'
,
type
:
'datamodel.extractExcelContent'
,
payload
:
{
fileList
:
excelFiles
},
payload
:
{
fileList
:
excelFiles
},
callback
:
data
=>
{
callback
:
data
=>
{
setExcelFiles
([]);
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
setHints
(
data
||
[]);
setHints
(
data
||
[]);
setStep
(
step
+
1
);
setStep
(
step
+
1
);
...
@@ -92,6 +104,7 @@ const ImportModal = (props) => {
...
@@ -92,6 +104,7 @@ const ImportModal = (props) => {
},
},
callback
:
()
=>
{
callback
:
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
reset
();
onCancel
&&
onCancel
(
true
);
onCancel
&&
onCancel
(
true
);
}
}
})
})
...
@@ -104,6 +117,18 @@ const ImportModal = (props) => {
...
@@ -104,6 +117,18 @@ const ImportModal = (props) => {
}
}
const
reset
=
()
=>
{
setStep
(
0
);
setRadioValue
(
''
);
setExcelFiles
([]);
setHints
([]);
setModelerData
({});
setConfirmLoading
(
false
);
if
(
form
&&
form
.
resetFields
)
{
form
.
resetFields
();
}
}
const
onActionChange
=
(
data
)
=>
{
const
onActionChange
=
(
data
)
=>
{
setModelerData
(
data
);
setModelerData
(
data
);
}
}
...
@@ -130,6 +155,7 @@ const ImportModal = (props) => {
...
@@ -130,6 +155,7 @@ const ImportModal = (props) => {
destroyOnClose
destroyOnClose
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
setStep
(
0
);
setStep
(
0
);
reset
();
onCancel
&&
onCancel
();
onCancel
&&
onCancel
();
}
}
}
}
footer=
{
[
footer=
{
[
...
...
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