From 436b52186129e60ba72c20e43d2845bc3f899901 Mon Sep 17 00:00:00 2001
From: Ben Lin <maobin001@msn.com>
Date: 星期四, 22 八月 2024 11:16:56 +0800
Subject: [PATCH] 取消暂停svg更新

---
 src/api/sys/menu.ts |   47 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/src/api/sys/menu.ts b/src/api/sys/menu.ts
index 9354907..3d6d3bf 100644
--- a/src/api/sys/menu.ts
+++ b/src/api/sys/menu.ts
@@ -1,6 +1,15 @@
+/*
+ * @Description: 鑿滃崟Api鐩稿叧
+ * @Author: Ben Lin
+ * @version: 
+ * @Date: 2024-06-18 15:09:47
+ * @LastEditors: Ben Lin
+ * @LastEditTime: 2024-06-24 22:50:45
+ */
 import { defHttp } from '/@/utils/http/axios';
 import { getMenuListResultModel } from './model/menuModel';
 import { genAction, Api } from '../tigerapi/system';
+import { useUserStore } from '/@/store/modules/user';
 
 enum _Api {
   GetMenuList = '/SYS/getMenuList',
@@ -29,8 +38,11 @@
   );
 };
 
-// params: string
-// 鑿滃崟鏉冮檺
+/**
+ * @description: 鑿滃崟鏉冮檺
+ * @param {string} params
+ * @return {*}
+ */
 export const getMenuAuthList = async (params: string) => {
   const usParams = genAction('V_USER_MENU', {
     QueryAble_T: '',
@@ -45,3 +57,34 @@
     },
   );
 };
+
+/**
+ * @description: 鑾峰彇鑿滃崟涓嬬殑鎸夐挳
+ * @param {string} params
+ * @return {*}
+ */
+export const getMenuButtons = async (params: string) =>{
+  const usParams = genAction('SYS_MENU', {
+    QueryAble_T: '',
+    where: "PFUNC_CODE = '" + params + "' And BUTTON_TYPE < 3",
+    order: 'SEQ_NO',
+  });
+  return await defHttp.post(
+    { url: Api.QueryUrl, params: usParams },
+    {
+      errorMessageMode: 'none',
+      isTransformResponse: false,
+    },
+  );
+};
+
+/**
+ * @description: 鏍规嵁褰撳墠鑿滃崟浠g爜鑾峰彇鐢ㄦ埛鏈夋潈闄愮殑鎸夐挳鍒楄〃
+ * @param {string} menuCode
+ * @return {*}
+ */
+export async function getRoleButtons(menuCode: string) {
+  const buttons = (await getMenuButtons(menuCode)).Data.Items;
+  const roles = useUserStore().getUserInfo.roles;
+  return buttons.filter((btn) => roles.some((item) => item.MENU_CODE === btn.FUNC_CODE));
+}

--
Gitblit v1.9.3