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
70a9aa5e
Commit
70a9aa5e
authored
Jan 13, 2022
by
Jenny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 公用文件调整
parent
ee656d42
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
48 additions
and
52 deletions
+48
-52
ChinaMap.vue
components/ChinaMap/ChinaMap.vue
+1
-1
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+3
-8
LineMixBar.vue
components/LineMixBar/LineMixBar.vue
+3
-8
NormalBar.vue
components/NormalBar/NormalBar.vue
+3
-8
NormalGauge.vue
components/NormalGauge/NormalGauge.vue
+6
-10
NormalLine.vue
components/NormalLine/NormalLine.vue
+3
-8
main.js
main.js
+4
-0
echartElementData.js
mixins/echartElementData.js
+2
-3
common.scss
static/style/common.scss
+6
-0
common.js
utils/common.js
+17
-6
No files found.
components/ChinaMap/ChinaMap.vue
View file @
70a9aa5e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"china-map"
id=
"china-map"
ref=
"canvas"
ref=
"c
hinaMapC
anvas"
canvas-id=
"china-map-chart"
canvas-id=
"china-map-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
...
...
components/HorizontalBar/HorizontalBar.vue
View file @
70a9aa5e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"horizontal-bar"
id=
"horizontal-bar"
ref=
"
c
anvas"
ref=
"
horizontalBarC
anvas"
canvas-id=
"horizontal-bar-chart"
canvas-id=
"horizontal-bar-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
c
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
this
.
$refs
[
'
horizontalBarC
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
...
@@ -69,7 +69,7 @@ export default {
...
@@ -69,7 +69,7 @@ export default {
label
:
{
label
:
{
...
this
.
elementInfo
.
option
.
dataset
,
...
this
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
formatter
:
val
=>
{
return
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
}
}
}
}
...
@@ -81,9 +81,4 @@ export default {
...
@@ -81,9 +81,4 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.uni-ec-canvas
{
width
:
750
rpx
;
height
:
750
rpx
;
display
:
block
;
}
</
style
>
</
style
>
components/LineMixBar/LineMixBar.vue
View file @
70a9aa5e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"line-mix-bar"
id=
"line-mix-bar"
ref=
"
c
anvas"
ref=
"
lineMixBarC
anvas"
canvas-id=
"line-mix-bar-chart"
canvas-id=
"line-mix-bar-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
c
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
this
.
$refs
[
'
lineMixBarC
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
label
:
{
label
:
{
...
this
.
elementInfo
.
option
.
dataset
,
...
this
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
formatter
:
val
=>
{
return
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
}
}
}
}
...
@@ -108,9 +108,4 @@
...
@@ -108,9 +108,4 @@
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.uni-ec-canvas
{
width
:
750
rpx
;
height
:
750
rpx
;
display
:
block
;
}
</
style
>
</
style
>
components/NormalBar/NormalBar.vue
View file @
70a9aa5e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"normal-bar"
id=
"normal-bar"
ref=
"
c
anvas"
ref=
"
normalbarC
anvas"
canvas-id=
"normal-bar-chart"
canvas-id=
"normal-bar-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
...
@@ -35,7 +35,7 @@ export default {
...
@@ -35,7 +35,7 @@ export default {
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
c
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
this
.
$refs
[
'
normalbarC
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
...
@@ -69,7 +69,7 @@ export default {
...
@@ -69,7 +69,7 @@ export default {
label
:
{
label
:
{
...
this
.
elementInfo
.
option
.
dataset
,
...
this
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
formatter
:
val
=>
{
return
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
}
}
}
}
...
@@ -81,9 +81,4 @@ export default {
...
@@ -81,9 +81,4 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.uni-ec-canvas
{
width
:
750
rpx
;
height
:
750
rpx
;
display
:
block
;
}
</
style
>
</
style
>
components/NormalGauge/NormalGauge.vue
View file @
70a9aa5e
...
@@ -2,9 +2,9 @@
...
@@ -2,9 +2,9 @@
<view>
<view>
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"
NormalG
auge"
id=
"
normal-g
auge"
ref=
"
c
anvas"
ref=
"
normalGaugeC
anvas"
canvas-id=
"
lazy-load
-chart"
canvas-id=
"
normal-gauge
-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
</view>
</view>
...
@@ -26,7 +26,7 @@ export default {
...
@@ -26,7 +26,7 @@ export default {
lazyLoad
:
true
lazyLoad
:
true
}
}
};
};
}
}
,
onReady
()
{
onReady
()
{
...
@@ -39,14 +39,14 @@ export default {
...
@@ -39,14 +39,14 @@ export default {
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
c
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
this
.
$refs
[
'
normalGaugeC
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
devicePixelRatio
:
canvasDpr
devicePixelRatio
:
canvasDpr
})
})
canvas
.
setChart
(
chart
)
canvas
.
setChart
(
chart
)
const
{
dataList
:
{
categories
,
series
}
}
=
this
.
elementData
const
{
dataList
:
{
guageChart
}
}
=
this
.
elementData
const
options
=
{
const
options
=
{
...
this
.
elementInfo
.
option
,
...
this
.
elementInfo
.
option
,
tooltip
:
{
tooltip
:
{
...
@@ -62,10 +62,6 @@ export default {
...
@@ -62,10 +62,6 @@ export default {
return
chart
return
chart
})
})
})
})
},
dealSeriesData
(
data
)
{
return
data
}
}
}
}
}
}
...
...
components/NormalLine/NormalLine.vue
View file @
70a9aa5e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<uni-ec-canvas
<uni-ec-canvas
class=
"uni-ec-canvas"
class=
"uni-ec-canvas"
id=
"normal-line"
id=
"normal-line"
ref=
"
c
anvas"
ref=
"
normalLineC
anvas"
canvas-id=
"normal-line-chart"
canvas-id=
"normal-line-chart"
:ec=
"ec"
:ec=
"ec"
></uni-ec-canvas>
></uni-ec-canvas>
...
@@ -34,7 +34,7 @@ export default {
...
@@ -34,7 +34,7 @@ export default {
methods
:
{
methods
:
{
initChart
()
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'
c
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
this
.
$refs
[
'
normalLineC
anvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
...
@@ -69,7 +69,7 @@ export default {
...
@@ -69,7 +69,7 @@ export default {
label
:
{
label
:
{
...
this
.
elementInfo
.
option
.
dataset
,
...
this
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
formatter
:
val
=>
{
return
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
return
this
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
}
}
}
}
...
@@ -81,9 +81,4 @@ export default {
...
@@ -81,9 +81,4 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.uni-ec-canvas
{
width
:
750
rpx
;
height
:
750
rpx
;
display
:
block
;
}
</
style
>
</
style
>
main.js
View file @
70a9aa5e
...
@@ -27,4 +27,8 @@ Vue.use(HTTPInterceptor, app)
...
@@ -27,4 +27,8 @@ Vue.use(HTTPInterceptor, app)
import
HTTPApi
from
'@/common/http.api.js'
import
HTTPApi
from
'@/common/http.api.js'
Vue
.
use
(
HTTPApi
,
app
)
Vue
.
use
(
HTTPApi
,
app
)
// 自定义方法
import
common
from
'./utils/common.js'
Vue
.
use
(
common
,
app
)
app
.
$mount
()
app
.
$mount
()
mixins/echartElementData.js
View file @
70a9aa5e
import
{
converFunction
}
from
'@/utils/common.js'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -29,7 +28,7 @@ export default {
...
@@ -29,7 +28,7 @@ export default {
if
(
value
.
queryFormatter
)
dataFormatter
=
{...
dataFormatter
,
...
value
.
queryFormatter
}
if
(
value
.
queryFormatter
)
dataFormatter
=
{...
dataFormatter
,
...
value
.
queryFormatter
}
let
res
=
await
this
.
$u
[
dataMethod
.
toLowerCase
()](
dataUrl
,
dataFormatter
)
let
res
=
await
this
.
$u
[
dataMethod
.
toLowerCase
()](
dataUrl
,
dataFormatter
)
if
(
dataProcessing
)
{
if
(
dataProcessing
)
{
this
.
elementData
.
dataList
=
converFunction
(
dataProcessing
,
res
.
data
)
this
.
elementData
.
dataList
=
this
.
$u
.
common
.
converFunction
(
dataProcessing
,
res
.
data
)
}
else
{
}
else
{
this
.
elementData
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
Result
))
this
.
elementData
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
Result
))
}
}
...
@@ -50,7 +49,7 @@ export default {
...
@@ -50,7 +49,7 @@ export default {
const
{
Status
,
Msg
}
=
res
.
data
;
const
{
Status
,
Msg
}
=
res
.
data
;
if
(
Status
==
"true"
)
{
if
(
Status
==
"true"
)
{
if
(
dataSetInfo
.
script
)
{
if
(
dataSetInfo
.
script
)
{
this
.
elementData
.
dataList
=
converFunction
(
dataSetInfo
.
script
,
res
.
data
.
Result
)
this
.
elementData
.
dataList
=
this
.
$u
.
common
.
converFunction
(
dataSetInfo
.
script
,
res
.
data
.
Result
)
}
else
{
}
else
{
this
.
elementData
.
dataList
=
res
.
data
.
Result
this
.
elementData
.
dataList
=
res
.
data
.
Result
}
}
...
...
static/style/common.scss
View file @
70a9aa5e
...
@@ -21,3 +21,9 @@
...
@@ -21,3 +21,9 @@
.my-u-block
{
.my-u-block
{
display
:
block
;
display
:
block
;
}
}
.uni-ec-canvas
{
width
:
100%
;
height
:
750rpx
;
display
:block
;
}
\ No newline at end of file
utils/common.js
View file @
70a9aa5e
import
{
Function
}
from
'../static/plugin/eval5/eval5.js'
import
{
Function
}
from
'../static/plugin/eval5/eval5.js'
/**
const
install
=
(
Vue
,
vm
)
=>
{
/**
* 数据转换
* 数据转换
*/
*/
export
const
converFunction
=
(
func
,
data
)
=>
{
const
converFunction
=
(
func
,
data
)
=>
{
if
(
!
func
)
return
if
(
!
func
)
return
return
new
Function
(
'"use strict";return ('
+
func
+
')'
)()(
data
);
return
new
Function
(
'"use strict";return ('
+
func
+
')'
)()(
data
);
}
vm
.
$u
.
common
=
{
converFunction
}
}
export
default
{
install
}
}
\ No newline at end of file
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