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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
72 deletions
+105
-72
datamodeler.js
src/service/datamodeler.js
+1
-1
ExportModal.jsx
src/view/Manage/Model/Component/ExportModal.jsx
+77
-44
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+2
-2
index.jsx
src/view/Manage/Model/index.jsx
+25
-25
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,57 +130,87 @@ class ExportModal extends React.Component {
...
@@ -127,57 +130,87 @@ 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
;
const
title
=
ddlExportSuccess
?
'ddl导出详情'
:
'导出方式'
;
const
footer
=
ddlExportSuccess
?
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
}
}
>
取消
</
Button
>
])
:
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
}
}
>
取消
</
Button
>,
<
Button
key=
"0"
type=
"primary"
onClick=
{
this
.
handleOk
}
>
导出
</
Button
>
])
return
(
return
(
<
Modal
<
Modal
visible=
{
visible
}
visible=
{
visible
}
title=
{
"导出方式"
}
title=
{
title
}
loading=
{
confirmLoading
}
loading=
{
confirmLoading
}
onOk=
{
this
.
handleOk
}
onOk=
{
this
.
handleOk
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
this
.
reset
();
this
.
reset
();
onCancel
&&
onCancel
();
onCancel
&&
onCancel
();
}
}
}
}
footer=
{
[
footer=
{
footer
}
<
Button
key=
"0"
type=
"primary"
onClick=
{
this
.
handleOk
}
>
导出
</
Button
>
]
}
>
>
<>
<>
<
Radio
.
Group
value=
{
selectedKey
}
onChange=
{
this
.
onModeClick
}
>
{
{
ddlExportSuccess
?
<
Input
.
TextArea
value=
{
ddlExportString
||
''
}
autoSize=
{
{
minRows
:
1
,
maxRows
:
20
}
}
></
Input
.
TextArea
>
:
<>
modes
&&
modes
.
map
((
mode
,
index
)
=>
{
<
Radio
.
Group
value=
{
selectedKey
}
onChange=
{
this
.
onModeClick
}
>
return
(
{
<
Radio
key=
{
mode
.
key
||
''
}
value=
{
mode
.
key
||
''
}
>
modes
&&
modes
.
map
((
mode
,
index
)
=>
{
{
mode
.
title
||
''
}
return
(
</
Radio
>
<
Radio
key=
{
mode
.
key
||
''
}
value=
{
mode
.
key
||
''
}
>
);
{
mode
.
title
||
''
}
})
</
Radio
>
}
);
</
Radio
.
Group
>
})
{
}
selectedKey
===
'ddl'
&&
<
div
className=
'd-flex mt-5'
style=
{
{
alignItems
:
'center'
}
}
>
</
Radio
.
Group
>
<
span
className=
'mr-2'
>
数据库类型:
</
span
>
{
<
Select
selectedKey
===
'ddl'
&&
<
div
className=
'd-flex mt-5'
style=
{
{
alignItems
:
'center'
}
}
>
value=
{
selectDDLGeneratorName
}
<
span
className=
'mr-2'
>
数据库类型:
</
span
>
loading=
{
loadingDDLGenerators
}
<
Select
style=
{
{
width
:
180
}
}
value=
{
selectDDLGeneratorName
}
placeholder=
'请选择数据库类型'
loading=
{
loadingDDLGenerators
}
onChange=
{
this
.
onDDLGeneratorChange
}
style=
{
{
width
:
180
}
}
>
placeholder=
'请选择数据库类型'
{
onChange=
{
this
.
onDDLGeneratorChange
}
ddlGenerators
&&
ddlGenerators
.
map
((
ddlGenerator
,
index
)
=>
{
>
return
<
Option
key=
{
index
}
value=
{
ddlGenerator
.
name
||
''
}
>
{
ddlGenerator
.
cnName
||
''
}
</
Option
>
{
})
ddlGenerators
&&
ddlGenerators
.
map
((
ddlGenerator
,
index
)
=>
{
}
return
<
Option
key=
{
index
}
value=
{
ddlGenerator
.
name
||
''
}
>
{
ddlGenerator
.
cnName
||
''
}
</
Option
>
</
Select
>
})
</
div
>
}
}
</
Select
>
</
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