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
ab3f62c9
Commit
ab3f62c9
authored
Aug 20, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hive部分属性不可编辑
parent
1feb03f1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
19 deletions
+39
-19
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+11
-11
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+25
-6
suggest.jsx
src/view/Manage/Model/Component/suggest.jsx
+3
-2
No files found.
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
ab3f62c9
...
...
@@ -434,7 +434,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
Select
allowClear
>
<
Select
.
Option
value=
{
false
}
>
内部表
</
Select
.
Option
>
<
Select
.
Option
value=
{
true
}
>
外部表
</
Select
.
Option
>
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
externalTable
?
'外部表'
:
'内部表'
,
terms
)
}
</
span
>
...
...
@@ -449,7 +449,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
HivePartitionSelect
modelerData=
{
modelerData
}
partitionTypes=
{
_pratitionTypes
}
/>
:
<
Tooltip
(
editable
&&!
modelerData
?.
deployed
)
?
<
HivePartitionSelect
modelerData=
{
modelerData
}
partitionTypes=
{
_pratitionTypes
}
/>
:
<
Tooltip
overlayClassName=
'tooltip-common'
title=
{
<
KeysDetail
value=
{
modelerData
?.
partition
?.
keys
}
/>
}
>
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
partitionsDescription
,
terms
)
}
</
span
>
...
...
@@ -482,7 +482,7 @@ const ImportActionHeader = (props) => {
]
}
>
{
editable
?
<
DistributionBucketItem
modelerData=
{
modelerData
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
distributionBucketDescription
,
terms
)
}
</
span
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
DistributionBucketItem
modelerData=
{
modelerData
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
distributionBucketDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
...
...
@@ -493,7 +493,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'默认永久保存'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveLifeCycle
,
terms
)
}
</
span
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
Input
placeholder=
'默认永久保存'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveLifeCycle
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
...
...
@@ -504,7 +504,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Select
allowClear
loading=
{
loadingHiveStoredTypes
}
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
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
>
}
...
...
@@ -517,7 +517,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'请填写存储地址'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveStoredLocation
,
terms
)
}
</
span
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
Input
placeholder=
'请填写存储地址'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveStoredLocation
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
...
...
@@ -528,14 +528,14 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
Input
placeholder=
'请填写字段分隔符'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
hiveFieldsTerminated
,
terms
)
}
</
span
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
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"
>
(
editable
&&!
modelerData
?.
deployed
)
?
<
Form
.
List
name=
"hiveTableConfigProperties"
>
{
(
fields
,
{
add
,
remove
})
=>
(
<>
{
fields
.
map
(({
key
,
name
,
...
restField
})
=>
(
...
...
@@ -675,7 +675,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
NameInput
(
editable
&&
(
modelerData
?.
dbType
!==
'Hive'
||!
modelerData
?.
deployed
))
?
<
NameInput
prefixName=
{
modelerData
?.
prefixName
}
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
name
,
terms
)
}
</
span
>
}
...
...
@@ -700,7 +700,7 @@ const ImportActionHeader = (props) => {
style=
{
{
marginBottom
}
}
>
{
editable
?
<
AttributesSelect
modelerData=
{
modelerData
}
mode=
'tags'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
primaryDescription
,
terms
)
}
</
span
>
(
editable
&&
(
modelerData
?.
dbType
!==
'Hive'
||!
modelerData
?.
deployed
))
?
<
AttributesSelect
modelerData=
{
modelerData
}
mode=
'tags'
/>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
primaryDescription
,
terms
)
}
</
span
>
}
</
Form
.
Item
>
</
Col
>
...
...
@@ -712,7 +712,7 @@ const ImportActionHeader = (props) => {
// rules={[{ required: true, message: '请输入数据库Schema!' }]}
>
{
editable
?
<
Select
allowClear
loading=
{
loadingRangeList
}
placeholder=
'描述数据表落地的数据库Schema'
>
(
editable
&&
(
modelerData
?.
dbType
!==
'Hive'
||!
modelerData
?.
deployed
))
?
<
Select
allowClear
loading=
{
loadingRangeList
}
placeholder=
'描述数据表落地的数据库Schema'
>
{
rangeList
?.
map
(
item
=>
<
Select
.
Option
key=
{
item
}
value=
{
item
}
>
{
item
}
</
Select
.
Option
>)
}
</
Select
>
:
<
span
className=
'word-wrap'
>
{
highlightSearchContentByTerms
(
modelerData
?.
dataResidence
,
terms
)
}
</
span
>
}
...
...
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
ab3f62c9
...
...
@@ -272,6 +272,7 @@ export const ImportActionTable = (props) => {
name
:
undefined
,
cnName
:
undefined
,
triggerType
:
undefined
,
hiveDeployed
:
false
,
})
const
{
attrIsEditingFunction
}
=
useContext
(
EditModelContext
);
...
...
@@ -583,8 +584,11 @@ export const ImportActionTable = (props) => {
newMenuData = [...newMenuData, ...[
{ title: '在上方插入行', key: 'up' },
{ title: '在下方插入行', key: 'down' },
{ title: '删除', key: 'delete' },
]]
if (modelerData?.dbType!=='Hive'||!currentItem?.deployed) {
newMenuData.push({ title: '删除', key: 'delete' })
}
if (originAction !== 'flow') {
newMenuData.push({
title: currentItem?.needAttention ? '取消送审关注': '送审关注',
...
...
@@ -594,7 +598,7 @@ export const ImportActionTable = (props) => {
}
return newMenuData;
}, [currentItem, action, originAction, editable])
}, [currentItem, action, originAction, editable
, modelerData
])
const isEditing = (record) => record?.iid === editingKey;
...
...
@@ -805,6 +809,7 @@ export const ImportActionTable = (props) => {
const row = await form.validateFields();
if (row.datatype) {
if ((row.datatype.name||'')==='') {
form.setFields([{ name: 'datatype', errors: ['必须选择类型'] }]);
return;
...
...
@@ -815,11 +820,13 @@ export const ImportActionTable = (props) => {
row.datatype.parameterValues[index] = 0;
}
})
}
const newData = [...data];
const index = newData.findIndex((item) => editingKey === item.iid);
if (row.name) {
//判断字段名称是否唯一
let _index;
if (index === -1) {
...
...
@@ -834,6 +841,7 @@ export const ImportActionTable = (props) => {
form.setFields([{ name: 'name', errors: ['字段名称不能重复'] }]);
return;
}
}
let attribute = {};
if (index === -1) {
...
...
@@ -909,20 +917,29 @@ export const ImportActionTable = (props) => {
};
const onSuggestChange = (record) => {
const onSuggestChange = (record
, hiveDeployed
) => {
const { notNull, partOfPrimaryKeyLogically, foreignKey, ...restRecord } = record;
if (hiveDeployed) {
const { name, datatype, ..._restRecord } = restRecord
form.setFieldsValue({
..._restRecord
});
} else {
form.setFieldsValue({
...restRecord
});
}
};
const onColumnPressEnter = (title) => {
const onColumnPressEnter = (title
, hiveDeployed
) => {
if (title === '中文名称') {
setSuggestParams({
visible: true,
name: form?.getFieldValue('name'),
cnName: form?.getFieldValue('cnName'),
triggerType: 'cnName',
hiveDeployed,
})
} else if (title === '英文名称') {
setSuggestParams({
...
...
@@ -930,6 +947,7 @@ export const ImportActionTable = (props) => {
name: form?.getFieldValue('name'),
cnName: form?.getFieldValue('cnName'),
triggerType: 'name',
hiveDeployed,
})
}
}
...
...
@@ -966,11 +984,11 @@ export const ImportActionTable = (props) => {
dataIndex: col.dataIndex,
inputType,
colTitle: col.title,
editing: isEditing(record),
editing:
((col.title==='英文名称'||col.title==='类型')&&modelerData?.dbType==='Hive'&&record?.deployed)?false:
isEditing(record),
datatypes: (supportedDatatypes??[]).filter(item => item.supportedDBTypes.indexOf(modelerData?.dbType) !== -1),
require: col.require,
onPressEnter: () => {
onColumnPressEnter(col.title)
onColumnPressEnter(col.title
, modelerData?.dbType==='Hive'&&record?.deployed
)
}
}),
};
...
...
@@ -1219,6 +1237,7 @@ export const ImportActionTable = (props) => {
name: undefined,
cnName: undefined,
triggerType: undefined,
hiveDeployed: false,
})
}}
onOk={onSuggestChange}
...
...
src/view/Manage/Model/Component/suggest.jsx
View file @
ab3f62c9
...
...
@@ -5,11 +5,12 @@ import { dispatch } from '../../../../model'
import
Table
from
'../../../../util/Component/Table'
import
{
checkMenuAdmit
,
inputWidth
,
isSzseEnv
,
showMessage
}
from
'../../../../util'
import
{
useDebounceEffect
}
from
'ahooks'
import
{
throwIfEmpty
}
from
'rxjs'
const
topN
=
20
const
FC
=
(
props
)
=>
{
const
{
visible
,
name
,
cnName
,
onCancel
,
onOk
,
triggerType
=
'cnName'
}
=
props
const
{
visible
,
name
,
cnName
,
onCancel
,
onOk
,
triggerType
=
'cnName'
,
hiveDeployed
=
false
}
=
props
const
[
loading
,
setLoading
]
=
React
.
useState
(
false
)
const
[
suggests
,
setSuggests
]
=
React
.
useState
()
const
[
selectedRows
,
setSelectedRows
]
=
React
.
useState
()
...
...
@@ -210,7 +211,7 @@ const FC = (props) => {
return
}
onOk?.(selectedRows?.[0])
onOk?.(selectedRows?.[0]
, hiveDeployed
)
close()
}
...
...
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