smart-admin-web 10.20.1 → 10.21.0

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 (143) hide show
  1. package/dist/api/index.d.ts +19 -1
  2. package/dist/api/index.js +85 -66
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/schema.d.ts +448 -1
  5. package/dist/assets/icons/ph-subset.json.js +1 -1
  6. package/dist/components/FormContainer/index.vue.js +87 -75
  7. package/dist/components/FormContainer/index.vue.js.map +1 -1
  8. package/dist/components/UserPicker/UserAvatar.vue.d.ts +8 -0
  9. package/dist/components/UserPicker/UserAvatar.vue.js +8 -0
  10. package/dist/components/UserPicker/UserAvatar.vue.js.map +1 -0
  11. package/dist/components/UserPicker/UserAvatar2.vue.js +38 -0
  12. package/dist/components/UserPicker/UserAvatar2.vue.js.map +1 -0
  13. package/dist/components/UserPicker/index.vue.js +1 -1
  14. package/dist/components/UserPicker/index2.vue.js +328 -186
  15. package/dist/components/UserPicker/index2.vue.js.map +1 -1
  16. package/dist/index.js +248 -246
  17. package/dist/lib/runtime.js +1 -1
  18. package/dist/lib/watermark.d.ts +1 -1
  19. package/dist/locales/en-US.d.ts +62 -3
  20. package/dist/locales/en-US.js +65 -6
  21. package/dist/locales/en-US.js.map +1 -1
  22. package/dist/locales/kernelMenuTitles.js +1 -0
  23. package/dist/locales/kernelMenuTitles.js.map +1 -1
  24. package/dist/locales/zh-CN.d.ts +62 -3
  25. package/dist/locales/zh-CN.js +65 -6
  26. package/dist/locales/zh-CN.js.map +1 -1
  27. package/dist/router/viewRegistry.js +6 -6
  28. package/dist/router/viewRegistry.js.map +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/theme/naive-theme.js +80 -77
  31. package/dist/theme/naive-theme.js.map +1 -1
  32. package/dist/types/api.d.ts +91 -0
  33. package/dist/types/api.js +17 -15
  34. package/dist/types/api.js.map +1 -1
  35. package/dist/utils/shake.d.ts +1 -0
  36. package/dist/utils/shake.js +30 -0
  37. package/dist/utils/shake.js.map +1 -0
  38. package/dist/views/login/LoginForm.vue.js +2 -2
  39. package/dist/views/login/LoginForm2.vue.js +135 -135
  40. package/dist/views/login/LoginForm2.vue.js.map +1 -1
  41. package/dist/views/login/components/LoginDesk.vue.js +1 -1
  42. package/dist/views/login/components/LoginDesk2.vue.js +59 -47
  43. package/dist/views/login/components/LoginDesk2.vue.js.map +1 -1
  44. package/dist/views/personal/notice2.vue.js +1 -1
  45. package/dist/views/personal/notice2.vue.js.map +1 -1
  46. package/dist/views/personal/sessions.vue.js +2 -2
  47. package/dist/views/personal/sessions2.vue.js +41 -40
  48. package/dist/views/personal/sessions2.vue.js.map +1 -1
  49. package/dist/views/system/ai-usage/index.vue.js +3 -3
  50. package/dist/views/system/ai-usage/index2.vue.js +13 -12
  51. package/dist/views/system/ai-usage/index2.vue.js.map +1 -1
  52. package/dist/views/system/config/components/AdvancedSection.vue.js +3 -3
  53. package/dist/views/system/config/components/AdvancedSection2.vue.js +2 -1
  54. package/dist/views/system/config/components/AdvancedSection2.vue.js.map +1 -1
  55. package/dist/views/system/dict/index.vue.js +2 -2
  56. package/dist/views/system/dict/index2.vue.js +12 -1
  57. package/dist/views/system/dict/index2.vue.js.map +1 -1
  58. package/dist/views/system/file/index2.vue.js +1 -0
  59. package/dist/views/system/file/index2.vue.js.map +1 -1
  60. package/dist/views/system/job/index.vue.js +3 -3
  61. package/dist/views/system/job/index2.vue.js +182 -181
  62. package/dist/views/system/job/index2.vue.js.map +1 -1
  63. package/dist/views/system/job-log/components/AttemptTable2.vue.js +8 -3
  64. package/dist/views/system/job-log/components/AttemptTable2.vue.js.map +1 -1
  65. package/dist/views/system/job-log/index.vue.js +1 -1
  66. package/dist/views/system/job-log/index2.vue.js +5 -5
  67. package/dist/views/system/job-log/index2.vue.js.map +1 -1
  68. package/dist/views/system/log/exception/index.vue.js +2 -2
  69. package/dist/views/system/log/exception/index2.vue.js +8 -5
  70. package/dist/views/system/log/exception/index2.vue.js.map +1 -1
  71. package/dist/views/system/log/login/index2.vue.js +21 -12
  72. package/dist/views/system/log/login/index2.vue.js.map +1 -1
  73. package/dist/views/system/log/op/index.vue.js +2 -2
  74. package/dist/views/system/log/op/index2.vue.js +50 -40
  75. package/dist/views/system/log/op/index2.vue.js.map +1 -1
  76. package/dist/views/system/menu/components/ButtonManager.vue.js +2 -2
  77. package/dist/views/system/menu/components/ButtonManager2.vue.js +45 -36
  78. package/dist/views/system/menu/components/ButtonManager2.vue.js.map +1 -1
  79. package/dist/views/system/menu/index.vue.js +2 -2
  80. package/dist/views/system/menu/index2.vue.js +11 -11
  81. package/dist/views/system/menu/index2.vue.js.map +1 -1
  82. package/dist/views/system/module/index.vue.js +1 -1
  83. package/dist/views/system/module/index2.vue.js +171 -117
  84. package/dist/views/system/module/index2.vue.js.map +1 -1
  85. package/dist/views/system/notice/index.vue.js +3 -3
  86. package/dist/views/system/notice/index2.vue.js +1 -0
  87. package/dist/views/system/notice/index2.vue.js.map +1 -1
  88. package/dist/views/system/org/index.vue.js +2 -2
  89. package/dist/views/system/org/index2.vue.js +70 -67
  90. package/dist/views/system/org/index2.vue.js.map +1 -1
  91. package/dist/views/system/position/index.vue.js +2 -2
  92. package/dist/views/system/position/index2.vue.js +57 -48
  93. package/dist/views/system/position/index2.vue.js.map +1 -1
  94. package/dist/views/system/recycle/index.vue.js +1 -1
  95. package/dist/views/system/recycle/index2.vue.js +3 -1
  96. package/dist/views/system/recycle/index2.vue.js.map +1 -1
  97. package/dist/views/system/role/components/GrantMenuSheet.vue.d.ts +2 -0
  98. package/dist/views/system/role/components/GrantMenuSheet.vue.js +2 -2
  99. package/dist/views/system/role/components/GrantMenuSheet2.vue.js +54 -49
  100. package/dist/views/system/role/components/GrantMenuSheet2.vue.js.map +1 -1
  101. package/dist/views/system/role/components/GrantMenuTable.vue.js +1 -1
  102. package/dist/views/system/role/components/GrantMenuTable2.vue.js +159 -195
  103. package/dist/views/system/role/components/GrantMenuTable2.vue.js.map +1 -1
  104. package/dist/views/system/role/components/grantMenuGroups.d.ts +54 -0
  105. package/dist/views/system/role/components/grantMenuGroups.js +116 -76
  106. package/dist/views/system/role/components/grantMenuGroups.js.map +1 -1
  107. package/dist/views/system/role/index.vue.js +2 -2
  108. package/dist/views/system/role/index2.vue.js +152 -145
  109. package/dist/views/system/role/index2.vue.js.map +1 -1
  110. package/dist/views/system/session/index2.vue.js +39 -35
  111. package/dist/views/system/session/index2.vue.js.map +1 -1
  112. package/dist/views/system/user/components/UserGrantEffectiveTable.vue.d.ts +10 -0
  113. package/dist/views/system/user/components/UserGrantEffectiveTable.vue.js +5 -0
  114. package/dist/views/system/user/components/UserGrantEffectiveTable.vue.js.map +1 -0
  115. package/dist/views/system/user/components/UserGrantEffectiveTable2.vue.js +96 -0
  116. package/dist/views/system/user/components/UserGrantEffectiveTable2.vue.js.map +1 -0
  117. package/dist/views/system/user/components/UserGrantMenuSheet.vue.d.ts +13 -0
  118. package/dist/views/system/user/components/UserGrantMenuSheet.vue.js +8 -0
  119. package/dist/views/system/user/components/UserGrantMenuSheet.vue.js.map +1 -0
  120. package/dist/views/system/user/components/UserGrantMenuSheet2.vue.js +216 -0
  121. package/dist/views/system/user/components/UserGrantMenuSheet2.vue.js.map +1 -0
  122. package/dist/views/system/user/components/UserGrantMenuTable.vue.d.ts +13 -0
  123. package/dist/views/system/user/components/UserGrantMenuTable.vue.js +8 -0
  124. package/dist/views/system/user/components/UserGrantMenuTable.vue.js.map +1 -0
  125. package/dist/views/system/user/components/UserGrantMenuTable2.vue.js +186 -0
  126. package/dist/views/system/user/components/UserGrantMenuTable2.vue.js.map +1 -0
  127. package/dist/views/system/user/components/UserGrantNodeRow.vue.d.ts +31 -0
  128. package/dist/views/system/user/components/UserGrantNodeRow.vue.js +8 -0
  129. package/dist/views/system/user/components/UserGrantNodeRow.vue.js.map +1 -0
  130. package/dist/views/system/user/components/UserGrantNodeRow2.vue.js +171 -0
  131. package/dist/views/system/user/components/UserGrantNodeRow2.vue.js.map +1 -0
  132. package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.d.ts +21 -0
  133. package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.js +5 -0
  134. package/dist/views/system/user/components/UserGrantOverviewDrawer.vue.js.map +1 -0
  135. package/dist/views/system/user/components/UserGrantOverviewDrawer2.vue.js +178 -0
  136. package/dist/views/system/user/components/UserGrantOverviewDrawer2.vue.js.map +1 -0
  137. package/dist/views/system/user/components/userGrantState.d.ts +64 -0
  138. package/dist/views/system/user/components/userGrantState.js +117 -0
  139. package/dist/views/system/user/components/userGrantState.js.map +1 -0
  140. package/dist/views/system/user/index.vue.js +2 -2
  141. package/dist/views/system/user/index2.vue.js +250 -207
  142. package/dist/views/system/user/index2.vue.js.map +1 -1
  143. package/package.json +3 -3
