Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
energyai_vue
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
葛齐林
energyai_vue
Commits
5983515a
Commit
5983515a
authored
Apr 07, 2021
by
xiexingan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整
parent
b05cc6f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
58 deletions
+63
-58
myPies.vue
src/pages/components/myPies.vue
+52
-53
page.vue
src/pages/home/page.vue
+11
-5
No files found.
src/pages/components/myPies.vue
View file @
5983515a
...
...
@@ -6,115 +6,114 @@
<
script
>
export
default
{
name
:
"myPies"
,
name
:
'myPies'
,
data
()
{
return
{
myPies
:
null
,
}
;
myPies
:
null
}
},
mounted
()
{
this
.
initPie
()
;
this
.
initPie
()
},
methods
:
{
initPie
()
{
let
myPie
=
document
.
getElementById
(
"myPies"
);
this
.
myPies
=
this
.
$echarts
.
init
(
myPie
)
;
let
myPie
=
document
.
getElementById
(
'myPies'
)
this
.
myPies
=
this
.
$echarts
.
init
(
myPie
)
const
data
=
[
{
name
:
"冷"
,
value
:
150
},
{
name
:
"适中"
,
value
:
80
},
{
name
:
"热"
,
value
:
80
},
]
;
{
name
:
'冷'
,
value
:
150
},
{
name
:
'适中'
,
value
:
80
},
{
name
:
'热'
,
value
:
80
}
]
const
option
=
{
tooltip
:
{
trigger
:
"item"
,
formatter
:
"{a} <br/>{b}: {c} ({d}%)"
,
trigger
:
'item'
,
formatter
:
'{a} <br/>{b}: {c} ({d}%)'
},
legend
:
{
show
:
true
,
orient
:
'
vertic
al'
,
orient
:
'
horizont
al'
,
// left: "center",
bottom
:
"40"
,
bottom
:
'40'
,
itemHeight
:
13
,
itemWidth
:
13
,
itemGap
:
35
,
icon
:
"circle"
,
icon
:
'circle'
,
data
:
data
,
formatter
:
function
(
name
)
{
var
total
=
0
;
var
target
;
var
value
;
var
total
=
0
var
target
var
value
for
(
let
i
=
0
,
l
=
data
.
length
;
i
<
l
;
i
++
)
{
value
=
data
[
i
].
value
;
total
+=
data
[
i
].
value
;
value
=
data
[
i
].
value
total
+=
data
[
i
].
value
if
(
data
[
i
].
name
==
name
)
{
target
=
data
[
i
].
value
;
target
=
data
[
i
].
value
}
}
return
name
+
' '
+
((
target
/
total
)
*
100
).
toFixed
(
0
)
+
'%'
return
name
+
' '
+
((
target
/
total
)
*
100
).
toFixed
(
0
)
+
'%'
},
textStyle
:
{
rich
:
{
a
:
{
color
:
"#333333"
,
color
:
'#333333'
,
// verticalAlign: "top",
// align: "center",
// fontSize: 12,
// padding: [10, 0, 28, 0]
padding
:
20
padding
:
20
},
b
:
{
// align: "left",
// fontSize: 18,
padding
:
[
10
,
10
,
10
,
0
],
// // lineHeight: 25,
color
:
"#333333"
}
,
}
,
}
,
color
:
'#333333'
}
}
}
},
color
:
[
'rgba(72,154,254,1)'
,
'rgba(247,243,204,1)'
,
'rgba(236,73,104,1)'
],
color
:
[
'rgba(72,154,254,1)'
,
'rgba(247,243,204,1)'
,
'rgba(236,73,104,1)'
],
series
:
[
{
name
:
"访问来源"
,
type
:
"pie"
,
radius
:
[
"50%"
,
"70%"
],
center
:
[
"50%"
,
"40%"
],
name
:
'访问来源'
,
type
:
'pie'
,
radius
:
[
'50%'
,
'70%'
],
center
:
[
'50%'
,
'40%'
],
avoidLabelOverlap
:
false
,
label
:
{
// show: true,
position
:
"center"
,
position
:
'center'
,
normal
:
{
show
:
true
,
position
:
"center"
,
position
:
'center'
,
formatter
:
function
()
{
return
`调查总数\r\n \r\n20000`
;
return
`调查总数\r\n \r\n20000`
},
textStyle
:
{
fontSize
:
30
,
color
:
"#333"
,
}
,
}
,
color
:
'#333'
}
}
},
emphasis
:
{
label
:
{
show
:
false
,
fontSize
:
"30"
,
fontWeight
:
"bold"
,
}
,
fontSize
:
'30'
,
fontWeight
:
'bold'
}
},
labelLine
:
{
show
:
false
,
show
:
false
},
data
:
[...
data
],
},
],
};
this
.
myPies
.
setOption
(
option
);
},
},
};
</
script
>
\ No newline at end of file
data
:
[...
data
]
}
]
}
this
.
myPies
.
setOption
(
option
)
}
}
}
</
script
>
src/pages/home/page.vue
View file @
5983515a
...
...
@@ -16,6 +16,7 @@
<span
v-if=
"index == 0"
v-html=
"item.cardText"
></span>
<span
v-else-if=
"index == 1"
v-html=
"item.cardText"
></span>
<span
v-else
>
{{
item
.
cardText
}}
</span>
<p
>
{{
item
.
state
}}
</p>
</div>
</div>
</div>
...
...
@@ -153,17 +154,22 @@ export default {
{
iconUrl
:
require
(
'./image/sun_icon.png'
),
cardDesc
:
'供暖模式'
,
cardText
:
'办公区域供暖模式已开启'
cardText
:
'办公区域供暖模式'
,
state
:
'已开启'
},
{
iconUrl
:
require
(
'./image/fan_icon.png'
),
cardDesc
:
'机械通风模式'
,
cardText
:
'办公区域机械通风模式已开启'
cardText
:
'办公区域机械通风模式'
,
state
:
'已开启'
},
{
iconUrl
:
require
(
'./image/nan_fan_icon.png'
),
cardDesc
:
'自然通风模式'
,
cardText
:
'办公区域自然通风模式已开启'
cardText
:
'办公区域自然通风模式'
,
state
:
'已开启'
}
],
dateList
:
[
...
...
@@ -224,7 +230,7 @@ export default {
img
{
width
:
50px
;
height
:
50px
;
padding-bottom
:
1
9
px
;
padding-bottom
:
1
3
px
;
}
.card-desc
{
font-size
:
16px
;
...
...
@@ -234,7 +240,7 @@ export default {
// padding-bottom: 16px;
}
.card-text
{
font-size
:
30
px
;
font-size
:
26
px
;
font-family
:
PingFang
SC
;
font-weight
:
600
;
color
:
#333333
;
...
...
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