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
bf66e0c5
Commit
bf66e0c5
authored
Feb 20, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产管理
parent
64d23a20
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
122 additions
and
35 deletions
+122
-35
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+19
-3
AssetDirectory.jsx
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
+3
-3
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+41
-18
AssetTable.less
src/view/Manage/AssetManage/Component/AssetTable.less
+12
-0
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+8
-2
ElementManage.jsx
src/view/Manage/AssetManage/Component/ElementManage.jsx
+7
-1
FilterElementModal.jsx
src/view/Manage/AssetManage/Component/FilterElementModal.jsx
+3
-2
ImportElement.jsx
src/view/Manage/AssetManage/Component/ImportElement.jsx
+1
-1
index.jsx
src/view/Manage/AssetManage/index.jsx
+27
-5
index.less
src/view/Manage/AssetManage/index.less
+1
-0
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
bf66e0c5
...
@@ -9,7 +9,7 @@ import { unfoldedElements } from '../util';
...
@@ -9,7 +9,7 @@ import { unfoldedElements } from '../util';
const
AssetAction
=
(
props
)
=>
{
const
AssetAction
=
(
props
)
=>
{
const
{
id
,
dirId
,
action
,
terms
}
=
props
;
const
{
id
,
dirId
,
action
,
terms
,
onChange
}
=
props
;
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
[],
attributes
:
[],
attributesFoldMap
:
{}
});
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
[],
attributes
:
[],
attributesFoldMap
:
{}
});
...
@@ -17,6 +17,7 @@ const AssetAction = (props) => {
...
@@ -17,6 +17,7 @@ const AssetAction = (props) => {
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
confirmLoading
,
setConfirmLoading
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
const
{
assets
,
attributes
,
attributesFoldMap
}
=
assetParams
;
...
@@ -149,6 +150,7 @@ const AssetAction = (props) => {
...
@@ -149,6 +150,7 @@ const AssetAction = (props) => {
setCurrentAction
(
'detail'
);
setCurrentAction
(
'detail'
);
getAsset
();
getAsset
();
showMessage
(
"success"
,(
action
===
'add'
)?
"新增成功"
:
"修改成功"
);
showMessage
(
"success"
,(
action
===
'add'
)?
"新增成功"
:
"修改成功"
);
onChange
&&
onChange
();
},
},
error
:
()
=>
{
error
:
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
...
@@ -168,6 +170,10 @@ const AssetAction = (props) => {
...
@@ -168,6 +170,10 @@ const AssetAction = (props) => {
setAssetParams
({...
assetParams
,
attributesFoldMap
:
newAttributesFoldMap
});
setAssetParams
({...
assetParams
,
attributesFoldMap
:
newAttributesFoldMap
});
}
}
const
onFullScreenClick
=
()
=>
{
setFullScreen
(
!
fullScreen
);
}
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
labelCol
:
{
xs
:
{
span
:
24
},
xs
:
{
span
:
24
},
...
@@ -184,7 +190,14 @@ const AssetAction = (props) => {
...
@@ -184,7 +190,14 @@ const AssetAction = (props) => {
className=
'flex'
className=
'flex'
style=
{
{
style=
{
{
height
:
'100%'
,
height
:
'100%'
,
flexDirection
:
'column'
flexDirection
:
'column'
,
position
:
fullScreen
?
'absolute'
:
'relative'
,
left
:
0
,
right
:
0
,
top
:
0
,
bottom
:
0
,
backgroundColor
:
'#fff'
,
zIndex
:
fullScreen
?
100
:
0
,
}
}
}
}
>
>
<
div
<
div
...
@@ -199,17 +212,20 @@ const AssetAction = (props) => {
...
@@ -199,17 +212,20 @@ const AssetAction = (props) => {
<
div
style=
{
{
color
:
'rgba(0,0,0,0.75)'
}
}
>
资产详情
</
div
>
<
div
style=
{
{
color
:
'rgba(0,0,0,0.75)'
}
}
>
资产详情
</
div
>
<
Space
>
<
Space
>
<
Button
loading=
{
confirmLoading
}
onClick=
{
onActionButtonClick
}
>
{
currentAction
===
'detail'
?
'编辑'
:
'保存'
}
</
Button
>
<
Button
loading=
{
confirmLoading
}
onClick=
{
onActionButtonClick
}
>
{
currentAction
===
'detail'
?
'编辑'
:
'保存'
}
</
Button
>
<
Button
onClick=
{
onFullScreenClick
}
>
全屏
</
Button
>
</
Space
>
</
Space
>
</
div
>
</
div
>
<
div
<
div
style=
{
{
style=
{
{
flex
:
1
,
flex
:
1
,
overflow
:
'auto'
overflow
:
'auto'
,
}
}
}
}
>
>
<
Spin
<
Spin
spinning=
{
loading
}
spinning=
{
loading
}
style=
{
{
marginTop
:
30
}
}
>
>
{
{
(
attributes
||
[]).
map
((
attribute
,
index
)
=>
{
(
attributes
||
[]).
map
((
attribute
,
index
)
=>
{
...
...
src/view/Manage/AssetManage/Component/AssetDirectory.jsx
View file @
bf66e0c5
...
@@ -6,7 +6,7 @@ import { dispatch } from '../../../../model';
...
@@ -6,7 +6,7 @@ import { dispatch } from '../../../../model';
import
record
from
'../../../../assets/record.png'
;
import
record
from
'../../../../assets/record.png'
;
const
AssetDirectory
=
(
props
)
=>
{
const
AssetDirectory
=
(
props
)
=>
{
const
{
id
}
=
props
;
const
{
id
,
directoryChanged
,
assetCount
}
=
props
;
const
[
dir
,
setDir
]
=
useState
(
null
);
const
[
dir
,
setDir
]
=
useState
(
null
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
@@ -15,7 +15,7 @@ const AssetDirectory = (props) => {
...
@@ -15,7 +15,7 @@ const AssetDirectory = (props) => {
getDirectory
();
getDirectory
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
id
])
},
[
id
,
directoryChanged
])
const
getDirectory
=
()
=>
{
const
getDirectory
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
...
@@ -70,7 +70,7 @@ const AssetDirectory = (props) => {
...
@@ -70,7 +70,7 @@ const AssetDirectory = (props) => {
<
img
src=
{
record
}
style=
{
{
width
:
30
,
height
:
30
}
}
alt=
""
/>
<
img
src=
{
record
}
style=
{
{
width
:
30
,
height
:
30
}
}
alt=
""
/>
<
div
>
<
div
>
<
div
>
记录数
</
div
>
<
div
>
记录数
</
div
>
<
div
>
0
</
div
>
<
div
>
{
assetCount
}
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
...
...
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
bf66e0c5
...
@@ -12,10 +12,11 @@ import { showMessage, showNotifaction, getQueryParam, inputWidth, isSzseEnv } fr
...
@@ -12,10 +12,11 @@ import { showMessage, showNotifaction, getQueryParam, inputWidth, isSzseEnv } fr
import
{
AnchorId
,
AnchorTimestamp
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
AnchorTimestamp
}
from
'../../../../util/constant'
;
import
"./AssetTable.less"
;
import
"./AssetTable.less"
;
import
{
select
}
from
"redux-saga/effects"
;
const
AssetTable
=
(
props
)
=>
{
const
AssetTable
=
(
props
)
=>
{
const
{
readOnly
=
false
,
className
,
nodeId
,
nodeType
,
onSelect
}
=
props
;
const
{
readOnly
=
false
,
className
,
nodeId
,
nodeType
,
elementsChanged
,
assetActionChanged
,
onSelect
,
onCountChange
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
columns
,
setColumns
]
=
useState
([]);
const
[
columns
,
setColumns
]
=
useState
([]);
const
[
assets
,
setAssets
]
=
useState
([]);
const
[
assets
,
setAssets
]
=
useState
([]);
...
@@ -32,6 +33,7 @@ const AssetTable = (props) => {
...
@@ -32,6 +33,7 @@ const AssetTable = (props) => {
const
{
pageNum
,
pageSize
}
=
pagination
;
const
{
pageNum
,
pageSize
}
=
pagination
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
batchCatalogChange
,
setBatchCatalogChange
]
=
useState
(
false
);
const
[
batchCatalogChange
,
setBatchCatalogChange
]
=
useState
(
false
);
const
[
fullScreen
,
setFullScreen
]
=
useState
(
false
);
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
const
anchorId
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
...
@@ -42,6 +44,9 @@ const AssetTable = (props) => {
...
@@ -42,6 +44,9 @@ const AssetTable = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
nodeId
||
''
)
!==
''
)
{
if
((
nodeId
||
''
)
!==
''
)
{
setKeyword
(
''
);
setSelectKey
(
''
);
setCheckedKeys
([]);
if
(
shouldScrollRef
.
current
===
true
)
{
if
(
shouldScrollRef
.
current
===
true
)
{
...
@@ -52,9 +57,6 @@ const AssetTable = (props) => {
...
@@ -52,9 +57,6 @@ const AssetTable = (props) => {
setPagination
({
...
pagination
,
pageNum
:
1
});
setPagination
({
...
pagination
,
pageNum
:
1
});
}
}
setKeyword
(
''
);
setCheckedKeys
([]);
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
nodeId
])
},
[
nodeId
])
...
@@ -73,7 +75,7 @@ const AssetTable = (props) => {
...
@@ -73,7 +75,7 @@ const AssetTable = (props) => {
getFilterElementsGroupThenGetDataAssets
();
getFilterElementsGroupThenGetDataAssets
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
,
pagination
])
},
[
keyword
,
pagination
,
elementsChanged
,
assetActionChanged
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
shouldScrollRef
.
current
)
{
if
(
shouldScrollRef
.
current
)
{
...
@@ -244,9 +246,21 @@ const AssetTable = (props) => {
...
@@ -244,9 +246,21 @@ const AssetTable = (props) => {
})
})
setAssets
(
_assets
);
setAssets
(
_assets
);
setSelectKey
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
);
onSelect
&&
onSelect
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
)
if
((
selectKey
||
''
)
!==
''
)
{
const
index
=
_assets
.
findIndex
((
asset
)
=>
asset
.
id
===
selectKey
);
if
(
index
===
-
1
)
{
setSelectKey
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
);
onSelect
&&
onSelect
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
);
}
}
else
{
setSelectKey
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
);
onSelect
&&
onSelect
(
_assets
.
length
>
0
?
_assets
[
0
].
id
:
''
);
}
setTotal
(
data
.
total
||
0
);
setTotal
(
data
.
total
||
0
);
onCountChange
&&
onCountChange
(
data
.
total
||
0
);
setLoading
(
false
);
setLoading
(
false
);
},
},
error
:
()
=>
{
error
:
()
=>
{
...
@@ -352,13 +366,18 @@ const AssetTable = (props) => {
...
@@ -352,13 +366,18 @@ const AssetTable = (props) => {
setCheckedKeys
(
keys
);
setCheckedKeys
(
keys
);
};
};
const
onFullScreenClick
=
()
=>
{
setFullScreen
(
!
fullScreen
);
}
const
rowSelection
=
{
const
rowSelection
=
{
selectedRowKeys
:
checkedKeys
,
selectedRowKeys
:
checkedKeys
,
onChange
:
onSelectChange
,
onChange
:
onSelectChange
,
};
};
const
classes
=
classNames
(
'asset-list'
,
className
,
{
const
classes
=
classNames
(
'asset-list'
,
className
,
{
'asset-list-read-only'
:
readOnly
'asset-list-read-only'
:
readOnly
,
'asset-list-fullscreen'
:
fullScreen
,
});
});
return
(
return
(
...
@@ -369,7 +388,8 @@ const AssetTable = (props) => {
...
@@ -369,7 +388,8 @@ const AssetTable = (props) => {
alignItems
:
'center'
,
alignItems
:
'center'
,
justifyContent
:
'space-between'
,
justifyContent
:
'space-between'
,
borderBottom
:
'1px solid #EFEFEF'
,
borderBottom
:
'1px solid #EFEFEF'
,
height
:
52
height
:
52
,
padding
:
fullScreen
?
'0 15px'
:
'0'
}
}
}
}
>
>
<
Space
>
<
Space
>
...
@@ -395,17 +415,20 @@ const AssetTable = (props) => {
...
@@ -395,17 +415,20 @@ const AssetTable = (props) => {
</
Tooltip
>
</
Tooltip
>
}
}
</
Space
>
</
Space
>
<
Input
<
Space
>
placeholder=
"请输入资产要素值"
<
Input
allowClear
placeholder=
"请输入资产要素值"
value=
{
keyword
}
allowClear
onChange=
{
onSearchInputChange
}
value=
{
keyword
}
style=
{
{
width
:
inputWidth
}
}
onChange=
{
onSearchInputChange
}
/>
style=
{
{
width
:
inputWidth
}
}
/>
<
Button
onClick=
{
onFullScreenClick
}
>
全屏
</
Button
>
</
Space
>
</
div
>
</
div
>
<
div
<
div
style=
{
{
style=
{
{
padding
:
'12px 0 0'
,
padding
:
fullScreen
?
'12px 15px 0'
:
'12px 0 0'
,
}
}
}
}
>
>
<
Table
<
Table
...
@@ -432,7 +455,7 @@ const AssetTable = (props) => {
...
@@ -432,7 +455,7 @@ const AssetTable = (props) => {
dataSource=
{
assets
}
dataSource=
{
assets
}
pagination=
{
false
}
pagination=
{
false
}
size=
'default'
size=
'default'
scroll=
{
{
x
:
1000
,
y
:
(
assets
||
[]).
length
>
0
?
'calc(100vh - 182px - 52px - 52px - 84px - 12px)'
:
null
}
}
scroll=
{
{
x
:
1000
,
y
:
(
assets
||
[]).
length
>
0
?
(
fullScreen
?
'calc(100vh - 182px - 12px - 50px)'
:
'calc(100vh - 182px - 52px - 52px - 84px - 12px)'
)
:
null
}
}
/>
/>
</
div
>
</
div
>
<
Pagination
<
Pagination
...
...
src/view/Manage/AssetManage/Component/AssetTable.less
View file @
bf66e0c5
@import '../../../../variables.less';
@import '../../../../variables.less';
.asset-list {
.asset-list {
background-color: #fff;
z-index: 0;
.highlight-row {
.highlight-row {
.yy-table-cell {
.yy-table-cell {
background-color: #e7f7ff !important;
background-color: #e7f7ff !important;
}
}
}
}
}
.asset-list-fullscreen {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 100;
}
}
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
bf66e0c5
...
@@ -13,7 +13,7 @@ import './AssetTree.less';
...
@@ -13,7 +13,7 @@ import './AssetTree.less';
const
AssetTree
=
(
props
)
=>
{
const
AssetTree
=
(
props
)
=>
{
const
{
readOnly
=
false
,
checkable
=
false
,
onSelect
,
className
,
onCheck
,
tableId
,
reference
=
''
,
showCustom
=
true
}
=
props
;
const
{
readOnly
=
false
,
checkable
=
false
,
onSelect
,
className
,
onCheck
,
tableId
,
reference
=
''
,
showCustom
=
true
,
onDirectoryChange
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeData
,
setTreeData
]
=
useState
([]);
...
@@ -388,7 +388,13 @@ const AssetTree = (props) => {
...
@@ -388,7 +388,13 @@ const AssetTree = (props) => {
const
onUpdateDirectoryCancel
=
(
refresh
=
false
)
=>
{
const
onUpdateDirectoryCancel
=
(
refresh
=
false
)
=>
{
setUpdateDirectoryModalVisible
(
false
);
setUpdateDirectoryModalVisible
(
false
);
refresh
&&
getAllDirectoryAsTree
(
false
);
if
(
refresh
)
{
getAllDirectoryAsTree
(
false
);
if
(
updateDirectoryAction
===
'edit'
)
{
onDirectoryChange
&&
onDirectoryChange
();
}
}
}
}
const
onImportDirectoryCancel
=
(
refresh
=
false
,
resetCurrentDirId
=
false
)
=>
{
const
onImportDirectoryCancel
=
(
refresh
=
false
,
resetCurrentDirId
=
false
)
=>
{
...
...
src/view/Manage/AssetManage/Component/ElementManage.jsx
View file @
bf66e0c5
...
@@ -6,6 +6,8 @@ import AttributeRelationModal from "./AttributeRelationModal";
...
@@ -6,6 +6,8 @@ import AttributeRelationModal from "./AttributeRelationModal";
import
{
showNotifaction
}
from
'../../../../util'
;
import
{
showNotifaction
}
from
'../../../../util'
;
const
ElementManage
=
(
props
)
=>
{
const
ElementManage
=
(
props
)
=>
{
const
{
onChange
}
=
props
;
const
[
importElementVisible
,
setImportElementVisible
]
=
useState
(
false
);
const
[
importElementVisible
,
setImportElementVisible
]
=
useState
(
false
);
const
[
attributeRelationModalVisible
,
setAttributeRelationModalVisible
]
=
useState
(
false
);
const
[
attributeRelationModalVisible
,
setAttributeRelationModalVisible
]
=
useState
(
false
);
...
@@ -21,9 +23,13 @@ const ElementManage = (props) => {
...
@@ -21,9 +23,13 @@ const ElementManage = (props) => {
setAttributeRelationModalVisible
(
true
);
setAttributeRelationModalVisible
(
true
);
}
}
const
onImportElementCancel
=
(
visible
=
false
,
tip
=
''
)
=>
{
const
onImportElementCancel
=
(
visible
=
false
,
change
=
false
,
tip
=
''
)
=>
{
setImportElementVisible
(
visible
);
setImportElementVisible
(
visible
);
if
(
change
)
{
onChange
&&
onChange
();
}
if
(
tip
&&
tip
!==
''
)
{
if
(
tip
&&
tip
!==
''
)
{
showNotifaction
(
'导入提示'
,
tip
,
5
);
showNotifaction
(
'导入提示'
,
tip
,
5
);
}
}
...
...
src/view/Manage/AssetManage/Component/FilterElementModal.jsx
View file @
bf66e0c5
...
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
...
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Button
,
Switch
,
Modal
}
from
'antd'
;
import
{
Row
,
Col
,
Checkbox
,
Typography
,
Button
,
Switch
,
Modal
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
requireElements
}
from
'../util'
;
import
'./FilterElementModal.less'
;
import
'./FilterElementModal.less'
;
const
FilterElementModal
=
(
props
)
=>
{
const
FilterElementModal
=
(
props
)
=>
{
...
@@ -79,7 +80,7 @@ const FilterElementModal = (props) => {
...
@@ -79,7 +80,7 @@ const FilterElementModal = (props) => {
});
});
}
else
{
}
else
{
(
elements
||
[]).
forEach
(
element
=>
{
(
elements
||
[]).
forEach
(
element
=>
{
if
(
(
element
.
name
||
''
)
===
'中文名称'
||
(
element
.
name
||
''
)
===
'资产项'
)
{
if
(
requireElements
.
indexOf
(
element
.
name
||
''
)
!==-
1
)
{
_selectedKeys
.
push
(
element
.
id
||
''
);
_selectedKeys
.
push
(
element
.
id
||
''
);
}
}
});
});
...
@@ -165,7 +166,7 @@ const FilterElementModal = (props) => {
...
@@ -165,7 +166,7 @@ const FilterElementModal = (props) => {
return
(
return
(
<
Col
className=
'mb-3'
key=
{
_index
}
md=
{
6
}
>
<
Col
className=
'mb-3'
key=
{
_index
}
md=
{
6
}
>
<
div
className=
'd-flex'
>
<
div
className=
'd-flex'
>
<
Checkbox
checked=
{
selectedKeys
.
indexOf
(
element
.
id
||
''
)
!==-
1
}
value=
{
element
.
id
||
''
}
onChange=
{
onCheckChange
}
disabled=
{
(
element
.
name
||
''
)
===
'中文名称'
||
(
element
.
name
||
''
)
===
'资产项'
}
>
<
Checkbox
checked=
{
selectedKeys
.
indexOf
(
element
.
id
||
''
)
!==-
1
}
value=
{
element
.
id
||
''
}
onChange=
{
onCheckChange
}
disabled=
{
requireElements
.
indexOf
(
element
.
name
)
!==-
1
}
>
</
Checkbox
>
</
Checkbox
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
element
.
name
||
''
}
ellipsis
>
<
Typography
.
Paragraph
className=
'ml-1'
title=
{
element
.
name
||
''
}
ellipsis
>
{
element
.
name
||
''
}
{
element
.
name
||
''
}
...
...
src/view/Manage/AssetManage/Component/ImportElement.jsx
View file @
bf66e0c5
...
@@ -46,7 +46,7 @@ const ImportElement = (props) => {
...
@@ -46,7 +46,7 @@ const ImportElement = (props) => {
callback
:
data
=>
{
callback
:
data
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
reset
();
reset
();
onCancel
&&
onCancel
(
false
,
data
);
onCancel
&&
onCancel
(
false
,
true
,
data
);
},
},
error
:
()
=>
{
error
:
()
=>
{
setConfirmLoading
(
false
);
setConfirmLoading
(
false
);
...
...
src/view/Manage/AssetManage/index.jsx
View file @
bf66e0c5
...
@@ -17,6 +17,11 @@ const AssetManage = (props) => {
...
@@ -17,6 +17,11 @@ const AssetManage = (props) => {
const
[
assetId
,
setAssetId
]
=
useState
(
''
);
const
[
assetId
,
setAssetId
]
=
useState
(
''
);
const
[
expandTree
,
setExpandTree
]
=
useState
(
true
);
const
[
expandTree
,
setExpandTree
]
=
useState
(
true
);
const
[
assetCount
,
setAssetCount
]
=
useState
(
0
);
const
[
directoryChanged
,
setDirectoryChanged
]
=
useState
(
false
);
const
[
elementsChanged
,
setElementsChanged
]
=
useState
(
false
);
const
[
assetActionChanged
,
setAssetActionChanged
]
=
useState
(
false
);
const
onTreeSelect
=
(
value
,
type
)
=>
{
const
onTreeSelect
=
(
value
,
type
)
=>
{
setNodeId
(
value
||
''
);
setNodeId
(
value
||
''
);
...
@@ -31,6 +36,22 @@ const AssetManage = (props) => {
...
@@ -31,6 +36,22 @@ const AssetManage = (props) => {
setExpandTree
(
!
expandTree
);
setExpandTree
(
!
expandTree
);
}
}
const
onElementsChange
=
()
=>
{
setElementsChanged
(
!
elementsChanged
);
}
const
onDirectoryChange
=
()
=>
{
setDirectoryChanged
(
!
directoryChanged
);
}
const
onAssetActionChange
=
()
=>
{
setAssetActionChanged
(
!
assetActionChanged
);
}
const
onAssetCountChange
=
(
count
)
=>
{
setAssetCount
(
count
);
}
const
classes
=
classNames
(
'asset-manage'
,
{
const
classes
=
classNames
(
'asset-manage'
,
{
'asset-manage-collapse'
:
!
expandTree
'asset-manage-collapse'
:
!
expandTree
});
});
...
@@ -38,7 +59,7 @@ const AssetManage = (props) => {
...
@@ -38,7 +59,7 @@ const AssetManage = (props) => {
return
(
return
(
<
div
className=
{
classes
}
>
<
div
className=
{
classes
}
>
<
div
className=
'left'
>
<
div
className=
'left'
>
<
AssetTree
onSelect=
{
onTreeSelect
}
{
...
props
}
/>
<
AssetTree
onSelect=
{
onTreeSelect
}
onDirectoryChange=
{
onDirectoryChange
}
{
...
props
}
/>
</
div
>
</
div
>
<
div
className=
'tree-toggle-wrap'
>
<
div
className=
'tree-toggle-wrap'
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
<
div
className=
'tree-toggle'
onClick=
{
treeToggleClick
}
>
...
@@ -46,13 +67,14 @@ const AssetManage = (props) => {
...
@@ -46,13 +67,14 @@ const AssetManage = (props) => {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'middle'
>
<
div
className=
'middle'
>
<
ElementManage
/>
<
ElementManage
onChange=
{
onElementsChange
}
/>
<
AssetDirectory
id=
{
nodeId
}
/>
<
AssetDirectory
id=
{
nodeId
}
assetCount=
{
assetCount
}
directoryChanged=
{
directoryChanged
}
/>
<
AssetTable
nodeId=
{
nodeId
}
nodeType=
{
nodeType
}
onSelect=
{
onTableSelect
}
{
...
props
}
/>
<
AssetTable
nodeId=
{
nodeId
}
nodeType=
{
nodeType
}
elementsChanged=
{
elementsChanged
}
assetActionChanged=
{
assetActionChanged
}
onSelect=
{
onTableSelect
}
onCountChange=
{
onAssetCountChange
}
{
...
props
}
/>
</
div
>
</
div
>
<
div
className=
'right'
>
<
div
className=
'right'
>
<
AssetAction
id=
{
assetId
}
dirId=
{
nodeId
}
action=
'detail'
/>
<
AssetAction
id=
{
assetId
}
dirId=
{
nodeId
}
action=
'detail'
onChange=
{
onAssetActionChange
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
}
}
...
...
src/view/Manage/AssetManage/index.less
View file @
bf66e0c5
.asset-manage {
.asset-manage {
display: flex;
display: flex;
position: relative;
background-color: #fff;
background-color: #fff;
height: 100%;
height: 100%;
...
...
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