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
c957e96b
Commit
c957e96b
authored
Apr 12, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
excel复制粘贴导入
parent
498353d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
17 deletions
+70
-17
ImportExcelCopy.jsx
src/view/Manage/Model/Component/ImportExcelCopy.jsx
+36
-0
ImportModal.jsx
src/view/Manage/Model/Component/ImportModal.jsx
+34
-17
No files found.
src/view/Manage/Model/Component/ImportExcelCopy.jsx
0 → 100644
View file @
c957e96b
import
React
from
'react'
;
import
{
Input
}
from
'antd'
;
class
ImportExcelCopy
extends
React
.
Component
{
constructor
()
{
super
();
this
.
state
=
{
inputValue
:
''
};
}
onInputChange
=
(
e
)
=>
{
const
{
onChange
}
=
this
.
props
;
this
.
setState
({
inputValue
:
e
.
target
.
value
},
()
=>
{
onChange
&&
onChange
(
e
.
target
.
value
.
split
(
'
\
n'
).
filter
(
value
=>
value
!==
''
));
});
}
render
()
{
const
{
inputValue
}
=
this
.
state
;
return
(
<
Input
.
TextArea
value=
{
inputValue
||
''
}
onChange=
{
this
.
onInputChange
}
autoSize=
{
{
minRows
:
4
,
maxRows
:
20
}
}
>
</
Input
.
TextArea
>
)
}
}
export
default
ImportExcelCopy
;
\ No newline at end of file
src/view/Manage/Model/Component/ImportModal.jsx
View file @
c957e96b
...
...
@@ -3,6 +3,7 @@ import { Modal, Radio, Button, Form } from 'antd';
// import ImportLog from './ImportLog';
import
ImportExcel
from
'./ImportExcel'
;
import
ImportExcelCopy
from
'./ImportExcelCopy'
;
import
ImportMetadata
from
'./ImportMetadata'
;
import
ImportAction
from
'./ImportAction'
;
...
...
@@ -12,19 +13,20 @@ import { showMessage } from '../../../../util';
const
modes
=
[
{
title
:
'Excel导入'
,
key
:
'excel'
},
{
title
:
'Excel复制粘贴'
,
key
:
'excel-copy'
,
},
// {
// title: 'Excel复制粘贴',
// },
// {
// title: 'Erwin',
// key: 'erwin',
// },
// {
// title: '元数据输入',
// key: 'metadata',
// },
// {
// title: '数据模型输入',
// }
]
const
ImportModal
=
(
props
)
=>
{
...
...
@@ -70,7 +72,7 @@ const ImportModal = (props) => {
return
;
}
if
(
step
===
1
&&
radioValue
===
0
)
{
if
(
step
===
1
&&
radioValue
===
'excel'
)
{
if
((
excelFiles
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先选择文件上传'
);
}
else
{
...
...
@@ -91,6 +93,16 @@ const ImportModal = (props) => {
}
return
;
}
else
if
(
step
===
1
&&
radioValue
===
'excel-copy'
)
{
if
((
hints
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先从Excel文件中复制内容'
);
}
else
{
setStep
(
step
+
1
);
}
return
;
}
setStep
(
step
+
1
);
...
...
@@ -160,14 +172,22 @@ const ImportModal = (props) => {
setExcelFiles
(
files
||
[]);
}
const
onImportExcelCopyChange
=
(
data
)
=>
{
setHints
(
data
||
[]);
}
let
title
=
''
;
if
(
action
===
'add'
)
{
if
(
step
===
0
)
{
title
=
'创建方式'
;
}
else
if
(
step
===
1
&&
radioValue
===
0
)
{
}
else
if
(
step
===
1
&&
radioValue
===
'excel'
)
{
title
=
'excel导入'
;
}
else
if
(
step
===
2
&&
radioValue
===
0
)
{
}
else
if
(
step
===
1
&&
radioValue
===
'excel-copy'
)
{
title
=
'excel复制粘贴导入'
;
}
else
if
(
step
===
2
&&
radioValue
===
'excel'
)
{
title
=
'模型创建-excel导入'
;
}
else
if
(
step
===
2
&&
radioValue
===
'excel-copy'
)
{
title
=
'模型创建-excel复制粘贴导入'
;
}
}
else
if
(
action
===
'edit'
)
{
title
=
'模型编辑'
;
...
...
@@ -257,7 +277,7 @@ const ImportModal = (props) => {
{
modes
&&
modes
.
map
((
mode
,
index
)
=>
{
return
(
<
Radio
key=
{
index
}
value=
{
index
}
>
<
Radio
key=
{
index
}
value=
{
mode
.
key
||
''
}
>
{
mode
.
title
||
''
}
</
Radio
>
);
...
...
@@ -268,19 +288,16 @@ const ImportModal = (props) => {
</>
}
{
step
===
1
&&
radioValue
===
0
&&
<
ImportExcel
onChange=
{
onImportExcelChange
}
/>
}
{
step
===
1
&&
radioValue
===
1
&&
<></>
step
===
1
&&
radioValue
===
'excel'
&&
<
ImportExcel
onChange=
{
onImportExcelChange
}
/>
}
{
step
===
1
&&
radioValue
===
2
&&
<><
/>
step
===
1
&&
radioValue
===
'excel-copy'
&&
<
ImportExcelCopy
onChange=
{
onImportExcelCopyChange
}
/>
}
{
step
===
1
&&
radioValue
===
3
&&
<
ImportMetadata
/>
step
===
1
&&
radioValue
===
'erwin'
&&
<><
/>
}
{
step
===
1
&&
radioValue
===
4
&&
<><
/>
step
===
1
&&
radioValue
===
'metadata'
&&
<
ImportMetadata
/>
}
{
step
===
2
&&
<
ImportAction
hints=
{
hints
}
onChange=
{
onActionChange
}
action=
{
action
}
modelerId=
{
modelerId
}
form=
{
form
}
/>
...
...
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