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
4ad47ed9
Commit
4ad47ed9
authored
May 09, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持hive
parent
5732470c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
345 additions
and
119 deletions
+345
-119
datamodel.js
src/model/datamodel.js
+11
-0
datamodeler.js
src/service/datamodeler.js
+11
-0
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+3
-9
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+320
-110
No files found.
src/model/datamodel.js
View file @
4ad47ed9
...
@@ -442,4 +442,14 @@ export function* getSearchProperties() {
...
@@ -442,4 +442,14 @@ export function* getSearchProperties() {
export
function
*
searchModelBySearchProperties
(
payload
)
{
export
function
*
searchModelBySearchProperties
(
payload
)
{
return
yield
call
(
datamodelerService
.
searchModelBySearchProperties
,
payload
)
return
yield
call
(
datamodelerService
.
searchModelBySearchProperties
,
payload
)
}
//zcx hive
export
function
*
getDbTypes
()
{
return
yield
call
(
datamodelerService
.
getDbTypes
)
}
//zcx hive
export
function
*
getHiveStoredTypes
()
{
return
yield
call
(
datamodelerService
.
getHiveStoredTypes
)
}
}
\ No newline at end of file
src/service/datamodeler.js
View file @
4ad47ed9
...
@@ -398,4 +398,14 @@ export function getSearchProperties() {
...
@@ -398,4 +398,14 @@ export function getSearchProperties() {
export
function
searchModelBySearchProperties
(
payload
)
{
export
function
searchModelBySearchProperties
(
payload
)
{
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/searchEasyDataModelerDataModelsByModelSearchProperties"
,
payload
);
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/searchEasyDataModelerDataModelsByModelSearchProperties"
,
payload
);
}
//zcx hive
export
function
getDbTypes
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getDbTypes"
)
}
//zcx hive
export
function
getHiveStoredTypes
()
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getHiveStoredTypes"
)
}
}
\ No newline at end of file
src/view/Manage/Model/Component/ImportAction.jsx
View file @
4ad47ed9
...
@@ -500,15 +500,9 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -500,15 +500,9 @@ const ImportAction = React.forwardRef((props, ref) => {
const getConsistentKeys = (newModelerData) => {
const getConsistentKeys = (newModelerData) => {
//分布键
//分布键
let newDistribution =
[]
;
let newDistribution =
{...newModelerData.distributionKey}
;
(newModelerData.easyDataModelerDistributionKey||[]).forEach((item, index) => {
newDistribution.keys = (newDistribution.keys??[]).filter(item => (newModelerData.easyDataModelerDataModelAttributes??[]).findIndex(_item => item.iid === _item.iid) !== -1)
const _index = (newModelerData.easyDataModelerDataModelAttributes||[]).findIndex(_item => item.iid === _item.iid);
if (_index !== -1) {
newDistribution.push({...newModelerData.easyDataModelerDataModelAttributes[_index]});
}
})
//主键
//主键
let newPrimary = [];
let newPrimary = [];
...
@@ -573,7 +567,7 @@ const ImportAction = React.forwardRef((props, ref) => {
...
@@ -573,7 +567,7 @@ const ImportAction = React.forwardRef((props, ref) => {
newEasyDataModelerIndices = newEasyDataModelerIndices.filter(item => (item.indexedEasyDataModelAttributes||[]).length > 0);
newEasyDataModelerIndices = newEasyDataModelerIndices.filter(item => (item.indexedEasyDataModelAttributes||[]).length > 0);
return { partition: newPartition,
easyDataModelerD
istributionKey: newDistribution, easyDataModelerPrimaryKey: newPrimary, easyDataModelerIndices: newEasyDataModelerIndices, easyDataModelerSemiPrimaryKey: newSemiPrimary};
return { partition: newPartition,
d
istributionKey: newDistribution, easyDataModelerPrimaryKey: newPrimary, easyDataModelerIndices: newEasyDataModelerIndices, easyDataModelerSemiPrimaryKey: newSemiPrimary};
}
}
return (
return (
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
4ad47ed9
import
React
,
{
useState
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useMemo
,
useRef
}
from
'react'
;
import
{
Form
,
Input
,
Row
,
Col
,
Select
,
AutoComplete
,
Button
,
Divider
,
Tooltip
,
Checkbox
,
Space
}
from
'antd'
;
import
{
Form
,
Input
,
Row
,
Col
,
Select
,
AutoComplete
,
Button
,
Divider
,
Tooltip
,
Checkbox
,
Space
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
,
ExclamationCircleFilled
,
WarningFilled
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
UpOutlined
,
ExclamationCircleFilled
,
WarningFilled
,
MinusCircleOutlined
,
PlusOutlined
}
from
'@ant-design/icons'
;
import
{
Subject
}
from
'rxjs'
;
import
{
Subject
}
from
'rxjs'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
...
@@ -53,7 +53,11 @@ const ImportActionHeader = (props) => {
...
@@ -53,7 +53,11 @@ const ImportActionHeader = (props) => {
const
[
options
,
setOptions
]
=
useState
([]);
const
[
options
,
setOptions
]
=
useState
([]);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
autoTranslate
,
setAutoTranslate
]
=
useState
(
false
);
const
[
loadingDbTypes
,
setLoadingDbTypes
]
=
useState
(
false
);
const
[
dbTypes
,
setDbTypes
]
=
useState
();
const
[
dataTypeList
,
setDataTypeList
]
=
useState
(
null
);
const
[
dataTypeList
,
setDataTypeList
]
=
useState
(
null
);
const
[
loadingHiveStoredTypes
,
setLoadingHiveStoredTypes
]
=
useState
(
false
);
const
[
hiveStoredTypes
,
setHiveStoredTypes
]
=
useState
();
const
[
bindingLoadRangeList
,
setBindingLoadRangeList
]
=
useState
(
null
);
const
[
bindingLoadRangeList
,
setBindingLoadRangeList
]
=
useState
(
null
);
const
[
isCollapse
,
setCollapse
]
=
useState
(
true
)
const
[
isCollapse
,
setCollapse
]
=
useState
(
true
)
const
[
ruleParams
,
setRuleParams
]
=
useState
({
const
[
ruleParams
,
setRuleParams
]
=
useState
({
...
@@ -62,6 +66,8 @@ const ImportActionHeader = (props) => {
...
@@ -62,6 +66,8 @@ const ImportActionHeader = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
getDataTypeList
();
getDataTypeList
();
getDbTypes
();
getHiveStoredTypes
();
},
[])
},
[])
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -82,22 +88,14 @@ const ImportActionHeader = (props) => {
...
@@ -82,22 +88,14 @@ const ImportActionHeader = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
modelerData
])
},
[
modelerData
])
//分布
//分布
键
const
distributionDescription
=
useMemo
(()
=>
{
const
distributionDescription
=
useMemo
(()
=>
{
let
newDistributionDescription
=
''
if
(
modelerData
&&
modelerData
.
distributionKey
)
{
if
(
!
editable
&&
modelerData
)
{
return
(
modelerData
.
distributionKey
.
keys
??[]).
map
(
item
=>
item
.
name
).
toString
()
if
(
modelerData
?.
easyDataModelerDistributionKey
)
{
(
modelerData
?.
easyDataModelerDistributionKey
||
[]).
forEach
((
item
,
index
)
=>
{
if
(
index
>
0
)
{
newDistributionDescription
+=
','
;
}
newDistributionDescription
+=
item
.
name
||
''
;
});
}
}
}
return
newDistributionDescription
;
},
[
editable
,
modelerData
])
return
''
;
},
[
modelerData
])
//主键
//主键
const
primaryDescription
=
useMemo
(()
=>
{
const
primaryDescription
=
useMemo
(()
=>
{
...
@@ -150,6 +148,15 @@ const ImportActionHeader = (props) => {
...
@@ -150,6 +148,15 @@ const ImportActionHeader = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
editable
,
modelerData
])
},
[
editable
,
modelerData
])
const
hiveTableConfigPropertiesDescription
=
useMemo
(()
=>
{
let
tmp
=
[]
for
(
const
item
of
modelerData
?.
hiveTableConfigProperties
??[])
{
tmp
.
push
({[
item
.
key
]:
[
item
.
value
]})
}
return
tmp
.
join
(
';'
)
},
[
modelerData
])
const
marginBottom
=
useMemo
(()
=>
{
const
marginBottom
=
useMemo
(()
=>
{
return
editable
?
15
:
10
return
editable
?
15
:
10
},
[
editable
])
},
[
editable
])
...
@@ -174,6 +181,34 @@ const ImportActionHeader = (props) => {
...
@@ -174,6 +181,34 @@ const ImportActionHeader = (props) => {
})
})
}
}
const
getDbTypes
=
()
=>
{
setLoadingDbTypes
(
true
)
dispatch
({
type
:
'datamodel.getDbTypes'
,
callback
:
data
=>
{
setLoadingDbTypes
(
false
)
setDbTypes
(
data
)
},
error
:
()
=>
{
setLoadingDbTypes
(
false
)
}
})
}
const
getHiveStoredTypes
=
()
=>
{
setLoadingHiveStoredTypes
(
true
)
dispatch
({
type
:
'datamodel.getHiveStoredTypes'
,
callback
:
data
=>
{
setLoadingHiveStoredTypes
(
false
)
setHiveStoredTypes
(
data
)
},
error
:
()
=>
{
setLoadingHiveStoredTypes
(
false
)
}
})
}
const
getBindingLoadRangeList
=
(
dataTypeName
)
=>
{
const
getBindingLoadRangeList
=
(
dataTypeName
)
=>
{
dispatch
({
dispatch
({
type
:
'datamodel.bindingLoadRangeList'
,
type
:
'datamodel.bindingLoadRangeList'
,
...
@@ -227,6 +262,226 @@ const ImportActionHeader = (props) => {
...
@@ -227,6 +262,226 @@ const ImportActionHeader = (props) => {
}
}
}
}
const
genericTechnicalInfoComponent
=
()
=>
{
return
(
<>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"分布键"
name=
"distributionKey"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
DistributionItem
modelerData=
{
modelerData
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
distributionDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"分区键"
name=
"partition"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
PartitionSelect
modelerData=
{
modelerData
}
partitionTypes=
{
supportedPartitionTypes
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
partitionsDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"类主键"
name=
"easyDataModelerSemiPrimaryKey"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
AttributesSelect
modelerData=
{
modelerData
}
mode=
'tags'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
semiPrimaryDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"数据情况"
name=
"dataCircumstances"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'描述数据表中数据的更新频率、每日增量情况、数据量级和历史数据'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataCircumstances
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"更新时间"
name=
"dataUpdatingTiming"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
UpdateSelect
placeholder=
'描述数据表的更新时间点'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataUpdatingTiming
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"数据类型"
name=
"dataType"
tooltip=
{
dataTypeRemark
}
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
placeholder=
'请选择数据类型'
>
{
dataTypeList
?.
map
((
item
,
index
)
=>
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataType
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"绑定加载范围"
name=
"bindingLoadRange"
tooltip=
{
bindingLoadRemark
}
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
placeholder=
'请选择绑定加载范围'
>
{
bindingLoadRangeList
?.
map
((
item
,
index
)
=>
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
bindingLoadRang
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
</>
)
}
const
hiveTechnicalInfoComponent
=
()
=>
{
return
(
<>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"数据表类型"
name=
"hiveExternalTable"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
>
<
Select
.
Option
value=
{
false
}
>
内部表
</
Select
.
Option
>
<
Select
.
Option
value=
{
true
}
>
外部表
</
Select
.
Option
>
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveExternalTable
?
'外部表'
:
'内部表'
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"生命周期"
name=
"hiveLifeCycle"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'默认永久保存'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveLifeCycle
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"存储类型"
name=
"hiveStoredType"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
loading=
{
loadingHiveStoredTypes
}
>
{
hiveStoredTypes
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Select
.
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveStoredType
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"存储地址"
name=
"hvieStoredLocation"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'请填写存储地址'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hvieStoredLocation
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"字段分隔符"
name=
"hiveFieldsTerminated"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'请填写字段分隔符'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveFieldsTerminated
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
'自定义参数'
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Form
.
List
name=
"hiveTableConfigProperties"
>
{
(
fields
,
{
add
,
remove
})
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
<
Space
key=
{
key
}
style=
{
{
display
:
'flex'
,
marginBottom
:
0
,
}
}
align=
"baseline"
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'key'
]
}
style=
{
{
marginBottom
}
}
rules=
{
[
{
required
:
true
,
message
:
'请输入key值'
,
},
]
}
>
<
Input
placeholder=
"请输入key值"
/>
</
Form
.
Item
>
<
Form
.
Item
{
...
restField
}
name=
{
[
name
,
'value'
]
}
style=
{
{
marginBottom
}
}
rules=
{
[
{
required
:
true
,
message
:
'请输入value值'
,
},
]
}
>
<
Input
placeholder=
"请输入value值"
/>
</
Form
.
Item
>
<
MinusCircleOutlined
onClick=
{
()
=>
remove
(
name
)
}
/>
</
Space
>
))
}
<
Form
.
Item
style=
{
{
marginBottom
}
}
>
<
Button
type=
"dashed"
onClick=
{
()
=>
add
()
}
block
icon=
{
<
PlusOutlined
/>
}
>
新增参数
</
Button
>
</
Form
.
Item
>
</>
)
}
</
Form
.
List
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
hiveTableConfigPropertiesDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
</>
)
}
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
const
onValuesChange
=
(
changedValues
,
allValues
)
=>
{
if
(
changedValues
.
hasOwnProperty
(
'tableType'
))
return
;
if
(
changedValues
.
hasOwnProperty
(
'tableType'
))
return
;
...
@@ -272,6 +527,22 @@ const ImportActionHeader = (props) => {
...
@@ -272,6 +527,22 @@ const ImportActionHeader = (props) => {
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
'数据库类型'
name=
"dbType"
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
style=
{
{
marginBottom
}
}
>
{
!
modelerData
?.
id
?
<
Select
loading=
{
loadingDbTypes
}
>
{
dbTypes
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Select
.
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dbType
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
{
<
ItemTitle
name=
'cnName'
cnName=
'中文名称'
validateReports=
{
validateReports
}
/>
}
label=
{
<
ItemTitle
name=
'cnName'
cnName=
'中文名称'
validateReports=
{
validateReports
}
/>
}
name=
"cnName"
name=
"cnName"
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请输入中文名称!'
}]
}
...
@@ -359,9 +630,9 @@ const ImportActionHeader = (props) => {
...
@@ -359,9 +630,9 @@ const ImportActionHeader = (props) => {
</
Col
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
"
数据表
类型"
label=
"
模板
类型"
name=
"tableType"
name=
"tableType"
rules=
{
[{
required
:
true
,
message
:
'请选择
数据表
类型!'
}]
}
rules=
{
[{
required
:
true
,
message
:
'请选择
模板
类型!'
}]
}
style=
{
{
marginBottom
}
}
style=
{
{
marginBottom
}
}
>
>
{
{
...
@@ -396,97 +667,7 @@ const ImportActionHeader = (props) => {
...
@@ -396,97 +667,7 @@ const ImportActionHeader = (props) => {
onValuesChange=
{
onValuesChange
}
onValuesChange=
{
onValuesChange
}
>
>
<
Row
gutter=
{
10
}
>
<
Row
gutter=
{
10
}
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
{
modelerData
?.
dbType
===
'Hive'
?
hiveTechnicalInfoComponent
()
:
genericTechnicalInfoComponent
()
}
<
Form
.
Item
label=
"分布键"
name=
"easyDataModelerDistributionKey"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
AttributesSelect
modelerData=
{
modelerData
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
distributionDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"分区键"
name=
"partition"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
PartitionSelect
modelerData=
{
modelerData
}
partitionTypes=
{
supportedPartitionTypes
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
partitionsDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"类主键"
name=
"easyDataModelerSemiPrimaryKey"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
AttributesSelect
modelerData=
{
modelerData
}
mode=
'tags'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
semiPrimaryDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"数据情况"
name=
"dataCircumstances"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'描述数据表中数据的更新频率、每日增量情况、数据量级和历史数据'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataCircumstances
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"更新时间"
name=
"dataUpdatingTiming"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
UpdateSelect
placeholder=
'描述数据表的更新时间点'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataUpdatingTiming
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"数据类型"
name=
"dataType"
tooltip=
{
dataTypeRemark
}
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
placeholder=
'请选择数据类型'
>
{
dataTypeList
?.
map
((
item
,
index
)
=>
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataType
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"绑定加载范围"
name=
"bindingLoadRange"
tooltip=
{
bindingLoadRemark
}
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
placeholder=
'请选择绑定加载范围'
>
{
bindingLoadRangeList
?.
map
((
item
,
index
)
=>
<
Option
key=
{
index
}
value=
{
item
}
>
{
item
}
</
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
bindingLoadRang
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
</
Row
>
</
Row
>
</
Form
>
</
Form
>
}
}
...
@@ -545,7 +726,7 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
...
@@ -545,7 +726,7 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
<
span
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
<
span
style=
{
{
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
}
}
>
{
{
isCustom
?
<
InputDebounce
isCustom
?
<
InputDebounce
placeholder=
'请输入
数据表
类型'
placeholder=
'请输入
模板
类型'
allowClear
allowClear
value=
{
modelerData
?.
tableType
}
value=
{
modelerData
?.
tableType
}
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
...
@@ -557,7 +738,7 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
...
@@ -557,7 +738,7 @@ const TemplateSelect = ({ value = '', modelerData = undefined, templates = [], o
onChange
?.(
val
);
onChange
?.(
val
);
}
}
}
}
value=
{
value
||
undefined
}
value=
{
value
||
undefined
}
placeholder=
'请选择
数据表
类型'
placeholder=
'请选择
模板
类型'
allowClear
allowClear
style=
{
{
flex
:
1
}
}
style=
{
{
flex
:
1
}
}
{
...
restProps
}
{
...
restProps
}
...
@@ -646,6 +827,35 @@ const AttributesSelect = ({ value = [], modelerData, onChange, mode = 'multiple'
...
@@ -646,6 +827,35 @@ const AttributesSelect = ({ value = [], modelerData, onChange, mode = 'multiple'
);
);
}
}
const
DistributionItem
=
({
value
,
modelerData
,
onChange
,
...
restProps
})
=>
{
const
onAttributeChange
=
(
value
)
=>
{
const
newKeys
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
iid
)
!==-
1
);
triggerChange
({
keys
:
newKeys
});
}
const
triggerChange
=
(
changedValue
)
=>
{
onChange
?.({...
value
,
...
changedValue
});
}
return
(
<
Select
onChange=
{
(
val
)
=>
{
onAttributeChange
(
val
)
}
}
value=
{
(
value
?.
keys
??[]).
map
(
item
=>
item
.
iid
)
}
placeholder=
'请选择字段名称'
mode=
'multiple'
allowClear=
{
true
}
>
{
modelerData
?.
easyDataModelerDataModelAttributes
?.
map
((
attribute
,
index
)
=>
<
Option
key=
{
index
}
value=
{
attribute
.
iid
}
>
{
attribute
.
name
}
</
Option
>
)
}
</
Select
>
);
}
const
PartitionSelect
=
({
value
=
{},
modelerData
,
partitionTypes
=
[],
onChange
,
...
restProps
})
=>
{
const
PartitionSelect
=
({
value
=
{},
modelerData
,
partitionTypes
=
[],
onChange
,
...
restProps
})
=>
{
const
onPartitionTypeChange
=
(
value
)
=>
{
const
onPartitionTypeChange
=
(
value
)
=>
{
...
...
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