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
29177075
Commit
29177075
authored
May 27, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix
parent
c7b11490
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
25 deletions
+74
-25
export-ddl.jsx
src/view/Manage/Model/Component/export-ddl.jsx
+74
-25
No files found.
src/view/Manage/Model/Component/export-ddl.jsx
View file @
29177075
...
@@ -89,7 +89,7 @@ const FC = (props) => {
...
@@ -89,7 +89,7 @@ const FC = (props) => {
<
Modal
<
Modal
visible=
{
visible
}
visible=
{
visible
}
footer=
{
footer
}
footer=
{
footer
}
width=
'
8
0%'
width=
'
9
0%'
bodyStyle=
{
{
padding
:
'15px'
,
height
:
'80vh'
,
overflow
:
'auto'
}
}
bodyStyle=
{
{
padding
:
'15px'
,
height
:
'80vh'
,
overflow
:
'auto'
}
}
title=
'DDL导出详情'
title=
'DDL导出详情'
centered
destroyOnClose
centered
destroyOnClose
...
@@ -107,6 +107,8 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
...
@@ -107,6 +107,8 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
const
[
data
,
setData
]
=
React
.
useState
()
const
[
data
,
setData
]
=
React
.
useState
()
const
[
configs
,
setConfigs
]
=
React
.
useState
()
const
[
configs
,
setConfigs
]
=
React
.
useState
()
const
[
currentConfig
,
setConfig
]
=
React
.
useState
()
const
[
currentConfig
,
setConfig
]
=
React
.
useState
()
const
[
loadingDDLGenerators
,
setLoadingDDLGenerators
]
=
React
.
useState
(
false
)
const
[
ddlGenerators
,
setDDLGenerators
]
=
React
.
useState
()
React
.
useImperativeHandle
(
ref
,
()
=>
({
React
.
useImperativeHandle
(
ref
,
()
=>
({
configs
,
configs
,
...
@@ -119,6 +121,10 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
...
@@ -119,6 +121,10 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
},
[
ids
])
},
[
ids
])
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
getDDLGenerators
()
},
[])
React
.
useEffect
(()
=>
{
let
ddlFilter
=
{}
let
ddlFilter
=
{}
for
(
const
key
in
ddlFilterInfo
)
{
for
(
const
key
in
ddlFilterInfo
)
{
for
(
const
_key
in
ddlFilterInfo
[
key
])
{
for
(
const
_key
in
ddlFilterInfo
[
key
])
{
...
@@ -159,10 +165,24 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
...
@@ -159,10 +165,24 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
})
})
}
}
const
getDDLGenerators
=
(
needDB
=
false
)
=>
{
setLoadingDDLGenerators
(
true
)
dispatch
({
type
:
'datamodel.ddlGenerators'
,
callback
:
data
=>
{
setLoadingDDLGenerators
(
false
)
setDDLGenerators
(
data
)
},
error
:
()
=>
{
setLoadingDDLGenerators
(
false
)
}
})
}
return
(
return
(
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
Row
gutter=
{
15
}
>
<
Row
gutter=
{
15
}
>
<
Col
flex=
'3
0
0px'
style=
{
{
height
:
'calc(80vh - 30px)'
,
overflow
:
'auto'
}
}
>
<
Col
flex=
'3
5
0px'
style=
{
{
height
:
'calc(80vh - 30px)'
,
overflow
:
'auto'
}
}
>
{
data
?.
map
((
item
,
index
)
=>
(
{
data
?.
map
((
item
,
index
)
=>
(
<
Row
gutter=
{
10
}
key=
{
index
}
className=
{
index
!==
0
?
'mt-2'
:
''
}
align=
'middle'
>
<
Row
gutter=
{
10
}
key=
{
index
}
className=
{
index
!==
0
?
'mt-2'
:
''
}
align=
'middle'
>
<
Col
flex=
'1'
style=
{
{
overflow
:
'hidden'
}
}
>
<
Col
flex=
'1'
style=
{
{
overflow
:
'hidden'
}
}
>
...
@@ -181,7 +201,33 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
...
@@ -181,7 +201,33 @@ const Basic = React.forwardRef(function ({ ids }, ref) {
</
Typography
.
Text
>
</
Typography
.
Text
>
</
Tooltip
>
</
Tooltip
>
</
Col
>
</
Col
>
<
Col
flex=
'80px'
>
{
item
.
dbType
}
</
Col
>
<
Col
flex=
'none'
>
<
Select
defaultValue=
{
item
.
dbType
}
style=
{
{
width
:
120
}
}
loading=
{
loadingDDLGenerators
}
onChange=
{
(
val
)
=>
{
const
index
=
(
configs
??[]).
findIndex
(
_item
=>
item
.
easyDataModelerDataModelId
===
_item
.
easyDataModelerDataModelId
)
if
(
index
!==
-
1
)
{
const
newConfig
=
{
...
configs
[
index
],
dbType
:
val
}
setConfigs
((
prev
)
=>
{
const
newConfigs
=
[...
prev
??[]]
newConfigs
.
splice
(
index
,
1
,
newConfig
)
return
newConfigs
})
if
(
configs
[
index
].
easyDataModelerDataModelId
===
currentConfig
?.
easyDataModelerDataModelId
)
{
setConfig
(
newConfig
)
}
}
}
}
>
{
ddlGenerators
?.
map
(
item
=>
(
<
Select
.
Option
key=
{
item
.
name
}
value=
{
item
.
name
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
</
Col
>
<
Col
flex=
'none'
>
<
Col
flex=
'none'
>
<
Select
defaultValue=
{
false
}
<
Select
defaultValue=
{
false
}
style=
{
{
width
:
80
}
}
style=
{
{
width
:
80
}
}
...
@@ -245,14 +291,37 @@ const DDLDetail = ({ config, setConfig }) => {
...
@@ -245,14 +291,37 @@ const DDLDetail = ({ config, setConfig }) => {
if
(
config
?.
easyDataModelerDataModelId
)
{
if
(
config
?.
easyDataModelerDataModelId
)
{
getVersions
()
getVersions
()
}
}
},
[
config
?.
alertDLL
,
config
?.
easyDataModelerDataModelId
])
},
[
config
?.
easyDataModelerDataModelId
])
React
.
useEffect
(()
=>
{
React
.
useEffect
(()
=>
{
if
((
config
?.
alertDLL
&&
config
?.
leftVersionId
&&
config
?.
rightVersionId
)
if
((
config
?.
alertDLL
&&
config
?.
leftVersionId
&&
config
?.
rightVersionId
)
||
(
!
config
?.
alertDLL
&&
config
?.
leftVersionId
))
{
||
(
!
config
?.
alertDLL
&&
config
?.
leftVersionId
))
{
getDDL
()
getDDL
()
}
}
},
[
config
?.
alertDLL
,
config
?.
leftVersionId
,
config
?.
rightVersionId
,
config
?.
ddlFilter
])
},
[
config
?.
alertDLL
,
config
?.
dbType
,
config
?.
leftVersionId
,
config
?.
rightVersionId
,
config
?.
ddlFilter
])
React
.
useEffect
(()
=>
{
if
(
config
?.
alertDLL
)
{
//增量
if
((
versions
??[]).
length
>
1
)
{
setIncVersions
((
versions
??[]).
slice
(
0
,
1
))
setConfig
?.({
...
config
,
leftVersionId
:
versions
[
1
].
id
,
rightVersionId
:
versions
[
0
].
id
,
})
}
}
else
{
//全量
if
((
versions
??[]).
length
>
0
)
{
setConfig
?.({
...
config
,
leftVersionId
:
versions
[
0
].
id
,
rightVersionId
:
null
,
})
}
}
},
[
versions
,
config
?.
alertDLL
])
const
getVersions
=
()
=>
{
const
getVersions
=
()
=>
{
setLoadingVersions
(
true
)
setLoadingVersions
(
true
)
...
@@ -278,26 +347,6 @@ const DDLDetail = ({ config, setConfig }) => {
...
@@ -278,26 +347,6 @@ const DDLDetail = ({ config, setConfig }) => {
newData
.
push
({
...
item
,
name
})
newData
.
push
({
...
item
,
name
})
}
}
setVersions
(
newData
)
setVersions
(
newData
)
if
(
config
?.
alertDLL
)
{
//增量
if
(
newData
.
length
>
1
)
{
setIncVersions
((
newData
??[]).
slice
(
0
,
1
))
setConfig
?.({
...
config
,
leftVersionId
:
newData
[
1
].
id
,
rightVersionId
:
newData
[
0
].
id
,
})
}
}
else
{
//全量
if
(
newData
.
length
>
0
)
{
setConfig
?.({
...
config
,
leftVersionId
:
newData
[
0
].
id
,
})
}
}
},
},
error
:
()
=>
{
error
:
()
=>
{
setLoadingVersions
(
false
)
setLoadingVersions
(
false
)
...
...
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