From 457390c88a1cebaa22bd8efe5798f401d3a5873d Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Fri, 10 Jun 2022 15:55:53 +0800
Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E6=AE=B5=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/report/total.js | 9 +
src/api/report/visit.js | 15 ++
src/views/active/activity.vue | 10 +-
src/views/dashboard/components/PanelGroup.vue | 40 ++++-
src/views/dashboard/index.vue | 62 +++----
src/views/order/activeorder.vue | 2 +-
src/views/report/visit/periodRpt.vue | 167 ++++++++++++++++++
src/views/report/visit/timeRpt.vue | 8 +-
8 files changed, 266 insertions(+), 47 deletions(-)
create mode 100644 src/api/report/total.js
create mode 100644 src/views/report/visit/periodRpt.vue
diff --git a/src/api/report/total.js b/src/api/report/total.js
new file mode 100644
index 0000000..04a8dc5
--- /dev/null
+++ b/src/api/report/total.js
@@ -0,0 +1,9 @@
+import request from '@/utils/request'
+
+export function totalRpt(params) {
+ return request({
+ url: '/api/admin/chart/total',
+ method: 'get',
+ params: params
+ })
+}
diff --git a/src/api/report/visit.js b/src/api/report/visit.js
index b3db355..8e82921 100644
--- a/src/api/report/visit.js
+++ b/src/api/report/visit.js
@@ -48,4 +48,19 @@ export function monthRpt(params) {
})
}
+export function areaRpt(params) {
+ return request({
+ url: '/api/admin/chart/visit_area',
+ method: 'get',
+ params: params
+ })
+}
+
+export function detailRpt(params) {
+ return request({
+ url: '/api/admin/chart/visit_time_detail',
+ method: 'get',
+ params: params
+ })
+}
diff --git a/src/views/active/activity.vue b/src/views/active/activity.vue
index 90428db..a303a4b 100644
--- a/src/views/active/activity.vue
+++ b/src/views/active/activity.vue
@@ -687,9 +687,13 @@
this.load();
},
toactive(obj) {
- if (obj.id) {
- let url = "/#/order/activeorder?activity_id=" + obj.id;
- window.location.href = url
+ if (obj.id) {
+ this.$router.push({
+ path: '/order/activeorder',
+ query: {
+ activity_id: obj.id
+ }
+ })
}
},
changeEndTime(val) {
diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue
index 72e2102..1fd75dc 100644
--- a/src/views/dashboard/components/PanelGroup.vue
+++ b/src/views/dashboard/components/PanelGroup.vue
@@ -12,8 +12,8 @@ background: linear-gradient(to right, #F37335, #FDC830); /* W3C, IE 10+/ Edge, F
预约参观人次
-
总人数:238
-
今 日:46
+
总人数:{{totaldata.visit_total.total}}
+
今 日:{{totaldata.visit_total.today}}
@@ -30,9 +30,9 @@ background: linear-gradient(to right, #ED8F03, #FFB75E); /* W3C, IE 10+/ Edge, F
入场参观人次
-
总人数:208
-
今 日:46
-
核销比:87%
+
总人数:{{totaldata.visit_enter.total}}
+
今 日:{{totaldata.visit_enter.today}}
+
核销比:{{totaldata.visit_enter.per}}
@@ -50,8 +50,8 @@ background: linear-gradient(to right, #ffa751, #ffe259); /* W3C, IE 10+/ Edge, F
预约活动人次
-
总人数:308
-
今 日:26
+
总人数:{{totaldata.activity_total.total}}
+
今 日:{{totaldata.activity_total.today}}
@@ -69,8 +69,8 @@ background: linear-gradient(to right, #f83600, #fe8c00); /* W3C, IE 10+/ Edge, F
预约活动人次
-
总人数:338
-
今 日:46
+
总人数:{{totaldata.activity_enter.total}}
+
今 日:{{totaldata.activity_enter.today}}
@@ -87,6 +87,28 @@ background: linear-gradient(to right, #f83600, #fe8c00); /* W3C, IE 10+/ Edge, F
props: {
countsData: {
type: Object
+ },
+ totaldata:{
+ type: Object,
+ default:{
+ "visit_total": {
+ "total": 0,
+ "today": 0
+ },
+ "visit_enter": {
+ "total": 0,
+ "today": 0,
+ "per":0
+ },
+ "activity_total": {
+ "total": 0,
+ "today": 0
+ },
+ "activity_enter": {
+ "total": 0,
+ "today": 0
+ }
+ }
}
},
components: {
diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index 92ac874..ed6aca8 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -1,7 +1,7 @@
-
+
@@ -42,7 +42,7 @@
-->
-
+
@@ -63,15 +63,17 @@
import PanelGroup from './components/PanelGroup'
// import BarChart from './components/BarChart'
import PieChart from './components/PieChart'
- import LineChart from './components/LineChart'
+ import LineChart from './components/LineChart'
+ import {
+ totalRpt
+ } from '../../api/report/total.js'
import {
getChartsData,
getCounts
} from "../../api/dashboard.js"
import {
- ageRpt
- } from "@/api/report/visit.js";
- import {
+ ageRpt,
+ areaRpt,
sexRpt
} from "@/api/report/visit.js";
export default {
@@ -82,7 +84,8 @@
LineChart
},
data() {
- return {
+ return {
+ totaldata:{},
countsData: {
client_count: 0,
tool_count: 0,
@@ -117,28 +120,9 @@
// name: "本月"
// }]
},
- times: {
+ areas: {
radiusArr: "50%",
- yArr: [{
- value: 240,
- name: '苏州'
- },
- {
- value: 20,
- name: '无锡'
- },
- {
- value: 130,
- name: '常州'
- },
- {
- value: 120,
- name: '泰州'
- },
- {
- value: 120,
- name: '宿迁'
- }
+ yArr: [
],
}
},
@@ -180,6 +164,24 @@
methods: {
load() {
// this.showData = true;
+ totalRpt().then(res => {
+ res.visit_enter.per = (res.visit_enter.total / (res.visit_total.total == 0 ? 1 : res.visit_total.total)) * 100 + "%"
+ this.totaldata = res;
+ })
+
+ var aeraArr = [];
+ areaRpt().then(res=>{
+ for(var m of res.city_list){
+ if(!m.city){
+ m.city = "未知"
+ }
+ aeraArr.push({
+ name: m.city,
+ value: m.num
+ })
+ }
+ this.stat.areas.yArr = aeraArr
+ })
var agearr = [];
var sexarr = [];
ageRpt().then((res) => {
@@ -191,7 +193,7 @@
}
this.stat.exception.yArr = agearr;
}).catch((res) => {})
-
+
sexRpt().then((res) => {
for (var m of res) {
sexarr.push({
@@ -199,7 +201,7 @@
value: m.plan_total
})
}
-
+
this.stat.warning.yArr = sexarr;
}).catch((res) => {})
},
diff --git a/src/views/order/activeorder.vue b/src/views/order/activeorder.vue
index 6597fb4..e65f485 100644
--- a/src/views/order/activeorder.vue
+++ b/src/views/order/activeorder.vue
@@ -172,7 +172,7 @@
value: '已参加',
id: "2"
}, {
- value: '取消预约',
+ value: '已取消',
id: "0"
}]
},
diff --git a/src/views/report/visit/periodRpt.vue b/src/views/report/visit/periodRpt.vue
new file mode 100644
index 0000000..97aebec
--- /dev/null
+++ b/src/views/report/visit/periodRpt.vue
@@ -0,0 +1,167 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/report/visit/timeRpt.vue b/src/views/report/visit/timeRpt.vue
index 7633f03..d110b11 100644
--- a/src/views/report/visit/timeRpt.vue
+++ b/src/views/report/visit/timeRpt.vue
@@ -3,7 +3,7 @@
-
+
@@ -73,11 +73,11 @@
},
{
id:'this_month',
- value:"本月"
+ value:"当月"
},
{
id:'last_month',
- value:"上一月"
+ value:"去年同期"
},
{
id:'this_year',
@@ -85,7 +85,7 @@
},
{
id:'last_year',
- value:"上一年"
+ value:"去年同期"
}],
rptData: {
xArr:[],