@pubinfo/module-rbac 2.0.0-beta.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/package.json +53 -0
- package/src/api/modules/assist/gonggaofuwu.ts +109 -0
- package/src/api/modules/assist/index.ts +5 -0
- package/src/api/modules/assist/qunzujiekou.ts +95 -0
- package/src/api/modules/assist/quyujiekou.ts +97 -0
- package/src/api/modules/assist/typings.d.ts +364 -0
- package/src/api/modules/configData/heibaimingdanfuwu.ts +95 -0
- package/src/api/modules/configData/index.ts +5 -0
- package/src/api/modules/configData/typings.d.ts +347 -0
- package/src/api/modules/configData/xitongpeizhifuwu.ts +322 -0
- package/src/api/modules/configData/zidianfuwu.ts +151 -0
- package/src/api/modules/log/caozuorizhifuwu.ts +37 -0
- package/src/api/modules/log/denglurizhifuwu.ts +37 -0
- package/src/api/modules/log/index.ts +4 -0
- package/src/api/modules/log/typings.d.ts +179 -0
- package/src/api/modules/rbac/gangweijiekou.ts +93 -0
- package/src/api/modules/rbac/index.ts +13 -0
- package/src/api/modules/rbac/jiaosejiekou.ts +124 -0
- package/src/api/modules/rbac/pubJiaosezukongzhiqi.ts +113 -0
- package/src/api/modules/rbac/shujuquanxianzhubiaokongzhiqi.ts +186 -0
- package/src/api/modules/rbac/typings.d.ts +2001 -0
- package/src/api/modules/rbac/yonghujiekou.ts +225 -0
- package/src/api/modules/rbac/yonghushoucangbiaojiekou.ts +93 -0
- package/src/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +72 -0
- package/src/api/modules/rbac/ziyuanjiekou.ts +223 -0
- package/src/api/modules/rbac/zuhuguanlijiekou.ts +91 -0
- package/src/api/modules/rbac/zuzhijiaosebiaokongzhiqi.ts +76 -0
- package/src/api/modules/rbac/zuzhijiekou.ts +171 -0
- package/src/api/request.ts +3 -0
- package/src/assets/icons/403.svg +1 -0
- package/src/assets/icons/403_dark.svg +1 -0
- package/src/assets/icons/404.svg +1 -0
- package/src/assets/icons/404_dark.svg +1 -0
- package/src/assets/icons/add-child.svg +1 -0
- package/src/assets/icons/authority.svg +1 -0
- package/src/assets/icons/authorize.svg +1 -0
- package/src/assets/icons/blacklist-disable.svg +1 -0
- package/src/assets/icons/blacklist-enable.svg +1 -0
- package/src/assets/icons/browser-360.svg +1 -0
- package/src/assets/icons/browser-chrome.svg +1 -0
- package/src/assets/icons/browser-edge.svg +1 -0
- package/src/assets/icons/browser-ie.svg +1 -0
- package/src/assets/icons/browser-other.svg +1 -0
- package/src/assets/icons/browser-qq.svg +1 -0
- package/src/assets/icons/browser-safari.svg +1 -0
- package/src/assets/icons/browser-uc.svg +1 -0
- package/src/assets/icons/change-org.svg +1 -0
- package/src/assets/icons/edit.svg +1 -0
- package/src/assets/icons/empty-data.svg +1 -0
- package/src/assets/icons/favorites.svg +1 -0
- package/src/assets/icons/icard.svg +1 -0
- package/src/assets/icons/icon_animation.svg +1 -0
- package/src/assets/icons/icon_breadcrumb.svg +1 -0
- package/src/assets/icons/icon_copyright.svg +1 -0
- package/src/assets/icons/icon_jt.svg +1 -0
- package/src/assets/icons/icon_layout.svg +1 -0
- package/src/assets/icons/icon_mainpage.svg +1 -0
- package/src/assets/icons/icon_menu.svg +1 -0
- package/src/assets/icons/icon_page_size.svg +1 -0
- package/src/assets/icons/icon_position_type.svg +1 -0
- package/src/assets/icons/icon_safe_manage.svg +1 -0
- package/src/assets/icons/icon_screen_scale.svg +6 -0
- package/src/assets/icons/icon_system_manage.svg +1 -0
- package/src/assets/icons/icon_tabbar.svg +1 -0
- package/src/assets/icons/icon_toolbar.svg +1 -0
- package/src/assets/icons/icon_topbar.svg +1 -0
- package/src/assets/icons/icon_watermark.svg +1 -0
- package/src/assets/icons/image-load-fail.svg +1 -0
- package/src/assets/icons/log-center.svg +1 -0
- package/src/assets/icons/logo-sig.svg +1 -0
- package/src/assets/icons/logo.svg +1 -0
- package/src/assets/icons/mima.svg +1 -0
- package/src/assets/icons/not-data.svg +1 -0
- package/src/assets/icons/org-main.svg +1 -0
- package/src/assets/icons/org-unmain.svg +1 -0
- package/src/assets/icons/process-management.svg +1 -0
- package/src/assets/icons/project-management.svg +1 -0
- package/src/assets/icons/rbac.svg +1 -0
- package/src/assets/icons/remove.svg +1 -0
- package/src/assets/icons/resource-app.svg +1 -0
- package/src/assets/icons/resource-btn.svg +1 -0
- package/src/assets/icons/resource-index.svg +1 -0
- package/src/assets/icons/resource-menu.svg +1 -0
- package/src/assets/icons/resource-nonmenu.svg +1 -0
- package/src/assets/icons/setting-manage.svg +1 -0
- package/src/assets/icons/test.svg +1 -0
- package/src/assets/icons/theme-check-mark.svg +1 -0
- package/src/assets/icons/theme-title.svg +1 -0
- package/src/assets/icons/toolbar-collapse.svg +1 -0
- package/src/assets/icons/tree_icon.svg +1 -0
- package/src/assets/icons/tree_icon_checked.svg +1 -0
- package/src/assets/icons/view.svg +1 -0
- package/src/assets/icons/workbench.svg +1 -0
- package/src/assets/icons/zddata.svg +1 -0
- package/src/assets/icons/zy_checked.svg +1 -0
- package/src/assets/icons/zy_default.svg +1 -0
- package/src/assets/images/layout/item1.webp +0 -0
- package/src/assets/images/layout/item1_dark.webp +0 -0
- package/src/assets/images/layout/item2.webp +0 -0
- package/src/assets/images/layout/item2_dark.webp +0 -0
- package/src/assets/images/layout/item3.webp +0 -0
- package/src/assets/images/layout/item3_dark.webp +0 -0
- package/src/assets/images/layout/item4.webp +0 -0
- package/src/assets/images/layout/item4_dark.webp +0 -0
- package/src/assets/images/layout/item5.webp +0 -0
- package/src/assets/images/layout/item5_dark.webp +0 -0
- package/src/assets/images/page-width/anto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/auto.webp +0 -0
- package/src/assets/images/page-width/auto_dark.webp +0 -0
- package/src/assets/images/page-width/auto_min_w.webp +0 -0
- package/src/assets/images/page-width/auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto.webp +0 -0
- package/src/assets/images/page-width/icon_auto_dark.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w.webp +0 -0
- package/src/assets/images/page-width/icon_auto_min_w_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle.webp +0 -0
- package/src/assets/images/page-width/icon_middle_dark.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w.webp +0 -0
- package/src/assets/images/page-width/icon_middle_max_w_dark.webp +0 -0
- package/src/assets/images/page-width/middle.webp +0 -0
- package/src/assets/images/page-width/middle_dark.webp +0 -0
- package/src/assets/images/page-width/middle_max_w.webp +0 -0
- package/src/assets/images/page-width/middle_max_w_dark.webp +0 -0
- package/src/assets/lottie/breadcrumb/dark/enable.json +1 -0
- package/src/assets/lottie/breadcrumb/dark/enableMainMenu.json +1 -0
- package/src/assets/lottie/breadcrumb/dark/style.json +1 -0
- package/src/assets/lottie/breadcrumb/light/enable.json +1 -0
- package/src/assets/lottie/breadcrumb/light/enableMainMenu.json +1 -0
- package/src/assets/lottie/breadcrumb/light/style.json +1 -0
- package/src/assets/lottie/layout/data-test.json +1 -0
- package/src/assets/lottie/layout/data.json +1 -0
- package/src/assets/lottie/menu/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/menu/dark/enableSubMenuCollapseButton.json +1 -0
- package/src/assets/lottie/menu/dark/isRounded.json +1 -0
- package/src/assets/lottie/menu/dark/menuActiveStyle.json +1 -0
- package/src/assets/lottie/menu/dark/subMenuCollapse.json +1 -0
- package/src/assets/lottie/menu/dark/subMenuUniqueOpened.json +1 -0
- package/src/assets/lottie/menu/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/menu/light/enableSubMenuCollapseButton.json +1 -0
- package/src/assets/lottie/menu/light/isRounded.json +1 -0
- package/src/assets/lottie/menu/light/menuActiveStyle.json +1 -0
- package/src/assets/lottie/menu/light/subMenuCollapse.json +1 -0
- package/src/assets/lottie/menu/light/subMenuUniqueOpened.json +1 -0
- package/src/assets/lottie/other/dark/enableCopyright.json +1 -0
- package/src/assets/lottie/other/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/other/dark/switchTabbarAndToolbar.json +1 -0
- package/src/assets/lottie/other/light/enableCopyright.json +1 -0
- package/src/assets/lottie/other/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/other/light/switchTabbarAndToolbar.json +1 -0
- package/src/assets/lottie/page_animation/dark/fadeinout.json +1 -0
- package/src/assets/lottie/page_animation/dark/fadeinout_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/tobottom.json +1 -0
- package/src/assets/lottie/page_animation/dark/tobottom_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/toleft.json +1 -0
- package/src/assets/lottie/page_animation/dark/toleft_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/toright.json +1 -0
- package/src/assets/lottie/page_animation/dark/toright_old.json +1 -0
- package/src/assets/lottie/page_animation/dark/totop.json +1 -0
- package/src/assets/lottie/page_animation/dark/totop_old.json +1 -0
- package/src/assets/lottie/page_animation/light/fadeinout.json +1 -0
- package/src/assets/lottie/page_animation/light/tobottom.json +1 -0
- package/src/assets/lottie/page_animation/light/toleft.json +1 -0
- package/src/assets/lottie/page_animation/light/toright.json +1 -0
- package/src/assets/lottie/page_animation/light/totop.json +1 -0
- package/src/assets/lottie/tabbar/dark/enable.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableHotkeys.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableIcon.json +1 -0
- package/src/assets/lottie/tabbar/dark/enableMemory.json +1 -0
- package/src/assets/lottie/tabbar/dark/style.json +1 -0
- package/src/assets/lottie/tabbar/light/enable.json +1 -0
- package/src/assets/lottie/tabbar/light/enableHotkeys.json +1 -0
- package/src/assets/lottie/tabbar/light/enableIcon.json +1 -0
- package/src/assets/lottie/tabbar/light/enableMemory.json +1 -0
- package/src/assets/lottie/tabbar/light/style.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableColorScheme.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableFullscreen.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableI18n.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableNotification.json +1 -0
- package/src/assets/lottie/toolbar/dark/enablePageReload.json +1 -0
- package/src/assets/lottie/toolbar/dark/enableUserPreferences.json +1 -0
- package/src/assets/lottie/toolbar/dark/navSearchEnable.json +1 -0
- package/src/assets/lottie/toolbar/dark/navSearchEnableHotkeys.json +1 -0
- package/src/assets/lottie/toolbar/light/enableColorScheme.json +1 -0
- package/src/assets/lottie/toolbar/light/enableFullscreen.json +1 -0
- package/src/assets/lottie/toolbar/light/enableI18n.json +1 -0
- package/src/assets/lottie/toolbar/light/enableNotification.json +1 -0
- package/src/assets/lottie/toolbar/light/enablePageReload.json +1 -0
- package/src/assets/lottie/toolbar/light/enableUserPreferences.json +1 -0
- package/src/assets/lottie/toolbar/light/navSearchEnable.json +1 -0
- package/src/assets/lottie/toolbar/light/navSearchEnableHotkeys.json +1 -0
- package/src/assets/lottie/watermark/dark/enableWatermark.json +1 -0
- package/src/assets/lottie/watermark/light/enableWatermark.json +1 -0
- package/src/assets/styles/vxe-table.css +13 -0
- package/src/components/GroupSelector/index.vue +311 -0
- package/src/components/OrgTree/index.vue +91 -0
- package/src/components/OrgUserSelector/OrgSelector.vue +135 -0
- package/src/components/OrgUserSelector/UserSelector.vue +164 -0
- package/src/components/OrgUserSelector/index.ts +47 -0
- package/src/components/OrgUserSelector/provider.ts +373 -0
- package/src/components/ResourceSelector/enum.ts +5 -0
- package/src/components/ResourceSelector/hooks/useAppAndResource.ts +96 -0
- package/src/components/ResourceSelector/index.vue +432 -0
- package/src/composables/useLottie.ts +65 -0
- package/src/index.ts +31 -0
- package/src/interface.ts +54 -0
- package/src/routes/index.ts +156 -0
- package/src/routes/modules/authority.manage.menu.ts +105 -0
- package/src/routes/modules/log.manage.menu.ts +45 -0
- package/src/routes/modules/safe.manage.menu.ts +71 -0
- package/src/routes/modules/stylesetting.manage.menu.ts +130 -0
- package/src/routes/modules/system.manage.menu.ts +92 -0
- package/src/stores/index.ts +1 -0
- package/src/views/blackWhiteList/components/drawerBlackWhiteList.vue +132 -0
- package/src/views/blackWhiteList/enum.ts +7 -0
- package/src/views/blackWhiteList/index.vue +309 -0
- package/src/views/blackWhiteList/types.ts +4 -0
- package/src/views/breadcrumb_setting/animationData.ts +15 -0
- package/src/views/breadcrumb_setting/index.vue +147 -0
- package/src/views/components/HCheckList.vue +47 -0
- package/src/views/components/animation_item.vue +37 -0
- package/src/views/components/setItem.vue +126 -0
- package/src/views/data-permission/components/createAndEditDataPermission.vue +354 -0
- package/src/views/data-permission/enum.ts +59 -0
- package/src/views/data-permission/index.vue +190 -0
- package/src/views/dictionary/components/drawerDictionary.vue +108 -0
- package/src/views/dictionary/components/drawerDictionaryItem.vue +115 -0
- package/src/views/dictionary/enum.ts +8 -0
- package/src/views/dictionary/index.vue +194 -0
- package/src/views/dictionary/itemlist.vue +164 -0
- package/src/views/group/components/drawerGroup.vue +177 -0
- package/src/views/group/enum.ts +25 -0
- package/src/views/group/index.vue +207 -0
- package/src/views/layout_setting/index.vue +306 -0
- package/src/views/log_center/components/browserType.vue +35 -0
- package/src/views/log_center/components/loginHistoryDetail.vue +71 -0
- package/src/views/log_center/components/operateHistoryDetail.vue +80 -0
- package/src/views/log_center/login_history.vue +239 -0
- package/src/views/log_center/operate_history.vue +233 -0
- package/src/views/menu_setting/animationData.ts +27 -0
- package/src/views/menu_setting/index.vue +207 -0
- package/src/views/organization/components/drawerOrganization.vue +161 -0
- package/src/views/organization/components/drawerRole.vue +159 -0
- package/src/views/organization/components/roleSelect.vue +258 -0
- package/src/views/organization/enum.ts +26 -0
- package/src/views/organization/index.vue +516 -0
- package/src/views/other_setting/animationData.ts +15 -0
- package/src/views/other_setting/index.vue +250 -0
- package/src/views/other_setting/interface.ts +26 -0
- package/src/views/page_animation_setting/animationData.ts +23 -0
- package/src/views/page_animation_setting/index.vue +200 -0
- package/src/views/page_w_setting/index.vue +238 -0
- package/src/views/position/components/drawerPosition.vue +131 -0
- package/src/views/position/enum.ts +8 -0
- package/src/views/position/index.vue +167 -0
- package/src/views/region/components/drawerRegion.vue +143 -0
- package/src/views/region/enum.ts +24 -0
- package/src/views/region/index.vue +246 -0
- package/src/views/resource/components/ResourceEdit.vue +209 -0
- package/src/views/resource/components/RoleRelation.vue +100 -0
- package/src/views/resource/enum.ts +35 -0
- package/src/views/resource/index.vue +237 -0
- package/src/views/resource/interface.ts +6 -0
- package/src/views/role/components/ResourceRelation.vue +113 -0
- package/src/views/role/components/drawerRole.vue +191 -0
- package/src/views/role/enum.ts +26 -0
- package/src/views/role/index.vue +183 -0
- package/src/views/role/interface.ts +6 -0
- package/src/views/role_group/components/ResourceRelation.vue +91 -0
- package/src/views/role_group/components/drawerRole.vue +153 -0
- package/src/views/role_group/components/roleSelect.vue +224 -0
- package/src/views/role_group/enum.ts +22 -0
- package/src/views/role_group/index.vue +170 -0
- package/src/views/role_group/interface.ts +6 -0
- package/src/views/safe_setting/index.vue +237 -0
- package/src/views/tabbar_setting/animationData.ts +23 -0
- package/src/views/tabbar_setting/index.vue +186 -0
- package/src/views/tenant/components/TenantEdit.vue +226 -0
- package/src/views/tenant/index.vue +192 -0
- package/src/views/tenant/interface.ts +4 -0
- package/src/views/theme_setting/index.vue +465 -0
- package/src/views/toolbar_setting/animationData.ts +42 -0
- package/src/views/toolbar_setting/index.vue +189 -0
- package/src/views/user/components/OrgAndPosition.vue +156 -0
- package/src/views/user/components/UserAuthorization.vue +260 -0
- package/src/views/user/components/UserEdit.vue +267 -0
- package/src/views/user/components/roleSelect.vue +258 -0
- package/src/views/user/enum.ts +13 -0
- package/src/views/user/index.vue +266 -0
- package/src/views/user/interface.ts +43 -0
- package/src/views/watermark_setting/animationData.ts +7 -0
- package/src/views/watermark_setting/index.vue +236 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { VxeTableInstance, VxeTablePropTypes } from 'vxe-table';
|
|
3
|
+
import { getRbacOrgDeleteOrg, getRbacOrgOrgListByParentId, getRbacOrgSearchTreeById, postRbacOrgSearch } from '@/api/modules/rbac';
|
|
4
|
+
import { useToggle } from '@vueuse/core';
|
|
5
|
+
import { Badge, message, Modal } from 'ant-design-vue';
|
|
6
|
+
import { cloneDeep } from 'lodash-es';
|
|
7
|
+
import { VxeColumn, VxeTable } from 'vxe-table';
|
|
8
|
+
import DrawerOrganization from './components/drawerOrganization.vue';
|
|
9
|
+
import DrawerRole from './components/drawerRole.vue';
|
|
10
|
+
import { ACTION } from './enum';
|
|
11
|
+
|
|
12
|
+
defineOptions({
|
|
13
|
+
name: 'Organization',
|
|
14
|
+
});
|
|
15
|
+
const VNodes = defineComponent({
|
|
16
|
+
props: {
|
|
17
|
+
vnodes: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
setup(props) {
|
|
24
|
+
return () => props.vnodes;
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
type ChilData = API.PubOrg & { children?: API.PubOrg[], hasChild?: boolean };
|
|
29
|
+
|
|
30
|
+
const [loading, setLoading] = useToggle(false);
|
|
31
|
+
/** 下拉查询的相关数据 start */
|
|
32
|
+
const formState: Ref<API.OrgSearchQuery> = ref({ currentPage: 1, pageSize: 10, doSearchTotal: true });
|
|
33
|
+
const searchId: Ref<string> = ref('');
|
|
34
|
+
const searchText: Ref<string> = ref('');
|
|
35
|
+
const selectOptions = ref<any[]>([]);
|
|
36
|
+
const searchTotal: Ref<number> = ref(0);
|
|
37
|
+
// 保留searchResultData,为了在查询状态下,当展开下一级时,使用的是查询结果的数据
|
|
38
|
+
const searchResultData: Ref<ChilData[]> = ref([]);
|
|
39
|
+
// 查询后的数据是需要全部展开的,所以除了最后一级之外其余全部存储在expandedRowKeys
|
|
40
|
+
const expandedRowKeys = ref<string[]>([]);
|
|
41
|
+
/** 下拉查询的相关数据 end */
|
|
42
|
+
|
|
43
|
+
const query = ref<API.getRbacOrgOrgListByParentIdParams>({ parentId: '0' });
|
|
44
|
+
|
|
45
|
+
const tableData: Ref<ChilData[]> = ref([]);
|
|
46
|
+
|
|
47
|
+
const tableRef = ref<VxeTableInstance<ChilData>>();
|
|
48
|
+
const DrawerOrganizationRef = ref();
|
|
49
|
+
const DrawerRoleRef = ref();
|
|
50
|
+
const isSearch = ref(false);
|
|
51
|
+
let timeout: any;
|
|
52
|
+
|
|
53
|
+
function handleZuZhiSearch(val: string) {
|
|
54
|
+
// console.log('--val:', val);
|
|
55
|
+
formState.value.currentPage = 1;
|
|
56
|
+
if (val.length > 0) {
|
|
57
|
+
searchText.value = val;
|
|
58
|
+
debounce(() => {
|
|
59
|
+
const params = { ...formState.value, keyWord: searchText.value };
|
|
60
|
+
getSelectData(params);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
selectOptions.value = [];
|
|
65
|
+
searchTotal.value = 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function getSelectData(params: any) {
|
|
70
|
+
postRbacOrgSearch(params).then((res: any) => {
|
|
71
|
+
if (res?.success) {
|
|
72
|
+
selectOptions.value = res.data.records.map((item: API.PubOrg) => {
|
|
73
|
+
return {
|
|
74
|
+
label: item.name,
|
|
75
|
+
value: item.id,
|
|
76
|
+
idPath: item.idPath,
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
searchTotal.value = res.data.total;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function debounce(callback: () => void, delay = 300): void {
|
|
84
|
+
clearTimeout(timeout);
|
|
85
|
+
timeout = setTimeout(() => {
|
|
86
|
+
callback();
|
|
87
|
+
}, delay);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function handleChange(): void {
|
|
91
|
+
const params = { ...formState.value, keyWord: searchText.value };
|
|
92
|
+
getSelectData(params);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function handleSelectChange(value: any): void {
|
|
96
|
+
// 当清空数据时,需要清空下拉数据
|
|
97
|
+
if (value === undefined) {
|
|
98
|
+
selectOptions.value = [];
|
|
99
|
+
searchTotal.value = 0;
|
|
100
|
+
formState.value.currentPage = 1;
|
|
101
|
+
searchId.value = '';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function onSearch() {
|
|
106
|
+
if (searchId.value === '') {
|
|
107
|
+
isSearch.value = false;
|
|
108
|
+
generateData();
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const idPath = selectOptions.value.find(item => item.value === searchId.value).idPath;
|
|
112
|
+
expandedRowKeys.value = idPath.split(',');
|
|
113
|
+
// 删除当前最后一级节点,使其处于不展开的状态
|
|
114
|
+
expandedRowKeys.value.pop();
|
|
115
|
+
const res = await getRbacOrgSearchTreeById({ id: searchId.value });
|
|
116
|
+
searchResultData.value = addPropertyToTreeNodes([res.data!]);
|
|
117
|
+
tableData.value = cloneDeep(searchResultData.value);
|
|
118
|
+
tableRef.value?.reloadData(tableData.value);
|
|
119
|
+
if (expandedRowKeys.value.length > 0) {
|
|
120
|
+
expandedRowKeys.value.forEach((key) => {
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
const row = getNodeById(tableData.value, key);
|
|
123
|
+
tableRef.value?.reloadTreeExpand(row);
|
|
124
|
+
}, 200);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function addPropertyToTreeNodes(nodes: ChilData[]): ChilData[] {
|
|
131
|
+
return nodes.map((node) => {
|
|
132
|
+
// 为当前节点添加新属性
|
|
133
|
+
const newNode: ChilData = {
|
|
134
|
+
...node,
|
|
135
|
+
hasChild: !node.leaf,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// 如果当前节点有子节点,递归调用addPropertyToTreeNodes
|
|
139
|
+
if (node.children && node.children.length > 0) {
|
|
140
|
+
newNode.children = addPropertyToTreeNodes(node.children);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return newNode;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function reset() {
|
|
148
|
+
searchId.value = '';
|
|
149
|
+
isSearch.value = false;
|
|
150
|
+
generateData();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function generateData(): void {
|
|
154
|
+
expandedRowKeys.value = [];
|
|
155
|
+
setLoading(true);
|
|
156
|
+
getRbacOrgOrgListByParentId({
|
|
157
|
+
parentId: '0',
|
|
158
|
+
}).then((res: any) => {
|
|
159
|
+
if (res?.success) {
|
|
160
|
+
tableData.value = res.data?.map((e: API.PubOrg) => {
|
|
161
|
+
return {
|
|
162
|
+
...e,
|
|
163
|
+
children: [],
|
|
164
|
+
hasChild: !e.leaf,
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
tableRef.value?.reloadData(tableData.value);
|
|
168
|
+
}
|
|
169
|
+
setLoading(false);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
generateData();
|
|
174
|
+
|
|
175
|
+
const operateRow = ref<ChilData>({});
|
|
176
|
+
const operateType = ref<string>('');
|
|
177
|
+
|
|
178
|
+
function updateData() {
|
|
179
|
+
if (operateType.value === ACTION.ADD) {
|
|
180
|
+
searchId.value = '';
|
|
181
|
+
isSearch.value = false;
|
|
182
|
+
generateData();
|
|
183
|
+
}
|
|
184
|
+
else if (operateType.value === ACTION.ADDNEXT) {
|
|
185
|
+
if (operateRow.value.hasChild) {
|
|
186
|
+
tableRef.value?.setTreeExpand(operateRow.value.children, false);
|
|
187
|
+
tableRef.value?.reloadTreeExpand(operateRow.value);
|
|
188
|
+
}
|
|
189
|
+
// 没有子节点的新增下级需要刷新父节点,使其节点前面多一个加号
|
|
190
|
+
else {
|
|
191
|
+
const parentNode = getNodeById(tableData.value, operateRow.value.parentId!);
|
|
192
|
+
if (parentNode) {
|
|
193
|
+
tableRef.value?.setTreeExpand(parentNode.children, false);
|
|
194
|
+
tableRef.value?.reloadTreeExpand(parentNode);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
generateData();
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// 编辑某一行数据后,把父节点关闭然后重新打开,页面数据才更新
|
|
202
|
+
else if (operateType.value === ACTION.EDIT) {
|
|
203
|
+
const parentNode = getNodeById(tableData.value, operateRow.value.parentId!);
|
|
204
|
+
tableRef.value?.setTreeExpand(parentNode.children, false);
|
|
205
|
+
tableRef.value?.reloadTreeExpand(parentNode);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/* 获取某节点的信息 */
|
|
209
|
+
function getNodeById(nodes: any, id: string): any {
|
|
210
|
+
for (const node of nodes) {
|
|
211
|
+
if (node.id === id) {
|
|
212
|
+
return node;
|
|
213
|
+
}
|
|
214
|
+
if (node.children) {
|
|
215
|
+
const foundNode = getNodeById(node.children, id);
|
|
216
|
+
if (foundNode) {
|
|
217
|
+
return foundNode;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const treeConfig = reactive<VxeTablePropTypes.TreeConfig<ChilData>>({
|
|
225
|
+
lazy: true,
|
|
226
|
+
transform: true,
|
|
227
|
+
reserve: false,
|
|
228
|
+
rowField: 'id',
|
|
229
|
+
parentField: 'parentId',
|
|
230
|
+
hasChildField: 'hasChild',
|
|
231
|
+
childrenField: 'children',
|
|
232
|
+
iconOpen: 'vxe-icon-minus',
|
|
233
|
+
iconClose: 'vxe-icon-add',
|
|
234
|
+
loadMethod({ row }) {
|
|
235
|
+
if (expandedRowKeys.value.includes(row.id!)) {
|
|
236
|
+
return new Promise((resolve) => {
|
|
237
|
+
const node = getNodeById(searchResultData.value, row.id!);
|
|
238
|
+
const childs = cloneDeep(node.children);
|
|
239
|
+
resolve(childs);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
// 异步加载子节点
|
|
244
|
+
query.value.parentId = row.id;
|
|
245
|
+
return new Promise((resolve) => {
|
|
246
|
+
getRbacOrgOrgListByParentId({
|
|
247
|
+
...query.value,
|
|
248
|
+
}).then((res: any) => {
|
|
249
|
+
if (res?.success) {
|
|
250
|
+
const childs = res.data?.map((e: ChilData) => {
|
|
251
|
+
return {
|
|
252
|
+
...e,
|
|
253
|
+
hasChild: !e.leaf,
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
resolve(childs);
|
|
257
|
+
}
|
|
258
|
+
// console.log('*************', tableData.value);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
function onAction(key: string, record?: ChilData): void {
|
|
265
|
+
operateType.value = key;
|
|
266
|
+
switch (key) {
|
|
267
|
+
case ACTION.AUTHORIZE:
|
|
268
|
+
DrawerRoleRef.value.open(record);
|
|
269
|
+
break;
|
|
270
|
+
case ACTION.ADDNEXT:
|
|
271
|
+
operateRow.value = record!;
|
|
272
|
+
DrawerOrganizationRef.value.open(key, record);
|
|
273
|
+
break;
|
|
274
|
+
case ACTION.ADD:
|
|
275
|
+
DrawerOrganizationRef.value.open(key);
|
|
276
|
+
break;
|
|
277
|
+
case ACTION.EDIT:
|
|
278
|
+
operateRow.value = record!;
|
|
279
|
+
DrawerOrganizationRef.value.open(key, record);
|
|
280
|
+
break;
|
|
281
|
+
case ACTION.REMOVE:
|
|
282
|
+
operateRow.value = record!;
|
|
283
|
+
// console.log('remove', operateRow.value, tableData.value);
|
|
284
|
+
Modal.confirm({
|
|
285
|
+
title: '删除',
|
|
286
|
+
content: '确定要删除该组织吗?',
|
|
287
|
+
onOk() {
|
|
288
|
+
getRbacOrgDeleteOrg({ id: record?.id as string }).then((res: API.ResponseDataVoid) => {
|
|
289
|
+
if (res.success) {
|
|
290
|
+
message.success('删除成功');
|
|
291
|
+
const parentRow = getNodeById(tableData.value, operateRow.value.parentId!);
|
|
292
|
+
if (parentRow) {
|
|
293
|
+
if (parentRow.children?.length > 1) {
|
|
294
|
+
tableRef.value?.remove(operateRow.value);
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
// 如果他的父节点只有一个子节点,那么刷新他的父节点的父节点,使其没有前面的加号
|
|
298
|
+
const opRow = getNodeById(tableData.value, parentRow.parentId!);
|
|
299
|
+
if (opRow) {
|
|
300
|
+
tableRef.value?.setTreeExpand(opRow.children, false);
|
|
301
|
+
tableRef.value?.reloadTreeExpand(opRow);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
generateData();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
generateData();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
</script>
|
|
320
|
+
|
|
321
|
+
<template>
|
|
322
|
+
<div w-full h-full p-10px>
|
|
323
|
+
<div class="org_page bg-[#fff] dark:bg-[#141414]">
|
|
324
|
+
<div class="search_panel">
|
|
325
|
+
<div class="left">
|
|
326
|
+
<label class="dark:text-[#f7f7f7]">组织名称:</label>
|
|
327
|
+
<a-select
|
|
328
|
+
v-model:value="searchId"
|
|
329
|
+
class="w-400px!"
|
|
330
|
+
show-search
|
|
331
|
+
allow-clear
|
|
332
|
+
:filter-option="false"
|
|
333
|
+
:options="selectOptions.map(item => ({ ...item }))"
|
|
334
|
+
@search="handleZuZhiSearch"
|
|
335
|
+
@change="handleSelectChange"
|
|
336
|
+
>
|
|
337
|
+
<template #dropdownRender="{ menuNode: menu }">
|
|
338
|
+
<VNodes :vnodes="menu" />
|
|
339
|
+
<div class="text-right">
|
|
340
|
+
<a-pagination
|
|
341
|
+
v-if="searchTotal > 10"
|
|
342
|
+
v-model:current="formState.currentPage"
|
|
343
|
+
:show-size-changer="false"
|
|
344
|
+
size="small"
|
|
345
|
+
:total="searchTotal"
|
|
346
|
+
@change="handleChange"
|
|
347
|
+
/>
|
|
348
|
+
</div>
|
|
349
|
+
</template>
|
|
350
|
+
</a-select>
|
|
351
|
+
</div>
|
|
352
|
+
<div class="right">
|
|
353
|
+
<a-button @click="reset">
|
|
354
|
+
重置
|
|
355
|
+
</a-button>
|
|
356
|
+
<a-button class="ml-10px" type="primary" @click="onSearch">
|
|
357
|
+
搜索
|
|
358
|
+
</a-button>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
<div class="px-16px divider">
|
|
362
|
+
<a-divider />
|
|
363
|
+
</div>
|
|
364
|
+
<div class="body_panel" style="height: calc(100% - 74px);">
|
|
365
|
+
<div class="h-48px flex items-center px-16px">
|
|
366
|
+
<a-button v-auth="'org_add'" type="primary" @click="onAction(ACTION.ADD)">
|
|
367
|
+
<PlusCircleOutlined />
|
|
368
|
+
{{ ACTION.ADD }}
|
|
369
|
+
</a-button>
|
|
370
|
+
</div>
|
|
371
|
+
<div class="px-16px" style="height: calc(100% - 50px);">
|
|
372
|
+
<VxeTable
|
|
373
|
+
ref="tableRef"
|
|
374
|
+
border="inner"
|
|
375
|
+
keep-source
|
|
376
|
+
:loading="loading"
|
|
377
|
+
:auto-resize="true"
|
|
378
|
+
height="auto"
|
|
379
|
+
:row-config="{ keyField: 'id', isHover: true }"
|
|
380
|
+
:column-config="{ resizable: true }"
|
|
381
|
+
:tree-config="treeConfig"
|
|
382
|
+
:data="tableData"
|
|
383
|
+
:scroll-y="{ enabled: true }"
|
|
384
|
+
show-overflow
|
|
385
|
+
>
|
|
386
|
+
<VxeColumn
|
|
387
|
+
field="name"
|
|
388
|
+
title="组织名称"
|
|
389
|
+
width="300"
|
|
390
|
+
tree-node
|
|
391
|
+
/>
|
|
392
|
+
<VxeColumn field="enable" title="是否启动">
|
|
393
|
+
<template #default="{ row }">
|
|
394
|
+
<Badge v-if="row.enable" status="success" text="启用" />
|
|
395
|
+
<Badge v-else status="error" text="禁用" />
|
|
396
|
+
</template>
|
|
397
|
+
</VxeColumn>
|
|
398
|
+
<VxeColumn field="contactPerson" title="联系人" />
|
|
399
|
+
<VxeColumn field="contactMobile" title="联系电话" />
|
|
400
|
+
<VxeColumn field="type" title="组织类型" />
|
|
401
|
+
<VxeColumn field="code" title="组织编码" />
|
|
402
|
+
<VxeColumn field="action" title="操作" width="280">
|
|
403
|
+
<template #default="{ row }">
|
|
404
|
+
<a-space>
|
|
405
|
+
<a v-auth="'org_authorize'" class="flex items-center" @click="onAction(ACTION.AUTHORIZE, row)">
|
|
406
|
+
<PubinfoIcon name="authorize" mr-1 text-base />
|
|
407
|
+
<span>{{ ACTION.AUTHORIZE }}</span>
|
|
408
|
+
</a>
|
|
409
|
+
<a v-auth="'org_add_child'" class="flex items-center" @click="onAction(ACTION.ADDNEXT, row)">
|
|
410
|
+
<PubinfoIcon name="add-child" class="text-base" />
|
|
411
|
+
<span class="ml-4px">{{ ACTION.ADDNEXT }}</span>
|
|
412
|
+
</a>
|
|
413
|
+
<a v-auth="'org_edit'" class="flex items-center" @click="onAction(ACTION.EDIT, row)">
|
|
414
|
+
<PubinfoIcon name="edit" class="text-base" />
|
|
415
|
+
<span class="ml-4px">{{ ACTION.EDIT }}</span>
|
|
416
|
+
</a>
|
|
417
|
+
<span v-auth="'org_remove'" class="flex items-center text-red-500 hover:cursor-pointer hover:opacity-80" @click="onAction(ACTION.REMOVE, row)">
|
|
418
|
+
<PubinfoIcon name="remove" class="text-base" />
|
|
419
|
+
<span class="ml-4px">{{ ACTION.REMOVE }}</span>
|
|
420
|
+
</span>
|
|
421
|
+
</a-space>
|
|
422
|
+
</template>
|
|
423
|
+
</VxeColumn>
|
|
424
|
+
|
|
425
|
+
<template #empty>
|
|
426
|
+
<div class="flex-center">
|
|
427
|
+
<img src="@/assets/icons/not-data.svg" alt="">
|
|
428
|
+
</div>
|
|
429
|
+
</template>
|
|
430
|
+
</VxeTable>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
<DrawerOrganization
|
|
435
|
+
ref="DrawerOrganizationRef"
|
|
436
|
+
@submit="updateData"
|
|
437
|
+
/>
|
|
438
|
+
<DrawerRole ref="DrawerRoleRef" />
|
|
439
|
+
</div>
|
|
440
|
+
</template>
|
|
441
|
+
|
|
442
|
+
<style lang="scss" scoped>
|
|
443
|
+
.org_page {
|
|
444
|
+
position: relative;
|
|
445
|
+
box-sizing: border-box;
|
|
446
|
+
width: 100%;
|
|
447
|
+
height: 100%;
|
|
448
|
+
padding: 0;
|
|
449
|
+
margin: 0;
|
|
450
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
451
|
+
font-size: 14px;
|
|
452
|
+
line-height: 1.5714;
|
|
453
|
+
color: rgb(0 0 0 / 88%);
|
|
454
|
+
list-style: none;
|
|
455
|
+
border-radius: 8px;
|
|
456
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 3%), 0 1px 6px -1px rgb(0 0 0 / 2%), 0 2px 4px 0 rgb(0 0 0 / 2%);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.search_panel {
|
|
460
|
+
display: flex;
|
|
461
|
+
align-items: center;
|
|
462
|
+
justify-content: space-between;
|
|
463
|
+
// height: 80px;
|
|
464
|
+
padding: 16px 16px 16px 24px;
|
|
465
|
+
|
|
466
|
+
.left {
|
|
467
|
+
display: flex;
|
|
468
|
+
align-items: center;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.right {
|
|
472
|
+
display: flex;
|
|
473
|
+
align-items: center;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.divider {
|
|
478
|
+
:deep(.ant-divider-horizontal) {
|
|
479
|
+
margin: 0;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
</style>
|
|
483
|
+
|
|
484
|
+
<style lang="scss" scoped>
|
|
485
|
+
:deep(.vxe-table--body-wrapper) {
|
|
486
|
+
overflow-x: hidden;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
:deep(.vxe-tree--btn-wrapper) {
|
|
490
|
+
width: 15px !important;
|
|
491
|
+
height: 15px !important;
|
|
492
|
+
border: 1px solid #f0f0f0;
|
|
493
|
+
border-radius: 6px;
|
|
494
|
+
|
|
495
|
+
&:hover {
|
|
496
|
+
border-color: #69b1ff !important;
|
|
497
|
+
|
|
498
|
+
.vxe-tree--node-btn {
|
|
499
|
+
color: #69b1ff !important;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
:deep(.vxe-header--column .vxe-resizable) {
|
|
505
|
+
right: 0;
|
|
506
|
+
bottom: 14px;
|
|
507
|
+
width: 1px;
|
|
508
|
+
height: 1.6em;
|
|
509
|
+
background-color: var(--vxe-table-border-color);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
:deep([class*="vxe-icon-"]) {
|
|
513
|
+
font-size: 12px;
|
|
514
|
+
transform: scale(0.8);
|
|
515
|
+
}
|
|
516
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import darkEnableCopyrightData from '@/assets/lottie/other/dark/enableCopyright.json?url';
|
|
2
|
+
import darkEnableHotkeysData from '@/assets/lottie/other/dark/enableHotkeys.json?url';
|
|
3
|
+
import darkSwitchTabbarAndToolbarData from '@/assets/lottie/other/dark/switchTabbarAndToolbar.json?url';
|
|
4
|
+
import lightEnableCopyrightData from '@/assets/lottie/other/light/enableCopyright.json?url';
|
|
5
|
+
import lightEnableHotkeysData from '@/assets/lottie/other/light/enableHotkeys.json?url';
|
|
6
|
+
import lightSwitchTabbarAndToolbarData from '@/assets/lottie/other/light/switchTabbarAndToolbar.json?url';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
darkEnableCopyrightData,
|
|
10
|
+
darkEnableHotkeysData,
|
|
11
|
+
darkSwitchTabbarAndToolbarData,
|
|
12
|
+
lightEnableCopyrightData,
|
|
13
|
+
lightEnableHotkeysData,
|
|
14
|
+
lightSwitchTabbarAndToolbarData,
|
|
15
|
+
};
|