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
17ff7421
Commit
17ff7421
authored
Nov 20, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产增加要素搜索
parent
5eec17ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletion
+52
-1
AssetManageTree.jsx
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
+4
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+44
-1
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+4
-0
No files found.
src/view/Manage/AssetManage/Component/AssetManageTree.jsx
View file @
17ff7421
...
@@ -12,6 +12,7 @@ import CustomDirectoryModal from './CustomDirectoryModal';
...
@@ -12,6 +12,7 @@ import CustomDirectoryModal from './CustomDirectoryModal';
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
AnchorTimestamp
,
AnchorId
,
AssetManageReference
,
AssetBrowseReference
,
ResourceBrowseReference
,
AssetMountReference
,
AnchorDirId
}
from
'../../../../util/constant'
;
import
{
AnchorTimestamp
,
AnchorId
,
AssetManageReference
,
AssetBrowseReference
,
ResourceBrowseReference
,
AssetMountReference
,
AnchorDirId
}
from
'../../../../util/constant'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
highlightSearchContentByTerms
}
from
'../../../../util'
;
import
{
listSubject
}
from
'./AssetTable'
;
import
'./AssetManageTree.less'
;
import
'./AssetManageTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
...
@@ -139,6 +140,7 @@ const AssetManageTree = (props) => {
...
@@ -139,6 +140,7 @@ const AssetManageTree = (props) => {
if
((
data
??[]).
length
>
0
)
{
if
((
data
??[]).
length
>
0
)
{
setTemplateType
(
data
[
0
].
type
)
setTemplateType
(
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
listSubject
.
next
({
msg
:
'templateChange'
})
onSelect
?.(
''
,
''
)
onSelect
?.(
''
,
''
)
getAllDirectoryAsTree
(
false
)
getAllDirectoryAsTree
(
false
)
}
}
...
@@ -782,6 +784,8 @@ const AssetManageTree = (props) => {
...
@@ -782,6 +784,8 @@ const AssetManageTree = (props) => {
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
setTemplateType
(
val
)
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
listSubject
.
next
({
msg
:
'templateChange'
})
setCurrentDirId
();
setCurrentDirId
();
onSelect
?.(
null
,
null
);
onSelect
?.(
null
,
null
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
17ff7421
...
@@ -5,6 +5,7 @@ import { Resizable } from 'react-resizable';
...
@@ -5,6 +5,7 @@ import { Resizable } from 'react-resizable';
import
ResizeObserver
from
'rc-resize-observer'
;
import
ResizeObserver
from
'rc-resize-observer'
;
import
{
useContextMenu
,
Menu
as
RcMenu
,
Item
as
RcItem
}
from
"react-contexify"
;
import
{
useContextMenu
,
Menu
as
RcMenu
,
Item
as
RcItem
}
from
"react-contexify"
;
import
LocalStorage
from
'local-storage'
;
import
LocalStorage
from
'local-storage'
;
import
{
Subject
}
from
"rxjs"
;
import
FilterElementModal
from
'./FilterElementModal'
;
import
FilterElementModal
from
'./FilterElementModal'
;
import
AssetMount
from
'../../AssetRecycle/Component/AssetMount'
;
import
AssetMount
from
'../../AssetRecycle/Component/AssetMount'
;
...
@@ -116,6 +117,8 @@ const ResizeableHeaderCell = props => {
...
@@ -116,6 +117,8 @@ const ResizeableHeaderCell = props => {
);
);
};
};
export
const
listSubject
=
new
Subject
();
const
AssetTable
=
(
props
)
=>
{
const
AssetTable
=
(
props
)
=>
{
const
{
className
,
nodeId
,
nodeType
,
nodeLevel
,
elementsChanged
,
assetActionChanged
,
onSelect
,
onCountChange
,
reference
=
AssetManageReference
,
onFullScreenChange
}
=
props
;
const
{
className
,
nodeId
,
nodeType
,
nodeLevel
,
elementsChanged
,
assetActionChanged
,
onSelect
,
onCountChange
,
reference
=
AssetManageReference
,
onFullScreenChange
}
=
props
;
...
@@ -158,6 +161,9 @@ const AssetTable = (props) => {
...
@@ -158,6 +161,9 @@ const AssetTable = (props) => {
const
[
loadingTemplates
,
setLoadingTemplates
]
=
useState
(
false
)
const
[
loadingTemplates
,
setLoadingTemplates
]
=
useState
(
false
)
const
[
templates
,
setTemplates
]
=
useState
()
const
[
templates
,
setTemplates
]
=
useState
()
const
[
currentTemplateType
,
setTemplateType
]
=
useState
()
const
[
currentTemplateType
,
setTemplateType
]
=
useState
()
const
[
loadingElements
,
setLoadingElements
]
=
useState
(
false
)
const
[
elements
,
setElements
]
=
useState
()
const
[
currentElementId
,
setCurrentElementId
]
=
useState
()
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
const
anchorId
=
getQueryParam
(
AnchorId
,
props
?.
location
?.
search
);
...
@@ -225,9 +231,16 @@ const AssetTable = (props) => {
...
@@ -225,9 +231,16 @@ const AssetTable = (props) => {
getTemplates
()
getTemplates
()
}
}
const
$list
=
listSubject
.
subscribe
((
val
)
=>
{
if
(
val
.
msg
===
'templateChange'
)
{
setCurrentElementId
();
getElements
();
}
});
window
?.
addEventListener
(
"storage"
,
storageChange
);
window
?.
addEventListener
(
"storage"
,
storageChange
);
return
()
=>
{
return
()
=>
{
$list
.
unsubscribe
()
window
?.
removeEventListener
(
"storage"
,
storageChange
);
window
?.
removeEventListener
(
"storage"
,
storageChange
);
}
}
...
@@ -267,7 +280,7 @@ const AssetTable = (props) => {
...
@@ -267,7 +280,7 @@ const AssetTable = (props) => {
getFilterElementsGroupThenGetDataAssets
();
getFilterElementsGroupThenGetDataAssets
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
,
elementsChanged
,
assetActionChanged
,
recursive
,
fullSearch
])
},
[
keyword
,
pagination
,
elementsChanged
,
assetActionChanged
,
recursive
,
fullSearch
,
currentElementId
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
reference
===
AssetRecycleReference
)
{
if
(
reference
===
AssetRecycleReference
)
{
...
@@ -348,6 +361,20 @@ const AssetTable = (props) => {
...
@@ -348,6 +361,20 @@ const AssetTable = (props) => {
})
})
}
}
const
getElements
=
()
=>
{
setLoadingElements
(
true
);
dispatch
({
type
:
'assetmanage.listElements'
,
callback
:
(
data
)
=>
{
setLoadingElements
(
false
);
setElements
(
data
);
},
error
:
()
=>
{
setLoadingElements
(
false
);
}
})
}
const
getDataAssetLocationByRelation
=
()
=>
{
const
getDataAssetLocationByRelation
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
...
@@ -495,6 +522,7 @@ const AssetTable = (props) => {
...
@@ -495,6 +522,7 @@ const AssetTable = (props) => {
setLoading
(
true
);
setLoading
(
true
);
let
params
=
{
let
params
=
{
queryElementId
:
currentElementId
,
dirId
:
nodeId
,
dirId
:
nodeId
,
pageNum
,
pageNum
,
pageSize
,
pageSize
,
...
@@ -1097,6 +1125,21 @@ const AssetTable = (props) => {
...
@@ -1097,6 +1125,21 @@ const AssetTable = (props) => {
{
/* {
{
/* {
(reference!==AssetRecycleReference) && <Checkbox onChange={onFullSearchChange} checked={fullSearch}>全部数据</Checkbox>
(reference!==AssetRecycleReference) && <Checkbox onChange={onFullSearchChange} checked={fullSearch}>全部数据</Checkbox>
} */
}
} */
}
<
Select
allowClear
loading=
{
loadingElements
}
value=
{
currentElementId
}
placeholder=
'请选择搜索属性'
onChange=
{
(
val
)
=>
{
setCurrentElementId
(
val
)
}
}
style=
{
{
width
:
160
}
}
>
{
(
elements
??[]).
map
((
item
,
index
)
=>
(
<
Select
.
Option
key=
{
item
.
id
}
value=
{
item
.
id
}
>
{
item
.
name
}
</
Select
.
Option
>
))
}
</
Select
>
<
Search
<
Search
placeholder=
"请输入资产目录要素值"
placeholder=
"请输入资产目录要素值"
allowClear
allowClear
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
17ff7421
...
@@ -13,6 +13,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
...
@@ -13,6 +13,7 @@ import { highlightSearchContentByTerms } from '../../../../util';
import
'./AssetTree.less'
;
import
'./AssetTree.less'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
'react-contexify/dist/ReactContexify.css'
;
import
{
appId
}
from
'../../../../App'
;
import
{
appId
}
from
'../../../../App'
;
import
{
listSubject
}
from
'./AssetTable'
;
const
{
Option
}
=
AutoComplete
;
const
{
Option
}
=
AutoComplete
;
...
@@ -127,8 +128,10 @@ const AssetTree = (props) => {
...
@@ -127,8 +128,10 @@ const AssetTree = (props) => {
if
(
_templateType
)
{
if
(
_templateType
)
{
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
_templateType
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
_templateType
)
listSubject
.
next
({
msg
:
'templateChange'
})
}
else
{
}
else
{
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
LocalStorage
.
set
(
`templateType-
${
appId
}
`
,
data
[
0
].
type
)
listSubject
.
next
({
msg
:
'templateChange'
})
}
}
if
(
_dirId
)
{
if
(
_dirId
)
{
...
@@ -580,6 +583,7 @@ const AssetTree = (props) => {
...
@@ -580,6 +583,7 @@ const AssetTree = (props) => {
onChange=
{
(
val
)
=>
{
onChange=
{
(
val
)
=>
{
setTemplateType
(
val
)
setTemplateType
(
val
)
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
LocalStorage
.
set
(
`templateType-${appId}`
,
val
);
listSubject
.
next
({
msg
:
'templateChange'
});
setCurrentDirId
();
setCurrentDirId
();
onSelect
?.(
null
,
null
);
onSelect
?.(
null
,
null
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
...
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