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
dc2c19c6
Commit
dc2c19c6
authored
Jul 30, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
存量模型导入
parent
9fc1bcf8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
12 deletions
+29
-12
ExportDDLModal.jsx
src/view/Manage/Model/Component/ExportDDLModal.jsx
+2
-2
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+1
-1
ImportWordModal.jsx
src/view/Manage/Model/Component/ImportWordModal.jsx
+4
-3
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+4
-1
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+9
-2
index.jsx
src/view/Manage/Model/index.jsx
+9
-3
No files found.
src/view/Manage/Model/Component/ExportDDLModal.jsx
View file @
dc2c19c6
import
React
,
{
useContext
}
from
'react'
;
import
React
from
'react'
;
import
{
Modal
,
Button
,
Select
,
Input
}
from
'antd'
;
import
{
Modal
,
Button
,
Select
,
Input
}
from
'antd'
;
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
...
@@ -270,7 +270,7 @@ class ExportDDLModal extends React.Component {
...
@@ -270,7 +270,7 @@ class ExportDDLModal extends React.Component {
render
()
{
render
()
{
const
{
visible
,
onCancel
,
names
,
ids
,
reference
}
=
this
.
props
;
const
{
visible
,
onCancel
,
names
,
ids
,
reference
}
=
this
.
props
;
const
{
ddlGenerators
,
loadingDDLGenerators
,
confirmLoading
,
selectDDLGeneratorName
,
ddlExportSuccess
,
ddlExportString
,
selectModalerNameKey
,
loadingDatabases
,
loadingSchemas
,
databases
,
schemas
,
currentDatabaseId
,
currentSchemaId
,
filterDatabases
}
=
this
.
state
;
const
{
ddlGenerators
,
loadingDDLGenerators
,
confirmLoading
,
selectDDLGeneratorName
,
ddlExportSuccess
,
ddlExportString
,
selectModalerNameKey
,
loadingDatabases
,
loadingSchemas
,
schemas
,
currentDatabaseId
,
currentSchemaId
,
filterDatabases
}
=
this
.
state
;
let
title
=
''
;
let
title
=
''
;
if
(
reference
===
'exportDDL'
)
{
if
(
reference
===
'exportDDL'
)
{
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
dc2c19c6
...
@@ -216,7 +216,7 @@ const ImportActionHeader = (props) => {
...
@@ -216,7 +216,7 @@ const ImportActionHeader = (props) => {
label=
"数据表类型"
label=
"数据表类型"
name=
"easyDataModelerModelingTemplate"
name=
"easyDataModelerModelingTemplate"
labelAlign=
"left"
labelAlign=
"left"
rules=
{
[{
required
:
tru
e
,
message
:
'请选择数据表类型!'
}]
}
rules=
{
[{
required
:
fals
e
,
message
:
'请选择数据表类型!'
}]
}
>
>
<
TemplateSelect
<
TemplateSelect
templates=
{
templates
}
templates=
{
templates
}
...
...
src/view/Manage/Model/Component/ImportWordModal.jsx
View file @
dc2c19c6
...
@@ -6,7 +6,7 @@ import { dispatchLatest } from '../../../../model';
...
@@ -6,7 +6,7 @@ import { dispatchLatest } from '../../../../model';
import
{
showMessage
}
from
'../../../../util'
;
import
{
showMessage
}
from
'../../../../util'
;
const
ImportWordModal
=
(
props
)
=>
{
const
ImportWordModal
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
catalogId
}
=
props
;
const
{
onCancel
,
visible
,
catalogId
,
reference
=
''
}
=
props
;
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
fileList
,
setFileList
]
=
useState
([]);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
@@ -40,7 +40,8 @@ const ImportWordModal = (props) => {
...
@@ -40,7 +40,8 @@ const ImportWordModal = (props) => {
type
:
'datamodel.importWordGenerateModel'
,
type
:
'datamodel.importWordGenerateModel'
,
payload
:
{
payload
:
{
params
:
{
params
:
{
catalogId
catalogId
,
stateId
:
(
reference
===
'stock'
)?
''
:
'1'
},
},
fileList
fileList
},
},
...
@@ -64,7 +65,7 @@ const ImportWordModal = (props) => {
...
@@ -64,7 +65,7 @@ const ImportWordModal = (props) => {
<
Modal
<
Modal
forceRender
forceRender
visible=
{
visible
}
visible=
{
visible
}
title=
'Word导入'
title=
{
(
reference
===
''
)?
'Word导入'
:
'存量模型导入'
}
width=
{
520
}
width=
{
520
}
confirmLoading=
{
confirmLoading
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
dc2c19c6
...
@@ -97,7 +97,10 @@ const ModelTable = (props) => {
...
@@ -97,7 +97,10 @@ const ModelTable = (props) => {
})
})
}
}
{
{
record
?.
deployable
&&
<
Button
size=
'small'
onClick=
{
()
=>
{
deployAction
(
record
);
}
}
>
建表
</
Button
>
record
?.
deployable
&&
<
React
.
Fragment
>
<
Divider
type=
'vertical'
/>
<
Button
size=
'small'
onClick=
{
()
=>
{
deployAction
(
record
);
}
}
>
建表
</
Button
>
</
React
.
Fragment
>
}
}
</
Space
>
</
Space
>
)
)
...
...
src/view/Manage/Model/Component/ModelTree.jsx
View file @
dc2c19c6
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
Tooltip
,
Tree
,
Modal
,
Spin
,
Dropdown
,
Menu
}
from
"antd"
;
import
{
Tooltip
,
Tree
,
Modal
,
Spin
,
Dropdown
,
Menu
}
from
"antd"
;
import
{
PlusOutlined
,
EditOutlined
,
SyncOutlined
,
DeleteOutlined
,
UnorderedListOutlined
}
from
'@ant-design/icons'
;
import
{
PlusOutlined
,
EditOutlined
,
SyncOutlined
,
DeleteOutlined
,
UnorderedListOutlined
,
ImportOutlined
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
import
UpdateTreeItemModal
from
'./UpdateTreeItemModal'
;
import
UpdateTreeItemModal
from
'./UpdateTreeItemModal'
;
...
@@ -23,7 +23,7 @@ const viewModes = [
...
@@ -23,7 +23,7 @@ const viewModes = [
const
ModelTree
=
(
props
)
=>
{
const
ModelTree
=
(
props
)
=>
{
const
{
onSelect
,
onViewChange
,
refrence
=
''
}
=
props
;
const
{
onSelect
,
onViewChange
,
refrence
=
''
,
importStockModel
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
(
null
);
const
[
treeData
,
setTreeData
]
=
useState
(
null
);
const
[
item
,
setItem
]
=
useState
(
null
);
const
[
item
,
setItem
]
=
useState
(
null
);
...
@@ -343,6 +343,13 @@ const ModelTree = (props) => {
...
@@ -343,6 +343,13 @@ const ModelTree = (props) => {
</
Tooltip
>
</
Tooltip
>
)
)
}
}
{
viewSelectedKey
===
'dir'
&&
(
<
Tooltip
title=
"存量模型导入"
className=
'ml-4'
>
<
ImportOutlined
onClick=
{
()
=>
{
importStockModel
&&
importStockModel
()
}
}
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
</
Tooltip
>
)
}
<
Tooltip
title=
"刷新目录"
className=
'ml-4'
>
<
Tooltip
title=
"刷新目录"
className=
'ml-4'
>
<
SyncOutlined
onClick=
{
refresh
}
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
<
SyncOutlined
onClick=
{
refresh
}
style=
{
{
fontSize
:
16
,
cursor
:
'pointer'
}
}
/>
</
Tooltip
>
</
Tooltip
>
...
...
src/view/Manage/Model/index.jsx
View file @
dc2c19c6
...
@@ -28,6 +28,7 @@ class Model extends React.Component {
...
@@ -28,6 +28,7 @@ class Model extends React.Component {
constraintDetailDrawerVisible
:
false
,
constraintDetailDrawerVisible
:
false
,
importModalVisible
:
false
,
importModalVisible
:
false
,
importWordModalVisible
:
false
,
importWordModalVisible
:
false
,
importWordModalReference
:
''
,
exportDDLModalVisible
:
false
,
exportDDLModalVisible
:
false
,
recatalogModalVisible
:
false
,
recatalogModalVisible
:
false
,
catalogId
:
''
,
catalogId
:
''
,
...
@@ -196,7 +197,7 @@ class Model extends React.Component {
...
@@ -196,7 +197,7 @@ class Model extends React.Component {
return
;
return
;
}
}
this
.
setState
({
importWordModalVisible
:
true
});
this
.
setState
({
importWordModalVisible
:
true
,
importWordModalReference
:
''
});
}
}
...
@@ -361,8 +362,12 @@ class Model extends React.Component {
...
@@ -361,8 +362,12 @@ class Model extends React.Component {
}
}
}
}
importStockModel
=
()
=>
{
this
.
setState
({
importWordModalVisible
:
true
,
importWordModalReference
:
'stock'
});
}
render
()
{
render
()
{
const
{
importModalVisible
,
catalogId
,
loadingTableData
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDDrawerVisible
,
wordTemplateModalVisible
,
constraintDetailDrawerVisible
,
importWordModalVisible
,
loadingStates
,
modelStates
,
currentModelState
,
currentView
,
recatalogModalVisible
,
exportDDLModalReference
,
currentModel
}
=
this
.
state
;
const
{
importModalVisible
,
catalogId
,
loadingTableData
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDDrawerVisible
,
wordTemplateModalVisible
,
constraintDetailDrawerVisible
,
importWordModalVisible
,
loadingStates
,
modelStates
,
currentModelState
,
currentView
,
recatalogModalVisible
,
exportDDLModalReference
,
currentModel
,
importWordModalReference
}
=
this
.
state
;
const
content
=
(
const
content
=
(
<
ModelTable
<
ModelTable
...
@@ -387,7 +392,7 @@ class Model extends React.Component {
...
@@ -387,7 +392,7 @@ class Model extends React.Component {
return
(
return
(
<
div
className=
'data-model'
>
<
div
className=
'data-model'
>
<
div
className=
'left'
>
<
div
className=
'left'
>
<
ModelTree
onViewChange=
{
this
.
onViewChange
}
onSelect=
{
this
.
onTreeSelect
}
{
...
this
.
props
}
/>
<
ModelTree
onViewChange=
{
this
.
onViewChange
}
onSelect=
{
this
.
onTreeSelect
}
importStockModel=
{
this
.
importStockModel
}
{
...
this
.
props
}
/>
</
div
>
</
div
>
<
div
className=
'right'
>
<
div
className=
'right'
>
<
div
<
div
...
@@ -469,6 +474,7 @@ class Model extends React.Component {
...
@@ -469,6 +474,7 @@ class Model extends React.Component {
visible=
{
importWordModalVisible
}
visible=
{
importWordModalVisible
}
onCancel=
{
this
.
onImportWordModalCancel
}
onCancel=
{
this
.
onImportWordModalCancel
}
catalogId=
{
catalogId
}
catalogId=
{
catalogId
}
reference=
{
importWordModalReference
}
/>
/>
<
AppContext
.
Consumer
>
<
AppContext
.
Consumer
>
...
...
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