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
b0e974ed
Commit
b0e974ed
authored
May 09, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持hive
parent
4ad47ed9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
4 deletions
+77
-4
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+77
-4
No files found.
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
b0e974ed
...
@@ -97,6 +97,16 @@ const ImportActionHeader = (props) => {
...
@@ -97,6 +97,16 @@ const ImportActionHeader = (props) => {
return
''
;
return
''
;
},
[
modelerData
])
},
[
modelerData
])
//分桶字段
const
distributionBucketDescription
=
useMemo
(()
=>
{
if
(
modelerData
&&
modelerData
.
distributionKey
)
{
const
keyNamesString
=
(
modelerData
.
distributionKey
.
keys
??[]).
map
(
item
=>
item
.
name
).
toString
()
return
`
${
keyNamesString
}
分桶数
${
modelerData
.
distributionKey
.
bucketCount
}
`
}
return
''
;
},
[
modelerData
])
//主键
//主键
const
primaryDescription
=
useMemo
(()
=>
{
const
primaryDescription
=
useMemo
(()
=>
{
let
newPrimaryDescription
=
''
let
newPrimaryDescription
=
''
...
@@ -151,10 +161,12 @@ const ImportActionHeader = (props) => {
...
@@ -151,10 +161,12 @@ const ImportActionHeader = (props) => {
const
hiveTableConfigPropertiesDescription
=
useMemo
(()
=>
{
const
hiveTableConfigPropertiesDescription
=
useMemo
(()
=>
{
let
tmp
=
[]
let
tmp
=
[]
for
(
const
item
of
modelerData
?.
hiveTableConfigProperties
??[])
{
for
(
const
item
of
modelerData
?.
hiveTableConfigProperties
??[])
{
tmp
.
push
({[
item
.
key
]:
[
item
.
value
]})
if
(
item
&&
item
.
key
&&
item
.
value
)
{
tmp
.
push
(
`
${
item
.
key
}
:
${
item
.
value
}
`
)
}
}
}
return
tmp
.
join
(
';'
)
return
tmp
.
toString
(
)
},
[
modelerData
])
},
[
modelerData
])
const
marginBottom
=
useMemo
(()
=>
{
const
marginBottom
=
useMemo
(()
=>
{
...
@@ -379,6 +391,17 @@ const ImportActionHeader = (props) => {
...
@@ -379,6 +391,17 @@ 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=
"分桶字段"
name=
"distributionKey"
style=
{
{
marginBottom
}
}
>
{
editable
?
<
DistributionBucketItem
modelerData=
{
modelerData
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
distributionBucketDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
<
Col
xs=
{
24
}
sm=
{
24
}
lg=
{
12
}
xl=
{
8
}
>
<
Form
.
Item
label=
"生命周期"
label=
"生命周期"
name=
"hiveLifeCycle"
name=
"hiveLifeCycle"
style=
{
{
marginBottom
}
}
style=
{
{
marginBottom
}
}
...
@@ -404,11 +427,11 @@ const ImportActionHeader = (props) => {
...
@@ -404,11 +427,11 @@ const ImportActionHeader = (props) => {
<
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=
"h
vi
eStoredLocation"
name=
"h
iv
eStoredLocation"
style=
{
{
marginBottom
}
}
style=
{
{
marginBottom
}
}
>
>
{
{
editable
?
<
Input
placeholder=
'请填写存储地址'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
h
vi
eStoredLocation
,
terms
)
}
</
span
>
editable
?
<
Input
placeholder=
'请填写存储地址'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
h
iv
eStoredLocation
,
terms
)
}
</
span
>
}
}
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
...
@@ -856,6 +879,56 @@ const DistributionItem = ({ value, modelerData, onChange, ...restProps }) => {
...
@@ -856,6 +879,56 @@ const DistributionItem = ({ value, modelerData, onChange, ...restProps }) => {
);
);
}
}
const
DistributionBucketItem
=
({
value
,
modelerData
,
onChange
,
...
restProps
})
=>
{
const
onAttributeChange
=
(
value
)
=>
{
const
newKeys
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
iid
)
!==-
1
);
triggerChange
({
keys
:
newKeys
});
}
const
onBucketChange
=
(
e
)
=>
{
const
val
=
e
.
target
.
value
;
//只允许输入数字
const
reg
=
/^
\d
+$/
;
if
(
reg
.
test
(
val
)
||
val
===
''
)
{
triggerChange
({
bucketCount
:
val
});
}
}
const
triggerChange
=
(
changedValue
)
=>
{
onChange
?.({...
value
,
...
changedValue
,
type
:
'Hive'
});
}
return
(
<
Row
>
<
Col
span=
{
12
}
>
<
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
>
</
Col
>
<
Col
span=
{
12
}
>
<
Input
onChange=
{
onBucketChange
}
value=
{
value
.
bucketCount
}
style=
{
{
width
:
'100%'
}
}
placeholder=
'分桶数'
/>
</
Col
>
</
Row
>
);
}
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