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
785d5647
Commit
785d5647
authored
Jul 09, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型模板增加数据库类型
parent
dc78860b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
54 deletions
+119
-54
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+7
-1
VersionCompareHeader.jsx
src/view/Manage/Model/Component/VersionCompareHeader.jsx
+1
-1
index.jsx
src/view/Manage/Model/index.jsx
+6
-2
TemplateAction.jsx
src/view/Manage/ModelConfig/Component/TemplateAction.jsx
+7
-0
TemplateActionHeader.jsx
...iew/Manage/ModelConfig/Component/TemplateActionHeader.jsx
+96
-49
TemplateCURD.jsx
src/view/Manage/ModelConfig/Component/TemplateCURD.jsx
+2
-1
No files found.
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
785d5647
...
@@ -706,7 +706,7 @@ const ImportActionHeader = (props) => {
...
@@ -706,7 +706,7 @@ const ImportActionHeader = (props) => {
{
{
editable
?
<
TemplateSelect
editable
?
<
TemplateSelect
modelerData=
{
modelerData
}
modelerData=
{
modelerData
}
templates=
{
templates
}
templates=
{
(
templates
??[]).
filter
(
item
=>
item
.
dbType
===
modelerData
?.
dbType
)
}
onChange=
{
onTemplateChange
}
onChange=
{
onTemplateChange
}
/>
:
<
span
className=
'word-wrap'
>
{
modelerData
?.
tableType
}
</
span
>
/>
:
<
span
className=
'word-wrap'
>
{
modelerData
?.
tableType
}
</
span
>
}
}
...
@@ -790,6 +790,12 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
...
@@ -790,6 +790,12 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
}
}
},
[
modelerData
])
},
[
modelerData
])
useEffect
(()
=>
{
if
(
modelerData
?.
dbType
&&
modelerData
?.
easyDataModelerModelingTemplate
?.
dbType
&&
modelerData
?.
dbType
!==
modelerData
?.
easyDataModelerModelingTemplate
?.
dbType
)
{
onChange
?.(
''
);
}
},
[
modelerData
])
return
(
return
(
<
span
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
<
span
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
{
{
...
...
src/view/Manage/Model/Component/VersionCompareHeader.jsx
View file @
785d5647
...
@@ -21,7 +21,7 @@ const VersionCompareHeader = (props) => {
...
@@ -21,7 +21,7 @@ const VersionCompareHeader = (props) => {
if
(
direction
===
'left'
&&
(
data
?.
left
?.
tableValue
||
[]).
length
>
index
)
{
if
(
direction
===
'left'
&&
(
data
?.
left
?.
tableValue
||
[]).
length
>
index
)
{
columnValue
=
data
?.
left
?.
tableValue
[
index
];
columnValue
=
data
?.
left
?.
tableValue
[
index
];
}
else
if
(
direction
===
'right'
&&
(
data
?.
left
?.
tableValue
||
[]).
length
>
index
)
{
}
else
if
(
direction
===
'right'
&&
(
data
?.
left
?.
tableValue
||
[]).
length
>
index
)
{
columnValue
=
data
?.
lef
t
?.
tableValue
[
index
];
columnValue
=
data
?.
righ
t
?.
tableValue
[
index
];
}
}
let
stateClassName
=
''
;
let
stateClassName
=
''
;
...
...
src/view/Manage/Model/index.jsx
View file @
785d5647
...
@@ -297,7 +297,7 @@ class ModelComponet extends React.Component {
...
@@ -297,7 +297,7 @@ class ModelComponet extends React.Component {
this.props.modal?.confirm({
this.props.modal?.confirm({
title: '提示',
title: '提示',
content: '
您确定要删除这些模型吗?
',
content: '
是否确认删除选中内容
',
onOk: () => {
onOk: () => {
dispatch({
dispatch({
type: 'datamodel.deleteDataModels',
type: 'datamodel.deleteDataModels',
...
@@ -310,7 +310,11 @@ class ModelComponet extends React.Component {
...
@@ -310,7 +310,11 @@ class ModelComponet extends React.Component {
this.onTableChange();
this.onTableChange();
this.setState({ selectModelerIds: [] });
this.setState({ selectModelerIds: [] });
if (tip) {
if (tip) {
showMessage((tip==='删除成功')?'success':'warn', tip)
if (tip === '删除成功') {
showMessage('success', '删除成功')
} else {
showMessage('warn', '存在非草稿态模型无法删除')
}
}
}
}
}
})
})
...
...
src/view/Manage/ModelConfig/Component/TemplateAction.jsx
View file @
785d5647
...
@@ -100,6 +100,8 @@ const TemplateAction = (props) => {
...
@@ -100,6 +100,8 @@ const TemplateAction = (props) => {
setTabKey
(
`
${
Number
(
tabKey
)
+
1
}
`
);
setTabKey
(
`
${
Number
(
tabKey
)
+
1
}
`
);
}
}
console
.
log
(
'templateData'
,
templateData
)
return
(
return
(
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
Tabs
activeKey=
{
tabKey
}
onChange=
{
onTabChange
}
>
<
Tabs
activeKey=
{
tabKey
}
onChange=
{
onTabChange
}
>
...
@@ -108,6 +110,11 @@ const TemplateAction = (props) => {
...
@@ -108,6 +110,11 @@ const TemplateAction = (props) => {
form=
{
form
}
form=
{
form
}
editable=
{
action
!==
'detail'
}
editable=
{
action
!==
'detail'
}
templateData=
{
templateData
||
{}
}
templateData=
{
templateData
||
{}
}
onChange=
{
(
val
)
=>
{
const
newTemplateData
=
{...
templateData
,
...
val
};
setTemplateData
(
newTemplateData
);
onChange
&&
onChange
(
newTemplateData
);
}
}
/>
/>
</
TabPane
>
</
TabPane
>
<
TabPane
<
TabPane
...
...
src/view/Manage/ModelConfig/Component/TemplateActionHeader.jsx
View file @
785d5647
import
React
from
'react'
;
import
React
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
}
from
'antd'
;
import
{
Form
,
Input
,
Row
,
Col
,
Descriptions
,
Select
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
const
{
TextArea
}
=
Input
;
const
{
TextArea
}
=
Input
;
const
TemplateActionHeader
=
(
props
)
=>
{
const
TemplateActionHeader
=
(
props
)
=>
{
const
{
editable
,
form
,
templateData
}
=
props
;
const
{
editable
,
form
,
templateData
,
onChange
}
=
props
;
const
[
loadingDbTypes
,
setLoadingDbTypes
]
=
React
.
useState
(
false
);
const
[
dbTypes
,
setDbTypes
]
=
React
.
useState
();
React
.
useEffect
(()
=>
{
getDbTypes
()
},
[])
const
getDbTypes
=
()
=>
{
setLoadingDbTypes
(
true
)
dispatch
({
type
:
'datamodel.getDbTypes'
,
callback
:
data
=>
{
setLoadingDbTypes
(
false
)
setDbTypes
(
data
)
},
error
:
()
=>
{
setLoadingDbTypes
(
false
)
}
})
}
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
labelCol
:
{
...
@@ -17,54 +40,78 @@ const TemplateActionHeader = (props) => {
...
@@ -17,54 +40,78 @@ const TemplateActionHeader = (props) => {
},
},
};
};
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
onChange
&&
onChange
(
allValues
)
}
return
(
return
(
editable
?
(
<>
<
Form
{
form=
{
form
}
editable
?
(
{
...
formItemLayout
}
<
Form
>
form=
{
form
}
<
Row
>
{
...
formItemLayout
}
<
Col
span=
{
12
}
>
onValuesChange=
{
onValuesChange
}
<
Form
.
Item
style=
{
{
overflow
:
'hidden'
}
}
label=
"中文名称"
>
name=
"cnName"
<
Row
gutter=
{
10
}
>
labelAlign=
"left"
<
Col
span=
{
12
}
>
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
<
Form
.
Item
>
label=
'数据库类型'
<
Input
/>
name=
"dbType"
</
Form
.
Item
>
rules=
{
[{
required
:
true
,
message
:
'请选择数据库类型!'
}]
}
</
Col
>
>
<
Col
span=
{
12
}
>
{
<
Form
.
Item
!
templateData
?.
id
?
<
Select
loading=
{
loadingDbTypes
}
>
label=
"英文名称"
{
dbTypes
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Select
.
Option
>)
}
name=
"name"
</
Select
>
:
<
span
className=
'word-wrap'
>
labelAlign=
"left"
{
templateData
?.
dbType
}
rules=
{
[{
required
:
true
,
message
:
'请输入英文名称!'
}]
}
</
span
>
>
}
<
Input
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
span=
{
12
}
>
</
Row
>
<
Form
.
Item
<
Row
>
label=
"中文名称"
<
Col
span=
{
12
}
>
name=
"cnName"
<
Form
.
Item
labelAlign=
"left"
label=
"描述"
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
name=
"remark"
>
labelAlign=
"left"
<
Input
/>
rules=
{
[{
required
:
true
,
message
:
'请输入描述!'
}]
}
</
Form
.
Item
>
>
</
Col
>
<
TextArea
row=
{
4
}
/>
<
Col
span=
{
12
}
>
</
Form
.
Item
>
<
Form
.
Item
</
Col
>
label=
"英文名称"
</
Row
>
name=
"name"
</
Form
>
labelAlign=
"left"
)
:
(
rules=
{
[{
required
:
true
,
message
:
'请输入英文名称!'
}]
}
<
Descriptions
column=
{
2
}
>
>
<
Descriptions
.
Item
label=
"中文名称"
>
{
templateData
.
cnName
||
''
}
</
Descriptions
.
Item
>
<
Input
/>
<
Descriptions
.
Item
label=
"英文名称"
>
{
templateData
.
name
||
''
}
</
Descriptions
.
Item
>
</
Form
.
Item
>
<
Descriptions
.
Item
label=
"描述"
>
{
templateData
.
remark
||
''
}
</
Descriptions
.
Item
>
</
Col
>
</
Descriptions
>
<
Col
span=
{
12
}
>
)
<
Form
.
Item
label=
"描述"
name=
"remark"
labelAlign=
"left"
rules=
{
[{
required
:
true
,
message
:
'请输入描述!'
}]
}
>
<
TextArea
row=
{
4
}
/>
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Form
>
)
:
(
<
Descriptions
column=
{
2
}
>
<
Descriptions
.
Item
label=
"数据库类型"
>
{
templateData
.
dbType
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"中文名称"
>
{
templateData
.
cnName
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"英文名称"
>
{
templateData
.
name
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"描述"
>
{
templateData
.
remark
||
''
}
</
Descriptions
.
Item
>
</
Descriptions
>
)
}
</>
)
)
}
}
...
...
src/view/Manage/ModelConfig/Component/TemplateCURD.jsx
View file @
785d5647
...
@@ -69,8 +69,9 @@ const TemplateCURD = (props) => {
...
@@ -69,8 +69,9 @@ const TemplateCURD = (props) => {
{
{
title
:
'更新时间'
,
title
:
'更新时间'
,
dataIndex
:
'modifiedTs'
,
dataIndex
:
'modifiedTs'
,
width
:
1
2
0
,
width
:
1
6
0
,
ellipsis
:
true
,
ellipsis
:
true
,
render
:
(
_
,
record
)
=>
record
.
modifiedTs
?
new
Date
(
record
.
modifiedTs
).
toLocaleString
()
:
''
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
...
...
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