Merge branch 'main' of https://gitee.com/dapppp/ruoyi-plus-vben5
This commit is contained in:
commit
21e05a1bc8
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -222,5 +222,7 @@
|
|||||||
"vitest.disableWorkspaceWarning": true,
|
"vitest.disableWorkspaceWarning": true,
|
||||||
"cSpell.words": ["tinymce"],
|
"cSpell.words": ["tinymce"],
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"editor.linkedEditing": true // 自动同步更改html标签
|
"editor.linkedEditing": true, // 自动同步更改html标签,
|
||||||
|
"vscodeCustomCodeColor.highlightValue": "v-access", // v-access显示的颜色
|
||||||
|
"vscodeCustomCodeColor.highlightValueColor": "#CCFFFF"
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
|
"root": "Root",
|
||||||
"system": {
|
"system": {
|
||||||
"root": "System",
|
"root": "System",
|
||||||
"user": "User",
|
"user": "User",
|
||||||
|
@ -84,6 +84,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menu": {
|
"menu": {
|
||||||
|
"root": "根目录",
|
||||||
"system": {
|
"system": {
|
||||||
"root": "系统管理",
|
"root": "系统管理",
|
||||||
"user": "用户管理",
|
"user": "用户管理",
|
||||||
|
@ -43,12 +43,16 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
async function setupMenuSelect() {
|
async function setupMenuSelect() {
|
||||||
// menu
|
// menu
|
||||||
const menuArray = await menuList();
|
const menuArray = await menuList();
|
||||||
|
// support i18n
|
||||||
|
menuArray.forEach((item) => {
|
||||||
|
item.menuName = $t(item.menuName);
|
||||||
|
});
|
||||||
// const folderArray = menuArray.filter((item) => item.menuType === 'M');
|
// const folderArray = menuArray.filter((item) => item.menuType === 'M');
|
||||||
const menuTree = listToTree(menuArray, { id: 'menuId', pid: 'parentId' });
|
const menuTree = listToTree(menuArray, { id: 'menuId', pid: 'parentId' });
|
||||||
const fullMenuTree = [
|
const fullMenuTree = [
|
||||||
{
|
{
|
||||||
menuId: 0,
|
menuId: 0,
|
||||||
menuName: '根目录',
|
menuName: $t('menu.root'),
|
||||||
children: menuTree,
|
children: menuTree,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -4,6 +4,7 @@ import type { Column, GenInfo } from '#/api/tool/gen/model';
|
|||||||
import { inject, onMounted, type Ref } from 'vue';
|
import { inject, onMounted, type Ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenForm } from '@vben/common-ui';
|
import { useVbenForm } from '@vben/common-ui';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
import { addFullName, listToTree } from '@vben/utils';
|
import { addFullName, listToTree } from '@vben/utils';
|
||||||
|
|
||||||
import { Col, Row } from 'ant-design-vue';
|
import { Col, Row } from 'ant-design-vue';
|
||||||
@ -66,12 +67,16 @@ async function initTreeSelect(columns: Column[]) {
|
|||||||
*/
|
*/
|
||||||
async function initMenuSelect() {
|
async function initMenuSelect() {
|
||||||
const list = await menuList();
|
const list = await menuList();
|
||||||
|
// support i18n
|
||||||
|
list.forEach((item) => {
|
||||||
|
item.menuName = $t(item.menuName);
|
||||||
|
});
|
||||||
const tree = listToTree(list, { id: 'menuId', pid: 'parentId' });
|
const tree = listToTree(list, { id: 'menuId', pid: 'parentId' });
|
||||||
const treeData = [
|
const treeData = [
|
||||||
{
|
{
|
||||||
fullName: '根目录',
|
fullName: $t('menu.root'),
|
||||||
menuId: 0,
|
menuId: 0,
|
||||||
menuName: '根目录',
|
menuName: $t('menu.root'),
|
||||||
children: tree,
|
children: tree,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
13
apps/web-antd/types/directive.d.ts
vendored
Normal file
13
apps/web-antd/types/directive.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import type { Directive } from 'vue';
|
||||||
|
|
||||||
|
declare module 'vue' {
|
||||||
|
export interface ComponentCustomProperties {
|
||||||
|
/**
|
||||||
|
* 判断权限: v-access:code=""
|
||||||
|
* 判断角色 v-access:role=""
|
||||||
|
* VueOfficial插件暂时不支持判断modifer/arg
|
||||||
|
* @see https://github.com/vuejs/language-tools/issues/4810
|
||||||
|
*/
|
||||||
|
vAccess: Directive<Element, string | string[]>;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user