Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rongtong-pc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
融通安全管理系统
rongtong-pc
Commits
358b490b
Commit
358b490b
authored
Dec 20, 2023
by
kaitly205422@163.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大屏事故类型排序
parent
82a447f4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
25 deletions
+30
-25
src/assets/map/circle.jpg
src/assets/map/circle.jpg
+0
-0
src/views/map/components/map-table.vue
src/views/map/components/map-table.vue
+1
-1
src/views/map/map-index.vue
src/views/map/map-index.vue
+25
-20
vue.config.js
vue.config.js
+4
-4
No files found.
src/assets/map/circle.jpg
0 → 100644
View file @
358b490b
603 Bytes
src/views/map/components/map-table.vue
View file @
358b490b
...
...
@@ -32,7 +32,7 @@ export default {
this
.
mapTableContainerHeight
=
mapTableContainer
.
offsetHeight
-
50
;
}
let
mapTableList
=
this
.
$refs
.
mapTableList
;
this
.
mapTableListHeight
=
mapTableList
.
offsetHeight
;
this
.
mapTableListHeight
=
mapTableList
?
.
offsetHeight
;
},
// 比较map-table-list高度
compareH
()
{
...
...
src/views/map/map-index.vue
View file @
358b490b
...
...
@@ -505,7 +505,7 @@ export default {
const
num
=
res
.
data
.
find
(
val
=>
val
.
levelName
==
x
.
name
)
return
{
...
x
,
y
:
num
?.
levelNum
-
''
,
y
:
num
?.
levelNum
-
''
||
0
,
}
})
setTimeout
(()
=>
{
...
...
@@ -539,14 +539,29 @@ export default {
accidentType
()
{
rightAccidentType
({
areaName
:
this
.
areaName
,
type
:
''
,
level
:
this
.
level
-
1
}).
then
(
res
=>
{
d3
.
select
(
"
#circleEchart svg
"
).
remove
()
d3
.
select
(
"
#circleEchart svg
"
).
remove
()
;
if
(
!
res
.
data
.
length
)
return
;
const
data
=
res
.
data
,
count
=
res
.
data
.
length
-
1
,
centerCount
=
Math
.
ceil
(
count
/
2
),
start
=
centerCount
-
1
,
end
=
centerCount
+
1
;
let
mapData
=
res
.
data
.
slice
(
start
,
end
);
//取中间值作为圆心
let
countI
=
0
;
while
(
countI
<
count
/
2
)
{
//将数据按照大小交替排序
const
inverCountI
=
end
+
countI
;
inverCountI
<=
count
&&
mapData
.
push
(
data
[
inverCountI
]);
countI
<
start
&&
mapData
.
push
(
data
[
countI
]);
countI
++
;
}
//
if
(
mapData
.
length
>=
6
)
{
mapData
.
length
==
6
&&
mapData
.
push
({
typeName
:
''
});
[
mapData
[
5
],
mapData
[
6
]]
=
[
mapData
[
6
],
mapData
[
5
]];
}
const
maxNum
=
res
.
data
[
0
].
typeNum
;
const
max
=
30
,
min
=
12
;
const
max
=
40
,
min
=
15
;
// 使用D3.js库中的circlePack布局
const
ele
=
document
.
querySelector
(
'
#accident
'
)
const
containerWidth
=
ele
.
offsetWidth
,
containerHeight
=
ele
.
offsetHeight
;
const
circles
=
res
.
d
ata
.
map
((
x
,
index
)
=>
{
const
circles
=
mapD
ata
.
map
((
x
,
index
)
=>
{
return
{
radius
:
Math
.
max
(
max
*
x
.
typeNum
/
maxNum
,
min
),
name
:
x
.
typeName
,
...
...
@@ -560,25 +575,12 @@ export default {
.
padding
(
10
);
// 可选项,设置圆之间的间距
let
i
=
0
const
root
=
d3
.
hierarchy
({
children
:
circles
})
.
sum
(
d
=>
d
.
radius
*
2
)
.
sort
((
a
,
b
)
=>
{
//圆从中间开始排序,所有要把中间的球放在最开始
i
++
if
(
i
<
(
res
.
data
.
length
/
2
))
{
return
a
.
data
.
radius
-
b
.
data
.
radius
}
return
b
.
data
.
radius
-
a
.
data
.
radius
});
.
sum
(
d
=>
d
.
radius
*
2
);
/**
* 重排圆
* 1.获取大圆&&小圆中有y比它小的
*/
pack
(
root
);
// root.children.forEach((val, index) => {
// if (index > 1 && index
<
(
res
.
data
.
length
/
2
)
&&
index
%
2
==
0
)
{
// [root.children[index], root.children[res.data.length - 1 - index]] = [root.children[res.data.length - 1 - index], root.children[index]]
// }
// })
// 将root.children按照从小到大排序
// const rootChildren = root.children;
...
...
@@ -600,7 +602,6 @@ export default {
// }
// }
console
.
log
(
root
.
children
.
map
(
x
=>
x
.
data
.
name
))
pack
(
root
);
// 渲染结果
const
svg
=
d3
.
select
(
"
#circleEchart
"
)
...
...
@@ -784,6 +785,7 @@ export default {
scatters
.
push
(...
val
.
projectList
.
map
(
x
=>
{
return
{
value
:
[
x
.
lng
-
''
,
x
.
lat
-
''
,
0
],
// symbol: "image://" + require('@/assets/login/user.png'),
itemStyle
:
{
color
:
x
.
riskColor
,
},
...
...
@@ -811,6 +813,8 @@ export default {
}
})
}
// 自定义scatter3D系列的symbol
this
.
myMap
.
setOption
(
{
geo3D
:
{
...
...
@@ -870,7 +874,8 @@ export default {
{
type
:
"
scatter3D
"
,
symbol
:
'
circle
'
,
symbolSize
:
6
,
// symbol: 'image://' + require('@/assets/map/circle.jpg'),
symbolSize
:
8
,
coordinateSystem
:
"
geo3D
"
,
data
:
scatters
,
zlevel
:
1
,
...
...
vue.config.js
View file @
358b490b
...
...
@@ -37,10 +37,10 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
// target: "http://192.168.10.137:8080/",
//
target: `http://192.168.4.232:8080`, //服务器地址
target
:
`http://192.168.4.232:8080`
,
//服务器地址
// target: `http://192.168.15.230:8081`, //晓晋本地地址
// target: `http://192.168.15.152:8081`, //鲍德本地地址
target
:
`http://127.0.0.1:8080`
,
//本地地址
//
target: `http://127.0.0.1:8080`, //本地地址
changeOrigin
:
true
,
pathRewrite
:
{
[
"
^
"
+
process
.
env
.
VUE_APP_BASE_API
]:
""
,
...
...
@@ -48,10 +48,10 @@ module.exports = {
},
"
/app-api
"
:
{
// target: "http://192.168.10.137:8080/",
//
target: `http://192.168.4.232:8080/`, //服务器地址
target
:
`http://192.168.4.232:8080/`
,
//服务器地址
// target: `http://192.168.15.230:8081`, //晓晋本地地址
// target: `http://192.168.15.152:8081`, //鲍德本地地址
target
:
`http://127.0.0.1:8080`
,
//本地地址
//
target: `http://127.0.0.1:8080`, //本地地址
changeOrigin
:
true
,
},
},
...
...
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