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
4cfcbebd
Commit
4cfcbebd
authored
Jan 17, 2022
by
peco
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://106.15.103.105/lihuizhen/ec-report-refactor
into develop
parents
cf970f11
678be71b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
192 additions
and
5 deletions
+192
-5
BarMixMap.vue
components/BarMixMap/BarMixMap.vue
+130
-5
NormalTabs.vue
components/NormalTabs/NormalTabs.vue
+60
-0
index.vue
pages/index/index.vue
+2
-0
No files found.
components/BarMixMap/BarMixMap.vue
View file @
4cfcbebd
<
template
>
<
template
>
<view>
<view>
柱状图混合地图
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"bar-mix-map"
id=
"bar-mix-map"
...
@@ -25,7 +24,8 @@
...
@@ -25,7 +24,8 @@
return
{
return
{
ec
:
{
ec
:
{
lazyLoad
:
true
lazyLoad
:
true
}
},
changeTimer
:
null
}
}
},
},
components
:
{
components
:
{
...
@@ -34,9 +34,134 @@
...
@@ -34,9 +34,134 @@
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
clearInterval
(
this
.
changeTimer
)
this
.
$refs
[
'barMixMapCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
let
options
=
this
.
setMapOption
()
const
{
mapMixBarShow
,
mapMixBarChangeInterval
}
=
this
.
elementInfo
.
option
.
mapMix
let
flag
=
true
chart
.
setOption
(
options
,
true
)
// 柱状图 地图 切换
if
(
mapMixBarShow
&&
mapMixBarChangeInterval
)
{
clearInterval
(
this
.
changeTimer
)
this
.
changeTimer
=
setInterval
(()
=>
{
options
=
flag
?
this
.
setBarOption
()
:
this
.
setMapOption
()
flag
=
!
flag
chart
.
setOption
(
options
,
true
)
},
mapMixBarChangeInterval
*
1000
)
}
return
chart
})
})
})
},
},
setBarOption
()
{
const
{
dataList
:
{
series
}
}
=
this
.
elementData
let
options
=
{
...
this
.
elementInfo
.
option
,
tooltip
:
{},
yAxis
:
{
...
this
.
elementInfo
.
option
.
yAxis
,
data
:
this
.
dealSeriesData
(
series
).
categories
},
series
:
{
id
:
'associate'
,
type
:
'bar'
,
...
this
.
elementInfo
.
option
.
bar
,
label
:
{
...
this
.
elementInfo
.
option
.
dataset
,
formatter
:
(
val
)
=>
{
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
},
animationDurationUpdate
:
1000
,
universalTransition
:
true
,
data
:
this
.
dealSeriesData
(
series
).
series
}
}
return
options
},
setMapOption
()
{
const
{
dataList
}
=
this
.
elementData
const
seriesData
=
dataList
.
series
||
[]
const
series
=
[]
for
(
let
i
=
0
;
i
<
seriesData
.
length
;
i
++
)
{
const
geoCoord
=
geoCoordMapList
[
seriesData
[
i
].
name
]
if
(
geoCoord
)
{
series
.
push
({
name
:
seriesData
[
i
].
name
,
value
:
geoCoord
.
concat
(
seriesData
[
i
].
value
)
})
}
}
const
options
=
{
title
:
{
...
this
.
elementInfo
.
option
.
title
},
legend
:
{
...
this
.
elementInfo
.
option
.
legend
},
geo
:
{
map
:
'china'
,
zoom
:
1.2
,
roam
:
false
,
itemStyle
:
{
areaColor
:
'rgba(34, 70, 168, 0.7)'
,
borderColor
:
'#0692a4'
},
emphasis
:
{
itemStyle
:
{
areaColor
:
'rgba(119, 139, 224, 0.548)'
}
},
},
animationDurationUpdate
:
1000
,
series
:
[{
id
:
'associate'
,
type
:
'map'
,
map
:
'china'
,
geoIndex
:
0
,
aspectScale
:
0.75
,
animationDurationUpdate
:
1000
,
universalTransition
:
true
,
tooltip
:
{
show
:
false
},
data
:
series
,
},
{
type
:
'effectScatter'
,
coordinateSystem
:
'geo'
,
// zlevel: 2,
rippleEffect
:
{
brushType
:
'stroke'
},
label
:
{
show
:
true
,
position
:
'right'
,
formatter
:
(
value
)
=>
{
if
(
this
.
elementInfo
.
option
.
dataset
.
formatter
)
{
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
value
)
}
else
{
return
this
.
elementInfo
.
option
.
dataset
.
show
?
`
${
value
.
data
.
name
}
:
${
value
.
data
.
value
[
2
]}
`
:
value
.
data
.
name
}
},
fontSize
:
this
.
elementInfo
.
option
.
dataset
.
fontSize
,
color
:
this
.
elementInfo
.
option
.
dataset
.
color
,
fontWeight
:
this
.
elementInfo
.
option
.
dataset
.
fontWeight
},
symbolSize
:
6
,
itemStyle
:
{
color
:
'#a6c84c'
},
data
:
series
,
}]
}
return
options
},
/**
/**
* 柱状图数据处理
* 柱状图数据处理
*/
*/
...
...
components/NormalTabs/NormalTabs.vue
0 → 100644
View file @
4cfcbebd
<
template
>
<view
class=
"normal-tabs"
>
<u-tabs
v-if=
"elementInfo.option.tabs.type === 'radio'"
:list=
"elementData.dataList.series"
:is-scroll=
"false"
:current=
"currentTabs"
:active-color=
"elementInfo.option.tabs.activeColor"
:inactive-color=
"elementInfo.option.tabs.color"
:bg-color=
"elementInfo.option.tabs.backgroundColor"
@
change=
"handleTabsChange"
></u-tabs>
<u-input
v-if=
"elementInfo.option.tabs.type === 'select'"
v-model=
"tabsValue"
type=
"select"
border=
"true"
@
click=
"show = true"
/>
<u-select
v-model=
"show"
:list=
"elementData.dataList.series"
:safe-area-inset-bottom=
"true"
label-name=
"name"
@
confirm=
"handleSelectChange"
></u-select>
</view>
</
template
>
<
script
>
import
echartElementData
from
'@/mixins/echartElementData.js'
export
default
{
name
:
"NormalTabs"
,
mixins
:
[
echartElementData
],
data
()
{
return
{
currentTabs
:
0
,
show
:
false
};
},
computed
:
{
tabsValue
()
{
return
this
.
elementData
.
dataList
.
series
[
this
.
currentTabs
].
value
}
},
methods
:
{
initChart
()
{},
handleTabsChange
(
index
)
{
this
.
currentTabs
=
index
},
handleSelectChange
(
e
)
{
console
.
log
(
e
)
}
}
}
</
script
>
<
style
>
</
style
>
pages/index/index.vue
View file @
4cfcbebd
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
<BarMixMap
v-if=
"element.type == 'BarMixMap'"
:elementInfo=
"element"
></BarMixMap>
<BarMixMap
v-if=
"element.type == 'BarMixMap'"
:elementInfo=
"element"
></BarMixMap>
<!-- 雷达图 -->
<!-- 雷达图 -->
<NormalRadar
v-if=
"element.type == 'NormalRadar'"
:elementInfo=
"element"
></NormalRadar>
<NormalRadar
v-if=
"element.type == 'NormalRadar'"
:elementInfo=
"element"
></NormalRadar>
<!-- 普通选项卡 -->
<NormalTabs
v-if=
"element.type == 'NormalTabs'"
:elementInfo=
"element"
></NormalTabs>
<!-- 文本框 -->
<!-- 文本框 -->
<BasicText
v-if=
"element.type == 'BasicText'"
:elementInfo=
"element"
></BasicText>
<BasicText
v-if=
"element.type == 'BasicText'"
:elementInfo=
"element"
></BasicText>
<!-- 真实时间 -->
<!-- 真实时间 -->
...
...
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