diff --git a/src/views/history/history.vue b/src/views/history/history.vue index 291f562..6e5524f 100644 --- a/src/views/history/history.vue +++ b/src/views/history/history.vue @@ -28,8 +28,8 @@ const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return - hasNew.value = hasMenuPermission(menuTree.value, permissionMapping.newCoinSelect) - hasOld.value = hasMenuPermission(menuTree.value, permissionMapping.oldCoinSelect) + hasNew.value = hasMenuPermission(menuTree.value, permissionMapping.new_version_gold_query) + hasOld.value = hasMenuPermission(menuTree.value, permissionMapping.old_version_gold_query) } // 默认跳转逻辑 diff --git a/src/views/history/newHistory.vue b/src/views/history/newHistory.vue index a592369..364fc75 100644 --- a/src/views/history/newHistory.vue +++ b/src/views/history/newHistory.vue @@ -51,11 +51,12 @@ import dayjs from 'dayjs' const adminStore = useAdminStore() const { adminData, menuTree } = storeToRefs(adminStore) import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" + const defaultTime = [ new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59), ] - +const canLook = ref(hasMenuPermission(menuTree.value, permissionMapping.new_version_gold_query)) const tableData = ref([]) const dateRange = ref([]) const searchObj = ref({ @@ -69,6 +70,10 @@ const pagination = ref({ }) //获取新表数据 const get = async function () { + if(!canLook.value){ + ElMessage.error('无此权限') + return + } try { if (searchObj.value.name || searchObj.value.jwcode) { const startTime = dateRange.value && dateRange.value[0] ? moment(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "" diff --git a/src/views/history/oldHistory.vue b/src/views/history/oldHistory.vue index a0e0114..85477a6 100644 --- a/src/views/history/oldHistory.vue +++ b/src/views/history/oldHistory.vue @@ -52,7 +52,7 @@ const defaultTime = [ new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59), ] - +const canLook = ref(hasMenuPermission(menuTree.value, permissionMapping.old_version_gold_query)) const tableData = ref([]) const dateRange = ref([]) const searchObj = ref({ @@ -67,6 +67,10 @@ const pagination = ref({ //获取旧表数据 const getOld = async function () { + if(!canLook.value){ + ElMessage.error('无此权限') + return + } try { if (searchObj.value.name || searchObj.value.jwcode) { const startTime = dateRange.value && dateRange.value[0] ? moment(dateRange.value[0]).format('YYYY-MM-DD HH:mm:ss') : "" diff --git a/src/views/refund/gold/addCoinRefund.vue b/src/views/refund/gold/addCoinRefund.vue index 28806fb..574b6eb 100644 --- a/src/views/refund/gold/addCoinRefund.vue +++ b/src/views/refund/gold/addCoinRefund.vue @@ -112,7 +112,7 @@ const getRefund = async function () { // 这是添加退款信息的接口 const add = async function () { // 检查是否有添加权限 - if (!findMenuById(menuTree.value, permissionMapping.add_gold_coin_refund)) { + if (!canAdd.value) { ElMessage.error('无此权限') return } @@ -413,7 +413,7 @@ const calculatedRechargeGoods = computed(() => { const taskGold = addRefund.value.taskGold === '' ? 0 : +addRefund.value.taskGold; return Number((permanentGold + freeGold + taskGold).toFixed(2)); }) -const canAdd = findMenuById(menuTree.value,permissionMapping.addCoinRefund) +const canAdd = findMenuById(menuTree.value,permissionMapping.add_gold_coin_refund) watch(calculatedRechargeGoods, (newVal) => { addRefund.value.sumGold = newVal }) diff --git a/src/views/refund/gold/coinRefundDetail.vue b/src/views/refund/gold/coinRefundDetail.vue index 156241d..c510bda 100644 --- a/src/views/refund/gold/coinRefundDetail.vue +++ b/src/views/refund/gold/coinRefundDetail.vue @@ -114,7 +114,7 @@ const getRefundTypes = async function () { // 搜索============================================================== // 搜索方法 const getSelectBy = async function (val) { - if (!findMenuById(menuTree.value, permissionMapping.gold_coin_refund_details)) { + if (!canLook.value) { ElMessage.error('无此权限') return } diff --git a/src/views/usergold/bean/userbean.vue b/src/views/usergold/bean/userbean.vue index b320edf..d33c9c9 100644 --- a/src/views/usergold/bean/userbean.vue +++ b/src/views/usergold/bean/userbean.vue @@ -57,6 +57,7 @@ const { adminData, menuTree } = storeToRefs(adminStore); import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" import { ElMessage } from 'element-plus'; +const canLook = ref(findMenuById(menuTree.value, permissionMapping.gold_bean_customer_details)) const tableData = ref([]) const marketOptions = ref([]) const searchObj = ref({ @@ -78,6 +79,10 @@ const pagination = ref({ }) const get = async function () { try { + if(!canLook.value){ + ElMessage.error('无此权限') + return + } trim() if (searchObj.value.jwcode) { const numRef = /^\d{1,9}$/; diff --git a/src/views/usergold/gold/clientCount.vue b/src/views/usergold/gold/clientCount.vue index 6c8fa56..63d57a5 100644 --- a/src/views/usergold/gold/clientCount.vue +++ b/src/views/usergold/gold/clientCount.vue @@ -54,8 +54,8 @@ const navigateTo = (name) => { const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return; - hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.coinCustomerDetail); - hasBalance.value = hasMenuPermission(menuTree.value, permissionMapping.coinCustomerMoney); + hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_customer_bill); + hasBalance.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_customer_balance); }; // 默认跳转逻辑 diff --git a/src/views/usergold/gold/clientCountBalance.vue b/src/views/usergold/gold/clientCountBalance.vue index c55ca07..b7951da 100644 --- a/src/views/usergold/gold/clientCountBalance.vue +++ b/src/views/usergold/gold/clientCountBalance.vue @@ -65,7 +65,7 @@ const sortOrder = ref('') // 搜索=========================================================================== // 搜索方法 const get = async function (val) { - if (!findMenuById(menuTree.value, permissionMapping.coinCustomerMoney)) { + if (!findMenuById(menuTree.value, permissionMapping.gold_coin_customer_balance)) { ElMessage.error('无此权限') return } diff --git a/src/views/usergold/gold/clientCountDetail.vue b/src/views/usergold/gold/clientCountDetail.vue index e9f5d5a..1e7ab1c 100644 --- a/src/views/usergold/gold/clientCountDetail.vue +++ b/src/views/usergold/gold/clientCountDetail.vue @@ -120,7 +120,7 @@ const getObj = ref({ // 搜索=========================================================================== // 搜索方法 const get = async function (val) { - if (!findMenuById(menuTree.value, permissionMapping.coinCustomerDetail)) { + if (!findMenuById(menuTree.value, permissionMapping.gold_coin_customer_bill)) { ElMessage.error('无此权限') return }