@guodun/antdv 1.6.2 → 1.6.3
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 +52 -46
- package/dist/es/components/dept-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.mjs +67 -106
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +791 -794
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +2 -9
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +34 -36
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-menu-tree/src/pro-menu-tree.mjs +108 -103
- package/dist/es/components/pro-menu-tree/src/types.mjs +4 -0
- package/dist/es/components/pro-selector/src/ProUserSelector.vue.mjs +50 -44
- package/dist/es/components/pro-selector/src/types.mjs +4 -0
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +47 -40
- package/dist/es/components/role-selector/src/RoleSelector.vue.mjs +50 -44
- package/dist/es/components/role-selector/src/types.mjs +4 -0
- package/dist/es/components/selector-core/components/SelectorDialog.vue.mjs +242 -233
- package/dist/es/components/selector-core/selection-theme.mjs +35 -0
- package/dist/lib/components/dept-selector/src/DeptSelector.vue.cjs +1 -1
- package/dist/lib/components/dept-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-menu-tree/src/pro-menu-tree.cjs +1 -1
- package/dist/lib/components/pro-menu-tree/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/ProUserSelector.vue.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/role-selector/src/RoleSelector.vue.cjs +1 -1
- package/dist/lib/components/role-selector/src/types.cjs +1 -1
- package/dist/lib/components/selector-core/components/SelectorDialog.vue.cjs +1 -1
- package/dist/lib/components/selector-core/selection-theme.cjs +1 -0
- package/dist/theme/dept-selector.css +1 -0
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-menu-tree.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -0
- package/dist/theme/role-selector.css +1 -0
- package/dist/theme/selector-core.css +1 -1
- package/dist/types/components/dept-selector/index.d.ts +15 -0
- package/dist/types/components/dept-selector/src/DeptSelector.vue.d.ts +9 -0
- package/dist/types/components/dept-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateAuthoringBar.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-authoring.d.ts +2 -4
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +0 -3
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +0 -4
- package/dist/types/components/pro-menu-tree/index.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/pro-menu-tree.d.ts +9 -0
- package/dist/types/components/pro-menu-tree/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector/index.d.ts +59 -2
- package/dist/types/components/pro-selector/src/ProUserSelector.vue.d.ts +9 -0
- package/dist/types/components/pro-selector/src/ProUserSelectorDrilldown.vue.d.ts +28 -4
- package/dist/types/components/pro-selector/src/types.d.ts +7 -0
- package/dist/types/components/pro-selector-group/index.d.ts +3 -0
- package/dist/types/components/pro-selector-group/src/index.vue.d.ts +1 -0
- package/dist/types/components/pro-selector-group/src/types.d.ts +5 -0
- package/dist/types/components/role-selector/index.d.ts +30 -0
- package/dist/types/components/role-selector/src/RoleSelector.vue.d.ts +9 -0
- package/dist/types/components/role-selector/src/types.d.ts +7 -0
- package/dist/types/components/selector-core/components/SelectorDialog.vue.d.ts +2 -0
- package/dist/types/components/selector-core/selection-theme.d.ts +20 -0
- package/package.json +3 -3
- package/dist/es/components/pro-contract-template-designer/src/utils/clause-snippets.mjs +0 -56
- package/dist/lib/components/pro-contract-template-designer/src/utils/clause-snippets.cjs +0 -1
- package/dist/types/components/pro-contract-template-designer/src/utils/clause-snippets.d.ts +0 -10
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import e from "../../pro-modal/src/ProModal.mjs";
|
|
2
2
|
import t from "../../icon/src/icon.mjs";
|
|
3
|
-
import { cloneEntities as n, entityKey as r, flattenDepartments as i, selectionLimit as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
3
|
+
import { cloneEntities as n, entityKey as r, flattenDepartments as i, selectionLimit as ee, selectorLabels as a, toggleEntity as te, toggleVisible as o } from "../model.mjs";
|
|
4
|
+
import { DEFAULT_SELECTION_ACTIVE_COLOR as s, createSelectionTheme as ne } from "../selection-theme.mjs";
|
|
5
|
+
import { useSelectorData as re } from "../useSelectorData.mjs";
|
|
6
|
+
import ie from "./DepartmentTree.mjs";
|
|
7
|
+
import ae from "./PeoplePane.mjs";
|
|
8
|
+
import oe from "./RolePane.mjs";
|
|
9
|
+
import se from "./SelectionSummary.mjs";
|
|
10
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, mergeModels as _, nextTick as ce, normalizeClass as v, openBlock as y, ref as b, renderList as le, toDisplayString as x, unref as S, useModel as ue, watch as C, withCtx as w } from "vue";
|
|
11
|
+
import { Button as T, ConfigProvider as de } from "ant-design-vue";
|
|
11
12
|
//#region src/components/selector-core/components/SelectorDialog.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
13
|
+
var fe = { class: "gd-ant-selector__dialog-root" }, pe = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "gd-ant-selector__variant-toolbar",
|
|
15
16
|
"aria-label": "用户方案比较"
|
|
16
|
-
},
|
|
17
|
+
}, me = { class: "gd-ant-selector__segmented" }, he = ["aria-pressed"], ge = ["aria-pressed"], _e = {
|
|
17
18
|
key: 1,
|
|
18
19
|
class: "gd-ant-selector__tabs",
|
|
19
20
|
role: "tablist",
|
|
20
21
|
"aria-label": "选择对象类型"
|
|
21
|
-
},
|
|
22
|
+
}, ve = [
|
|
22
23
|
"id",
|
|
23
24
|
"aria-selected",
|
|
24
25
|
"tabindex",
|
|
25
26
|
"onClick",
|
|
26
27
|
"onKeydown"
|
|
27
|
-
],
|
|
28
|
+
], ye = ["role", "aria-labelledby"], be = { class: "gd-ant-selector__footer" }, xe = ["role"], Se = { class: "gd-ant-selector__footer-actions" }, Ce = { key: 0 }, E = /* @__PURE__ */ g({
|
|
28
29
|
__name: "SelectorDialog",
|
|
29
30
|
props: /* @__PURE__ */ _({
|
|
30
31
|
mode: {},
|
|
@@ -49,6 +50,7 @@ var le = { class: "gd-ant-selector__dialog-root" }, ue = {
|
|
|
49
50
|
default: !1
|
|
50
51
|
},
|
|
51
52
|
valueField: { default: "roleKey" },
|
|
53
|
+
activeColor: { default: s },
|
|
52
54
|
modalProps: { default: () => ({}) }
|
|
53
55
|
}, {
|
|
54
56
|
open: {
|
|
@@ -63,99 +65,99 @@ var le = { class: "gd-ant-selector__dialog-root" }, ue = {
|
|
|
63
65
|
"cancel",
|
|
64
66
|
"changeTab"
|
|
65
67
|
], ["update:open"]),
|
|
66
|
-
setup(
|
|
67
|
-
let
|
|
68
|
-
function
|
|
68
|
+
setup(s, { emit: g }) {
|
|
69
|
+
let _ = ue(s, "open"), E = s, D = g;
|
|
70
|
+
function O(e = E.selected) {
|
|
69
71
|
let t = n(e);
|
|
70
|
-
return
|
|
72
|
+
return E.mode === "group" && E.isSingle ? t.filter((e) => e.type === (E.initialTab || "dept")) : t;
|
|
71
73
|
}
|
|
72
|
-
let
|
|
73
|
-
mode:
|
|
74
|
+
let k = b(O()), A = b(E.variant), j = b(E.mode === "group" ? E.initialTab : E.mode), M = b(""), N = b(""), P = re({
|
|
75
|
+
mode: E.mode,
|
|
74
76
|
get http() {
|
|
75
|
-
return
|
|
77
|
+
return E.http;
|
|
76
78
|
},
|
|
77
79
|
get prefix() {
|
|
78
|
-
return
|
|
80
|
+
return E.prefix;
|
|
79
81
|
},
|
|
80
82
|
get isBuiltInRequest() {
|
|
81
|
-
return
|
|
83
|
+
return E.isBuiltInRequest;
|
|
82
84
|
},
|
|
83
|
-
initData: () =>
|
|
84
|
-
treeData: () =>
|
|
85
|
-
roleOptions: () =>
|
|
86
|
-
fieldNames: () =>
|
|
87
|
-
valueField: () =>
|
|
88
|
-
}), { departments:
|
|
89
|
-
mode:
|
|
90
|
-
selection:
|
|
91
|
-
maxCount:
|
|
92
|
-
})), H = l(() =>
|
|
85
|
+
initData: () => E.initData?.(),
|
|
86
|
+
treeData: () => E.treeData || [],
|
|
87
|
+
roleOptions: () => E.roleOptions || [],
|
|
88
|
+
fieldNames: () => E.fieldNames,
|
|
89
|
+
valueField: () => E.valueField
|
|
90
|
+
}), { departments: F, roles: I, members: L, treeLoading: R, roleLoading: z, memberLoading: we, treeError: B, roleError: Te, memberError: Ee } = P, V = l(() => ee({
|
|
91
|
+
mode: E.mode,
|
|
92
|
+
selection: E.selection,
|
|
93
|
+
maxCount: E.maxCount
|
|
94
|
+
})), H = l(() => E.mode === "group"), U = l(() => E.mode !== "group" && E.selection === "radio"), W = l(() => j.value === "user" && (H.value || A.value === "B")), De = l(() => H.value ? "选择部门、角色与用户" : E.title || `选择${a[j.value]}`), G = l(() => H.value && !E.isSingle ? [
|
|
93
95
|
"dept",
|
|
94
96
|
"role",
|
|
95
97
|
"user"
|
|
96
|
-
] : [
|
|
97
|
-
async function
|
|
98
|
+
] : [j.value]), Oe = l(() => H.value || W.value ? 1040 : E.mode === "user" ? 880 : E.mode === "dept" ? 800 : 760), K = l(() => ne(E.activeColor));
|
|
99
|
+
async function ke(e) {
|
|
98
100
|
if (e === "role") {
|
|
99
|
-
await
|
|
101
|
+
await P.loadRoles();
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
|
-
await
|
|
104
|
+
await P.loadTree(), e === "user" && (H.value || A.value === "B") && !M.value && (M.value = F.value[0]?.key || "");
|
|
103
105
|
}
|
|
104
|
-
C([
|
|
105
|
-
t &&
|
|
106
|
+
C([j, _], ([e, t]) => {
|
|
107
|
+
t && ke(e);
|
|
106
108
|
}, { immediate: !0 }), C([
|
|
107
|
-
N,
|
|
108
109
|
M,
|
|
109
|
-
|
|
110
|
+
j,
|
|
111
|
+
_
|
|
110
112
|
], ([e, t, n]) => {
|
|
111
|
-
n && H.value && t === "user" &&
|
|
112
|
-
}), C(() =>
|
|
113
|
-
|
|
113
|
+
n && H.value && t === "user" && P.loadMembers(e);
|
|
114
|
+
}), C(() => E.variant, (e) => {
|
|
115
|
+
A.value = e;
|
|
114
116
|
}), C(() => [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
E.http,
|
|
118
|
+
E.prefix,
|
|
119
|
+
E.isBuiltInRequest
|
|
118
120
|
], () => {
|
|
119
|
-
|
|
121
|
+
P.reset();
|
|
120
122
|
});
|
|
121
|
-
function
|
|
122
|
-
|
|
123
|
+
function q(e) {
|
|
124
|
+
A.value !== e && (A.value = e, D("update:variant", e), e === "B" && !M.value && (M.value = F.value[0]?.key || ""));
|
|
123
125
|
}
|
|
124
|
-
C(() =>
|
|
125
|
-
|
|
126
|
-
}, { deep: !0 }), C(() =>
|
|
127
|
-
|
|
128
|
-
}, { deep: !0 }), C(() =>
|
|
129
|
-
|
|
126
|
+
C(() => E.treeData, () => {
|
|
127
|
+
E.mode === "dept" && !E.isBuiltInRequest && P.loadTree(!0);
|
|
128
|
+
}, { deep: !0 }), C(() => E.roleOptions, () => {
|
|
129
|
+
E.mode === "role" && !E.isBuiltInRequest && P.loadRoles(!0);
|
|
130
|
+
}, { deep: !0 }), C(() => E.selected, (e) => {
|
|
131
|
+
_.value || (k.value = O(e));
|
|
130
132
|
}, {
|
|
131
133
|
deep: !0,
|
|
132
134
|
immediate: !0
|
|
133
|
-
}), C(
|
|
134
|
-
e ? (
|
|
135
|
+
}), C(_, (e) => {
|
|
136
|
+
e ? (A.value = E.variant, k.value = O(), j.value = E.mode === "group" ? E.initialTab : E.mode, M.value = "", N.value = "") : (k.value = O(), N.value = "");
|
|
135
137
|
}, { immediate: !0 });
|
|
136
|
-
async function
|
|
137
|
-
await
|
|
138
|
-
}
|
|
139
|
-
function J(e) {
|
|
140
|
-
A.value = ee(A.value, e, {
|
|
141
|
-
mode: D.mode,
|
|
142
|
-
selection: D.selection,
|
|
143
|
-
maxCount: D.maxCount
|
|
144
|
-
}), P.value = "";
|
|
138
|
+
async function J() {
|
|
139
|
+
await P.loadTree(!0), !M.value && (H.value || A.value === "B") && (M.value = F.value[0]?.key || "");
|
|
145
140
|
}
|
|
146
141
|
function Y(e) {
|
|
147
|
-
|
|
142
|
+
k.value = te(k.value, e, {
|
|
143
|
+
mode: E.mode,
|
|
144
|
+
selection: E.selection,
|
|
145
|
+
maxCount: E.maxCount
|
|
146
|
+
}), N.value = "";
|
|
147
|
+
}
|
|
148
|
+
function Ae(e) {
|
|
149
|
+
k.value = k.value.filter((t) => r(t) !== r(e)), N.value = "";
|
|
148
150
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
+
function je(e) {
|
|
152
|
+
k.value = e ? k.value.filter((t) => t.type !== e) : [], N.value = "";
|
|
151
153
|
}
|
|
152
|
-
let
|
|
153
|
-
...i(
|
|
154
|
+
let Me = l(() => [
|
|
155
|
+
...i(F.value).map((e) => e.entity),
|
|
156
|
+
...I.value,
|
|
154
157
|
...L.value,
|
|
155
|
-
...
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
let t = ke.value.find((t) => r(t) === r(e));
|
|
158
|
+
...i(F.value).flatMap((e) => e.members)
|
|
159
|
+
]), X = l(() => k.value.map((e) => {
|
|
160
|
+
let t = Me.value.find((t) => r(t) === r(e));
|
|
159
161
|
return t ? {
|
|
160
162
|
...t,
|
|
161
163
|
...e,
|
|
@@ -165,20 +167,20 @@ var le = { class: "gd-ant-selector__dialog-root" }, ue = {
|
|
|
165
167
|
} : e;
|
|
166
168
|
}));
|
|
167
169
|
function Z() {
|
|
168
|
-
let e =
|
|
169
|
-
if (!e.length &&
|
|
170
|
-
|
|
170
|
+
let e = E.mode === "group" && E.isSingle ? X.value.filter((e) => e.type === (E.initialTab || "dept")) : X.value;
|
|
171
|
+
if (!e.length && E.mode !== "group") {
|
|
172
|
+
N.value = `请至少选择一项${a[j.value]}`;
|
|
171
173
|
return;
|
|
172
174
|
}
|
|
173
|
-
|
|
175
|
+
D("confirm", n(e)), _.value = !1;
|
|
174
176
|
}
|
|
175
177
|
function Q() {
|
|
176
|
-
|
|
178
|
+
k.value = O(), D("cancel"), _.value = !1;
|
|
177
179
|
}
|
|
178
180
|
function $(e) {
|
|
179
|
-
|
|
181
|
+
j.value !== e && (j.value = e, D("changeTab", e));
|
|
180
182
|
}
|
|
181
|
-
async function
|
|
183
|
+
async function Ne(e, t) {
|
|
182
184
|
let n = t;
|
|
183
185
|
if (e.key === "ArrowRight") n = (t + 1) % G.value.length;
|
|
184
186
|
else if (e.key === "ArrowLeft") n = (t - 1 + G.value.length) % G.value.length;
|
|
@@ -186,168 +188,175 @@ var le = { class: "gd-ant-selector__dialog-root" }, ue = {
|
|
|
186
188
|
else if (e.key === "End") n = G.value.length - 1;
|
|
187
189
|
else return;
|
|
188
190
|
let r = e.currentTarget.parentElement;
|
|
189
|
-
e.preventDefault(), $(G.value[n]), await
|
|
191
|
+
e.preventDefault(), $(G.value[n]), await ce(), r?.querySelector("[aria-selected=\"true\"]")?.focus();
|
|
190
192
|
}
|
|
191
|
-
let
|
|
192
|
-
let { class: e,
|
|
193
|
+
let Pe = l(() => {
|
|
194
|
+
let { class: e, style: t, ...n } = E.modalProps || {}, r = Array.isArray(e) ? e : e ? [e] : [], i = typeof t == "string" ? `${t};${Object.entries(K.value.style).map(([e, t]) => `${e}:${t}`).join(";")}` : {
|
|
195
|
+
...t || {},
|
|
196
|
+
...K.value.style
|
|
197
|
+
};
|
|
193
198
|
return {
|
|
194
|
-
width: `min(${
|
|
199
|
+
width: `min(${Oe.value}px, calc(100vw - 32px))`,
|
|
195
200
|
centered: !0,
|
|
196
201
|
destroyOnClose: !0,
|
|
197
|
-
...
|
|
198
|
-
class: ["gd-ant-selector-modal", ...
|
|
202
|
+
...n,
|
|
203
|
+
class: ["gd-ant-selector-modal", ...r].filter(Boolean).join(" "),
|
|
204
|
+
style: i
|
|
199
205
|
};
|
|
200
206
|
});
|
|
201
|
-
return (n, r) => (y(), u(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
footer: w(() => [p("div", _e, [p("span", {
|
|
210
|
-
class: v(["gd-ant-selector__footer-status", { "gd-ant-selector__footer-status--warning": P.value || Number.isFinite(V.value) && A.value.length >= V.value && !U.value }]),
|
|
211
|
-
role: P.value ? "alert" : "status"
|
|
212
|
-
}, [P.value ? (y(), f(c, { key: 0 }, [m(x(P.value), 1)], 64)) : !U.value && Number.isFinite(V.value) && A.value.length >= V.value ? (y(), f(c, { key: 1 }, [m("已达 " + x(V.value) + " 人上限,取消已选后可继续选择", 1)], 64)) : (y(), f(c, { key: 2 }, [h(t, {
|
|
213
|
-
name: "carry-out",
|
|
214
|
-
size: 14,
|
|
215
|
-
"aria-hidden": "true"
|
|
216
|
-
}), m(" " + x(A.value.length ? `已选择 ${A.value.length} 项` : U.value ? "请选择一项" : "选择完成后点击确认"), 1)], 64))], 10, ve), p("div", ye, [h(S(T), { onClick: Q }, {
|
|
217
|
-
default: w(() => [...r[9] ||= [m("取消", -1)]]),
|
|
218
|
-
_: 1
|
|
219
|
-
}), h(S(T), {
|
|
220
|
-
type: "primary",
|
|
221
|
-
onClick: Z
|
|
207
|
+
return (n, r) => (y(), u(S(de), { theme: K.value.config }, {
|
|
208
|
+
default: w(() => [h(e, {
|
|
209
|
+
modelValue: _.value,
|
|
210
|
+
"onUpdate:modelValue": r[7] ||= (e) => _.value = e,
|
|
211
|
+
title: De.value,
|
|
212
|
+
"modal-props": Pe.value,
|
|
213
|
+
onOnCancel: Q,
|
|
214
|
+
onOnConfirm: Z
|
|
222
215
|
}, {
|
|
223
|
-
|
|
216
|
+
footer: w(() => [p("div", be, [p("span", {
|
|
217
|
+
class: v(["gd-ant-selector__footer-status", { "gd-ant-selector__footer-status--warning": N.value || Number.isFinite(V.value) && k.value.length >= V.value && !U.value }]),
|
|
218
|
+
role: N.value ? "alert" : "status"
|
|
219
|
+
}, [N.value ? (y(), f(c, { key: 0 }, [m(x(N.value), 1)], 64)) : !U.value && Number.isFinite(V.value) && k.value.length >= V.value ? (y(), f(c, { key: 1 }, [m("已达 " + x(V.value) + " 人上限,取消已选后可继续选择", 1)], 64)) : (y(), f(c, { key: 2 }, [h(t, {
|
|
220
|
+
name: "carry-out",
|
|
221
|
+
size: 14,
|
|
222
|
+
"aria-hidden": "true"
|
|
223
|
+
}), m(" " + x(k.value.length ? `已选择 ${k.value.length} 项` : U.value ? "请选择一项" : "选择完成后点击确认"), 1)], 64))], 10, xe), p("div", Se, [h(S(T), { onClick: Q }, {
|
|
224
|
+
default: w(() => [...r[9] ||= [m("取消", -1)]]),
|
|
225
|
+
_: 1
|
|
226
|
+
}), h(S(T), {
|
|
227
|
+
type: "primary",
|
|
228
|
+
onClick: Z
|
|
229
|
+
}, {
|
|
230
|
+
default: w(() => [r[10] ||= m(" 确认选择", -1), k.value.length ? (y(), f("span", Ce, "(" + x(k.value.length) + ")", 1)) : d("", !0)]),
|
|
231
|
+
_: 1
|
|
232
|
+
})])])]),
|
|
233
|
+
default: w(() => [p("div", fe, [
|
|
234
|
+
s.mode === "user" ? (y(), f("div", pe, [r[8] ||= p("span", null, [m("方案比较 "), p("small", null, "切换保留本次选择")], -1), p("div", me, [p("button", {
|
|
235
|
+
type: "button",
|
|
236
|
+
"aria-pressed": A.value === "A",
|
|
237
|
+
onClick: r[0] ||= (e) => q("A")
|
|
238
|
+
}, "A · 逐级浏览", 8, he), p("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
"aria-pressed": A.value === "B",
|
|
241
|
+
onClick: r[1] ||= (e) => q("B")
|
|
242
|
+
}, "B · 通讯录", 8, ge)])])) : d("", !0),
|
|
243
|
+
H.value ? (y(), f("div", _e, [(y(!0), f(c, null, le(G.value, (e, n) => (y(), f("button", {
|
|
244
|
+
id: `gd-ant-selector-tab-${e}`,
|
|
245
|
+
key: e,
|
|
246
|
+
type: "button",
|
|
247
|
+
role: "tab",
|
|
248
|
+
"aria-selected": j.value === e,
|
|
249
|
+
tabindex: j.value === e ? 0 : -1,
|
|
250
|
+
"aria-controls": "gd-ant-selector-panel",
|
|
251
|
+
onClick: (t) => $(e),
|
|
252
|
+
onKeydown: (e) => Ne(e, n)
|
|
253
|
+
}, [
|
|
254
|
+
h(t, {
|
|
255
|
+
name: e === "dept" ? "bumen" : e === "role" ? "a-jiaoseguanli2" : "zuzhijiagou",
|
|
256
|
+
size: 16,
|
|
257
|
+
"aria-hidden": "true"
|
|
258
|
+
}, null, 8, ["name"]),
|
|
259
|
+
m(" " + x(S(a)[e]) + " ", 1),
|
|
260
|
+
p("span", null, x(k.value.filter((t) => t.type === e).length), 1)
|
|
261
|
+
], 40, ve))), 128))])) : d("", !0),
|
|
262
|
+
p("div", { class: v(["gd-ant-selector__dialog-layout", { "gd-ant-selector__dialog-layout--three": W.value }]) }, [p("div", {
|
|
263
|
+
id: "gd-ant-selector-panel",
|
|
264
|
+
class: "gd-ant-selector__candidates",
|
|
265
|
+
role: H.value ? "tabpanel" : void 0,
|
|
266
|
+
"aria-labelledby": H.value ? `gd-ant-selector-tab-${j.value}` : void 0
|
|
267
|
+
}, [j.value === "user" ? (y(), u(ae, {
|
|
268
|
+
key: 0,
|
|
269
|
+
nodes: S(F),
|
|
270
|
+
variant: H.value ? "B" : A.value,
|
|
271
|
+
active: M.value,
|
|
272
|
+
selected: k.value,
|
|
273
|
+
limit: V.value,
|
|
274
|
+
radio: U.value,
|
|
275
|
+
group: H.value,
|
|
276
|
+
members: S(L),
|
|
277
|
+
loading: H.value ? S(we) : S(R),
|
|
278
|
+
"tree-loading": S(R),
|
|
279
|
+
error: H.value ? S(Ee) : S(B),
|
|
280
|
+
"tree-error": S(B),
|
|
281
|
+
onNavigate: r[2] ||= (e) => M.value = e,
|
|
282
|
+
onToggle: Y,
|
|
283
|
+
onBulk: r[3] ||= (e) => k.value = S(o)(k.value, e, {
|
|
284
|
+
mode: s.mode,
|
|
285
|
+
selection: s.selection,
|
|
286
|
+
maxCount: s.maxCount
|
|
287
|
+
}),
|
|
288
|
+
onRetry: r[4] ||= (e) => H.value ? S(P).loadMembers(M.value, !0) : J(),
|
|
289
|
+
onRetryTree: J
|
|
290
|
+
}, null, 8, [
|
|
291
|
+
"nodes",
|
|
292
|
+
"variant",
|
|
293
|
+
"active",
|
|
294
|
+
"selected",
|
|
295
|
+
"limit",
|
|
296
|
+
"radio",
|
|
297
|
+
"group",
|
|
298
|
+
"members",
|
|
299
|
+
"loading",
|
|
300
|
+
"tree-loading",
|
|
301
|
+
"error",
|
|
302
|
+
"tree-error"
|
|
303
|
+
])) : j.value === "dept" ? (y(), u(ie, {
|
|
304
|
+
key: 1,
|
|
305
|
+
nodes: S(F),
|
|
306
|
+
selected: k.value,
|
|
307
|
+
radio: U.value,
|
|
308
|
+
loading: S(R),
|
|
309
|
+
error: S(B),
|
|
310
|
+
onToggle: Y,
|
|
311
|
+
onRetry: J
|
|
312
|
+
}, null, 8, [
|
|
313
|
+
"nodes",
|
|
314
|
+
"selected",
|
|
315
|
+
"radio",
|
|
316
|
+
"loading",
|
|
317
|
+
"error"
|
|
318
|
+
])) : (y(), u(oe, {
|
|
319
|
+
key: 2,
|
|
320
|
+
roles: S(I),
|
|
321
|
+
selected: k.value,
|
|
322
|
+
radio: U.value,
|
|
323
|
+
group: H.value,
|
|
324
|
+
loading: S(z),
|
|
325
|
+
error: S(Te),
|
|
326
|
+
onToggle: Y,
|
|
327
|
+
onBulk: r[5] ||= (e) => k.value = S(o)(k.value, e, {
|
|
328
|
+
mode: s.mode,
|
|
329
|
+
selection: s.selection,
|
|
330
|
+
maxCount: s.maxCount
|
|
331
|
+
}),
|
|
332
|
+
onRetry: r[6] ||= (e) => S(P).loadRoles(!0)
|
|
333
|
+
}, null, 8, [
|
|
334
|
+
"roles",
|
|
335
|
+
"selected",
|
|
336
|
+
"radio",
|
|
337
|
+
"group",
|
|
338
|
+
"loading",
|
|
339
|
+
"error"
|
|
340
|
+
]))], 8, ye), h(se, {
|
|
341
|
+
selected: X.value,
|
|
342
|
+
limit: V.value,
|
|
343
|
+
grouped: H.value,
|
|
344
|
+
onRemove: Ae,
|
|
345
|
+
onClear: je
|
|
346
|
+
}, null, 8, [
|
|
347
|
+
"selected",
|
|
348
|
+
"limit",
|
|
349
|
+
"grouped"
|
|
350
|
+
])], 2)
|
|
351
|
+
])]),
|
|
224
352
|
_: 1
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
"aria-pressed": j.value === "A",
|
|
230
|
-
onClick: r[0] ||= (e) => K("A")
|
|
231
|
-
}, "A · 逐级浏览", 8, fe), p("button", {
|
|
232
|
-
type: "button",
|
|
233
|
-
"aria-pressed": j.value === "B",
|
|
234
|
-
onClick: r[1] ||= (e) => K("B")
|
|
235
|
-
}, "B · 通讯录", 8, pe)])])) : d("", !0),
|
|
236
|
-
H.value ? (y(), f("div", me, [(y(!0), f(c, null, se(G.value, (e, n) => (y(), f("button", {
|
|
237
|
-
id: `gd-ant-selector-tab-${e}`,
|
|
238
|
-
key: e,
|
|
239
|
-
type: "button",
|
|
240
|
-
role: "tab",
|
|
241
|
-
"aria-selected": M.value === e,
|
|
242
|
-
tabindex: M.value === e ? 0 : -1,
|
|
243
|
-
"aria-controls": "gd-ant-selector-panel",
|
|
244
|
-
onClick: (t) => $(e),
|
|
245
|
-
onKeydown: (e) => Ae(e, n)
|
|
246
|
-
}, [
|
|
247
|
-
h(t, {
|
|
248
|
-
name: e === "dept" ? "bumen" : e === "role" ? "a-jiaoseguanli2" : "zuzhijiagou",
|
|
249
|
-
size: 16,
|
|
250
|
-
"aria-hidden": "true"
|
|
251
|
-
}, null, 8, ["name"]),
|
|
252
|
-
m(" " + x(S(o)[e]) + " ", 1),
|
|
253
|
-
p("span", null, x(A.value.filter((t) => t.type === e).length), 1)
|
|
254
|
-
], 40, he))), 128))])) : d("", !0),
|
|
255
|
-
p("div", { class: v(["gd-ant-selector__dialog-layout", { "gd-ant-selector__dialog-layout--three": W.value }]) }, [p("div", {
|
|
256
|
-
id: "gd-ant-selector-panel",
|
|
257
|
-
class: "gd-ant-selector__candidates",
|
|
258
|
-
role: H.value ? "tabpanel" : void 0,
|
|
259
|
-
"aria-labelledby": H.value ? `gd-ant-selector-tab-${M.value}` : void 0
|
|
260
|
-
}, [M.value === "user" ? (y(), u(re, {
|
|
261
|
-
key: 0,
|
|
262
|
-
nodes: S(I),
|
|
263
|
-
variant: H.value ? "B" : j.value,
|
|
264
|
-
active: N.value,
|
|
265
|
-
selected: A.value,
|
|
266
|
-
limit: V.value,
|
|
267
|
-
radio: U.value,
|
|
268
|
-
group: H.value,
|
|
269
|
-
members: S(R),
|
|
270
|
-
loading: H.value ? S(Se) : S(z),
|
|
271
|
-
"tree-loading": S(z),
|
|
272
|
-
error: H.value ? S(we) : S(B),
|
|
273
|
-
"tree-error": S(B),
|
|
274
|
-
onNavigate: r[2] ||= (e) => N.value = e,
|
|
275
|
-
onToggle: J,
|
|
276
|
-
onBulk: r[3] ||= (e) => A.value = S(s)(A.value, e, {
|
|
277
|
-
mode: g.mode,
|
|
278
|
-
selection: g.selection,
|
|
279
|
-
maxCount: g.maxCount
|
|
280
|
-
}),
|
|
281
|
-
onRetry: r[4] ||= (e) => H.value ? S(F).loadMembers(N.value, !0) : q(),
|
|
282
|
-
onRetryTree: q
|
|
283
|
-
}, null, 8, [
|
|
284
|
-
"nodes",
|
|
285
|
-
"variant",
|
|
286
|
-
"active",
|
|
287
|
-
"selected",
|
|
288
|
-
"limit",
|
|
289
|
-
"radio",
|
|
290
|
-
"group",
|
|
291
|
-
"members",
|
|
292
|
-
"loading",
|
|
293
|
-
"tree-loading",
|
|
294
|
-
"error",
|
|
295
|
-
"tree-error"
|
|
296
|
-
])) : M.value === "dept" ? (y(), u(ne, {
|
|
297
|
-
key: 1,
|
|
298
|
-
nodes: S(I),
|
|
299
|
-
selected: A.value,
|
|
300
|
-
radio: U.value,
|
|
301
|
-
loading: S(z),
|
|
302
|
-
error: S(B),
|
|
303
|
-
onToggle: J,
|
|
304
|
-
onRetry: q
|
|
305
|
-
}, null, 8, [
|
|
306
|
-
"nodes",
|
|
307
|
-
"selected",
|
|
308
|
-
"radio",
|
|
309
|
-
"loading",
|
|
310
|
-
"error"
|
|
311
|
-
])) : (y(), u(ie, {
|
|
312
|
-
key: 2,
|
|
313
|
-
roles: S(L),
|
|
314
|
-
selected: A.value,
|
|
315
|
-
radio: U.value,
|
|
316
|
-
group: H.value,
|
|
317
|
-
loading: S(xe),
|
|
318
|
-
error: S(Ce),
|
|
319
|
-
onToggle: J,
|
|
320
|
-
onBulk: r[5] ||= (e) => A.value = S(s)(A.value, e, {
|
|
321
|
-
mode: g.mode,
|
|
322
|
-
selection: g.selection,
|
|
323
|
-
maxCount: g.maxCount
|
|
324
|
-
}),
|
|
325
|
-
onRetry: r[6] ||= (e) => S(F).loadRoles(!0)
|
|
326
|
-
}, null, 8, [
|
|
327
|
-
"roles",
|
|
328
|
-
"selected",
|
|
329
|
-
"radio",
|
|
330
|
-
"group",
|
|
331
|
-
"loading",
|
|
332
|
-
"error"
|
|
333
|
-
]))], 8, ge), h(ae, {
|
|
334
|
-
selected: X.value,
|
|
335
|
-
limit: V.value,
|
|
336
|
-
grouped: H.value,
|
|
337
|
-
onRemove: Y,
|
|
338
|
-
onClear: Oe
|
|
339
|
-
}, null, 8, [
|
|
340
|
-
"selected",
|
|
341
|
-
"limit",
|
|
342
|
-
"grouped"
|
|
343
|
-
])], 2)
|
|
353
|
+
}, 8, [
|
|
354
|
+
"modelValue",
|
|
355
|
+
"title",
|
|
356
|
+
"modal-props"
|
|
344
357
|
])]),
|
|
345
358
|
_: 1
|
|
346
|
-
}, 8, [
|
|
347
|
-
"modelValue",
|
|
348
|
-
"title",
|
|
349
|
-
"modal-props"
|
|
350
|
-
]));
|
|
359
|
+
}, 8, ["theme"]));
|
|
351
360
|
}
|
|
352
361
|
});
|
|
353
362
|
//#endregion
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { generatePalette as e } from "../../hooks/setup-theme.mjs";
|
|
2
|
+
//#region src/components/selector-core/selection-theme.ts
|
|
3
|
+
var t = "#1161ff", n = [
|
|
4
|
+
"50",
|
|
5
|
+
"100",
|
|
6
|
+
"200",
|
|
7
|
+
"300",
|
|
8
|
+
"400",
|
|
9
|
+
"500",
|
|
10
|
+
"600",
|
|
11
|
+
"700",
|
|
12
|
+
"800",
|
|
13
|
+
"900"
|
|
14
|
+
], r = {
|
|
15
|
+
50: "#f4f9ff",
|
|
16
|
+
100: "#e9f1f6",
|
|
17
|
+
200: "#bcd7ff",
|
|
18
|
+
300: "#7fb0ff",
|
|
19
|
+
400: "#3b87ff",
|
|
20
|
+
500: t,
|
|
21
|
+
600: "#0d4ed1",
|
|
22
|
+
700: "#0a3da5",
|
|
23
|
+
800: "#082c79",
|
|
24
|
+
900: "#05204d"
|
|
25
|
+
};
|
|
26
|
+
function i(t) {
|
|
27
|
+
let i = t?.trim(), a = i ? e(i) : r, o = n.every((e) => !!a[e]), s = a[500]?.toLowerCase(), c = o && s !== "#1161ff" ? a : r, l = c[500];
|
|
28
|
+
return {
|
|
29
|
+
color: l,
|
|
30
|
+
style: Object.fromEntries(n.map((e) => [`--gd-selection-primary-${e}`, c[e]])),
|
|
31
|
+
config: { token: { colorPrimary: l } }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { t as DEFAULT_SELECTION_ACTIVE_COLOR, i as createSelectionTheme };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../selector-core/model.cjs`),t=require(`../../selector-core/components/SelectorDialog.cjs`),
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../selector-core/model.cjs`),t=require(`../../selector-core/selection-theme.cjs`),n=require(`../../selector-core/components/SelectorDialog.cjs`),r=require(`../../selector-core/components/SelectionChips.cjs`),i=require(`./types.cjs`);let a=require(`vue`),o=require(`ant-design-vue`);var s=(0,a.defineComponent)({name:`KDeptSelector`,__name:`DeptSelector`,props:i.deptSelectorProps,emits:i.deptSelectorEmits,setup(i,{emit:s}){let c=i,l=s,u=(0,a.useAttrs)(),d=(0,a.computed)(()=>t.createSelectionTheme(c.activeColor)),f=(0,a.computed)(()=>c.isBuiltInRequest?e.defaultFieldNames:c.fieldNames),p=(0,a.computed)(()=>(Array.isArray(c.modelValue)?c.modelValue:c.modelValue?[c.modelValue]:[]).map(t=>({type:`dept`,value:e.text(t[f.value.key]),label:e.text(t[f.value.title]),raw:t})).filter(e=>e.value)),m=(0,a.computed)(()=>{let{modalProps:e,...t}=u;return{cancelText:`取消`,okText:`确定`,...t,...e||{}}});function h(e){l(`update:visible`,e===!0)}function g(t){let{values:n,confirm:r}=e.serializeDepartments(t,f.value),i=c.type===`radio`?n[0]||null:n;l(`update:visible`,!1),l(`update:modelValue`,i),l(`confirm`,r)}function _(){l(`update:visible`,!1),l(`cancel`)}function v(e){if(c.type===`radio`){l(`update:modelValue`,null);return}l(`update:modelValue`,(Array.isArray(c.modelValue)?c.modelValue:[]).filter(t=>String(t[f.value.key])!==e))}return(e,t)=>((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.FormItemRest),null,{default:(0,a.withCtx)(()=>[(0,a.createElementVNode)(`div`,{class:`gd-ant-dept-selector`,style:(0,a.normalizeStyle)(d.value.style)},[c.hideSlot?(0,a.createCommentVNode)(``,!0):(0,a.renderSlot)(e.$slots,`default`,{key:0},()=>[(0,a.createVNode)(r.default,{items:p.value,"max-visible-count":c.maxVisibleCount,"add-text":`选择部门`,onAdd:t[0]||=e=>l(`update:visible`,!0),onRemove:t[1]||=e=>v(e.value)},null,8,[`items`,`max-visible-count`])]),(0,a.createVNode)(n.default,{open:c.visible,mode:`dept`,selected:p.value,selection:c.type,title:`选择部门`,"tree-data":c.treeData,"field-names":f.value,http:c.http,prefix:c.prefix,"is-built-in-request":c.isBuiltInRequest,"active-color":c.activeColor,"modal-props":m.value,"onUpdate:open":h,onConfirm:g,onCancel:_},null,8,[`open`,`selected`,`selection`,`tree-data`,`field-names`,`http`,`prefix`,`is-built-in-request`,`active-color`,`modal-props`])],4)]),_:3}))}});exports.default=s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={visible:Boolean,modelValue:{type:[Array,Object],default:()=>[]},type:{type:String,default:`checkbox`},treeData:{type:Array,default:()=>[]},fieldNames:{type:Object,default:()=>({title:`label`,key:`id`,children:`children`})},isBuiltInRequest:{type:Boolean,default:!1},http:{type:[Object,Function],default:()=>{}},prefix:String,maxVisibleCount:{type:Number,default:5},hideSlot:{type:Boolean,default:!1}},t=`/security/dept/company/tree`,n={"update:visible":e=>!0,"update:modelValue":e=>!0,confirm:e=>!0,cancel:()=>!0};exports.GET_DEPT_TREE_URL=t,exports.deptSelectorEmits=n,exports.deptSelectorProps=e;
|
|
1
|
+
var e={visible:Boolean,modelValue:{type:[Array,Object],default:()=>[]},type:{type:String,default:`checkbox`},treeData:{type:Array,default:()=>[]},fieldNames:{type:Object,default:()=>({title:`label`,key:`id`,children:`children`})},isBuiltInRequest:{type:Boolean,default:!1},http:{type:[Object,Function],default:()=>{}},prefix:String,activeColor:{type:String,default:`#1161ff`},maxVisibleCount:{type:Number,default:5},hideSlot:{type:Boolean,default:!1}},t=`/security/dept/company/tree`,n={"update:visible":e=>!0,"update:modelValue":e=>!0,confirm:e=>!0,cancel:()=>!0};exports.GET_DEPT_TREE_URL=t,exports.deptSelectorEmits=n,exports.deptSelectorProps=e;
|