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
12227dd8
Commit
12227dd8
authored
Jan 04, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务属性搜索
parent
d4063f55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
30 deletions
+63
-30
index.jsx
src/view/Manage/Model/index.jsx
+63
-30
No files found.
src/view/Manage/Model/index.jsx
View file @
12227dd8
...
@@ -75,12 +75,16 @@ class Model extends React.Component {
...
@@ -75,12 +75,16 @@ class Model extends React.Component {
jdbcInformationVisible
:
false
,
jdbcInformationVisible
:
false
,
isRoot
:
false
,
isRoot
:
false
,
importServicesVisible
:
false
,
importServicesVisible
:
false
,
loadingAttrs
:
false
,
attrs
:
[],
currentAttr
:
undefined
,
}
}
}
}
componentDidMount
()
{
componentDidMount
()
{
this
.
getModelStates
();
this
.
getModelStates
();
this
.
getPreference
();
this
.
getPreference
();
this
.
getAttrs
();
window
?.
addEventListener
(
"storage"
,
this
.
modelEventChange
);
window
?.
addEventListener
(
"storage"
,
this
.
modelEventChange
);
}
}
...
@@ -127,6 +131,23 @@ class Model extends React.Component {
...
@@ -127,6 +131,23 @@ class Model extends React.Component {
})
})
}
}
getAttrs
=
()
=>
{
this
.
setState
({
loadingAttrs
:
true
},
()
=>
{
dispatch
({
type
:
'pds.getAttrs'
,
payload
:
{
modelName
:
'DataService'
},
callback
:
data
=>
{
this
.
setState
({
loadingAttrs
:
false
,
attrs
:
data
})
},
error
:
()
=>
{
this
.
setState
({
loadingAttrs
:
false
})
}
})
})
}
onViewChange
=
(
value
)
=>
{
onViewChange
=
(
value
)
=>
{
this
.
setState
({
currentView
:
value
});
this
.
setState
({
currentView
:
value
});
}
}
...
@@ -154,7 +175,7 @@ class Model extends React.Component {
...
@@ -154,7 +175,7 @@ class Model extends React.Component {
}
}
onTableChange
=
()
=>
{
onTableChange
=
()
=>
{
const
{
currentView
,
catalogId
,
keyword
,
currentModelState
,
currentODataState
}
=
this
.
state
;
const
{
currentView
,
catalogId
,
keyword
,
currentModelState
,
currentODataState
,
currentAttr
}
=
this
.
state
;
this
.
setState
({
loadingTableData
:
true
},
()
=>
{
this
.
setState
({
loadingTableData
:
true
},
()
=>
{
if
(
keyword
===
''
)
{
if
(
keyword
===
''
)
{
...
@@ -218,7 +239,8 @@ class Model extends React.Component {
...
@@ -218,7 +239,8 @@ class Model extends React.Component {
const params = {
const params = {
term: encodeURIComponent(keyword),
term: encodeURIComponent(keyword),
namespace: `
$
{
this
.
props
.
app
?.
env
?.
domainId
}
`,
namespace: `
$
{
this
.
props
.
app
?.
env
?.
domainId
}
`,
isExcludeOtherOwner: !this.props.isOnlyEnding
isExcludeOtherOwner: !this.props.isOnlyEnding,
fieldName: currentAttr?.key??'',
};
};
if (currentModelState !== '') {
if (currentModelState !== '') {
...
@@ -777,10 +799,9 @@ class Model extends React.Component {
...
@@ -777,10 +799,9 @@ class Model extends React.Component {
<Space>
<Space>
{
{
(currentView==='dir'||keyword!=='') && <Space>
(currentView==='dir'||keyword!=='') &&
<span>发布状态:</span>
<Select
<Select
style={{ width: 1
2
0 }}
style={{ width: 1
6
0 }}
onChange={(value) => {
onChange={(value) => {
this.onModelStateChange(value);
this.onModelStateChange(value);
}}
}}
...
@@ -795,31 +816,43 @@ class Model extends React.Component {
...
@@ -795,31 +816,43 @@ class Model extends React.Component {
})
})
}
}
</Select>
</Select>
</Space>
}
}
<Space>
<Select allowClear
{/* <span>OData状态:</span>
loading={this.state.loadingAttrs}
<Select
value={this.state.currentAttr?.key}
style={{ width: 120 }}
placeholder='请选择搜索属性'
onChange={(value) => {
style={{ width: 160 }}
this.onODataStateChange(value);
onChange={(value) => {
}}
let newCurrentAttr = undefined
value={currentODataState}
if (value) {
>
const index = (this.state.attrs??[]).findIndex(item => item.key === value)
<Option value='0'>所有状态</Option>
if (index !== -1) {
<Option value='1'>已启动</Option>
newCurrentAttr = this.state.attrs[index]
<Option value='2'>未启动</Option>
}
</Select> */}
}
</Space>
<Space>
this.setState({ currentAttr: newCurrentAttr }, () => {
<InputDebounce
this.onTableChange()
placeholder="通过服务名称全文搜索"
})
allowClear
}}
value={keyword}
>
onChange={(value) => { this.onSearchInputChange(value); }}
{
style={{ width: inputWidth, marginLeft: 'auto' }}
(this.state.attrs??[]).map(item => {
/>
return (
</Space>
<Option key={item.key} value={item.key}>{item.name}</Option>
);
})
}
</Select>
<InputDebounce
placeholder="通过服务名称全文搜索"
allowClear
value={keyword}
onChange={(value) => { this.onSearchInputChange(value); }}
style={{ width: inputWidth, marginLeft: 'auto' }}
/>
</Space>
</Space>
...
...
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