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,329 +0,0 @@
|
|
|
1
|
-
import { t as withInstall } from "./utils.BhlZXNZ6.js";
|
|
2
|
-
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper.Cf-_TWPK.js";
|
|
3
|
-
import { t as layout_default$1 } from "./layout.C6AMos7n.js";
|
|
4
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toHandlers, unref, useSlots, watch, withCtx } from "vue";
|
|
5
|
-
import { ElButton, ElDropdown, ElDropdownItem, ElDropdownMenu, ElIcon, ElPagination, ElTable, ElTableColumn } from "element-plus";
|
|
6
|
-
import { emitsMap, operationConfigMap, pageParams, paginationConfig } from "color-star-custom-methods";
|
|
7
|
-
import { SearchBar } from "color-star-custom-components";
|
|
8
|
-
import { IconMore, IconZuo } from "color-message-aibox-vue";
|
|
9
|
-
import { useRouter } from "vue-router";
|
|
10
|
-
import '../assets/PageContainer.css';const COLUMN_TYPES = { ACTION: "action" };
|
|
11
|
-
var _hoisted_1 = { class: "page-container flex flex-col overflow-hidden h-full" }, _hoisted_2 = { class: "text-1f2329 pd-l-4" }, _hoisted_3 = { class: "action-buttons flex items-center" }, _hoisted_4 = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "pagination-section pd-t-16 flex justify-center"
|
|
14
|
-
};
|
|
15
|
-
const PageContainer = withInstall(/* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ Object.assign({ name: "PageContainer" }, {
|
|
16
|
-
__name: "layout",
|
|
17
|
-
props: {
|
|
18
|
-
breadcrumb: {
|
|
19
|
-
type: Object,
|
|
20
|
-
default: () => ({
|
|
21
|
-
show: !1,
|
|
22
|
-
text: ""
|
|
23
|
-
})
|
|
24
|
-
},
|
|
25
|
-
title: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: ""
|
|
28
|
-
},
|
|
29
|
-
searchFields: {
|
|
30
|
-
type: Array,
|
|
31
|
-
default: () => []
|
|
32
|
-
},
|
|
33
|
-
modelValue: {
|
|
34
|
-
type: Object,
|
|
35
|
-
default: () => ({})
|
|
36
|
-
},
|
|
37
|
-
columns: {
|
|
38
|
-
type: Array,
|
|
39
|
-
default: () => []
|
|
40
|
-
},
|
|
41
|
-
tableData: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: () => []
|
|
44
|
-
},
|
|
45
|
-
tableProps: {
|
|
46
|
-
type: Object,
|
|
47
|
-
default: () => ({
|
|
48
|
-
stripe: !0,
|
|
49
|
-
border: !1
|
|
50
|
-
})
|
|
51
|
-
},
|
|
52
|
-
treeProps: {
|
|
53
|
-
type: Object,
|
|
54
|
-
default: () => ({})
|
|
55
|
-
},
|
|
56
|
-
tableEvents: {
|
|
57
|
-
type: Object,
|
|
58
|
-
default: () => ({})
|
|
59
|
-
},
|
|
60
|
-
showPagination: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: !0
|
|
63
|
-
},
|
|
64
|
-
pagination: {
|
|
65
|
-
type: Object,
|
|
66
|
-
default: () => ({
|
|
67
|
-
page: pageParams.pageNum,
|
|
68
|
-
size: pageParams.pageSize,
|
|
69
|
-
total: 0,
|
|
70
|
-
pageSizes: paginationConfig.pageSizes,
|
|
71
|
-
layout: paginationConfig.layout
|
|
72
|
-
})
|
|
73
|
-
},
|
|
74
|
-
customSlots: {
|
|
75
|
-
type: Array,
|
|
76
|
-
default: () => []
|
|
77
|
-
},
|
|
78
|
-
api: {
|
|
79
|
-
type: Function,
|
|
80
|
-
default: null
|
|
81
|
-
},
|
|
82
|
-
autoLoad: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: !0
|
|
85
|
-
},
|
|
86
|
-
apiParams: {
|
|
87
|
-
type: Object,
|
|
88
|
-
default: () => ({})
|
|
89
|
-
},
|
|
90
|
-
isSeparate: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: !1
|
|
93
|
-
},
|
|
94
|
-
minWidth: {
|
|
95
|
-
type: Number,
|
|
96
|
-
default: 290
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
emits: [
|
|
100
|
-
emitsMap.search,
|
|
101
|
-
emitsMap.reset,
|
|
102
|
-
emitsMap.actionClick,
|
|
103
|
-
emitsMap.paginationChange,
|
|
104
|
-
emitsMap.sizeChange,
|
|
105
|
-
emitsMap.dataLoaded,
|
|
106
|
-
emitsMap.dataError,
|
|
107
|
-
emitsMap.updateModelValue
|
|
108
|
-
],
|
|
109
|
-
setup(e, { expose: w, emit: D }) {
|
|
110
|
-
let O = useRouter(), k = e, A = D, j = ref(null), M = ref(null), N = useSlots(), P = ref(!1), F = ref([]), I = ref({
|
|
111
|
-
page: pageParams.pageNum,
|
|
112
|
-
size: pageParams.pageSize,
|
|
113
|
-
total: 0,
|
|
114
|
-
pageSizes: paginationConfig.pageSizes,
|
|
115
|
-
layout: paginationConfig.layout
|
|
116
|
-
}), L = ref({ ...k.modelValue }), R = computed(() => k.api ? F.value : k.tableData), z = computed(() => k.api ? I.value : k.pagination), B = computed(() => k.api ? P.value : k.tableProps.loading || !1), V = computed(() => k.columns?.map((e) => {
|
|
117
|
-
if (e.type === COLUMN_TYPES.ACTION && (Array.isArray(e.actions) || typeof e.actions == "function")) return {
|
|
118
|
-
...e,
|
|
119
|
-
align: "center",
|
|
120
|
-
fixed: "right"
|
|
121
|
-
};
|
|
122
|
-
let { width: w, ...T } = e;
|
|
123
|
-
return {
|
|
124
|
-
...T,
|
|
125
|
-
minWidth: w
|
|
126
|
-
};
|
|
127
|
-
})), H = () => {
|
|
128
|
-
O.back();
|
|
129
|
-
}, U = (e, w) => w.formatter ? w.formatter(e[w.prop], e, w) : e[w.prop], W = (e) => N[e] !== void 0, G = (e, w) => typeof e.actions == "function" ? e.actions(w) || [] : e.actions || [], K = (e) => e.length < 3 ? e : e.slice(0, 1), q = (e) => e.length < 3 ? [] : e.slice(1), J = (e = {}) => {
|
|
130
|
-
if (!k.api) return;
|
|
131
|
-
P.value = !0;
|
|
132
|
-
let w = {
|
|
133
|
-
...e,
|
|
134
|
-
...k.apiParams,
|
|
135
|
-
...L.value
|
|
136
|
-
};
|
|
137
|
-
k.showPagination && (w.page = z.value.page, w.size = z.value.size), k.api(w).then((e) => {
|
|
138
|
-
F.value = e?.data?.data || e?.data || [], I.value.total = e?.data?.total || 0, A(emitsMap.dataLoaded, {
|
|
139
|
-
data: F.value,
|
|
140
|
-
pagination: I.value,
|
|
141
|
-
params: w
|
|
142
|
-
});
|
|
143
|
-
}).catch((e) => {
|
|
144
|
-
F.value = [], I.value.total = 0, A(emitsMap.dataError, e);
|
|
145
|
-
}).finally(() => {
|
|
146
|
-
P.value = !1;
|
|
147
|
-
});
|
|
148
|
-
}, Y = () => {
|
|
149
|
-
k.api ? (I.value.page = pageParams.pageNum, J()) : A(emitsMap.search, L.value);
|
|
150
|
-
}, X = () => {
|
|
151
|
-
let e = {};
|
|
152
|
-
Object.keys(L.value).forEach((w) => {
|
|
153
|
-
e[w] = void 0;
|
|
154
|
-
}), L.value = e, k.api ? (I.value.page = pageParams.pageNum, J()) : A(emitsMap.reset);
|
|
155
|
-
}, Z = (e, w, T) => {
|
|
156
|
-
A(emitsMap.actionClick, {
|
|
157
|
-
action: e,
|
|
158
|
-
row: w,
|
|
159
|
-
index: T
|
|
160
|
-
});
|
|
161
|
-
}, Q = (e, w) => {
|
|
162
|
-
switch (e) {
|
|
163
|
-
case operationConfigMap.search:
|
|
164
|
-
Y();
|
|
165
|
-
break;
|
|
166
|
-
case operationConfigMap.reset:
|
|
167
|
-
X();
|
|
168
|
-
break;
|
|
169
|
-
default: break;
|
|
170
|
-
}
|
|
171
|
-
}, $ = (e, w) => {};
|
|
172
|
-
return watch(() => k.modelValue, (e) => {
|
|
173
|
-
L.value = { ...e };
|
|
174
|
-
}, {
|
|
175
|
-
deep: !0,
|
|
176
|
-
immediate: !0
|
|
177
|
-
}), watch(() => L.value, (e) => {
|
|
178
|
-
A(emitsMap.updateModelValue, { ...e });
|
|
179
|
-
}, { deep: !0 }), onMounted(() => {
|
|
180
|
-
k.autoLoad && k.api && J();
|
|
181
|
-
}), w({
|
|
182
|
-
loadData: J,
|
|
183
|
-
handleSearch: Y
|
|
184
|
-
}), (w, E) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
185
|
-
e.breadcrumb.show ? (openBlock(), createElementBlock("div", {
|
|
186
|
-
key: 0,
|
|
187
|
-
class: "flex items-center fz-14 pd-b-20 pointer",
|
|
188
|
-
onClick: H
|
|
189
|
-
}, [createVNode(unref(ElIcon), { size: 16 }, {
|
|
190
|
-
default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(e.breadcrumb.icon || unref(IconZuo))))]),
|
|
191
|
-
_: 1
|
|
192
|
-
}), createElementVNode("span", _hoisted_2, toDisplayString(e.breadcrumb.text), 1)])) : createCommentVNode("", !0),
|
|
193
|
-
e.searchFields && e.searchFields.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
194
|
-
key: 1,
|
|
195
|
-
class: normalizeClass({
|
|
196
|
-
"search-section pd-b-12 mg-b-12": !e.isSeparate,
|
|
197
|
-
"bg-fff radius-4 pd-l-16 pd-r-16 pd-t-16 pd-b-16": e.isSeparate
|
|
198
|
-
})
|
|
199
|
-
}, [createVNode(layout_default$1, { title: "查询" }), createVNode(unref(SearchBar), {
|
|
200
|
-
ref_key: "searchFormRef",
|
|
201
|
-
ref: j,
|
|
202
|
-
items: e.searchFields,
|
|
203
|
-
"filter-mode": !1,
|
|
204
|
-
minWidth: e.minWidth,
|
|
205
|
-
hideExpandButton: !1,
|
|
206
|
-
fixedWidth: !0,
|
|
207
|
-
maxHeight: 32,
|
|
208
|
-
modelValue: L.value,
|
|
209
|
-
"onUpdate:modelValue": E[0] ||= (e) => L.value = e,
|
|
210
|
-
onOperation: Q,
|
|
211
|
-
onChange: $
|
|
212
|
-
}, null, 8, [
|
|
213
|
-
"items",
|
|
214
|
-
"minWidth",
|
|
215
|
-
"modelValue"
|
|
216
|
-
])], 2)) : createCommentVNode("", !0),
|
|
217
|
-
createElementVNode("div", { class: normalizeClass(["table-section flex-1 overflow-hidden flex flex-col", { "bg-fff radius-4 pd-l-16 pd-r-16 pd-t-16 pd-b-16 mg-t-16": e.isSeparate }]) }, [
|
|
218
|
-
e.title ? renderSlot(w.$slots, "title", { key: 0 }, () => [createVNode(layout_default$1, { title: e.title }, {
|
|
219
|
-
default: withCtx(() => [renderSlot(w.$slots, "title-actions", {}, void 0, !0)]),
|
|
220
|
-
_: 3
|
|
221
|
-
}, 8, ["title"])], !0) : createCommentVNode("", !0),
|
|
222
|
-
createVNode(unref(ElTable), mergeProps({
|
|
223
|
-
ref_key: "tableRef",
|
|
224
|
-
ref: M,
|
|
225
|
-
data: R.value,
|
|
226
|
-
columns: V.value,
|
|
227
|
-
"row-key": e.treeProps.rowKey,
|
|
228
|
-
"tree-props": e.treeProps
|
|
229
|
-
}, {
|
|
230
|
-
...e.tableProps,
|
|
231
|
-
loading: B.value
|
|
232
|
-
}, toHandlers(e.tableEvents), {
|
|
233
|
-
class: "flex-1 admin-dashboard-table",
|
|
234
|
-
border: ""
|
|
235
|
-
}), createSlots({
|
|
236
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(V.value, (e) => (openBlock(), createBlock(unref(ElTableColumn), mergeProps({ key: e.prop }, { ref_for: !0 }, e), createSlots({ _: 2 }, [e.type === unref(COLUMN_TYPES).ACTION ? {
|
|
237
|
-
name: "default",
|
|
238
|
-
fn: withCtx((w) => [createElementVNode("div", _hoisted_3, [(openBlock(!0), createElementBlock(Fragment, null, renderList(K(G(e, w.row)), (e) => (openBlock(), createBlock(unref(ElButton), {
|
|
239
|
-
key: e.key || e.label,
|
|
240
|
-
type: e.type || "primary",
|
|
241
|
-
size: e.size || "small",
|
|
242
|
-
disabled: e.disabled,
|
|
243
|
-
loading: e.loading,
|
|
244
|
-
text: e.text,
|
|
245
|
-
link: e.link,
|
|
246
|
-
icon: e.icon,
|
|
247
|
-
onClick: (T) => Z(e, w.row, w.$index)
|
|
248
|
-
}, {
|
|
249
|
-
default: withCtx(() => [createTextVNode(toDisplayString(e.label), 1)]),
|
|
250
|
-
_: 2
|
|
251
|
-
}, 1032, [
|
|
252
|
-
"type",
|
|
253
|
-
"size",
|
|
254
|
-
"disabled",
|
|
255
|
-
"loading",
|
|
256
|
-
"text",
|
|
257
|
-
"link",
|
|
258
|
-
"icon",
|
|
259
|
-
"onClick"
|
|
260
|
-
]))), 128)), q(G(e, w.row)).length > 0 ? (openBlock(), createBlock(unref(ElDropdown), {
|
|
261
|
-
key: 0,
|
|
262
|
-
onCommand: (e) => Z(e, w.row, w.$index),
|
|
263
|
-
trigger: "click"
|
|
264
|
-
}, {
|
|
265
|
-
dropdown: withCtx(() => [createVNode(unref(ElDropdownMenu), null, {
|
|
266
|
-
default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(q(G(e, w.row)), (e) => (openBlock(), createBlock(unref(ElDropdownItem), {
|
|
267
|
-
key: e.key || e.label,
|
|
268
|
-
command: e,
|
|
269
|
-
disabled: e.disabled
|
|
270
|
-
}, {
|
|
271
|
-
default: withCtx(() => [createTextVNode(toDisplayString(e.label), 1)]),
|
|
272
|
-
_: 2
|
|
273
|
-
}, 1032, ["command", "disabled"]))), 128))]),
|
|
274
|
-
_: 2
|
|
275
|
-
}, 1024)]),
|
|
276
|
-
default: withCtx(() => [createVNode(unref(ElIcon), null, {
|
|
277
|
-
default: withCtx(() => [createVNode(unref(IconMore))]),
|
|
278
|
-
_: 1
|
|
279
|
-
})]),
|
|
280
|
-
_: 2
|
|
281
|
-
}, 1032, ["onCommand"])) : createCommentVNode("", !0)])]),
|
|
282
|
-
key: "0"
|
|
283
|
-
} : W(e.prop) ? {
|
|
284
|
-
name: "default",
|
|
285
|
-
fn: withCtx((T) => [renderSlot(w.$slots, e.prop, {
|
|
286
|
-
row: T.row,
|
|
287
|
-
index: T.$index,
|
|
288
|
-
column: e
|
|
289
|
-
}, void 0, !0)]),
|
|
290
|
-
key: "1"
|
|
291
|
-
} : {
|
|
292
|
-
name: "default",
|
|
293
|
-
fn: withCtx((w) => [createElementVNode("span", null, toDisplayString(U(w.row, e)), 1)]),
|
|
294
|
-
key: "2"
|
|
295
|
-
}]), 1040))), 128))]),
|
|
296
|
-
_: 2
|
|
297
|
-
}, [renderList(e.customSlots, (e) => ({
|
|
298
|
-
name: e,
|
|
299
|
-
fn: withCtx((T) => [renderSlot(w.$slots, e, normalizeProps(guardReactiveProps(T)), void 0, !0)])
|
|
300
|
-
}))]), 1040, [
|
|
301
|
-
"data",
|
|
302
|
-
"columns",
|
|
303
|
-
"row-key",
|
|
304
|
-
"tree-props"
|
|
305
|
-
]),
|
|
306
|
-
e.showPagination ? (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(unref(ElPagination), {
|
|
307
|
-
"current-page": z.value.page,
|
|
308
|
-
"onUpdate:currentPage": E[1] ||= (e) => z.value.page = e,
|
|
309
|
-
"page-size": z.value.size,
|
|
310
|
-
"onUpdate:pageSize": E[2] ||= (e) => z.value.size = e,
|
|
311
|
-
"page-sizes": z.value.pageSizes,
|
|
312
|
-
total: z.value.total,
|
|
313
|
-
layout: z.value.layout,
|
|
314
|
-
onSizeChange: J,
|
|
315
|
-
onCurrentChange: J
|
|
316
|
-
}, null, 8, [
|
|
317
|
-
"current-page",
|
|
318
|
-
"page-size",
|
|
319
|
-
"page-sizes",
|
|
320
|
-
"total",
|
|
321
|
-
"layout"
|
|
322
|
-
])])) : createCommentVNode("", !0)
|
|
323
|
-
], 2),
|
|
324
|
-
renderSlot(w.$slots, "default", {}, void 0, !0)
|
|
325
|
-
]));
|
|
326
|
-
}
|
|
327
|
-
}), [["__scopeId", "data-v-e55b45ca"]]));
|
|
328
|
-
var PageContainer_default = PageContainer;
|
|
329
|
-
export { PageContainer_default as n, COLUMN_TYPES as r, PageContainer as t };
|
|
@@ -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
|
-
one: 1,
|
|
26
|
-
two: 2
|
|
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.two : 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
|
-
};
|