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
4e1c3ea3
Commit
4e1c3ea3
authored
Dec 27, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
筛选
parent
2854b006
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
10 deletions
+37
-10
datamodeler.js
src/service/datamodeler.js
+2
-1
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+12
-2
index.jsx
src/view/Manage/Model/index.jsx
+23
-7
No files found.
src/service/datamodeler.js
View file @
4e1c3ea3
...
...
@@ -429,5 +429,5 @@ export function getSearchProperties() {
}
export
function
searchModelBySearchProperties
(
payload
)
{
return
Ge
tJSON
(
"/datamodeler/easyDataModelerCURD/searchEasyDataModelerDataModelsByModelSearchProperties"
,
payload
);
return
Pos
tJSON
(
"/datamodeler/easyDataModelerCURD/searchEasyDataModelerDataModelsByModelSearchProperties"
,
payload
);
}
\ No newline at end of file
src/view/Manage/Model/Component/ModelTree.jsx
View file @
4e1c3ea3
...
...
@@ -34,7 +34,7 @@ const ModelTree = (props) => {
id
:
MENU_ID
,
});
const
{
onSelect
,
onViewChange
,
refrence
=
''
,
importStockModel
,
keyword
}
=
props
;
const
{
onSelect
,
onViewChange
,
refrence
=
''
,
importStockModel
,
keyword
,
searchProperties
}
=
props
;
const
{
user
}
=
useContext
(
AppContext
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
...
@@ -89,7 +89,6 @@ const ModelTree = (props) => {
},
[
timestamp
])
useEffect
(()
=>
{
if
(
keyword
!==
''
)
{
if
(
item
&&
!
prevItem
)
{
setPrevItem
(
item
);
...
...
@@ -107,6 +106,17 @@ const ModelTree = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
])
useEffect
(()
=>
{
if
((
searchProperties
??[]).
length
>
0
)
{
if
(
item
&&
!
prevItem
)
{
setPrevItem
(
item
);
}
setItem
(
null
);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
searchProperties
])
const
haveStockImportPermission
=
useMemo
(()
=>
{
return
(
item
?.
optionList
||
[]).
findIndex
(
option
=>
option
.
name
===
'存量模型导入'
&&
option
.
enabled
)
!==
-
1
},
[
item
])
...
...
src/view/Manage/Model/index.jsx
View file @
4e1c3ea3
...
...
@@ -67,6 +67,7 @@ class Model extends React.Component {
canDelete
:
false
,
permissions
:
[],
selectSearchPropertiesVisible
:
false
,
searchProperties
:
[],
}
}
...
...
@@ -287,6 +288,26 @@ class Model extends React.Component {
this.setState({ selectSearchPropertiesVisible: true })
}
onSearchPropertiesCancel = (searchProperties) => {
this.setState({ selectSearchPropertiesVisible: false })
if ((searchProperties??[]).length > 0) {
this.setState({ loadingTableData: true, keyword: '', catalogId: '', searchProperties }, () => {
dispatch({
type: 'datamodel.searchModelBySearchProperties',
payload: {
data: searchProperties
},
callback: data => {
this.setState({ loadingTableData: false, tableData: data||[], filterTableData: data||[] });
},
error: () => {
this.setState({ loadingTableData: false });
}
})
})
}
}
onImportUnconditionBtnClick = () => {
const { catalogId, currentView } = this.state;
...
...
@@ -558,7 +579,7 @@ class Model extends React.Component {
axis='x'
minConstraints={[230, Infinity]} maxConstraints={[Infinity, Infinity]}
>
<ModelTree onViewChange={this.onViewChange} onSelect={this.onTreeSelect} importStockModel={this.importStockModel} keyword={keyword} {...this.props} />
<ModelTree onViewChange={this.onViewChange} onSelect={this.onTreeSelect} importStockModel={this.importStockModel} keyword={keyword}
searchProperties={this.state.searchProperties}
{...this.props} />
</ResizableBox>
<div className='tree-toggle-wrap'>
<div className='tree-toggle' onClick={this.treeToggleClick}>
...
...
@@ -752,12 +773,7 @@ class Model extends React.Component {
<SelectSearchProperties
visible={this.state.selectSearchPropertiesVisible}
onCancel={(searchProperties) => {
this.setState({ selectSearchPropertiesVisible: false })
if ((searchProperties??[]).length > 0) {
}
}}
onCancel={this.onSearchPropertiesCancel}
/>
</div>
}
...
...
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