Commit 0bd409ec by 匡雅琴

接口联调

1 parent 49839cc1
......@@ -46,7 +46,7 @@ const getDistribution = params => {
// 私域用户池总览接口---用户数、企微客户数、企微群数、小程序、个微客户数 趋势图
const getTrend = params => {
return window.$HTTP.get('dj/private/getTrend', params)
return window.$HTTP.get('dj/private/getTrend', params, false, true)
}
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布
......
......@@ -10,13 +10,13 @@ class Request {
constructor(_request_) {
this.DOMAIN = _request_ ? _request_.baseURL : this.DOMAIN
}
get(url, params, returnAll) {
return this.request('GET', url, params, returnAll)
get(url, params, returnAll, typeFlag) {
return this.request('GET', url, params, returnAll, typeFlag)
}
post(url, params, returnAll) {
return this.request('POST', url, params, returnAll)
}
request(method, url, params, returnAll) {
request(method, url, params, returnAll, typeFlag) {
var requestConfig = {
headers: {
// 'Content-Type': method == 'GET' ? 'application/json' : 'application/x-www-form-urlencoded; charset=UTF-8'
......@@ -24,8 +24,21 @@ class Request {
},
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]))
if (url.search(/\?/) === -1) {
url += '?' + paramsArray.join('&')
......
......@@ -84,12 +84,12 @@ export default {
},
getTrend(queryItem, name) {
console.log(queryItem, '=======');
const selectIndex = TEXT_VIEW.findIndex(item => item.text === name)
if (selectIndex > 2) return
this.selectIndex = selectIndex
const params = { req: { queryItem }}
this.api.operational.getTrend(params).then(res => {
console.log(res);
if (res.code === '0') {
const dataList = res.data.dataList
const obj = {
......
......@@ -9,7 +9,7 @@
<template>
<div class="view-chart flex">
<div class="line-chart">
<line-chart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></line-chart>
<LineChart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></LineChart>
</div>
<div class="pie-chart">
<Age></Age>
......@@ -25,6 +25,7 @@ import Age from './Age.vue'
import Price from './Price.vue'
import BuyCar from './BuyCar.vue'
import Mileage from './Mileage.vue'
import LineChart from './LineChart.vue'
import { userMixin } from '../../../mixins/index'
export default {
name: 'ViewChart',
......@@ -33,7 +34,8 @@ export default {
Age,
Price,
BuyCar,
Mileage
Mileage,
LineChart
},
data() {
return {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!