@pubinfo/module-rbac 2.0.0-beta.10 → 2.0.0-beta.12

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.
Files changed (54) hide show
  1. package/dist/{animation_item.vue_vue_type_script_setup_true_lang-BQvmwheq.js → animation_item.vue_vue_type_script_setup_true_lang-B6l7UFLh.js} +281 -281
  2. package/dist/cloneDeep-8vjgfynq.js +8 -0
  3. package/dist/components/OrgUserSelector/index.d.ts +3 -2
  4. package/dist/{gangweijiekou-BxJq_m0o.js → gangweijiekou-DoXatrli.js} +1 -1
  5. package/dist/{index-a0E9oj3q.js → index--VjqUCuf.js} +12 -13
  6. package/dist/{index-U8kjKY6p.js → index-437l5ijj.js} +5 -6
  7. package/dist/{index-Cr17VOfm.js → index-B7KC3boK.js} +4 -5
  8. package/dist/{index-Cej8u1qo.js → index-BGQ99J2l.js} +10 -11
  9. package/dist/{index-KboUdpTh.js → index-BTXg6pUc.js} +12 -15
  10. package/dist/{index-yEpViVkx.js → index-BWc4onKs.js} +10 -11
  11. package/dist/{index-MtXfNGqS.js → index-BX1CIagK.js} +6486 -562
  12. package/dist/{index-j_ln_NSt.js → index-BXq997wj.js} +10 -11
  13. package/dist/{index-s32GbmsJ.js → index-BamJFV9x.js} +3 -3
  14. package/dist/{index-D0yB_8b0.js → index-BpZlEjLH.js} +3 -3
  15. package/dist/{index-CTiFd9M0.js → index-BuIXR9Hh.js} +3 -3
  16. package/dist/{index-CsHj-xDw.js → index-Bugwk8cz.js} +2 -2
  17. package/dist/index-C-Pw2BFu.js +465 -0
  18. package/dist/{index-CLSeuhTv.js → index-C0HpWF9q.js} +13 -14
  19. package/dist/{index-CFPhIFyG.js → index-CEdx5DQj.js} +2 -2
  20. package/dist/{index-BhcAk-IH.js → index-CIAVtlta.js} +1 -1
  21. package/dist/{index-zh8PZXw2.js → index-CLKpGgxo.js} +16 -18
  22. package/dist/{index-Bl4v-7On.js → index-CLmuHwlB.js} +2 -2
  23. package/dist/{index-BleenJqT.js → index-D8wjctLy.js} +3 -3
  24. package/dist/{index-CLxqmFPw.js → index-DX_JxMJ5.js} +3 -3
  25. package/dist/{index-DNf0NPrD.js → index-McuDTIU1.js} +3 -3
  26. package/dist/{index-Bbsiwecf.js → index-QwehJ7aS.js} +33 -38
  27. package/dist/{index-BS45K9vK.js → index-ZlLpG1f9.js} +5 -6
  28. package/dist/{index-UZeQsp70.js → index-dJJh8i9i.js} +3 -3
  29. package/dist/{index-gmUZUdNl.js → index-uJt-0g6U.js} +7 -8
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +7 -3
  32. package/dist/{itemlist-xAbIKRVj.js → itemlist-D7MJp8Qk.js} +9 -10
  33. package/dist/{jiaosejiekou-BfY4h7uI.js → jiaosejiekou-BCXAevvU.js} +1 -1
  34. package/dist/{login_history-CuQv9Iw3.js → login_history-DmfGnXsn.js} +1 -1
  35. package/dist/{operate_history-CGP-1Xy2.js → operate_history-BzX4YfHD.js} +10 -10
  36. package/dist/{pubJiaosezukongzhiqi-CvYfc8Uz.js → pubJiaosezukongzhiqi-DjhWqIMC.js} +1 -1
  37. package/dist/{setItem-DkOvmWXP.js → setItem-A0ExOAEh.js} +1 -1
  38. package/dist/{shujuquanxianzhubiaokongzhiqi-DyNgf1y6.js → shujuquanxianzhubiaokongzhiqi-CmBc9yvH.js} +5 -5
  39. package/dist/style.css +1 -1
  40. package/dist/{useAppAndResource-D_b19V4t.js → useAppAndResource-BQ6GznA5.js} +2 -2
  41. package/dist/{xitongpeizhifuwu-C1Vm-W1B.js → xitongpeizhifuwu-DtEPa1iK.js} +1 -1
  42. package/dist/{zidianfuwu-yCWHhOfO.js → zidianfuwu-BUtPqzzu.js} +1 -1
  43. package/dist/{ziyuanjiekou-DhrAbneq.js → ziyuanjiekou-DMJynAKN.js} +1 -1
  44. package/dist/{zuzhijiaosebiaokongzhiqi-B1g74RqL.js → zuzhijiaosebiaokongzhiqi-Bf05-XJX.js} +1 -1
  45. package/package.json +4 -5
  46. package/src/components/OrgUserSelector/index.ts +5 -0
  47. package/src/index.ts +1 -0
  48. package/dist/OrgSelector.vue_vue_type_script_setup_true_lang-BcL0IFuA.js +0 -567
  49. package/dist/_baseClone-CQ44TFeq.js +0 -191
  50. package/dist/cloneDeep-BI4WNBQ9.js +0 -8
  51. package/dist/index-DFR8dd2B.js +0 -785
  52. package/dist/index-Dm4sOX43.js +0 -27
  53. package/dist/request-DQLgc7lT.js +0 -5
  54. package/dist/zuzhijiekou-PeZuFtCO.js +0 -85
