@guodun/antdv 1.6.2 → 1.6.4
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 +5 -1
- 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/es/components/selector-core/useSelectorData.mjs +1 -1
- 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/lib/components/selector-core/useSelectorData.cjs +1 -1
- 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 +9 -2
- 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,107 +1,109 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/use-namespace/index.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { createSelectionTheme as t } from "../../selector-core/selection-theme.mjs";
|
|
3
|
+
import { useProMenuTree as n } from "./hooks.mjs";
|
|
4
|
+
import { MENU_TREE_URL as r, proMenuTreeEmits as i, proMenuTreeProps as a } from "./types.mjs";
|
|
5
|
+
import { Fragment as o, computed as s, createTextVNode as c, createVNode as l, defineComponent as u, mergeProps as d, onMounted as ee, reactive as te, ref as f, watch as p } from "vue";
|
|
6
|
+
import { Button as m, ConfigProvider as ne, Empty as h, InputSearch as g, Spin as re, Tree as ie, message as _ } from "ant-design-vue";
|
|
6
7
|
//#region src/components/pro-menu-tree/src/pro-menu-tree.tsx
|
|
7
|
-
var v = /* @__PURE__ */
|
|
8
|
+
var v = /* @__PURE__ */ u({
|
|
8
9
|
name: "KProMenuTree",
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
props: a,
|
|
12
|
+
emits: i,
|
|
13
|
+
setup(i, { attrs: a, emit: u, slots: v, expose: ae }) {
|
|
14
|
+
let y = e("pro-menu-tree"), { treeData: oe, nodeMap: se, normalizeTree: b, getAllSelectableNodeIds: x, getAllExpandableKeys: S, getDefaultExpandedKeys: C, searchTree: w, getFilteredTree: T, buildCheckedStateFromIds: ce, buildCheckedStateAfterToggle: le, isButton: ue } = n(() => ({
|
|
15
|
+
fieldNames: i.fieldNames,
|
|
16
|
+
nodeTypeField: i.nodeTypeField,
|
|
17
|
+
buttonType: i.buttonType
|
|
18
|
+
})), E = f(!1), D = f(""), O = f([]), k = f(!0), A = te({
|
|
17
19
|
checked: [],
|
|
18
20
|
halfChecked: []
|
|
19
|
-
}),
|
|
20
|
-
checked:
|
|
21
|
-
halfChecked:
|
|
22
|
-
})),
|
|
21
|
+
}), j = !1, de = s(() => i.fieldNames.key), fe = s(() => i.fieldNames.title), M = s(() => i.showExpandActions ?? i.showToolbar), N = s(() => i.showClearAction ?? i.showToolbar), P = s(() => i.isBuiltInRequest && i.showRefreshAction), F = s(() => i.disabled), I = s(() => i.searchable || i.showToolbar || i.showStats || M.value || N.value || P.value), L = s(() => ({
|
|
22
|
+
checked: A.checked.length,
|
|
23
|
+
halfChecked: A.halfChecked.length
|
|
24
|
+
})), R = s(() => T(D.value)), z = s(() => t(i.activeColor));
|
|
23
25
|
function B() {
|
|
24
|
-
return [...
|
|
26
|
+
return [...A.checked, ...A.halfChecked].map((e) => ({
|
|
25
27
|
id: e,
|
|
26
28
|
selected: !0
|
|
27
29
|
}));
|
|
28
30
|
}
|
|
29
31
|
function V(e) {
|
|
30
|
-
|
|
32
|
+
A.checked = e.checked, A.halfChecked = e.halfChecked;
|
|
31
33
|
}
|
|
32
34
|
function H() {
|
|
33
|
-
|
|
35
|
+
F.value || (q(x()), J());
|
|
34
36
|
}
|
|
35
37
|
function U() {
|
|
36
|
-
if (
|
|
37
|
-
let e = new Set([...
|
|
38
|
+
if (F.value) return;
|
|
39
|
+
let e = new Set([...A.checked, ...A.halfChecked]);
|
|
38
40
|
q(x().filter((t) => !e.has(t))), J();
|
|
39
41
|
}
|
|
40
42
|
function W() {
|
|
41
|
-
|
|
43
|
+
F.value || (V({
|
|
42
44
|
checked: [],
|
|
43
45
|
halfChecked: []
|
|
44
46
|
}), J());
|
|
45
47
|
}
|
|
46
48
|
function G() {
|
|
47
|
-
|
|
49
|
+
F.value || (O.value = S(), k.value = !0);
|
|
48
50
|
}
|
|
49
51
|
function K() {
|
|
50
|
-
|
|
52
|
+
F.value || (O.value = [], k.value = !1);
|
|
51
53
|
}
|
|
52
54
|
function q(e) {
|
|
53
|
-
V(
|
|
55
|
+
V(ce(e ?? []));
|
|
54
56
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
+
function pe(e, t) {
|
|
58
|
+
i.disabled || (V(le(A, String(t.node[de.value] ?? t.node.key ?? t.node.eventKey ?? ""), t.checked)), J());
|
|
57
59
|
}
|
|
58
60
|
function J() {
|
|
59
|
-
|
|
61
|
+
j = !0, u("update:modelValue", [...A.checked, ...A.halfChecked]), u("change", B());
|
|
60
62
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
+
function me() {
|
|
64
|
+
se.value.size !== 0 && q(i.modelValue ?? []);
|
|
63
65
|
}
|
|
64
66
|
function Y(e) {
|
|
65
|
-
|
|
67
|
+
b(e), O.value = C(i.defaultExpandAll), D.value = "", k.value = !0, q(i.modelValue ?? []);
|
|
66
68
|
}
|
|
67
69
|
async function X() {
|
|
68
|
-
|
|
70
|
+
F.value || !i.isBuiltInRequest || await Z();
|
|
69
71
|
}
|
|
70
72
|
async function Z() {
|
|
71
|
-
if (!
|
|
73
|
+
if (!i.http?.get) {
|
|
72
74
|
_.error("请传入 http 实例");
|
|
73
75
|
return;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
E.value = !0;
|
|
76
78
|
try {
|
|
77
|
-
let e = await
|
|
78
|
-
e.status === 0 ? (Y(Array.isArray(e.data) ? e.data : []),
|
|
79
|
+
let e = await i.http.get(`${i.prefix ?? ""}${r}`);
|
|
80
|
+
e.status === 0 ? (Y(Array.isArray(e.data) ? e.data : []), u("ready")) : _.error(e.message ?? e.msg ?? "获取菜单树失败");
|
|
79
81
|
} catch (e) {
|
|
80
82
|
_.error(e instanceof Error ? e.message : "获取菜单树失败");
|
|
81
83
|
} finally {
|
|
82
|
-
|
|
84
|
+
E.value = !1;
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}), p(() =>
|
|
88
|
-
|
|
89
|
-
}), p(() =>
|
|
90
|
-
if (
|
|
91
|
-
|
|
87
|
+
ee(() => {
|
|
88
|
+
i.isBuiltInRequest ? Z() : (Y(i.treeData ?? []), u("ready"));
|
|
89
|
+
}), p(() => i.treeData, (e) => {
|
|
90
|
+
i.isBuiltInRequest || Y(e ?? []);
|
|
91
|
+
}), p(() => i.modelValue, () => {
|
|
92
|
+
if (j) {
|
|
93
|
+
j = !1;
|
|
92
94
|
return;
|
|
93
95
|
}
|
|
94
|
-
|
|
96
|
+
me();
|
|
95
97
|
}, { deep: !0 });
|
|
96
98
|
function Q(e) {
|
|
97
|
-
if (
|
|
98
|
-
let t =
|
|
99
|
-
|
|
99
|
+
if (F.value) return;
|
|
100
|
+
let t = w(e);
|
|
101
|
+
D.value = t.keyword, k.value = !0, O.value = t.keyword ? t.expandedKeys : C(i.defaultExpandAll);
|
|
100
102
|
}
|
|
101
|
-
function
|
|
102
|
-
|
|
103
|
+
function he(e) {
|
|
104
|
+
O.value = e, k.value = !1;
|
|
103
105
|
}
|
|
104
|
-
|
|
106
|
+
ae({
|
|
105
107
|
getSelectedStatusArray: B,
|
|
106
108
|
setCheckedKeysFromIds: q,
|
|
107
109
|
selectAll: H,
|
|
@@ -111,37 +113,37 @@ var v = /* @__PURE__ */ l({
|
|
|
111
113
|
collapseAll: K,
|
|
112
114
|
reload: X
|
|
113
115
|
});
|
|
114
|
-
let
|
|
115
|
-
if (!
|
|
116
|
-
let t = e.indexOf(
|
|
117
|
-
return t === -1 ?
|
|
116
|
+
let ge = (e) => {
|
|
117
|
+
if (!D.value) return l("span", { class: y.e("title") }, [e], 2);
|
|
118
|
+
let t = e.indexOf(D.value);
|
|
119
|
+
return t === -1 ? l("span", { class: y.e("title") }, [e], 2) : l("span", { class: y.e("title") }, [
|
|
118
120
|
e.substring(0, t),
|
|
119
|
-
|
|
120
|
-
e.substring(t +
|
|
121
|
+
l("span", { class: y.e("keyword") }, [e.substring(t, t + D.value.length)], 2),
|
|
122
|
+
e.substring(t + D.value.length)
|
|
121
123
|
], 2);
|
|
122
|
-
},
|
|
123
|
-
let t =
|
|
124
|
-
return
|
|
124
|
+
}, $ = (e) => {
|
|
125
|
+
let t = ue(e), n = String(e[fe.value] ?? ""), r = e[i.iconField];
|
|
126
|
+
return l("div", { class: [y.e("node"), t ? "pro-menu-tree-button" : ""] }, [l("div", { class: y.e("node-inner") }, [!t && v.icon ? v.icon({
|
|
125
127
|
node: e,
|
|
126
|
-
icon:
|
|
127
|
-
}) : null,
|
|
128
|
-
},
|
|
129
|
-
treeData:
|
|
130
|
-
fieldNames:
|
|
128
|
+
icon: r
|
|
129
|
+
}) : null, ge(n)], 2)], 2);
|
|
130
|
+
}, _e = () => l(ie, {
|
|
131
|
+
treeData: R.value,
|
|
132
|
+
fieldNames: i.fieldNames,
|
|
131
133
|
checkedKeys: {
|
|
132
|
-
checked:
|
|
133
|
-
halfChecked:
|
|
134
|
+
checked: A.checked,
|
|
135
|
+
halfChecked: A.halfChecked
|
|
134
136
|
},
|
|
135
|
-
expandedKeys:
|
|
136
|
-
autoExpandParent:
|
|
137
|
+
expandedKeys: O.value,
|
|
138
|
+
autoExpandParent: k.value,
|
|
137
139
|
checkable: !0,
|
|
138
140
|
checkStrictly: !0,
|
|
139
|
-
disabled:
|
|
141
|
+
disabled: i.disabled,
|
|
140
142
|
selectable: !1,
|
|
141
|
-
onCheck:
|
|
142
|
-
onExpand:
|
|
143
|
+
onCheck: pe,
|
|
144
|
+
onExpand: he
|
|
143
145
|
}, {
|
|
144
|
-
title: (e) =>
|
|
146
|
+
title: (e) => $(e),
|
|
145
147
|
_: 1
|
|
146
148
|
}, 8, [
|
|
147
149
|
"treeData",
|
|
@@ -154,47 +156,50 @@ var v = /* @__PURE__ */ l({
|
|
|
154
156
|
"disabled",
|
|
155
157
|
"onCheck",
|
|
156
158
|
"onExpand"
|
|
157
|
-
]),
|
|
158
|
-
|
|
159
|
+
]), ve = () => i.showToolbar || N.value || M.value || P.value ? l("div", { class: y.e("actions") }, [
|
|
160
|
+
i.showToolbar && l(o, null, [l(m, {
|
|
159
161
|
size: "small",
|
|
160
|
-
disabled:
|
|
162
|
+
disabled: i.disabled,
|
|
161
163
|
onClick: H
|
|
162
|
-
}, { default: () => [
|
|
164
|
+
}, { default: () => [c("全选")] }, 8, ["disabled", "onClick"]), l(m, {
|
|
163
165
|
size: "small",
|
|
164
|
-
disabled:
|
|
166
|
+
disabled: i.disabled,
|
|
165
167
|
onClick: U
|
|
166
|
-
}, { default: () => [
|
|
167
|
-
|
|
168
|
+
}, { default: () => [c("反选")] }, 8, ["disabled", "onClick"])]),
|
|
169
|
+
N.value && l(m, {
|
|
168
170
|
size: "small",
|
|
169
|
-
disabled:
|
|
171
|
+
disabled: i.disabled,
|
|
170
172
|
onClick: W
|
|
171
|
-
}, { default: () => [
|
|
172
|
-
|
|
173
|
+
}, { default: () => [c("清空")] }, 8, ["disabled", "onClick"]),
|
|
174
|
+
M.value && l(o, null, [l(m, {
|
|
173
175
|
size: "small",
|
|
174
|
-
disabled:
|
|
176
|
+
disabled: F.value,
|
|
175
177
|
onClick: G
|
|
176
|
-
}, { default: () => [
|
|
178
|
+
}, { default: () => [c("展开全部")] }, 8, ["disabled", "onClick"]), l(m, {
|
|
177
179
|
size: "small",
|
|
178
|
-
disabled:
|
|
180
|
+
disabled: F.value,
|
|
179
181
|
onClick: K
|
|
180
|
-
}, { default: () => [
|
|
181
|
-
|
|
182
|
+
}, { default: () => [c("收起全部")] }, 8, ["disabled", "onClick"])]),
|
|
183
|
+
P.value && l(m, {
|
|
182
184
|
size: "small",
|
|
183
|
-
disabled:
|
|
184
|
-
loading:
|
|
185
|
+
disabled: F.value,
|
|
186
|
+
loading: E.value,
|
|
185
187
|
onClick: X
|
|
186
|
-
}, { default: () => [
|
|
188
|
+
}, { default: () => [c("刷新")] }, 8, [
|
|
187
189
|
"disabled",
|
|
188
190
|
"loading",
|
|
189
191
|
"onClick"
|
|
190
192
|
])
|
|
191
193
|
], 2) : null;
|
|
192
|
-
return () =>
|
|
194
|
+
return () => l(ne, { theme: z.value.config }, { default: () => [l("div", d(a, {
|
|
195
|
+
class: [y.b(), a.class],
|
|
196
|
+
style: [a.style, z.value.style]
|
|
197
|
+
}), [I.value && l("div", { class: y.e("toolbar") }, [l("div", { class: y.e("tools") }, [i.searchable && l(g, {
|
|
193
198
|
class: y.e("search"),
|
|
194
|
-
value:
|
|
199
|
+
value: D.value,
|
|
195
200
|
placeholder: "请输入菜单名称",
|
|
196
201
|
allowClear: !0,
|
|
197
|
-
disabled:
|
|
202
|
+
disabled: F.value,
|
|
198
203
|
onSearch: Q,
|
|
199
204
|
onChange: (e) => Q(e.target?.value ?? "")
|
|
200
205
|
}, null, 8, [
|
|
@@ -204,16 +209,16 @@ var v = /* @__PURE__ */ l({
|
|
|
204
209
|
"disabled",
|
|
205
210
|
"onSearch",
|
|
206
211
|
"onChange"
|
|
207
|
-
]),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
], 2)], 2),
|
|
212
|
+
]), i.showStats && l("span", { class: y.e("stats") }, [
|
|
213
|
+
c("已选 "),
|
|
214
|
+
L.value.checked,
|
|
215
|
+
c(" 项 / 半选 "),
|
|
216
|
+
L.value.halfChecked,
|
|
217
|
+
c(" 项")
|
|
218
|
+
], 2)], 2), ve()], 2), l(re, { spinning: E.value }, { default: () => [l("div", { class: y.e("body") }, [R.value.length > 0 ? _e() : l(h, {
|
|
214
219
|
image: h.PRESENTED_IMAGE_SIMPLE,
|
|
215
220
|
description: "暂无数据"
|
|
216
|
-
}, null, 8, ["image"])], 2)] }, 8, ["spinning"])],
|
|
221
|
+
}, null, 8, ["image"])], 2)] }, 8, ["spinning"])], 16)] }, 8, ["theme"]);
|
|
217
222
|
}
|
|
218
223
|
});
|
|
219
224
|
//#endregion
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { serializeUsers as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
-
import n from "../../selector-core/
|
|
3
|
-
import r from "../../selector-core/components/
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { createSelectionTheme as n } from "../../selector-core/selection-theme.mjs";
|
|
3
|
+
import r from "../../selector-core/components/SelectorDialog.mjs";
|
|
4
|
+
import i from "../../selector-core/components/SelectionChips.mjs";
|
|
5
|
+
import { UserSelectorProps as a, userSelectorEmits as o } from "./types.mjs";
|
|
6
|
+
import { computed as s, createBlock as c, createCommentVNode as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeStyle as p, openBlock as m, renderSlot as h, unref as g, useAttrs as _, withCtx as v } from "vue";
|
|
7
|
+
import { FormItemRest as y } from "ant-design-vue";
|
|
7
8
|
//#region src/components/pro-selector/src/ProUserSelector.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var b = /* @__PURE__ */ f({
|
|
9
10
|
name: "ProUserSelector",
|
|
10
11
|
__name: "ProUserSelector",
|
|
11
|
-
props:
|
|
12
|
-
emits:
|
|
13
|
-
setup(
|
|
14
|
-
let
|
|
12
|
+
props: a,
|
|
13
|
+
emits: o,
|
|
14
|
+
setup(a, { expose: o, emit: f }) {
|
|
15
|
+
let b = a, x = f, S = _(), C = s(() => n(b.activeColor)), w = s(() => b.modelValue.map((e) => ({
|
|
15
16
|
type: "user",
|
|
16
17
|
value: t(e.id),
|
|
17
18
|
label: e.realName,
|
|
@@ -21,8 +22,8 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
21
22
|
id: e.id,
|
|
22
23
|
userId: e.id
|
|
23
24
|
}
|
|
24
|
-
}))),
|
|
25
|
-
let { modalProps: e, ...t } =
|
|
25
|
+
}))), T = s(() => {
|
|
26
|
+
let { modalProps: e, ...t } = S;
|
|
26
27
|
return {
|
|
27
28
|
cancelText: "取消",
|
|
28
29
|
okText: "确定",
|
|
@@ -30,43 +31,47 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
30
31
|
...e || {}
|
|
31
32
|
};
|
|
32
33
|
});
|
|
33
|
-
function
|
|
34
|
-
|
|
34
|
+
function E(e) {
|
|
35
|
+
x("update:visible", e === !0);
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function D(t) {
|
|
37
38
|
let n = e(t);
|
|
38
|
-
|
|
39
|
+
x("update:visible", !1), x("update:modelValue", n), x("confirm", n);
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
41
|
+
function O() {
|
|
42
|
+
x("update:visible", !1), x("cancel");
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
-
|
|
44
|
+
function k(e) {
|
|
45
|
+
x("update:modelValue", b.modelValue.filter((t) => t.id !== e)), x("delete-user", e);
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
-
default:
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
return o({ deleteCheckedUser: k }), (e, t) => (m(), c(g(y), null, {
|
|
48
|
+
default: v(() => [u("div", {
|
|
49
|
+
class: "gd-ant-pro-user-selector",
|
|
50
|
+
style: p(C.value.style)
|
|
51
|
+
}, [b.hideSlot ? l("", !0) : h(e.$slots, "default", { key: 0 }, () => [d(i, {
|
|
52
|
+
items: w.value,
|
|
53
|
+
"max-visible-count": b.maxVisibleCount,
|
|
50
54
|
"add-text": "选择用户",
|
|
51
|
-
onAdd: t[0] ||= (e) =>
|
|
52
|
-
onRemove: t[1] ||= (e) =>
|
|
53
|
-
}, null, 8, ["items", "max-visible-count"])]),
|
|
54
|
-
open:
|
|
55
|
+
onAdd: t[0] ||= (e) => x("update:visible", !0),
|
|
56
|
+
onRemove: t[1] ||= (e) => k(e.value)
|
|
57
|
+
}, null, 8, ["items", "max-visible-count"])]), d(r, {
|
|
58
|
+
open: b.visible,
|
|
55
59
|
mode: "user",
|
|
56
|
-
selected:
|
|
57
|
-
selection:
|
|
58
|
-
"max-count":
|
|
59
|
-
variant:
|
|
60
|
-
title:
|
|
61
|
-
http:
|
|
62
|
-
prefix:
|
|
63
|
-
"init-data":
|
|
64
|
-
"is-built-in-request":
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"onUpdate:
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
selected: w.value,
|
|
61
|
+
selection: b.type,
|
|
62
|
+
"max-count": b.maxCount,
|
|
63
|
+
variant: b.variant,
|
|
64
|
+
title: b.title || "选择联系人",
|
|
65
|
+
http: b.http,
|
|
66
|
+
prefix: b.prefix,
|
|
67
|
+
"init-data": b.initData,
|
|
68
|
+
"is-built-in-request": b.isBuiltInRequest,
|
|
69
|
+
"active-color": b.activeColor,
|
|
70
|
+
"modal-props": T.value,
|
|
71
|
+
"onUpdate:open": E,
|
|
72
|
+
"onUpdate:variant": t[2] ||= (e) => x("update:variant", e),
|
|
73
|
+
onConfirm: D,
|
|
74
|
+
onCancel: O
|
|
70
75
|
}, null, 8, [
|
|
71
76
|
"open",
|
|
72
77
|
"selected",
|
|
@@ -78,11 +83,12 @@ var v = { class: "gd-ant-pro-user-selector" }, y = /* @__PURE__ */ d({
|
|
|
78
83
|
"prefix",
|
|
79
84
|
"init-data",
|
|
80
85
|
"is-built-in-request",
|
|
86
|
+
"active-color",
|
|
81
87
|
"modal-props"
|
|
82
|
-
])])]),
|
|
88
|
+
])], 4)]),
|
|
83
89
|
_: 3
|
|
84
90
|
}));
|
|
85
91
|
}
|
|
86
92
|
});
|
|
87
93
|
//#endregion
|
|
88
|
-
export {
|
|
94
|
+
export { b as default };
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { serializeGroup as e, text as t } from "../../selector-core/model.mjs";
|
|
2
|
-
import n from "../../selector-core/
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { DEFAULT_SELECTION_ACTIVE_COLOR as n, createSelectionTheme as r } from "../../selector-core/selection-theme.mjs";
|
|
3
|
+
import i from "../../selector-core/components/SelectorDialog.mjs";
|
|
4
|
+
import a from "../../selector-core/components/SelectionChips.mjs";
|
|
5
|
+
import { normalizeSelectorOptions as o, removeSelectorOption as s } from "./utils/index.mjs";
|
|
6
|
+
import { computed as c, createBlock as l, createCommentVNode as u, createElementVNode as d, createVNode as f, defineComponent as p, mergeModels as m, normalizeStyle as h, openBlock as g, renderSlot as _, unref as v, useAttrs as y, useModel as b, withCtx as x } from "vue";
|
|
7
|
+
import { FormItemRest as S } from "ant-design-vue";
|
|
7
8
|
//#region src/components/pro-selector-group/src/index.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var C = /* @__PURE__ */ p({
|
|
9
10
|
name: "ProSelectorGroup",
|
|
10
11
|
__name: "index",
|
|
11
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ m({
|
|
12
13
|
title: { default: "选择器" },
|
|
13
14
|
http: {},
|
|
14
15
|
urlPrefix: {},
|
|
16
|
+
activeColor: { default: n },
|
|
15
17
|
isSingle: {
|
|
16
18
|
type: Boolean,
|
|
17
19
|
default: !0
|
|
@@ -35,19 +37,19 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
35
37
|
},
|
|
36
38
|
visibleModifiers: {}
|
|
37
39
|
}),
|
|
38
|
-
emits: /* @__PURE__ */
|
|
40
|
+
emits: /* @__PURE__ */ m([
|
|
39
41
|
"confirm",
|
|
40
42
|
"cancel",
|
|
41
43
|
"changeTab"
|
|
42
44
|
], ["update:modelValue", "update:visible"]),
|
|
43
|
-
setup(
|
|
44
|
-
let
|
|
45
|
-
type: e.type ||
|
|
45
|
+
setup(n, { emit: p }) {
|
|
46
|
+
let m = n, C = p, w = y(), T = b(n, "modelValue"), E = b(n, "visible"), D = c(() => r(m.activeColor)), O = c(() => T.value.map((e) => ({
|
|
47
|
+
type: e.type || m.type || "dept",
|
|
46
48
|
value: t(e.value),
|
|
47
49
|
label: e.label || "",
|
|
48
50
|
raw: e
|
|
49
|
-
}))),
|
|
50
|
-
let { modalProps: e, ...t } =
|
|
51
|
+
}))), k = c(() => {
|
|
52
|
+
let { modalProps: e, ...t } = w;
|
|
51
53
|
return {
|
|
52
54
|
cancelText: "取消",
|
|
53
55
|
okText: "确定",
|
|
@@ -55,36 +57,40 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
55
57
|
...e || {}
|
|
56
58
|
};
|
|
57
59
|
});
|
|
58
|
-
function
|
|
59
|
-
|
|
60
|
+
function A(t) {
|
|
61
|
+
T.value = o(e(t)), E.value = !1, C("confirm");
|
|
60
62
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
+
function j() {
|
|
64
|
+
E.value = !1, C("cancel");
|
|
63
65
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
+
function M(e) {
|
|
67
|
+
T.value = s(T.value, e.value, e.type, m.type || "dept");
|
|
66
68
|
}
|
|
67
|
-
return (e, t) => (
|
|
68
|
-
default:
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
return (e, t) => (g(), l(v(S), null, {
|
|
70
|
+
default: x(() => [d("div", {
|
|
71
|
+
class: "gd-ant-pro-selector-group",
|
|
72
|
+
style: h(D.value.style)
|
|
73
|
+
}, [m.hideSlot ? u("", !0) : _(e.$slots, "default", { key: 0 }, () => [f(a, {
|
|
74
|
+
items: O.value,
|
|
75
|
+
"max-visible-count": m.maxVisibleCount ?? 5,
|
|
71
76
|
"add-text": "选择对象",
|
|
72
|
-
onAdd: t[0] ||= (e) =>
|
|
73
|
-
onRemove:
|
|
74
|
-
}, null, 8, ["items", "max-visible-count"])]),
|
|
75
|
-
open:
|
|
77
|
+
onAdd: t[0] ||= (e) => E.value = !0,
|
|
78
|
+
onRemove: M
|
|
79
|
+
}, null, 8, ["items", "max-visible-count"])]), f(i, {
|
|
80
|
+
open: E.value,
|
|
76
81
|
mode: "group",
|
|
77
|
-
selected:
|
|
78
|
-
"initial-tab":
|
|
79
|
-
"is-single":
|
|
80
|
-
title:
|
|
81
|
-
http:
|
|
82
|
-
prefix:
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
selected: O.value,
|
|
83
|
+
"initial-tab": m.type,
|
|
84
|
+
"is-single": m.isSingle,
|
|
85
|
+
title: m.title,
|
|
86
|
+
http: m.http,
|
|
87
|
+
prefix: m.urlPrefix,
|
|
88
|
+
"active-color": m.activeColor,
|
|
89
|
+
"modal-props": k.value,
|
|
90
|
+
"onUpdate:open": t[1] ||= (e) => E.value = e === !0,
|
|
91
|
+
onConfirm: A,
|
|
92
|
+
onCancel: j,
|
|
93
|
+
onChangeTab: t[2] ||= (e) => C("changeTab", e)
|
|
88
94
|
}, null, 8, [
|
|
89
95
|
"open",
|
|
90
96
|
"selected",
|
|
@@ -93,11 +99,12 @@ var b = { class: "gd-ant-pro-selector-group" }, x = /* @__PURE__ */ d({
|
|
|
93
99
|
"title",
|
|
94
100
|
"http",
|
|
95
101
|
"prefix",
|
|
102
|
+
"active-color",
|
|
96
103
|
"modal-props"
|
|
97
|
-
])])]),
|
|
104
|
+
])], 4)]),
|
|
98
105
|
_: 3
|
|
99
106
|
}));
|
|
100
107
|
}
|
|
101
108
|
});
|
|
102
109
|
//#endregion
|
|
103
|
-
export {
|
|
110
|
+
export { C as default };
|