fix: warn
							parent
							
								
									ae3079b418
								
							
						
					
					
						commit
						c9ad9cfc5b
					
				|  | @ -13,26 +13,18 @@ import { useGo } from '@/hooks/web/usePage' | |||
| import { useMenuSetting } from '@/hooks/setting/useMenuSetting' | ||||
| import { useDesign } from '@/hooks/web/useDesign' | ||||
| import { PageEnum } from '@/enums/pageEnum' | ||||
| import { useUserStore } from '@/store/modules/user' | ||||
| 
 | ||||
| const props = defineProps({ | ||||
|   /** | ||||
|    * The theme of the current parent component | ||||
|    */ | ||||
|   // 当前父组件的主题 | ||||
|   theme: { type: String, validator: (v: string) => ['light', 'dark'].includes(v) }, | ||||
|   /** | ||||
|    * Whether to show title | ||||
|    */ | ||||
|   // 是否显示标题 | ||||
|   showTitle: { type: Boolean, default: true }, | ||||
|   /** | ||||
|    * The title is also displayed when the menu is collapsed | ||||
|    */ | ||||
|   // 折叠菜单时也会显示标题 | ||||
|   alwaysShowTitle: { type: Boolean } | ||||
| }) | ||||
| 
 | ||||
| const { prefixCls } = useDesign('app-logo') | ||||
| const { getCollapsedShowTitle } = useMenuSetting() | ||||
| const userStore = useUserStore() | ||||
| const { title } = useGlobSetting() | ||||
| const go = useGo() | ||||
| 
 | ||||
|  | @ -46,7 +38,7 @@ const getTitleClass = computed(() => [ | |||
| ]) | ||||
| 
 | ||||