@@ -1,5 +1,5 @@
1
- import "./request-DQLgc7lT.js";
2
- import { e as M, f as b } from "./ziyuanjiekou-DhrAbneq.js";
1
+ import "./index-BX1CIagK.js";
2
+ import { e as M, f as b } from "./ziyuanjiekou-DMJynAKN.js";
3
3
  import { R as D } from "./enum-CTUzwCYG.js";
4
4
  import { ref as u, computed as g } from "vue";
5
5
  function P(p) {
@@ -1,4 +1,4 @@
1
- import { b as o } from "./request-DQLgc7lT.js";
1
+ import { i as o } from "./index-BX1CIagK.js";
2
2
  function s(t, i) {
3
3
  return o.Post("/sysconfig/addOrEidtSysThemeStyleConfig", t, {
4
4
  headers: {
@@ -1,4 +1,4 @@
1
- import { b as e } from "./request-DQLgc7lT.js";
1
+ import { i as e } from "./index-BX1CIagK.js";
2
2
  function s(t, i) {
3
3
  const { id: n, ...o } = t;
4
4
  return e.Delete(
@@ -1,4 +1,4 @@
1
- import { b as r } from "./request-DQLgc7lT.js";
1
+ import { i as r } from "./index-BX1CIagK.js";
2
2
  function t(e, o) {
3
3
  return r.Post("/rbac/resource/addResource", e, {
4
4
  headers: {
@@ -1,4 +1,4 @@
1
- import { b as r } from "./request-DQLgc7lT.js";
1
+ import { i as r } from "./index-BX1CIagK.js";
2
2
  function t(o, e) {
3
3
  return r.Get("/rbac/orgRole/getByOrgId", {
4
4
  params: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/module-rbac",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.10",
4
+ "version": "2.0.0-beta.12",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -18,13 +18,13 @@
18
18
  ],
19
19
  "peerDependencies": {
20
20
  "@ant-design/icons-vue": "^7.0.1",
21
- "@pubinfo/headlessui": "^1.5.1",
22
21
  "@pubinfo/pro-components": "^1.7.0",
23
22
  "alova": "^3.2.9",
24
23
  "ant-design-vue": "^4.2.6",
25
- "pubinfo": "2.0.0-beta.10"
24
+ "pubinfo": "2.0.0-beta.12"
26
25
  },
27
26
  "dependencies": {
27
+ "@pubinfo/headlessui": "^1.5.1",
28
28
  "@vueuse/core": "^12.7.0",
29
29
  "dayjs": "^1.11.13",
30
30
  "lodash-es": "^4.17.21",
@@ -33,7 +33,6 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@ant-design/icons-vue": "^7.0.1",
36
- "@pubinfo/headlessui": "^1.5.1",
37
36
  "@pubinfo/openapi": "^0.8.4",
38
37
  "@pubinfo/preset-openapi": "^0.8.4",
39
38
  "@pubinfo/pro-components": "^1.7.0",
@@ -42,7 +41,7 @@
42
41
  "ant-design-vue": "^4.2.6",
43
42
  "type-fest": "^4.36.0",
44
43
  "vite-plugin-dts": "^4.5.3",
45
- "pubinfo": "2.0.0-beta.10"
44
+ "pubinfo": "2.0.0-beta.12"
46
45
  },
47
46
  "scripts": {
48
47
  "dev": "pubinfo build -w",
@@ -14,6 +14,11 @@ export function selectUser(props: UserSelectorProps & { modelValue?: UserModelVa
14
14
  createAppElement(UserSelector, props);
15
15
  }
16
16
 
17
+ export {
18
+ OrgSelector,
19
+ UserSelector,
20
+ };
21
+
17
22
  function createAppElement(
18
23
  component: typeof OrgSelector | typeof UserSelector,
19
24
  props: Parameters<typeof selectUser | typeof selectOrg>[0],
package/src/index.ts CHANGED
@@ -27,5 +27,6 @@ export function rbac(options: RbacOptions = {}): ModuleOptions {
27
27
  };
28
28
  }
29
29
 
30
+ export * from './components/OrgUserSelector';
30
31
  export * from './interface';
31
32
  export default rbac;
@@ -1,567 +0,0 @@
1
- import { defineComponent as B, mergeModels as V, useAttrs as M, useModel as N, ref as k, watch as $, createElementBlock as C, openBlock as w, createCommentVNode as q, createVNode as P, renderSlot as A, unref as y, mergeProps as z, withCtx as O, isRef as x } from "vue";
2
- import { OrgProvider as E, ContentSelector as W } from "@pubinfo/headlessui";
3
- import { message as R, Form as X, Modal as H } from "ant-design-vue";
4
- import { b as p } from "./request-DQLgc7lT.js";
5
- import { e as J, f as K, b as Q, h as Y } from "./zuzhijiekou-PeZuFtCO.js";
6
- import "@pubinfo/headlessui/style.css";
7
- import { u as Z } from "./index-Dm4sOX43.js";
8
- function ie(e, n) {
9
- return p.Post("/rbac/user/grantUserRoleAndDatPermission", e, {
10
- headers: {
11
- "Content-Type": "application/json"
12
- }
13
- });
14
- }
15
- function de(e, n) {
16
- return p.Get("/rbac/user/info", {
17
- params: {
18
- ...e
19
- }
20
- });
21
- }
22
- function ce(e, n) {
23
- return p.Post("/rbac/user/pubUserAdd", e, {
24
- headers: {
25
- "Content-Type": "application/json"
26
- }
27
- });
28
- }
29
- function pe(e, n) {
30
- return p.Put(
31
- "/rbac/user/resetPassword",
32
- {},
33
- {
34
- params: {
35
- ...e
36
- }
37
- }
38
- );
39
- }
40
- function _(e, n) {
41
- return p.Post("/rbac/user/userAndOrgList", e, {
42
- headers: {
43
- "Content-Type": "application/json"
44
- },
45
- ...n || {}
46
- });
47
- }
48
- function me(e, n) {
49
- return p.Get("/rbac/user/userDelete", {
50
- params: {
51
- ...e
52
- }
53
- });
54
- }
55
- function ee(e, n) {
56
- return p.Post("/rbac/user/userForMultiOrgPage", e, {
57
- headers: {
58
- "Content-Type": "application/json"
59
- },
60
- ...n || {}
61
- });
62
- }
63
- function fe(e, n) {
64
- return p.Post("/rbac/user/userPage", e, {
65
- headers: {
66
- "Content-Type": "application/json"
67
- }
68
- });
69
- }
70
- function ge(e, n) {
71
- return p.Post("/rbac/user/userUpdate-v2", e, {
72
- headers: {
73
- "Content-Type": "application/json"
74
- }
75
- });
76
- }
77
- function T(e, n) {
78
- return p.Post("/rbac/collect/add", e, {
79
- headers: {
80
- "Content-Type": "application/json"
81
- },
82
- ...n || {}
83
- });
84
- }
85
- function h(e, n) {
86
- return p.Post("/rbac/collect/findPage", e, {
87
- headers: {
88
- "Content-Type": "application/json"
89
- },
90
- ...n || {}
91
- });
92
- }
93
- function j(e, n) {
94
- return p.Post("/rbac/collect/removeCollect", e, {
95
- headers: {
96
- "Content-Type": "application/json"
97
- },
98
- ...n || {}
99
- });
100
- }
101
- function S(e, n) {
102
- return p.Post("/rbac/used/addBatch", e, {
103
- headers: {
104
- "Content-Type": "application/json"
105
- },
106
- ...n || {}
107
- });
108
- }
109
- function D(e, n) {
110
- return p.Post("/rbac/used/findPage", e, {
111
- headers: {
112
- "Content-Type": "application/json"
113
- },
114
- ...n || {}
115
- });
116
- }
117
- function be(e, n) {
118
- const { id: t, ...s } = e;
119
- return p.Delete(
120
- `/group/delete/${t}`,
121
- {},
122
- {
123
- params: { ...s }
124
- }
125
- );
126
- }
127
- function F(e, n) {
128
- const { id: t, ...s } = e;
129
- return p.Get(`/group/detail/${t}`, {
130
- params: {
131
- ...s
132
- },
133
- ...n || {}
134
- });
135
- }
136
- function G(e, n) {
137
- return p.Post("/group/findPage", e, {
138
- headers: {
139
- "Content-Type": "application/json"
140
- },
141
- ...n || {}
142
- });
143
- }
144
- function ye(e, n) {
145
- return p.Post("/group/list", e, {
146
- headers: {
147
- "Content-Type": "application/json"
148
- }
149
- });
150
- }
151
- function ve(e, n) {
152
- return p.Post("/group/saveOrUpdate", e, {
153
- headers: {
154
- "Content-Type": "application/json"
155
- }
156
- });
157
- }
158
- const i = {
159
- value: "orgId",
160
- label: "orgName",
161
- favorite: "collect",
162
- info: "fullName"
163
- }, c = {
164
- value: "orgUserId",
165
- label: "userName",
166
- favorite: "collect",
167
- info: "fullName"
168
- };
169
- function I(e = "", n = "") {
170
- return `${e}_${n}`;
171
- }
172
- function U(e) {
173
- const [n, t] = e == null ? void 0 : e.split("_");
174
- return {
175
- orgId: n,
176
- userId: t
177
- };
178
- }
179
- function m(e) {
180
- return e ? {
181
- headers: { "X-ResourceMark": e }
182
- } : {};
183
- }
184
- function ae({ auth: e, filter: n }) {
185
- return {
186
- // 回显选中项
187
- async getSelectedData(t) {
188
- var r;
189
- const s = await Y(
190
- t.map((a) => a[i.value]),
191
- m(e)
192
- );
193
- return ((r = s == null ? void 0 : s.data) == null ? void 0 : r.map((a) => ({
194
- ...a,
195
- [i.value]: a.id,
196
- [i.label]: a.name,
197
- [i.info]: a.fullName
198
- }))) ?? [];
199
- },
200
- // 添加到最近常用
201
- async addRecentlyUsed(t) {
202
- await S(t.map((s) => ({
203
- type: "1",
204
- orgId: s[i.value],
205
- orgName: s[i.label]
206
- })), m(e));
207
- },
208
- // 最近常用
209
- async recentlyUsed({ search: t, current: s }) {
210
- var a, o;
211
- return {
212
- total: 20,
213
- data: ((o = (a = (await D({
214
- type: "1",
215
- orgName: t,
216
- currentPage: s,
217
- pageSize: 20,
218
- showIsCollect: !0
219
- }, m(e))).data) == null ? void 0 : a.records) == null ? void 0 : o.map((l) => ({
220
- ...l,
221
- [i.value]: l.orgId,
222
- [i.label]: l.orgName,
223
- [i.info]: l.fullOrgName
224
- }))) ?? []
225
- };
226
- },
227
- // 收藏
228
- async favorites({ search: t, current: s, pageSize: r }) {
229
- var o, l, d;
230
- const a = await h({
231
- type: "1",
232
- orgName: t,
233
- currentPage: s,
234
- pageSize: r
235
- }, m(e));
236
- return {
237
- total: ((o = a.data) == null ? void 0 : o.total) ?? 0,
238
- data: ((d = (l = a.data) == null ? void 0 : l.records) == null ? void 0 : d.map((u) => ({
239
- ...u,
240
- [i.value]: u.orgId,
241
- [i.label]: u.orgName,
242
- [i.info]: u.fullOrgName
243
- }))) ?? []
244
- };
245
- },
246
- // 添加取消收藏
247
- async favoriteToggle({ favorite: t, record: s }) {
248
- (await (t ? T : j)({ type: "1", orgId: s == null ? void 0 : s[i.value] }, m(e))).success && R.success(t ? "收藏成功" : "取消收藏成功");
249
- },
250
- // 群组列表
251
- async groups({ search: t, current: s, pageSize: r }) {
252
- var o, l, d;
253
- const a = await G({
254
- type: "1",
255
- name: t,
256
- currentPage: s,
257
- pageSize: r
258
- });
259
- return {
260
- total: ((o = a.data) == null ? void 0 : o.total) ?? 0,
261
- data: ((d = (l = a.data) == null ? void 0 : l.records) == null ? void 0 : d.map((u) => ({
262
- ...u,
263
- [i.value]: u.id,
264
- [i.label]: u.name
265
- }))) ?? []
266
- };
267
- },
268
- // 群组数据
269
- async groupData({ node: t }) {
270
- var r, a;
271
- return ((a = (r = (await F({ id: t == null ? void 0 : t.id, showIsCollect: !0 }, m(e))).data) == null ? void 0 : r.pubGroupMemberList) == null ? void 0 : a.map((o) => ({
272
- ...o,
273
- [i.value]: o.orgId,
274
- [i.label]: o.orgName,
275
- [i.info]: o.fullOrgName,
276
- isLeaf: !0
277
- })).filter(n)) ?? [];
278
- },
279
- // 组织树
280
- async orgTree({ node: t }) {
281
- var r;
282
- return ((r = (await Q({
283
- parentId: t == null ? void 0 : t.orgId,
284
- enable: !0,
285
- showFullName: !0,
286
- showIsCollect: !0
287
- }, m(e))).data) == null ? void 0 : r.map((a) => ({
288
- ...a,
289
- [i.value]: a.id,
290
- [i.label]: a.name,
291
- [i.info]: a.fullName,
292
- isLeaf: a.leaf
293
- })).filter(n)) ?? [];
294
- },
295
- // 组织的所有子节点
296
- async orgChildren({ node: t }) {
297
- var r;
298
- return ((r = (await K({ parentId: t == null ? void 0 : t.orgId }, m(e))).data) == null ? void 0 : r.map((a) => ({
299
- ...a,
300
- [i.value]: a.id,
301
- [i.label]: a.name,
302
- [i.info]: a.fullName,
303
- isLeaf: a.leaf
304
- })).filter(n)) ?? [];
305
- },
306
- // 组织列表
307
- async orgList({ search: t, current: s, pageSize: r }) {
308
- var o, l, d;
309
- const a = await J({
310
- keyWord: t,
311
- currentPage: s,
312
- pageSize: r,
313
- showIsCollect: !0
314
- }, m(e));
315
- return {
316
- total: ((o = a.data) == null ? void 0 : o.total) ?? 0,
317
- data: ((d = (l = a.data) == null ? void 0 : l.records) == null ? void 0 : d.map((u) => ({
318
- ...u,
319
- [i.value]: u.id,
320
- [i.label]: u.simpleName,
321
- [i.info]: u.fullName
322
- })).filter(n)) ?? []
323
- };
324
- }
325
- };
326
- }
327
- function Ie({ auth: e, filter: n }) {
328
- return {
329
- // 回显选中项
330
- async getSelectedData(t) {
331
- var r;
332
- const s = await _(t.map((a) => ({
333
- orgId: a.orgId,
334
- userId: a.userId
335
- })), m(e));
336
- return ((r = s == null ? void 0 : s.data) == null ? void 0 : r.map((a) => ({
337
- ...a,
338
- [c.value]: I(a == null ? void 0 : a.orgId, a.id),
339
- [c.label]: a.realName,
340
- [c.info]: a.fullOrgName
341
- }))) ?? [];
342
- },
343
- // 添加到最近常用
344
- async addRecentlyUsed(t) {
345
- await S(t.map((s) => {
346
- const r = U(s[c.value]);
347
- return {
348
- type: "2",
349
- orgId: r.orgId,
350
- userId: r.userId,
351
- userName: s[c.label]
352
- };
353
- }), m(e));
354
- },
355
- // 最近常用
356
- async recentlyUsed({ search: t, current: s }) {
357
- var a, o;
358
- return {
359
- total: 20,
360
- data: ((o = (a = (await D({
361
- type: "2",
362
- userName: t,
363
- currentPage: s,
364
- pageSize: 20,
365
- showIsCollect: !0
366
- }, m(e))).data) == null ? void 0 : a.records) == null ? void 0 : o.map((l) => ({
367
- ...l,
368
- [c.value]: I(l.orgId, l.userId),
369
- [c.label]: l.userName,
370
- [c.info]: l.fullOrgName
371
- }))) ?? []
372
- };
373
- },
374
- // 收藏
375
- async favorites({ search: t, current: s, pageSize: r }) {
376
- var o, l, d;
377
- const a = await h({
378
- type: "2",
379
- userName: t,
380
- currentPage: s,
381
- pageSize: r
382
- }, m(e));
383
- return {
384
- total: ((o = a.data) == null ? void 0 : o.total) ?? 0,
385
- data: ((d = (l = a.data) == null ? void 0 : l.records) == null ? void 0 : d.map((u) => ({
386
- ...u,
387
- [c.value]: I(u.orgId, u.userId),
388
- [c.label]: u.userName,
389
- [c.info]: u.fullOrgName
390
- }))) ?? []
391
- };
392
- },
393
- // 添加取消收藏
394
- async favoriteToggle({ favorite: t, record: s }) {
395
- const r = t ? T : j, a = U(s == null ? void 0 : s[c.value]);
396
- (await r({
397
- type: "2",
398
- orgId: a.orgId,
399
- userId: a.userId
400
- }, m(e))).success && R.success(t ? "收藏成功" : "取消收藏成功");
401
- },
402
- // 群组列表
403
- async groups({ search: t, current: s, pageSize: r }) {
404
- var o, l, d;
405
- const a = await G({
406
- type: "2",
407
- name: t,
408
- currentPage: s,
409
- pageSize: r
410
- }, m(e));
411
- return {
412
- total: ((o = a.data) == null ? void 0 : o.total) ?? 0,
413
- data: ((d = (l = a.data) == null ? void 0 : l.records) == null ? void 0 : d.map((u) => ({
414
- ...u,
415
- [c.value]: u.id,
416
- [c.label]: u.name
417
- }))) ?? []
418
- };
419
- },
420
- // 群组数据
421
- async groupData({ node: t }) {
422
- var r, a;
423
- return ((a = (r = (await F({ id: t == null ? void 0 : t.id, showIsCollect: !0 }, m(e))).data) == null ? void 0 : r.pubGroupMemberList) == null ? void 0 : a.map((o) => ({
424
- ...o,
425
- [c.value]: I(o.orgId, o.userId),
426
- [c.label]: o.userName,
427
- [c.info]: o.fullOrgName,
428
- isLeaf: !0
429
- })).filter(n)) ?? [];
430
- },
431
- // 用户列表
432
- async userList({ orgId: t, search: s, current: r, pageSize: a }) {
433
- var l, d, u;
434
- const o = await ee({
435
- orgId: t,
436
- realName: s,
437
- currentPage: r,
438
- pageSize: a,
439
- enable: !0,
440
- showIsCollect: !0
441
- }, m(e));
442
- return {
443
- total: ((l = o.data) == null ? void 0 : l.total) ?? 0,
444
- data: ((u = (d = o.data) == null ? void 0 : d.records) == null ? void 0 : u.map((b) => ({
445
- ...b,
446
- [c.value]: I(b.orgId, b.userId),
447
- [c.label]: b.userName,
448
- [c.info]: b.fullOrgName
449
- })).filter(n)) ?? []
450
- };
451
- }
452
- };
453
- }
454
- const Pe = /* @__PURE__ */ B({
455
- name: "OrgSelector",
456
- __name: "OrgSelector",
457
- props: /* @__PURE__ */ V({
458
- title: { default: "选择组织" },
459
- multiple: { type: Boolean, default: !1 },
460
- auth: {},
461
- apis: { default: () => ({}) },
462
- tabs: { default: () => [
463
- { value: "RecentlyUsed", label: "最近常用" },
464
- { value: "Favorites", label: "收藏" },
465
- { value: "OrgTree", label: "全部" },
466
- { value: "Groups", label: "群组" }
467
- ] },
468
- disabledData: { type: Function, default: () => !1 },
469
- filter: { type: Function, default: () => !0 },
470
- onSubmit: {}
471
- }, {
472
- open: { type: Boolean },
473
- openModifiers: {},
474
- modelValue: { default: [] },
475
- modelModifiers: {}
476
- }),
477
- emits: ["update:open", "update:modelValue"],
478
- setup(e, { expose: n }) {
479
- const t = e, s = M(), r = {
480
- ...ae({ auth: t.auth, filter: t.filter }),
481
- ...t.apis
482
- }, a = N(e, "open"), o = N(e, "modelValue"), l = k([]), d = Z(a), { onFieldChange: u } = X.useInjectFormItemContext();
483
- function b() {
484
- d(!0);
485
- }
486
- $(a, async (g) => {
487
- var f;
488
- if (g) {
489
- if (!o.value.length) {
490
- l.value = [];
491
- return;
492
- }
493
- try {
494
- l.value = await ((f = r == null ? void 0 : r.getSelectedData) == null ? void 0 : f.call(r, o.value)) ?? o.value;
495
- } catch {
496
- l.value = o.value;
497
- }
498
- }
499
- }, { immediate: !0 });
500
- function L() {
501
- var g, f;
502
- o.value = l.value, (g = t.onSubmit) == null || g.call(t, l.value), u(), d(!1), (f = r == null ? void 0 : r.addRecentlyUsed) == null || f.call(r, l.value);
503
- }
504
- return n({
505
- open: b
506
- }), (g, f) => (w(), C("div", null, [
507
- g.$slots.trigger ? (w(), C("span", {
508
- key: 0,
509
- onClick: f[0] || (f[0] = (v) => b())
510
- }, [
511
- A(g.$slots, "trigger")
512
- ])) : q("v-if", !0),
513
- P(y(H), z(y(s), {
514
- open: a.value,
515
- "onUpdate:open": f[2] || (f[2] = (v) => a.value = v),
516
- title: g.title,
517
- width: 760,
518
- "z-index": 1001,
519
- "ok-text": "确认",
520
- "cancel-text": "取消",
521
- onOk: f[3] || (f[3] = (v) => L())
522
- }), {
523
- default: O(() => [
524
- P(y(E), {
525
- apis: r,
526
- "field-names": y(i)
527
- }, {
528
- default: O(() => [
529
- P(y(W), {
530
- modelValue: y(l),
531
- "onUpdate:modelValue": f[1] || (f[1] = (v) => x(l) ? l.value = v : null),
532
- "default-tab": "OrgTree",
533
- tabs: g.tabs,
534
- multiple: g.multiple,
535
- "disabled-data": g.disabledData
536
- }, null, 8, ["modelValue", "tabs", "multiple", "disabled-data"])
537
- ]),
538
- _: 1
539
- /* STABLE */
540
- }, 8, ["field-names"])
541
- ]),
542
- _: 1
543
- /* STABLE */
544
- }, 16, ["open", "title"])
545
- ]));
546
- }
547
- });
548
- export {
549
- Pe as _,
550
- ie as a,
551
- ce as b,
552
- ge as c,
553
- fe as d,
554
- me as e,
555
- pe as f,
556
- de as g,
557
- Ie as h,
558
- c as i,
559
- F as j,
560
- ve as k,
561
- G as l,
562
- be as m,
563
- i as o,
564
- ye as p,
565
- U as r,
566
- ae as u
567
- };