|
@@ -3,14 +3,14 @@
|
|
|
<div class="page_week_main">
|
|
|
<!-- 选择月报时间 -->
|
|
|
<div class="week_time">
|
|
|
- <SelectMonth></SelectMonth>
|
|
|
+ <SelectMonth @selectYear="selectYear"></SelectMonth>
|
|
|
</div>
|
|
|
<!-- 数据报告-周报 -->
|
|
|
<div class="dataReport">
|
|
|
<div class="dataReport_main">
|
|
|
<div class="data_r_head">
|
|
|
<div class="data_r_title">数据报告-月报</div>
|
|
|
- <div class="data_r_week">(1月1日-1月31日)</div>
|
|
|
+ <div class="data_r_week">({{dateFormatter(start * 1000, 'MM月dd日')}}-{{dateFormatter(end * 1000, 'MM月dd日')}})</div>
|
|
|
</div>
|
|
|
<div class="data_keys">
|
|
|
<span class="keys_label">订阅关键词组:</span>
|
|
@@ -26,31 +26,182 @@
|
|
|
</div>
|
|
|
<div class="echartsView">
|
|
|
<!-- 项目数量 -->
|
|
|
- <div class="newAdd_bid"></div>
|
|
|
+ <EchartsDetail title="项目数量" :Config="barConfig1" :projectData="pCountData"></EchartsDetail>
|
|
|
<!-- 项目规模 -->
|
|
|
- <div class="newAdd_bidBudget"></div>
|
|
|
+ <EchartsDetail title="项目规模" :Config="barConfig2" :projectData="pScaleData"></EchartsDetail>
|
|
|
<!-- 本月项目数量 -->
|
|
|
- <div class="newAdd_bidOpen"></div>
|
|
|
+ <div class="chart scale_chart" v-if="isShow.show_3">
|
|
|
+ <div class="chart_title">本月项目数量</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item, index) in showCurMonthCount" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.item}}</span>
|
|
|
+ <span class="item-count">{{item.count}}个</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count" :class="index > 2 ? 'blue-progress' : 'yellow-progress'" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="curMonthCount.list.length > 5 && !curMonthCount.showAll">
|
|
|
+ <div class="more">
|
|
|
+ <span @click="curMonthCount.showAll = true">查看更多</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 本月项目规模 -->
|
|
|
- <div class="newAdd_scale"></div>
|
|
|
+ <EchartsDetail title="本月项目规模" :Config="barConfig2" :projectData="curMonthScaleData"></EchartsDetail>
|
|
|
<!-- 本月项目数量分布 -->
|
|
|
- <div class="proNum_distrib"></div>
|
|
|
+ <div class="chart month_scale_chart" v-if="isShow.show_5">
|
|
|
+ <div class="chart_title">本月项目数量分布</div>
|
|
|
+ <div>
|
|
|
+ <ve-map
|
|
|
+ height="300px"
|
|
|
+ :init-options="initRendererSvg"
|
|
|
+ :data="mapCountData"
|
|
|
+ :after-config="mapCountConfig"
|
|
|
+ :settings="mapSettings.chartSettings"
|
|
|
+ :extend="mapSettings.chartExtend">
|
|
|
+ </ve-map>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 本月项目规模分布 -->
|
|
|
- <div class="pro_scale"></div>
|
|
|
- <!-- 本月项目数量TOP10采购行业 -->
|
|
|
- <div class="proNum_top"></div>
|
|
|
- <!-- 本月项目规模TOP10采购行业 -->
|
|
|
- <div class="proScale_top"></div>
|
|
|
- <!-- 本月项目平均规模TOP10采购行业 -->
|
|
|
- <div class="proAverage_top"></div>
|
|
|
- <!-- 本月中标企业注册地分布 -->
|
|
|
- <div class="bident_register"></div>
|
|
|
- <!-- 本月中标企业注册资本分布 -->
|
|
|
- <div class="bident_regprice"></div>
|
|
|
- <!-- 本月中标企业中标项目数量分布 -->
|
|
|
- <div class="bident_bidnum"></div>
|
|
|
- <!-- 本月采购单位排行榜 -->
|
|
|
- <div class="month_top"></div>
|
|
|
+ <div class="chart" v-if="isShow.show_6">
|
|
|
+ <div class="chart_title">本月项目规模分布</div>
|
|
|
+ <div>
|
|
|
+ <ve-map
|
|
|
+ height="300px"
|
|
|
+ :init-options="initRendererSvg"
|
|
|
+ :data="mapScaleData"
|
|
|
+ :after-config="mapScaleConfig"
|
|
|
+ :settings="mapSettings2.chartSettings"
|
|
|
+ :extend="mapSettings2.chartExtend">
|
|
|
+ </ve-map>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月项目数量TOP10采购行业 7-->
|
|
|
+ <div class="chart rank" v-if="isShow.show_7">
|
|
|
+ <div class="chart_title">本月项目数量TOP10采购行业</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item,index) in showCurMonthCountTop" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.buyerclass}}</span>
|
|
|
+ <span class="item-count">{{item.count}}个</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count" :class="index > 2 ? 'blue-progress' : 'yellow-progress'" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="curMonthCountTop.list.length > 5 && !curMonthCountTop.showAll">
|
|
|
+ <div class="more">
|
|
|
+ <span @click="curMonthCountTop.showAll = true">查看更多</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月项目规模TOP10采购行业 8-->
|
|
|
+ <div class="chart rank" v-if="isShow.show_8">
|
|
|
+ <div class="chart_title">本月项目规模TOP10采购行业</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item,index) in showCurMonthScaleTop" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.buyerclass}}</span>
|
|
|
+ <span class="item-count">{{item.bidamount}}万元</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count" :class="index > 2 ? 'blue-progress' : 'yellow-progress'" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="curMonthScaleTop.list.length > 5 && !curMonthScaleTop.showAll">
|
|
|
+ <div class="more">
|
|
|
+ <span @click="curMonthScaleTop.showAll = true">查看更多</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月项目平均规模TOP10采购行业 9-->
|
|
|
+ <div class="chart rank" v-if="isShow.show_9">
|
|
|
+ <div class="chart_title">本月项目平均规模TOP10采购行业</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item,index) in showAverageScaleTop" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.buyerclass}}</span>
|
|
|
+ <span class="item-count">{{item.average}}万元</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count" :class="index > 2 ? 'blue-progress' : 'yellow-progress'" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="averageScaleTop.list.length > 5 && !averageScaleTop.showAll">
|
|
|
+ <div class="more">
|
|
|
+ <span @click="averageScaleTop.showAll = true">查看更多</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月中标企业注册地分布 10-->
|
|
|
+ <div class="chart" v-if="isShow.show_10">
|
|
|
+ <div class="chart_title">本月中标企业注册地分布</div>
|
|
|
+ <div>
|
|
|
+ <ve-map
|
|
|
+ ref="chartRegCount"
|
|
|
+ :init-options="initRendererSvg"
|
|
|
+ height="300px"
|
|
|
+ :data="mapRegionData"
|
|
|
+ :after-config="mapRegCountConfig"
|
|
|
+ :settings="mapSettings3.chartSettings"
|
|
|
+ :extend="mapSettings3.chartExtend">
|
|
|
+ </ve-map>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月中标企业注册资本分布 11-->
|
|
|
+ <div class="chart rank" v-if="isShow.show_11">
|
|
|
+ <div class="chart_title">本月中标企业注册资本分布</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item,index) in regCapitalTop.list" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.range}}</span>
|
|
|
+ <span class="item-count">{{item.count}}个</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count blue-progress" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月中标企业中标项目数量分布 12-->
|
|
|
+ <div class="chart month_scale_chart" v-if="isShow.show_12">
|
|
|
+ <div class="chart_title">本月中标企业中标项目数量分布</div>
|
|
|
+ <div>
|
|
|
+ <ve-histogram
|
|
|
+ height="284px"
|
|
|
+ :init-options="initRendererSvg"
|
|
|
+ :data="curWinEntCountData"
|
|
|
+ :settings="settings3"
|
|
|
+ :extend="barChart3.chartExtend">
|
|
|
+ </ve-histogram>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 本月采购单位排行榜 13-->
|
|
|
+ <div class="chart rank" v-if="isShow.show_13">
|
|
|
+ <div class="chart_title">本月采购单位排行榜</div>
|
|
|
+ <div class="progress-bar-container">
|
|
|
+ <div class="progress-bar-item" v-for="(item,index) in showBuyerTop" :key="index">
|
|
|
+ <div class="item-label">
|
|
|
+ <span class="item-name">{{item.buyer}}</span>
|
|
|
+ <span class="item-count">{{item.count}}个</span>
|
|
|
+ </div>
|
|
|
+ <div class="item-progress">
|
|
|
+ <span class="item-progress-count" :class="index > 2 ? 'blue-progress' : 'yellow-progress'" :style="{width: item.parent}"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="buyerTop.list.length > 5 && !buyerTop.showAll">
|
|
|
+ <div class="more">
|
|
|
+ <span @click="buyerTop.showAll = true">查看更多</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!-- 本月中标企业排行榜 -->
|
|
|
<ProjectTop title="本月中标企业排行榜" :data="winner" type="winner"></ProjectTop>
|
|
|
<!-- 本月项目规模排行榜 -->
|
|
@@ -65,61 +216,539 @@
|
|
|
|
|
|
import SelectMonth from '@/components/report-data/SelectMonth.vue'
|
|
|
import ProjectTop from '@/components/report-data/ProjectTop.vue'
|
|
|
+import { getReportDetail, getReportIndex, getReportStartTime } from '@/api/modules'
|
|
|
+import { dateFormatter } from '@/utils/globalFunctions'
|
|
|
+import { mapSettings, mapSettings2, mapSettings3, barChart3 } from '@/utils/echarts_option.js'
|
|
|
+import EchartsDetail from '@/components/report-data/EchartsDetail.vue'
|
|
|
export default {
|
|
|
name: 'page_week',
|
|
|
components: {
|
|
|
SelectMonth,
|
|
|
- ProjectTop
|
|
|
+ ProjectTop,
|
|
|
+ EchartsDetail
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
isWeekIndex: 0,
|
|
|
- winner: [
|
|
|
- {
|
|
|
- area: '广东',
|
|
|
- capital: 9000,
|
|
|
- city: '广州市',
|
|
|
- establish_date: '2015-11-04',
|
|
|
- project_count: 4,
|
|
|
- type: '内资公司',
|
|
|
- winner: '广东崇好健康国际贸易有限公司'
|
|
|
- },
|
|
|
- {
|
|
|
- area: '浙江',
|
|
|
- capital: 10011,
|
|
|
- city: '杭州市',
|
|
|
- establish_date: '1996-04-05',
|
|
|
- project_count: 3,
|
|
|
- type: '内资公司',
|
|
|
- winner: '浙江新中环建设有限公司'
|
|
|
- }
|
|
|
- ],
|
|
|
- project_bidamount: [
|
|
|
- {
|
|
|
- area: '陕西',
|
|
|
- bidamount: 1371059000,
|
|
|
- buyer: '西安市儿童医院',
|
|
|
- city: '西安市',
|
|
|
- jgtime: 1599124420,
|
|
|
- projectname: '西安市儿童医院经开院区项目工程总承包(EPC)',
|
|
|
- winner: '中建八局第二建设有限公司'
|
|
|
- },
|
|
|
- {
|
|
|
- area: '陕西',
|
|
|
- bidamount: 1371059000,
|
|
|
- buyer: '西安市儿童医院',
|
|
|
- city: '西安市',
|
|
|
- jgtime: 1599124420,
|
|
|
- projectname: '西安市儿童医院经开院区项目工程总承包(EPC)',
|
|
|
- winner: '中建八局第二建设有限公司'
|
|
|
- }
|
|
|
- ]
|
|
|
+ winner: [],
|
|
|
+ project_bidamount: [],
|
|
|
+ yearmonth: '', // 第一个月报的年份
|
|
|
+ start: 0,
|
|
|
+ end: 0,
|
|
|
+ project_count: [], // 项目规模
|
|
|
+ settings1: {
|
|
|
+ showLine: ['环比增长率(%)-右纵轴'],
|
|
|
+ axisSite: { right: ['环比增长率(%)-右纵轴'] }
|
|
|
+ },
|
|
|
+ settings2: {
|
|
|
+ showLine: ['环比增长率(%)-右纵轴'],
|
|
|
+ axisSite: { right: ['环比增长率(%)-右纵轴'] }
|
|
|
+ },
|
|
|
+ settings3: {
|
|
|
+ showLine: ['累计占比(%)-右纵轴'],
|
|
|
+ axisSite: { right: ['累计占比(%)-右纵轴'] }
|
|
|
+ },
|
|
|
+ // 项目数量 1
|
|
|
+ pCountData: {
|
|
|
+ columns: ['日期', '项目数量'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 项目规模 2
|
|
|
+ pScaleData: {
|
|
|
+ columns: ['日期', '项目规模', '环比增长率(%)-右纵轴'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 本月项目数量 3
|
|
|
+ curMonthCount: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ // 本月项目规模 4
|
|
|
+ curMonthScaleData: {
|
|
|
+ columns: ['项目类型', '项目规模', '环比增长率(%)-右纵轴'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 地图配置项
|
|
|
+ mapSettings: mapSettings,
|
|
|
+ // 地图数据-本月项目数量分布 5
|
|
|
+ mapCountData: {
|
|
|
+ columns: ['name', 'value'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 地图配置项
|
|
|
+ mapSettings2: mapSettings2,
|
|
|
+ mapSettings3: mapSettings3,
|
|
|
+ // 地图数据-本月项目规模分布 6
|
|
|
+ mapScaleData: {
|
|
|
+ columns: ['name', 'value'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 本月项目数量Top10采购行业 7
|
|
|
+ curMonthCountTop: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ // 本月项目规模TOP10采购行业 8
|
|
|
+ curMonthScaleTop: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ // 本月项目平均规模TOP10采购行业 9
|
|
|
+ averageScaleTop: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ // 地图数据-本月中标企业注册地分布 10
|
|
|
+ mapRegionData: {
|
|
|
+ columns: ['name', 'value'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 本月中标企业注册资本分布 11
|
|
|
+ regCapitalTop: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ // 本月中标企业中标项目数量分布 12
|
|
|
+ barChart3: barChart3,
|
|
|
+ curWinEntCountData: {
|
|
|
+ columns: ['项目数量', '企业数量', '累计占比(%)-右纵轴'],
|
|
|
+ rows: []
|
|
|
+ },
|
|
|
+ // 本月采购单位排行榜 13
|
|
|
+ buyerTop: {
|
|
|
+ list: [],
|
|
|
+ showAll: false
|
|
|
+ },
|
|
|
+ isShow: {
|
|
|
+ show_1: true,
|
|
|
+ show_2: true,
|
|
|
+ show_3: true,
|
|
|
+ show_4: true,
|
|
|
+ show_5: true,
|
|
|
+ show_6: true,
|
|
|
+ show_7: true,
|
|
|
+ show_8: true,
|
|
|
+ show_9: true,
|
|
|
+ show_10: true,
|
|
|
+ show_11: true,
|
|
|
+ show_12: true,
|
|
|
+ show_13: true,
|
|
|
+ show_14: true,
|
|
|
+ show_15: true
|
|
|
+ },
|
|
|
+ initRendererSvg: {
|
|
|
+ renderer: 'svg'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ showCurMonthCount () {
|
|
|
+ return this.curMonthCount.showAll ? this.curMonthCount.list : this.curMonthCount.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showCurMonthCountTop: function () {
|
|
|
+ return this.curMonthCountTop.showAll ? this.curMonthCountTop.list : this.curMonthCountTop.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showCurMonthScaleTop: function () {
|
|
|
+ return this.curMonthScaleTop.showAll ? this.curMonthScaleTop.list : this.curMonthScaleTop.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showAverageScaleTop: function () {
|
|
|
+ return this.averageScaleTop.showAll ? this.averageScaleTop.list : this.averageScaleTop.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showRegCapitalTop: function () {
|
|
|
+ return this.regCapitalTop.showAll ? this.regCapitalTop.list : this.regCapitalTop.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showBuyerTop: function () {
|
|
|
+ return this.buyerTop.showAll ? this.buyerTop.list : this.buyerTop.list.slice(0, 5)
|
|
|
+ },
|
|
|
+ showEntWinTop: function () {
|
|
|
+ return this.curMonthEntWin.showAll ? this.curMonthEntWin.list : this.curMonthEntWin.list.slice(0, 3)
|
|
|
+ },
|
|
|
+ showScaleWin: function () {
|
|
|
+ return this.curMonthScaleWin.showAll ? this.curMonthScaleWin.list : this.curMonthScaleWin.list.slice(0, 3)
|
|
|
}
|
|
|
},
|
|
|
+ created () {
|
|
|
+ this.getFirst()
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ // this.$refs['chartRegCount'].echarts.resize()
|
|
|
+ },
|
|
|
methods: {
|
|
|
- // 选择周报
|
|
|
- selectWeek (data) {
|
|
|
- this.isWeekIndex = data
|
|
|
+ dateFormatter,
|
|
|
+ // 格式化进度条图表数据
|
|
|
+ formatterWinData (data, type) {
|
|
|
+ const that = this
|
|
|
+ console.log(data)
|
|
|
+ data.forEach(function (v, i) {
|
|
|
+ console.log(v)
|
|
|
+ switch (type) {
|
|
|
+ case 'count':
|
|
|
+ v.parent = v.count / data[0].count * 100 + '%'
|
|
|
+ break
|
|
|
+ case 'scale':
|
|
|
+ v.bidamount = (v.bidamount / 10000).toFixed(2)
|
|
|
+ v.parent = v.bidamount / data[0].bidamount * 100 + '%'
|
|
|
+ break
|
|
|
+ case 'average':
|
|
|
+ v.average = (v.average / 10000).toFixed(2)
|
|
|
+ v.parent = v.average / data[0].average * 100 + '%'
|
|
|
+ break
|
|
|
+ case 'capital':
|
|
|
+ v.parent = v.count / that.maxNumForArray(data) * 100 + '%'
|
|
|
+ break
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ },
|
|
|
+ getFirst () {
|
|
|
+ getReportStartTime().then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data) {
|
|
|
+ if (res.data.month_firsttime !== 0) {
|
|
|
+ this.yearmonth = res.data.month_firsttime.slice(0, 4)
|
|
|
+ this.getReportList(res.data.month_firsttime.slice(0, 4))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择月报
|
|
|
+ selectYear (data) {
|
|
|
+ this.getReportList(data)
|
|
|
+ },
|
|
|
+ getReportList (time) {
|
|
|
+ getReportIndex({ ym: time }).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data && res.data.list && res.data.list.length !== 0) {
|
|
|
+ res.data.list.forEach(function (item) {
|
|
|
+ if (item.pushtime) {
|
|
|
+ item.pushtime = dateFormatter(item.pushtime * 1000, 'yyyy/MM/dd')
|
|
|
+ } else {
|
|
|
+ item.pushtime = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.getDetail(res.data.list[0].startdate, res.data.list[0].enddate)
|
|
|
+ this.start = res.data.list[0].startdate
|
|
|
+ this.end = res.data.list[0].enddate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 月报详情
|
|
|
+ getDetail (start, end) {
|
|
|
+ getReportDetail({ start: start, end: end }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.error_code === 0) {
|
|
|
+ // 项目数量 1
|
|
|
+ if (res.data.project_count && res.data.project_count.length > 0) {
|
|
|
+ var pCount = res.data.project_count
|
|
|
+ const data = this.formatterBarLine(pCount, '1')
|
|
|
+ if (data) {
|
|
|
+ this.pCountData.rows = data
|
|
|
+ } else {
|
|
|
+ this.isShow.show_1 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isShow.show_1 = false
|
|
|
+ }
|
|
|
+ // 项目规模 2
|
|
|
+ if (res.data.project_bidamount_count && res.data.project_bidamount_count.length > 0) {
|
|
|
+ const data = this.formatterBarLine(res.data.project_bidamount_count, '2')
|
|
|
+ if (data) {
|
|
|
+ this.pScaleData.rows = data
|
|
|
+ } else {
|
|
|
+ this.isShow.show_2 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isShow.show_2 = false
|
|
|
+ }
|
|
|
+ // 本月项目数量 3
|
|
|
+ if (res.data.project_matchitem_bidamount && res.data.project_matchitem_count.length > 0) {
|
|
|
+ this.curMonthCount.list = this.formatterWinData(res.data.project_matchitem_count, 'count')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_3 = false
|
|
|
+ }
|
|
|
+ // 本月项目规模 4
|
|
|
+ if (res.data.project_matchitem_bidamount && res.data.project_matchitem_bidamount.length > 0) {
|
|
|
+ var data = this.formatterBarLine(res.data.project_matchitem_bidamount, '3')
|
|
|
+ if (data) {
|
|
|
+ this.curMonthScaleData.rows = data
|
|
|
+ } else {
|
|
|
+ this.isShow.show_4 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isShow.show_4 = false
|
|
|
+ }
|
|
|
+ // 本月项目数量分布 5
|
|
|
+ if (res.data.project_area_count && Object.keys(res.data.project_area_count).length > 0) {
|
|
|
+ this.mapCountData.rows = this.formatterMapData(res.data.project_area_count)
|
|
|
+ } else {
|
|
|
+ this.isShow.show_5 = false
|
|
|
+ }
|
|
|
+ // 本月项目规模分布 6
|
|
|
+ if (res.data.project_area_bidamount && Object.keys(res.data.project_area_bidamount).length > 0) {
|
|
|
+ this.mapScaleData.rows = this.formatterMapData(res.data.project_area_bidamount)
|
|
|
+ } else {
|
|
|
+ this.isShow.show_6 = false
|
|
|
+ }
|
|
|
+ // 本月项目数量TOP10采购行业 7
|
|
|
+ if (res.data.project_buyerclass_count && res.data.project_buyerclass_count.length > 0) {
|
|
|
+ this.curMonthCountTop.list = this.formatterWinData(res.data.project_buyerclass_count, 'count')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_7 = false
|
|
|
+ }
|
|
|
+ // 本月项目规模TOP10采购行业 8
|
|
|
+ if (res.data.project_buyerclass_bidamount && res.data.project_buyerclass_bidamount.length > 0) {
|
|
|
+ this.curMonthScaleTop.list = this.formatterWinData(res.data.project_buyerclass_bidamount, 'scale')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_8 = false
|
|
|
+ }
|
|
|
+ // 本月项目平均规模TOP10采购行业 9
|
|
|
+ if (res.data.project_buyerclass_average_bidamount && res.data.project_buyerclass_average_bidamount.length > 0) {
|
|
|
+ var d = res.data.project_buyerclass_average_bidamount
|
|
|
+ this.averageScaleTop.list = this.formatterWinData(d, 'average')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_9 = false
|
|
|
+ }
|
|
|
+ // 本月中标企业注册地分布 10
|
|
|
+ if (res.data.winner_area && Object.keys(res.data.winner_area).length > 0) {
|
|
|
+ this.mapRegionData.rows = this.formatterMapData(res.data.winner_area)
|
|
|
+ } else {
|
|
|
+ this.isShow.show_10 = false
|
|
|
+ }
|
|
|
+ // 本月中标企业注册资本分布 11
|
|
|
+ if (res.data.winner_capital && res.data.winner_capital.length > 0) {
|
|
|
+ this.regCapitalTop.list = this.formatterWinData(res.data.winner_capital, 'capital')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_11 = false
|
|
|
+ }
|
|
|
+
|
|
|
+ // 本月中标企业中标项目数量分布 12
|
|
|
+ if (res.data.winner_project && res.data.winner_project.length > 0) {
|
|
|
+ var datas = this.formatterBarLine(res.data.winner_project, '4')
|
|
|
+ if (datas) {
|
|
|
+ this.curWinEntCountData.rows = datas
|
|
|
+ } else {
|
|
|
+ this.isShow.show_12 = false
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.isShow.show_12 = false
|
|
|
+ }
|
|
|
+
|
|
|
+ // 本月采购单位排行榜 13
|
|
|
+ if (res.data.buyer && res.data.buyer.length > 0) {
|
|
|
+ this.buyerTop.list = this.formatterWinData(res.data.buyer, 'count')
|
|
|
+ } else {
|
|
|
+ this.isShow.show_13 = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.winner = res.data.winner
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 处理地图图表数据(如果type传入的是money,需要进行单位换算,其他则不需要)
|
|
|
+ formatterMapData (data) {
|
|
|
+ var mapRows = []
|
|
|
+ for (var key in data) {
|
|
|
+ mapRows.push({
|
|
|
+ name: key,
|
|
|
+ value: data[key]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return mapRows
|
|
|
+ },
|
|
|
+ // 处理柱状图 + 折线图 图表数据
|
|
|
+ formatterBarLine (data, type) {
|
|
|
+ var that = this
|
|
|
+ var rows
|
|
|
+ var count = 0
|
|
|
+ switch (type) {
|
|
|
+ case '1':
|
|
|
+ rows = []
|
|
|
+ data.forEach(function (item, index) {
|
|
|
+ count += item.value
|
|
|
+ rows.push({
|
|
|
+ 日期: that.formatterTime(item.key) + '月',
|
|
|
+ 项目数量: item.value
|
|
|
+ })
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '2':
|
|
|
+ rows = []
|
|
|
+ data.forEach(function (item, index) {
|
|
|
+ console.log(item)
|
|
|
+ count += item.value
|
|
|
+ count += item.growthrate
|
|
|
+ if (item.growthrate === 0) {
|
|
|
+ item.growthrate = 0
|
|
|
+ } else {
|
|
|
+ item.growthrate = (item.growthrate).toFixed(2)
|
|
|
+ }
|
|
|
+ rows.push({
|
|
|
+ 日期: that.formatterTime(item.key) + '月',
|
|
|
+ 项目规模: Math.round(item.value),
|
|
|
+ '环比增长率(%)-右纵轴': item.growthrate
|
|
|
+ })
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '3':
|
|
|
+ rows = []
|
|
|
+ data.forEach(function (item, index) {
|
|
|
+ count += item.bidamount
|
|
|
+ count += item.growthrate
|
|
|
+ if (item.growthrate === 0) {
|
|
|
+ item.growthrate = 0
|
|
|
+ } else {
|
|
|
+ item.growthrate = (item.growthrate).toFixed(2)
|
|
|
+ }
|
|
|
+ rows.push({
|
|
|
+ 项目类型: item.item,
|
|
|
+ 项目规模: Math.round(item.bidamount),
|
|
|
+ '环比增长率(%)-右纵轴': item.growthrate
|
|
|
+ })
|
|
|
+ })
|
|
|
+ break
|
|
|
+ case '4':
|
|
|
+ console.log(data)
|
|
|
+ rows = []
|
|
|
+ data.forEach(function (item, index) {
|
|
|
+ count += item.entcount
|
|
|
+ count += item.proportion
|
|
|
+ rows.push({
|
|
|
+ 项目数量: item.projectcount,
|
|
|
+ 企业数量: item.entcount,
|
|
|
+ '累计占比(%)-右纵轴': (item.proportion).toFixed(2)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if (count !== 0) {
|
|
|
+ return rows
|
|
|
+ } else {
|
|
|
+ return null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理时间戳
|
|
|
+ formatterTime (time) {
|
|
|
+ var date = new Date(parseInt(time) * 1000)
|
|
|
+ var month = date.getMonth() + 1
|
|
|
+ return month
|
|
|
+ },
|
|
|
+ // 获取数组对里的最大值
|
|
|
+ maxNumForArray (arr) {
|
|
|
+ // eslint-disable-next-line no-array-constructor
|
|
|
+ var sum = new Array()
|
|
|
+ for (var i = 0; i < arr.length; i++) {
|
|
|
+ sum.push(arr[i].count)
|
|
|
+ };
|
|
|
+ var max = sum.sort(function (a, b) {
|
|
|
+ return b - a
|
|
|
+ })
|
|
|
+ return max[0]
|
|
|
+ },
|
|
|
+ // 以下为配置项部分
|
|
|
+ mapCountConfig (options) {
|
|
|
+ options.graphic[0].children[0].style.text = '单位:个'
|
|
|
+ var arr = this.mapCountData.rows
|
|
|
+ var maxNum = Math.max.apply(Math, arr.map(function (o) { return o.value }))
|
|
|
+ options.visualMap.min = 1
|
|
|
+ options.visualMap.max = maxNum < 100 ? 100 : maxNum
|
|
|
+ options.graphic[options.graphic.length - 1].children[0].style.text = maxNum > 100 ? maxNum : 100
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ mapScaleConfig (options) {
|
|
|
+ var arr = this.mapScaleData.rows
|
|
|
+ var maxNum = Math.max.apply(Math, arr.map(function (o) { return o.value }))
|
|
|
+ options.visualMap.min = 1
|
|
|
+ options.visualMap.max = maxNum < 100 ? 100 : maxNum
|
|
|
+ options.graphic[options.graphic.length - 1].children[0].style.text = maxNum > 100 ? maxNum : 100
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ mapRegCountConfig (options) {
|
|
|
+ var arr = this.mapRegionData.rows
|
|
|
+ var maxNum = Math.max.apply(Math, arr.map(function (o) { return o.value }))
|
|
|
+ options.visualMap.min = 1
|
|
|
+ options.visualMap.max = maxNum < 100 ? 100 : maxNum
|
|
|
+ options.graphic[options.graphic.length - 1].children[0].style.text = maxNum > 100 ? maxNum : 100
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ // 修改点击浮窗显示效果
|
|
|
+ formatter (params) {
|
|
|
+ var tip = ''
|
|
|
+ for (var i = 0; i < params.length; i++) {
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ params[i].value === undefined ? params[i].value = 0 : params[i].value
|
|
|
+ params[i].marker = '<span style="display:inline-block;margin-right:5px;border-radius:8px;width:8px;height:8px;background-color:' + params[i].color + '"></span>'
|
|
|
+ if (params[i].seriesName === '项目数量' || params[i].seriesName === '企业数量') {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '个' + '<br/>'
|
|
|
+ } else if (params[i].seriesName === '环比增长率(%)-右纵轴' || params[i].seriesName === '累计占比(%)-右纵轴') {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '%' + '<br/>'
|
|
|
+ } else {
|
|
|
+ tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '万元' + '<br/>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
|
|
|
+ return tip
|
|
|
+ },
|
|
|
+ // 项目数量
|
|
|
+ barConfig1 (options) {
|
|
|
+ var that = this
|
|
|
+ console.log(options)
|
|
|
+ options.color = ['#0BD991']
|
|
|
+ options.legend.show = true
|
|
|
+ // options.grid.bottom = 60
|
|
|
+ // options.tooltip.axisPointer.shadowStyle.color = 'rgba(5,166,243,0.1)'
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ return that.formatter(params)
|
|
|
+ }
|
|
|
+ return options
|
|
|
+ },
|
|
|
+ // 项目规模
|
|
|
+ barConfig2 (options) {
|
|
|
+ var that = this
|
|
|
+ // options.grid.left = 4
|
|
|
+ // options.grid.bottom = 60
|
|
|
+ options.color = ['#0BD991', '#FF9F40']
|
|
|
+ // options.tooltip.axisPointer.shadowStyle.color = 'rgba(5,166,243,0.1)'
|
|
|
+ options.legend.show = true
|
|
|
+ options.yAxis[1].axisLabel.show = true // 显示右侧y轴刻度
|
|
|
+ // options.series[1].lineStyle.width = 2 // 折线
|
|
|
+ // options.series[1].lineStyle.color = '#FF9F40'
|
|
|
+ options.yAxis[0].axisLabel.margin = 2
|
|
|
+ options.yAxis[0].axisLabel.formatter = function (value, index) {
|
|
|
+ return value.toString().replace(/,/, '')
|
|
|
+ }
|
|
|
+ // 以下代码为:处理左侧y轴与右侧y轴刻度保持在同一X轴水平线上
|
|
|
+ var maxCountList = that.pScaleData.rows.map(function (v) {
|
|
|
+ return v['项目规模']
|
|
|
+ })
|
|
|
+ var maxPriceList = that.pScaleData.rows.map(function (v) {
|
|
|
+ return v['环比增长率(%)-右纵轴']
|
|
|
+ })
|
|
|
+ var maxLeft = Math.ceil(Math.max.apply(null, maxCountList)).toString()
|
|
|
+ var maxRight = Math.ceil(Math.max.apply(null, maxPriceList)).toString()
|
|
|
+ var minRight = Math.ceil(Math.min.apply(null, maxPriceList)).toString()
|
|
|
+ maxLeft = Math.ceil(maxLeft / (Math.pow(10, maxLeft.length - 1))) * Math.pow(10, maxLeft.length - 1)
|
|
|
+ maxRight = Math.ceil(maxRight / (Math.pow(10, maxRight.length - 1))) * Math.pow(10, maxRight.length - 1)
|
|
|
+ if (minRight.indexOf('-') > -1) {
|
|
|
+ minRight = '-' + Math.ceil(minRight.replace('-', '') / (Math.pow(10, minRight.replace('-', '').length - 1))) * Math.pow(10, minRight.replace('-', '').length - 1)
|
|
|
+ } else {
|
|
|
+ minRight = 0
|
|
|
+ }
|
|
|
+ var item = options.yAxis
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (maxRight != minRight) {
|
|
|
+ item[0].min = 0
|
|
|
+ item[1].min = minRight
|
|
|
+ item[0].max = maxLeft
|
|
|
+ item[0].interval = Math.ceil(maxLeft / 5)
|
|
|
+ item[1].max = maxRight
|
|
|
+ item[1].interval = Math.ceil((maxRight - minRight) / 5)
|
|
|
+ } else {
|
|
|
+ options.yAxis[1].axisLabel.show = false
|
|
|
+ }
|
|
|
+ options.tooltip.formatter = function (params) {
|
|
|
+ return that.formatter(params)
|
|
|
+ }
|
|
|
+ return options
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -202,6 +831,77 @@ export default {
|
|
|
width: 100%;
|
|
|
background: #ffffff;
|
|
|
}
|
|
|
+ .chart{
|
|
|
+ height: auto;
|
|
|
+ margin-top: .16rem;
|
|
|
+ padding: 0 .32rem;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .chart_title{
|
|
|
+ font-size: 18px;
|
|
|
+ color: #1d1d1d;
|
|
|
+ line-height: 28px;
|
|
|
+ }
|
|
|
+ .progress-bar-container {
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 0 0 .32rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+ /* height: 1.04rem; */
|
|
|
+ margin-top: 28px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item .item-label {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item .item-label .item-name {
|
|
|
+ font-size: 13px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #5F5E64;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item .item-label .item-count {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #171826;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item .item-progress {
|
|
|
+ position: relative;
|
|
|
+ height: 16px;
|
|
|
+ background-color: #EDEFF2;
|
|
|
+ border-radius: 0 28px 28px 0;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-top: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .progress-bar-item .item-progress-count {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 0 28px 28px 0;
|
|
|
+ }
|
|
|
+ .yellow-progress{
|
|
|
+ background: linear-gradient(to right,#FAE7CA, #F1D090);
|
|
|
+ }
|
|
|
+ .blue-progress{
|
|
|
+ background: linear-gradient(to right,#8DE0EB, #2ABED1);
|
|
|
+ }
|
|
|
+ .more{
|
|
|
+ padding: 20px 0 36px;
|
|
|
+ text-align: center;
|
|
|
+ color: #2ABED1;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|