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 14b0c506
authored
Oct 25, 2022
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
d4573a48
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
314 additions
and
52 deletions
src/components/LineChart.vue
src/components/ViewContentLeft.vue
src/components/ViewSurface.vue
src/components/barChart.vue
src/components/barOptions.js
src/utils/data.js
src/views/user/analyse.vue
src/views/user/area.vue
src/views/user/brand.vue
src/components/LineChart.vue
View file @
14b0c50
<
template
>
<div
class=
"line-box"
>
<div
:id=
"domId"
class=
"line-chart"
></div>
<div
class=
"rank-box"
>
<div
class=
"rank-title-block"
>
<p
:class=
"['rank-title', rankFlag == 'top' ? 'rank-title-active' : '']"
@
click=
"handleRankChange('top')"
>
前5
{{
storeOrBrandTxt
}}
</p>
<p
:class=
"['rank-title', rankFlag == 'last' ? 'rank-title-active' : '']"
@
click=
"handleRankChange('last')"
>
后5
{{
storeOrBrandTxt
}}
</p>
</div>
<div
class=
"rank-block"
>
<div
class=
"rank-line"
v-for=
"(item, index) in rankList"
:key=
"index"
>
<div
class=
"line-item"
>
<marquee
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.label"
></marquee>
</div>
<div
class=
"line-item"
>
<marquee
class=
"txt-orange"
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"item.value"
></marquee>
</div>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
...
...
@@ -167,7 +150,7 @@ export default {
this
.
lineOptions
.
yAxis
.
scale
=
true
}
else
{
this
.
lineOptions
.
yAxis
.
max
=
Math
.
ceil
(
Math
.
max
(...
seriesDate
)
/
10
)
*
10
this
.
lineOptions
.
yAxis
.
min
=
Math
.
floor
(
Math
.
min
(...
seriesDate
)
*
0.9
/
10
)
*
10
this
.
lineOptions
.
yAxis
.
min
=
Math
.
floor
(
(
Math
.
min
(...
seriesDate
)
*
0.9
)
/
10
)
*
10
}
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
// 默认展示tooltip
...
...
src/components/ViewContentLeft.vue
View file @
14b0c50
...
...
@@ -23,7 +23,6 @@ import Area from '../views/customer/area'
import
Store
from
'../views/customer/store'
import
Brand
from
'../views/customer/brand'
import
OverSize
from
'../views/saas/overview.vue'
export
default
{
name
:
'ViewContentLeft'
,
components
:
{
...
...
src/components/ViewSurface.vue
View file @
14b0c50
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 11:17:49
* @FilePath: \dj-data-view\src\components\ViewSurface.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"surface box"
>
</div>
<div
class=
"surface box"
></div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
...
...
@@ -20,7 +26,7 @@ export default {
<
style
scoped
lang=
"scss"
>
.surface
{
height
:
21.46vh
;
margin-bottom
:
0.98vh
;
height
:
21.46vh
;
margin-bottom
:
0.98vh
;
}
</
style
>
src/components/barChart.vue
0 → 100644
View file @
14b0c50
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:05:23
* @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"line-box"
>
<div
:id=
"domId"
class=
"line-chart"
:style=
"
{ height: boxHeight }">
</div>
</div>
</
template
>
<
script
>
import
datas
from
'@/utils/data'
import
*
as
echarts
from
'echarts'
import
{
getBarOptions
,
getBarReverseOptions
}
from
'./barOptions'
export
default
{
name
:
'barChart'
,
props
:
{
domId
:
{
type
:
String
,
default
:
'line-chart'
},
revese
:
{
type
:
Boolean
,
default
:
false
},
boxHeight
:
{
type
:
String
,
default
:
'12.83vh'
},
storeOrBrandTxt
:
{
type
:
String
,
default
:
'品牌'
},
dataList
:
{
type
:
Array
,
default
:
()
=>
[]
},
// 0-月表;1-日表
queryType
:
{
type
:
Number
,
default
:
0
},
tooltipFormatterObj
:
{
type
:
Array
,
default
:
()
=>
{
return
[
{
label
:
'数量'
,
attrName
:
'num'
},
{
label
:
'环比'
,
attrName
:
'hrate'
,
addSymbol
:
'%'
},
{
label
:
'同比'
,
attrName
:
'trate'
,
addSymbol
:
'%'
}
]
}
}
},
data
()
{
return
{
directionTimer
:
datas
.
DefaultData
.
directionTimer
,
delayTimer
:
datas
.
DefaultData
.
delayTimer
,
rankFlag
:
'top'
,
lineOptions
:
[],
rankList
:
[],
echartsLine
:
''
,
moveAttr
:
{
// speed: 900,
seriesIndex
:
0
,
dataIndex
:
0
},
timer
:
null
}
},
created
()
{
this
.
lineOptions
=
this
.
revese
?
getBarReverseOptions
()
:
getBarOptions
()
},
mounted
()
{
this
.
lineDom
=
document
.
getElementById
(
this
.
domId
)
this
[
this
.
domId
]
=
echarts
.
init
(
this
.
lineDom
)
this
.
chartBindEvent
()
},
methods
:
{
chartBindEvent
()
{
this
[
this
.
domId
].
setOption
(
this
.
lineOptions
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.line-box
{
height
:
100%
;
color
:
#ffffff
;
.txt-orange
{
color
:
#eb6001
;
}
.line-chart
{
width
:
100%
;
}
}
</
style
>
src/components/barOptions.js
0 → 100644
View file @
14b0c50
/*
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:14:13
* @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
function
getBarOptions
(
obj
)
{
var
options
=
{
xAxis
:
{
type
:
'category'
,
axisLabel
:
{
color
:
'#606266'
,
fontSize
:
'0.8em'
,
rotate
:
30
},
splitLine
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
axisLine
:
{
show
:
false
},
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
,
'Fri'
,
'Sat'
,
'Sun'
]
},
grid
:
{
left
:
'3%'
,
right
:
'6%'
,
top
:
'6%'
,
bottom
:
'0%'
,
containLabel
:
true
},
yAxis
:
{
nameGap
:
30
,
type
:
'value'
,
splitLine
:
{
show
:
false
},
axisLabel
:
{
show
:
false
},
splitLine
:
{
lineStyle
:
{
color
:
'#2F314F'
}
},
splitNumber
:
4
},
series
:
[
{
type
:
'bar'
,
symbol
:
'circle'
,
backgroundStyle
:
{
color
:
'#6578FF'
},
barWidth
:
'30%'
,
data
:
[
120
,
200
,
150
,
80
,
70
,
110
,
130
]
}
]
}
return
options
}
function
getBarReverseOptions
(
obj
)
{
var
options
=
{
tooltip
:
{
trigger
:
'axis'
,
showContent
:
false
,
axisPointer
:
{
type
:
'shadow'
,
shadowStyle
:
{
color
:
'rgba(210, 210, 210, 0.2)'
}
},
borderWidth
:
0
,
backgroundColor
:
'rgba(68,68,68,0.80)'
,
confine
:
true
,
textStyle
:
{
color
:
'#ffffff'
,
fontSize
:
8
}
},
yAxis
:
{
type
:
'category'
,
axisLabel
:
{
color
:
'#ccc'
,
fontSize
:
'0.8em'
},
splitLine
:
{
show
:
false
},
axisTick
:
{
show
:
false
},
axisLine
:
{
show
:
false
},
data
:
[
'一般发展'
,
'一般价值'
,
'一般挽留'
,
'重要挽留'
,
'重要价值'
,
'重要发展'
,
'重要保持'
,
'一般保持'
]
},
grid
:
{
left
:
'15%'
,
right
:
'0%'
,
top
:
'0%'
,
bottom
:
'0%'
,
containLabel
:
true
},
xAxis
:
{
nameGap
:
30
,
type
:
'value'
,
splitLine
:
{
show
:
false
},
axisLabel
:
{
show
:
false
},
splitNumber
:
4
},
series
:
[
{
type
:
'bar'
,
symbol
:
'circle'
,
backgroundStyle
:
{
color
:
'#6578FF'
},
data
:
[
30
,
120
,
200
,
150
,
80
,
70
,
110
,
130
]
}
]
}
return
options
}
export
{
getBarReverseOptions
,
getBarOptions
}
src/utils/data.js
View file @
14b0c50
...
...
@@ -2,8 +2,8 @@
* @Description: 公共数据
* @Author: huyue
* @Date: 2022-06-23 17:38:33
* @LastEditors:
huyue
* @LastEditTime: 2022-
06-29 19:47:34
* @LastEditors:
前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-
10-25 10:38:15
*/
const
DefaultData
=
{
defaultLineHeight
:
'17.32'
,
...
...
src/views/user/analyse.vue
View file @
14b0c50
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 15:16:19
* @FilePath: \dj-data-view\src\views\user\analyse.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"analyse"
>
<div
class=
"title title-icon"
>
<span
class=
"icon"
></span>
<
span>
门店类型
</span
>
<
div
class=
"title-h3"
>
客户价值分析
</div
>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<bar-chart
domId=
"analyseChart"
:revese=
"true"
boxHeight=
"14.54vh"
></bar-chart>
</div>
</div>
</
template
>
...
...
@@ -15,14 +22,26 @@
export
default
{
name
:
'Analyse'
,
data
()
{
return
{
}
return
{}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.analyse
{
width
:
18.06vw
;
.analyse
{
width
:
18.06vw
;
.container
{
margin-top
:
-1vh
;
}
.icon
{
display
:
inline-block
;
transform
:
rotate
(
90deg
);
}
.title
{
display
:
block
;
}
.title-h3
{
width
:
10px
;
margin
:
10px
4px
;
}
}
</
style
>
\ No newline at end of file
</
style
>
src/views/user/area.vue
View file @
14b0c50
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 13:49:20
* @FilePath: \dj-data-view\src\views\user\area.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"area"
>
<div
class=
"title title-icon"
>
...
...
@@ -6,23 +13,22 @@
<span>
区域分布
</span>
</div>
<div
class=
"container"
>
<bar-chart
domId=
"areaChart"
></bar-chart>
</div>
</div>
</
template
>
<
script
>
import
'../../components'
export
default
{
name
:
'Area'
,
data
()
{
return
{
}
return
{}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.a
nalyse
{
width
:
15.42vw
;
.a
rea
{
width
:
15.42vw
;
}
</
style
>
\ No newline at end of file
</
style
>
src/views/user/brand.vue
View file @
14b0c50
<!--
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-25 13:43:57
* @FilePath: \dj-data-view\src\views\user\brand.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<
template
>
<div
class=
"brand"
>
<div
class=
"title title-icon"
>
...
...
@@ -6,22 +13,21 @@
<span>
品牌分布
</span>
</div>
<div
class=
"container"
>
<bar-chart
domId=
"brandChart"
></bar-chart>
</div>
</div>
</
template
>
<
script
>
import
'../../components'
export
default
{
name
:
'Brand'
,
data
()
{
return
{
}
return
{}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.brand
{
width
:
15.42vw
;
.brand
{
width
:
15.42vw
;
}
</
style
>
\ No newline at end of file
</
style
>
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