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
68ee4849
Commit
68ee4849
authored
Aug 03, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型全文检索
parent
dcd2fb22
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+10
-3
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+4
-3
index.jsx
src/view/Manage/Model/index.jsx
+5
-3
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
68ee4849
...
...
@@ -34,7 +34,7 @@ const ResizeableHeaderCell = props => {
const
ModelTable
=
(
props
)
=>
{
const
{
data
,
onChange
,
onItemAction
,
onSelect
,
catalogId
,
onSearchInputChange
,
onModelStateChange
,
loadingStates
,
currentModelState
,
modelStates
,
view
,
keyword
,
onRecatalog
,
onAutoCreateTable
}
=
props
;
const
{
data
,
onChange
,
onItemAction
,
onSelect
,
catalogId
,
onSearchInputChange
,
onModelStateChange
,
loadingStates
,
currentModelState
,
modelStates
,
view
,
keyword
,
onRecatalog
,
onAutoCreateTable
,
offset
=
null
}
=
props
;
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
[
columns
,
setColumns
]
=
useState
([
...
...
@@ -120,11 +120,18 @@ const ModelTable = (props) => {
useEffect
(()
=>
{
setPagination
({
pageNum
:
1
,
pageSize
:
20
});
if
(
offset
!==
null
)
{
const
_pageNum
=
parseInt
(
offset
/
pageSize
+
((
offset
%
pageSize
===
0
)?
0
:
1
));
setPagination
({...
pagination
,
pageNum
:
_pageNum
});
}
else
{
setPagination
({...
pagination
,
pageNum
:
1
});
}
setSelectedRowKeys
([]);
onSelect
&&
onSelect
([]);
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
catalogId
,
keyword
]);
},
[
catalogId
,
keyword
,
offset
]);
useEffect
(()
=>
{
...
...
src/view/Manage/Model/Component/ModelTree.jsx
View file @
68ee4849
...
...
@@ -67,15 +67,16 @@ const ModelTree = (props) => {
id
},
callback
:
data
=>
{
getDirTreeData
(
data
.
easyDataModelerDataModelCatalogId
||
''
);
getDirTreeData
(
data
.
easyDataModelerDataModelCatalogId
||
''
,
data
.
offset
);
},
error
:
()
=>
{
setLoading
(
false
);
getDirTreeData
();
}
});
}
const
getDirTreeData
=
(
defaultSelectedId
=
''
)
=>
{
const
getDirTreeData
=
(
defaultSelectedId
=
''
,
offset
=
null
)
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -127,7 +128,7 @@ const ModelTree = (props) => {
setAutoExpandParent
(
true
);
setItem
(
defaultItem
);
onSelect
&&
onSelect
(
defaultItem
.
key
||
''
);
onSelect
&&
onSelect
(
defaultItem
.
key
||
''
,
offset
);
}
else
if
(
refrence
===
''
)
{
...
...
src/view/Manage/Model/index.jsx
View file @
68ee4849
...
...
@@ -48,6 +48,7 @@ class Model extends React.Component {
currentView
:
''
,
exportDDLModalReference
:
'exportDDL'
,
currentModel
:
{},
offset
:
null
}
}
...
...
@@ -82,9 +83,9 @@ class Model extends React.Component {
})
}
onTreeSelect
=
(
key
)
=>
{
onTreeSelect
=
(
key
,
offset
)
=>
{
this
.
setState
({
catalogId
:
key
,
keyword
:
''
},
()
=>
{
this
.
setState
({
catalogId
:
key
,
keyword
:
''
,
offset
},
()
=>
{
if
(
!
key
||
key
===
''
)
{
this
.
setState
({
tableData
:
[],
filterTableData
:
[]
});
}
else
{
...
...
@@ -385,7 +386,7 @@ class Model extends React.Component {
}
render
()
{
const
{
importModalVisible
,
catalogId
,
loadingTableData
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDDrawerVisible
,
wordTemplateModalVisible
,
constraintDetailDrawerVisible
,
importWordModalVisible
,
loadingStates
,
modelStates
,
currentModelState
,
currentView
,
recatalogModalVisible
,
exportDDLModalReference
,
currentModel
,
importWordModalReference
}
=
this
.
state
;
const
{
importModalVisible
,
catalogId
,
loadingTableData
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDDrawerVisible
,
wordTemplateModalVisible
,
constraintDetailDrawerVisible
,
importWordModalVisible
,
loadingStates
,
modelStates
,
currentModelState
,
currentView
,
recatalogModalVisible
,
exportDDLModalReference
,
currentModel
,
importWordModalReference
,
offset
}
=
this
.
state
;
const
content
=
(
<
ModelTable
...
...
@@ -397,6 +398,7 @@ class Model extends React.Component {
modelStates=
{
modelStates
}
currentModelState=
{
currentModelState
}
keyword=
{
keyword
}
offset=
{
offset
}
onChange=
{
this
.
onTableChange
}
onSelect=
{
this
.
onTableSelect
}
onItemAction=
{
this
.
onTableItemAction
}
...
...
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