diff --git a/index.html b/index.html
index 7f05b6f..1d21590 100644
--- a/index.html
+++ b/index.html
@@ -2,14 +2,14 @@
-
+
-
+
-
+
-
-
+
+
diff --git a/src/api/nutrition.js b/src/api/nutrition.js
index 43e4257..7aece7c 100644
--- a/src/api/nutrition.js
+++ b/src/api/nutrition.js
@@ -65,4 +65,15 @@ export const repurchase = (data) => {
method: 'post',
data,
})
+}
+
+/**
+ * 外部就餐情况(合作商家)
+ */
+export const external = (data) => {
+ return service({
+ url: 'hard/panel-nutrition/external',
+ method: 'post',
+ data,
+ })
}
\ No newline at end of file
diff --git a/src/components/nutrition-analyse/index.vue b/src/components/nutrition-analyse/index.vue
index a3124d1..dbd904a 100644
--- a/src/components/nutrition-analyse/index.vue
+++ b/src/components/nutrition-analyse/index.vue
@@ -47,7 +47,7 @@ const tabList = [
{ label: "本月", value: "THIS_MONTH", component: MonthStatistics },
{ label: "本年", value: "THIS_YEAR", component: YearStatistics },
];
-const activeIndex = ref(0);
+const activeIndex = ref(1);
const activeKey = computed(() => tabList[activeIndex.value].value);
const componentData = computed(() => {
if (!props.data) {
diff --git a/src/components/nutrition-external.vue b/src/components/nutrition-external.vue
new file mode 100644
index 0000000..06ecce7
--- /dev/null
+++ b/src/components/nutrition-external.vue
@@ -0,0 +1,327 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/person-abnormal-event-line-chart.vue b/src/components/person-abnormal-event-line-chart.vue
index 3379f2f..a6d0a5b 100644
--- a/src/components/person-abnormal-event-line-chart.vue
+++ b/src/components/person-abnormal-event-line-chart.vue
@@ -53,8 +53,6 @@ watch(
() => props.data,
(val) => {
if (!chartInstance) return;
- // console.log(props.type, "type");
- // console.log(props.data, "data");
if (props.type == "nutrition") {
const { hc, sc, zs } = props.data;
chartInstance.setOption({
@@ -127,6 +125,12 @@ const option = {
bottom: "10%",
containLabel: true,
},
+ dataZoom: [
+ {
+ type: 'inside',
+ throttle: 50
+ }
+ ],
tooltip: {
trigger: "axis",
backgroundColor: "rgba(0, 0, 0, 0.8)",
diff --git a/src/views/canteen.vue b/src/views/canteen.vue
index f9aec44..a32413a 100644
--- a/src/views/canteen.vue
+++ b/src/views/canteen.vue
@@ -183,7 +183,7 @@ onBeforeUnmount(() => {
});
const changeQueryDate = (e) => {
- canteenReportRef.value?.refresh(e)
+ shopReportRef.value?.refresh(e)
}
// 用餐时间段统计
diff --git a/src/views/nutrition.vue b/src/views/nutrition.vue
index e8f1fb2..3d53b1a 100644
--- a/src/views/nutrition.vue
+++ b/src/views/nutrition.vue
@@ -10,8 +10,9 @@
- 今日就餐人数统计
+ 本周外部就餐情况(合作商家)
+
@@ -73,6 +74,7 @@ import AbnormalEventTypeStatus from "@/components/abnormal-event-type-status.vue
import NutritionAnalyse from "@/components/nutrition-analyse/index.vue"
import PersonThroughRank from "@/components/person-through-rank.vue";
import PersonAbnormalEventLineChart from "@/components/person-abnormal-event-line-chart.vue";
+import NutritionExternal from "@/components/nutrition-external.vue"
import NutritionTop from "@/components/nutrition-top.vue"
const { notificationAdd, notificationClear } = useNotification();
@@ -102,7 +104,19 @@ const timerObj = reactive({
labels: null,
},
queryParams: {
- dateRangeType: "YESTERDAY"
+ dateRangeType: "TODAY"
+ },
+ },
+ // 外部就餐情况(合作商家)
+ external: {
+ initial: null,
+ interval: 10 * 1000,
+ data: {
+ data: null,
+ labels: null,
+ },
+ queryParams: {
+ dateRangeType: "THIS_WEEK"
},
},
// 营养分析趋势
@@ -142,6 +156,7 @@ onMounted(() => {
getClassBuyCount()
getCuisineTop()
getNutritionAnalyseTrend()
+ getExternal()
})
onBeforeUnmount(() => {
@@ -196,6 +211,27 @@ const getNutritionAnalyseTrend = () => {
}, timerObj.nutritionAnalyseTrend.interval)
}
+// 外部就餐情况(合作商家)
+const getExternal = () => {
+ timerObj.external.initial = simplePoll(async () => {
+ try {
+ const { code, data } = await nutritionApi.external({ ...timerObj.external.queryParams });
+ if (code != 0) throw new Error("code!=0");
+ console.log("外部就餐情况(合作商家):", data);
+ if (!data) return;
+ timerObj.external.data = data;
+ } catch (error) {
+ console.error("|外部就餐情况(合作商家)|意外的错误:", error);
+ }
+ }, timerObj.external.interval)
+}
+
+const externalChangeDateType = (type) => {
+ console.log("type:", type);
+ timerObj.external.queryParams.dateRangeType = type;
+ timerObj.external.initial.executeOnce(type);
+}
+
// 营养分析
const getNutritionAnalyse = () => {
timerObj.nutritionAnalyse.initial = simplePoll(async () => {
diff --git a/src/views/shop.vue b/src/views/shop.vue
index 4052d43..3975e0e 100644
--- a/src/views/shop.vue
+++ b/src/views/shop.vue
@@ -207,6 +207,10 @@ const getDeviceStatusData = () => {
}, timerObj.deviceTotal.interval);
};
+const changeQueryDate = (e) => {
+ shopReportRef.value?.refresh(e)
+}
+
// 设备在线率趋势 (近7日)
const getDeviceOnlineData = async () => {
timerObj.deviceOfflineRate.initial = simplePoll(async () => {