Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-report
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
4
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 93e6b579
authored
Mar 03, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
5b3551be
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
src/assets/css/index.scss
src/components/Chart.vue
src/assets/css/index.scss
View file @
93e6b57
...
@@ -7,7 +7,14 @@ body .app {
...
@@ -7,7 +7,14 @@ body .app {
height
:
100vh
;
height
:
100vh
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
*
{
-webkit-touch-callout
:none
;
//系统默认菜单被禁用/
-webkit-user-select
:none
;
//webkit浏览器/
-khtml-user-select
:none
;
//早期浏览器/
-moz-user-select
:none
;
//火狐/
-ms-user-select
:none
;
//IE10/
user-select
:none
;
}
img
{
img
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
...
...
src/components/Chart.vue
View file @
93e6b57
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
(userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && tabIndex == 0 && trendChartList.length > 0)
(userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && tabIndex == 0 && trendChartList.length > 0)
"
"
></canvas>
></canvas>
<div
class=
"line-tooltip flex"
ref=
"lineCustomerTooltip"
></div>
<div
class=
"line-tooltip flex"
ref=
"lineCustomerTooltip"
id=
"2"
v-if=
"tabIndex == 0"
></div>
<!-- 产值的折线图 -->
<!-- 产值的折线图 -->
<canvas
<canvas
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
(tabIndex == 1 && userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && trendList.length > 0)
(tabIndex == 1 && userInfo.accountLevel == 4 && reportType == 1 && tabType.index == 0 && trendList.length > 0)
"
"
></canvas>
></canvas>
<div
class=
"line-tooltip flex"
ref=
"lineTooltip"
></div>
<div
class=
"line-tooltip flex"
ref=
"lineTooltip"
id=
"3"
v-if=
"tabIndex == 1"
></div>
<canvas
class=
"canvas"
id=
"pieChart"
v-show=
"tabIndex == 1 && tabType.index == 1 && productionValueReportList.length > 0"
></canvas>
<canvas
class=
"canvas"
id=
"pieChart"
v-show=
"tabIndex == 1 && tabType.index == 1 && productionValueReportList.length > 0"
></canvas>
<template
<template
...
@@ -119,8 +119,6 @@ export default {
...
@@ -119,8 +119,6 @@ export default {
})
})
},
},
initLineChart
(
id
=
'lineChart'
)
{
initLineChart
(
id
=
'lineChart'
)
{
let
offsetY
offsetY
=
document
.
getElementById
(
id
).
height
*
0.4
let
{
trendList
}
=
this
let
{
trendList
}
=
this
trendList
.
forEach
(
item
=>
{
trendList
.
forEach
(
item
=>
{
item
.
type
=
'新增产值'
item
.
type
=
'新增产值'
...
@@ -162,6 +160,8 @@ export default {
...
@@ -162,6 +160,8 @@ export default {
this
.
lineChart
.
tooltip
({
this
.
lineChart
.
tooltip
({
custom
:
true
,
custom
:
true
,
showCrosshairs
:
false
,
showCrosshairs
:
false
,
triggerOn
:
[
'touchstart'
,
'touchmove'
],
triggerOff
:
'touchend'
,
onChange
(
ev
)
{
onChange
(
ev
)
{
const
currentData
=
ev
.
items
[
0
]
const
currentData
=
ev
.
items
[
0
]
let
reg
=
/
(\d{4})
-
(\d{1,2})
-
(\d{1,2})
/
let
reg
=
/
(\d{4})
-
(\d{1,2})
-
(\d{1,2})
/
...
@@ -170,7 +170,7 @@ export default {
...
@@ -170,7 +170,7 @@ export default {
<div class="item flex"><span class="arc" style="color:#3975C6;">●</span>新增产值:
${
ev
.
items
[
0
].
value
}
</div>`
<div class="item flex"><span class="arc" style="color:#3975C6;">●</span>新增产值:
${
ev
.
items
[
0
].
value
}
</div>`
tooltipEl
.
style
.
opacity
=
1
tooltipEl
.
style
.
opacity
=
1
tooltipEl
.
style
.
left
=
currentData
.
x
-
140
/
2
+
'px'
tooltipEl
.
style
.
left
=
currentData
.
x
-
140
/
2
+
'px'
tooltipEl
.
style
.
top
=
currentData
.
y
-
4
0
-
15
+
'px'
tooltipEl
.
style
.
top
=
currentData
.
y
-
4
5
-
15
+
'px'
},
},
onHide
()
{
onHide
()
{
tooltipEl
.
style
.
opacity
=
0
tooltipEl
.
style
.
opacity
=
0
...
@@ -200,7 +200,7 @@ export default {
...
@@ -200,7 +200,7 @@ export default {
content
:
'产值'
,
content
:
'产值'
,
offsetX
:
-
10
,
offsetX
:
-
10
,
// offsetY: -`${offsetY}`
// offsetY: -`${offsetY}`
offsetY
:
-
156
offsetY
:
-
156
})
})
this
.
lineChart
.
render
()
this
.
lineChart
.
render
()
},
},
...
@@ -316,6 +316,8 @@ export default {
...
@@ -316,6 +316,8 @@ export default {
this
.
lineChartCustomer
.
tooltip
({
this
.
lineChartCustomer
.
tooltip
({
custom
:
true
,
custom
:
true
,
showCrosshairs
:
false
,
showCrosshairs
:
false
,
triggerOn
:
[
'touchstart'
,
'touchmove'
],
triggerOff
:
'touchend'
,
onChange
(
ev
)
{
onChange
(
ev
)
{
const
currentData
=
ev
.
items
[
0
]
const
currentData
=
ev
.
items
[
0
]
let
reg
=
/
(\d{4})
-
(\d{1,2})
-
(\d{1,2})
/
let
reg
=
/
(\d{4})
-
(\d{1,2})
-
(\d{1,2})
/
...
@@ -325,7 +327,7 @@ export default {
...
@@ -325,7 +327,7 @@ export default {
<div class="item flex"><span class="arc" style="color:#FA7C0B;">●</span>新增客户:
${
ev
.
items
[
1
].
value
}
</div>`
<div class="item flex"><span class="arc" style="color:#FA7C0B;">●</span>新增客户:
${
ev
.
items
[
1
].
value
}
</div>`
tooltipEl
.
style
.
opacity
=
1
tooltipEl
.
style
.
opacity
=
1
tooltipEl
.
style
.
left
=
currentData
.
x
-
140
/
2
+
'px'
tooltipEl
.
style
.
left
=
currentData
.
x
-
140
/
2
+
'px'
tooltipEl
.
style
.
top
=
currentData
.
y
-
4
0
-
15
+
'px'
tooltipEl
.
style
.
top
=
currentData
.
y
-
4
5
-
15
+
'px'
},
},
onHide
()
{
onHide
()
{
tooltipEl
.
style
.
opacity
=
0
tooltipEl
.
style
.
opacity
=
0
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment