@king-one/antdv 1.2.22 → 1.2.23

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 (29) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/es/components/dept-selector/src/dept.mjs +51 -51
  3. package/dist/es/components/dept-selector/src/types.mjs +3 -1
  4. package/dist/es/components/pro-selector/index.mjs +5 -4
  5. package/dist/es/components/pro-selector/src/pro-user.mjs +49 -55
  6. package/dist/es/components/pro-selector/src/types.mjs +12 -5
  7. package/dist/es/components/role-selector/src/role.mjs +19 -19
  8. package/dist/es/components/role-selector/src/types.mjs +5 -3
  9. package/dist/es/index.mjs +33 -32
  10. package/dist/lib/components/dept-selector/src/dept.js +1 -1
  11. package/dist/lib/components/dept-selector/src/types.js +1 -1
  12. package/dist/lib/components/pro-selector/index.js +1 -1
  13. package/dist/lib/components/pro-selector/src/pro-user.js +1 -1
  14. package/dist/lib/components/pro-selector/src/types.js +1 -1
  15. package/dist/lib/components/role-selector/src/role.js +1 -1
  16. package/dist/lib/components/role-selector/src/types.js +1 -1
  17. package/dist/lib/index.js +1 -1
  18. package/dist/theme-chalk/icon.css +1 -1
  19. package/dist/theme-chalk/index.css +1 -1
  20. package/dist/types/components/dept-selector/index.d.ts +4 -0
  21. package/dist/types/components/dept-selector/src/dept.d.ts +4 -0
  22. package/dist/types/components/dept-selector/src/types.d.ts +2 -0
  23. package/dist/types/components/pro-selector/index.d.ts +5 -5
  24. package/dist/types/components/pro-selector/src/pro-user.d.ts +5 -5
  25. package/dist/types/components/pro-selector/src/types.d.ts +8 -0
  26. package/dist/types/components/role-selector/index.d.ts +8 -0
  27. package/dist/types/components/role-selector/src/role.d.ts +4 -0
  28. package/dist/types/components/role-selector/src/types.d.ts +2 -0
  29. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.2.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 选择器增加确认与取消事件
8
+
3
9
  ## 1.2.22
4
10
 
5
11
  ### Patch Changes
