diff --git a/src/views/permissions/rolePermission.vue b/src/views/permissions/rolePermission.vue index 341a6b0..5468bd2 100644 --- a/src/views/permissions/rolePermission.vue +++ b/src/views/permissions/rolePermission.vue @@ -10,7 +10,7 @@ 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) const roleData = ref([]) @@ -36,7 +36,7 @@ const addRole = ref({ market: '' }) const addRoleMarket = ref([]) -const channelList = ref(['美股', '港股', 'hc第一频道']) +const channelList = ref(['全部']) const getRoleList = async function (val) { if (!findMenuById(menuTree.value, permissionMapping.view_role_information)) { ElMessage.error('无此权限') @@ -275,6 +275,23 @@ const getLists = async function () { } } +//获取频道列表 +const getChannelList = async () => { + try { + const res = await API({ + url: '/role/getChannel', + }) + console.log('res', res); + if (res.code == 200) { + channelList.value = [...channelList.value, ...res.data] + } else { + console.log('获取频道列表', res.msg); + } + } catch (err) { + console.log('获取频道列表出错', err); + } +} + //金豆过滤 const goldenBeanMenuIds = new Set([ permissionMapping.gold_bean_audit, @@ -411,7 +428,8 @@ const permissionEditRoleObj = ref({ market: '', parentId: null, parentName: '', - checkedKeys: [] + checkedKeys: [], + channel:'' }) // 编辑角色弹窗 @@ -458,6 +476,8 @@ const permissionEditRoleInit = async function (row) { permissionEditRoleObj.value.parentId = row.fatherId permissionEditRoleObj.value.parentName = row.fatherName permissionEditRoleObj.value.channel = row.channel + console.log('permissionEditRoleObj.value',permissionEditRoleObj.value); + if (EditIds.includes(124)) { ifHasChannel.value = true } else { @@ -533,11 +553,8 @@ const permissionEditRole = async function () { const res = await API({ url: '/menu/update', data: { - "id": permissionEditRoleObj.value.id, - "roleName": permissionEditRoleObj.value.roleName, - "menuIds": finalCheckedKeys, - "fatherId": permissionEditRoleObj.value.parentId, - "market": permissionEditRoleObj.value.market + ...permissionEditRoleObj.value, + menuIds: finalCheckedKeys } }); if (res.code === 200) { @@ -617,6 +634,7 @@ const canEdit = findMenuById(menuTree.value, permissionMapping.edit_role_informa onMounted(async function () { await getRoleList() await getRoleArea() + await getChannelList() }) @@ -725,7 +743,7 @@ onMounted(async function () { - +