修改info 获取权限及菜单
This commit is contained in:
@@ -25,7 +25,7 @@ export namespace SystemMenuApi {
|
||||
export interface SystemMenu {
|
||||
[key: string]: any;
|
||||
/** 后端权限标识 */
|
||||
authCode: string;
|
||||
auth_code: string;
|
||||
/** 子级 */
|
||||
children?: SystemMenu[];
|
||||
/** 组件 */
|
||||
@@ -110,9 +110,10 @@ async function isMenuNameExists(
|
||||
async function isMenuSearchExists(
|
||||
name: string,
|
||||
id?: SystemMenuApi.SystemMenu['id'],
|
||||
pid?: SystemMenuApi.SystemMenu['pid'],
|
||||
) {
|
||||
return requestClient.get<boolean>('/system/menu/name-search', {
|
||||
params: { name, id },
|
||||
params: { name, id, pid },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"component": "Component",
|
||||
"status": "Status",
|
||||
"sort": "sort",
|
||||
"authCode": "Permission Code",
|
||||
"auth_code": "Permission Code",
|
||||
"badge": "Badge",
|
||||
"operation": "Actions",
|
||||
"linkSrc": "Link URL",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"activePathMustExist": "该路径未能找到有效的菜单",
|
||||
"advancedSettings": "其它设置",
|
||||
"affixTab": "固定在标签",
|
||||
"authCode": "权限标识",
|
||||
"auth_code": "权限标识",
|
||||
"badge": "徽章内容",
|
||||
"badgeVariants": "徽标样式",
|
||||
"badgeType": {
|
||||
|
||||
@@ -56,7 +56,11 @@ const schema: VbenFormSchema[] = [
|
||||
.max(30, $t('ui.formRules.maxLength', [$t('system.menu.menuName'), 30]))
|
||||
.refine(
|
||||
async (value: string) => {
|
||||
return !(await isMenuSearchExists(value, formData.value?.id));
|
||||
return !(await isMenuSearchExists(
|
||||
value,
|
||||
formData.value?.id,
|
||||
formData.value?.pid,
|
||||
));
|
||||
},
|
||||
(value) => ({
|
||||
message: $t('ui.formRules.alreadyExists', [
|
||||
@@ -252,7 +256,7 @@ const schema: VbenFormSchema[] = [
|
||||
triggerFields: ['type'],
|
||||
},
|
||||
fieldName: 'auth_code',
|
||||
label: $t('system.menu.authCode'),
|
||||
label: $t('system.menu.auth_code'),
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
|
||||
Reference in New Issue
Block a user