fix: 优化初始化菜单配置

This commit is contained in:
XieYongHong 2023-11-02 10:13:57 +08:00
parent 33c92b72e1
commit e1e1ed4a27
6 changed files with 248 additions and 11 deletions

View File

@ -25,7 +25,7 @@
"event-source-polyfill": "^1.0.31",
"global": "^4.4.0",
"jetlinks-store": "^0.0.3",
"jetlinks-ui-components": "^1.0.34-4",
"jetlinks-ui-components": "^1.0.34-7",
"js-cookie": "^3.0.1",
"jsencrypt": "^3.3.2",
"less": "^4.1.3",

View File

@ -320,6 +320,9 @@ export const handleSiderMenu = (menuData: any[]) => {
if (menuData && menuData.length) {
return menuData.map(item => {
const { isApp, appUrl } = hasAppID(item) // 是否为第三方程序
if ( item.options?.isShow !== undefined && item.isShow === undefined) {
item.isShow = item.options.isShow
}
const meta = handleMeta(item, isApp)
const route: any = {
path: isApp ? appUrl : `${item.url}`,
@ -333,7 +336,7 @@ export const handleSiderMenu = (menuData: any[]) => {
route.children = handleSiderMenu(route.children)
}
route.meta.hideInMenu = hideInMenu(item.code)
// route.meta.hideInMenu = hideInMenu(item.code)
return route
})

View File

@ -101,9 +101,9 @@ const menuCount = (menus: any[]) => {
*/
const dealMenu = (data:any) =>{
data.forEach((item:any)=>{
item.options = {
show: true
}
item.options = Object.assign({
show: true
}, item?.options || {})
if(item.children){
dealMenu(item.children)
}
@ -139,4 +139,4 @@ defineExpose({
margin-right: 16px;
}
}
</style>
</style>

View File

@ -13,6 +13,9 @@ export const USER_CENTER_MENU_DATA = {
sortIndex: 9999,
granted: true,
owner: 'iot',
options: {
isShow: false,
},
permissions: [
{
permission: 'system_config',
@ -4588,5 +4591,236 @@ export default [
supportDataAccess: false
},
],
},
{
"id": "50a4a0582cc8b93590475efc96ffa86e",
"path": "3nkE",
"sortIndex": 5,
"level": 1,
"owner": "iot",
"name": "低码菜单",
"code": "code",
"url": "/code",
"icon": "MenuUnfoldOutlined",
showPage: ["low-code-editor","process-deployment", "low-code-info"],
"options": {
isShow: false,
},
"accessSupport": {
"text": "不支持",
"value": "unsupported"
},
"indirectMenus": [],
permissions: [
{
"permission": "low-code-info",
"actions": [
"add", "query", "save", "delete"
]
},
{
"permission": "low-code-editor",
"actions": [
"query", "deploy"
]
}
],
"buttons": [
{
"id": "form_query",
"name": "流程表单-查询",
"permissions": [
{
"permission": "process-form",
"actions": [
"query"
]
}
]
},
{
"id": "form_save",
"name": "流程表单-保存",
"permissions": [
{
"permission": "process-form",
"actions": [
"save"
]
}
]
},
{
"id": "form_delete",
"name": "流程表单-删除",
"permissions": [
{
"permission": "process-form",
"actions": [
"delete"
]
}
]
},
{
"id": "definition_query",
"name": "流程定义-查询",
"permissions": [
{
"permission": "process-definition",
"actions": [
"query"
]
}
]
},
{
"id": "definition_save",
"name": "流程定义-保存",
"permissions": [
{
"permission": "process-definition",
"actions": [
"save"
]
}
]
},
{
"id": "definition_delete",
"name": "流程定义-删除",
"permissions": [
{
"permission": "process-definition",
"actions": [
"delete"
]
}
]
},
{
"id": "release_query",
"name": "流程部署-查询",
"permissions": [
{
"permission": "process-deployment",
"actions": [
"query"
]
}
]
},
{
"id": "release_save",
"name": "流程部署-保存",
"permissions": [
{
"permission": "process-deployment",
"actions": [
"save"
]
}
]
},
{
"id": "release_delete",
"name": "流程部署-删除",
"permissions": [
{
"permission": "process-deployment",
"actions": [
"delete"
]
}
]
},
{
"id": "runtime-dismiss",
"name": "流程运行时-驳回任务",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"reject"
]
}
]
},
{
"id": "runtime-initiate",
"name": "流程运行时-发起流程",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"start"
]
}
]
},
{
"id": "runtime-mine",
"name": "流程运行时-我的流程",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"self"
]
}
]
},
{
"id": "runtime-sign",
"name": "流程运行时-签收任务",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"claim"
]
}
]
},
{
"id": "runtime-complete",
"name": "流程运行时-完成任务",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"complete"
]
}
]
},
{
"id": "runtime-create",
"name": "流程运行时-创建/启动流程",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"createAndStart"
]
}
]
},
{
"id": "runtime-revoke",
"name": "流程运行时-撤销流程",
"permissions": [
{
"permission": "process-runtime",
"actions": [
"repeal"
]
}
]
}
],
"creatorId": "1199596756811550720",
"createTime": 1698735482730,
"supportDataAccess": false
}
];

View File

@ -386,7 +386,7 @@ const form = reactive({
const params = {
...form.data,
owner: form.data?.owner ?? null,
options: { show: true },
options: form.data?.options || { show: true },
accessSupport: {
value: accessSupportValue,
label:

View File

@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3:
resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz"
integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==
jetlinks-ui-components@^1.0.34-4:
version "1.0.34-4"
resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-4.tgz#92cfc6be685988385a489f3e924383c4831f3ed5"
integrity sha512-td+RgaBC5lQxRuDsHkCg9UEzCcSy4XikufnabVGz5IxU+UmXu+PJUjz2wo9vDe8sPSctyk/5jQU+N6GBPlp8JA==
jetlinks-ui-components@^1.0.34-7:
version "1.0.34-7"
resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-7.tgz#3a14e85edb4c5d11427d30f3925dc5f498478940"
integrity sha512-Rgbjig3QYP8CDVHLbco20Cf7sArYralO8yWtH5E5zylYAN2lINLUsgOlIVf9aweszZR/Ps+z/NLP0CoRQf1Xtw==
dependencies:
"@vueuse/core" "^9.12.0"
"@vueuse/router" "^9.13.0"