Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
gh
/
dj-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 72ab07ba
authored
Oct 27, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed
1 parent
8aaf526d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
39 deletions
src/api/modules/user.js
src/components/LineChart.vue
src/components/ViewChart.vue
src/components/options.js
src/utils/util.js
src/views/saas/businessView.vue
src/views/saas/project.vue
vue.config.js
src/api/modules/user.js
View file @
72ab07b
...
...
@@ -2,8 +2,8 @@
* @Description: 售后数据
* @Author: huyue
* @Date: 2022-06-28 16:55:48
* @LastEditors:
huyue
* @LastEditTime: 2022-
06-28 19:13:34
* @LastEditors:
前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-
10-27 13:55:36
*/
// 私域用户池总览数据
const
getoverview
=
params
=>
{
...
...
@@ -14,6 +14,10 @@ const getoverview = params => {
const
getDistribution
=
params
=>
{
return
window
.
$HTTP
.
get
(
'privateDomainUserPool/getDistribution'
,
params
)
}
// 用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const
getTrend
=
params
=>
{
return
window
.
$HTTP
.
get
(
'privateDomainUserPool/getTrend'
,
params
)
}
// // 获取品牌售后其他信息
// const aftersaleother = params => {
...
...
@@ -25,4 +29,4 @@ const getDistribution = params => {
// return window.$HTTP.get('merchant/aftersaleother', params)
// }
export
default
{
getoverview
,
getDistribution
}
export
default
{
getoverview
,
getDistribution
,
getTrend
}
src/components/LineChart.vue
View file @
72ab07b
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
6 10:26:09
* @LastEditTime: 2022-10-2
7 14:32:16
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -34,9 +34,9 @@ export default {
type
:
String
,
default
:
'品牌'
},
data
List
:
{
type
:
Array
,
default
:
()
=>
[]
private
List
:
{
type
:
Object
,
default
:
()
=>
{}
},
// 0-月表;1-日表
queryType
:
{
...
...
@@ -81,13 +81,18 @@ export default {
timer
:
null
}
},
created
()
{
this
.
lineOptions
=
getLineOptions
()
watch
:
{
privateList
:
{
handler
()
{
this
.
lineOptions
=
getLineOptions
(
this
.
privateList
)
this
.
chartBindEvent
()
},
deep
:
true
}
},
mounted
()
{
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
this
.
chartBindEvent
()
},
methods
:
{
chartBindEvent
()
{
...
...
src/components/ViewChart.vue
View file @
72ab07b
...
...
@@ -2,14 +2,14 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-26 10:22:41
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-2
6 10:28:12
* @LastEditTime: 2022-10-2
7 14:30:38
* @FilePath: \dj-data-view\src\components\ViewChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"view-chart flex"
>
<div
class=
"line-chart"
>
<line-chart
domId=
"sumChart"
boxHeight=
"17.54vh"
></line-chart>
<line-chart
domId=
"sumChart"
boxHeight=
"17.54vh"
:privateList=
"privateList"
></line-chart>
</div>
<div
class=
"pie-chart"
>
<Age></Age>
...
...
@@ -36,9 +36,15 @@ export default {
Mileage
},
data
()
{
return
{}
return
{
privateList
:
[]
}
},
mounted
()
{
this
.
$bus
.
$on
(
'drawPrivateChart'
,
data
=>
{
this
.
privateList
=
data
})
},
mounted
()
{},
methods
:
{}
}
</
script
>
...
...
src/components/options.js
View file @
72ab07b
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 1
1:26:55
* @LastEditTime: 2022-10-27 1
4:31:44
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -145,7 +145,10 @@ function getBarReverseOptions(obj) {
}
return
options
}
function
getLineOptions
()
{
function
getLineOptions
(
obj
)
{
const
{
dataList
,
name
}
=
obj
const
statDate
=
dataList
.
map
(
item
=>
item
.
statDate
)
const
num
=
dataList
.
map
(
item
=>
item
.
num
)
var
options
=
{
tooltip
:
{
trigger
:
'axis'
,
...
...
@@ -163,7 +166,7 @@ function getLineOptions() {
fontSize
:
14
},
formatter
:
function
(
item
)
{
return
`
用户数
:
${
item
[
0
].
value
}
`
return
`
${
name
}
:
${
item
[
0
].
value
}
`
}
},
xAxis
:
{
...
...
@@ -181,13 +184,13 @@ function getLineOptions() {
axisLine
:
{
show
:
false
},
data
:
[
'1月'
,
'2月'
,
'3月'
,
'4月'
,
'5月'
,
'6月'
,
'7月'
,
'8月'
,
'9月'
,
'10月'
,
'11月'
,
'12月'
]
data
:
statDate
},
grid
:
{
left
:
'
3
%'
,
left
:
'
6
%'
,
right
:
'6%'
,
top
:
'14%'
,
bottom
:
'
3
%'
,
bottom
:
'
1
%'
,
containLabel
:
true
},
yAxis
:
{
...
...
@@ -234,14 +237,13 @@ function getLineOptions() {
]
}
},
data
:
[
666
,
200
,
150
,
80
,
70
,
110
,
130
,
554
,
3
,
44
,
33
,
5
,
666
]
data
:
num
}
]
}
return
options
}
function
lineAndBarOptions
(
list
)
{
console
.
log
(
list
)
const
statDate
=
list
.
map
(
item
=>
item
.
statDate
)
const
totalNum
=
list
.
map
(
item
=>
item
.
totalNum
)
const
increNum
=
list
.
map
(
item
=>
item
.
increNum
)
...
...
src/utils/util.js
View file @
72ab07b
...
...
@@ -45,7 +45,6 @@ const decimal = (num, fixed) => {
return
Math
.
round
(
num
*
pow
)
/
pow
}
const
toTop
=
()
=>
{
let
bodySrcollTop
=
document
.
body
.
scrollTop
if
(
bodySrcollTop
!==
0
)
{
...
...
@@ -110,7 +109,7 @@ const debounce = function (func, wait = 200) {
const
setChartFontSize
=
fontSize
=>
{
let
clientWidth
=
window
.
innerWidth
||
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
if
(
!
clientWidth
)
return
fontSize
return
fontSize
*
clientWidth
/
1440
return
(
fontSize
*
clientWidth
)
/
1440
}
const
utils
=
{
getParams
,
...
...
src/views/saas/businessView.vue
View file @
72ab07b
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 1
1:21:13
* @LastEditTime: 2022-10-27 1
3:33:57
* @FilePath: \dj-data-view\src\views\saas\business.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -19,7 +19,7 @@
</div>
<div
class=
"business-border"
>
<div
class=
"business-title"
>
客单价
</div>
<div
class=
"business-number"
>
{{
businessNum
.
atv
}}
</div>
<div
class=
"business-number"
>
{{
toFixNum
(
businessNum
.
atv
)
}}
</div>
</div>
</div>
<div
class=
"business-bottom flex"
>
...
...
@@ -46,6 +46,11 @@ export default {
type
:
Object
,
default
:
{}
}
},
methods
:
{
toFixNum
(
val
)
{
return
this
.
numAddSymbol
(
val
.
toFixed
(
2
))
}
}
}
</
script
>
...
...
src/views/saas/project.vue
View file @
72ab07b
...
...
@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 1
1:09:06
* @LastEditTime: 2022-10-27 1
3:38:57
* @FilePath: \dj-data-view\src\views\saas\project.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
...
...
@@ -24,11 +24,11 @@
</div>
<div
class=
"project-content-item"
>
<div
class=
"project-content-desc"
>
转化率
</div>
<div
class=
"project-content-num"
>
{{
toFix
Num
(
item
.
conversionrate
)
}}
</div>
<div
class=
"project-content-num"
>
{{
toFix
Ratio
(
item
.
conversionrate
)
}}
</div>
</div>
<div
class=
"project-content-item"
>
<div
class=
"project-content-desc"
>
客单价
</div>
<div
class=
"project-content-num"
>
{{
numAddSymbol
(
item
.
atv
)
}}
</div>
<div
class=
"project-content-num"
>
{{
toFixNum
(
item
.
atv
)
}}
</div>
</div>
<div
class=
"project-content-item"
>
<div
class=
"project-content-desc"
>
产值
</div>
...
...
@@ -53,9 +53,12 @@ export default {
this
.
getBusinessType
()
},
methods
:
{
toFix
Num
(
val
)
{
toFix
Ratio
(
val
)
{
return
(
val
*
100
).
toFixed
(
2
)
+
'%'
},
toFixNum
(
val
)
{
return
this
.
numAddSymbol
(
val
.
toFixed
(
2
))
},
getBusinessType
()
{
this
.
api
.
sass
.
getBusinessType
().
then
(
res
=>
{
if
(
res
.
code
==
0
)
{
...
...
@@ -100,19 +103,19 @@ export default {
flex
:
1
;
.project-content-item
{
&:first-child
{
width
:
2
8
%
;
width
:
2
7
%
;
}
&
:nth-child
(
2
)
{
width
:
1
4
%
;
width
:
1
5
%
;
}
&
:nth-child
(
3
)
{
width
:
1
4
%
;
width
:
1
5
%
;
}
&
:nth-child
(
4
)
{
width
:
22
%
;
width
:
15
%
;
}
&
:nth-child
(
5
)
{
width
:
2
2
%
;
width
:
2
8
%
;
}
padding-left
:
0
.5vw
;
.project-content-desc
{
...
...
vue.config.js
View file @
72ab07b
...
...
@@ -35,8 +35,7 @@ module.exports = {
pathRewrite
:
{
'^/dev'
:
''
},
onProxyReq
:
(
proxyReq
,
req
,
res
)
=>
{
}
onProxyReq
:
(
proxyReq
,
req
,
res
)
=>
{}
},
'/test'
:
{
target
:
'http://192.168.3.126:8081'
,
...
...
@@ -45,8 +44,7 @@ module.exports = {
pathRewrite
:
{
'^/test'
:
''
},
onProxyReq
:
(
proxyReq
,
req
,
res
)
=>
{
}
onProxyReq
:
(
proxyReq
,
req
,
res
)
=>
{}
}
}
},
...
...
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