diff --git a/admin-web-master/src/api/cereBusinessInfo.js b/admin-web-master/src/api/cereBusinessInfo.js index 5024f11..f99afa1 100644 --- a/admin-web-master/src/api/cereBusinessInfo.js +++ b/admin-web-master/src/api/cereBusinessInfo.js @@ -52,3 +52,12 @@ export function getInvestmentStatistics(data) { }) } +// 招商方案统计 +export function getInvestmentPlanStatistics(data) { + return request({ + url: '/attractInvestmentStatisticsController/getInvestmentPlanStatistics', + method: 'post', + data + }) +} + diff --git a/admin-web-master/src/views/rent/InvestmentAnalysis/index.vue b/admin-web-master/src/views/rent/InvestmentAnalysis/index.vue index d2e5f9b..2dad1a6 100644 --- a/admin-web-master/src/views/rent/InvestmentAnalysis/index.vue +++ b/admin-web-master/src/views/rent/InvestmentAnalysis/index.vue @@ -232,6 +232,7 @@ } ], + graphic: [ { type: 'text', diff --git a/admin-web-master/src/views/scheme/statistics.vue b/admin-web-master/src/views/scheme/statistics.vue index 31820fa..41bad2c 100644 --- a/admin-web-master/src/views/scheme/statistics.vue +++ b/admin-web-master/src/views/scheme/statistics.vue @@ -7,14 +7,14 @@
- + import { - getInvestmentStatistics + getInvestmentPlanStatistics } from '@/api/cereBusinessInfo' import * as echarts from 'echarts' export default { @@ -129,56 +129,42 @@ const chartDom = this.$refs.shop2TJ // 初始化 ECharts 实例 const myChart = echarts.init(chartDom); - // 模拟数据 - const shopCount = 50; - const adCount = 30; - const venueCount = 20; - const totalCount = shopCount + adCount + venueCount; + const option = { tooltip: { trigger: 'item', - formatter: '{a}
{b}: {c} ({d}%)' + formatter: function (params) { + const dataItem = val.find(item => item.businessPurpose === params.name); + return `${params.name}
数量: ${dataItem.num}
占比: ${dataItem.proportion}%`; + } }, legend: { orient: 'horizontal', // 横向展示 left: 'center', // 居中显示 - data: ['商铺', '广告位', '场地'] + data: val.map(item => item.businessPurpose) }, series: [ { + color: ['#4A90E2', '#37c954','#ff94e8', '#7a69d8','#aaffe7', '#8cd89b','#feff89', '#d8d6d5'], name: '资源分布', type: 'pie', - radius: ['50%', '70%'], + radius: ['0%', '60%'], avoidLabelOverlap: false, label: { show: true, position: 'outside', - formatter: '{b}: {c}' + formatter: '{b}: {c}%' }, labelLine: { show: true }, - data: [ - { value: shopCount, name: '商铺' }, - { value: adCount, name: '广告位' }, - { value: venueCount, name: '场地' } - ] + data: val.map(item => ({ + value: item.proportion, + name: item.businessPurpose + })) }, - { - name: '总量', - type: 'pie', - radius: ['0%', '0%'], // 不显示圆形 - label: { - show: true, - position: 'center', - formatter: `总量: ${totalCount}`, - fontSize: 20 - }, - data: [ - { value: totalCount, name: '总量' } - ] - } + ] }; // 使用刚指定的配置项和数据显示图表 @@ -191,25 +177,38 @@ const chartDom = this.$refs.shop1ZX; const myChart = echarts.init(chartDom) - - // 模拟数据 - const shopCount = 50; - const adCount = 30; - const venueCount = 20; - const totalCount = shopCount + adCount + venueCount; + let shopCount = 0; + let adCount = 0; + let venueCount = 0; + let totalCount = 0; + val.forEach(item => { + totalCount += item.num; + if (item.businessPurpose === '商铺合同') { + shopCount = item.proportion; + } else if (item.businessPurpose === '场地合同') { + venueCount = item.proportion; + } else if (item.businessPurpose === '广告位合同') { + adCount = item.proportion; + } + }); const option = { tooltip: { trigger: 'item', - formatter: '{a}
{b}: {c} ({d}%)' + formatter: function (params) { + const dataItem = val.find(item => item.businessPurpose === params.name); + return `${params.name}
数量: ${dataItem.num}
占比: ${dataItem.proportion}%`; + } }, legend: { - orient: 'horizontal', // 横向展示 - left: 'center', // 居中显示 - data: ['商铺', '广告位', '场地'] + orient: 'horizontal', + left: 'center', + data: val.map(item => item.businessPurpose) }, series: [ + { + color: ['#4A90E2', '#37c954','#ff94e8', '#7a69d8','#aaffe7', '#8cd89b','#feff89', '#d8d6d5'], name: '资源分布', type: 'pie', radius: ['50%', '70%'], @@ -217,30 +216,27 @@ label: { show: true, position: 'outside', - formatter: '{b}: {c}' + formatter: '{b}: {c}%' }, labelLine: { show: true }, - data: [ - { value: shopCount, name: '商铺' }, - { value: adCount, name: '广告位' }, - { value: venueCount, name: '场地' } - ] + data: val.map(item => ({ + value: item.proportion, + name: item.businessPurpose + })) }, { - name: '总量', - type: 'pie', - radius: ['0%', '0%'], // 不显示圆形 - label: { - show: true, - position: 'center', - formatter: `总量: ${totalCount}`, - fontSize: 20 - }, - data: [ - { value: totalCount, name: '总量' } - ] + name: '总数', + type: 'pie', + radius: ['0%', '0%'], + label: { + show: true, + position: 'center', + formatter: `总数: ${totalCount}`, + fontSize: 20 + }, + data: [{ value: totalCount, name: '总数' }] } ] }; @@ -251,15 +247,21 @@ charDam3(val) { let Dom = this.$refs.shop1TJ let myChart = echarts.init(Dom) - // val.sort((a, b) => { - // return new Date(a.mouth) - new Date(b.mouth); - // }); - // const months = val.map(item => item.mouth); - // const intentMerchants = val.map(item => item.intention); - // const signedMerchants = val.map(item => item.signContract); - // 模拟月度签约数据 - const months = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']; - const contractCounts = [12, 15, 20, 18, 22, 25, 28, 30, 26, 24, 21, 23]; + // 处理数据 + const months = Object.keys(val).reverse(); // 反转月份顺序,最新月份在前 + const shopData = []; + const venueData = []; + const adData = []; + + months.forEach(month => { + const monthData = val[month]; + const shop = monthData.find(item => item.contractType === '商铺合同')?.contractCount || 0; + const venue = monthData.find(item => item.contractType === '场地合同')?.contractCount || 0; + const ad = monthData.find(item => item.contractType === '广告位合同')?.contractCount || 0; + shopData.push(shop); + venueData.push(venue); + adData.push(ad); + }); const option = { tooltip: { @@ -272,33 +274,37 @@ }, yAxis: { type: 'value', - name: '签约数' + name: '合同数量' }, series: [ { - name: '签约数', + name: '商铺合同', type: 'line', - data: contractCounts, + data: shopData, symbol: 'circle', - lineStyle: { - color: '#4A90E2' - }, - itemStyle: { - color: '#4A90E2' - }, - areaStyle: { - color: new echarts.graphic.LinearGradient( - 0, 0, 0, 1, - [ - { offset: 0, color: 'rgba(74, 144, 226, 0.3)' }, - { offset: 1, color: 'rgba(74, 144, 226, 0.1)' } - ] - ) - } + lineStyle: { color: '#4A90E2' }, + itemStyle: { color: '#4A90E2' } + }, + { + name: '场地合同', + type: 'line', + data: venueData, + symbol: 'square', + lineStyle: { color: '#52C41A' }, + itemStyle: { color: '#52C41A' } + }, + { + name: '广告位合同', + type: 'line', + data: adData, + symbol: 'triangle', + lineStyle: { color: '#FF7800' }, + itemStyle: { color: '#FF7800' } } ] }; + option && myChart.setOption(option); window.addEventListener('resize', function() { myChart.resize(); @@ -313,48 +319,72 @@ const myChart = echarts.init(chartDom); - // 模拟租金价格数据,这里假设是按月份统计 - const months = ['1月', '2月', '3月', '4月', '5月', '6月']; - const rentPrices = [50, 52, 55, 53, 56, 58]; - - const option = { - tooltip: { - trigger: 'axis' - }, - xAxis: { - type: 'category', - data: months, - boundaryGap: false - }, - yAxis: { - type: 'value', - name: '租金价格(元/m²)' - }, - series: [ - { + const allDates = []; + const leaseTerms = ['季', '年', '日', '月']; + const seriesData = { + '季': [], + '年': [], + '日': [], + '月': [] + }; + + // 收集所有日期 + leaseTerms.forEach(term => { + val[term].forEach(item => { + if (!allDates.includes(item.createDay)) { + allDates.push(item.createDay); + } + }); + }); + + // 按日期排序 + allDates.sort(); + + // 填充各租赁期限的数据 + leaseTerms.forEach(term => { + allDates.forEach(date => { + const found = val[term].find(item => item.createDay === date); + seriesData[term].push(found ? found.rentalPrice : null); + }); + }); + + const option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + } + }, + legend: { + data: leaseTerms + }, + xAxis: { + type: 'category', + data: allDates + }, + yAxis: { + type: 'value', name: '租金价格', + axisLabel: { + formatter: '{value}' + } + }, + series: leaseTerms.map(term => ({ + name: term, type: 'line', - data: rentPrices, + data: seriesData[term], symbol: 'circle', - lineStyle: { - color: '#4A90E2' + label: { + show: false }, - itemStyle: { - color: '#4A90E2' - }, - areaStyle: { - color: new echarts.graphic.LinearGradient( - 0, 0, 0, 1, - [ - { offset: 0, color: 'rgba(74, 144, 226, 0.3)' }, - { offset: 1, color: 'rgba(74, 144, 226, 0.1)' } - ] - ) + lineStyle: { + width: 2 } - } - ] - }; - + })) + }; // 使用刚指定的配置项和数据显示图表 option && myChart.setOption(option) window.addEventListener('resize', function() { @@ -364,11 +394,11 @@ }, async getAll() { - const res = await getInvestmentStatistics(this.pageindex) - this.charDam3() - this.charDam1() - this.charDam() - this.charDam5() + const res = await getInvestmentPlanStatistics(this.pageindex) + this.charDam3(res.data.monthlyContractVOList) + this.charDam1(res.data.resourceUsageRatioVOList) + this.charDam(res.data.businessTypeProportionList) + this.charDam5(res.data.rentTrendMap) }, diff --git a/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue b/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue index 3b1ac68..b7cc830 100644 --- a/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue +++ b/lvdao-miniapp/pagesA/rentPay/rentPayDetails.vue @@ -138,7 +138,6 @@ }, confirm(e) { this.pageIndex.time = e.year - const { firstDay, lastDay @@ -150,7 +149,6 @@ }, 1).then(res => { console.log(res) if (res.data.data.length > 0) { - this.getAll(res.data.data[0].cerePropertyOrderList) } else { this.dataList = []