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
d21a7c03
Commit
d21a7c03
authored
May 26, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产搜索
parent
7caeba5d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
routes.js
src/routes.js
+1
-1
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+22
-6
AssetTable.less
src/view/Manage/AssetManage/Component/AssetTable.less
+2
-0
No files found.
src/routes.js
View file @
d21a7c03
...
@@ -29,7 +29,7 @@ export const routes = [
...
@@ -29,7 +29,7 @@ export const routes = [
},
},
{
{
name
:
'asset-recycle'
,
name
:
'asset-recycle'
,
text
:
'
资产回收站
'
,
text
:
'
未分类资产
'
,
}
}
]
]
}
}
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
d21a7c03
import
React
,{
useState
,
useEffect
}
from
"react"
;
import
React
,{
useState
,
useEffect
}
from
"react"
;
import
{
Card
,
Checkbox
,
Button
,
List
,
Skeleton
,
Pagination
,
Space
,
Modal
,
Switch
,
Divider
,
Tooltip
,
Popover
}
from
"antd"
;
import
{
Card
,
Checkbox
,
Button
,
List
,
Skeleton
,
Pagination
,
Space
,
Modal
,
Switch
,
Divider
,
Tooltip
,
Popover
,
Input
}
from
"antd"
;
import
{
EditOutlined
,
ReconciliationOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
{
EditOutlined
,
ReconciliationOutlined
,
DeleteOutlined
}
from
'@ant-design/icons'
;
import
ImportElement
from
'./ImportElement'
;
import
ImportElement
from
'./ImportElement'
;
...
@@ -31,6 +31,7 @@ const AssetTable = (props) =>{
...
@@ -31,6 +31,7 @@ const AssetTable = (props) =>{
const
[
assetEditAction
,
setAssetEditAction
]
=
useState
(
''
);
const
[
assetEditAction
,
setAssetEditAction
]
=
useState
(
''
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
{
pageNum
,
pageSize
}
=
pagination
;
const
{
pageNum
,
pageSize
}
=
pagination
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
...
@@ -49,7 +50,7 @@ const AssetTable = (props) =>{
...
@@ -49,7 +50,7 @@ const AssetTable = (props) =>{
getTable
();
getTable
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
pagination
])
},
[
keyword
,
pagination
])
const
changeCurrent
=
(
page
,
size
)
=>
{
const
changeCurrent
=
(
page
,
size
)
=>
{
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
setPagination
({
pageNum
:
page
,
pageSize
:
size
});
...
@@ -63,7 +64,7 @@ const AssetTable = (props) =>{
...
@@ -63,7 +64,7 @@ const AssetTable = (props) =>{
dirId
:
nodeId
,
dirId
:
nodeId
,
pageNum
,
pageNum
,
pageSize
,
pageSize
,
keyword
:
''
keyword
:
keyword
},
},
callback
:
data
=>
{
callback
:
data
=>
{
const
_assetNames
=
[];
const
_assetNames
=
[];
...
@@ -86,6 +87,11 @@ const AssetTable = (props) =>{
...
@@ -86,6 +87,11 @@ const AssetTable = (props) =>{
})
})
}
}
const
onSearchInputChange
=
(
e
)
=>
{
setKeyword
(
e
.
target
.
value
||
''
);
setPagination
({
...
pagination
,
pageNum
:
1
});
}
const
onRecycleClick
=
()
=>
{
const
onRecycleClick
=
()
=>
{
window
.
location
.
href
=
'/center-home/view/asset-recycle'
;
window
.
location
.
href
=
'/center-home/view/asset-recycle'
;
}
}
...
@@ -109,7 +115,7 @@ const AssetTable = (props) =>{
...
@@ -109,7 +115,7 @@ const AssetTable = (props) =>{
const
deleteAsset
=
(
item
)
=>
{
const
deleteAsset
=
(
item
)
=>
{
modal
.
confirm
({
modal
.
confirm
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'该资产在所有目录上唯一存在,移除后,你可以前往“
资产回收站
”重新挂载。'
,
content
:
'该资产在所有目录上唯一存在,移除后,你可以前往“
未分类资产
”重新挂载。'
,
onOk
:
()
=>
{
onOk
:
()
=>
{
dispatch
({
dispatch
({
type
:
'assetmanage.unloadDataAssets'
,
type
:
'assetmanage.unloadDataAssets'
,
...
@@ -245,8 +251,18 @@ const AssetTable = (props) =>{
...
@@ -245,8 +251,18 @@ const AssetTable = (props) =>{
bodyStyle=
{
{
padding
:
'0 10px'
}
}
bodyStyle=
{
{
padding
:
'0 10px'
}
}
headStyle=
{
{
padding
:
10
}
}
headStyle=
{
{
padding
:
10
}
}
title=
{
title=
{
<
div
className=
'd-flex'
>
<
div
className=
'd-flex'
style=
{
{
justifyContent
:
'space-between'
}
}
>
<
Button
style=
{
{
marginLeft
:
'auto'
}
}
type=
"primary"
onClick=
{
onRecycleClick
}
>
资产回收站
</
Button
>
<
Space
>
<
span
>
资产搜索:
</
span
>
<
Input
placeholder=
"请输入资产要素值"
allowClear
value=
{
keyword
}
onChange=
{
onSearchInputChange
}
style=
{
{
width
:
240
,
marginLeft
:
'auto'
}
}
/>
</
Space
>
<
Button
style=
{
{
marginLeft
:
'auto'
}
}
type=
"primary"
onClick=
{
onRecycleClick
}
>
未分类资产
</
Button
>
</
div
>
</
div
>
}
}
>
>
...
...
src/view/Manage/AssetManage/Component/AssetTable.less
View file @
d21a7c03
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
text-align: right;
text-align: right;
}
}
.yy-card-head-title {
.yy-card-head-title {
font-weight: normal;
font-size: 14px;
padding: 0;
padding: 0;
}
}
.yy-list-vertical .yy-list-item-action > li {
.yy-list-vertical .yy-list-item-action > li {
...
...
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