china-mobile-international-custom-components 0.0.21 → 0.0.23
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/AvailableRangeSetting.mjs +15 -14
- package/lib/AvailableRangeSetting.js +1 -1
- package/package.json +3 -3
- 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.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.C6AMos7n.js +0 -17
- package/es/chunks/layout.CWFXohJu.js +0 -622
- 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.DydPD8Lc.js +0 -1
- package/lib/chunks/index.k_hSuA6i.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/utils.BT5Uuz2Q.js +0 -1
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { _, w as P } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
-
import { computed as c, createElementBlock as r, openBlock as a, createElementVNode as s, createCommentVNode as g, createVNode as x, toDisplayString as E, unref as h, withCtx as L, createTextVNode as N, Fragment as M, renderList as T } from "vue";
|
|
3
|
-
import { ElButton as w } from "element-plus";
|
|
4
|
-
import '../assets/index.css';const R = {
|
|
5
|
-
ALL: "all",
|
|
6
|
-
PARTIAL: "partial"
|
|
7
|
-
}, D = [
|
|
8
|
-
{
|
|
9
|
-
value: R.ALL,
|
|
10
|
-
label: "全部成员"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: R.PARTIAL,
|
|
14
|
-
label: "部分成员"
|
|
15
|
-
}
|
|
16
|
-
], n = {
|
|
17
|
-
MEMBER: "member",
|
|
18
|
-
DEPARTMENT: "department"
|
|
19
|
-
}, I = { class: "available-range-preview w-full" }, S = { class: "preview-area pd-16 radius-8 border" }, k = { class: "flex items-center justify-between mg-b-16" }, B = { class: "type-display" }, V = { class: "fz-14 weight-500" }, z = {
|
|
20
|
-
key: 0,
|
|
21
|
-
class: "mg-b-12"
|
|
22
|
-
}, C = { class: "member-list flex flex-wrap gap-8" }, Y = { key: 1 }, G = { class: "department-list flex flex-wrap gap-8" }, W = {
|
|
23
|
-
__name: "layout",
|
|
24
|
-
props: {
|
|
25
|
-
// 当前选择的范围类型
|
|
26
|
-
type: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "all"
|
|
29
|
-
},
|
|
30
|
-
// 选中的项目列表
|
|
31
|
-
modelValue: {
|
|
32
|
-
type: Array,
|
|
33
|
-
default: () => []
|
|
34
|
-
},
|
|
35
|
-
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
36
|
-
treeList: {
|
|
37
|
-
type: Array,
|
|
38
|
-
default: () => []
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
emits: ["edit"],
|
|
42
|
-
setup(m) {
|
|
43
|
-
const p = m, v = {
|
|
44
|
-
PARTIAL: "partial"
|
|
45
|
-
}, f = c(() => p.modelValue.filter(
|
|
46
|
-
(i) => i.type === n.MEMBER
|
|
47
|
-
)), y = c(() => ((t) => {
|
|
48
|
-
const e = [], A = (l) => {
|
|
49
|
-
if (l.type === n.DEPARTMENT && l.children) {
|
|
50
|
-
const b = (d) => {
|
|
51
|
-
const o = [];
|
|
52
|
-
for (const u of d)
|
|
53
|
-
u.type === n.MEMBER ? o.push(u.id) : u.type === n.DEPARTMENT && o.push(...b(u.children));
|
|
54
|
-
return o;
|
|
55
|
-
};
|
|
56
|
-
if (b(l.children).every(
|
|
57
|
-
(d) => p.modelValue.some(
|
|
58
|
-
(o) => o.type === n.MEMBER && o.id === d
|
|
59
|
-
)
|
|
60
|
-
) && e.push({
|
|
61
|
-
id: l.id,
|
|
62
|
-
name: l.name,
|
|
63
|
-
type: n.DEPARTMENT
|
|
64
|
-
}), l.children)
|
|
65
|
-
for (const d of l.children)
|
|
66
|
-
A(d);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
for (const l of t)
|
|
70
|
-
A(l);
|
|
71
|
-
return e;
|
|
72
|
-
})(p.treeList));
|
|
73
|
-
return c(() => y.value.length), c(() => p.modelValue.filter(
|
|
74
|
-
(i) => i.type === n.DEPARTMENT
|
|
75
|
-
).length), c(() => f.value.length), (i, t) => (a(), r("div", I, [
|
|
76
|
-
s("div", S, [
|
|
77
|
-
s("div", k, [
|
|
78
|
-
s("div", B, [
|
|
79
|
-
s("span", V, E(h(D).find((e) => e.value === m.type)?.label), 1)
|
|
80
|
-
]),
|
|
81
|
-
x(h(w), {
|
|
82
|
-
type: "primary",
|
|
83
|
-
size: "small",
|
|
84
|
-
onClick: t[0] || (t[0] = (e) => i.$emit("edit"))
|
|
85
|
-
}, {
|
|
86
|
-
default: L(() => [...t[1] || (t[1] = [
|
|
87
|
-
N("编辑", -1)
|
|
88
|
-
])]),
|
|
89
|
-
_: 1
|
|
90
|
-
})
|
|
91
|
-
]),
|
|
92
|
-
m.type === v.PARTIAL && f.value.length > 0 ? (a(), r("div", z, [
|
|
93
|
-
t[2] || (t[2] = s("div", { class: "fz-12 text-secondary mg-b-8" }, "成员:", -1)),
|
|
94
|
-
s("div", C, [
|
|
95
|
-
(a(!0), r(M, null, T(f.value, (e) => (a(), r("span", {
|
|
96
|
-
key: e.id,
|
|
97
|
-
class: "member-tag fz-12 pd-4 pd-l-8 pd-r-8 radius-4 bg-primary-light text-primary"
|
|
98
|
-
}, E(e.name), 1))), 128))
|
|
99
|
-
])
|
|
100
|
-
])) : g("", !0),
|
|
101
|
-
m.type === v.PARTIAL && y.value.length > 0 ? (a(), r("div", Y, [
|
|
102
|
-
t[3] || (t[3] = s("div", { class: "fz-12 text-secondary mg-b-8" }, "部门:", -1)),
|
|
103
|
-
s("div", G, [
|
|
104
|
-
(a(!0), r(M, null, T(y.value, (e) => (a(), r("span", {
|
|
105
|
-
key: e.id,
|
|
106
|
-
class: "department-tag fz-12 pd-4 pd-l-8 pd-r-8 radius-4 bg-info-light text-info"
|
|
107
|
-
}, E(e.name), 1))), 128))
|
|
108
|
-
])
|
|
109
|
-
])) : g("", !0)
|
|
110
|
-
])
|
|
111
|
-
]));
|
|
112
|
-
}
|
|
113
|
-
}, $ = /* @__PURE__ */ _(W, [["__scopeId", "data-v-fc2b7e91"]]), J = P($);
|
|
114
|
-
export {
|
|
115
|
-
J as A,
|
|
116
|
-
R,
|
|
117
|
-
D as r
|
|
118
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { _ as P, w as L } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
-
import { computed as f, createElementBlock as m, createCommentVNode as y, openBlock as l, createElementVNode as a, toDisplayString as o, createBlock as E, Fragment as R, renderList as x, unref as _, withCtx as A, createVNode as S, createTextVNode as k } from "vue";
|
|
3
|
-
import { ElPopover as N, ElButton as I } from "element-plus";
|
|
4
|
-
import '../assets/index.css';const w = {
|
|
5
|
-
ALL: "all",
|
|
6
|
-
PARTIAL: "partial"
|
|
7
|
-
}, D = [
|
|
8
|
-
{
|
|
9
|
-
value: w.ALL,
|
|
10
|
-
label: "全部成员"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: w.PARTIAL,
|
|
14
|
-
label: "部分成员"
|
|
15
|
-
}
|
|
16
|
-
], u = {
|
|
17
|
-
MEMBER: "member",
|
|
18
|
-
DEPARTMENT: "department"
|
|
19
|
-
}, B = { key: 0 }, C = { class: "fz-14 text-646a73 mg-b-8" }, z = { class: "tag-list flex flex-wrap gap-4" }, V = { class: "expand-btn fz-12 pd-l-8 pd-r-8 radius-4 bg-f5f7fa text-646a73 cursor-pointer" }, $ = { class: "popover-content" }, Y = { class: "fz-14 text-646a73 mg-b-12" }, G = { class: "tag-list-popover flex flex-wrap gap-4" }, W = {
|
|
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(t) {
|
|
39
|
-
const e = t, h = f(() => e.items.slice(0, e.defaultShowCount)), b = f(() => e.items.length > e.defaultShowCount), v = f(() => e.items.length - e.defaultShowCount), n = f(() => e.items.slice(e.defaultShowCount));
|
|
40
|
-
return (i, c) => t.items.length > 0 ? (l(), m("div", B, [
|
|
41
|
-
a("div", C, o(t.label), 1),
|
|
42
|
-
a("div", z, [
|
|
43
|
-
(l(!0), m(R, null, x(h.value, (r) => (l(), m("span", {
|
|
44
|
-
key: r.id,
|
|
45
|
-
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
46
|
-
}, o(r.name), 1))), 128)),
|
|
47
|
-
b.value ? (l(), E(_(N), {
|
|
48
|
-
key: 0,
|
|
49
|
-
placement: "top",
|
|
50
|
-
trigger: "click",
|
|
51
|
-
width: "300"
|
|
52
|
-
}, {
|
|
53
|
-
reference: A(() => [
|
|
54
|
-
a("span", V, " +" + o(v.value), 1)
|
|
55
|
-
]),
|
|
56
|
-
default: A(() => [
|
|
57
|
-
a("div", $, [
|
|
58
|
-
a("div", Y, o(t.label.replace(":", "")) + "(" + o(n.value.length) + "个)", 1),
|
|
59
|
-
a("div", G, [
|
|
60
|
-
(l(!0), m(R, null, x(n.value, (r) => (l(), m("span", {
|
|
61
|
-
key: r.id,
|
|
62
|
-
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
63
|
-
}, o(r.name), 1))), 128))
|
|
64
|
-
])
|
|
65
|
-
])
|
|
66
|
-
]),
|
|
67
|
-
_: 1
|
|
68
|
-
})) : y("", !0)
|
|
69
|
-
])
|
|
70
|
-
])) : y("", !0);
|
|
71
|
-
}
|
|
72
|
-
}, M = /* @__PURE__ */ P(W, [["__scopeId", "data-v-d1a6ca27"]]), j = { class: "available-range-preview w-full" }, q = { class: "flex items-center justify-between mg-b-16" }, F = { class: "flex-1" }, O = { class: "fz-14 weight-500" }, H = {
|
|
73
|
-
__name: "layout",
|
|
74
|
-
props: {
|
|
75
|
-
// 当前选择的范围类型
|
|
76
|
-
type: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: "all"
|
|
79
|
-
},
|
|
80
|
-
// 选中的项目列表
|
|
81
|
-
modelValue: {
|
|
82
|
-
type: Array,
|
|
83
|
-
default: () => []
|
|
84
|
-
},
|
|
85
|
-
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
86
|
-
treeList: {
|
|
87
|
-
type: Array,
|
|
88
|
-
default: () => []
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
emits: ["edit"],
|
|
92
|
-
setup(t) {
|
|
93
|
-
const e = t, h = {
|
|
94
|
-
PARTIAL: "partial"
|
|
95
|
-
}, b = f(() => e.modelValue.filter(
|
|
96
|
-
(n) => n.type === u.MEMBER
|
|
97
|
-
)), v = f(() => ((i) => {
|
|
98
|
-
const c = [], r = (s) => {
|
|
99
|
-
if (s.type === u.DEPARTMENT && s.children) {
|
|
100
|
-
const T = (p) => {
|
|
101
|
-
const d = [];
|
|
102
|
-
for (const g of p)
|
|
103
|
-
g.type === u.MEMBER ? d.push(g.id) : g.type === u.DEPARTMENT && d.push(...T(g.children));
|
|
104
|
-
return d;
|
|
105
|
-
};
|
|
106
|
-
if (T(s.children).every(
|
|
107
|
-
(p) => e.modelValue.some(
|
|
108
|
-
(d) => d.type === u.MEMBER && d.id === p
|
|
109
|
-
)
|
|
110
|
-
) && c.push({
|
|
111
|
-
id: s.id,
|
|
112
|
-
name: s.name,
|
|
113
|
-
type: u.DEPARTMENT
|
|
114
|
-
}), s.children)
|
|
115
|
-
for (const p of s.children)
|
|
116
|
-
r(p);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
for (const s of i)
|
|
120
|
-
r(s);
|
|
121
|
-
return c;
|
|
122
|
-
})(e.treeList));
|
|
123
|
-
return (n, i) => (l(), m("div", j, [
|
|
124
|
-
a("div", q, [
|
|
125
|
-
a("div", F, [
|
|
126
|
-
a("span", O, o(_(D).find((c) => c.value === t.type)?.label), 1)
|
|
127
|
-
]),
|
|
128
|
-
S(_(I), {
|
|
129
|
-
type: "primary",
|
|
130
|
-
size: "small",
|
|
131
|
-
onClick: i[0] || (i[0] = (c) => n.$emit("edit"))
|
|
132
|
-
}, {
|
|
133
|
-
default: A(() => [...i[1] || (i[1] = [
|
|
134
|
-
k(" 编辑 ", -1)
|
|
135
|
-
])]),
|
|
136
|
-
_: 1
|
|
137
|
-
})
|
|
138
|
-
]),
|
|
139
|
-
t.type === h.PARTIAL ? (l(), E(M, {
|
|
140
|
-
key: 0,
|
|
141
|
-
label: "成员:",
|
|
142
|
-
items: b.value
|
|
143
|
-
}, null, 8, ["items"])) : y("", !0),
|
|
144
|
-
t.type === h.PARTIAL ? (l(), E(M, {
|
|
145
|
-
key: 1,
|
|
146
|
-
label: "部门:",
|
|
147
|
-
items: v.value
|
|
148
|
-
}, null, 8, ["items"])) : y("", !0)
|
|
149
|
-
]));
|
|
150
|
-
}
|
|
151
|
-
}, Z = L(H), ee = L(M);
|
|
152
|
-
export {
|
|
153
|
-
Z as A,
|
|
154
|
-
w as R,
|
|
155
|
-
ee as T,
|
|
156
|
-
D as r
|
|
157
|
-
};
|
|
@@ -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
|
-
};
|