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;