china-mobile-international-custom-components 0.0.26 → 0.0.28
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 +85 -0
- package/es/AvailableRangePreview.mjs +1 -1
- package/es/AvailableRangeSetting.mjs +68 -63
- package/es/CustomSidebar.mjs +1 -1
- package/es/assets/AvailableRangePreview.css +1 -0
- package/es/assets/AvailableRangeSetting.css +1 -0
- package/es/assets/CustomSidebar.css +1 -0
- package/es/assets/layout2.css +1 -1
- package/es/chunks/AvailableRangePreview.D4mZe1lQ.js +217 -0
- package/es/chunks/AvailableRangeSetting.BkSLnQ6N.js +215 -0
- package/es/chunks/CustomSidebar.BWGoPtLi.js +506 -0
- package/es/chunks/CustomTitle.BLZ7evms.js +5 -0
- package/es/chunks/CustomToggle.CP3M2_f3.js +165 -0
- package/es/chunks/PageContainer.D-G32lvP.js +329 -0
- package/es/chunks/_plugin-vue_export-helper.CVVE_0_F.js +13 -0
- package/es/chunks/_plugin-vue_export-helper.Cf-_TWPK.js +6 -0
- package/es/chunks/index.AHEDCg43.js +160 -0
- package/es/chunks/index.B67AnSJI.js +154 -0
- package/es/chunks/index.B9F4VYQK.js +118 -0
- package/es/chunks/index.BPxF6Amx.js +157 -0
- package/es/chunks/index.C2gKjqoA.js +209 -0
- package/es/chunks/index.DTtNnKDH.js +288 -0
- package/es/chunks/index.Dh5IGfxO.js +290 -0
- package/es/chunks/index.DtBeJlu6.js +142 -0
- package/es/chunks/index.kR57MtNP.js +211 -0
- package/es/chunks/index.wQj5YKPy.js +288 -0
- package/es/chunks/layout.BE8_kCeR.js +619 -0
- package/es/chunks/layout.C0EtkrZg.js +639 -0
- package/es/chunks/layout.C6AMos7n.js +17 -0
- package/es/chunks/layout.CWFXohJu.js +622 -0
- package/es/chunks/layout.R5FQNRjS.js +619 -0
- package/es/chunks/layout.nKB_kc-U.js +26 -0
- package/es/chunks/utils.BhlZXNZ6.js +19 -0
- package/es/index.mjs +643 -630
- package/lib/ApplicationIcon.js +1 -0
- package/lib/AvailableRangePreview.js +1 -1
- package/lib/AvailableRangeSetting.js +1 -1
- package/lib/CustomSidebar.js +1 -1
- package/lib/assets/AvailableRangePreview.css +1 -0
- package/lib/assets/AvailableRangeSetting.css +1 -0
- package/lib/assets/CustomSidebar.css +1 -0
- package/lib/assets/layout2.css +1 -1
- package/lib/chunks/AvailableRangePreview.CkgZsXP0.js +1 -0
- package/lib/chunks/AvailableRangeSetting.CF-jHm4x.js +1 -0
- package/lib/chunks/CustomSidebar.CMYJFb2P.js +1 -0
- package/lib/chunks/CustomTitle.BkFZ-ZIq.js +1 -0
- package/lib/chunks/CustomToggle.C0PpzKPP.js +1 -0
- package/lib/chunks/PageContainer.GH56wASV.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.C55-DZV2.js +1 -0
- package/lib/chunks/_plugin-vue_export-helper.DAGvX2Jf.js +1 -0
- package/lib/chunks/index.BfHfKST0.js +1 -0
- package/lib/chunks/index.Bk55us0s.js +1 -0
- package/lib/chunks/index.BlXappa4.js +1 -0
- package/lib/chunks/index.CCxHaoi4.js +1 -0
- package/lib/chunks/index.CSYGhK9M.js +1 -0
- package/lib/chunks/index.C_IlZrzE.js +1 -0
- package/lib/chunks/index.DUGtabLJ.js +1 -0
- package/lib/chunks/index.Dakz8S3g.js +1 -0
- package/lib/chunks/index.DydPD8Lc.js +1 -0
- package/lib/chunks/index.k_hSuA6i.js +1 -0
- package/lib/chunks/layout.BJjU9nKW.js +1 -0
- package/lib/chunks/layout.BO1q-dAZ.js +1 -0
- package/lib/chunks/layout.BQigNrr5.js +1 -0
- package/lib/chunks/layout.ClFtiz-t.js +1 -0
- package/lib/chunks/layout.CmDwUHZo.js +1 -0
- package/lib/chunks/layout.CqbDoD_v.js +1 -0
- package/lib/chunks/layout.CwJgDGuR.js +1 -0
- package/lib/chunks/utils.BT5Uuz2Q.js +1 -0
- package/lib/index.js +6 -6
- package/package.json +4 -4
|
@@ -0,0 +1,329 @@
|
|
|
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 };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { _ as P, w as _ } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
+
import { computed as m, createElementBlock as f, createCommentVNode as E, openBlock as o, normalizeClass as b, createElementVNode as i, toDisplayString as A, Fragment as x, renderList as N, createBlock as v, createVNode as S, unref as R, withCtx as w, createTextVNode as D } from "vue";
|
|
3
|
+
import { ElButton as B } from "element-plus";
|
|
4
|
+
import '../assets/index.css';const L = {
|
|
5
|
+
ALL: "all",
|
|
6
|
+
PARTIAL: "partial"
|
|
7
|
+
}, I = [
|
|
8
|
+
{
|
|
9
|
+
value: L.ALL,
|
|
10
|
+
label: "全部成员"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: L.PARTIAL,
|
|
14
|
+
label: "部分成员"
|
|
15
|
+
}
|
|
16
|
+
], l = {
|
|
17
|
+
MEMBER: "member",
|
|
18
|
+
DEPARTMENT: "department"
|
|
19
|
+
}, k = { class: "fz-12 text-secondary mg-b-8" }, C = {
|
|
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
|
+
containerClass: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "mg-b-12"
|
|
36
|
+
},
|
|
37
|
+
// 标签样式类
|
|
38
|
+
tagClass: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "bg-primary-light text-primary"
|
|
41
|
+
},
|
|
42
|
+
// 是否可滚动
|
|
43
|
+
scrollable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !0
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
setup(e) {
|
|
49
|
+
const a = e;
|
|
50
|
+
return m(() => ["tag-item", "fz-12", "pd-4", "pd-l-8", "pd-r-8", "radius-4", a.tagClass]), (y, g) => e.items.length > 0 ? (o(), f("div", {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: b(e.containerClass)
|
|
53
|
+
}, [
|
|
54
|
+
i("div", k, A(e.label), 1),
|
|
55
|
+
i("div", {
|
|
56
|
+
class: b(["tag-list flex flex-wrap gap-8", { "max-h-120 overflow-y-auto": e.scrollable }])
|
|
57
|
+
}, [
|
|
58
|
+
(o(!0), f(x, null, N(e.items, (u) => (o(), f("span", {
|
|
59
|
+
key: u.id,
|
|
60
|
+
class: b([
|
|
61
|
+
"tag-item fz-12 pd-4 pd-l-8 pd-r-8 radius-4",
|
|
62
|
+
e.tagClass
|
|
63
|
+
])
|
|
64
|
+
}, A(u.name), 3))), 128))
|
|
65
|
+
], 2)
|
|
66
|
+
], 2)) : E("", !0);
|
|
67
|
+
}
|
|
68
|
+
}, h = /* @__PURE__ */ P(C, [["__scopeId", "data-v-40bc237e"]]), V = { class: "available-range-preview w-full" }, z = { class: "preview-area pd-16 radius-8 border" }, $ = { class: "flex items-center justify-between mg-b-16" }, Y = { class: "type-display" }, G = { class: "fz-14 weight-500" }, W = {
|
|
69
|
+
__name: "layout",
|
|
70
|
+
props: {
|
|
71
|
+
// 当前选择的范围类型
|
|
72
|
+
type: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "all"
|
|
75
|
+
},
|
|
76
|
+
// 选中的项目列表
|
|
77
|
+
modelValue: {
|
|
78
|
+
type: Array,
|
|
79
|
+
default: () => []
|
|
80
|
+
},
|
|
81
|
+
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
82
|
+
treeList: {
|
|
83
|
+
type: Array,
|
|
84
|
+
default: () => []
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
emits: ["edit"],
|
|
88
|
+
setup(e) {
|
|
89
|
+
const a = e, y = {
|
|
90
|
+
PARTIAL: "partial"
|
|
91
|
+
}, g = m(() => a.modelValue.filter(
|
|
92
|
+
(s) => s.type === l.MEMBER
|
|
93
|
+
)), u = m(() => ((r) => {
|
|
94
|
+
const c = [], M = (t) => {
|
|
95
|
+
if (t.type === l.DEPARTMENT && t.children) {
|
|
96
|
+
const T = (d) => {
|
|
97
|
+
const n = [];
|
|
98
|
+
for (const p of d)
|
|
99
|
+
p.type === l.MEMBER ? n.push(p.id) : p.type === l.DEPARTMENT && n.push(...T(p.children));
|
|
100
|
+
return n;
|
|
101
|
+
};
|
|
102
|
+
if (T(t.children).every(
|
|
103
|
+
(d) => a.modelValue.some(
|
|
104
|
+
(n) => n.type === l.MEMBER && n.id === d
|
|
105
|
+
)
|
|
106
|
+
) && c.push({
|
|
107
|
+
id: t.id,
|
|
108
|
+
name: t.name,
|
|
109
|
+
type: l.DEPARTMENT
|
|
110
|
+
}), t.children)
|
|
111
|
+
for (const d of t.children)
|
|
112
|
+
M(d);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
for (const t of r)
|
|
116
|
+
M(t);
|
|
117
|
+
return c;
|
|
118
|
+
})(a.treeList));
|
|
119
|
+
return m(() => a.modelValue.filter(
|
|
120
|
+
(s) => s.type === l.DEPARTMENT
|
|
121
|
+
).length), m(() => g.value.length), (s, r) => (o(), f("div", V, [
|
|
122
|
+
i("div", z, [
|
|
123
|
+
i("div", $, [
|
|
124
|
+
i("div", Y, [
|
|
125
|
+
i("span", G, A(R(I).find((c) => c.value === e.type)?.label), 1)
|
|
126
|
+
]),
|
|
127
|
+
S(R(B), {
|
|
128
|
+
type: "primary",
|
|
129
|
+
size: "small",
|
|
130
|
+
onClick: r[0] || (r[0] = (c) => s.$emit("edit"))
|
|
131
|
+
}, {
|
|
132
|
+
default: w(() => [...r[1] || (r[1] = [
|
|
133
|
+
D(" 编辑 ", -1)
|
|
134
|
+
])]),
|
|
135
|
+
_: 1
|
|
136
|
+
})
|
|
137
|
+
]),
|
|
138
|
+
e.type === y.PARTIAL ? (o(), v(h, {
|
|
139
|
+
key: 0,
|
|
140
|
+
label: "成员:",
|
|
141
|
+
items: g.value,
|
|
142
|
+
"tag-class": "bg-primary-light text-primary"
|
|
143
|
+
}, null, 8, ["items"])) : E("", !0),
|
|
144
|
+
e.type === y.PARTIAL ? (o(), v(h, {
|
|
145
|
+
key: 1,
|
|
146
|
+
label: "部门:",
|
|
147
|
+
items: u.value,
|
|
148
|
+
"container-class": "",
|
|
149
|
+
"tag-class": "bg-info-light text-info"
|
|
150
|
+
}, null, 8, ["items"])) : E("", !0)
|
|
151
|
+
])
|
|
152
|
+
]));
|
|
153
|
+
}
|
|
154
|
+
}, j = /* @__PURE__ */ P(W, [["__scopeId", "data-v-e94c88d4"]]), K = _(j), Q = _(h);
|
|
155
|
+
export {
|
|
156
|
+
K as A,
|
|
157
|
+
L as R,
|
|
158
|
+
Q as T,
|
|
159
|
+
I as r
|
|
160
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { _ as S, w as P } from "./_plugin-vue_export-helper.CVVE_0_F.js";
|
|
2
|
+
import { computed as m, createElementBlock as d, createCommentVNode as y, openBlock as s, createElementVNode as n, toDisplayString as p, createBlock as A, Fragment as R, renderList as w, unref as _, withCtx as v, createVNode as x, createTextVNode as k } from "vue";
|
|
3
|
+
import { ElPopover as N, ElButton as I } from "element-plus";
|
|
4
|
+
import '../assets/index.css';const L = {
|
|
5
|
+
ALL: "all",
|
|
6
|
+
PARTIAL: "partial"
|
|
7
|
+
}, D = [
|
|
8
|
+
{
|
|
9
|
+
value: L.ALL,
|
|
10
|
+
label: "全部成员"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
value: L.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" }, V = { class: "tag-list flex gap-4" }, $ = { class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe pointer" }, z = { class: "tag-list-popover flex gap-4 flex-wrap" }, Y = {
|
|
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 e = l, h = m(() => e.items.slice(0, e.defaultShowCount)), E = m(() => e.items.length > e.defaultShowCount), b = m(() => e.items.length - e.defaultShowCount), i = m(() => e.items.slice(e.defaultShowCount));
|
|
40
|
+
return (r, o) => l.items.length > 0 ? (s(), d("div", B, [
|
|
41
|
+
n("div", C, p(l.label), 1),
|
|
42
|
+
n("div", V, [
|
|
43
|
+
(s(!0), d(R, null, w(h.value, (a) => (s(), d("span", {
|
|
44
|
+
key: a.id,
|
|
45
|
+
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
46
|
+
}, p(a.name), 1))), 128)),
|
|
47
|
+
E.value ? (s(), A(_(N), {
|
|
48
|
+
key: 0,
|
|
49
|
+
placement: "top",
|
|
50
|
+
trigger: "click",
|
|
51
|
+
width: "300"
|
|
52
|
+
}, {
|
|
53
|
+
reference: v(() => [
|
|
54
|
+
n("span", $, " +" + p(b.value), 1)
|
|
55
|
+
]),
|
|
56
|
+
default: v(() => [
|
|
57
|
+
n("div", z, [
|
|
58
|
+
(s(!0), d(R, null, w(i.value, (a) => (s(), d("span", {
|
|
59
|
+
key: a.id,
|
|
60
|
+
class: "tag-item fz-12 pd-l-8 pd-r-8 radius-4 bg-eaf0fe text-3271fe"
|
|
61
|
+
}, p(a.name), 1))), 128))
|
|
62
|
+
])
|
|
63
|
+
]),
|
|
64
|
+
_: 1
|
|
65
|
+
})) : y("", !0)
|
|
66
|
+
])
|
|
67
|
+
])) : y("", !0);
|
|
68
|
+
}
|
|
69
|
+
}, M = /* @__PURE__ */ S(Y, [["__scopeId", "data-v-b1926095"]]), G = { class: "available-range-preview w-full" }, W = { class: "flex items-center justify-between mg-b-16" }, j = { class: "flex-1" }, q = { class: "fz-14 weight-500" }, F = {
|
|
70
|
+
__name: "layout",
|
|
71
|
+
props: {
|
|
72
|
+
// 当前选择的范围类型
|
|
73
|
+
type: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: "all"
|
|
76
|
+
},
|
|
77
|
+
// 选中的项目列表
|
|
78
|
+
modelValue: {
|
|
79
|
+
type: Array,
|
|
80
|
+
default: () => []
|
|
81
|
+
},
|
|
82
|
+
// 完整的树形数据(用于判断部门成员是否全部选中)
|
|
83
|
+
treeList: {
|
|
84
|
+
type: Array,
|
|
85
|
+
default: () => []
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
emits: ["edit"],
|
|
89
|
+
setup(l) {
|
|
90
|
+
const e = l, h = {
|
|
91
|
+
PARTIAL: "partial"
|
|
92
|
+
}, E = m(() => e.modelValue.filter(
|
|
93
|
+
(i) => i.type === u.MEMBER
|
|
94
|
+
)), b = m(() => ((r) => {
|
|
95
|
+
const o = [], a = (t) => {
|
|
96
|
+
if (t.type === u.DEPARTMENT && t.children) {
|
|
97
|
+
const T = (f) => {
|
|
98
|
+
const c = [];
|
|
99
|
+
for (const g of f)
|
|
100
|
+
g.type === u.MEMBER ? c.push(g.id) : g.type === u.DEPARTMENT && c.push(...T(g.children));
|
|
101
|
+
return c;
|
|
102
|
+
};
|
|
103
|
+
if (T(t.children).every(
|
|
104
|
+
(f) => e.modelValue.some(
|
|
105
|
+
(c) => c.type === u.MEMBER && c.id === f
|
|
106
|
+
)
|
|
107
|
+
) && o.push({
|
|
108
|
+
id: t.id,
|
|
109
|
+
name: t.name,
|
|
110
|
+
type: u.DEPARTMENT
|
|
111
|
+
}), t.children)
|
|
112
|
+
for (const f of t.children)
|
|
113
|
+
a(f);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
for (const t of r)
|
|
117
|
+
a(t);
|
|
118
|
+
return o;
|
|
119
|
+
})(e.treeList));
|
|
120
|
+
return (i, r) => (s(), d("div", G, [
|
|
121
|
+
n("div", W, [
|
|
122
|
+
n("div", j, [
|
|
123
|
+
n("span", q, p(_(D).find((o) => o.value === l.type)?.label), 1)
|
|
124
|
+
]),
|
|
125
|
+
x(_(I), {
|
|
126
|
+
type: "primary",
|
|
127
|
+
size: "small",
|
|
128
|
+
onClick: r[0] || (r[0] = (o) => i.$emit("edit"))
|
|
129
|
+
}, {
|
|
130
|
+
default: v(() => [...r[1] || (r[1] = [
|
|
131
|
+
k(" 编辑 ", -1)
|
|
132
|
+
])]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
]),
|
|
136
|
+
l.type === h.PARTIAL ? (s(), A(M, {
|
|
137
|
+
key: 0,
|
|
138
|
+
label: "成员:",
|
|
139
|
+
items: E.value
|
|
140
|
+
}, null, 8, ["items"])) : y("", !0),
|
|
141
|
+
l.type === h.PARTIAL ? (s(), A(M, {
|
|
142
|
+
key: 1,
|
|
143
|
+
label: "部门:",
|
|
144
|
+
items: b.value
|
|
145
|
+
}, null, 8, ["items"])) : y("", !0)
|
|
146
|
+
]));
|
|
147
|
+
}
|
|
148
|
+
}, U = P(F), X = P(M);
|
|
149
|
+
export {
|
|
150
|
+
U as A,
|
|
151
|
+
L as R,
|
|
152
|
+
X as T,
|
|
153
|
+
D as r
|
|
154
|
+
};
|