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
cad8abef
Commit
cad8abef
authored
Mar 01, 2022
by
leon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:use that repleace this in some functions
parent
1c032356
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
229 additions
and
187 deletions
+229
-187
BarMixMap.vue
components/BarMixMap/BarMixMap.vue
+11
-10
ChinaMap.vue
components/ChinaMap/ChinaMap.vue
+15
-14
CountTo.vue
components/CountTo/CountTo.vue
+6
-5
HorizontalBar.vue
components/HorizontalBar/HorizontalBar.vue
+14
-12
LineMixBar.vue
components/LineMixBar/LineMixBar.vue
+16
-14
NormalBar.vue
components/NormalBar/NormalBar.vue
+13
-11
NormalGauge.vue
components/NormalGauge/NormalGauge.vue
+6
-5
NormalLine.vue
components/NormalLine/NormalLine.vue
+13
-11
NormalPie.vue
components/NormalPie/NormalPie.vue
+8
-7
NormalRadar.vue
components/NormalRadar/NormalRadar.vue
+7
-6
NormalTable.vue
components/NormalTable/NormalTable.vue
+4
-3
NumberScroll.vue
components/NumberScroll/NumberScroll.vue
+4
-3
RealTime.vue
components/RealTime/RealTime.vue
+3
-2
RemoteImage.vue
components/RemoteImage/RemoteImage.vue
+3
-2
Table.vue
components/Table/Table.vue
+3
-2
echartElementData.js
mixins/echartElementData.js
+21
-18
index.vue
pages/center/index.vue
+2
-2
details.vue
pages/details/details.vue
+38
-32
index.vue
pages/index/index.vue
+33
-21
reports.vue
pages/reports/reports.vue
+9
-7
No files found.
components/BarMixMap/BarMixMap.vue
View file @
cad8abef
...
...
@@ -32,27 +32,28 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
clearInterval
(
this
.
changeTimer
)
this
.
$refs
[
'barMixMapCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
clearInterval
(
that
.
changeTimer
)
that
.
$refs
[
'barMixMapCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
let
options
=
th
is
.
setMapOption
()
const
{
mapMixBarShow
,
mapMixBarChangeInterval
}
=
th
is
.
elementInfo
.
option
.
mapMix
let
options
=
th
at
.
setMapOption
()
const
{
mapMixBarShow
,
mapMixBarChangeInterval
}
=
th
at
.
elementInfo
.
option
.
mapMix
let
flag
=
true
chart
.
setOption
(
options
,
true
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
// 柱状图 地图 切换
if
(
mapMixBarShow
&&
mapMixBarChangeInterval
)
{
clearInterval
(
th
is
.
changeTimer
)
th
is
.
changeTimer
=
setInterval
(()
=>
{
options
=
flag
?
th
is
.
setBarOption
()
:
this
.
setMapOption
()
clearInterval
(
th
at
.
changeTimer
)
th
at
.
changeTimer
=
setInterval
(()
=>
{
options
=
flag
?
th
at
.
setBarOption
()
:
that
.
setMapOption
()
flag
=
!
flag
chart
.
setOption
(
options
,
true
)
},
mapMixBarChangeInterval
*
1000
)
...
...
components/ChinaMap/ChinaMap.vue
View file @
cad8abef
...
...
@@ -28,15 +28,16 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'chinaMapCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'chinaMapCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
dataList
}
=
th
is
.
elementData
const
{
dataList
}
=
th
at
.
elementData
const
seriesData
=
dataList
.
chinaMapAreas
||
[]
// 处理成地图所需的数据格式
const
finalData
=
[];
...
...
@@ -71,7 +72,7 @@
curveness
:
0.2
}
},
data
:
th
is
.
convertData
(
item
[
1
])
data
:
th
at
.
convertData
(
item
[
1
])
},
{
name
:
item
[
0
],
type
:
'effectScatter'
,
...
...
@@ -84,15 +85,15 @@
show
:
true
,
position
:
'right'
,
formatter
:
value
=>
{
if
(
th
is
.
elementInfo
.
option
.
dataset
.
formatter
)
{
return
th
is
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
value
)
if
(
th
at
.
elementInfo
.
option
.
dataset
.
formatter
)
{
return
th
at
.
$u
.
common
.
converFunction
(
that
.
elementInfo
.
option
.
dataset
.
formatter
,
value
)
}
else
{
return
th
is
.
elementInfo
.
option
.
dataset
.
show
?
`
${
value
.
data
.
name
}
:
${
value
.
data
.
value
[
2
]}
`
:
value
.
data
.
name
return
th
at
.
elementInfo
.
option
.
dataset
.
show
?
`
${
value
.
data
.
name
}
:
${
value
.
data
.
value
[
2
]}
`
:
value
.
data
.
name
}
},
fontSize
:
th
is
.
elementInfo
.
option
.
dataset
.
fontSize
,
color
:
th
is
.
elementInfo
.
option
.
dataset
.
color
,
fontWeight
:
th
is
.
elementInfo
.
option
.
dataset
.
fontWeight
fontSize
:
th
at
.
elementInfo
.
option
.
dataset
.
fontSize
,
color
:
th
at
.
elementInfo
.
option
.
dataset
.
color
,
fontWeight
:
th
at
.
elementInfo
.
option
.
dataset
.
fontWeight
},
symbolSize
:
4
,
itemStyle
:
{
...
...
@@ -109,10 +110,10 @@
const
options
=
{
title
:
{
...
th
is
.
elementInfo
.
option
.
title
...
th
at
.
elementInfo
.
option
.
title
},
legend
:
{
...
th
is
.
elementInfo
.
option
.
legend
...
th
at
.
elementInfo
.
option
.
legend
},
geo
:
{
map
:
'china'
,
...
...
@@ -132,7 +133,7 @@
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
})
...
...
components/CountTo/CountTo.vue
View file @
cad8abef
...
...
@@ -28,11 +28,12 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
startVal
=
this
.
endVal
this
.
endVal
=
this
.
elementData
.
dataList
.
endVal
if
(
this
.
elementInfo
.
option
.
countTo
.
duration
)
{
this
.
duration
=
this
.
elementInfo
.
option
.
countTo
.
duration
*
1000
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
startVal
=
that
.
endVal
that
.
endVal
=
that
.
elementData
.
dataList
.
endVal
if
(
that
.
elementInfo
.
option
.
countTo
.
duration
)
{
that
.
duration
=
that
.
elementInfo
.
option
.
countTo
.
duration
*
1000
}
})
},
...
...
components/HorizontalBar/HorizontalBar.vue
View file @
cad8abef
...
...
@@ -22,10 +22,11 @@
uniEcCanvas
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'horizontalBarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
initChart
()
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'horizontalBarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
...
...
@@ -38,15 +39,15 @@
preview
,
images
}
}
=
th
is
.
elementData
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
tooltip
:
{},
yAxis
:
{
...
th
is
.
elementInfo
.
option
.
yAxis
,
...
th
at
.
elementInfo
.
option
.
yAxis
,
data
:
categories
},
series
:
th
is
.
dealSeriesData
(
series
)
series
:
th
at
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
...
...
@@ -57,7 +58,7 @@
urls
:
images
})
}
else
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
}
})
return
chart
...
...
@@ -69,14 +70,15 @@
*/
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
that
=
this
const
newData
=
data
.
map
(
item
=>
{
const
config
=
{
type
:
'bar'
,
...
th
is
.
elementInfo
.
option
.
bar
,
...
th
at
.
elementInfo
.
option
.
bar
,
label
:
{
...
th
is
.
elementInfo
.
option
.
dataset
,
...
th
at
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
return
th
is
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
return
th
at
.
$u
.
common
.
converFunction
(
that
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
...
...
components/LineMixBar/LineMixBar.vue
View file @
cad8abef
...
...
@@ -28,9 +28,10 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'lineMixBarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'lineMixBarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
...
...
@@ -41,28 +42,28 @@
categories
,
series
}
}
=
th
is
.
elementData
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
tooltip
:
{},
xAxis
:
{
...
th
is
.
elementInfo
.
option
.
xAxis
,
...
th
at
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
yAxis
:
[{
...
th
is
.
elementInfo
.
option
.
yAxis
,
...
th
at
.
elementInfo
.
option
.
yAxis
,
type
:
'value'
},
{
...
th
is
.
elementInfo
.
option
.
yAxis
,
...
th
at
.
elementInfo
.
option
.
yAxis
,
type
:
'value'
}
],
series
:
th
is
.
dealSeriesData
(
series
)
series
:
th
at
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
})
...
...
@@ -73,25 +74,26 @@
*/
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
that
=
this
const
newData
=
data
.
map
(
item
=>
{
let
config
=
{
label
:
{
...
th
is
.
elementInfo
.
option
.
dataset
,
...
th
at
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
return
th
is
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
return
th
at
.
$u
.
common
.
converFunction
(
that
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
}
if
(
item
.
type
===
'bar'
)
{
config
=
{
...
config
,
...
th
is
.
elementInfo
.
option
.
bar
...
th
at
.
elementInfo
.
option
.
bar
}
}
else
if
(
item
.
type
===
'line'
)
{
config
=
{
yAxisIndex
:
1
,
...
config
,
...
th
is
.
elementInfo
.
option
.
line
...
th
at
.
elementInfo
.
option
.
line
}
}
return
{
...
...
components/NormalBar/NormalBar.vue
View file @
cad8abef
...
...
@@ -23,9 +23,10 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalbarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'normalbarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
...
...
@@ -36,19 +37,19 @@
categories
,
series
}
}
=
th
is
.
elementData
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
tooltip
:
{},
xAxis
:
{
...
th
is
.
elementInfo
.
option
.
xAxis
,
...
th
at
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
series
:
th
is
.
dealSeriesData
(
series
)
series
:
th
at
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
})
...
...
@@ -59,14 +60,15 @@
*/
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
that
=
this
const
newData
=
data
.
map
(
item
=>
{
const
config
=
{
type
:
'bar'
,
...
th
is
.
elementInfo
.
option
.
bar
,
...
th
at
.
elementInfo
.
option
.
bar
,
label
:
{
...
th
is
.
elementInfo
.
option
.
dataset
,
...
th
at
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
return
th
is
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
return
th
at
.
$u
.
common
.
converFunction
(
that
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
...
...
components/NormalGauge/NormalGauge.vue
View file @
cad8abef
...
...
@@ -31,17 +31,18 @@ export default {
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalGaugeCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'normalGaugeCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
dataList
:
{
guageChart
}
}
=
th
is
.
elementData
const
{
dataList
:
{
guageChart
}
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
tooltip
:
{
formatter
:
'{a} <br/>{b} : {c}%'
},
...
...
components/NormalLine/NormalLine.vue
View file @
cad8abef
...
...
@@ -22,9 +22,10 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalLineCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'normalLineCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
...
...
@@ -35,22 +36,22 @@
categories
,
series
}
}
=
th
is
.
elementData
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
color
:
[
'#00f2f1'
,
'#ed3f35'
,
'#1089E7'
,
"#F8B448"
,
"#8B78F6"
,
'#8cd8ff'
,
'#f0ad54'
,
'#ffffff'
,
'#000000'
],
tooltip
:
{},
xAxis
:
{
...
th
is
.
elementInfo
.
option
.
xAxis
,
...
th
at
.
elementInfo
.
option
.
xAxis
,
data
:
categories
},
series
:
th
is
.
dealSeriesData
(
series
)
series
:
th
at
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
})
...
...
@@ -61,14 +62,15 @@
*/
dealSeriesData
(
data
)
{
if
(
!
data
)
return
const
that
=
this
const
newData
=
data
.
map
(
item
=>
{
const
config
=
{
type
:
'line'
,
...
th
is
.
elementInfo
.
option
.
line
,
...
th
at
.
elementInfo
.
option
.
line
,
label
:
{
...
th
is
.
elementInfo
.
option
.
dataset
,
...
th
at
.
elementInfo
.
option
.
dataset
,
formatter
:
val
=>
{
return
th
is
.
$u
.
common
.
converFunction
(
this
.
elementInfo
.
option
.
dataset
return
th
at
.
$u
.
common
.
converFunction
(
that
.
elementInfo
.
option
.
dataset
.
formatter
,
val
)
}
}
...
...
components/NormalPie/NormalPie.vue
View file @
cad8abef
...
...
@@ -31,27 +31,28 @@ export default {
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalPieCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'normalPieCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
})
canvas
.
setChart
(
chart
)
const
{
dataList
:
{
series
}
}
=
th
is
.
elementData
const
{
dataList
:
{
series
}
}
=
th
at
.
elementData
const
options
=
{
...
th
is
.
elementInfo
.
option
,
...
th
at
.
elementInfo
.
option
,
color
:
[
'#1089E7'
,
'#F57474'
,
'#56D0E3'
,
'#F8B448'
,
'#8B78F6'
],
tooltip
:
{
trigger
:
'item'
,
formatter
:
'{a}<br/>{b}:{c}({d}%)'
},
series
:
th
is
.
dealSeriesData
(
series
)
series
:
th
at
.
dealSeriesData
(
series
)
}
chart
.
setOption
(
options
)
chart
.
on
(
'click'
,
event
=>
{
th
is
.
handleEchartsClick
(
event
)
th
at
.
handleEchartsClick
(
event
)
})
return
chart
})
...
...
components/NormalRadar/NormalRadar.vue
View file @
cad8abef
...
...
@@ -28,9 +28,10 @@
},
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
'normalRadarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
this
.
$echarts
.
init
(
canvas
,
null
,
{
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
$refs
[
'normalRadarCanvas'
].
init
((
canvas
,
width
,
height
,
canvasDpr
)
=>
{
chart
=
that
.
$echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
height
:
height
,
devicePixelRatio
:
canvasDpr
...
...
@@ -41,7 +42,7 @@
indicator
,
series
}
}
=
th
is
.
elementData
}
=
th
at
.
elementData
const
config
=
{
tooltip
:
{},
radar
:
{
...
...
@@ -50,9 +51,9 @@
series
:
[{
type
:
'radar'
,
label
:
{
...
th
is
.
elementInfo
.
option
.
dataset
...
th
at
.
elementInfo
.
option
.
dataset
},
data
:
th
is
.
dealSeriesData
(
series
)
data
:
th
at
.
dealSeriesData
(
series
)
}]
}
chart
.
setOption
(
config
)
...
...
components/NormalTable/NormalTable.vue
View file @
cad8abef
...
...
@@ -72,9 +72,10 @@
}
,
methods: {
initChart() {
this.$nextTick(() => {
this.columns = this.elementInfo.table.column
this.chartTables = this.elementData.dataList.chartTables
const that = this
that.$nextTick(() => {
that.columns = that.elementInfo.table.column
that.chartTables = that.elementData.dataList.chartTables
}
)
}
,
cellClick(e) {
...
...
components/NumberScroll/NumberScroll.vue
View file @
cad8abef
...
...
@@ -45,9 +45,10 @@
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
endVal
=
this
.
elementData
.
dataList
.
endVal
this
.
toOrderNumber
(
this
.
endVal
)
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
endVal
=
that
.
elementData
.
dataList
.
endVal
that
.
toOrderNumber
(
that
.
endVal
)
})
},
...
...
components/RealTime/RealTime.vue
View file @
cad8abef
...
...
@@ -33,9 +33,10 @@
},
methods
:
{
getRealTime
()
{
this
.
timer
=
setInterval
(()
=>
{
const
that
=
this
that
.
timer
=
setInterval
(()
=>
{
const
timestamp
=
new
Date
().
getTime
()
th
is
.
realTime
=
this
.
$u
.
timeFormat
(
timestamp
,
this
.
getDateFormat
())
th
at
.
realTime
=
that
.
$u
.
timeFormat
(
timestamp
,
that
.
getDateFormat
())
},
1000
)
},
initChart
()
{},
...
...
components/RemoteImage/RemoteImage.vue
View file @
cad8abef
...
...
@@ -24,8 +24,9 @@
},
methods
:{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
imageUrl
=
this
.
elementData
.
dataList
.
imageUrl
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
imageUrl
=
that
.
elementData
.
dataList
.
imageUrl
})
}
}
...
...
components/Table/Table.vue
View file @
cad8abef
...
...
@@ -89,8 +89,9 @@
}
,
methods
:
{
initChart
()
{
this
.
$nextTick
(()
=>
{
this
.
chartTables
=
this
.
elementData
.
dataList
.
chartTables
const
that
=
this
that
.
$nextTick
(()
=>
{
that
.
chartTables
=
that
.
elementData
.
dataList
.
chartTables
}
)
}
,
cellClick
(
e
)
{
...
...
mixins/echartElementData.js
View file @
cad8abef
...
...
@@ -24,15 +24,16 @@ export default {
* 动态数据
*/
async
handleDynamicData
(
value
)
{
const
that
=
this
let
{
dataUrl
,
dataMethod
,
dataFormatter
,
dataProcessing
}
=
{
...
value
}
dataUrl
=
dataUrl
.
replace
(
/^
(\/
dashboardCharts
)?
|^
(\/
dashboardAPI
)?
/
,
''
)
let
res
=
await
th
is
.
$u
.
api
[
`
${
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
dataFormatter
,
{
let
res
=
await
th
at
.
$u
.
api
[
`
${
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
dataFormatter
,
{
custom
:
{
loading
:
false
}
})
if
(
dataProcessing
)
{
th
is
.
elementData
.
dataList
=
this
.
$u
.
common
.
converFunction
(
dataProcessing
,
res
.
data
)
th
at
.
elementData
.
dataList
=
that
.
$u
.
common
.
converFunction
(
dataProcessing
,
res
.
data
)
}
else
{
th
is
.
elementData
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
Result
))
th
at
.
elementData
.
dataList
=
JSON
.
parse
(
JSON
.
stringify
(
res
.
data
.
Result
))
}
},
/**
...
...
@@ -52,16 +53,17 @@ export default {
*/
async
handleDataSet
(
value
)
{
const
{
dataSetInfo
}
=
value
let
res
=
await
this
.
$u
.
api
.
dataSetPreview
(
dataSetInfo
)
const
that
=
this
let
res
=
await
that
.
$u
.
api
.
dataSetPreview
(
dataSetInfo
)
const
{
Status
,
Msg
}
=
res
.
data
;
if
(
Status
==
"true"
)
{
if
(
dataSetInfo
.
script
)
{
th
is
.
elementData
.
dataList
=
this
.
$u
.
common
.
converFunction
(
dataSetInfo
.
script
,
res
.
data
.
Result
)
th
at
.
elementData
.
dataList
=
that
.
$u
.
common
.
converFunction
(
dataSetInfo
.
script
,
res
.
data
.
Result
)
}
else
{
th
is
.
elementData
.
dataList
=
res
.
data
.
Result
th
at
.
elementData
.
dataList
=
res
.
data
.
Result
}
}
else
{
th
is
.
$u
.
toast
(
Msg
)
th
at
.
$u
.
toast
(
Msg
)
}
},
clearTimer
()
{
...
...
@@ -85,31 +87,32 @@ export default {
watch
:
{
'elementInfo.data'
:
{
handler
(
newVal
)
{
if
(
this
.
elementInfo
.
hide
)
return
false
const
that
=
this
if
(
that
.
elementInfo
.
hide
)
return
false
if
(
newVal
.
dataType
===
'static'
)
{
th
is
.
handleStaticData
(
newVal
)
th
at
.
handleStaticData
(
newVal
)
}
else
if
(
newVal
.
dataType
===
'dynamic'
)
{
th
is
.
handleDynamicData
(
newVal
)
th
at
.
handleDynamicData
(
newVal
)
if
(
newVal
.
dataPolling
)
{
th
is
.
timer
=
setInterval
(()
=>
{
th
is
.
handleDynamicData
(
newVal
)
th
at
.
timer
=
setInterval
(()
=>
{
th
at
.
handleDynamicData
(
newVal
)
},
newVal
.
dataPollingInterval
*
1000
)
}
else
{
clearInterval
(
th
is
.
timer
)
clearInterval
(
th
at
.
timer
)
}
}
else
if
(
newVal
.
dataType
===
'public'
)
{
th
is
.
handlePublicData
(
newVal
)
th
at
.
handlePublicData
(
newVal
)
}
else
if
(
newVal
.
dataType
===
'dataSet'
)
{
th
is
.
handleDataSet
(
newVal
)
th
at
.
handleDataSet
(
newVal
)
if
(
newVal
.
dataPolling
)
{
th
is
.
timer
=
setInterval
(()
=>
{
th
is
.
handleDataSet
(
newVal
)
th
at
.
timer
=
setInterval
(()
=>
{
th
at
.
handleDataSet
(
newVal
)
},
newVal
.
dataPollingInterval
*
1000
)
}
else
{
clearInterval
(
th
is
.
timer
)
clearInterval
(
th
at
.
timer
)
}
}
},
...
...
pages/center/index.vue
View file @
cad8abef
...
...
@@ -34,7 +34,7 @@
async
onLoad
()
{
var
admin
=
uni
.
getStorageSync
(
'admin'
)
if
(
admin
)
{
this
.
$data
.
admin
=
admin
this
.
admin
=
admin
}
},
onShow
()
{
...
...
@@ -59,7 +59,7 @@
itemList
[
2
].
count
=
Result
.
authorized
;
}
this
.
$data
.
itemList
=
itemList
this
.
itemList
=
itemList
})
},
// item 点击
...
...
pages/details/details.vue
View file @
cad8abef
<
template
>
<view
class=
"viewport-wrapper"
:style=
"[styleObject]"
>
<template
v-for=
"(element, index) in report
Data
"
>
<template
v-for=
"(element, index) in report
Info.list
"
>
<view
class=
"view-element"
v-show=
"!element.hide"
...
...
@@ -60,51 +60,61 @@
data
()
{
return
{
reportInfo
:
{},
reportData
:
[],
timename
:
null
,
detailId
:
""
detailId
:
""
,
timename
:
null
}
},
computed
:
{
styleObject
()
{
if
(
JSON
.
stringify
(
this
.
reportInfo
)
==
"{}"
)
{
return
}
let
params
=
{}
const
{
backgroundColor
,
backgroundImage
}
=
this
.
reportI
nfo
const
{
backgroundColor
,
backgroundImage
,
width
,
height
}
=
this
.
reportInfo
.
i
nfo
if
(
backgroundImage
)
params
=
{
'background-image'
:
`url(
${
backgroundImage
}
)`
}
return
{
width
:
`
${
width
*
this
.
scale
}
px`
,
height
:
`
${
height
*
this
.
scale
}
px`
,
'background-color'
:
backgroundColor
,
...
params
}
},
scale
()
{
if
(
JSON
.
stringify
(
this
.
reportInfo
)
==
"{}"
)
{
return
}
const
{
windowWidth
}
=
uni
.
getSystemInfoSync
()
const
{
width
,
height
}
=
this
.
reportInfo
const
{
width
,
height
}
=
this
.
reportInfo
.
info
return
windowWidth
/
width
}
},
onLoad
(
option
)
{
this
.
detailId
=
option
.
id
this
.
userAuthCheck
()
this
.
getReportCharts
()
},
onShow
()
{
const
that
=
this
/**
* 组件交互 - 参数
*/
uni
.
$on
(
'handleLinkParams'
,
({
index
,
paramName
,
value
})
=>
{
th
is
.
handleValueChange
(
index
,
paramName
,
value
)
th
at
.
handleValueChange
(
index
,
paramName
,
value
)
})
/**
* 组件交互 - 组件
*/
uni
.
$on
(
'handleLinkComp'
,
({
showData
,
hideData
})
=>
{
th
is
.
reportData
=
this
.
reportData
.
map
(
item
=>
{
th
at
.
reportInfo
.
list
=
that
.
reportInfo
.
list
.
map
(
item
=>
{
if
(
showData
.
includes
(
item
.
id
))
item
.
hide
=
false
if
(
hideData
.
includes
(
item
.
id
))
item
.
hide
=
true
return
item
})
})
},
})
},
onUnload
()
{
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
uni
.
$off
(
'handleLinkComp'
)
clearInterval
(
this
.
timename
)
},
methods
:
{
...
...
@@ -115,7 +125,7 @@
var
authorized
=
uni
.
getStorageSync
(
'authorized'
)
if
(
userId
)
{
if
(
authorized
)
{
this
.
getReportCharts
()
}
else
{
uni
.
reLaunch
({
url
:
'../login/authorized'
...
...
@@ -144,57 +154,56 @@
*/
async
getReportCharts
()
{
clearInterval
(
this
.
timename
)
let
res
=
await
this
.
$u
.
api
.
getReportCharts
({
id
:
this
.
detailId
})
const
that
=
this
let
res
=
await
that
.
$u
.
api
.
getReportCharts
({
id
:
that
.
detailId
})
uni
.
stopPullDownRefresh
()
const
{
Status
,
Result
:
{
info
,
list
}
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
info
.
dataUrl
)
{
th
is
.
getGlobalData
(
info
)
th
at
.
getGlobalData
(
info
)
if
(
info
.
dataPollingInterval
)
{
th
is
.
timename
=
setInterval
(()
=>
{
th
is
.
getGlobalData
(
info
)
th
at
.
timename
=
setInterval
(()
=>
{
th
at
.
getGlobalData
(
info
)
},
parseInt
(
info
.
dataPollingInterval
)
*
1000
)
}
}
this
.
reportInfo
=
info
this
.
reportData
=
list
that
.
reportInfo
=
res
.
data
.
Result
}
},
/**
* 获取全局接口数据
*/
async
getGlobalData
(
info
)
{
const
that
=
this
const
dataUrl
=
info
.
dataUrl
.
replace
(
/^
(\/
dashboardCharts
)?
|^
(\/
dashboardAPI
)?
/
,
''
)
let
res
=
await
th
is
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
info
.
dataFormatter
,
{
let
res
=
await
th
at
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
info
.
dataFormatter
,
{
custom
:
{
loading
:
false
}
})
th
is
.
$u
.
vuex
(
'vuex_globalData'
,
JSON
.
stringify
(
res
.
data
))
th
at
.
$u
.
vuex
(
'vuex_globalData'
,
JSON
.
stringify
(
res
.
data
))
},
/**
* 组件之间关联
*/
handleValueChange
(
index
,
paramName
,
value
)
{
if
(
index
.
length
&&
paramName
&&
value
)
{
this
.
reportData
=
this
.
reportData
.
map
(
item
=>
{
const
that
=
this
that
.
reportInfo
.
list
=
that
.
reportInfo
.
list
.
map
(
item
=>
{
const
flag
=
index
.
includes
(
item
.
id
)
if
(
flag
&&
item
.
type
===
'BasicText'
&&
item
.
data
.
dataType
===
'static'
)
{
th
is
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
th
at
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dynamic'
)
{
if
(
!
item
.
data
.
dataFormatter
)
item
.
data
.
dataFormatter
=
{}
th
is
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
th
at
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dataSet'
)
{
if
(
!
item
.
data
.
dataSetInfo
.
queryFormatter
)
item
.
data
.
dataSetInfo
.
queryFormatter
=
{}
th
is
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
th
at
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
}
return
item
})
}
}
},
onReachBottom
()
{
},
onPullDownRefresh
()
{
this
.
getReportCharts
()
...
...
@@ -203,18 +212,15 @@
</
script
>
<
style
lang=
"scss"
scoped
>
.
canvas
{
.
viewport-wrapper
{
position
:
relative
;
height
:
100%
;
user-select
:
none
;
overflow
:
auto
;
//
overflow: auto;
background-repeat
:
no-repeat
;
background-size
:
cover
;
background-position
:
center
;
}
.viewport-wrapper
{
position
:
relative
;
}
.view-element
{
position
:
absolute
;
user-select
:
none
;
...
...
pages/index/index.vue
View file @
cad8abef
<
template
>
<view
class=
"viewport-wrapper"
:style=
"[styleObject]"
>
<template
v-for=
"(element, index) in report
Data
"
>
<template
v-for=
"(element, index) in report
Info.list
"
>
<view
class=
"view-element"
v-show=
"!element.hide"
...
...
@@ -60,14 +60,16 @@
data
()
{
return
{
reportInfo
:
{},
reportData
:
[],
timename
:
null
}
},
computed
:
{
styleObject
()
{
if
(
JSON
.
stringify
(
this
.
reportInfo
)
==
"{}"
)
{
return
}
let
params
=
{}
const
{
backgroundColor
,
backgroundImage
,
width
,
height
}
=
this
.
reportInfo
const
{
backgroundColor
,
backgroundImage
,
width
,
height
}
=
this
.
reportInfo
.
info
if
(
backgroundImage
)
params
=
{
'background-image'
:
`url(
${
backgroundImage
}
)`
}
return
{
width
:
`
${
width
*
this
.
scale
}
px`
,
...
...
@@ -77,31 +79,39 @@
}
},
scale
()
{
if
(
JSON
.
stringify
(
this
.
reportInfo
)
==
"{}"
)
{
return
}
const
{
windowWidth
}
=
uni
.
getSystemInfoSync
()
const
{
width
,
height
}
=
this
.
reportInfo
const
{
width
,
height
}
=
this
.
reportInfo
.
info
return
windowWidth
/
width
}
},
onLoad
()
{
this
.
userAuthCheck
()
},
// detail页面也会监听这两个事件,所有index页面需要在onShow里面增加监听,在onHide里面移除监听
onShow
()
{
const
that
=
this
/**
* 组件交互 - 参数
*/
uni
.
$on
(
'handleLinkParams'
,
({
index
,
paramName
,
value
})
=>
{
th
is
.
handleValueChange
(
index
,
paramName
,
value
)
th
at
.
handleValueChange
(
index
,
paramName
,
value
)
})
/**
* 组件交互 - 组件
*/
uni
.
$on
(
'handleLinkComp'
,
({
showData
,
hideData
})
=>
{
th
is
.
reportData
=
this
.
reportData
.
map
(
item
=>
{
th
at
.
reportInfo
.
list
=
that
.
reportInfo
.
list
.
map
(
item
=>
{
if
(
showData
.
includes
(
item
.
id
))
item
.
hide
=
false
if
(
hideData
.
includes
(
item
.
id
))
item
.
hide
=
true
return
item
})
})
},
on
Unload
()
{
})
},
on
Hide
()
{
// 移除监听事件
uni
.
$off
(
'handleLinkParams'
)
uni
.
$off
(
'handleLinkComp'
)
...
...
@@ -144,49 +154,51 @@
*/
async
getReportCharts
()
{
clearInterval
(
this
.
timename
)
let
res
=
await
this
.
$u
.
api
.
getReportCharts
({
id
:
'61cd2ba1c06bffbdae442c4f'
})
const
that
=
this
let
res
=
await
that
.
$u
.
api
.
getReportCharts
({
id
:
'61cd2ba1c06bffbdae442c4f'
})
uni
.
stopPullDownRefresh
()
const
{
Status
,
Result
:
{
info
,
list
}
}
=
res
.
data
if
(
Status
===
'true'
)
{
if
(
info
.
dataUrl
)
{
th
is
.
getGlobalData
(
info
)
th
at
.
getGlobalData
(
info
)
if
(
info
.
dataPollingInterval
)
{
th
is
.
timename
=
setInterval
(()
=>
{
th
is
.
getGlobalData
(
info
)
th
at
.
timename
=
setInterval
(()
=>
{
th
at
.
getGlobalData
(
info
)
},
parseInt
(
info
.
dataPollingInterval
)
*
1000
)
}
}
this
.
reportInfo
=
info
this
.
reportData
=
list
that
.
reportInfo
=
res
.
data
.
Result
}
},
/**
* 获取全局接口数据
*/
async
getGlobalData
(
info
)
{
const
that
=
this
const
dataUrl
=
info
.
dataUrl
.
replace
(
/^
(\/
dashboardCharts
)?
|^
(\/
dashboardAPI
)?
/
,
''
)
let
res
=
await
th
is
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
info
.
dataFormatter
,
{
let
res
=
await
th
at
.
$u
.
api
[
`
${
info
.
dataMethod
.
toLowerCase
()}
Http`
](
dataUrl
,
info
.
dataFormatter
,
{
custom
:
{
loading
:
false
}
})
th
is
.
$u
.
vuex
(
'vuex_globalData'
,
JSON
.
stringify
(
res
.
data
))
th
at
.
$u
.
vuex
(
'vuex_globalData'
,
JSON
.
stringify
(
res
.
data
))
},
/**
* 组件之间关联
*/
handleValueChange
(
index
,
paramName
,
value
)
{
if
(
index
.
length
&&
paramName
&&
value
)
{
this
.
reportData
=
this
.
reportData
.
map
(
item
=>
{
const
that
=
this
that
.
reportInfo
.
list
=
that
.
reportInfo
.
list
.
map
(
item
=>
{
const
flag
=
index
.
includes
(
item
.
id
)
if
(
flag
&&
item
.
type
===
'BasicText'
&&
item
.
data
.
dataType
===
'static'
)
{
th
is
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
th
at
.
$set
(
item
.
data
.
dataList
,
'text'
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dynamic'
)
{
if
(
!
item
.
data
.
dataFormatter
)
item
.
data
.
dataFormatter
=
{}
th
is
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
th
at
.
$set
(
item
.
data
.
dataFormatter
,
paramName
,
value
)
}
if
(
flag
&&
item
.
data
.
dataType
===
'dataSet'
)
{
if
(
!
item
.
data
.
dataSetInfo
.
queryFormatter
)
item
.
data
.
dataSetInfo
.
queryFormatter
=
{}
th
is
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
th
at
.
$set
(
item
.
data
.
dataSetInfo
.
queryFormatter
,
paramName
,
value
)
}
return
item
})
...
...
pages/reports/reports.vue
View file @
cad8abef
...
...
@@ -37,7 +37,7 @@
pageSize
:
10
,
totalPages
:
0
,
totals
:
0
,
folderId
:
'6
1cd45a8c06bffbdae442d09
'
,
folderId
:
'6
21db7710668d7e647d5f4cc
'
,
superAdmin
:
true
}
}
...
...
@@ -50,16 +50,18 @@
* 获取页面报表配置
*/
async
getReportList
()
{
let
res
=
await
this
.
$u
.
api
.
getReportList
(
this
.
params
)
const
that
=
this
let
res
=
await
that
.
$u
.
api
.
getReportList
(
that
.
params
)
const
{
Status
,
Result
}
=
res
.
data
uni
.
stopPullDownRefresh
()
if
(
Status
===
'true'
)
{
if
(
th
is
.
params
.
pageNumber
===
1
)
{
th
is
.
reportList
=
Result
.
content
if
(
th
at
.
params
.
pageNumber
===
1
)
{
th
at
.
reportList
=
Result
.
content
}
else
{
th
is
.
reportList
=
this
.
reportList
.
concat
(
Result
.
content
)
th
at
.
reportList
=
that
.
reportList
.
concat
(
Result
.
content
)
}
th
is
.
params
.
totals
=
Result
.
total
th
is
.
params
.
totalPages
=
Result
.
totalPages
th
at
.
params
.
totals
=
Result
.
total
th
at
.
params
.
totalPages
=
Result
.
totalPages
}
},
...
...
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