From 96692819c1aaebdfa66526503d9ab7129462c9d6 Mon Sep 17 00:00:00 2001 From: lihui Date: Wed, 5 Nov 2025 10:24:43 +0800 Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=E6=B1=87=E7=8E=87=E3=80=81?= =?UTF-8?q?=E9=87=91=E5=B8=81=E6=B6=88=E8=80=97=E3=80=81=E9=87=91=E5=B8=81?= =?UTF-8?q?=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/consume/gold/addCoinConsume.vue | 13 +++++++++++++ src/views/consume/gold/coinConsume.vue | 4 ++-- src/views/consume/gold/coinConsumeDetail.vue | 16 ++++++++++++++++ src/views/managerecharge/rate.vue | 4 ++-- src/views/recharge/gold/coinRecharge.vue | 4 ++-- 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/views/consume/gold/addCoinConsume.vue b/src/views/consume/gold/addCoinConsume.vue index 4ff8467..e299370 100644 --- a/src/views/consume/gold/addCoinConsume.vue +++ b/src/views/consume/gold/addCoinConsume.vue @@ -8,6 +8,7 @@ import { useAdminStore } from "@/store/index.js"; import { storeToRefs } from "pinia"; import { WarnTriangleFilled } from "@element-plus/icons-vue"; import dayjs from "dayjs"; +import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js"; const adminStore = useAdminStore(); const { adminData, menuTree } = storeToRefs(adminStore); @@ -213,8 +214,20 @@ const WriteCookiesTime = ref(null) const ReadCookies = ref(null) // 用来读的 cookie 的 value const ReadCookiesTime = ref(null) + +const addCoinConsumePermission = ref(false) // 新增金币消耗的权限状态 +// 初始化权限状态 +const initPermissions = async() => { + if (!menuTree.value || !menuTree.value.length) return; + addCoinConsumePermission.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_coin_consumption); + +}; // 这是添加消费信息的接口 const add = async function () { + if (!addCoinConsumePermission) { + ElMessage.error('暂无权限') + return + } try { // 验证输入数据 再验证一次 if (!validateInput()) { diff --git a/src/views/consume/gold/coinConsume.vue b/src/views/consume/gold/coinConsume.vue index dbbaa24..7187be0 100644 --- a/src/views/consume/gold/coinConsume.vue +++ b/src/views/consume/gold/coinConsume.vue @@ -52,8 +52,8 @@ const navigateTo = (name) => { // 初始化权限状态 const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return; - hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.addCoinConsume); - hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.coinConsumeDetail); + hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_coin_consumption); + hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_consumption_details); }; // 默认跳转逻辑 diff --git a/src/views/consume/gold/coinConsumeDetail.vue b/src/views/consume/gold/coinConsumeDetail.vue index d8f01c5..46c33d5 100644 --- a/src/views/consume/gold/coinConsumeDetail.vue +++ b/src/views/consume/gold/coinConsumeDetail.vue @@ -5,6 +5,7 @@ import request from '@/util/http.js' import API from '@/util/http.js' import moment from 'moment' import { reverseMarketMapping } from "@/utils/marketMap.js"; +import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js"; // 之后整理一下 /* @@ -141,6 +142,15 @@ const totalGoldSearch = ref({ goodsName: "" }) +const selectPermission = ref(false) +// 初始化权限状态 +const initPermissions = async() => { + if (!menuTree.value || !menuTree.value.length) return; + selectPermission.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_consumption_details); + + +}; + /* ====================方法================================= */ @@ -161,6 +171,12 @@ const getAdminData = async function () { const ConsumeSelectBy = async function (val) { + + if (!hasrechargeWaitShow) { + ElMessage.error('暂无权限') + return + } + try { // 搜索参数页码赋值 diff --git a/src/views/managerecharge/rate.vue b/src/views/managerecharge/rate.vue index 4592318..0ddc64e 100644 --- a/src/views/managerecharge/rate.vue +++ b/src/views/managerecharge/rate.vue @@ -128,8 +128,8 @@ const hasrateEdit = ref(false) // 初始化权限状态 const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return; - hasrateShow.value = hasMenuPermission(menuTree.value, permissionMapping.rateShow); - hasrateEdit.value = hasMenuPermission(menuTree.value, permissionMapping.rateEdit); + hasrateShow.value = hasMenuPermission(menuTree.value, permissionMapping.view_exchange_rate); + hasrateEdit.value = hasMenuPermission(menuTree.value, permissionMapping.edit_exchange_rate); }; // 编辑汇率 diff --git a/src/views/recharge/gold/coinRecharge.vue b/src/views/recharge/gold/coinRecharge.vue index 1ae1f26..b51a8d2 100644 --- a/src/views/recharge/gold/coinRecharge.vue +++ b/src/views/recharge/gold/coinRecharge.vue @@ -45,8 +45,8 @@ const navigateTo = (name) => { const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return; - hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.addCoinRecharge); - hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.coinRechargeDetail); + hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_coin_recharge); + hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_recharge_details); }; // 默认跳转逻辑