| | |
| | | |
| | | <script setup lang="ts"> |
| | | import { computed, reactive, watch } from 'vue'; |
| | | import * as baseModuleServices from '@/services/api/BaseModule'; |
| | | import { Message } from '@bole-core/core'; |
| | | import { AuthorizeType, SubModuleType, SubModuleTitle } from '@/constants'; |
| | | import { getTree } from '@/utils'; |
| | |
| | | render() { |
| | | const { typeTip, isMenu } = this; |
| | | const tipText = isMenu ? `菜单` : '页面'; |
| | | console.log(typeTip); |
| | | return h( |
| | | 'span', |
| | | { |
| | |
| | | }), |
| | | }; |
| | | |
| | | const result = await baseModuleServices.addAuthorizeModule(data); |
| | | if (result) { |
| | | Message.successMessage('授权成功!'); |
| | | } else { |
| | | Message.errorMessage('授权失败!'); |
| | | } |
| | | // const result = await baseModuleServices.addAuthorizeModule(data); |
| | | // if (result) { |
| | | // Message.successMessage('授权成功!'); |
| | | // } else { |
| | | // Message.errorMessage('授权失败!'); |
| | | // } |
| | | handleClose(); |
| | | } catch (error) {} |
| | | } |
| | |
| | | id, |
| | | }; |
| | | |
| | | const result = await baseModuleServices.getUserOrRoleModuleList(data); |
| | | // const result = await baseModuleServices.getUserOrRoleModuleList(data); |
| | | |
| | | state.sysModules = getTree(result, null); |
| | | elModuleTree.value.setCheckedKeys(result.filter((x) => x.hasCheck).map((x) => x.id)); |
| | | // state.sysModules = getTree(result, null); |
| | | // elModuleTree.value.setCheckedKeys(result.filter((x) => x.hasCheck).map((x) => x.id)); |
| | | |
| | | initAuthorizeInfo(result, 1); |
| | | // initAuthorizeInfo(result, 1); |
| | | |
| | | getExtendsByRoleOrUser(data); |
| | | } |
| | |
| | | |
| | | async function getExtendsByRoleOrUser(data) { |
| | | try { |
| | | let result = await baseModuleServices.getUserOrRoleSubModuleList(data); |
| | | const { pageButton, dataButton, column } = result; |
| | | initAuthorizeInfo(pageButton, 2, 'pageButton'); |
| | | initAuthorizeInfo(dataButton, 3, 'dataButton'); |
| | | initAuthorizeInfo(column, 4, 'dataColumn'); |
| | | // let result = await baseModuleServices.getUserOrRoleSubModuleList(data); |
| | | // const { pageButton, dataButton, column } = result; |
| | | // initAuthorizeInfo(pageButton, 2, 'pageButton'); |
| | | // initAuthorizeInfo(dataButton, 3, 'dataButton'); |
| | | // initAuthorizeInfo(column, 4, 'dataColumn'); |
| | | } catch (error) { |
| | | console.log(error); |
| | | } |