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 f30c05cc
authored
Jun 29, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
11254130
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
227 additions
and
5 deletions
src/api/modules/overview.js
src/components/TransitionNumber.vue
src/components/ViewTabs.vue
src/main.js
src/api/modules/overview.js
0 → 100644
View file @
f30c05c
import
Request
from
'../request'
var
request
=
new
Request
()
// window.$HTTP
export
default
{
/**获取品牌---总体模块信息(包括:总客户:total,企微客户:wechat,企微群:wechatGroup,小程序:applet,公众号:publiccus 的基础数据 和 前五排行/后五排行 ) */
getBrandOverallbase
(
params
){
return
request
.
get
(
'brand/overallbase'
,
params
)
}
}
src/components/TransitionNumber.vue
0 → 100644
View file @
f30c05c
<
template
>
<div
class=
"transition-number"
:id=
"idKey"
>
</div>
</
template
>
<
script
type=
'text/ecmascript-6'
>
export
default
{
name
:
'TransitionNumber'
,
props
:
{
num
:
[
String
,
Number
],
idKey
:
String
},
data
()
{
return
{
}
},
watch
:
{
num
(
n
)
{
if
(
n
)
document
.
querySelector
(
`#
${
this
.
idKey
}
`
).
style
=
`--step:
${
n
}
`
}
},
mounted
()
{
},
methods
:
{
}
}
</
script
>
<
style
scoped
lang=
'scss'
>
.transition-number
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
color
:
#fff
;
--step
:
0
;
counter-reset
:
count
var
(
--step
);
z-index
:
var
(
--step
);
transition
:
--step
1s
;
&::before
{
content
:
counter
(
count
);
}
}
@property
--step
{
syntax
:
'<integer>'
;
inherits
:
false
;
initial-value
:
15
;
}
</
style
>
\ No newline at end of file
src/components/ViewTabs.vue
View file @
f30c05c
...
...
@@ -2,11 +2,55 @@
<div
class=
"tabs"
>
<div
class=
"tab pointer"
>
<div
class=
"tab-left box"
>
<div
class=
"title inline"
>
客户总数
</div>
<div
class=
"tab-total-box"
>
<div
class=
"total-title-box flex"
>
<div
class=
"title inline total"
>
客户总数
</div>
<div
class=
"title inline"
>
昨日新增
</div>
<div
class=
"title inline"
>
上月到店
</div>
</div>
<div
class=
"total-number-box flex"
>
<transition-number
:num=
"pageData.total.totalNum"
idKey=
"number-total"
/>
<transition-number
:num=
"pageData.total.incrNum"
idKey=
"number-incr"
/>
<transition-number
:num=
"pageData.total.returnNum"
idKey=
"number-return"
/>
</div>
</div>
</div>
<div
class=
"tab-right box"
>
<template
v-for=
"(i,index) in tabs"
>
<div
:key=
"index"
class=
"item flex"
>
<div
class=
"item-title"
>
{{
i
.
title
}}
</div>
<transition-number
:num=
"pageData[i.key].totalNum"
:idKey=
"`number-$
{i.key}`"
class="item-total"
/>
<div
class=
"item-incr flex"
>
上月
<transition-number
:num=
"pageData[i.key].incrNum"
:idKey=
"`number-incr-$
{i.key}`"
class="item-incr-numer"
/>
</div>
</div>
</
template
>
</div>
<div
class=
"tab-right box"
></div>
</div>
<div
class=
"tabs-content box"
>
<div
class=
"
tabs-content
box"
>
<div
class=
"title inline"
>
客户增长趋势
</div>
</div>
</div>
...
...
@@ -19,11 +63,66 @@ export default {
mixins
:
[
changeMixin
],
data
()
{
return
{
tabs
:
[
{
title
:
'企微客户'
,
key
:
'wechat'
},
{
title
:
'企微群数'
,
key
:
'wechatGroup'
},
{
title
:
'小程序客户数'
,
key
:
'applet'
},
{
title
:
'公众号客户数'
,
key
:
'publiccus'
}
],
queryItem
:
'total'
,
id
:
'10086'
,
pageData
:
{
total
:
{},
wechat
:
{},
wechatGroup
:
{},
applet
:
{},
publiccus
:
{}
}
}
},
mounted
()
{
},
methods
:
{
init
(
params
)
{
console
.
log
(
params
)
this
.
getBrandOverallbase
(
'total'
)
this
.
getBrandOverallbase
(
'wechat'
)
this
.
getBrandOverallbase
(
'wechatGroup'
)
this
.
getBrandOverallbase
(
'applet'
)
this
.
getBrandOverallbase
(
'publiccus'
)
},
getBrandOverallbase
(
queryItem
)
{
const
params
=
{
req
:
{
queryItem
,
queryTime
:
'2022-06-23'
,
corporateGroupName
:
'集团1'
,
queryType
:
0
}
}
this
.
api
.
overview
.
getBrandOverallbase
(
params
).
then
(
res
=>
{
const
{
code
,
data
}
=
res
if
(
code
==
0
)
{
let
[
dataList
]
=
data
.
dataList
console
.
log
(
`________________
${
queryItem
}
_______________________`
,
data
)
this
.
pageData
[
queryItem
]
=
dataList
}
})
}
}
}
</
script
>
...
...
@@ -37,6 +136,67 @@ export default {
grid-template-columns
:
41.5%
57.5%
;
justify-content
:
space-between
;
margin-bottom
:
0.5vh
;
.tab-total-box
{
height
:
100%
;
padding-left
:
8px
;
box-sizing
:
border-box
;
.total-title-box
{
.total
{
width
:
40%
;
}
>
div
{
box-sizing
:
border-box
;
width
:
30%
;
padding-left
:
0
;
}
}
.total-number-box
{
#number-total
{
font-size
:
24px
;
color
:
#eb6001
;
font-weight
:
700
;
line-height
:
3.7vh
;
width
:
40%
;
}
>
div
{
width
:
30%
;
font-size
:
14px
;
color
:
#f5aa01
;
}
}
}
&
-right
{
display
:
grid
;
grid-template-columns
:
repeat
(
4
,
25%
);
height
:
100%
;
.item
{
padding
:
0
8px
;
box-sizing
:
border-box
;
flex-direction
:
column
;
justify-content
:
space-between
;
align-items
:
flex-start
;
&-title
{
font-size
:
12px
;
color
:
#e8e8e8
;
padding-top
:
0.5vh
;
}
&
-total
{
font-size
:
16px
;
color
:
#eb6001
;
font-weight
:
700
;
}
&
-incr
{
font-size
:
12px
;
color
:
#606266
;
padding-bottom
:
0.5vh
;
&-numer
{
font-size
:
10.5px
;
color
:
#e60115
;
}
}
}
}
}
&
-content
{
height
:
24.4vh
;
...
...
src/main.js
View file @
f30c05c
...
...
@@ -20,7 +20,6 @@ import { fetchConfig, cfg } from '@/config'
import
'@/assets/css/index.scss'
import
'./utils/util'
import
'components'
Vue
.
prototype
.
api
=
api
Vue
.
prototype
.
to
=
function
(
name
,
params
)
{
if
(
name
===
-
1
)
{
router
.
go
(
-
1
)
...
...
@@ -39,7 +38,9 @@ fetchConfig(!isMock).then(res => {
// 设置 js中可以访问 $cdn
Vue
.
use
(
cfg
)
// if (res.vconsole) new VConsole()
window
.
$HTTP
=
new
Request
(
res
.
request
)
window
.
$HTTP
=
new
Request
()
// window.$HTTP = new Request(res.request)
Vue
.
prototype
.
api
=
api
window
.
vm
=
new
Vue
({
el
:
'#app'
,
router
,
...
...
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