@pubinfo/module-rbac 2.0.0-beta.9 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ComponentSelect-AWuDE4De.js +2 -0
- package/dist/ComponentSelect-CFoCrAFh.js +483 -0
- package/dist/DynamicRoutesForm-DmQMP8-p.js +376 -0
- package/dist/DynamicRoutesForm-xXTdh5EX.js +4 -0
- package/dist/HCheckList-DDP7S_nc.js +37 -0
- package/dist/HCheckList-u43x0KiD.js +2 -0
- package/dist/ImportExport-BbZkZEW_.js +4 -0
- package/dist/ImportExport-Yt6dABIv.js +354 -0
- package/dist/MetaForm-BB80P4w6.js +284 -0
- package/dist/MetaForm-D_na1CP8.js +4 -0
- package/dist/OrgAndPosition-BK5MTlOO.js +188 -0
- package/dist/OrgAndPosition-CDCim7yM.js +2 -0
- package/dist/ResourceEdit-CVwNJMVm.js +309 -0
- package/dist/ResourceEdit-D1e8tLAA.js +8 -0
- package/dist/ResourceRelation-DJDFQYFT.js +93 -0
- package/dist/ResourceRelation-DWhWzKQJ.js +3 -0
- package/dist/ResourceRelation-cfGS-erP.js +78 -0
- package/dist/ResourceSelector-B4AXXCxI.js +247 -0
- package/dist/RoleRelation-BlWDNAM1.js +79 -0
- package/dist/RoleRelation-CAMzPMFz.js +2 -0
- package/dist/RoleSelector-Bqv2p_7X.js +279 -0
- package/dist/TenantEdit-6rMUS9EP.js +253 -0
- package/dist/TenantEdit-BhpSW4w7.js +6 -0
- package/dist/UserAuthorization-Cx9oYms2.js +238 -0
- package/dist/UserAuthorization-D5rSSagE.js +4 -0
- package/dist/UserEdit-CqH6hxTZ.js +336 -0
- package/dist/UserEdit-CqrRx717.js +4 -0
- package/dist/_plugin-vue_export-helper-Cmy-mbsL.js +6 -0
- package/dist/add-child-CJM7MvB2.js +2 -0
- package/dist/animation_item-Bf_Y_nyf.js +4536 -0
- package/dist/animation_item-Wmcl4yBo.js +2 -0
- package/dist/api/modules/assist/qunzujiekou.d.ts +7 -0
- package/dist/api/modules/configData/index.d.ts +1 -1
- package/dist/api/modules/configData/{zidianfuwu.d.ts → zidifuwu.d.ts} +14 -0
- package/dist/api/modules/rbac/gangweijiekou.d.ts +7 -0
- package/dist/api/modules/rbac/index.d.ts +1 -0
- package/dist/api/modules/rbac/pubJiaosezukongzhiqi.d.ts +7 -0
- package/dist/api/modules/rbac/yonghujiekou.d.ts +21 -0
- package/dist/api/modules/rbac/ziyuandaorudaochuxiangguanjiekou.d.ts +43 -0
- package/dist/api/modules/rbac/ziyuanjiekou.d.ts +7 -0
- package/dist/api/request.d.ts +1 -1
- package/dist/authority-BofK2fFE.js +2 -0
- package/dist/authorize-Ck1i_5K5.js +2 -0
- package/dist/blackWhiteList-B-EAyXzG.js +213 -0
- package/dist/blacklist-disable-BgMERGDX.js +2 -0
- package/dist/blacklist-enable-D8ds6NgH.js +2 -0
- package/dist/breadcrumb_setting-Bv12pA15.js +111 -0
- package/dist/browser-chrome-BVvmyPYW.js +2 -0
- package/dist/browser-edge-Bc36eH7f.js +2 -0
- package/dist/browser-ie-BiDFft9C.js +2 -0
- package/dist/browser-other-BzyOvDmB.js +2 -0
- package/dist/browser-safari-CBxgFrI_.js +2 -0
- package/dist/browserType-BJeH2o0t.js +26 -0
- package/dist/browserType-pMY0VZ_3.js +2 -0
- package/dist/chunk-B3eAFu3c.js +11 -0
- package/dist/cloneDeep-BnvyNhik.js +7 -0
- package/dist/components/DirectoryIcones/ComponentsIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/FolderIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/ModuleIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/PackagesIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/SrcIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/ViewIcones.vue.d.ts +7 -0
- package/dist/components/DirectoryIcones/VueIcones.vue.d.ts +2 -0
- package/dist/components/GroupSelector/index.vue.d.ts +4 -4
- package/dist/components/OrgTree/index.vue.d.ts +1 -1
- package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +7 -7
- package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +7 -7
- package/dist/components/OrgUserSelector/index.d.ts +3 -2
- package/dist/components/ResourceIcones/Select.vue.d.ts +9 -0
- package/dist/components/ResourceSelector/index.vue.d.ts +5 -5
- package/dist/components/RoleSelector/RoleSearch.vue.d.ts +19 -0
- package/dist/components/RoleSelector/RoleSelector.vue.d.ts +20 -0
- package/dist/components/RoleSelector/TooltipLabel.vue.d.ts +8 -0
- package/dist/components/RoleSelector/index.d.ts +2 -0
- package/dist/components/RoleSelector/interface.d.ts +4 -0
- package/dist/components/RoleSelector/useRole.d.ts +13 -0
- package/dist/composables/useLottie.d.ts +1 -1
- package/dist/configData-BoeH9I4s.js +86 -0
- package/dist/context.d.ts +3 -0
- package/dist/createAndEditDataPermission-BFmD3zpY.js +443 -0
- package/dist/createAndEditDataPermission-Ll6GWW-p.js +8 -0
- package/dist/data-permission-Dz4eCdAg.js +156 -0
- package/dist/dayjs.min-KffHrkDe.js +297 -0
- package/dist/dictionary-C8UVX_8l.js +180 -0
- package/dist/drawerBlackWhiteList-opDsd2_O.js +125 -0
- package/dist/drawerBlackWhiteList-taaV8A5D.js +3 -0
- package/dist/drawerDictionary-CzT9KJGw.js +130 -0
- package/dist/drawerDictionary-D0Bi75vl.js +4 -0
- package/dist/drawerDictionaryItem-BqQojUNh.js +4 -0
- package/dist/drawerDictionaryItem-LBeuvrE8.js +142 -0
- package/dist/drawerGroup-BI0pYuIO.js +3 -0
- package/dist/drawerGroup-B_pYqrpy.js +188 -0
- package/dist/drawerOrganization-BeDsW0ah.js +251 -0
- package/dist/drawerOrganization-RbLK6k_c.js +3 -0
- package/dist/drawerPosition-CKZCt-Yc.js +3 -0
- package/dist/drawerPosition-DRacJCCQ.js +170 -0
- package/dist/drawerRegion-BM__zqtq.js +187 -0
- package/dist/drawerRegion-CaXvxWEn.js +3 -0
- package/dist/drawerRole-27ggtdnJ.js +6 -0
- package/dist/drawerRole-BOf6UXMc.js +172 -0
- package/dist/drawerRole-CQURGn5D.js +215 -0
- package/dist/drawerRole-D9Dt3l7O.js +5 -0
- package/dist/drawerRole-DPC9SVDe.js +3 -0
- package/dist/drawerRole-DhU_4L0Z.js +159 -0
- package/dist/edit-DF7Qsxtl.js +2 -0
- package/dist/enum-BMY6bmPA.js +54 -0
- package/dist/enum-BZtNAeJC.js +23 -0
- package/dist/enum-CtIne-Ul.js +61 -0
- package/dist/enum-DfCD4cL8.js +4 -0
- package/dist/enum-e5LlvaOv.js +4 -0
- package/dist/group-C0rajn0e.js +174 -0
- package/dist/icard-CtletXtq.js +2 -0
- package/dist/icon_animation-Do8Rw-K9.js +2 -0
- package/dist/icon_breadcrumb-CmZgmswj.js +2 -0
- package/dist/icon_copyright--7CIXSE1.js +2 -0
- package/dist/icon_jt--G-Amuu4.js +2 -0
- package/dist/icon_layout-BkQems5J.js +2 -0
- package/dist/icon_mainpage-98dHnXRL.js +2 -0
- package/dist/icon_menu-8foYPA9U.js +2 -0
- package/dist/icon_page_size-CPjiZpP2.js +2 -0
- package/dist/icon_position_type-Do71e9Ov.js +2 -0
- package/dist/icon_safe_manage-DiBn-uSS.js +2 -0
- package/dist/icon_screen_scale-Ct8iHVKy.js +2 -0
- package/dist/icon_system_manage-CzBNNisy.js +2 -0
- package/dist/icon_tabbar-BajHaWfA.js +2 -0
- package/dist/icon_toolbar-DHKFZD2w.js +2 -0
- package/dist/icon_topbar-C4mu7up7.js +2 -0
- package/dist/icon_watermark-2Wtjrft3.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6873 -5
- package/dist/interface.d.ts +27 -3
- package/dist/itemlist-CZBPz_rC.js +157 -0
- package/dist/layout_setting-oQd8BfKx.js +74 -0
- package/dist/log-CQfCPTsC.js +14 -0
- package/dist/log-center-qtOWNEaD.js +2 -0
- package/dist/loginHistoryDetail-Abn9eS5-.js +78 -0
- package/dist/loginHistoryDetail-DDEuFbYB.js +4 -0
- package/dist/login_history-Btv9KB0x.js +196 -0
- package/dist/menu_setting-Cju5OkSE.js +158 -0
- package/dist/not-data-BA50qHBT.js +2 -0
- package/dist/not-data-BzaRFolb.js +2 -0
- package/dist/operateHistoryDetail-Br_M3mhI.js +90 -0
- package/dist/operateHistoryDetail-CLsHDBp7.js +4 -0
- package/dist/operate_history-D7jq2IH-.js +191 -0
- package/dist/org-main-D0M4-Mu2.js +2 -0
- package/dist/org-unmain-Bh9hzLgK.js +2 -0
- package/dist/organization-CeOyltjo.js +15605 -0
- package/dist/other_setting-rbUoVood.js +220 -0
- package/dist/page_animation_setting-Diclx4mg.js +117 -0
- package/dist/page_w_setting-Dr2tu_oS.js +69 -0
- package/dist/position-Bodjtnh9.js +168 -0
- package/dist/region-B9xObK4Z.js +185 -0
- package/dist/remove-B3pgrGrf.js +2 -0
- package/dist/resource-DhkRTloI.js +270 -0
- package/dist/resource-app-BKgfDs09.js +2 -0
- package/dist/resource-btn-BXLyUStb.js +2 -0
- package/dist/resource-dynamic-Dx3RhbQk.js +2 -0
- package/dist/resource-index-C2COvmY-.js +2 -0
- package/dist/resource-menu-C_Q6AEFw.js +2 -0
- package/dist/resource-micro-D_OBvoET.js +2 -0
- package/dist/resource-nonmenu-CCpeV9Km.js +2 -0
- package/dist/role-DoBrQ1zG.js +196 -0
- package/dist/role_group-BMNZ1M1A.js +172 -0
- package/dist/routes/index.d.ts +3 -1
- package/dist/routes/modules/authority.manage.menu.d.ts +1 -1
- package/dist/routes/modules/log.manage.menu.d.ts +1 -1
- package/dist/routes/modules/safe.manage.menu.d.ts +1 -1
- package/dist/routes/modules/stylesetting.manage.menu.d.ts +1 -1
- package/dist/routes/modules/system.manage.menu.d.ts +1 -1
- package/dist/safe_setting-J6GWqrZx.js +232 -0
- package/dist/setItem-CcNK_f8V.js +77 -0
- package/dist/setItem-CqHPfTBZ.js +5 -0
- package/dist/setting-manage-Di7-Ks18.js +2 -0
- package/dist/stores-DXQ1Ibt6.js +2 -0
- package/dist/style.css +2 -1
- package/dist/tabbar_setting-Di3OcDig.js +142 -0
- package/dist/tenant-pPYq3xtM.js +183 -0
- package/dist/theme-check-mark-DhhsmM5v.js +2 -0
- package/dist/theme-title-DEVFVYNh.js +2 -0
- package/dist/theme_setting-DMyPJp3M.js +117 -0
- package/dist/{index-BleenJqT.js → toolbar_setting-ChcZxAJJ.js} +155 -167
- package/dist/useAppAndResource-DWQG9bqY.js +57 -0
- package/dist/user-BJL1Sw0q.js +345 -0
- package/dist/view-FR2dRATN.js +2 -0
- package/dist/views/blackWhiteList/components/drawerBlackWhiteList.vue.d.ts +4 -4
- package/dist/views/blackWhiteList/index.vue.d.ts +319 -319
- package/dist/views/breadcrumb_setting/index.vue.d.ts +1 -1
- package/dist/views/components/HCheckList.vue.d.ts +5 -5
- package/dist/views/components/animation_item.vue.d.ts +5 -5
- package/dist/views/components/setItem.vue.d.ts +18 -18
- package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +35 -35
- package/dist/views/data-permission/index.vue.d.ts +350 -350
- package/dist/views/dictionary/components/drawerDictionary.vue.d.ts +4 -4
- package/dist/views/dictionary/components/drawerDictionaryItem.vue.d.ts +4 -4
- package/dist/views/dictionary/index.vue.d.ts +319 -319
- package/dist/views/dictionary/itemlist.vue.d.ts +319 -319
- package/dist/views/group/components/drawerGroup.vue.d.ts +4 -4
- package/dist/views/group/index.vue.d.ts +319 -319
- package/dist/views/layout_setting/index.vue.d.ts +1 -1
- package/dist/views/log_center/components/browserType.vue.d.ts +3 -3
- package/dist/views/log_center/components/loginHistoryDetail.vue.d.ts +4 -4
- package/dist/views/log_center/components/operateHistoryDetail.vue.d.ts +4 -4
- package/dist/views/log_center/login_history.vue.d.ts +315 -315
- package/dist/views/log_center/operate_history.vue.d.ts +315 -315
- package/dist/views/menu_setting/index.vue.d.ts +1 -1
- package/dist/views/organization/components/drawerOrganization.vue.d.ts +4 -4
- package/dist/views/organization/components/drawerRole.vue.d.ts +18 -10
- package/dist/views/organization/index.vue.d.ts +23 -15
- package/dist/views/other_setting/index.vue.d.ts +1 -1
- package/dist/views/page_animation_setting/index.vue.d.ts +1 -1
- package/dist/views/page_w_setting/index.vue.d.ts +1 -1
- package/dist/views/position/components/drawerPosition.vue.d.ts +4 -4
- package/dist/views/position/index.vue.d.ts +319 -319
- package/dist/views/region/components/drawerRegion.vue.d.ts +4 -4
- package/dist/views/region/index.vue.d.ts +319 -319
- package/dist/views/resource/components/ComponentSelect.vue.d.ts +12 -0
- package/dist/views/resource/components/DynamicRoutesForm.vue.d.ts +13 -0
- package/dist/views/resource/components/ImportExport.vue.d.ts +13 -0
- package/dist/views/resource/components/MetaForm.vue.d.ts +10 -0
- package/dist/views/resource/components/ResourceEdit.vue.d.ts +4 -4
- package/dist/views/resource/components/RoleRelation.vue.d.ts +2 -2
- package/dist/views/resource/enum.d.ts +6 -13
- package/dist/views/resource/hooks/useMetaForm.d.ts +6 -0
- package/dist/views/resource/index.vue.d.ts +343 -321
- package/dist/views/resource/interface.d.ts +4 -1
- package/dist/views/resource/model.d.ts +37 -0
- package/dist/views/role/components/ResourceRelation.vue.d.ts +316 -316
- package/dist/views/role/components/drawerRole.vue.d.ts +10 -10
- package/dist/views/role/index.vue.d.ts +642 -642
- package/dist/views/role_group/components/drawerRole.vue.d.ts +18 -10
- package/dist/views/role_group/index.vue.d.ts +333 -325
- package/dist/views/safe_setting/index.vue.d.ts +1 -1
- package/dist/views/tabbar_setting/index.vue.d.ts +1 -1
- package/dist/views/tenant/components/TenantEdit.vue.d.ts +10 -10
- package/dist/views/tenant/index.vue.d.ts +325 -325
- package/dist/views/theme_setting/index.vue.d.ts +1 -1
- package/dist/views/toolbar_setting/index.vue.d.ts +1 -1
- package/dist/views/user/components/OrgAndPosition.vue.d.ts +3 -3
- package/dist/views/user/components/UserAuthorization.vue.d.ts +18 -10
- package/dist/views/user/components/UserEdit.vue.d.ts +4 -4
- package/dist/views/user/index.vue.d.ts +337 -329
- package/dist/views/watermark_setting/index.vue.d.ts +9 -9
- package/dist/watermark_setting-tqYUcPzF.js +199 -0
- package/dist/zddata-D9x-CcqP.js +2 -0
- package/dist/zy_checked-B0r0BaR-.js +2 -0
- package/dist/zy_default-BHbIn4if.js +2 -0
- package/package.json +14 -14
- package/src/api/modules/assist/gonggaofuwu.ts +24 -9
- package/src/api/modules/assist/index.ts +0 -2
- package/src/api/modules/assist/qunzujiekou.ts +37 -7
- package/src/api/modules/assist/quyujiekou.ts +12 -3
- package/src/api/modules/assist/typings.d.ts +62 -58
- package/src/api/modules/configData/heibaimingdanfuwu.ts +12 -3
- package/src/api/modules/configData/index.ts +1 -3
- package/src/api/modules/configData/typings.d.ts +84 -74
- package/src/api/modules/configData/xitongpeizhifuwu.ts +39 -15
- package/src/api/modules/configData/{zidianfuwu.ts → zidifuwu.ts} +80 -8
- package/src/api/modules/log/caozuorizhifuwu.ts +8 -2
- package/src/api/modules/log/denglurizhifuwu.ts +8 -2
- package/src/api/modules/log/index.ts +0 -2
- package/src/api/modules/log/typings.d.ts +29 -25
- package/src/api/modules/rbac/gangweijiekou.ts +44 -8
- package/src/api/modules/rbac/index.ts +1 -2
- package/src/api/modules/rbac/jiaosejiekou.ts +24 -9
- package/src/api/modules/rbac/pubJiaosezukongzhiqi.ts +45 -6
- package/src/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.ts +26 -12
- package/src/api/modules/rbac/typings.d.ts +419 -296
- package/src/api/modules/rbac/yonghujiekou.ts +115 -13
- package/src/api/modules/rbac/yonghushoucangbiaojiekou.ts +20 -5
- package/src/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +12 -3
- package/src/api/modules/rbac/ziyuandaorudaochuxiangguanjiekou.ts +158 -0
- package/src/api/modules/rbac/ziyuanjiekou.ts +43 -4
- package/src/api/modules/rbac/zuhuguanlijiekou.ts +20 -11
- package/src/api/modules/rbac/zuzhijiaosebiaokongzhiqi.ts +12 -3
- package/src/api/modules/rbac/zuzhijiekou.ts +28 -10
- package/src/api/request.ts +3 -2
- package/src/assets/icons/resource-dynamic.svg +39 -0
- package/src/assets/icons/resource-micro.svg +40 -0
- package/src/components/DirectoryIcones/ComponentsIcones.vue +18 -0
- package/src/components/DirectoryIcones/FolderIcones.vue +18 -0
- package/src/components/DirectoryIcones/ModuleIcones.vue +18 -0
- package/src/components/DirectoryIcones/PackagesIcones.vue +18 -0
- package/src/components/DirectoryIcones/SrcIcones.vue +18 -0
- package/src/components/DirectoryIcones/ViewIcones.vue +18 -0
- package/src/components/DirectoryIcones/VueIcones.vue +9 -0
- package/src/components/GroupSelector/index.vue +64 -89
- package/src/components/OrgTree/index.vue +2 -2
- package/src/components/OrgUserSelector/index.ts +5 -0
- package/src/components/OrgUserSelector/provider.ts +1 -1
- package/src/components/ResourceIcones/Select.vue +240 -0
- package/src/components/ResourceSelector/index.vue +33 -50
- package/src/components/RoleSelector/RoleSearch.vue +60 -0
- package/src/components/RoleSelector/RoleSelector.vue +174 -0
- package/src/components/RoleSelector/TooltipLabel.vue +24 -0
- package/src/components/RoleSelector/index.ts +2 -0
- package/src/components/RoleSelector/interface.ts +4 -0
- package/src/components/RoleSelector/useRole.ts +56 -0
- package/src/context.ts +20 -0
- package/src/index.ts +21 -18
- package/src/interface.ts +31 -2
- package/src/routes/index.ts +9 -5
- package/src/routes/modules/authority.manage.menu.ts +0 -13
- package/src/routes/modules/log.manage.menu.ts +0 -8
- package/src/routes/modules/safe.manage.menu.ts +0 -12
- package/src/routes/modules/stylesetting.manage.menu.ts +0 -16
- package/src/routes/modules/system.manage.menu.ts +0 -10
- package/src/views/blackWhiteList/components/drawerBlackWhiteList.vue +1 -1
- package/src/views/blackWhiteList/index.vue +14 -26
- package/src/views/breadcrumb_setting/index.vue +3 -3
- package/src/views/components/animation_item.vue +2 -2
- package/src/views/components/setItem.vue +13 -20
- package/src/views/data-permission/components/createAndEditDataPermission.vue +4 -4
- package/src/views/data-permission/enum.ts +7 -7
- package/src/views/data-permission/index.vue +9 -12
- package/src/views/dictionary/components/drawerDictionary.vue +1 -1
- package/src/views/dictionary/components/drawerDictionaryItem.vue +1 -1
- package/src/views/dictionary/index.vue +3 -3
- package/src/views/dictionary/itemlist.vue +3 -3
- package/src/views/group/components/drawerGroup.vue +2 -2
- package/src/views/group/index.vue +13 -18
- package/src/views/layout_setting/index.vue +154 -164
- package/src/views/log_center/components/loginHistoryDetail.vue +6 -8
- package/src/views/log_center/components/operateHistoryDetail.vue +6 -8
- package/src/views/log_center/login_history.vue +6 -11
- package/src/views/log_center/operate_history.vue +6 -11
- package/src/views/menu_setting/index.vue +3 -3
- package/src/views/organization/components/drawerOrganization.vue +3 -3
- package/src/views/organization/components/drawerRole.vue +9 -7
- package/src/views/organization/index.vue +23 -49
- package/src/views/other_setting/index.vue +2 -2
- package/src/views/page_animation_setting/index.vue +10 -18
- package/src/views/page_w_setting/index.vue +133 -116
- package/src/views/position/components/drawerPosition.vue +2 -2
- package/src/views/position/index.vue +1 -1
- package/src/views/region/components/drawerRegion.vue +2 -2
- package/src/views/region/index.vue +1 -1
- package/src/views/resource/components/ComponentSelect.vue +375 -0
- package/src/views/resource/components/DynamicRoutesForm.vue +92 -0
- package/src/views/resource/components/ImportExport.vue +313 -0
- package/src/views/resource/components/MetaForm.vue +119 -0
- package/src/views/resource/components/ResourceEdit.vue +144 -73
- package/src/views/resource/components/RoleRelation.vue +1 -1
- package/src/views/resource/enum.ts +12 -13
- package/src/views/resource/hooks/useMetaForm.ts +103 -0
- package/src/views/resource/index.vue +59 -32
- package/src/views/resource/interface.ts +5 -1
- package/src/views/resource/model.ts +53 -0
- package/src/views/role/components/ResourceRelation.vue +3 -4
- package/src/views/role/components/drawerRole.vue +3 -3
- package/src/views/role/index.vue +1 -1
- package/src/views/role_group/components/ResourceRelation.vue +3 -4
- package/src/views/role_group/components/drawerRole.vue +8 -7
- package/src/views/role_group/index.vue +1 -1
- package/src/views/safe_setting/index.vue +5 -7
- package/src/views/tabbar_setting/index.vue +2 -2
- package/src/views/tenant/components/TenantEdit.vue +1 -1
- package/src/views/tenant/index.vue +1 -1
- package/src/views/theme_setting/index.vue +202 -231
- package/src/views/toolbar_setting/index.vue +3 -3
- package/src/views/user/components/OrgAndPosition.vue +2 -2
- package/src/views/user/components/UserAuthorization.vue +13 -12
- package/src/views/user/components/UserEdit.vue +1 -1
- package/src/views/user/index.vue +1 -1
- package/src/views/watermark_setting/index.vue +8 -15
- package/dist/OrgSelector.vue_vue_type_script_setup_true_lang-BcL0IFuA.js +0 -567
- package/dist/_baseClone-CQ44TFeq.js +0 -191
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/animation_item.vue_vue_type_script_setup_true_lang-BQvmwheq.js +0 -4864
- package/dist/browserType.vue_vue_type_script_setup_true_lang-Cv8wph6G.js +0 -38
- package/dist/cloneDeep-BI4WNBQ9.js +0 -8
- package/dist/enum-BEHz_Q18.js +0 -74
- package/dist/enum-C9ihxJe7.js +0 -4
- package/dist/enum-CTUzwCYG.js +0 -4
- package/dist/enum-DDKThkSw.js +0 -24
- package/dist/gangweijiekou-BxJq_m0o.js +0 -46
- package/dist/index-BS45K9vK.js +0 -685
- package/dist/index-Bbsiwecf.js +0 -1631
- package/dist/index-BhcAk-IH.js +0 -399
- package/dist/index-Bl4v-7On.js +0 -125
- package/dist/index-CFPhIFyG.js +0 -140
- package/dist/index-CLSeuhTv.js +0 -872
- package/dist/index-CLxqmFPw.js +0 -317
- package/dist/index-CTiFd9M0.js +0 -303
- package/dist/index-Cej8u1qo.js +0 -274
- package/dist/index-Cr17VOfm.js +0 -389
- package/dist/index-CsHj-xDw.js +0 -283
- package/dist/index-D0yB_8b0.js +0 -181
- package/dist/index-DFR8dd2B.js +0 -785
- package/dist/index-DNf0NPrD.js +0 -131
- package/dist/index-Dm4sOX43.js +0 -27
- package/dist/index-KboUdpTh.js +0 -18588
- package/dist/index-MtXfNGqS.js +0 -1246
- package/dist/index-U8kjKY6p.js +0 -462
- package/dist/index-UZeQsp70.js +0 -177
- package/dist/index-a0E9oj3q.js +0 -703
- package/dist/index-gmUZUdNl.js +0 -634
- package/dist/index-j_ln_NSt.js +0 -455
- package/dist/index-s32GbmsJ.js +0 -164
- package/dist/index-yEpViVkx.js +0 -409
- package/dist/index-zh8PZXw2.js +0 -862
- package/dist/itemlist-xAbIKRVj.js +0 -369
- package/dist/jiaosejiekou-BfY4h7uI.js +0 -58
- package/dist/login_history-CuQv9Iw3.js +0 -430
- package/dist/operate_history-CGP-1Xy2.js +0 -468
- package/dist/pubJiaosezukongzhiqi-CvYfc8Uz.js +0 -57
- package/dist/request-DQLgc7lT.js +0 -5
- package/dist/setItem-DkOvmWXP.js +0 -152
- package/dist/shujuquanxianzhubiaokongzhiqi-DyNgf1y6.js +0 -65
- package/dist/useAppAndResource-D_b19V4t.js +0 -55
- package/dist/views/organization/components/roleSelect.vue.d.ts +0 -14
- package/dist/views/role_group/components/roleSelect.vue.d.ts +0 -14
- package/dist/views/user/components/roleSelect.vue.d.ts +0 -14
- package/dist/xitongpeizhifuwu-C1Vm-W1B.js +0 -23
- package/dist/zidianfuwu-yCWHhOfO.js +0 -65
- package/dist/ziyuanjiekou-DhrAbneq.js +0 -69
- package/dist/zuzhijiaosebiaokongzhiqi-B1g74RqL.js +0 -28
- package/dist/zuzhijiekou-PeZuFtCO.js +0 -85
- package/src/assets/icons/403.svg +0 -1
- package/src/assets/icons/403_dark.svg +0 -1
- package/src/assets/icons/404.svg +0 -1
- package/src/assets/icons/404_dark.svg +0 -1
- package/src/assets/icons/browser-360.svg +0 -1
- package/src/assets/icons/browser-qq.svg +0 -1
- package/src/assets/icons/browser-uc.svg +0 -1
- package/src/assets/icons/change-org.svg +0 -1
- package/src/assets/icons/empty-data.svg +0 -1
- package/src/assets/icons/favorites.svg +0 -1
- package/src/assets/icons/image-load-fail.svg +0 -1
- package/src/assets/icons/logo-sig.svg +0 -1
- package/src/assets/icons/logo.svg +0 -1
- package/src/assets/icons/mima.svg +0 -1
- package/src/assets/icons/process-management.svg +0 -1
- package/src/assets/icons/project-management.svg +0 -1
- package/src/assets/icons/rbac.svg +0 -1
- package/src/assets/icons/test.svg +0 -1
- package/src/assets/icons/toolbar-collapse.svg +0 -1
- package/src/assets/icons/tree_icon.svg +0 -1
- package/src/assets/icons/tree_icon_checked.svg +0 -1
- package/src/assets/icons/workbench.svg +0 -1
- package/src/views/organization/components/roleSelect.vue +0 -258
- package/src/views/role_group/components/roleSelect.vue +0 -224
- package/src/views/user/components/roleSelect.vue +0 -258
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import type { Rule } from 'ant-design-vue/es/form';
|
|
3
3
|
import type { FormExpose } from 'ant-design-vue/es/form/Form';
|
|
4
4
|
import type { AddForm, EditForm, Form, TreeNode } from '../interface';
|
|
5
|
-
import { getRbacResourceInfo, postRbacResourceAddResource, postRbacResourceResourceUpdate } from '@/api/modules/rbac';
|
|
6
|
-
import { DATA_PERMISSION_TYPE, dataPermissionOptions } from '@/views/data-permission/enum';
|
|
7
5
|
import { useToggle } from '@vueuse/core';
|
|
8
6
|
import { message } from 'ant-design-vue';
|
|
9
7
|
import { cloneDeep } from 'lodash-es';
|
|
10
|
-
import {
|
|
8
|
+
import { getRbacResourceInfo, postRbacResourceAddResource, postRbacResourceResourceUpdate } from '@/api/modules/rbac';
|
|
9
|
+
import { DATA_PERMISSION_TYPE } from '@/views/data-permission/enum';
|
|
10
|
+
import { ACTION, RESOURCE_COLOR, RESOURCE_TYPE, resourceOptions } from '../enum';
|
|
11
|
+
import { useMetaForm } from '../hooks/useMetaForm';
|
|
12
|
+
import { defaultMeta } from '../model';
|
|
13
|
+
import DynamicRoutesForm from './DynamicRoutesForm.vue';
|
|
14
|
+
import MetaForm from './MetaForm.vue';
|
|
11
15
|
|
|
12
16
|
defineOptions({
|
|
13
17
|
name: 'ResourceEdit',
|
|
@@ -27,11 +31,15 @@ const state = reactive<{
|
|
|
27
31
|
title: '',
|
|
28
32
|
record: {},
|
|
29
33
|
initData: {
|
|
30
|
-
type: RESOURCE_TYPE.
|
|
34
|
+
type: RESOURCE_TYPE.DYNAMIC_APP,
|
|
31
35
|
sort: 0,
|
|
32
36
|
enable: true,
|
|
33
37
|
enableDataPermission: false,
|
|
34
38
|
dataPermissionType: DATA_PERMISSION_TYPE.ALL,
|
|
39
|
+
meta: {
|
|
40
|
+
url: '',
|
|
41
|
+
component: '',
|
|
42
|
+
},
|
|
35
43
|
},
|
|
36
44
|
});
|
|
37
45
|
|
|
@@ -44,7 +52,7 @@ const rules: Record<string, Rule[]> = {
|
|
|
44
52
|
};
|
|
45
53
|
|
|
46
54
|
const parentNode = computed(() => {
|
|
47
|
-
return recursiveTreeFind(props.dataSource, node => node.id === form.value.parentId);
|
|
55
|
+
return recursiveTreeFind(props.dataSource, node => node.id === form.value.parentId) ?? {};
|
|
48
56
|
});
|
|
49
57
|
function recursiveTreeFind<T extends { children?: T[] }>(tree: T[], fn: (node: T) => boolean) {
|
|
50
58
|
const list = [...tree];
|
|
@@ -62,41 +70,60 @@ function recursiveTreeFind<T extends { children?: T[] }>(tree: T[], fn: (node: T
|
|
|
62
70
|
const resourceComputedOptions = computed(() => {
|
|
63
71
|
switch (parentNode.value?.type) {
|
|
64
72
|
case RESOURCE_TYPE.APP:
|
|
73
|
+
case RESOURCE_TYPE.MICRO_APP:
|
|
74
|
+
case RESOURCE_TYPE.DYNAMIC_APP:
|
|
75
|
+
return resourceOptions.filter(node => [RESOURCE_TYPE.INDEX, RESOURCE_TYPE.MENU, RESOURCE_TYPE.IFRAME, RESOURCE_TYPE.LINK].includes(node.value));
|
|
76
|
+
|
|
65
77
|
case RESOURCE_TYPE.INDEX:
|
|
66
|
-
return resourceOptions.filter(node =>
|
|
78
|
+
return resourceOptions.filter(node => [RESOURCE_TYPE.INDEX, RESOURCE_TYPE.MENU, RESOURCE_TYPE.IFRAME, RESOURCE_TYPE.LINK, RESOURCE_TYPE.NON_MENU].includes(node.value));
|
|
67
79
|
|
|
68
80
|
case RESOURCE_TYPE.MENU:
|
|
69
81
|
case RESOURCE_TYPE.NON_MENU:
|
|
70
|
-
return resourceOptions.filter(node =>
|
|
82
|
+
return resourceOptions.filter(node => [RESOURCE_TYPE.BUTTON, RESOURCE_TYPE.NON_MENU].includes(node.value));
|
|
71
83
|
|
|
72
84
|
case RESOURCE_TYPE.BUTTON:
|
|
85
|
+
case RESOURCE_TYPE.IFRAME:
|
|
86
|
+
case RESOURCE_TYPE.LINK:
|
|
73
87
|
return [];
|
|
74
88
|
|
|
75
89
|
default:
|
|
76
|
-
return resourceOptions.filter(node =>
|
|
90
|
+
return resourceOptions.filter(node => [RESOURCE_TYPE.APP, RESOURCE_TYPE.MICRO_APP, RESOURCE_TYPE.DYNAMIC_APP].includes(node.value));
|
|
77
91
|
}
|
|
78
92
|
});
|
|
79
93
|
|
|
80
|
-
const
|
|
81
|
-
return form.value.type === RESOURCE_TYPE.BUTTON || form.value.type === RESOURCE_TYPE.MENU || form.value.type === RESOURCE_TYPE.NON_MENU;
|
|
82
|
-
});
|
|
94
|
+
const { show, resetIncompatibleOptions } = useMetaForm(form);
|
|
83
95
|
|
|
96
|
+
const [formLoading, setFormLoading] = useToggle(false);
|
|
84
97
|
async function onOpen(key: ACTION, record?: Form) {
|
|
85
98
|
state.title = key;
|
|
86
99
|
form.value = cloneDeep(state.initData);
|
|
87
100
|
setOpen(true);
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
102
|
+
try {
|
|
103
|
+
setFormLoading(true);
|
|
104
|
+
if (key === ACTION.ADD_CHILD) {
|
|
105
|
+
form.value.parentId = record?.id as string;
|
|
106
|
+
form.value.type = resourceComputedOptions.value[0].value;
|
|
93
107
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
108
|
+
// 清除不适用于当前资源类型的配置项,确保业务逻辑一致性
|
|
109
|
+
resetIncompatibleOptions();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (key === ACTION.EDIT) {
|
|
113
|
+
const res = await getRbacResourceInfo({ id: record?.id as string });
|
|
114
|
+
if (res.success) {
|
|
115
|
+
form.value = res.data ?? {};
|
|
116
|
+
// 合并默认 meta 对象和返回的 meta 对象,form.value.meta 优先
|
|
117
|
+
form.value.meta = { ...defaultMeta, ...res.data?.meta };
|
|
118
|
+
|
|
119
|
+
// 确保编辑现有资源时也遵循业务规则约束
|
|
120
|
+
resetIncompatibleOptions();
|
|
121
|
+
}
|
|
98
122
|
}
|
|
99
123
|
}
|
|
124
|
+
finally {
|
|
125
|
+
setFormLoading(false);
|
|
126
|
+
}
|
|
100
127
|
}
|
|
101
128
|
|
|
102
129
|
const [loading, setLoading] = useToggle(false);
|
|
@@ -104,13 +131,22 @@ function onSubmit() {
|
|
|
104
131
|
formRef.value?.validate().then(() => {
|
|
105
132
|
const params = {
|
|
106
133
|
...form.value,
|
|
134
|
+
icon: form.value.icon || undefined,
|
|
107
135
|
};
|
|
108
136
|
|
|
109
137
|
// app, 目录等不参与数据权限筛选
|
|
110
|
-
if (!
|
|
138
|
+
if (!show.value.dataPermission) {
|
|
111
139
|
params.enableDataPermission = false;
|
|
112
140
|
}
|
|
113
141
|
|
|
142
|
+
// 如果是开发模式的应用,给出警告提示
|
|
143
|
+
if (show.value.devMode && form.value.meta?.isDev) {
|
|
144
|
+
console.warn('开发模式应用的子路由将不会在生产环境中注册到vue-router,请确保这是预期行为。');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// 可以在提交前检查目录下是否有有效的子菜单,如果没有则给出提示
|
|
148
|
+
// 这部分逻辑可能需要额外的API调用来检查子资源
|
|
149
|
+
|
|
114
150
|
const promise
|
|
115
151
|
= state.title === ACTION.EDIT
|
|
116
152
|
? postRbacResourceResourceUpdate(params as EditForm)
|
|
@@ -138,62 +174,97 @@ defineExpose({
|
|
|
138
174
|
v-model:open="open"
|
|
139
175
|
:title="state.title"
|
|
140
176
|
placement="right"
|
|
141
|
-
:width="
|
|
177
|
+
:width="800"
|
|
142
178
|
destroy-on-close
|
|
143
179
|
:footer-style="{ textAlign: 'right' }"
|
|
144
180
|
>
|
|
145
|
-
<a-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
181
|
+
<a-spin :spinning="formLoading">
|
|
182
|
+
<a-form
|
|
183
|
+
ref="formRef"
|
|
184
|
+
:model="form"
|
|
185
|
+
:rules="rules"
|
|
186
|
+
:label-col="{ style: { width: '100px' } }"
|
|
187
|
+
>
|
|
188
|
+
<a-row :gutter="8">
|
|
189
|
+
<a-col v-if="parentNode?.name" :span="24">
|
|
190
|
+
<a-form-item name="parentId">
|
|
191
|
+
<template #label>
|
|
192
|
+
<DatabaseOutlined class="mr-1" />
|
|
193
|
+
父资源
|
|
194
|
+
</template>
|
|
195
|
+
{{ parentNode?.name }}
|
|
196
|
+
</a-form-item>
|
|
197
|
+
</a-col>
|
|
198
|
+
<a-col :span="24">
|
|
199
|
+
<a-form-item label="资源类型" name="type">
|
|
200
|
+
<div
|
|
201
|
+
v-if="state.title === ACTION.EDIT"
|
|
202
|
+
class="flex items-center space-x-1"
|
|
203
|
+
>
|
|
204
|
+
<!-- <PubinfoIcon v-if="form.type" :name="`resource-${RESOURCE_ICON[Number(form.type)]}`" class="text-xl" />
|
|
205
|
+
<span>
|
|
206
|
+
{{ resourceComputedOptions.find(e => e.value === form.type)?.label }}
|
|
207
|
+
</span> -->
|
|
208
|
+
|
|
209
|
+
<a-tag v-if="form.type" :color="RESOURCE_COLOR[Number(form.type)]" :bordered="false">
|
|
210
|
+
{{ resourceComputedOptions.find(e => e.value === form.type)?.label }}
|
|
211
|
+
</a-tag>
|
|
212
|
+
</div>
|
|
213
|
+
<a-radio-group
|
|
214
|
+
v-else
|
|
215
|
+
v-model:value="form.type"
|
|
216
|
+
:options="resourceComputedOptions"
|
|
217
|
+
option-type="button"
|
|
218
|
+
button-style="solid"
|
|
219
|
+
/>
|
|
220
|
+
</a-form-item>
|
|
221
|
+
</a-col>
|
|
222
|
+
</a-row>
|
|
223
|
+
<a-row :gutter="8">
|
|
224
|
+
<a-col :span="12">
|
|
225
|
+
<a-form-item label="资源名称" name="name">
|
|
226
|
+
<a-input v-model:value="form.name" placeholder="请输入资源名称" :maxlength="128" />
|
|
227
|
+
</a-form-item>
|
|
228
|
+
</a-col>
|
|
229
|
+
|
|
230
|
+
<DynamicRoutesForm v-model="form" :parent="parentNode" />
|
|
231
|
+
|
|
232
|
+
<a-col :span="12">
|
|
233
|
+
<a-form-item label="资源编码" name="code">
|
|
234
|
+
<a-input v-model:value="form.code" placeholder="请输入资源编码(权限码)" :maxlength="50" />
|
|
235
|
+
</a-form-item>
|
|
236
|
+
</a-col>
|
|
237
|
+
|
|
238
|
+
<a-col :span="12">
|
|
239
|
+
<a-form-item label="接口权限" name="permissionCode">
|
|
240
|
+
<a-input v-model:value="form.permissionCode" placeholder="请输入接口权限(接口地址,多个使用逗号分隔)" :maxlength="256" />
|
|
241
|
+
</a-form-item>
|
|
242
|
+
</a-col>
|
|
243
|
+
|
|
244
|
+
<a-col :span="12">
|
|
245
|
+
<a-form-item label="显示顺序" name="sort">
|
|
246
|
+
<a-input-number v-model:value="form.sort" :max="999" />
|
|
247
|
+
</a-form-item>
|
|
248
|
+
</a-col>
|
|
249
|
+
</a-row>
|
|
250
|
+
|
|
251
|
+
<a-row :gutter="8">
|
|
252
|
+
<a-col :span="24">
|
|
253
|
+
<a-form-item label="描述" name="description" :label-col="{ span: 3 }">
|
|
254
|
+
<a-textarea
|
|
255
|
+
v-model:value="form.description"
|
|
256
|
+
placeholder="请输入描述"
|
|
257
|
+
:maxlength="255"
|
|
258
|
+
:auto-size="{ minRows: 2 }"
|
|
259
|
+
show-count
|
|
260
|
+
/>
|
|
261
|
+
</a-form-item>
|
|
262
|
+
</a-col>
|
|
263
|
+
</a-row>
|
|
264
|
+
|
|
265
|
+
<MetaForm v-model="form" />
|
|
266
|
+
</a-form>
|
|
267
|
+
</a-spin>
|
|
197
268
|
|
|
198
269
|
<template #footer>
|
|
199
270
|
<a-space>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { ColumnsType } from 'ant-design-vue/es/table';
|
|
3
3
|
import type { TreeNode } from '../interface';
|
|
4
|
-
import { getRbacResourceGetRoleListByResourceId } from '@/api/modules/rbac';
|
|
5
4
|
import { useToggle } from '@vueuse/core';
|
|
6
5
|
import { useRequest } from 'alova/client';
|
|
7
6
|
import { theme } from 'ant-design-vue';
|
|
7
|
+
import { getRbacResourceGetRoleListByResourceId } from '@/api/modules/rbac';
|
|
8
8
|
|
|
9
9
|
defineOptions({
|
|
10
10
|
name: 'RoleRelation',
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { RESOURCE_TYPE } from 'pubinfo';
|
|
2
|
+
|
|
1
3
|
/** 操作按钮 */
|
|
2
4
|
export enum ACTION {
|
|
3
5
|
/** 分配查看 */
|
|
@@ -6,30 +8,27 @@ export enum ACTION {
|
|
|
6
8
|
ADD = '新建',
|
|
7
9
|
/** 新建下级 */
|
|
8
10
|
ADD_CHILD = '新建下级',
|
|
11
|
+
/** 导入/导出 */
|
|
12
|
+
IMPORT_EXPORT = '导入 / 导出',
|
|
9
13
|
/** 修改 */
|
|
10
14
|
EDIT = '修改',
|
|
11
15
|
/** 删除 */
|
|
12
16
|
REMOVE = '删除',
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** 目录 */
|
|
20
|
-
INDEX = '2',
|
|
21
|
-
/** 菜单 */
|
|
22
|
-
MENU = '3',
|
|
23
|
-
/** 按钮 */
|
|
24
|
-
BUTTON = '4',
|
|
25
|
-
/** 非菜单页 */
|
|
26
|
-
NON_MENU = '5',
|
|
27
|
-
}
|
|
19
|
+
export { RESOURCE_TYPE };
|
|
20
|
+
|
|
21
|
+
export const RESOURCE_ICON = ['', 'app', 'index', 'menu', 'btn', 'nonmenu', 'micro', 'dynamic', 'iframe', 'link'];
|
|
22
|
+
export const RESOURCE_COLOR = ['', 'geekblue', 'blue', 'default', 'cyan', 'default', 'geekblue', 'geekblue', 'default', 'default'];
|
|
28
23
|
|
|
29
24
|
export const resourceOptions = [
|
|
25
|
+
{ label: '动态应用', value: RESOURCE_TYPE.DYNAMIC_APP },
|
|
30
26
|
{ label: '应用', value: RESOURCE_TYPE.APP },
|
|
27
|
+
{ label: '微应用', value: RESOURCE_TYPE.MICRO_APP },
|
|
31
28
|
{ label: '目录', value: RESOURCE_TYPE.INDEX },
|
|
32
29
|
{ label: '菜单', value: RESOURCE_TYPE.MENU },
|
|
33
30
|
{ label: '按钮', value: RESOURCE_TYPE.BUTTON },
|
|
34
31
|
{ label: '非菜单页', value: RESOURCE_TYPE.NON_MENU },
|
|
32
|
+
{ label: '内嵌', value: RESOURCE_TYPE.IFRAME },
|
|
33
|
+
{ label: '外链', value: RESOURCE_TYPE.LINK },
|
|
35
34
|
];
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { Form } from '../interface';
|
|
3
|
+
import { RESOURCE_TYPE } from '../enum';
|
|
4
|
+
import { defaultMeta } from '../model';
|
|
5
|
+
|
|
6
|
+
export function useMetaForm(form: Ref<Form>) {
|
|
7
|
+
const show = computed(() => {
|
|
8
|
+
const type = form.value.type as RESOURCE_TYPE;
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
dataPermission: [RESOURCE_TYPE.BUTTON, RESOURCE_TYPE.MENU, RESOURCE_TYPE.NON_MENU].includes(type),
|
|
12
|
+
|
|
13
|
+
// 开发模式选项可见性:只在应用或动态应用中显示
|
|
14
|
+
devMode: [RESOURCE_TYPE.APP, RESOURCE_TYPE.DYNAMIC_APP].includes(type),
|
|
15
|
+
|
|
16
|
+
// 缓存标签页和固定标签页选项可见性:只在菜单中显示
|
|
17
|
+
cacheAndPin: [RESOURCE_TYPE.MENU].includes(type),
|
|
18
|
+
|
|
19
|
+
// 侧边栏显示选项可见性:应用和动态应用不显示此选项
|
|
20
|
+
sidebar: ![RESOURCE_TYPE.APP, RESOURCE_TYPE.DYNAMIC_APP, RESOURCE_TYPE.BUTTON, RESOURCE_TYPE.NON_MENU].includes(type),
|
|
21
|
+
|
|
22
|
+
// 标签栏显示选项可见性:应用、动态应用和目录不显示此选项
|
|
23
|
+
tabbar: ![RESOURCE_TYPE.APP, RESOURCE_TYPE.DYNAMIC_APP, RESOURCE_TYPE.INDEX, RESOURCE_TYPE.BUTTON].includes(type),
|
|
24
|
+
|
|
25
|
+
breadcrumb: ![RESOURCE_TYPE.BUTTON].includes(type),
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// 监听资源类型变化,自动重置不适用的配置项
|
|
30
|
+
watch(
|
|
31
|
+
() => form.value.type,
|
|
32
|
+
(newType, oldType) => {
|
|
33
|
+
// 只有在资源类型真正改变时才执行重置逻辑
|
|
34
|
+
if (newType !== oldType && newType && oldType) {
|
|
35
|
+
resetIncompatibleOptions();
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{ immediate: false },
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
// 监听开发模式状态变化,自动处理开发模式文本
|
|
42
|
+
watch(
|
|
43
|
+
() => form.value.meta?.isDev,
|
|
44
|
+
(newIsDev, oldIsDev) => {
|
|
45
|
+
// 当开发模式从开启变为关闭时,重置文本
|
|
46
|
+
if (oldIsDev === true && newIsDev === false) {
|
|
47
|
+
if (form.value.meta) {
|
|
48
|
+
form.value.meta.devText = defaultMeta.devText;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// 当首次开启开发模式且文本为空时,设置默认文本
|
|
52
|
+
if (oldIsDev === false && newIsDev === true) {
|
|
53
|
+
if (form.value.meta && !form.value.meta.devText) {
|
|
54
|
+
form.value.meta.devText = defaultMeta.devText;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{ immediate: false },
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
// 根据当前资源类型重置不适用的配置项
|
|
62
|
+
function resetIncompatibleOptions() {
|
|
63
|
+
if (!form.value.meta) {
|
|
64
|
+
form.value.meta = { ...defaultMeta };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 如果当前资源类型不支持开发模式,则重置为false
|
|
68
|
+
if (!show.value.devMode) {
|
|
69
|
+
form.value.meta.isDev = false;
|
|
70
|
+
// 重置开发模式文本
|
|
71
|
+
form.value.meta.devText = defaultMeta.devText;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 如果开发模式被关闭,重置开发模式文本为默认值
|
|
75
|
+
if (!form.value.meta.isDev) {
|
|
76
|
+
form.value.meta.devText = defaultMeta.devText;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 如果当前资源类型不支持缓存和固定标签页,则重置为false
|
|
80
|
+
if (!show.value.cacheAndPin) {
|
|
81
|
+
form.value.meta.cache = false;
|
|
82
|
+
form.value.meta.pin = false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 如果当前资源类型不支持侧边栏显示,则重置为true(默认显示)
|
|
86
|
+
if (!show.value.sidebar) {
|
|
87
|
+
form.value.meta.sidebar = true;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 如果当前资源类型不支持标签栏显示,则重置为true(默认显示)
|
|
91
|
+
if (!show.value.tabbar) {
|
|
92
|
+
form.value.meta.tabbar = true;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 当应用或动态应用开启开发模式时,需要确保其子路由不会被注册到vue-router
|
|
96
|
+
// 这个逻辑主要在路由生成阶段处理,此处仅做数据一致性保证
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
show,
|
|
101
|
+
resetIncompatibleOptions,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<script setup lang="tsx">
|
|
2
2
|
import type { ProColumns } from '@pubinfo/pro-components';
|
|
3
3
|
import type { AddForm, TreeNode } from './interface';
|
|
4
|
-
import {
|
|
4
|
+
import { SwapOutlined } from '@ant-design/icons-vue';
|
|
5
5
|
import { ProTable } from '@pubinfo/pro-components';
|
|
6
|
-
import { Badge, message, Modal } from 'ant-design-vue';
|
|
6
|
+
import { Badge, message, Modal, Tag } from 'ant-design-vue';
|
|
7
7
|
import { cloneDeep } from 'lodash-es';
|
|
8
8
|
import { PubinfoIcon } from 'pubinfo';
|
|
9
|
+
import { getRbacResourceResourceDelete, getRbacResourceResourceTree } from '@/api/modules/rbac';
|
|
10
|
+
import ImportExport from './components/ImportExport.vue';
|
|
9
11
|
import ResourceEdit from './components/ResourceEdit.vue';
|
|
10
12
|
import RoleRelation from './components/RoleRelation.vue';
|
|
11
|
-
import { ACTION, RESOURCE_TYPE, resourceOptions } from './enum';
|
|
13
|
+
import { ACTION, RESOURCE_COLOR, RESOURCE_TYPE, resourceOptions } from './enum';
|
|
12
14
|
|
|
13
15
|
defineOptions({
|
|
14
16
|
name: 'Resource',
|
|
@@ -28,16 +30,6 @@ const columns: ProColumns<TreeNode> = [
|
|
|
28
30
|
allowClear: true,
|
|
29
31
|
},
|
|
30
32
|
},
|
|
31
|
-
{
|
|
32
|
-
valueType: 'a-input',
|
|
33
|
-
title: '资源编码',
|
|
34
|
-
dataIndex: 'code',
|
|
35
|
-
ellipsis: true,
|
|
36
|
-
fieldProps: {
|
|
37
|
-
placeholder: '请输入资源编码',
|
|
38
|
-
allowClear: true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
33
|
{
|
|
42
34
|
valueType: 'a-select',
|
|
43
35
|
title: '资源类型',
|
|
@@ -48,20 +40,47 @@ const columns: ProColumns<TreeNode> = [
|
|
|
48
40
|
options: resourceOptions,
|
|
49
41
|
},
|
|
50
42
|
customRender({ text }) {
|
|
51
|
-
const icon = ['', 'app', 'index', 'menu', 'btn', 'nonmenu'];
|
|
52
43
|
return (
|
|
53
44
|
<div class="flex items-center space-x-1">
|
|
54
|
-
<PubinfoIcon name={`resource-${
|
|
55
|
-
<span>{resourceOptions.find(item => item.value === text)?.label}</span>
|
|
45
|
+
{/* <PubinfoIcon name={`resource-${RESOURCE_ICON[text]}`} class="text-xl" />
|
|
46
|
+
<span>{resourceOptions.find(item => item.value === text)?.label}</span> */}
|
|
47
|
+
|
|
48
|
+
<Tag color={RESOURCE_COLOR[text]} bordered={false}>{resourceOptions.find(item => item.value === text)?.label}</Tag>
|
|
56
49
|
</div>
|
|
57
50
|
);
|
|
58
51
|
},
|
|
59
52
|
},
|
|
53
|
+
{
|
|
54
|
+
valueType: 'a-input',
|
|
55
|
+
title: '资源编码',
|
|
56
|
+
dataIndex: 'code',
|
|
57
|
+
ellipsis: true,
|
|
58
|
+
fieldProps: {
|
|
59
|
+
placeholder: '请输入资源编码',
|
|
60
|
+
allowClear: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: '资源路径',
|
|
65
|
+
dataIndex: 'meta',
|
|
66
|
+
ellipsis: true,
|
|
67
|
+
hideInSearch: true,
|
|
68
|
+
customRender({ text }) {
|
|
69
|
+
return text?.url || '-';
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: '接口权限',
|
|
74
|
+
dataIndex: 'permissionCode',
|
|
75
|
+
ellipsis: true,
|
|
76
|
+
hideInSearch: true,
|
|
77
|
+
},
|
|
60
78
|
{
|
|
61
79
|
valueType: 'a-select',
|
|
62
80
|
title: '是否启用',
|
|
63
81
|
dataIndex: 'enable',
|
|
64
|
-
width:
|
|
82
|
+
width: 80,
|
|
83
|
+
align: 'center',
|
|
65
84
|
fieldProps: {
|
|
66
85
|
placeholder: '请选择是否启用',
|
|
67
86
|
allowClear: true,
|
|
@@ -78,22 +97,18 @@ const columns: ProColumns<TreeNode> = [
|
|
|
78
97
|
);
|
|
79
98
|
},
|
|
80
99
|
},
|
|
81
|
-
{
|
|
82
|
-
title: '权限标识',
|
|
83
|
-
dataIndex: 'permissionCode',
|
|
84
|
-
ellipsis: true,
|
|
85
|
-
hideInSearch: true,
|
|
86
|
-
},
|
|
87
100
|
{
|
|
88
101
|
title: '排序',
|
|
89
102
|
dataIndex: 'sort',
|
|
103
|
+
width: 60,
|
|
104
|
+
align: 'center',
|
|
90
105
|
hideInSearch: true,
|
|
91
106
|
},
|
|
92
107
|
{
|
|
93
108
|
title: '操作',
|
|
94
109
|
dataIndex: 'action',
|
|
95
110
|
fixed: 'right',
|
|
96
|
-
width:
|
|
111
|
+
width: 300,
|
|
97
112
|
hideInSearch: true,
|
|
98
113
|
hideInTable() {
|
|
99
114
|
return !auth([
|
|
@@ -120,10 +135,9 @@ function getTreeData() {
|
|
|
120
135
|
}
|
|
121
136
|
|
|
122
137
|
async function request(query: any) {
|
|
123
|
-
const { pageSize, current,
|
|
138
|
+
const { pageSize, current, ...rest } = cloneDeep(query);
|
|
124
139
|
const params: AddForm = {
|
|
125
140
|
...rest,
|
|
126
|
-
enabled: Boolean(enabled),
|
|
127
141
|
};
|
|
128
142
|
const dataSource = await getRbacResourceResourceTree(params, {
|
|
129
143
|
transform(data) {
|
|
@@ -141,6 +155,7 @@ async function request(query: any) {
|
|
|
141
155
|
|
|
142
156
|
const editRef = ref();
|
|
143
157
|
const relationRef = ref();
|
|
158
|
+
const importExportRef = ref();
|
|
144
159
|
function onAction(key: string, record?: TreeNode) {
|
|
145
160
|
switch (key) {
|
|
146
161
|
case ACTION.ROLE_RELATION:
|
|
@@ -159,6 +174,10 @@ function onAction(key: string, record?: TreeNode) {
|
|
|
159
174
|
editRef.value.open(key, record);
|
|
160
175
|
break;
|
|
161
176
|
|
|
177
|
+
case ACTION.IMPORT_EXPORT:
|
|
178
|
+
importExportRef.value.open();
|
|
179
|
+
break;
|
|
180
|
+
|
|
162
181
|
case ACTION.REMOVE:
|
|
163
182
|
if (!record?.leaf) {
|
|
164
183
|
message.info('非叶子节点不能删除');
|
|
@@ -193,14 +212,21 @@ function onAction(key: string, record?: TreeNode) {
|
|
|
193
212
|
:columns="columns"
|
|
194
213
|
:request="request"
|
|
195
214
|
:pagination="false"
|
|
196
|
-
:scroll="{ x:
|
|
215
|
+
:scroll="{ x: 1280 }"
|
|
197
216
|
auto-height
|
|
198
217
|
>
|
|
199
218
|
<template #toolbar>
|
|
200
|
-
<a-
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
|
|
219
|
+
<a-space>
|
|
220
|
+
<a-button v-auth="'resource_app_add'" type="primary" @click="onAction(ACTION.ADD)">
|
|
221
|
+
<PlusCircleOutlined />
|
|
222
|
+
{{ ACTION.ADD }}
|
|
223
|
+
</a-button>
|
|
224
|
+
|
|
225
|
+
<a-button @click="onAction(ACTION.IMPORT_EXPORT)">
|
|
226
|
+
<SwapOutlined />
|
|
227
|
+
{{ ACTION.IMPORT_EXPORT }}
|
|
228
|
+
</a-button>
|
|
229
|
+
</a-space>
|
|
204
230
|
</template>
|
|
205
231
|
|
|
206
232
|
<template #bodyCell="{ column, record }">
|
|
@@ -211,7 +237,7 @@ function onAction(key: string, record?: TreeNode) {
|
|
|
211
237
|
<span>{{ ACTION.ROLE_RELATION }}</span>
|
|
212
238
|
</a>
|
|
213
239
|
<a
|
|
214
|
-
v-if="
|
|
240
|
+
v-if="![RESOURCE_TYPE.BUTTON, RESOURCE_TYPE.IFRAME, RESOURCE_TYPE.LINK].includes(record.type)"
|
|
215
241
|
v-auth="'resource_add_child'"
|
|
216
242
|
class="flex items-center"
|
|
217
243
|
@click="onAction(ACTION.ADD_CHILD, record)"
|
|
@@ -233,5 +259,6 @@ function onAction(key: string, record?: TreeNode) {
|
|
|
233
259
|
</ProTable>
|
|
234
260
|
<ResourceEdit ref="editRef" :data-source="dataSource" @submit="getTreeData" />
|
|
235
261
|
<RoleRelation ref="relationRef" />
|
|
262
|
+
<ImportExport ref="importExportRef" :data-source="dataSource" @submit="getTreeData" />
|
|
236
263
|
</div>
|
|
237
264
|
</template>
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CustomMeta } from './model';
|
|
2
|
+
|
|
3
|
+
export type Form = Omit<API.PubResource, 'meta'> & {
|
|
4
|
+
meta?: CustomMeta | API.PubResource['meta']
|
|
5
|
+
};
|
|
2
6
|
export type AddForm = API.PubResourceAddDto;
|
|
3
7
|
export type EditForm = API.PubResourceUpdateDto;
|
|
4
8
|
export type TreeNode = Form & {
|