feat: 总览数据联调
This commit is contained in:
@@ -35,9 +35,6 @@
|
||||
<span>{{ appStore.roleLabel }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-select v-model="role" class="role-select" size="small" @change="handleRoleChange">
|
||||
<el-option v-for="item in roleOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -89,19 +86,13 @@
|
||||
import { computed, ref } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ArrowDown, Bell, Fold, Moon, QuestionFilled, Search, Sunny } from '@element-plus/icons-vue'
|
||||
import { roleOptions } from '@/mock/dashboard'
|
||||
import { getFirstPage, getPagePath, pageTitles, roleMenus } from '@/mock/navigation'
|
||||
import { getPagePath, pageTitles, roleMenus } from '@/mock/navigation'
|
||||
import { useAppStore } from '@/stores/app'
|
||||
import type { RoleKey } from '@/types'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const appStore = useAppStore()
|
||||
const keyword = ref('')
|
||||
const role = computed({
|
||||
get: () => appStore.user.role,
|
||||
set: value => appStore.switchRole(value)
|
||||
})
|
||||
|
||||
const visibleSections = computed(() => roleMenus[appStore.user.role])
|
||||
const pageTitle = computed(() => {
|
||||
@@ -112,11 +103,6 @@ const pageTitle = computed(() => {
|
||||
return String(route.meta.title || '数据驾驶舱')
|
||||
})
|
||||
|
||||
function handleRoleChange(value: RoleKey) {
|
||||
appStore.switchRole(value)
|
||||
router.push(getPagePath(getFirstPage(value)))
|
||||
}
|
||||
|
||||
function handleCommand(command: string) {
|
||||
if (command === 'logout') {
|
||||
appStore.logout()
|
||||
|
||||
Reference in New Issue
Block a user