Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
雪碧有白泡泡
可视化 csdn 数据
提交
3d0164c1
可
可视化 csdn 数据
项目概览
雪碧有白泡泡
/
可视化 csdn 数据
与 Fork 源项目一致
Fork自
yma16 / 可视化 csdn 数据
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
可
可视化 csdn 数据
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3d0164c1
编写于
7月 20, 2023
作者:
6
63f1bb74d2451104dc7d8b9f
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Auto Commit
上级
e6261d12
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
79 addition
and
34 deletion
+79
-34
src/App.vue
src/App.vue
+5
-4
src/components/GameChart.vue
src/components/GameChart.vue
+74
-30
未找到文件。
src/App.vue
浏览文件 @
3d0164c1
...
@@ -3,7 +3,7 @@ import GameChart from './components/GameChart.vue'
...
@@ -3,7 +3,7 @@ import GameChart from './components/GameChart.vue'
import
SearchGrade
from
'
./components/SearchGrade.vue
'
import
SearchGrade
from
'
./components/SearchGrade.vue
'
import
{
reactive
,
onMounted
}
from
'
vue
'
;
import
{
reactive
,
onMounted
}
from
'
vue
'
;
const
state
=
reactive
({
const
state
=
reactive
({
current
:
'
grade查询分数
'
current
:
'
新星赛道选手信息可视化
'
})
})
onMounted
(()
=>
{
onMounted
(()
=>
{
const
href
=
window
.
location
.
href
const
href
=
window
.
location
.
href
...
@@ -17,10 +17,11 @@ onMounted(() => {
...
@@ -17,10 +17,11 @@ onMounted(() => {
const
value
=
itemArray
[
1
]
const
value
=
itemArray
[
1
]
data
[
key
]
=
value
data
[
key
]
=
value
})
})
if
(
data
[
'
type
'
]
=
'
csdn_game
'
)
{
state
.
current
=
'
新星赛道选手信息可视化
'
}
}
}
if
(
data
[
'
type
'
]
=
'
csdn_game
'
){
state
.
current
=
'
新星赛道选手信息可视化
'
}
})
})
</
script
>
</
script
>
...
...
src/components/GameChart.vue
浏览文件 @
3d0164c1
...
@@ -4,15 +4,25 @@
...
@@ -4,15 +4,25 @@
<a
style=
"font-size: 24px;font-weight:bolder;"
>
{{
state
.
title
}}
</a>
<a
style=
"font-size: 24px;font-weight:bolder;"
>
{{
state
.
title
}}
</a>
</div>
</div>
</div>
</div>
<
div
style=
"width: 100%;text-align: right;line-height: 80px;"
>
<
Author
/
>
<a-button
@
click=
"initDataSource"
type=
"primary
"
>
<div
style=
"display: flex;height: 100px;margin:10px 0
"
>
重置表格
<div
style=
"width: 600px;"
>
</a-button
>
赛道信息:
<a
href=
"https://bbs.csdn.net/topics/616574177"
target=
"_blank"
>
https://bbs.csdn.net/topics/616574177
</a
>
</div>
</div>
<div
style=
"width: 100%;text-align: right;"
>
<a-button
@
click=
"initDataSource"
type=
"primary"
>
重置表格
</a-button>
</div>
</div>
<div>
参赛报名人数:
{{
state
.
totlaNum
}}
</div>
<div
style=
"display:flex"
>
<div
style=
"display:flex"
>
<div
id=
"barChartId"
style=
"flex:1;width:600px;height:900px;border: 1px solid #333;"
>
<div
id=
"barChartId"
style=
"flex:1;width:600px;height:900px;border: 1px solid #333;"
>
<div
style=
"width: 100%;font-weight: 600;text-align: center;"
>
{{
state
.
clickCity
}}
</div>
<div
style=
"width: 100%;font-weight: 600;text-align: center;"
>
{{
state
.
clickCity
}}
</div>
<div
id=
"barChartId"
style=
"width:600px;height:600px;margin: 0 auto;"
>
<div
id=
"barChartId"
style=
"width:600px;height:600px;margin: 0 auto;"
>
</div>
</div>
</div>
</div>
...
@@ -21,7 +31,7 @@
...
@@ -21,7 +31,7 @@
:loading="state.loading" :pagination="state.pagination" bordered style="border-bottom:1px solid #f0f0f0;">
:loading="state.loading" :pagination="state.pagination" bordered style="border-bottom:1px solid #f0f0f0;">
<template
#bodyCell
="
{ column, record }">
<template
#bodyCell
="
{ column, record }">
<template
v-if=
"column.key === 'imgSrc'"
>
<template
v-if=
"column.key === 'imgSrc'"
>
<a-image
:src=
"record.imgSrc"
height=
"50"
:alt=
"record.imgSrc"
/>
<a-image
:src=
"record.imgSrc"
height=
"50"
:alt=
"record.imgSrc"
/>
</
template
>
</
template
>
</template>
</template>
</a-table>
</a-table>
...
@@ -31,6 +41,7 @@
...
@@ -31,6 +41,7 @@
</template>
</template>
<
script
setup
>
<
script
setup
>
import
chinaJson
from
'
./chinaGeo.js
'
;
import
chinaJson
from
'
./chinaGeo.js
'
;
import
Author
from
'
./Author.vue
'
import
gameJson
from
'
./gameJson.js
'
;
import
gameJson
from
'
./gameJson.js
'
;
import
{
tableGameColumns
}
from
'
./const.js
'
import
{
tableGameColumns
}
from
'
./const.js
'
import
*
as
echarts
from
'
echarts
'
;
import
*
as
echarts
from
'
echarts
'
;
...
@@ -41,7 +52,8 @@ const props = defineProps({
...
@@ -41,7 +52,8 @@ const props = defineProps({
const
state
=
reactive
({
const
state
=
reactive
({
title
:
'
vue3 ts antd 参赛选手所在城市
'
,
title
:
'
vue3 ts antd 参赛选手所在城市
'
,
clickCity
:
'
全国
'
,
clickCity
:
'
全国
'
,
totlaNum
:
''
,
linesCoord
:
[],
linesCoord
:
[],
focusCity
:
'
广东省
'
,
focusCity
:
'
广东省
'
,
locationGis
:
[],
locationGis
:
[],
...
@@ -65,7 +77,7 @@ const state = reactive({
...
@@ -65,7 +77,7 @@ const state = reactive({
}
}
})
})
function
initDataSource
()
{
function
initDataSource
()
{
state
.
clickCity
=
'
全国
'
state
.
clickCity
=
'
全国
'
state
.
dataSource
=
[]
state
.
dataSource
=
[]
state
.
total
=
0
state
.
total
=
0
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
...
@@ -77,27 +89,45 @@ function initDataSource() {
...
@@ -77,27 +89,45 @@ function initDataSource() {
})
})
state
.
total
+=
1
state
.
total
+=
1
})
})
state
.
pagination
.
current
=
1
state
.
pagination
.
current
=
1
state
.
totlaNum
=
state
.
total
}
}
function
filterName
(
name
)
{
function
filterName
(
name
)
{
state
.
clickCity
=
name
state
.
clickCity
=
name
state
.
dataSource
=
[]
state
.
dataSource
=
[]
state
.
total
=
0
state
.
total
=
0
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
const
locName
=
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
const
locName
=
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
if
(
name
.
includes
(
locName
))
{
if
(
name
.
includes
(
locName
))
{
state
.
dataSource
.
push
({
state
.
dataSource
.
push
({
uid
:
gameJson
[
uid
].
uid
,
uid
:
gameJson
[
uid
].
uid
,
imgSrc
:
gameJson
[
uid
].
imgSrc
,
imgSrc
:
gameJson
[
uid
].
imgSrc
,
name
:
gameJson
[
uid
].
name
,
name
:
gameJson
[
uid
].
name
,
ip
:
locName
ip
:
locName
})
})
state
.
total
+=
1
state
.
total
+=
1
}
})
state
.
pagination
.
current
=
1
}
function
filterMapName
(
name
)
{
const
res
=
[]
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
const
locName
=
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
if
(
name
.
includes
(
locName
))
{
res
.
push
({
uid
:
gameJson
[
uid
].
uid
,
imgSrc
:
gameJson
[
uid
].
imgSrc
,
name
:
gameJson
[
uid
].
name
,
ip
:
locName
})
}
}
})
})
state
.
pagination
.
current
=
1
return
res
}
}
...
@@ -106,8 +136,8 @@ function initMap() {
...
@@ -106,8 +136,8 @@ function initMap() {
let
itemData
=
chinaJson
.
features
let
itemData
=
chinaJson
.
features
let
length
=
itemData
.
length
let
length
=
itemData
.
length
state
.
aimPointData
=
[]
state
.
aimPointData
=
[]
state
.
airData
=
[]
state
.
airData
=
[]
state
.
linesCoord
=
[]
state
.
linesCoord
=
[]
for
(
let
loc
=
0
;
loc
<
length
;
++
loc
)
{
for
(
let
loc
=
0
;
loc
<
length
;
++
loc
)
{
let
name
=
itemData
[
loc
].
properties
.
name
let
name
=
itemData
[
loc
].
properties
.
name
state
.
aimPointData
.
push
({
state
.
aimPointData
.
push
({
...
@@ -124,8 +154,8 @@ function initMap() {
...
@@ -124,8 +154,8 @@ function initMap() {
let
number
=
0
let
number
=
0
let
center
=
itemData
[
loc
].
properties
.
center
let
center
=
itemData
[
loc
].
properties
.
center
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
const
locName
=
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
const
locName
=
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
if
(
name
.
includes
(
locName
)
||
locName
.
includes
)
{
if
(
name
.
includes
(
locName
)
||
locName
.
includes
)
{
number
+=
1
number
+=
1
}
}
})
})
...
@@ -134,10 +164,10 @@ function initMap() {
...
@@ -134,10 +164,10 @@ function initMap() {
})
})
// eslint-disable-next-line eqeqeq
// eslint-disable-next-line eqeqeq
if
(
!
name
.
includes
(
state
.
focusCity
))
{
if
(
!
name
.
includes
(
state
.
focusCity
))
{
if
(
center
&&
state
.
centerLoction
)
{
if
(
center
&&
state
.
centerLoction
)
{
state
.
linesCoord
.
push
([
center
,
state
.
centerLoction
])
state
.
linesCoord
.
push
([
center
,
state
.
centerLoction
])
}
}
}
}
// eslint-disable-next-line eqeqeq
// eslint-disable-next-line eqeqeq
if
(
name
&&
name
!==
state
.
focusCity
)
{
if
(
name
&&
name
!==
state
.
focusCity
)
{
...
@@ -150,9 +180,9 @@ function initMap() {
...
@@ -150,9 +180,9 @@ function initMap() {
continue
continue
}
}
setTimeout
(()
=>
{
setTimeout
(()
=>
{
renderEchartBar
()
renderEchartBar
()
},
500
)
},
500
)
}
}
// storage
// storage
...
@@ -204,7 +234,7 @@ function renderEchartBar() {
...
@@ -204,7 +234,7 @@ function renderEchartBar() {
// nameProperty: 'name',
// nameProperty: 'name',
show
:
true
,
show
:
true
,
color
:
'
#333
'
,
color
:
'
#333
'
,
formatter
:
function
(
params
)
{
formatter
:
function
(
params
)
{
return
params
.
name
return
params
.
name
},
},
// backgroundColor: '#546de5',
// backgroundColor: '#546de5',
...
@@ -220,6 +250,20 @@ function renderEchartBar() {
...
@@ -220,6 +250,20 @@ function renderEchartBar() {
},
},
zoom
:
1.2
zoom
:
1.2
},
},
tooltip
:{
show
:
true
,
formatter
:(
params
)
=>
{
const
{
name
}
=
params
.
data
const
filterData
=
filterMapName
(
name
)
const
strInfo
=
filterData
.
map
(
item
=>
{
return
`<img src=
${
item
.
imgSrc
}
width='20' height='20'/>
${
item
.
name
}
`
}).
join
(
'
'
)
const
value
=
filterData
.
length
return
`地区:
${
name
}
<br>
总人数:
${
value
}
<br>
详细信息:<br>
${
strInfo
}
`
}
},
series
:
[
series
:
[
// 坐标点的热力数据
// 坐标点的热力数据
{
{
...
@@ -286,7 +330,7 @@ function renderEchartBar() {
...
@@ -286,7 +330,7 @@ function renderEchartBar() {
// 监听
// 监听
state
.
echartInstance
=
myChart
;
state
.
echartInstance
=
myChart
;
myChart
.
on
(
'
click
'
,
function
(
params
)
{
myChart
.
on
(
'
click
'
,
function
(
params
)
{
console
.
log
(
'
params
'
,
params
)
console
.
log
(
'
params
'
,
params
)
filterName
(
params
.
name
)
filterName
(
params
.
name
)
});
});
window
.
onresize
=
myChart
.
resize
;
window
.
onresize
=
myChart
.
resize
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录