@@ -1,265 +1,407 @@
1
- import { defineComponent as ae, ref as v, computed as p, onMounted as ne, h as se, reactive as oe, openBlock as f, createBlock as _, unref as l, withCtx as h, createVNode as u, createTextVNode as g, toDisplayString as o, createCommentVNode as b, createElementVNode as r, normalizeClass as re, createElementBlock as C, withDirectives as A, vShow as K, Fragment as ie, renderList as ce } from "vue";
2
- import { useMessage as ue, NButton as S, NTabs as de, NTab as L, NTree as pe, NTreeSelect as me, NInput as ve, NEmpty as fe } from "naive-ui";
3
- import { SmartTable as he } from "smart-naive-table";
4
- import { useI18n as ke } from "vue-i18n";
5
- import { useWindowSize as ge } from "@vueuse/core";
6
- import ye from "../AppIcon.vue.js";
7
- import we from "../FormContainer/index.vue.js";
1
+ import { defineComponent as Ne, ref as d, computed as u, onMounted as Ie, reactive as Ee, openBlock as i, createBlock as w, unref as s, withCtx as f, createVNode as c, createTextVNode as E, toDisplayString as r, createCommentVNode as h, createElementVNode as n, normalizeClass as H, createElementBlock as m, withDirectives as R, Fragment as Z, renderList as J, withKeys as Q, withModifiers as X, vShow as Y } from "vue";
2
+ import { useMessage as Ue, NTabs as Te, NTab as ee, NTree as $e, NTreeSelect as Ae, NInput as ae, NDropdown as De, NButton as te, NSpin as Be, NEmpty as se } from "naive-ui";
3
+ import { useI18n as Me } from "vue-i18n";
4
+ import { useWindowSize as Ke, useDebounceFn as Le } from "@vueuse/core";
5
+ import S from "../AppIcon.vue.js";
6
+ import Oe from "../FormContainer/index.vue.js";
8
7
  /* empty css */
