china-mobile-international-custom-components 0.0.28 → 0.0.30
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/es/ApplicationIcon.mjs +30 -28
- package/es/PageContainer.mjs +178 -149
- package/es/assets/PageContainer.css +1 -1
- package/es/index.mjs +2 -2
- package/lib/ApplicationIcon.js +1 -1
- package/lib/PageContainer.js +1 -1
- package/lib/assets/PageContainer.css +1 -1
- package/lib/index.js +2 -2
- package/package.json +4 -4
- package/es/assets/AvailableRangePreview.css +0 -1
- package/es/assets/AvailableRangeSetting.css +0 -1
- package/es/assets/CustomSidebar.css +0 -1
- package/es/chunks/AvailableRangePreview.D4mZe1lQ.js +0 -217
- package/es/chunks/AvailableRangeSetting.BkSLnQ6N.js +0 -215
- package/es/chunks/CustomSidebar.BWGoPtLi.js +0 -506
- package/es/chunks/CustomTitle.BLZ7evms.js +0 -5
- package/es/chunks/CustomToggle.CP3M2_f3.js +0 -165
- package/es/chunks/PageContainer.D-G32lvP.js +0 -329
- package/es/chunks/_plugin-vue_export-helper.CVVE_0_F.js +0 -13
- package/es/chunks/_plugin-vue_export-helper.Cf-_TWPK.js +0 -6
- package/es/chunks/index.39AUVSwV.js +0 -288
- package/es/chunks/index.AHEDCg43.js +0 -160
- package/es/chunks/index.B67AnSJI.js +0 -154
- package/es/chunks/index.B9F4VYQK.js +0 -118
- package/es/chunks/index.BPxF6Amx.js +0 -157
- package/es/chunks/index.C2gKjqoA.js +0 -209
- package/es/chunks/index.DTtNnKDH.js +0 -288
- package/es/chunks/index.DtBeJlu6.js +0 -142
- package/es/chunks/index.kR57MtNP.js +0 -211
- package/es/chunks/index.wQj5YKPy.js +0 -288
- package/es/chunks/layout.BE8_kCeR.js +0 -619
- package/es/chunks/layout.BNqqXOrs.js +0 -639
- package/es/chunks/layout.C6AMos7n.js +0 -17
- package/es/chunks/layout.CWFXohJu.js +0 -622
- package/es/chunks/layout.ClkgLsEw.js +0 -640
- package/es/chunks/layout.R5FQNRjS.js +0 -619
- package/es/chunks/layout.nKB_kc-U.js +0 -26
- package/es/chunks/utils.BhlZXNZ6.js +0 -19
- package/lib/assets/AvailableRangePreview.css +0 -1
- package/lib/assets/AvailableRangeSetting.css +0 -1
- package/lib/assets/CustomSidebar.css +0 -1
- package/lib/chunks/AvailableRangePreview.CkgZsXP0.js +0 -1
- package/lib/chunks/AvailableRangeSetting.CF-jHm4x.js +0 -1
- package/lib/chunks/CustomSidebar.CMYJFb2P.js +0 -1
- package/lib/chunks/CustomTitle.BkFZ-ZIq.js +0 -1
- package/lib/chunks/CustomToggle.C0PpzKPP.js +0 -1
- package/lib/chunks/PageContainer.GH56wASV.js +0 -1
- package/lib/chunks/_plugin-vue_export-helper.C55-DZV2.js +0 -1
- package/lib/chunks/_plugin-vue_export-helper.DAGvX2Jf.js +0 -1
- package/lib/chunks/index.BfHfKST0.js +0 -1
- package/lib/chunks/index.BlXappa4.js +0 -1
- package/lib/chunks/index.CCxHaoi4.js +0 -1
- package/lib/chunks/index.CSYGhK9M.js +0 -1
- package/lib/chunks/index.C_IlZrzE.js +0 -1
- package/lib/chunks/index.DUGtabLJ.js +0 -1
- package/lib/chunks/index.Dakz8S3g.js +0 -1
- package/lib/chunks/index.DsmgWFv8.js +0 -1
- package/lib/chunks/index.DydPD8Lc.js +0 -1
- package/lib/chunks/index.k_hSuA6i.js +0 -1
- package/lib/chunks/layout.BEW4Cgni.js +0 -1
- package/lib/chunks/layout.BJjU9nKW.js +0 -1
- package/lib/chunks/layout.BQigNrr5.js +0 -1
- package/lib/chunks/layout.ClFtiz-t.js +0 -1
- package/lib/chunks/layout.CmDwUHZo.js +0 -1
- package/lib/chunks/layout.CqbDoD_v.js +0 -1
- package/lib/chunks/layout.CwJgDGuR.js +0 -1
- package/lib/chunks/layout.D0zeFdw9.js +0 -1
- package/lib/chunks/utils.BT5Uuz2Q.js +0 -1
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { _ as L, w as k } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
-
import { computed as u, createElementBlock as f, createCommentVNode as E, openBlock as a, Fragment as M, createElementVNode as b, toDisplayString as y, createBlock as w, renderList as N, unref as d, withCtx as A, ref as P, watch as S, onMounted as V, createVNode as D, createTextVNode as I, nextTick as B } from "vue";
|
|
3
|
-
import { ElPopover as C, ElButton as z } from "element-plus";
|
|
4
|
-
import '../assets/index.css';const T = {
|
|
5
|
-
ALL: !0,
|
|
6
|
-
PARTIAL: !1
|
|
7
|
-
}, $ = [
|
|
8
|
-
{
|
|
9
|
-
value: T.ALL,
|
|
10
|
-
label: "全部成员"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: T.PARTIAL,
|
|
14
|
-
label: "部分成员"
|
|
15
|
-
}
|
|
16
|
-
], c = {
|
|
17
|
-
MEMBER: 1,
|
|
18
|
-
DEPARTMENT: 2
|
|
19
|
-
}, X = {
|
|
20
|
-
label: "memberName",
|
|
21
|
-
children: "children",
|
|
22
|
-
value: "bnid"
|
|
23
|
-
}, F = { class: "fz-14 text-646a73 pd-l-16 nowrap" }, O = { class: "tag-list flex gap-4 items-center" }, Y = { class: "tag-item nowrap fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe pointer" }, q = { class: "tag-list-popover overflow-y-auto flex gap-4 flex-wrap" }, G = {
|
|
24
|
-
__name: "TagList",
|
|
25
|
-
props: {
|
|
26
|
-
// 显示的标签
|
|
27
|
-
label: {
|
|
28
|
-
type: String,
|
|
29
|
-
required: !0
|
|
30
|
-
},
|
|
31
|
-
// 数据项列表
|
|
32
|
-
items: {
|
|
33
|
-
type: Array,
|
|
34
|
-
default: () => []
|
|
35
|
-
},
|
|
36
|
-
// 默认显示的数量
|
|
37
|
-
defaultShowCount: {
|
|
38
|
-
type: Number,
|
|
39
|
-
default: 1
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
setup(n) {
|
|
43
|
-
const l = n, p = u(() => l.items.slice(0, l.defaultShowCount)), i = u(() => l.items.length > l.defaultShowCount), s = u(() => l.items.length - l.defaultShowCount), r = u(() => l.items.slice(l.defaultShowCount));
|
|
44
|
-
return (o, e) => n.items.length > 0 ? (a(), f(M, { key: 0 }, [
|
|
45
|
-
e[0] || (e[0] = b("span", { class: "pd-l-16 text-dee0e3" }, "|", -1)),
|
|
46
|
-
b("span", F, y(n.label), 1),
|
|
47
|
-
b("div", O, [
|
|
48
|
-
(a(!0), f(M, null, N(p.value, (t) => (a(), f("div", {
|
|
49
|
-
key: t.bnid,
|
|
50
|
-
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
51
|
-
}, y(t.memberName), 1))), 128)),
|
|
52
|
-
i.value ? (a(), w(d(C), {
|
|
53
|
-
key: 0,
|
|
54
|
-
placement: "top",
|
|
55
|
-
trigger: "click",
|
|
56
|
-
width: "300"
|
|
57
|
-
}, {
|
|
58
|
-
reference: A(() => [
|
|
59
|
-
b("span", Y, " +" + y(s.value), 1)
|
|
60
|
-
]),
|
|
61
|
-
default: A(() => [
|
|
62
|
-
b("div", q, [
|
|
63
|
-
(a(!0), f(M, null, N(r.value, (t) => (a(), f("span", {
|
|
64
|
-
key: t.bnid,
|
|
65
|
-
class: "tag-item nowrap fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
66
|
-
}, y(t.memberName), 1))), 128))
|
|
67
|
-
])
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
})) : E("", !0)
|
|
71
|
-
])
|
|
72
|
-
], 64)) : E("", !0);
|
|
73
|
-
}
|
|
74
|
-
}, R = /* @__PURE__ */ L(G, [["__scopeId", "data-v-bd8e4281"]]);
|
|
75
|
-
function j(n, l) {
|
|
76
|
-
const p = u(() => {
|
|
77
|
-
const s = /* @__PURE__ */ new Set();
|
|
78
|
-
return i.value.forEach((r) => {
|
|
79
|
-
const o = (e) => {
|
|
80
|
-
for (const t of e)
|
|
81
|
-
t.memberType === c.MEMBER ? s.add(t.bnid) : t.memberType === c.DEPARTMENT && o(t.children);
|
|
82
|
-
};
|
|
83
|
-
o(r.children || []);
|
|
84
|
-
}), n.value.filter(
|
|
85
|
-
(r) => r.memberType === c.MEMBER && !s.has(r.bnid)
|
|
86
|
-
);
|
|
87
|
-
}), i = u(() => {
|
|
88
|
-
const s = [], r = (e) => {
|
|
89
|
-
if (!e.children || e.children.length === 0) return !1;
|
|
90
|
-
const h = ((m) => {
|
|
91
|
-
const v = [], _ = (x) => {
|
|
92
|
-
if (x.children)
|
|
93
|
-
for (const g of x.children)
|
|
94
|
-
g.memberType === c.MEMBER ? v.push(g.bnid) : g.memberType === c.DEPARTMENT && _(g);
|
|
95
|
-
};
|
|
96
|
-
return _(m), v;
|
|
97
|
-
})(e);
|
|
98
|
-
return h.length === 0 ? !1 : h.every(
|
|
99
|
-
(m) => n.value.some(
|
|
100
|
-
(v) => v.memberType === c.MEMBER && v.bnid === m
|
|
101
|
-
)
|
|
102
|
-
);
|
|
103
|
-
}, o = (e, t = !1) => {
|
|
104
|
-
if (e.memberType === c.DEPARTMENT) {
|
|
105
|
-
const h = r(e);
|
|
106
|
-
if (h && !t) {
|
|
107
|
-
if (s.push({
|
|
108
|
-
bnid: e.bnid,
|
|
109
|
-
memberName: e.memberName,
|
|
110
|
-
memberType: c.DEPARTMENT,
|
|
111
|
-
children: e.children
|
|
112
|
-
}), e.children)
|
|
113
|
-
for (const m of e.children)
|
|
114
|
-
o(m, !0);
|
|
115
|
-
} else if (!h && e.children)
|
|
116
|
-
for (const m of e.children)
|
|
117
|
-
o(m, !1);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
for (const e of l.value)
|
|
121
|
-
o(e, !1);
|
|
122
|
-
return s;
|
|
123
|
-
});
|
|
124
|
-
return {
|
|
125
|
-
selectedMembers: p,
|
|
126
|
-
selectedDepartments: i
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
const H = { class: "fz-14 text-1f2329 pd-r-16" }, J = {
|
|
130
|
-
key: 0,
|
|
131
|
-
class: "flex-1 overflow-hidden flex items-center"
|
|
132
|
-
}, K = {
|
|
133
|
-
__name: "layout",
|
|
134
|
-
props: {
|
|
135
|
-
// 当前选择的范围类型(是否全部可见)
|
|
136
|
-
allVisible: {
|
|
137
|
-
type: Boolean,
|
|
138
|
-
default: T.ALL
|
|
139
|
-
},
|
|
140
|
-
// 选中的项目列表(完整对象数组,由父组件根据ID从树中查找得到)
|
|
141
|
-
modelValue: {
|
|
142
|
-
type: Array,
|
|
143
|
-
default: () => []
|
|
144
|
-
},
|
|
145
|
-
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
146
|
-
treeList: {
|
|
147
|
-
type: Array,
|
|
148
|
-
default: () => []
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
setup(n) {
|
|
152
|
-
const l = P(null), p = () => {
|
|
153
|
-
l.value && B(() => {
|
|
154
|
-
l.value.scrollIntoView({
|
|
155
|
-
behavior: "smooth",
|
|
156
|
-
block: "center"
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
}, i = n, { selectedMembers: s, selectedDepartments: r } = j(
|
|
160
|
-
u(() => i.modelValue),
|
|
161
|
-
u(() => i.treeList)
|
|
162
|
-
);
|
|
163
|
-
return S(
|
|
164
|
-
() => [i.allVisible, i.modelValue],
|
|
165
|
-
() => {
|
|
166
|
-
p();
|
|
167
|
-
},
|
|
168
|
-
{ immediate: !1, deep: !0 }
|
|
169
|
-
), V(() => {
|
|
170
|
-
p();
|
|
171
|
-
}), (o, e) => (a(), f("div", {
|
|
172
|
-
ref_key: "previewRef",
|
|
173
|
-
ref: l,
|
|
174
|
-
class: "available-range-preview w-full flex items-center overflow-hidden"
|
|
175
|
-
}, [
|
|
176
|
-
b("span", H, y(d($).find((t) => t.value === n.allVisible)?.label), 1),
|
|
177
|
-
D(d(z), {
|
|
178
|
-
type: "primary",
|
|
179
|
-
link: "",
|
|
180
|
-
onClick: e[0] || (e[0] = (t) => o.$emit("edit"))
|
|
181
|
-
}, {
|
|
182
|
-
default: A(() => [...e[1] || (e[1] = [
|
|
183
|
-
I(" 编辑 ", -1)
|
|
184
|
-
])]),
|
|
185
|
-
_: 1
|
|
186
|
-
}),
|
|
187
|
-
n.allVisible === d(T).PARTIAL ? (a(), f("div", J, [
|
|
188
|
-
d(s).length > 0 ? (a(), w(R, {
|
|
189
|
-
key: 0,
|
|
190
|
-
label: "成员:",
|
|
191
|
-
items: d(s)
|
|
192
|
-
}, null, 8, ["items"])) : E("", !0),
|
|
193
|
-
d(r).length > 0 ? (a(), w(R, {
|
|
194
|
-
key: 1,
|
|
195
|
-
label: "部门:",
|
|
196
|
-
items: d(r)
|
|
197
|
-
}, null, 8, ["items"])) : E("", !0)
|
|
198
|
-
])) : E("", !0)
|
|
199
|
-
], 512));
|
|
200
|
-
}
|
|
201
|
-
}, Z = k(K), ee = k(R);
|
|
202
|
-
export {
|
|
203
|
-
Z as A,
|
|
204
|
-
T as R,
|
|
205
|
-
ee as T,
|
|
206
|
-
X as a,
|
|
207
|
-
$ as r,
|
|
208
|
-
j as u
|
|
209
|
-
};
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { w as B } from "./index.bCzIhWFw.js";
|
|
2
|
-
import { computed as u, createElementBlock as b, createCommentVNode as v, openBlock as i, Fragment as M, createElementVNode as E, toDisplayString as g, normalizeClass as I, createBlock as A, renderList as k, unref as p, withCtx as x, ref as C, watch as z, onMounted as F, createVNode as O, createTextVNode as _, nextTick as $ } from "vue";
|
|
3
|
-
import { ElPopover as U, ElButton as Y } from "element-plus";
|
|
4
|
-
import { _ as q } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
-
import '../assets/index2.css';const R = {
|
|
6
|
-
ALL: !0,
|
|
7
|
-
PARTIAL: !1
|
|
8
|
-
}, G = [
|
|
9
|
-
{
|
|
10
|
-
value: R.ALL,
|
|
11
|
-
label: "全部成员"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
value: R.PARTIAL,
|
|
15
|
-
label: "部分成员"
|
|
16
|
-
}
|
|
17
|
-
], m = {
|
|
18
|
-
MEMBER: 1,
|
|
19
|
-
DEPARTMENT: 2
|
|
20
|
-
}, ne = {
|
|
21
|
-
label: "memberName",
|
|
22
|
-
children: "children",
|
|
23
|
-
value: "memberId"
|
|
24
|
-
}, S = {
|
|
25
|
-
three: 3,
|
|
26
|
-
one: 1
|
|
27
|
-
}, H = {
|
|
28
|
-
key: 0,
|
|
29
|
-
class: "pd-l-16 text-dee0e3 pd-r-16"
|
|
30
|
-
}, W = { class: "fz-14 text-646a73 nowrap" }, j = { class: "tag-item nowrap fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe pointer" }, J = { class: "tag-list-popover overflow-y-auto flex gap-4 flex-wrap" }, K = {
|
|
31
|
-
__name: "TagList",
|
|
32
|
-
props: {
|
|
33
|
-
// 显示的标签
|
|
34
|
-
label: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: !0
|
|
37
|
-
},
|
|
38
|
-
// 数据项列表
|
|
39
|
-
items: {
|
|
40
|
-
type: Array,
|
|
41
|
-
default: () => []
|
|
42
|
-
},
|
|
43
|
-
// 默认显示的数量
|
|
44
|
-
defaultShowCount: {
|
|
45
|
-
type: Number,
|
|
46
|
-
default: S.one
|
|
47
|
-
},
|
|
48
|
-
// 是否为只读模式
|
|
49
|
-
readonly: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: !1
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
setup(e) {
|
|
55
|
-
const t = e, n = u(() => t.readonly ? t.items : t.items.slice(0, t.defaultShowCount)), d = u(() => t.items.length > t.defaultShowCount), f = u(() => t.items.length - t.defaultShowCount), h = u(() => t.items.slice(t.defaultShowCount));
|
|
56
|
-
return (a, o) => e.items.length > 0 ? (i(), b(M, { key: 0 }, [
|
|
57
|
-
e.readonly ? v("", !0) : (i(), b("span", H, "|")),
|
|
58
|
-
E("span", W, g(e.label), 1),
|
|
59
|
-
E("div", {
|
|
60
|
-
class: I(["tag-list", { "flex items-center gap-4": !e.readonly }])
|
|
61
|
-
}, [
|
|
62
|
-
(i(!0), b(M, null, k(n.value, (s) => (i(), b("div", {
|
|
63
|
-
key: s.memberId,
|
|
64
|
-
class: I(["tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe", { "mg-r-4 mg-b-4": e.readonly }])
|
|
65
|
-
}, g(s.memberName), 3))), 128)),
|
|
66
|
-
!e.readonly && d.value ? (i(), A(p(U), {
|
|
67
|
-
key: 0,
|
|
68
|
-
placement: "top",
|
|
69
|
-
trigger: "click",
|
|
70
|
-
width: "300"
|
|
71
|
-
}, {
|
|
72
|
-
reference: x(() => [
|
|
73
|
-
E("span", j, " +" + g(f.value), 1)
|
|
74
|
-
]),
|
|
75
|
-
default: x(() => [
|
|
76
|
-
E("div", J, [
|
|
77
|
-
(i(!0), b(M, null, k(h.value, (s) => (i(), b("span", {
|
|
78
|
-
key: s.memberId,
|
|
79
|
-
class: "tag-item nowrap fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
80
|
-
}, g(s.memberName), 1))), 128))
|
|
81
|
-
])
|
|
82
|
-
]),
|
|
83
|
-
_: 1
|
|
84
|
-
})) : v("", !0)
|
|
85
|
-
], 2)
|
|
86
|
-
], 64)) : v("", !0);
|
|
87
|
-
}
|
|
88
|
-
}, D = /* @__PURE__ */ q(K, [["__scopeId", "data-v-bf564085"]]), L = (e, t) => e?.filter(t) || [], w = (e, t) => L(e, (n) => n.memberType === t), N = (e, t) => {
|
|
89
|
-
if (e.children)
|
|
90
|
-
for (const n of e.children)
|
|
91
|
-
n.memberType === m.MEMBER ? t(n) : n.memberType === m.DEPARTMENT && N(n, t);
|
|
92
|
-
}, P = (e) => {
|
|
93
|
-
const t = [];
|
|
94
|
-
return N(e, (n) => t.push(n.memberId)), t;
|
|
95
|
-
};
|
|
96
|
-
function Q(e, t, n = !1) {
|
|
97
|
-
const d = u(() => {
|
|
98
|
-
if (!e.value) return [];
|
|
99
|
-
const a = [...e.value], o = w(
|
|
100
|
-
a,
|
|
101
|
-
m.DEPARTMENT
|
|
102
|
-
);
|
|
103
|
-
if (o.length > 0 && t.value && t.value.length > 0) {
|
|
104
|
-
const s = /* @__PURE__ */ new Set();
|
|
105
|
-
o.forEach((r) => {
|
|
106
|
-
const c = (y) => {
|
|
107
|
-
for (const T of y) {
|
|
108
|
-
if (T.memberType === m.DEPARTMENT && T.memberId === r.memberId)
|
|
109
|
-
return N(
|
|
110
|
-
T,
|
|
111
|
-
(V) => s.add(V)
|
|
112
|
-
), !0;
|
|
113
|
-
if (T.children && c(T.children))
|
|
114
|
-
return !0;
|
|
115
|
-
}
|
|
116
|
-
return !1;
|
|
117
|
-
};
|
|
118
|
-
c(t.value);
|
|
119
|
-
});
|
|
120
|
-
const l = new Set(
|
|
121
|
-
w(a, m.MEMBER).map(
|
|
122
|
-
(r) => r.memberId
|
|
123
|
-
)
|
|
124
|
-
);
|
|
125
|
-
s.forEach((r) => {
|
|
126
|
-
l.has(r.memberId) || a.push(r);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
return a;
|
|
130
|
-
}), f = u(() => {
|
|
131
|
-
if (n)
|
|
132
|
-
return w(
|
|
133
|
-
d.value,
|
|
134
|
-
m.MEMBER
|
|
135
|
-
);
|
|
136
|
-
{
|
|
137
|
-
const a = /* @__PURE__ */ new Set();
|
|
138
|
-
return h.value.forEach((o) => {
|
|
139
|
-
P(o).forEach((l) => a.add(l));
|
|
140
|
-
}), L(
|
|
141
|
-
d.value,
|
|
142
|
-
(o) => o.memberType === m.MEMBER && !a.has(o.memberId)
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
}), h = u(() => {
|
|
146
|
-
if (n)
|
|
147
|
-
return w(
|
|
148
|
-
d.value,
|
|
149
|
-
m.DEPARTMENT
|
|
150
|
-
);
|
|
151
|
-
{
|
|
152
|
-
const a = [], o = (l) => {
|
|
153
|
-
if (!l.children || l.children.length === 0) return !1;
|
|
154
|
-
const r = P(l);
|
|
155
|
-
return r.length === 0 ? !1 : r.every(
|
|
156
|
-
(c) => d.value.some(
|
|
157
|
-
(y) => y.memberType === m.MEMBER && y.memberId === c
|
|
158
|
-
)
|
|
159
|
-
);
|
|
160
|
-
}, s = (l, r = !1) => {
|
|
161
|
-
if (l.memberType === m.DEPARTMENT) {
|
|
162
|
-
const c = o(l);
|
|
163
|
-
if (c && !r) {
|
|
164
|
-
if (a.push({
|
|
165
|
-
memberId: l.memberId,
|
|
166
|
-
memberName: l.memberName,
|
|
167
|
-
memberType: m.DEPARTMENT,
|
|
168
|
-
children: l.children
|
|
169
|
-
}), l.children)
|
|
170
|
-
for (const y of l.children)
|
|
171
|
-
s(y, !0);
|
|
172
|
-
} else if (!c && l.children)
|
|
173
|
-
for (const y of l.children)
|
|
174
|
-
s(y, !1);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
for (const l of t.value)
|
|
178
|
-
s(l, !1);
|
|
179
|
-
return a;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
return {
|
|
183
|
-
selectedMembers: f,
|
|
184
|
-
selectedDepartments: h
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
const X = { class: "fz-14 text-1f2329" }, Z = {
|
|
188
|
-
__name: "layout",
|
|
189
|
-
props: {
|
|
190
|
-
// 当前选择的范围类型(是否全部可见)
|
|
191
|
-
allVisible: {
|
|
192
|
-
type: Boolean,
|
|
193
|
-
default: R.ALL
|
|
194
|
-
},
|
|
195
|
-
// 选中的项目列表(完整对象数组,由父组件根据ID从树中查找得到)
|
|
196
|
-
modelValue: {
|
|
197
|
-
type: Array,
|
|
198
|
-
default: () => []
|
|
199
|
-
},
|
|
200
|
-
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
201
|
-
treeList: {
|
|
202
|
-
type: Array,
|
|
203
|
-
default: () => []
|
|
204
|
-
},
|
|
205
|
-
// 是否为只读模式
|
|
206
|
-
readonly: {
|
|
207
|
-
type: Boolean,
|
|
208
|
-
default: !1
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
setup(e, { expose: t }) {
|
|
212
|
-
const n = C(null), d = () => {
|
|
213
|
-
n.value && $(() => {
|
|
214
|
-
n.value.scrollIntoView({
|
|
215
|
-
behavior: "smooth",
|
|
216
|
-
block: "center"
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
}, f = e, { selectedMembers: h, selectedDepartments: a } = Q(
|
|
220
|
-
u(() => f.modelValue),
|
|
221
|
-
u(() => f.treeList),
|
|
222
|
-
f.readonly
|
|
223
|
-
), o = u(() => {
|
|
224
|
-
const l = h.value.length > 0, r = a.value.length > 0;
|
|
225
|
-
return l && !r || !l && r ? S.three : S.one;
|
|
226
|
-
}), s = u(() => [...h.value, ...a.value]);
|
|
227
|
-
return z(
|
|
228
|
-
() => [f.allVisible, f.modelValue],
|
|
229
|
-
() => {
|
|
230
|
-
d();
|
|
231
|
-
},
|
|
232
|
-
{ immediate: !1, deep: !0 }
|
|
233
|
-
), F(() => {
|
|
234
|
-
d();
|
|
235
|
-
}), t({
|
|
236
|
-
allSelectedItems: s
|
|
237
|
-
}), (l, r) => (i(), b("div", {
|
|
238
|
-
ref_key: "previewRef",
|
|
239
|
-
ref: n,
|
|
240
|
-
class: I(["available-range-preview w-full overflow-hidden", {
|
|
241
|
-
"flex items-center": !e.readonly
|
|
242
|
-
}])
|
|
243
|
-
}, [
|
|
244
|
-
e.readonly ? v("", !0) : (i(), b(M, { key: 0 }, [
|
|
245
|
-
r[2] || (r[2] = E("div", { class: "text-1f2329" }, "可用范围:", -1)),
|
|
246
|
-
E("span", X, g(p(G).find((c) => c.value === e.allVisible)?.label), 1),
|
|
247
|
-
O(p(Y), {
|
|
248
|
-
class: "mg-l-16",
|
|
249
|
-
type: "primary",
|
|
250
|
-
link: "",
|
|
251
|
-
onClick: r[0] || (r[0] = (c) => l.$emit("edit"))
|
|
252
|
-
}, {
|
|
253
|
-
default: x(() => [...r[1] || (r[1] = [
|
|
254
|
-
_(" 编辑 ", -1)
|
|
255
|
-
])]),
|
|
256
|
-
_: 1
|
|
257
|
-
})
|
|
258
|
-
], 64)),
|
|
259
|
-
e.allVisible === p(R).PARTIAL ? (i(), b("div", {
|
|
260
|
-
key: 1,
|
|
261
|
-
class: I(["flex-1 overflow-hidden", { "flex items-center": !e.readonly }])
|
|
262
|
-
}, [
|
|
263
|
-
p(h)?.length ? (i(), A(D, {
|
|
264
|
-
key: 0,
|
|
265
|
-
label: "成员:",
|
|
266
|
-
items: p(h),
|
|
267
|
-
"default-show-count": o.value,
|
|
268
|
-
readonly: e.readonly
|
|
269
|
-
}, null, 8, ["items", "default-show-count", "readonly"])) : v("", !0),
|
|
270
|
-
p(a)?.length ? (i(), A(D, {
|
|
271
|
-
key: 1,
|
|
272
|
-
label: "部门:",
|
|
273
|
-
items: p(a),
|
|
274
|
-
"default-show-count": o.value,
|
|
275
|
-
readonly: e.readonly
|
|
276
|
-
}, null, 8, ["items", "default-show-count", "readonly"])) : v("", !0)
|
|
277
|
-
], 2)) : v("", !0)
|
|
278
|
-
], 2));
|
|
279
|
-
}
|
|
280
|
-
}, ae = B(Z), se = B(D);
|
|
281
|
-
export {
|
|
282
|
-
ae as A,
|
|
283
|
-
R,
|
|
284
|
-
ne as T,
|
|
285
|
-
se as a,
|
|
286
|
-
G as r,
|
|
287
|
-
Q as u
|
|
288
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { _ as x, w as R } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
-
import { ref as L, computed as m, createElementBlock as d, createCommentVNode as E, openBlock as n, createElementVNode as f, toDisplayString as y, Fragment as P, renderList as S, createBlock as M, createVNode as w, unref as T, withCtx as N, createTextVNode as k } from "vue";
|
|
3
|
-
import { ElButton as D } from "element-plus";
|
|
4
|
-
import '../assets/index.css';const _ = {
|
|
5
|
-
ALL: "all",
|
|
6
|
-
PARTIAL: "partial"
|
|
7
|
-
}, I = [
|
|
8
|
-
{
|
|
9
|
-
value: _.ALL,
|
|
10
|
-
label: "全部成员"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: _.PARTIAL,
|
|
14
|
-
label: "部分成员"
|
|
15
|
-
}
|
|
16
|
-
], c = {
|
|
17
|
-
MEMBER: "member",
|
|
18
|
-
DEPARTMENT: "department"
|
|
19
|
-
}, B = { key: 0 }, C = { class: "fz-14 text-646a73 mg-b-8" }, V = { class: "tag-list flex flex-wrap gap-4" }, $ = {
|
|
20
|
-
__name: "TagList",
|
|
21
|
-
props: {
|
|
22
|
-
// 显示的标签
|
|
23
|
-
label: {
|
|
24
|
-
type: String,
|
|
25
|
-
required: !0
|
|
26
|
-
},
|
|
27
|
-
// 数据项列表
|
|
28
|
-
items: {
|
|
29
|
-
type: Array,
|
|
30
|
-
default: () => []
|
|
31
|
-
},
|
|
32
|
-
// 默认显示的数量
|
|
33
|
-
defaultShowCount: {
|
|
34
|
-
type: Number,
|
|
35
|
-
default: 3
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
setup(l) {
|
|
39
|
-
const t = l, a = L(!1), h = m(() => a.value ? t.items : t.items.slice(0, t.defaultShowCount)), b = m(() => t.items.length > t.defaultShowCount), r = m(() => t.items.length - t.defaultShowCount), s = () => {
|
|
40
|
-
a.value = !a.value;
|
|
41
|
-
};
|
|
42
|
-
return (i, A) => l.items.length > 0 ? (n(), d("div", B, [
|
|
43
|
-
f("div", C, y(l.label), 1),
|
|
44
|
-
f("div", V, [
|
|
45
|
-
(n(!0), d(P, null, S(h.value, (e) => (n(), d("span", {
|
|
46
|
-
key: e.id,
|
|
47
|
-
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
48
|
-
}, y(e.name), 1))), 128)),
|
|
49
|
-
b.value ? (n(), d("span", {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: "expand-btn fz-12 pd-l-8 pd-r-8 radius-4 bg-f5f7fa text-646a73 cursor-pointer",
|
|
52
|
-
onClick: s
|
|
53
|
-
}, y(a.value ? "收起" : `+${r.value}`), 1)) : E("", !0)
|
|
54
|
-
])
|
|
55
|
-
])) : E("", !0);
|
|
56
|
-
}
|
|
57
|
-
}, v = /* @__PURE__ */ x($, [["__scopeId", "data-v-cff25679"]]), z = { class: "available-range-preview w-full" }, Y = { class: "flex items-center justify-between mg-b-16" }, G = { class: "flex-1" }, W = { class: "fz-14 weight-500" }, j = {
|
|
58
|
-
__name: "layout",
|
|
59
|
-
props: {
|
|
60
|
-
// 当前选择的范围类型
|
|
61
|
-
type: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: "all"
|
|
64
|
-
},
|
|
65
|
-
// 选中的项目列表
|
|
66
|
-
modelValue: {
|
|
67
|
-
type: Array,
|
|
68
|
-
default: () => []
|
|
69
|
-
},
|
|
70
|
-
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
71
|
-
treeList: {
|
|
72
|
-
type: Array,
|
|
73
|
-
default: () => []
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
emits: ["edit"],
|
|
77
|
-
setup(l) {
|
|
78
|
-
const t = l, a = {
|
|
79
|
-
PARTIAL: "partial"
|
|
80
|
-
}, h = m(() => t.modelValue.filter(
|
|
81
|
-
(r) => r.type === c.MEMBER
|
|
82
|
-
)), b = m(() => ((s) => {
|
|
83
|
-
const i = [], A = (e) => {
|
|
84
|
-
if (e.type === c.DEPARTMENT && e.children) {
|
|
85
|
-
const g = (u) => {
|
|
86
|
-
const o = [];
|
|
87
|
-
for (const p of u)
|
|
88
|
-
p.type === c.MEMBER ? o.push(p.id) : p.type === c.DEPARTMENT && o.push(...g(p.children));
|
|
89
|
-
return o;
|
|
90
|
-
};
|
|
91
|
-
if (g(e.children).every(
|
|
92
|
-
(u) => t.modelValue.some(
|
|
93
|
-
(o) => o.type === c.MEMBER && o.id === u
|
|
94
|
-
)
|
|
95
|
-
) && i.push({
|
|
96
|
-
id: e.id,
|
|
97
|
-
name: e.name,
|
|
98
|
-
type: c.DEPARTMENT
|
|
99
|
-
}), e.children)
|
|
100
|
-
for (const u of e.children)
|
|
101
|
-
A(u);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
for (const e of s)
|
|
105
|
-
A(e);
|
|
106
|
-
return i;
|
|
107
|
-
})(t.treeList));
|
|
108
|
-
return (r, s) => (n(), d("div", z, [
|
|
109
|
-
f("div", Y, [
|
|
110
|
-
f("div", G, [
|
|
111
|
-
f("span", W, y(T(I).find((i) => i.value === l.type)?.label), 1)
|
|
112
|
-
]),
|
|
113
|
-
w(T(D), {
|
|
114
|
-
type: "primary",
|
|
115
|
-
size: "small",
|
|
116
|
-
onClick: s[0] || (s[0] = (i) => r.$emit("edit"))
|
|
117
|
-
}, {
|
|
118
|
-
default: N(() => [...s[1] || (s[1] = [
|
|
119
|
-
k(" 编辑 ", -1)
|
|
120
|
-
])]),
|
|
121
|
-
_: 1
|
|
122
|
-
})
|
|
123
|
-
]),
|
|
124
|
-
l.type === a.PARTIAL ? (n(), M(v, {
|
|
125
|
-
key: 0,
|
|
126
|
-
label: "成员:",
|
|
127
|
-
items: h.value
|
|
128
|
-
}, null, 8, ["items"])) : E("", !0),
|
|
129
|
-
l.type === a.PARTIAL ? (n(), M(v, {
|
|
130
|
-
key: 1,
|
|
131
|
-
label: "部门:",
|
|
132
|
-
items: b.value
|
|
133
|
-
}, null, 8, ["items"])) : E("", !0)
|
|
134
|
-
]));
|
|
135
|
-
}
|
|
136
|
-
}, K = R(j), Q = R(v);
|
|
137
|
-
export {
|
|
138
|
-
K as A,
|
|
139
|
-
_ as R,
|
|
140
|
-
Q as T,
|
|
141
|
-
I as r
|
|
142
|
-
};
|