ling-yun-custom-components 0.0.55 → 0.0.57

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,601 @@
1
+ import { renderSlot as b, 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 be, normalizeClass as I, mergeProps as g, createCommentVNode as N, withKeys as ke, 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 ? b(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
+ v4b15a536: 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] = be(() => {
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
+ b(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: ke((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
+ disabled: l.disabled
226
+ }, {
227
+ default: r(() => [
228
+ V(U(l.label), 1)
229
+ ]),
230
+ _: 2
231
+ }, 1032, ["label", "value", "disabled"]))), 128))
232
+ ]),
233
+ _: 2
234
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).textarea ? (u(), c(t(Z), g({
235
+ key: 7,
236
+ modelValue: a.formData[e.key],
237
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
238
+ }, { ref_for: !0 }, e, {
239
+ class: "w-full",
240
+ type: "textarea",
241
+ onChange: (l) => n.$emit(t(f).change, e.key, a.formData[e.key])
242
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).upload ? (u(), c(ze, g({
243
+ key: 8,
244
+ modelValue: a.formData[e.key],
245
+ "onUpdate:modelValue": (l) => a.formData[e.key] = l
246
+ }, { ref_for: !0 }, e), null, 16, ["modelValue", "onUpdate:modelValue"])) : N("", !0)
247
+ ], !0)
248
+ ]),
249
+ _: 2
250
+ }, 1040, ["label", "prop", "show-label", "class"]))), 128)),
251
+ b(n.$slots, "default", {}, void 0, !0)
252
+ ]),
253
+ _: 3
254
+ }, 8, ["model", "label-width", "label-position", "inline", "rules", "class"]));
255
+ }
256
+ }), G = /* @__PURE__ */ ne(je, [["__scopeId", "data-v-125bfab7"]]), 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({
257
+ name: "SearchBar"
258
+ }, {
259
+ __name: "layout",
260
+ props: {
261
+ // 搜索项配置
262
+ items: {
263
+ type: Array,
264
+ default: () => []
265
+ },
266
+ // 初始值
267
+ modelValue: {
268
+ type: Object,
269
+ default: () => ({})
270
+ },
271
+ // 标签宽度
272
+ labelWidth: {
273
+ type: [String, Number],
274
+ default: "auto"
275
+ },
276
+ // 标签位置
277
+ labelPosition: {
278
+ type: String,
279
+ default: B.right,
280
+ validator: (a) => [B.left, B.right, B.top].includes(a)
281
+ },
282
+ // 是否可以展开
283
+ isExpand: {
284
+ type: Boolean,
285
+ default: !0
286
+ },
287
+ // 最大的高度
288
+ maxHeight: {
289
+ type: Number,
290
+ default: 84
291
+ },
292
+ // 每项最小宽度
293
+ minWidth: {
294
+ type: Number,
295
+ default: re
296
+ },
297
+ operationList: {
298
+ type: Array,
299
+ default: Re
300
+ },
301
+ // 是否为筛选器模式
302
+ filterMode: {
303
+ type: Boolean,
304
+ default: !0
305
+ }
306
+ },
307
+ emits: [f.updateModelValue, f.operation, f.change],
308
+ setup(a, { expose: L, emit: E }) {
309
+ le((o) => ({
310
+ v6f32bb87: a.maxHeight + "px",
311
+ v8603bafe: A.value ? A.value + "px" : "100%"
312
+ }));
313
+ 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(() => {
314
+ const o = {};
315
+ return d.items.forEach((i) => {
316
+ if (i.required) {
317
+ const s = [{ required: !0, message: `${i.label}不能为空`, trigger: "blur" }];
318
+ typeof i.validator == "function" && s.push({ validator: i.validator, trigger: "blur" }), o[i.key] = s;
319
+ }
320
+ }), o;
321
+ }), 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) => {
322
+ n.value = { ...o };
323
+ }, ie = () => {
324
+ v(f.updateModelValue, { ...n.value });
325
+ }, de = (o, i) => {
326
+ n.value[o] = i, T.value = !0, W(C.search), setTimeout(() => {
327
+ T.value = !1;
328
+ }, 200), R(o, i);
329
+ }, R = (o, i) => {
330
+ o && v(f.change, o, i);
331
+ }, se = () => n.value, j = (o, i) => {
332
+ T.value || v(f.operation, C.search, n.value);
333
+ }, W = (o) => {
334
+ ie(), v(f.operation, o, n.value), (o === C.search || o === C.reset) && (l.value = !1, P.value = !1);
335
+ }, fe = (o) => e.value.validate(o), A = p(0), me = (o) => {
336
+ A.value = o + 32;
337
+ }, ce = () => {
338
+ y.value = !y.value;
339
+ }, ye = () => {
340
+ l.value = !1, P.value = !0;
341
+ }, ve = () => {
342
+ P.value = !1, l.value = !0;
343
+ }, X = p(!1), Y = (o) => {
344
+ X.value = o > d.maxHeight;
345
+ }, he = x(() => d.filterMode || y.value ? "10px" : "0");
346
+ return ge(() => {
347
+ Q(d.modelValue), Y();
348
+ }), we(
349
+ () => d.modelValue,
350
+ (o) => {
351
+ Q(o);
352
+ },
353
+ { immediate: !0, deep: !0 }
354
+ ), L({
355
+ validate: fe,
356
+ getFormData: se,
357
+ // clearValidate,
358
+ // resetFields,
359
+ // scrollToField,
360
+ formRef: e
361
+ }), (o, i) => (u(), D("div", {
362
+ class: I(["relative overflow-hidden w-full", { flex: a.filterMode }])
363
+ }, [
364
+ w("div", {
365
+ class: I({
366
+ "is-collapsed overflow-hidden": !y.value
367
+ })
368
+ }, [
369
+ m(t(_), null, {
370
+ default: r(({ height: s }) => [
371
+ V(U(Y(s)) + " ", 1),
372
+ m(G, {
373
+ ref_key: "formRef",
374
+ ref: e,
375
+ items: J.value,
376
+ "form-data": n.value,
377
+ rules: ue.value,
378
+ "label-width": a.labelWidth,
379
+ "label-position": a.labelPosition,
380
+ inline: !0,
381
+ "show-label": !a.filterMode,
382
+ "min-width": a.minWidth,
383
+ "is-filter-preview": a.filterMode,
384
+ onChange: de,
385
+ onEnter: j
386
+ }, F({
387
+ default: r(() => [
388
+ a.isExpand && !a.filterMode ? (u(), c(t(oe), {
389
+ key: 0,
390
+ "label-width": "0"
391
+ }, {
392
+ default: r(() => [
393
+ w("div", Ae, [
394
+ m(t(_), null, {
395
+ default: r(({ width: k }) => [
396
+ V(U(me(k)), 1)
397
+ ]),
398
+ _: 1
399
+ })
400
+ ])
401
+ ]),
402
+ _: 1
403
+ })) : N("", !0)
404
+ ]),
405
+ _: 2
406
+ }, [
407
+ $(J.value, (k) => ({
408
+ name: k.key,
409
+ fn: r((pe) => [
410
+ b(o.$slots, k.key, H(K(pe)), void 0, !0)
411
+ ])
412
+ }))
413
+ ]), 1032, ["items", "form-data", "rules", "label-width", "label-position", "show-label", "min-width", "is-filter-preview"])
414
+ ]),
415
+ _: 3
416
+ })
417
+ ], 2),
418
+ w("div", {
419
+ class: I(["operation-buttons", {
420
+ "absolute right-0 bg-fff text-right": a.isExpand && !a.filterMode,
421
+ "text-left": a.filterMode
422
+ }]),
423
+ style: Ve({ bottom: he.value })
424
+ }, [
425
+ a.filterMode ? (u(), D(M, { key: 0 }, [
426
+ m(t(O), {
427
+ onClick: i[0] || (i[0] = (s) => W(t(C).reset)),
428
+ type: "default"
429
+ }, {
430
+ default: r(() => [...i[3] || (i[3] = [
431
+ V("重置", -1)
432
+ ])]),
433
+ _: 1
434
+ }),
435
+ S.value?.length ? (u(), c(t(Le), {
436
+ key: 0,
437
+ visible: l.value,
438
+ placement: "bottom-start",
439
+ width: 628,
440
+ trigger: "click"
441
+ }, {
442
+ reference: r(() => [
443
+ m(t(O), {
444
+ onClick: i[1] || (i[1] = (s) => l.value = !l.value),
445
+ icon: t(We),
446
+ type: "default"
447
+ }, {
448
+ default: r(() => [...i[4] || (i[4] = [
449
+ V(" 筛选器 ", -1)
450
+ ])]),
451
+ _: 1
452
+ }, 8, ["icon"])
453
+ ]),
454
+ default: r(() => [
455
+ w("div", He, [
456
+ m(te, {
457
+ content: "筛选器",
458
+ fontSize: 16
459
+ }),
460
+ m(t(ee), {
461
+ size: 16,
462
+ onClick: ye
463
+ }, {
464
+ default: r(() => [
465
+ m(t(Se))
466
+ ]),
467
+ _: 1
468
+ })
469
+ ]),
470
+ m(G, {
471
+ items: S.value,
472
+ "form-data": n.value,
473
+ "label-width": "auto",
474
+ "label-position": "top",
475
+ inline: !1,
476
+ "show-label": !0,
477
+ "is-filter": !0,
478
+ "min-width": a.minWidth,
479
+ class: "filter-form-popover overflow-y-auto",
480
+ onChange: R,
481
+ onEnter: j
482
+ }, F({ _: 2 }, [
483
+ $(S.value, (s) => ({
484
+ name: s.key,
485
+ fn: r((k) => [
486
+ b(o.$slots, s.key, H(K(k)), void 0, !0)
487
+ ])
488
+ }))
489
+ ]), 1032, ["items", "form-data", "min-width"]),
490
+ w("div", Ke, [
491
+ m(q, {
492
+ "operation-list": a.operationList,
493
+ onOperation: W
494
+ }, F({ _: 2 }, [
495
+ o.$slots.operation ? {
496
+ name: "operation",
497
+ fn: r(({ operationList: s }) => [
498
+ b(o.$slots, "operation", { operationList: s }, void 0, !0)
499
+ ]),
500
+ key: "0"
501
+ } : void 0
502
+ ]), 1032, ["operation-list"])
503
+ ])
504
+ ]),
505
+ _: 3
506
+ }, 8, ["visible"])) : N("", !0)
507
+ ], 64)) : (u(), D(M, { key: 1 }, [
508
+ X.value && a.isExpand ? (u(), c(t(O), {
509
+ key: 0,
510
+ icon: y.value ? t(Be) : t(Ie),
511
+ text: "",
512
+ onClick: ce
513
+ }, {
514
+ default: r(() => [
515
+ V(U(y.value ? "收起" : "展开"), 1)
516
+ ]),
517
+ _: 1
518
+ }, 8, ["icon"])) : N("", !0),
519
+ m(q, {
520
+ "operation-list": a.operationList,
521
+ onOperation: W
522
+ }, F({ _: 2 }, [
523
+ o.$slots.operation ? {
524
+ name: "operation",
525
+ fn: r(({ operationList: s }) => [
526
+ b(o.$slots, "operation", { operationList: s }, void 0, !0)
527
+ ]),
528
+ key: "0"
529
+ } : void 0
530
+ ]), 1032, ["operation-list"])
531
+ ], 64))
532
+ ], 6),
533
+ m(t(Pe), {
534
+ modelValue: P.value,
535
+ "onUpdate:modelValue": i[2] || (i[2] = (s) => P.value = s),
536
+ size: "628",
537
+ "show-close": !1
538
+ }, {
539
+ header: r(() => [
540
+ w("div", qe, [
541
+ m(te, {
542
+ content: "筛选器",
543
+ fontSize: 16
544
+ }),
545
+ m(t(ee), {
546
+ size: 16,
547
+ onClick: ve,
548
+ class: "shrink-button"
549
+ }, {
550
+ default: r(() => [
551
+ m(t(Ne))
552
+ ]),
553
+ _: 1
554
+ })
555
+ ])
556
+ ]),
557
+ default: r(() => [
558
+ w("div", Ge, [
559
+ m(G, {
560
+ items: S.value,
561
+ "form-data": n.value,
562
+ "label-width": "auto",
563
+ "label-position": "top",
564
+ inline: !1,
565
+ "show-label": !0,
566
+ "is-filter": !0,
567
+ "min-width": a.minWidth,
568
+ onChange: R,
569
+ onEnter: j
570
+ }, F({ _: 2 }, [
571
+ $(S.value, (s) => ({
572
+ name: s.key,
573
+ fn: r((k) => [
574
+ b(o.$slots, s.key, H(K(k)), void 0, !0)
575
+ ])
576
+ }))
577
+ ]), 1032, ["items", "form-data", "min-width"])
578
+ ]),
579
+ w("div", Je, [
580
+ m(q, {
581
+ "operation-list": a.operationList,
582
+ onOperation: W
583
+ }, F({ _: 2 }, [
584
+ o.$slots.operation ? {
585
+ name: "operation",
586
+ fn: r(({ operationList: s }) => [
587
+ b(o.$slots, "operation", { operationList: s }, void 0, !0)
588
+ ]),
589
+ key: "0"
590
+ } : void 0
591
+ ]), 1032, ["operation-list"])
592
+ ])
593
+ ]),
594
+ _: 3
595
+ }, 8, ["modelValue"])
596
+ ], 2));
597
+ }
598
+ }), oa = /* @__PURE__ */ ne(Qe, [["__scopeId", "data-v-663b89dc"]]);
599
+ export {
600
+ oa as S
601
+ };
package/lib/AppIntro.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/AppIntro.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),w=require("color-message-lingyun-vue"),V=require("./chunks/layout.B9EVVV-O.js"),_=require("./chunks/layout.B-T_NE6r.js"),v=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=require("ling-yun-methods"),o={LISTING:1,DELISTING:2,ONLINE:3,OFFLINE:4},y={PENDING:0,APPROVED:1,REJECTED:2},E={IMAGE:1,VIDEO:2},f={INTRO:"intro",TIMELINE:"timeline"},B={[o.LISTING]:"上架申请",[o.DELISTING]:"下架申请",[o.ONLINE]:"上线应用",[o.OFFLINE]:"下线应用"},N={[y.PENDING]:{type:"warning",text:"待审核"},[y.APPROVED]:{type:"primary",text:"已通过"},[y.REJECTED]:{type:"danger",text:"已驳回"}},C=[{title:"申请人:",field:"appCreatorName"},{title:"应用省份:",field:"appCreatorOrg"},{title:"应用说明:",field:"appDesc"},{title:"接入系统:",field:"accessSystem"},{title:"业务背景:",field:"businessBackground"},{title:"业务目标:",field:"businessTarget"},{title:"成效数据:",field:"resultData"}],L=[{title:"申请人",field:"creatorName",showForTypes:[o.LISTING,o.DELISTING]},{title:"操作人",field:"creatorName",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下架原因",field:"delistingReason",showForTypes:[o.DELISTING]},{title:"成效数据",field:"resultData",showForTypes:[o.LISTING]},{title:"推荐理由",field:"recommendReason",showForTypes:[o.LISTING]},{title:"版本号",field:"appVersionNum",showForTypes:[o.ONLINE,o.OFFLINE],formatter:a=>a?`V${a}`:"--"},{title:"配置摘要",field:"configSummary",showForTypes:[o.ONLINE]},{title:"版本说明",field:"publishRemark",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下线原因",field:"offlineReason",showForTypes:[o.OFFLINE]}],k={[o.LISTING]:{text:"查看上架申请"},[o.DELISTING]:{text:"查看下架申请"}},D={key:0,class:"media-video relative w-full"},x=["src"],F={key:1,class:"media-image relative w-full"},S=["src"],I={__name:"MediaViewer",props:{media:{type:Object,default:null}},setup(a){return(i,d)=>a.media?.type===e.unref(E).VIDEO?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("video",{class:"w-full",src:a.media.url,controls:""},null,8,x)])):a.media?.type===e.unref(E).IMAGE?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("img",{class:"w-full",src:a.media.url,alt:""},null,8,S)])):e.createCommentVNode("",!0)}},b={class:"app-intro-content overflow-hidden h-full"},O={key:0,class:"media-section w-full pd-b-12"},$={class:"media-content relative w-full"},G=["onClick"],M={class:"info-section"},R={class:"flex items-center"},q={class:"fz-14 text-666 pd-r-12"},A={class:"preview-content"},P={__name:"AppIntroContent",props:{introData:{type:Object,default:()=>({})}},setup(a){const i=e.ref(!1),d=e.ref(null),u=r=>{d.value=r,i.value=!0},m=()=>{i.value=!1,d.value=null},p=r=>{try{const t=document.createElement("a");t.href=r.attachementUrl,t.download=r.attachementName,t.style.display="none",t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(t){console.error(t)}};return(r,t)=>(e.openBlock(),e.createElementBlock("div",b,[a.introData?.pics?.length>0?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.pics,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"media-item w-full"},[e.createVNode(I,{media:l},null,8,["media"]),e.createElementVNode("div",{class:"hover-overlay absolute top-0 left-0 w-full h-full flex justify-center items-center",onClick:s=>u(l)},[e.createVNode(e.unref(c.ElIcon),{size:24,class:"view-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.IconLook))]),_:1})],8,G)]))),128))])])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",{},void 0,!0),e.createElementVNode("div",M,[e.createVNode(e.unref(c.ElForm),{model:a.introData,"label-width":"auto"},{default:e.withCtx(()=>[["agent","workflow"].includes(a.introData?.appCategory)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(C),l=>(e.openBlock(),e.createBlock(e.unref(c.ElFormItem),{key:l.field,label:l.title,class:"mg-b-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.introData?.[l.field]??"--"),1)]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["model"]),a.introData?.attachements?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(_.CustomTitle,{content:"附件:",class:"pd-b-12 pd-t-24"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.attachements,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"mg-b-8"},[e.createElementVNode("div",R,[e.createElementVNode("span",q,e.toDisplayString(l.attachementName),1),l.attachementUrl?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,onClick:s=>p(l)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 点击查看 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))],64)):e.createCommentVNode("",!0)]),e.createVNode(V.CustomDialog,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),width:"60%","show-close":!0,onClose:m,buttons:{showCancel:!1,showConfirm:!1}},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createVNode(I,{media:d.value,class:"preview-media"},null,8,["media"])])]),_:1},8,["modelValue"])]))}},j=v._export_sfc(P,[["__scopeId","data-v-f5af90d9"]]),z={class:"flex items-center flex-gap-row-nowrap-8 mg-b-12"},U={class:"fz-14 weight-500",style:{color:"#1d2129"}},H={class:"fz-14",style:{color:"#4e5969"}},J={__name:"AppTimeline",props:{appId:{type:String,default:""},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appOperationList:{type:Function,default:()=>{}}},setup(a){const i=a,d=async t=>{i.vueRouter.push({path:"/promptTestDetail",query:{id:t.id,type:t.auditStatus,sourceFlag:"1",operationType:t.operationType,sourceHistory:"1"}})},u=t=>[o.LISTING,o.DELISTING].includes(t),m=t=>L.filter(l=>l.showForTypes.includes(t)),p=e.ref([]),r=async()=>{await i.appOperationList({appId:i.appId,operationType:[o.LISTING,o.DELISTING,o.ONLINE,o.OFFLINE].join(","),pageNum:h.pageParams.pageNum,pageSize:1e6}).then(({data:t})=>{p.value=t.list})};return e.onMounted(()=>{r()}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(c.ElTimeline),{class:"overflow-y-auto h-full pd-l-4"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(c.ElTimelineItem),{key:n.id,timestamp:n.createTime,placement:"top",color:"var(--primary-color-1)"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ElCard),{shadow:"hover"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createElementVNode("span",U,e.toDisplayString(e.unref(B)[n.operationType]||"--"),1),u(n.operationType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(N)[n.auditStatus]?(e.openBlock(),e.createBlock(e.unref(c.ElTag),{key:0,type:e.unref(N)[n.auditStatus].type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)[n.auditStatus].text),1)]),_:2},1032,["type"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(n.operationType),s=>(e.openBlock(),e.createElementBlock("div",{key:s.field+s.title,class:"mg-t-8 mg-b-8",style:{"line-height":"1.5"}},e.toDisplayString(s.title)+":"+e.toDisplayString(s.formatter?s.formatter(n[s.field]):n[s.field]??"--"),1))),128)),e.unref(k)[n.operationType]&&!a.square?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,class:"mg-t-8",onClick:s=>d(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k)[n.operationType].text),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1}))}},Y=v._export_sfc(J,[["__scopeId","data-v-3a2170d7"]]),K={class:"h-full overflow-hidden flex flex-col pd-t-12"},Q={class:"pd-b-12"},W={key:0,class:"flex-1 overflow-hidden"},X={key:1,class:"flex-1 overflow-hidden"},Z=Object.assign({name:"AppIntro"},{__name:"layout",props:{introData:{type:Object,default:()=>({})},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appId:{type:String,default:""},appOperationList:{type:Function,default:()=>{}}},emits:[h.emitsMap.tabChange],setup(a,{emit:i}){const d=i,u=e.ref(f.INTRO),m=e.computed(()=>[{label:"应用介绍",value:f.INTRO},{label:"迭代时间轴",value:f.TIMELINE}]),p=r=>{d(h.emitsMap.tabChange,r)};return(r,t)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createVNode(e.unref(c.ElSegmented),{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=l=>u.value=l),options:m.value,onChange:p},null,8,["modelValue","options"])]),u.value===e.unref(f).INTRO?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(j,{"intro-data":a.introData},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"plugin-detail")]),_:3},8,["intro-data"])])):u.value===e.unref(f).TIMELINE?(e.openBlock(),e.createElementBlock("div",X,[e.createVNode(Y,{"app-operation-list":a.appOperationList,square:a.square,"vue-router":a.vueRouter,"app-id":a.appId},null,8,["app-operation-list","square","vue-router","app-id"])])):e.createCommentVNode("",!0)]))}}),T=g.withInstall(Z);exports.AppIntro=T;exports.default=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/AppIntro.css');const g=require("./chunks/index.CkihWzK6.js"),e=require("vue"),c=require("element-plus"),w=require("color-message-lingyun-vue"),V=require("./chunks/layout.B9EVVV-O.js"),_=require("./chunks/layout.B-T_NE6r.js"),v=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=require("ling-yun-methods"),o={LISTING:1,DELISTING:2,ONLINE:3,OFFLINE:4},y={PENDING:0,APPROVED:1,REJECTED:2},E={IMAGE:1,VIDEO:2},f={INTRO:"intro",TIMELINE:"timeline"},B={[o.LISTING]:"上架申请",[o.DELISTING]:"下架申请",[o.ONLINE]:"上线应用",[o.OFFLINE]:"下线应用"},N={[y.PENDING]:{type:"warning",text:"待审核"},[y.APPROVED]:{type:"primary",text:"已通过"},[y.REJECTED]:{type:"danger",text:"已驳回"}},C=[{title:"申请人:",field:"appCreatorName"},{title:"应用省份:",field:"appCreatorOrg"},{title:"应用说明:",field:"appDesc"},{title:"接入系统:",field:"accessSystem"},{title:"业务背景:",field:"businessBackground"},{title:"业务目标:",field:"businessTarget"},{title:"成效数据:",field:"resultData"}],L=[{title:"申请人",field:"creatorName",showForTypes:[o.LISTING,o.DELISTING]},{title:"操作人",field:"creatorName",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下架原因",field:"delistingReason",showForTypes:[o.DELISTING]},{title:"成效数据",field:"resultData",showForTypes:[o.LISTING]},{title:"推荐理由",field:"recommendReason",showForTypes:[o.LISTING]},{title:"版本号",field:"appVersionNum",showForTypes:[o.ONLINE,o.OFFLINE],formatter:a=>a?`V${a}`:"--"},{title:"配置摘要",field:"configSummary",showForTypes:[o.ONLINE]},{title:"版本说明",field:"publishRemark",showForTypes:[o.ONLINE,o.OFFLINE]},{title:"下线原因",field:"offlineReason",showForTypes:[o.OFFLINE]}],k={[o.LISTING]:{text:"查看上架申请"},[o.DELISTING]:{text:"查看下架申请"}},D={key:0,class:"media-video relative w-full"},b=["src"],x={key:1,class:"media-image relative w-full"},F=["src"],I={__name:"MediaViewer",props:{media:{type:Object,default:null}},setup(a){return(i,d)=>a.media?.type===e.unref(E).VIDEO?(e.openBlock(),e.createElementBlock("div",D,[e.createElementVNode("video",{class:"w-full",src:a.media.url,controls:""},null,8,b)])):a.media?.type===e.unref(E).IMAGE?(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("img",{class:"w-full",src:a.media.url,alt:""},null,8,F)])):e.createCommentVNode("",!0)}},S={class:"app-intro-content overflow-hidden h-full"},O={key:0,class:"media-section w-full pd-b-12"},$={class:"media-content relative w-full"},G=["onClick"],M={class:"info-section"},R={class:"flex items-center"},q={class:"fz-14 text-666 pd-r-12"},A={class:"preview-content"},P={__name:"AppIntroContent",props:{introData:{type:Object,default:()=>({})}},setup(a){const i=e.ref(!1),d=e.ref(null),u=r=>{d.value=r,i.value=!0},m=()=>{i.value=!1,d.value=null},p=r=>{try{const t=document.createElement("a");t.href=r.attachementUrl,t.download=r.attachementName,t.style.display="none",t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)}catch(t){console.error(t)}};return(r,t)=>(e.openBlock(),e.createElementBlock("div",S,[a.introData?.pics?.length>0?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.pics,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"media-item w-full"},[e.createVNode(I,{media:l},null,8,["media"]),e.createElementVNode("div",{class:"hover-overlay absolute top-0 left-0 w-full h-full flex justify-center items-center",onClick:s=>u(l)},[e.createVNode(e.unref(c.ElIcon),{size:24,class:"view-icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(w.IconLook))]),_:1})],8,G)]))),128))])])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default",{},void 0,!0),e.createElementVNode("div",M,[e.createVNode(e.unref(c.ElForm),{model:a.introData,"label-width":"auto"},{default:e.withCtx(()=>[["agent","workflow"].includes(a.introData?.appCategory)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(C),l=>(e.openBlock(),e.createBlock(e.unref(c.ElFormItem),{key:l.field,label:l.title,class:"mg-b-0"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.introData?.[l.field]??"--"),1)]),_:2},1032,["label"]))),128)):e.createCommentVNode("",!0)]),_:1},8,["model"]),a.introData?.attachements?.length?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(_.CustomTitle,{content:"附件:",class:"pd-b-12 pd-t-24"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.introData.attachements,(l,n)=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"mg-b-8"},[e.createElementVNode("div",R,[e.createElementVNode("span",q,e.toDisplayString(l.attachementName),1),l.attachementUrl?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,onClick:s=>p(l)},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode(" 点击查看 ",-1)])]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])]))),128))],64)):e.createCommentVNode("",!0)]),e.createVNode(V.CustomDialog,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),width:"60%","show-close":!0,onClose:m,buttons:{showCancel:!1,showConfirm:!1}},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createVNode(I,{media:d.value,class:"preview-media"},null,8,["media"])])]),_:1},8,["modelValue"])]))}},j=v._export_sfc(P,[["__scopeId","data-v-7bb24f99"]]),z={class:"flex items-center flex-gap-row-nowrap-8 mg-b-12"},U={class:"fz-14 weight-500",style:{color:"#1d2129"}},H={class:"fz-14",style:{color:"#4e5969"}},J={__name:"AppTimeline",props:{appId:{type:String,default:""},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appOperationList:{type:Function,default:()=>{}}},setup(a){const i=a,d=async t=>{i.vueRouter.push({path:"/promptTestDetail",query:{id:t.id,type:t.auditStatus,sourceFlag:"1",operationType:t.operationType,sourceHistory:"1"}})},u=t=>[o.LISTING,o.DELISTING].includes(t),m=t=>L.filter(l=>l.showForTypes.includes(t)),p=e.ref([]),r=async()=>{await i.appOperationList({appId:i.appId,operationType:[o.LISTING,o.DELISTING,o.ONLINE,o.OFFLINE].join(","),pageNum:h.pageParams.pageNum,pageSize:1e6}).then(({data:t})=>{p.value=t.list})};return e.onMounted(()=>{r()}),(t,l)=>(e.openBlock(),e.createBlock(e.unref(c.ElTimeline),{class:"overflow-y-auto h-full pd-l-4"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,n=>(e.openBlock(),e.createBlock(e.unref(c.ElTimelineItem),{key:n.id,timestamp:n.createTime,placement:"top",color:"var(--primary-color-1)"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ElCard),{shadow:"hover"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createElementVNode("span",U,e.toDisplayString(e.unref(B)[n.operationType]||"--"),1),u(n.operationType)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(N)[n.auditStatus]?(e.openBlock(),e.createBlock(e.unref(c.ElTag),{key:0,type:e.unref(N)[n.auditStatus].type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)[n.auditStatus].text),1)]),_:2},1032,["type"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m(n.operationType),s=>(e.openBlock(),e.createElementBlock("div",{key:s.field+s.title,class:"mg-t-8 mg-b-8",style:{"line-height":"1.5"}},e.toDisplayString(s.title)+":"+e.toDisplayString(s.formatter?s.formatter(n[s.field]):n[s.field]??"--"),1))),128)),e.unref(k)[n.operationType]&&!a.square?(e.openBlock(),e.createBlock(e.unref(c.ElLink),{key:0,type:"primary",underline:!1,class:"mg-t-8",onClick:s=>d(n)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k)[n.operationType].text),1)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:2},1024)]),_:2},1032,["timestamp"]))),128))]),_:1}))}},Y=v._export_sfc(J,[["__scopeId","data-v-3a2170d7"]]),K={class:"h-full overflow-hidden flex flex-col pd-t-12"},Q={class:"pd-b-12"},W={key:0,class:"flex-1 overflow-hidden"},X={key:1,class:"flex-1 overflow-hidden"},Z=Object.assign({name:"AppIntro"},{__name:"layout",props:{introData:{type:Object,default:()=>({})},square:{type:Boolean,default:!1},vueRouter:{type:Object,default:()=>({})},appId:{type:String,default:""},appOperationList:{type:Function,default:()=>{}}},emits:[h.emitsMap.tabChange],setup(a,{emit:i}){const d=i,u=e.ref(f.INTRO),m=e.computed(()=>[{label:"应用介绍",value:f.INTRO},{label:"迭代时间轴",value:f.TIMELINE}]),p=r=>{d(h.emitsMap.tabChange,r)};return(r,t)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createVNode(e.unref(c.ElSegmented),{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=l=>u.value=l),options:m.value,onChange:p},null,8,["modelValue","options"])]),u.value===e.unref(f).INTRO?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(j,{"intro-data":a.introData},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"plugin-detail")]),_:3},8,["intro-data"])])):u.value===e.unref(f).TIMELINE?(e.openBlock(),e.createElementBlock("div",X,[e.createVNode(Y,{"app-operation-list":a.appOperationList,square:a.square,"vue-router":a.vueRouter,"app-id":a.appId},null,8,["app-operation-list","square","vue-router","app-id"])])):e.createCommentVNode("",!0)]))}}),T=g.withInstall(Z);exports.AppIntro=T;exports.default=T;
@@ -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.XouT1lGG.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.D0m66zzb.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.XouT1lGG.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.D0m66zzb.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;