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 268a7b9a
authored
Jun 30, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
2f938b11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
24 deletions
src/api/request.js
src/components/ViewTabs.vue
src/api/request.js
View file @
268a7b9
...
@@ -18,6 +18,11 @@ class Request {
...
@@ -18,6 +18,11 @@ class Request {
method
method
}
}
params
.
req
.
corporateGroupName
=
'广汇'
params
.
req
.
corporateGroupName
=
'广汇'
const
{
reportParams
}
=
window
.
vm
.
$store
.
state
.
app
if
(
reportParams
)
{
params
.
req
.
queryType
=
reportParams
.
reportType
||
0
if
(
reportParams
.
brand
)
params
.
req
.
brandName
=
reportParams
.
brand
.
name
}
if
(
method
===
'GET'
)
{
if
(
method
===
'GET'
)
{
var
paramsArray
=
[]
var
paramsArray
=
[]
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
...
...
src/components/ViewTabs.vue
View file @
268a7b9
...
@@ -55,10 +55,17 @@
...
@@ -55,10 +55,17 @@
<div
class=
"tabs-content box"
>
<div
class=
"tabs-content box"
>
<div
class=
"tabs-title"
>
客户增长趋势
</div>
<div
class=
"tabs-title"
>
客户增长趋势
</div>
<div
class=
"tabs-content-chart flex"
>
<div
class=
"tabs-content-chart flex"
>
<
template
v-if=
"isEmpty"
>
<div
class=
"empty"
>
<img
src=
"@/assets/images/empty.png"
/>
</div>
</
template
>
<
template
v-else
>
<div
<div
class=
"line"
class=
"line"
ref=
"canvas"
ref=
"canvas"
></div>
></div>
</
template
>
<div
class=
"table user-select pointer"
>
<div
class=
"table user-select pointer"
>
<div
class=
"table-head"
>
<div
class=
"table-head"
>
<
template
v-for=
"(i,index) in tabHead"
>
<
template
v-for=
"(i,index) in tabHead"
>
...
@@ -136,23 +143,27 @@ export default {
...
@@ -136,23 +143,27 @@ export default {
publiccus
:
{}
publiccus
:
{}
},
},
canvas
:
null
,
canvas
:
null
,
req
:
{}
req
:
{},
isGroup
:
true
,
isEmpty
:
true
}
}
},
},
mounted
()
{
mounted
()
{
},
},
methods
:
{
methods
:
{
init
(
params
)
{
init
(
params
)
{
console
.
log
(
params
)
let
req
=
{
// params.queryType = params.reportType || 0
queryType
:
params
.
reportType
||
0
// delete params.reportType
}
// this.req = params
if
(
params
.
brand
)
this
.
isGroup
=
false
// this.getOverallbase('total')
this
.
req
=
req
// this.getOverallbase('wechat')
this
.
isEmpty
=
true
// this.getOverallbase('wechatGroup')
this
.
getOverallbase
(
'total'
)
// this.getOverallbase('applet')
this
.
getOverallbase
(
'wechat'
)
// this.getOverallbase('publiccus')
this
.
getOverallbase
(
'wechatGroup'
)
// this.getOveralltrend('total')
this
.
getOverallbase
(
'applet'
)
this
.
getOverallbase
(
'publiccus'
)
this
.
getOveralltrend
(
'total'
)
},
},
changeType
(
type
)
{
changeType
(
type
)
{
this
.
tabType
=
type
this
.
tabType
=
type
...
@@ -162,15 +173,11 @@ export default {
...
@@ -162,15 +173,11 @@ export default {
this
.
tabIndex
=
index
this
.
tabIndex
=
index
},
},
getOverallbase
(
queryItem
)
{
getOverallbase
(
queryItem
)
{
let
{
req
:
{
queryType
},
req
}
=
this
const
params
=
{
const
params
=
{
queryItem
,
queryItem
,
queryTime
:
'2022-06-23'
,
queryTime
:
this
.
getCurrentDate
(),
// queryTime: this.getCurrentDate(),
corporateGroupName
:
'集团1'
,
...
req
}
}
this
.
api
.
overview
[
queryType
==
0
?
'getBrandOverallbase'
:
'getMerchantOverallbase'
](
params
).
then
(({
code
,
data
})
=>
{
this
.
api
.
overview
[
this
.
isGroup
?
'getBrandOverallbase'
:
'getMerchantOverallbase'
](
params
).
then
(({
code
,
data
})
=>
{
if
(
code
==
0
)
{
if
(
code
==
0
)
{
let
[
dataList
]
=
data
.
dataList
let
[
dataList
]
=
data
.
dataList
if
(
dataList
)
{
if
(
dataList
)
{
...
@@ -191,23 +198,28 @@ export default {
...
@@ -191,23 +198,28 @@ export default {
},
},
ObjectToArray
(
obj
)
{
ObjectToArray
(
obj
)
{
let
arr
=
[]
let
arr
=
[]
obj
=
JSON
.
parse
(
obj
)
JSON
.
parse
(
obj
).
map
(
e
=>
{
Object
.
keys
(
obj
).
map
(
name
=>
arr
.
push
({
name
,
num
:
obj
[
name
]
}))
Object
.
keys
(
e
).
map
(
name
=>
arr
.
push
({
name
,
num
:
e
[
name
]
}))
})
return
arr
return
arr
},
},
getOveralltrend
(
queryItem
)
{
getOveralltrend
(
queryItem
)
{
let
{
req
:
{
queryType
}
,
req
}
=
this
let
{
req
:
{
queryType
}
}
=
this
const
params
=
{
const
params
=
{
queryItem
,
queryItem
,
querystartTime
:
queryType
==
1
?
this
.
getNDate
(
-
30
)
:
this
.
getNMonth
(
-
12
),
querystartTime
:
queryType
==
1
?
this
.
getNDate
(
-
30
)
:
this
.
getNMonth
(
-
12
),
queryendTime
:
queryType
==
1
?
this
.
getNDate
(
-
1
)
:
this
.
getNMonth
(
-
1
),
queryendTime
:
queryType
==
1
?
this
.
getNDate
(
-
1
)
:
this
.
getNMonth
(
-
1
),
corporateGroupName
:
'集团1'
,
...
req
}
}
this
.
api
.
overview
[
queryType
==
0
?
'getBrandOveralltrend'
:
'getMerchantOveralltrend'
](
params
).
then
(({
data
,
code
})
=>
{
this
.
api
.
overview
[
this
.
isGroup
?
'getBrandOveralltrend'
:
'getMerchantOveralltrend'
](
params
).
then
(({
data
,
code
})
=>
{
if
(
code
==
0
)
{
if
(
code
==
0
)
{
if
(
!
data
.
dataList
.
map
(
item
=>
item
.
totalNum
).
every
(
item
=>
item
===
0
))
{
this
.
isEmpty
=
false
this
.
$nextTick
(()
=>
{
this
.
canvas
=
echarts
.
init
(
this
.
$refs
.
canvas
)
this
.
canvas
=
echarts
.
init
(
this
.
$refs
.
canvas
)
this
.
draw
(
data
.
dataList
,
queryType
)
this
.
draw
(
data
.
dataList
,
queryType
)
})
}
}
}
})
})
},
},
...
@@ -393,7 +405,8 @@ export default {
...
@@ -393,7 +405,8 @@ export default {
margin-top
:
auto
;
margin-top
:
auto
;
justify-content
:
space-between
;
justify-content
:
space-between
;
gap
:
0
8px
;
gap
:
0
8px
;
.line
{
.line,
.empty
{
flex
:
7
;
flex
:
7
;
}
}
.table
{
.table
{
...
...
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