@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,164 @@
|
|
|
1
|
+
<script setup lang="tsx">
|
|
2
|
+
import type { ProColumns } from '@pubinfo/pro-components';
|
|
3
|
+
import { deleteDictItemDeleteById, postDictItemPage } from '@/api/modules/configData';
|
|
4
|
+
import { ProTable } from '@pubinfo/pro-components';
|
|
5
|
+
import { Badge, message, Modal } from 'ant-design-vue';
|
|
6
|
+
import drawerDictionaryItem from './components/drawerDictionaryItem.vue';
|
|
7
|
+
import { ACTION } from './enum';
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'DictionaryItem',
|
|
11
|
+
});
|
|
12
|
+
const { auth } = useAuth();
|
|
13
|
+
const tableRef = ref();
|
|
14
|
+
const DrawerDictionaryItemRef = ref();
|
|
15
|
+
|
|
16
|
+
const columns: ProColumns<API.DictItemVo> = [
|
|
17
|
+
{
|
|
18
|
+
minWidth: 100,
|
|
19
|
+
title: '字典项标签名',
|
|
20
|
+
dataIndex: 'dictLabel',
|
|
21
|
+
ellipsis: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
minWidth: 100,
|
|
25
|
+
title: '字典项值',
|
|
26
|
+
dataIndex: 'dictValue',
|
|
27
|
+
ellipsis: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
minWidth: 200,
|
|
31
|
+
title: '描述',
|
|
32
|
+
dataIndex: 'description',
|
|
33
|
+
ellipsis: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
width: 80,
|
|
37
|
+
minWidth: 60,
|
|
38
|
+
title: '排序',
|
|
39
|
+
dataIndex: 'sort',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
width: 100,
|
|
43
|
+
minWidth: 80,
|
|
44
|
+
title: '是否启用',
|
|
45
|
+
dataIndex: 'enable',
|
|
46
|
+
customRender({ text }: { text: boolean }) {
|
|
47
|
+
return (
|
|
48
|
+
text
|
|
49
|
+
? <Badge status="success" text="启用" />
|
|
50
|
+
: <Badge status="error" text="禁用" />
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: '操作',
|
|
56
|
+
dataIndex: 'action',
|
|
57
|
+
width: 160,
|
|
58
|
+
fixed: 'right',
|
|
59
|
+
hideInTable() {
|
|
60
|
+
return !auth([
|
|
61
|
+
'dictionary_data_remove',
|
|
62
|
+
'dictionary_data_edit',
|
|
63
|
+
]);
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const state = reactive({
|
|
69
|
+
code: '',
|
|
70
|
+
name: '',
|
|
71
|
+
});
|
|
72
|
+
const route = useRoute();
|
|
73
|
+
onMounted(() => {
|
|
74
|
+
state.code = route.query.code as string;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
function onAction(key: string, record?: API.DictItemVo): void {
|
|
78
|
+
switch (key) {
|
|
79
|
+
case ACTION.ADD:
|
|
80
|
+
DrawerDictionaryItemRef.value.open(key, state.code);
|
|
81
|
+
break;
|
|
82
|
+
case ACTION.EDIT:
|
|
83
|
+
DrawerDictionaryItemRef.value.open(key, state.code, record);
|
|
84
|
+
break;
|
|
85
|
+
case ACTION.REMOVE:
|
|
86
|
+
Modal.confirm({
|
|
87
|
+
title: '删除',
|
|
88
|
+
content: '确定要删除该字典数据吗?',
|
|
89
|
+
onOk() {
|
|
90
|
+
deleteDictItemDeleteById({ id: record?.id as string }).then((res: API.ResponseDataVoid) => {
|
|
91
|
+
if (res.success) {
|
|
92
|
+
message.success('删除成功');
|
|
93
|
+
getDictData();
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function request(params: any) {
|
|
103
|
+
const { current, pageSize, ...rest } = params;
|
|
104
|
+
const res = await postDictItemPage({
|
|
105
|
+
currentPage: current,
|
|
106
|
+
pageSize,
|
|
107
|
+
code: route.query.code,
|
|
108
|
+
...rest,
|
|
109
|
+
});
|
|
110
|
+
return {
|
|
111
|
+
success: res.success,
|
|
112
|
+
data: res.data?.records ?? [],
|
|
113
|
+
total: res.data?.total ?? 0,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function getDictData() {
|
|
118
|
+
tableRef.value.reload();
|
|
119
|
+
}
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<template>
|
|
123
|
+
<div
|
|
124
|
+
p-20px
|
|
125
|
+
w-full
|
|
126
|
+
h-full
|
|
127
|
+
>
|
|
128
|
+
<ProTable
|
|
129
|
+
ref="tableRef"
|
|
130
|
+
row-key="id"
|
|
131
|
+
:request="request"
|
|
132
|
+
:search="false"
|
|
133
|
+
:columns="columns"
|
|
134
|
+
auto-height
|
|
135
|
+
:scroll="{ x: 1040 }"
|
|
136
|
+
>
|
|
137
|
+
<template #toolbar>
|
|
138
|
+
<a-button v-auth="'dictionary_data_add'" type="primary" @click="onAction(ACTION.ADD)">
|
|
139
|
+
<PlusCircleOutlined />
|
|
140
|
+
{{ ACTION.ADD }}
|
|
141
|
+
</a-button>
|
|
142
|
+
</template>
|
|
143
|
+
<template #bodyCell="{ column, record }">
|
|
144
|
+
<template v-if="column.dataIndex === 'action'">
|
|
145
|
+
<a-space>
|
|
146
|
+
<a v-auth="'dictionary_data_edit'" class="flex items-center" @click="onAction(ACTION.EDIT, record)">
|
|
147
|
+
<PubinfoIcon name="edit" class="text-base" />
|
|
148
|
+
<span class="ml-4px">{{ ACTION.EDIT }}</span>
|
|
149
|
+
</a>
|
|
150
|
+
<a v-auth="'dictionary_data_remove'" class="flex items-center text-red-500 hover:cursor-pointer hover:opacity-80" @click="onAction(ACTION.REMOVE, record)">
|
|
151
|
+
<PubinfoIcon name="remove" class="text-base" />
|
|
152
|
+
<span class="ml-4px">{{ ACTION.REMOVE }}</span>
|
|
153
|
+
</a>
|
|
154
|
+
</a-space>
|
|
155
|
+
</template>
|
|
156
|
+
</template>
|
|
157
|
+
</ProTable>
|
|
158
|
+
|
|
159
|
+
<drawerDictionaryItem
|
|
160
|
+
ref="DrawerDictionaryItemRef"
|
|
161
|
+
@submit="getDictData()"
|
|
162
|
+
/>
|
|
163
|
+
</div>
|
|
164
|
+
</template>
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Rule } from 'ant-design-vue/es/form';
|
|
3
|
+
import type { FormExpose } from 'ant-design-vue/es/form/Form';
|
|
4
|
+
import { getGroupDetailById, postGroupSaveOrUpdate } from '@/api/modules/assist';
|
|
5
|
+
import { selectOrg, selectUser } from '@/components/OrgUserSelector';
|
|
6
|
+
import { useToggle } from '@vueuse/core';
|
|
7
|
+
import { message } from 'ant-design-vue';
|
|
8
|
+
import { ACTION, GROUP_TYPE, useOptions } from '../enum';
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: 'DrawerGroup',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const emit = defineEmits(['submit']);
|
|
15
|
+
|
|
16
|
+
const state = reactive({
|
|
17
|
+
title: '',
|
|
18
|
+
type: '',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const rules: Record<string, Rule[]> = {
|
|
22
|
+
name: [{ required: true, message: '请输入群组名称', trigger: 'blur' },
|
|
23
|
+
{ max: 128, message: '长度不能超过128位', trigger: 'change' }],
|
|
24
|
+
remark: [{ max: 250, message: '长度不能超过250位', trigger: ['blur', 'change'] }],
|
|
25
|
+
viewScope: [{ required: true, message: '请选择使用范围', trigger: ['blur', 'change'] }],
|
|
26
|
+
pubGroupMemberList: [{ required: true, message: '请选择群组成员', trigger: ['blur', 'change'] }],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const [open, setOpen] = useToggle(false);
|
|
30
|
+
const formRef = ref<FormExpose>();
|
|
31
|
+
|
|
32
|
+
type Member = API.PubGroupMemberDto;
|
|
33
|
+
|
|
34
|
+
const form = ref<API.PubGroupBo & { pubGroupMemberList?: Member[] }>({});
|
|
35
|
+
const memberList = computed(() => {
|
|
36
|
+
return form.value?.pubGroupMemberList?.map((item) => {
|
|
37
|
+
return {
|
|
38
|
+
...item,
|
|
39
|
+
name: state.type === GROUP_TYPE.ORG ? item.orgName : item.userName,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
async function onOpen(key: ACTION, type: string, record?: API.PubGroup) {
|
|
45
|
+
setOpen(true);
|
|
46
|
+
state.title = key;
|
|
47
|
+
state.type = type;
|
|
48
|
+
form.value = {};
|
|
49
|
+
|
|
50
|
+
if (key === ACTION.EDIT) {
|
|
51
|
+
const res = await getGroupDetailById({ id: record?.id as string });
|
|
52
|
+
if (res.success) {
|
|
53
|
+
form.value = res?.data ?? {};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function chooseMember() {
|
|
59
|
+
if (state.type === GROUP_TYPE.ORG) {
|
|
60
|
+
selectOrg({
|
|
61
|
+
modelValue: form.value.pubGroupMemberList ?? [],
|
|
62
|
+
multiple: true,
|
|
63
|
+
onSubmit(selected = []) {
|
|
64
|
+
form.value.pubGroupMemberList = selected;
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (state.type === GROUP_TYPE.PER) {
|
|
70
|
+
selectUser({
|
|
71
|
+
modelValue: form.value.pubGroupMemberList ?? [],
|
|
72
|
+
multiple: true,
|
|
73
|
+
onSubmit(selected = []) {
|
|
74
|
+
form.value.pubGroupMemberList = selected;
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const [loading, setLoading] = useToggle(false);
|
|
81
|
+
|
|
82
|
+
function onSubmit() {
|
|
83
|
+
formRef.value?.validate().then(() => {
|
|
84
|
+
setLoading(true);
|
|
85
|
+
const { pubGroupMemberList = [], ...rest } = form.value;
|
|
86
|
+
const params: any = {
|
|
87
|
+
...rest,
|
|
88
|
+
type: state.type,
|
|
89
|
+
pubGroupMemberList: pubGroupMemberList?.map((e) => {
|
|
90
|
+
return {
|
|
91
|
+
orgId: e?.orgId,
|
|
92
|
+
userId: e?.userId,
|
|
93
|
+
};
|
|
94
|
+
}),
|
|
95
|
+
};
|
|
96
|
+
delete params.createTime;
|
|
97
|
+
delete params.updateTime;
|
|
98
|
+
postGroupSaveOrUpdate(params)
|
|
99
|
+
.then((res: API.ResponseData) => {
|
|
100
|
+
if (res.success) {
|
|
101
|
+
message.success(`${state.title}成功!`);
|
|
102
|
+
setOpen(false);
|
|
103
|
+
emit('submit');
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
.finally(() => setLoading(false));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function close() {
|
|
110
|
+
setOpen(false);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
defineExpose({
|
|
114
|
+
open: onOpen,
|
|
115
|
+
});
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<template>
|
|
119
|
+
<a-drawer
|
|
120
|
+
v-model:open="open"
|
|
121
|
+
:title="`${state.title}${state.type === GROUP_TYPE.ORG ? '组织' : '人员'}群组`"
|
|
122
|
+
placement="right"
|
|
123
|
+
:width="600"
|
|
124
|
+
destroy-on-close
|
|
125
|
+
:footer-style="{ textAlign: 'right' }"
|
|
126
|
+
@close="close"
|
|
127
|
+
>
|
|
128
|
+
<a-form
|
|
129
|
+
ref="formRef"
|
|
130
|
+
:model="form"
|
|
131
|
+
:rules="rules"
|
|
132
|
+
:label-col="{ span: 5 }"
|
|
133
|
+
:label-wrap="true"
|
|
134
|
+
>
|
|
135
|
+
<a-form-item label="群组名称" name="name">
|
|
136
|
+
<a-input v-model:value="form.name" :maxlength="128" />
|
|
137
|
+
</a-form-item>
|
|
138
|
+
<a-form-item label="群组描述" name="remark">
|
|
139
|
+
<a-textarea
|
|
140
|
+
v-model:value="form.remark"
|
|
141
|
+
:maxlength="250"
|
|
142
|
+
show-count
|
|
143
|
+
/>
|
|
144
|
+
</a-form-item>
|
|
145
|
+
<a-form-item label="群组使用范围" name="viewScope">
|
|
146
|
+
<a-select v-model:value="form.viewScope" :options="useOptions" placeholder="本部门/本部门及子部门/全部" />
|
|
147
|
+
</a-form-item>
|
|
148
|
+
<a-form-item label="群组成员" name="pubGroupMemberList">
|
|
149
|
+
<a-button type="primary" @click="chooseMember">
|
|
150
|
+
编辑成员
|
|
151
|
+
</a-button>
|
|
152
|
+
<div class="pt-10px">
|
|
153
|
+
<template v-for="item in memberList" :key="item">
|
|
154
|
+
<a-tooltip v-if="item.name && item.name?.length > 20" :title="item.name">
|
|
155
|
+
<span class="inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]">
|
|
156
|
+
{{ `${item.name?.slice(0, 20)}...` }}
|
|
157
|
+
</span>
|
|
158
|
+
</a-tooltip>
|
|
159
|
+
<span v-else class="inline-block mb-6px mr-6px bg-[#E8F3FF] rounded-2px px-8px py-3px whitespace-nowrap dark:bg-[#141414]">
|
|
160
|
+
{{ item.name }}
|
|
161
|
+
</span>
|
|
162
|
+
</template>
|
|
163
|
+
</div>
|
|
164
|
+
</a-form-item>
|
|
165
|
+
</a-form>
|
|
166
|
+
<template #footer>
|
|
167
|
+
<a-space>
|
|
168
|
+
<a-button @click="close">
|
|
169
|
+
取消
|
|
170
|
+
</a-button>
|
|
171
|
+
<a-button type="primary" :loading="loading" @click="onSubmit()">
|
|
172
|
+
提交
|
|
173
|
+
</a-button>
|
|
174
|
+
</a-space>
|
|
175
|
+
</template>
|
|
176
|
+
</a-drawer>
|
|
177
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export enum ACTION {
|
|
2
|
+
/** 新增 */
|
|
3
|
+
ADD = '新增',
|
|
4
|
+
/** 编辑 */
|
|
5
|
+
EDIT = '编辑',
|
|
6
|
+
/** 删除 */
|
|
7
|
+
REMOVE = '删除',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export enum GROUP_USE_TYPE {
|
|
11
|
+
OWNER = '1',
|
|
12
|
+
PARENT = '2',
|
|
13
|
+
ALL = '3',
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useOptions = [
|
|
17
|
+
{ label: '本部门', value: GROUP_USE_TYPE.OWNER },
|
|
18
|
+
{ label: '本部门及子部门', value: GROUP_USE_TYPE.PARENT },
|
|
19
|
+
{ label: '全部', value: GROUP_USE_TYPE.ALL },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export enum GROUP_TYPE {
|
|
23
|
+
ORG = '1',
|
|
24
|
+
PER = '2',
|
|
25
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<script setup lang="tsx">
|
|
2
|
+
import type { ProColumns } from '@pubinfo/pro-components';
|
|
3
|
+
import { deleteGroupDeleteById, postGroupFindPage } from '@/api/modules/assist';
|
|
4
|
+
import { ProTable } from '@pubinfo/pro-components';
|
|
5
|
+
import { message, Modal } from 'ant-design-vue';
|
|
6
|
+
import DrawerGroup from './components/drawerGroup.vue';
|
|
7
|
+
import { ACTION } from './enum';
|
|
8
|
+
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'GroupManage',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const query = ref<{ type: string }>({ type: '1' });
|
|
14
|
+
const data = ref<API.PubGroup[]>([]);
|
|
15
|
+
|
|
16
|
+
const tableRef = ref<typeof ProTable>();
|
|
17
|
+
const drawerGroupRef = ref<InstanceType<typeof DrawerGroup>>();
|
|
18
|
+
|
|
19
|
+
function getGroupData() {
|
|
20
|
+
tableRef.value?.reload();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function request(params: any) {
|
|
24
|
+
const { current, pageSize, ...rest } = params;
|
|
25
|
+
const res = await postGroupFindPage({
|
|
26
|
+
currentPage: current,
|
|
27
|
+
pageSize,
|
|
28
|
+
...rest,
|
|
29
|
+
type: query.value.type,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
data: res.data?.records ?? [],
|
|
35
|
+
total: res.data?.total,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const columns: ProColumns<API.PubGroup> = [
|
|
40
|
+
{
|
|
41
|
+
valueType: 'a-input',
|
|
42
|
+
bind: 'value',
|
|
43
|
+
minWidth: 200,
|
|
44
|
+
title: '群组名称',
|
|
45
|
+
dataIndex: 'name',
|
|
46
|
+
ellipsis: true,
|
|
47
|
+
fieldProps: {
|
|
48
|
+
placeholder: '请输入群组名称',
|
|
49
|
+
allowClear: true,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
hideInSearch: true,
|
|
54
|
+
minWidth: 80,
|
|
55
|
+
title: '群组描述',
|
|
56
|
+
dataIndex: 'remark',
|
|
57
|
+
ellipsis: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
hideInSearch: true,
|
|
61
|
+
minWidth: 100,
|
|
62
|
+
title: '群组使用范围',
|
|
63
|
+
dataIndex: 'viewScope',
|
|
64
|
+
customRender: ({ text }) => {
|
|
65
|
+
if (text === '1') {
|
|
66
|
+
return '本部门';
|
|
67
|
+
}
|
|
68
|
+
else if (text === '2') {
|
|
69
|
+
return '本部门及子部门';
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return '全部';
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
hideInSearch: true,
|
|
78
|
+
minWidth: 100,
|
|
79
|
+
title: '最后一次编辑时间',
|
|
80
|
+
dataIndex: 'updateTime',
|
|
81
|
+
ellipsis: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
hideInSearch: true,
|
|
85
|
+
minWidth: 100,
|
|
86
|
+
title: '编辑人',
|
|
87
|
+
dataIndex: 'updatedUserName',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
hideInSearch: true,
|
|
91
|
+
width: 160,
|
|
92
|
+
title: '操作',
|
|
93
|
+
dataIndex: 'action',
|
|
94
|
+
fixed: 'right',
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
function changeType() {
|
|
99
|
+
tableRef.value?.reload();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function onAction(key: string, type: string, record?: API.PubGroup): void {
|
|
103
|
+
switch (key) {
|
|
104
|
+
case ACTION.EDIT:
|
|
105
|
+
drawerGroupRef.value?.open(key, type, record);
|
|
106
|
+
break;
|
|
107
|
+
case ACTION.ADD:
|
|
108
|
+
drawerGroupRef.value?.open(key, type);
|
|
109
|
+
break;
|
|
110
|
+
case ACTION.REMOVE:
|
|
111
|
+
Modal.confirm({
|
|
112
|
+
title: '删除',
|
|
113
|
+
content: '确定要删除该群组吗?',
|
|
114
|
+
onOk() {
|
|
115
|
+
deleteGroupDeleteById({ id: record?.id as string })
|
|
116
|
+
.then(({ success }) => {
|
|
117
|
+
if (success) {
|
|
118
|
+
message.success('删除成功');
|
|
119
|
+
getGroupData();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<template>
|
|
130
|
+
<div
|
|
131
|
+
py-10px
|
|
132
|
+
px-10px
|
|
133
|
+
w-full
|
|
134
|
+
h-full
|
|
135
|
+
>
|
|
136
|
+
<div
|
|
137
|
+
h-full
|
|
138
|
+
w-full
|
|
139
|
+
bg-white
|
|
140
|
+
rounded-8px
|
|
141
|
+
class="dark:bg-[#141414]"
|
|
142
|
+
>
|
|
143
|
+
<a-tabs v-model:active-key="query.type" class="tabs_custom" @change="changeType">
|
|
144
|
+
<a-tab-pane key="1" tab="组织群组" />
|
|
145
|
+
<a-tab-pane key="2" tab="人员群组" />
|
|
146
|
+
</a-tabs>
|
|
147
|
+
|
|
148
|
+
<div style="height: calc(100% - 48px);">
|
|
149
|
+
<ProTable
|
|
150
|
+
ref="tableRef"
|
|
151
|
+
row-key="id"
|
|
152
|
+
:request="request"
|
|
153
|
+
:columns="columns"
|
|
154
|
+
:data-source="data"
|
|
155
|
+
auto-height
|
|
156
|
+
:scroll="{ x: 1100 }"
|
|
157
|
+
>
|
|
158
|
+
<template #toolbar>
|
|
159
|
+
<a-button type="primary" @click="onAction(ACTION.ADD, query.type)">
|
|
160
|
+
<PlusCircleOutlined />
|
|
161
|
+
{{ ACTION.ADD }}
|
|
162
|
+
</a-button>
|
|
163
|
+
</template>
|
|
164
|
+
<template #bodyCell="{ column, record }">
|
|
165
|
+
<template v-if="column.dataIndex === 'action'">
|
|
166
|
+
<a-space>
|
|
167
|
+
<a class="flex items-center" @click="onAction(ACTION.EDIT, query.type, record)">
|
|
168
|
+
<PubinfoIcon name="edit" class="text-base" />
|
|
169
|
+
<span class="ml-4px">{{ ACTION.EDIT }}</span>
|
|
170
|
+
</a>
|
|
171
|
+
<span
|
|
172
|
+
class="flex items-center text-red-500 hover:cursor-pointer hover:opacity-80"
|
|
173
|
+
@click="onAction(ACTION.REMOVE, query.type, record)"
|
|
174
|
+
>
|
|
175
|
+
<PubinfoIcon name="remove" class="text-base" />
|
|
176
|
+
<span class="ml-4px">{{ ACTION.REMOVE }}</span>
|
|
177
|
+
</span>
|
|
178
|
+
</a-space>
|
|
179
|
+
</template>
|
|
180
|
+
</template>
|
|
181
|
+
</ProTable>
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
<DrawerGroup ref="drawerGroupRef" @submit="getGroupData()" />
|
|
185
|
+
</div>
|
|
186
|
+
</template>
|
|
187
|
+
|
|
188
|
+
<style lang="scss" scoped>
|
|
189
|
+
.box_sh {
|
|
190
|
+
box-shadow:
|
|
191
|
+
0 1px 2px 0 rgb(0 0 0 / 3%),
|
|
192
|
+
0 1px 6px -1px rgb(0 0 0 / 2%),
|
|
193
|
+
0 2px 4px 0 rgb(0 0 0 / 2%);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.tabs_custom {
|
|
197
|
+
height: 46px;
|
|
198
|
+
|
|
199
|
+
:deep(.ant-tabs-nav) {
|
|
200
|
+
margin: 0;
|
|
201
|
+
|
|
202
|
+
.ant-tabs-nav-list {
|
|
203
|
+
padding-left: 16px;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
</style>
|