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
a74052f3
Commit
a74052f3
authored
Apr 27, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: datazoom enable when show is true
parent
6e627ad2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
70 deletions
+70
-70
BarMixMap.vue
components/BarMixMap/BarMixMap.vue
+1
-1
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+48
-48
LineMixBar.vue
components/LineMixBar/LineMixBar.vue
+6
-6
NormalBar.vue
components/NormalBar/NormalBar.vue
+7
-7
NormalLine.vue
components/NormalLine/NormalLine.vue
+8
-8
No files found.
components/BarMixMap/BarMixMap.vue
View file @
a74052f3
...
...
@@ -74,7 +74,7 @@
...
this
.
elementInfo
.
option
.
yAxis
,
data
:
this
.
dealSeriesData
(
series
).
categories
},
dataZoom
:
this
.
elementInfo
.
dataZoom
,
dataZoom
:
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
,
series
:
{
id
:
'associate'
,
type
:
'bar'
,
...
...
components/HorizontalBar/HorizontalBar.vue
View file @
a74052f3
...
...
@@ -45,26 +45,26 @@
...
this
.
elementInfo
.
option
.
yAxis
,
data
:
categories
},
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
,
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
,
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
this
.
ec
.
option
)
chart
.
setOption
(
this
.
ec
.
option
)
const
that
=
this
chart
.
on
(
'click'
,
event
=>
{
const
{
preview
,
images
}
=
that
.
elementData
.
dataList
var
urls
=
[]
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
images
.
forEach
(
url
=>
{
if
(
caches
.
hasOwnProperty
(
url
))
{
urls
.
push
(
caches
[
url
])
}
else
{
urls
.
push
(
url
)
}
})
chart
.
on
(
'click'
,
event
=>
{
const
{
preview
,
images
}
=
that
.
elementData
.
dataList
var
urls
=
[]
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
images
.
forEach
(
url
=>
{
if
(
caches
.
hasOwnProperty
(
url
))
{
urls
.
push
(
caches
[
url
])
}
else
{
urls
.
push
(
url
)
}
})
// 特殊处理,如果preview为true,代表点击显示图片
if
(
preview
)
{
uni
.
previewImage
({
...
...
@@ -74,19 +74,19 @@
}
else
{
that
.
handleEchartsClick
(
event
)
}
})
chart
.
on
(
'datazoom'
,
event
=>
{
that
.
echartsDataZoom
(
event
)
})
chart
.
on
(
'datazoom'
,
event
=>
{
that
.
echartsDataZoom
(
event
)
})
return
chart
},
initChart
()
{
const
{
categories
,
series
,
preview
,
images
}
=
this
.
elementData
.
dataList
this
.
$set
(
this
.
ec
.
option
,
'yAxis.data'
,
categories
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
)
if
(
preview
)
{
this
.
cacheImages
(
images
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[])
if
(
preview
)
{
this
.
cacheImages
(
images
)
}
},
/**
...
...
@@ -113,30 +113,30 @@
}
})
return
newData
},
/**
* 缓存图片数据
*/
cacheImages
(
images
)
{
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
if
(
!
caches
)
{
caches
=
{}
}
images
.
forEach
(
url
=>
{
// 如果包含当前url,就不再下载
if
(
!
caches
.
hasOwnProperty
(
url
))
{
uni
.
downloadFile
({
url
:
url
,
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
caches
[
url
]
=
res
.
tempFilePath
uni
.
setStorageSync
(
'cacheImages'
,
caches
)
}
}
})
}
})
}
},
/**
* 缓存图片数据
*/
cacheImages
(
images
)
{
var
caches
=
uni
.
getStorageSync
(
'cacheImages'
)
if
(
!
caches
)
{
caches
=
{}
}
images
.
forEach
(
url
=>
{
// 如果包含当前url,就不再下载
if
(
!
caches
.
hasOwnProperty
(
url
))
{
uni
.
downloadFile
({
url
:
url
,
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
caches
[
url
]
=
res
.
tempFilePath
uni
.
setStorageSync
(
'cacheImages'
,
caches
)
}
}
})
}
})
}
}
}
...
...
components/LineMixBar/LineMixBar.vue
View file @
a74052f3
...
...
@@ -54,11 +54,11 @@
type
:
'value'
}
],
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
,
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
,
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
this
.
ec
.
option
)
...
...
@@ -71,7 +71,7 @@
const
{
categories
,
series
}
=
this
.
elementData
.
dataList
this
.
$set
(
this
.
ec
.
option
,
'xAxis.data'
,
categories
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
)
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[])
},
/**
* 处理数据
...
...
components/NormalBar/NormalBar.vue
View file @
a74052f3
...
...
@@ -39,12 +39,12 @@
xAxis
:
{
...
this
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
,
},
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
,
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
this
.
ec
.
option
)
...
...
@@ -57,7 +57,7 @@
const
{
categories
,
series
}
=
this
.
elementData
.
dataList
this
.
$set
(
this
.
ec
.
option
,
'xAxis.data'
,
categories
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
)
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[])
},
/**
* 处理数据
...
...
components/NormalLine/NormalLine.vue
View file @
a74052f3
...
...
@@ -41,12 +41,12 @@
xAxis
:
{
...
this
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
,
},
tooltip
:
{
...
this
.
elementInfo
.
option
.
tooltip
,
trigger
:
"axis"
},
dataZoom
:
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
,
series
:
this
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
this
.
ec
.
option
)
...
...
@@ -58,8 +58,8 @@
initChart
()
{
const
{
categories
,
series
}
=
this
.
elementData
.
dataList
this
.
$set
(
this
.
ec
.
option
,
'xAxis.data'
,
categories
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
)
this
.
$set
(
this
.
ec
.
option
,
'series'
,
this
.
dealSeriesData
(
series
))
this
.
$set
(
this
.
ec
.
option
,
'dataZoom'
,
this
.
elementInfo
.
dataZoom
.
show
?
this
.
elementInfo
.
dataZoom
:
[]
)
},
/**
* 处理数据
...
...
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