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