From 988d14b714af3f994643a9e96eb16dbb16f8722c Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Sun, 24 Mar 2024 23:25:36 +0800 Subject: [PATCH 1/3] [Page] [Layout] Add tooltip to icon navigator --- .../components/components/NavigationOpened.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/layouts/base/components/components/NavigationOpened.vue b/src/views/layouts/base/components/components/NavigationOpened.vue index 080023f2..60be97ad 100644 --- a/src/views/layouts/base/components/components/NavigationOpened.vue +++ b/src/views/layouts/base/components/components/NavigationOpened.vue @@ -3,7 +3,19 @@ + + + {{ $t(navigator?.title as string) }} + {{ navigator?.label }} + + + From 5f232b8ea24fd23fc59e3f03221fa05c92d12dd4 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Sun, 24 Mar 2024 23:44:34 +0800 Subject: [PATCH 2/3] [Page] [Form] Add basic form --- src/data/Navigation.ts | 8 +++++- src/i18n/langs/en/Form.ts | 9 +++++++ src/i18n/langs/en/index.ts | 4 ++- src/i18n/langs/zhCn/Form.ts | 9 +++++++ src/i18n/langs/zhCn/index.ts | 4 ++- src/router/default.ts | 16 +++++++++++ src/views/pages/form/FormBasic.vue | 43 ++++++++++++++++++++++++++++++ 7 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 src/i18n/langs/en/Form.ts create mode 100644 src/i18n/langs/zhCn/Form.ts create mode 100644 src/views/pages/form/FormBasic.vue diff --git a/src/data/Navigation.ts b/src/data/Navigation.ts index 89cfa28f..d5059c6b 100644 --- a/src/data/Navigation.ts +++ b/src/data/Navigation.ts @@ -1,6 +1,6 @@ import { NavigationModel, NavigationPosition } from '@/model/Navigation' import NavigationService from '@/services/Navigation' -import { Ban, CircleOff, Gauge, LogIn, LogOut, StickyNote } from 'lucide-vue-next' +import { AudioWaveform, Ban, CircleOff, FormInput, Gauge, LogIn, LogOut, StickyNote } from 'lucide-vue-next' const createNavigation = (): void => { NavigationService.addNavigation(createNavigationItem('common.common.dashboard', undefined, '/dashboard', Gauge, NavigationPosition.LEFT_TOP)) @@ -41,6 +41,12 @@ const createNavigation = (): void => { const pages = createNavigationItem('common.common.page', pageArray.length.toString(), '/pages', StickyNote, NavigationPosition.LEFT_TOP, pageArray, undefined, 'common.common.page') NavigationService.addNavigation(pages) + + const form = createNavigationItem('form.common.formBasic', undefined, '/forms/basic', AudioWaveform, NavigationPosition.LEFT_TOP) + const formArray = [form] + const froms = createNavigationItem('form.common.form', formArray.length.toString(), '/forms', FormInput, NavigationPosition.LEFT_TOP, + formArray, undefined, 'common.common.form') + NavigationService.addNavigation(froms) } const createNavigationItem = (title?: string, label?: string, href?: string, icon?: any, position?: NavigationPosition, children?: NavigationModel[], group?: string, description?: string, blank?: boolean): NavigationModel => { diff --git a/src/i18n/langs/en/Form.ts b/src/i18n/langs/en/Form.ts new file mode 100644 index 00000000..b00162bf --- /dev/null +++ b/src/i18n/langs/en/Form.ts @@ -0,0 +1,9 @@ +export default { + common: { + form: 'Form', + formBasic: 'Basic Form', + }, + tip: { + formBasic: 'This is a basic form example' + } +} \ No newline at end of file diff --git a/src/i18n/langs/en/index.ts b/src/i18n/langs/en/index.ts index e2c9f2c8..f28029c9 100644 --- a/src/i18n/langs/en/index.ts +++ b/src/i18n/langs/en/index.ts @@ -1,9 +1,11 @@ import region from '@/i18n/langs/en/Region' import common from '@/i18n/langs/en/Common' import user from '@/i18n/langs/en/User' +import form from '@/i18n/langs/en/Form' export default { region: region, common: common, - user: user + user: user, + form: form } \ No newline at end of file diff --git a/src/i18n/langs/zhCn/Form.ts b/src/i18n/langs/zhCn/Form.ts new file mode 100644 index 00000000..9ac8e8e4 --- /dev/null +++ b/src/i18n/langs/zhCn/Form.ts @@ -0,0 +1,9 @@ +export default { + common: { + form: '表单', + formBasic: '基础表单' + }, + tip: { + formBasic: '这是一个表单的基础示例' + } +} \ No newline at end of file diff --git a/src/i18n/langs/zhCn/index.ts b/src/i18n/langs/zhCn/index.ts index af02fe9a..1a9e2e3d 100644 --- a/src/i18n/langs/zhCn/index.ts +++ b/src/i18n/langs/zhCn/index.ts @@ -1,9 +1,11 @@ import region from '@/i18n/langs/zhCn/Region' import common from '@/i18n/langs/zhCn/Common' import user from '@/i18n/langs/zhCn/User' +import form from '@/i18n/langs/zhCn/Form' export default { region: region, common: common, - user: user + user: user, + form: form } \ No newline at end of file diff --git a/src/router/default.ts b/src/router/default.ts index 0b1c1953..231d45fd 100644 --- a/src/router/default.ts +++ b/src/router/default.ts @@ -17,6 +17,7 @@ const createDefaultRouter = (router: Router): void => { }) createHttpRouter(router) createUserRouter(router) + createFormRouter(router) } /** @@ -70,6 +71,21 @@ const createUserRouter = (router: Router): void => { }) } +const createFormRouter = (router: Router): void => { + router.addRoute({ + path: '/forms', + name: 'form', + component: LayoutContainer, + children: [ + { + name: 'basic', + path: 'basic', + component: () => import('@/views/pages/form/FormBasic.vue') + } + ] + }) +} + export { createDefaultRouter } diff --git a/src/views/pages/form/FormBasic.vue b/src/views/pages/form/FormBasic.vue new file mode 100644 index 00000000..f0263cf7 --- /dev/null +++ b/src/views/pages/form/FormBasic.vue @@ -0,0 +1,43 @@ + + + From 5d18b80584c41da8d90debde2ed415c9d8226a58 Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Mon, 25 Mar 2024 00:04:18 +0800 Subject: [PATCH 3/3] [Page] [Form] Add with action form --- src/data/Navigation.ts | 17 +++++---- src/i18n/langs/en/Form.ts | 5 ++- src/i18n/langs/zhCn/Form.ts | 7 +++- src/router/default.ts | 5 +++ src/views/pages/form/FormBasic.vue | 2 +- src/views/pages/form/FormWithAction.vue | 51 +++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 src/views/pages/form/FormWithAction.vue diff --git a/src/data/Navigation.ts b/src/data/Navigation.ts index d5059c6b..d1377e52 100644 --- a/src/data/Navigation.ts +++ b/src/data/Navigation.ts @@ -4,18 +4,18 @@ import { AudioWaveform, Ban, CircleOff, FormInput, Gauge, LogIn, LogOut, StickyN const createNavigation = (): void => { NavigationService.addNavigation(createNavigationItem('common.common.dashboard', undefined, '/dashboard', Gauge, NavigationPosition.LEFT_TOP)) - const signIn = createNavigationItem('common.common.signIn', undefined, '/auth/signin', LogIn, NavigationPosition.LEFT_TOP) - NavigationService.addNavigation(signIn) - const signUp = createNavigationItem('common.common.signUp', undefined, '/auth/signup', LogOut, NavigationPosition.LEFT_BOTTOM) - NavigationService.addNavigation(signUp) - NavigationService.addNavigation(createNavigationItem('common.common.home', + NavigationService.addNavigation(createNavigationItem('common.common.dashboard', undefined, - '/', + '/dashboard', undefined, NavigationPosition.TOP, [], - 'common.common.home', + 'common.common.dashboard', undefined)) + const signIn = createNavigationItem('common.common.signIn', undefined, '/auth/signin', LogIn, NavigationPosition.TOP) + NavigationService.addNavigation(signIn) + const signUp = createNavigationItem('common.common.signUp', undefined, '/auth/signup', LogOut, NavigationPosition.TOP) + NavigationService.addNavigation(signUp) const datacap = createNavigationItem('common.common.datacap', undefined, @@ -43,7 +43,8 @@ const createNavigation = (): void => { NavigationService.addNavigation(pages) const form = createNavigationItem('form.common.formBasic', undefined, '/forms/basic', AudioWaveform, NavigationPosition.LEFT_TOP) - const formArray = [form] + const formWithAction = createNavigationItem('form.common.formWithAction', undefined, '/forms/withAction', AudioWaveform, NavigationPosition.LEFT_TOP) + const formArray = [form, formWithAction] const froms = createNavigationItem('form.common.form', formArray.length.toString(), '/forms', FormInput, NavigationPosition.LEFT_TOP, formArray, undefined, 'common.common.form') NavigationService.addNavigation(froms) diff --git a/src/i18n/langs/en/Form.ts b/src/i18n/langs/en/Form.ts index b00162bf..76fa350a 100644 --- a/src/i18n/langs/en/Form.ts +++ b/src/i18n/langs/en/Form.ts @@ -2,8 +2,11 @@ export default { common: { form: 'Form', formBasic: 'Basic Form', + formWithAction: 'Form with Action', + signInWithGoogle: 'Sign in with Google', }, tip: { - formBasic: 'This is a basic form example' + formBasic: 'This is a basic form example', + formWithAction: 'Here\'s an example of a form with an action function' } } \ No newline at end of file diff --git a/src/i18n/langs/zhCn/Form.ts b/src/i18n/langs/zhCn/Form.ts index 9ac8e8e4..0288ca9b 100644 --- a/src/i18n/langs/zhCn/Form.ts +++ b/src/i18n/langs/zhCn/Form.ts @@ -1,9 +1,12 @@ export default { common: { form: '表单', - formBasic: '基础表单' + formBasic: '基础表单', + formWithAction: '带操作功能表单', + signInWithGoogle: '使用 Google 登录', }, tip: { - formBasic: '这是一个表单的基础示例' + formBasic: '这是一个表单的基础示例', + formWithAction: '这是一个带有操作功能的表单示例' } } \ No newline at end of file diff --git a/src/router/default.ts b/src/router/default.ts index 231d45fd..e71b5571 100644 --- a/src/router/default.ts +++ b/src/router/default.ts @@ -81,6 +81,11 @@ const createFormRouter = (router: Router): void => { name: 'basic', path: 'basic', component: () => import('@/views/pages/form/FormBasic.vue') + }, + { + name: 'withAction', + path: 'withAction', + component: () => import('@/views/pages/form/FormWithAction.vue') } ] }) diff --git a/src/views/pages/form/FormBasic.vue b/src/views/pages/form/FormBasic.vue index f0263cf7..fadfed3b 100644 --- a/src/views/pages/form/FormBasic.vue +++ b/src/views/pages/form/FormBasic.vue @@ -17,7 +17,7 @@ - + diff --git a/src/views/pages/form/FormWithAction.vue b/src/views/pages/form/FormWithAction.vue new file mode 100644 index 00000000..528097d5 --- /dev/null +++ b/src/views/pages/form/FormWithAction.vue @@ -0,0 +1,51 @@ + + +