Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-pd
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 0bd409ec
authored
Aug 21, 2023
by
匡雅琴
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
接口联调
1 parent
49839cc1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
src/api/modules/operational.js
src/api/request.js
src/views/operational/components/UserTab.vue
src/views/operational/components/ViewChart.vue
src/api/modules/operational.js
View file @
0bd409e
...
@@ -46,7 +46,7 @@ const getDistribution = params => {
...
@@ -46,7 +46,7 @@ const getDistribution = params => {
// 私域用户池总览接口---用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
// 私域用户池总览接口---用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const
getTrend
=
params
=>
{
const
getTrend
=
params
=>
{
return
window
.
$HTTP
.
get
(
'dj/private/getTrend'
,
params
)
return
window
.
$HTTP
.
get
(
'dj/private/getTrend'
,
params
,
false
,
true
)
}
}
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布
...
...
src/api/request.js
View file @
0bd409e
...
@@ -10,13 +10,13 @@ class Request {
...
@@ -10,13 +10,13 @@ class Request {
constructor
(
_request_
)
{
constructor
(
_request_
)
{
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
this
.
DOMAIN
=
_request_
?
_request_
.
baseURL
:
this
.
DOMAIN
}
}
get
(
url
,
params
,
returnAll
)
{
get
(
url
,
params
,
returnAll
,
typeFlag
)
{
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'GET'
,
url
,
params
,
returnAll
,
typeFlag
)
}
}
post
(
url
,
params
,
returnAll
)
{
post
(
url
,
params
,
returnAll
)
{
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
return
this
.
request
(
'POST'
,
url
,
params
,
returnAll
)
}
}
request
(
method
,
url
,
params
,
returnAll
)
{
request
(
method
,
url
,
params
,
returnAll
,
typeFlag
)
{
var
requestConfig
=
{
var
requestConfig
=
{
headers
:
{
headers
:
{
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
...
@@ -24,8 +24,21 @@ class Request {
...
@@ -24,8 +24,21 @@ class Request {
},
},
method
method
}
}
if
(
method
===
'GET'
)
{
var
paramsArray
=
[]
var
paramsArray
=
[]
if
(
method
===
'GET'
&&
typeFlag
)
{
// var paramsArray = []
params
&&
Object
.
keys
(
params
.
req
).
forEach
(
key
=>
paramsArray
.
push
(
'req.'
+
key
+
'='
+
params
.
req
[
key
]))
if
(
url
.
search
(
/
\?
/
)
===
-
1
)
{
url
+=
'?'
+
paramsArray
.
join
(
'&'
)
}
else
{
url
+=
'&'
+
paramsArray
.
join
(
'&'
)
}
}
if
(
method
===
'GET'
&&
!
typeFlag
)
{
// var paramsArray = []
params
&&
Object
.
keys
(
params
).
forEach
(
key
=>
paramsArray
.
push
(
key
+
'='
+
params
[
key
]))
params
&&
Object
.
keys
(
params
).
forEach
(
key
=>
paramsArray
.
push
(
key
+
'='
+
params
[
key
]))
if
(
url
.
search
(
/
\?
/
)
===
-
1
)
{
if
(
url
.
search
(
/
\?
/
)
===
-
1
)
{
url
+=
'?'
+
paramsArray
.
join
(
'&'
)
url
+=
'?'
+
paramsArray
.
join
(
'&'
)
...
...
src/views/operational/components/UserTab.vue
View file @
0bd409e
...
@@ -84,12 +84,12 @@ export default {
...
@@ -84,12 +84,12 @@ export default {
},
},
getTrend
(
queryItem
,
name
)
{
getTrend
(
queryItem
,
name
)
{
console
.
log
(
queryItem
,
'======='
);
const
selectIndex
=
TEXT_VIEW
.
findIndex
(
item
=>
item
.
text
===
name
)
const
selectIndex
=
TEXT_VIEW
.
findIndex
(
item
=>
item
.
text
===
name
)
if
(
selectIndex
>
2
)
return
if
(
selectIndex
>
2
)
return
this
.
selectIndex
=
selectIndex
this
.
selectIndex
=
selectIndex
const
params
=
{
req
:
{
queryItem
}}
const
params
=
{
req
:
{
queryItem
}}
this
.
api
.
operational
.
getTrend
(
params
).
then
(
res
=>
{
this
.
api
.
operational
.
getTrend
(
params
).
then
(
res
=>
{
console
.
log
(
res
);
if
(
res
.
code
===
'0'
)
{
if
(
res
.
code
===
'0'
)
{
const
dataList
=
res
.
data
.
dataList
const
dataList
=
res
.
data
.
dataList
const
obj
=
{
const
obj
=
{
...
...
src/views/operational/components/ViewChart.vue
View file @
0bd409e
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<
template
>
<
template
>
<div
class=
"view-chart flex"
>
<div
class=
"view-chart flex"
>
<div
class=
"line-chart"
>
<div
class=
"line-chart"
>
<
line-chart
domId=
"sumChart"
boxHeight=
"17.54vh"
:privateList=
"privateList"
></line-c
hart>
<
LineChart
domId=
"sumChart"
boxHeight=
"17.54vh"
:privateList=
"privateList"
></LineC
hart>
</div>
</div>
<div
class=
"pie-chart"
>
<div
class=
"pie-chart"
>
<Age></Age>
<Age></Age>
...
@@ -25,6 +25,7 @@ import Age from './Age.vue'
...
@@ -25,6 +25,7 @@ import Age from './Age.vue'
import
Price
from
'./Price.vue'
import
Price
from
'./Price.vue'
import
BuyCar
from
'./BuyCar.vue'
import
BuyCar
from
'./BuyCar.vue'
import
Mileage
from
'./Mileage.vue'
import
Mileage
from
'./Mileage.vue'
import
LineChart
from
'./LineChart.vue'
import
{
userMixin
}
from
'../../../mixins/index'
import
{
userMixin
}
from
'../../../mixins/index'
export
default
{
export
default
{
name
:
'ViewChart'
,
name
:
'ViewChart'
,
...
@@ -33,7 +34,8 @@ export default {
...
@@ -33,7 +34,8 @@ export default {
Age
,
Age
,
Price
,
Price
,
BuyCar
,
BuyCar
,
Mileage
Mileage
,
LineChart
},
},
data
()
{
data
()
{
return
{
return
{
...
...
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