Commit 872bec7b authored by 乐宝呗666's avatar 乐宝呗666

修改饼图点击控制

parent 324c721d
import { service, request, serviceForMock, requestForMock, mock } from './service' import { request } from './service'
// 用户端客户行业分布
export function getCustomerByCustomerAttribute () {
return request({
url: '/tp/customerInformation/getCustomerByCustomerAttribute',
method: 'get'
})
}
// 用户端客户地区分布
export function getCustomerByProvince () {
return request({
url: '/tp/customerInformation/getCustomerByProvince',
method: 'get'
})
}
// 获取客户图标信息 // 获取客户图标信息
export function GetClientList () { export function GetClientList () {
return request({ return request({
......
...@@ -14,7 +14,7 @@ export default { ...@@ -14,7 +14,7 @@ export default {
chart: null chart: null
} }
}, },
props: ['message', 'idstr'], props: ['message', 'idstr', 'noDrill'],
mounted () { mounted () {
this.drawLine() this.drawLine()
}, },
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
}, },
eventList () { eventList () {
const vm = this const vm = this
if (vm.noDrill) { return false }
vm.chart.off('click') vm.chart.off('click')
vm.chart.on('click', function (params) { vm.chart.on('click', function (params) {
vm.isShowBack = true vm.isShowBack = true
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</div> </div>
<div class="flex-1"> <div class="flex-1">
<div class="title">商机类型</div> <div class="title">商机类型</div>
<pieChart :message="bussionType" idstr="bussionType" class="heightCut44"></pieChart> <pieChart :message="bussionType" :noDrill="true" idstr="bussionType" class="heightCut44"></pieChart>
</div> </div>
</div> </div>
<div class="flex-1"> <div class="flex-1">
...@@ -163,6 +163,9 @@ export default { ...@@ -163,6 +163,9 @@ export default {
// 行业分布 // 行业分布
async getDistribution () { async getDistribution () {
const _data = await API_BUSSINESS.getDistribution({ industry: this.industry || null }) const _data = await API_BUSSINESS.getDistribution({ industry: this.industry || null })
if (!_data.data.data.length) {
return false
}
const _distribute = { const _distribute = {
legend: _data.data.legend, legend: _data.data.legend,
data: _data.data.data.map(item => { data: _data.data.data.map(item => {
...@@ -191,6 +194,9 @@ export default { ...@@ -191,6 +194,9 @@ export default {
// 产品类型分析 // 产品类型分析
async getProductType () { async getProductType () {
const _data = await API_BUSSINESS.getProductType({ type: this.productType || null }) const _data = await API_BUSSINESS.getProductType({ type: this.productType || null })
if (!_data.data.data.length) {
return false
}
const _typeAnalysis = { const _typeAnalysis = {
legend: _data.data.legend, legend: _data.data.legend,
data: _data.data.data.map(item => { data: _data.data.data.map(item => {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<pieChart :message="dataList" idstr="serviceAnalysis" class="heightCut68"></pieChart> <pieChart :message="dataList" :noDrill="true" idstr="serviceAnalysis" class="heightCut68"></pieChart>
</div> </div>
</template> </template>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</div> </div>
<div class="boxHeight-3 mt-2"> <div class="boxHeight-3 mt-2">
<div class="title">行业分布</div> <div class="title">行业分布</div>
<pieChart :message="typeDistribute" idstr="customTypeDistribute" class="heightCut44"></pieChart> <pieChart :message="typeDistribute" :noDrill="true" idstr="customTypeDistribute" class="heightCut44"></pieChart>
</div> </div>
<div class="boxHeight-3 mt-2"> <div class="boxHeight-3 mt-2">
<div class="title">地区分布</div> <div class="title">地区分布</div>
...@@ -238,7 +238,7 @@ export default { ...@@ -238,7 +238,7 @@ export default {
clientData: {}, // 客户数据 clientData: {}, // 客户数据
clientObj: {}, // 客户数据 clientObj: {}, // 客户数据
typeDistribute: {}, // 业务分布 typeDistribute: {}, // 业务分布
customDistribute: {}, // 客户分布 customDistribute: {}, // 地区分布
clientAnalysis: {}, // 客户分析 clientAnalysis: {}, // 客户分析
input: '', input: '',
state: '', state: '',
...@@ -255,8 +255,29 @@ export default { ...@@ -255,8 +255,29 @@ export default {
mounted () { mounted () {
this.getClientList() this.getClientList()
this.GetCustomerInfo() this.GetCustomerInfo()
this.getCustomerByProvince()
this.getDistribution()
}, },
methods: { methods: {
// 行业分布
async getDistribution () {
const _data = await API_CLIENT.getCustomerByCustomerAttribute()
const _distribute = {
legend: _data.data.legend,
data: _data.data.data.map(item => {
return {
name: item.name,
value: Number(item.number)
}
})
}
this.typeDistribute = _distribute
},
// 客户地区分布
async getCustomerByProvince () {
const _data = await API_CLIENT.getCustomerByProvince()
this.customDistribute = _data.data
},
// 默认展示公司信息 // 默认展示公司信息
GetCustomerInfo () { GetCustomerInfo () {
API_CLIENT.CustomerInfo().then(res => { API_CLIENT.CustomerInfo().then(res => {
...@@ -286,25 +307,25 @@ export default { ...@@ -286,25 +307,25 @@ export default {
this.clientData = res this.clientData = res
this.clientObj = this.clientData.data this.clientObj = this.clientData.data
// 行业分布 // 行业分布
const arg = this.clientObj.status // const arg = this.clientObj.status
const title = [] // const title = []
const da = [] // const da = []
arg.forEach(element => { // arg.forEach(element => {
title.push(element.status) // title.push(element.status)
var jso = { name: element.status, value: element.num } // var jso = { name: element.status, value: element.num }
da.push(jso) // da.push(jso)
}) // })
this.typeDistribute = { legend: title, data: da } // this.typeDistribute = { legend: title, data: da }
// 客户地区分布 // 客户地区分布
const argdis = this.clientObj.area // const argdis = this.clientObj.area
const titdis = [] // const titdis = []
const dadis = [] // const dadis = []
argdis.forEach(e => { // argdis.forEach(e => {
titdis.push(e.area) // titdis.push(e.area)
var dis = { name: e.area, value: e.num } // var dis = { name: e.area, value: e.num }
dadis.push(dis) // dadis.push(dis)
}) // })
this.customDistribute = { xAxis: titdis, data: dadis } // this.customDistribute = { xAxis: titdis, data: dadis }
// 客户合同分析 // 客户合同分析
const legend = this.clientObj.analysis.title const legend = this.clientObj.analysis.title
const seriesData = this.clientObj.analysis.data const seriesData = this.clientObj.analysis.data
...@@ -322,7 +343,6 @@ export default { ...@@ -322,7 +343,6 @@ export default {
} }
_data.push(_obj) _data.push(_obj)
} }
console.log(_data)
this.clientAnalysis = { this.clientAnalysis = {
legend: legend, legend: legend,
xAxis: xAxis, xAxis: xAxis,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<pieChart :message="dataList" idstr="agingAnalysis" class="heightCut68"></pieChart> <pieChart :message="dataList" :noDrill="true" idstr="agingAnalysis" class="heightCut68"></pieChart>
</div> </div>
</template> </template>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<pieChart :message="dataList" idstr="contractAmount" class="heightCut68"></pieChart> <pieChart :message="dataList" :noDrill="true" idstr="contractAmount" class="heightCut68"></pieChart>
</div> </div>
</template> </template>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<span class="tab-button" @click="distributeActive=5" :class="{'is-active':distributeActive=== 5 }">司龄</span> <span class="tab-button" @click="distributeActive=5" :class="{'is-active':distributeActive=== 5 }">司龄</span>
</div> </div>
</div> </div>
<pieChart :message="jobDistribution" idstr="jobDistribution" class="jobDistribution heightCut42"></pieChart> <pieChart :message="jobDistribution" :noDrill="true" idstr="jobDistribution" class="jobDistribution heightCut42"></pieChart>
</div> </div>
</div> </div>
<div class="boxHeight-3 mt-2"> <div class="boxHeight-3 mt-2">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<label>{{titleList[type]}}</label> <label>{{titleList[type]}}</label>
<span @click="goBack">&lt; 返回</span> <span @click="goBack">&lt; 返回</span>
</div> </div>
<div class="news-content" v-if="type===0 ||type===3|| type===4|| type===5 "> <div class="news-content" v-if="type===0 ||type===2|| type===3|| type===4 ">
<h3>{{contentData.name}}</h3> <h3>{{contentData.name}}</h3>
<div v-html="contentData.content"></div> <div v-html="contentData.content"></div>
</div> </div>
...@@ -46,11 +46,11 @@ export default { ...@@ -46,11 +46,11 @@ export default {
this.getIntroductionById() this.getIntroductionById()
} else if (this.type === 1) { } else if (this.type === 1) {
this.getCertificationList() this.getCertificationList()
} else if (this.type === 3) { } else if (this.type === 2) {
this.getMainBusinessById() this.getMainBusinessById()
} else if (this.type === 4) { } else if (this.type === 3) {
this.getGloryById() this.getGloryById()
} else if (this.type === 5) { } else if (this.type === 4) {
this.getCultureById() this.getCultureById()
} }
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="title">全国</div> <div class="title">全国</div>
<div class="content d-flex"> <div class="content d-flex">
<div class="flex-1"> <div class="flex-1">
<pieChart :message="itemNationWide" idstr="itemNationWide" class="heightCut44"></pieChart> <pieChart :message="itemNationWide" :noDrill="true" idstr="itemNationWide" class="heightCut44"></pieChart>
<p v-if="type=='4'">共计客户 <strong>{{message.allCustomerNumber}}</strong></p> <p v-if="type=='4'">共计客户 <strong>{{message.allCustomerNumber}}</strong></p>
<p v-if="type=='3'">共计商机 <strong>{{message.allOpportunitiesNumber}}</strong></p> <p v-if="type=='3'">共计商机 <strong>{{message.allOpportunitiesNumber}}</strong></p>
<p v-if="type=='1'">共计项目 <strong>{{message.allProjectNumber}}</strong></p> <p v-if="type=='1'">共计项目 <strong>{{message.allProjectNumber}}</strong></p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment