From b6fed795b21976f7aa8edff087c2706ae4cd05db Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Mon, 28 Apr 2025 10:33:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=B1=8F=E8=94=BD=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=92=8C=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/elegant/routes.ts | 260 +++++++++++++++++------------------ src/service/api/auth.ts | 4 +- 2 files changed, 132 insertions(+), 132 deletions(-) diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index b45c72a..e840a02 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -91,136 +91,136 @@ export const generatedRoutes: GeneratedRoute[] = [ }, // 下面是指定角色才有 - { - name: 'function', - path: '/function', - component: 'layout.base', - meta: { - title: 'function', - i18nKey: 'route.function', - icon: 'icon-park-outline:all-application', - order: 1002, - roles: ['super'] - }, - children: [ - { - name: 'function_hide-child', - path: '/function/hide-child', - meta: { - title: 'function_hide-child', - i18nKey: 'route.function_hide-child', - icon: 'material-symbols:filter-list-off', - order: 2 - }, - redirect: '/function/hide-child/one', - children: [ - { - name: 'function_hide-child_one', - path: '/function/hide-child/one', - component: 'view.function_hide-child_one', - meta: { - title: 'function_hide-child_one', - i18nKey: 'route.function_hide-child_one', - icon: 'material-symbols:filter-list-off', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - }, - { - name: 'function_hide-child_three', - path: '/function/hide-child/three', - component: 'view.function_hide-child_three', - meta: { - title: 'function_hide-child_three', - i18nKey: 'route.function_hide-child_three', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - }, - { - name: 'function_hide-child_two', - path: '/function/hide-child/two', - component: 'view.function_hide-child_two', - meta: { - title: 'function_hide-child_two', - i18nKey: 'route.function_hide-child_two', - hideInMenu: true, - activeMenu: 'function_hide-child' - } - } - ] - }, - { - name: 'function_multi-tab', - path: '/function/multi-tab', - component: 'view.function_multi-tab', - meta: { - title: 'function_multi-tab', - i18nKey: 'route.function_multi-tab', - icon: 'ic:round-tab', - multiTab: true, - hideInMenu: true, - activeMenu: 'function_tab' - } - }, - { - name: 'function_request', - path: '/function/request', - component: 'view.function_request', - meta: { - title: 'function_request', - i18nKey: 'route.function_request', - icon: 'carbon:network-overlay', - order: 3 - } - }, - { - name: 'function_super-page', - path: '/function/super-page', - component: 'view.function_super-page', - meta: { - title: 'function_super-page', - i18nKey: 'route.function_super-page', - icon: 'ic:round-supervisor-account', - order: 5, - } - }, - { - name: 'function_tab', - path: '/function/tab', - component: 'view.function_tab', - meta: { - title: 'function_tab', - i18nKey: 'route.function_tab', - icon: 'ic:round-tab', - order: 1 - } - }, - { - name: 'function_toggle-auth', - path: '/function/toggle-auth', - component: 'view.function_toggle-auth', - meta: { - title: 'function_toggle-auth', - i18nKey: 'route.function_toggle-auth', - icon: 'ic:round-construction', - order: 4 - } - } - ] - }, - { - name: 'about', - path: '/about', - component: 'layout.base$view.about', - meta: { - title: 'about', - i18nKey: 'route.about', - icon: 'fluent:book-information-24-regular', - order: 1003, - roles: ['super'] - } - }, + // { + // name: 'function', + // path: '/function', + // component: 'layout.base', + // meta: { + // title: 'function', + // i18nKey: 'route.function', + // icon: 'icon-park-outline:all-application', + // order: 1002, + // roles: ['super'] + // }, + // children: [ + // { + // name: 'function_hide-child', + // path: '/function/hide-child', + // meta: { + // title: 'function_hide-child', + // i18nKey: 'route.function_hide-child', + // icon: 'material-symbols:filter-list-off', + // order: 2 + // }, + // redirect: '/function/hide-child/one', + // children: [ + // { + // name: 'function_hide-child_one', + // path: '/function/hide-child/one', + // component: 'view.function_hide-child_one', + // meta: { + // title: 'function_hide-child_one', + // i18nKey: 'route.function_hide-child_one', + // icon: 'material-symbols:filter-list-off', + // hideInMenu: true, + // activeMenu: 'function_hide-child' + // } + // }, + // { + // name: 'function_hide-child_three', + // path: '/function/hide-child/three', + // component: 'view.function_hide-child_three', + // meta: { + // title: 'function_hide-child_three', + // i18nKey: 'route.function_hide-child_three', + // hideInMenu: true, + // activeMenu: 'function_hide-child' + // } + // }, + // { + // name: 'function_hide-child_two', + // path: '/function/hide-child/two', + // component: 'view.function_hide-child_two', + // meta: { + // title: 'function_hide-child_two', + // i18nKey: 'route.function_hide-child_two', + // hideInMenu: true, + // activeMenu: 'function_hide-child' + // } + // } + // ] + // }, + // { + // name: 'function_multi-tab', + // path: '/function/multi-tab', + // component: 'view.function_multi-tab', + // meta: { + // title: 'function_multi-tab', + // i18nKey: 'route.function_multi-tab', + // icon: 'ic:round-tab', + // multiTab: true, + // hideInMenu: true, + // activeMenu: 'function_tab' + // } + // }, + // { + // name: 'function_request', + // path: '/function/request', + // component: 'view.function_request', + // meta: { + // title: 'function_request', + // i18nKey: 'route.function_request', + // icon: 'carbon:network-overlay', + // order: 3 + // } + // }, + // { + // name: 'function_super-page', + // path: '/function/super-page', + // component: 'view.function_super-page', + // meta: { + // title: 'function_super-page', + // i18nKey: 'route.function_super-page', + // icon: 'ic:round-supervisor-account', + // order: 5, + // } + // }, + // { + // name: 'function_tab', + // path: '/function/tab', + // component: 'view.function_tab', + // meta: { + // title: 'function_tab', + // i18nKey: 'route.function_tab', + // icon: 'ic:round-tab', + // order: 1 + // } + // }, + // { + // name: 'function_toggle-auth', + // path: '/function/toggle-auth', + // component: 'view.function_toggle-auth', + // meta: { + // title: 'function_toggle-auth', + // i18nKey: 'route.function_toggle-auth', + // icon: 'ic:round-construction', + // order: 4 + // } + // } + // ] + // }, + // { + // name: 'about', + // path: '/about', + // component: 'layout.base$view.about', + // meta: { + // title: 'about', + // i18nKey: 'route.about', + // icon: 'fluent:book-information-24-regular', + // order: 1003, + // roles: ['super'] + // } + // }, { name: 'dictData', path: '/manage/dict/dictData', diff --git a/src/service/api/auth.ts b/src/service/api/auth.ts index b025ce3..271ce94 100644 --- a/src/service/api/auth.ts +++ b/src/service/api/auth.ts @@ -433,11 +433,11 @@ export function resetPassword(data: { email: string; code: string; password: str }); } /** 通过原密码修改密码 */ -export function updatePasswordByOld(data: { oldPassword: string; newPassword: string }) { +export function updatePasswordByOld(params: { oldPassword: string; newPassword: string }) { return request({ url: '/system/user/profile/updatePwd', method: 'put', - data + params }); } /** 添加站点 */ From 87d2e1adeb357e43b67e8c14401b5322417cc1e5 Mon Sep 17 00:00:00 2001 From: caiyuchao Date: Mon, 28 Apr 2025 10:37:31 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E8=8F=9C=E5=8D=95=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=92=8C=E6=97=A5=E5=BF=97=E7=AE=A1=E7=90=86super?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/manage/menu/index.vue | 24 ++++++++++++++++++------ src/views/manage/task/index.vue | 15 +++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/views/manage/menu/index.vue b/src/views/manage/menu/index.vue index aa20e67..94cb335 100644 --- a/src/views/manage/menu/index.vue +++ b/src/views/manage/menu/index.vue @@ -4,10 +4,17 @@ import { Button, Tag } from 'ant-design-vue'; import { SimpleScrollbar } from '~/packages/materials/src'; import MenuOperateModal from './modules/menu-operate-modal.vue'; import { useI18n } from 'vue-i18n'; +import { useAuthStore } from '@/store/modules/auth'; const { t } = useI18n(); + +const authStore = useAuthStore(); +const isSuper = authStore.userInfo.roles?.includes('super'); + const { data, columns, loading, getData } = useTable({ apiFn: doGetMenuList, - columns: () => [ + columns: () => { + let arr = + [ { key: 'menuName', dataIndex: 'menuName', @@ -89,12 +96,15 @@ const { data, columns, loading, getData } = useTable({ dataIndex: 'createTime', align: 'center', title: t('page.menu.createtime') - }, - { + } + ] + if (isSuper) { + arr.push({ key: 'operate', title: t('page.menu.operate'), align: 'center', width: 200, + hidden: true, customRender: ({ record }) => (
) - } - ], + }) + } + return arr; + }, rowKey: 'menuId' }); const { handleEdit, handleAdd, checkedRowKeys, operateType, drawerVisible, onDeleted, editingData } = useTableOperate( @@ -145,7 +157,7 @@ function handleSubmitSuccess() {
- {{ t('page.menu.addmenu') }} + {{ t('page.menu.addmenu') }} (null); const { height: wrapperElHeight } = useElementSize(wrapperEl); +const authStore = useAuthStore(); +const isSuper = authStore.userInfo.roles?.includes('super'); /**对话框对象信息状态 */ let modalState: any = reactive({ @@ -509,14 +512,14 @@ const handleReset = () => {
- +
{{ $t('common.add') }}
+ @confirm="handleBatchDelete" v-if="isSuper">
@@ -559,7 +562,7 @@ const handleReset = () => { - +