@guodun/antdv 1.4.3 → 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/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +66 -13
- package/dist/es/components/contract-signing-location/src/constants.mjs +27 -17
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +2 -2
- package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -36
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- package/dist/es/components/index.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +2 -1
- 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/ContractTemplatePreviewPage.vue.mjs +4 -4
- 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/DesignerPage.vue.mjs +50 -50
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +948 -887
- 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 +225 -150
- 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/page-decorations.mjs +17 -17
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +14 -14
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +168 -137
- 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/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/constants.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/contract-signing-location/style/index.css +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/ContractTemplatePreviewPage.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/DesignerPage.vue.cjs +2 -2
- 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/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -1
- 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/contract-signing-location.css +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/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +3 -1
- package/dist/types/components/contract-signing-location/src/constants.d.ts +18 -0
- package/dist/types/components/contract-signing-location/src/coordinates.d.ts +6 -0
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +17 -0
- 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 +5 -1
|
@@ -4,13 +4,13 @@ import { GTE_ORGTREE_URL as n, selectUserContextKey as r } from "../types.mjs";
|
|
|
4
4
|
import { debounce as i, formatOrgTree as a, uniqueById as o } from "../utils/orgTree.mjs";
|
|
5
5
|
import s from "./user.mjs";
|
|
6
6
|
import { Fragment as c, createTextVNode as l, createVNode as u, defineComponent as d, inject as f, isVNode as p, onMounted as m, ref as h, watch as g } from "vue";
|
|
7
|
-
import { Breadcrumb as _, BreadcrumbItem as v,
|
|
8
|
-
import { uid as
|
|
7
|
+
import { Breadcrumb as _, BreadcrumbItem as v, Button as y, Empty as b, Modal as x, Skeleton as S } from "ant-design-vue";
|
|
8
|
+
import { uid as C } from "@guodun/utils";
|
|
9
9
|
//#region src/components/pro-selector/src/components/org-tree.tsx
|
|
10
|
-
function
|
|
10
|
+
function w(e) {
|
|
11
11
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !p(e);
|
|
12
12
|
}
|
|
13
|
-
var { b:
|
|
13
|
+
var { b: T } = e("pro-user-selector"), E = /* @__PURE__ */ d({
|
|
14
14
|
name: "OrgTree",
|
|
15
15
|
props: {
|
|
16
16
|
selectUserList: {
|
|
@@ -31,73 +31,81 @@ var { b: w } = e("pro-user-selector"), T = /* @__PURE__ */ d({
|
|
|
31
31
|
ready: () => !0
|
|
32
32
|
},
|
|
33
33
|
setup(e, { emit: d, expose: p }) {
|
|
34
|
-
let
|
|
34
|
+
let E = f(r), D = h([]), O = h({}), k = h([]), A = h({}), j = h([]), M = h(!1), N = i((e) => {
|
|
35
35
|
let t = [], n = (r) => {
|
|
36
36
|
for (let i of r) {
|
|
37
37
|
if (i.members && i.members.length > 0) for (let n of i.members) n.realName && n.realName.includes(e) && t.push(n);
|
|
38
38
|
i.children && i.children.length > 0 && n(i.children);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
n(
|
|
41
|
+
n(D.value), j.value = o(t), M.value = e !== "";
|
|
42
42
|
}, 300);
|
|
43
43
|
g(() => e.keyword, (e, t) => {
|
|
44
44
|
if (e === "") {
|
|
45
|
-
|
|
45
|
+
N.cancel(), M.value = !1, j.value = [];
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
e !== t &&
|
|
48
|
+
e !== t && N(e);
|
|
49
49
|
});
|
|
50
|
-
let
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
let P = (e) => {
|
|
51
|
+
let t = (n) => {
|
|
52
|
+
n.forEach((n) => {
|
|
53
|
+
n.members?.forEach((t) => {
|
|
54
|
+
(t.userId || t.id) === e && (t.checked = !1);
|
|
55
|
+
}), n.children?.length && t(n.children);
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
t(D.value), j.value = j.value.map((t) => ((t.userId || t.id) === e && (t.checked = !1), t));
|
|
59
|
+
}, F = (t, n) => {
|
|
60
|
+
let r = n.userId || n.id, i = E?.type === "radio" ? 1 : E?.maxCount;
|
|
61
|
+
if (t && E?.type === "radio") {
|
|
62
|
+
P(r), n.checked = !0, d("update:selectUserList", [n]);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (t && i !== void 0 && e.selectUserList.length >= i && !e.selectUserList.some((e) => (e.userId || e.id) === r)) {
|
|
66
|
+
n.checked = !1, x.warning({
|
|
57
67
|
title: "温馨提示",
|
|
58
|
-
content: `最多只能选择${
|
|
68
|
+
content: `最多只能选择${i}个用户`
|
|
59
69
|
});
|
|
60
70
|
return;
|
|
61
71
|
}
|
|
62
|
-
d("update:selectUserList", t ? [...e.selectUserList, n] : e.selectUserList.filter((e) => e.
|
|
63
|
-
},
|
|
64
|
-
t.parentId === "root" ?
|
|
65
|
-
id:
|
|
72
|
+
d("update:selectUserList", t ? e.selectUserList.some((e) => (e.userId || e.id) === r) ? e.selectUserList : [...e.selectUserList, n] : e.selectUserList.filter((e) => (e.userId || e.id) !== r));
|
|
73
|
+
}, I = (t) => {
|
|
74
|
+
t.parentId === "root" ? k.value.push({
|
|
75
|
+
id: C(32),
|
|
66
76
|
deptName: "组织内联系人",
|
|
67
|
-
children:
|
|
68
|
-
members:
|
|
69
|
-
}) :
|
|
70
|
-
t.checked = e.selectUserList.some((e) => e.userId === t.userId);
|
|
71
|
-
}),
|
|
72
|
-
},
|
|
77
|
+
children: D.value[0].children,
|
|
78
|
+
members: D.value[0].members
|
|
79
|
+
}) : k.value.push(t), t.members?.forEach((t) => {
|
|
80
|
+
t.checked = e.selectUserList.some((e) => (e.userId || e.id) === (t.userId || t.id));
|
|
81
|
+
}), O.value = t, A.value = t;
|
|
82
|
+
}, L = (t, n) => {
|
|
73
83
|
let r = {};
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
if (A.value.id !== t.id) {
|
|
85
|
+
if (n === 0) r = { children: D.value }, k.value = [{
|
|
86
|
+
id: C(32),
|
|
87
|
+
deptName: "联系人",
|
|
88
|
+
children: D.value
|
|
89
|
+
}];
|
|
90
|
+
else if (n === 1) r = D.value[0], k.value = k.value.slice(0, 2);
|
|
91
|
+
else {
|
|
92
|
+
r = t;
|
|
93
|
+
let e = k.value.findIndex((e) => e.id === t.id);
|
|
94
|
+
e !== -1 && (k.value = k.value.slice(0, e + 1));
|
|
95
|
+
}
|
|
96
|
+
r.members?.forEach((t) => {
|
|
97
|
+
t.checked = e.selectUserList.some((e) => (e.userId || e.id) === (t.userId || t.id));
|
|
98
|
+
}), O.value = r;
|
|
88
99
|
}
|
|
89
|
-
|
|
90
|
-
t.checked = e.selectUserList.some((e) => e.id === t.userId);
|
|
91
|
-
}), D.value = r;
|
|
92
|
-
}, L = (e) => u(c, null, [u("div", { class: w("org-tree-item-title") }, [e.parentId === "root" ? u(t, {
|
|
100
|
+
}, R = (e) => u(c, null, [u("div", { class: T("org-tree-item-title") }, [e.parentId === "root" ? u(t, {
|
|
93
101
|
name: "zuzhijiagou",
|
|
94
102
|
size: 18,
|
|
95
103
|
color: "var(--gdant-success-500)"
|
|
96
|
-
}, null) : u("div", { class:
|
|
104
|
+
}, null) : u("div", { class: T("org-tree-dept-icon") }, [u(t, {
|
|
97
105
|
name: "zuzhijiagou",
|
|
98
106
|
size: 18,
|
|
99
107
|
color: "var(--gdant-neutral-0)"
|
|
100
|
-
}, null)], 2), u("div", { class:
|
|
108
|
+
}, null)], 2), u("div", { class: T("org-tree-item-title-text") }, [e.deptName, e.parentId !== "root" && u(c, null, [
|
|
101
109
|
l("("),
|
|
102
110
|
e.members && e.members.length > 0 ? e.members.length : 0,
|
|
103
111
|
l(")")
|
|
@@ -105,78 +113,111 @@ var { b: w } = e("pro-user-selector"), T = /* @__PURE__ */ d({
|
|
|
105
113
|
name: "right",
|
|
106
114
|
size: 14,
|
|
107
115
|
color: "var(--gdant-neutral-400)"
|
|
108
|
-
}, null) : u("
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}, [l("下级")])]),
|
|
116
|
+
}, null) : u("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
class: T("org-tree-next")
|
|
119
|
+
}, [l("下级")], 2)]), z = (e) => u("div", { class: T("user-list") }, [e.members?.map((e) => u(s, {
|
|
120
|
+
key: e.userId || e.id,
|
|
112
121
|
userInfo: e,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
selectionType: E?.type,
|
|
123
|
+
"onChange-checked": F
|
|
124
|
+
}, null, 8, [
|
|
125
|
+
"userInfo",
|
|
126
|
+
"selectionType",
|
|
127
|
+
"onChange-checked"
|
|
128
|
+
]))], 2), B = (e) => e.parentId === "root" && k.value.length === 1 ? u("div", {
|
|
129
|
+
class: T("org-tree-item"),
|
|
130
|
+
onClick: () => I(e)
|
|
131
|
+
}, [R(e)], 10, ["onClick"]) : u(c, null, [e.children && e.children.length > 0 ? e.children.map((e) => u("div", {
|
|
132
|
+
class: T("org-tree-item"),
|
|
133
|
+
onClick: () => I(e)
|
|
134
|
+
}, [R(e)], 10, ["onClick"])) : null, z(e)]), V = () => u("div", { class: T("user-list") }, [j.value.length > 0 ? j.value.map((t) => u(s, {
|
|
135
|
+
key: t.userId || t.id,
|
|
121
136
|
userInfo: t,
|
|
122
|
-
|
|
137
|
+
selectionType: E?.type,
|
|
138
|
+
"onChange-checked": F
|
|
123
139
|
}, {
|
|
124
140
|
name: () => u("div", { style: "font-size: 14px;color: var(--gdant-neutral-900);" }, [t?.realName.includes(e.keyword) ? t?.realName.split(e.keyword).map((n, r) => u(c, null, [n, r < t?.realName.split(e.keyword).length - 1 && u("span", { style: "color: var(--gdant-error-500);" }, [e.keyword])])) : t?.realName]),
|
|
125
141
|
_: 1
|
|
126
|
-
}, 8, [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
});
|
|
142
|
+
}, 8, [
|
|
143
|
+
"userInfo",
|
|
144
|
+
"selectionType",
|
|
145
|
+
"onChange-checked"
|
|
146
|
+
])) : u(b, { description: "暂无数据" }, null)], 2), H = h(!1), U = h(""), W, G = !1, K = new Promise((e) => {
|
|
147
|
+
W = e;
|
|
148
|
+
}), q = async () => {
|
|
149
|
+
if (!E?.http) return U.value = "缺少用户数据请求实例", [];
|
|
150
|
+
try {
|
|
151
|
+
let e = await E.http.get(`${E.prefix}${n}`);
|
|
152
|
+
return e?.status === 0 && Array.isArray(e.data) ? e.data : (U.value = "用户组织数据加载失败,请重试", []);
|
|
153
|
+
} catch {
|
|
154
|
+
return U.value = "用户组织数据加载失败,请重试", [];
|
|
136
155
|
}
|
|
137
|
-
})
|
|
138
|
-
return m(async () => {
|
|
156
|
+
}, J = async () => {
|
|
139
157
|
try {
|
|
140
|
-
|
|
141
|
-
id:
|
|
158
|
+
H.value = !0, U.value = "", E?.isBuiltInRequest ? D.value = await q() : E?.initData && (D.value = await E.initData()), a(D.value), O.value = { children: D.value }, k.value = [{
|
|
159
|
+
id: C(32),
|
|
142
160
|
deptName: "联系人",
|
|
143
|
-
children:
|
|
144
|
-
}],
|
|
161
|
+
children: D.value
|
|
162
|
+
}], D.value[0] && I(D.value[0]);
|
|
163
|
+
} catch {
|
|
164
|
+
D.value = [], O.value = { children: [] }, U.value = "用户组织数据加载失败,请重试";
|
|
145
165
|
} finally {
|
|
146
|
-
|
|
166
|
+
H.value = !1, G || (G = !0, W(D.value)), d("ready");
|
|
147
167
|
}
|
|
168
|
+
};
|
|
169
|
+
return m(() => {
|
|
170
|
+
J();
|
|
148
171
|
}), p({
|
|
149
|
-
deleteDeptUser:
|
|
172
|
+
deleteDeptUser: P,
|
|
150
173
|
getInitData: (e, t) => {
|
|
151
174
|
let n = [], r = (t) => {
|
|
152
175
|
for (let i of t) {
|
|
153
|
-
if (i.members && i.members.length > 0) for (let t of i.members) e.some((e) => e.id === t.userId) ? (t.checked = !0, n.push(t)) : t.checked = !1;
|
|
176
|
+
if (i.members && i.members.length > 0) for (let t of i.members) e.some((e) => e.id === (t.userId || t.id)) ? (t.checked = !0, n.push(t)) : t.checked = !1;
|
|
154
177
|
i.children && i.children.length > 0 && r(i.children);
|
|
155
178
|
}
|
|
156
179
|
};
|
|
157
|
-
r(t)
|
|
180
|
+
r(t);
|
|
181
|
+
let i = new Set(n.map((e) => e.userId || e.id)), a = e.filter((e) => !i.has(e.id)).map((e) => ({
|
|
182
|
+
id: e.id,
|
|
183
|
+
username: null,
|
|
184
|
+
userId: e.id,
|
|
185
|
+
realName: e.realName,
|
|
186
|
+
avatar: e.avatar,
|
|
187
|
+
checked: !0
|
|
188
|
+
})), s = o([...n, ...a]);
|
|
189
|
+
d("update:selectUserList", E?.type === "radio" ? s.slice(0, 1) : s);
|
|
158
190
|
},
|
|
159
|
-
dataLoadPromise:
|
|
191
|
+
dataLoadPromise: K
|
|
160
192
|
}), () => {
|
|
161
193
|
let e;
|
|
162
|
-
return u(c, null, [u("div", { style: "padding:0 16px" }, [
|
|
194
|
+
return u(c, null, [u("div", { style: "padding:0 16px" }, [k.value.length > 1 && !M.value ? u(_, {
|
|
163
195
|
separator: ">",
|
|
164
|
-
class:
|
|
165
|
-
},
|
|
196
|
+
class: T("breadcrumb")
|
|
197
|
+
}, w(e = k.value.map((e, t) => u(v, { onClick: () => L(e, t) }, { default: () => [t === k.value.length - 1 ? e.deptName : u("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
class: T("breadcrumb-link")
|
|
200
|
+
}, [e.deptName], 2)] }, 8, ["onClick"]))) ? e : {
|
|
166
201
|
default: () => [e],
|
|
167
202
|
_: 1
|
|
168
|
-
}, 8, ["class"]) : null]),
|
|
169
|
-
class:
|
|
203
|
+
}, 8, ["class"]) : null]), M.value ? u(c, null, [V()]) : u("div", { class: T("org-tree") }, [H.value ? u("div", {
|
|
204
|
+
class: T("org-tree-item"),
|
|
170
205
|
style: "height: 200px;display: block;"
|
|
171
|
-
}, [u(
|
|
206
|
+
}, [u(S, {
|
|
172
207
|
active: !0,
|
|
173
208
|
avatar: !0
|
|
174
|
-
}, null, 8, ["active", "avatar"]), u(
|
|
209
|
+
}, null, 8, ["active", "avatar"]), u(S, {
|
|
175
210
|
active: !0,
|
|
176
211
|
avatar: !0
|
|
177
|
-
}, null, 8, ["active", "avatar"])], 2) :
|
|
212
|
+
}, null, 8, ["active", "avatar"])], 2) : U.value ? u(b, { description: U.value }, {
|
|
213
|
+
default: () => u(y, {
|
|
214
|
+
type: "link",
|
|
215
|
+
onClick: () => void J()
|
|
216
|
+
}, { default: () => [l("重试")] }, 8, ["onClick"]),
|
|
217
|
+
_: 1
|
|
218
|
+
}, 8, ["description"]) : B(O.value)], 2)]);
|
|
178
219
|
};
|
|
179
220
|
}
|
|
180
221
|
});
|
|
181
222
|
//#endregion
|
|
182
|
-
export {
|
|
223
|
+
export { E as default };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useNamespace as e } from "../../../../hooks/use-namespace/index.mjs";
|
|
2
|
-
import t from "../../../icon/
|
|
3
|
-
import n from "../../../pro-user-avatar/index.mjs";
|
|
2
|
+
import t from "../../../icon/src/icon.mjs";
|
|
3
|
+
import n from "../../../pro-user-avatar/src/index.mjs";
|
|
4
4
|
import { createVNode as r, defineComponent as i, isVNode as a } from "vue";
|
|
5
|
-
import { Checkbox as o } from "ant-design-vue";
|
|
6
|
-
import { CheckOutlined as
|
|
5
|
+
import { Checkbox as o, Radio as s } from "ant-design-vue";
|
|
6
|
+
import { CheckOutlined as c } from "@ant-design/icons-vue";
|
|
7
7
|
//#region src/components/pro-selector/src/components/user.tsx
|
|
8
|
-
function
|
|
8
|
+
function l(e) {
|
|
9
9
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
|
|
10
10
|
}
|
|
11
|
-
var { b:
|
|
11
|
+
var { b: u } = e("pro-user-selector"), d = /* @__PURE__ */ i({
|
|
12
12
|
name: "User",
|
|
13
13
|
props: {
|
|
14
14
|
userInfo: {
|
|
@@ -22,6 +22,10 @@ var { b: l } = e("pro-user-selector"), u = /* @__PURE__ */ i({
|
|
|
22
22
|
isDelete: {
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: !1
|
|
25
|
+
},
|
|
26
|
+
selectionType: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "checkbox"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
emits: {
|
|
@@ -29,14 +33,9 @@ var { b: l } = e("pro-user-selector"), u = /* @__PURE__ */ i({
|
|
|
29
33
|
"change-checked": (e, t) => e
|
|
30
34
|
},
|
|
31
35
|
setup(e, { emit: i, slots: a }) {
|
|
32
|
-
let
|
|
36
|
+
let d = (t) => {
|
|
33
37
|
i("change-checked", t.target.checked, e.userInfo);
|
|
34
|
-
},
|
|
35
|
-
width: "100%",
|
|
36
|
-
display: "flex",
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
"margin-top": "4px"
|
|
39
|
-
} }, [
|
|
38
|
+
}, f = () => r("div", { class: u("user-item-content") }, [r("div", { class: u("user-item-main") }, [
|
|
40
39
|
r(n, {
|
|
41
40
|
name: e.userInfo.realName ? e.userInfo.realName : "",
|
|
42
41
|
avatar: e.userInfo.avatar,
|
|
@@ -45,8 +44,8 @@ var { b: l } = e("pro-user-selector"), u = /* @__PURE__ */ i({
|
|
|
45
44
|
r("div", { style: {
|
|
46
45
|
flex: 1,
|
|
47
46
|
minWidth: 0
|
|
48
|
-
} }, [r("div", { style: "display: flex;align-items: center;" }, [a.name ? a.name() : r("div", {
|
|
49
|
-
class:
|
|
47
|
+
} }, [r("div", { style: "display: flex;align-items: center;" }, [a.name ? a.name() : r("div", { class: u("user-item-name") }, [e.userInfo.realName], 2), e.userInfo.position && r("div", {
|
|
48
|
+
class: u("user-item-content-tag"),
|
|
50
49
|
style: {
|
|
51
50
|
"font-size": "10px",
|
|
52
51
|
"margin-left": "10px",
|
|
@@ -61,37 +60,46 @@ var { b: l } = e("pro-user-selector"), u = /* @__PURE__ */ i({
|
|
|
61
60
|
color: "var(--gdant-neutral-500)",
|
|
62
61
|
lineHeight: "20px"
|
|
63
62
|
} }, [e.userInfo.stageName])]),
|
|
64
|
-
e.userInfo.checked && r(
|
|
63
|
+
e.userInfo.checked && r(c, { style: {
|
|
65
64
|
color: "var(--gdant-primary-500)",
|
|
66
65
|
fontSize: "16px",
|
|
67
66
|
marginLeft: "8px",
|
|
68
67
|
flexShrink: 0
|
|
69
68
|
} }, null)
|
|
70
|
-
]), e.isDelete && r("
|
|
69
|
+
], 2), e.isDelete && r("button", {
|
|
70
|
+
type: "button",
|
|
71
71
|
class: "select-user-item-icon",
|
|
72
|
-
|
|
72
|
+
"aria-label": `移除${e.userInfo.realName || "用户"}`,
|
|
73
|
+
onClick: () => i("delete-user", e.userInfo.userId || e.userInfo.id)
|
|
73
74
|
}, [r(t, {
|
|
74
75
|
name: "shanchu",
|
|
75
76
|
size: 12,
|
|
76
77
|
color: "var(--gdant-neutral-800)"
|
|
77
|
-
}, null)], 8, ["onClick"])], 2);
|
|
78
|
+
}, null)], 8, ["aria-label", "onClick"])], 2);
|
|
78
79
|
return () => {
|
|
79
|
-
let t;
|
|
80
|
-
return r("div", { class: [
|
|
80
|
+
let t, n;
|
|
81
|
+
return r("div", { class: [u("user-item"), e.userInfo.checked ? `${u("user-item")}--selected` : ""] }, [e.isChecked ? e.selectionType === "radio" ? r(s, {
|
|
81
82
|
style: "margin: 0 6px;width: 100%;",
|
|
82
83
|
checked: e.userInfo.checked,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, c(t = d()) ? t : {
|
|
84
|
+
onChange: (e) => d({ target: { checked: e.target.checked } })
|
|
85
|
+
}, l(t = f()) ? t : {
|
|
86
86
|
default: () => [t],
|
|
87
87
|
_: 1
|
|
88
|
+
}, 8, ["checked", "onChange"]) : r(o, {
|
|
89
|
+
style: "margin: 0 6px;width: 100%;",
|
|
90
|
+
checked: e.userInfo.checked,
|
|
91
|
+
"onUpdate:checked": (t) => e.userInfo.checked = t,
|
|
92
|
+
onChange: d
|
|
93
|
+
}, l(n = f()) ? n : {
|
|
94
|
+
default: () => [n],
|
|
95
|
+
_: 1
|
|
88
96
|
}, 8, [
|
|
89
97
|
"checked",
|
|
90
98
|
"onUpdate:checked",
|
|
91
99
|
"onChange"
|
|
92
|
-
]) : r("div", { style: "width: 100%;" }, [
|
|
100
|
+
]) : r("div", { style: "width: 100%;" }, [f()])], 2);
|
|
93
101
|
};
|
|
94
102
|
}
|
|
95
103
|
});
|
|
96
104
|
//#endregion
|
|
97
|
-
export {
|
|
105
|
+
export { d as default };
|