@pubinfo/module-rbac 2.0.0-rc.2 → 2.0.0-rc.3
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-Dyqb3Uh3.js → ComponentSelect-B1ZyenXP.js} +897 -945
- package/dist/ComponentSelect-DlVJI5an.js +2 -0
- package/dist/DynamicRoutesForm-Cu3WhRpA.js +4 -0
- package/dist/{DynamicRoutesForm-D3nGj7oA.js → DynamicRoutesForm-qjbrykW4.js} +95 -95
- package/dist/HCheckList-Cze_TkQp.js +2 -0
- package/dist/HoverCard-B79q5sly.js +43 -0
- package/dist/HoverCard-U5WTpvFy.js +2 -0
- package/dist/{ImportExport-Yt6dABIv.js → ImportExport-Clbc8xaw.js} +65 -65
- package/dist/ImportExport-CtEZTU87.js +4 -0
- package/dist/MetaForm-BWy4Lpr8.js +5 -0
- package/dist/MetaForm-DpH9an5A.js +300 -0
- package/dist/MetaForm.css +1 -0
- package/dist/OrgAndPosition-3lCm4Fyb.js +2 -0
- package/dist/ResourceEdit-0_cYB0iu.js +338 -0
- package/dist/ResourceEdit-CYPzEbqn.js +10 -0
- package/dist/{ResourceRelation-BihfkBCe.js → ResourceRelation-CZ8hGgOm.js} +6 -6
- package/dist/ResourceRelation-DMWa09ae.js +3 -0
- package/dist/{ResourceRelation-CBPrqf2V.js → ResourceRelation-DkKdZ3TD.js} +2 -2
- package/dist/ResourceRelation.css +1 -1
- package/dist/ResourceRelation2.css +1 -1
- package/dist/{ResourceSelector-CxZ1ae30.js → ResourceSelector-ConJ30Jd.js} +48 -48
- package/dist/ResourceSelector.css +1 -1
- package/dist/{RoleRelation-BlWDNAM1.js → RoleRelation-B1D1NM_L.js} +1 -1
- package/dist/RoleRelation-DySyilcs.js +2 -0
- package/dist/RoleSelector-DOt30OLy.js +279 -0
- package/dist/TenantEdit-D8-Pt7sf.js +6 -0
- package/dist/{TenantEdit-Bt31IV9W.js → TenantEdit-DNJzo8SS.js} +19 -19
- package/dist/{UserAuthorization-Dhp0ZamX.js → UserAuthorization-DPHUk69M.js} +6 -6
- package/dist/UserAuthorization-DuioGghR.js +4 -0
- package/dist/UserAuthorization.css +1 -1
- package/dist/UserEdit-6HYbgtOh.js +4 -0
- package/dist/{UserEdit-CqH6hxTZ.js → UserEdit-C6eNXSCu.js} +24 -24
- package/dist/animation_item-C3pkH-cB.js +2 -0
- package/dist/{blackWhiteList-B7tUj2Rx.js → blackWhiteList-DQALdBZf.js} +10 -10
- package/dist/blackWhiteList.css +1 -1
- package/dist/{breadcrumb_setting-CIm-6QHw.js → breadcrumb_setting-D3UjJYhA.js} +32 -32
- package/dist/breadcrumb_setting.css +1 -1
- package/dist/browserType-BGl2j5RW.js +2 -0
- package/dist/components/OrgUserSelector/OrgSelector.vue.d.ts +1 -1
- package/dist/components/OrgUserSelector/UserSelector.vue.d.ts +1 -1
- package/dist/components/ResourceSelector/index.vue.d.ts +1 -1
- package/dist/composables/useWebSocketManager.d.ts +8 -0
- package/dist/createAndEditDataPermission-CAaxueTy.js +8 -0
- package/dist/{createAndEditDataPermission-Bd3tlIEE.js → createAndEditDataPermission-DnAcKvaE.js} +55 -55
- package/dist/createAndEditDataPermission.css +1 -1
- package/dist/{data-permission-Db1Lu9KO.js → data-permission-CLnnLoPt.js} +8 -8
- package/dist/data-permission.css +1 -1
- package/dist/{dictionary-XMJprxvM.js → dictionary-BFM0Mx0P.js} +3 -3
- package/dist/{drawerBlackWhiteList-D-Sq4mul.js → drawerBlackWhiteList-BYACpO3D.js} +9 -9
- package/dist/drawerBlackWhiteList-C3xS7Kxx.js +3 -0
- package/dist/{drawerDictionary-Bw3w5PTm.js → drawerDictionary-BUBLrbTi.js} +13 -13
- package/dist/drawerDictionary-Bk0BgL7i.js +4 -0
- package/dist/{drawerDictionaryItem-4WIgL3No.js → drawerDictionaryItem-CfOPleN6.js} +14 -14
- package/dist/drawerDictionaryItem-Dy2T56AH.js +4 -0
- package/dist/{drawerGroup-932n7Ywc.js → drawerGroup-Bly3CWfM.js} +10 -10
- package/dist/drawerGroup-ZyzAWXOl.js +3 -0
- package/dist/{drawerOrganization-IwZZkHWM.js → drawerOrganization-BhO5-PP5.js} +27 -27
- package/dist/drawerOrganization-HSVB8JzO.js +3 -0
- package/dist/{drawerPosition-BiO92_At.js → drawerPosition-CM0NBfoR.js} +15 -15
- package/dist/drawerPosition-vsuG4JYe.js +3 -0
- package/dist/drawerRegion-BXZ751ge.js +3 -0
- package/dist/{drawerRegion-CNOK55im.js → drawerRegion-CGySAL6D.js} +17 -17
- package/dist/{drawerRole-IIsKhycU.js → drawerRole-BE0utb7R.js} +9 -9
- package/dist/drawerRole-BVeaz3Yb.js +5 -0
- package/dist/drawerRole-BdoMYLYW.js +215 -0
- package/dist/drawerRole-BeUNs7cF.js +6 -0
- package/dist/drawerRole-DNsK5a6O.js +3 -0
- package/dist/{drawerRole-PnDochPg.js → drawerRole-DS7fbx1h.js} +10 -10
- package/dist/{group-BzuuCGyR.js → group-B1gGoTD5.js} +10 -10
- package/dist/group.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2065 -1875
- package/dist/{itemlist-KOYuEUk4.js → itemlist-uCHnA_We.js} +3 -3
- package/dist/{layout_setting-DQgWzV7M.js → layout_setting-DMvxwL31.js} +20 -20
- package/dist/layout_setting.css +1 -1
- package/dist/{loginHistoryDetail-DgHx6n66.js → loginHistoryDetail-BAYuSqvw.js} +2 -2
- package/dist/loginHistoryDetail-DiuNa6Sv.js +4 -0
- package/dist/{login_history-Co6JLGsd.js → login_history-BexfCN-1.js} +7 -7
- package/dist/login_history.css +1 -1
- package/dist/{menu_setting-B0QIQ1um.js → menu_setting-BXR3EAXD.js} +43 -43
- package/dist/menu_setting.css +1 -1
- package/dist/not-data-OpiacaSk.js +2 -0
- package/dist/{operateHistoryDetail-BrdNmYD0.js → operateHistoryDetail-DiuqMTkN.js} +2 -2
- package/dist/operateHistoryDetail-r30ZBNqw.js +4 -0
- package/dist/{operate_history-CVeIorOr.js → operate_history-hXxS3atI.js} +7 -7
- package/dist/operate_history.css +1 -1
- package/dist/{organization-CXMk4mRo.js → organization-cvYm9P9w.js} +2647 -2647
- package/dist/organization.css +1 -1
- package/dist/{other_setting-DK9MHysY.js → other_setting-DjVQevBW.js} +69 -69
- package/dist/other_setting.css +1 -1
- package/dist/{page_animation_setting-tSYfjx-m.js → page_animation_setting-DgHHmFEc.js} +52 -52
- package/dist/page_animation_setting.css +1 -1
- package/dist/{page_w_setting-BDI5KsA-.js → page_w_setting-B_im6vBo.js} +20 -20
- package/dist/page_w_setting.css +1 -1
- package/dist/{position-BjUZQQUz.js → position-BkpbHXYP.js} +2 -2
- package/dist/{region-BsX0gK_y.js → region-DVkbjI9t.js} +6 -6
- package/dist/{resource-DKhlH74I.js → resource-CrhX7VRK.js} +13 -11
- package/dist/{role-ffXddsAo.js → role-PjmrOdFd.js} +6 -6
- package/dist/{role_group-BBH28A40.js → role_group-Dlx-6BZF.js} +2 -2
- package/dist/routeSystem-Dg0b6mAl.js +2 -0
- package/dist/{safe_setting-Dis73Gsw.js → safe_setting-DpWUCv2p.js} +1 -1
- package/dist/setItem-9ZBl0BlF.js +5 -0
- package/dist/setItem-BenNySNl.js +77 -0
- package/dist/setItem.css +1 -1
- package/dist/stores/view.d.ts +56 -0
- package/dist/{tabbar_setting-DGwk_Oec.js → tabbar_setting-9UKDc1Ev.js} +38 -38
- package/dist/tabbar_setting.css +1 -1
- package/dist/{tenant-BhA6R8aJ.js → tenant-BGtOP_wo.js} +5 -5
- package/dist/{theme_setting-Ca1YGTdZ.js → theme_setting-BBLaZ4NS.js} +8 -8
- package/dist/theme_setting.css +1 -1
- package/dist/{toolbar_setting-Cmrpyxgs.js → toolbar_setting-OemNp6pO.js} +37 -37
- package/dist/toolbar_setting.css +1 -1
- package/dist/{useAppAndResource-BgnrL15l.js → useAppAndResource-CeMCjg2v.js} +1 -1
- package/dist/{user-Bnb1cvVD.js → user-JCiGXodF.js} +11 -11
- package/dist/user.css +1 -1
- package/dist/utils/routeSystem.d.ts +55 -0
- package/dist/views/blackWhiteList/index.vue.d.ts +2 -2
- package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +5 -5
- package/dist/views/data-permission/index.vue.d.ts +7 -7
- package/dist/views/dictionary/index.vue.d.ts +2 -2
- package/dist/views/dictionary/itemlist.vue.d.ts +2 -2
- package/dist/views/group/index.vue.d.ts +2 -2
- package/dist/views/log_center/login_history.vue.d.ts +2 -2
- package/dist/views/log_center/operate_history.vue.d.ts +2 -2
- package/dist/views/position/index.vue.d.ts +2 -2
- package/dist/views/region/index.vue.d.ts +2 -2
- package/dist/views/resource/components/HoverCard.vue.d.ts +21 -0
- package/dist/views/resource/index.vue.d.ts +2 -2
- package/dist/views/resource/model.d.ts +3 -1
- package/dist/views/role/components/ResourceRelation.vue.d.ts +2 -2
- package/dist/views/role/components/drawerRole.vue.d.ts +2 -2
- package/dist/views/role/index.vue.d.ts +6 -6
- package/dist/views/role_group/index.vue.d.ts +2 -2
- package/dist/views/tenant/components/TenantEdit.vue.d.ts +2 -2
- package/dist/views/tenant/index.vue.d.ts +4 -4
- package/dist/views/user/index.vue.d.ts +2 -2
- package/dist/{watermark_setting-BnBt5gdM.js → watermark_setting-C1VFRfbW.js} +111 -111
- package/dist/watermark_setting.css +1 -1
- package/package.json +7 -7
- package/src/composables/useWebSocketManager.ts +104 -0
- package/src/index.ts +22 -0
- package/src/stores/view.ts +292 -0
- package/src/utils/routeSystem.ts +53 -0
- package/src/views/region/index.vue +1 -1
- package/src/views/resource/components/ComponentSelect.vue +12 -119
- package/src/views/resource/components/HoverCard.vue +62 -0
- package/src/views/resource/components/MetaForm.vue +129 -67
- package/src/views/resource/components/ResourceEdit.vue +33 -4
- package/src/views/resource/hooks/useMetaForm.ts +23 -0
- package/src/views/resource/model.ts +5 -1
- package/src/views/watermark_setting/index.vue +2 -2
- package/dist/ComponentSelect-Din5Vses.js +0 -2
- package/dist/DynamicRoutesForm-CkmCaHum.js +0 -4
- package/dist/HCheckList-Dd2Tx0jW.js +0 -2
- package/dist/ImportExport-BbZkZEW_.js +0 -4
- package/dist/MetaForm-CI-T2qEE.js +0 -284
- package/dist/MetaForm-CrsQmdOg.js +0 -4
- package/dist/OrgAndPosition-CDCim7yM.js +0 -2
- package/dist/ResourceEdit-BFXA953U.js +0 -309
- package/dist/ResourceEdit-V6gt22gW.js +0 -8
- package/dist/ResourceRelation-BnLQZey7.js +0 -3
- package/dist/RoleRelation-CAMzPMFz.js +0 -2
- package/dist/RoleSelector-DTnDRRTQ.js +0 -279
- package/dist/TenantEdit-DYHJehf0.js +0 -6
- package/dist/UserAuthorization-BdHxAQlK.js +0 -4
- package/dist/UserEdit-CqrRx717.js +0 -4
- package/dist/animation_item-COb6VI4T.js +0 -2
- package/dist/browserType-D2cPQa0k.js +0 -2
- package/dist/createAndEditDataPermission-6pvYsJo9.js +0 -8
- package/dist/drawerBlackWhiteList-DK4g_CpC.js +0 -3
- package/dist/drawerDictionary-DHIcxPrY.js +0 -4
- package/dist/drawerDictionaryItem-dg1sIDYE.js +0 -4
- package/dist/drawerGroup-CrF2c8UJ.js +0 -3
- package/dist/drawerOrganization-b39q3V33.js +0 -3
- package/dist/drawerPosition-BjoDy0cQ.js +0 -3
- package/dist/drawerRegion-omVT_dpq.js +0 -3
- package/dist/drawerRole-BaQBb2-J.js +0 -215
- package/dist/drawerRole-BqMh5l11.js +0 -5
- package/dist/drawerRole-D7VJRLmp.js +0 -6
- package/dist/drawerRole-dJ3m0_K2.js +0 -3
- package/dist/loginHistoryDetail-BNGtarOv.js +0 -4
- package/dist/not-data-uXybSS43.js +0 -2
- package/dist/operateHistoryDetail-DsM4L8Nz.js +0 -4
- package/dist/setItem-CjNn98dC.js +0 -77
- package/dist/setItem-H6NRNSt7.js +0 -5
- /package/dist/{HCheckList-3zLNVNr0.js → HCheckList-CmS0Zgjk.js} +0 -0
- /package/dist/{OrgAndPosition-BK5MTlOO.js → OrgAndPosition-DYxNkasL.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-Bvl99pNT.js → _plugin-vue_export-helper-DziIhCOI.js} +0 -0
- /package/dist/{add-child-sIXCU5sL.js → add-child-BqjLtFNF.js} +0 -0
- /package/dist/{animation_item-D78koyTo.js → animation_item-Cg-CB3zX.js} +0 -0
- /package/dist/{authority-DQ4-SayE.js → authority-BCFCPQkb.js} +0 -0
- /package/dist/{authorize-CR54jxEa.js → authorize-BykMzt1r.js} +0 -0
- /package/dist/{blacklist-disable-ypFSVSX1.js → blacklist-disable-COoLZMSA.js} +0 -0
- /package/dist/{blacklist-enable-DlkD_15-.js → blacklist-enable-LZep1trj.js} +0 -0
- /package/dist/{browser-chrome-DNH4U6iO.js → browser-chrome-D0rex7Ir.js} +0 -0
- /package/dist/{browser-edge-4sSjlzO1.js → browser-edge-KCb_AIL5.js} +0 -0
- /package/dist/{browser-ie-yTwVV0GC.js → browser-ie-C1znjJM-.js} +0 -0
- /package/dist/{browser-other-Jax-vzDs.js → browser-other-C4er8PkV.js} +0 -0
- /package/dist/{browser-safari-B7PIezpj.js → browser-safari-BPRC1TV-.js} +0 -0
- /package/dist/{browserType-DZrDbVVY.js → browserType-E4RCiZfN.js} +0 -0
- /package/dist/{configData-CONUFxaH.js → configData-DQOHeFW2.js} +0 -0
- /package/dist/{dayjs.min-KffHrkDe.js → dayjs.min-DcxwBe2I.js} +0 -0
- /package/dist/{edit-CCL7qbDV.js → edit-C9HH0bNg.js} +0 -0
- /package/dist/{enum-DUjQrWbG.js → enum-B1DCzyaW.js} +0 -0
- /package/dist/{enum-CUMv4gQ2.js → enum-BWzxzuim.js} +0 -0
- /package/dist/{enum-B-lkiBy0.js → enum-CYW8g64p.js} +0 -0
- /package/dist/{enum-BMY6bmPA.js → enum-D0U38jb6.js} +0 -0
- /package/dist/{enum-Bg70i-vM.js → enum-VH4_jOj5.js} +0 -0
- /package/dist/{icard-BUuV9yW4.js → icard-FW0Ro50-.js} +0 -0
- /package/dist/{icon_animation-rPC0qi0K.js → icon_animation-DuNUKCIP.js} +0 -0
- /package/dist/{icon_breadcrumb-BOiEdwRY.js → icon_breadcrumb-DrPNYW5B.js} +0 -0
- /package/dist/{icon_copyright-zk1pF8Jj.js → icon_copyright-Di3Yr0PZ.js} +0 -0
- /package/dist/{icon_jt-BMoQoZvf.js → icon_jt-C4rQLl9Y.js} +0 -0
- /package/dist/{icon_layout-KBHA8xU_.js → icon_layout-5L9E7uN2.js} +0 -0
- /package/dist/{icon_mainpage-BTdCCyi2.js → icon_mainpage-DMKqRgmE.js} +0 -0
- /package/dist/{icon_menu-5k8XiWt5.js → icon_menu-Cp7-Zght.js} +0 -0
- /package/dist/{icon_page_size-DUMZ6xhJ.js → icon_page_size-Dc0zqT2W.js} +0 -0
- /package/dist/{icon_position_type-Cnkn2IzO.js → icon_position_type-DH2qxQQE.js} +0 -0
- /package/dist/{icon_safe_manage-B0PtL90p.js → icon_safe_manage-DXYWl1y-.js} +0 -0
- /package/dist/{icon_screen_scale-CwVhfflc.js → icon_screen_scale-DwC6qqx2.js} +0 -0
- /package/dist/{icon_system_manage-vM71UmjM.js → icon_system_manage-BYTldLly.js} +0 -0
- /package/dist/{icon_tabbar-CuMnIey0.js → icon_tabbar-CxffARwI.js} +0 -0
- /package/dist/{icon_toolbar-BoCbAU3P.js → icon_toolbar-CsxnTrNJ.js} +0 -0
- /package/dist/{icon_topbar-DGIDBcE6.js → icon_topbar-DS-oEZFA.js} +0 -0
- /package/dist/{icon_watermark-BBU-lOdN.js → icon_watermark-DDXsHlfQ.js} +0 -0
- /package/dist/{log-center-Z3WDfhg1.js → log-center-BFjZ4IE1.js} +0 -0
- /package/dist/{log-BgIwPjNu.js → log-hgUXTuhy.js} +0 -0
- /package/dist/{not-data-DejN9beo.js → not-data-Bw8FlpyB.js} +0 -0
- /package/dist/{org-main-C2g7AMMY.js → org-main-D5Isevbc.js} +0 -0
- /package/dist/{org-unmain-CjGtvuIa.js → org-unmain-BHBqSuCz.js} +0 -0
- /package/dist/{remove-BroXCqy9.js → remove-DKMMsJNq.js} +0 -0
- /package/dist/{resource-app-DV2RZiRk.js → resource-app-DZwdNG6F.js} +0 -0
- /package/dist/{resource-btn-Dw9-L0P5.js → resource-btn-DPX0oM2L.js} +0 -0
- /package/dist/{resource-dynamic-Cmk2ihZb.js → resource-dynamic-Cb_vjMjt.js} +0 -0
- /package/dist/{resource-index-D9J-wVCc.js → resource-index-ah4NpEob.js} +0 -0
- /package/dist/{resource-menu-XnlgciPe.js → resource-menu-CzWI03EU.js} +0 -0
- /package/dist/{resource-micro-DzYCcl5c.js → resource-micro-Ca0NS7j_.js} +0 -0
- /package/dist/{resource-nonmenu-8bXZBBWf.js → resource-nonmenu-Deitjo_5.js} +0 -0
- /package/dist/{setting-manage-BPwzU94V.js → setting-manage-B3vaM0w1.js} +0 -0
- /package/dist/{stores-Di6SQ3pp.js → stores-D6JJmBEU.js} +0 -0
- /package/dist/{theme-check-mark-Dz4lGIXE.js → theme-check-mark-BK7E8lqd.js} +0 -0
- /package/dist/{theme-title-CPXdAbpI.js → theme-title-aqbHq846.js} +0 -0
- /package/dist/{view-D4SR4EYn.js → view-C6Eo1zRL.js} +0 -0
- /package/dist/{zddata-Cdy8vScr.js → zddata-fjEtQ3lZ.js} +0 -0
- /package/dist/{zy_checked-xjGWlIXf.js → zy_checked-DTsDCC94.js} +0 -0
- /package/dist/{zy_default-kwFuicHB.js → zy_default-BaIuMKw-.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
.item_ani[data-v-
|
|
1
|
+
.item_ani[data-v-89565948]{background-color:var(--g-bg);border:1px solid var(--g-tabbar-tab-hover-bg);border-radius:.5rem;flex-direction:column;place-items:center;padding-top:26px;display:flex}.item_ani .jb[data-v-89565948]{background:linear-gradient(180deg,var(--g-container-bg)0%,#fff0 100%)}.bar-header[data-v-89565948]{background:var(--g-bg)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/module-rbac",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-rc.
|
|
4
|
+
"version": "2.0.0-rc.3",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
],
|
|
19
19
|
"peerDependencies": {
|
|
20
20
|
"@ant-design/icons-vue": "^7.0.1",
|
|
21
|
-
"@pubinfo/pro-components": "^1.7.
|
|
21
|
+
"@pubinfo/pro-components": "^1.7.3",
|
|
22
22
|
"alova": "^3.3.4",
|
|
23
23
|
"ant-design-vue": "^4.2.6",
|
|
24
|
-
"pubinfo": "2.0.0-rc.
|
|
24
|
+
"pubinfo": "2.0.0-rc.3"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@destyler/popover": "^0.1.0",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@ant-design/icons-vue": "^7.0.1",
|
|
39
|
-
"@pubinfo/openapi": "^0.
|
|
40
|
-
"@pubinfo/preset-openapi": "^0.
|
|
41
|
-
"@pubinfo/pro-components": "^1.7.
|
|
39
|
+
"@pubinfo/openapi": "^0.9.0",
|
|
40
|
+
"@pubinfo/preset-openapi": "^0.9.0",
|
|
41
|
+
"@pubinfo/pro-components": "^1.7.3",
|
|
42
42
|
"@types/file-saver": "^2.0.7",
|
|
43
43
|
"@types/lodash-es": "^4.17.12",
|
|
44
44
|
"alova": "^3.3.4",
|
|
45
45
|
"ant-design-vue": "^4.2.6",
|
|
46
46
|
"type-fest": "^4.41.0",
|
|
47
|
-
"pubinfo": "2.0.0-rc.
|
|
47
|
+
"pubinfo": "2.0.0-rc.3"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"dev": "pubinfo build -w --sourcemap",
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { useViewStore } from '@/stores/view';
|
|
2
|
+
|
|
3
|
+
// WebSocket 消息类型定义
|
|
4
|
+
interface WebSocketMessage {
|
|
5
|
+
type: 'custom'
|
|
6
|
+
event: 'pubinfo-resolver:update'
|
|
7
|
+
data: {
|
|
8
|
+
action: 'add' | 'unlink'
|
|
9
|
+
file: string
|
|
10
|
+
timestamp: number
|
|
11
|
+
data: {
|
|
12
|
+
icons: string[]
|
|
13
|
+
layouts: string[]
|
|
14
|
+
pages: string[]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* WebSocket 管理器
|
|
21
|
+
*/
|
|
22
|
+
export function useWebSocketManager() {
|
|
23
|
+
const viewStore = useViewStore();
|
|
24
|
+
let isInitialized = false;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 初始化 WebSocket 监听
|
|
28
|
+
*/
|
|
29
|
+
function initializeWebSocket() {
|
|
30
|
+
if (isInitialized) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
// @ts-expect-error 全局 WebSocket 对象
|
|
36
|
+
const ws = globalThis.__PUBINFO_WEBSOCKET__;
|
|
37
|
+
|
|
38
|
+
if (!ws) {
|
|
39
|
+
console.warn('WebSocket 连接不可用');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// 设置连接状态
|
|
44
|
+
viewStore.setWebSocketConnected(true);
|
|
45
|
+
|
|
46
|
+
// 监听 pubinfo-resolver:update 事件
|
|
47
|
+
ws.on('pubinfo-resolver:update', (data: WebSocketMessage['data']) => {
|
|
48
|
+
// 构造完整的消息对象
|
|
49
|
+
const message: WebSocketMessage = {
|
|
50
|
+
type: 'custom',
|
|
51
|
+
event: 'pubinfo-resolver:update',
|
|
52
|
+
data,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// 传递给 viewStore 处理
|
|
56
|
+
viewStore.handleFileChange(message);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// 监听 WebSocket 连接状态变化
|
|
60
|
+
ws.on('connect', () => {
|
|
61
|
+
viewStore.setWebSocketConnected(true);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
ws.on('disconnect', () => {
|
|
65
|
+
viewStore.setWebSocketConnected(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
isInitialized = true;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
console.error('WebSocket Manager: 初始化失败', error);
|
|
72
|
+
viewStore.setWebSocketConnected(false);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 清理 WebSocket 监听
|
|
78
|
+
*/
|
|
79
|
+
function cleanupWebSocket() {
|
|
80
|
+
try {
|
|
81
|
+
// @ts-expect-error 全局 WebSocket 对象
|
|
82
|
+
const ws = globalThis.__PUBINFO_WEBSOCKET__;
|
|
83
|
+
|
|
84
|
+
if (ws) {
|
|
85
|
+
// 移除事件监听器
|
|
86
|
+
ws.off('pubinfo-resolver:update');
|
|
87
|
+
ws.off('connect');
|
|
88
|
+
ws.off('disconnect');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
viewStore.setWebSocketConnected(false);
|
|
92
|
+
isInitialized = false;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error('WebSocket Manager: 清理失败', error);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
initializeWebSocket,
|
|
101
|
+
cleanupWebSocket,
|
|
102
|
+
isInitialized: () => isInitialized,
|
|
103
|
+
};
|
|
104
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { ModuleOptions } from 'pubinfo';
|
|
|
2
2
|
import type { RbacOptions } from './interface';
|
|
3
3
|
import { defineAsyncRoutes, defineIconModule, defineRouteModule } from 'pubinfo';
|
|
4
4
|
import modules from 'virtual:pubinfo-resolver';
|
|
5
|
+
import { useWebSocketManager } from '@/composables/useWebSocketManager';
|
|
6
|
+
import { useViewStore } from '@/stores/view';
|
|
5
7
|
import { ctx } from './context';
|
|
6
8
|
import { filterPages } from './routes';
|
|
7
9
|
import './assets/styles/vxe-table.css';
|
|
@@ -27,8 +29,28 @@ export function rbac(options: RbacOptions): ModuleOptions {
|
|
|
27
29
|
|
|
28
30
|
return {
|
|
29
31
|
name: 'pubinfo:rbac',
|
|
32
|
+
setup() {
|
|
33
|
+
const viewStore = useViewStore();
|
|
34
|
+
const wsManager = useWebSocketManager();
|
|
35
|
+
|
|
36
|
+
viewStore.initializeRouteData();
|
|
37
|
+
wsManager.initializeWebSocket(); ;
|
|
38
|
+
|
|
39
|
+
// 在模块设置时初始化路由系统
|
|
40
|
+
import('./utils/routeSystem').then(({ initializeRouteSystem }) => {
|
|
41
|
+
try {
|
|
42
|
+
initializeRouteSystem();
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error('RBAC 模块路由系统初始化失败:', error);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
},
|
|
30
49
|
};
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
export * from './components/OrgUserSelector';
|
|
53
|
+
export * from './composables/useWebSocketManager';
|
|
34
54
|
export * from './interface';
|
|
55
|
+
export * from './stores/view';
|
|
56
|
+
export * from './utils/routeSystem';
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { acceptHMRUpdate, defineStore } from 'pinia';
|
|
2
|
+
import { getAllRouteModules, readProjectModules } from 'pubinfo';
|
|
3
|
+
|
|
4
|
+
// WebSocket 消息类型定义
|
|
5
|
+
export interface WebSocketMessage {
|
|
6
|
+
type: 'custom'
|
|
7
|
+
event: 'pubinfo-resolver:update'
|
|
8
|
+
data: {
|
|
9
|
+
action: 'add' | 'unlink'
|
|
10
|
+
file: string
|
|
11
|
+
timestamp: number
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// 路由树节点接口
|
|
16
|
+
export interface RouteTreeNode {
|
|
17
|
+
title: string
|
|
18
|
+
key: string
|
|
19
|
+
root?: boolean
|
|
20
|
+
module?: boolean
|
|
21
|
+
children?: RouteTreeNode[]
|
|
22
|
+
isLeaf?: boolean
|
|
23
|
+
value?: string
|
|
24
|
+
scope?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// 模块信息接口
|
|
28
|
+
interface ModuleInfo {
|
|
29
|
+
id: string
|
|
30
|
+
pages: Record<string, string>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const useViewStore = defineStore('view', () => {
|
|
34
|
+
// 主项目页面路径数据
|
|
35
|
+
const projectPages = ref<Record<string, string>>({});
|
|
36
|
+
|
|
37
|
+
// 模块页面路径数据
|
|
38
|
+
const modulePages = ref<Map<string, Record<string, string>>>(new Map()); // 路由树数据
|
|
39
|
+
const routeTree = ref<RouteTreeNode[]>([]);
|
|
40
|
+
|
|
41
|
+
// 最后更新时间
|
|
42
|
+
const lastUpdateTime = ref<number>(0);
|
|
43
|
+
|
|
44
|
+
// WebSocket 连接状态
|
|
45
|
+
const wsConnected = ref<boolean>(false);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 初始化路由树数据
|
|
49
|
+
*/
|
|
50
|
+
function initializeRouteData() {
|
|
51
|
+
// 获取主项目的 pages - 只存储路径
|
|
52
|
+
const projectStructure = readProjectModules();
|
|
53
|
+
const rawProjectPages = projectStructure?.pages || {};
|
|
54
|
+
projectPages.value = Object.keys(rawProjectPages).reduce((acc, key) => {
|
|
55
|
+
acc[key] = key; // 存储路径本身
|
|
56
|
+
return acc;
|
|
57
|
+
}, {} as Record<string, string>);
|
|
58
|
+
|
|
59
|
+
// 获取所有模块的 pages - 只存储路径
|
|
60
|
+
const routeModuleMap = getAllRouteModules();
|
|
61
|
+
const modulePageMap = new Map<string, Record<string, string>>();
|
|
62
|
+
for (const [id, moduleMap] of routeModuleMap) {
|
|
63
|
+
const pathMap = Object.keys(moduleMap).reduce((acc, key) => {
|
|
64
|
+
acc[key] = key; // 存储路径本身
|
|
65
|
+
return acc;
|
|
66
|
+
}, {} as Record<string, string>);
|
|
67
|
+
modulePageMap.set(id, pathMap);
|
|
68
|
+
}
|
|
69
|
+
modulePages.value = modulePageMap;
|
|
70
|
+
|
|
71
|
+
// 构建路由树
|
|
72
|
+
buildRouteTree();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 构建路由树结构
|
|
77
|
+
*/
|
|
78
|
+
function buildRouteTree() {
|
|
79
|
+
const treeNodes: RouteTreeNode[] = [];
|
|
80
|
+
|
|
81
|
+
// 构建本地项目节点
|
|
82
|
+
if (Object.keys(projectPages.value).length > 0) {
|
|
83
|
+
const localPaths = Object.keys(projectPages.value);
|
|
84
|
+
|
|
85
|
+
treeNodes.push(
|
|
86
|
+
buildTreeNode('本地', 'local', localPaths),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 构建模块节点
|
|
91
|
+
for (const [id, moduleMap] of modulePages.value) {
|
|
92
|
+
if (Object.keys(moduleMap).length > 0) {
|
|
93
|
+
treeNodes.push(
|
|
94
|
+
buildTreeNode(id, `module:${id}`, Object.keys(moduleMap), id),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
routeTree.value = treeNodes;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* 从扁平路径数组构建树节点
|
|
104
|
+
*/
|
|
105
|
+
function buildTreeNode(
|
|
106
|
+
label: string,
|
|
107
|
+
keyPrefix: string,
|
|
108
|
+
paths: string[],
|
|
109
|
+
scope?: string,
|
|
110
|
+
): RouteTreeNode {
|
|
111
|
+
const root: RouteTreeNode = {
|
|
112
|
+
title: label,
|
|
113
|
+
key: keyPrefix,
|
|
114
|
+
root: true,
|
|
115
|
+
module: keyPrefix !== 'local',
|
|
116
|
+
children: [],
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const findOrCreate = (parent: RouteTreeNode, title: string, key: string) => {
|
|
120
|
+
if (!parent.children) {
|
|
121
|
+
parent.children = [];
|
|
122
|
+
}
|
|
123
|
+
let node = parent.children.find(n => n.title === title && !n.isLeaf);
|
|
124
|
+
if (!node) {
|
|
125
|
+
node = { title, key, children: [] };
|
|
126
|
+
parent.children.push(node);
|
|
127
|
+
}
|
|
128
|
+
return node;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
for (const p of paths) {
|
|
132
|
+
const segs = p.split('/').filter(Boolean);
|
|
133
|
+
let current = root;
|
|
134
|
+
let acc = keyPrefix;
|
|
135
|
+
|
|
136
|
+
for (let i = 0; i < segs.length; i++) {
|
|
137
|
+
const seg = segs[i];
|
|
138
|
+
acc = acc ? `${acc}/${seg}` : seg;
|
|
139
|
+
const isLast = i === segs.length - 1;
|
|
140
|
+
|
|
141
|
+
if (isLast) {
|
|
142
|
+
// 叶子节点
|
|
143
|
+
current.children = current.children || [];
|
|
144
|
+
current.children.push({
|
|
145
|
+
title: seg,
|
|
146
|
+
key: acc,
|
|
147
|
+
isLeaf: true,
|
|
148
|
+
value: p,
|
|
149
|
+
scope,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
current = findOrCreate(current, seg, acc);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return root;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 处理 WebSocket 文件变化事件
|
|
163
|
+
*/
|
|
164
|
+
function handleFileChange(message: WebSocketMessage) {
|
|
165
|
+
const { action, file, timestamp } = message.data;
|
|
166
|
+
|
|
167
|
+
// 更新时间戳
|
|
168
|
+
lastUpdateTime.value = timestamp;
|
|
169
|
+
|
|
170
|
+
// 根据操作类型处理
|
|
171
|
+
if (action === 'add') {
|
|
172
|
+
handleFileAdd(file);
|
|
173
|
+
}
|
|
174
|
+
else if (action === 'unlink') {
|
|
175
|
+
handleFileRemove(file);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// 重新构建路由树
|
|
179
|
+
buildRouteTree();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* 处理文件添加
|
|
184
|
+
*/
|
|
185
|
+
function handleFileAdd(filePath: string) {
|
|
186
|
+
// 检查是否是 views 目录下的 .vue 文件
|
|
187
|
+
const relativePath = filePath.replace(/^.*\/src\//, 'src/');
|
|
188
|
+
|
|
189
|
+
if (relativePath.startsWith('src/views/') && relativePath.endsWith('.vue')) {
|
|
190
|
+
// 添加到主项目页面数据
|
|
191
|
+
projectPages.value = {
|
|
192
|
+
...projectPages.value,
|
|
193
|
+
[relativePath]: relativePath,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* 处理文件删除
|
|
200
|
+
*/
|
|
201
|
+
function handleFileRemove(filePath: string) {
|
|
202
|
+
// 检查是否是 views 目录下的 .vue 文件
|
|
203
|
+
const relativePath = filePath.replace(/^.*\/src\//, 'src/');
|
|
204
|
+
if (relativePath.startsWith('src/views/') && relativePath.endsWith('.vue')) {
|
|
205
|
+
// 从主项目页面数据中移除
|
|
206
|
+
const newProjectPages = { ...projectPages.value };
|
|
207
|
+
delete newProjectPages[relativePath];
|
|
208
|
+
projectPages.value = newProjectPages;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* 设置 WebSocket 连接状态
|
|
214
|
+
*/
|
|
215
|
+
function setWebSocketConnected(connected: boolean) {
|
|
216
|
+
wsConnected.value = connected;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* 获取路由树数据(用于组件)
|
|
221
|
+
*/
|
|
222
|
+
function getRouteTreeData() {
|
|
223
|
+
return routeTree.value;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 刷新路由树数据
|
|
228
|
+
*/
|
|
229
|
+
function refreshRouteTree() {
|
|
230
|
+
initializeRouteData();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* 根据搜索条件过滤树数据
|
|
235
|
+
*/
|
|
236
|
+
function filterRouteTree(searchQuery: string): RouteTreeNode[] {
|
|
237
|
+
if (!searchQuery.trim()) {
|
|
238
|
+
return routeTree.value;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const q = searchQuery.trim().toLowerCase();
|
|
242
|
+
|
|
243
|
+
const filterNodes = (nodes: RouteTreeNode[]): RouteTreeNode[] => {
|
|
244
|
+
const result: RouteTreeNode[] = [];
|
|
245
|
+
|
|
246
|
+
for (const node of nodes) {
|
|
247
|
+
const title = node.title.toLowerCase();
|
|
248
|
+
const value = (node.value || '').toLowerCase();
|
|
249
|
+
const key = node.key.toLowerCase();
|
|
250
|
+
const selfMatch = title.includes(q) || value.includes(q) || key.includes(q);
|
|
251
|
+
|
|
252
|
+
let filteredChildren: RouteTreeNode[] | undefined;
|
|
253
|
+
if (node.children && node.children.length > 0) {
|
|
254
|
+
filteredChildren = filterNodes(node.children);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if (selfMatch || (filteredChildren && filteredChildren.length > 0)) {
|
|
258
|
+
const cloned = { ...node };
|
|
259
|
+
if (filteredChildren) {
|
|
260
|
+
cloned.children = filteredChildren;
|
|
261
|
+
}
|
|
262
|
+
result.push(cloned);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return result;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
return filterNodes(routeTree.value);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
return {
|
|
273
|
+
// 状态
|
|
274
|
+
projectPages: readonly(projectPages),
|
|
275
|
+
modulePages: readonly(modulePages),
|
|
276
|
+
routeTree: readonly(routeTree),
|
|
277
|
+
lastUpdateTime: readonly(lastUpdateTime),
|
|
278
|
+
wsConnected: readonly(wsConnected),
|
|
279
|
+
|
|
280
|
+
// 方法
|
|
281
|
+
initializeRouteData,
|
|
282
|
+
handleFileChange,
|
|
283
|
+
setWebSocketConnected,
|
|
284
|
+
getRouteTreeData,
|
|
285
|
+
refreshRouteTree,
|
|
286
|
+
filterRouteTree,
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
if (import.meta.hot) {
|
|
291
|
+
import.meta.hot.accept(acceptHMRUpdate(useViewStore, import.meta.hot));
|
|
292
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useWebSocketManager } from '@/composables/useWebSocketManager';
|
|
2
|
+
import { useViewStore } from '@/stores/view';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 应用启动时的路由数据初始化
|
|
6
|
+
*/
|
|
7
|
+
export function initializeRouteSystem() {
|
|
8
|
+
const viewStore = useViewStore();
|
|
9
|
+
const wsManager = useWebSocketManager();
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
// 初始化路由数据
|
|
13
|
+
viewStore.initializeRouteData();
|
|
14
|
+
|
|
15
|
+
// 初始化 WebSocket 管理器
|
|
16
|
+
wsManager.initializeWebSocket();
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
viewStore,
|
|
20
|
+
wsManager,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('[RBAC] 路由系统初始化失败:', error);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 应用关闭时的清理逻辑
|
|
31
|
+
*/
|
|
32
|
+
export function cleanupRouteSystem() {
|
|
33
|
+
try {
|
|
34
|
+
const wsManager = useWebSocketManager();
|
|
35
|
+
wsManager.cleanupWebSocket();
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error('[RBAC] 路由系统清理失败:', error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 手动刷新路由数据
|
|
44
|
+
*/
|
|
45
|
+
export function refreshRouteSystem() {
|
|
46
|
+
try {
|
|
47
|
+
const viewStore = useViewStore();
|
|
48
|
+
viewStore.refreshRouteTree();
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
console.error('[RBAC] 路由系统数据刷新失败:', error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -116,7 +116,7 @@ async function request() {
|
|
|
116
116
|
const res = await getRegionGetListByParentId({
|
|
117
117
|
...query.value,
|
|
118
118
|
});
|
|
119
|
-
if (Object.keys(chilData.value).length > 0) {
|
|
119
|
+
if (chilData.value && Object.keys(chilData.value).length > 0) {
|
|
120
120
|
const length = res.data!.length;
|
|
121
121
|
if (length > 0) {
|
|
122
122
|
chilData.value.children = res.data?.map((e: API.PubRegion) => {
|