|
@@ -7,10 +7,12 @@ var vm = new Vue({
|
|
|
components: {
|
|
|
keywordComponent: keywordComponent,
|
|
|
areaCityMobile: areaCityMobileComponent,
|
|
|
+ areaComponent: areaComponent,
|
|
|
industryComponent: industryComponent,
|
|
|
cateComponent: cateComponent,
|
|
|
dateComponent: dateComponent,
|
|
|
chartExample: chartExample,
|
|
|
+ projectHeader: projectHeaderComponent,
|
|
|
// 图表
|
|
|
projectScatter: projectScatter,
|
|
|
marketTimeScatter: marketTimeScatter,
|
|
@@ -201,6 +203,11 @@ var vm = new Vue({
|
|
|
areaScatter: {
|
|
|
dataAlready: false,
|
|
|
chartData: null,
|
|
|
+ showAreaPopup: false,
|
|
|
+ setCityList: [],
|
|
|
+ selectArea: {},
|
|
|
+ sortType: 0,
|
|
|
+ showAreaCityListBtn: false,
|
|
|
// 项目数量Top3
|
|
|
projectCountTop3: null,
|
|
|
// 项目金额Top3
|
|
@@ -216,19 +223,22 @@ var vm = new Vue({
|
|
|
buyerclass: {
|
|
|
dataAlready: false,
|
|
|
chartData: null,
|
|
|
- showViewAllBtn: false,
|
|
|
// 项目数量Top3
|
|
|
projectCountTop3: null,
|
|
|
+ showCountAllBtn: false,
|
|
|
// 项目金额Top3
|
|
|
- projectAmountTop3: null
|
|
|
+ projectAmountTop3: null,
|
|
|
+ showAmoutAllBtn: false
|
|
|
},
|
|
|
winner: {
|
|
|
dataAlready: false,
|
|
|
chartData: null,
|
|
|
// 项目数量Top3
|
|
|
projectCountTop3: null,
|
|
|
+ showCountAllBtn: false,
|
|
|
// 项目金额Top3
|
|
|
- projectAmountTop3: null
|
|
|
+ projectAmountTop3: null,
|
|
|
+ showAmoutAllBtn: false
|
|
|
}
|
|
|
},
|
|
|
empty: {
|
|
@@ -243,7 +253,26 @@ var vm = new Vue({
|
|
|
},
|
|
|
computed: {
|
|
|
showBuyerBtn: function () {
|
|
|
- return this.sections.buyerclass.showViewAllBtn ? this.sections.buyerclass.projectCountTop3.slice(0, 3) : this.sections.buyerclass.projectCountTop3
|
|
|
+ return this.sections.buyerclass.showCountAllBtn ? this.sections.buyerclass.projectCountTop3.slice(0, 3) : this.sections.buyerclass.projectCountTop3
|
|
|
+ },
|
|
|
+ showAmoutBtn: function () {
|
|
|
+ return this.sections.buyerclass.showAmoutAllBtn ? this.sections.buyerclass.projectAmountTop3.slice(0, 3) : this.sections.buyerclass.projectAmountTop3
|
|
|
+ },
|
|
|
+ showWinnerCountBtn: function () {
|
|
|
+ return this.sections.winner.showCountAllBtn ? this.sections.winner.projectCountTop3.slice(0, 3) : this.sections.winner.projectCountTop3
|
|
|
+ },
|
|
|
+ showWinnerAmoutBtn: function () {
|
|
|
+ return this.sections.winner.showAmoutAllBtn ? this.sections.winner.projectAmountTop3.slice(0, 3) : this.sections.winner.projectAmountTop3
|
|
|
+ },
|
|
|
+ showAreaCityBtn: function () {
|
|
|
+ return this.sections.areaScatter.showAreaCityListBtn ? this.sections.areaScatter.setCityList.slice(0, 5) : this.sections.areaScatter.setCityList
|
|
|
+ },
|
|
|
+ // 选出项目数量最多的省份
|
|
|
+ getMaxProjectCount: function () {
|
|
|
+ const result = this.sections.areaScatter.chartData.rows.reduce((max, item) => {
|
|
|
+ return item.项目数量 > max.项目数量 ? item : max
|
|
|
+ })
|
|
|
+ return result
|
|
|
},
|
|
|
getStatus: function () {
|
|
|
if (JSON.stringify(this.powerInfo) !== '{}') {
|
|
@@ -335,6 +364,14 @@ var vm = new Vue({
|
|
|
utils.iosBackRefresh()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 设置排序方式
|
|
|
+ setsortType (data) {
|
|
|
+ this.sections.areaScatter.sortType = data
|
|
|
+ },
|
|
|
+ cancelSelectArea () {},
|
|
|
+ confirmSelectArea (data) {
|
|
|
+ console.log(data)
|
|
|
+ },
|
|
|
inProList () {
|
|
|
this.saveState()
|
|
|
if(utils.$envs.inWX){
|
|
@@ -892,6 +929,8 @@ var vm = new Vue({
|
|
|
this.sortProjectScatter(data.projectScale)
|
|
|
// 地区规模分布
|
|
|
this.sortAreaScatter(data.area_infos)
|
|
|
+ // 城市分布
|
|
|
+ this.sortAreaCityScatter(data.area_infos)
|
|
|
// 客户分布
|
|
|
if(data.customer_scale){
|
|
|
if(data.customer_scale.length!=0){
|
|
@@ -1299,6 +1338,35 @@ var vm = new Vue({
|
|
|
this.sections.areaScatter.dataAlready = true
|
|
|
}
|
|
|
},
|
|
|
+ setAreaCity () {
|
|
|
+ this.sections.areaScatter.showAreaPopup = true
|
|
|
+ },
|
|
|
+ // 城市分布
|
|
|
+ sortAreaCityScatter (areacitylist) {
|
|
|
+ const result = areacitylist.reduce((max, item) => {
|
|
|
+ return item.total > max.total ? item : max
|
|
|
+ })
|
|
|
+ if (result.areaDetails.length > 5) {
|
|
|
+ this.sections.areaScatter.showAreaCityListBtn = true
|
|
|
+ } else {
|
|
|
+ this.sections.areaScatter.showAreaCityListBtn = false
|
|
|
+ }
|
|
|
+ this.sections.areaScatter.setCityList = this.formatterWinData(result.areaDetails, 'total')
|
|
|
+ this.sections.areaScatter.selectArea = result
|
|
|
+ },
|
|
|
+ // 格式化进度条图表数据
|
|
|
+ formatterWinData: function(data,type) {
|
|
|
+ data.forEach(function(v,i){
|
|
|
+ // v.bidamount = (v.bidamount / 10000).fixed(2);
|
|
|
+ // v.average = (v.average / 10000).fixed(2);
|
|
|
+ switch (type) {
|
|
|
+ case 'total':
|
|
|
+ v.parent = v.total / data[0].total*100 + "%";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data;
|
|
|
+ },
|
|
|
// 客户分布
|
|
|
sortUserScatter (userList) {
|
|
|
if (Array.isArray(userList)) {
|
|
@@ -1669,13 +1737,18 @@ var vm = new Vue({
|
|
|
}
|
|
|
if (dataCount.rows.length) {
|
|
|
if (dataCount.rows.length > 3) {
|
|
|
- this.sections.buyerclass.showViewAllBtn = true
|
|
|
+ this.sections.buyerclass.showCountAllBtn = true
|
|
|
} else {
|
|
|
- this.sections.buyerclass.showViewAllBtn = false
|
|
|
+ this.sections.buyerclass.showCountAllBtn = false
|
|
|
}
|
|
|
this.$set(this.sections.buyerclass, 'projectCountTop3', dataCount.rows)
|
|
|
}
|
|
|
if (dataAmount.rows.length) {
|
|
|
+ if (dataAmount.rows.length > 3) {
|
|
|
+ this.sections.buyerclass.showAmoutAllBtn = true
|
|
|
+ } else {
|
|
|
+ this.sections.buyerclass.showAmoutAllBtn = false
|
|
|
+ }
|
|
|
this.$set(this.sections.buyerclass, 'projectAmountTop3', dataAmount.rows)
|
|
|
}
|
|
|
},
|
|
@@ -1782,9 +1855,19 @@ var vm = new Vue({
|
|
|
}
|
|
|
|
|
|
if (dataCount.rows.length) {
|
|
|
+ if (dataCount.rows.length > 3) {
|
|
|
+ this.sections.winner.showCountAllBtn = true
|
|
|
+ } else {
|
|
|
+ this.sections.winner.showCountAllBtn = false
|
|
|
+ }
|
|
|
this.$set(this.sections.winner, 'projectCountTop3', dataCount.rows)
|
|
|
}
|
|
|
if (dataAmount.rows.length) {
|
|
|
+ if (dataAmount.rows.length > 3) {
|
|
|
+ this.sections.winner.showAmoutAllBtn = true
|
|
|
+ } else {
|
|
|
+ this.sections.winner.showAmoutAllBtn = false
|
|
|
+ }
|
|
|
this.$set(this.sections.winner, 'projectAmountTop3', dataAmount.rows)
|
|
|
}
|
|
|
},
|