Merge branch 'main' of https://gitee.com/xia5520/ruoyi-plus-vben5 into hr
This commit is contained in:
commit
891e5aeaf7
@ -82,5 +82,59 @@
|
||||
"downloadLoading": "Downloading... Please wait.",
|
||||
"preview": "Preview"
|
||||
}
|
||||
},
|
||||
"menu": {
|
||||
"system": {
|
||||
"root": "System",
|
||||
"user": "User",
|
||||
"role": "Role",
|
||||
"menu": "Menu",
|
||||
"dept": "Department",
|
||||
"post": "Post",
|
||||
"dict": "Dictionary",
|
||||
"config": "Parameter Settings",
|
||||
"notice": "Notifications",
|
||||
"log": {
|
||||
"root": "Log",
|
||||
"operation": "Operation Log",
|
||||
"login": "Login Log"
|
||||
},
|
||||
"oss": "File",
|
||||
"client": "Client"
|
||||
},
|
||||
"tenant": {
|
||||
"root": "Tenant",
|
||||
"package": "Package"
|
||||
},
|
||||
"monitor": {
|
||||
"root": "System Monitoring",
|
||||
"online": "Online Users",
|
||||
"cache": "Cache Monitoring",
|
||||
"admin": "Admin Monitoring",
|
||||
"job": "Task Scheduling Center"
|
||||
},
|
||||
"tool": {
|
||||
"root": "System Tools",
|
||||
"gen": "Code Generation"
|
||||
},
|
||||
"workflow": {
|
||||
"root": "Workflow",
|
||||
"category": "Process Category",
|
||||
"model": "Model",
|
||||
"define": "Process Definition",
|
||||
"monitor": {
|
||||
"root": "Process Monitoring",
|
||||
"instance": "Process Instance",
|
||||
"todo": "Pending Tasks"
|
||||
},
|
||||
"form": "Form"
|
||||
},
|
||||
"task": {
|
||||
"root": "My Tasks",
|
||||
"apply": "My Initiated Tasks",
|
||||
"todo": "My Pending Tasks",
|
||||
"done": "My Completed Tasks",
|
||||
"cc": "My CC"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -82,5 +82,59 @@
|
||||
"downloadLoading": "下载中, 请稍后...",
|
||||
"preview": "预览"
|
||||
}
|
||||
},
|
||||
"menu": {
|
||||
"system": {
|
||||
"root": "系统管理",
|
||||
"user": "用户管理",
|
||||
"role": "角色管理",
|
||||
"menu": "菜单管理",
|
||||
"dept": "部门管理",
|
||||
"post": "岗位管理",
|
||||
"dict": "字典管理",
|
||||
"config": "参数设置",
|
||||
"notice": "通知公告",
|
||||
"log": {
|
||||
"root": "日志管理",
|
||||
"operation": "操作日志",
|
||||
"login": "登录日志"
|
||||
},
|
||||
"oss": "文件管理",
|
||||
"client": "客户端管理"
|
||||
},
|
||||
"tenant": {
|
||||
"root": "租户管理",
|
||||
"package": "套餐管理"
|
||||
},
|
||||
"monitor": {
|
||||
"root": "系统监控",
|
||||
"online": "在线用户",
|
||||
"cache": "缓存监控",
|
||||
"admin": "Admin监控",
|
||||
"job": "任务调度中心"
|
||||
},
|
||||
"tool": {
|
||||
"root": "系统工具",
|
||||
"gen": "代码生成"
|
||||
},
|
||||
"workflow": {
|
||||
"root": "工作流",
|
||||
"category": "流程分类",
|
||||
"model": "模型管理",
|
||||
"define": "流程定义",
|
||||
"monitor": {
|
||||
"root": "流程监控",
|
||||
"instance": "流程实例",
|
||||
"todo": "待办任务"
|
||||
},
|
||||
"form": "表单管理"
|
||||
},
|
||||
"task": {
|
||||
"root": "我的任务",
|
||||
"apply": "我发起的",
|
||||
"todo": "我的待办",
|
||||
"done": "我的已办",
|
||||
"cc": "我的抄送"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { DictEnum } from '@vben/constants';
|
||||
import { $t } from '@vben/locales';
|
||||
import { getPopupContainer } from '@vben/utils';
|
||||
|
||||
import { type FormSchemaGetter, type VxeGridProps, z } from '#/adapter';
|
||||
@ -56,6 +57,10 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'menuName',
|
||||
treeNode: true,
|
||||
width: 200,
|
||||
slots: {
|
||||
// 需要i18n支持 否则返回原始值
|
||||
default: ({ row }) => $t(row.menuName),
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '图标',
|
||||
@ -195,6 +200,7 @@ export const drawerSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
fieldName: 'menuName',
|
||||
label: '菜单名称',
|
||||
help: '支持i18n写法, 如: menu.system.user',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenDrawer } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import { cloneDeep, eachTree } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter';
|
||||
import { menuTreeSelect, roleMenuTreeSelect } from '#/api/system/menu';
|
||||
@ -36,11 +36,20 @@ async function setupMenuTree(id?: number | string) {
|
||||
if (id) {
|
||||
const resp = await roleMenuTreeSelect(id);
|
||||
formApi.setFieldValue('menuIds', resp.checkedKeys);
|
||||
const menus = resp.menus;
|
||||
// i18n处理
|
||||
eachTree(menus, (node) => {
|
||||
node.label = $t(node.label);
|
||||
});
|
||||
// 设置菜单信息
|
||||
menuTree.value = resp.menus;
|
||||
} else {
|
||||
const resp = await menuTreeSelect();
|
||||
formApi.setFieldValue('menuIds', []);
|
||||
// i18n处理
|
||||
eachTree(resp, (node) => {
|
||||
node.label = $t(node.label);
|
||||
});
|
||||
// 设置菜单信息
|
||||
menuTree.value = resp;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
title: '租户状态',
|
||||
title: '状态',
|
||||
field: 'status',
|
||||
slots: { default: 'status' },
|
||||
},
|
||||
|
@ -3,7 +3,7 @@ import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenDrawer } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep, listToTree } from '@vben/utils';
|
||||
import { cloneDeep, eachTree, listToTree } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter';
|
||||
import { menuList, tenantPackageMenuTreeSelect } from '#/api/system/menu';
|
||||
@ -45,6 +45,10 @@ const menuTree = ref<any[]>([]);
|
||||
async function setupMenuTree() {
|
||||
const resp = await menuList();
|
||||
const treeData = listToTree(resp, { id: 'menuId' });
|
||||
// i18n处理
|
||||
eachTree(treeData, (node) => {
|
||||
node.menuName = $t(node.menuName);
|
||||
});
|
||||
// 设置菜单信息
|
||||
menuTree.value = treeData;
|
||||
}
|
||||
@ -122,7 +126,7 @@ function handleMenuCheckStrictlyChange(value: boolean) {
|
||||
ref="menuSelectRef"
|
||||
v-bind="slotProps"
|
||||
:check-strictly="formApi.form.values.menuCheckStrictly"
|
||||
:expand-all-on-init="true"
|
||||
:expand-all-on-init="false"
|
||||
:field-names="{ title: 'menuName', key: 'menuId' }"
|
||||
:tree-data="menuTree"
|
||||
@check-strictly-change="handleMenuCheckStrictlyChange"
|
||||
|
Loading…
Reference in New Issue
Block a user