@witlink/usercenter 1.2.82 → 1.2.83

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.
@@ -1,4 +1,4 @@
1
- import './assets/main.4904cb40.css';var __defProp = Object.defineProperty;
1
+ import './assets/main.2404021a.css';var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -13,7 +13,7 @@ import { getUserInfo as getUserInfo$2, hasPermission } from "@witlink/components
13
13
  import en_US from "ant-design-vue/es/locale/en_US";
14
14
  import zh_CN from "ant-design-vue/es/locale/zh_CN";
15
15
  import fr_FR from "ant-design-vue/es/locale/fr_FR";
16
- import { InputPassword, FormItem, Form, Button as Button$1, Modal, Tooltip, DescriptionsItem, Descriptions, Space, Upload, ConfigProvider as ConfigProvider$1, Textarea, Input, InputGroup, AutoComplete, Alert, Divider, MenuItem, Menu, Dropdown, Table, Col, Row, Checkbox, Cascader, Select, Avatar, Tag, InputNumber, Switch, SelectOption, Radio, RadioGroup, InputSearch, DatePicker } from "ant-design-vue/es";
16
+ import { InputPassword, FormItem, Form, Button as Button$1, Modal, Tooltip, DescriptionsItem, Descriptions, Space, Upload, ConfigProvider as ConfigProvider$1, Textarea, Input, InputGroup, AutoComplete, Alert, Divider, MenuItem, Menu, Dropdown, Table, Col, Row, Spin, Checkbox, Cascader, Select, Avatar, Tag, InputNumber, Switch, SelectOption, Radio, RadioGroup, InputSearch, DatePicker } from "ant-design-vue/es";
17
17
  import Icon, { ImportOutlined, RedoOutlined, ExclamationCircleOutlined, DownOutlined, LeftOutlined, UploadOutlined, PlusOutlined, MinusOutlined, EditOutlined, InfoCircleOutlined, DeleteOutlined, DownloadOutlined } from "@ant-design/icons-vue";
18
18
  import dayjs from "dayjs";
19
19
  import { cloneDeep } from "lodash-es";
@@ -40627,26 +40627,34 @@ const _hoisted_13$2 = {
40627
40627
  key: 2,
40628
40628
  class: "permission-layout"
40629
40629
  };
