Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
ec-report-refactor
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lihuizhen
ec-report-refactor
Commits
a96cb0dd
Commit
a96cb0dd
authored
Jan 19, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 图表组件点击交互
parent
10d99f0e
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
6 deletions
+35
-6
http.interceptor.js
common/http.interceptor.js
+2
-2
BarMixMap.vue
components/BarMixMap/BarMixMap.vue
+3
-0
ChinaMap.vue
components/ChinaMap/ChinaMap.vue
+3
-0
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+3
-0
LineMixBar.vue
components/LineMixBar/LineMixBar.vue
+3
-0
NormalBar.vue
components/NormalBar/NormalBar.vue
+3
-0
NormalLine.vue
components/NormalLine/NormalLine.vue
+3
-0
NormalPie.vue
components/NormalPie/NormalPie.vue
+3
-0
echartElementData.js
mixins/echartElementData.js
+11
-4
index.vue
pages/index/index.vue
+1
-0
No files found.
common/http.interceptor.js
View file @
a96cb0dd
const
install
=
(
Vue
,
vm
)
=>
{
Vue
.
prototype
.
$u
.
http
.
setConfig
({
baseUrl
:
'https://api.charleskeith.cn'
,
// 请求的本域名
// baseUrl: 'http://192.168.138.55:808l
',
//
baseUrl: 'https://api.charleskeith.cn', // 请求的本域名
baseUrl
:
'http://192.168.138.55:8081
'
,
showLoading
:
true
,
// 是否显示请求中的loading
loadingText
:
'努力加载中。。。'
,
// 请求loading中的文字提示
loadingTime
:
300
,
// 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
...
...
components/BarMixMap/BarMixMap.vue
View file @
a96cb0dd
...
...
@@ -46,6 +46,9 @@
const
{
mapMixBarShow
,
mapMixBarChangeInterval
}
=
this
.
elementInfo
.
option
.
mapMix
let
flag
=
true
chart
.
setOption
(
options
,
true
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
// 柱状图 地图 切换
if
(
mapMixBarShow
&&
mapMixBarChangeInterval
)
{
clearInterval
(
this
.
changeTimer
)
...
...
components/ChinaMap/ChinaMap.vue
View file @
a96cb0dd
...
...
@@ -137,6 +137,9 @@
series
:
series
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
components/HorizontalBar/HorizontalBar.vue
View file @
a96cb0dd
...
...
@@ -53,6 +53,9 @@ export default {
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
components/LineMixBar/LineMixBar.vue
View file @
a96cb0dd
...
...
@@ -67,6 +67,9 @@
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
components/NormalBar/NormalBar.vue
View file @
a96cb0dd
...
...
@@ -53,6 +53,9 @@ export default {
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
components/NormalLine/NormalLine.vue
View file @
a96cb0dd
...
...
@@ -53,6 +53,9 @@ export default {
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
components/NormalPie/NormalPie.vue
View file @
a96cb0dd
...
...
@@ -57,6 +57,9 @@ export default {
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
this
.
handleEchartsClick
(
event
)
})
return
chart
})
})
...
...
mixins/echartElementData.js
View file @
a96cb0dd
...
...
@@ -67,6 +67,13 @@ export default {
clearTimer
()
{
clearInterval
(
this
.
timer
)
this
.
timer
=
null
},
/**
* 组件点击交互 - 传参
*/
handleEchartsClick
(
chartEvent
)
{
const
{
index
,
paramName
}
=
this
.
elementInfo
.
child
uni
.
$emit
(
'handleLinkParams'
,
{
index
,
paramName
,
value
:
chartEvent
.
name
})
}
},
deactivated
()
{
...
...
pages/index/index.vue
View file @
a96cb0dd
...
...
@@ -75,6 +75,7 @@
onUnload
()
{
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
clearInterval
(
this
.
timer
)
},
methods
:
{
//检查是否登录
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment