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
fe1235c7
Commit
fe1235c7
authored
Jan 20, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字段编辑优化
parent
90483a08
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
22 deletions
+48
-22
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+23
-8
ImportActionHeader.jsx
src/view/Manage/Model/Component/ImportActionHeader.jsx
+25
-14
ImportActionIndex.jsx
src/view/Manage/Model/Component/ImportActionIndex.jsx
+0
-0
ImportActionTable.jsx
src/view/Manage/Model/Component/ImportActionTable.jsx
+0
-0
No files found.
src/view/Manage/Model/Component/ImportAction.jsx
View file @
fe1235c7
...
@@ -358,10 +358,10 @@ const ImportAction = (props) => {
...
@@ -358,10 +358,10 @@ const ImportAction = (props) => {
const
getAllNewKeysAfterTableChange
=
(
newModelerData
)
=>
{
const
getAllNewKeysAfterTableChange
=
(
newModelerData
)
=>
{
//分布键
//分布键
let
newDistribution
=
[
...(
newModelerData
.
easyDataModelerDistributionKey
||
[])
];
let
newDistribution
=
[];
(
new
Distribution
||
[]).
forEach
((
item
,
index
)
=>
{
(
new
ModelerData
.
easyDataModelerDistributionKey
||
[]).
forEach
((
item
,
index
)
=>
{
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
name
===
_item
.
name
);
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
iid
===
_item
.
iid
);
if
(
_index
!==
-
1
)
{
if
(
_index
!==
-
1
)
{
newDistribution
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
newDistribution
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
...
@@ -373,10 +373,10 @@ const ImportAction = (props) => {
...
@@ -373,10 +373,10 @@ const ImportAction = (props) => {
}
}
//主键
//主键
let
newPrimary
=
[
...(
newModelerData
.
easyDataModelerPrimaryKey
||
[])
];
let
newPrimary
=
[];
(
new
Primar
y
||
[]).
forEach
((
item
,
index
)
=>
{
(
new
ModelerData
.
easyDataModelerPrimaryKe
y
||
[]).
forEach
((
item
,
index
)
=>
{
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
name
===
_item
.
name
);
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
iid
===
_item
.
iid
);
if
(
_index
!==
-
1
)
{
if
(
_index
!==
-
1
)
{
newPrimary
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
newPrimary
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
...
@@ -393,7 +393,7 @@ const ImportAction = (props) => {
...
@@ -393,7 +393,7 @@ const ImportAction = (props) => {
const
newKeys
=
[];
const
newKeys
=
[];
(
newPartition
.
keys
||
[]).
forEach
((
item
,
index
)
=>
{
(
newPartition
.
keys
||
[]).
forEach
((
item
,
index
)
=>
{
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
name
===
_item
.
name
);
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
iid
===
_item
.
iid
);
if
(
_index
!==
-
1
)
{
if
(
_index
!==
-
1
)
{
newKeys
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
newKeys
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
...
@@ -406,6 +406,21 @@ const ImportAction = (props) => {
...
@@ -406,6 +406,21 @@ const ImportAction = (props) => {
newPartition
=
null
;
newPartition
=
null
;
}
}
//类主键
let
newSemiPrimary
=
[];
(
newModelerData
.
semiPrimaryKey
||
[]).
forEach
((
item
,
index
)
=>
{
const
_index
=
(
newModelerData
.
easyDataModelerDataModelAttributes
||
[]).
findIndex
(
_item
=>
item
.
iid
===
_item
.
iid
);
if
(
_index
!==
-
1
)
{
newSemiPrimary
.
push
({...
newModelerData
.
easyDataModelerDataModelAttributes
[
_index
]});
}
})
if
((
newSemiPrimary
||
[]).
length
===
0
)
{
newSemiPrimary
=
null
;
}
//索引
//索引
let
newEasyDataModelerIndices
=
[...(
newModelerData
.
easyDataModelerIndices
||
[])];
let
newEasyDataModelerIndices
=
[...(
newModelerData
.
easyDataModelerIndices
||
[])];
(
newModelerData
.
easyDataModelerIndices
||
[]).
forEach
((
easyDataModelerIndex
,
index
)
=>
{
(
newModelerData
.
easyDataModelerIndices
||
[]).
forEach
((
easyDataModelerIndex
,
index
)
=>
{
...
@@ -427,7 +442,7 @@ const ImportAction = (props) => {
...
@@ -427,7 +442,7 @@ const ImportAction = (props) => {
newEasyDataModelerIndices
=
newEasyDataModelerIndices
.
filter
(
item
=>
(
item
.
indexedEasyDataModelAttributes
||
[]).
length
>
0
);
newEasyDataModelerIndices
=
newEasyDataModelerIndices
.
filter
(
item
=>
(
item
.
indexedEasyDataModelAttributes
||
[]).
length
>
0
);
return
{
partition
:
newPartition
,
easyDataModelerDistributionKey
:
newDistribution
,
easyDataModelerPrimaryKey
:
newPrimary
,
easyDataModelerIndices
:
newEasyDataModelerIndices
};
return
{
partition
:
newPartition
,
easyDataModelerDistributionKey
:
newDistribution
,
easyDataModelerPrimaryKey
:
newPrimary
,
easyDataModelerIndices
:
newEasyDataModelerIndices
,
semiPrimaryKey
:
newSemiPrimary
};
}
}
return
(
return
(
...
...
src/view/Manage/Model/Component/ImportActionHeader.jsx
View file @
fe1235c7
...
@@ -82,7 +82,7 @@ const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps })
...
@@ -82,7 +82,7 @@ const TemplateSelect = ({ value = {}, templates = [], onChange, ...restProps })
const
AttributesSelect
=
({
value
=
[],
modelerData
,
onChange
,
...
restProps
})
=>
{
const
AttributesSelect
=
({
value
=
[],
modelerData
,
onChange
,
...
restProps
})
=>
{
const
onAttributeChange
=
(
value
)
=>
{
const
onAttributeChange
=
(
value
)
=>
{
const
currentAttributes
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
name
)
!==-
1
);
const
currentAttributes
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
iid
)
!==-
1
);
triggerChange
(
currentAttributes
);
triggerChange
(
currentAttributes
);
}
}
...
@@ -94,15 +94,15 @@ const AttributesSelect = ({ value = [], modelerData, onChange, ...restProps }) =
...
@@ -94,15 +94,15 @@ const AttributesSelect = ({ value = [], modelerData, onChange, ...restProps }) =
//value有可能为空
//value有可能为空
value
=
value
?
value
:
[];
value
=
value
?
value
:
[];
let
attribute
Name
s
=
[];
let
attribute
Id
s
=
[];
value
.
forEach
(
attribute
=>
{
value
.
forEach
(
attribute
=>
{
attribute
Names
.
push
(
attribute
.
name
);
attribute
Ids
.
push
(
attribute
.
iid
);
})
})
return
(
return
(
<
Select
<
Select
onChange=
{
(
value
)
=>
{
onAttributeChange
&&
onAttributeChange
(
value
)
}
}
onChange=
{
(
value
)
=>
{
onAttributeChange
&&
onAttributeChange
(
value
)
}
}
value=
{
attribute
Name
s
}
value=
{
attribute
Id
s
}
placeholder=
'请选择字段名称'
placeholder=
'请选择字段名称'
style=
{
{
width
:
300
}
}
style=
{
{
width
:
300
}
}
mode=
'multiple'
mode=
'multiple'
...
@@ -111,7 +111,7 @@ const AttributesSelect = ({ value = [], modelerData, onChange, ...restProps }) =
...
@@ -111,7 +111,7 @@ const AttributesSelect = ({ value = [], modelerData, onChange, ...restProps }) =
{
{
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
map
((
attribute
,
index
)
=>
{
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
map
((
attribute
,
index
)
=>
{
return
(
return
(
<
Option
key=
{
index
}
value=
{
attribute
.
name
||
''
}
>
{
attribute
.
name
||
''
}
</
Option
>
<
Option
key=
{
index
}
value=
{
attribute
.
iid
||
''
}
>
{
attribute
.
name
||
''
}
</
Option
>
);
);
})
})
}
}
...
@@ -134,7 +134,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
...
@@ -134,7 +134,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
}
}
const
onAttributeChange
=
(
value
)
=>
{
const
onAttributeChange
=
(
value
)
=>
{
const
currentAttributes
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
name
)
!==-
1
);
const
currentAttributes
=
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
filter
(
attribute
=>
(
value
||
[]).
indexOf
(
attribute
.
iid
)
!==-
1
);
triggerChange
({
keys
:
currentAttributes
});
triggerChange
({
keys
:
currentAttributes
});
}
}
...
@@ -149,9 +149,9 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
...
@@ -149,9 +149,9 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
//value有可能为空
//value有可能为空
value
=
value
?
value
:
{};
value
=
value
?
value
:
{};
let
attribute
Name
s
=
[];
let
attribute
Id
s
=
[];
(
value
?.
keys
||
[]).
forEach
(
attribute
=>
{
(
value
?.
keys
||
[]).
forEach
(
attribute
=>
{
attribute
Names
.
push
(
attribute
.
name
);
attribute
Ids
.
push
(
attribute
.
iid
);
})
})
return
(
return
(
...
@@ -173,7 +173,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
...
@@ -173,7 +173,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
</
Select
>
</
Select
>
<
Select
<
Select
onChange=
{
(
value
)
=>
{
onAttributeChange
&&
onAttributeChange
(
value
)
}
}
onChange=
{
(
value
)
=>
{
onAttributeChange
&&
onAttributeChange
(
value
)
}
}
value=
{
attribute
Name
s
}
value=
{
attribute
Id
s
}
placeholder=
'请选择字段名称'
placeholder=
'请选择字段名称'
style=
{
{
width
:
200
,
marginLeft
:
5
}
}
style=
{
{
width
:
200
,
marginLeft
:
5
}
}
mode=
'multiple'
mode=
'multiple'
...
@@ -182,7 +182,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
...
@@ -182,7 +182,7 @@ const PartitionSelect = ({ value = {}, modelerData, partitionTypes = [], onChang
{
{
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
map
((
attribute
,
index
)
=>
{
(
modelerData
?.
easyDataModelerDataModelAttributes
||
[]).
map
((
attribute
,
index
)
=>
{
return
(
return
(
<
Option
key=
{
index
}
value=
{
attribute
.
name
||
''
}
>
{
attribute
.
name
||
''
}
</
Option
>
<
Option
key=
{
index
}
value=
{
attribute
.
iid
||
''
}
>
{
attribute
.
name
||
''
}
</
Option
>
);
);
})
})
}
}
...
@@ -399,7 +399,7 @@ const ImportActionHeader = (props) => {
...
@@ -399,7 +399,7 @@ const ImportActionHeader = (props) => {
setOnlyShowRequireChange
(
e
.
target
.
checked
);
setOnlyShowRequireChange
(
e
.
target
.
checked
);
}
}
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
;
let
distributionDescription
=
''
,
primaryDescription
=
''
,
partitionsDescription
=
''
,
semiPrimaryDescription
=
''
;
if
(
!
editable
&&
modelerData
)
{
if
(
!
editable
&&
modelerData
)
{
//分布
//分布
...
@@ -438,6 +438,17 @@ const ImportActionHeader = (props) => {
...
@@ -438,6 +438,17 @@ const ImportActionHeader = (props) => {
if
(
modelerData
?.
partition
?.
partitionType
?.
name
)
{
if
(
modelerData
?.
partition
?.
partitionType
?.
name
)
{
partitionsDescription
+=
'/'
+
modelerData
?.
partition
?.
partitionType
?.
name
||
''
;
partitionsDescription
+=
'/'
+
modelerData
?.
partition
?.
partitionType
?.
name
||
''
;
}
}
//类主键
if
(
modelerData
?.
semiPrimaryKey
)
{
(
modelerData
?.
semiPrimaryKey
||
[]).
forEach
((
item
,
index
)
=>
{
if
(
index
>
0
)
{
semiPrimaryDescription
+=
','
;
}
semiPrimaryDescription
+=
item
.
name
||
''
;
})
}
}
}
return
(
return
(
...
@@ -583,10 +594,10 @@ const ImportActionHeader = (props) => {
...
@@ -583,10 +594,10 @@ const ImportActionHeader = (props) => {
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
label=
"类主键"
label=
"类主键"
name=
"semiPrimaryKey
sDescription
"
name=
"semiPrimaryKey"
labelAlign=
"left"
labelAlign=
"left"
>
>
<
Input
style=
{
{
width
:
300
}
}
/>
<
AttributesSelect
modelerData=
{
modelerData
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
</
Row
>
</
Row
>
...
@@ -650,7 +661,7 @@ const ImportActionHeader = (props) => {
...
@@ -650,7 +661,7 @@ const ImportActionHeader = (props) => {
<
Descriptions
.
Item
label=
"分布键"
>
{
highlightSearchContentByTerms
(
distributionDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"分布键"
>
{
highlightSearchContentByTerms
(
distributionDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"分区键"
>
{
highlightSearchContentByTerms
(
partitionsDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"分区键"
>
{
highlightSearchContentByTerms
(
partitionsDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"主键"
>
{
highlightSearchContentByTerms
(
primaryDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"主键"
>
{
highlightSearchContentByTerms
(
primaryDescription
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"类主键"
>
{
highlightSearchContentByTerms
(
modelerData
.
semiPrimaryKeys
Description
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"类主键"
>
{
highlightSearchContentByTerms
(
semiPrimary
Description
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"加载方式"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataLoadingStrategy
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"加载方式"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataLoadingStrategy
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"更新时间"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataUpdatingTiming
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"更新时间"
>
{
highlightSearchContentByTerms
(
modelerData
.
dataUpdatingTiming
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"维护历史"
>
{
highlightSearchContentByTerms
(
modelerData
.
maintenanceRecords
||
''
,
terms
)
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
"维护历史"
>
{
highlightSearchContentByTerms
(
modelerData
.
maintenanceRecords
||
''
,
terms
)
}
</
Descriptions
.
Item
>
...
...
src/view/Manage/Model/Component/ImportActionIndex.jsx
View file @
fe1235c7
This diff is collapsed.
Click to expand it.
src/view/Manage/Model/Component/ImportActionTable.jsx
View file @
fe1235c7
This diff is collapsed.
Click to expand it.
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