From f93d46bed6b339ef01b351345581f54c3079f33b Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期五, 08 八月 2025 17:00:05 +0800
Subject: [PATCH] 添加获取/修改菜单列表函数
---
utils/menuListApp.js | 93 +++++++++++++++++++++++++++++++++-------------
1 files changed, 67 insertions(+), 26 deletions(-)
diff --git a/utils/menuListApp.js b/utils/menuListApp.js
index f509c61..00e8f97 100644
--- a/utils/menuListApp.js
+++ b/utils/menuListApp.js
@@ -1,39 +1,80 @@
-import { getUserInfo } from "./auth";
-import { CommonUtils } from "./common";
+import {
+ getUserInfo
+} from "./auth";
+import {
+ CommonUtils
+} from "./common";
-export function getMenuList({ user = getUserInfo()['Czymc'], menuName }) {
+export function getMenuList({
+ user = getUserInfo()['Czymc'],
+ menuName,
+ HType = "APP"
+}) {
CommonUtils.doRequest2({
url: '',
data: {
HMakeName: user,
menuName,
+ HType
},
(res) => {
- let {data, count, Message} = res.data;
- if(count == 1) {
-
- }else {
-
+ let {
+ data,
+ count,
+ Message
+ } = res.data;
+ if (count == 1) {
+ uni.showToast({
+ icon: 'none',
+ Message: Message
+ })
+ return data;
+ } else {
+ uni.showToast({
+ icon: 'none',
+ Message: Message
+ })
+ return;
}
}
})()
}
-export function setMenuList({user = getUserInfo()['Czymc'], menuName, payload}) {
- CommonUtils.doRequest2({
- url: '',
- data: {
- user,
- menuName,
- payload,
- },
- (res) => {
- let {data, count, Message} = res.data;
- if(count == 1) {
-
- }else {
-
- }
- }
- })()
-}
\ No newline at end of file
+export function setMenuList({
+ user = getUserInfo()['Czymc'],
+ menuName,
+ type = "APP",
+ payload
+}) {
+ let oMainSub = []
+ Array.from(payload).forEach((one, index) => {
+ if (one.hidden == true) {
+ oMainSub.push({
+ HEntryID: one.id,
+ HIndex: index
+ HMenuName: one.text
+ HPicNum: one.img
+ HShowMode: !one.hidden
+ })
+ })
+ // string oMain =
+ CommonUtils.doRequest2({
+ url: '/Web/SetMenuList_APP',
+ data: {
+ oMain: oMain
+ },
+ resFunction: (res) => {
+ let {
+ data,
+ count,
+ Message
+ } = res.data;
+ if (count == 1) {
+
+ } else {
+
+ }
+ },
+ method: 'POST'
+ })()
+ }
\ No newline at end of file
--
Gitblit v1.9.1