mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2026-01-02 14:20:21 +08:00
style: lint
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
|
||||
<script setup>
|
||||
import { usePermissionStore } from '@/store'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const permissionStore = usePermissionStore()
|
||||
@@ -43,7 +44,7 @@ watch(
|
||||
(v) => {
|
||||
breadItems.value = findMatchs(permissionStore.permissions, v)
|
||||
},
|
||||
{ immediate: true }
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
function findMatchs(tree, code, parents = []) {
|
||||
@@ -69,8 +70,8 @@ function handleItemClick(item) {
|
||||
|
||||
function getDropOptions(list = []) {
|
||||
return list
|
||||
.filter((item) => item.show)
|
||||
.map((child) => ({
|
||||
.filter(item => item.show)
|
||||
.map(child => ({
|
||||
label: child.name,
|
||||
key: child.code,
|
||||
icon: () => h('i', { class: child.icon }),
|
||||
|
||||
@@ -24,7 +24,9 @@
|
||||
|
||||
<template #footer>
|
||||
<div class="flex">
|
||||
<n-button class="flex-1" size="large" @click="logout()">退出登录</n-button>
|
||||
<n-button class="flex-1" size="large" @click="logout()">
|
||||
退出登录
|
||||
</n-button>
|
||||
<n-button
|
||||
:loading="okLoading"
|
||||
class="ml-20 flex-1"
|
||||
@@ -44,7 +46,7 @@
|
||||
import api from '@/api'
|
||||
import { MeModal } from '@/components'
|
||||
import { useModal } from '@/composables'
|
||||
import { useUserStore, useAuthStore } from '@/store'
|
||||
import { useAuthStore, useUserStore } from '@/store'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const authStore = useAuthStore()
|
||||
@@ -67,7 +69,8 @@ async function setCurrentRole() {
|
||||
okLoading.value = false
|
||||
$message.success('切换成功')
|
||||
modalRef.value?.handleOk()
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
okLoading.value = false
|
||||
return false
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
<script setup>
|
||||
import { useAppStore } from '@/store'
|
||||
|
||||
const title = import.meta.env.VITE_TITLE
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -52,7 +52,8 @@ function handleMenuSelect(key, item) {
|
||||
router.push(item.path)
|
||||
},
|
||||
})
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
router.push(item.path)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useUserStore, useAuthStore, usePermissionStore } from '@/store'
|
||||
import { useAuthStore, usePermissionStore, useUserStore } from '@/store'
|
||||
import { RoleSelect } from '@/layouts/components'
|
||||
import api from '@/api'
|
||||
|
||||
@@ -35,7 +35,7 @@ const options = reactive([
|
||||
label: '个人资料',
|
||||
key: 'profile',
|
||||
icon: () => h('i', { class: 'i-material-symbols:person-outline text-14' }),
|
||||
show: computed(() => permissionStore.accessRoutes?.some((item) => item.path === '/profile')),
|
||||
show: computed(() => permissionStore.accessRoutes?.some(item => item.path === '/profile')),
|
||||
},
|
||||
{
|
||||
label: '切换角色',
|
||||
@@ -71,7 +71,8 @@ function handleSelect(key) {
|
||||
async confirm() {
|
||||
try {
|
||||
await api.logout()
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
authStore.logout()
|
||||
|
||||
@@ -73,8 +73,8 @@ const options = computed(() => [
|
||||
label: '关闭右侧',
|
||||
key: 'close-right',
|
||||
disabled:
|
||||
tabStore.tabs.length <= 1 ||
|
||||
props.currentPath === tabStore.tabs[tabStore.tabs.length - 1].path,
|
||||
tabStore.tabs.length <= 1
|
||||
|| props.currentPath === tabStore.tabs[tabStore.tabs.length - 1].path,
|
||||
icon: () => h('i', { class: 'i-mdi:arrow-expand-right text-14' }),
|
||||
},
|
||||
])
|
||||
|
||||
@@ -49,7 +49,7 @@ const contextMenuOption = reactive({
|
||||
currentPath: '',
|
||||
})
|
||||
|
||||
const handleItemClick = (path) => {
|
||||
function handleItemClick(path) {
|
||||
tabStore.setActiveTab(path)
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user