Skip to content

Commit

Permalink
Merge pull request #202 from little3201/develop
Browse files Browse the repository at this point in the history
添加页面,修改菜单展示
  • Loading branch information
little3201 authored Aug 23, 2024
2 parents 10d3fe7 + 45ae1bb commit 59340b9
Show file tree
Hide file tree
Showing 31 changed files with 985 additions and 141 deletions.
Binary file modified .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion quasar.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ module.exports = configure(function (ctx) {
env: {
API: ctx.dev
? '/api'
: 'https://api.leafage.top/v1'
: 'https://api.leafage.top/v1',
TITLE: ''
},

rawDefine: {
Expand Down
8 changes: 4 additions & 4 deletions src/boot/msw-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { handlers } from 'src/mocks/handlers' // 您的请求处理程序

export default boot(() => {
// dev
// if (process.env.DEV) {
const worker = setupWorker(...handlers)
worker.start()
// }
if (process.env.DEV) {
const worker = setupWorker(...handlers)
worker.start()
}
})
3 changes: 1 addition & 2 deletions src/boot/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ export default boot(({ router, store }) => {
next({ path: '/' })
} else {
// 获取权限,注册路由表
if (to.path !== '/' && !userStore.routes.length) {
if (!to.name || !router.hasRoute(to.name)) {
const routes = generateRoutes(userStore.privileges as PrivilegeTreeNode[])

// 动态添加可访问路由表
userStore.updateRoutes(routes)
routes.forEach((route) => {
router.addRoute(route as RouteRecordRaw)
})
Expand Down
1 change: 0 additions & 1 deletion src/components/EssentialLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<q-item-section v-if="icon" avatar>
<q-icon :name="icon" />
</q-item-section>

<q-item-section>
<q-item-label>{{ $t(name) }}</q-item-label>
</q-item-section>
Expand Down
14 changes: 12 additions & 2 deletions src/components/EssentialList.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<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-expansion-item v-if="Array.isArray(link.children) && isSubMenu(link.children)" :icon="link.icon"
:label="$t(link.name)">
<q-card>
<q-card-section>
<!-- children -->
Expand All @@ -9,7 +10,7 @@
</q-card>
</q-expansion-item>
<!-- single item -->
<EssentialLink v-else v-bind="{ ...link, parentPath }" />
<EssentialLink v-else v-bind="{ name: link.name, icon: link.icon, path: link.path, parentPath }" />
</template>
</template>

Expand All @@ -24,4 +25,13 @@ withDefaults(defineProps<{
}>(), {
parentPath: ''
})
function isSubMenu(children: PrivilegeTreeNode[]) {
for (const child of children) {
if (child.hidden) {
return false
}
}
return true
}
</script>
4 changes: 0 additions & 4 deletions src/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,4 @@

.rounded-full {
border-radius: 50%;
}

.bg-dark-page {
background-color: var(--q-dark-page);
}
56 changes: 40 additions & 16 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is just an example,
// so you can safely delete all default props below
// so you can safely remove all default props below

export default {
search: 'Search...',
Expand All @@ -17,41 +17,60 @@ export default {
superior: 'Superior',
description: 'Description',
lastModifiedDate: 'Last Modified Date',

members: 'Members',
username: 'Username',
password: 'Password',
firstname: 'First Name',
lastname: 'Last Name',
fullname: 'Full Name',
accountLocked: 'Account Locked',
email: 'Email',
accountNonLocked: 'Locked',
accountExpiresAt: 'User Expires At',
credentialsExpiresAt: 'Credentials Expires At',

component: 'Conponent',
order: 'Order',
data: 'Data ',
type: 'Type',
path: 'Path',
icon: 'Icon',
principal: 'Principal',
ip: 'IP',
location: 'Location',

module: 'Module',
method: 'Method',
api: 'API',
params: 'Params',
operator: 'Operator',
operation: 'Operation Time',
operationTime: 'Operation',
Time: 'Time',
status: 'Status',
responseTime: 'Response Time',
responseCode: 'Response Code',
responseMessage: 'Response Message',
resource: 'Resource',
oldValue: 'Old Value',
newValue: 'New Value',
cronExpression: 'Cron Expression',
success: 'Success',
failure: 'Failure',
column: 'Column ',
areaCode: 'Area Code',
postalCode: 'Postal Code',
enabled: 'Enabled',

enabled: 'Is Enabled',
enable: 'Enable',
disable: 'Disable',

actions: 'Actions',
actions: 'Actions ',
import: 'Import',
export: 'Export',
confirm: 'Confirm',
commit: 'Commit',
cancle: 'Cancle',
submit: 'Submit',
cancel: 'Cancel',
add: 'Add',
edit: 'Edit',
delete: 'Delete',
unlock: 'Unlock',
grant: 'Grants',
members: 'memberss',
detail: 'Detail',
remove: 'Remove',
refresh: 'Refresh',
reset: 'Reset',

home: 'Home',
system: 'System',
Expand All @@ -67,6 +86,11 @@ export default {
auditLog: 'Audit Log',
schedulerLog: 'Scheduler Log',

inputText: 'Please input ',
searchText: 'Please select ',
lengthRange: 'The length must between {min} and {max}',
removeConfirm: 'Are you sure to delete this?',

welcome: 'Hi! Welcome Back.',
subtitle: 'Please sign in to continue exploring.',
rememberMe: 'Remember me ?'
Expand Down
52 changes: 39 additions & 13 deletions src/i18n/zh-CN/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is just an example,
// so you can safely delete all default props below
// so you can safely remove all default props below

export default {
search: '搜索...',
Expand All @@ -17,43 +17,64 @@ export default {
superior: '上级',
description: '描述',
lastModifiedDate: '更新时间',

members: '成员',
username: '账号',
password: '密码',
firstname: '姓',
lastname: '名字',
fullname: '姓名',
accountLocked: '账号锁状态',
email: '邮箱',
accountNonLocked: '锁状态',
accountExpiresAt: '账号失效时间',
credentialsExpiresAt: '密码失效时间',

component: '组件',
order: '排序',
data: '数据',
type: '类型',
path: '路径',
icon: '图标',
principal: '负责人',
ip: 'IP',
location: '归属地',

module: '模块',
method: '方法',
api: '接口',
params: '参数',
operator: '操作人',
operation: '操作',
time: '时间',
status: '状态',
operationTime: '操作时间',
responseTime: '响应时间',
responseCode: '响应码',
responseMessage: '响应消息',
resource: '资源',
oldValue: '旧值',
newValue: '新值',
cronExpression: 'Cron表达式',
success: '成功',
failure: '失败',
column: '列',
areaCode: '区号',
postalCode: '邮编',

enabled: '是否启用',

actions: '操作',
import: '导入',
export: '导出',
commit: '提交',
submit: '提交',
confirm: '确定',
cancle: '取消',
cancel: '取消',
add: '添加',
edit: '修改',
delete: '删除',
unlock: '解锁',
grant: '授权',
members: '成员',
detail: '详情',
remove: '删除',
refresh: '刷新',
reset: '重置',

home: '首页',
system: '系统管理',
groups: '分组',
groups: '组织',
roles: '角色',
privileges: '权限',
users: '用户',
Expand All @@ -65,6 +86,11 @@ export default {
auditLog: '审计日志',
schedulerLog: '调度日志',

inputText: '請輸入',
searchText: '請選擇',
lengthRange: '长度在 {min} 到 {max} 个字符',
removeConfirm: '是否确定要删除这条数据?',

welcome: '嗨!欢迎回来',
subtitle: '请填写您的账号和密码,让我们继续探索',
rememberMe: '记住我 ?'
Expand Down
53 changes: 39 additions & 14 deletions src/i18n/zh-TW/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is just an example,
// so you can safely delete all default props below
// so you can safely remove all default props below

export default {
search: '搜索...',
Expand All @@ -17,45 +17,65 @@ export default {
superior: '上級',
description: '描述',
lastModifiedDate: '更新時間',

members: '成員',
username: '賬號',
password: '密碼',
firstname: '姓',
lastname: '名字',
fullname: '姓名',
accountLocked: '賬號鎖狀態',
email: '郵箱',
accountNonLocked: '鎖狀態',
accountExpiresAt: '賬號失效時間',
credentialsExpiresAt: '密碼失效時間',

component: '元件',
order: '排序',
data: '數據',
type: '類型',
path: '路徑',
icon: '圖示',
principal: '負責人',
ip: 'IP',
location: '歸屬地',
module: '模組',
method: '方法',
api: '接口',
params: '參數',
operator: '操作人',
operation: '操作',
time: '時間',
status: '状态',
operationTime: '操作時間',
responseTime: '響應時間',
responseCode: '響應碼',
responseMessage: '響應消息',
resource: '資源',
oldValue: '舊值',
newValue: '新值',
cronExpression: 'Cron表達式',
success: '成功',
failure: '失敗',
column: '列',

areaCode: '區號',
postalCode: '郵編',

enabled: '是否啟用',
enable: '啟用',
disable: '禁用',

actions: '操作',
import: '導入',
export: '導出',
commit: '提交',
submit: '提交',
confirm: '確定',
cancle: '取消',
cancel: '取消',
add: '添加',
edit: '修改',
delete: '刪除',
unlock: '解鎖',
grant: '授權',
members: '成員',
detail: '詳情',
remove: '刪除',
refresh: '刷新',
reset: '重置',

home: '首頁',
system: '系統管理',
groups: '分組',
groups: '組織',
roles: '角色',
privileges: '權限',
users: '用戶',
Expand All @@ -67,6 +87,11 @@ export default {
auditLog: '審計日誌',
schedulerLog: '調度日誌',

inputText: '请输入',
searchText: '请选择',
lengthRange: '長度在 {min} 到 {max} 個字元',
removeConfirm: '是否確定要刪除這條數據?',

welcome: '嗨!歡迎回來',
subtitle: '請填寫您的帳號和密碼,讓我們繼續探索',
rememberMe: '記住我 ?'
Expand Down
Loading

0 comments on commit 59340b9

Please sign in to comment.