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
c832451d
Commit
c832451d
authored
Apr 12, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddl导出样式调整
parent
ecbdb6d4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
43 deletions
+76
-43
datamodeler.js
src/service/datamodeler.js
+1
-1
ExportModal.jsx
src/view/Manage/Model/Component/ExportModal.jsx
+47
-14
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+2
-2
index.jsx
src/view/Manage/Model/index.jsx
+26
-26
No files found.
src/service/datamodeler.js
View file @
c832451d
import
{
filePost
,
Get
,
Get
JSON
,
PostJSON
,
Post
}
from
"../util/axios"
import
{
filePost
,
GetJSON
,
PostJSON
,
Post
}
from
"../util/axios"
export
function
loadDataModelCatalog
()
{
export
function
loadDataModelCatalog
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/loadDataModelCatalog"
);
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/loadDataModelCatalog"
);
...
...
src/view/Manage/Model/Component/ExportModal.jsx
View file @
c832451d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Modal
,
Radio
,
Button
,
Select
}
from
'antd'
;
import
{
Modal
,
Radio
,
Button
,
Select
,
Input
}
from
'antd'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
...
@@ -31,6 +31,8 @@ class ExportModal extends React.Component {
...
@@ -31,6 +31,8 @@ class ExportModal extends React.Component {
ddlGenerators
:
[],
ddlGenerators
:
[],
selectDDLGeneratorName
:
null
,
selectDDLGeneratorName
:
null
,
confirmLoading
:
false
,
confirmLoading
:
false
,
ddlExportSuccess
:
false
,
ddlExportString
:
''
,
}
}
}
}
...
@@ -104,8 +106,9 @@ class ExportModal extends React.Component {
...
@@ -104,8 +106,9 @@ class ExportModal extends React.Component {
},
},
callback
:
data
=>
{
callback
:
data
=>
{
this
.
setState
({
confirmLoading
:
false
},
()
=>
{
this
.
setState
({
confirmLoading
:
false
},
()
=>
{
this
.
reset
();
// this.reset();
onCancel
&&
onCancel
(
data
||
[]);
// onCancel && onCancel(data||[]);
this
.
setState
({
ddlExportSuccess
:
true
,
ddlExportString
:
data
.
join
(
'
\
n'
)
});
});
});
},
},
error
:
()
=>
{
error
:
()
=>
{
...
@@ -118,7 +121,7 @@ class ExportModal extends React.Component {
...
@@ -118,7 +121,7 @@ class ExportModal extends React.Component {
}
}
reset
=
()
=>
{
reset
=
()
=>
{
this
.
setState
({
selectedKey
:
''
,
selectDDLGeneratorName
:
''
});
this
.
setState
({
selectedKey
:
''
,
selectDDLGeneratorName
:
''
,
ddlExportSuccess
:
false
,
ddlExportString
:
''
});
}
}
onDDLGeneratorChange
=
(
value
)
=>
{
onDDLGeneratorChange
=
(
value
)
=>
{
...
@@ -127,18 +130,32 @@ class ExportModal extends React.Component {
...
@@ -127,18 +130,32 @@ class ExportModal extends React.Component {
render
()
{
render
()
{
const
{
visible
,
onCancel
}
=
this
.
props
;
const
{
visible
,
onCancel
}
=
this
.
props
;
const
{
selectedKey
,
ddlGenerators
,
loadingDDLGenerators
,
confirmLoading
,
selectDDLGeneratorName
}
=
this
.
state
;
const
{
selectedKey
,
ddlGenerators
,
loadingDDLGenerators
,
confirmLoading
,
selectDDLGeneratorName
,
ddlExportSuccess
,
ddlExportString
}
=
this
.
state
;
return
(
<
Modal
const
title
=
ddlExportSuccess
?
'ddl导出详情'
:
'导出方式'
;
visible=
{
visible
}
title=
{
"导出方式"
}
const
footer
=
ddlExportSuccess
?
([
loading=
{
confirmLoading
}
<
Button
onOk=
{
this
.
handleOk
}
key=
"0"
onCancel=
{
()
=>
{
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
}
}
>
取消
</
Button
>
])
:
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
this
.
reset
();
onCancel
&&
onCancel
();
onCancel
&&
onCancel
();
}
}
}
}
footer=
{
[
>
取消
</
Button
>,
<
Button
<
Button
key=
"0"
key=
"0"
type=
"primary"
type=
"primary"
...
@@ -146,9 +163,23 @@ class ExportModal extends React.Component {
...
@@ -146,9 +163,23 @@ class ExportModal extends React.Component {
>
>
导出
导出
</
Button
>
</
Button
>
]
}
])
return
(
<
Modal
visible=
{
visible
}
title=
{
title
}
loading=
{
confirmLoading
}
onOk=
{
this
.
handleOk
}
onCancel=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
}
}
footer=
{
footer
}
>
>
<>
<>
{
ddlExportSuccess
?
<
Input
.
TextArea
value=
{
ddlExportString
||
''
}
autoSize=
{
{
minRows
:
1
,
maxRows
:
20
}
}
></
Input
.
TextArea
>
:
<>
<
Radio
.
Group
value=
{
selectedKey
}
onChange=
{
this
.
onModeClick
}
>
<
Radio
.
Group
value=
{
selectedKey
}
onChange=
{
this
.
onModeClick
}
>
{
{
modes
&&
modes
.
map
((
mode
,
index
)
=>
{
modes
&&
modes
.
map
((
mode
,
index
)
=>
{
...
@@ -179,6 +210,8 @@ class ExportModal extends React.Component {
...
@@ -179,6 +210,8 @@ class ExportModal extends React.Component {
</
div
>
</
div
>
}
}
</>
</>
}
</>
</
Modal
>
</
Modal
>
)
)
}
}
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
c832451d
...
@@ -41,7 +41,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
...
@@ -41,7 +41,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
const
newParameterValues
=
[...(
value
.
parameterValues
||
[])];
const
newParameterValues
=
[...(
value
.
parameterValues
||
[])];
//默认为0
//默认为0
newParameterValues
[
index
]
=
parameterValue
||
0
;
newParameterValues
[
index
]
=
parameterValue
;
triggerChange
({
parameterValues
:
newParameterValues
});
triggerChange
({
parameterValues
:
newParameterValues
});
}
}
}
}
...
@@ -88,7 +88,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
...
@@ -88,7 +88,7 @@ const DatatypeInput = ({ value = {}, datatypes, onChange }) => {
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
onParameterValuesChange
(
e
,
index
);
onParameterValuesChange
(
e
,
index
);
}
}
}
}
value=
{
value
.
parameterValues
[
index
]
||
0
}
value=
{
value
.
parameterValues
[
index
]
||
''
}
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
placeholder=
'请输入一个整数'
placeholder=
'请输入一个整数'
/>
/>
...
...
src/view/Manage/Model/index.jsx
View file @
c832451d
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Row
,
Col
,
Button
,
Typography
}
from
'antd'
;
import
{
Row
,
Col
,
Button
}
from
'antd'
;
import
ModelTree
from
'./Component/ModelTree'
;
import
ModelTree
from
'./Component/ModelTree'
;
import
ModelTable
from
'./Component/ModelTable'
;
import
ModelTable
from
'./Component/ModelTable'
;
import
ImportModal
from
'./Component/ImportModal'
;
import
ImportModal
from
'./Component/ImportModal'
;
import
ExportModal
from
'./Component/ExportModal'
;
import
ExportModal
from
'./Component/ExportModal'
;
import
{
showMessage
,
showNotifaction
}
from
'../../../util'
;
import
{
showMessage
}
from
'../../../util'
;
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
}
from
'../../../model'
;
class
Model
extends
React
.
Component
{
class
Model
extends
React
.
Component
{
...
@@ -85,32 +85,32 @@ class Model extends React.Component {
...
@@ -85,32 +85,32 @@ class Model extends React.Component {
refresh
&&
this
.
onTableChange
();
refresh
&&
this
.
onTableChange
();
}
}
onExportModalCancel
=
(
ddlStrings
=
[]
)
=>
{
onExportModalCancel
=
()
=>
{
this
.
setState
({
exportModalVisible
:
false
});
this
.
setState
({
exportModalVisible
:
false
});
if
(
ddlStrings
.
length
>
0
)
{
//
if (ddlStrings.length>0) {
const
tip
=
(
//
const tip = (
<>
//
<>
{
//
{
ddlStrings
&&
ddlStrings
.
map
((
ddlString
,
index
)
=>
{
//
ddlStrings && ddlStrings.map((ddlString, index) => {
return
(
//
return (
<
Typography
.
Paragraph
//
<Typography.Paragraph
key=
{
index
}
//
key={index}
copyable=
{
{
//
copyable={{
tooltips
:
[
'复制'
,
'复制成功'
],
//
tooltips: ['复制', '复制成功'],
}
}
//
}}
>
//
>
{
ddlString
||
''
}
//
{ ddlString||'' }
</
Typography
.
Paragraph
>
//
</Typography.Paragraph>
)
//
)
})
//
})
}
//
}
</>
//
</>
);
//
);
showNotifaction
(
'ddl'
,
tip
);
//
showNotifaction('ddl', tip);
}
//
}
}
}
render
()
{
render
()
{
...
...
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