From a664075dc1c8f145a2687c25eeefa9e36277bd4c Mon Sep 17 00:00:00 2001
From: zzyuan <781948537@qq.com>
Date: Mon, 23 Jun 2025 16:40:05 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=80=BB=E8=A7=88=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/kitchen/index.js | 30 +++++++++++++
src/views/kitchen/index.vue | 84 ++++++++++++++++++++++++++++++-------
2 files changed, 98 insertions(+), 16 deletions(-)
create mode 100644 src/api/kitchen/index.js
diff --git a/src/api/kitchen/index.js b/src/api/kitchen/index.js
new file mode 100644
index 00000000..36765566
--- /dev/null
+++ b/src/api/kitchen/index.js
@@ -0,0 +1,30 @@
+import request from '@/utils/request'
+
+
+
+
+// 数据总览接口
+export function getHomePageInfoApi(data) {
+ return request({
+ url: '/smart-canteen/kitchen_home_page/information',
+ method: 'get',
+ headers: {
+ "merchant-id":"378915229716713472",
+ },
+ params: data
+ })
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/kitchen/index.vue b/src/views/kitchen/index.vue
index 3f502950..c900c14b 100644
--- a/src/views/kitchen/index.vue
+++ b/src/views/kitchen/index.vue
@@ -10,13 +10,41 @@
+
+
+
+
+
+
+
+
@@ -58,12 +86,10 @@
import PanelGroup from './dashboard/PanelGroup'
import SubGroup from './dashboard/SubGroup'
import * as echarts from 'echarts'
-import { getDataScreeningModelApi,
- getCanteenOrdersAndSalesTrendsApi,
- getSupermarketOrderAndSalesTrendApi,
- getThisMonthSDishSalesRankingApi,
+import { getThisMonthSDishSalesRankingApi,
getProportionOfOrderTypesApi
} from "@/api/index";
+import { getHomePageInfoApi } from "@/api/kitchen/index";
export default {
name: 'Index',
components: {
@@ -103,9 +129,35 @@ export default {
"num3": 3,
"num4": 4,
},
- type1:1,
- type2:1,
- type3:1,
+ dateRange1:[new Date(),new Date()],
+ dateRange2:[new Date(),new Date()],
+ pickerOptions: {
+ shortcuts: [{
+ text: '最近一周',
+ onClick(picker) {
+ const start = new Date();
+ const end = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 6);
+ picker.$emit('pick', [start, end]);
+ }
+ },{
+ text: '最近一个月',
+ onClick(picker) {
+ const start = new Date();
+ const end = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+ picker.$emit('pick', [start, end]);
+ }
+ },{
+ text: '最近三个月',
+ onClick(picker) {
+ const start = new Date();
+ const end = new Date();
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 91);
+ picker.$emit('pick', [start, end]);
+ }
+ }]
+ },
myCharts1:null,
myCharts2:null,
myCharts3:null,
@@ -136,16 +188,16 @@ export default {
}
},
getTopData(){
- // getDataScreeningModelApi({}).then((response) => {
- // this.topAreaOptions = response.data.data;
- // });
+ getHomePageInfoApi({}).then((response) => {
+ // this.topAreaOptions = response.data.data;
+ });
},
- changType1(e){
- console.log(this.type1)
+ changDate1(){
this.InitEChartsOne()
this.myCharts1.resize();
},
InitEChartsOne() {
+ console.log(this.dateRange1)
var chartData=[]
// getProportionOfOrderTypesApi({type:this.type3}).then((response) => {
// chartData = response.data;
@@ -282,12 +334,12 @@ export default {
// });
// });
},
- changType2(e){
- console.log(this.type2)
+ changDate2(){
this.InitEChartsTwo()
this.myCharts2.resize();
},
InitEChartsTwo() {
+ console.log(this.dateRange2)
var chartData=[]
// getProportionOfOrderTypesApi({type:this.type3}).then((response) => {
// chartData = response.data;