Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c805f280
提交
c805f280
authored
7月 27, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: 地图坐标json使用缓存
上级
9fb8c031
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
24 行增加
和
9 行删除
+24
-9
getters.js
frontend/src/store/getters.js
+2
-1
index.js
frontend/src/store/index.js
+3
-1
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+19
-7
没有找到文件。
frontend/src/store/getters.js
浏览文件 @
c805f280
...
@@ -26,6 +26,7 @@ const getters = {
...
@@ -26,6 +26,7 @@ const getters = {
licMsg
:
state
=>
state
.
lic
.
licMsg
,
licMsg
:
state
=>
state
.
lic
.
licMsg
,
uiInfo
:
state
=>
state
.
user
.
uiInfo
,
uiInfo
:
state
=>
state
.
user
.
uiInfo
,
conditions
:
state
=>
state
.
conditions
.
conditions
,
conditions
:
state
=>
state
.
conditions
.
conditions
,
msgTypes
:
state
=>
state
.
msg
.
msgTypes
msgTypes
:
state
=>
state
.
msg
.
msgTypes
,
geoMap
:
state
=>
state
.
map
.
geoMap
}
}
export
default
getters
export
default
getters
frontend/src/store/index.js
浏览文件 @
c805f280
...
@@ -12,6 +12,7 @@ import panel from './modules/panel'
...
@@ -12,6 +12,7 @@ import panel from './modules/panel'
import
application
from
'./modules/application'
import
application
from
'./modules/application'
import
lic
from
'./modules/lic'
import
lic
from
'./modules/lic'
import
msg
from
'./modules/msg'
import
msg
from
'./modules/msg'
import
map
from
'./modules/map'
import
animation
from
'@/components/canvas/store/animation'
import
animation
from
'@/components/canvas/store/animation'
import
compose
from
'@/components/canvas/store/compose'
import
compose
from
'@/components/canvas/store/compose'
import
contextmenu
from
'@/components/canvas/store/contextmenu'
import
contextmenu
from
'@/components/canvas/store/contextmenu'
...
@@ -185,7 +186,8 @@ const data = {
...
@@ -185,7 +186,8 @@ const data = {
panel
,
panel
,
application
,
application
,
lic
,
lic
,
msg
msg
,
map
},
},
getters
getters
}
}
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
c805f280
...
@@ -35,7 +35,8 @@ export default {
...
@@ -35,7 +35,8 @@ export default {
data
()
{
data
()
{
return
{
return
{
myChart
:
{},
myChart
:
{},
chartId
:
uuid
.
v1
()
chartId
:
uuid
.
v1
(),
currentGeoJson
:
null
}
}
},
},
watch
:
{
watch
:
{
...
@@ -100,22 +101,33 @@ export default {
...
@@ -100,22 +101,33 @@ export default {
const
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
const
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
if
(
!
customAttr
.
areaCode
)
return
if
(
!
customAttr
.
areaCode
)
return
let
areaJson
if
(
this
.
currentGeoJson
)
{
if
((
areaJson
=
localStorage
.
getItem
(
'areaJson'
+
customAttr
.
areaCode
))
!==
null
)
{
this
.
initMapChart
(
this
.
currentGeoJson
,
chart
)
this
.
initMapChart
(
areaJson
,
chart
)
return
return
}
}
if
(
this
.
$store
.
getters
.
geoMap
[
customAttr
.
areaCode
])
{
this
.
currentGeoJson
=
this
.
$store
.
getters
.
geoMap
[
customAttr
.
areaCode
]
this
.
initMapChart
(
this
.
currentGeoJson
,
chart
)
return
}
geoJson
(
customAttr
.
areaCode
).
then
(
res
=>
{
geoJson
(
customAttr
.
areaCode
).
then
(
res
=>
{
this
.
initMapChart
(
res
.
data
,
chart
)
this
.
initMapChart
(
res
.
data
,
chart
)
// localStorage最大容量只有5M,先取消缓存
// localStorage.setItem('areaJson' + customAttr.areaCode, res.data)
this
.
$store
.
dispatch
(
'map/setGeo'
,
{
key
:
customAttr
.
areaCode
,
value
:
res
.
data
})
this
.
currentGeoJson
=
res
.
data
})
})
return
return
}
}
this
.
myEcharts
(
chart_option
)
this
.
myEcharts
(
chart_option
)
},
},
initMapChart
(
geoJson
,
chart
)
{
initMapChart
(
geoJson
,
chart
)
{
this
.
$echarts
.
registerMap
(
'HK'
,
geoJson
)
// this.$echarts.registerMap('HK', geoJson)
this
.
$echarts
.
getMap
(
'HK'
)
||
this
.
$echarts
.
registerMap
(
'HK'
,
geoJson
)
const
base_json
=
JSON
.
parse
(
JSON
.
stringify
(
BASE_MAP
))
const
base_json
=
JSON
.
parse
(
JSON
.
stringify
(
BASE_MAP
))
const
chart_option
=
baseMapOption
(
base_json
,
chart
)
const
chart_option
=
baseMapOption
(
base_json
,
chart
)
this
.
myEcharts
(
chart_option
)
this
.
myEcharts
(
chart_option
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论