diff --git a/admin-web-master/src/api/newly.js b/admin-web-master/src/api/newly.js index 4edb7e6..ee27916 100644 --- a/admin-web-master/src/api/newly.js +++ b/admin-web-master/src/api/newly.js @@ -8,6 +8,22 @@ export function cereContractInformationgetPages(data) { data }) } +// 广告位投放效果统计 +export function selectByAdPlacementId(data) { + return request({ + url: `/cereAdvertisingVisitLog/selectByAdPlacementId?adPlacementId=${data}`, + method: 'get', + data + }) +} +// 广告位投放效果统计 +export function selectByAdPlacementIdAndTime(data) { + return request({ + url: '/cereAdvertisingVisitLog/selectByAdPlacementIdAndTime', + method: 'post', + data + }) +} // 物业缴费 export function cerePaymentInfo(data) { return request({ @@ -16,6 +32,14 @@ export function cerePaymentInfo(data) { data }) } +// 广告位投放效果统计 +export function selectByAdPlacementIdAndTimeAndHour(data) { + return request({ + url: '/cereAdvertisingVisitLog/selectByAdPlacementIdAndTimeAndHour', + method: 'post', + data + }) +} // 合同 export function cereContractInformationgetPage(data) { return request({ diff --git a/admin-web-master/src/components/add/addht.vue b/admin-web-master/src/components/add/addht.vue index 5b4d27b..be8a29f 100644 --- a/admin-web-master/src/components/add/addht.vue +++ b/admin-web-master/src/components/add/addht.vue @@ -465,11 +465,19 @@ import { for (let index = 0; index < this.list1.length; index++) { const element = this.list1[index]; // console.error({...element}) + if(element.type == '资源') { + console.log(element.value,'element.value') if(element.value && typeof element.value == 'object') { - info['资源名称'] =''+ element.value.shopName?element.value.shopName:element.value.advertisingName?element.value.advertisingName:element.value.venueName?element.value.venueName:'暂无' - info['资源类型'] = ''+ element.value.shopName?'商铺':element.value.advertisingType?element.value.advertisingType:element.value.venueName?'场地':'暂无' - info['详细地址'] = element.value.detailedLocation?element.value.detailedLocation:'暂无' + info['资源名称'] =element.value.shopName?element.value.shopName:element.value.advertisingName?element.value.advertisingName:element.value.venueName?element.value.venueName:'暂无' + + info['资源类型'] =element.value.shopName?'商铺':element.value.advertisingType?element.value.advertisingType:element.value.venueName?'场地':'暂无' + if(element.value.venueName){ + info['详细地址'] ='暂无' + }else{ + info['详细地址'] = element.value.detailedLocation?element.value.detailedLocation:'暂无' + } + info['实际使用面积'] = element.value.actualArea?element.value.actualArea:element.value.actualUsableArea?element.value.actualUsableArea:'暂无' } else { info['资源名称'] = '暂无' @@ -497,6 +505,7 @@ import { } } + return info }, async ylht(){ diff --git a/admin-web-master/src/components/chakan/map.vue b/admin-web-master/src/components/chakan/map.vue index b893d07..be4ab00 100644 --- a/admin-web-master/src/components/chakan/map.vue +++ b/admin-web-master/src/components/chakan/map.vue @@ -258,25 +258,25 @@ - + - 120次 + {{msg.dianji}}次 - 18:00-23:00 + {{msg.hour}} - 无 + {{msg.count}} @@ -338,7 +338,10 @@ cereResourceStrategylist, cereBusinessPlan, cereContractInformation, - resourcesFindPlan + resourcesFindPlan, + selectByAdPlacementId, + selectByAdPlacementIdAndTime, + selectByAdPlacementIdAndTimeAndHour } from '@/api/newly'; import { editList @@ -404,7 +407,12 @@ labelStyle: { width: '10%' }, - shouldShowChart: false + shouldShowChart: false, + msg:{ + hour:'', + count:0, + dianji:0 + } } }, created() { @@ -414,13 +422,22 @@ pageSize: 10, resourcesId: 'gg' + this.editbgid.id } - cereResourceStrategylist(c1).then(res => { - console.error(res) - if (!Array.isArray(res.data)) { - this.datalist = []; - return; - } - this.datalist = res.data + // cereResourceStrategylist(c1).then(res => { + // console.error(res) + // if (!Array.isArray(res.data)) { + // this.datalist = []; + // return; + // } + // this.datalist = res.data + // }) + selectByAdPlacementId(this.editbgid.id).then(res => { + this.msg.dianji = res.data + + }) + + selectByAdPlacementIdAndTimeAndHour({adPlacementId:this.editbgid.id}).then(res => { + this.msg.count = res.data.count + this.msg.hour = res.data.hour }) // cereBusinessPlan(c1).then(res => { // console.error(res) @@ -477,28 +494,32 @@ tabClick(val) { if (val.index == '3') { this.shouldShowChart = true - this.$nextTick(() => { - const chartContainer = this.$refs.shop1ZX; - if (chartContainer) { - this.initChart(); - } else { - console.log('图表容器元素未找到,尝试延迟初始化'); - setTimeout(() => { - - if (chartContainer) { - this.initChart(); - } else { - console.error('图表容器元素仍然未找到'); - } - }, 100); - } - }); + selectByAdPlacementIdAndTime({adPlacementId:this.editbgid.id}).then(res => { + this.$nextTick(() => { + const chartContainer = this.$refs.shop1ZX; + if (chartContainer) { + this.initChart(res.data); + } else { + console.log('图表容器元素未找到,尝试延迟初始化'); + setTimeout(() => { + + if (chartContainer) { + this.initChart(res.data); + } else { + console.error('图表容器元素仍然未找到'); + } + }, 100); + } + }); + + }) + } else { this.shouldShowChart = false } }, - initChart() { + initChart(datas) { // 初始化 echarts 实例 const chartDom = this.$refs.shop1ZX; const myChart = echarts.init(chartDom) @@ -511,16 +532,15 @@ }, xAxis: { type: 'category', - data: ['2023-11-26', '2023-11-27', '2023-11-28', - '2023-11-29', '2023-11-30', '2023-12-1', '2023-12-2' - ] + data: datas.map(item => item.month), }, yAxis: { type: 'value' }, series: [{ + color:'#3F9B6A', name: '销售量', - data: [300, 500, 350, 300, 420, 600, 800], + data: datas.map(item => item.count), type: 'line', symbol: 'none' // 不显示数据点 }] diff --git a/admin-web-master/src/router/index.js b/admin-web-master/src/router/index.js index 6fc4aea..91a499d 100644 --- a/admin-web-master/src/router/index.js +++ b/admin-web-master/src/router/index.js @@ -880,7 +880,7 @@ const prefixRoutes = (routes, prefix) => { console.log(' process.env.NODE_ENV='+ process.env.NODE_ENV) const createRouter = () => new Router({ base: process.env.NODE_ENV === 'production' ? '/cdwlMall/' : '/', - mode: process.env.NODE_ENV === 'production' ? 'history' : 'hash', // require service support + mode: process.env.NODE_ENV === 'production' ? 'history' : 'history', // require service support // base: '/', // mode: 'hash', scrollBehavior: () => ({ diff --git a/admin-web-master/src/utils/request.js b/admin-web-master/src/utils/request.js index 81a06f1..ca59a6d 100644 --- a/admin-web-master/src/utils/request.js +++ b/admin-web-master/src/utils/request.js @@ -22,7 +22,7 @@ if(host === 'localhost:8080' || host === 'localhost:8081' || host === 'localhost // baseURL = process.env.VUE_APP_DOMAIN_PREFIX_1; - baseURL = 'http://128.10.249.41:9003'; + baseURL = 'http://128.10.249.39:9003'; } else { @@ -57,6 +57,7 @@ service.interceptors.request.use( // config.headers['Content-Type'] = 'application/json; charset=UTF-8' // config.headers['type'] = ' admin' } + console.log(config) return config }, error => { diff --git a/admin-web-master/src/views/advertisement/advertisingReview/advertisingReview.vue b/admin-web-master/src/views/advertisement/advertisingReview/advertisingReview.vue index cbd7a3a..a19887a 100644 --- a/admin-web-master/src/views/advertisement/advertisingReview/advertisingReview.vue +++ b/admin-web-master/src/views/advertisement/advertisingReview/advertisingReview.vue @@ -321,6 +321,7 @@ type: 'success' }) this.removeonaction('1') + } else { this.$message({ message: res.msg, diff --git a/admin-web-master/src/views/detect/analyse.vue b/admin-web-master/src/views/detect/analyse.vue index 7a64f37..3f574e6 100644 --- a/admin-web-master/src/views/detect/analyse.vue +++ b/admin-web-master/src/views/detect/analyse.vue @@ -24,15 +24,41 @@ -
-
+
+
- +
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
@@ -67,6 +93,10 @@ startTime: "1990-09-11", endTime: "2024-11-09" }, + msgList:{ + belongingGreenwaySection:'', + belongingParkTrail:'' + }, formSel: { } @@ -93,50 +123,258 @@ }, methods: { initecharts1(datas) { - console.error(datas) - let allx = [] - let list1 = { - cent:[], - name:'商铺资源', - } - for (let index = 0; index < datas.shopTrend.length; index++) { - const element = datas.shopTrend[index]; - allx.push(element.trendDate) - list1.cent.push(element.trendQuantity) - } let Dom = this.$refs.echarts1 let myChart = echarts.init(Dom); - let option = { - grid: { - top: '3%', - left: '6%', - right: '6%', - bottom: '6%', - }, - xAxis: { - type: 'category', - boundaryGap: false, - data: allx - }, - yAxis: { - type: 'value' - }, - series: [ - { - name: list1.name, - type: 'line', - stack: 'Total', - data: list1.cent - }, - - ] - }; + // 提取所有日期 + const allDates = []; + Object.values(datas).forEach(trend => { + trend.forEach(item => { + if (!allDates.includes(item.trendDate)) { + allDates.push(item.trendDate); + } + }); + }); + allDates.sort(); + + // 提取每条折线的数据 + const shopData =datas.shopTrend.map(item => item.trendQuantity); + const venueData = datas.venueTrend.map(item => item.trendQuantity); + const advertisingData = datas.advertisingTrend.map(item => item.trendQuantity); + const greenwayData = datas.greenwayTrend.map(item => item.trendQuantity); + + const option = { + tooltip: { + trigger: 'axis' + }, + legend: { + data: ['商铺资源增长趋势', '场地资源增长趋势', '广告位资源增长趋势', '总资源增长趋势'], + + }, + xAxis: { + type: 'category', + data: allDates + }, + yAxis: { + type: 'value' + }, + color: ['#4A90E2', '#37c954', '#F7C153', '#7a69d8'], // 使用浅色系颜色 + series: [ + { + name: '商铺资源增长趋势', + type: 'line', + data: shopData + }, + { + name: '场地资源增长趋势', + type: 'line', + data: venueData + }, + { + name: '广告位资源增长趋势', + type: 'line', + data: advertisingData + }, + { + name: '总资源增长趋势', + type: 'line', + data: greenwayData + } + ] + }; + option && myChart.setOption(option); + window.addEventListener('resize', function() { + myChart.resize(); + }) + }, + initecharts2(val) { + // 获取图表容器的 DOM 元素 + const chartDom = this.$refs.shop2TJ + // 初始化 ECharts 实例 + const myChart = echarts.init(chartDom); + + // 处理数据 + const processedData = [ + { name: '商铺分布占比', value: val.shopCount }, + { name: '场地分布占比', value: val.vendorCount }, + { name: '广告位分布占比', value: val.advertisingCount } + ]; + const option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + formatter: function (params) { + return `${params[0].name}: ${params[0].value}%`; + } + }, + xAxis: { + type: 'category', + data: processedData.map(item => item.name) + }, + yAxis: { + type: 'value', + name: '分布占比(%)', + axisLabel: { + formatter: '{value}%' + } + }, + series: [ + { + name: '资源分布', + type: 'bar', + data: processedData.map(item => item.value), + itemStyle: { + color: function (params) { + const colors = ['#3F7BC5', '#3F9B6A', '#F7C153']; + return colors[params.dataIndex % colors.length]; + } + } + } + ] + }; + + // 使用刚指定的配置项和数据显示图表 + option && myChart.setOption(option) + window.addEventListener('resize', function() { + myChart.resize(); + }) + }, + initecharts3(val) { + // 获取图表容器的 DOM 元素 + const chartDom = this.$refs.zyzbTJ + // 初始化 ECharts 实例 + const myChart = echarts.init(chartDom); + + // 统计不同发布状态的总数 + const statusCountMap = { + 0: 0, + 1: 0, + 2: 0, + 4: 0 + }; + + Object.values(val).forEach(resourceType => { + resourceType.forEach(item => { + statusCountMap[item.publishStatus] += item.statusCount; + }); + }); + + const statusLabels = { + 0: '待发布', + 1: '待审核', + 2: '已发布', + 4: '已租赁' + }; + + const chartData = Object.keys(statusCountMap).map(status => ({ + name: statusLabels[status], + value: statusCountMap[status] + })); + + const option = { + tooltip: { + trigger: 'item', + formatter: '{b}: {c}%' + }, + legend: { + orient: 'horizontal', // 横向展示 + left: 'center', // 居中显示 + data: chartData.map(item => item.name) + }, + series: [ + { + color: ['#F7C153', '#3F7BC5', '#3F9B6A','#904bf7'], + name: '发布状态', + type: 'pie', + radius: '50%', + data: chartData, + label: { + formatter: '{b}: {d}%' + } + } + ] + }; + // 使用刚指定的配置项和数据显示图表 + option && myChart.setOption(option) + window.addEventListener('resize', function() { + myChart.resize(); + }) + }, + initecharts4(val) { + // 获取图表容器的 DOM 元素 + const chartDom = this.$refs.zylhlTJ + // 初始化 ECharts 实例 + const myChart = echarts.init(chartDom); + + // 处理数据 + const processedData = [ + { name: '商铺', value: val.shop }, + { name: '场地', value: val.venue }, + { name: '广告位', value: val.adv } + ]; + + const option = { + title: [ + { + text: `已发布总数:${val.total}`, + left: 'center', + top: 'center', + textStyle: { + fontSize: 14, + fontWeight: 'bold' + } + } + ], + tooltip: { + trigger: 'item', + formatter: function (params) { + return `${params.name}: ${params.value}%`; + } + }, + legend: { + orient: 'horizontal', // 横向展示 + left: 'center', // 居中显示 + data: processedData.map(item => item.name) + }, + series: [ + { + color: ['#F7C153', '#3F7BC5', '#3F9B6A'], + name: '资源分布', + type: 'pie', + radius: ['40%', '60%'], + avoidLabelOverlap: false, + label: { + show: true, + position: 'outside', + formatter: '{b}: {c}%' + }, + labelLine: { + show: true + }, + data: processedData + }, + + ] + }; + // 使用刚指定的配置项和数据显示图表 + option && myChart.setOption(option) + window.addEventListener('resize', function() { + myChart.resize(); + }) }, async getAll() { const res1 = await resourceQuantityGrowth({...this.pageindex}) - console.log(res1.data) + const res2 = await resourceDistributionStatistics({...this.msgList}) + const res3 = await resourceSituationProportion() + + const res4 = await resourceUtilizationProportion() + this.initecharts1(res1.data) + this.initecharts2(res2.data) + this.initecharts3(res3.data) + this.initecharts4(res4.data) }, resetting() { let today = new Date(); @@ -157,15 +395,7 @@ startTime: this.FormTime[0], endTime: this.FormTime[1] } - const res = await statistical(Msg) - this.charDam(res.data.seekingIntentionStatistics) - this.charDam2(res.data.seekingIntentionStatistics) - this.charDam6(res.data.contractTrend) - this.charDam7(res.data.basicQueryTrends) - let trends = [...res.data.shopTrend, ...res.data.venueTrend, ...res.data.advertisingTrend] - - this.charDam1(trends) - this.charDam3(trends) + }, async gitOut() { diff --git a/admin-web-master/src/views/detect/information/index.vue b/admin-web-master/src/views/detect/information/index.vue index c62f778..157e209 100644 --- a/admin-web-master/src/views/detect/information/index.vue +++ b/admin-web-master/src/views/detect/information/index.vue @@ -195,7 +195,7 @@ }, tableData: [], total: 0, - onaction: '2', + onaction: '1', formInline: {}, } }, diff --git a/admin-web-master/src/views/serve/salesReport.vue b/admin-web-master/src/views/serve/salesReport.vue index 4811b0b..66bc396 100644 --- a/admin-web-master/src/views/serve/salesReport.vue +++ b/admin-web-master/src/views/serve/salesReport.vue @@ -93,7 +93,8 @@ - +