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
482d478a
Commit
482d478a
authored
Aug 11, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
类主见自动生成索引
parent
c43fa49d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
ImportAction.jsx
src/view/Manage/Model/Component/ImportAction.jsx
+43
-1
No files found.
src/view/Manage/Model/Component/ImportAction.jsx
View file @
482d478a
...
@@ -337,6 +337,39 @@ const ImportAction = (props) => {
...
@@ -337,6 +337,39 @@ const ImportAction = (props) => {
})
})
}
}
//类主键自动创建索引
let
autoEasyDataModelerIndex
=
{
"name"
:
`i_pk_
${
newModelerData
.
name
}
`
,
"indextype"
:
{
"name"
:
"btree"
,
"displayName"
:
"B-tree"
,
"supportedDBTypes"
:
[
"Greenplum"
,
"MySQL"
],
"default"
:
true
},
"indexedAttributeOrders"
:
[
"ASC"
],
"indexedEasyDataModelAttributes"
:
[...
newModelerData
.
easyDataModelerSemiPrimaryKey
],
"unique"
:
true
};
let
newEasyDataModelerIndices
=
[];
(
newModelerData
.
easyDataModelerIndices
||
[]).
forEach
((
easyDataModelerIndex
,
index
)
=>
{
if
(
easyDataModelerIndex
.
name
!==
`i_pk_
${
modelerDataRef
.
current
?.
name
}
` && easyDataModelerIndex.name!==`
i_pk_$
{
newModelerData
.
name
}
`) {
newEasyDataModelerIndices.push(easyDataModelerIndex);
}
});
newEasyDataModelerIndices.push(autoEasyDataModelerIndex);
newEasyDataModelerIndices = newEasyDataModelerIndices.filter(item => (item.indexedEasyDataModelAttributes||[]).length > 0);
newModelerData = {...newModelerData, easyDataModelerIndices: newEasyDataModelerIndices};
setModelerData(newModelerData);
setModelerData(newModelerData);
modelerDataRef.current = newModelerData;
modelerDataRef.current = newModelerData;
...
@@ -436,10 +469,19 @@ const ImportAction = (props) => {
...
@@ -436,10 +469,19 @@ const ImportAction = (props) => {
}
}
//类主键
//类主键
let
newSemiPrimary
=
[...(
newModelerData
.
easyDataModelerSemiPrimaryKey
||
[])];
let newSemiPrimary = [];
(newModelerData.easyDataModelerSemiPrimaryKey||[]).forEach((item, index) => {
const _index = (newModelerData.easyDataModelerDataModelAttributes||[]).findIndex(_item => item.iid === _item.iid);
if (_index !== -1) {
newSemiPrimary.push({...newModelerData.easyDataModelerDataModelAttributes[_index]});
}
})
//索引
//索引
let newEasyDataModelerIndices = [...(newModelerData.easyDataModelerIndices||[])];
let newEasyDataModelerIndices = [...(newModelerData.easyDataModelerIndices||[])];
(newModelerData.easyDataModelerIndices||[]).forEach((easyDataModelerIndex, index) => {
(newModelerData.easyDataModelerIndices||[]).forEach((easyDataModelerIndex, index) => {
const newIndexedEasyDataModelAttributes = [], newIndexedAttributeOrders = [];
const newIndexedEasyDataModelAttributes = [], newIndexedAttributeOrders = [];
...
...
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