ling-yun-custom-components 0.0.51 → 0.0.53

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.
@@ -0,0 +1,600 @@
1
+ import { renderSlot as k, createElementBlock as D, openBlock as u, Fragment as M, renderList as $, createBlock as c, unref as t, withCtx as r, createTextVNode as V, toDisplayString as U, useCssVars as le, ref as p, computed as x, withModifiers as ke, normalizeClass as I, mergeProps as g, createCommentVNode as N, withKeys as be, onMounted as ge, watch as we, createElementVNode as w, createVNode as m, createSlots as F, normalizeProps as H, guardReactiveProps as K, normalizeStyle as Ve } from "vue";
2
+ import { ElButton as O, ElForm as Ce, ElFormItem as oe, ElInput as Z, ElDatePicker as De, ElInputNumber as $e, ElSwitch as Ee, ElRadioGroup as Fe, ElRadio as xe, ElCheckboxGroup as Me, ElCheckbox as Ue, ElAutoResizer as _, ElPopover as Le, ElIcon as ee, ElDrawer as Pe } from "element-plus";
3
+ import { IconMagnify as Se, IconCheck as We, IconUp as Be, IconDown as Ie, IconShrink as Ne } from "color-message-lingyun-vue";
4
+ import { operationConfigMap as C, emitsMap as f, labelPositionMap as B, componentType as h, dateParamsMap as Oe, dateFormat as ae } from "ling-yun-methods";
5
+ import { _ as Te } from "./layout.wck_IDgd.js";
6
+ import { _ as ze } from "./layout.BaJd1PXA.js";
7
+ import { _ as ne } from "./_plugin-vue_export-helper.CHgC5LLL.js";
8
+ import { C as te } from "./layout.BKJPyxR8.js";
9
+ import '../assets/layout3.css';const Re = [
10
+ {
11
+ type: "primary",
12
+ label: "查询",
13
+ value: C.search
14
+ },
15
+ {
16
+ type: "default",
17
+ label: "重置",
18
+ value: C.reset
19
+ }
20
+ ], re = 320, q = {
21
+ __name: "OperationButtons",
22
+ props: {
23
+ operationList: {
24
+ type: Array,
25
+ default: () => []
26
+ }
27
+ },
28
+ emits: [f.operation],
29
+ setup(a, { emit: L }) {
30
+ const E = L, d = (v) => {
31
+ E(f.operation, v);
32
+ };
33
+ return (v, n) => v.$slots.operation ? k(v.$slots, "operation", {
34
+ key: 0,
35
+ operationList: a.operationList
36
+ }) : (u(!0), D(M, { key: 1 }, $(a.operationList, (y) => (u(), c(t(O), {
37
+ key: y.value,
38
+ type: y.type,
39
+ icon: y.icon,
40
+ onClick: (e) => d(y.value)
41
+ }, {
42
+ default: r(() => [
43
+ V(U(y.label), 1)
44
+ ]),
45
+ _: 2
46
+ }, 1032, ["type", "icon", "onClick"]))), 128));
47
+ }
48
+ }, je = /* @__PURE__ */ Object.assign({
49
+ name: "FormWrapper"
50
+ }, {
51
+ __name: "FormWrapper",
52
+ props: {
53
+ // 表单项配置
54
+ items: {
55
+ type: Array,
56
+ default: () => []
57
+ },
58
+ // 表单数据
59
+ formData: {
60
+ type: Object,
61
+ default: () => ({})
62
+ },
63
+ // 表单验证规则
64
+ rules: {
65
+ type: Object,
66
+ default: () => ({})
67
+ },
68
+ // 标签宽度
69
+ labelWidth: {
70
+ type: [String, Number],
71
+ default: "auto"
72
+ },
73
+ // 标签位置
74
+ labelPosition: {
75
+ type: String,
76
+ default: B.right
77
+ },
78
+ // 是否显示标签
79
+ showLabel: {
80
+ type: Boolean,
81
+ default: !0
82
+ },
83
+ // 是否内联布局
84
+ inline: {
85
+ type: Boolean,
86
+ default: !1
87
+ },
88
+ // 是否为筛选器模式
89
+ isFilter: {
90
+ type: Boolean,
91
+ default: !1
92
+ },
93
+ // 是否为筛选器预览模式
94
+ isFilterPreview: {
95
+ type: Boolean,
96
+ default: !1
97
+ },
98
+ minWidth: {
99
+ type: Number,
100
+ default: re
101
+ }
102
+ },
103
+ emits: [f.change, f.enter],
104
+ setup(a, { expose: L }) {
105
+ le((n) => ({
106
+ v65f9c9b2: a.minWidth + "px"
107
+ }));
108
+ const E = a, d = p(null), v = x(() => E.isFilter ? "filter-form" : E.isFilterPreview ? "filter-preview-form" : "search-bar-form");
109
+ return L({
110
+ validate: (n) => d.value ? d.value.validate(n) : Promise.resolve(!0),
111
+ resetFields: () => {
112
+ d.value && d.value.resetFields();
113
+ },
114
+ clearValidate: (n) => {
115
+ d.value && d.value.clearValidate(n);
116
+ },
117
+ scrollToField: (n) => {
118
+ d.value && d.value.scrollToField(n);
119
+ }
120
+ }), (n, y) => (u(), c(t(Ce), {
121
+ ref_key: "formRef",
122
+ ref: d,
123
+ model: a.formData,
124
+ "label-width": a.labelWidth,
125
+ "label-position": a.labelPosition,
126
+ inline: a.inline,
127
+ rules: a.rules,
128
+ class: I({
129
+ [v.value]: !0,
130
+ "items-end display-grid": !a.isFilterPreview
131
+ }),
132
+ onSubmit: y[0] || (y[0] = ke(() => {
133
+ }, ["prevent", "stop"]))
134
+ }, {
135
+ default: r(() => [
136
+ (u(!0), D(M, null, $(a.items, (e) => (u(), c(t(oe), g({
137
+ key: e.key,
138
+ label: a.showLabel ? e.label : "",
139
+ prop: e.key,
140
+ "show-label": a.showLabel,
141
+ class: [
142
+ {
143
+ "search-bar-item--wide": e.wide
144
+ }
145
+ ]
146
+ }, { ref_for: !0 }, e), {
147
+ default: r(() => [
148
+ k(n.$slots, e.key, {
149
+ item: e,
150
+ formData: a.formData
151
+ }, () => [
152
+ e.type === t(h).text ? (u(), c(t(Z), g({
153
+ key: 0,
154
+ modelValue: a.formData[e.key],
155
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
156
+ }, { ref_for: !0 }, e, {
157
+ class: "w-full",
158
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key]),
159
+ onKeyup: be((l) => n.$emit(t(f).enter, e.key, a.formData[e.key]), ["enter"])
160
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange", "onKeyup"])) : e.type === t(h).select ? (u(), c(Te, g({
161
+ key: 1,
162
+ modelValue: a.formData[e.key],
163
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l,
164
+ "static-options": e.options
165
+ }, { ref_for: !0 }, e, {
166
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key]),
167
+ class: "w-full"
168
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "static-options", "onChange"])) : e.type === t(h).date ? (u(), c(t(De), g({
169
+ key: 2,
170
+ modelValue: a.formData[e.key],
171
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
172
+ }, { ref_for: !0 }, {
173
+ ...e,
174
+ ...t(Oe)[e.dateType]
175
+ }, {
176
+ type: e.dateType,
177
+ format: e.format || t(ae).date,
178
+ "value-format": e.valueFormat || t(ae).dateTime,
179
+ class: "w-full",
180
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
181
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "type", "format", "value-format", "onChange"])) : e.type === t(h).inputNumber ? (u(), c(t($e), g({
182
+ key: 3,
183
+ modelValue: a.formData[e.key],
184
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
185
+ }, { ref_for: !0 }, e, {
186
+ class: "w-full",
187
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
188
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).switch ? (u(), c(t(Ee), g({
189
+ key: 4,
190
+ modelValue: a.formData[e.key],
191
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
192
+ }, { ref_for: !0 }, e, {
193
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
194
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).radio ? (u(), c(t(Fe), {
195
+ key: 5,
196
+ modelValue: a.formData[e.key],
197
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l,
198
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
199
+ }, {
200
+ default: r(() => [
201
+ (u(!0), D(M, null, $(e.options, (l) => (u(), c(t(xe), {
202
+ key: l.value,
203
+ label: l.value,
204
+ value: l.value,
205
+ disabled: l.disabled
206
+ }, {
207
+ default: r(() => [
208
+ V(U(l.label), 1)
209
+ ]),
210
+ _: 2
211
+ }, 1032, ["label", "value", "disabled"]))), 128))
212
+ ]),
213
+ _: 2
214
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).checkbox ? (u(), c(t(Me), {
215
+ key: 6,
216
+ modelValue: a.formData[e.key],
217
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l,
218
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
219
+ }, {
220
+ default: r(() => [
221
+ (u(!0), D(M, null, $(e.options, (l) => (u(), c(t(Ue), {
222
+ key: l.value,
223
+ label: l.value,
224
+ value: l.value
225
+ }, {
226
+ default: r(() => [
227
+ V(U(l.label), 1)
228
+ ]),
229
+ _: 2
230
+ }, 1032, ["label", "value"]))), 128))
231
+ ]),
232
+ _: 2
233
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).textarea ? (u(), c(t(Z), g({
234
+ key: 7,
235
+ modelValue: a.formData[e.key],
236
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
237
+ }, { ref_for: !0 }, e, {
238
+ class: "w-full",
239
+ type: "textarea",
240
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
241
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).upload ? (u(), c(ze, g({
242
+ key: 8,
243
+ modelValue: a.formData[e.key],
244
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
245
+ }, { ref_for: !0 }, e), null, 16, ["modelValue", "onUpdate:modelValue"])) : N("", !0)
246
+ ], !0)
247
+ ]),
248
+ _: 2
249
+ }, 1040, ["label", "prop", "show-label", "class"]))), 128)),
250
+ k(n.$slots, "default", {}, void 0, !0)
251
+ ]),
252
+ _: 3
253
+ }, 8, ["model", "label-width", "label-position", "inline", "rules", "class"]));
254
+ }
255
+ }), G = /* @__PURE__ */ ne(je, [["__scopeId", "data-v-b5708f35"]]), Ae = { class: "h-32 w-full" }, He = { class: "flex items-center justify-between pd-b-20" }, Ke = { class: "text-right" }, qe = { class: "drawer-header" }, Ge = { class: "flex-1 pd-l-16 pd-r-16 overflow-y-auto" }, Je = { class: "text-right border-top pd-t-16 pd-l-16 pd-r-16" }, Qe = /* @__PURE__ */ Object.assign({
256
+ name: "SearchBar"
257
+ }, {
258
+ __name: "layout",
259
+ props: {
260
+ // 搜索项配置
261
+ items: {
262
+ type: Array,
263
+ default: () => []
264
+ },
265
+ // 初始值
266
+ modelValue: {
267
+ type: Object,
268
+ default: () => ({})
269
+ },
270
+ // 标签宽度
271
+ labelWidth: {
272
+ type: [String, Number],
273
+ default: "auto"
274
+ },
275
+ // 标签位置
276
+ labelPosition: {
277
+ type: String,
278
+ default: B.right,
279
+ validator: (a) => [B.left, B.right, B.top].includes(a)
280
+ },
281
+ // 是否可以展开
282
+ isExpand: {
283
+ type: Boolean,
284
+ default: !0
285
+ },
286
+ // 最大的高度
287
+ maxHeight: {
288
+ type: Number,
289
+ default: 84
290
+ },
291
+ // 每项最小宽度
292
+ minWidth: {
293
+ type: Number,
294
+ default: re
295
+ },
296
+ operationList: {
297
+ type: Array,
298
+ default: Re
299
+ },
300
+ // 是否为筛选器模式
301
+ filterMode: {
302
+ type: Boolean,
303
+ default: !0
304
+ }
305
+ },
306
+ emits: [f.updateModelValue, f.operation, f.change],
307
+ setup(a, { expose: L, emit: E }) {
308
+ le((o) => ({
309
+ v6f32bb87: a.maxHeight + "px",
310
+ v8603bafe: A.value ? A.value + "px" : "100%"
311
+ }));
312
+ const d = a, v = E, n = p({}), y = p(!d.isExpand), e = p(null), l = p(!1), P = p(!1), T = p(!1), ue = x(() => {
313
+ const o = {};
314
+ return d.items.forEach((i) => {
315
+ if (i.required) {
316
+ const s = [{ required: !0, message: `${i.label}不能为空`, trigger: "blur" }];
317
+ typeof i.validator == "function" && s.push({ validator: i.validator, trigger: "blur" }), o[i.key] = s;
318
+ }
319
+ }), o;
320
+ }), z = x(() => d.items?.filter((o) => !o.hidden) || []), J = x(() => d.filterMode ? z.value?.slice(0, 2) || [] : z.value), S = x(() => d.filterMode ? z.value.slice(2) : []), Q = (o) => {
321
+ n.value = { ...o };
322
+ }, ie = () => {
323
+ v(f.updateModelValue, { ...n.value });
324
+ }, de = (o, i) => {
325
+ n.value[o] = i, T.value = !0, W(C.search), setTimeout(() => {
326
+ T.value = !1;
327
+ }, 200), R(o, i);
328
+ }, R = (o, i) => {
329
+ o && v(f.change, o, i);
330
+ }, se = () => n.value, j = (o, i) => {
331
+ T.value || v(f.operation, C.search, n.value);
332
+ }, W = (o) => {
333
+ ie(), v(f.operation, o, n.value), (o === C.search || o === C.reset) && (l.value = !1, P.value = !1);
334
+ }, fe = (o) => e.value.validate(o), A = p(0), me = (o) => {
335
+ A.value = o + 32;
336
+ }, ce = () => {
337
+ y.value = !y.value;
338
+ }, ye = () => {
339
+ l.value = !1, P.value = !0;
340
+ }, ve = () => {
341
+ P.value = !1, l.value = !0;
342
+ }, X = p(!1), Y = (o) => {
343
+ X.value = o > d.maxHeight;
344
+ }, he = x(() => d.filterMode || y.value ? "10px" : "0");
345
+ return ge(() => {
346
+ Q(d.modelValue), Y();
347
+ }), we(
348
+ () => d.modelValue,
349
+ (o) => {
350
+ Q(o);
351
+ },
352
+ { immediate: !0, deep: !0 }
353
+ ), L({
354
+ validate: fe,
355
+ getFormData: se,
356
+ // clearValidate,
357
+ // resetFields,
358
+ // scrollToField,
359
+ formRef: e
360
+ }), (o, i) => (u(), D("div", {
361
+ class: I(["relative overflow-hidden w-full", { flex: a.filterMode }])
362
+ }, [
363
+ w("div", {
364
+ class: I({
365
+ "is-collapsed overflow-hidden": !y.value
366
+ })
367
+ }, [
368
+ m(t(_), null, {
369
+ default: r(({ height: s }) => [
370
+ V(U(Y(s)) + " ", 1),
371
+ m(G, {
372
+ ref_key: "formRef",
373
+ ref: e,
374
+ items: J.value,
375
+ "form-data": n.value,
376
+ rules: ue.value,
377
+ "label-width": a.labelWidth,
378
+ "label-position": a.labelPosition,
379
+ inline: !0,
380
+ "show-label": !a.filterMode,
381
+ "min-width": a.minWidth,
382
+ "is-filter-preview": a.filterMode,
383
+ onChange: de,
384
+ onEnter: j
385
+ }, F({
386
+ default: r(() => [
387
+ a.isExpand && !a.filterMode ? (u(), c(t(oe), {
388
+ key: 0,
389
+ "label-width": "0"
390
+ }, {
391
+ default: r(() => [
392
+ w("div", Ae, [
393
+ m(t(_), null, {
394
+ default: r(({ width: b }) => [
395
+ V(U(me(b)), 1)
396
+ ]),
397
+ _: 1
398
+ })
399
+ ])
400
+ ]),
401
+ _: 1
402
+ })) : N("", !0)
403
+ ]),
404
+ _: 2
405
+ }, [
406
+ $(J.value, (b) => ({
407
+ name: b.key,
408
+ fn: r((pe) => [
409
+ k(o.$slots, b.key, H(K(pe)), void 0, !0)
410
+ ])
411
+ }))
412
+ ]), 1032, ["items", "form-data", "rules", "label-width", "label-position", "show-label", "min-width", "is-filter-preview"])
413
+ ]),
414
+ _: 3
415
+ })
416
+ ], 2),
417
+ w("div", {
418
+ class: I(["operation-buttons", {
419
+ "absolute right-0 bg-fff text-right": a.isExpand && !a.filterMode,
420
+ "text-left": a.filterMode
421
+ }]),
422
+ style: Ve({ bottom: he.value })
423
+ }, [
424
+ a.filterMode ? (u(), D(M, { key: 0 }, [
425
+ m(t(O), {
426
+ onClick: i[0] || (i[0] = (s) => W(t(C).reset)),
427
+ type: "default"
428
+ }, {
429
+ default: r(() => [...i[3] || (i[3] = [
430
+ V("重置", -1)
431
+ ])]),
432
+ _: 1
433
+ }),
434
+ S.value?.length ? (u(), c(t(Le), {
435
+ key: 0,
436
+ visible: l.value,
437
+ placement: "bottom-start",
438
+ width: 628,
439
+ trigger: "click"
440
+ }, {
441
+ reference: r(() => [
442
+ m(t(O), {
443
+ onClick: i[1] || (i[1] = (s) => l.value = !l.value),
444
+ icon: t(We),
445
+ type: "default"
446
+ }, {
447
+ default: r(() => [...i[4] || (i[4] = [
448
+ V(" 筛选器 ", -1)
449
+ ])]),
450
+ _: 1
451
+ }, 8, ["icon"])
452
+ ]),
453
+ default: r(() => [
454
+ w("div", He, [
455
+ m(te, {
456
+ content: "筛选器",
457
+ fontSize: 16
458
+ }),
459
+ m(t(ee), {
460
+ size: 16,
461
+ onClick: ye
462
+ }, {
463
+ default: r(() => [
464
+ m(t(Se))
465
+ ]),
466
+ _: 1
467
+ })
468
+ ]),
469
+ m(G, {
470
+ items: S.value,
471
+ "form-data": n.value,
472
+ "label-width": "auto",
473
+ "label-position": "top",
474
+ inline: !1,
475
+ "show-label": !0,
476
+ "is-filter": !0,
477
+ "min-width": a.minWidth,
478
+ class: "filter-form-popover overflow-y-auto",
479
+ onChange: R,
480
+ onEnter: j
481
+ }, F({ _: 2 }, [
482
+ $(S.value, (s) => ({
483
+ name: s.key,
484
+ fn: r((b) => [
485
+ k(o.$slots, s.key, H(K(b)), void 0, !0)
486
+ ])
487
+ }))
488
+ ]), 1032, ["items", "form-data", "min-width"]),
489
+ w("div", Ke, [
490
+ m(q, {
491
+ "operation-list": a.operationList,
492
+ onOperation: W
493
+ }, F({ _: 2 }, [
494
+ o.$slots.operation ? {
495
+ name: "operation",
496
+ fn: r(({ operationList: s }) => [
497
+ k(o.$slots, "operation", { operationList: s }, void 0, !0)
498
+ ]),
499
+ key: "0"
500
+ } : void 0
501
+ ]), 1032, ["operation-list"])
502
+ ])
503
+ ]),
504
+ _: 3
505
+ }, 8, ["visible"])) : N("", !0)
506
+ ], 64)) : (u(), D(M, { key: 1 }, [
507
+ X.value && a.isExpand ? (u(), c(t(O), {
508
+ key: 0,
509
+ icon: y.value ? t(Be) : t(Ie),
510
+ text: "",
511
+ onClick: ce
512
+ }, {
513
+ default: r(() => [
514
+ V(U(y.value ? "收起" : "展开"), 1)
515
+ ]),
516
+ _: 1
517
+ }, 8, ["icon"])) : N("", !0),
518
+ m(q, {
519
+ "operation-list": a.operationList,
520
+ onOperation: W
521
+ }, F({ _: 2 }, [
522
+ o.$slots.operation ? {
523
+ name: "operation",
524
+ fn: r(({ operationList: s }) => [
525
+ k(o.$slots, "operation", { operationList: s }, void 0, !0)
526
+ ]),
527
+ key: "0"
528
+ } : void 0
529
+ ]), 1032, ["operation-list"])
530
+ ], 64))
531
+ ], 6),
532
+ m(t(Pe), {
533
+ modelValue: P.value,
534
+ "onUpdate:modelValue": i[2] || (i[2] = (s) => P.value = s),
535
+ size: "628",
536
+ "show-close": !1
537
+ }, {
538
+ header: r(() => [
539
+ w("div", qe, [
540
+ m(te, {
541
+ content: "筛选器",
542
+ fontSize: 16
543
+ }),
544
+ m(t(ee), {
545
+ size: 16,
546
+ onClick: ve,
547
+ class: "shrink-button"
548
+ }, {
549
+ default: r(() => [
550
+ m(t(Ne))
551
+ ]),
552
+ _: 1
553
+ })
554
+ ])
555
+ ]),
556
+ default: r(() => [
557
+ w("div", Ge, [
558
+ m(G, {
559
+ items: S.value,
560
+ "form-data": n.value,
561
+ "label-width": "auto",
562
+ "label-position": "top",
563
+ inline: !1,
564
+ "show-label": !0,
565
+ "is-filter": !0,
566
+ "min-width": a.minWidth,
567
+ onChange: R,
568
+ onEnter: j
569
+ }, F({ _: 2 }, [
570
+ $(S.value, (s) => ({
571
+ name: s.key,
572
+ fn: r((b) => [
573
+ k(o.$slots, s.key, H(K(b)), void 0, !0)
574
+ ])
575
+ }))
576
+ ]), 1032, ["items", "form-data", "min-width"])
577
+ ]),
578
+ w("div", Je, [
579
+ m(q, {
580
+ "operation-list": a.operationList,
581
+ onOperation: W
582
+ }, F({ _: 2 }, [
583
+ o.$slots.operation ? {
584
+ name: "operation",
585
+ fn: r(({ operationList: s }) => [
586
+ k(o.$slots, "operation", { operationList: s }, void 0, !0)
587
+ ]),
588
+ key: "0"
589
+ } : void 0
590
+ ]), 1032, ["operation-list"])
591
+ ])
592
+ ]),
593
+ _: 3
594
+ }, 8, ["modelValue"])
595
+ ], 2));
596
+ }
597
+ }), oa = /* @__PURE__ */ ne(Qe, [["__scopeId", "data-v-663b89dc"]]);
598
+ export {
599
+ oa as S
600
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./chunks/index.CkihWzK6.js"),e=require("vue"),s=require("element-plus"),a={lingyun:"lingyun",aibox:"aibox"},d=async(o,n)=>{if(!n)return null;try{switch(o){case a.lingyun:const{icons:r}=await Promise.resolve().then(()=>require("./chunks/global.Vf7E2i7y.js"));return r[n]||null;case a.aibox:const{icons:t}=await Promise.resolve().then(()=>require("./chunks/global.DIPtiMPx.js"));return t[n]||null}}catch(r){return console.warn(`Failed to load icon ${n} from ${o} library:`,r),null}},m=Object.assign({name:"IconRenderer"},{__name:"layout",props:{iconName:{type:String,default:""},iconLibrary:{type:String,default:a.lingyun,validator:o=>Object.values(a).includes(o)},size:{type:Number,default:16},color:{type:String,default:""}},setup(o){const n=o,r=e.shallowRef(null),t=e.ref(!1),c=async()=>{if(!n.iconName){r.value=null;return}if(!t.value){t.value=!0;try{const l=await d(n.iconLibrary,n.iconName);r.value=l}catch(l){console.error("Failed to load icon component:",l),r.value=null}finally{t.value=!1}}};return e.watch(()=>[n.iconLibrary,n.iconName],()=>{c()},{immediate:!1}),e.onMounted(()=>{c()}),(l,y)=>o.iconName&&r.value?(e.openBlock(),e.createBlock(e.unref(s.ElIcon),e.mergeProps({key:0,size:o.size,color:o.color},l.$attrs),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value)))]),_:1},16,["size","color"])):e.createCommentVNode("",!0)}}),i=u.withInstall(m);exports.IconRenderer=i;exports.default=i;exports.iconLibraryMap=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./chunks/index.CkihWzK6.js"),e=require("vue"),s=require("element-plus"),a={lingyun:"lingyun",aibox:"aibox"},d=async(o,n)=>{if(!n)return null;try{switch(o){case a.lingyun:const{icons:r}=await Promise.resolve().then(()=>require("./chunks/global.DH9s3Z8E.js"));return r[n]||null;case a.aibox:const{icons:t}=await Promise.resolve().then(()=>require("./chunks/global.DIPtiMPx.js"));return t[n]||null}}catch(r){return console.warn(`Failed to load icon ${n} from ${o} library:`,r),null}},m=Object.assign({name:"IconRenderer"},{__name:"layout",props:{iconName:{type:String,default:""},iconLibrary:{type:String,default:a.lingyun,validator:o=>Object.values(a).includes(o)},size:{type:Number,default:16},color:{type:String,default:""}},setup(o){const n=o,r=e.shallowRef(null),t=e.ref(!1),c=async()=>{if(!n.iconName){r.value=null;return}if(!t.value){t.value=!0;try{const l=await d(n.iconLibrary,n.iconName);r.value=l}catch(l){console.error("Failed to load icon component:",l),r.value=null}finally{t.value=!1}}};return e.watch(()=>[n.iconLibrary,n.iconName],()=>{c()},{immediate:!1}),e.onMounted(()=>{c()}),(l,y)=>o.iconName&&r.value?(e.openBlock(),e.createBlock(e.unref(s.ElIcon),e.mergeProps({key:0,size:o.size,color:o.color},l.$attrs),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value)))]),_:1},16,["size","color"])):e.createCommentVNode("",!0)}}),i=u.withInstall(m);exports.IconRenderer=i;exports.default=i;exports.iconLibraryMap=a;
package/lib/IconSelect.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/IconSelect.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),f=require("color-message-lingyun-vue"),p=require("./chunks/global.Vf7E2i7y.js"),h=require("./chunks/layout.B8d4J538.js"),v=require("ling-yun-methods"),w=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),_={class:"icon-select-content flex flex-col overflow-hidden"},b={class:"icon-select-grid overflow-y-auto display-grid"},B=["title","onClick"],I={key:0,class:"no-data"},C=Object.assign({name:"IconSelect"},{__name:"layout",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"请选择图标"},width:{type:Number,default:520},iconSize:{type:Number,default:62}},emits:[v.emitsMap.updateModelValue],setup(a,{emit:x}){const u=a,V=x,i=e.ref(!1),r=e.ref(""),n=e.ref(u.modelValue),d=e.computed(()=>Object.entries(p.icons).filter(([t])=>t.toLowerCase().includes("menu")).map(([t,o])=>({name:t,component:o}))),m=e.computed(()=>r.value?d.value.filter(t=>t.name.toLowerCase().includes(r.value.toLowerCase())):d.value),s=e.computed(()=>n.value&&p.icons[n.value]||null),y=t=>{n.value=t.name,V(v.emitsMap.updateModelValue,t.name),i.value=!1};return e.watch(()=>u.modelValue,t=>{n.value=t}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(c.ElPopover),{visible:i.value,"onUpdate:visible":o[1]||(o[1]=l=>i.value=l),placement:"bottom-start",width:a.width,trigger:"click"},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center pointer radius-16 justify-center w-icon-item",{"select-icon-box bg-fcfdff text-202434 fz-14 flex-col":!s.value,"icon-item":n.value}])},[s.value?(e.openBlock(),e.createBlock(e.unref(c.ElIcon),{key:0,size:a.iconSize},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value)))]),_:1},8,["size"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(c.ElIcon),{size:16},{default:e.withCtx(()=>[e.createVNode(e.unref(f.IconAdd))]),_:1}),o[2]||(o[2]=e.createTextVNode(" 上传 ",-1))],64))],2)]),default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(c.ElInput),{class:"mg-b-12",modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=l=>r.value=l),placeholder:"搜索图标","prefix-icon":e.unref(f.IconSearch),clearable:""},null,8,["modelValue","prefix-icon"]),e.createElementVNode("div",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:e.normalizeClass(["icon-item radius-8 justify-center items-center pointer flex w-icon-item",{active:n.value===l.name}]),title:l.name,onClick:N=>y(l)},[e.createVNode(e.unref(c.ElIcon),{size:50},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component)))]),_:2},1024)],10,B))),128))]),m.value.length===0?(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(h.IconEmpty,{text:"未找到相关图标"})])):e.createCommentVNode("",!0)])]),_:1},8,["visible","width"]))}}),E=w._export_sfc(C,[["__scopeId","data-v-92e76646"]]),k=g.withInstall(E);exports.IconSelect=k;exports.default=k;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/IconSelect.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),f=require("color-message-lingyun-vue"),p=require("./chunks/global.DH9s3Z8E.js"),h=require("./chunks/layout.B8d4J538.js"),v=require("ling-yun-methods"),w=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),_={class:"icon-select-content flex flex-col overflow-hidden"},b={class:"icon-select-grid overflow-y-auto display-grid"},B=["title","onClick"],I={key:0,class:"no-data"},C=Object.assign({name:"IconSelect"},{__name:"layout",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"请选择图标"},width:{type:Number,default:520},iconSize:{type:Number,default:62}},emits:[v.emitsMap.updateModelValue],setup(a,{emit:x}){const u=a,V=x,i=e.ref(!1),r=e.ref(""),n=e.ref(u.modelValue),d=e.computed(()=>Object.entries(p.icons).filter(([t])=>t.toLowerCase().includes("menu")).map(([t,o])=>({name:t,component:o}))),m=e.computed(()=>r.value?d.value.filter(t=>t.name.toLowerCase().includes(r.value.toLowerCase())):d.value),s=e.computed(()=>n.value&&p.icons[n.value]||null),y=t=>{n.value=t.name,V(v.emitsMap.updateModelValue,t.name),i.value=!1};return e.watch(()=>u.modelValue,t=>{n.value=t}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(c.ElPopover),{visible:i.value,"onUpdate:visible":o[1]||(o[1]=l=>i.value=l),placement:"bottom-start",width:a.width,trigger:"click"},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center pointer radius-16 justify-center w-icon-item",{"select-icon-box bg-fcfdff text-202434 fz-14 flex-col":!s.value,"icon-item":n.value}])},[s.value?(e.openBlock(),e.createBlock(e.unref(c.ElIcon),{key:0,size:a.iconSize},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.value)))]),_:1},8,["size"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(c.ElIcon),{size:16},{default:e.withCtx(()=>[e.createVNode(e.unref(f.IconAdd))]),_:1}),o[2]||(o[2]=e.createTextVNode(" 上传 ",-1))],64))],2)]),default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(e.unref(c.ElInput),{class:"mg-b-12",modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=l=>r.value=l),placeholder:"搜索图标","prefix-icon":e.unref(f.IconSearch),clearable:""},null,8,["modelValue","prefix-icon"]),e.createElementVNode("div",b,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:e.normalizeClass(["icon-item radius-8 justify-center items-center pointer flex w-icon-item",{active:n.value===l.name}]),title:l.name,onClick:N=>y(l)},[e.createVNode(e.unref(c.ElIcon),{size:50},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component)))]),_:2},1024)],10,B))),128))]),m.value.length===0?(e.openBlock(),e.createElementBlock("div",I,[e.createVNode(h.IconEmpty,{text:"未找到相关图标"})])):e.createCommentVNode("",!0)])]),_:1},8,["visible","width"]))}}),E=w._export_sfc(C,[["__scopeId","data-v-92e76646"]]),k=g.withInstall(E);exports.IconSelect=k;exports.default=k;
package/lib/SearchBar.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./chunks/index.CkihWzK6.js"),t=require("./chunks/layout.BjELgY2K.js"),e=r.withInstall(t.SearchBar);exports.SearchBar=e;exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./chunks/index.CkihWzK6.js"),t=require("./chunks/layout.Bn_I4pI8.js"),e=r.withInstall(t.SearchBar);exports.SearchBar=e;exports.default=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/UpdatePasswordDialog.css');const P=require("./chunks/index.CkihWzK6.js"),e=require("vue"),_=require("./chunks/layout.B9EVVV-O.js"),M=require("./chunks/layout.BjELgY2K.js"),o=require("ling-yun-methods"),V=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=()=>{const u=e.ref({password:"",confirmPassword:""}),p=e.computed(()=>[{label:"请输入新密码",key:"password",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:d},{label:"请再次输入新密码",key:"confirmPassword",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:i}]),d=(l,s,t)=>{!s||!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/.test(s)?t(new Error("请输入6-20位,需包含大小写字母、数字")):t()},i=(l,s,t)=>{s===""?t(new Error("两次密码不一致")):s!==u.value.password?t(new Error("两次密码不一致")):t()};return{formData:u,userFromItems:p}},x={__name:"layout",props:{modelValue:{type:Boolean,default:!1},nowUserData:{type:Object,default:()=>{}},apiConfig:{type:Object,default:()=>{}}},emits:[o.emitsMap.updateModelValue,o.emitsMap.change],setup(u,{emit:p}){const d=u,i=p,l=e.computed({get:()=>d.modelValue,set:r=>i(o.emitsMap.updateModelValue,r)}),s=e.ref(null),{formData:t,userFromItems:y}=h(),g=async()=>{const r=await d.apiConfig.getSecretKeyApi();if(r.code!==o.codeMap.success)return{};const{key:a,iv:n,keyId:c}=r.data,{password:f}=s.value.getFormData(),m=o.AESCrypto.encrypt(f,a,n);return{keyId:c,encryptedPassword:m}},v=async()=>{let r=!1;return await s.value.validate(async a=>{if(!a)return;const{keyId:n,encryptedPassword:c}=await g();if(!n||!c)return;const f={userId:d.nowUserData.id,newPassword:c,aesKeyId:n};(await d.apiConfig.updatePasswordApi(f)).code===o.codeMap.success&&(o.messageSuccess("修改成功"),l.value=!1,r=!0,i(o.emitsMap.change))}),r};return(r,a)=>(e.openBlock(),e.createBlock(_.CustomDialog,{modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=n=>l.value=n),title:"修改密码",buttons:{confirmText:"确定",onConfirm:v},top:"30vh",width:"568px","destroy-on-close":""},{default:e.withCtx(()=>[e.createVNode(M.SearchBar,{modelValue:e.unref(t),"onUpdate:modelValue":a[0]||(a[0]=n=>e.isRef(t)?t.value=n:null),ref_key:"formRef",ref:s,items:e.unref(y),isExpand:!1,operationList:[],filterMode:!1,labelPosition:"top"},null,8,["modelValue","items"])]),_:1},8,["modelValue","buttons"]))}},b=V._export_sfc(x,[["__scopeId","data-v-0088227a"]]),w=P.withInstall(b);exports.UpdatePasswordDialog=w;exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/UpdatePasswordDialog.css');const P=require("./chunks/index.CkihWzK6.js"),e=require("vue"),_=require("./chunks/layout.B9EVVV-O.js"),M=require("./chunks/layout.Bn_I4pI8.js"),o=require("ling-yun-methods"),V=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=()=>{const u=e.ref({password:"",confirmPassword:""}),p=e.computed(()=>[{label:"请输入新密码",key:"password",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:d},{label:"请再次输入新密码",key:"confirmPassword",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:i}]),d=(l,s,t)=>{!s||!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/.test(s)?t(new Error("请输入6-20位,需包含大小写字母、数字")):t()},i=(l,s,t)=>{s===""?t(new Error("两次密码不一致")):s!==u.value.password?t(new Error("两次密码不一致")):t()};return{formData:u,userFromItems:p}},x={__name:"layout",props:{modelValue:{type:Boolean,default:!1},nowUserData:{type:Object,default:()=>{}},apiConfig:{type:Object,default:()=>{}}},emits:[o.emitsMap.updateModelValue,o.emitsMap.change],setup(u,{emit:p}){const d=u,i=p,l=e.computed({get:()=>d.modelValue,set:r=>i(o.emitsMap.updateModelValue,r)}),s=e.ref(null),{formData:t,userFromItems:y}=h(),g=async()=>{const r=await d.apiConfig.getSecretKeyApi();if(r.code!==o.codeMap.success)return{};const{key:a,iv:n,keyId:c}=r.data,{password:f}=s.value.getFormData(),m=o.AESCrypto.encrypt(f,a,n);return{keyId:c,encryptedPassword:m}},v=async()=>{let r=!1;return await s.value.validate(async a=>{if(!a)return;const{keyId:n,encryptedPassword:c}=await g();if(!n||!c)return;const f={userId:d.nowUserData.id,newPassword:c,aesKeyId:n};(await d.apiConfig.updatePasswordApi(f)).code===o.codeMap.success&&(o.messageSuccess("修改成功"),l.value=!1,r=!0,i(o.emitsMap.change))}),r};return(r,a)=>(e.openBlock(),e.createBlock(_.CustomDialog,{modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=n=>l.value=n),title:"修改密码",buttons:{confirmText:"确定",onConfirm:v},top:"30vh",width:"568px","destroy-on-close":""},{default:e.withCtx(()=>[e.createVNode(M.SearchBar,{modelValue:e.unref(t),"onUpdate:modelValue":a[0]||(a[0]=n=>e.isRef(t)?t.value=n:null),ref_key:"formRef",ref:s,items:e.unref(y),isExpand:!1,operationList:[],filterMode:!1,labelPosition:"top"},null,8,["modelValue","items"])]),_:1},8,["modelValue","buttons"]))}},b=V._export_sfc(x,[["__scopeId","data-v-0088227a"]]),w=P.withInstall(b);exports.UpdatePasswordDialog=w;exports.default=w;
@@ -1 +1 @@
1
- .filter-form[data-v-b5708f35]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-b5708f35]{display:flex}.filter-preview-form .el-form-item[data-v-b5708f35]{width:var(--v65f9c9b2);margin-right:10px}.search-bar-form[data-v-b5708f35]{grid-template-columns:repeat(auto-fit,minmax(var(--v65f9c9b2),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-b5708f35]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-b5708f35]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-b5708f35] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-b5708f35]{display:grid}.search-bar-item--wide[data-v-b5708f35]{grid-column:span 2}.is-collapsed[data-v-a1cfa7c0]{max-height:var(--v632205ee)}.operation-buttons[data-v-a1cfa7c0]{width:var(--v6de1698c);z-index:1}.h-32[data-v-a1cfa7c0]{height:32px}.drawer-header[data-v-a1cfa7c0]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-a1cfa7c0]{margin-left:auto}.border-top[data-v-a1cfa7c0]{border-top:1px solid var(--parting-line)}[data-v-a1cfa7c0] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-a1cfa7c0]{max-height:400px}[data-v-a1cfa7c0] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
1
+ .filter-form[data-v-b5708f35]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-b5708f35]{display:flex}.filter-preview-form .el-form-item[data-v-b5708f35]{width:var(--v65f9c9b2);margin-right:10px}.search-bar-form[data-v-b5708f35]{grid-template-columns:repeat(auto-fit,minmax(var(--v65f9c9b2),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-b5708f35]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-b5708f35]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-b5708f35] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-b5708f35]{display:grid}.search-bar-item--wide[data-v-b5708f35]{grid-column:span 2}.is-collapsed[data-v-663b89dc]{max-height:var(--v6f32bb87)}.operation-buttons[data-v-663b89dc]{width:var(--v8603bafe);z-index:1}.h-32[data-v-663b89dc]{height:32px}.drawer-header[data-v-663b89dc]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-663b89dc]{margin-left:auto}.border-top[data-v-663b89dc]{border-top:1px solid var(--parting-line)}[data-v-663b89dc] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-663b89dc]{max-height:400px}[data-v-663b89dc] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}