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
800c2f26
Commit
800c2f26
authored
Apr 26, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回收站
parent
8f946bf6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
15 deletions
+45
-15
AssetTable.jsx
src/view/Manage/AssetManage/components/AssetTable.jsx
+5
-1
AssetTree.jsx
src/view/Manage/AssetManage/components/AssetTree.jsx
+8
-2
AssetTree.less
src/view/Manage/AssetManage/components/AssetTree.less
+8
-0
AssetMount.jsx
src/view/Manage/AssetRecycle/Components/AssetMount.jsx
+3
-3
index.jsx
src/view/Manage/AssetRecycle/index.jsx
+21
-9
No files found.
src/view/Manage/AssetManage/components/AssetTable.jsx
View file @
800c2f26
...
...
@@ -86,6 +86,10 @@ const AssetTable = (props) =>{
})
}
const
onRecycleClick
=
()
=>
{
window
.
open
(
'/center-home/view/asset-recycle'
);
}
const
addAsset
=
()
=>
{
setAssetEditAction
(
'add'
);
setAssetEditVisible
(
true
);
...
...
@@ -227,7 +231,7 @@ const AssetTable = (props) =>{
headStyle=
{
{
padding
:
10
}
}
title=
{
<
div
className=
'd-flex'
>
<
Button
style=
{
{
marginLeft
:
'auto'
}
}
type=
"primary"
>
资产回收站
</
Button
>
<
Button
style=
{
{
marginLeft
:
'auto'
}
}
type=
"primary"
onClick=
{
onRecycleClick
}
>
资产回收站
</
Button
>
</
div
>
}
>
...
...
src/view/Manage/AssetManage/components/AssetTree.jsx
View file @
800c2f26
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Spin
,
Button
,
Tooltip
,
Tree
,
Input
,
Dropdown
,
Menu
,
Space
,
Modal
}
from
'antd'
;
import
{
PlusOutlined
,
ImportOutlined
,
EditOutlined
,
DeleteOutlined
,
ExportOutlined
,
SyncOutlined
}
from
'@ant-design/icons'
;
import
classNames
from
'classnames'
import
{
dispatch
}
from
'../../../../model'
;
import
ImportDirectory
from
'./ImportDirectory'
;
...
...
@@ -10,7 +11,7 @@ import './AssetTree.less';
const
AssetTree
=
(
props
)
=>
{
const
{
readOnly
=
false
,
onSelect
}
=
props
;
const
{
readOnly
=
false
,
onSelect
,
className
,
...
restProps
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
...
...
@@ -222,9 +223,13 @@ const AssetTree = (props) => {
};
});
const
classes
=
classNames
(
'asset-tree'
,
className
,
{
'asset-tree-read'
:
readOnly
});
return
(
<
Card
className=
{
"asset-tree"
}
className=
{
classes
}
title=
{
readOnly
?
null
:
(
<
Space
>
<
Tooltip
title=
"新增目录"
>
...
...
@@ -253,6 +258,7 @@ const AssetTree = (props) => {
bodyStyle=
{
{
padding
:
10
}
}
headStyle=
{
{
padding
:
10
}
}
style=
{
{
width
:
'100%'
}
}
{
...
restProps
}
>
<
Spin
spinning=
{
loading
}
>
<
Input
...
...
src/view/Manage/AssetManage/components/AssetTree.less
View file @
800c2f26
...
...
@@ -12,4 +12,11 @@
.site-tree-search-value {
color: #f50;
}
}
.asset-tree-read {
.yy-tree-list {
height: 400px !important;
overflow: auto !important;
}
}
\ No newline at end of file
src/view/Manage/AssetRecycle/Components/AssetMount.jsx
View file @
800c2f26
...
...
@@ -7,7 +7,7 @@ import { showMessage } from '../../../../util';
const
AssetMount
=
(
props
)
=>
{
const
{
onCancel
,
visible
,
item
}
=
props
;
const
{
onCancel
,
visible
,
id
}
=
props
;
const
[
nodeId
,
setNodeId
]
=
useState
(
null
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
...
...
@@ -24,7 +24,7 @@ const AssetMount = (props) => {
params
:
{
dirId
:
nodeId
,
},
data
:
[
i
tem
.
i
d
||
''
]
data
:
[
id
||
''
]
},
callback
:
data
=>
{
setConfirmLoading
(
false
);
...
...
@@ -41,7 +41,7 @@ const AssetMount = (props) => {
<
Modal
title=
'挂载详情'
visible=
{
visible
}
width=
{
5
00
}
width=
{
4
00
}
confirmLoading=
{
confirmLoading
}
onCancel=
{
()
=>
{
onCancel
&&
onCancel
()}
}
onOk=
{
onOk
}
...
...
src/view/Manage/AssetRecycle/index.jsx
View file @
800c2f26
...
...
@@ -15,7 +15,7 @@ const AssetRecycle = (props) => {
const
[
assets
,
setAssets
]
=
useState
([]);
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
pagination
,
setPagination
]
=
useState
(
{
pageNum
:
1
,
pageSize
:
20
}
);
const
[
currentAsset
,
setCurrentAsset
]
=
useState
(
null
);
const
[
currentAsset
Id
,
setCurrentAssetId
]
=
useState
(
''
);
const
[
assetDetailVisible
,
setAssetDetailVisible
]
=
useState
(
false
);
const
[
assetMountVisible
,
setAssetMountVisible
]
=
useState
(
false
);
...
...
@@ -47,9 +47,6 @@ const AssetRecycle = (props) => {
dataIndex
:
'name'
,
},
{
title
:
'说明'
},
{
title
:
'操作'
,
key
:
'action'
,
width
:
120
,
...
...
@@ -80,7 +77,7 @@ const AssetRecycle = (props) => {
pageSize
},
callback
:
data
=>
{
se
tAssets
(
data
.
data
||
[]);
conver
tAssets
(
data
.
data
||
[]);
setTotal
(
data
.
total
);
setLoading
(
false
);
},
...
...
@@ -90,13 +87,28 @@ const AssetRecycle = (props) => {
})
}
const
convertAssets
=
data
=>
{
(
data
||
[]).
forEach
(
item
=>
{
(
item
.
elements
||
[]).
forEach
(
element
=>
{
if
(
element
.
name
===
'中文名称'
)
{
item
.
cnName
=
element
.
value
;
}
if
(
element
.
name
===
'英文名称'
)
{
item
.
name
=
element
.
value
;
}
})
})
setAssets
(
data
||
[]);
}
const
detailItem
=
(
record
)
=>
{
setCurrentAsset
(
recor
d
);
setCurrentAsset
Id
(
record
.
i
d
);
setAssetDetailVisible
(
true
);
}
const
mountItem
=
(
record
)
=>
{
setCurrentAsset
(
recor
d
);
setCurrentAsset
Id
(
record
.
i
d
);
setAssetMountVisible
(
true
);
}
...
...
@@ -156,12 +168,12 @@ const AssetRecycle = (props) => {
/>
<
AssetDetail
visible=
{
assetDetailVisible
}
i
tem=
{
currentAsset
}
i
d=
{
currentAssetId
}
onCancel=
{
onAssetDetailCancel
}
/>
<
AssetMount
visible=
{
assetMountVisible
}
i
tem=
{
currentAsset
}
i
d=
{
currentAssetId
}
onCancel=
{
onAssetMountCancel
}
/>
{
contextHolder
}
...
...
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