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 e47ee55c
authored
Jun 30, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
c2532d2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
45 deletions
src/api/modules/common.js
src/api/modules/overview.js
src/api/request.js
src/components/ViewTabs.vue
src/api/modules/common.js
View file @
e47ee55
...
...
@@ -10,8 +10,7 @@ export default {
getBrandList
()
{
return
request
.
get
(
'brand/getBrandName'
,
{
req
:
{
corporateGroupName
:
'集团1'
,
queryTime
:
'2022-06-23'
queryTime
:
window
.
vm
.
getCurrentDate
()
}
})
}
...
...
src/api/modules/overview.js
View file @
e47ee55
...
...
@@ -4,7 +4,11 @@ var request = new Request()
// window.$HTTP
export
default
{
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase
(
params
){
return
request
.
get
(
'brand/overallbase'
,
params
)
getBrandOverallbase
(
req
)
{
return
request
.
get
(
'brand/overallbase'
,
{
req
})
},
/*获取品牌---总体模块趋势图指标(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus) */
getBrandOveralltrend
(
req
)
{
return
request
.
get
(
'brand/overalltrend'
,
{
req
})
}
}
src/api/request.js
View file @
e47ee55
...
...
@@ -3,13 +3,13 @@ class Request {
constructor
(
_request_
)
{
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
}
get
(
url
,
params
,
returnAll
)
{
get
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
}
post
(
url
,
params
,
returnAll
)
{
post
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
}
request
(
method
,
url
,
params
,
returnAll
)
{
request
(
method
,
url
,
params
,
returnAll
)
{
var
requestConfig
=
{
headers
:
{
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
...
...
@@ -17,7 +17,7 @@ class Request {
},
method
}
params
.
req
.
corporateGroupName
=
'集团1'
if
(
method
===
'GET'
)
{
var
paramsArray
=
[]
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
...
...
@@ -39,9 +39,9 @@ class Request {
.
then
(
res
=>
{
return
res
.
json
()
})
// .catch(error => {
// alert(error)
// })
// .catch(error => {
// alert(error)
// })
}
}
...
...
src/components/ViewTabs.vue
View file @
e47ee55
<
template
>
<div
class=
"tabs"
>
<div
class=
"tab pointer"
>
<div
class=
"tab-left box"
>
<div
class=
"tab-left box"
@
click=
"changeType('total')"
>
<div
class=
"tab-total-box"
>
<div
class=
"total-title-box flex"
>
<div
class=
"title inline total"
>
客户总数
</div>
...
...
@@ -29,6 +32,7 @@
<div
:key=
"index"
class=
"item flex"
@
click=
"changeType(i.key)"
>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<transition-number
...
...
@@ -48,41 +52,82 @@
</
template
>
</div>
</div>
<div
class=
"
tabs-content
box"
>
<div
class=
"title inline"
>
客户增长趋势
</div>
<div
class=
"tabs-content box"
>
<div
class=
"tabs-title"
>
客户增长趋势
</div>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"line"
id=
"total-chart"
></div>
<div
class=
"table user-select pointer"
>
<div
class=
"table-head"
>
<
template
v-for=
"(i,index) in tabHead"
>
<div
:class=
"['table-head-item flex',
{'active':index == tabIndex}]"
:key="index"
@click="changeTab(index)"
>
{{
i
}}
</div>
</
template
>
</div>
<div
class=
"table-body flex"
>
<
template
v-for=
"(i,index) in tabIndex == 0 ? pageData[tabType].top : pageData[tabType].last"
>
<div
class=
"table-body-item flex"
:key=
"index"
>
<div
class=
"table-num flex"
>
{{
index
+
1
}}
</div>
<div
class=
"table-key"
>
<marquee
:direction=
"directionTimer"
:delay=
"delayTimer"
:text=
"i.name"
/>
</div>
<div
class=
"table-value"
>
{{
i
.
num
}}
</div>
</div>
</
template
>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
type=
"text/ecmascript-6"
>
const
tabs
=
[
{
title
:
'企微客户'
,
key
:
'wechat'
},
{
title
:
'企微群数'
,
key
:
'wechatGroup'
},
{
title
:
'小程序客户数'
,
key
:
'applet'
},
{
title
:
'公众号客户数'
,
key
:
'publiccus'
}
]
let
tabHead
=
[
'前5品牌'
,
'后5品牌'
]
import
{
changeMixin
}
from
'@/mixins'
import
*
as
echarts
from
'echarts'
export
default
{
name
:
'ViewTabs'
,
mixins
:
[
changeMixin
],
data
()
{
return
{
tabs
:
[
{
title
:
'企微客户'
,
key
:
'wechat'
},
{
title
:
'企微群数'
,
key
:
'wechatGroup'
},
{
title
:
'小程序客户数'
,
key
:
'applet'
},
{
title
:
'公众号客户数'
,
key
:
'publiccus'
}
],
queryItem
:
'total'
,
id
:
'10086'
,
tabs
,
tabHead
,
tabType
:
'total'
,
tabIndex
:
0
,
delayTimer
:
3000
,
directionTimer
:
3000
,
pageData
:
{
total
:
{},
wechat
:
{},
...
...
@@ -104,24 +149,49 @@ export default {
this
.
getBrandOverallbase
(
'wechatGroup'
)
this
.
getBrandOverallbase
(
'applet'
)
this
.
getBrandOverallbase
(
'publiccus'
)
this
.
getBrandOveralltrend
(
'total'
)
},
changeType
(
type
)
{
console
.
log
(
type
)
this
.
tabType
=
type
this
.
getBrandOveralltrend
(
type
)
},
changeTab
(
index
)
{
this
.
tabIndex
=
index
},
getBrandOverallbase
(
queryItem
)
{
const
params
=
{
req
:
{
queryItem
,
queryTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
}
queryItem
,
queryTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(({
code
,
data
})
=>
{
if
(
code
==
0
)
{
let
[
dataList
]
=
data
.
dataList
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
data
)
dataList
.
top
=
this
.
ObjectToArray
(
dataList
.
topList
)
dataList
.
last
=
this
.
ObjectToArray
(
dataList
.
lastList
)
this
.
pageData
[
queryItem
]
=
dataList
}
})
},
ObjectToArray
(
obj
)
{
let
arr
=
[]
obj
=
JSON
.
parse
(
obj
)
Object
.
keys
(
obj
).
map
(
name
=>
arr
.
push
({
name
,
num
:
obj
[
name
]
}))
return
arr
},
getBrandOveralltrend
(
queryItem
)
{
const
params
=
{
queryItem
,
querystartTime
:
'2022-05-23'
,
queryendTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
res
)
})
}
}
}
...
...
@@ -200,6 +270,74 @@ export default {
}
&
-content
{
height
:
24.4vh
;
box-sizing
:
border-box
;
padding
:
1vh
8px
;
display
:
flex
;
flex-direction
:
column
;
.tabs-title
{
font-size
:
12px
;
color
:
#e8e8e8
;
}
&
-chart
{
height
:
20.2vh
;
margin-top
:
auto
;
justify-content
:
space-between
;
gap
:
0
8px
;
.line
{
flex
:
7
;
background
:
#022
;
}
.table
{
flex
:
3
;
background
:
#262525
;
&-head
{
display
:
grid
;
grid-template-columns
:
repeat
(
2
,
50%
);
height
:
2.4vh
;
&-item
{
height
:
100%
;
font-size
:
10px
;
background
:
#353535
;
color
:
rgba
(
$
color
:
#fff
,
$
alpha
:
0.7
);
justify-content
:
center
;
&:hover
{
opacity
:
0.9
;
}
}
.active
{
background
:
#eb6001
;
color
:
#fff
;
}
}
&
-body
{
height
:
calc
(
100%
-
2.4vh
);
flex-direction
:
column
;
justify-content
:
space-between
;
&-item
{
line-height
:
3.4vh
;
width
:
100%
;
font-size
:
10px
;
color
:
#ffffff
;
.table-num
{
width
:
22px
;
justify-content
:
center
;
color
:
#606266
;
}
.table-key
{
width
:
calc
(
100%
-
96px
);
}
.tab-value
{
width
:
52px
;
margin-left
:
auto
;
padding-right
:
4px
;
}
}
}
}
>
div
{
height
:
100%
;
}
}
}
}
</
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