Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
renewal-interest-data-board
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5f4e3223
authored
Jul 12, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
二轮bug修复
1 parent
f69e7d20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
src/components/ViewTabs.vue
src/components/lineBar.vue
src/components/options.js
src/components/ViewTabs.vue
View file @
5f4e322
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
</span>
</span>
</div>
</div>
<line-bar
:isDatazoom=
'true'
domId=
'viewTrendDomId'
:dataList=
'viewTrendList'
boxHeight=
'190px'
></line-bar>
<line-bar
:isDatazoom=
'true'
domId=
'viewTrendDomId'
:
lineTitle=
'linaBarTitle'
:
dataList=
'viewTrendList'
boxHeight=
'190px'
></line-bar>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -62,6 +62,7 @@ export default {
...
@@ -62,6 +62,7 @@ export default {
dataOverView
:
null
,
dataOverView
:
null
,
viewTrendList
:
null
,
viewTrendList
:
null
,
linaBarTitle
:
''
,
linaBarTitle
:
''
,
tabType
:
''
,
tabTitleList
:
[
tabTitleList
:
[
{
title
:
'访问量'
,
type
:
'views'
},
{
title
:
'访问量'
,
type
:
'views'
},
{
title
:
'转发量'
,
type
:
'forward'
},
{
title
:
'转发量'
,
type
:
'forward'
},
...
...
src/components/lineBar.vue
View file @
5f4e322
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
-->
-->
<
template
>
<
template
>
<div
class=
'line-box'
>
<div
class=
'line-box'
>
<div
:id=
'domId'
class=
'line-chart'
:style=
'
{ height: boxHeight }'>
</div>
<div
:id=
'domId'
class=
'line-chart'
:
lineTitle=
'lineTitle'
:
style=
'
{ height: boxHeight }'>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
...
@@ -23,6 +23,10 @@ export default {
...
@@ -23,6 +23,10 @@ export default {
type
:
String
,
type
:
String
,
default
:
'line-chart'
default
:
'line-chart'
},
},
lineTitle
:
{
type
:
String
,
default
:
''
},
isDatazoom
:
{
isDatazoom
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
...
@@ -94,7 +98,7 @@ export default {
...
@@ -94,7 +98,7 @@ export default {
watch
:
{
watch
:
{
dataList
:
{
dataList
:
{
handler
()
{
handler
()
{
this
.
lineOptions
=
this
.
isDatazoom
?
lineAndBarZoomOptions
(
this
.
dataList
,
this
.
displayName
)
:
lineAndBarOptions
(
this
.
dataList
,
this
.
displayNam
e
)
this
.
lineOptions
=
this
.
isDatazoom
?
lineAndBarZoomOptions
(
this
.
dataList
,
this
.
displayName
,
this
.
lineTitle
)
:
lineAndBarOptions
(
this
.
dataList
,
this
.
displayName
,
this
.
lineTitl
e
)
this
.
chartBindEvent
()
this
.
chartBindEvent
()
},
},
deep
:
true
deep
:
true
...
@@ -112,12 +116,16 @@ export default {
...
@@ -112,12 +116,16 @@ export default {
this
[
this
.
domId
].
on
(
'click'
,
(
params
)
=>
{
this
[
this
.
domId
].
on
(
'click'
,
(
params
)
=>
{
const
month
=
params
.
name
const
month
=
params
.
name
const
type
=
this
.
domId
const
type
=
this
.
domId
if
(
this
.
domId
===
'glLineBar'
)
(
if
(
this
.
domId
===
'glLineBar'
)
{
this
.
$bus
.
$emit
(
'updataGLRank'
,
{
month
,
type
})
(
)
this
.
$bus
.
$emit
(
'updataGLRank'
,
{
month
,
type
})
if
(
this
.
domId
===
'ghLineBar'
)
(
)
this
.
$bus
.
$emit
(
'updataGHRank'
,
{
month
,
type
})
}
)
if
(
this
.
domId
===
'ghLineBar'
)
{
(
this
.
$bus
.
$emit
(
'updataGHRank'
,
{
month
,
type
})
)
}
})
})
// )
// )
}
}
...
...
src/components/options.js
View file @
5f4e322
...
@@ -483,8 +483,7 @@ function getLineDoubleOptions(obj) {
...
@@ -483,8 +483,7 @@ function getLineDoubleOptions(obj) {
return
options
return
options
}
}
function
lineAndBarZoomOptions
(
list
,
namelist
,
lineTitle
)
{
function
lineAndBarZoomOptions
(
list
,
namelist
)
{
const
statDate
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
xName
])
:
list
.
map
(
item
=>
item
.
statDate
)
const
statDate
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
xName
])
:
list
.
map
(
item
=>
item
.
statDate
)
const
orderNum
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
leftYName
])
:
list
.
map
(
item
=>
item
.
viewsincr
)
const
orderNum
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
leftYName
])
:
list
.
map
(
item
=>
item
.
viewsincr
)
const
orderMoney
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
rightYName
])
:
list
.
map
(
item
=>
item
.
viewstotal
)
const
orderMoney
=
namelist
?
list
.
map
(
item
=>
item
[
namelist
.
rightYName
])
:
list
.
map
(
item
=>
item
.
viewstotal
)
...
@@ -509,7 +508,7 @@ function lineAndBarZoomOptions(list, namelist) {
...
@@ -509,7 +508,7 @@ function lineAndBarZoomOptions(list, namelist) {
},
},
formatter
:
function
(
item
)
{
formatter
:
function
(
item
)
{
const
items
=
list
[
item
[
0
].
dataIndex
]
const
items
=
list
[
item
[
0
].
dataIndex
]
return
`
${
items
.
statDate
}
<br>总
访问量
:
${
items
.
viewstotal
}
<br>当日新增:
${
items
.
viewsincr
}
`
return
`
${
items
.
statDate
}
<br>总
${
lineTitle
}
:
${
items
.
viewstotal
}
<br>当日新增:
${
items
.
viewsincr
}
`
}
}
},
},
xAxis
:
[
xAxis
:
[
...
...
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