From 97a04658900419e91c48dac56371f627d2a73876 Mon Sep 17 00:00:00 2001 From: bestlee Date: Thu, 27 Aug 2026 16:43:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global-header/components/user-avatar.vue | 7 +- src/locales/langs/zh-cn.ts | 3 +- src/router/elegant/imports.ts | 1 + src/router/elegant/routes.ts | 31 ++---- src/router/elegant/transform.ts | 1 + src/service/api/user.ts | 9 ++ src/typings/components.d.ts | 6 ++ src/typings/elegant-router.d.ts | 2 + .../systemManage/changePassword/index.vue | 98 +++++++++++++++++++ 9 files changed, 132 insertions(+), 26 deletions(-) create mode 100644 src/views/systemManage/changePassword/index.vue diff --git a/src/layouts/modules/global-header/components/user-avatar.vue b/src/layouts/modules/global-header/components/user-avatar.vue index 4b89bdd..1f0796c 100644 --- a/src/layouts/modules/global-header/components/user-avatar.vue +++ b/src/layouts/modules/global-header/components/user-avatar.vue @@ -33,9 +33,9 @@ type DropdownOption = const options = computed(() => { const opts: DropdownOption[] = [ { - label: '个人中心', + label: '修改密码', key: 'user-center', - icon: SvgIconVNode({ icon: 'ph:user-circle', fontSize: 18 }) + icon: SvgIconVNode({ icon: 'boxicons:lock-open', fontSize: 18 }) }, { type: 'divider', @@ -67,8 +67,7 @@ function handleDropdown(key: DropdownKey) { if (key === 'logout') { logout(); } else { - // If your other options are jumps from other routes, they will be directly supported here - // routerPushByKey(key); + routerPushByKey('systemmanage_changepassword'); } } diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 86a10a8..a7a99c2 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -255,7 +255,8 @@ const local: App.I18n.Schema = { report: '统计报表', signstatistics: '质量会签统计', factoryoverview: '全工厂统计概览', - systemmanage_setting: '系统配置' + systemmanage_setting: '系统配置', + systemmanage_changepassword: '修改密码' }, form: { required: '不能为空', diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index aa950f4..1e4c6e2 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -42,6 +42,7 @@ export const views: Record Promise import("@/views/report/index.vue"), riskstatistics: () => import("@/views/riskStatistics/index.vue"), signstatistics: () => import("@/views/signStatistics/index.vue"), + systemmanage_changepassword: () => import("@/views/systemManage/changePassword/index.vue"), systemmanage_role: () => import("@/views/systemManage/role/index.vue"), systemmanage_setting: () => import("@/views/systemManage/setting/index.vue"), systemmanage_template: () => import("@/views/systemManage/template/index.vue"), diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index f3cd2bc..69624b4 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -56,7 +56,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.changeledger_mychanges', meta: { title: '我发起的变更', - icon: '', i18nKey: 'route.changeledger_mychanges' } }, @@ -66,7 +65,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.changeledger_workshopchanges', meta: { title: '本车间变更', - icon: '', i18nKey: 'route.changeledger_workshopchanges' } } @@ -100,7 +98,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.docs_archives', meta: { title: '资料档案库', - icon: '', i18nKey: 'route.docs_archives' } }, @@ -110,7 +107,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.docs_query', meta: { title: '变更归档查询', - icon: '', i18nKey: 'route.docs_query' } } @@ -167,7 +163,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_closeconfirm', meta: { title: '关闭确认', - icon: '', i18nKey: 'route.my_closeconfirm' } }, @@ -177,7 +172,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_datachangecenter', meta: { title: '变更数据中心', - icon: '', i18nKey: 'route.my_datachangecenter' } }, @@ -187,7 +181,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_effect', meta: { title: '变更投入和效果', - icon: '', i18nKey: 'route.my_effect' } }, @@ -197,7 +190,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_highrisk', meta: { title: '本专业高风险', - icon: '', i18nKey: 'route.my_highrisk' } }, @@ -207,7 +199,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_highriskdetail', meta: { title: '高风险场景详情', - icon: '', hideInMenu: true, i18nKey: 'route.my_highriskdetail' } @@ -218,7 +209,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_initiatechange', meta: { title: '发起变更', - icon: '', i18nKey: 'route.my_initiatechange' } }, @@ -228,7 +218,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_mydraft', meta: { title: '我的草稿', - icon: '', i18nKey: 'route.my_mydraft' } }, @@ -238,7 +227,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_mytask', meta: { title: '我的任务', - icon: '', i18nKey: 'route.my_mytask' } }, @@ -248,7 +236,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_pending', meta: { title: '待我处理', - icon: '', i18nKey: 'route.my_pending' } }, @@ -258,7 +245,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_pendingchange', meta: { title: '待投用变更', - icon: '', i18nKey: 'route.my_pendingchange' } }, @@ -268,7 +254,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_process', meta: { title: '流程演示', - icon: '', i18nKey: 'route.my_process' } }, @@ -278,7 +263,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_processdetail', meta: { title: '流程演示详情', - icon: '', hideInMenu: true, i18nKey: 'route.my_processdetail' } @@ -289,7 +273,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.my_pssr', meta: { title: 'PSSR监督', - icon: '', i18nKey: 'route.my_pssr' } } @@ -339,13 +322,22 @@ export const generatedRoutes: GeneratedRoute[] = [ i18nKey: 'route.systemmanage' }, children: [ + { + name: 'systemmanage_changepassword', + path: '/systemmanage/changepassword', + component: 'view.systemmanage_changepassword', + meta: { + title: '修改密码', + i18nKey: 'route.systemmanage_changepassword', + order: 5 + } + }, { name: 'systemmanage_role', path: '/systemmanage/role', component: 'view.systemmanage_role', meta: { title: '角色管理', - icon: '', order: 2, i18nKey: 'route.systemmanage_role' } @@ -356,7 +348,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.systemmanage_setting', meta: { title: '系统配置', - icon: '', order: 4, i18nKey: 'route.systemmanage_setting' } @@ -367,7 +358,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.systemmanage_template', meta: { title: '审批模板管理', - icon: '', order: 3, i18nKey: 'route.systemmanage_template' } @@ -378,7 +368,6 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'view.systemmanage_user', meta: { title: '架构及用户管理', - icon: '', order: 1, i18nKey: 'route.systemmanage_user' } diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index 9601ef5..30e8214 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -194,6 +194,7 @@ const routeMap: RouteMap = { "riskstatistics": "/riskstatistics", "signstatistics": "/signstatistics", "systemmanage": "/systemmanage", + "systemmanage_changepassword": "/systemmanage/changepassword", "systemmanage_role": "/systemmanage/role", "systemmanage_setting": "/systemmanage/setting", "systemmanage_template": "/systemmanage/template", diff --git a/src/service/api/user.ts b/src/service/api/user.ts index 258cca6..e9ceacb 100644 --- a/src/service/api/user.ts +++ b/src/service/api/user.ts @@ -100,3 +100,12 @@ export function resetPasswordApi(id: number) { }); } +// 修改用户密码 +export function changePasswordApi(params: { oldPassword: string, password: string }) { + return request({ + url: `/api/user/change-password`, + method: 'post', + data: params + }); +} + diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 33571a6..0e71ab9 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -42,6 +42,7 @@ declare module 'vue' { NCascader: typeof import('naive-ui')['NCascader'] NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] + NCol: typeof import('naive-ui')['NCol'] NColorPicker: typeof import('naive-ui')['NColorPicker'] NDataTable: typeof import('naive-ui')['NDataTable'] NDatePicker: typeof import('naive-ui')['NDatePicker'] @@ -64,6 +65,7 @@ declare module 'vue' { NMenu: typeof import('naive-ui')['NMenu'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NModal: typeof import('naive-ui')['NModal'] + NNInput: typeof import('naive-ui')['NNInput'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NPagination: typeof import('naive-ui')['NPagination'] NPopconfirm: typeof import('naive-ui')['NPopconfirm'] @@ -71,6 +73,7 @@ declare module 'vue' { NProgress: typeof import('naive-ui')['NProgress'] NRadio: typeof import('naive-ui')['NRadio'] NRadioGroup: typeof import('naive-ui')['NRadioGroup'] + NRow: typeof import('naive-ui')['NRow'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSelect: typeof import('naive-ui')['NSelect'] NSpace: typeof import('naive-ui')['NSpace'] @@ -132,6 +135,7 @@ declare global { const NCascader: typeof import('naive-ui')['NCascader'] const NCheckbox: typeof import('naive-ui')['NCheckbox'] const NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] + const NCol: typeof import('naive-ui')['NCol'] const NColorPicker: typeof import('naive-ui')['NColorPicker'] const NDataTable: typeof import('naive-ui')['NDataTable'] const NDatePicker: typeof import('naive-ui')['NDatePicker'] @@ -154,6 +158,7 @@ declare global { const NMenu: typeof import('naive-ui')['NMenu'] const NMessageProvider: typeof import('naive-ui')['NMessageProvider'] const NModal: typeof import('naive-ui')['NModal'] + const NNInput: typeof import('naive-ui')['NNInput'] const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] const NPagination: typeof import('naive-ui')['NPagination'] const NPopconfirm: typeof import('naive-ui')['NPopconfirm'] @@ -161,6 +166,7 @@ declare global { const NProgress: typeof import('naive-ui')['NProgress'] const NRadio: typeof import('naive-ui')['NRadio'] const NRadioGroup: typeof import('naive-ui')['NRadioGroup'] + const NRow: typeof import('naive-ui')['NRow'] const NScrollbar: typeof import('naive-ui')['NScrollbar'] const NSelect: typeof import('naive-ui')['NSelect'] const NSpace: typeof import('naive-ui')['NSpace'] diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index 7e4bf32..baeb230 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -48,6 +48,7 @@ declare module "@elegant-router/types" { "riskstatistics": "/riskstatistics"; "signstatistics": "/signstatistics"; "systemmanage": "/systemmanage"; + "systemmanage_changepassword": "/systemmanage/changepassword"; "systemmanage_role": "/systemmanage/role"; "systemmanage_setting": "/systemmanage/setting"; "systemmanage_template": "/systemmanage/template"; @@ -140,6 +141,7 @@ declare module "@elegant-router/types" { | "report" | "riskstatistics" | "signstatistics" + | "systemmanage_changepassword" | "systemmanage_role" | "systemmanage_setting" | "systemmanage_template" diff --git a/src/views/systemManage/changePassword/index.vue b/src/views/systemManage/changePassword/index.vue new file mode 100644 index 0000000..76ae9af --- /dev/null +++ b/src/views/systemManage/changePassword/index.vue @@ -0,0 +1,98 @@ + + + + +