Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
data-view
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 cbdb395c
authored
Jun 30, 2022
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'dev_v1.0.0' of
http://192.168.3.233:8090/gh/data-view
into dev_v1.0.0
2 parents
5799be72
936a753c
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
153 additions
and
43 deletions
src/api/modules/overview.js
src/components/LineChart.vue
src/components/Marquee.vue
src/components/ViewControl.vue
src/components/ViewTabs.vue
src/mixins/changeMixin.js
src/mixins/clientMixin.js
src/mixins/salesMixin.js
src/views/afterSales/analyze.vue
src/views/afterSales/mileage.vue
src/api/modules/overview.js
View file @
cbdb395
...
...
@@ -10,5 +10,13 @@ export default {
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend
(
req
)
{
return
request
.
get
(
'brand/overalltrend'
,
{
req
})
}
},
/* 获取门店总体相关信息 */
getMerchantOverallbase
(
req
)
{
return
request
.
get
(
'merchant/overallbase'
,
{
req
})
},
/*获取门店---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getMerchantOveralltrend
(
req
)
{
return
request
.
get
(
'merchant/overalltrend'
,
{
req
})
},
}
src/components/LineChart.vue
View file @
cbdb395
...
...
@@ -124,25 +124,21 @@ export default {
// 鼠标划入
this
[
this
.
domId
].
on
(
'mouseover'
,
data
=>
{
this
.
moveAttr
.
series
Index
=
data
.
dataIndex
this
.
getRankList
(
this
.
moveAttr
.
series
Index
,
this
.
rankFlag
+
'List'
)
this
.
moveAttr
.
data
Index
=
data
.
dataIndex
this
.
getRankList
(
this
.
moveAttr
.
data
Index
,
this
.
rankFlag
+
'List'
)
})
// 鼠标划出
this
[
this
.
domId
].
on
(
'mouseout'
,
()
=>
{
console
.
log
(
'0000000000'
)
setTimeout
(()
=>
{
// 移除图表
this
[
this
.
domId
].
on
(
'globalout'
,
()
=>
{
this
.
chartAction
()
},
1000
)
})
},
chartAction
(
type
)
{
console
.
log
(
this
.
moveAttr
,
'???/cwq'
)
this
[
this
.
domId
].
dispatchAction
({
type
:
type
||
'showTip'
,
seriesIndex
:
this
.
moveAttr
.
seriesIndex
,
dataIndex
:
this
.
moveAttr
.
dataIndex
seriesIndex
:
+
this
.
moveAttr
.
seriesIndex
,
dataIndex
:
+
this
.
moveAttr
.
dataIndex
})
},
...
...
@@ -169,7 +165,7 @@ export default {
handleRankChange
(
value
)
{
this
.
rankFlag
=
value
this
.
getRankList
(
this
.
moveAttr
.
series
Index
,
this
.
rankFlag
+
'List'
)
this
.
getRankList
(
this
.
moveAttr
.
data
Index
,
this
.
rankFlag
+
'List'
)
}
}
}
...
...
src/components/Marquee.vue
View file @
cbdb395
...
...
@@ -37,6 +37,7 @@ export default {
mounted
()
{
setTimeout
(()
=>
{
let
{
marqueeBox
,
marqueeText
}
=
this
.
$refs
if
(
!
marqueeBox
)
return
let
boxWidth
=
marqueeBox
.
offsetWidth
,
valueWidth
=
marqueeText
.
offsetWidth
this
.
valueWidth
=
valueWidth
...
...
src/components/ViewControl.vue
View file @
cbdb395
...
...
@@ -96,6 +96,7 @@ export default {
if
(
tabIndex
==
1
)
brands
.
map
(
e
=>
{
if
(
e
.
active
)
params
.
brandName
=
e
.
brandName
})
console
.
log
(
params
)
this
.
$store
.
state
.
app
.
reportParams
=
params
},
chooseBrand
({
i
,
index
})
{
...
...
src/components/ViewTabs.vue
View file @
cbdb395
...
...
@@ -57,7 +57,7 @@
<div
class=
"tabs-content-chart flex"
>
<div
class=
"line"
id=
"total-chart
"
ref=
"canvas
"
></div>
<div
class=
"table user-select pointer"
>
<div
class=
"table-head"
>
...
...
@@ -134,40 +134,43 @@ export default {
wechatGroup
:
{},
applet
:
{},
publiccus
:
{}
}
},
canvas
:
null
,
req
:
{}
}
},
mounted
()
{
},
methods
:
{
init
(
params
)
{
console
.
log
(
params
)
this
.
getBrandOverallbase
(
'total'
)
this
.
getBrandOverallbase
(
'wechat'
)
this
.
getBrandOverallbase
(
'wechatGroup'
)
this
.
getBrandOverallbase
(
'applet'
)
this
.
getBrandOverallbase
(
'publiccus'
)
this
.
getBrandOveralltrend
(
'total'
)
params
.
queryType
=
params
.
reportType
||
0
delete
params
.
reportType
this
.
req
=
params
this
.
getOverallbase
(
'total'
)
this
.
getOverallbase
(
'wechat'
)
this
.
getOverallbase
(
'wechatGroup'
)
this
.
getOverallbase
(
'applet'
)
this
.
getOverallbase
(
'publiccus'
)
this
.
getOveralltrend
(
'total'
)
},
changeType
(
type
)
{
console
.
log
(
type
)
this
.
tabType
=
type
this
.
get
Brand
Overalltrend
(
type
)
this
.
getOveralltrend
(
type
)
},
changeTab
(
index
)
{
this
.
tabIndex
=
index
},
getBrandOverallbase
(
queryItem
)
{
getOverallbase
(
queryItem
)
{
let
{
req
:
{
queryType
},
req
}
=
this
const
params
=
{
queryItem
,
queryTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
...
req
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(({
code
,
data
})
=>
{
this
.
api
.
overview
[
queryType
==
0
?
'getBrandOverallbase'
:
'getMerchantOverallbase'
]
(
params
).
then
(({
code
,
data
})
=>
{
if
(
code
==
0
)
{
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
data
)
let
[
dataList
]
=
data
.
dataList
dataList
.
top
=
this
.
ObjectToArray
(
dataList
.
topList
)
dataList
.
last
=
this
.
ObjectToArray
(
dataList
.
lastList
)
...
...
@@ -181,16 +184,113 @@ export default {
Object
.
keys
(
obj
).
map
(
name
=>
arr
.
push
({
name
,
num
:
obj
[
name
]
}))
return
arr
},
getBrandOveralltrend
(
queryItem
)
{
getOveralltrend
(
queryItem
)
{
let
{
req
:
{
queryType
},
req
}
=
this
const
params
=
{
queryItem
,
querystartTime
:
'2022-05-23'
,
queryendTime
:
'2022-06-23'
,
querystartTime
:
queryType
==
1
?
this
.
getNDate
(
-
30
)
:
this
.
getNMonth
(
-
12
)
,
queryendTime
:
queryType
==
1
?
this
.
getNDate
(
-
1
)
:
this
.
getNMonth
(
-
1
)
,
corporateGroupName
:
'集团1'
,
queryType
:
0
...
req
}
this
.
api
.
overview
[
queryType
==
0
?
'getBrandOveralltrend'
:
'getMerchantOveralltrend'
](
params
).
then
(({
data
,
code
})
=>
{
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
data
)
if
(
code
==
0
)
{
this
.
canvas
=
echarts
.
init
(
this
.
$refs
.
canvas
)
this
.
draw
(
data
.
dataList
,
queryType
)
}
})
},
draw
(
lineData
,
queryType
)
{
let
data
=
[],
xData
=
[],
title
=
{
'total'
:
'客户数'
,
'wechat'
:
'企微客户数'
,
'wechatGroup'
:
'企微群数'
,
'applet'
:
'小程序客户数'
,
'publiccus'
:
'公众号客户数'
},
{
tabType
}
=
this
lineData
.
map
(
e
=>
{
let
month
=
new
Date
(
e
.
statDate
).
getMonth
()
xData
.
push
(
queryType
==
0
?
`
${
month
==
0
?
'1月'
:
`
${
Number
(
month
)
+
1
}
月`
}
`
:
e
.
statDate
)
data
.
push
(
e
.
totalNum
)
})
let
options
=
{
tooltip
:
{
trigger
:
'axis'
,
borderWidth
:
0
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
textStyle
:
{
color
:
'#FFFFFF'
,
fontSize
:
'8px'
},
formatter
:
([
value
])
=>
{
return
`
${
title
[
tabType
]}
:
${
value
.
data
}
`
// `${value.name}${title[tabType]}:${value.data}`
}
},
xAxis
:
{
type
:
'category'
,
axisLabel
:
{
color
:
'#606266'
,
fontSize
:
'0.8em'
},
data
:
xData
},
grid
:
{
left
:
'3%'
,
right
:
'4%'
,
top
:
'10%'
,
bottom
:
'1.2vh'
,
containLabel
:
true
},
yAxis
:
{
type
:
'value'
,
splitLine
:
{
lineStyle
:
{
color
:
'#606266'
}
}
},
series
:
[
{
type
:
'line'
,
itemStyle
:
{
color
:
'#F5AA01'
},
// 节点,平滑曲线
symbol
:
'none'
,
smooth
:
true
,
// 折线背景色
areaStyle
:
{
color
:
{
type
:
'linear'
,
x
:
0
,
y
:
0
,
x2
:
0
,
y2
:
1
,
colorStops
:
[
{
offset
:
0
,
color
:
'rgba(254, 84, 0, 0.6)'
},
{
offset
:
1
,
color
:
'rgba(254, 84, 0, 0.05)'
}
]
}
},
data
}
]
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
res
)
this
.
canvas
.
setOption
(
options
)
window
.
addEventListener
(
'resize'
,
()
=>
{
this
.
canvas
.
resize
()
})
}
}
...
...
@@ -285,7 +385,6 @@ export default {
gap
:
0
8px
;
.line
{
flex
:
7
;
background
:
#022
;
}
.table
{
flex
:
3
;
...
...
src/mixins/changeMixin.js
View file @
cbdb395
export
default
{
data
()
{
return
{
corporateGroupName
:
'集团1'
}
},
watch
:
{
watchReportParams
:
{
immediate
:
true
,
...
...
src/mixins/clientMixin.js
View file @
cbdb395
...
...
@@ -18,7 +18,7 @@ export default {
let
clientApi
=
!
this
.
isBrand
?
'overalldistribution'
:
'merchantOveralldistribution'
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
this
.
corporateGroupName
,
queryItem
:
this
.
type
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
...
...
src/mixins/salesMixin.js
View file @
cbdb395
...
...
@@ -18,7 +18,7 @@ export default {
let
salesApi
=
!
this
.
isBrand
?
'getSales'
:
'getMerchantSales'
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
this
.
corporateGroupName
,
queryItem
:
this
.
type
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
...
...
src/views/afterSales/analyze.vue
View file @
cbdb395
...
...
@@ -134,7 +134,7 @@ export default {
let
analyzeApi
=
!
this
.
isBrand
?
'aftersaleother'
:
'afterMerchantSaleother'
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
this
.
corporateGroupName
,
queryItem
:
'valueanalyse'
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
...
...
src/views/afterSales/mileage.vue
View file @
cbdb395
...
...
@@ -17,7 +17,7 @@
<div>
客户数
</div>
</div>
<div
class=
"ranking"
>
<div
class=
"brand flex"
v-for=
"(item, index) in rankingData.slice(0,5)"
:key=
"index"
>
<div
class=
"brand flex"
v-for=
"(item, index) in rankingData.slice(0,
5)"
:key=
"index"
>
<span
class=
"brand-num"
>
{{
index
+
1
}}
</span>
<marquee
class=
"marquee"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.brand"
/>
<span>
{{
item
.
value
}}
</span>
...
...
@@ -62,7 +62,7 @@ export default {
let
mileageApi
=
!
this
.
isBrand
?
'aftersaleother'
:
'afterMerchantSaleother'
const
params
=
{
req
:
{
corporateGroupName
:
'集团1'
,
corporateGroupName
:
this
.
corporateGroupName
,
queryItem
:
'mileage'
,
// queryTime: this.getCurrentDate,
queryTime
:
'2022-06-23'
,
...
...
@@ -108,8 +108,8 @@ export default {
}
</
script
>
<
style
lang=
"scss"
scoped
>
.title
{
padding
:
1vh
0.556vw
;
.title
{
padding
:
1vh
0.556vw
;
}
.ranking-container
{
flex
:
1
;
...
...
@@ -127,7 +127,7 @@ export default {
background
:
rgba
(
53
,
53
,
53
,
0.6
);
display
:
flex
;
align-items
:
center
;
div{
div
{
white-space
:
nowrap
;
}
.ranking-title-brand
{
...
...
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