@guodun/antdv 1.4.4 → 1.4.5
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/contract-signing-location/src/ContractSigningLocation.vue.mjs +85 -85
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- package/dist/es/components/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +914 -853
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +214 -139
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
- package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
- package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -65
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
- package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
- package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
- package/dist/es/components/pro-selector/src/types.mjs +4 -1
- package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
- package/dist/es/components/role-selector/src/role.mjs +134 -120
- package/dist/es/index.mjs +50 -49
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/dept-selector/src/dept.cjs +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
- package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.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 -0
- package/dist/lib/components/role-selector/src/role.cjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/dept-selector.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -1
- package/dist/theme/pro-selector.css +1 -1
- package/dist/theme/role-selector.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
- package/dist/types/components/pro-selector/index.d.ts +9 -0
- package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
- package/dist/types/components/pro-selector/src/types.d.ts +2 -0
- package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
- package/package.json +3 -1
|
@@ -1,114 +1,116 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../hooks/use-namespace/index.mjs";
|
|
2
2
|
import t from "../../pro-modal/index.mjs";
|
|
3
3
|
import n from "../../icon/index.mjs";
|
|
4
|
-
import { UserSelectorProps as r,
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { createTextVNode as
|
|
9
|
-
import { Empty as
|
|
4
|
+
import { UserSelectorProps as r, resolveUserSelectorMaxCount as i, selectUserContextKey as a, userSelectorEmits as o } from "./types.mjs";
|
|
5
|
+
import s from "./components/user.mjs";
|
|
6
|
+
import c from "./components/org-tree.mjs";
|
|
7
|
+
import l from "../../pro-user-avatar/index.mjs";
|
|
8
|
+
import { createTextVNode as u, createVNode as d, defineComponent as f, nextTick as p, provide as m, reactive as h, ref as g, watch as _ } from "vue";
|
|
9
|
+
import { Empty as v, FormItemRest as y, Input as b, message as x } from "ant-design-vue";
|
|
10
10
|
//#region src/components/pro-selector/src/pro-user.tsx
|
|
11
|
-
var { b:
|
|
11
|
+
var { b: S } = e("pro-user-selector"), C = e("user-selector-extermal"), w = /* @__PURE__ */ f({
|
|
12
12
|
name: "ProUserSelector",
|
|
13
13
|
props: r,
|
|
14
|
-
emits:
|
|
15
|
-
setup(e, { emit: r, slots:
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
maxCount: e.maxCount,
|
|
14
|
+
emits: o,
|
|
15
|
+
setup(e, { emit: r, slots: o, expose: f, attrs: w }) {
|
|
16
|
+
let T = g(""), E = g([]), D = g(), O = g(null);
|
|
17
|
+
m(a, h({
|
|
18
|
+
maxCount: i(e.type, e.maxCount),
|
|
19
19
|
http: e.http,
|
|
20
20
|
isBuiltInRequest: e.isBuiltInRequest,
|
|
21
21
|
prefix: e.prefix,
|
|
22
|
-
initData: e.initData
|
|
22
|
+
initData: e.initData,
|
|
23
|
+
type: e.type
|
|
23
24
|
}));
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
A(O.value);
|
|
28
|
-
}));
|
|
25
|
+
let k = g(e.modelValue || []);
|
|
26
|
+
_(() => e.modelValue, (e) => {
|
|
27
|
+
k.value = Array.isArray(e) ? e.map((e) => ({ ...e })) : [], p(() => A(k.value));
|
|
29
28
|
}, {
|
|
30
29
|
deep: !0,
|
|
31
30
|
immediate: !0
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
}), _(() => e.visible, (t) => {
|
|
32
|
+
t && (k.value = e.modelValue.map((e) => ({ ...e })), p(() => A(k.value)));
|
|
33
|
+
}), _(E, (e, t) => {
|
|
34
|
+
e.length > t.length && p(() => {
|
|
35
|
+
O.value && (O.value.scrollTop = O.value.scrollHeight);
|
|
35
36
|
});
|
|
36
37
|
}, { deep: !0 });
|
|
37
38
|
async function A(e) {
|
|
38
|
-
if (await
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
let t = await E.value.dataLoadPromise;
|
|
43
|
-
E.value.getInitData(e, t);
|
|
39
|
+
if (await p(), !D.value) return;
|
|
40
|
+
let t = await D.value.dataLoadPromise;
|
|
41
|
+
D.value.getInitData(e, t);
|
|
44
42
|
}
|
|
45
43
|
let j = (e) => {
|
|
46
|
-
|
|
44
|
+
E.value = E.value.filter((t) => (t.userId || t.id) !== e), D.value?.deleteDeptUser(e);
|
|
47
45
|
};
|
|
48
46
|
function M() {
|
|
49
|
-
|
|
47
|
+
A(k.value);
|
|
50
48
|
}
|
|
51
49
|
let N = () => {
|
|
52
|
-
r("update:visible", !1), r("cancel");
|
|
50
|
+
A(e.modelValue), r("update:visible", !1), r("cancel");
|
|
53
51
|
}, P = (t) => {
|
|
54
|
-
|
|
52
|
+
let n = e.modelValue.filter((e) => e.id !== t);
|
|
53
|
+
k.value = n.map((e) => ({ ...e })), r("update:modelValue", n);
|
|
55
54
|
}, F = () => {
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
if (E.value.length === 0) {
|
|
56
|
+
x.warn("请选择用户");
|
|
58
57
|
return;
|
|
59
58
|
}
|
|
60
|
-
let e =
|
|
61
|
-
id: e.userId,
|
|
59
|
+
let e = E.value.map((e) => ({
|
|
60
|
+
id: e.userId || e.id,
|
|
62
61
|
realName: e.realName || "",
|
|
63
62
|
avatar: e.avatar
|
|
64
63
|
}));
|
|
65
|
-
r("update:visible", !1),
|
|
64
|
+
r("update:visible", !1), r("update:modelValue", e), r("confirm", e);
|
|
66
65
|
};
|
|
67
|
-
|
|
68
|
-
let I = () =>
|
|
66
|
+
f({ deleteCheckedUser: P });
|
|
67
|
+
let I = () => d(t, {
|
|
69
68
|
modelValue: e.visible,
|
|
70
|
-
title: "选择联系人",
|
|
69
|
+
title: e.title || "选择联系人",
|
|
71
70
|
modalProps: {
|
|
72
71
|
cancelText: "取消",
|
|
73
72
|
okText: "确定",
|
|
74
|
-
...
|
|
73
|
+
...w
|
|
75
74
|
},
|
|
76
|
-
onOnCancel:
|
|
77
|
-
onOnConfirm: () => F()
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
75
|
+
onOnCancel: N,
|
|
76
|
+
onOnConfirm: () => F(),
|
|
77
|
+
"onUpdate:modelValue": (t) => {
|
|
78
|
+
t || A(e.modelValue), r("update:visible", t);
|
|
79
|
+
}
|
|
80
|
+
}, { default: () => [d("div", { class: S() }, [d("div", { class: S("content-left") }, [d("div", { style: "padding: 16px 16px 0 16px" }, [d(b, {
|
|
81
|
+
value: T.value,
|
|
82
|
+
"onUpdate:value": (e) => T.value = e,
|
|
81
83
|
size: "small",
|
|
82
84
|
placeholder: "搜索",
|
|
83
85
|
allowClear: !0
|
|
84
86
|
}, {
|
|
85
|
-
prefix: () =>
|
|
87
|
+
prefix: () => d(n, { name: "search" }, null),
|
|
86
88
|
_: 1
|
|
87
89
|
}, 8, [
|
|
88
90
|
"value",
|
|
89
91
|
"onUpdate:value",
|
|
90
92
|
"allowClear"
|
|
91
|
-
])]),
|
|
92
|
-
ref:
|
|
93
|
-
selectUserList:
|
|
94
|
-
"onUpdate:selectUserList": (e) =>
|
|
95
|
-
keyword:
|
|
93
|
+
])]), d(c, {
|
|
94
|
+
ref: D,
|
|
95
|
+
selectUserList: E.value,
|
|
96
|
+
"onUpdate:selectUserList": (e) => E.value = e,
|
|
97
|
+
keyword: T.value,
|
|
96
98
|
onReady: () => M()
|
|
97
99
|
}, null, 8, [
|
|
98
100
|
"selectUserList",
|
|
99
101
|
"onUpdate:selectUserList",
|
|
100
102
|
"keyword",
|
|
101
103
|
"onReady"
|
|
102
|
-
])], 2),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
e.maxCount,
|
|
107
|
-
|
|
108
|
-
], 2),
|
|
104
|
+
])], 2), d("div", { class: S("content-right") }, [d("div", { class: S("content-right-title") }, [
|
|
105
|
+
u("已选:"),
|
|
106
|
+
E.value.length,
|
|
107
|
+
u("/"),
|
|
108
|
+
i(e.type, e.maxCount),
|
|
109
|
+
u("人")
|
|
110
|
+
], 2), d("div", {
|
|
109
111
|
class: "select-user-list",
|
|
110
|
-
ref:
|
|
111
|
-
}, [
|
|
112
|
+
ref: O
|
|
113
|
+
}, [d("div", { class: S("user-list") }, [E.value.length > 0 ? E.value.map((e) => d(s, {
|
|
112
114
|
key: e.id,
|
|
113
115
|
userInfo: e,
|
|
114
116
|
isChecked: !1,
|
|
@@ -118,36 +120,48 @@ var { b: x } = e("pro-user-selector"), S = e("user-selector-extermal"), C = /* @
|
|
|
118
120
|
"userInfo",
|
|
119
121
|
"isDelete",
|
|
120
122
|
"onDelete-user"
|
|
121
|
-
])) :
|
|
122
|
-
image:
|
|
123
|
+
])) : d(v, {
|
|
124
|
+
image: v.PRESENTED_IMAGE_SIMPLE,
|
|
123
125
|
description: "暂无数据"
|
|
124
126
|
}, null, 8, ["image"])], 2)], 512)], 2)], 2)] }, 8, [
|
|
125
127
|
"modelValue",
|
|
128
|
+
"title",
|
|
126
129
|
"modalProps",
|
|
127
130
|
"onOnCancel",
|
|
128
|
-
"onOnConfirm"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
"onOnConfirm",
|
|
132
|
+
"onUpdate:modelValue"
|
|
133
|
+
]), L = () => d(y, null, { default: () => [d("div", { class: C.b() }, [e.hideSlot ? null : o.default ? o.default() : d("div", { class: C.b("list") }, [d("button", {
|
|
134
|
+
type: "button",
|
|
135
|
+
class: C.b("icon"),
|
|
136
|
+
"aria-label": "选择用户",
|
|
131
137
|
onClick: () => r("update:visible", !0)
|
|
132
|
-
}, [
|
|
138
|
+
}, [d(n, {
|
|
133
139
|
name: "plus",
|
|
134
140
|
size: 20,
|
|
135
141
|
color: "var(--gdant-primary-500)"
|
|
136
|
-
}, null)], 10, ["onClick"]), e.modelValue.map((e) =>
|
|
137
|
-
|
|
142
|
+
}, null)], 10, ["onClick"]), e.modelValue.map((e) => d("div", {
|
|
143
|
+
key: e.id,
|
|
144
|
+
class: C.b("item")
|
|
145
|
+
}, [
|
|
146
|
+
d(l, {
|
|
138
147
|
name: e.realName,
|
|
139
148
|
avatar: e.avatar,
|
|
140
149
|
size: "small"
|
|
141
150
|
}, null, 8, ["name", "avatar"]),
|
|
142
|
-
|
|
143
|
-
|
|
151
|
+
d("span", { class: C.be("item", "name") }, [e.realName], 2),
|
|
152
|
+
d("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
class: C.be("item", "remove"),
|
|
155
|
+
"aria-label": `移除${e.realName}`,
|
|
156
|
+
onClick: () => P(e.id)
|
|
157
|
+
}, [d(n, {
|
|
144
158
|
name: "shanchu",
|
|
145
159
|
size: 18,
|
|
146
160
|
color: "var(--gdant-neutral-600)"
|
|
147
|
-
}, null)],
|
|
161
|
+
}, null)], 10, ["aria-label", "onClick"])
|
|
148
162
|
], 2))], 2), I()], 2)] });
|
|
149
163
|
return () => L();
|
|
150
164
|
}
|
|
151
165
|
});
|
|
152
166
|
//#endregion
|
|
153
|
-
export {
|
|
167
|
+
export { w as default };
|
|
@@ -44,5 +44,8 @@ var e = Symbol("selectUserContextKey"), t = {
|
|
|
44
44
|
confirm: (e) => !0,
|
|
45
45
|
cancel: () => !0
|
|
46
46
|
};
|
|
47
|
+
function i(e, t) {
|
|
48
|
+
return e === "radio" ? 1 : !Number.isFinite(t) || t < 1 ? 25 : Math.floor(t);
|
|
49
|
+
}
|
|
47
50
|
//#endregion
|
|
48
|
-
export { n as GTE_ORGTREE_URL, t as UserSelectorProps, e as selectUserContextKey, r as userSelectorEmits };
|
|
51
|
+
export { n as GTE_ORGTREE_URL, t as UserSelectorProps, i as resolveUserSelectorMaxCount, e as selectUserContextKey, r as userSelectorEmits };
|
|
@@ -9,8 +9,11 @@ function e(e, t) {
|
|
|
9
9
|
}, r;
|
|
10
10
|
}
|
|
11
11
|
function t(e) {
|
|
12
|
-
let t = /* @__PURE__ */ new
|
|
13
|
-
return e.filter((e) =>
|
|
12
|
+
let t = /* @__PURE__ */ new Set();
|
|
13
|
+
return e.filter((e) => {
|
|
14
|
+
let n = e?.userId || e?.id;
|
|
15
|
+
return !n || t.has(n) ? !1 : (t.add(n), !0);
|
|
16
|
+
});
|
|
14
17
|
}
|
|
15
18
|
function n(e) {
|
|
16
19
|
if (!(!e || e.length === 0)) for (let t of e) t.deptType === "department" && (t.checkedUserIds = []), t.members && t.members.length > 0 && t.members.forEach((e) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import e from "../../../icon/
|
|
1
|
+
import e from "../../../icon/src/icon.mjs";
|
|
2
2
|
import { selectContextKey as t } from "../types.mjs";
|
|
3
3
|
import { useApi as n } from "../hooks/useApi.mjs";
|
|
4
|
-
import { createBlock as r,
|
|
5
|
-
import { Empty as
|
|
4
|
+
import { createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, inject as u, mergeModels as d, onMounted as f, openBlock as p, ref as m, toDisplayString as h, unref as g, useModel as _, watch as v, withCtx as y } from "vue";
|
|
5
|
+
import { Alert as b, Button as x, Empty as S, InputSearch as C, Spin as w, Tree as T } from "ant-design-vue";
|
|
6
6
|
//#region src/components/pro-selector-group/src/compoents/dept-tree.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var E = { class: "dept-tree-panel" }, D = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "selector-tree"
|
|
10
|
-
},
|
|
10
|
+
}, O = { class: "tree-title" }, k = { class: "tree-title_name" }, A = { key: 0 }, j = { class: "selector-highlight" }, M = { key: 1 }, N = /* @__PURE__ */ l({
|
|
11
11
|
__name: "dept-tree",
|
|
12
12
|
props: {
|
|
13
13
|
modelValue: {
|
|
@@ -16,85 +16,112 @@ var S = {
|
|
|
16
16
|
},
|
|
17
17
|
modelModifiers: {}
|
|
18
18
|
},
|
|
19
|
-
emits: /* @__PURE__ */
|
|
20
|
-
setup(
|
|
21
|
-
let
|
|
22
|
-
function
|
|
19
|
+
emits: /* @__PURE__ */ d(["select"], ["update:modelValue"]),
|
|
20
|
+
setup(l, { emit: d }) {
|
|
21
|
+
let N = d, P = u(t), { getDeptTree: F, getUserListByDeptId: I, deptTree: L, deptLoading: R, deptError: z } = n(P.http, P.urlPrefix), B = _(l, "modelValue"), V = m(""), H = m([]), U = m([]), W = m(!0), G = m([]);
|
|
22
|
+
function K(e) {
|
|
23
23
|
let t = [];
|
|
24
24
|
for (let n = 0; n < e.length; n++) {
|
|
25
25
|
let r = e[n], i = r.id;
|
|
26
26
|
t.push({
|
|
27
27
|
key: i,
|
|
28
28
|
title: r.deptName
|
|
29
|
-
}), r.children && t.push(...
|
|
29
|
+
}), r.children && t.push(...K(r.children));
|
|
30
30
|
}
|
|
31
31
|
return t;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function q(e, t) {
|
|
34
34
|
let n;
|
|
35
35
|
for (let r = 0; r < t.length; r++) {
|
|
36
36
|
let i = t[r];
|
|
37
|
-
i.children && (i.children.some((t) => t.id === e) ? n = i.id :
|
|
37
|
+
i.children && (i.children.some((t) => t.id === e) ? n = i.id : q(e, i.children) && (n = q(e, i.children)));
|
|
38
38
|
}
|
|
39
39
|
return n;
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
v(V, (e) => {
|
|
42
|
+
U.value = G.value.map((t) => t.title.includes(e) ? q(t.key, L.value) : null).filter((e, t, n) => e && n.indexOf(e) === t), W.value = !!e;
|
|
43
|
+
});
|
|
44
|
+
async function J() {
|
|
45
|
+
await F(), G.value = K(L.value);
|
|
46
|
+
let e = L.value[0];
|
|
47
|
+
e && (U.value = [e.id], H.value = [e.id], B.value = e.id, await I(e.id));
|
|
48
|
+
}
|
|
49
|
+
f(() => {
|
|
50
|
+
J();
|
|
49
51
|
});
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
+
function Y(e) {
|
|
53
|
+
V.value = e;
|
|
52
54
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
55
|
+
function X(e) {
|
|
56
|
+
U.value = e.map((e) => String(e)), W.value = !1;
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
+
function Z(e, { node: t }) {
|
|
59
|
+
B.value = t.id, N("select", t);
|
|
58
60
|
}
|
|
59
|
-
return (t, n) => (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
61
|
+
return (t, n) => (p(), a("div", E, [
|
|
62
|
+
c(g(C), {
|
|
63
|
+
value: V.value,
|
|
64
|
+
"onUpdate:value": n[0] ||= (e) => V.value = e,
|
|
65
|
+
"allow-clear": "",
|
|
66
|
+
placeholder: "搜索部门",
|
|
67
|
+
onSearch: Y
|
|
68
|
+
}, null, 8, ["value"]),
|
|
69
|
+
g(z) ? (p(), r(g(b), {
|
|
70
|
+
key: 0,
|
|
71
|
+
class: "selector-feedback",
|
|
72
|
+
type: "error",
|
|
73
|
+
message: g(z),
|
|
74
|
+
"show-icon": ""
|
|
75
|
+
}, {
|
|
76
|
+
action: y(() => [c(g(x), {
|
|
77
|
+
type: "link",
|
|
78
|
+
size: "small",
|
|
79
|
+
onClick: J
|
|
80
|
+
}, {
|
|
81
|
+
default: y(() => [...n[3] ||= [s("重试", -1)]]),
|
|
82
|
+
_: 1
|
|
83
|
+
})]),
|
|
84
|
+
_: 1
|
|
85
|
+
}, 8, ["message"])) : i("", !0),
|
|
86
|
+
c(g(w), { spinning: g(R) }, {
|
|
87
|
+
default: y(() => [g(L).length > 0 ? (p(), a("div", D, [c(g(T), {
|
|
88
|
+
"selected-keys": H.value,
|
|
89
|
+
"onUpdate:selectedKeys": n[1] ||= (e) => H.value = e,
|
|
90
|
+
"expanded-keys": U.value,
|
|
91
|
+
"onUpdate:expandedKeys": n[2] ||= (e) => U.value = e,
|
|
92
|
+
"tree-data": g(L),
|
|
93
|
+
"auto-expand-parent": W.value,
|
|
94
|
+
"field-names": {
|
|
95
|
+
key: "id",
|
|
96
|
+
title: "deptName"
|
|
97
|
+
},
|
|
98
|
+
virtual: !1,
|
|
99
|
+
onSelect: Z,
|
|
100
|
+
onExpand: X
|
|
101
|
+
}, {
|
|
102
|
+
title: y(({ data: t }) => [o("div", O, [c(e, {
|
|
103
|
+
name: t.parentId === "root" ? "qiye" : "bumen",
|
|
104
|
+
size: 16
|
|
105
|
+
}, null, 8, ["name"]), o("span", k, [V.value && t.deptName.includes(V.value) ? (p(), a("span", A, [
|
|
106
|
+
s(h(t.deptName.substring(0, t.deptName.indexOf(V.value))) + " ", 1),
|
|
107
|
+
o("span", j, h(V.value), 1),
|
|
108
|
+
s(" " + h(t.deptName.substring(t.deptName.indexOf(V.value) + V.value.length)), 1)
|
|
109
|
+
])) : (p(), a("span", M, h(t.deptName), 1))])])]),
|
|
110
|
+
_: 1
|
|
111
|
+
}, 8, [
|
|
112
|
+
"selected-keys",
|
|
113
|
+
"expanded-keys",
|
|
114
|
+
"tree-data",
|
|
115
|
+
"auto-expand-parent"
|
|
116
|
+
])])) : g(z) ? i("", !0) : (p(), r(g(S), {
|
|
117
|
+
key: 1,
|
|
118
|
+
image: g(S).PRESENTED_IMAGE_SIMPLE,
|
|
119
|
+
description: "暂无部门"
|
|
120
|
+
}, null, 8, ["image"]))]),
|
|
121
|
+
_: 1
|
|
122
|
+
}, 8, ["spinning"])
|
|
123
|
+
]));
|
|
97
124
|
}
|
|
98
125
|
});
|
|
99
126
|
//#endregion
|
|
100
|
-
export {
|
|
127
|
+
export { N as default };
|
|
@@ -23,13 +23,13 @@ var l = { class: "type-selector-box dept-selector" }, u = /* @__PURE__ */ i({
|
|
|
23
23
|
h(e);
|
|
24
24
|
}
|
|
25
25
|
function _(e) {
|
|
26
|
-
p.value =
|
|
26
|
+
p.value = p.value.filter((t) => !e.includes(t.value));
|
|
27
27
|
}
|
|
28
28
|
function v() {
|
|
29
29
|
p.value = [];
|
|
30
30
|
}
|
|
31
31
|
function y(e) {
|
|
32
|
-
|
|
32
|
+
p.value = e.map((e) => ({
|
|
33
33
|
value: e.value,
|
|
34
34
|
label: e.label || "",
|
|
35
35
|
type: "dept"
|
|
@@ -43,7 +43,7 @@ var l = { class: "type-selector-box dept-selector" }, u = /* @__PURE__ */ i({
|
|
|
43
43
|
}), (e, i) => (o(), n("div", l, [r(t, {
|
|
44
44
|
modelValue: f.value,
|
|
45
45
|
"onUpdate:modelValue": i[0] ||= (e) => f.value = e,
|
|
46
|
-
|
|
46
|
+
class: "selector-pane",
|
|
47
47
|
onSelect: m
|
|
48
48
|
}, null, 8, ["modelValue"])]));
|
|
49
49
|
}
|