diff --git a/src/views/admin/system/user/form.vue b/src/views/admin/system/user/form.vue index e25012a..26f638a 100644 --- a/src/views/admin/system/user/form.vue +++ b/src/views/admin/system/user/form.vue @@ -42,7 +42,7 @@ - + { dataForm.password = "******" } - // 加载使用的数据 - getDeptData() + // 新增时加载部门树数据,修改时不加载 + !id ? getDeptData() : "" getPostData() getRoleData() } diff --git a/src/views/canteenDailyDishes/index.vue b/src/views/canteenDailyDishes/index.vue index 07a86aa..e623eca 100644 --- a/src/views/canteenDailyDishes/index.vue +++ b/src/views/canteenDailyDishes/index.vue @@ -25,17 +25,17 @@
-
+
-

今日菜品

+

今日午餐菜品

{{ currentDate }} {{ currentTime }}
-
+
@@ -43,7 +43,7 @@ @@ -71,7 +71,7 @@
@@ -104,7 +104,7 @@
-
+
@@ -114,7 +114,7 @@
@@ -147,7 +147,7 @@
-
+
@@ -157,9 +157,9 @@
-
+
智慧食堂 -
+
@@ -172,10 +172,8 @@ import dayjs from "dayjs" import { ElTooltip } from "element-plus" import { selectTimeFoodApi } from "/@/api/canteen/canteenDailyMenu" import { getAllSimple as getCanteenCategory } from "/@/api/canteen/canteenCategory" -import { useDict } from "/@/hooks/dict" import { displayPrice } from "/@/utils/formatMoney" -const { daily_menu } = useDict("daily_menu") const containerRef = ref(null) const currentDate = ref(dayjs().format("YYYY年MM月DD日")) const currentTime = ref(dayjs().format("HH:mm:ss")) @@ -210,23 +208,22 @@ const foodData = reactive<{ dinner: [], }) -// 根据时段获取菜品 +// 根据日期和时段获取菜品 const getDishByType = async () => { const result = await selectTimeFoodApi({ time: dayjs().format("YYYY-MM-DD"), // time: "2025-03-14", // time: "2025-02-07", merchantId: "1887400193644199937", - // hourType: 2, }) - if (result.code === 0) { + if (result.code == 0) { result.data.forEach((r: any) => { switch (r.hourType) { case 1: // foodData.breakfast = r.dailyMenuVOS break case 2: - foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 13) + foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 12) break case 3: // foodData.dinner = r.dailyMenuVOS @@ -464,7 +461,7 @@ const gridStyle = computed(() => { } }) -// 添加一个简单的防抖函数 +// 防抖函数 function debounce(fn: Function, delay: number) { let timer: number | null = null return function (this: any, ...args: any[]) { @@ -478,16 +475,16 @@ function debounce(fn: Function, delay: number) {