Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
雪碧有白泡泡
可视化 csdn 数据
提交
82a5d70e
可
可视化 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看板
“917a87c4d11ecb0e677d512e47cebf0eb2a9251d”上不存在“src/git@gitcode.net:openanolis/dragonwell8_hotspot.git”
提交
82a5d70e
编写于
7月 17, 2023
作者:
6
63f1bb74d2451104dc7d8b9f
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mon Jul 17 10:05:00 CST 2023 inscode
上级
5df37b77
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
80 addition
and
58 deletion
+80
-58
src/components/GameChart.vue
src/components/GameChart.vue
+80
-58
未找到文件。
src/components/GameChart.vue
浏览文件 @
82a5d70e
...
...
@@ -4,33 +4,36 @@
<a
style=
"font-size: 24px;font-weight:bolder;"
>
{{
state
.
title
}}
</a>
</div>
</div>
<div>
<a-table
:scroll=
"
{ x: 800, y: 600 }" :columns="state.columns" :data-source="state.dataSource"
:loading="state.loading" :pagination="state.pagination" bordered style="border-bottom:1px solid #f0f0f0;">
<template
#bodyCell
="
{ column, record }">
<template
v-if=
"column.key === 'url'"
>
<a
:href=
"record.url"
target=
"_blank"
>
{{
record
.
url
}}
</a>
</
template
>
<
template
v-else-if=
"column.key === 'score'"
>
<span>
<a-tag
:color=
"record.score
<
60
?
'
volcano
'
:
record.score
>
80 ? 'geekblue' : 'green'">
{{
record
.
score
}}
</a-tag>
</span>
</
template
>
<
template
v-else-if=
"column.key === 'option'"
>
<a-tooltip
placement=
"topLeft"
:title=
"record.editUrl"
>
<a
:href=
"record.editUrl"
target=
"_blank"
>
编辑文章
<div
style=
"display:flex"
>
<div
id=
"barChartId"
style=
"flex:1;width:600px;height:900px;margin: 0 auto;border: 1px solid #333;"
></div>
<div
style=
"width: 700px;height:900px;border: 1px solid #333;"
>
<a-table
:scroll=
"
{ x: 600, y: 750 }" :columns="state.columns" :data-source="state.dataSource"
:loading="state.loading" :pagination="state.pagination" bordered style="border-bottom:1px solid #f0f0f0;">
<template
#bodyCell
="
{ column, record }">
<template
v-if=
"column.key === 'url'"
>
<a
:href=
"record.url"
target=
"_blank"
>
{{
record
.
url
}}
</a>
</a-tooltip>
</
template
>
<
template
v-else-if=
"column.key === 'score'"
>
<span>
<a-tag
:color=
"record.score
<
60
?
'
volcano
'
:
record.score
>
80 ? 'geekblue' : 'green'">
{{
record
.
score
}}
</a-tag>
</span>
</
template
>
<
template
v-else-if=
"column.key === 'option'"
>
<a-tooltip
placement=
"topLeft"
:title=
"record.editUrl"
>
<a
:href=
"record.editUrl"
target=
"_blank"
>
编辑文章
</a>
</a-tooltip>
</
template
>
</template>
</template>
</a-table>
</a-table>
</div>
</div>
<div
id=
"barChartId"
style=
"width:100vw;height:900px;margin: 0 auto"
></div>
</template>
<
script
setup
>
import
chinaJson
from
'
./chinaGeo.js
'
;
...
...
@@ -43,7 +46,7 @@ const props = defineProps({
})
const
state
=
reactive
({
title
:
'
参赛选手所在城市
'
,
title
:
'
python 爬虫赛道
参赛选手所在城市
'
,
linesCoord
:
[],
focusCity
:
'
深圳
'
,
locationGis
:
[],
...
...
@@ -57,8 +60,8 @@ const state = reactive({
pagination
:
{
total
:
0
,
current
:
1
,
pageSize
:
1
0
,
pageSizeOptions
:
[
'
10
'
,
'
50
'
,
'
1
00
'
],
pageSize
:
5
0
,
pageSizeOptions
:
[
'
50
'
,
'
100
'
,
'
2
00
'
],
showTotal
:
(
total
,
range
)
=>
{
return
range
[
0
]
+
'
-
'
+
range
[
1
]
+
'
共
'
+
total
+
'
个选手
'
;
},
...
...
@@ -77,10 +80,26 @@ function initDataSource() {
})
state
.
total
+=
1
})
// map
state
.
pagination
.
current
=
1
}
function
filterName
(
name
)
{
state
.
dataSource
=
[]
state
.
total
=
0
Object
.
keys
(
gameJson
).
forEach
(
uid
=>
{
if
(
name
.
includes
(
gameJson
[
uid
].
name
)){
state
.
dataSource
.
push
({
uid
:
gameJson
[
uid
].
uid
,
name
:
gameJson
[
uid
].
name
,
ip
:
gameJson
[
uid
].
ip
.
split
(
'
:
'
)[
1
]
})
state
.
total
+=
1
}
})
state
.
pagination
.
current
=
1
}
function
initMap
()
{
echarts
.
registerMap
(
'
chinaJson
'
,
chinaJson
)
let
itemData
=
chinaJson
.
features
...
...
@@ -123,6 +142,10 @@ function initMap() {
}
continue
}
setTimeout
(()
=>
{
renderEchartBar
()
},
500
)
}
// storage
...
...
@@ -134,16 +157,16 @@ function changePageSize(current, pageSize) {
state
.
pagination
.
current
=
current
state
.
pagination
.
pageSize
=
pageSize
}
watch
(()
=>
props
.
tableData
,
(
val
)
=>
{
state
.
dataSource
=
val
nextTick
(()
=>
{
renderEchartBar
()
})
},
{
deep
:
true
,
immediate
:
true
})
//
watch(() => props.tableData,
//
(val) => {
//
state.dataSource = val
//
nextTick(() => {
//
renderEchartBar()
//
})
//
}, {
//
deep: true,
//
immediate: true
//
})
function
renderEchartBar
()
{
// 基于准备好的dom,初始化echarts实例
const
domInstance
=
document
.
getElementById
(
'
barChartId
'
)
...
...
@@ -161,29 +184,32 @@ function renderEchartBar() {
},
geo
:
{
// 经纬度中心
center
:
state
.
centerLoction
,
//
center: state.centerLoction,
type
:
'
map
'
,
map
:
'
chinaJson
'
,
// 这里的值要和上面registerMap的第一个参数一致
roam
:
tru
e
,
// 拖拽
roam
:
fals
e
,
// 拖拽
nameProperty
:
'
name
'
,
// 悬浮标签
label
:
{
type
:
'
map
'
,
map
:
'
chinaJson
'
,
// 这里的值要和上面registerMap的第一个参数一致
// roam: false, // 拖拽
nameProperty
:
'
name
'
,
//
nameProperty: 'name',
show
:
true
,
color
:
'
#fff
'
,
backgroundColor
:
'
#546de5
'
,
align
:
'
center
'
,
fontSize
:
10
,
width
:
(
function
()
{
// let n = parseInt(Math.random() * 10)
return
110
})(),
height
:
50
,
shadowColor
:
'
rgba(0,0,0,.7)
'
,
borderRadius
:
10
color
:
'
#333
'
,
formatter
:
function
(
params
){
return
params
.
name
},
// backgroundColor: '#546de5',
// align: 'center',
// fontSize: 10,
// width: (function () {
// // let n = parseInt(Math.random() * 10)
// return 110
// })(),
// height: 50,
// shadowColor: 'rgba(0,0,0,.7)',
// borderRadius: 10
},
zoom
:
1.2
},
...
...
@@ -255,12 +281,8 @@ function renderEchartBar() {
// 监听
state
.
echartInstance
=
myChart
;
myChart
.
on
(
'
click
'
,
function
(
params
)
{
const
findItem
=
state
.
dataSource
.
find
(
item
=>
{
return
item
.
postTime
==
params
.
name
})
if
(
params
.
name
)
{
window
.
open
(
findItem
.
url
,
'
_blank
'
)
}
console
.
log
(
'
params
'
,
params
)
filterName
(
params
.
name
)
});
window
.
onresize
=
myChart
.
resize
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录