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
c071c3c8
Commit
c071c3c8
authored
Apr 26, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量删除资产
parent
b6e2c236
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
AssetTable.jsx
src/view/Manage/AssetManage/components/AssetTable.jsx
+1
-1
index.jsx
src/view/Manage/AssetRecycle/index.jsx
+49
-1
index.less
src/view/Manage/AssetRecycle/index.less
+4
-1
No files found.
src/view/Manage/AssetManage/components/AssetTable.jsx
View file @
c071c3c8
...
@@ -277,7 +277,7 @@ const AssetTable = (props) =>{
...
@@ -277,7 +277,7 @@ const AssetTable = (props) =>{
<
Space
className=
'ml-5'
>
<
Space
className=
'ml-5'
>
<
span
>
资产:
</
span
>
<
span
>
资产:
</
span
>
<
Button
type=
"primary"
onClick=
{
addAsset
}
>
新增
</
Button
>
<
Button
type=
"primary"
onClick=
{
addAsset
}
>
新增
</
Button
>
<
Button
type=
"
primary"
danger
onClick=
{
deleteAssets
}
>
删除
</
Button
>
<
Button
type=
"
danger"
onClick=
{
deleteAssets
}
>
删除
</
Button
>
<
Button
type=
"primary"
onClick=
{
importAsset
}
>
导入
</
Button
>
<
Button
type=
"primary"
onClick=
{
importAsset
}
>
导入
</
Button
>
<
Button
type=
"primary"
onClick=
{
exportAsset
}
>
导出
</
Button
>
<
Button
type=
"primary"
onClick=
{
exportAsset
}
>
导出
</
Button
>
</
Space
>
</
Space
>
...
...
src/view/Manage/AssetRecycle/index.jsx
View file @
c071c3c8
...
@@ -18,6 +18,7 @@ const AssetRecycle = (props) => {
...
@@ -18,6 +18,7 @@ const AssetRecycle = (props) => {
const
[
currentAssetId
,
setCurrentAssetId
]
=
useState
(
''
);
const
[
currentAssetId
,
setCurrentAssetId
]
=
useState
(
''
);
const
[
assetDetailVisible
,
setAssetDetailVisible
]
=
useState
(
false
);
const
[
assetDetailVisible
,
setAssetDetailVisible
]
=
useState
(
false
);
const
[
assetMountVisible
,
setAssetMountVisible
]
=
useState
(
false
);
const
[
assetMountVisible
,
setAssetMountVisible
]
=
useState
(
false
);
const
[
selectedRowKeys
,
setSelectedRowKeys
]
=
useState
([]);
const
{
pageNum
,
pageSize
}
=
pagination
;
const
{
pageNum
,
pageSize
}
=
pagination
;
...
@@ -41,10 +42,12 @@ const AssetRecycle = (props) => {
...
@@ -41,10 +42,12 @@ const AssetRecycle = (props) => {
{
{
title
:
'中文名称'
,
title
:
'中文名称'
,
dataIndex
:
'cnName'
,
dataIndex
:
'cnName'
,
ellipsis
:
true
,
},
},
{
{
title
:
'英文名称'
,
title
:
'英文名称'
,
dataIndex
:
'name'
,
dataIndex
:
'name'
,
ellipsis
:
true
,
},
},
{
{
title
:
'操作'
,
title
:
'操作'
,
...
@@ -112,6 +115,31 @@ const AssetRecycle = (props) => {
...
@@ -112,6 +115,31 @@ const AssetRecycle = (props) => {
setAssetMountVisible
(
true
);
setAssetMountVisible
(
true
);
}
}
const
deleteItems
=
()
=>
{
if
((
selectedRowKeys
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先选择资产'
);
return
;
}
modal
.
confirm
({
title
:
'提示!'
,
content
:
'您确定要永久删除选中的资产吗?'
,
onOk
:
()
=>
{
dispatchLatest
({
type
:
'assetmanage.deleteDataAssets'
,
payload
:
{
data
:
selectedRowKeys
},
callback
:
()
=>
{
showMessage
(
'success'
,
'资产删除成功'
);
setSelectedRowKeys
([]);
getAssets
();
}
})
}
});
}
const
deleteItem
=
(
record
)
=>
{
const
deleteItem
=
(
record
)
=>
{
modal
.
confirm
({
modal
.
confirm
({
title
:
'提示!'
,
title
:
'提示!'
,
...
@@ -140,10 +168,29 @@ const AssetRecycle = (props) => {
...
@@ -140,10 +168,29 @@ const AssetRecycle = (props) => {
refresh
&&
getAssets
();
refresh
&&
getAssets
();
}
}
const
onSelectChange
=
keys
=>
{
setSelectedRowKeys
(
keys
);
};
const
rowSelection
=
{
selectedRowKeys
,
onChange
:
onSelectChange
,
};
return
(
return
(
<
div
className=
'asset-recycle p-3'
style=
{
{
backgroundColor
:
'#fff'
}
}
>
<
div
className=
'asset-recycle'
style=
{
{
backgroundColor
:
'#fff'
}
}
>
<
div
className=
'd-flex p-3'
style=
{
{
borderBottom
:
'1px solid #EFEFEF'
,
}
}
>
<
Button
type=
"danger"
onClick=
{
deleteItems
}
style=
{
{
marginLeft
:
'auto'
}
}
>
删除
</
Button
>
</
div
>
<
div
className=
'list p-3'
>
<
Table
<
Table
loading=
{
loading
}
loading=
{
loading
}
rowSelection=
{
rowSelection
}
columns=
{
columns
}
columns=
{
columns
}
rowKey=
{
'id'
}
rowKey=
{
'id'
}
dataSource=
{
assets
||
[]
}
dataSource=
{
assets
||
[]
}
...
@@ -166,6 +213,7 @@ const AssetRecycle = (props) => {
...
@@ -166,6 +213,7 @@ const AssetRecycle = (props) => {
total=
{
total
}
total=
{
total
}
showTotal=
{
total
=>
`共 ${total} 条`
}
showTotal=
{
total
=>
`共 ${total} 条`
}
/>
/>
</
div
>
<
AssetDetail
<
AssetDetail
visible=
{
assetDetailVisible
}
visible=
{
assetDetailVisible
}
id=
{
currentAssetId
}
id=
{
currentAssetId
}
...
...
src/view/Manage/AssetRecycle/index.less
View file @
c071c3c8
.asset-recycle {
.asset-recycle {
height: calc(100vh - 64px - 30px) !important;
.list {
height: calc(100vh - 64px - 30px - 53px) !important;
overflow: auto !important;
overflow: auto !important;
}
}
}
\ No newline at end of file
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