Commit 0bd409ec by 匡雅琴

接口联调

1 parent 49839cc1
...@@ -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)
} }
// 私域用户池总览接口---客户价值分析--品牌分布/区域分布 // 私域用户池总览接口---客户价值分析--品牌分布/区域分布
......
...@@ -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('&')
......
...@@ -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 = {
......
...@@ -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-chart> <LineChart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></LineChart>
</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 {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!