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
0f273a7c
Commit
0f273a7c
authored
May 26, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产自定义主题加搜索
parent
98254a97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
23 deletions
+44
-23
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+24
-18
CustomDirectoryModal.jsx
...iew/Manage/AssetManage/Component/CustomDirectoryModal.jsx
+20
-5
No files found.
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
0f273a7c
...
@@ -289,22 +289,24 @@ const AssetTable = (props) =>{
...
@@ -289,22 +289,24 @@ const AssetTable = (props) =>{
onChange=
{
onCheckAll
}
onChange=
{
onCheckAll
}
/>
/>
<
div
>
<
div
>
{
<
Space
>
!
readOnly
&&
<
Space
>
<
span
>
资产要素:
</
span
>
<
span
>
资产要素:
</
span
>
{
<
Button
type=
"primary"
onClick=
{
onImportElementBtnClick
}
>
导入
</
Button
>
!
readOnly
&&
<>
<
Button
type=
"primary"
onClick=
{
onExportElementBtnClick
}
>
导出
</
Button
>
<
Button
type=
"primary"
onClick=
{
onImportElementBtnClick
}
>
导入
</
Button
>
<
Popover
<
Button
type=
"primary"
onClick=
{
onExportElementBtnClick
}
>
导出
</
Button
>
placement=
"bottom"
</>
content=
{
<
FilterElement
onCancel=
{
onFilterElementVisibleChange
}
/>
}
}
title=
'资产要素过滤'
<
Popover
visible=
{
filterElementVisible
}
placement=
"bottom"
onVisibleChange=
{
onFilterElementVisibleChange
}
content=
{
<
FilterElement
onCancel=
{
onFilterElementVisibleChange
}
/>
}
trigger=
"hover"
>
title=
'资产要素过滤'
<
Button
type=
"primary"
>
过滤
</
Button
>
visible=
{
filterElementVisible
}
</
Popover
>
onVisibleChange=
{
onFilterElementVisibleChange
}
</
Space
>
trigger=
"hover"
>
}
<
Button
type=
"primary"
>
过滤
</
Button
>
</
Popover
>
</
Space
>
<
Space
className=
'ml-5'
>
<
Space
className=
'ml-5'
>
<
span
>
资产:
</
span
>
<
span
>
资产:
</
span
>
{
{
...
@@ -339,15 +341,19 @@ const AssetTable = (props) =>{
...
@@ -339,15 +341,19 @@ const AssetTable = (props) =>{
<
span
title=
{
assetNames
[
index
]
||
''
}
style=
{
{
marginLeft
:
8
}
}
>
{
assetNames
[
index
]
||
''
}
</
span
>
<
span
title=
{
assetNames
[
index
]
||
''
}
style=
{
{
marginLeft
:
8
}
}
>
{
assetNames
[
index
]
||
''
}
</
span
>
</
div
>
</
div
>
<
Space
className=
'm-3'
style=
{
{
marginLeft
:
'auto'
}
}
size=
'small'
>
<
Space
className=
'm-3'
style=
{
{
marginLeft
:
'auto'
}
}
size=
'small'
>
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
{
!
readOnly
&&
<
Tooltip
placement=
'bottom'
title=
{
'修改'
}
>
<
Button
icon=
{
<
EditOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
editAsset
(
item
);
}
}
/>
<
Button
icon=
{
<
EditOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
editAsset
(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
}
<
Tooltip
placement=
'bottom'
title=
{
'详情'
}
>
<
Tooltip
placement=
'bottom'
title=
{
'详情'
}
>
<
Button
icon=
{
<
ReconciliationOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
detailAsset
(
item
);
}
}
/>
<
Button
icon=
{
<
ReconciliationOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
detailAsset
(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
{
!
readOnly
&&
<
Tooltip
placement=
'bottom'
title=
{
'删除'
}
>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
deleteAsset
(
item
);
}
}
/>
<
Button
icon=
{
<
DeleteOutlined
/>
}
size=
'small'
onClick=
{
()
=>
{
deleteAsset
(
item
);
}
}
/>
</
Tooltip
>
</
Tooltip
>
}
</
Space
>
</
Space
>
</
div
>
</
div
>
<
Divider
/>
<
Divider
/>
...
...
src/view/Manage/AssetManage/Component/CustomDirectoryModal.jsx
View file @
0f273a7c
...
@@ -13,7 +13,9 @@ import { showMessage } from '../../../../util';
...
@@ -13,7 +13,9 @@ import { showMessage } from '../../../../util';
const
CustomDirectoryModal
=
(
props
)
=>
{
const
CustomDirectoryModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
action
,
dirId
}
=
props
;
const
{
visible
,
onCancel
,
action
,
dirId
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
data
,
setData
]
=
useState
([]);
const
[
data
,
setData
]
=
useState
([]);
const
[
filterData
,
setFilterData
]
=
useState
([]);
const
[
previewTreeData
,
setPreviewTreeData
]
=
useState
({});
const
[
previewTreeData
,
setPreviewTreeData
]
=
useState
({});
const
[
checkedValues
,
setCheckedValues
]
=
useState
([]);
const
[
checkedValues
,
setCheckedValues
]
=
useState
([]);
const
[
checkedData
,
setCheckedData
]
=
useState
([]);
const
[
checkedData
,
setCheckedData
]
=
useState
([]);
...
@@ -43,6 +45,7 @@ const CustomDirectoryModal = (props) => {
...
@@ -43,6 +45,7 @@ const CustomDirectoryModal = (props) => {
type
:
'assetmanage.listCustomElements'
,
type
:
'assetmanage.listCustomElements'
,
callback
:
elements
=>
{
callback
:
elements
=>
{
setData
(
elements
||
[]);
setData
(
elements
||
[]);
setFilterData
((
elements
||
[]).
filter
(
item
=>
(
item
.
name
||
''
).
indexOf
(
keyword
)
!==-
1
));
if
(
action
===
'edit'
)
{
if
(
action
===
'edit'
)
{
getCurrentDirectory
(
elements
||
[]);
getCurrentDirectory
(
elements
||
[]);
}
}
...
@@ -59,7 +62,7 @@ const CustomDirectoryModal = (props) => {
...
@@ -59,7 +62,7 @@ const CustomDirectoryModal = (props) => {
callback
:
data
=>
{
callback
:
data
=>
{
setCheckedValues
(
data
.
elementIds
||
[]);
setCheckedValues
(
data
.
elementIds
||
[]);
form
.
setFieldsValue
({
name
:
data
.
name
||
''
,
desc
:
data
.
desc
||
''
});
form
.
setFieldsValue
({
name
:
data
.
name
||
''
,
desc
:
data
.
desc
||
''
});
onChange
(
data
.
elementIds
||
[],
elements
);
onCh
eckboxCh
ange
(
data
.
elementIds
||
[],
elements
);
}
}
})
})
}
}
...
@@ -76,7 +79,12 @@ const CustomDirectoryModal = (props) => {
...
@@ -76,7 +79,12 @@ const CustomDirectoryModal = (props) => {
})
})
}
}
const
onChange
=
(
checkedValues
,
elements
=
data
)
=>
{
const
onSearchChange
=
(
e
)
=>
{
setKeyword
(
e
.
target
.
value
);
setFilterData
((
data
||
[]).
filter
(
item
=>
(
item
.
name
||
''
).
indexOf
(
e
.
target
.
value
)
!==-
1
));
}
const
onCheckboxChange
=
(
checkedValues
,
elements
=
data
)
=>
{
setCheckedValues
(
checkedValues
);
setCheckedValues
(
checkedValues
);
const
_checkedData
=
[];
const
_checkedData
=
[];
...
@@ -93,6 +101,7 @@ const CustomDirectoryModal = (props) => {
...
@@ -93,6 +101,7 @@ const CustomDirectoryModal = (props) => {
const
reset
=
()
=>
{
const
reset
=
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
setKeyword
(
''
);
setCheckedValues
([]);
setCheckedValues
([]);
setCheckedData
([]);
setCheckedData
([]);
setPreviewTreeData
({});
setPreviewTreeData
({});
...
@@ -160,7 +169,7 @@ const CustomDirectoryModal = (props) => {
...
@@ -160,7 +169,7 @@ const CustomDirectoryModal = (props) => {
const
index
=
newCheckedValues
.
indexOf
(
id
);
const
index
=
newCheckedValues
.
indexOf
(
id
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
newCheckedValues
.
splice
(
index
,
1
);
newCheckedValues
.
splice
(
index
,
1
);
onChange
(
newCheckedValues
);
onCh
eckboxCh
ange
(
newCheckedValues
);
}
}
}
}
...
@@ -192,10 +201,16 @@ const CustomDirectoryModal = (props) => {
...
@@ -192,10 +201,16 @@ const CustomDirectoryModal = (props) => {
<
Row
gutter=
{
30
}
>
<
Row
gutter=
{
30
}
>
<
Col
span=
{
8
}
style=
{
{
borderRight
:
'1px solid #EFEFEF'
}
}
>
<
Col
span=
{
8
}
style=
{
{
borderRight
:
'1px solid #EFEFEF'
}
}
>
<
div
className=
'mb-3'
>
资产要素
</
div
>
<
div
className=
'mb-3'
>
资产要素
</
div
>
<
Input
value=
{
keyword
}
placeholder=
'请输入资产要素'
style=
{
{
marginBottom
:
10
}
}
onChange=
{
(
e
)
=>
{
onSearchChange
(
e
)
}
}
/>
<
div
style=
{
{
maxHeight
:
500
,
overflow
:
'auto'
}
}
>
<
div
style=
{
{
maxHeight
:
500
,
overflow
:
'auto'
}
}
>
<
Checkbox
.
Group
value=
{
checkedValues
}
onChange=
{
onChange
}
>
<
Checkbox
.
Group
value=
{
checkedValues
}
onChange=
{
onCh
eckboxCh
ange
}
>
{
{
(
d
ata
||
[]).
map
((
item
,
index
)
=>
{
(
filterD
ata
||
[]).
map
((
item
,
index
)
=>
{
return
(
return
(
<
Row
key=
{
index
}
>
<
Row
key=
{
index
}
>
<
Checkbox
value=
{
item
.
id
||
''
}
>
{
item
.
name
||
''
}
</
Checkbox
>
<
Checkbox
value=
{
item
.
id
||
''
}
>
{
item
.
name
||
''
}
</
Checkbox
>
...
...
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