Commit 1ce0173d authored by wangjiankun's avatar wangjiankun

feat: 板块供求数据、板块产品分析四个图表的接口对接 下拉框的变化传值

fix: 搜索框传值改为字符串 防止报错 细节优化
parent ff468d21
import xhr from '@utils/http'
// 板块产品分析-可视化图表数据
export function plateAnalysis(data) {
return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProduct', data)
}
// 板块产品分析-显示户型信息
export function plateAnalysisHouseImg(data) {
return xhr.post('/bnsproject/bns-project/withProjectAndProduct/getRegionProductImg', data)
}
// 导出数据
export function exportExcel(data) {
return xhr.downloadFile('/bnsproject/bns-project/withProjectAndProduct/getRegionProductJson', data)
}
// 查询产品类型
export function queryProductionType(type) {
return xhr.get('/bnsproject/bns-project/withProjectAndProduct/allProperty', {
type
})
}
...@@ -20,7 +20,6 @@ export function queryPlateByRegion(param) { ...@@ -20,7 +20,6 @@ export function queryPlateByRegion(param) {
} }
// 楼盘详情查询 // 楼盘详情查询
export function queryPropertyDetail(id) { export function queryPropertyDetail(id) {
console.log(id)
return xhr.get('/bnsproject/bns-project/withProjectAndProduct/selectDetils/'+ id) return xhr.get('/bnsproject/bns-project/withProjectAndProduct/selectDetils/'+ id)
} }
// 根据楼盘Id查询楼盘销售信息---供求数据 // 根据楼盘Id查询楼盘销售信息---供求数据
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
} }
window.eventBus.$emit('searchParamChange', { window.eventBus.$emit('searchParamChange', {
type: res.data.flag, type: res.data.flag,
data: result data: JSON.stringify(result)
}) })
}) })
} }
......
export function headerTable() {
return [
{
type: 'function',
name: '产品组',
height: '300px'
},
{
type: 'description',
name: '户型描述',
height: '55px'
},
{
type: 'function',
name: '开间数',
height: '50px'
},
{
type: 'function',
name: '居室数',
height: '50px'
},
{
type: 'function',
name: '厅数',
height: '50px'
},
{
type: 'function',
name: '卫生间',
height: '50px'
},
{
type: 'description',
name: '户型面宽',
height: '55px'
},
{
type: 'function',
name: '南向面宽',
height: '50px'
},
{
type: 'function',
name: '起居室面宽',
height: '50px'
},
{
type: 'function',
name: '主卧面宽',
height: '50px'
}, {
type: 'function',
name: '客卧面宽',
height: '50px'
},
{
type: 'description',
name: '户型功能',
height: '55px'
},
]
}
<template>
<div class="hoseDetailForm">
<div class="tableHeader">
</div>
<div class="container">
</div>
</div>
</template>
<script>
export default {
name: 'hoseDetailForm'
}
</script>
<style scoped>
</style>
...@@ -8,22 +8,22 @@ ...@@ -8,22 +8,22 @@
v-for="item in regionOptions" v-for="item in regionOptions"
:key="item.adminRegionId" :key="item.adminRegionId"
:label="item.adminRegionName" :label="item.adminRegionName"
:value="item.adminRegionName"> :value="item.adminRegionId">
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-select v-model="plateVal" placeholder="板块名"> <el-select v-model="plateVal" @change="getPlateAnalysisData" placeholder="板块名">
<el-option <el-option
v-for="item in plateOptions" v-for="item in plateOptions"
:key="item.regionId" :key="item.regionId"
:label="item.regionName" :label="item.regionName"
:value="item.regionName"> :value="item.regionId">
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-select v-model="timeVal" placeholder="年份"> <el-select v-model="timeVal" placeholder="年份" @change="getPlateAnalysisData">
<el-option <el-option
v-for="item in timeOptions" v-for="item in timeOptions"
:key="item.value" :key="item.value"
...@@ -33,17 +33,17 @@ ...@@ -33,17 +33,17 @@
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-select v-model="houseTypeVal" placeholder="类型"> <el-select v-model="houseTypeVal" @change="getPlateAnalysisData" placeholder="类型">
<el-option <el-option
v-for="item in houseTypeOptions" v-for="item in houseTypeOptions"
:key="item.value" :key="item.businessId"
:label="item.label" :label="item.name"
:value="item.value"> :value="item.businessId">
</el-option> </el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-select v-model="areaInterval" placeholder="面积区间"> <el-select v-model="areaInterval" @change="getPlateAnalysisData" placeholder="面积区间">
<el-option <el-option
v-for="item in areaIntervalData" v-for="item in areaIntervalData"
:key="item.value" :key="item.value"
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
</el-radio-group> </el-radio-group>
</el-col> </el-col>
</div> </div>
<el-row style="text-align: right;margin: 20px 0">
<el-button type="primary" size="small" :loading="exportLoading" :disabled="exportLoading" @click="exportPlateAnalysis">导出数据</el-button>
</el-row>
<div class="supplyDealCharts" v-if="showMode === 0"> <div class="supplyDealCharts" v-if="showMode === 0">
<div style="width: 50%"> <div style="width: 50%">
<ve-pie :data="pieData" :legend="{ bottom: 20 }" :colors="colorsArr" :settings="pieSettings"></ve-pie> <ve-pie :data="pieData" :legend="{ bottom: 20 }" :colors="colorsArr" :settings="pieSettings"></ve-pie>
...@@ -73,7 +76,7 @@ ...@@ -73,7 +76,7 @@
<th>卫生间数</th> <th>卫生间数</th>
</tr> </tr>
<tr v-for="item in pieData.rows"> <tr v-for="item in pieData.rows">
<td>{{item.production}}</td> <td>{{item.productionPie}}</td>
<td>{{item.supplication}}</td> <td>{{item.supplication}}</td>
<td>{{item.kjNum || 0}}</td> <td>{{item.kjNum || 0}}</td>
<td>{{item.jsNum || 0}}</td> <td>{{item.jsNum || 0}}</td>
...@@ -83,7 +86,7 @@ ...@@ -83,7 +86,7 @@
</table> </table>
</div> </div>
<div style="width: 50%"> <div style="width: 50%">
<ve-histogram :data="histogramData" :legend="{ bottom: 20 }" :colors="colorsArr" :settings="chartSettings"></ve-histogram> <ve-histogram :data="histogramData" :extend="extend" :legend="{ bottom: 20 }" :colors="colorsArr" :settings="chartSettings"></ve-histogram>
<!-- 各房屋 面宽表格详情--> <!-- 各房屋 面宽表格详情-->
<table cellspacing="0" cellpadding="0" class="table"> <table cellspacing="0" cellpadding="0" class="table">
<tr> <tr>
...@@ -144,6 +147,9 @@ ...@@ -144,6 +147,9 @@
import multiHeaderTable from '@comp/multilHeaderTable' import multiHeaderTable from '@comp/multilHeaderTable'
import { demoData } from "./tableHeader"; import { demoData } from "./tableHeader";
import { getRegionPlate } from "../../assets/js/api/plateSupplyManage"; import { getRegionPlate } from "../../assets/js/api/plateSupplyManage";
import { unitArea } from "./unitArea";
import {plateAnalysis, queryProductionType} from "../../assets/js/api/projectManage";
export default { export default {
name: "ProductAnalysis", name: "ProductAnalysis",
components:{ components:{
...@@ -153,26 +159,19 @@ ...@@ -153,26 +159,19 @@
data () { data () {
return { return {
pieData: { pieData: {
columns: ['production', 'supplication'], columns: ['productionPie', 'supplication'],
rows: [ rows: []
{ 'production': '产品1', 'supplication': 1393, kjNum: 1, jsNum: 2, tingNum: 3, wsjNum: 2 },
{ 'production': '产品2', 'supplication': 3530, kjNum: 2, jsNum: 3, tingNum: 5, wsjNum: 4 },
{ 'production': '产品3', 'supplication': 2923, kjNum: 4, jsNum: 1, tingNum: 1, wsjNum: 3 }
]
}, },
pieSettings: { pieSettings: {
labelMap: { labelMap: {
production: '产品类型', productionPie: '产品类型',
supplication: '产品提供数' supplication: '产品提供数'
} }
}, },
histogramData: { histogramData: {
columns: ['rommInfo', 'proNumOne', 'proNumTwo', 'proNumThree'], columns: ['roomInfo'],
rows: [ rows: [
{ 'rommInfo': '南向面宽', 'proNumOne': 10.1, 'proNumTwo': 10.8, 'proNumThree': 8.9 }, { 'roomInfo': '南向面宽' }
{ 'rommInfo': '起居室面宽', 'proNumOne': 10.5, 'proNumTwo': 10.7, 'proNumThree': 4.5 },
{ 'rommInfo': '主卧面宽', 'proNumOne': 15, 'proNumTwo': 12, 'proNumThree': 0 },
{ 'rommInfo': '客卧面宽', 'proNumOne': 13, 'proNumTwo': 19, 'proNumThree': 10 }
] ]
}, },
map: { map: {
...@@ -181,37 +180,15 @@ ...@@ -181,37 +180,15 @@
'zwmk': '主卧面宽', 'zwmk': '主卧面宽',
'kwmk': '客卧面宽' 'kwmk': '客卧面宽'
}, // 房屋数据 map匹配 }, // 房屋数据 map匹配
histogramTableData: [ histogramTableData: [],
{
production: '产品1',
nxmk: 10.1,
qjsmk: 10.5,
zwmk: 15,
kwmk: 13
},
{
production: '产品2',
nxmk: 8.9,
qjsmk: 4.5,
zwmk: 0,
kwmk: 10
},
{
production: '产品3',
nxmk: 10.1,
qjsmk: 10.5,
zwmk: 15,
kwmk: 13
}
],
chartSettings : { chartSettings : {
axisSite: { right: ['下单率'] }, axisSite: { right: ['下单率'] },
yAxisType: ['normal'], yAxisType: ['normal']
labelMap: { },
roomInfo: '面宽类型', extend: {
proNumOne: '产品1', series: {
proNumTwo: '产品2', type: 'bar',
proNumThree: '产品3' barWidth: 30
} }
}, },
regionOptions: [], regionOptions: [],
...@@ -219,20 +196,24 @@ ...@@ -219,20 +196,24 @@
plateOptions: [], plateOptions: [],
plateVal: '', plateVal: '',
timeOptions: [], timeOptions: [],
timeVal: 2020, timeVal: '',
houseTypeOptions: [], houseTypeOptions: [],
houseTypeVal: '', houseTypeVal: '',
areaInterval: '', areaInterval: '0-70',
areaIntervalData: [], areaIntervalData: unitArea,
showMode: 0, showMode: 0,
colorsArr: colors, colorsArr: colors,
headerTable: tableHeader, headerTable: tableHeader,
plateMap: { plateMap: {
} },
exportLoading: false
} }
}, },
methods: { methods: {
exportPlateAnalysis () {
},
changePlateForRegion (region) { changePlateForRegion (region) {
this.plateVal = '' this.plateVal = ''
if(this.plateMap[region] && this.plateMap[region].length > 0) { if(this.plateMap[region] && this.plateMap[region].length > 0) {
...@@ -240,6 +221,84 @@ ...@@ -240,6 +221,84 @@
} else { } else {
this.plateOptions = [] this.plateOptions = []
} }
},
getPlateAnalysisData() {
// let temp = {
// adminRegion: this.regionVal,
// regionId: this.plateVal,
// year: this.timeVal,
// productType: this.houseTypeVal,
// unitArea: {
// areaMin: this.areaInterval.split('-')[0],
// areaMax: this.areaInterval.split('-')[1]
// }
// }
plateAnalysis().then(res => {
this.pieData.rows = res.data.pieDetilProductDtoList || []
this.histogramTableData = res.data.barDetilDtoList || []
// 处理 面宽数据 格式: { roomInfo: '南向面宽', '产品1': num, '产品2': num2 }
let histomData = []
let colum = ['roomInfo']
Object.keys(this.map).forEach(key => {
let singleData = {}
res.data.barDetilDtoList.forEach(item => {
if(colum.length - 1 !== res.data.barDetilDtoList.length) {
colum.push(item.production)
}
if(!singleData.roomInfo) {
singleData.roomInfo = this.map[key]
}
singleData[item.production] = item[key]
})
histomData.push(singleData)
})
this.histogramData.columns = colum
this.histogramData.rows = histomData
})
},
getRegionAndPlate() {
getRegionPlate().then(res => {
this.regionOptions = res.data
const plateAnalysis = sessionStorage.getItem('plateAnalysisQuery')
const plateAnalysisQuery = JSON.parse(plateAnalysis)
if(plateAnalysisQuery && plateAnalysisQuery.adminRegion && plateAnalysisQuery.regionId) {
res.data.forEach(item => {
if(!this.plateMap[item.adminRegionId]) {
this.plateMap[item.adminRegionId] = item.resultRegionDTOS
}
if (item.adminRegionId === plateAnalysisQuery.adminRegion) {
console.log(item.resultRegionDTOS)
this.plateOptions = item.resultRegionDTOS
}
})
this.regionVal = plateAnalysisQuery.adminRegion ? plateAnalysisQuery.adminRegion : ''
this.plateVal = plateAnalysisQuery.regionId ? plateAnalysisQuery.regionId : ''
this.timeVal = plateAnalysisQuery.year ? plateAnalysisQuery.year: new Date().getFullYear()
} else {
res.data.forEach(item => {
if(!this.plateMap[item.adminRegionId]) {
this.plateMap[item.adminRegionId] = item.resultRegionDTOS
}
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0) {
this.plateOptions = item.resultRegionDTOS
this.regionVal = item.adminRegionId
this.plateVal = item.resultRegionDTOS[0].regionId
this.timeVal = 2020
}
})
}
})
},
getProductType () {
queryProductionType('product_Type').then(res => {
this.houseTypeOptions = res.data
try {
const product_type = JSON.parse(sessionStorage.getItem('plateAnalysisQuery')).productType
this.houseTypeVal = product_type || res.data[0].businessId
} catch (e) {
this.houseTypeVal = ''
}
})
} }
}, },
created() { created() {
...@@ -255,28 +314,29 @@ ...@@ -255,28 +314,29 @@
return demoData return demoData
} }
}, },
beforeMount() { async beforeMount() {
for(let i = 2000; i<= 2020; i++) { for(let i = new Date().getFullYear(); i>= 2000; i--) {
this.timeOptions.push({ this.timeOptions.push({
value: i, value: i,
label: i + '年' label: i + '年'
}) })
} }
getRegionPlate().then(res => { await this.getRegionAndPlate()
this.regionOptions = res.data await this.getProductType()
res.data.forEach(item => { this.getPlateAnalysisData()
if(!this.plateMap[item.adminRegionName]) { },
this.plateMap[item.adminRegionName] = item.resultRegionDTOS beforeDestroy() {
} sessionStorage.setItem('plateAnalysisQuery', JSON.stringify({
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal) { adminRegion: this.regionVal,
this.plateOptions = item.resultRegionDTOS regionId: this.plateVal,
this.regionVal = item.adminRegionName year: this.timeVal,
this.plateVal = item.resultRegionDTOS[0].regionName productType: this.houseTypeVal,
} unitArea: {
}) areaMin: this.areaInterval.split('-')[0],
}) areaMax: this.areaInterval.split('-')[1]
}
}))
} }
} }
</script> </script>
...@@ -290,7 +350,7 @@ ...@@ -290,7 +350,7 @@
} }
.supplyDealCharts{ .supplyDealCharts{
width: 90%; width: 90%;
margin: 40px auto 0; margin: 0 auto;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
table.table{ table.table{
......
export const unitArea = [
{
value: '0-70',
label: '70以下'
},
{
value: '70-80',
label: '70-80'
},
{
value: '80-90',
label: '80-90'
},
{
value: '90-100',
label: '90-100'
},
{
value: '100-110',
label: '100-110'
},
{
value: '110-120',
label: '110-120'
},
{
value: '120-130',
label: '120-130'
},
{
value: '130-140',
label: '130-140'
},
{
value: '140-150',
label: '140-150'
},
{
value: '150-160',
label: '150-160'
},
{
value: '160-170',
label: '160-170'
},
{
value: '170-180',
label: '170-180'
},
{
value: '180-190',
label: '180-190'
},
{
value: '190-200',
label: '190-200'
},
{
value: '200-10000',
label: '200以上'
},
]
...@@ -292,16 +292,18 @@ ...@@ -292,16 +292,18 @@
const searchResult = this.$route.query const searchResult = this.$route.query
if(searchResult.type === 'plateRegion') { if(searchResult.type === 'plateRegion') {
this.showType = 'plateRegion' this.showType = 'plateRegion'
this.map.center.lng = searchResult.data.longitude const resultData = JSON.parse(searchResult.data)
this.map.center.lat = searchResult.data.latitude this.map.center.lng = resultData.longitude
this.map.center.lat = resultData.latitude
this.map.setZoom = this.zoomType.plateRegion this.map.setZoom = this.zoomType.plateRegion
this.dataType.plateRegion = searchResult.data this.dataType.plateRegion = resultData
} else { } else {
this.showType = 'property' this.showType = 'property'
this.map.center.lng = averagePosition(searchResult.data).longitude const resultData = JSON.parse(searchResult.data)
this.map.center.lat = averagePosition(searchResult.data).latitude this.map.center.lng = averagePosition(resultData).longitude
this.map.center.lat = averagePosition(resultData).latitude
this.map.setZoom = this.zoomType.property this.map.setZoom = this.zoomType.property
this.dataType.property = searchResult.data this.dataType.property = resultData
this.propertyDetailData = this.dataType.property[0] this.propertyDetailData = this.dataType.property[0]
} }
} else { } else {
...@@ -322,17 +324,19 @@ ...@@ -322,17 +324,19 @@
window.eventBus.$on('searchParamChange', (searchResult) => { window.eventBus.$on('searchParamChange', (searchResult) => {
if(searchResult.type === 'plateRegion') { if(searchResult.type === 'plateRegion') {
this.showType = 'plateRegion' this.showType = 'plateRegion'
this.map.center.lng = searchResult.data.longitude const resultDetail = JSON.parse(searchResult.data) || {}
this.map.center.lat = searchResult.data.latitude this.map.center.lng = resultDetail.longitude
this.map.center.lat = resultDetail.latitude
this.map.setZoom = this.zoomType.plateRegion this.map.setZoom = this.zoomType.plateRegion
this.dataType.plateRegion = searchResult.data this.dataType.plateRegion = resultDetail
this.detailShow = true this.detailShow = true
} else { } else {
this.showType = 'property' this.showType = 'property'
this.map.center.lng = averagePosition(searchResult.data).longitude const resultDetail = JSON.parse(searchResult.data) || {}
this.map.center.lat = averagePosition(searchResult.data).latitude this.map.center.lng = averagePosition(resultDetail).longitude
this.map.center.lat = averagePosition(resultDetail).latitude
this.map.setZoom = this.zoomType.property this.map.setZoom = this.zoomType.property
this.dataType.property = searchResult.data this.dataType.property = resultDetail
this.propertyDetailData = this.dataType.property[0] this.propertyDetailData = this.dataType.property[0]
this.detailShow = true this.detailShow = true
} }
......
export const areaRangeMap = {
'1.00-70.00': '70以下',
'70.00-80.00': '70-80',
'80.00-90.00': '80-90',
'90.00-100.00': '90-100',
'100.00-110.00': '100-110',
'110.00-120.00': '110-120',
'120.00-130.00': '120-130',
'130.00-140.00': '130-140',
'140.00-150.00': '140-150',
'150.00-160.00': '150-160',
'160.00-170.00': '160-170',
'170.00-180.00': '170-180',
'180.00-190.00': '180-190',
'190.00-200.00': '190-200',
'200.00-10000.00': '200以上'
}
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<script> <script>
import { getSupplyNumData, getRegionPlate, exportSupplyData } from "../../assets/js/api/plateSupplyManage"; import { getSupplyNumData, getRegionPlate, exportSupplyData } from "../../assets/js/api/plateSupplyManage";
import { colors } from "../../components/color"; import { colors } from "../../components/color";
import { areaRangeMap } from "./areaRangeMap";
export default { export default {
name: "ProductAnalysis", name: "ProductAnalysis",
data () { data () {
...@@ -135,11 +136,13 @@ ...@@ -135,11 +136,13 @@
}, },
extend: { extend: {
series: { series: {
type: 'bar',
barWidth: 30 barWidth: 30
} }
}, },
exportSaveStatus: [], // 请求数据后保存 导出时用 exportSaveStatus: [], // 请求数据后保存导出时用
exportLoading: false, // 导出按钮loading exportLoading: false, // 导出按钮loading
} }
}, },
methods: { methods: {
...@@ -155,13 +158,13 @@ ...@@ -155,13 +158,13 @@
const link = document.createElement('a') const link = document.createElement('a')
link.style.display = 'none' link.style.display = 'none'
link.href = url link.href = url
link.setAttribute('download', `${this.regionVal}${this.plateVal}板块${this.timeVal}年份供求信息`) // 自定义下载文件名(如exemple.txt) link.setAttribute('download', `${this.regionVal}${this.plateVal}板块${this.timeVal}年份供求信息`) // 自定义下载文件名
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
this.$message({ this.$message({
type: 'success', type: 'success',
message: '正在下载' message: '导出完成'
}) })
this.exportLoading = false this.exportLoading = false
} else { } else {
...@@ -175,41 +178,46 @@ ...@@ -175,41 +178,46 @@
this.exportLoading = false this.exportLoading = false
}) })
}, },
// yaxisDataDeal(rateArray) {
// let result = rateArray.sort((a,b) => {
// return b-a
// }).filter(item => {
// return item > 1
// }).map(item => {
// return Math.ceil(item)
// })
// const arr = []
// for(let i = Math.max(...result); i>=0; i--) {
// arr.push(i)
// }
// return arr
// },
// 根据区域-板块名-年份获取供求信息 // 根据区域-板块名-年份获取供求信息
getSupplyData () { getSupplyData () {
getSupplyNumData(this.regionVal,this.plateVal,this.timeVal).then(res => { getSupplyNumData(this.regionVal,this.plateVal,this.timeVal).then(res => {
this.exportSaveStatus = JSON.stringify(res.data) if(res.data) {
const areaRange = [] let exportList = []
const supplyNum = [] let supplyChartsData = [] // 供求百分比 图表数据
const dealNum = [] let supplyDealRate = [] //供求比图表数据
const rate = [] let rate = [] // 供求比
this.chartData.rows = res.data let supplyNumber = [] // 供应套数
this.chartData2.rows = res.data let dealNumber = [] // 成交套数
res.data.forEach(item => { let areaRange = [] // 面积区间
areaRange.push(item.areaRange) Object.keys(areaRangeMap).forEach(key => {
supplyNum.push(item.suplyNumber) supplyChartsData.push({
dealNum.push(item.dealNumber) areaRange: areaRangeMap[key],
rate.push(item.rate) supplyProportion: res.data[key] ? (res.data[key].supplyProportion || 0) : 0,
}) dealProportion: res.data[key] ? (res.data[key].dealProportion || 0) : 0
this.supplyData.areaRange.data = areaRange })
this.supplyData.supplyNum.data = supplyNum supplyDealRate.push({
this.supplyData.dealNum.data = dealNum areaRange: areaRangeMap[key],
this.supplyRateData.areaRange.data = areaRange rate: res.data[key] ? (res.data[key].rate || 0) : 0
this.supplyRateData.Rate.data = rate })
areaRange.push(areaRangeMap[key])
rate.push(res.data[key] ? (res.data[key].rate || 0) : 0)
supplyNumber.push(res.data[key] ? (res.data[key].supplyNumber || 0) : 0)
dealNumber.push(res.data[key] ? (res.data[key].dealNumber || 0) : 0)
exportList.push({
areaRange: areaRangeMap[key],
supplyNumber: res.data[key] ? (res.data[key].supplyNumber || 0) : 0,
dealNumber: res.data[key] ? (res.data[key].dealNumber || 0) : 0
})
})
this.chartData.rows = supplyChartsData
this.chartData2.rows = supplyDealRate
this.supplyData.areaRange.data = areaRange
this.supplyData.dealNum.data = dealNumber
this.supplyData.supplyNum.data = supplyNumber
this.supplyRateData.areaRange.data = areaRange
this.supplyRateData.Rate.data = rate
this.exportSaveStatus = JSON.stringify(exportList)
}
}) })
}, },
regionToPlate (region) { regionToPlate (region) {
...@@ -222,7 +230,7 @@ ...@@ -222,7 +230,7 @@
} }
}, },
mounted() { mounted() {
for(let i = 2000; i<= 2020; i++) { for(let i = new Date().getFullYear(); i>= 2000; i--) {
this.timeOptions.push({ this.timeOptions.push({
value: i, value: i,
label: i + '年' label: i + '年'
...@@ -234,21 +242,29 @@ ...@@ -234,21 +242,29 @@
const regionVal = JSON.parse(sessionStorage.getItem('supplyQuery')).regionVal const regionVal = JSON.parse(sessionStorage.getItem('supplyQuery')).regionVal
const plateVal = JSON.parse(sessionStorage.getItem('supplyQuery')).plateVal const plateVal = JSON.parse(sessionStorage.getItem('supplyQuery')).plateVal
const timeVal = JSON.parse(sessionStorage.getItem('supplyQuery')).timeVal const timeVal = JSON.parse(sessionStorage.getItem('supplyQuery')).timeVal
this.regionVal = regionVal res.data.forEach(item => {
this.plateVal = plateVal if(!this.plateMap[item.adminRegionName]) {
this.timeVal = timeVal this.plateMap[item.adminRegionName] = item.resultRegionDTOS
}
if (item.adminRegionName === regionVal) {
this.plateOptions = item.resultRegionDTOS
}
})
this.regionVal = regionVal ? regionVal : ''
this.plateVal = plateVal ? plateVal : ''
this.timeVal = timeVal ? timeVal: new Date().getFullYear()
} else {
res.data.forEach(item => {
if(!this.plateMap[item.adminRegionName]) {
this.plateMap[item.adminRegionName] = item.resultRegionDTOS
}
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal) {
this.plateOptions = item.resultRegionDTOS
this.regionVal = item.adminRegionName
this.plateVal = item.resultRegionDTOS[0].regionName
}
})
} }
res.data.forEach(item => {
if(!this.plateMap[item.adminRegionName]) {
this.plateMap[item.adminRegionName] = item.resultRegionDTOS
}
if(item.resultRegionDTOS && item.resultRegionDTOS.length > 0 && !this.regionVal && !this.plateVal && !this.timeVal) {
this.plateOptions = item.resultRegionDTOS
this.regionVal = item.adminRegionName
this.plateVal = item.resultRegionDTOS[0].regionName
this.timeVal = 2020
}
})
this.getSupplyData() this.getSupplyData()
}) })
}, },
......
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</tr> </tr>
</table> </table>
<!-- 供求比提示信息--> <!-- 供求比提示信息-->
<div class="tips">注:供求比=供应数量/销售数量,供应比越小,销售越好</div> <div class="tips" style="color: red">注:供求比=供应数量/销售数量,供应比越小,销售越好</div>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
...@@ -165,6 +165,7 @@ ...@@ -165,6 +165,7 @@
import planningInfoMap from "./planningInfoMap"; import planningInfoMap from "./planningInfoMap";
import { propertyMapFunction } from "./propertyFunctionMap"; import { propertyMapFunction } from "./propertyFunctionMap";
import { queryPropertyDetail, queryPropertySupplyData } from "../../assets/js/api/unitManage"; import { queryPropertyDetail, queryPropertySupplyData } from "../../assets/js/api/unitManage";
import { areaRangeMap } from "../plateSupplyData/areaRangeMap";
export default { export default {
name: "propertiesDetail", name: "propertiesDetail",
components: {banner, multiHeaderTable}, components: {banner, multiHeaderTable},
...@@ -377,23 +378,36 @@ ...@@ -377,23 +378,36 @@
}, },
getPropertySupplyData () { getPropertySupplyData () {
queryPropertySupplyData(this.propertyId).then(res => { queryPropertySupplyData(this.propertyId).then(res => {
const areaRange = [] if(res.data) {
const supplyNum = [] let supplyChartsData = [] // 供求百分比 图表数据
const dealNum = [] let supplyDealRate = [] //供求比图表数据
const rate = [] let rate = [] // 供求比
this.supplySaleData.rows = res.data let supplyNumber = [] // 供应套数
this.supplyDemandRatioData.rows = res.data let dealNumber = [] // 成交套数
res.data.forEach(item => { let areaRange = [] // 面积区间
areaRange.push(item.areaRange) Object.keys(areaRangeMap).forEach(key => {
supplyNum.push(item.suplyNumber) supplyChartsData.push({
dealNum.push(item.dealNumber) areaRange: areaRangeMap[key],
rate.push(item.rate) supplyProportion: res.data[key] ? (res.data[key].supplyProportion || 0) : 0,
}) dealProportion: res.data[key] ? (res.data[key].dealProportion || 0) : 0
this.supplySaleDataDetail.areaRange.data = areaRange })
this.supplySaleDataDetail.supplyNum.data = supplyNum supplyDealRate.push({
this.supplySaleDataDetail.dealNum.data = dealNum areaRange: areaRangeMap[key],
this.supplyDemandRatioDataDetail.areaRange.data = areaRange rate: res.data[key] ? (res.data[key].rate || 0) : 0
this.supplyDemandRatioDataDetail.rate.data = rate })
areaRange.push(areaRangeMap[key])
rate.push(res.data[key] ? (res.data[key].rate || 0) : 0)
supplyNumber.push(res.data[key] ? (res.data[key].supplyNumber || 0) : 0)
dealNumber.push(res.data[key] ? (res.data[key].dealNumber || 0) : 0)
})
this.supplySaleData.rows = supplyChartsData
this.supplyDemandRatioData.rows = supplyDealRate
this.supplySaleDataDetail.areaRange.data = areaRange
this.supplySaleDataDetail.dealNum.data = dealNumber
this.supplySaleDataDetail.supplyNum.data = supplyNumber
this.supplyRateData.areaRange.data = areaRange
this.supplyRateData.Rate.data = rate
}
}) })
} }
}, },
......
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