| | |
| | | <script setup lang="ts"> |
| | | import { computed, reactive, watch } from 'vue'; |
| | | import * as baseModuleServices from '@/services/api/BaseModule'; |
| | | import * as baseModuleNewServices from '@/services/api/BaseModuleNew'; |
| | | import { Message } from '@bole-core/core'; |
| | | import { AuthorizeType, SubModuleType, SubModuleTitle } from '@/constants'; |
| | | import { |
| | | AuthorizeType, |
| | | SubModuleType, |
| | | SubModuleTitle, |
| | | EnumMenuSceneText, |
| | | EnumMenuScene, |
| | | } from '@/constants'; |
| | | import { getTree } from '@/utils'; |
| | | import { templateRef } from '@vueuse/core'; |
| | | import { PropType } from 'vue'; |
| | | |
| | | const TypeTip = defineComponent({ |
| | | name: 'TypeTip', |
| | |
| | | render() { |
| | | const { typeTip, isMenu } = this; |
| | | const tipText = isMenu ? `菜单` : '页面'; |
| | | console.log(typeTip); |
| | | return h( |
| | | 'span', |
| | | { |
| | |
| | | authorizeType: { |
| | | type: String, |
| | | default: 'Role', |
| | | }, |
| | | menuScene: { |
| | | type: Number as PropType<EnumMenuScene>, |
| | | default: EnumMenuScene.Back, |
| | | }, |
| | | }); |
| | | const emit = defineEmits<{ |
| | |
| | | async function getModulesByUserOrRoleId(id) { |
| | | const { authorizeType } = props; |
| | | |
| | | const data = { |
| | | const data: API.APIgetUserOrRoleModuleListParams = { |
| | | objectType: AuthorizeType[authorizeType], |
| | | id, |
| | | menuScene: props.menuScene, |
| | | }; |
| | | |
| | | const result = await baseModuleServices.getUserOrRoleModuleList(data); |
| | | const result = await baseModuleNewServices.getUserOrRoleModuleList(data); |
| | | |
| | | state.sysModules = getTree(result, null); |
| | | elModuleTree.value.setCheckedKeys(result.filter((x) => x.hasCheck).map((x) => x.id)); |