9
- import { useShellBreakpoint as _e } from "../../composables/useShellBreakpoint.js";
10
- import { orgApi as be, userApi as O } from "../../api/index.js";
11
- import { buildTree as Se } from "../../utils/tree.js";
12
- import { translateError as ze } from "../../utils/error.js";
13
- import { SEARCH_ACTIONS as xe } from "../../utils/tableFilter.js";
14
- const Ce = {
8
+ import le from "./UserAvatar.vue.js";
9
+ import { useShellBreakpoint as Ve } from "../../composables/useShellBreakpoint.js";
10
+ import { orgApi as Fe, userApi as ne } from "../../api/index.js";
11
+ import { buildTree as qe } from "../../utils/tree.js";
12
+ import { translateError as We } from "../../utils/error.js";
13
+ const je = {
15
14
  key: 0,
16
- class: "picker-tree"
17
- }, Ne = { class: "panel-header" }, Pe = { class: "picker-table" }, Ie = { class: "panel-header" }, Te = { class: "picker-selected" }, Ue = { class: "panel-header" }, Ee = { class: "selected-list" }, Be = { class: "selected-name" }, qe = { class: "selected-account" }, Ge = /* @__PURE__ */ ae({
15
+ class: "picker-org"
16
+ }, Ge = { class: "side-title" }, He = { class: "picker-main" }, Re = { class: "picker-toolbar" }, Ze = {
17
+ class: "scope-trigger",
18
+ role: "button",
19
+ tabindex: "0"
20
+ }, Je = {
21
+ class: "user-list",
22
+ role: "group"
23
+ }, Qe = ["aria-checked", "aria-disabled", "tabindex", "onClick", "onKeydown"], Xe = { class: "user-main" }, Ye = { class: "user-name" }, ea = {
24
+ key: 0,
25
+ class: "user-sub"
26
+ }, aa = {
27
+ key: 0,
28
+ class: "user-tag"
29
+ }, ta = {
30
+ key: 1,
31
+ class: "user-check"
32
+ }, sa = { class: "picker-foot" }, la = { class: "picker-total" }, na = {
33
+ key: 0,
34
+ class: "pager"
35
+ }, oa = ["disabled", "aria-label"], ia = { class: "pager-num" }, ca = ["disabled", "aria-label"], ra = { class: "picker-selected" }, ua = { class: "side-head" }, da = { class: "side-title" }, va = { class: "side-count" }, pa = { class: "selected-list" }, ma = { class: "user-main" }, fa = { class: "user-name" }, ha = {
36
+ key: 0,
37
+ class: "user-sub"
38
+ }, ga = ["aria-label", "onClick"], oe = 20, ka = 8, Ua = /* @__PURE__ */ Ne({
18
39
  __name: "index",
19
40
  props: {
20
41
  excludeIds: {}
21
42
  },
22
43
  emits: ["confirm"],
23
- setup(R, { expose: V, emit: D }) {
24
- const $ = R, F = D, { t: n } = ke(), M = ue(), z = v(!1), y = v(), { bp: N } = _e(), { width: W } = ge(), d = p(() => N.value === "narrow" || W.value < 900), H = p(() => N.value === "narrow" ? "drawer" : "modal"), k = v("users"), x = p(() => d.value ? "large" : "small"), P = v([]), I = p(() => [{ id: 0, parentId: -1, name: n("common.all"), children: Se(P.value) }]), c = v(null), j = p(
25
- () => c.value && c.value !== 0 ? c.value : void 0
44
+ setup(ie, { expose: ce, emit: re }) {
45
+ const ue = ie, de = re, { t: l } = Me(), ve = Ue(), M = d(!1), { bp: V } = Ve(), { width: pe } = Ke(), g = u(() => V.value === "narrow" || pe.value < 900), me = u(() => V.value === "narrow" ? "drawer" : "modal"), x = d("users"), F = d([]), q = u(() => [{ id: 0, parentId: -1, name: l("common.all"), children: qe(F.value) }]), k = d(null), fe = u(
46
+ () => k.value && k.value !== 0 ? k.value : void 0
26
47
  );
27
- ne(async () => {
48
+ Ie(async () => {
28
49
  try {
29
- P.value = await be.list();
50
+ F.value = await Fe.list();
30
51
  } catch {
31
52
  }
32
53
  });
33
- function G(t) {
34
- var e;
35
- c.value = t[0] ?? null, (e = y.value) == null || e.refresh();
54
+ function he(e) {
55
+ k.value = e[0] ?? null, A();
36
56
  }
37
- function J(t) {
38
- var e;
39
- c.value = t ?? null, (e = y.value) == null || e.refresh();
57
+ function ge(e) {
58
+ k.value = e ?? null, A();
40
59
  }
41
- const m = v([]), T = p(() => new Set($.excludeIds ?? [])), Q = (t) => O.page({
42
- page: t.page,
43
- pageSize: t.pageSize,
44
- account: t.account,
45
- orgId: j.value
46
- }), X = [
47
- { type: "selection" },
48
- { key: "name", title: () => n("user.name"), width: 100 },
49
- {
50
- key: "account",
51
- title: () => n("user.account"),
52
- width: 120,
53
- search: { actions: xe.fuzzy }
54
- },
55
- {
56
- key: "op",
57
- title: () => n("common.operation"),
58
- width: 70,
59
- render: (t) => {
60
- const e = U.value.has(t.id) || T.value.has(t.id);
61
- return se(
62
- S,
63
- {
64
- size: "tiny",
65
- type: "primary",
66
- quaternary: !0,
67
- disabled: e,
68
- onClick: () => B([t])
69
- },
70
- () => n(e ? "userPicker.added" : "userPicker.add")
71
- );
72
- }
60
+ const b = d("name"), P = d(""), v = d(1), C = d(0), y = d([]), U = d(!1);
61
+ let T = 0;
62
+ const $ = u(() => Math.max(1, Math.ceil(C.value / oe))), ke = u(
63
+ () => b.value === "name" ? l("userPicker.searchName") : l("userPicker.searchAccount")
64
+ ), _e = u(() => [
65
+ { key: "name", label: l("user.name") },
66
+ { key: "account", label: l("user.account") }
67
+ ]);
68
+ async function K() {
69
+ const e = ++T;
70
+ U.value = !0;
71
+ try {
72
+ const t = P.value.trim() || void 0, a = await ne.page({
73
+ page: v.value,
74
+ pageSize: oe,
75
+ name: b.value === "name" ? t : void 0,
76
+ account: b.value === "account" ? t : void 0,
77
+ orgId: fe.value
78
+ });
79
+ if (e !== T) return;
80
+ y.value = a.items, C.value = a.total;
81
+ } catch (t) {
82
+ if (e !== T) return;
83
+ y.value = [], C.value = 0, ve.error(We(t));
84
+ } finally {
85
+ e === T && (U.value = !1);
73
86
  }
74
- ], s = oe([]), U = p(() => new Set(s.map((t) => t.id))), w = v(""), E = p(() => {
75
- const t = w.value.trim().toLowerCase();
76
- return t ? s.filter(
77
- (e) => e.name.toLowerCase().includes(t) || e.account.toLowerCase().includes(t)
78
- ) : s;
87
+ }
88
+ function A() {
89
+ v.value = 1, K();
90
+ }
91
+ const be = Le(A, 300);
92
+ function ye(e) {
93
+ P.value = e, be();
94
+ }
95
+ function we(e) {
96
+ b.value = e, P.value.trim() && A();
97
+ }
98
+ function W(e) {
99
+ e < 1 || e > $.value || e === v.value || (v.value = e, K());
100
+ }
101
+ const o = Ee([]), z = u(() => new Set(o.map((e) => e.id))), _ = u(() => new Set(ue.excludeIds ?? [])), D = d(""), Se = u(() => {
102
+ const e = D.value.trim().toLowerCase();
103
+ return e ? o.filter(
104
+ (t) => t.name.toLowerCase().includes(e) || t.account.toLowerCase().includes(e)
105
+ ) : o;
79
106
  });
80
- function B(t) {
81
- for (const e of t)
82
- !U.value.has(e.id) && !T.value.has(e.id) && s.push(e);
107
+ function j(e) {
108
+ for (const t of e)
109
+ !z.value.has(t.id) && !_.value.has(t.id) && o.push(t);
83
110
  }
84
- function Y() {
85
- var e;
86
- const t = (l((e = y.value) == null ? void 0 : e.rows) ?? []).filter((a) => m.value.includes(a.id));
87
- B(t), m.value = [];
111
+ function L(e) {
112
+ const t = o.findIndex((a) => a.id === e);
113
+ t >= 0 && o.splice(t, 1);
88
114
  }
89
- function Z(t) {
90
- const e = s.findIndex((a) => a.id === t);
91
- e >= 0 && s.splice(e, 1);
115
+ function O(e) {
116
+ _.value.has(e.id) || (z.value.has(e.id) ? L(e.id) : j([e]));
92
117
  }
93
- function ee() {
94
- s.splice(0, s.length);
118
+ function xe() {
119
+ o.splice(0, o.length);
95
120
  }
96
- async function te(t) {
97
- if (s.splice(0, s.length), m.value = [], w.value = "", c.value = null, k.value = "users", z.value = !0, t != null && t.length)
121
+ const N = u(() => y.value.filter((e) => !_.value.has(e.id))), G = u(
122
+ () => N.value.length > 0 && N.value.every((e) => z.value.has(e.id))
123
+ );
124
+ function Pe() {
125
+ if (G.value)
126
+ for (const e of N.value) L(e.id);
127
+ else
128
+ j(N.value);
129
+ }
130
+ function B(e) {
131
+ return [e.account !== e.name ? e.account : "", e.orgName].filter(Boolean).join(" · ");
132
+ }
133
+ async function Ce(e) {
134
+ if (o.splice(0, o.length), D.value = "", k.value = null, P.value = "", b.value = "name", v.value = 1, y.value = [], C.value = 0, x.value = "users", M.value = !0, K(), !!(e != null && e.length))
98
135
  try {
99
- const { items: e } = await O.page({ page: 1, pageSize: 200 }), a = e.filter((i) => t.includes(i.id)), q = new Set(a.map((i) => i.id));
100
- for (const i of a) s.push(i);
101
- for (const i of t)
102
- q.has(i) || s.push({ id: i, account: String(i), name: String(i) });
136
+ const { items: t } = await ne.page({ page: 1, pageSize: 200 }), a = t.filter((p) => e.includes(p.id)), I = new Set(a.map((p) => p.id));
137
+ for (const p of a) o.push(p);
138
+ for (const p of e)
139
+ I.has(p) || o.push({ id: p, account: String(p), name: String(p) });
103
140
  } catch {
104
- for (const e of t) s.push({ id: e, account: String(e), name: String(e) });
141
+ for (const t of e) o.push({ id: t, account: String(t), name: String(t) });
105
142
  }
106
143
  }
107
- async function le() {
108
- const t = s.map((e) => e.id);
109
- F("confirm", t);
144
+ async function ze() {
145
+ de(
146
+ "confirm",
147
+ o.map((e) => e.id)
148
+ );
110
149
  }
111
- return V({ open: te }), (t, e) => (f(), _(we, {
112
- show: z.value,
113
- "onUpdate:show": e[4] || (e[4] = (a) => z.value = a),
114
- variant: H.value,
115
- title: l(n)("userPicker.title"),
116
- width: 1100,
117
- "on-confirm": le,
118
- "confirm-text": l(n)("common.confirm")
150
+ return ce({ open: Ce }), (e, t) => (i(), w(Oe, {
151
+ show: M.value,
152
+ "onUpdate:show": t[4] || (t[4] = (a) => M.value = a),
153
+ variant: me.value,
154
+ title: s(l)("userPicker.title"),
155
+ width: 920,
156
+ "on-confirm": ze,
157
+ "confirm-text": s(l)("common.confirm")
119
158
  }, {
120
- default: h(() => [
121
- d.value ? (f(), _(l(de), {
159
+ default: f(() => [
160
+ g.value ? (i(), w(s(Te), {
122
161
  key: 0,
123
- value: k.value,
124
- "onUpdate:value": e[0] || (e[0] = (a) => k.value = a),
162
+ value: x.value,
163
+ "onUpdate:value": t[0] || (t[0] = (a) => x.value = a),
125
164
  type: "segment",
126
165
  animated: "",
127
166
  class: "picker-tabs"
128
167
  }, {
129
- default: h(() => [
130
- u(l(L), { name: "users" }, {
131
- default: h(() => [
132
- g(o(l(n)("userPicker.available")), 1)
168
+ default: f(() => [
169
+ c(s(ee), { name: "users" }, {
170
+ default: f(() => [
171
+ E(r(s(l)("userPicker.available")), 1)
133
172
  ]),
134
173
  _: 1
135
174
  }),
136
- u(l(L), { name: "selected" }, {
137
- default: h(() => [
138
- g(o(l(n)("userPicker.selected")) + "(" + o(s.length) + ")", 1)
175
+ c(s(ee), { name: "selected" }, {
176
+ default: f(() => [
177
+ E(r(s(l)("userPicker.selected")) + " " + r(o.length), 1)
139
178
  ]),
140
179
  _: 1
141
180
  })
142
181
  ]),
143
182
  _: 1
144
- }, 8, ["value"])) : b("", !0),
145
- r("div", {
146
- class: re(["user-picker", { "is-compact": d.value }])
183
+ }, 8, ["value"])) : h("", !0),
184
+ n("div", {
185
+ class: H(["user-picker", { "is-compact": g.value }])
147
186
  }, [
148
- d.value ? b("", !0) : (f(), C("div", Ce, [
149
- r("div", Ne, o(l(n)("org.title")), 1),
150
- u(l(pe), {
151
- data: I.value,
187
+ g.value ? h("", !0) : (i(), m("div", je, [
188
+ n("div", Ge, r(s(l)("userPicker.org")), 1),
189
+ c(s($e), {
190
+ data: q.value,
152
191
  "key-field": "id",
153
192
  "label-field": "name",
154
193
  "children-field": "children",
155
194
  selectable: "",
156
195
  "block-line": "",
157
196
  "default-expand-all": "",
158
- "selected-keys": c.value != null ? [c.value] : [],
159
- "onUpdate:selectedKeys": G
197
+ "selected-keys": [k.value ?? 0],
198
+ "onUpdate:selectedKeys": he
160
199
  }, null, 8, ["data", "selected-keys"])
161
200
  ])),
162
- A(r("div", Pe, [
163
- d.value ? (f(), _(l(me), {
201
+ R(n("div", He, [
202
+ g.value ? (i(), w(s(Ae), {
164
203
  key: 0,
165
- value: c.value ?? 0,
166
- options: I.value,
204
+ value: k.value ?? 0,
205
+ options: q.value,
167
206
  "key-field": "id",
168
207
  "label-field": "name",
169
208
  "children-field": "children",
170
209
  "default-expand-all": "",
171
210
  size: "large",
172
211
  class: "picker-org-select",
173
- "onUpdate:value": J
174
- }, null, 8, ["value", "options"])) : b("", !0),
175
- r("div", Ie, [
176
- r("span", null, o(l(n)("userPicker.available")), 1),
177
- u(l(S), {
178
- size: x.value,
212
+ "onUpdate:value": ge
213
+ }, null, 8, ["value", "options"])) : h("", !0),
214
+ n("div", Re, [
215
+ c(s(ae), {
216
+ value: P.value,
217
+ round: "",
218
+ clearable: "",
219
+ size: g.value ? "large" : "medium",
220
+ placeholder: ke.value,
221
+ class: "picker-search",
222
+ "onUpdate:value": ye
223
+ }, {
224
+ prefix: f(() => [
225
+ c(s(De), {
226
+ trigger: "click",
227
+ options: _e.value,
228
+ value: b.value,
229
+ onSelect: we
230
+ }, {
231
+ default: f(() => [
232
+ n("span", Ze, [
233
+ c(S, {
234
+ icon: "ph:magnifying-glass",
235
+ size: 15
236
+ }),
237
+ c(S, {
238
+ icon: "ph:caret-down",
239
+ size: 10
240
+ })
241
+ ])
242
+ ]),
243
+ _: 1
244
+ }, 8, ["options", "value"])
245
+ ]),
246
+ _: 1
247
+ }, 8, ["value", "size", "placeholder"]),
248
+ c(s(te), {
249
+ text: "",
179
250
  type: "primary",
180
- disabled: m.value.length === 0,
181
- onClick: Y
251
+ class: "page-toggle",
252
+ disabled: N.value.length === 0,
253
+ onClick: Pe
182
254
  }, {
183
- default: h(() => [
184
- g(o(l(n)("userPicker.addChecked")) + "(" + o(m.value.length) + ") ", 1)
255
+ default: f(() => [
256
+ E(r(G.value ? s(l)("userPicker.unselectPage") : s(l)("userPicker.selectPage")), 1)
185
257
  ]),
186
258
  _: 1
187
- }, 8, ["size", "disabled"])
259
+ }, 8, ["disabled"])
188
260
  ]),
189
- u(l(he), {
190
- "default-page-size": 100,
191
- ref_key: "tableRef",
192
- ref: y,
193
- columns: X,
194
- fetcher: Q,
195
- search: { container: "table" },
196
- pagination: { pageSize: 10 },
261
+ c(s(Be), {
262
+ show: U.value,
197
263
  size: "small",
198
- "storage-key": "user-picker",
199
- "tool-button": !1,
200
- "checked-row-keys": m.value,
201
- "onUpdate:checkedRowKeys": e[1] || (e[1] = (a) => m.value = a),
202
- onError: e[2] || (e[2] = (a) => l(M).error(l(ze)(a)))
203
- }, null, 8, ["checked-row-keys"])
264
+ class: "picker-spin"
265
+ }, {
266
+ default: f(() => [
267
+ n("div", Je, [
268
+ (i(!0), m(Z, null, J(y.value, (a) => (i(), m("div", {
269
+ key: a.id,
270
+ class: H(["user-row", {
271
+ "is-selected": z.value.has(a.id),
272
+ "is-disabled": _.value.has(a.id)
273
+ }]),
274
+ role: "checkbox",
275
+ "aria-checked": z.value.has(a.id) ? "true" : "false",
276
+ "aria-disabled": _.value.has(a.id) ? "true" : void 0,
277
+ tabindex: _.value.has(a.id) ? -1 : 0,
278
+ onClick: (I) => O(a),
279
+ onKeydown: [
280
+ Q(X((I) => O(a), ["prevent"]), ["enter"]),
281
+ Q(X((I) => O(a), ["prevent"]), ["space"])
282
+ ]
283
+ }, [
284
+ c(le, {
285
+ name: a.name,
286
+ src: a.avatar,
287
+ size: 32
288
+ }, null, 8, ["name", "src"]),
289
+ n("span", Xe, [
290
+ n("span", Ye, r(a.name), 1),
291
+ B(a) ? (i(), m("span", ea, r(B(a)), 1)) : h("", !0)
292
+ ]),
293
+ _.value.has(a.id) ? (i(), m("span", aa, r(s(l)("userPicker.existing")), 1)) : (i(), m("span", ta, [
294
+ c(S, {
295
+ icon: "ph:check-bold",
296
+ size: 12
297
+ })
298
+ ]))
299
+ ], 42, Qe))), 128)),
300
+ !U.value && y.value.length === 0 ? (i(), w(s(se), {
301
+ key: 0,
302
+ description: s(l)("common.noData"),
303
+ class: "user-empty"
304
+ }, null, 8, ["description"])) : h("", !0)
305
+ ])
306
+ ]),
307
+ _: 1
308
+ }, 8, ["show"]),
309
+ n("div", sa, [
310
+ n("span", la, r(s(l)("userPicker.total", { n: C.value })), 1),
311
+ $.value > 1 ? (i(), m("div", na, [
312
+ n("button", {
313
+ type: "button",
314
+ class: "pager-btn pager-prev",
315
+ disabled: v.value <= 1,
316
+ "aria-label": s(l)("userPicker.prevPage"),
317
+ onClick: t[1] || (t[1] = (a) => W(v.value - 1))
318
+ }, [
319
+ c(S, {
320
+ icon: "ph:caret-left",
321
+ size: 14
322
+ })
323
+ ], 8, oa),
324
+ n("span", ia, r(v.value) + " / " + r($.value), 1),
325
+ n("button", {
326
+ type: "button",
327
+ class: "pager-btn pager-next",
328
+ disabled: v.value >= $.value,
329
+ "aria-label": s(l)("userPicker.nextPage"),
330
+ onClick: t[2] || (t[2] = (a) => W(v.value + 1))
331
+ }, [
332
+ c(S, {
333
+ icon: "ph:caret-right",
334
+ size: 14
335
+ })
336
+ ], 8, ca)
337
+ ])) : h("", !0)
338
+ ])
204
339
  ], 512), [
205
- [K, !d.value || k.value === "users"]
340
+ [Y, !g.value || x.value === "users"]
206
341
  ]),
207
- A(r("div", Te, [
208
- r("div", Ue, [
209
- r("span", null, o(l(n)("userPicker.selected")) + "(" + o(s.length) + ")", 1),
210
- u(l(S), {
211
- size: x.value,
212
- quaternary: "",
342
+ R(n("div", ra, [
343
+ n("div", ua, [
344
+ n("span", da, [
345
+ E(r(s(l)("userPicker.selected")) + " ", 1),
346
+ n("span", va, r(o.length), 1)
347
+ ]),
348
+ c(s(te), {
349
+ text: "",
213
350
  type: "error",
214
- disabled: s.length === 0,
215
- onClick: ee
351
+ class: "selected-clear",
352
+ disabled: o.length === 0,
353
+ onClick: xe
216
354
  }, {
217
- default: h(() => [
218
- g(o(l(n)("userPicker.clear")), 1)
355
+ default: f(() => [
356
+ E(r(s(l)("userPicker.clear")), 1)
219
357
  ]),
220
358
  _: 1
221
- }, 8, ["size", "disabled"])
359
+ }, 8, ["disabled"])
222
360
  ]),
223
- u(l(ve), {
224
- value: w.value,
225
- "onUpdate:value": e[3] || (e[3] = (a) => w.value = a),
226
- size: d.value ? "large" : "small",
361
+ o.length > ka ? (i(), w(s(ae), {
362
+ key: 0,
363
+ value: D.value,
364
+ "onUpdate:value": t[3] || (t[3] = (a) => D.value = a),
365
+ round: "",
227
366
  clearable: "",
228
- placeholder: l(n)("common.search"),
229
- style: { "margin-bottom": "8px" }
230
- }, null, 8, ["value", "size", "placeholder"]),
231
- r("div", Ee, [
232
- (f(!0), C(ie, null, ce(E.value, (a) => (f(), C("div", {
367
+ size: g.value ? "large" : "small",
368
+ placeholder: s(l)("common.search"),
369
+ class: "selected-search"
370
+ }, null, 8, ["value", "size", "placeholder"])) : h("", !0),
371
+ n("div", pa, [
372
+ (i(!0), m(Z, null, J(Se.value, (a) => (i(), m("div", {
233
373
  key: a.id,
234
374
  class: "selected-item"
235
375
  }, [
236
- r("span", Be, [
237
- g(o(a.name) + " ", 1),
238
- r("span", qe, "(" + o(a.account) + ")", 1)
376
+ c(le, {
377
+ name: a.name,
378
+ src: a.avatar,
379
+ size: 28
380
+ }, null, 8, ["name", "src"]),
381
+ n("span", ma, [
382
+ n("span", fa, r(a.name), 1),
383
+ B(a) ? (i(), m("span", ha, r(B(a)), 1)) : h("", !0)
239
384
  ]),
240
- u(l(S), {
241
- size: x.value,
242
- quaternary: "",
243
- type: "error",
244
- onClick: (q) => Z(a.id)
245
- }, {
246
- icon: h(() => [
247
- u(ye, {
248
- icon: "ph:x",
249
- size: 14
250
- })
251
- ]),
252
- _: 1
253
- }, 8, ["size", "onClick"])
385
+ n("button", {
386
+ type: "button",
387
+ class: "item-remove",
388
+ "aria-label": s(l)("userPicker.remove"),
389
+ onClick: (I) => L(a.id)
390
+ }, [
391
+ c(S, {
392
+ icon: "ph:x",
393
+ size: 12
394
+ })
395
+ ], 8, ga)
254
396
  ]))), 128)),
255
- E.value.length === 0 ? (f(), _(l(fe), {
397
+ o.length === 0 ? (i(), w(s(se), {
256
398
  key: 0,
257
- description: l(n)("common.noData"),
258
- style: { padding: "24px 0" }
259
- }, null, 8, ["description"])) : b("", !0)
399
+ description: s(l)("userPicker.emptySelected"),
400
+ class: "user-empty"
401
+ }, null, 8, ["description"])) : h("", !0)
260
402
  ])
261
403
  ], 512), [
262
- [K, !d.value || k.value === "selected"]
404
+ [Y, !g.value || x.value === "selected"]
263
405
  ])
264
406
  ], 2)
265
407
  ]),
@@ -268,6 +410,6 @@ const Ce = {
268
410
  }
269
411
  });
270
412
  export {
271
- Ge as default
413
+ Ua as default
272
414
  };
273
415
  //# sourceMappingURL=index2.vue.js.map