@@ -5,20 +5,20 @@ import { message as W, FormItemRest as X, InputSearch as Y, Tree as Z, Empty as
5
5
  import { GET_DEPT_TREE_URL as le, deptSelectorEmits as te, deptSelectorProps as ae } from "./types.mjs";
6
6
  import { KProModal as ne } from "../../pro-modal/index.mjs";
7
7
  import { KIcon as P } from "../../icon/index.mjs";
8
- const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
8
+ const f = Q("dept-selector"), ve = /* @__PURE__ */ H({
9
9
  name: "KDeptSelector",
10
10
  props: ae,
11
11
  emits: te,
12
12
  setup(t, {
13
- emit: m,
13
+ emit: h,
14
14
  attrs: V,
15
15
  slots: g
16
16
  }) {
17
- const x = s(!0), w = s(!0), y = s([]), f = s([]), d = s([]), A = s(!1), u = s(t.isBuiltInRequest ? {
17
+ const x = s(!0), w = s(!0), y = s([]), m = s([]), r = s([]), A = s(!1), u = s(t.isBuiltInRequest ? {
18
18
  children: "children",
19
19
  title: "deptName",
20
20
  key: "id"
21
- } : t.fieldNames), b = s(""), o = s([]), v = s(t.treeData), E = s(!1), p = s("");
21
+ } : t.fieldNames), b = s(""), d = s([]), v = s(t.treeData), E = s(!1), p = s("");
22
22
  if (t.isBuiltInRequest) {
23
23
  if (!t.http)
24
24
  throw new Error("请传入http实例");
@@ -30,19 +30,19 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
30
30
  if (t.type === "checkbox") {
31
31
  if (!Array.isArray(t.modelValue)) return;
32
32
  const e = t.modelValue.map((l) => l[u.value.key]);
33
- x.value ? d.value = {
33
+ x.value ? r.value = {
34
34
  checked: e,
35
35
  halfChecked: []
36
- } : d.value = e, y.value = e;
36
+ } : r.value = e, y.value = e;
37
37
  } else {
38
38
  if (Array.isArray(t.modelValue)) return;
39
39
  const e = t.modelValue[u.value.key];
40
- f.value = [e], y.value = [e];
40
+ m.value = [e], y.value = [e];
41
41
  }
42
42
  }, I = (e) => {
43
43
  if (E.value)
44
44
  return E.value = !1;
45
- t.type === "radio" ? o.value.length > 0 && (b.value = o.value[0][u.value.title] || "") : b.value = o.value.map((l) => l[u.value.title]).join(",");
45
+ t.type === "radio" ? d.value.length > 0 && (b.value = d.value[0][u.value.title] || "") : b.value = d.value.map((l) => l[u.value.title]).join(",");
46
46
  };
47
47
  k(() => t.visible, () => {
48
48
  t.visible && N();
@@ -60,12 +60,12 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
60
60
  deep: !0
61
61
  });
62
62
  function R(e) {
63
- const l = (i, r) => {
63
+ const l = (i, o) => {
64
64
  for (const a of i) {
65
- if (a[u.value.key] === r)
65
+ if (a[u.value.key] === o)
66
66
  return a;
67
67
  if (a.children && a.children.length) {
68
- const c = l(a.children, r);
68
+ const c = l(a.children, o);
69
69
  if (c) return c;
70
70
  }
71
71
  }
@@ -76,13 +76,13 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
76
76
  function D(e) {
77
77
  return e ? e.map((l) => R(l)).filter(Boolean) : [];
78
78
  }
79
- k(d, () => {
80
- t.type === "checkbox" && (x.value ? o.value = D(d.value.checked) : o.value = D(d.value), I("watch checkedKeys..."));
79
+ k(r, () => {
80
+ t.type === "checkbox" && (x.value ? d.value = D(r.value.checked) : d.value = D(r.value), I("watch checkedKeys..."));
81
81
  }, {
82
82
  immediate: !0,
83
83
  deep: !0
84
- }), k(f, () => {
85
- t.type === "radio" && (o.value = D(f.value), I("watch selectedKeys..."));
84
+ }), k(m, () => {
85
+ t.type === "radio" && (d.value = D(m.value), I("watch selectedKeys..."));
86
86
  }, {
87
87
  immediate: !0,
88
88
  deep: !0
@@ -94,34 +94,34 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
94
94
  }, B = () => {
95
95
  E.value = !0;
96
96
  }, O = () => {
97
- m("update:visible", !1);
97
+ h("update:visible", !1), h("cancel");
98
98
  }, F = () => {
99
- if (!o.value.length) {
99
+ if (!d.value.length) {
100
100
  W.warn("请选择部门");
101
101
  return;
102
102
  }
103
- t.type === "radio" ? m("update:modelValue", {
104
- [u.value.key]: f.value[0],
105
- [u.value.title]: o.value[0][u.value.title]
106
- }) : m("update:modelValue", o.value.map((e) => ({
103
+ t.type === "radio" ? h("update:modelValue", {
104
+ [u.value.key]: m.value[0],
105
+ [u.value.title]: d.value[0][u.value.title]
106
+ }) : h("update:modelValue", d.value.map((e) => ({
107
107
  [u.value.key]: e[u.value.key],
108
108
  [u.value.title]: e[u.value.title]
109
- }))), m("update:visible", !1), I("handleConfirm ...");
109
+ }))), h("update:visible", !1), h("confirm", d.value), I("handleConfirm ...");
110
110
  }, M = (e) => {
111
111
  if (E.value = !0, t.type === "radio")
112
- return o.value = [], f.value = [], !1;
112
+ return d.value = [], m.value = [], !1;
113
113
  if (x.value)
114
- d.value.checked = d.value.checked.filter((l) => l !== e[u.value.key]);
114
+ r.value.checked = r.value.checked.filter((l) => l !== e[u.value.key]);
115
115
  else {
116
- const l = e.parentId, i = d.value.indexOf(l);
117
- i !== -1 && d.value.splice(i, 1), d.value = d.value.filter((a) => a !== e[u.value.key]), L(e.children).forEach((a) => {
118
- const c = d.value.indexOf(a);
119
- c !== -1 && d.value.splice(c, 1);
116
+ const l = e.parentId, i = r.value.indexOf(l);
117
+ i !== -1 && r.value.splice(i, 1), r.value = r.value.filter((a) => a !== e[u.value.key]), L(e.children).forEach((a) => {
118
+ const c = r.value.indexOf(a);
119
+ c !== -1 && r.value.splice(c, 1);
120
120
  });
121
121
  }
122
122
  }, L = (e) => {
123
- const l = [], i = (r) => {
124
- for (const a of r)
123
+ const l = [], i = (o) => {
124
+ for (const a of o)
125
125
  l.push(a[u.value.key]), a.children && a.children.length && i(a.children);
126
126
  };
127
127
  return i(e), l;
@@ -138,12 +138,12 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
138
138
  onOnConfirm: F
139
139
  }, {
140
140
  default: () => [n("div", {
141
- class: h.e("modal-content")
141
+ class: f.e("modal-content")
142
142
  }, [$(), j()], 2)]
143
143
  }, 8, ["modelValue", "modalProps", "onOnCancel", "onOnConfirm"])]), K = (e, l) => {
144
144
  let i;
145
- for (let r = 0; r < l.length; r++) {
146
- const a = l[r];
145
+ for (let o = 0; o < l.length; o++) {
146
+ const a = l[o];
147
147
  if (a.children)
148
148
  if (a.children.some((c) => c[u.value.key] === e)) {
149
149
  i = a[u.value.key];
@@ -156,8 +156,8 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
156
156
  y.value = [], p.value = "", w.value = !0;
157
157
  return;
158
158
  }
159
- const l = /* @__PURE__ */ new Set(), i = (r, a) => {
160
- r.forEach((c) => {
159
+ const l = /* @__PURE__ */ new Set(), i = (o, a) => {
160
+ o.forEach((c) => {
161
161
  var U;
162
162
  if ((U = c[u.value.title]) != null && U.includes(a)) {
163
163
  let S = K(c[u.value.key], v.value);
@@ -176,12 +176,12 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
176
176
  const i = l.indexOf(p.value);
177
177
  if (i === -1)
178
178
  return n("span", null, [l]);
179
- const r = l.substring(0, i), a = l.substring(i, i + p.value.length), c = l.substring(i + p.value.length);
180
- return n("span", null, [r, n("span", {
179
+ const o = l.substring(0, i), a = l.substring(i, i + p.value.length), c = l.substring(i + p.value.length);
180
+ return n("span", null, [o, n("span", {
181
181
  style: "color: #f50; font-weight: bold"
182
182
  }, [a]), c]);
183
183
  }, $ = () => n("div", {
184
- class: h.e("modal-content-left")
184
+ class: f.e("modal-content-left")
185
185
  }, [n(X, null, {
186
186
  default: () => [n(Y, {
187
187
  placeholder: "请输入部门名称",
@@ -194,10 +194,10 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
194
194
  }), v.value.length > 0 ? n(Z, {
195
195
  expandedKeys: y.value,
196
196
  "onUpdate:expandedKeys": (e) => y.value = e,
197
- selectedKeys: f.value,
198
- "onUpdate:selectedKeys": (e) => f.value = e,
199
- checkedKeys: d.value,
200
- "onUpdate:checkedKeys": (e) => d.value = e,
197
+ selectedKeys: m.value,
198
+ "onUpdate:selectedKeys": (e) => m.value = e,
199
+ checkedKeys: r.value,
200
+ "onUpdate:checkedKeys": (e) => r.value = e,
201
201
  checkable: t.type === "checkbox",
202
202
  checkStrictly: x.value,
203
203
  "show-icon": !0,
@@ -209,7 +209,7 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
209
209
  "tree-data": v.value,
210
210
  onCheck: _,
211
211
  onSelect: B,
212
- class: h.e("modal-content-left-tree")
212
+ class: f.e("modal-content-left-tree")
213
213
  }, {
214
214
  icon: (e) => T(e),
215
215
  title: G,
@@ -221,13 +221,13 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
221
221
  name: e.parentId === "0" ? "qiye" : "bumen",
222
222
  size: 16
223
223
  }, null, 8, ["name"]), j = () => n("div", {
224
- class: h.e("modal-content-right")
225
- }, [o.value.length > 0 ? o.value.map((e) => n("div", {
226
- class: h.e("modal-content-right-item")
224
+ class: f.e("modal-content-right")
225
+ }, [d.value.length > 0 ? d.value.map((e) => n("div", {
226
+ class: f.e("modal-content-right-item")
227
227
  }, [n("div", {
228
- class: h.e("modal-content-right-item-label")
228
+ class: f.e("modal-content-right-item-label")
229
229
  }, [T(e), n("span", null, [e[u.value.title]])], 2), n("div", {
230
- class: h.e("modal-content-right-item-del"),
230
+ class: f.e("modal-content-right-item-del"),
231
231
  onClick: () => M(e)
232
232
  }, [n(P, {
233
233
  name: "shanchu",
@@ -239,17 +239,17 @@ const h = Q("dept-selector"), ve = /* @__PURE__ */ H({
239
239
  return () => {
240
240
  var e;
241
241
  return n("div", {
242
- class: h.b()
242
+ class: f.b()
243
243
  }, [(e = g.default) != null && e.call(g) ? g.default() : n("div", null, [n(ee, {
244
244
  style: "width: 100%;",
245
245
  readonly: !0,
246
246
  value: b.value,
247
247
  "onUpdate:value": (l) => b.value = l,
248
- onClick: () => m("update:visible", !0),
248
+ onClick: () => h("update:visible", !0),
249
249
  placeholder: "请选择部门"
250
250
  }, {
251
251
  suffix: () => n("div", {
252
- onClick: () => m("update:visible", !0)
252
+ onClick: () => h("update:visible", !0)
253
253
  }, [n(P, {
254
254
  style: {
255
255
  cursor: "pointer"
@@ -42,7 +42,9 @@ const t = {
42
42
  prefix: String
43
43
  }, l = "/security/dept/company/tree", a = {
44
44
  "update:visible": (e) => !0,
45
- "update:modelValue": (e) => !0
45
+ "update:modelValue": (e) => !0,
46
+ confirm: (e) => !0,
47
+ cancel: () => !0
46
48
  };
47
49
  export {
48
50
  l as GET_DEPT_TREE_URL,
@@ -1,14 +1,15 @@
1
1
  import { withInstall as r } from "../utils/install.mjs";
2
2
  import e from "./src/pro-user.mjs";
3
3
  import "./style/index.mjs";
4
- import { GTE_ORGTREE_URL as l, UserSelectorProps as E, selectUserContextKey as R } from "./src/types.mjs";
4
+ import { GTE_ORGTREE_URL as l, UserSelectorProps as E, selectUserContextKey as R, userSelectorEmits as U } from "./src/types.mjs";
5
5
  import "./src/hooks/index.mjs";
6
6
  e.GTE_ORGTREE_URL = "/security/dept/user/tree";
7
- const m = r(e);
7
+ const p = r(e);
8
8
  export {
9
9
  l as GTE_ORGTREE_URL,
10
- m as KUserSelector,
10
+ p as KUserSelector,
11
11
  e as ProUserSelector,
12
12
  E as UserSelectorProps,
13
- R as selectUserContextKey
13
+ R as selectUserContextKey,
14
+ U as userSelectorEmits
14
15
  };
@@ -1,91 +1,85 @@
1
- import { defineComponent as O, ref as n, provide as S, reactive as T, watch as U, nextTick as g, createVNode as l, createTextVNode as v } from "vue";
1
+ import { defineComponent as L, ref as n, provide as O, reactive as T, watch as U, nextTick as g, createVNode as l, createTextVNode as v } from "vue";
2
2
  import "../../index.mjs";
3
3
  import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
4
4
  import { message as w, Input as R, Empty as x, FormItemRest as B } from "ant-design-vue";
5
- import { selectUserContextKey as M, UserSelectorProps as z } from "./types.mjs";
6
- import A from "./components/org-tree.mjs";
7
- import K from "./components/user.mjs";
8
- import { KProModal as F } from "../../pro-modal/index.mjs";
5
+ import { selectUserContextKey as M, userSelectorEmits as z, UserSelectorProps as A } from "./types.mjs";
6
+ import K from "./components/org-tree.mjs";
7
+ import F from "./components/user.mjs";
8
+ import { KProModal as _ } from "../../pro-modal/index.mjs";
9
9
  import { KIcon as f } from "../../icon/index.mjs";
10
- import { KUserAvatar as _ } from "../../pro-user-avatar/index.mjs";
10
+ import { KUserAvatar as q } from "../../pro-user-avatar/index.mjs";
11
11
  const {
12
12
  b: u
13
- } = D("pro-user-selector"), i = D("user-selector-extermal"), $ = /* @__PURE__ */ O({
13
+ } = D("pro-user-selector"), i = D("user-selector-extermal"), ee = /* @__PURE__ */ L({
14
14
  name: "ProUserSelector",
15
- props: z,
16
- emits: {
17
- "update:visible": (a) => !0,
18
- "update:modelValue": (a) => !0,
19
- "delete-user": (a) => !0,
20
- confirm: (a) => !0,
21
- cancel: () => !0
22
- },
23
- setup(a, {
15
+ props: A,
16
+ emits: z,
17
+ setup(t, {
24
18
  emit: s,
25
19
  slots: p,
26
- expose: V,
27
- attrs: b
20
+ expose: E,
21
+ attrs: V
28
22
  }) {
29
23
  const d = n(""), r = n([]), o = n(), c = n(null);
30
- S(M, T({
31
- maxCount: a.maxCount,
32
- http: a.http,
33
- isBuiltInRequest: a.isBuiltInRequest,
34
- prefix: a.prefix,
35
- initData: a.initData
24
+ O(M, T({
25
+ maxCount: t.maxCount,
26
+ http: t.http,
27
+ isBuiltInRequest: t.isBuiltInRequest,
28
+ prefix: t.prefix,
29
+ initData: t.initData
36
30
  }));
37
- const h = n(a.modelValue || []), m = n(!1);
38
- U(() => a.modelValue, (e) => {
31
+ const h = n(t.modelValue || []), m = n(!1);
32
+ U(() => t.modelValue, (e) => {
39
33
  m.value ? m.value = !1 : (h.value = JSON.parse(JSON.stringify(e)), g(() => {
40
- E(h.value);
34
+ k(h.value);
41
35
  }));
42
36
  }, {
43
37
  deep: !0,
44
38
  immediate: !0
45
- }), U(r, (e, t) => {
46
- e.length > t.length && g(() => {
39
+ }), U(r, (e, a) => {
40
+ e.length > a.length && g(() => {
47
41
  c.value && (c.value.scrollTop = c.value.scrollHeight);
48
42
  });
49
43
  }, {
50
44
  deep: !0
51
45
  });
52
- async function E(e) {
46
+ async function k(e) {
53
47
  if (o.value) {
54
- const t = await o.value.dataLoadPromise;
55
- o.value.getInitData(e, t);
48
+ const a = await o.value.dataLoadPromise;
49
+ o.value.getInitData(e, a);
56
50
  }
57
51
  }
58
- const k = (e) => {
59
- var t;
60
- r.value = r.value.filter((L) => L.id !== e), (t = o.value) == null || t.deleteDeptUser(e);
61
- }, I = () => {
52
+ const I = (e) => {
53
+ var a;
54
+ r.value = r.value.filter((y) => y.id !== e), (a = o.value) == null || a.deleteDeptUser(e);
55
+ }, b = () => {
62
56
  s("update:visible", !1), s("cancel");
63
57
  }, C = (e) => {
64
- s("update:modelValue", a.modelValue.filter((t) => t.id !== e));
58
+ s("update:modelValue", t.modelValue.filter((a) => a.id !== e));
65
59
  }, N = () => {
66
60
  if (r.value.length === 0) {
67
61
  w.warn("请选择用户");
68
62
  return;
69
63
  }
70
- const e = r.value.map((t) => ({
71
- id: t.id,
72
- realName: t.realName || "",
73
- avatar: t.avatar
64
+ const e = r.value.map((a) => ({
65
+ id: a.id,
66
+ realName: a.realName || "",
67
+ avatar: a.avatar
74
68
  }));
75
69
  s("update:visible", !1), m.value = !0, s("update:modelValue", e), s("confirm", e);
76
70
  };
77
- V({
71
+ E({
78
72
  deleteCheckedUser: C
79
73
  });
80
- const P = () => l(F, {
81
- modelValue: a.visible,
74
+ const P = () => l(_, {
75
+ modelValue: t.visible,
82
76
  title: "选择联系人",
83
77
  modalProps: {
84
78
  cancelText: "取消",
85
79
  okText: "确定",
86
- ...b
80
+ ...V
87
81
  },
88
- onOnCancel: () => I(),
82
+ onOnCancel: () => b(),
89
83
  onOnConfirm: () => N()
90
84
  }, {
91
85
  default: () => [l("div", {
@@ -105,7 +99,7 @@ const {
105
99
  name: "search"
106
100
  }, null),
107
101
  _: 1
108
- }, 8, ["value", "onUpdate:value", "allowClear"])]), l(A, {
102
+ }, 8, ["value", "onUpdate:value", "allowClear"])]), l(K, {
109
103
  ref: o,
110
104
  selectUserList: r.value,
111
105
  "onUpdate:selectUserList": (e) => r.value = e,
@@ -114,22 +108,22 @@ const {
114
108
  class: u("content-right")
115
109
  }, [l("div", {
116
110
  class: u("content-right-title")
117
- }, [v("已选:"), r.value.length, v("/"), a.maxCount, v("人")], 2), l("div", {
111
+ }, [v("已选:"), r.value.length, v("/"), t.maxCount, v("人")], 2), l("div", {
118
112
  class: "select-user-list",
119
113
  ref: c
120
114
  }, [l("div", {
121
115
  class: u("user-list")
122
- }, [r.value.length > 0 ? r.value.map((e) => l(K, {
116
+ }, [r.value.length > 0 ? r.value.map((e) => l(F, {
123
117
  key: e.id,
124
118
  userInfo: e,
125
119
  isChecked: !1,
126
120
  isDelete: !0,
127
- "onDelete-user": k
121
+ "onDelete-user": I
128
122
  }, null, 8, ["userInfo", "isDelete", "onDelete-user"])) : l(x, {
129
123
  image: x.PRESENTED_IMAGE_SIMPLE,
130
124
  description: "暂无数据"
131
125
  }, null, 8, ["image"])], 2)], 512)], 2)], 2)]
132
- }, 8, ["modelValue", "modalProps", "onOnCancel", "onOnConfirm"]), y = () => l(B, null, {
126
+ }, 8, ["modelValue", "modalProps", "onOnCancel", "onOnConfirm"]), S = () => l(B, null, {
133
127
  default: () => [l("div", {
134
128
  class: i.b()
135
129
  }, [p.default ? p.default() : l("div", {
@@ -141,9 +135,9 @@ const {
141
135
  name: "plus",
142
136
  size: 20,
143
137
  color: "#409eff"
144
- }, null)], 10, ["onClick"]), a.modelValue.map((e) => l("div", {
138
+ }, null)], 10, ["onClick"]), t.modelValue.map((e) => l("div", {
145
139
  class: i.b("item")
146
- }, [l(_, {
140
+ }, [l(q, {
147
141
  name: e.realName,
148
142
  avatar: e.avatar,
149
143
  size: "small"
@@ -157,9 +151,9 @@ const {
157
151
  color: "#646a73"
158
152
  }, null)], 8, ["onClick"])], 2))], 2), P()], 2)]
159
153
  });
160
- return () => y();
154
+ return () => S();
161
155
  }
162
156
  });
163
157
  export {
164
- $ as default
158
+ ee as default
165
159
  };
@@ -1,4 +1,4 @@
1
- const e = Symbol("selectUserContextKey"), t = {
1
+ const t = Symbol("selectUserContextKey"), l = {
2
2
  visible: {
3
3
  type: Boolean,
4
4
  default: !1
@@ -34,9 +34,16 @@ const e = Symbol("selectUserContextKey"), t = {
34
34
  default: !1
35
35
  },
36
36
  prefix: String
37
- }, l = "/security/dept/user/tree";
37
+ }, u = "/security/dept/user/tree", r = {
38
+ "update:visible": (e) => !0,
39
+ "update:modelValue": (e) => !0,
40
+ "delete-user": (e) => !0,
41
+ confirm: (e) => !0,
42
+ cancel: () => !0
43
+ };
38
44
  export {
39
- l as GTE_ORGTREE_URL,
40
- t as UserSelectorProps,
41
- e as selectUserContextKey
45
+ u as GTE_ORGTREE_URL,
46
+ l as UserSelectorProps,
47
+ t as selectUserContextKey,
48
+ r as userSelectorEmits
42
49
  };
@@ -8,16 +8,16 @@ import { KProModal as $ } from "../../pro-modal/index.mjs";
8
8
  function g(t) {
9
9
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !x(t);
10
10
  }
11
- const i = j("role-selector"), ee = /* @__PURE__ */ O({
11
+ const r = j("role-selector"), ee = /* @__PURE__ */ O({
12
12
  name: "KRoleSelector",
13
13
  props: q,
14
14
  emits: K,
15
15
  setup(t, {
16
- emit: s,
16
+ emit: i,
17
17
  attrs: w,
18
18
  slots: y
19
19
  }) {
20
- const u = d([]), b = d(""), n = d([]), r = d([]), v = d(""), c = d(!1);
20
+ const u = d([]), b = d(""), n = d([]), s = d([]), v = d(""), c = d(!1);
21
21
  if (t.isBuiltInRequest) {
22
22
  if (!t.http)
23
23
  throw new Error("请传入http实例");
@@ -49,7 +49,7 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
49
49
  const a = n.value.find((o) => o.value === u.value);
50
50
  a && e.push(a);
51
51
  }
52
- r.value = e;
52
+ s.value = e;
53
53
  }, C = () => {
54
54
  Array.isArray(t.modelValue) ? u.value = t.modelValue.map((e) => e.value) : u.value = t.modelValue.value;
55
55
  };
@@ -77,7 +77,7 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
77
77
  return (o = a.label) == null ? void 0 : o.includes(e);
78
78
  }) : n.value = [...t.options];
79
79
  }, k = () => {
80
- s("update:visible", !1);
80
+ i("update:visible", !1), i("cancel");
81
81
  }, V = () => {
82
82
  var e;
83
83
  if (t.type === "radio" && !u.value) {
@@ -88,28 +88,28 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
88
88
  R.warn("请选择角色");
89
89
  return;
90
90
  }
91
- Array.isArray(u.value) ? (v.value = r.value.map((a) => a.label).join(","), s("update:modelValue", r.value)) : (v.value = ((e = r.value[0]) == null ? void 0 : e.label) || "", s("update:modelValue", r.value[0])), c.value = !0, s("update:visible", !1);
91
+ Array.isArray(u.value) ? (v.value = s.value.map((a) => a.label).join(","), i("update:modelValue", s.value)) : (v.value = ((e = s.value[0]) == null ? void 0 : e.label) || "", i("update:modelValue", s.value[0])), c.value = !0, i("update:visible", !1), i("confirm", s.value);
92
92
  }, I = (e) => {
93
93
  Array.isArray(u.value) ? u.value = u.value.filter((a) => a !== e.value) : u.value = "";
94
94
  }, p = (e, a) => l("div", {
95
- class: [i.e("role-item"), a && i.is("active")]
95
+ class: [r.e("role-item"), a && r.is("active")]
96
96
  }, [l("div", {
97
- class: i.e("role-item-label")
97
+ class: r.e("role-item-label")
98
98
  }, [l(h, {
99
99
  name: "a-jiaoseguanli2",
100
100
  size: 18,
101
101
  color: "#606266"
102
102
  }, null), l("span", {
103
- class: i.e("label")
103
+ class: r.e("label")
104
104
  }, [e.label], 2)], 2), l("div", {
105
- class: i.e("role-item-del"),
105
+ class: r.e("role-item-del"),
106
106
  onClick: () => I(e)
107
107
  }, [a && l(h, {
108
108
  name: "shanchu",
109
109
  size: 18,
110
110
  color: "#606266"
111
111
  }, null)], 10, ["onClick"])], 2), _ = () => l("div", {
112
- class: i.b("left")
112
+ class: r.b("left")
113
113
  }, [l(D, {
114
114
  allowClear: !0,
115
115
  placeholder: "请输入角色名称",
@@ -117,7 +117,7 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
117
117
  "onUpdate:value": (e) => b.value = e,
118
118
  onSearch: A
119
119
  }, null, 8, ["allowClear", "value", "onUpdate:value", "onSearch"]), l("div", {
120
- class: i.e("role-list")
120
+ class: r.e("role-list")
121
121
  }, [n.value.length === 0 && l(m, {
122
122
  description: "暂无数据",
123
123
  image: m.PRESENTED_IMAGE_SIMPLE
@@ -156,10 +156,10 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
156
156
  }, 8, ["value"])]);
157
157
  })])]
158
158
  }, 8, ["value", "onUpdate:value"])], 2)], 2), U = () => l("div", {
159
- class: i.b("right")
160
- }, [r.value.map((e, a) => l("div", {
159
+ class: r.b("right")
160
+ }, [s.value.map((e, a) => l("div", {
161
161
  key: a
162
- }, [p(e, !0)])), r.value.length === 0 && l(m, {
162
+ }, [p(e, !0)])), s.value.length === 0 && l(m, {
163
163
  description: "暂无数据",
164
164
  image: m.PRESENTED_IMAGE_SIMPLE
165
165
  }, null, 8, ["image"])], 2), N = () => l("div", null, [l($, {
@@ -175,22 +175,22 @@ const i = j("role-selector"), ee = /* @__PURE__ */ O({
175
175
  onOnConfirm: () => V()
176
176
  }, {
177
177
  default: () => [l("div", {
178
- class: i.b("modal")
178
+ class: r.b("modal")
179
179
  }, [_(), U()], 2)]
180
180
  }, 8, ["modelValue", "modalProps", "onOnCancel", "onOnConfirm"])]);
181
181
  return () => l(L, null, {
182
182
  default: () => [l("div", {
183
- class: i.b()
183
+ class: r.b()
184
184
  }, [y.default ? y.default() : l(B, {
185
185
  style: "width: 100%;",
186
186
  readonly: !0,
187
187
  value: v.value,
188
188
  "onUpdate:value": (e) => v.value = e,
189
- onClick: () => s("update:visible", !0),
189
+ onClick: () => i("update:visible", !0),
190
190
  placeholder: "请选择角色"
191
191
  }, {
192
192
  suffix: () => l("div", {
193
- onClick: () => s("update:visible", !0)
193
+ onClick: () => i("update:visible", !0)
194
194
  }, [l(h, {
195
195
  style: {
196
196
  cursor: "pointer"
@@ -32,12 +32,14 @@ const t = {
32
32
  * 请求前缀,如 qy-user-service
33
33
  */
34
34
  prefix: String
35
- }, l = "/security/company/role/page?pageNum=1&pageSize=1000", o = {
35
+ }, l = "/security/company/role/page?pageNum=1&pageSize=1000", a = {
36
36
  "update:visible": (e) => !0,
37
- "update:modelValue": (e) => !0
37
+ "update:modelValue": (e) => !0,
38
+ confirm: (e) => !0,
39
+ cancel: () => !0
38
40
  };
39
41
  export {
40
42
  l as GTE_OPTIONS_URL,
41
- o as roleSelectorEmits,
43
+ a as roleSelectorEmits,
42
44
  t as roleSelectorProps
43
45
  };