Prechádzať zdrojové kódy

feat(auth): 调整业务板块显示逻辑

- 修改酒单管理、菜单管理、人员配置的显示条件为12
- 更新设施与服务显示条件为15和17
- 在酒单管理中新增图片保存功能调用
- 优化设施与服务页面的业务板块判断逻辑
spy 2 týždňov pred
rodič
commit
5937350d5d

+ 4 - 4
src/stores/modules/auth.ts

@@ -65,19 +65,19 @@ export const useAuthStore = defineStore({
             switch (menu.meta.title) {
               case "酒单管理":
                 // 为11时显示酒单管理
-                menu.meta.isHide = businessSection !== 11;
+                menu.meta.isHide = businessSection !== 12;
                 break;
               case "菜单管理":
                 // 为11时不显示菜单管理
-                menu.meta.isHide = businessSection === 11;
+                menu.meta.isHide = businessSection === 12;
                 break;
               case "人员配置":
                 // 为11时显示人员配置(即人员管理),否则不显示
-                menu.meta.isHide = businessSection !== 11;
+                menu.meta.isHide = businessSection !== 12;
                 break;
               case "设施与服务":
                 // 为4和7时显示设施与服务,否则不显示
-                menu.meta.isHide = ![4, 7].includes(businessSection);
+                menu.meta.isHide = ![15, 17].includes(businessSection);
                 break;
             }
           }

+ 2 - 2
src/views/storeDecoration/facilitiesAndServices/index.vue

@@ -23,11 +23,11 @@ const activeComponent = computed<"service" | "facility">(() => {
   const businessSection = userInfo.businessSection || "";
 
   // 如果是"运动健身",显示设施管理
-  if (businessSection == "7") {
+  if (businessSection == "17") {
     return "facility";
   }
   // 如果是"洗浴汗蒸",显示服务管理
-  if (businessSection == "4") {
+  if (businessSection == "15") {
     return "service";
   }
   // 默认显示服务管理

+ 21 - 1
src/views/storeDecoration/wineMenuManagement/index.vue

@@ -233,7 +233,8 @@ import {
   deleteBarMenu,
   getDishDetail,
   downloadBarMenuTemplate,
-  importBarMenuExcel
+  importBarMenuExcel,
+  saveOfficialImg
 } from "@/api/modules/storeDecoration";
 
 // 酒单接口
@@ -647,6 +648,25 @@ const handleSubmit = async () => {
     // 新接口需要将参数包装在storeMenu对象中
     const res: any = await saveOrUpdateBarMenu(params);
     if (res && (res.code === 200 || res.code === "200")) {
+      // 调用saveOfficialImg接口保存图片信息
+      if (formData.imgUrl) {
+        try {
+          const saveImgParams = [
+            {
+              imgUrl: formData.imgUrl,
+              imgType: 7, // 参数imageType设置为7
+              businessId: res.data?.id || editId.value, // 使用返回的id或编辑的id作为businessId
+              storeId: Number(storeId),
+              imgSort: 0 // 默认排序
+            }
+          ];
+          await saveOfficialImg(saveImgParams);
+        } catch (error: any) {
+          console.error("保存图片信息失败:", error);
+          // 图片保存失败不影响主流程
+        }
+      }
+
       ElMessage.success(editId.value ? "编辑成功" : "新建成功");
       dialogVisible.value = false;
       resetForm();