40630
- const _hoisted_14$2 = { class: "layout-left" };
40631
- const _hoisted_15$2 = { class: "category-nav" };
40632
- const _hoisted_16$2 = ["onClick"];
40633
- const _hoisted_17$2 = { class: "layout-right" };
40634
- const _hoisted_18$2 = { class: "permission-header" };
40635
- const _hoisted_19$2 = { class: "perm-menu-col" };
40636
- const _hoisted_20$2 = { class: "perm-btn-col" };
40637
- const _hoisted_21$2 = { class: "permission-body" };
40638
- const _hoisted_22$2 = ["id"];
40639
- const _hoisted_23$2 = {
40630
+ const _hoisted_14$2 = {
40631
+ key: 0,
40632
+ class: "permission-loading-mask"
40633
+ };
40634
+ const _hoisted_15$2 = { class: "layout-left" };
40635
+ const _hoisted_16$2 = { class: "category-nav" };
40636
+ const _hoisted_17$2 = ["onClick"];
40637
+ const _hoisted_18$2 = { class: "layout-right" };
40638
+ const _hoisted_19$2 = { class: "permission-header" };
40639
+ const _hoisted_20$2 = { class: "perm-menu-col" };
40640
+ const _hoisted_21$2 = { class: "perm-btn-col" };
40641
+ const _hoisted_22$2 = { class: "permission-body" };
40642
+ const _hoisted_23$2 = ["id"];
40643
+ const _hoisted_24$2 = {
40640
40644
  key: 0,
40641
40645
  class: "permission-row"
40642
40646
  };
40643
- const _hoisted_24$2 = { class: "perm-menu-col perm-menu-col--directory" };
40644
- const _hoisted_25$2 = { class: "perm-btn-col" };
40645
- const _hoisted_26$2 = { class: "permission-row" };
40646
- const _hoisted_27$2 = { class: "perm-menu-col perm-menu-col--directory" };
40647
- const _hoisted_28$2 = { class: "perm-menu-col perm-menu-col--page" };
40648
- const _hoisted_29$2 = { class: "perm-btn-col" };
40649
- const _hoisted_30$2 = {
40647
+ const _hoisted_25$2 = { class: "perm-menu-col perm-menu-col--directory" };
40648
+ const _hoisted_26$2 = { class: "perm-btn-col" };
40649
+ const _hoisted_27$2 = { class: "permission-row" };
40650
+ const _hoisted_28$2 = { class: "perm-menu-col perm-menu-col--directory" };
40651
+ const _hoisted_29$2 = { class: "perm-menu-col perm-menu-col--page" };
40652
+ const _hoisted_30$2 = { class: "perm-btn-col" };
40653
+ const _hoisted_31$2 = {
40654
+ key: 2,
40655
+ class: "permission-loading-placeholder"
40656
+ };
40657
+ const _hoisted_32$1 = {
40650
40658
  key: 3,
40651
40659
  class: "no-auth-permission"
40652
40660
  };
@@ -40734,35 +40742,38 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
40734
40742
  const handleAddRole = async () => {
40735
40743
  showTable.value = false;
40736
40744
  isCreate.value = true;
40745
+ resetPermissionPanelState(true);
40737
40746
  formState.value = {
40738
40747
  name: null,
40739
40748
  remarks: ""
40740
40749
  };
40741
40750
  await getCurrentSysAuth();
40742
- initAuth();
40751
+ await initAuth();
40743
40752
  };
40744
40753
  const handleEdit = async (record) => {
40745
40754
  showTable.value = false;
40746
40755
  isCreate.value = false;
40756
+ resetPermissionPanelState(true);
40747
40757
  formState.value = {
40748
40758
  name: record.name,
40749
40759
  remarks: record.remarks || ""
40750
40760
  };
40751
40761
  currentRow.value = record;
40752
40762
  await getCurrentSysAuth();
40753
- initAuth();
40763
+ await initAuth();
40754
40764
  };
40755
40765
  const handleDetail = async (record) => {
40756
40766
  showTable.value = false;
40757
40767
  isDetail.value = true;
40758
40768
  isCreate.value = false;
40769
+ resetPermissionPanelState(true);
40759
40770
  formState.value = {
40760
40771
  name: record.name,
40761
40772
  remarks: record.remarks || "-"
40762
40773
  };
40763
40774
  currentRow.value = record;
40764
40775
  await handleSysMenuDetail(record);
40765
- initAuth();
40776
+ await initAuth();
40766
40777
  };
40767
40778
  const handleSwitch = async (checked, record) => {
40768
40779
  if (!checked) {
@@ -40827,6 +40838,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
40827
40838
  currentRow.value = {};
40828
40839
  sysMenuAuthMap.value = {};
40829
40840
  sysMenuParentMap.value = {};
40841
+ resetPermissionPanelState();
40830
40842
  formState.value = {
40831
40843
  name: null,
40832
40844
  remarks: ""
@@ -40905,9 +40917,30 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
40905
40917
  const menuAuthList = ref([]);
40906
40918
  const menuModules = ref([]);
40907
40919
  const menuTreeRef = ref(null);
40920
+ const permissionLoading = ref(false);
40908
40921
  const allPermissionsSelected = ref(false);
40909
40922
  const isIndeterminate = ref(false);
40910
40923
  const activeCategoryId = ref("");
40924
+ const showPermissionLayout = computed(
40925
+ () => permissionLoading.value || menuModules.value.length > 0
40926
+ );
40927
+ let permissionRequestId = 0;
40928
+ const resetPermissionPanelState = (keepLoading = false) => {
40929
+ permissionRequestId += 1;
40930
+ permissionLoading.value = keepLoading;
40931
+ parentMenuList.value = [];
40932
+ menuAuthList.value = [];
40933
+ menuModules.value = [];
40934
+ activeCategoryId.value = "";
40935
+ allPermissionsSelected.value = false;
40936
+ isIndeterminate.value = false;
40937
+ };
40938
+ const setCurrentParentMenuList = (sysId, sourceData = []) => {
40939
+ var _a;
40940
+ parentMenuList.value = sourceData || [];
40941
+ sysMenuParentMap.value[sysId] = parentMenuList.value;
40942
+ activeCategoryId.value = ((_a = parentMenuList.value[0]) == null ? void 0 : _a.id) || "";
40943
+ };
40911
40944
  const updateGlobalPermissionState = () => {
40912
40945
  const totalModules = menuModules.value.length;
40913
40946
  let selectedModules = 0;
@@ -41067,33 +41100,6 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41067
41100
  sysMenuAuthMap.value[sysId] = tempData;
41068
41101
  updateGlobalPermissionState();
41069
41102
  };
41070
- const getCurrentMenuAuthList = async (sysId, isC = false) => {
41071
- if (sysMenuAuthMap.value[sysId]) {
41072
- menuModules.value = sysMenuAuthMap.value[sysId];
41073
- updateGlobalPermissionState();
41074
- return;
41075
- }
41076
- const { result } = await getMenuAuthList({
41077
- systemId: sysId,
41078
- roleId: isC ? void 0 : currentRow.value.id
41079
- });
41080
- menuAuthList.value = result || [];
41081
- initCurrentMenuAuth(menuAuthList.value, sysId);
41082
- };
41083
- const getCurrentSysMenuList = async (sysId) => {
41084
- var _a, _b;
41085
- if (sysMenuParentMap.value[sysId]) {
41086
- parentMenuList.value = sysMenuParentMap.value[sysId];
41087
- activeCategoryId.value = ((_a = parentMenuList.value[0]) == null ? void 0 : _a.id) || "";
41088
- return;
41089
- }
41090
- const { result } = await getMenuParentList({
41091
- systemId: sysId
41092
- });
41093
- parentMenuList.value = result || [];
41094
- sysMenuParentMap.value[sysId] = parentMenuList.value;
41095
- activeCategoryId.value = ((_b = parentMenuList.value[0]) == null ? void 0 : _b.id) || "";
41096
- };
41097
41103
  async function getCurrentSysAuth() {
41098
41104
  var _a;
41099
41105
  const { result } = await getAuthList({});
@@ -41105,29 +41111,90 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41105
41111
  activeAuthId.value = ((_a = tabList.value[0]) == null ? void 0 : _a.systemId) || "";
41106
41112
  return activeAuthId.value;
41107
41113
  }
41108
- const handleTabClick = (item) => {
41109
- activeAuthId.value = item.systemId;
41110
- if (isDetail.value) {
41111
- handleCurrentSysMenuDetailList(item.systemId);
41112
- } else {
41113
- getCurrentSysMenuList(item.systemId);
41114
+ const fetchPermissionParentMenu = async (sysId) => {
41115
+ const cachedParentMenu = sysMenuParentMap.value[sysId];
41116
+ if (cachedParentMenu) {
41117
+ return cachedParentMenu;
41114
41118
  }
41115
41119
  if (isDetail.value) {
41116
- handleMenuAuthDetail(item.systemId);
41117
- } else if (isCreate.value) {
41118
- getCurrentMenuAuthList(item.systemId, true);
41119
- } else {
41120
- getCurrentMenuAuthList(item.systemId);
41120
+ const { result: result2 } = await getMenuParentDetialList({
41121
+ systemId: sysId,
41122
+ roleId: currentRow.value.id
41123
+ });
41124
+ return result2 || [];
41121
41125
  }
41126
+ const { result } = await getMenuParentList({
41127
+ systemId: sysId
41128
+ });
41129
+ return result || [];
41122
41130
  };
41123
- async function handleMenuAuthDetail(sysId) {
41124
- const { result } = await getMenuAuthDetailList({
41131
+ const fetchPermissionMenuAuth = async (sysId) => {
41132
+ const cachedMenuAuth = sysMenuAuthMap.value[sysId];
41133
+ if (cachedMenuAuth) {
41134
+ return cachedMenuAuth;
41135
+ }
41136
+ if (isDetail.value) {
41137
+ const { result: result2 } = await getMenuAuthDetailList({
41138
+ systemId: sysId,
41139
+ roleId: currentRow.value.id
41140
+ });
41141
+ return result2 || [];
41142
+ }
41143
+ const { result } = await getMenuAuthList({
41125
41144
  systemId: sysId,
41126
- roleId: currentRow.value.id
41145
+ roleId: isCreate.value ? void 0 : currentRow.value.id
41127
41146
  });
41128
- menuAuthList.value = result || [];
41129
- initCurrentMenuAuth(menuAuthList.value, sysId);
41130
- }
41147
+ return result || [];
41148
+ };
41149
+ const loadPermissionPanel = async (sysId) => {
41150
+ if (!sysId) {
41151
+ resetPermissionPanelState();
41152
+ return;
41153
+ }
41154
+ const currentRequestId = ++permissionRequestId;
41155
+ const cachedParentMenu = sysMenuParentMap.value[sysId];
41156
+ const cachedMenuAuth = sysMenuAuthMap.value[sysId];
41157
+ if (cachedParentMenu) {
41158
+ setCurrentParentMenuList(sysId, cachedParentMenu);
41159
+ } else {
41160
+ parentMenuList.value = [];
41161
+ activeCategoryId.value = "";
41162
+ }
41163
+ if (cachedMenuAuth) {
41164
+ menuModules.value = cachedMenuAuth;
41165
+ updateGlobalPermissionState();
41166
+ } else {
41167
+ menuAuthList.value = [];
41168
+ menuModules.value = [];
41169
+ allPermissionsSelected.value = false;
41170
+ isIndeterminate.value = false;
41171
+ }
41172
+ if (cachedParentMenu && cachedMenuAuth) {
41173
+ permissionLoading.value = false;
41174
+ return;
41175
+ }
41176
+ permissionLoading.value = true;
41177
+ try {
41178
+ const [parentList, authList] = await Promise.all([
41179
+ fetchPermissionParentMenu(sysId),
41180
+ fetchPermissionMenuAuth(sysId)
41181
+ ]);
41182
+ if (currentRequestId !== permissionRequestId) {
41183
+ return;
41184
+ }
41185
+ setCurrentParentMenuList(sysId, parentList || []);
41186
+ menuAuthList.value = authList || [];
41187
+ initCurrentMenuAuth(menuAuthList.value, sysId);
41188
+ } finally {
41189
+ if (currentRequestId === permissionRequestId) {
41190
+ permissionLoading.value = false;
41191
+ }
41192
+ }
41193
+ };
41194
+ const handleTabClick = async (item) => {
41195
+ activeAuthId.value = item.systemId;
41196
+ await loadPermissionPanel(item.systemId);
41197
+ };
41131
41198
  async function handleSysMenuDetail(row) {
41132
41199
  var _a;
41133
41200
  const { result } = await getAuthDetailList({
@@ -41146,35 +41213,14 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41146
41213
  return activeAuthId.value;
41147
41214
  }
41148
41215
  }
41149
- async function handleCurrentSysMenuDetailList(sysId) {
41150
- var _a;
41151
- const { result } = await getMenuParentDetialList({
41152
- systemId: sysId,
41153
- roleId: currentRow.value.id
41154
- });
41155
- parentMenuList.value = result || [];
41156
- sysMenuParentMap.value[sysId] = parentMenuList.value;
41157
- activeCategoryId.value = ((_a = parentMenuList.value[0]) == null ? void 0 : _a.id) || "";
41158
- }
41159
41216
  async function initAuth() {
41160
41217
  if (!activeAuthId.value) {
41161
41218
  sysMenuAuthMap.value = {};
41162
41219
  sysMenuParentMap.value = {};
41163
- menuModules.value = [];
41220
+ resetPermissionPanelState();
41164
41221
  return;
41165
41222
  }
41166
- if (isDetail.value) {
41167
- handleCurrentSysMenuDetailList(activeAuthId.value);
41168
- } else {
41169
- getCurrentSysMenuList(activeAuthId.value);
41170
- }
41171
- if (isDetail.value) {
41172
- handleMenuAuthDetail(activeAuthId.value);
41173
- } else if (isCreate.value) {
41174
- getCurrentMenuAuthList(activeAuthId.value, true);
41175
- } else {
41176
- getCurrentMenuAuthList(activeAuthId.value);
41177
- }
41223
+ await loadPermissionPanel(activeAuthId.value);
41178
41224
  }
41179
41225
  watch(
41180
41226
  () => userStore.userLanguage,
@@ -41185,6 +41231,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41185
41231
  currentRow.value = {};
41186
41232
  sysMenuAuthMap.value = {};
41187
41233
  sysMenuParentMap.value = {};
41234
+ resetPermissionPanelState();
41188
41235
  showTable.value = true;
41189
41236
  formState.value = {
41190
41237
  name: null,
@@ -41207,6 +41254,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41207
41254
  const _component_uc_btn_edit = resolveComponent("uc-btn-edit");
41208
41255
  const _component_a_col = Col;
41209
41256
  const _component_a_row = Row;
41257
+ const _component_a_spin = Spin;
41210
41258
  const _component_a_checkbox = Checkbox;
41211
41259
  const _component_a_config_provider = ConfigProvider$1;
41212
41260
  return openBlock(), createBlock(_component_a_config_provider, {
@@ -41433,98 +41481,61 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41433
41481
  }), 128))
41434
41482
  ])) : createCommentVNode("v-if", true),
41435
41483
  unref(systemId) !== 1 ? (openBlock(), createElementBlock("div", _hoisted_12$2, toDisplayString(_ctx.$t("uc_role.permission_config")), 1)) : createCommentVNode("v-if", true),
41436
- menuModules.value.length ? (openBlock(), createElementBlock("div", _hoisted_13$2, [
41437
- createElementVNode("div", _hoisted_14$2, [
41438
- createCommentVNode(" \u5DE6\u4FA7\u5206\u7C7B\u5BFC\u822A "),
41484
+ showPermissionLayout.value ? (openBlock(), createElementBlock("div", _hoisted_13$2, [
41485
+ permissionLoading.value ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
41486
+ createVNode(_component_a_spin)
41487
+ ])) : createCommentVNode("v-if", true),
41488
+ menuModules.value.length ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
41439
41489
  createElementVNode("div", _hoisted_15$2, [
41440
- (openBlock(true), createElementBlock(Fragment, null, renderList(parentMenuList.value, (item) => {
41441
- return openBlock(), createElementBlock("div", {
41442
- class: normalizeClass(["category-item", { active: item.id === activeCategoryId.value }]),
41443
- key: item.id,
41444
- onClick: ($event) => handleCategoryClick(item)
41445
- }, toDisplayString(item.name), 11, _hoisted_16$2);
41446
- }), 128))
41447
- ])
41448
- ]),
41449
- createElementVNode("div", _hoisted_17$2, [
41450
- createCommentVNode(" \u9876\u90E8\u8868\u5934\u884C "),
41490
+ createCommentVNode(" \u5DE6\u4FA7\u5206\u7C7B\u5BFC\u822A "),
41491
+ createElementVNode("div", _hoisted_16$2, [
41492
+ (openBlock(true), createElementBlock(Fragment, null, renderList(parentMenuList.value, (item) => {
41493
+ return openBlock(), createElementBlock("div", {
41494
+ class: normalizeClass(["category-item", { active: item.id === activeCategoryId.value }]),
41495
+ key: item.id,
41496
+ onClick: ($event) => handleCategoryClick(item)
41497
+ }, toDisplayString(item.name), 11, _hoisted_17$2);
41498
+ }), 128))
41499
+ ])
41500
+ ]),
41451
41501
  createElementVNode("div", _hoisted_18$2, [
41502
+ createCommentVNode(" \u9876\u90E8\u8868\u5934\u884C "),
41452
41503
  createElementVNode("div", _hoisted_19$2, [
41453
- createVNode(_component_a_checkbox, {
41454
- checked: allPermissionsSelected.value,
41455
- "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => allPermissionsSelected.value = $event),
41456
- indeterminate: isIndeterminate.value,
41457
- onChange: handleGlobalPermissionChange,
41458
- disabled: isDetail.value
41459
- }, {
41460
- default: withCtx(() => [
41461
- createTextVNode(toDisplayString(_ctx.$t("uc_role.menu_permission")), 1)
41462
- ]),
41463
- _: 1
41464
- }, 8, ["checked", "indeterminate", "disabled"])
41504
+ createElementVNode("div", _hoisted_20$2, [
41505
+ createVNode(_component_a_checkbox, {
41506
+ checked: allPermissionsSelected.value,
41507
+ "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => allPermissionsSelected.value = $event),
41508
+ indeterminate: isIndeterminate.value,
41509
+ onChange: handleGlobalPermissionChange,
41510
+ disabled: isDetail.value
41511
+ }, {
41512
+ default: withCtx(() => [
41513
+ createTextVNode(toDisplayString(_ctx.$t("uc_role.menu_permission")), 1)
41514
+ ]),
41515
+ _: 1
41516
+ }, 8, ["checked", "indeterminate", "disabled"])
41517
+ ]),
41518
+ createElementVNode("div", _hoisted_21$2, [
41519
+ createElementVNode("span", null, toDisplayString(_ctx.$t("uc_role.button_permission")), 1)
41520
+ ])
41465
41521
  ]),
41466
- createElementVNode("div", _hoisted_20$2, [
41467
- createElementVNode("span", null, toDisplayString(_ctx.$t("uc_role.button_permission")), 1)
41468
- ])
41469
- ]),
41470
- createCommentVNode(" \u5185\u5BB9\u533A\uFF1A\u6743\u9650\u884C\u5217\u8868 "),
41471
- createElementVNode("div", _hoisted_21$2, [
41472
- createCommentVNode(" \u6743\u9650\u884C\u5217\u8868 "),
41473
- createElementVNode("div", {
41474
- class: "permission-rows",
41475
- ref_key: "menuTreeRef",
41476
- ref: menuTreeRef
41477
- }, [
41478
- (openBlock(true), createElementBlock(Fragment, null, renderList(menuModules.value, (directory) => {
41479
- return openBlock(), createElementBlock("div", {
41480
- key: directory.id,
41481
- class: "directory-block",
41482
- id: `category-${directory.id}`
41483
- }, [
41484
- createCommentVNode(" type=1 \u9876\u7EA7\u9875\u9762\uFF1A\u4E00\u884C\uFF0C\u5DE6\u4FA7checkbox + \u53F3\u4FA7\u6309\u94AE "),
41485
- directory.type === 1 ? (openBlock(), createElementBlock("div", _hoisted_23$2, [
41486
- createElementVNode("div", _hoisted_24$2, [
41487
- createVNode(_component_a_checkbox, {
41488
- checked: directory.selected,
41489
- "onUpdate:checked": ($event) => directory.selected = $event,
41490
- indeterminate: directory.indeterminate,
41491
- onChange: (e) => handleDirectoryChange(directory, e),
41492
- disabled: isDetail.value
41493
- }, {
41494
- default: withCtx(() => [
41495
- createTextVNode(toDisplayString(directory.name), 1)
41496
- ]),
41497
- _: 2
41498
- }, 1032, ["checked", "onUpdate:checked", "indeterminate", "onChange", "disabled"])
41499
- ]),
41500
- createElementVNode("div", _hoisted_25$2, [
41501
- (openBlock(true), createElementBlock(Fragment, null, renderList(directory.actionList, (button) => {
41502
- return openBlock(), createElementBlock("div", {
41503
- key: button.btnId,
41504
- class: "button-item"
41505
- }, [
41506
- createVNode(_component_a_checkbox, {
41507
- checked: button.checked,
41508
- "onUpdate:checked": ($event) => button.checked = $event,
41509
- onChange: () => handleButtonChange(
41510
- directory,
41511
- directory
41512
- ),
41513
- disabled: isDetail.value
41514
- }, {
41515
- default: withCtx(() => [
41516
- createTextVNode(toDisplayString(button.name), 1)
41517
- ]),
41518
- _: 2
41519
- }, 1032, ["checked", "onUpdate:checked", "onChange", "disabled"])
41520
- ]);
41521
- }), 128))
41522
- ])
41523
- ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
41524
- createCommentVNode(" type=0 \u76EE\u5F55\uFF1A\u76EE\u5F55\u6807\u9898\u884C\uFF08\u65E0\u6309\u94AE\uFF09+ \u6BCF\u4E2A\u5B50\u9875\u9762\u4E00\u884C "),
41525
- createCommentVNode(" \u76EE\u5F55\u6807\u9898\u884C "),
41526
- createElementVNode("div", _hoisted_26$2, [
41527
- createElementVNode("div", _hoisted_27$2, [
41522
+ createCommentVNode(" \u5185\u5BB9\u533A\uFF1A\u6743\u9650\u884C\u5217\u8868 "),
41523
+ createElementVNode("div", _hoisted_22$2, [
41524
+ createCommentVNode(" \u6743\u9650\u884C\u5217\u8868 "),
41525
+ createElementVNode("div", {
41526
+ class: "permission-rows",
41527
+ ref_key: "menuTreeRef",
41528
+ ref: menuTreeRef
41529
+ }, [
41530
+ (openBlock(true), createElementBlock(Fragment, null, renderList(menuModules.value, (directory) => {
41531
+ return openBlock(), createElementBlock("div", {
41532
+ key: directory.id,
41533
+ class: "directory-block",
41534
+ id: `category-${directory.id}`
41535
+ }, [
41536
+ createCommentVNode(" type=1 \u9876\u7EA7\u9875\u9762\uFF1A\u4E00\u884C\uFF0C\u5DE6\u4FA7checkbox + \u53F3\u4FA7\u6309\u94AE "),
41537
+ directory.type === 1 ? (openBlock(), createElementBlock("div", _hoisted_24$2, [
41538
+ createElementVNode("div", _hoisted_25$2, [
41528
41539
  createVNode(_component_a_checkbox, {
41529
41540
  checked: directory.selected,
41530
41541
  "onUpdate:checked": ($event) => directory.selected = $event,
@@ -41538,57 +41549,99 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
41538
41549
  _: 2
41539
41550
  }, 1032, ["checked", "onUpdate:checked", "indeterminate", "onChange", "disabled"])
41540
41551
  ]),
41541
- _cache[6] || (_cache[6] = createElementVNode("div", { class: "perm-btn-col perm-btn-col--empty" }, null, -1))
41542
- ]),
41543
- createCommentVNode(" \u5B50\u9875\u9762\u884C "),
41544
- (openBlock(true), createElementBlock(Fragment, null, renderList(directory.permissionsList, (page) => {
41545
- return openBlock(), createElementBlock("div", {
41546
- key: page.id,
41547
- class: "permission-row"
41548
- }, [
41552
+ createElementVNode("div", _hoisted_26$2, [
41553
+ (openBlock(true), createElementBlock(Fragment, null, renderList(directory.actionList, (button) => {
41554
+ return openBlock(), createElementBlock("div", {
41555
+ key: button.btnId,
41556
+ class: "button-item"
41557
+ }, [
41558
+ createVNode(_component_a_checkbox, {
41559
+ checked: button.checked,
41560
+ "onUpdate:checked": ($event) => button.checked = $event,
41561
+ onChange: () => handleButtonChange(
41562
+ directory,
41563
+ directory
41564
+ ),
41565
+ disabled: isDetail.value
41566
+ }, {
41567
+ default: withCtx(() => [
41568
+ createTextVNode(toDisplayString(button.name), 1)
41569
+ ]),
41570
+ _: 2
41571
+ }, 1032, ["checked", "onUpdate:checked", "onChange", "disabled"])
41572
+ ]);
41573
+ }), 128))
41574
+ ])
41575
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
41576
+ createCommentVNode(" type=0 \u76EE\u5F55\uFF1A\u76EE\u5F55\u6807\u9898\u884C\uFF08\u65E0\u6309\u94AE\uFF09+ \u6BCF\u4E2A\u5B50\u9875\u9762\u4E00\u884C "),
41577
+ createCommentVNode(" \u76EE\u5F55\u6807\u9898\u884C "),
41578
+ createElementVNode("div", _hoisted_27$2, [
41549
41579
  createElementVNode("div", _hoisted_28$2, [
41550
41580
  createVNode(_component_a_checkbox, {
41551
- checked: page.selected,
41552
- "onUpdate:checked": ($event) => page.selected = $event,
41553
- indeterminate: page.indeterminate,
41554
- onChange: (e) => handlePageChange(directory, page, e),
41581
+ checked: directory.selected,
41582
+ "onUpdate:checked": ($event) => directory.selected = $event,
41583
+ indeterminate: directory.indeterminate,
41584
+ onChange: (e) => handleDirectoryChange(directory, e),
41555
41585
  disabled: isDetail.value
41556
41586
  }, {
41557
41587
  default: withCtx(() => [
41558
- createTextVNode(toDisplayString(page.name), 1)
41588
+ createTextVNode(toDisplayString(directory.name), 1)
41559
41589
  ]),
41560
41590
  _: 2
41561
41591
  }, 1032, ["checked", "onUpdate:checked", "indeterminate", "onChange", "disabled"])
41562
41592
  ]),
41563
- createElementVNode("div", _hoisted_29$2, [
41564
- (openBlock(true), createElementBlock(Fragment, null, renderList(page.actionList, (button) => {
41565
- return openBlock(), createElementBlock("div", {
41566
- key: button.btnId,
41567
- class: "button-item"
41568
- }, [
41569
- createVNode(_component_a_checkbox, {
41570
- checked: button.checked,
41571
- "onUpdate:checked": ($event) => button.checked = $event,
41572
- onChange: () => handleButtonChange(directory, page),
41573
- disabled: isDetail.value
41574
- }, {
41575
- default: withCtx(() => [
41576
- createTextVNode(toDisplayString(button.name), 1)
41577
- ]),
41578
- _: 2
41579
- }, 1032, ["checked", "onUpdate:checked", "onChange", "disabled"])
41580
- ]);
41581
- }), 128))
41582
- ])
41583
- ]);
41584
- }), 128))
41585
- ], 64))
41586
- ], 8, _hoisted_22$2);
41587
- }), 128))
41588
- ], 512)
41593
+ _cache[6] || (_cache[6] = createElementVNode("div", { class: "perm-btn-col perm-btn-col--empty" }, null, -1))
41594
+ ]),
41595
+ createCommentVNode(" \u5B50\u9875\u9762\u884C "),
41596
+ (openBlock(true), createElementBlock(Fragment, null, renderList(directory.permissionsList, (page) => {
41597
+ return openBlock(), createElementBlock("div", {
41598
+ key: page.id,
41599
+ class: "permission-row"
41600
+ }, [
41601
+ createElementVNode("div", _hoisted_29$2, [
41602
+ createVNode(_component_a_checkbox, {
41603
+ checked: page.selected,
41604
+ "onUpdate:checked": ($event) => page.selected = $event,
41605
+ indeterminate: page.indeterminate,
41606
+ onChange: (e) => handlePageChange(directory, page, e),
41607
+ disabled: isDetail.value
41608
+ }, {
41609
+ default: withCtx(() => [
41610
+ createTextVNode(toDisplayString(page.name), 1)
41611
+ ]),
41612
+ _: 2
41613
+ }, 1032, ["checked", "onUpdate:checked", "indeterminate", "onChange", "disabled"])
41614
+ ]),
41615
+ createElementVNode("div", _hoisted_30$2, [
41616
+ (openBlock(true), createElementBlock(Fragment, null, renderList(page.actionList, (button) => {
41617
+ return openBlock(), createElementBlock("div", {
41618
+ key: button.btnId,
41619
+ class: "button-item"
41620
+ }, [
41621
+ createVNode(_component_a_checkbox, {
41622
+ checked: button.checked,
41623
+ "onUpdate:checked": ($event) => button.checked = $event,
41624
+ onChange: () => handleButtonChange(directory, page),
41625
+ disabled: isDetail.value
41626
+ }, {
41627
+ default: withCtx(() => [
41628
+ createTextVNode(toDisplayString(button.name), 1)
41629
+ ]),
41630
+ _: 2
41631
+ }, 1032, ["checked", "onUpdate:checked", "onChange", "disabled"])
41632
+ ]);
41633
+ }), 128))
41634
+ ])
41635
+ ]);
41636
+ }), 128))
41637
+ ], 64))
41638
+ ], 8, _hoisted_23$2);
41639
+ }), 128))
41640
+ ], 512)
41641
+ ])
41589
41642
  ])
41590
- ])
41591
- ])) : (openBlock(), createElementBlock("div", _hoisted_30$2, toDisplayString(_ctx.$t("uc_role.no_auth_permission")), 1))
41643
+ ], 64)) : (openBlock(), createElementBlock("div", _hoisted_31$2))
41644
+ ])) : (openBlock(), createElementBlock("div", _hoisted_32$1, toDisplayString(_ctx.$t("uc_role.no_auth_permission")), 1))
41592
41645
  ])
41593
41646
  ])
41594
41647
  ]))