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
346fee25
Commit
346fee25
authored
Jun 25, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产地图性能优化
parent
d0a3ee91
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
37 deletions
+23
-37
AssetMount.jsx
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
+2
-1
index.jsx
src/view/Manage/AssetRecycle/index.jsx
+1
-0
Org.jsx
src/view/Manage/Map/Component/Org.jsx
+6
-4
SquareItem.jsx
src/view/Manage/Map/Component/SquareItem.jsx
+0
-1
SquareItem.less
src/view/Manage/Map/Component/SquareItem.less
+0
-5
MapContent.jsx
src/view/Manage/Map/MapContent.jsx
+14
-26
No files found.
src/view/Manage/AssetRecycle/Component/AssetMount.jsx
View file @
346fee25
...
@@ -48,7 +48,8 @@ const AssetMount = (props) => {
...
@@ -48,7 +48,8 @@ const AssetMount = (props) => {
>
>
<
AssetTree
<
AssetTree
readOnly=
{
true
}
readOnly=
{
true
}
onSelect=
{
(
value
)
=>
setNodeId
(
value
)
}
onSelect=
{
(
value
)
=>
setNodeId
(
value
)
}
{
...
props
}
/>
/>
</
Modal
>
</
Modal
>
)
)
...
...
src/view/Manage/AssetRecycle/index.jsx
View file @
346fee25
...
@@ -231,6 +231,7 @@ const AssetRecycle = (props) => {
...
@@ -231,6 +231,7 @@ const AssetRecycle = (props) => {
visible=
{
assetMountVisible
}
visible=
{
assetMountVisible
}
id=
{
currentAssetId
}
id=
{
currentAssetId
}
onCancel=
{
onAssetMountCancel
}
onCancel=
{
onAssetMountCancel
}
{
...
props
}
/>
/>
{
contextHolder
}
{
contextHolder
}
</
div
>
</
div
>
...
...
src/view/Manage/Map/Component/Org.jsx
View file @
346fee25
...
@@ -62,6 +62,7 @@ class Org extends React.Component {
...
@@ -62,6 +62,7 @@ class Org extends React.Component {
textAlign
:
'left'
,
textAlign
:
'left'
,
textBaseline
:
'middle'
,
textBaseline
:
'middle'
,
text
:
(
cfg
.
label
||
''
),
text
:
(
cfg
.
label
||
''
),
cursor
:
'pointer'
,
}
}
});
});
...
@@ -77,6 +78,7 @@ class Org extends React.Component {
...
@@ -77,6 +78,7 @@ class Org extends React.Component {
symbol
:
EXPAND_ICON
,
symbol
:
EXPAND_ICON
,
stroke
:
'#73d13d'
,
stroke
:
'#73d13d'
,
lineWidth
:
2
,
lineWidth
:
2
,
cursor
:
'pointer'
,
}
}
});
});
}
else
if
((
cfg
.
children
||
[]).
length
>
0
)
{
}
else
if
((
cfg
.
children
||
[]).
length
>
0
)
{
...
@@ -88,6 +90,7 @@ class Org extends React.Component {
...
@@ -88,6 +90,7 @@ class Org extends React.Component {
symbol
:
cfg
.
collapsed
?
EXPAND_ICON
:
COLLAPSE_ICON
,
symbol
:
cfg
.
collapsed
?
EXPAND_ICON
:
COLLAPSE_ICON
,
stroke
:
cfg
.
collapsed
?
'#73d13d'
:
'#ff4d4f'
,
stroke
:
cfg
.
collapsed
?
'#73d13d'
:
'#ff4d4f'
,
lineWidth
:
2
,
lineWidth
:
2
,
cursor
:
'pointer'
,
}
}
});
});
}
}
...
@@ -255,14 +258,13 @@ class Org extends React.Component {
...
@@ -255,14 +258,13 @@ class Org extends React.Component {
const
model
=
node
.
getModel
();
const
model
=
node
.
getModel
();
if
(
model
.
dbType
===
'Dir'
)
{
if
(
model
.
dbType
===
'
Root'
||
model
.
dbType
===
'
Dir'
)
{
const
children
=
model
.
children
;
const
children
=
model
.
children
;
if
(
!
children
&&
loadMoreData
)
{
if
(
!
children
&&
loadMoreData
)
{
loadMoreData
(
model
.
dirId
||
''
,
nodeId
);
loadMoreData
(
model
.
dirId
||
''
,
nodeId
);
}
}
}
else
if
(
model
.
dbType
!==
'Root'
)
{
}
else
if
(
model
.
dbType
===
'Table'
)
{
//通过资产id跳转到资产详情页
// history && history.push(`${ContextPath}/home`);
}
}
});
});
...
...
src/view/Manage/Map/Component/SquareItem.jsx
View file @
346fee25
...
@@ -11,7 +11,6 @@ const colors = [
...
@@ -11,7 +11,6 @@ const colors = [
'from-cyan-400 to-lightBlue-500'
,
'from-cyan-400 to-lightBlue-500'
,
'from-green-400 to-cyan-500'
,
'from-green-400 to-cyan-500'
,
'from-yellow-400 to-orange-500'
,
'from-yellow-400 to-orange-500'
,
'from-light-blue-400 to-indigo-500'
,
];
];
class
SquareItem
extends
React
.
Component
{
class
SquareItem
extends
React
.
Component
{
...
...
src/view/Manage/Map/Component/SquareItem.less
View file @
346fee25
...
@@ -4,14 +4,9 @@
...
@@ -4,14 +4,9 @@
color: #fff !important;
color: #fff !important;
font-size: 20px !important;
font-size: 20px !important;
font-weight: bold !important;
font-weight: bold !important;
// :hover {
// color: #1890ff;
// }
}
}
.yy-card-body {
.yy-card-body {
// color: #1890ff !important;
font-size: 18px !important;
font-size: 18px !important;
height: 76px !important;
height: 76px !important;
}
}
...
...
src/view/Manage/Map/MapContent.jsx
View file @
346fee25
...
@@ -8,7 +8,7 @@ import Tree from './Component/Tree';
...
@@ -8,7 +8,7 @@ import Tree from './Component/Tree';
import
Relation
from
'./Component/Relation'
;
import
Relation
from
'./Component/Relation'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../model'
;
import
{
dispatch
,
dispatchLatest
}
from
'../../../model'
;
const
column
=
3
;
const
column
=
4
;
class
MapContent
extends
React
.
Component
{
class
MapContent
extends
React
.
Component
{
...
@@ -92,6 +92,10 @@ class MapContent extends React.Component {
...
@@ -92,6 +92,10 @@ class MapContent extends React.Component {
item
.
id
=
`t
${
parentDirId
}${
item
.
id
||
''
}${
index
}
`
;
item
.
id
=
`t
${
parentDirId
}${
item
.
id
||
''
}${
index
}
`
;
}
}
if
(
index
===
10
)
{
item
.
text
=
'点击加载更多'
;
}
if
(
item
.
children
)
{
if
(
item
.
children
)
{
this
.
convertRemoteData
(
item
.
children
,
item
.
dirId
||
''
);
this
.
convertRemoteData
(
item
.
children
,
item
.
dirId
||
''
);
}
}
...
@@ -103,9 +107,10 @@ class MapContent extends React.Component {
...
@@ -103,9 +107,10 @@ class MapContent extends React.Component {
return
{
return
{
text
:
topic
.
name
||
''
,
text
:
topic
.
name
||
''
,
dirId
:
topic
.
id
,
id
:
`t
${
topic
.
id
}
`
,
id
:
`t
${
topic
.
id
}
`
,
dbType
:
'Root'
,
dbType
:
'Root'
,
children
:
data
children
:
(
data
||
[]).
length
===
0
?
null
:
data
};
};
}
}
...
@@ -171,13 +176,6 @@ class MapContent extends React.Component {
...
@@ -171,13 +176,6 @@ class MapContent extends React.Component {
const
{
type
,
topic
,
switchMode
}
=
this
.
props
;
const
{
type
,
topic
,
switchMode
}
=
this
.
props
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
,
currentLevel
,
totalLevel
}
=
this
.
state
;
const
{
curTableModelData
,
breadcrumbContents
,
orgModelData
,
treeModelData
,
relationModelData
,
orgChildData
,
treeChildData
,
relationChildData
,
parentNodeId
,
currentLevel
,
totalLevel
}
=
this
.
state
;
let
groups
=
[];
if
(
curTableModelData
)
{
for
(
var
i
=
0
;
i
<
curTableModelData
.
length
;
i
+=
column
)
{
groups
.
push
(
curTableModelData
.
slice
(
i
,
i
+
column
));
}
}
if
(
type
===
'square'
)
{
if
(
type
===
'square'
)
{
return
(
return
(
<
div
className=
'position-relative p-3 from-blueGray-200 bg-gradient-to-b'
style=
{
{
height
:
'100%'
}
}
>
<
div
className=
'position-relative p-3 from-blueGray-200 bg-gradient-to-b'
style=
{
{
height
:
'100%'
}
}
>
...
@@ -207,30 +205,20 @@ class MapContent extends React.Component {
...
@@ -207,30 +205,20 @@ class MapContent extends React.Component {
{
switchMode
}
{
switchMode
}
</
div
>
</
div
>
</
div
>
</
div
>
<
Row
gutter=
{
10
}
>
{
{
groups
&&
groups
.
map
((
group
,
index
)
=>
{
curTableModelData
&&
curTableModelData
.
map
((
item
,
index
)
=>
{
return
(
return
(
<
div
key=
{
index
}
>
<
Col
className=
'mt-3'
key=
{
index
}
xs=
{
24
}
md=
{
8
}
lg=
{
6
}
>
<
Row
gutter=
{
10
}
className=
{
index
===
0
?
''
:
'mt-3'
}
>
<
SquareItem
item=
{
item
}
index=
{
index
}
onClick=
{
this
.
onSquareItemClick
}
{
...
this
.
props
}
/>
{
</
Col
>
group
&&
group
.
map
((
item
,
_index
)
=>
{
return
(
<
Col
key=
{
_index
}
xs=
{
24
}
md=
{
8
}
lg=
{
6
}
//span=
{24
/
column
}
>
<
SquareItem
item=
{
item
}
index=
{
(
index
*
column
+
_index
)
}
onClick=
{
this
.
onSquareItemClick
}
{
...
this
.
props
}
/>
</
Col
>
)
})
}
</
Row
>
{
(
index
===
groups
.
length
-
1
)
&&
<
div
style=
{
{
height
:
10
}
}
/>
}
</
div
>
)
)
})
})
}
}
</
Row
>
<
div
style=
{
{
height
:
10
}
}
/>
</>
</>
}
}
</
div
>
</
div
>
);
);
}
else
{
}
else
{
...
...
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