Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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<any>({
|
||||
url: '/system/user/profile/updatePwd',
|
||||
method: 'put',
|
||||
data
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 添加站点 */
|
||||
|
||||
@@ -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 }) => (
|
||||
<div class="flex justify-around gap-8px">
|
||||
<Button size="small" onClick={() => edit(record.menuId)}>
|
||||
@@ -102,8 +112,10 @@ const { data, columns, loading, getData } = useTable({
|
||||
</Button>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
],
|
||||
return arr;
|
||||
},
|
||||
rowKey: 'menuId'
|
||||
});
|
||||
const { handleEdit, handleAdd, checkedRowKeys, operateType, drawerVisible, onDeleted, editingData } = useTableOperate(
|
||||
@@ -145,7 +157,7 @@ function handleSubmitSuccess() {
|
||||
<SimpleScrollbar>
|
||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||
<ACard :title="t('page.menu.title')">
|
||||
<AButton mb-4 type="primary" ghost @click="handleAdd">{{ t('page.menu.addmenu') }}</AButton>
|
||||
<AButton mb-4 type="primary" ghost @click="handleAdd" v-if="isSuper">{{ t('page.menu.addmenu') }}</AButton>
|
||||
|
||||
<ATable
|
||||
:checked-row-keys="checkedRowKeys"
|
||||
|
||||
@@ -11,6 +11,7 @@ import Form from 'ant-design-vue/es/form/Form';
|
||||
import Modal from 'ant-design-vue/es/modal/Modal';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import useDictStore from '@/store/modules/dict';
|
||||
import { useAuthStore } from '@/store/modules/auth';
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const routePath = route.path;
|
||||
@@ -24,6 +25,8 @@ const { t } = useI18n();
|
||||
const wrapperEl = shallowRef<HTMLElement | null>(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 = () => {
|
||||
<div class="flex flex-wrap justify-end gap-x-12px gap-y-8px lt-sm:(w-200px py-12px)">
|
||||
<slot name="prefix"></slot>
|
||||
<slot name="default">
|
||||
<AButton size="small" ghost type="primary" @click="fnModalVisibleByEdit()">
|
||||
<AButton size="small" ghost type="primary" @click="fnModalVisibleByEdit()" v-if="isSuper">
|
||||
<div class="flex-y-center gap-8px">
|
||||
<icon-ic-round-plus class="text-icon" />
|
||||
<span>{{ $t('common.add') }}</span>
|
||||
</div>
|
||||
</AButton>
|
||||
<APopconfirm :title="$t('common.confirmDelete')" :disabled="checkedRowKeys.length === 0"
|
||||
@confirm="handleBatchDelete">
|
||||
@confirm="handleBatchDelete" v-if="isSuper">
|
||||
<AButton size="small" danger :disabled="checkedRowKeys.length <= 0">
|
||||
<div class="flex-y-center gap-8px">
|
||||
<icon-ic-round-delete class="text-icon" />
|
||||
@@ -559,7 +562,7 @@ const handleReset = () => {
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-switch v-model:checked="record.status" checked-value="0" un-checked-value="1" size="small"
|
||||
<a-switch v-model:checked="record.status" checked-value="0" :disabled="!isSuper" un-checked-value="1" size="small"
|
||||
@change="fnRecordStatus(record)" />
|
||||
</template>
|
||||
|
||||
@@ -573,7 +576,7 @@ const handleReset = () => {
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-tooltip>
|
||||
<a-tooltip v-if="isSuper">
|
||||
<template #title>{{ t('common.edit') }}</template>
|
||||
<a-button type="link" @click.prevent="fnModalVisibleByEdit(record.jobId)">
|
||||
<template #icon>
|
||||
@@ -582,7 +585,7 @@ const handleReset = () => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip>
|
||||
<a-tooltip v-if="isSuper">
|
||||
<template #title>{{ t('common.delete') }}</template>
|
||||
<a-button type="link" @click.prevent="fnRecordDelete(record.jobId)">
|
||||
<template #icon>
|
||||
@@ -591,7 +594,7 @@ const handleReset = () => {
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip>
|
||||
<a-tooltip v-if="isSuper">
|
||||
<template #title>{{ t('page.manage.task.runOne') }}</template>
|
||||
<a-button type="link" @click.prevent="fnRunTask(record.jobId)">
|
||||
<template #icon>
|
||||
|
||||
Reference in New Issue
Block a user