Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c70c6cff
Unverified
提交
c70c6cff
authored
8月 12, 2021
作者:
fit2cloud-chenyw
提交者:
GitHub
8月 12, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #609 from dataease/pr@dev@feat_恢复地图缓存
feat: 地图缓存 地图联动预留接口
上级
f701ff69
49441ace
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
46 行增加
和
23 行删除
+46
-23
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+31
-13
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+15
-10
没有找到文件。
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
c70c6cff
...
@@ -141,7 +141,13 @@ export default {
...
@@ -141,7 +141,13 @@ export default {
},
},
linkageFilters
:
{
linkageFilters
:
{
handler
(
newVal
,
oldVal
)
{
handler
(
newVal
,
oldVal
)
{
isChange
(
newVal
,
oldVal
)
&&
this
.
getData
(
this
.
element
.
propValue
.
viewId
)
// isChange(newVal, oldVal) && this.getData(this.element.propValue.viewId)
if
(
isChange
(
newVal
,
oldVal
))
{
// if (this.chart.type === 'map') {
// this.doMapLink(newVal)
// }
this
.
getData
(
this
.
element
.
propValue
.
viewId
)
}
},
},
deep
:
true
deep
:
true
},
},
...
@@ -327,18 +333,7 @@ export default {
...
@@ -327,18 +333,7 @@ export default {
current
&&
current
.
registerDynamicMap
&&
current
.
registerDynamicMap
(
nextNode
.
code
)
current
&&
current
.
registerDynamicMap
&&
current
.
registerDynamicMap
(
nextNode
.
code
)
}
}
},
},
// 根据地名获取areaCode
// findEntityByname(name, array) {
// if (array === null || array.length === 0) array = this.places
// for (let index = 0; index
<
array
.
length
;
index
++
)
{
// const node = array[index]
// if (node.name === name) return node
// if (node.children && node.children.length > 0) {
// const temp = this.findEntityByname(name, node.children)
// if (temp) return temp
// }
// }
// }
findEntityByCode
(
code
,
array
)
{
findEntityByCode
(
code
,
array
)
{
if
(
array
===
null
||
array
.
length
===
0
)
array
=
this
.
places
if
(
array
===
null
||
array
.
length
===
0
)
array
=
this
.
places
for
(
let
index
=
0
;
index
<
array
.
length
;
index
++
)
{
for
(
let
index
=
0
;
index
<
array
.
length
;
index
++
)
{
...
@@ -360,6 +355,29 @@ export default {
...
@@ -360,6 +355,29 @@ export default {
this
.
places
=
res
.
data
this
.
places
=
res
.
data
localStorage
.
setItem
(
'areaMapping'
,
JSON
.
stringify
(
res
.
data
))
localStorage
.
setItem
(
'areaMapping'
,
JSON
.
stringify
(
res
.
data
))
})
})
},
doMapLink
(
linkFilters
)
{
if
(
!
linkFilters
&&
linkFilters
.
length
===
0
)
return
const
value
=
linkFilters
[
0
].
value
if
(
!
value
&&
value
.
length
===
0
)
return
const
name
=
value
[
0
]
if
(
!
name
)
return
const
areaNode
=
this
.
findEntityByname
(
name
,
[])
if
(
!
areaNode
)
return
const
current
=
this
.
$refs
[
this
.
element
.
propValue
.
id
]
current
&&
current
.
registerDynamicMap
&&
current
.
registerDynamicMap
(
areaNode
.
code
)
},
// 根据地名获取areaCode
findEntityByname
(
name
,
array
)
{
if
(
array
===
null
||
array
.
length
===
0
)
array
=
this
.
places
for
(
let
index
=
0
;
index
<
array
.
length
;
index
++
)
{
const
node
=
array
[
index
]
if
(
node
.
name
===
name
)
return
node
if
(
node
.
children
&&
node
.
children
.
length
>
0
)
{
const
temp
=
this
.
findEntityByname
(
name
,
node
.
children
)
if
(
temp
)
return
temp
}
}
}
}
}
}
}
}
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
c70c6cff
...
@@ -145,16 +145,11 @@ export default {
...
@@ -145,16 +145,11 @@ export default {
const
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
const
customAttr
=
JSON
.
parse
(
chart
.
customAttr
)
if
(
!
customAttr
.
areaCode
)
return
if
(
!
customAttr
.
areaCode
)
return
// if (this.currentGeoJson) {
if
(
this
.
$store
.
getters
.
geoMap
[
customAttr
.
areaCode
])
{
// this.initMapChart(this.currentGeoJson, chart)
const
json
=
this
.
$store
.
getters
.
geoMap
[
customAttr
.
areaCode
]
// return
this
.
initMapChart
(
json
,
chart
)
// }
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
,
chart
)
this
.
initMapChart
(
res
,
chart
)
...
@@ -171,9 +166,19 @@ export default {
...
@@ -171,9 +166,19 @@ export default {
this
.
myEcharts
(
chart_option
)
this
.
myEcharts
(
chart_option
)
},
},
registerDynamicMap
(
areaCode
)
{
registerDynamicMap
(
areaCode
)
{
if
(
this
.
$store
.
getters
.
geoMap
[
areaCode
])
{
this
.
downOrUp
=
true
const
json
=
this
.
$store
.
getters
.
geoMap
[
areaCode
]
this
.
$echarts
.
registerMap
(
'MAP'
,
json
)
return
}
geoJson
(
areaCode
).
then
(
res
=>
{
geoJson
(
areaCode
).
then
(
res
=>
{
this
.
downOrUp
=
true
this
.
downOrUp
=
true
this
.
$echarts
.
registerMap
(
'MAP'
,
res
)
this
.
$echarts
.
registerMap
(
'MAP'
,
res
)
this
.
$store
.
dispatch
(
'map/setGeo'
,
{
key
:
areaCode
,
value
:
res
})
})
})
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论