Эх сурвалжийг харах

feat(operationManagement): 添加运营管理模块及菜单配置

- 新增运营管理主菜单,包含活动列表、优惠券模板和发放记录子菜单
- 配置运营管理相关路由及页面组件路径
- 添加运营活动、优惠券模板和发放记录的API接口函数
- 实现活动规则级联选择器选项的临时数据返回
- 设置菜单隐藏、重定向及页面元信息配置
congxuesong 2 долоо хоног өмнө
parent
commit
d879ef7825

+ 114 - 0
src/api/modules/operationManagement.ts

@@ -0,0 +1,114 @@
+import { ResPage, StoreUser } from "@/api/interface/index";
+import { PORT_NONE } from "@/api/config/servicePort";
+import http from "@/api";
+
+/**
+ * 获取优惠券列表
+ * @param params 请求参数
+ * @returns 优惠券列表数据
+ */
+export const getCouponList = params => {
+  return http.post<ResPage<any>>(PORT_NONE + `/couponPlatform/getCouponList`, params);
+};
+
+/**
+ * 获取优惠券模板列表
+ * @param params 请求参数
+ * @returns 优惠券模板列表数据
+ */
+export const getCouponTemplateList = params => {
+  return http.post<ResPage<any>>(PORT_NONE + `/discountCouponPlatform/getCouponTemplateList`, params);
+};
+
+/**
+ * 获取运营活动列表
+ * @param params 请求参数
+ * @returns 运营活动列表数据
+ */
+export const getActivityList = params => {
+  return http.post<ResPage<any>>(PORT_NONE + `/operationalActivity/queryActivityList`, params);
+};
+
+/**
+ * 获取运营活动详情
+ * @param params 请求参数
+ * @returns 运营活动详情数据
+ */
+export const getActivityDetail = params => {
+  return http.get<any>(PORT_NONE + `/operationalActivity/queryActivityById`, params);
+};
+
+/**
+ * 新增运营活动
+ * @param params 请求参数
+ * @returns 新增结果
+ */
+export const addActivity = params => {
+  return http.post<any>(PORT_NONE + `/operationalActivity/create`, params);
+};
+
+/**
+ * 更新运营活动
+ * @param params 请求参数
+ * @returns 更新结果
+ */
+export const updateActivity = params => {
+  return http.post<any>(PORT_NONE + `/operationalActivity/update`, params);
+};
+
+/**
+ * 删除运营活动
+ * @param params 请求参数
+ * @returns 删除结果
+ */
+export const deleteActivity = params => {
+  return http.get<any>(PORT_NONE + `/operationalActivity/delete`, params);
+};
+
+/**
+ * 更新运营活动状态
+ * @param params 请求参数
+ * @returns 更新结果
+ */
+export const updateActivityStatus = params => {
+  return http.get<any>(PORT_NONE + `/operationalActivity/updateStatus`, params);
+};
+
+/**
+ * 获取活动规则级联选择器选项
+ * @param params 请求参数
+ * @returns 级联选择器选项数据
+ */
+export const getActivityRuleOptions = (params?: any) => {
+  // 暂时返回假数据,后续替换为真实 API
+  // 真实 API: return http.get<any>(PORT_NONE + `/store-activity/getActivityRuleOptions`, params);
+  return Promise.resolve({
+    code: 200,
+    data: [
+      {
+        value: "当用户",
+        label: "当用户",
+        children: [
+          {
+            value: "核销并评论",
+            label: "核销并评论",
+            disabled: false,
+            children: [{ value: "优惠券", label: "优惠券", disabled: false }]
+          },
+          {
+            value: "核销",
+            label: "核销",
+            disabled: true,
+            children: [{ value: "红包", label: "红包", disabled: true }]
+          },
+          {
+            value: "打卡",
+            label: "打卡",
+            disabled: true,
+            children: []
+          }
+        ]
+      }
+    ]
+  });
+};

+ 107 - 0
src/assets/json/authMenuList.json

@@ -495,6 +495,113 @@
           }
         }
       ]
+    },
+    {
+      "path": "/operationManagement",
+      "name": "operationManagement",
+      "redirect": "/operationManagement/couponList",
+      "meta": {
+        "icon": "Operation",
+        "title": "运营管理",
+        "isLink": "",
+        "isHide": true,
+        "isFull": false,
+        "isAffix": false,
+        "isKeepAlive": false
+      },
+      "children": [
+        {
+          "path": "/operationManagement/activityList",
+          "name": "operationManagementActivityList",
+          "component": "/operationManagement/activityList",
+          "meta": {
+            "icon": "MessageBox",
+            "title": "运营活动",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          },
+          "children": [
+            {
+              "path": "/operationManagement/newActivity",
+              "name": "operationManagementNewActivity",
+              "component": "/operationManagement/newActivity",
+              "meta": {
+                "icon": "Menu",
+                "title": "新增活动",
+                "activeMenu": "/operationManagement/activityList",
+                "isLink": "",
+                "isHide": true,
+                "isFull": false,
+                "isAffix": false,
+                "isKeepAlive": false
+              }
+            },
+            {
+              "path": "/operationManagement/activityDetail",
+              "name": "operationManagementActivityDetail",
+              "component": "/operationManagement/activityDetail",
+              "meta": {
+                "icon": "Menu",
+                "title": "活动详情",
+                "activeMenu": "/operationManagement/activityList",
+                "isLink": "",
+                "isHide": true,
+                "isFull": false,
+                "isAffix": false,
+                "isKeepAlive": false
+              }
+            }
+          ]
+        },
+        {
+          "path": "/operationManagement/couponTemplate",
+          "name": "operationManagementCouponTemplate",
+          "component": "/operationManagement/couponTemplate",
+          "meta": {
+            "icon": "SetUp",
+            "title": "优惠券模板",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          },
+          "children": [
+            {
+              "path": "/operationManagement/couponTemplate/detail",
+              "name": "operationManagementCouponTemplateDetail",
+              "component": "/operationManagement/couponDetail",
+              "meta": {
+                "icon": "Menu",
+                "title": "优惠券模板详情",
+                "activeMenu": "/operationManagement/couponTemplate",
+                "isLink": "",
+                "isHide": true,
+                "isFull": false,
+                "isAffix": false,
+                "isKeepAlive": false
+              }
+            }
+          ]
+        },
+        {
+          "path": "/operationManagement/couponIssuanceRecords",
+          "name": "operationManagementCouponIssuanceRecords",
+          "component": "/operationManagement/couponIssuanceRecords",
+          "meta": {
+            "icon": "FolderOpened",
+            "title": "优惠券发放记录",
+            "isLink": "",
+            "isHide": false,
+            "isFull": false,
+            "isAffix": false,
+            "isKeepAlive": false
+          }
+        }
+      ]
     }
   ],
   "msg": "成功"