Auto Commit

上级 f01209c9
...@@ -10,7 +10,12 @@ ...@@ -10,7 +10,12 @@
</a-button> </a-button>
</div> </div>
<div style="display:flex"> <div style="display:flex">
<div id="barChartId" style="flex:1;width:600px;height:900px;margin: 0 auto;border: 1px solid #333;"></div> <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 id="barChartId" style="width:600px;height:600px;margin: 0 auto;">
</div>
</div>
<div style="width: 700px;height:900px;border: 1px solid #333;"> <div style="width: 700px;height:900px;border: 1px solid #333;">
<a-table :scroll="{ x: 600, y: 750 }" :columns="state.columns" :data-source="state.dataSource" <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;"> :loading="state.loading" :pagination="state.pagination" bordered style="border-bottom:1px solid #f0f0f0;">
...@@ -52,8 +57,9 @@ const props = defineProps({ ...@@ -52,8 +57,9 @@ const props = defineProps({
const state = reactive({ const state = reactive({
title: 'python 爬虫赛道 参赛选手所在城市', title: 'python 爬虫赛道 参赛选手所在城市',
clickCity:'全国',
linesCoord: [], linesCoord: [],
focusCity: '深圳', focusCity: '广东省',
locationGis: [], locationGis: [],
centerLoction: [], centerLoction: [],
aimPointData: [], aimPointData: [],
...@@ -75,6 +81,7 @@ const state = reactive({ ...@@ -75,6 +81,7 @@ const state = reactive({
} }
}) })
function initDataSource() { function initDataSource() {
state.clickCity='全国'
state.dataSource = [] state.dataSource = []
state.total = 0 state.total = 0
Object.keys(gameJson).forEach(uid => { Object.keys(gameJson).forEach(uid => {
...@@ -89,7 +96,7 @@ function initDataSource() { ...@@ -89,7 +96,7 @@ function initDataSource() {
} }
function filterName(name) { function filterName(name) {
console.log('name',name) state.clickCity=name
state.dataSource = [] state.dataSource = []
state.total = 0 state.total = 0
Object.keys(gameJson).forEach(uid => { Object.keys(gameJson).forEach(uid => {
...@@ -113,6 +120,7 @@ function initMap() { ...@@ -113,6 +120,7 @@ function initMap() {
let itemData = chinaJson.features let itemData = chinaJson.features
let length = itemData.length let length = itemData.length
state.aimPointData = [] state.aimPointData = []
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({
...@@ -129,7 +137,8 @@ function initMap() { ...@@ -129,7 +137,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 => {
if (name.includes(gameJson[uid].ip.split('')[1])) { const locName=gameJson[uid].ip.split('')[1]
if (name.includes(locName)||locName.includes(name)) {
number += 1 number += 1
} }
}) })
...@@ -138,10 +147,13 @@ function initMap() { ...@@ -138,10 +147,13 @@ 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){
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 !== '') { if (name && name !== state.focusCity) {
let temp = { let temp = {
name: `${name}`, name: `${name}`,
value: Number(number) value: Number(number)
...@@ -209,15 +221,15 @@ function renderEchartBar() { ...@@ -209,15 +221,15 @@ function renderEchartBar() {
return params.name return params.name
}, },
// backgroundColor: '#546de5', // backgroundColor: '#546de5',
// align: 'center', align: 'center',
// fontSize: 10, fontSize: 10,
// width: (function () { width: (function () {
// // let n = parseInt(Math.random() * 10) // let n = parseInt(Math.random() * 10)
// return 110 return 110
// })(), })(),
// height: 50, height: 50,
// shadowColor: 'rgba(0,0,0,.7)', shadowColor: 'rgba(0,0,0,.7)',
// borderRadius: 10 borderRadius: 10
}, },
zoom: 1.2 zoom: 1.2
}, },
...@@ -231,7 +243,7 @@ function renderEchartBar() { ...@@ -231,7 +243,7 @@ function renderEchartBar() {
{ {
type: 'effectScatter', type: 'effectScatter',
// 渲染显示 // 渲染显示
zlevel: 2, zlevel: 3,
showEffectOn: 'render', showEffectOn: 'render',
data: state.locationGis, // 配置散点的坐标数据 data: state.locationGis, // 配置散点的坐标数据
coordinateSystem: 'geo', // 指明散点使用的坐标系统 coordinateSystem: 'geo', // 指明散点使用的坐标系统
...@@ -248,32 +260,30 @@ function renderEchartBar() { ...@@ -248,32 +260,30 @@ function renderEchartBar() {
// 形状 // 形状
symbol: 'circle' symbol: 'circle'
}, },
// // 飞线层 // 飞线层
// { {
// // name: '贵阳市飞线', // name: '贵阳市飞线',
// type: 'lines', type: 'lines',
// coordinateSystem: 'geo', coordinateSystem: 'geo',
// polyline: true, polyline: true,
// zlevel: 3, zlevel: 3,
// effect: { effect: {
// show: true, show: true,
// period: 5, period: 5,
// trailLength: 0, // 拖尾 trailLength: 0, // 拖尾
// symbol: 'arrow', // 箭头 symbol: 'arrow', // 箭头
// color: 'red', // 样式颜色 color: 'red', // 样式颜色
// symbolSize: 5 symbolSize: 5
// }, },
// lineStyle: { lineStyle: {
// color: '#000', color: '#000',
// width: 2, width: 2,
// type: 'solid', type: 'solid',
// dashOffset: 0 dashOffset: 1
// // cap: butt, },
// // join: bevel // 飞线层数据
// }, data: state.linesCoord
// // 飞线层数据 }
// data: state.linesCoord
// }
], ],
visualMap: { visualMap: {
min: 0, min: 0,
......
...@@ -42,32 +42,22 @@ export const tableColumns= [ ...@@ -42,32 +42,22 @@ export const tableColumns= [
{ {
title: '用户id', title: '用户id',
dataIndex: 'uid', dataIndex: 'uid',
sorter: true, sorter: (a, b) => a.uid[0].charCodeAt() - b.uid[0].charCodeAt(),
fixed: true fixed: true
}, { }, {
title: '用户昵称', title: '用户昵称',
sorter: true, sorter: true,
dataIndex: 'name' dataIndex: 'name',
sorter: (a, b) => a.name[0].charCodeAt() - b.name[0].charCodeAt(),
}, { }, {
title: '城市', title: '城市',
sorter: true, sorter: true,
dataIndex: 'ip', dataIndex: 'ip',
sorter: (a, b) => a.ip[0].charCodeAt() - b.ip[0].charCodeAt(),
filters: [ filters: [
{ {
text: '深圳市', text: '广东省',
value: '深圳市', value: '广东省',
},
{
text: '上海市',
value: '上海市',
},
{
text: '北京市',
value: '北京市',
},
{
text: '贵阳市',
value: '贵阳市',
} }
] ]
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册