@guodun/antdv 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/dept-selector/src/DeptSelector.vue.mjs +23 -30
- package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +22 -29
- package/dist/es/components/pro-selector/src/ProUserSelectorDrilldown.vue.mjs +7 -7
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +23 -28
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +2 -2
- package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +21 -28
- package/dist/es/components/selector-core/components/DepartmentTree.vue.mjs +10 -3
- package/dist/es/components/selector-core/components/RolePane.vue.mjs +1 -1
- package/dist/es/components/selector-core/components/SelectionChips.mjs +5 -0
- package/dist/es/components/selector-core/components/SelectionChips.vue.mjs +114 -0
- package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +113 -110
- package/dist/es/components/selector-core/useSelectorData.mjs +5 -1
- package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelectorDrilldown.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -1
- package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
- package/dist/lib/components/selector-core/components/DepartmentTree.vue.cjs +1 -1
- package/dist/lib/components/selector-core/components/RolePane.vue.cjs +1 -1
- package/dist/lib/components/selector-core/components/SelectionChips.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectionChips.vue.cjs +1 -0
- package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
- package/dist/lib/components/selector-core/useSelectorData.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-dynamic-tags.css +1 -1
- package/dist/theme/selector-core.css +1 -1
- package/dist/types/components/pro-dynamic-tags/src/index.vue.d.ts +2 -2
- package/dist/types/components/pro-selector/src/types.d.ts +1 -1
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +1 -1
- package/dist/types/components/selector-core/components/SelectionChips.vue.d.ts +16 -0
- package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -3
- package/dist/types/components/selector-core/model.d.ts +4 -0
- package/package.json +3 -3
- package/dist/theme/dept-selector.css +0 -1
- package/dist/theme/pro-selector-group.css +0 -1
- package/dist/theme/role-selector.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
import i from "../../selector-core/components/
|
|
1
|
+
import { defaultFieldNames as e, serializeDepartments as t, text as n } from "../../selector-core/model.mjs";
|
|
2
|
+
import r from "../../selector-core/components/SelectorDialog.mjs";
|
|
3
|
+
import i from "../../selector-core/components/SelectionChips.mjs";
|
|
4
4
|
import { deptSelectorEmits as a, deptSelectorProps as o } from "./types.mjs";
|
|
5
5
|
import { computed as s, createBlock as c, createCommentVNode as l, createElementVNode as u, createVNode as d, defineComponent as f, openBlock as p, renderSlot as m, unref as h, useAttrs as g, withCtx as _ } from "vue";
|
|
6
6
|
import { FormItemRest as v } from "ant-design-vue";
|
|
@@ -11,16 +11,12 @@ var y = { class: "gd-ant-dept-selector" }, b = /* @__PURE__ */ f({
|
|
|
11
11
|
props: o,
|
|
12
12
|
emits: a,
|
|
13
13
|
setup(a, { emit: o }) {
|
|
14
|
-
let f = a, b = o, x = g(), S = s(() => f.isBuiltInRequest ?
|
|
14
|
+
let f = a, b = o, x = g(), S = s(() => f.isBuiltInRequest ? e : f.fieldNames), C = s(() => (Array.isArray(f.modelValue) ? f.modelValue : f.modelValue ? [f.modelValue] : []).map((e) => ({
|
|
15
15
|
type: "dept",
|
|
16
|
-
value:
|
|
17
|
-
label:
|
|
16
|
+
value: n(e[S.value.key]),
|
|
17
|
+
label: n(e[S.value.title]),
|
|
18
18
|
raw: e
|
|
19
|
-
})).filter((e) => e.value)), w = s(() =>
|
|
20
|
-
label: e.label,
|
|
21
|
-
value: e.value,
|
|
22
|
-
closable: !0
|
|
23
|
-
}))), T = s(() => {
|
|
19
|
+
})).filter((e) => e.value)), w = s(() => {
|
|
24
20
|
let { modalProps: e, ...t } = x;
|
|
25
21
|
return {
|
|
26
22
|
cancelText: "取消",
|
|
@@ -29,34 +25,31 @@ var y = { class: "gd-ant-dept-selector" }, b = /* @__PURE__ */ f({
|
|
|
29
25
|
...e || {}
|
|
30
26
|
};
|
|
31
27
|
});
|
|
32
|
-
function
|
|
28
|
+
function T(e) {
|
|
33
29
|
b("update:visible", e === !0);
|
|
34
30
|
}
|
|
35
|
-
function
|
|
36
|
-
let { values:
|
|
31
|
+
function E(e) {
|
|
32
|
+
let { values: n, confirm: r } = t(e, S.value), i = f.type === "radio" ? n[0] || null : n;
|
|
37
33
|
b("update:visible", !1), b("update:modelValue", i), b("confirm", r);
|
|
38
34
|
}
|
|
39
|
-
function
|
|
35
|
+
function D() {
|
|
40
36
|
b("update:visible", !1), b("cancel");
|
|
41
37
|
}
|
|
42
|
-
function
|
|
38
|
+
function O(e) {
|
|
43
39
|
if (f.type === "radio") {
|
|
44
40
|
b("update:modelValue", null);
|
|
45
41
|
return;
|
|
46
42
|
}
|
|
47
43
|
b("update:modelValue", (Array.isArray(f.modelValue) ? f.modelValue : []).filter((t) => String(t[S.value.key]) !== e));
|
|
48
44
|
}
|
|
49
|
-
return (
|
|
50
|
-
default: _(() => [u("div", y, [f.hideSlot ? l("", !0) : m(
|
|
51
|
-
|
|
52
|
-
"max-count": f.maxVisibleCount,
|
|
53
|
-
"show-add": "",
|
|
45
|
+
return (e, t) => (p(), c(h(v), null, {
|
|
46
|
+
default: _(() => [u("div", y, [f.hideSlot ? l("", !0) : m(e.$slots, "default", { key: 0 }, () => [d(i, {
|
|
47
|
+
items: C.value,
|
|
48
|
+
"max-visible-count": f.maxVisibleCount,
|
|
54
49
|
"add-text": "选择部门",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onClose: n[1] ||= (e) => k(String(e.value))
|
|
59
|
-
}, null, 8, ["model-value", "max-count"])]), d(i, {
|
|
50
|
+
onAdd: t[0] ||= (e) => b("update:visible", !0),
|
|
51
|
+
onRemove: t[1] ||= (e) => O(e.value)
|
|
52
|
+
}, null, 8, ["items", "max-visible-count"])]), d(r, {
|
|
60
53
|
open: f.visible,
|
|
61
54
|
mode: "dept",
|
|
62
55
|
selected: C.value,
|
|
@@ -67,10 +60,10 @@ var y = { class: "gd-ant-dept-selector" }, b = /* @__PURE__ */ f({
|
|
|
67
60
|
http: f.http,
|
|
68
61
|
prefix: f.prefix,
|
|
69
62
|
"is-built-in-request": f.isBuiltInRequest,
|
|
70
|
-
"modal-props":
|
|
71
|
-
"onUpdate:open":
|
|
72
|
-
onConfirm:
|
|
73
|
-
onCancel:
|
|
63
|
+
"modal-props": w.value,
|
|
64
|
+
"onUpdate:open": T,
|
|
65
|
+
onConfirm: E,
|
|
66
|
+
onCancel: D
|
|
74
67
|
}, null, 8, [
|
|
75
68
|
"open",
|
|
76
69
|
"selected",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
import r from "../../selector-core/components/
|
|
1
|
+
import { serializeUsers as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
+
import n from "../../selector-core/components/SelectorDialog.mjs";
|
|
3
|
+
import r from "../../selector-core/components/SelectionChips.mjs";
|
|
4
4
|
import { UserSelectorProps as i, userSelectorEmits as a } from "./types.mjs";
|
|
5
5
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementVNode as l, createVNode as u, defineComponent as d, openBlock as f, renderSlot as p, unref as m, useAttrs as h, withCtx as g } from "vue";
|
|
6
6
|
import { FormItemRest as _ } from "ant-design-vue";
|
|
@@ -13,7 +13,7 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
13
13
|
setup(i, { expose: a, emit: d }) {
|
|
14
14
|
let y = i, b = d, x = h(), S = o(() => y.modelValue.map((e) => ({
|
|
15
15
|
type: "user",
|
|
16
|
-
value:
|
|
16
|
+
value: t(e.id),
|
|
17
17
|
label: e.realName,
|
|
18
18
|
avatar: e.avatar,
|
|
19
19
|
raw: {
|
|
@@ -21,11 +21,7 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
21
21
|
id: e.id,
|
|
22
22
|
userId: e.id
|
|
23
23
|
}
|
|
24
|
-
}))), C = o(() =>
|
|
25
|
-
label: e.realName,
|
|
26
|
-
value: e.id,
|
|
27
|
-
closable: !0
|
|
28
|
-
}))), w = o(() => {
|
|
24
|
+
}))), C = o(() => {
|
|
29
25
|
let { modalProps: e, ...t } = x;
|
|
30
26
|
return {
|
|
31
27
|
cancelText: "取消",
|
|
@@ -34,30 +30,27 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
34
30
|
...e || {}
|
|
35
31
|
};
|
|
36
32
|
});
|
|
37
|
-
function
|
|
33
|
+
function w(e) {
|
|
38
34
|
b("update:visible", e === !0);
|
|
39
35
|
}
|
|
40
|
-
function
|
|
41
|
-
let n = t
|
|
36
|
+
function T(t) {
|
|
37
|
+
let n = e(t);
|
|
42
38
|
b("update:visible", !1), b("update:modelValue", n), b("confirm", n);
|
|
43
39
|
}
|
|
44
|
-
function
|
|
40
|
+
function E() {
|
|
45
41
|
b("update:visible", !1), b("cancel");
|
|
46
42
|
}
|
|
47
|
-
function
|
|
43
|
+
function D(e) {
|
|
48
44
|
b("update:modelValue", y.modelValue.filter((t) => t.id !== e)), b("delete-user", e);
|
|
49
45
|
}
|
|
50
|
-
return a({ deleteCheckedUser:
|
|
51
|
-
default: g(() => [l("div", v, [y.hideSlot ? c("", !0) : p(
|
|
52
|
-
|
|
53
|
-
"max-count": y.maxVisibleCount,
|
|
54
|
-
"show-add": "",
|
|
46
|
+
return a({ deleteCheckedUser: D }), (e, t) => (f(), s(m(_), null, {
|
|
47
|
+
default: g(() => [l("div", v, [y.hideSlot ? c("", !0) : p(e.$slots, "default", { key: 0 }, () => [u(r, {
|
|
48
|
+
items: S.value,
|
|
49
|
+
"max-visible-count": y.maxVisibleCount,
|
|
55
50
|
"add-text": "选择用户",
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
onClose: n[1] ||= (e) => O(String(e.value))
|
|
60
|
-
}, null, 8, ["model-value", "max-count"])]), u(r, {
|
|
51
|
+
onAdd: t[0] ||= (e) => b("update:visible", !0),
|
|
52
|
+
onRemove: t[1] ||= (e) => D(e.value)
|
|
53
|
+
}, null, 8, ["items", "max-visible-count"])]), u(n, {
|
|
61
54
|
open: y.visible,
|
|
62
55
|
mode: "user",
|
|
63
56
|
selected: S.value,
|
|
@@ -69,11 +62,11 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
69
62
|
prefix: y.prefix,
|
|
70
63
|
"init-data": y.initData,
|
|
71
64
|
"is-built-in-request": y.isBuiltInRequest,
|
|
72
|
-
"modal-props":
|
|
73
|
-
"onUpdate:open":
|
|
74
|
-
"onUpdate:variant":
|
|
75
|
-
onConfirm:
|
|
76
|
-
onCancel:
|
|
65
|
+
"modal-props": C.value,
|
|
66
|
+
"onUpdate:open": w,
|
|
67
|
+
"onUpdate:variant": t[2] ||= (e) => b("update:variant", e),
|
|
68
|
+
onConfirm: T,
|
|
69
|
+
onCancel: E
|
|
77
70
|
}, null, 8, [
|
|
78
71
|
"open",
|
|
79
72
|
"selected",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import e from "./ProUserSelector.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { computed as t, createBlock as n, defineComponent as r, mergeProps as i, openBlock as a, ref as o, renderSlot as s, useAttrs as c, withCtx as l } from "vue";
|
|
3
3
|
//#region src/components/pro-selector/src/ProUserSelectorDrilldown.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var u = /* @__PURE__ */
|
|
4
|
+
var u = /* @__PURE__ */ r({
|
|
5
5
|
name: "ProUserSelectorDrilldown",
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ProUserSelectorDrilldown",
|
|
8
|
-
setup(
|
|
9
|
-
let d = c(), f =
|
|
10
|
-
return u({ deleteCheckedUser: (e) => f.value?.deleteCheckedUser(e) }), (
|
|
8
|
+
setup(r, { expose: u }) {
|
|
9
|
+
let d = c(), f = o(), p = t(() => d.variant || "A");
|
|
10
|
+
return u({ deleteCheckedUser: (e) => f.value?.deleteCheckedUser(e) }), (t, r) => (a(), n(e, i({
|
|
11
11
|
ref_key: "selectorRef",
|
|
12
12
|
ref: f
|
|
13
|
-
},
|
|
14
|
-
default: l(() => [
|
|
13
|
+
}, t.$attrs, { variant: p.value }), {
|
|
14
|
+
default: l(() => [s(t.$slots, "default")]),
|
|
15
15
|
_: 3
|
|
16
16
|
}, 16, ["variant"]));
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
import r from "../../selector-core/components/
|
|
1
|
+
import { serializeGroup as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
+
import n from "../../selector-core/components/SelectorDialog.mjs";
|
|
3
|
+
import r from "../../selector-core/components/SelectionChips.mjs";
|
|
4
4
|
import { normalizeSelectorOptions as i, removeSelectorOption as a } from "./utils/index.mjs";
|
|
5
5
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementVNode as l, createVNode as u, defineComponent as d, mergeModels as f, openBlock as p, renderSlot as m, unref as h, useAttrs as g, useModel as _, withCtx as v } from "vue";
|
|
6
6
|
import { FormItemRest as y } from "ant-design-vue";
|
|
@@ -43,14 +43,10 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
43
43
|
setup(d, { emit: f }) {
|
|
44
44
|
let x = d, S = f, C = g(), w = _(d, "modelValue"), T = _(d, "visible"), E = o(() => w.value.map((e) => ({
|
|
45
45
|
type: e.type || x.type || "dept",
|
|
46
|
-
value:
|
|
46
|
+
value: t(e.value),
|
|
47
47
|
label: e.label || "",
|
|
48
48
|
raw: e
|
|
49
|
-
}))), D = o(() =>
|
|
50
|
-
label: e.label || "",
|
|
51
|
-
value: e.value,
|
|
52
|
-
type: e.type
|
|
53
|
-
}))), O = o(() => {
|
|
49
|
+
}))), D = o(() => {
|
|
54
50
|
let { modalProps: e, ...t } = C;
|
|
55
51
|
return {
|
|
56
52
|
cancelText: "取消",
|
|
@@ -59,24 +55,23 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
59
55
|
...e || {}
|
|
60
56
|
};
|
|
61
57
|
});
|
|
62
|
-
function
|
|
63
|
-
w.value = i(t
|
|
58
|
+
function O(t) {
|
|
59
|
+
w.value = i(e(t)), T.value = !1, S("confirm");
|
|
64
60
|
}
|
|
65
|
-
function
|
|
61
|
+
function k() {
|
|
66
62
|
T.value = !1, S("cancel");
|
|
67
63
|
}
|
|
68
|
-
function
|
|
69
|
-
w.value = a(w.value,
|
|
64
|
+
function A(e) {
|
|
65
|
+
w.value = a(w.value, e.value, e.type, x.type || "dept");
|
|
70
66
|
}
|
|
71
|
-
return (
|
|
72
|
-
default: v(() => [l("div", b, [x.hideSlot ? c("", !0) : m(
|
|
73
|
-
|
|
74
|
-
"max-count": x.maxVisibleCount ?? 5,
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, null, 8, ["model-value", "max-count"])]), u(r, {
|
|
67
|
+
return (e, t) => (p(), s(h(y), null, {
|
|
68
|
+
default: v(() => [l("div", b, [x.hideSlot ? c("", !0) : m(e.$slots, "default", { key: 0 }, () => [u(r, {
|
|
69
|
+
items: E.value,
|
|
70
|
+
"max-visible-count": x.maxVisibleCount ?? 5,
|
|
71
|
+
"add-text": "选择对象",
|
|
72
|
+
onAdd: t[0] ||= (e) => T.value = !0,
|
|
73
|
+
onRemove: A
|
|
74
|
+
}, null, 8, ["items", "max-visible-count"])]), u(n, {
|
|
80
75
|
open: T.value,
|
|
81
76
|
mode: "group",
|
|
82
77
|
selected: E.value,
|
|
@@ -85,11 +80,11 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
85
80
|
title: x.title,
|
|
86
81
|
http: x.http,
|
|
87
82
|
prefix: x.urlPrefix,
|
|
88
|
-
"modal-props":
|
|
89
|
-
"onUpdate:open":
|
|
90
|
-
onConfirm:
|
|
91
|
-
onCancel:
|
|
92
|
-
onChangeTab:
|
|
83
|
+
"modal-props": D.value,
|
|
84
|
+
"onUpdate:open": t[1] ||= (e) => T.value = e === !0,
|
|
85
|
+
onConfirm: O,
|
|
86
|
+
onCancel: k,
|
|
87
|
+
onChangeTab: t[2] ||= (e) => S("changeTab", e)
|
|
93
88
|
}, null, 8, [
|
|
94
89
|
"open",
|
|
95
90
|
"selected",
|
|
@@ -17,8 +17,8 @@ function t(t) {
|
|
|
17
17
|
}]);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
function n(e, t, n) {
|
|
21
|
-
return e.filter((e) => !(e.value === t && (
|
|
20
|
+
function n(e, t, n, r) {
|
|
21
|
+
return e.filter((e) => !(e.value === t && (e.type || r) === n));
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { t as normalizeSelectorOptions, n as removeSelectorOption };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "../../
|
|
2
|
-
import
|
|
3
|
-
import r from "../../selector-core/components/
|
|
1
|
+
import { serializeRoles as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
+
import n from "../../selector-core/components/SelectorDialog.mjs";
|
|
3
|
+
import r from "../../selector-core/components/SelectionChips.mjs";
|
|
4
4
|
import { roleSelectorEmits as i, roleSelectorProps as a } from "./types.mjs";
|
|
5
5
|
import { computed as o, createBlock as s, createCommentVNode as c, createElementVNode as l, createVNode as u, defineComponent as d, openBlock as f, renderSlot as p, unref as m, useAttrs as h, withCtx as g } from "vue";
|
|
6
6
|
import { FormItemRest as _ } from "ant-design-vue";
|
|
@@ -13,14 +13,10 @@ var v = { class: "gd-ant-role-selector" }, y = /* @__PURE__ */ d({
|
|
|
13
13
|
setup(i, { emit: a }) {
|
|
14
14
|
let d = i, y = a, b = h(), x = o(() => (Array.isArray(d.modelValue) ? d.modelValue : d.modelValue ? [d.modelValue] : []).map((e) => ({
|
|
15
15
|
type: "role",
|
|
16
|
-
value:
|
|
16
|
+
value: t(e.value),
|
|
17
17
|
label: e.label || "",
|
|
18
18
|
raw: e
|
|
19
|
-
}))), S = o(() =>
|
|
20
|
-
label: e.label,
|
|
21
|
-
value: e.value,
|
|
22
|
-
closable: !0
|
|
23
|
-
}))), C = o(() => {
|
|
19
|
+
}))), S = o(() => {
|
|
24
20
|
let { modalProps: e, ...t } = b;
|
|
25
21
|
return {
|
|
26
22
|
cancelText: "取消",
|
|
@@ -29,34 +25,31 @@ var v = { class: "gd-ant-role-selector" }, y = /* @__PURE__ */ d({
|
|
|
29
25
|
...e || {}
|
|
30
26
|
};
|
|
31
27
|
});
|
|
32
|
-
function
|
|
28
|
+
function C(e) {
|
|
33
29
|
y("update:visible", e === !0);
|
|
34
30
|
}
|
|
35
|
-
function
|
|
36
|
-
let n = t
|
|
31
|
+
function w(t) {
|
|
32
|
+
let n = e(t), r = d.type === "radio" ? n[0] || null : n;
|
|
37
33
|
y("update:visible", !1), y("update:modelValue", r), y("confirm", n);
|
|
38
34
|
}
|
|
39
|
-
function
|
|
35
|
+
function T() {
|
|
40
36
|
y("update:visible", !1), y("cancel");
|
|
41
37
|
}
|
|
42
|
-
function
|
|
38
|
+
function E(e) {
|
|
43
39
|
if (d.type === "radio") {
|
|
44
40
|
y("update:modelValue", null);
|
|
45
41
|
return;
|
|
46
42
|
}
|
|
47
43
|
y("update:modelValue", (Array.isArray(d.modelValue) ? d.modelValue : []).filter((t) => t.value !== e));
|
|
48
44
|
}
|
|
49
|
-
return (
|
|
50
|
-
default: g(() => [l("div", v, [d.hideSlot ? c("", !0) : p(
|
|
51
|
-
|
|
52
|
-
"max-count": d.maxVisibleCount,
|
|
53
|
-
"show-add": "",
|
|
45
|
+
return (e, t) => (f(), s(m(_), null, {
|
|
46
|
+
default: g(() => [l("div", v, [d.hideSlot ? c("", !0) : p(e.$slots, "default", { key: 0 }, () => [u(r, {
|
|
47
|
+
items: x.value,
|
|
48
|
+
"max-visible-count": d.maxVisibleCount,
|
|
54
49
|
"add-text": "选择角色",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onClose: n[1] ||= (e) => D(String(e.value))
|
|
59
|
-
}, null, 8, ["model-value", "max-count"])]), u(r, {
|
|
50
|
+
onAdd: t[0] ||= (e) => y("update:visible", !0),
|
|
51
|
+
onRemove: t[1] ||= (e) => E(e.value)
|
|
52
|
+
}, null, 8, ["items", "max-visible-count"])]), u(n, {
|
|
60
53
|
open: d.visible,
|
|
61
54
|
mode: "role",
|
|
62
55
|
selected: x.value,
|
|
@@ -67,10 +60,10 @@ var v = { class: "gd-ant-role-selector" }, y = /* @__PURE__ */ d({
|
|
|
67
60
|
prefix: d.prefix,
|
|
68
61
|
"is-built-in-request": d.isBuiltInRequest,
|
|
69
62
|
"value-field": d.valueField,
|
|
70
|
-
"modal-props":
|
|
71
|
-
"onUpdate:open":
|
|
72
|
-
onConfirm:
|
|
73
|
-
onCancel:
|
|
63
|
+
"modal-props": S.value,
|
|
64
|
+
"onUpdate:open": C,
|
|
65
|
+
onConfirm: w,
|
|
66
|
+
onCancel: T
|
|
74
67
|
}, null, 8, [
|
|
75
68
|
"open",
|
|
76
69
|
"selected",
|
|
@@ -55,6 +55,13 @@ var y = ["aria-label"], b = { class: "gd-ant-selector__pane-heading" }, x = { cl
|
|
|
55
55
|
let n = t(D.nodes).find((t) => t.key === e);
|
|
56
56
|
n && O("toggle", n.entity);
|
|
57
57
|
}
|
|
58
|
+
function I(e, t) {
|
|
59
|
+
let n = t.nativeEvent?.target;
|
|
60
|
+
!D.navigation && !D.radio && n?.closest?.(".ant-tree-checkbox") || F(String(t.node.key));
|
|
61
|
+
}
|
|
62
|
+
function L(e, t) {
|
|
63
|
+
!D.navigation && !D.radio && F(String(t.node.key));
|
|
64
|
+
}
|
|
58
65
|
return (i, d) => (u(), o("section", {
|
|
59
66
|
class: "gd-ant-selector__tree-pane",
|
|
60
67
|
"aria-label": l.navigation ? "组织导航" : "选择部门"
|
|
@@ -81,7 +88,7 @@ var y = ["aria-label"], b = { class: "gd-ant-selector__pane-heading" }, x = { cl
|
|
|
81
88
|
empty: !N.value.length,
|
|
82
89
|
searching: !!k.value,
|
|
83
90
|
label: "部门",
|
|
84
|
-
onRetry: d[
|
|
91
|
+
onRetry: d[3] ||= (e) => O("retry")
|
|
85
92
|
}, {
|
|
86
93
|
default: h(() => [s("div", S, [c(p(v), {
|
|
87
94
|
"tree-data": N.value,
|
|
@@ -93,8 +100,8 @@ var y = ["aria-label"], b = { class: "gd-ant-selector__pane-heading" }, x = { cl
|
|
|
93
100
|
"expanded-keys": A.value,
|
|
94
101
|
"auto-expand-parent": !1,
|
|
95
102
|
onExpand: d[2] ||= (e) => A.value = e.map(String),
|
|
96
|
-
onSelect:
|
|
97
|
-
onCheck:
|
|
103
|
+
onSelect: I,
|
|
104
|
+
onCheck: L
|
|
98
105
|
}, {
|
|
99
106
|
title: h(({ title: t, key: r }) => [s("span", {
|
|
100
107
|
class: "gd-ant-selector__tree-title",
|
|
@@ -53,7 +53,7 @@ var b = {
|
|
|
53
53
|
label: "角色",
|
|
54
54
|
onRetry: m[3] ||= (e) => O("retry")
|
|
55
55
|
}, {
|
|
56
|
-
default: v(() => [l("div", C, [f.group ? (p(), c("label", w, [
|
|
56
|
+
default: v(() => [l("div", C, [f.group && A.value.length ? (p(), c("label", w, [
|
|
57
57
|
l("input", {
|
|
58
58
|
type: "checkbox",
|
|
59
59
|
checked: M.value,
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import e from "../../icon/src/icon.mjs";
|
|
2
|
+
import { entityKey as t } from "../model.mjs";
|
|
3
|
+
import n from "../../pro-user-avatar/src/index.mjs";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g, withModifiers as _ } from "vue";
|
|
5
|
+
import { Popover as v } from "ant-design-vue";
|
|
6
|
+
//#region src/components/selector-core/components/SelectionChips.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var y = { class: "gd-ant-selector__confirmed" }, b = { class: "gd-ant-selector__confirmed-chips" }, x = ["title"], S = ["aria-label", "onClick"], C = { class: "gd-ant-selector__confirmed-actions" }, w = {
|
|
8
|
+
class: "gd-ant-selector__confirmed-popover-content",
|
|
9
|
+
"aria-label": "隐藏的已选择项"
|
|
10
|
+
}, T = ["title"], E = ["aria-label", "onClick"], D = ["title", "aria-label"], O = ["aria-label"], k = /* @__PURE__ */ u({
|
|
11
|
+
__name: "SelectionChips",
|
|
12
|
+
props: {
|
|
13
|
+
items: {},
|
|
14
|
+
maxVisibleCount: { default: 5 },
|
|
15
|
+
addText: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["add", "remove"],
|
|
18
|
+
setup(u) {
|
|
19
|
+
let k = u, A = i(() => {
|
|
20
|
+
let e = k.maxVisibleCount;
|
|
21
|
+
return Number.isFinite(e) && e >= 0 ? Math.floor(e) : 5;
|
|
22
|
+
}), j = i(() => k.items.slice(0, A.value)), M = i(() => k.items.slice(A.value)), N = i(() => `另有 ${M.value.length} 项:${M.value.map((e) => e.label || "未命名").join("、")}`);
|
|
23
|
+
return (i, k) => (f(), s("div", y, [c("div", b, [(f(!0), s(r, null, p(j.value, (r) => (f(), s("div", {
|
|
24
|
+
key: h(t)(r),
|
|
25
|
+
class: d(["gd-ant-selector__confirmed-chip", `gd-ant-selector__confirmed-chip--${r.type}`])
|
|
26
|
+
}, [
|
|
27
|
+
r.type === "user" ? (f(), a(n, {
|
|
28
|
+
key: 0,
|
|
29
|
+
name: r.label,
|
|
30
|
+
avatar: r.avatar,
|
|
31
|
+
preview: !1,
|
|
32
|
+
size: "small"
|
|
33
|
+
}, null, 8, ["name", "avatar"])) : (f(), s("span", {
|
|
34
|
+
key: 1,
|
|
35
|
+
class: d(["gd-ant-selector__confirmed-chip-icon", `gd-ant-selector__confirmed-chip-icon--${r.type}`])
|
|
36
|
+
}, [l(e, {
|
|
37
|
+
name: r.type === "dept" ? "bumen" : "a-jiaoseguanli2",
|
|
38
|
+
size: 14,
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, null, 8, ["name"])], 2)),
|
|
41
|
+
c("span", {
|
|
42
|
+
class: "gd-ant-selector__confirmed-chip-label",
|
|
43
|
+
title: r.label || "未命名"
|
|
44
|
+
}, m(r.label || "未命名"), 9, x),
|
|
45
|
+
c("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
class: "gd-ant-selector__confirmed-chip-remove",
|
|
48
|
+
"aria-label": `移除已选择的${r.label || "未命名"}`,
|
|
49
|
+
onClick: _((e) => i.$emit("remove", r), ["stop"])
|
|
50
|
+
}, [l(e, {
|
|
51
|
+
name: "guanbi",
|
|
52
|
+
size: 10,
|
|
53
|
+
"aria-hidden": "true"
|
|
54
|
+
})], 8, S)
|
|
55
|
+
], 2))), 128))]), c("div", C, [M.value.length ? (f(), a(h(v), {
|
|
56
|
+
key: 0,
|
|
57
|
+
placement: "top",
|
|
58
|
+
trigger: "click",
|
|
59
|
+
"overlay-class-name": "gd-ant-selector__confirmed-popover"
|
|
60
|
+
}, {
|
|
61
|
+
content: g(() => [c("div", w, [(f(!0), s(r, null, p(M.value, (r) => (f(), s("div", {
|
|
62
|
+
key: h(t)(r),
|
|
63
|
+
class: d(["gd-ant-selector__confirmed-chip", `gd-ant-selector__confirmed-chip--${r.type}`])
|
|
64
|
+
}, [
|
|
65
|
+
r.type === "user" ? (f(), a(n, {
|
|
66
|
+
key: 0,
|
|
67
|
+
name: r.label,
|
|
68
|
+
avatar: r.avatar,
|
|
69
|
+
preview: !1,
|
|
70
|
+
size: "small"
|
|
71
|
+
}, null, 8, ["name", "avatar"])) : (f(), s("span", {
|
|
72
|
+
key: 1,
|
|
73
|
+
class: d(["gd-ant-selector__confirmed-chip-icon", `gd-ant-selector__confirmed-chip-icon--${r.type}`])
|
|
74
|
+
}, [l(e, {
|
|
75
|
+
name: r.type === "dept" ? "bumen" : "a-jiaoseguanli2",
|
|
76
|
+
size: 14,
|
|
77
|
+
"aria-hidden": "true"
|
|
78
|
+
}, null, 8, ["name"])], 2)),
|
|
79
|
+
c("span", {
|
|
80
|
+
class: "gd-ant-selector__confirmed-chip-label",
|
|
81
|
+
title: r.label || "未命名"
|
|
82
|
+
}, m(r.label || "未命名"), 9, T),
|
|
83
|
+
c("button", {
|
|
84
|
+
type: "button",
|
|
85
|
+
class: "gd-ant-selector__confirmed-chip-remove",
|
|
86
|
+
"aria-label": `移除已选择的${r.label || "未命名"}`,
|
|
87
|
+
onClick: _((e) => i.$emit("remove", r), ["stop"])
|
|
88
|
+
}, [l(e, {
|
|
89
|
+
name: "guanbi",
|
|
90
|
+
size: 10,
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
})], 8, E)
|
|
93
|
+
], 2))), 128))])]),
|
|
94
|
+
default: g(() => [c("button", {
|
|
95
|
+
type: "button",
|
|
96
|
+
class: "gd-ant-selector__confirmed-more",
|
|
97
|
+
title: N.value,
|
|
98
|
+
"aria-label": `查看隐藏的已选择项,共 ${M.value.length} 项`
|
|
99
|
+
}, " +" + m(M.value.length), 9, D)]),
|
|
100
|
+
_: 1
|
|
101
|
+
})) : o("", !0), c("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
class: "gd-ant-selector__confirmed-add",
|
|
104
|
+
"aria-label": u.items.length ? "继续选择" : u.addText,
|
|
105
|
+
onClick: k[0] ||= (e) => i.$emit("add")
|
|
106
|
+
}, [l(e, {
|
|
107
|
+
name: "plus",
|
|
108
|
+
size: 15,
|
|
109
|
+
"aria-hidden": "true"
|
|
110
|
+
}), c("span", null, m(u.items.length ? "继续选择" : u.addText), 1)], 8, O)])]));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
export { k as default };
|