@topdatasec/report 1.0.12 → 1.1.1

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.
@@ -1,28 +1,2191 @@
1
- import { defineComponent as s, ref as c, openBlock as r, createElementBlock as p } from "vue";
2
- const l = { style: { height: "100%" } }, m = /* @__PURE__ */ s({
1
+ import { defineComponent as k, computed as I, resolveComponent as p, openBlock as d, createElementBlock as h, createElementVNode as C, Fragment as A, renderList as z, normalizeClass as O, createBlock as S, createCommentVNode as R, toDisplayString as W, ref as $, createVNode as a, withCtx as u, onMounted as te, normalizeProps as re, guardReactiveProps as se, isVNode as ie, normalizeStyle as xe, mergeModels as ue, useModel as pe, unref as y, createTextVNode as E, resolveDynamicComponent as Y, isRef as we, withModifiers as Ve, watch as Se, resolveDirective as ke, withDirectives as $e, shallowRef as Te, onBeforeUnmount as Le, onUnmounted as Re, reactive as Ue, TransitionGroup as De } from "vue";
2
+ import { defineStore as Ee, storeToRefs as Ae } from "pinia";
3
+ import { ElMessage as Fe } from "element-plus";
4
+ import { VueDraggable as Ie } from "vue-draggable-plus";
5
+ import { Toolbar as ze, Editor as He } from "@wangeditor/editor-for-vue";
6
+ const B = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math.random().toString(36).substring(2, 9), q = (l) => JSON.parse(JSON.stringify(l)), Me = (l) => l.replace(/-([a-z])/g, (t, e) => e.toUpperCase()).replace(/^[a-z]/, (t) => t.toUpperCase()), H = (l, t) => l[Me(t)], de = "rgba(51, 51, 51, 0.15)", M = "rgba(51, 51, 51, 1)", N = 12, ce = (l = !1) => {
7
+ const t = {
8
+ // top: '2%',
9
+ left: "3%",
10
+ right: "3%",
11
+ bottom: "2%",
12
+ containLabel: !0
13
+ };
14
+ return l && (t.top = "5%"), t;
15
+ }, U = [
16
+ "46, 145, 255",
17
+ "48, 212, 183",
18
+ "108, 108, 255",
19
+ "109, 237, 124",
20
+ "128, 218, 236",
21
+ "58, 200, 218",
22
+ "146, 218, 89",
23
+ "118, 218, 218",
24
+ "143, 192, 244",
25
+ "192, 192, 145",
26
+ "153, 136, 204",
27
+ "212, 217, 230",
28
+ "124, 186, 255",
29
+ "209, 182, 225",
30
+ "255, 197, 84",
31
+ "249, 140, 106",
32
+ "246, 179, 82",
33
+ "100, 161, 206",
34
+ "246, 175, 159",
35
+ "238, 97, 97"
36
+ ], je = (l, t, e = "", n = { name: "name", value: "value" }) => {
37
+ const r = [], o = [];
38
+ t.forEach((s) => {
39
+ r.push(s[n.name]), o.push(s[n.value]);
40
+ }), l.xAxis[0].data = r, l.series[0].data = o, l.series[0].name = e, l.series[1].data = o, l.series[2].data = o;
41
+ }, oe = (l = [
42
+ {
43
+ name: "数据1",
44
+ value: 63
45
+ },
46
+ {
47
+ name: "数据2",
48
+ value: 45
49
+ },
50
+ {
51
+ name: "数据3",
52
+ value: 43
53
+ }
54
+ ], t = { name: "name", value: "value" }) => {
55
+ const e = (r = "rgba(46, 145, 255, 0.7)", o = "rgba(46, 145, 255, 0.2)") => ({
56
+ color: {
57
+ type: "linear",
58
+ x: 0,
59
+ y: 0,
60
+ x2: 0,
61
+ y2: 1,
62
+ colorStops: [
63
+ {
64
+ offset: 0,
65
+ color: r
66
+ },
67
+ {
68
+ offset: 0.8,
69
+ color: o
70
+ }
71
+ ]
72
+ }
73
+ }), n = l.map((r) => r[t.value]);
74
+ return {
75
+ // 提示框组件
76
+ tooltip: {
77
+ trigger: "item"
78
+ //触发类型,axis:坐标轴触发
79
+ },
80
+ // 图例组件
81
+ // legend: {
82
+ // type: 'plain', //plain:普通图例;scroll:可滚动翻页的图例。当图例数量较多时使。
83
+ // show: true,
84
+ // },
85
+ grid: ce(),
86
+ title: {
87
+ show: !0,
88
+ text: "样例数据",
89
+ textStyle: {
90
+ color: "#333",
91
+ fontSize: 18
92
+ },
93
+ x: 10,
94
+ y: 10
95
+ },
96
+ // x 轴设置
97
+ xAxis: [
98
+ {
99
+ type: "category",
100
+ nameGap: 8,
101
+ // X轴名称与轴线之间的距离
102
+ nameRotate: 0,
103
+ // 坐标轴名称旋转
104
+ axisLabel: {
105
+ color: M,
106
+ // X轴类目名称样式
107
+ rotate: 0
108
+ // X轴类目名称旋转角度
109
+ },
110
+ axisLine: {
111
+ //X轴轴线设置
112
+ show: !0,
113
+ lineStyle: {
114
+ color: de,
115
+ width: 1
116
+ }
117
+ },
118
+ axisTick: { show: !1 },
119
+ // X轴刻度相关设置
120
+ splitLine: { show: !1 },
121
+ // 横向分隔线
122
+ data: l.map((r) => r[t.name])
123
+ }
124
+ ],
125
+ // y轴设置
126
+ yAxis: [
127
+ {
128
+ type: "value",
129
+ min: 0,
130
+ // 坐标轴刻度最小值
131
+ position: "left",
132
+ nameTextStyle: {
133
+ fontSize: N,
134
+ color: M,
135
+ fontWeight: "bold"
136
+ },
137
+ axisLine: { show: !1 },
138
+ // y轴轴线设置
139
+ axisTick: { show: !1 },
140
+ // 刻度设置
141
+ splitLine: { show: !1 },
142
+ // 纵向分隔线
143
+ axisLabel: {
144
+ color: M,
145
+ // y轴刻度标签
146
+ formatter: "{value}",
147
+ inside: !1
148
+ // 刻度标签是否朝内,默认朝外
149
+ }
150
+ }
151
+ ],
152
+ series: [
153
+ {
154
+ type: "bar",
155
+ barWidth: 15,
156
+ barGap: "0%",
157
+ itemStyle: e(`rgba(${U[0]}, 0.7)`, `rgba(${U[0]}, 0.2)`),
158
+ data: n,
159
+ label: {
160
+ show: !0,
161
+ // 显示标签
162
+ position: "top",
163
+ // 标签位置
164
+ color: "inherit",
165
+ // 标签颜色
166
+ lineHeight: 24
167
+ // 行高
168
+ }
169
+ },
170
+ {
171
+ // 柱底圆片
172
+ name: "",
173
+ type: "pictorialBar",
174
+ symbolSize: [15, 10],
175
+ //调整截面形状
176
+ symbolOffset: [0, 5],
177
+ itemStyle: e(`rgba(${U[0]}, 0.7)`, `rgba(${U[0]}, 0.2)`),
178
+ data: n
179
+ },
180
+ {
181
+ // 柱顶圆片
182
+ name: "",
183
+ type: "pictorialBar",
184
+ symbolSize: [15, 10],
185
+ //调整截面形状
186
+ symbolOffset: [0, -5],
187
+ symbolPosition: "end",
188
+ itemStyle: e(`rgba(${U[0]}, 0.9)`, `rgba(${U[0]}, 1)`),
189
+ data: n
190
+ }
191
+ ]
192
+ };
193
+ }, Pe = ({ chartOption: l, data: t, props: e = { name: "label", value: "data" } }) => {
194
+ let n = 0;
195
+ const r = t.map((o, s) => (n += Number(o[e.value]), {
196
+ name: o[e.name],
197
+ value: Number(o[e.value])
198
+ }));
199
+ t.length > 0 && (l.legend.data = r, l.series[0].data = r, l.graphic[1].style.text = n);
200
+ }, Be = () => U.map((l) => `rgba(${l}, 1)`), J = ({
201
+ data: l = [
202
+ {
203
+ name: "数据1",
204
+ value: 63
205
+ },
206
+ {
207
+ name: "数据2",
208
+ value: 45
209
+ },
210
+ {
211
+ name: "数据3",
212
+ value: 43
213
+ }
214
+ ],
215
+ radiusType: t = 1,
216
+ roseType: e = !1,
217
+ isLegend: n = !0,
218
+ isLine: r = !1,
219
+ center: o = ["50%", "50%"],
220
+ isTitle: s = !0
221
+ }) => {
222
+ const m = {
223
+ color: Be(),
224
+ toolbox: { show: !1 },
225
+ tooltip: {
226
+ trigger: "item",
227
+ show: !0,
228
+ formatter: (i) => {
229
+ const { name: f, value: c } = i;
230
+ return `<div style="color: ${i.color}; font-size: 14px;">${f}&nbsp;&nbsp;&nbsp;</div>
231
+ <div><span style="font-size: 14px; color: #86909c; float: right;">数量:${c}</span></div>`;
232
+ }
233
+ },
234
+ title: {
235
+ show: s,
236
+ text: "样例数据",
237
+ textStyle: {
238
+ color: "#333",
239
+ fontSize: 18
240
+ },
241
+ x: 10,
242
+ y: 10
243
+ },
244
+ legend: {
245
+ show: n,
246
+ left: "70%",
247
+ formatter: (i) => {
248
+ var c;
249
+ const f = (c = m.series[0]) == null ? void 0 : c.data.find((_) => _.name === i).value;
250
+ return ` ${i} | ${f}`;
251
+ },
252
+ textStyle: {
253
+ fontSize: N,
254
+ color: M
255
+ },
256
+ data: l,
257
+ orient: "vertical",
258
+ itemWidth: 10,
259
+ itemHeight: 10,
260
+ borderRadius: 10,
261
+ x: "left",
262
+ top: "center",
263
+ align: "left",
264
+ itemGap: 15
265
+ },
266
+ series: [
267
+ // 展示层
268
+ {
269
+ type: "pie",
270
+ center: o,
271
+ radius: t === 1 ? e ? ["10%", "65%"] : ["45%", "70%"] : ["0%", "65%"],
272
+ roseType: e,
273
+ itemStyle: {
274
+ borderRadius: 1
275
+ // color: (p: any) => {
276
+ // return {
277
+ // colorStops: [
278
+ // {
279
+ // offset: 0,
280
+ // color: `rgba(${colorRGBValue[p.dataIndex % colorRGBValue.length]}, 0.5)`, // 0% 处的颜色
281
+ // },
282
+ // {
283
+ // offset: 1,
284
+ // color: `rgba(${colorRGBValue[p.dataIndex % colorRGBValue.length]}, 1)`, // 100% 处的颜色
285
+ // },
286
+ // ],
287
+ // }
288
+ // },
289
+ },
290
+ label: {
291
+ show: r,
292
+ position: "outside",
293
+ alignTo: "labelLine",
294
+ backgroundColor: "#fff",
295
+ height: 0,
296
+ width: 0,
297
+ lineHeight: 0,
298
+ distanceToLabelLine: 0,
299
+ borderRadius: 3,
300
+ borderWidth: 1,
301
+ borderColor: "inherit",
302
+ padding: [3, -3, 3, -3],
303
+ formatter: function(i) {
304
+ return `{a|${i.name}(${i.value})}`;
305
+ },
306
+ rich: {
307
+ a: {
308
+ padding: [20, -80, 40, -80],
309
+ fontSize: "12px",
310
+ fontFamily: "MicrosoftYaHei",
311
+ color: "#091158"
312
+ },
313
+ b: {
314
+ padding: [0, -80, 55, -80],
315
+ fontSize: "15px",
316
+ fontFamily: "MicrosoftYaHei-Bold, MicrosoftYaHei",
317
+ fontWeight: "bold",
318
+ color: "#001F3D"
319
+ }
320
+ }
321
+ },
322
+ labelLine: {
323
+ show: !0,
324
+ length: 40,
325
+ length2: 85,
326
+ align: "right",
327
+ lineStyle: {
328
+ width: 1
329
+ }
330
+ },
331
+ data: l
332
+ }
333
+ ],
334
+ graphic: [
335
+ {
336
+ invisible: !1,
337
+ type: "text",
338
+ left: "center",
339
+ top: "44%",
340
+ style: {
341
+ text: "总量",
342
+ fontSize: 14,
343
+ fill: "#86909c",
344
+ fontWeight: "bold"
345
+ }
346
+ },
347
+ {
348
+ invisible: !1,
349
+ type: "text",
350
+ left: "center",
351
+ top: "50%",
352
+ style: {
353
+ text: "151",
354
+ fontSize: 18,
355
+ fill: "#86909c",
356
+ fontWeight: "bold"
357
+ }
358
+ }
359
+ ]
360
+ };
361
+ return m;
362
+ }, We = (l, t, e = { name: "name", value: "value" }) => {
363
+ l.xAxis.data = t.map((n) => n[e.name]), Array.isArray(e.value) ? e.value.forEach((n, r) => {
364
+ l.series[r].data = t.map((o) => o[n.value]);
365
+ }) : typeof e.value == "string" && (l.series[0].data = t.map((n) => n[e.value]));
366
+ }, Ne = () => ({
367
+ name: "",
368
+ type: "line",
369
+ symbol: "circle",
370
+ smooth: !0,
371
+ lineStyle: {
372
+ width: 1,
373
+ color: `rgba(${U[0]}, 1)`
374
+ // 线条颜色
375
+ },
376
+ showSymbol: !1,
377
+ itemStyle: {
378
+ color: `rgba(${U[0]}, 1)`,
379
+ //拐点颜色
380
+ label: {
381
+ show: !0,
382
+ //开启显示
383
+ position: "top",
384
+ //在上方显示
385
+ formatter: function(l) {
386
+ return l.value ? l.value : 0;
387
+ }
388
+ }
389
+ },
390
+ areaStyle: {
391
+ color: {
392
+ type: "linear",
393
+ x: 0,
394
+ y: 0,
395
+ x2: 0,
396
+ y2: 1,
397
+ colorStops: [
398
+ // 渐变颜色
399
+ {
400
+ offset: 0,
401
+ color: `rgba(${U[0]}, 0.7)`
402
+ },
403
+ {
404
+ offset: 1,
405
+ color: `rgba(${U[0]}, 0.1)`
406
+ }
407
+ ],
408
+ global: !1
409
+ }
410
+ },
411
+ data: []
412
+ }), K = (l = [
413
+ {
414
+ name: "2024-08",
415
+ value: 63
416
+ },
417
+ {
418
+ name: "2024-09",
419
+ value: 45
420
+ },
421
+ {
422
+ name: "2024-10",
423
+ value: 43
424
+ }
425
+ ], t = { name: "name", value: "value" }) => {
426
+ const e = {
427
+ tooltip: {
428
+ trigger: "axis"
429
+ },
430
+ title: {
431
+ show: !0,
432
+ text: "样例数据",
433
+ textStyle: {
434
+ color: "#333",
435
+ fontSize: 18
436
+ },
437
+ x: 10,
438
+ y: 10
439
+ },
440
+ legend: {
441
+ show: !0,
442
+ itemWidth: 30,
443
+ textStyle: {
444
+ color: M,
445
+ fontSize: N,
446
+ padding: [0, 8, 0, 8]
447
+ }
448
+ },
449
+ grid: ce(),
450
+ xAxis: {
451
+ type: "category",
452
+ splitLine: { show: !1 },
453
+ axisTick: { show: !1 },
454
+ axisLine: {
455
+ show: !0,
456
+ lineStyle: { color: de }
457
+ },
458
+ axisLabel: {
459
+ show: !0,
460
+ fontSize: N,
461
+ color: M
462
+ },
463
+ boundaryGap: !1,
464
+ data: l.map((o) => o[t.name])
465
+ },
466
+ yAxis: {
467
+ name: "",
468
+ type: "value",
469
+ splitLine: { show: !1 },
470
+ axisLine: { show: !1 },
471
+ axisTick: { show: !1 },
472
+ nameTextStyle: {
473
+ fontSize: N,
474
+ color: M,
475
+ padding: [0, 60, 0, 0]
476
+ },
477
+ axisLabel: {
478
+ show: !0,
479
+ fontSize: N,
480
+ color: M
481
+ }
482
+ },
483
+ series: []
484
+ }, n = Ne(), r = [];
485
+ if (Array.isArray(t.value))
486
+ t.value.forEach((o, s) => {
487
+ const m = q(n);
488
+ m.name = o.name, m.lineStyle.color = `rgba(${U[s]}, 1)`, m.itemStyle.color = `rgba(${U[s]}, 1)`, m.areaStyle.color.colorStops[0].color = `rgba(${U[s]}, 0.7)`, m.areaStyle.color.colorStops[1].color = `rgba(${U[s]}, 0.1)`, m.data = l.map((i) => i[o.value]), r.push(m);
489
+ });
490
+ else if (typeof t.value == "string") {
491
+ const o = q(n);
492
+ o.data = l.map((s) => s[t.value]), r.push(o);
493
+ }
494
+ return e.series = r, e;
495
+ }, le = [
496
+ { key: "assets", name: "资产名称" },
497
+ { key: "type", name: "资产类型" },
498
+ { key: "data", name: "资产数据" }
499
+ ], ne = [
500
+ { assets: "name1", type: "type1", data: "data1" },
501
+ { assets: "name2", type: "type2", data: "data2" },
502
+ { assets: "name3", type: "type3", data: "data3" }
503
+ ], Q = [
504
+ { data: [{ name: "默认数据", value: 180 }], label: "name1" },
505
+ { data: [{ name: "默认数据", value: 311 }], label: "name2" },
506
+ { data: [{ name: "默认数据", value: 42 }], label: "name3" },
507
+ { data: [{ name: "默认数据", value: 32391 }], label: "name4" }
508
+ ], Oe = [
509
+ {
510
+ data: 63,
511
+ label: "数据1"
512
+ },
513
+ {
514
+ data: 45,
515
+ label: "数据2"
516
+ },
517
+ {
518
+ data: 43,
519
+ label: "数据3"
520
+ }
521
+ ], Ye = [
522
+ {
523
+ type: "report-select",
524
+ label: "资产:",
525
+ value: "0",
526
+ data: [
527
+ {
528
+ label: "全部",
529
+ data: "0"
530
+ },
531
+ {
532
+ label: "10.10.2.20_root",
533
+ data: "743dbb32-8a41-4990-9d76-48925b000a93"
534
+ },
535
+ {
536
+ label: "10.10.4.206_sysdba",
537
+ data: "23193788-c895-47a8-8123-65799540394c"
538
+ },
539
+ {
540
+ label: "10.10.4.26_root@/root/files/",
541
+ data: "bb7b07c9-b96b-4caf-ac76-bb45ae849844"
542
+ }
543
+ ],
544
+ uri: "/da/report/sens/get_asset_all",
545
+ id: B()
546
+ },
547
+ {
548
+ type: "range-time",
549
+ data: [
550
+ {
551
+ start_time: "2024-08-20 19:49:34",
552
+ end_time: "2024-09-12 19:49:34"
553
+ }
554
+ ],
555
+ id: B()
556
+ },
557
+ {
558
+ type: "h1",
559
+ data: "报表名称",
560
+ options: {
561
+ size: 24,
562
+ color: "rgba(0,0,0,0.85)",
563
+ fontWeight: 500,
564
+ letterSpacing: 0,
565
+ textIndent: 0,
566
+ textAlign: "left"
567
+ },
568
+ id: B()
569
+ },
570
+ {
571
+ type: "h2",
572
+ data: "一级标题",
573
+ name: "一级标题",
574
+ options: {
575
+ size: 18,
576
+ color: " rgba(0, 0, 0, 0.85)",
577
+ fontWeight: 500,
578
+ letterSpacing: 0,
579
+ textIndent: 0,
580
+ textAlign: "left"
581
+ },
582
+ id: B()
583
+ },
584
+ {
585
+ type: "report-table",
586
+ data: ne,
587
+ showColumn: le,
588
+ name: "表格",
589
+ options: {
590
+ showColumn: {
591
+ assets: !0,
592
+ type: !0,
593
+ data: !0
594
+ },
595
+ border: !0,
596
+ showHeader: !0,
597
+ stripe: !1
598
+ },
599
+ rp_item_uuid: "",
600
+ id: B()
601
+ }
602
+ ], qe = [
603
+ {
604
+ type: "h1",
605
+ data: "报表名称",
606
+ name: "报表名称",
607
+ options: {
608
+ size: 24,
609
+ color: " rgba(0, 0, 0, 0.85)",
610
+ fontWeight: 500,
611
+ letterSpacing: 0,
612
+ textIndent: 0,
613
+ textAlign: "left"
614
+ },
615
+ hide: !0,
616
+ id: ""
617
+ },
618
+ {
619
+ type: "h2",
620
+ data: "一级标题",
621
+ name: "一级标题",
622
+ options: {
623
+ size: 18,
624
+ color: " rgba(0, 0, 0, 0.85)",
625
+ fontWeight: 500,
626
+ letterSpacing: 0,
627
+ textIndent: 0,
628
+ textAlign: "left"
629
+ },
630
+ id: ""
631
+ },
632
+ {
633
+ type: "h3",
634
+ data: "二级标题",
635
+ name: "二级标题",
636
+ options: {
637
+ size: 14,
638
+ color: " rgba(0, 0, 0, 0.85)",
639
+ fontWeight: 500,
640
+ letterSpacing: 0,
641
+ textIndent: 0,
642
+ textAlign: "left"
643
+ },
644
+ id: ""
645
+ },
646
+ { type: "p", data: "正文", name: "正文", rp_item_uuid: "", id: "" },
647
+ {
648
+ type: "report-table",
649
+ data: ne,
650
+ showColumn: le,
651
+ name: "表格",
652
+ options: {
653
+ border: !0,
654
+ showHeader: !0,
655
+ stripe: !1,
656
+ showColumn: {
657
+ assect: !0,
658
+ type: !0,
659
+ data: !0
660
+ }
661
+ },
662
+ rp_item_uuid: "",
663
+ id: ""
664
+ },
665
+ {
666
+ type: "bar",
667
+ data: Q,
668
+ showColumn: [{ key: "label", value: "data" }],
669
+ name: "图表",
670
+ options: oe(),
671
+ rp_item_uuid: "",
672
+ id: ""
673
+ }
674
+ ], Ge = (l) => ({
675
+ bar: {
676
+ type: "bar",
677
+ data: Q,
678
+ showColumn: [{ key: "label", value: "data" }],
679
+ name: "图表",
680
+ options: oe(),
681
+ rp_item_uuid: "",
682
+ id: ""
683
+ },
684
+ line: {
685
+ type: "line",
686
+ data: Q,
687
+ showColumn: [{ key: "label", value: "data" }],
688
+ name: "图表",
689
+ options: K(),
690
+ rp_item_uuid: "",
691
+ id: ""
692
+ },
693
+ pie: {
694
+ type: "pie",
695
+ data: Oe,
696
+ showColumn: [{ key: "label", value: "data" }],
697
+ name: "图表",
698
+ options: J({ isLegend: !0 }),
699
+ rp_item_uuid: "",
700
+ id: ""
701
+ },
702
+ "report-table": {
703
+ type: "report-table",
704
+ data: ne,
705
+ showColumn: le,
706
+ name: "表格",
707
+ options: {
708
+ showColumn: {
709
+ assect: !0,
710
+ type: !0,
711
+ data: !0
712
+ },
713
+ border: !0,
714
+ showHeader: !0,
715
+ stripe: !1
716
+ },
717
+ rp_item_uuid: "",
718
+ id: ""
719
+ }
720
+ })[l], D = Ee("tds-report", {
721
+ state: () => ({
722
+ componentList: [],
723
+ activeComponents: {},
724
+ notDraggableList: [],
725
+ titleComponent: {},
726
+ prodType: -1,
727
+ envURL: "",
728
+ filterForm: {
729
+ range_time: 1,
730
+ filter_uuid: ""
731
+ }
732
+ }),
733
+ getters: {
734
+ getActiveComponents: (l) => l.activeComponents
735
+ },
736
+ actions: {
737
+ // setComponentList
738
+ setComponentList(l) {
739
+ this.componentList = l;
740
+ },
741
+ async getReportDemo(l) {
742
+ let t = [];
743
+ l ? t = (await Ke({ report_uuid: l })).data : t = { content: q(Ye), range_time: 1 };
744
+ const e = [];
745
+ t.content.forEach((n) => {
746
+ (n.type === "report-select" || n.type === "range-time") && e.push(n), n.type === "h1" && (this.titleComponent = n), n.id = B();
747
+ }), this.notDraggableList = e, this.filterForm.range_time = t.range_time, this.filterForm.filter_uuid = t.filter_uuid, t.content.splice(0, 3), this.componentList = t.content;
748
+ },
749
+ // 设置使用分支
750
+ setProdType(l) {
751
+ this.prodType = l;
752
+ },
753
+ // 设置请求路由
754
+ setEnvURL(l) {
755
+ this.envURL = l;
756
+ },
757
+ setActiveComponents(l) {
758
+ this.activeComponents = l;
759
+ },
760
+ clearComponents() {
761
+ this.activeComponents = {}, this.componentList = [], this.notDraggableList = [], this.titleComponent = {}, this.filterForm = {
762
+ range_time: 1,
763
+ filter_uuid: ""
764
+ };
765
+ }
766
+ }
767
+ }), Je = D(), j = window.$http, P = Je.envURL, Ke = (l) => j.request({
768
+ url: `${P}/tds/report/demo/get`,
769
+ method: "get",
770
+ params: l,
771
+ isError: !1
772
+ }), me = (l) => j.request({
773
+ url: `${P}/tds/report/item/get`,
774
+ method: "get",
775
+ params: l,
776
+ isError: !1
777
+ }), Qe = (l) => j.request({
778
+ url: `${P}/tds/report/preview`,
779
+ method: "get",
780
+ params: l,
781
+ isError: !1
782
+ }), Xe = (l) => j.request({
783
+ url: `${P}/tds/report/add`,
784
+ method: "post",
785
+ data: l
786
+ }), Ze = (l) => j.request({
787
+ url: `${P}/tds/report/put`,
788
+ method: "put",
789
+ data: l
790
+ }), et = (l) => j.request({
791
+ url: `${P}/tds/report/get`,
792
+ method: "get",
793
+ params: l,
794
+ isError: !1
795
+ }), tt = (l) => j.request({
796
+ url: `${P}/tds/report/filter/get`,
797
+ method: "get",
798
+ params: l,
799
+ isError: !1
800
+ }), ot = (l) => j.request({
801
+ url: `${P}/tds/report/delete`,
802
+ method: "delete",
803
+ data: l
804
+ }), lt = { class: "catalogue" }, nt = ["href", "title"], at = /* @__PURE__ */ k({
805
+ __name: "Catalogue",
806
+ props: {
807
+ data: { default: () => [] }
808
+ },
809
+ setup(l) {
810
+ const t = l, e = I(() => t.data.filter((n) => ["h2", "h3", "h4"].includes(n.type)));
811
+ return (n, r) => {
812
+ const o = p("el-divider");
813
+ return d(), h("div", lt, [
814
+ r[0] || (r[0] = C("div", { class: "cata-title el-anchor__link" }, "目录", -1)),
815
+ (d(!0), h(A, null, z(e.value, (s) => (d(), h("div", {
816
+ class: O("level" + s.type),
817
+ key: s.value
818
+ }, [
819
+ s.type === "h2" ? (d(), S(o, {
820
+ key: 0,
821
+ style: { "margin-top": "10px", "margin-bottom": "10px" }
822
+ })) : R("", !0),
823
+ C("a", {
824
+ class: "el-anchor__link",
825
+ href: "#" + s.id,
826
+ title: s.data
827
+ }, W(s.data), 9, nt)
828
+ ], 2))), 128))
829
+ ]);
830
+ };
831
+ }
832
+ });
833
+ const G = (l, t) => {
834
+ const e = l.__vccOpts || l;
835
+ for (const [n, r] of t)
836
+ e[n] = r;
837
+ return e;
838
+ }, rt = /* @__PURE__ */ G(at, [["__scopeId", "data-v-1cd8aa2d"]]), st = {
839
+ class: "chart-components"
840
+ }, _e = /* @__PURE__ */ k({
841
+ __name: "Bar",
842
+ props: {
843
+ value: {}
844
+ },
845
+ setup(l) {
846
+ const t = l, e = I(() => t.value.options);
847
+ return $(!1), (n, r) => {
848
+ const o = p("TdsChart");
849
+ return d(), h("div", st, [a(o, {
850
+ option: e.value
851
+ }, null, 8, ["option"])]);
852
+ };
853
+ }
854
+ }), it = { class: "chart-components" }, fe = /* @__PURE__ */ k({
855
+ __name: "Line",
856
+ props: {
857
+ value: {}
858
+ },
859
+ setup(l) {
860
+ const t = l, e = I(() => t.value.options);
861
+ return (n, r) => {
862
+ const o = p("TdsChart");
863
+ return d(), h("div", it, [
864
+ a(o, { option: e.value }, null, 8, ["option"])
865
+ ]);
866
+ };
867
+ }
868
+ }), ut = { class: "chart-components" }, ve = /* @__PURE__ */ k({
869
+ __name: "Pie",
870
+ props: {
871
+ value: {}
872
+ },
873
+ setup(l) {
874
+ const t = l, e = I(() => t.value.options);
875
+ return (n, r) => {
876
+ const o = p("TdsChart");
877
+ return d(), h("div", ut, [
878
+ a(o, { option: e.value }, null, 8, ["option"])
879
+ ]);
880
+ };
881
+ }
882
+ }), pt = { key: 0 }, X = /* @__PURE__ */ k({
883
+ __name: "ReportSelect",
884
+ props: {
885
+ value: {}
886
+ },
887
+ emits: ["change"],
888
+ setup(l, { emit: t }) {
889
+ const e = t, n = (s) => {
890
+ e("change", s);
891
+ }, o = $(l.value);
892
+ return (s, m) => {
893
+ const i = p("el-option"), f = p("el-select");
894
+ return o.value.data ? (d(), h("div", pt, [
895
+ a(f, {
896
+ modelValue: o.value.value,
897
+ "onUpdate:modelValue": m[0] || (m[0] = (c) => o.value.value = c),
898
+ multiple: "",
899
+ style: { width: "100%" },
900
+ onChange: n,
901
+ placeholder: "全部"
902
+ }, {
903
+ default: u(() => [
904
+ (d(!0), h(A, null, z(o.value.data, (c) => (d(), S(i, {
905
+ key: c.data,
906
+ label: c.label,
907
+ value: c.data
908
+ }, null, 8, ["label", "value"]))), 128))
909
+ ]),
910
+ _: 1
911
+ }, 8, ["modelValue"])
912
+ ])) : R("", !0);
913
+ };
914
+ }
915
+ }), Z = /* @__PURE__ */ k({
916
+ __name: "RangeTime",
917
+ props: {
918
+ value: {}
919
+ },
920
+ emits: ["change"],
921
+ setup(l, { emit: t }) {
922
+ const e = t, r = $(l.value), o = $([]);
923
+ function s(m) {
924
+ m ? (r.value.data[0].start_time = m[0], r.value.data[0].end_time = m[1]) : o.value = [], e("change", o.value);
925
+ }
926
+ return te(() => {
927
+ o.value = [r.value.data[0].start_time, r.value.data[0].end_time];
928
+ }), (m, i) => {
929
+ const f = p("el-date-picker");
930
+ return d(), h("div", null, [
931
+ a(f, {
932
+ modelValue: o.value,
933
+ "onUpdate:modelValue": i[0] || (i[0] = (c) => o.value = c),
934
+ type: "datetimerange",
935
+ placeholder: "Pick a Date",
936
+ format: "YYYY-MM-DD HH:mm:ss",
937
+ "value-format": "YYYY-MM-DD HH:mm:ss",
938
+ onChange: s,
939
+ clearable: !1
940
+ }, null, 8, ["modelValue"])
941
+ ]);
942
+ };
943
+ }
944
+ });
945
+ function dt(l) {
946
+ return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !ie(l);
947
+ }
948
+ const be = /* @__PURE__ */ k({
949
+ __name: "ReportTable",
950
+ props: {
951
+ value: {}
952
+ },
953
+ setup(l) {
954
+ const t = l, e = (n) => {
955
+ let r;
956
+ return a(p("el-table"), {
957
+ data: n.data,
958
+ border: t.value.options.border,
959
+ "show-header": !!t.value.options.showHeader,
960
+ stripe: t.value.options.stripe
961
+ }, dt(r = n.showColumn.map((o) => t.value.options.showColumn[o.key] === !0 ? a(p("el-table-column"), {
962
+ prop: o.key,
963
+ label: o.name
964
+ }, null) : null)) ? r : {
965
+ default: () => [r]
966
+ });
967
+ };
968
+ return (n, r) => (d(), h("div", null, [a(e, re(se(n.value)), null, 16)]));
969
+ }
970
+ }), ee = /* @__PURE__ */ k({
971
+ __name: "ReportText",
972
+ props: {
973
+ value: {}
974
+ },
975
+ setup(l) {
976
+ const t = l, e = () => {
977
+ const n = t.value.options || {};
978
+ return {
979
+ color: n.color,
980
+ "font-size": n.size + "px",
981
+ "font-weight": n.fontWeight,
982
+ "letter-spacing": n.letterSpacing + "px",
983
+ "text-indent": n.textIndent + "px",
984
+ "text-align": n.textAlign
985
+ };
986
+ };
987
+ return (n, r) => (d(), h("div", {
988
+ style: xe(e())
989
+ }, W(n.value.data), 5));
990
+ }
991
+ }), ct = { class: "chart-components" }, ge = /* @__PURE__ */ k({
992
+ __name: "ReportChart",
993
+ props: {
994
+ value: {}
995
+ },
996
+ setup(l) {
997
+ const t = l, e = I(() => t.value), n = I(() => {
998
+ if (e.value.type === "bar") {
999
+ e.value.options.series = oe([]).series;
1000
+ const r = [];
1001
+ let o = "";
1002
+ e.value.data.forEach((s) => {
1003
+ o = s.data[0].name, r.push({
1004
+ name: s.label,
1005
+ value: s.data[0].value
1006
+ });
1007
+ }), je(e.value.options, r, o);
1008
+ }
1009
+ if (e.value.type === "pie" && (e.value.options = J({ isLegend: !0 }), console.log(J({ isLegend: !0 }), "chartsPie({ isLegend: true })"), Pe({ chartOption: e.value.options, data: e.value.data })), e.value.type === "line") {
1010
+ let r = [];
1011
+ e.value.data.forEach((m) => {
1012
+ r = m.data.map((i, f) => ({ name: i.name, value: "value" + f }));
1013
+ });
1014
+ const o = {
1015
+ name: "name",
1016
+ value: r
1017
+ }, s = e.value.data.map((m) => {
1018
+ const i = {
1019
+ name: m.label
1020
+ };
1021
+ return r.forEach((f, c) => {
1022
+ i[f.value] = m.data[c].value;
1023
+ }), i;
1024
+ });
1025
+ console.log(K([], o), "chartsLine([], params)"), e.value.options.series = K([], o).series, We(e.value.options, s, o);
1026
+ }
1027
+ return e.value.options;
1028
+ });
1029
+ return (r, o) => {
1030
+ const s = p("TdsChart");
1031
+ return d(), h("div", ct, [
1032
+ a(s, { option: n.value }, null, 8, ["option"])
1033
+ ]);
1034
+ };
1035
+ }
1036
+ });
1037
+ function mt(l) {
1038
+ return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !ie(l);
1039
+ }
1040
+ const ye = /* @__PURE__ */ k({
1041
+ __name: "ReportDescribe",
1042
+ props: {
1043
+ value: {}
1044
+ },
1045
+ setup(l) {
1046
+ const t = l, e = (n) => {
1047
+ let r;
1048
+ return a(p("el-descriptions"), {
1049
+ title: t.value.options.title,
1050
+ border: t.value.options.border,
1051
+ column: t.value.options.column,
1052
+ direction: t.value.options.direction
1053
+ }, mt(r = n.showColumn.map((o) => a(p("el-descriptions-item"), {
1054
+ label: o.name
1055
+ }, {
1056
+ default: () => [t.value.data[o.key]]
1057
+ }))) ? r : {
1058
+ default: () => [r]
1059
+ });
1060
+ };
1061
+ return (n, r) => (d(), h("div", null, [a(e, re(se(n.value)), null, 16)]));
1062
+ }
1063
+ }), _t = {
1064
+ class: "editor-box"
1065
+ }, ft = {
1066
+ class: "editor",
1067
+ id: "editor",
1068
+ style: {
1069
+ width: "100%"
1070
+ }
1071
+ }, vt = {
1072
+ class: "editor-content flex flex-start"
1073
+ }, bt = ["id"], gt = ["innerHTML"], yt = /* @__PURE__ */ k({
1074
+ __name: "index",
1075
+ props: /* @__PURE__ */ ue({
1076
+ reportId: {
1077
+ type: String,
1078
+ default: ""
1079
+ }
1080
+ }, {
1081
+ modelValue: {},
1082
+ modelModifiers: {}
1083
+ }),
1084
+ emits: ["update:modelValue"],
1085
+ setup(l) {
1086
+ const t = {
1087
+ Bar: _e,
1088
+ Line: fe,
1089
+ Pie: ve,
1090
+ ReportSelect: X,
1091
+ RangeTime: Z,
1092
+ ReportTable: be,
1093
+ ReportText: ee,
1094
+ ReportChart: ge,
1095
+ ReportDescribe: ye
1096
+ }, e = D(), n = l, r = pe(l, "modelValue"), o = $([]), s = $([]), m = $([]), i = $(""), f = $("");
1097
+ function c() {
1098
+ r.value = "table";
1099
+ }
1100
+ const _ = (v) => {
1101
+ m.value = v, b();
1102
+ }, g = (v) => {
1103
+ v && v.length > 0 && (i.value = v[0], f.value = v[1]), b();
1104
+ }, b = async () => {
1105
+ const v = {
1106
+ report_uuid: n.reportId,
1107
+ start_time: i.value,
1108
+ end_time: f.value,
1109
+ select_data: m.value.join(",")
1110
+ }, x = await Qe(v), F = [];
1111
+ x.data.forEach((w) => {
1112
+ (w.type === "report-select" || w.type === "range-time") && F.push(w);
1113
+ }), o.value = F, x.data.splice(0, o.value.length), s.value = x.data;
1114
+ };
1115
+ b();
1116
+ const T = () => a("div", null, [E("未找到对应组件")]), V = (v) => v === "h2" || v === "h3" || v === "h4" ? H(t, "ReportText") : v === "bar" || v === "pie" || v === "line" ? H(t, "ReportChart") : v ? H(t, v) : a(T, null, null);
1117
+ return (v, x) => {
1118
+ const F = p("el-button"), w = p("el-card");
1119
+ return d(), S(w, {
1120
+ class: "editor view"
1121
+ }, {
1122
+ default: u(() => [C("div", _t, [a(rt, {
1123
+ data: s.value
1124
+ }, null, 8, ["data"]), C("div", ft, [C("div", vt, [(d(!0), h(A, null, z(o.value, (L) => (d(), h("div", {
1125
+ class: "item-input",
1126
+ key: L.id
1127
+ }, [L.type === "report-select" ? (d(), S(X, {
1128
+ key: 0,
1129
+ onChange: _,
1130
+ value: L
1131
+ }, null, 8, ["value"])) : R("", !0), L.type === "range-time" && y(e).filterForm.range_time ? (d(), S(Z, {
1132
+ key: 1,
1133
+ onChange: g,
1134
+ value: L
1135
+ }, null, 8, ["value"])) : R("", !0)]))), 128)), a(F, {
1136
+ plain: "",
1137
+ onClick: c,
1138
+ type: "primary",
1139
+ class: "custom-btn",
1140
+ style: {
1141
+ "margin-left": "auto"
1142
+ }
1143
+ }, {
1144
+ default: u(() => x[0] || (x[0] = [E("退出预览")])),
1145
+ _: 1
1146
+ })]), (d(!0), h(A, null, z(s.value, (L) => (d(), h("div", {
1147
+ key: L.id,
1148
+ class: O(["editor-content", ["editor" + L.type]]),
1149
+ id: L.id
1150
+ }, [L.type !== "p" ? (d(), S(Y(V(L.type)), {
1151
+ key: 0,
1152
+ class: O(["editor" + L.type]),
1153
+ value: L
1154
+ }, {
1155
+ default: u(() => [E(W(L.data), 1)]),
1156
+ _: 2
1157
+ }, 1032, ["class", "value"])) : (d(), h("p", {
1158
+ key: 1,
1159
+ innerHTML: L.data
1160
+ }, null, 8, gt))], 10, bt))), 128))])])]),
1161
+ _: 1
1162
+ });
1163
+ };
1164
+ }
1165
+ });
1166
+ const ht = /* @__PURE__ */ G(yt, [["__scopeId", "data-v-2d59469a"]]), Ct = {
1167
+ class: "editor"
1168
+ }, xt = {
1169
+ class: "editor-content edit"
1170
+ }, wt = ["onClick"], Vt = ["onClick"], St = ["innerHTML", "draggable"], kt = /* @__PURE__ */ k({
1171
+ __name: "Editor",
1172
+ setup(l) {
1173
+ const t = {
1174
+ Bar: _e,
1175
+ Line: fe,
1176
+ Pie: ve,
1177
+ ReportSelect: X,
1178
+ RangeTime: Z,
1179
+ ReportTable: be,
1180
+ ReportText: ee,
1181
+ ReportChart: ge,
1182
+ ReportDescribe: ye
1183
+ }, {
1184
+ componentList: e,
1185
+ activeComponents: n,
1186
+ notDraggableList: r,
1187
+ titleComponent: o
1188
+ } = Ae(D()), s = D(), m = (v) => {
1189
+ e.value.forEach((x, F) => {
1190
+ x.id === v && (e.value.splice(F, 1), s.activeComponents = []);
1191
+ });
1192
+ }, i = (v) => {
1193
+ s.setActiveComponents(v);
1194
+ }, f = () => a("div", null, [E("未找到对应组件")]), c = (v) => v === "h2" || v === "h3" || v === "h4" ? H(t, "ReportText") : v === "bar" || v === "pie" || v === "line" ? H(t, "ReportChart") : v ? H(t, v) : a(f, null, null), _ = (v) => {
1195
+ console.log(v, "evt");
1196
+ }, g = $(!1), b = () => {
1197
+ g.value = !0;
1198
+ }, T = (v) => {
1199
+ v.newIndex !== 0 && (console.log(v), g.value = !1);
1200
+ }, V = $();
1201
+ return (v, x) => {
1202
+ const F = p("icon-material-symbols:cancel-outline");
1203
+ return d(), h("div", Ct, [C("div", {
1204
+ class: O(["editor-content edit flex flex-start", [{
1205
+ active: y(n).id === "filter"
1206
+ }]]),
1207
+ onClick: x[0] || (x[0] = (w) => i({
1208
+ id: "filter",
1209
+ type: "filter"
1210
+ }))
1211
+ }, [(d(!0), h(A, null, z(y(r), (w) => (d(), h("div", {
1212
+ class: "item-input",
1213
+ key: w.id
1214
+ }, [w.type === "report-select" || w.type === "range-time" && y(s).filterForm.range_time ? (d(), S(Y(y(H)(t, w.type)), {
1215
+ key: 0,
1216
+ value: w
1217
+ }, {
1218
+ default: u(() => [E(W(w.data), 1)]),
1219
+ _: 2
1220
+ }, 1032, ["value"])) : R("", !0)]))), 128))], 2), C("div", xt, [a(ee, {
1221
+ value: y(o),
1222
+ onClick: x[1] || (x[1] = (w) => i(y(o)))
1223
+ }, null, 8, ["value"])]), a(y(Ie), {
1224
+ ref_key: "el",
1225
+ ref: V,
1226
+ modelValue: y(e),
1227
+ "onUpdate:modelValue": x[2] || (x[2] = (w) => we(e) ? e.value = w : null),
1228
+ "on-change": _,
1229
+ animation: 150,
1230
+ onStart: b,
1231
+ onEnd: T
1232
+ }, {
1233
+ default: u(() => [(d(!0), h(A, null, z(y(e), (w) => (d(), h("div", {
1234
+ key: w.id,
1235
+ class: O(["editor-content edit", ["editor" + w.type, {
1236
+ active: w.id === y(n).id
1237
+ }]]),
1238
+ onClick: (L) => i(w)
1239
+ }, [C("i", {
1240
+ onClick: Ve((L) => m(w.id), ["stop"])
1241
+ }, [a(F, {
1242
+ class: "color-red"
1243
+ })], 8, Vt), w.type !== "p" ? (d(), S(Y(c(w.type)), {
1244
+ key: 0,
1245
+ class: O(["editor" + w.type]),
1246
+ value: w,
1247
+ draggable: g.value
1248
+ }, {
1249
+ default: u(() => [E(W(w.data), 1)]),
1250
+ _: 2
1251
+ }, 1032, ["class", "value", "draggable"])) : (d(), h("p", {
1252
+ key: 1,
1253
+ innerHTML: w.data,
1254
+ draggable: g.value
1255
+ }, null, 8, St))], 10, wt))), 128))]),
1256
+ _: 1
1257
+ }, 8, ["modelValue"])]);
1258
+ };
1259
+ }
1260
+ }), $t = { class: "label" }, Tt = { class: "flex item-switch" }, Lt = { class: "flex item-switch" }, Rt = { class: "flex item-switch" }, he = /* @__PURE__ */ k({
1261
+ __name: "SettingTable",
1262
+ setup(l) {
1263
+ const t = D(), e = I(() => t.getActiveComponents);
1264
+ return (n, r) => {
1265
+ const o = p("el-switch"), s = p("el-form-item"), m = p("el-divider");
1266
+ return d(), h("div", null, [
1267
+ a(s, { label: "控制列" }, {
1268
+ default: u(() => [
1269
+ (d(!0), h(A, null, z(e.value.showColumn, (i, f) => (d(), h("p", {
1270
+ class: "flex item-switch",
1271
+ key: f
1272
+ }, [
1273
+ C("span", $t, W(i.name), 1),
1274
+ a(o, {
1275
+ modelValue: e.value.options.showColumn[i.key],
1276
+ "onUpdate:modelValue": (c) => e.value.options.showColumn[i.key] = c
1277
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
1278
+ ]))), 128))
1279
+ ]),
1280
+ _: 1
1281
+ }),
1282
+ a(m),
1283
+ a(s, { label: "表格样式" }, {
1284
+ default: u(() => [
1285
+ C("p", Tt, [
1286
+ r[3] || (r[3] = C("span", { class: "label" }, "斑马纹", -1)),
1287
+ a(o, {
1288
+ modelValue: e.value.options.stripe,
1289
+ "onUpdate:modelValue": r[0] || (r[0] = (i) => e.value.options.stripe = i)
1290
+ }, null, 8, ["modelValue"])
1291
+ ]),
1292
+ C("p", Lt, [
1293
+ r[4] || (r[4] = C("span", { class: "label" }, "边框", -1)),
1294
+ a(o, {
1295
+ modelValue: e.value.options.border,
1296
+ "onUpdate:modelValue": r[1] || (r[1] = (i) => e.value.options.border = i)
1297
+ }, null, 8, ["modelValue"])
1298
+ ]),
1299
+ C("p", Rt, [
1300
+ r[5] || (r[5] = C("span", { class: "label" }, "表头", -1)),
1301
+ a(o, {
1302
+ modelValue: e.value.options.showHeader,
1303
+ "onUpdate:modelValue": r[2] || (r[2] = (i) => e.value.options.showHeader = i)
1304
+ }, null, 8, ["modelValue"])
1305
+ ])
1306
+ ]),
1307
+ _: 1
1308
+ })
1309
+ ]);
1310
+ };
1311
+ }
1312
+ }), Ut = { key: 0 }, Dt = /* @__PURE__ */ k({
1313
+ __name: "ChartsUniConfig",
1314
+ setup(l) {
1315
+ const t = D(), e = I(() => t.activeComponents);
1316
+ function n(r) {
1317
+ r ? (e.value.options.series[0].radius = ["10%", "65%"], e.value.options.graphic[0].invisible = !0, e.value.options.graphic[1].invisible = !0) : (e.value.options.series[0].radius = ["45%", "70%"], e.value.options.graphic[0].invisible = !1, e.value.options.graphic[1].invisible = !1);
1318
+ }
1319
+ return $("rgb(46, 145, 255)"), (r, o) => {
1320
+ const s = p("el-input"), m = p("el-form-item"), i = p("el-switch"), f = p("el-col"), c = p("el-color-picker"), _ = p("el-input-number"), g = p("el-row"), b = p("el-collapse-item"), T = p("el-collapse");
1321
+ return e.value.options.title ? (d(), h("div", Ut, [
1322
+ a(m, { label: "标题" }, {
1323
+ default: u(() => [
1324
+ a(s, {
1325
+ modelValue: e.value.options.title.text,
1326
+ "onUpdate:modelValue": o[0] || (o[0] = (V) => e.value.options.title.text = V)
1327
+ }, null, 8, ["modelValue"])
1328
+ ]),
1329
+ _: 1
1330
+ }),
1331
+ a(T, null, {
1332
+ default: u(() => [
1333
+ a(b, {
1334
+ title: "标题配置",
1335
+ name: "1"
1336
+ }, {
1337
+ default: u(() => [
1338
+ a(g, { class: "w-100%" }, {
1339
+ default: u(() => [
1340
+ a(f, { span: 24 }, {
1341
+ default: u(() => [
1342
+ o[8] || (o[8] = C("span", { class: "switch-label" }, "显示标题", -1)),
1343
+ a(i, {
1344
+ modelValue: e.value.options.title.show,
1345
+ "onUpdate:modelValue": o[1] || (o[1] = (V) => e.value.options.title.show = V)
1346
+ }, null, 8, ["modelValue"])
1347
+ ]),
1348
+ _: 1
1349
+ }),
1350
+ a(f, { span: 12 }, {
1351
+ default: u(() => [
1352
+ a(c, {
1353
+ modelValue: e.value.options.title.textStyle.color,
1354
+ "onUpdate:modelValue": o[2] || (o[2] = (V) => e.value.options.title.textStyle.color = V),
1355
+ "show-alpha": ""
1356
+ }, null, 8, ["modelValue"]),
1357
+ o[9] || (o[9] = C("p", { class: "sub-title" }, "颜色", -1))
1358
+ ]),
1359
+ _: 1
1360
+ }),
1361
+ a(f, { span: 12 }, {
1362
+ default: u(() => [
1363
+ a(_, {
1364
+ modelValue: e.value.options.title.textStyle.fontSize,
1365
+ "onUpdate:modelValue": o[3] || (o[3] = (V) => e.value.options.title.textStyle.fontSize = V),
1366
+ "controls-position": "right"
1367
+ }, null, 8, ["modelValue"]),
1368
+ o[10] || (o[10] = C("p", { class: "sub-title" }, "字体大小", -1))
1369
+ ]),
1370
+ _: 1
1371
+ }),
1372
+ a(f, { span: 12 }, {
1373
+ default: u(() => [
1374
+ a(_, {
1375
+ modelValue: e.value.options.title.x,
1376
+ "onUpdate:modelValue": o[4] || (o[4] = (V) => e.value.options.title.x = V),
1377
+ "controls-position": "right"
1378
+ }, null, 8, ["modelValue"]),
1379
+ o[11] || (o[11] = C("p", { class: "sub-title" }, "横向", -1))
1380
+ ]),
1381
+ _: 1
1382
+ }),
1383
+ a(f, { span: 12 }, {
1384
+ default: u(() => [
1385
+ a(_, {
1386
+ modelValue: e.value.options.title.y,
1387
+ "onUpdate:modelValue": o[5] || (o[5] = (V) => e.value.options.title.y = V),
1388
+ "controls-position": "right"
1389
+ }, null, 8, ["modelValue"]),
1390
+ o[12] || (o[12] = C("p", { class: "sub-title" }, "纵向", -1))
1391
+ ]),
1392
+ _: 1
1393
+ })
1394
+ ]),
1395
+ _: 1
1396
+ })
1397
+ ]),
1398
+ _: 1
1399
+ }),
1400
+ a(b, {
1401
+ title: "图形配置",
1402
+ name: "2"
1403
+ }, {
1404
+ default: u(() => [
1405
+ e.value.options.color && e.value.options.color.length && e.value.type === "pie" ? (d(), S(g, { key: 0 }, {
1406
+ default: u(() => [
1407
+ a(f, { span: 24 }, {
1408
+ default: u(() => [
1409
+ o[13] || (o[13] = C("span", { class: "switch-label" }, "玫瑰图", -1)),
1410
+ a(i, {
1411
+ onChange: n,
1412
+ modelValue: e.value.options.series[0].roseType,
1413
+ "onUpdate:modelValue": o[6] || (o[6] = (V) => e.value.options.series[0].roseType = V)
1414
+ }, null, 8, ["modelValue"])
1415
+ ]),
1416
+ _: 1
1417
+ })
1418
+ ]),
1419
+ _: 1
1420
+ })) : R("", !0)
1421
+ ]),
1422
+ _: 1
1423
+ }),
1424
+ a(b, {
1425
+ title: "图例配置",
1426
+ name: "3"
1427
+ }, {
1428
+ default: u(() => [
1429
+ a(g, null, {
1430
+ default: u(() => [
1431
+ a(f, { span: 24 }, {
1432
+ default: u(() => [
1433
+ o[14] || (o[14] = C("span", { class: "switch-label" }, "显示图例", -1)),
1434
+ e.value.options.legend ? (d(), S(i, {
1435
+ key: 0,
1436
+ modelValue: e.value.options.legend.show,
1437
+ "onUpdate:modelValue": o[7] || (o[7] = (V) => e.value.options.legend.show = V)
1438
+ }, null, 8, ["modelValue"])) : R("", !0)
1439
+ ]),
1440
+ _: 1
1441
+ })
1442
+ ]),
1443
+ _: 1
1444
+ })
1445
+ ]),
1446
+ _: 1
1447
+ })
1448
+ ]),
1449
+ _: 1
1450
+ })
1451
+ ])) : R("", !0);
1452
+ };
1453
+ }
1454
+ });
1455
+ const Et = /* @__PURE__ */ G(Dt, [["__scopeId", "data-v-e9859d3b"]]), Ce = /* @__PURE__ */ k({
1456
+ __name: "SettingDescribe",
1457
+ setup(l) {
1458
+ const t = D(), e = I(() => t.getActiveComponents);
1459
+ return (n, r) => {
1460
+ const o = p("el-input"), s = p("el-form-item"), m = p("el-switch"), i = p("el-input-number"), f = p("el-radio"), c = p("el-radio-group");
1461
+ return d(), h("div", null, [
1462
+ a(s, { label: "标题" }, {
1463
+ default: u(() => [
1464
+ a(o, {
1465
+ modelValue: e.value.options.title,
1466
+ "onUpdate:modelValue": r[0] || (r[0] = (_) => e.value.options.title = _)
1467
+ }, null, 8, ["modelValue"])
1468
+ ]),
1469
+ _: 1
1470
+ }),
1471
+ a(s, { label: "边框" }, {
1472
+ default: u(() => [
1473
+ a(m, {
1474
+ modelValue: e.value.options.border,
1475
+ "onUpdate:modelValue": r[1] || (r[1] = (_) => e.value.options.border = _)
1476
+ }, null, 8, ["modelValue"])
1477
+ ]),
1478
+ _: 1
1479
+ }),
1480
+ a(s, { label: "每行展示数量" }, {
1481
+ default: u(() => [
1482
+ a(i, {
1483
+ modelValue: e.value.options.column,
1484
+ "onUpdate:modelValue": r[2] || (r[2] = (_) => e.value.options.column = _),
1485
+ min: 1,
1486
+ max: 10,
1487
+ controls: !1
1488
+ }, null, 8, ["modelValue"])
1489
+ ]),
1490
+ _: 1
1491
+ }),
1492
+ a(s, { label: "排列方向" }, {
1493
+ default: u(() => [
1494
+ a(c, {
1495
+ modelValue: e.value.options.direction,
1496
+ "onUpdate:modelValue": r[3] || (r[3] = (_) => e.value.options.direction = _)
1497
+ }, {
1498
+ default: u(() => [
1499
+ a(f, { value: "horizontal" }, {
1500
+ default: u(() => r[4] || (r[4] = [
1501
+ E("横向")
1502
+ ])),
1503
+ _: 1
1504
+ }),
1505
+ a(f, { value: "vertical" }, {
1506
+ default: u(() => r[5] || (r[5] = [
1507
+ E("纵向")
1508
+ ])),
1509
+ _: 1
1510
+ })
1511
+ ]),
1512
+ _: 1
1513
+ }, 8, ["modelValue"])
1514
+ ]),
1515
+ _: 1
1516
+ })
1517
+ ]);
1518
+ };
1519
+ }
1520
+ }), At = /* @__PURE__ */ k({
1521
+ __name: "SettingCharts",
1522
+ setup(l) {
1523
+ const t = D(), e = $(!1), n = I(() => t.getActiveComponents), r = [
1524
+ { value: "report-describe", name: "描述列表" },
1525
+ { value: "report-table", name: "表格" },
1526
+ { value: "line", name: "趋势图" },
1527
+ { value: "pie", name: "扇形图" },
1528
+ { value: "bar", name: "柱状图" }
1529
+ ], o = $(""), s = $();
1530
+ async function m(c) {
1531
+ const _ = await me({
1532
+ prod_type: t.prodType,
1533
+ chart_type: c,
1534
+ filter_uuid: t.filterForm.filter_uuid
1535
+ });
1536
+ s.value = _.data;
1537
+ }
1538
+ function i(c) {
1539
+ let _ = s.value.find((b) => b.rp_item_uuid === c);
1540
+ const g = _.rp_item_content;
1541
+ if (_.rp_item_content.type, g.type === "report-table") {
1542
+ const b = {};
1543
+ g.showColumn.forEach((T) => {
1544
+ b[T.key] = !0;
1545
+ }), g.options = { ...g.options, showColumn: b, border: !0, showHeader: !0, stripe: !1 };
1546
+ }
1547
+ g.type === "report-describe" && (g.options = { ...g.options, title: "", border: !0, column: 1, direction: "horizontal", ...n.value.options }), Object.assign(t.activeComponents, g), t.activeComponents.rp_item_uuid = _.rp_item_uuid;
1548
+ }
1549
+ te(async () => {
1550
+ o.value = n.value.type, await m(o.value);
1551
+ });
1552
+ async function f(c) {
1553
+ try {
1554
+ e.value = !0, await m(c), Object.assign(t.activeComponents, Ge(c)), e.value = !1;
1555
+ } catch {
1556
+ e.value = !1;
1557
+ }
1558
+ }
1559
+ return Se(
1560
+ () => n.value,
1561
+ (c) => {
1562
+ console.log(c, "activeComponents"), ~["bar", "pie", "line", "report-table", "report-describe"].indexOf(c.type) && (o.value = n.value.type, m(o.value));
1563
+ }
1564
+ ), (c, _) => {
1565
+ const g = p("el-option"), b = p("el-select"), T = p("el-form-item"), V = p("el-form"), v = ke("loading");
1566
+ return $e((d(), h("div", null, [
1567
+ a(V, { "label-position": "top" }, {
1568
+ default: u(() => [
1569
+ a(T, { label: "图表类型" }, {
1570
+ default: u(() => [
1571
+ a(b, {
1572
+ style: { width: "100%" },
1573
+ modelValue: o.value,
1574
+ "onUpdate:modelValue": _[0] || (_[0] = (x) => o.value = x),
1575
+ onChange: f
1576
+ }, {
1577
+ default: u(() => [
1578
+ (d(), h(A, null, z(r, (x, F) => a(g, {
1579
+ key: F,
1580
+ label: x.name,
1581
+ value: x.value
1582
+ }, null, 8, ["label", "value"])), 64))
1583
+ ]),
1584
+ _: 1
1585
+ }, 8, ["modelValue"])
1586
+ ]),
1587
+ _: 1
1588
+ }),
1589
+ a(T, { label: "组件库" }, {
1590
+ default: u(() => [
1591
+ a(b, {
1592
+ style: { width: "100%" },
1593
+ modelValue: y(t).activeComponents.rp_item_uuid,
1594
+ "onUpdate:modelValue": _[1] || (_[1] = (x) => y(t).activeComponents.rp_item_uuid = x),
1595
+ onChange: i
1596
+ }, {
1597
+ default: u(() => [
1598
+ (d(!0), h(A, null, z(s.value, (x, F) => (d(), S(g, {
1599
+ key: F,
1600
+ label: x.rp_item_name,
1601
+ value: x.rp_item_uuid
1602
+ }, null, 8, ["label", "value"]))), 128))
1603
+ ]),
1604
+ _: 1
1605
+ }, 8, ["modelValue"])
1606
+ ]),
1607
+ _: 1
1608
+ }),
1609
+ o.value === "report-table" && n.value.options.showColumn ? (d(), S(he, { key: 0 })) : R("", !0),
1610
+ o.value === "pie" || o.value === "bar" || o.value === "line" ? (d(), S(Et, { key: 1 })) : R("", !0),
1611
+ o.value === "report-describe" ? (d(), S(Ce, { key: 2 })) : R("", !0)
1612
+ ]),
1613
+ _: 1
1614
+ })
1615
+ ])), [
1616
+ [v, e.value]
1617
+ ]);
1618
+ };
1619
+ }
1620
+ }), Ft = { key: 0 }, It = { style: { border: "1px solid #ccc", "border-radius": "3px" } }, ae = "default", zt = /* @__PURE__ */ k({
1621
+ __name: "SettingText",
1622
+ setup(l) {
1623
+ const t = D(), e = Te(), n = $();
1624
+ function r(c) {
1625
+ const _ = n.value.find((g) => g.rp_item_uuid === c);
1626
+ t.activeComponents.uri = _.rp_item_content.uri, e.value.setHtml((_ == null ? void 0 : _.rp_item_content.data) || "");
1627
+ }
1628
+ async function o() {
1629
+ const c = await me({ prod_type: t.prodType, chart_type: "p", filter_uuid: t.filterForm.filter_uuid });
1630
+ n.value = c.data;
1631
+ }
1632
+ o();
1633
+ const s = {
1634
+ toolbarKeys: [
1635
+ "bold",
1636
+ "underline",
1637
+ "italic",
1638
+ "through",
1639
+ "code",
1640
+ "bulletedList",
1641
+ // 无序列表
1642
+ "numberedList",
1643
+ // 有序列表
1644
+ "clearStyle",
1645
+ "color",
1646
+ "bgColor",
1647
+ "fontSize",
1648
+ "fontFamily",
1649
+ "justifyLeft",
1650
+ "justifyRight",
1651
+ "justifyCenter",
1652
+ "justifyJustify",
1653
+ "lineHeight"
1654
+ ]
1655
+ }, m = { placeholder: "请输入内容..." }, i = (c) => {
1656
+ e.value = c;
1657
+ }, f = (c) => {
1658
+ };
1659
+ return Le(() => {
1660
+ const c = e.value;
1661
+ c != null && c.destroy();
1662
+ }), (c, _) => {
1663
+ const g = p("el-option"), b = p("el-select"), T = p("el-form-item"), V = p("el-form");
1664
+ return y(t).activeComponents.id ? (d(), h("div", Ft, [
1665
+ a(V, { "label-position": "top" }, {
1666
+ default: u(() => [
1667
+ a(T, { label: "组件库" }, {
1668
+ default: u(() => [
1669
+ a(b, {
1670
+ style: { width: "100%" },
1671
+ modelValue: y(t).activeComponents.rp_item_uuid,
1672
+ "onUpdate:modelValue": _[0] || (_[0] = (v) => y(t).activeComponents.rp_item_uuid = v),
1673
+ onChange: r
1674
+ }, {
1675
+ default: u(() => [
1676
+ (d(!0), h(A, null, z(n.value, (v, x) => (d(), S(g, {
1677
+ key: x,
1678
+ label: v.rp_item_name,
1679
+ value: v.rp_item_uuid
1680
+ }, null, 8, ["label", "value"]))), 128))
1681
+ ]),
1682
+ _: 1
1683
+ }, 8, ["modelValue"])
1684
+ ]),
1685
+ _: 1
1686
+ }),
1687
+ a(T, { label: "文本内容" }, {
1688
+ default: u(() => [
1689
+ C("div", It, [
1690
+ a(y(ze), {
1691
+ style: { "border-bottom": "1px solid #ccc" },
1692
+ editor: e.value,
1693
+ "default-config": s,
1694
+ mode: ae
1695
+ }, null, 8, ["editor"]),
1696
+ a(y(He), {
1697
+ style: { height: "500px", "overflow-y": "hidden" },
1698
+ onOnChange: f,
1699
+ modelValue: y(t).activeComponents.data,
1700
+ "onUpdate:modelValue": _[1] || (_[1] = (v) => y(t).activeComponents.data = v),
1701
+ "default-config": m,
1702
+ mode: ae,
1703
+ onOnCreated: i
1704
+ }, null, 8, ["modelValue"])
1705
+ ])
1706
+ ]),
1707
+ _: 1
1708
+ })
1709
+ ]),
1710
+ _: 1
1711
+ })
1712
+ ])) : R("", !0);
1713
+ };
1714
+ }
1715
+ }), Ht = /* @__PURE__ */ k({
1716
+ __name: "SettingFilter",
1717
+ setup(l) {
1718
+ const t = $([]), e = D();
1719
+ async function n() {
1720
+ const r = await tt({ prod_type: e.prodType });
1721
+ t.value = r.data;
1722
+ }
1723
+ return n(), (r, o) => {
1724
+ const s = p("el-option"), m = p("el-select"), i = p("el-form-item"), f = p("el-checkbox"), c = p("el-form");
1725
+ return d(), S(c, {
1726
+ "label-width": "80px",
1727
+ "label-position": "top"
1728
+ }, {
1729
+ default: u(() => [
1730
+ a(i, { label: "筛选条件" }, {
1731
+ default: u(() => [
1732
+ a(m, {
1733
+ modelValue: y(e).filterForm.filter_uuid,
1734
+ "onUpdate:modelValue": o[0] || (o[0] = (_) => y(e).filterForm.filter_uuid = _),
1735
+ disabled: !!y(e).filterForm.filter_uuid
1736
+ }, {
1737
+ default: u(() => [
1738
+ (d(!0), h(A, null, z(t.value, (_) => (d(), S(s, {
1739
+ key: _.filter_uuid,
1740
+ label: _.filter_name,
1741
+ value: _.filter_uuid
1742
+ }, null, 8, ["label", "value"]))), 128))
1743
+ ]),
1744
+ _: 1
1745
+ }, 8, ["modelValue", "disabled"])
1746
+ ]),
1747
+ _: 1
1748
+ }),
1749
+ a(i, null, {
1750
+ default: u(() => [
1751
+ a(f, {
1752
+ modelValue: y(e).filterForm.range_time,
1753
+ "onUpdate:modelValue": o[1] || (o[1] = (_) => y(e).filterForm.range_time = _),
1754
+ "true-value": 1,
1755
+ "false-value": 0,
1756
+ label: "时间范围"
1757
+ }, null, 8, ["modelValue"])
1758
+ ]),
1759
+ _: 1
1760
+ })
1761
+ ]),
1762
+ _: 1
1763
+ });
1764
+ };
1765
+ }
1766
+ }), Mt = /* @__PURE__ */ k({
1767
+ __name: "SettingTitle",
1768
+ setup(l) {
1769
+ const t = D();
1770
+ return (e, n) => {
1771
+ const r = p("el-input"), o = p("el-form-item"), s = p("el-color-picker"), m = p("el-col"), i = p("el-input-number"), f = p("el-option"), c = p("el-select"), _ = p("el-row"), g = p("el-form");
1772
+ return d(), S(g, {
1773
+ "label-width": "auto",
1774
+ "label-position": "top"
1775
+ }, {
1776
+ default: u(() => [
1777
+ a(o, { label: "名称" }, {
1778
+ default: u(() => [
1779
+ a(r, {
1780
+ modelValue: y(t).activeComponents.data,
1781
+ "onUpdate:modelValue": n[0] || (n[0] = (b) => y(t).activeComponents.data = b),
1782
+ placeholder: "Please input",
1783
+ maxlength: "24",
1784
+ "show-word-limit": ""
1785
+ }, null, 8, ["modelValue"])
1786
+ ]),
1787
+ _: 1
1788
+ }),
1789
+ a(o, { label: "样式" }, {
1790
+ default: u(() => [
1791
+ a(_, { gutter: 20 }, {
1792
+ default: u(() => [
1793
+ a(m, { span: 12 }, {
1794
+ default: u(() => [
1795
+ a(s, {
1796
+ modelValue: y(t).activeComponents.options.color,
1797
+ "onUpdate:modelValue": n[1] || (n[1] = (b) => y(t).activeComponents.options.color = b),
1798
+ "show-alpha": ""
1799
+ }, null, 8, ["modelValue"]),
1800
+ n[7] || (n[7] = C("p", { class: "sub-title" }, "颜色", -1))
1801
+ ]),
1802
+ _: 1
1803
+ }),
1804
+ a(m, { span: 12 }, {
1805
+ default: u(() => [
1806
+ a(i, {
1807
+ modelValue: y(t).activeComponents.options.size,
1808
+ "onUpdate:modelValue": n[2] || (n[2] = (b) => y(t).activeComponents.options.size = b),
1809
+ "controls-position": "right"
1810
+ }, null, 8, ["modelValue"]),
1811
+ n[8] || (n[8] = C("p", { class: "sub-title" }, "字体大小", -1))
1812
+ ]),
1813
+ _: 1
1814
+ }),
1815
+ a(m, { span: 12 }, {
1816
+ default: u(() => [
1817
+ a(c, {
1818
+ modelValue: y(t).activeComponents.options.fontWeight,
1819
+ "onUpdate:modelValue": n[3] || (n[3] = (b) => y(t).activeComponents.options.fontWeight = b)
1820
+ }, {
1821
+ default: u(() => [
1822
+ a(f, {
1823
+ label: "常规",
1824
+ value: 500
1825
+ }),
1826
+ a(f, {
1827
+ label: "加粗",
1828
+ value: 600
1829
+ })
1830
+ ]),
1831
+ _: 1
1832
+ }, 8, ["modelValue"]),
1833
+ n[9] || (n[9] = C("p", { class: "sub-title" }, "字体粗细", -1))
1834
+ ]),
1835
+ _: 1
1836
+ }),
1837
+ a(m, { span: 12 }, {
1838
+ default: u(() => [
1839
+ a(i, {
1840
+ modelValue: y(t).activeComponents.options.letterSpacing,
1841
+ "onUpdate:modelValue": n[4] || (n[4] = (b) => y(t).activeComponents.options.letterSpacing = b),
1842
+ "controls-position": "right"
1843
+ }, null, 8, ["modelValue"]),
1844
+ n[10] || (n[10] = C("p", { class: "sub-title" }, "字间距", -1))
1845
+ ]),
1846
+ _: 1
1847
+ }),
1848
+ a(m, { span: 12 }, {
1849
+ default: u(() => [
1850
+ a(i, {
1851
+ modelValue: y(t).activeComponents.options.textIndent,
1852
+ "onUpdate:modelValue": n[5] || (n[5] = (b) => y(t).activeComponents.options.textIndent = b),
1853
+ "controls-position": "right"
1854
+ }, null, 8, ["modelValue"]),
1855
+ n[11] || (n[11] = C("p", { class: "sub-title" }, "首行缩进", -1))
1856
+ ]),
1857
+ _: 1
1858
+ }),
1859
+ a(m, { span: 12 }, {
1860
+ default: u(() => [
1861
+ a(c, {
1862
+ modelValue: y(t).activeComponents.options.textAlign,
1863
+ "onUpdate:modelValue": n[6] || (n[6] = (b) => y(t).activeComponents.options.textAlign = b)
1864
+ }, {
1865
+ default: u(() => [
1866
+ a(f, {
1867
+ label: "左对齐",
1868
+ value: "left"
1869
+ }),
1870
+ a(f, {
1871
+ label: "居中对齐",
1872
+ value: "center"
1873
+ }),
1874
+ a(f, {
1875
+ label: "右对齐",
1876
+ value: "right"
1877
+ })
1878
+ ]),
1879
+ _: 1
1880
+ }, 8, ["modelValue"]),
1881
+ n[12] || (n[12] = C("p", { class: "sub-title" }, "位置", -1))
1882
+ ]),
1883
+ _: 1
1884
+ })
1885
+ ]),
1886
+ _: 1
1887
+ })
1888
+ ]),
1889
+ _: 1
1890
+ })
1891
+ ]),
1892
+ _: 1
1893
+ });
1894
+ };
1895
+ }
1896
+ });
1897
+ const jt = /* @__PURE__ */ G(Mt, [["__scopeId", "data-v-56fef84c"]]), Pt = /* @__PURE__ */ k({
1898
+ __name: "Setting",
1899
+ setup(l) {
1900
+ const t = {
1901
+ SettingTable: he,
1902
+ SettingCharts: At,
1903
+ SettingDescribe: Ce,
1904
+ SettingText: zt,
1905
+ SettingFilter: Ht,
1906
+ SettingTitle: jt
1907
+ }, e = D(), n = I(() => e.activeComponents), r = ["h1", "h2", "h3", "h4"], o = ["p"], s = ["report-table", "bar", "line", "pie", "report-describe"], m = (i) => r.includes(i) ? H(t, "SettingTitle") : o.includes(i) ? H(t, "SettingText") : s.includes(i) ? H(t, "SettingCharts") : i === "filter" ? H(t, "SettingFilter") : "DefaultEditor";
1908
+ return (i, f) => {
1909
+ const c = p("el-card");
1910
+ return d(), S(c, { class: "config-wrapper" }, {
1911
+ default: u(() => [
1912
+ (d(), S(Y(m(n.value.type))))
1913
+ ]),
1914
+ _: 1
1915
+ });
1916
+ };
1917
+ }
1918
+ }), Bt = { class: "editor-wrapper flex start" }, Wt = { class: "flex" }, Nt = { class: "btn-group" }, Ot = /* @__PURE__ */ k({
1919
+ __name: "index",
1920
+ props: /* @__PURE__ */ ue({
1921
+ reportId: {
1922
+ type: String,
1923
+ default: ""
1924
+ }
1925
+ }, {
1926
+ modelValue: {},
1927
+ modelModifiers: {}
1928
+ }),
1929
+ emits: ["update:modelValue"],
1930
+ setup(l) {
1931
+ const t = D(), e = l, n = pe(l, "modelValue"), r = (i) => {
1932
+ const f = q(i);
1933
+ f.id = B(), t.componentList.push(f);
1934
+ };
1935
+ function o() {
1936
+ n.value = "table";
1937
+ }
1938
+ function s() {
1939
+ t.getReportDemo(e.reportId);
1940
+ }
1941
+ te(() => {
1942
+ s();
1943
+ });
1944
+ async function m() {
1945
+ if (!t.filterForm.filter_uuid) {
1946
+ Fe.error("请选择筛选条件");
1947
+ return;
1948
+ }
1949
+ try {
1950
+ e.reportId ? await Ze({
1951
+ report_uuid: e.reportId,
1952
+ data: {
1953
+ report_name: t.titleComponent.data,
1954
+ prod_type: t.prodType,
1955
+ content: [...t.notDraggableList, t.titleComponent, ...t.componentList],
1956
+ ...t.filterForm
1957
+ }
1958
+ }) : await Xe({
1959
+ data: {
1960
+ report_name: t.titleComponent.data,
1961
+ prod_type: t.prodType,
1962
+ content: [...t.notDraggableList, t.titleComponent, ...t.componentList],
1963
+ ...t.filterForm
1964
+ }
1965
+ }), o();
1966
+ } catch (i) {
1967
+ console.log(i, "error");
1968
+ }
1969
+ }
1970
+ return Re(() => {
1971
+ t.clearComponents();
1972
+ }), (i, f) => {
1973
+ const c = p("el-button"), _ = p("el-button-group"), g = p("el-card");
1974
+ return d(), h("div", Bt, [
1975
+ a(g, { class: "view-wrapper" }, {
1976
+ default: u(() => [
1977
+ C("div", Wt, [
1978
+ C("div", Nt, [
1979
+ a(_, null, {
1980
+ default: u(() => [
1981
+ (d(!0), h(A, null, z(y(qe), (b) => (d(), h(A, {
1982
+ key: b.type
1983
+ }, [
1984
+ b != null && b.hide ? R("", !0) : (d(), S(c, {
1985
+ key: 0,
1986
+ onClick: (T) => r(b)
1987
+ }, {
1988
+ default: u(() => [
1989
+ E(W(b.name), 1)
1990
+ ]),
1991
+ _: 2
1992
+ }, 1032, ["onClick"]))
1993
+ ], 64))), 128))
1994
+ ]),
1995
+ _: 1
1996
+ })
1997
+ ]),
1998
+ a(_, null, {
1999
+ default: u(() => [
2000
+ a(c, {
2001
+ type: "primary",
2002
+ onClick: m
2003
+ }, {
2004
+ default: u(() => f[0] || (f[0] = [
2005
+ E("保存")
2006
+ ])),
2007
+ _: 1
2008
+ }),
2009
+ a(c, { onClick: o }, {
2010
+ default: u(() => f[1] || (f[1] = [
2011
+ E("退出")
2012
+ ])),
2013
+ _: 1
2014
+ })
2015
+ ]),
2016
+ _: 1
2017
+ })
2018
+ ]),
2019
+ a(kt)
2020
+ ]),
2021
+ _: 1
2022
+ }),
2023
+ a(Pt)
2024
+ ]);
2025
+ };
2026
+ }
2027
+ }), Yt = {
2028
+ class: "table-box"
2029
+ }, qt = /* @__PURE__ */ k({
2030
+ __name: "Report",
2031
+ emits: ["click"],
2032
+ setup(l, {
2033
+ emit: t
2034
+ }) {
2035
+ const e = D(), n = I(() => ({
2036
+ prod_type: e.prodType
2037
+ })), r = $(), o = t, s = (g) => {
2038
+ o("click", g.report_uuid, "review");
2039
+ }, m = (g) => {
2040
+ o("click", g.report_uuid, "editor");
2041
+ }, i = () => {
2042
+ o("click", "", "editor");
2043
+ }, f = (g) => {
2044
+ console.log(g);
2045
+ }, c = (g) => {
2046
+ window.$messageBox("确定要删除吗?", "", "温馨提示", "error").then(async () => {
2047
+ await ot({
2048
+ report_uuids: g
2049
+ }), r.value.getTableList();
2050
+ });
2051
+ }, _ = Ue([
2052
+ // { type: 'selection', fixed: 'left', width: 70 },
2053
+ {
2054
+ type: "selection",
2055
+ width: 80
2056
+ },
2057
+ {
2058
+ field: "report_name",
2059
+ name: "名称",
2060
+ search: {
2061
+ type: "input"
2062
+ }
2063
+ },
2064
+ {
2065
+ field: "report_desc",
2066
+ name: "报表描述"
2067
+ },
2068
+ {
2069
+ field: "create_time",
2070
+ name: "创建时间"
2071
+ },
2072
+ {
2073
+ field: "operation",
2074
+ width: 140,
2075
+ name: "操作",
2076
+ align: "center",
2077
+ fixed: "right",
2078
+ render: (g) => a("div", null, [a(p("el-button"), {
2079
+ link: !0,
2080
+ type: "primary",
2081
+ class: "custom-btn",
2082
+ icon: "View",
2083
+ title: "预览",
2084
+ onClick: () => s(g.row)
2085
+ }, null), a(p("el-button"), {
2086
+ link: !0,
2087
+ type: "primary",
2088
+ class: "custom-btn",
2089
+ icon: "Edit",
2090
+ title: "编辑",
2091
+ onClick: () => m(g.row)
2092
+ }, null), a(p("el-button"), {
2093
+ link: !0,
2094
+ type: "danger",
2095
+ icon: "Delete",
2096
+ title: "删除",
2097
+ onClick: () => c([g.row.report_uuid])
2098
+ }, null)])
2099
+ }
2100
+ ]);
2101
+ return (g, b) => {
2102
+ const T = p("el-button"), V = p("TdsTable");
2103
+ return d(), h("div", Yt, [a(V, {
2104
+ ref_key: "proTable",
2105
+ ref: r,
2106
+ columns: _,
2107
+ "request-api": y(et),
2108
+ "init-param": n.value,
2109
+ "row-key": "report_uuid",
2110
+ options: g.$tableOptions(),
2111
+ "search-col": 6,
2112
+ onSelectionChange: f
2113
+ }, {
2114
+ tableHeader: u((v) => [a(T, {
2115
+ plain: "",
2116
+ type: "primary",
2117
+ class: "custom-btn",
2118
+ icon: "Plus",
2119
+ onClick: i
2120
+ }, {
2121
+ default: u(() => b[0] || (b[0] = [E("添加")])),
2122
+ _: 1
2123
+ }), a(T, {
2124
+ plain: "",
2125
+ type: "danger",
2126
+ icon: "Delete",
2127
+ onClick: (x) => c(v.selectedListIds)
2128
+ }, {
2129
+ default: u(() => b[1] || (b[1] = [E("删除")])),
2130
+ _: 2
2131
+ }, 1032, ["onClick"])]),
2132
+ _: 1
2133
+ }, 8, ["columns", "request-api", "init-param", "options"])]);
2134
+ };
2135
+ }
2136
+ });
2137
+ const Gt = { style: { height: "100%" } }, Jt = /* @__PURE__ */ k({
3
2138
  name: "TCReport",
4
2139
  __name: "index",
5
- setup(e) {
6
- return c(), c("table"), (t, o) => (r(), p("div", l, "11111"));
2140
+ setup(l) {
2141
+ const t = $(), e = $("table"), n = (r, o) => {
2142
+ t.value = r, e.value = o;
2143
+ };
2144
+ return (r, o) => (d(), h("div", Gt, [
2145
+ a(De, { name: "slide-fade" }, {
2146
+ default: u(() => [
2147
+ e.value === "table" ? (d(), S(qt, {
2148
+ key: 0,
2149
+ onClick: n
2150
+ })) : R("", !0),
2151
+ e.value === "review" ? (d(), S(ht, {
2152
+ key: 1,
2153
+ "report-id": t.value,
2154
+ modelValue: e.value,
2155
+ "onUpdate:modelValue": o[0] || (o[0] = (s) => e.value = s)
2156
+ }, null, 8, ["report-id", "modelValue"])) : R("", !0),
2157
+ e.value === "editor" ? (d(), S(Ot, {
2158
+ key: 2,
2159
+ "report-id": t.value,
2160
+ modelValue: e.value,
2161
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => e.value = s)
2162
+ }, null, 8, ["report-id", "modelValue"])) : R("", !0)
2163
+ ]),
2164
+ _: 1
2165
+ })
2166
+ ]));
7
2167
  }
8
- }), f = (e, t) => {
9
- if (e.install = (o) => {
10
- for (const n of [e, ...Object.values(t ?? {})])
11
- o.component(n.name, n);
2168
+ });
2169
+ const Kt = (l, t) => {
2170
+ if (l.install = (e) => {
2171
+ for (const n of [l, ...Object.values(t ?? {})])
2172
+ e.component(n.name, n);
12
2173
  }, t)
13
- for (const [o, n] of Object.entries(t))
14
- e[o] = n;
15
- return e;
16
- }, a = f(m), i = {
17
- TCReport: a
18
- }, h = {
19
- install(e) {
20
- Object.entries(i).forEach(([t, o]) => {
21
- e.component(t, o);
2174
+ for (const [e, n] of Object.entries(t))
2175
+ l[e] = n;
2176
+ return l;
2177
+ }, Qt = Kt(Jt), Xt = {
2178
+ TCReport: Qt
2179
+ }, no = {
2180
+ install(l, t) {
2181
+ Object.entries(Xt).forEach(([n, r]) => {
2182
+ l.component(n, r);
22
2183
  });
2184
+ const e = D();
2185
+ t.prodType && e.setProdType(t.prodType), t.envURL && e.setEnvURL(t.envURL);
23
2186
  }
24
2187
  };
25
2188
  export {
26
- a as TCReport,
27
- h as default
2189
+ Qt as TCReport,
2190
+ no as default
28
2191
  };