-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from little3201/develop
1. 抽取国际化配置为组件、补充国际化内容;2. 路由动态加载;3.图标更换为mdi; 4. dark模式背景设置
- Loading branch information
Showing
44 changed files
with
1,572 additions
and
615 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { api } from 'boot/axios' | ||
|
||
export const retrievePrivilegeTree = (username: string) => { | ||
return api.get(`/privileges/${username}/tree`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
<template> | ||
<q-item v-ripple exact :to="link"> | ||
<q-item clickable v-ripple exact :to="pathResolve(parentPath, path)"> | ||
<q-item-section v-if="icon" avatar> | ||
<q-icon :name="icon" /> | ||
</q-item-section> | ||
|
||
<q-item-section> | ||
<q-item-label>{{ $t(title) }}</q-item-label> | ||
<q-item-label>{{ $t(name) }}</q-item-label> | ||
</q-item-section> | ||
</q-item> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
export interface EssentialLinkProps { | ||
title: string; | ||
link?: string; | ||
icon?: string; | ||
} | ||
withDefaults(defineProps<EssentialLinkProps>(), { | ||
title: '', | ||
link: '#', | ||
icon: '' | ||
import { pathResolve } from 'src/utils' | ||
withDefaults(defineProps<{ | ||
name: string | ||
path: string | ||
icon: string | ||
parentPath?: string | ||
}>(), { | ||
name: '', | ||
path: '#', | ||
icon: '', | ||
parentPath: '' | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<template v-for="link in essentialLinks" :key="link.name"> | ||
<q-expansion-item v-if="link.children" :icon="link.icon" :label="$t(link.name)"> | ||
<q-card> | ||
<q-card-section> | ||
<!-- children --> | ||
<EssentialList :essentialLinks="link.children" :parent-path="pathResolve(parentPath, link.path)" /> | ||
</q-card-section> | ||
</q-card> | ||
</q-expansion-item> | ||
<!-- single item --> | ||
<EssentialLink v-else v-bind="{ ...link, parentPath }" /> | ||
</template> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import EssentialLink from 'components/EssentialLink.vue' | ||
import type { PrivilegeTreeNode } from 'src/models' | ||
import { pathResolve } from 'src/utils' | ||
withDefaults(defineProps<{ | ||
essentialLinks: PrivilegeTreeNode[] | ||
parentPath?: string | ||
}>(), { | ||
parentPath: '' | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template> | ||
<q-btn title="language" icon="mdi-translate" round flat dense> | ||
<q-menu> | ||
<q-list dense separator> | ||
<q-item clickable v-close-popup v-for="option in localeOptions" :key="option.value" | ||
:active="locale === option.value" @click="changeLocale(option.value)"> | ||
<q-item-section>{{ option.label }}</q-item-section> | ||
</q-item> | ||
</q-list> | ||
</q-menu> | ||
</q-btn> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n' | ||
import { localeOptions } from 'src/i18n' | ||
import { useLocaleStore } from 'stores/locale-store' | ||
const { locale } = useI18n({ useScope: 'global' }) | ||
const localeStore = useLocaleStore() | ||
function changeLocale(lang: string = 'en-US') { | ||
locale.value = lang | ||
localeStore.changeLang(lang) | ||
changeHtmlLang(lang) | ||
} | ||
function changeHtmlLang(lang: string) { | ||
const htmlElement = document.querySelector('html') | ||
if (htmlElement) { | ||
htmlElement.setAttribute('lang', lang) | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<q-toggle size="sm" v-model="$q.dark.isActive" icon="mdi-weather-night" unchecked-icon="mdi-white-balance-sunny" | ||
:color="$q.dark.isActive ? 'black' : ''" @update:model-value="handleChange" /> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { useQuasar } from 'quasar' | ||
const $q = useQuasar() | ||
function handleChange(value: boolean) { | ||
$q.dark.set(value) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.