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>
This diff is collapsed.
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