From 459190a2186c017f7e95f5d733bda4a0362a54a1 Mon Sep 17 00:00:00 2001 From: ZhangYong Date: Thu, 6 Nov 2025 15:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A2=91=E9=81=93=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/permissions/rolePermission.vue | 36 ++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/views/permissions/rolePermission.vue b/src/views/permissions/rolePermission.vue index d8f34d0..e4a07b9 100644 --- a/src/views/permissions/rolePermission.vue +++ b/src/views/permissions/rolePermission.vue @@ -9,6 +9,7 @@ import { storeToRefs } from "pinia" const adminStore = useAdminStore(); const { adminData, menuTree } = storeToRefs(adminStore); import { permissionMapping, findMenuById } from "@/utils/menuTreePermission.js" +import { tr } from 'element-plus/es/locales.mjs' // 表单验证ref const Ref = ref(null) @@ -35,7 +36,7 @@ const addRole = ref({ market: '' }) const addRoleMarket = ref([]) - +const channelList = ref(['美股', '港股', 'hc第一频道']) const getRoleList = async function (val) { if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) { ElMessage.error('无此权限') @@ -317,6 +318,7 @@ const handleEditRolePermissionCheck = (checkedNodes, checkedInfo) => { // 判断是否有选中的节点 if (allCheckedNodes.length === 0) { permissionEditRoleObj.value.checkedKeys = [] + ifHasChannel.value = false return } @@ -326,13 +328,22 @@ const handleEditRolePermissionCheck = (checkedNodes, checkedInfo) => { console.log('编辑角色选中的权限ID:', checkedKeys) console.log('选中的节点数量:', allCheckedNodes.length) + if (checkedKeys.includes(124)||checkedKeys.includes(125)||checkedKeys.includes(126)||checkedKeys.includes(127)) { + ifHasChannel.value = true + } else { + ifHasChannel.value = false + } }; + +//用于标记是否勾选频道管理 +const ifHasChannel = ref(false) const handleCheckChange = async (checkedNodes, checkedInfo) => { const { checkedKeys, checkedNodes: allCheckedNodes } = checkedInfo // 判断是否有选中的节点 if (allCheckedNodes.length === 0) { addRole.value.checkedKeys = [] + ifHasChannel.value = false return } @@ -348,6 +359,12 @@ const handleCheckChange = async (checkedNodes, checkedInfo) => { // 将Set转换为数组并更新 addRole.value.checkedKeys = Array.from(allKeys) console.log('新增角色包含所有父级的选中项:', addRole.value.checkedKeys) + if (addRole.value.checkedKeys.includes(124)) { + ifHasChannel.value = true + console.log('勾选了频道'); + } else { + ifHasChannel.value = false + } } const selectParentNodes = (treeData, nodeId, checkedKeys) => { if (!Array.isArray(treeData)) return false @@ -636,9 +653,9 @@ onMounted(async function () {
- +
@@ -686,6 +703,11 @@ onMounted(async function () { 暂无数据 + + + + +
@@ -729,6 +751,12 @@ onMounted(async function () { 暂无数据
+ + + + + +