| function goHome() { | ||||
|   go(userStore.getUserInfo.homePath || PageEnum.BASE_HOME) | ||||
|   go(PageEnum.BASE_HOME) | ||||
| } | ||||
| </script> | ||||
| <style lang="less" scoped> | ||||
|  |  | |||
|  | @ -54,7 +54,6 @@ const getOptions = computed((): OptionsItem[] => { | |||
| 
 | ||||
| function handleClick(args) { | ||||
|   emitData.value = args | ||||
|   console.info(emitData.value) | ||||
|   emits('change', emitData.value) | ||||
| } | ||||
| </script> | ||||
|  |  | |||
|  | @ -4,11 +4,9 @@ | |||
|   </MenuItem> | ||||
| </template> | ||||
| <script lang="ts" setup name="BasicMenuItem"> | ||||
| import { Menu } from 'ant-design-vue' | ||||
| import { MenuItem } from 'ant-design-vue' | ||||
| import { itemProps } from '../props' | ||||
| import MenuItemContent from './MenuItemContent.vue' | ||||
| 
 | ||||
| const MenuItem = Menu.Item | ||||
| 
 | ||||
| defineProps(itemProps) | ||||
| </script> | ||||
|  |  | |||
|  | @ -12,6 +12,7 @@ import { useMenuSetting } from '@/hooks/setting/useMenuSetting' | |||
| 
 | ||||
| export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' | 'default' = 'default') { | ||||
|   const { getDarkMode: getSysDarkMode } = useRootSetting() | ||||
| 
 | ||||
|   const { getCollapsed } = useMenuSetting() | ||||
| 
 | ||||
|   const getDarkMode = computed(() => { | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ export function useLockPage() { | |||
| 
 | ||||
|   function resetCalcLockTimeout(): void { | ||||
|     // not login
 | ||||
|     if (!userStore.getToken) { | ||||
|     if (!userStore.getAccessToken) { | ||||
|       clear() | ||||
|       return | ||||
|     } | ||||
|  | @ -45,7 +45,7 @@ export function useLockPage() { | |||
|   } | ||||
| 
 | ||||
|   watchEffect((onClean) => { | ||||
|     if (userStore.getToken) { | ||||
|     if (userStore.getAccessToken) { | ||||
|       resetCalcLockTimeout() | ||||
|     } else { | ||||
|       clear() | ||||
|  |  | |||
|  | @ -91,7 +91,7 @@ function createSuccessModal(options: ModalOptionsPartial) { | |||
| } | ||||
| 
 | ||||
| function createErrorModal(options: ModalOptionsPartial) { | ||||
|   return Modal.error(createModalOptions(options, 'error')) | ||||
|   return Modal.error(createModalOptions(options, 'close')) | ||||
| } | ||||
| 
 | ||||
| function createInfoModal(options: ModalOptionsPartial) { | ||||
|  |  | |||
|  | @ -29,8 +29,7 @@ export function usePermission() { | |||
|    */ | ||||
|   async function togglePermissionMode() { | ||||
|     appStore.setProjectConfig({ | ||||
|       permissionMode: | ||||
|         appStore.projectConfig?.permissionMode === PermissionModeEnum.BACK ? PermissionModeEnum.ROUTE_MAPPING : PermissionModeEnum.BACK | ||||
|       permissionMode: projectSetting.permissionMode === PermissionModeEnum.BACK ? PermissionModeEnum.ROUTE_MAPPING : PermissionModeEnum.BACK | ||||
|     }) | ||||
|     location.reload() | ||||
|   } | ||||
|  |  | |||
|  | @ -24,16 +24,16 @@ import { useI18n } from '@/hooks/web/useI18n' | |||
| import { useDesign } from '@/hooks/web/useDesign' | ||||
| import { BasicModal, useModalInner } from '@/components/Modal' | ||||
| import { BasicForm, useForm } from '@/components/Form' | ||||
| 
 | ||||
| import { useUserStore } from '@/store/modules/user' | ||||
| import { useLockStore } from '@/store/modules/lock' | ||||
| import headerImg from '@/assets/images/header.jpg' | ||||
| 
 | ||||
| const { t } = useI18n() | ||||
| const { prefixCls } = useDesign('header-lock-modal') | ||||
| const userStore = useUserStore() | ||||
| const lockStore = useLockStore() | ||||
| 
 | ||||
| const getRealName = computed(() => userStore.getUserInfo?.realName) | ||||
| const getRealName = computed(() => userStore.getUserInfo?.user.nickname) | ||||
| const [register, { closeModal }] = useModalInner() | ||||
| 
 | ||||
| const [registerForm, { validateFields, resetFields }] = useForm({ | ||||
|  | @ -64,7 +64,7 @@ async function handleLock() { | |||
| } | ||||
| 
 | ||||
| const avatar = computed(() => { | ||||
|   const { avatar } = userStore.getUserInfo | ||||
|   const { avatar } = userStore.getUserInfo.user | ||||
|   return avatar || headerImg | ||||
| }) | ||||
| </script> | ||||
|  |  | |||
|  | @ -130,7 +130,6 @@ export default defineComponent({ | |||
| 
 | ||||
|     function renderMenu() { | ||||
|       const { menus, ...menuProps } = unref(getCommonProps) | ||||
|       // console.log(menus); | ||||
|       if (!menus || !menus.length) return null | ||||
|       return !props.isHorizontal ? ( | ||||
|         <SimpleMenu {...menuProps} isSplitMenu={unref(getSplit)} items={menus} /> | ||||
|  |  | |||
|  | @ -226,7 +226,6 @@ export const usePermissionStore = defineStore('app-permission', { | |||
|           //  Background routing to menu structure
 | ||||
|           //  后台路由到菜单结构
 | ||||
|           const backMenuList = transformRouteToMenu([dashboard, ...routeList]) | ||||
|           console.info(backMenuList) | ||||
|           this.setBackMenuList(backMenuList) | ||||
| 
 | ||||
|           // remove meta.ignoreRoute item
 | ||||
|  |  | |||
|  | @ -128,7 +128,6 @@ export const useUserStore = defineStore('app-user', { | |||
|           router.addRoute(PAGE_NOT_FOUND_ROUTE as unknown as RouteRecordRaw) | ||||
|           permissionStore.setDynamicAddedRoute(true) | ||||
|         } | ||||
|         console.info(router.replace(PageEnum.BASE_HOME)) | ||||
|         goHome && (await router.replace(PageEnum.BASE_HOME)) | ||||
|       } | ||||
|       return userInfo | ||||
|  |  | |||
|  | @ -70,7 +70,7 @@ const transform: AxiosTransform = { | |||
|         successMsg = t('sys.api.operationSuccess') | ||||
|       } | ||||
|       if (isNull(successMsg) || isUnDef(successMsg) || isEmpty(successMsg)) { | ||||
|         successMsg = t(`sys.api.operationSuccess`) | ||||
|         successMsg = t('sys.api.operationSuccess') | ||||
|       } | ||||
|       if (options.successMessageMode === 'modal') { | ||||
|         createSuccessModal({ title: t('sys.api.successTip'), content: successMsg }) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 xingyuv
						xingyuv