@topdatasec/report 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/t-report-ui.es.js +130 -123
- package/lib/t-report-ui.umd.js +2 -2
- package/package.json +1 -1
package/lib/t-report-ui.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as T, computed as q, resolveComponent as s, openBlock as _, createElementBlock as x, createElementVNode as V, Fragment as
|
|
1
|
+
import { defineComponent as T, computed as q, resolveComponent as s, openBlock as _, createElementBlock as x, createElementVNode as V, Fragment as D, renderList as I, normalizeClass as O, createBlock as L, createCommentVNode as U, toDisplayString as B, ref as S, createVNode as l, withCtx as p, onMounted as oe, normalizeProps as pe, guardReactiveProps as de, isVNode as le, normalizeStyle as Le, mergeModels as ce, useModel as me, resolveDirective as _e, withDirectives as fe, unref as h, createTextVNode as R, resolveDynamicComponent as W, isRef as Re, withModifiers as Ue, watch as Ee, shallowRef as Ae, onBeforeUnmount as Fe, onUnmounted as De, reactive as Y, TransitionGroup as qe, mergeProps as ve } from "vue";
|
|
2
2
|
import { defineStore as Ie, storeToRefs as ze } from "pinia";
|
|
3
3
|
import { ElMessage as He } from "element-plus";
|
|
4
4
|
import { VueDraggable as Be } from "vue-draggable-plus";
|
|
5
5
|
import { Toolbar as je, Editor as Pe } from "@wangeditor/editor-for-vue";
|
|
6
6
|
import { CircleClose as Me } from "@element-plus/icons-vue";
|
|
7
7
|
import { TdsTable as Oe, TdsForm as Ne } from "topdatasec-ui";
|
|
8
|
-
const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math.random().toString(36).substring(2, 9),
|
|
8
|
+
const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math.random().toString(36).substring(2, 9), K = (o) => JSON.parse(JSON.stringify(o)), We = (o) => o.replace(/-([a-z])/g, (t, e) => e.toUpperCase()).replace(/^[a-z]/, (t) => t.toUpperCase()), H = (o, t) => o[We(t)], Ye = (o) => window.$http.request({
|
|
9
9
|
url: `${window.$reportURL}/tds/report/demo/get`,
|
|
10
10
|
method: "get",
|
|
11
11
|
params: o,
|
|
@@ -104,7 +104,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
104
104
|
containLabel: !0
|
|
105
105
|
};
|
|
106
106
|
return o && (t.top = "5%"), t;
|
|
107
|
-
},
|
|
107
|
+
}, F = [
|
|
108
108
|
"46, 145, 255",
|
|
109
109
|
"48, 212, 183",
|
|
110
110
|
"108, 108, 255",
|
|
@@ -130,7 +130,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
130
130
|
t.forEach((i) => {
|
|
131
131
|
r.push(i[a.name]), n.push(i[a.value]);
|
|
132
132
|
}), o.xAxis[0].data = r, o.series[0].data = n, o.series[0].name = e, o.series[1].data = n, o.series[2].data = n;
|
|
133
|
-
},
|
|
133
|
+
}, J = (o = [
|
|
134
134
|
{
|
|
135
135
|
name: "数据1",
|
|
136
136
|
value: 63
|
|
@@ -246,7 +246,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
246
246
|
type: "bar",
|
|
247
247
|
barWidth: 15,
|
|
248
248
|
barGap: "0%",
|
|
249
|
-
itemStyle: e(`rgba(${
|
|
249
|
+
itemStyle: e(`rgba(${F[0]}, 0.7)`, `rgba(${F[0]}, 0.2)`),
|
|
250
250
|
data: a,
|
|
251
251
|
label: {
|
|
252
252
|
show: !0,
|
|
@@ -266,7 +266,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
266
266
|
symbolSize: [15, 10],
|
|
267
267
|
//调整截面形状
|
|
268
268
|
symbolOffset: [0, 5],
|
|
269
|
-
itemStyle: e(`rgba(${
|
|
269
|
+
itemStyle: e(`rgba(${F[0]}, 0.7)`, `rgba(${F[0]}, 0.2)`),
|
|
270
270
|
data: a
|
|
271
271
|
},
|
|
272
272
|
{
|
|
@@ -277,7 +277,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
277
277
|
//调整截面形状
|
|
278
278
|
symbolOffset: [0, -5],
|
|
279
279
|
symbolPosition: "end",
|
|
280
|
-
itemStyle: e(`rgba(${
|
|
280
|
+
itemStyle: e(`rgba(${F[0]}, 0.9)`, `rgba(${F[0]}, 1)`),
|
|
281
281
|
data: a
|
|
282
282
|
}
|
|
283
283
|
]
|
|
@@ -289,7 +289,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
289
289
|
value: Number(n[e.value])
|
|
290
290
|
}));
|
|
291
291
|
o.legend.data = r, o.series[0].data = r, o.graphic[1].style.text = a;
|
|
292
|
-
}, mt = () =>
|
|
292
|
+
}, mt = () => F.map((o) => `rgba(${o}, 1)`), ne = ({
|
|
293
293
|
data: o = [
|
|
294
294
|
{
|
|
295
295
|
name: "数据1",
|
|
@@ -462,12 +462,12 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
462
462
|
smooth: !0,
|
|
463
463
|
lineStyle: {
|
|
464
464
|
width: 1,
|
|
465
|
-
color: `rgba(${
|
|
465
|
+
color: `rgba(${F[0]}, 1)`
|
|
466
466
|
// 线条颜色
|
|
467
467
|
},
|
|
468
468
|
showSymbol: !1,
|
|
469
469
|
itemStyle: {
|
|
470
|
-
color: `rgba(${
|
|
470
|
+
color: `rgba(${F[0]}, 1)`,
|
|
471
471
|
//拐点颜色
|
|
472
472
|
label: {
|
|
473
473
|
show: !0,
|
|
@@ -490,18 +490,18 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
490
490
|
// 渐变颜色
|
|
491
491
|
{
|
|
492
492
|
offset: 0,
|
|
493
|
-
color: `rgba(${
|
|
493
|
+
color: `rgba(${F[0]}, 0.7)`
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
offset: 1,
|
|
497
|
-
color: `rgba(${
|
|
497
|
+
color: `rgba(${F[0]}, 0.1)`
|
|
498
498
|
}
|
|
499
499
|
],
|
|
500
500
|
global: !1
|
|
501
501
|
}
|
|
502
502
|
},
|
|
503
503
|
data: []
|
|
504
|
-
}),
|
|
504
|
+
}), G = (o = [
|
|
505
505
|
{
|
|
506
506
|
name: "2024-08",
|
|
507
507
|
value: 63
|
|
@@ -576,23 +576,23 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
576
576
|
}, a = ft(), r = [];
|
|
577
577
|
if (Array.isArray(t.value))
|
|
578
578
|
t.value.forEach((n, i) => {
|
|
579
|
-
const v =
|
|
580
|
-
v.name = n.name, v.lineStyle.color = `rgba(${
|
|
579
|
+
const v = K(a);
|
|
580
|
+
v.name = n.name, v.lineStyle.color = `rgba(${F[i]}, 1)`, v.itemStyle.color = `rgba(${F[i]}, 1)`, v.areaStyle.color.colorStops[0].color = `rgba(${F[i]}, 0.7)`, v.areaStyle.color.colorStops[1].color = `rgba(${F[i]}, 0.1)`, v.data = o.map((d) => d[n.value]), r.push(v);
|
|
581
581
|
});
|
|
582
582
|
else if (typeof t.value == "string") {
|
|
583
|
-
const n =
|
|
583
|
+
const n = K(a);
|
|
584
584
|
n.data = o.map((i) => i[t.value]), r.push(n);
|
|
585
585
|
}
|
|
586
586
|
return e.series = r, e;
|
|
587
|
-
},
|
|
587
|
+
}, ae = [
|
|
588
588
|
{ key: "assets", name: "资产名称" },
|
|
589
589
|
{ key: "type", name: "资产类型" },
|
|
590
590
|
{ key: "data", name: "资产数据" }
|
|
591
|
-
],
|
|
591
|
+
], re = [
|
|
592
592
|
{ assets: "name1", type: "type1", data: "data1" },
|
|
593
593
|
{ assets: "name2", type: "type2", data: "data2" },
|
|
594
594
|
{ assets: "name3", type: "type3", data: "data3" }
|
|
595
|
-
],
|
|
595
|
+
], X = [
|
|
596
596
|
{ data: [{ name: "默认数据", value: 180 }], label: "name1" },
|
|
597
597
|
{ data: [{ name: "默认数据", value: 311 }], label: "name2" },
|
|
598
598
|
{ data: [{ name: "默认数据", value: 42 }], label: "name3" },
|
|
@@ -675,8 +675,8 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
675
675
|
},
|
|
676
676
|
{
|
|
677
677
|
type: "report-table",
|
|
678
|
-
data:
|
|
679
|
-
showColumn:
|
|
678
|
+
data: re,
|
|
679
|
+
showColumn: ae,
|
|
680
680
|
name: "表格",
|
|
681
681
|
options: {
|
|
682
682
|
showColumn: {
|
|
@@ -738,8 +738,8 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
738
738
|
{ type: "p", data: "正文", name: "正文", rp_item_uuid: "", id: "" },
|
|
739
739
|
{
|
|
740
740
|
type: "report-table",
|
|
741
|
-
data:
|
|
742
|
-
showColumn:
|
|
741
|
+
data: re,
|
|
742
|
+
showColumn: ae,
|
|
743
743
|
name: "表格",
|
|
744
744
|
options: {
|
|
745
745
|
border: !0,
|
|
@@ -756,29 +756,29 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
756
756
|
},
|
|
757
757
|
{
|
|
758
758
|
type: "bar",
|
|
759
|
-
data:
|
|
759
|
+
data: X,
|
|
760
760
|
showColumn: [{ key: "label", value: "data" }],
|
|
761
761
|
name: "图表",
|
|
762
|
-
options:
|
|
762
|
+
options: J(),
|
|
763
763
|
rp_item_uuid: "",
|
|
764
764
|
id: ""
|
|
765
765
|
}
|
|
766
766
|
], gt = (o) => ({
|
|
767
767
|
bar: {
|
|
768
768
|
type: "bar",
|
|
769
|
-
data:
|
|
769
|
+
data: X,
|
|
770
770
|
showColumn: [{ key: "label", value: "data" }],
|
|
771
771
|
name: "图表",
|
|
772
|
-
options:
|
|
772
|
+
options: J(),
|
|
773
773
|
rp_item_uuid: "",
|
|
774
774
|
id: ""
|
|
775
775
|
},
|
|
776
776
|
line: {
|
|
777
777
|
type: "line",
|
|
778
|
-
data:
|
|
778
|
+
data: X,
|
|
779
779
|
showColumn: [{ key: "label", value: "data" }],
|
|
780
780
|
name: "图表",
|
|
781
|
-
options:
|
|
781
|
+
options: G(),
|
|
782
782
|
rp_item_uuid: "",
|
|
783
783
|
id: ""
|
|
784
784
|
},
|
|
@@ -787,14 +787,14 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
787
787
|
data: vt,
|
|
788
788
|
showColumn: [{ key: "label", value: "data" }],
|
|
789
789
|
name: "图表",
|
|
790
|
-
options:
|
|
790
|
+
options: ne({ isLegend: !0 }),
|
|
791
791
|
rp_item_uuid: "",
|
|
792
792
|
id: ""
|
|
793
793
|
},
|
|
794
794
|
"report-table": {
|
|
795
795
|
type: "report-table",
|
|
796
|
-
data:
|
|
797
|
-
showColumn:
|
|
796
|
+
data: re,
|
|
797
|
+
showColumn: ae,
|
|
798
798
|
name: "表格",
|
|
799
799
|
options: {
|
|
800
800
|
showColumn: {
|
|
@@ -830,7 +830,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
830
830
|
},
|
|
831
831
|
async getReportDemo(o) {
|
|
832
832
|
let t = [];
|
|
833
|
-
o ? t = (await Ye({ report_uuid: o })).data : t = { content:
|
|
833
|
+
o ? t = (await Ye({ report_uuid: o })).data : t = { content: K(bt), range_time: 1 };
|
|
834
834
|
const e = [];
|
|
835
835
|
t.content.forEach((a) => {
|
|
836
836
|
(a.type === "report-select" || a.type === "range-time") && e.push(a), a.type === "h1" && (this.titleComponent = a), a.id = P();
|
|
@@ -857,7 +857,7 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
857
857
|
const n = s("el-divider");
|
|
858
858
|
return _(), x("div", ht, [
|
|
859
859
|
r[0] || (r[0] = V("div", { class: "cata-title el-anchor__link" }, "目录", -1)),
|
|
860
|
-
(_(!0), x(
|
|
860
|
+
(_(!0), x(D, null, I(e.value, (i) => (_(), x("div", {
|
|
861
861
|
class: O("level" + i.type),
|
|
862
862
|
key: i.value
|
|
863
863
|
}, [
|
|
@@ -875,12 +875,12 @@ const P = () => (/* @__PURE__ */ new Date()).getTime().toString(36) + "-" + Math
|
|
|
875
875
|
};
|
|
876
876
|
}
|
|
877
877
|
});
|
|
878
|
-
const
|
|
878
|
+
const Q = (o, t) => {
|
|
879
879
|
const e = o.__vccOpts || o;
|
|
880
880
|
for (const [a, r] of t)
|
|
881
881
|
e[a] = r;
|
|
882
882
|
return e;
|
|
883
|
-
}, xt = /* @__PURE__ */
|
|
883
|
+
}, xt = /* @__PURE__ */ Q(Ct, [["__scopeId", "data-v-1cd8aa2d"]]), $t = {
|
|
884
884
|
class: "chart-components"
|
|
885
885
|
}, we = /* @__PURE__ */ T({
|
|
886
886
|
__name: "Bar",
|
|
@@ -924,7 +924,7 @@ const J = (o, t) => {
|
|
|
924
924
|
]);
|
|
925
925
|
};
|
|
926
926
|
}
|
|
927
|
-
}), St = { key: 0 },
|
|
927
|
+
}), St = { key: 0 }, Z = /* @__PURE__ */ T({
|
|
928
928
|
__name: "ReportSelect",
|
|
929
929
|
props: {
|
|
930
930
|
value: {}
|
|
@@ -946,7 +946,7 @@ const J = (o, t) => {
|
|
|
946
946
|
placeholder: "全部"
|
|
947
947
|
}, {
|
|
948
948
|
default: p(() => [
|
|
949
|
-
(_(!0), x(
|
|
949
|
+
(_(!0), x(D, null, I(n.value.data, (f) => (_(), L(d, {
|
|
950
950
|
key: f.data,
|
|
951
951
|
label: f.label,
|
|
952
952
|
value: f.data
|
|
@@ -957,7 +957,7 @@ const J = (o, t) => {
|
|
|
957
957
|
])) : U("", !0);
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
|
-
}),
|
|
960
|
+
}), ee = /* @__PURE__ */ T({
|
|
961
961
|
__name: "RangeTime",
|
|
962
962
|
props: {
|
|
963
963
|
value: {}
|
|
@@ -968,7 +968,7 @@ const J = (o, t) => {
|
|
|
968
968
|
function i(v) {
|
|
969
969
|
v ? (r.value.data[0].start_time = v[0], r.value.data[0].end_time = v[1]) : n.value = [], e("change", n.value);
|
|
970
970
|
}
|
|
971
|
-
return
|
|
971
|
+
return oe(() => {
|
|
972
972
|
n.value = [r.value.data[0].start_time, r.value.data[0].end_time];
|
|
973
973
|
}), (v, d) => {
|
|
974
974
|
const b = s("el-date-picker");
|
|
@@ -988,7 +988,7 @@ const J = (o, t) => {
|
|
|
988
988
|
}
|
|
989
989
|
});
|
|
990
990
|
function Tt(o) {
|
|
991
|
-
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !
|
|
991
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !le(o);
|
|
992
992
|
}
|
|
993
993
|
const $e = /* @__PURE__ */ T({
|
|
994
994
|
__name: "ReportTable",
|
|
@@ -1012,7 +1012,7 @@ const $e = /* @__PURE__ */ T({
|
|
|
1012
1012
|
};
|
|
1013
1013
|
return (a, r) => (_(), x("div", null, [l(e, pe(de(a.value)), null, 16)]));
|
|
1014
1014
|
}
|
|
1015
|
-
}),
|
|
1015
|
+
}), te = /* @__PURE__ */ T({
|
|
1016
1016
|
__name: "ReportText",
|
|
1017
1017
|
props: {
|
|
1018
1018
|
value: {}
|
|
@@ -1041,7 +1041,7 @@ const $e = /* @__PURE__ */ T({
|
|
|
1041
1041
|
setup(o) {
|
|
1042
1042
|
const t = o, e = q(() => t.value), a = q(() => {
|
|
1043
1043
|
if (e.value.type === "bar") {
|
|
1044
|
-
e.value.options.series =
|
|
1044
|
+
e.value.options.series = J([]).series;
|
|
1045
1045
|
const r = [];
|
|
1046
1046
|
let n = "";
|
|
1047
1047
|
e.value.data.forEach((i) => {
|
|
@@ -1051,7 +1051,7 @@ const $e = /* @__PURE__ */ T({
|
|
|
1051
1051
|
});
|
|
1052
1052
|
}), dt(e.value.options, r, n);
|
|
1053
1053
|
}
|
|
1054
|
-
if (e.value.type === "pie" && (e.value.options =
|
|
1054
|
+
if (e.value.type === "pie" && (e.value.options = ne({ isLegend: !0 }), ct({ chartOption: e.value.options, data: e.value.data })), e.value.type === "line") {
|
|
1055
1055
|
let r = [];
|
|
1056
1056
|
e.value.data.forEach((v) => {
|
|
1057
1057
|
r = v.data.map((d, b) => ({ name: d.name, value: "value" + b }));
|
|
@@ -1067,7 +1067,7 @@ const $e = /* @__PURE__ */ T({
|
|
|
1067
1067
|
d[b.value] = v.data[f].value;
|
|
1068
1068
|
}), d;
|
|
1069
1069
|
});
|
|
1070
|
-
console.log(
|
|
1070
|
+
console.log(G([], n), "chartsLine([], params)"), e.value.options.series = G([], n).series, _t(e.value.options, i, n);
|
|
1071
1071
|
}
|
|
1072
1072
|
return e.value.options;
|
|
1073
1073
|
});
|
|
@@ -1080,7 +1080,7 @@ const $e = /* @__PURE__ */ T({
|
|
|
1080
1080
|
}
|
|
1081
1081
|
});
|
|
1082
1082
|
function Rt(o) {
|
|
1083
|
-
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !
|
|
1083
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !le(o);
|
|
1084
1084
|
}
|
|
1085
1085
|
const Ve = /* @__PURE__ */ T({
|
|
1086
1086
|
__name: "ReportDescribe",
|
|
@@ -1132,10 +1132,10 @@ const Ve = /* @__PURE__ */ T({
|
|
|
1132
1132
|
Bar: we,
|
|
1133
1133
|
Line: Ce,
|
|
1134
1134
|
Pie: xe,
|
|
1135
|
-
ReportSelect:
|
|
1136
|
-
RangeTime:
|
|
1135
|
+
ReportSelect: Z,
|
|
1136
|
+
RangeTime: ee,
|
|
1137
1137
|
ReportTable: $e,
|
|
1138
|
-
ReportText:
|
|
1138
|
+
ReportText: te,
|
|
1139
1139
|
ReportChart: ke,
|
|
1140
1140
|
ReportDescribe: Ve
|
|
1141
1141
|
}, a = z(), r = o, n = me(o, "modelValue"), i = S([]), v = S([]), d = S([]), b = S(""), f = S("");
|
|
@@ -1154,10 +1154,10 @@ const Ve = /* @__PURE__ */ T({
|
|
|
1154
1154
|
start_time: b.value,
|
|
1155
1155
|
end_time: f.value,
|
|
1156
1156
|
select_data: d.value.join(",")
|
|
1157
|
-
}, y = await Ke(u),
|
|
1158
|
-
y.data.forEach((
|
|
1159
|
-
(
|
|
1160
|
-
}), i.value =
|
|
1157
|
+
}, y = await Ke(u), E = [];
|
|
1158
|
+
y.data.forEach((k) => {
|
|
1159
|
+
(k.type === "report-select" || k.type === "range-time") && E.push(k);
|
|
1160
|
+
}), i.value = E, y.data.splice(0, i.value.length), v.value = y.data, t.value = !1;
|
|
1161
1161
|
} catch (u) {
|
|
1162
1162
|
t.value = !1, console.error("Error setting loading state:", u);
|
|
1163
1163
|
}
|
|
@@ -1165,25 +1165,25 @@ const Ve = /* @__PURE__ */ T({
|
|
|
1165
1165
|
g();
|
|
1166
1166
|
const $ = () => l("div", null, [R("未找到对应组件")]), C = (u) => u === "h2" || u === "h3" || u === "h4" ? H(e, "ReportText") : u === "bar" || u === "pie" || u === "line" ? H(e, "ReportChart") : u ? H(e, u) : l($, null, null);
|
|
1167
1167
|
return (u, y) => {
|
|
1168
|
-
const
|
|
1169
|
-
return fe((_(), L(
|
|
1168
|
+
const E = s("el-button"), k = s("el-card"), N = _e("loading");
|
|
1169
|
+
return fe((_(), L(k, {
|
|
1170
1170
|
class: "editor view",
|
|
1171
1171
|
"element-loading-text": "加载中..."
|
|
1172
1172
|
}, {
|
|
1173
1173
|
default: p(() => [V("div", Ut, [l(xt, {
|
|
1174
1174
|
data: v.value
|
|
1175
|
-
}, null, 8, ["data"]), V("div", Et, [V("div", At, [(_(!0), x(
|
|
1175
|
+
}, null, 8, ["data"]), V("div", Et, [V("div", At, [(_(!0), x(D, null, I(i.value, (A) => (_(), x("div", {
|
|
1176
1176
|
class: "item-input",
|
|
1177
|
-
key:
|
|
1178
|
-
}, [
|
|
1177
|
+
key: A.id
|
|
1178
|
+
}, [A.type === "report-select" ? (_(), L(Z, {
|
|
1179
1179
|
key: 0,
|
|
1180
1180
|
onChange: w,
|
|
1181
|
-
value:
|
|
1182
|
-
}, null, 8, ["value"])) : U("", !0),
|
|
1181
|
+
value: A
|
|
1182
|
+
}, null, 8, ["value"])) : U("", !0), A.type === "range-time" && h(a).filterForm.range_time ? (_(), L(ee, {
|
|
1183
1183
|
key: 1,
|
|
1184
1184
|
onChange: m,
|
|
1185
|
-
value:
|
|
1186
|
-
}, null, 8, ["value"])) : U("", !0)]))), 128)), l(
|
|
1185
|
+
value: A
|
|
1186
|
+
}, null, 8, ["value"])) : U("", !0)]))), 128)), l(E, {
|
|
1187
1187
|
plain: "",
|
|
1188
1188
|
onClick: c,
|
|
1189
1189
|
type: "primary",
|
|
@@ -1194,27 +1194,27 @@ const Ve = /* @__PURE__ */ T({
|
|
|
1194
1194
|
}, {
|
|
1195
1195
|
default: p(() => y[0] || (y[0] = [R("退出预览")])),
|
|
1196
1196
|
_: 1
|
|
1197
|
-
})]), (_(!0), x(
|
|
1198
|
-
key:
|
|
1199
|
-
class: O(["editor-content", ["editor" +
|
|
1200
|
-
id:
|
|
1201
|
-
}, [
|
|
1197
|
+
})]), (_(!0), x(D, null, I(v.value, (A) => (_(), x("div", {
|
|
1198
|
+
key: A.id,
|
|
1199
|
+
class: O(["editor-content", ["editor" + A.type]]),
|
|
1200
|
+
id: A.id
|
|
1201
|
+
}, [A.type !== "p" ? (_(), L(W(C(A.type)), {
|
|
1202
1202
|
key: 0,
|
|
1203
|
-
class: O(["editor" +
|
|
1204
|
-
value:
|
|
1203
|
+
class: O(["editor" + A.type]),
|
|
1204
|
+
value: A
|
|
1205
1205
|
}, {
|
|
1206
|
-
default: p(() => [R(B(
|
|
1206
|
+
default: p(() => [R(B(A.data), 1)]),
|
|
1207
1207
|
_: 2
|
|
1208
1208
|
}, 1032, ["class", "value"])) : (_(), x("p", {
|
|
1209
1209
|
key: 1,
|
|
1210
|
-
innerHTML:
|
|
1210
|
+
innerHTML: A.data
|
|
1211
1211
|
}, null, 8, Dt))], 10, Ft))), 128))])])]),
|
|
1212
1212
|
_: 1
|
|
1213
|
-
})), [[
|
|
1213
|
+
})), [[N, t.value]]);
|
|
1214
1214
|
};
|
|
1215
1215
|
}
|
|
1216
1216
|
});
|
|
1217
|
-
const It = /* @__PURE__ */
|
|
1217
|
+
const It = /* @__PURE__ */ Q(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
1218
1218
|
class: "editor"
|
|
1219
1219
|
}, Ht = {
|
|
1220
1220
|
class: "editor-content edit"
|
|
@@ -1225,10 +1225,10 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1225
1225
|
Bar: we,
|
|
1226
1226
|
Line: Ce,
|
|
1227
1227
|
Pie: xe,
|
|
1228
|
-
ReportSelect:
|
|
1229
|
-
RangeTime:
|
|
1228
|
+
ReportSelect: Z,
|
|
1229
|
+
RangeTime: ee,
|
|
1230
1230
|
ReportTable: $e,
|
|
1231
|
-
ReportText:
|
|
1231
|
+
ReportText: te,
|
|
1232
1232
|
ReportChart: ke,
|
|
1233
1233
|
ReportDescribe: Ve
|
|
1234
1234
|
}, {
|
|
@@ -1250,7 +1250,7 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1250
1250
|
C.newIndex !== 0 && (console.log(C), w.value = !1);
|
|
1251
1251
|
}, $ = S();
|
|
1252
1252
|
return (C, u) => {
|
|
1253
|
-
const y = s("icon
|
|
1253
|
+
const y = s("CircleClose"), E = s("el-icon");
|
|
1254
1254
|
return _(), x("div", zt, [V("div", {
|
|
1255
1255
|
class: O(["editor-content edit flex flex-start", [{
|
|
1256
1256
|
active: h(a).id === "filter"
|
|
@@ -1259,16 +1259,16 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1259
1259
|
id: "filter",
|
|
1260
1260
|
type: "filter"
|
|
1261
1261
|
}))
|
|
1262
|
-
}, [(_(!0), x(
|
|
1262
|
+
}, [(_(!0), x(D, null, I(h(r), (k) => (_(), x("div", {
|
|
1263
1263
|
class: "item-input",
|
|
1264
1264
|
key: k.id
|
|
1265
|
-
}, [k.type === "report-select" || k.type === "range-time" && h(i).filterForm.range_time ? (_(), L(
|
|
1265
|
+
}, [k.type === "report-select" || k.type === "range-time" && h(i).filterForm.range_time ? (_(), L(W(h(H)(t, k.type)), {
|
|
1266
1266
|
key: 0,
|
|
1267
1267
|
value: k
|
|
1268
1268
|
}, {
|
|
1269
1269
|
default: p(() => [R(B(k.data), 1)]),
|
|
1270
1270
|
_: 2
|
|
1271
|
-
}, 1032, ["value"])) : U("", !0)]))), 128))], 2), V("div", Ht, [l(
|
|
1271
|
+
}, 1032, ["value"])) : U("", !0)]))), 128))], 2), V("div", Ht, [l(te, {
|
|
1272
1272
|
value: h(n),
|
|
1273
1273
|
onClick: u[1] || (u[1] = (k) => d(h(n)))
|
|
1274
1274
|
}, null, 8, ["value"])]), l(h(Be), {
|
|
@@ -1281,17 +1281,24 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1281
1281
|
onStart: m,
|
|
1282
1282
|
onEnd: g
|
|
1283
1283
|
}, {
|
|
1284
|
-
default: p(() => [(_(!0), x(
|
|
1284
|
+
default: p(() => [(_(!0), x(D, null, I(h(e), (k) => (_(), x("div", {
|
|
1285
1285
|
key: k.id,
|
|
1286
1286
|
class: O(["editor-content edit", ["editor" + k.type, {
|
|
1287
1287
|
active: k.id === h(a).id
|
|
1288
1288
|
}]]),
|
|
1289
|
-
onClick: (
|
|
1289
|
+
onClick: (N) => d(k)
|
|
1290
1290
|
}, [V("i", {
|
|
1291
|
-
onClick: Ue((
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1291
|
+
onClick: Ue((N) => v(k.id), ["stop"]),
|
|
1292
|
+
style: {
|
|
1293
|
+
"z-index": "99"
|
|
1294
|
+
}
|
|
1295
|
+
}, [l(E, {
|
|
1296
|
+
size: "16px",
|
|
1297
|
+
color: "red"
|
|
1298
|
+
}, {
|
|
1299
|
+
default: p(() => [l(y)]),
|
|
1300
|
+
_: 1
|
|
1301
|
+
})], 8, jt), k.type !== "p" ? (_(), L(W(f(k.type)), {
|
|
1295
1302
|
key: 0,
|
|
1296
1303
|
class: O(["editor" + k.type]),
|
|
1297
1304
|
value: k,
|
|
@@ -1317,7 +1324,7 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1317
1324
|
return _(), x("div", null, [
|
|
1318
1325
|
l(i, { label: "控制列" }, {
|
|
1319
1326
|
default: p(() => [
|
|
1320
|
-
(_(!0), x(
|
|
1327
|
+
(_(!0), x(D, null, I(e.value.showColumn, (d, b) => (_(), x("p", {
|
|
1321
1328
|
class: "flex item-switch",
|
|
1322
1329
|
key: b
|
|
1323
1330
|
}, [
|
|
@@ -1503,7 +1510,7 @@ const It = /* @__PURE__ */ J(qt, [["__scopeId", "data-v-db45c725"]]), zt = {
|
|
|
1503
1510
|
};
|
|
1504
1511
|
}
|
|
1505
1512
|
});
|
|
1506
|
-
const Jt = /* @__PURE__ */
|
|
1513
|
+
const Jt = /* @__PURE__ */ Q(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @__PURE__ */ T({
|
|
1507
1514
|
__name: "SettingDescribe",
|
|
1508
1515
|
setup(o) {
|
|
1509
1516
|
const t = z(), e = q(() => t.getActiveComponents);
|
|
@@ -1589,7 +1596,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1589
1596
|
function d(f) {
|
|
1590
1597
|
let c = i.value.find((m) => m.rp_item_uuid === f);
|
|
1591
1598
|
const w = c.rp_item_content;
|
|
1592
|
-
if (c.rp_item_content.type === "bar" && (w.options =
|
|
1599
|
+
if (c.rp_item_content.type === "bar" && (w.options = J()), w.type === "pie" && (w.options = ne({ isLegend: !0 })), w.type === "line") {
|
|
1593
1600
|
let m = [];
|
|
1594
1601
|
w.data.forEach(($) => {
|
|
1595
1602
|
m = $.data.map((C, u) => ({ name: C.name, value: "value" + u }));
|
|
@@ -1598,7 +1605,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1598
1605
|
name: "name",
|
|
1599
1606
|
value: m
|
|
1600
1607
|
};
|
|
1601
|
-
w.options =
|
|
1608
|
+
w.options = G([], g);
|
|
1602
1609
|
}
|
|
1603
1610
|
if (w.type === "report-table") {
|
|
1604
1611
|
const m = {};
|
|
@@ -1608,7 +1615,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1608
1615
|
}
|
|
1609
1616
|
w.type === "report-describe" && (w.options = { ...w.options, title: "", border: !0, column: 1, direction: "horizontal", ...a.value.options }), Object.assign(t.activeComponents, w), t.activeComponents.rp_item_uuid = c.rp_item_uuid;
|
|
1610
1617
|
}
|
|
1611
|
-
|
|
1618
|
+
oe(async () => {
|
|
1612
1619
|
n.value = a.value.type, await v(n.value);
|
|
1613
1620
|
});
|
|
1614
1621
|
async function b(f) {
|
|
@@ -1637,7 +1644,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1637
1644
|
onChange: b
|
|
1638
1645
|
}, {
|
|
1639
1646
|
default: p(() => [
|
|
1640
|
-
(_(), x(
|
|
1647
|
+
(_(), x(D, null, I(r, (u, y) => l(w, {
|
|
1641
1648
|
key: y,
|
|
1642
1649
|
label: u.name,
|
|
1643
1650
|
value: u.value
|
|
@@ -1657,7 +1664,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1657
1664
|
onChange: d
|
|
1658
1665
|
}, {
|
|
1659
1666
|
default: p(() => [
|
|
1660
|
-
(_(!0), x(
|
|
1667
|
+
(_(!0), x(D, null, I(i.value, (u, y) => (_(), L(w, {
|
|
1661
1668
|
key: y,
|
|
1662
1669
|
label: u.rp_item_name,
|
|
1663
1670
|
value: u.rp_item_uuid
|
|
@@ -1735,7 +1742,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1735
1742
|
onChange: r
|
|
1736
1743
|
}, {
|
|
1737
1744
|
default: p(() => [
|
|
1738
|
-
(_(!0), x(
|
|
1745
|
+
(_(!0), x(D, null, I(a.value, (C, u) => (_(), L(w, {
|
|
1739
1746
|
key: u,
|
|
1740
1747
|
label: C.rp_item_name,
|
|
1741
1748
|
value: C.rp_item_uuid
|
|
@@ -1797,7 +1804,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1797
1804
|
disabled: !!h(e).filterForm.filter_uuid
|
|
1798
1805
|
}, {
|
|
1799
1806
|
default: p(() => [
|
|
1800
|
-
(_(!0), x(
|
|
1807
|
+
(_(!0), x(D, null, I(t.value, (c) => (_(), L(i, {
|
|
1801
1808
|
key: c.filter_uuid,
|
|
1802
1809
|
label: c.filter_name,
|
|
1803
1810
|
value: c.filter_uuid
|
|
@@ -1956,7 +1963,7 @@ const Jt = /* @__PURE__ */ J(Gt, [["__scopeId", "data-v-e9859d3b"]]), Te = /* @_
|
|
|
1956
1963
|
};
|
|
1957
1964
|
}
|
|
1958
1965
|
});
|
|
1959
|
-
const lo = /* @__PURE__ */
|
|
1966
|
+
const lo = /* @__PURE__ */ Q(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @__PURE__ */ T({
|
|
1960
1967
|
__name: "Setting",
|
|
1961
1968
|
setup(o) {
|
|
1962
1969
|
const t = {
|
|
@@ -1971,7 +1978,7 @@ const lo = /* @__PURE__ */ J(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @_
|
|
|
1971
1978
|
const f = s("el-card");
|
|
1972
1979
|
return _(), L(f, { class: "config-wrapper" }, {
|
|
1973
1980
|
default: p(() => [
|
|
1974
|
-
(_(), L(
|
|
1981
|
+
(_(), L(W(v(a.value.type))))
|
|
1975
1982
|
]),
|
|
1976
1983
|
_: 1
|
|
1977
1984
|
});
|
|
@@ -1991,7 +1998,7 @@ const lo = /* @__PURE__ */ J(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @_
|
|
|
1991
1998
|
emits: ["update:modelValue"],
|
|
1992
1999
|
setup(o) {
|
|
1993
2000
|
const t = z(), e = o, a = me(o, "modelValue"), r = (d) => {
|
|
1994
|
-
const b =
|
|
2001
|
+
const b = K(d);
|
|
1995
2002
|
b.id = P(), t.componentList.push(b);
|
|
1996
2003
|
};
|
|
1997
2004
|
function n() {
|
|
@@ -2000,7 +2007,7 @@ const lo = /* @__PURE__ */ J(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @_
|
|
|
2000
2007
|
function i() {
|
|
2001
2008
|
t.getReportDemo(e.reportId);
|
|
2002
2009
|
}
|
|
2003
|
-
|
|
2010
|
+
oe(() => {
|
|
2004
2011
|
i();
|
|
2005
2012
|
});
|
|
2006
2013
|
async function v() {
|
|
@@ -2040,7 +2047,7 @@ const lo = /* @__PURE__ */ J(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @_
|
|
|
2040
2047
|
V("div", so, [
|
|
2041
2048
|
l(c, null, {
|
|
2042
2049
|
default: p(() => [
|
|
2043
|
-
(_(!0), x(
|
|
2050
|
+
(_(!0), x(D, null, I(h(yt), (m) => (_(), x(D, {
|
|
2044
2051
|
key: m.type
|
|
2045
2052
|
}, [
|
|
2046
2053
|
m != null && m.hide ? U("", !0) : (_(), L(f, {
|
|
@@ -2110,7 +2117,7 @@ const lo = /* @__PURE__ */ J(oo, [["__scopeId", "data-v-56fef84c"]]), no = /* @_
|
|
|
2110
2117
|
report_uuids: c
|
|
2111
2118
|
}), a.value.getTableList();
|
|
2112
2119
|
});
|
|
2113
|
-
}, f =
|
|
2120
|
+
}, f = Y([
|
|
2114
2121
|
// { type: 'selection', fixed: 'left', width: 70 },
|
|
2115
2122
|
{
|
|
2116
2123
|
type: "selection",
|
|
@@ -2228,7 +2235,7 @@ const co = { style: { height: "100%" } }, mo = /* @__PURE__ */ T({
|
|
|
2228
2235
|
]));
|
|
2229
2236
|
}
|
|
2230
2237
|
});
|
|
2231
|
-
const
|
|
2238
|
+
const se = (o, t) => {
|
|
2232
2239
|
if (o.install = (e) => {
|
|
2233
2240
|
for (const a of [o, ...Object.values(t ?? {})])
|
|
2234
2241
|
e.component(a.name, a);
|
|
@@ -2236,7 +2243,7 @@ const re = (o, t) => {
|
|
|
2236
2243
|
for (const [e, a] of Object.entries(t))
|
|
2237
2244
|
o[e] = a;
|
|
2238
2245
|
return o;
|
|
2239
|
-
}, _o =
|
|
2246
|
+
}, _o = se(mo), fo = [
|
|
2240
2247
|
{
|
|
2241
2248
|
label: "正文",
|
|
2242
2249
|
value: "p"
|
|
@@ -2292,7 +2299,7 @@ const re = (o, t) => {
|
|
|
2292
2299
|
name: "TCModule",
|
|
2293
2300
|
__name: "index",
|
|
2294
2301
|
setup(o) {
|
|
2295
|
-
const t = S(), e = S(), a = S({}), r = S(""), n =
|
|
2302
|
+
const t = S(), e = S(), a = S({}), r = S(""), n = Y({
|
|
2296
2303
|
prod_type: window.$prodType
|
|
2297
2304
|
});
|
|
2298
2305
|
function i(m) {
|
|
@@ -2328,7 +2335,7 @@ const re = (o, t) => {
|
|
|
2328
2335
|
key: "",
|
|
2329
2336
|
id: (/* @__PURE__ */ new Date()).getTime()
|
|
2330
2337
|
});
|
|
2331
|
-
}, w =
|
|
2338
|
+
}, w = Y([{
|
|
2332
2339
|
type: "selection",
|
|
2333
2340
|
width: 60,
|
|
2334
2341
|
field: "rp_item_uuid",
|
|
@@ -2498,7 +2505,7 @@ const re = (o, t) => {
|
|
|
2498
2505
|
type: "primary",
|
|
2499
2506
|
class: "custom-btn",
|
|
2500
2507
|
icon: "Plus",
|
|
2501
|
-
onClick: g[0] || (g[0] = (
|
|
2508
|
+
onClick: g[0] || (g[0] = (E) => v())
|
|
2502
2509
|
}, {
|
|
2503
2510
|
default: p(() => g[1] || (g[1] = [R("添加")])),
|
|
2504
2511
|
_: 1
|
|
@@ -2506,7 +2513,7 @@ const re = (o, t) => {
|
|
|
2506
2513
|
plain: "",
|
|
2507
2514
|
type: "danger",
|
|
2508
2515
|
icon: "Delete",
|
|
2509
|
-
onClick: (
|
|
2516
|
+
onClick: (E) => i(y.selectedListIds)
|
|
2510
2517
|
}, {
|
|
2511
2518
|
default: p(() => g[2] || (g[2] = [R("删除")])),
|
|
2512
2519
|
_: 2
|
|
@@ -2525,11 +2532,11 @@ const re = (o, t) => {
|
|
|
2525
2532
|
};
|
|
2526
2533
|
}
|
|
2527
2534
|
});
|
|
2528
|
-
const go =
|
|
2535
|
+
const go = se(yo), ho = {
|
|
2529
2536
|
class: "table-box"
|
|
2530
2537
|
};
|
|
2531
2538
|
function ue(o) {
|
|
2532
|
-
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !
|
|
2539
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !le(o);
|
|
2533
2540
|
}
|
|
2534
2541
|
const wo = /* @__PURE__ */ T({
|
|
2535
2542
|
name: "TCSubscribe",
|
|
@@ -2565,10 +2572,10 @@ const wo = /* @__PURE__ */ T({
|
|
|
2565
2572
|
data: y
|
|
2566
2573
|
}), t.value.getTableList(), e.value.close();
|
|
2567
2574
|
}
|
|
2568
|
-
function c(u, y,
|
|
2575
|
+
function c(u, y, E) {
|
|
2569
2576
|
if (!y || y.length === 0)
|
|
2570
|
-
return
|
|
2571
|
-
|
|
2577
|
+
return E(new Error("请输入收件人"));
|
|
2578
|
+
E();
|
|
2572
2579
|
}
|
|
2573
2580
|
const w = (u, y) => {
|
|
2574
2581
|
u.target.value && i.value[y].push(u.target.value);
|
|
@@ -2602,7 +2609,7 @@ const wo = /* @__PURE__ */ T({
|
|
|
2602
2609
|
}, {
|
|
2603
2610
|
label: "每月",
|
|
2604
2611
|
value: 2
|
|
2605
|
-
}], $ = [], C =
|
|
2612
|
+
}], $ = [], C = Y([{
|
|
2606
2613
|
type: "selection",
|
|
2607
2614
|
align: "center",
|
|
2608
2615
|
field: "subscript_uuid",
|
|
@@ -2680,17 +2687,17 @@ const wo = /* @__PURE__ */ T({
|
|
|
2680
2687
|
key: window.$prodType
|
|
2681
2688
|
}
|
|
2682
2689
|
},
|
|
2683
|
-
render: (u) => t.value.enumMap.get("dbsId").filter((
|
|
2690
|
+
render: (u) => t.value.enumMap.get("dbsId").filter((k) => u.row.dbsId.indexOf(k.id) > -1).map((k) => l(s("el-tag"), {
|
|
2684
2691
|
class: "mr-10px",
|
|
2685
2692
|
type: "info"
|
|
2686
2693
|
}, {
|
|
2687
|
-
default: () => [
|
|
2694
|
+
default: () => [k.policy_name]
|
|
2688
2695
|
}))
|
|
2689
2696
|
}, {
|
|
2690
2697
|
field: "receiver_email",
|
|
2691
2698
|
name: "收件人",
|
|
2692
2699
|
width: 300,
|
|
2693
|
-
render: (u) => l(
|
|
2700
|
+
render: (u) => l(D, null, [u.row.receiver_email.map((y) => l(s("el-tag"), {
|
|
2694
2701
|
class: "mr-10px",
|
|
2695
2702
|
type: "info"
|
|
2696
2703
|
}, ue(y) ? y : {
|
|
@@ -2700,7 +2707,7 @@ const wo = /* @__PURE__ */ T({
|
|
|
2700
2707
|
type: "input",
|
|
2701
2708
|
render: () => {
|
|
2702
2709
|
let u;
|
|
2703
|
-
return l(
|
|
2710
|
+
return l(D, null, [l(s("el-select"), {
|
|
2704
2711
|
class: "right-select",
|
|
2705
2712
|
modelValue: i.value.receiver_email,
|
|
2706
2713
|
"onUpdate:modelValue": (y) => i.value.receiver_email = y,
|
|
@@ -2847,7 +2854,7 @@ const wo = /* @__PURE__ */ T({
|
|
|
2847
2854
|
}, null)])
|
|
2848
2855
|
}]);
|
|
2849
2856
|
return (u, y) => {
|
|
2850
|
-
const
|
|
2857
|
+
const E = s("el-button");
|
|
2851
2858
|
return _(), x("div", ho, [l(h(Oe), {
|
|
2852
2859
|
ref_key: "refTdsTable",
|
|
2853
2860
|
ref: t,
|
|
@@ -2856,21 +2863,21 @@ const wo = /* @__PURE__ */ T({
|
|
|
2856
2863
|
columns: C,
|
|
2857
2864
|
options: u.$tableOptions()
|
|
2858
2865
|
}, {
|
|
2859
|
-
tableHeader: p((
|
|
2866
|
+
tableHeader: p((k) => [l(E, {
|
|
2860
2867
|
type: "primary",
|
|
2861
2868
|
icon: "Plus",
|
|
2862
2869
|
class: "custom-btn",
|
|
2863
2870
|
plain: "",
|
|
2864
|
-
onClick: y[0] || (y[0] = (
|
|
2871
|
+
onClick: y[0] || (y[0] = (N) => b())
|
|
2865
2872
|
}, {
|
|
2866
2873
|
default: p(() => [R(B(h(a)("button.add")), 1)]),
|
|
2867
2874
|
_: 1
|
|
2868
|
-
}), l(
|
|
2875
|
+
}), l(E, {
|
|
2869
2876
|
type: "danger",
|
|
2870
2877
|
icon: "Delete",
|
|
2871
2878
|
plain: "",
|
|
2872
2879
|
onClick: d,
|
|
2873
|
-
disabled: !
|
|
2880
|
+
disabled: !k.selectedListIds.length
|
|
2874
2881
|
}, {
|
|
2875
2882
|
default: p(() => [R(B(h(a)("button.delete")), 1)]),
|
|
2876
2883
|
_: 2
|
|
@@ -2888,7 +2895,7 @@ const wo = /* @__PURE__ */ T({
|
|
|
2888
2895
|
}), null, 16)]);
|
|
2889
2896
|
};
|
|
2890
2897
|
}
|
|
2891
|
-
}), Co =
|
|
2898
|
+
}), Co = se(wo), xo = {
|
|
2892
2899
|
TCReport: _o,
|
|
2893
2900
|
TCModule: go,
|
|
2894
2901
|
TCSubscribe: Co
|
package/lib/t-report-ui.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("element-plus"),require("vue-draggable-plus"),require("@wangeditor/editor-for-vue"),require("@element-plus/icons-vue"),require("topdatasec-ui")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus","vue-draggable-plus","@wangeditor/editor-for-vue","@element-plus/icons-vue","topdatasec-ui"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.TReportUI={},w.Vue,w.Pinia,w.ElementPlus,w.VueDraggable,w.Editor,w.IconsVue,w.TopdatasecUI))})(this,function(w,e,
|
|
2
|
-
<div><span style="font-size: 14px; color: #86909c; float: right;">数量:${m}</span></div>`}},title:{show:i,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},legend:{show:r,left:"70%",formatter:d=>{var m;const _=(m=u.series[0])==null?void 0:m.data.find(p=>p.name===d).value;return` ${d} | ${_}`},textStyle:{fontSize:12,color:B},data:n,orient:"vertical",itemWidth:10,itemHeight:10,borderRadius:10,x:"left",top:"center",align:"left",itemGap:15},series:[{type:"pie",center:l,radius:o===1?t?["10%","65%"]:["45%","70%"]:["0%","65%"],roseType:t,itemStyle:{borderRadius:1},label:{show:a,position:"outside",alignTo:"labelLine",backgroundColor:"#fff",height:0,width:0,lineHeight:0,distanceToLabelLine:0,borderRadius:3,borderWidth:1,borderColor:"inherit",padding:[3,-3,3,-3],formatter:function(d){return`{a|${d.name}(${d.value})}`},rich:{a:{padding:[20,-80,40,-80],fontSize:"12px",fontFamily:"MicrosoftYaHei",color:"#091158"},b:{padding:[0,-80,55,-80],fontSize:"15px",fontFamily:"MicrosoftYaHei-Bold, MicrosoftYaHei",fontWeight:"bold",color:"#001F3D"}}},labelLine:{show:!0,length:40,length2:85,align:"right",lineStyle:{width:1}},data:n}],graphic:[{invisible:!1,type:"text",left:"center",top:"44%",style:{text:"总量",fontSize:14,fill:"#86909c",fontWeight:"bold"}},{invisible:!1,type:"text",left:"center",top:"50%",style:{text:"151",fontSize:18,fill:"#86909c",fontWeight:"bold"}}]};return u},Ue=(n,o,t={name:"name",value:"value"})=>{n.xAxis.data=o.map(r=>r[t.name]),Array.isArray(t.value)?t.value.forEach((r,a)=>{n.series[a].data=o.map(l=>l[r.value])}):typeof t.value=="string"&&(n.series[0].data=o.map(r=>r[t.value]))},Fe=()=>({name:"",type:"line",symbol:"circle",smooth:!0,lineStyle:{width:1,color:`rgba(${V[0]}, 1)`},showSymbol:!1,itemStyle:{color:`rgba(${V[0]}, 1)`,label:{show:!0,position:"top",formatter:function(n){return n.value?n.value:0}}},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${V[0]}, 0.7)`},{offset:1,color:`rgba(${V[0]}, 0.1)`}],global:!1}},data:[]}),L=(n=[{name:"2024-08",value:63},{name:"2024-09",value:45},{name:"2024-10",value:43}],o={name:"name",value:"value"})=>{const t={tooltip:{trigger:"axis"},title:{show:!0,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},legend:{show:!0,itemWidth:30,textStyle:{color:B,fontSize:12,padding:[0,8,0,8]}},grid:K(),xAxis:{type:"category",splitLine:{show:!1},axisTick:{show:!1},axisLine:{show:!0,lineStyle:{color:Y}},axisLabel:{show:!0,fontSize:12,color:B},boundaryGap:!1,data:n.map(l=>l[o.name])},yAxis:{name:"",type:"value",splitLine:{show:!1},axisLine:{show:!1},axisTick:{show:!1},nameTextStyle:{fontSize:12,color:B,padding:[0,60,0,0]},axisLabel:{show:!0,fontSize:12,color:B}},series:[]},r=Fe(),a=[];if(Array.isArray(o.value))o.value.forEach((l,i)=>{const u=E(r);u.name=l.name,u.lineStyle.color=`rgba(${V[i]}, 1)`,u.itemStyle.color=`rgba(${V[i]}, 1)`,u.areaStyle.color.colorStops[0].color=`rgba(${V[i]}, 0.7)`,u.areaStyle.color.colorStops[1].color=`rgba(${V[i]}, 0.1)`,u.data=n.map(d=>d[l.value]),a.push(u)});else if(typeof o.value=="string"){const l=E(r);l.data=n.map(i=>i[o.value]),a.push(l)}return t.series=a,t},F=[{key:"assets",name:"资产名称"},{key:"type",name:"资产类型"},{key:"data",name:"资产数据"}],D=[{assets:"name1",type:"type1",data:"data1"},{assets:"name2",type:"type2",data:"data2"},{assets:"name3",type:"type3",data:"data3"}],A=[{data:[{name:"默认数据",value:180}],label:"name1"},{data:[{name:"默认数据",value:311}],label:"name2"},{data:[{name:"默认数据",value:42}],label:"name3"},{data:[{name:"默认数据",value:32391}],label:"name4"}],De=[{data:63,label:"数据1"},{data:45,label:"数据2"},{data:43,label:"数据3"}],Ae=[{type:"report-select",label:"资产:",value:"0",data:[{label:"全部",data:"0"},{label:"10.10.2.20_root",data:"743dbb32-8a41-4990-9d76-48925b000a93"},{label:"10.10.4.206_sysdba",data:"23193788-c895-47a8-8123-65799540394c"},{label:"10.10.4.26_root@/root/files/",data:"bb7b07c9-b96b-4caf-ac76-bb45ae849844"}],uri:"/da/report/sens/get_asset_all",id:T()},{type:"range-time",data:[{start_time:"2024-08-20 19:49:34",end_time:"2024-09-12 19:49:34"}],id:T()},{type:"h1",data:"报表名称",options:{size:24,color:"rgba(0,0,0,0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:T()},{type:"h2",data:"一级标题",name:"一级标题",options:{size:18,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:T()},{type:"report-table",data:D,showColumn:F,name:"表格",options:{showColumn:{assets:!0,type:!0,data:!0},border:!0,showHeader:!0,stripe:!1},rp_item_uuid:"",id:T()}],qe=[{type:"h1",data:"报表名称",name:"报表名称",options:{size:24,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},hide:!0,id:""},{type:"h2",data:"一级标题",name:"一级标题",options:{size:18,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:""},{type:"h3",data:"二级标题",name:"二级标题",options:{size:14,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:""},{type:"p",data:"正文",name:"正文",rp_item_uuid:"",id:""},{type:"report-table",data:D,showColumn:F,name:"表格",options:{border:!0,showHeader:!0,stripe:!1,showColumn:{assect:!0,type:!0,data:!0}},rp_item_uuid:"",id:""},{type:"bar",data:A,showColumn:[{key:"label",value:"data"}],name:"图表",options:S(),rp_item_uuid:"",id:""}],ze=n=>({bar:{type:"bar",data:A,showColumn:[{key:"label",value:"data"}],name:"图表",options:S(),rp_item_uuid:"",id:""},line:{type:"line",data:A,showColumn:[{key:"label",value:"data"}],name:"图表",options:L(),rp_item_uuid:"",id:""},pie:{type:"pie",data:De,showColumn:[{key:"label",value:"data"}],name:"图表",options:U({isLegend:!0}),rp_item_uuid:"",id:""},"report-table":{type:"report-table",data:D,showColumn:F,name:"表格",options:{showColumn:{assect:!0,type:!0,data:!0},border:!0,showHeader:!0,stripe:!1},rp_item_uuid:"",id:""}})[n],N=P.defineStore("tds-report",{state:()=>({componentList:[],activeComponents:{},notDraggableList:[],titleComponent:{},filterForm:{range_time:1,filter_uuid:""}}),getters:{getActiveComponents:n=>n.activeComponents},actions:{setComponentList(n){this.componentList=n},async getReportDemo(n){let o=[];n?o=(await me({report_uuid:n})).data:o={content:E(Ae),range_time:1};const t=[];o.content.forEach(r=>{(r.type==="report-select"||r.type==="range-time")&&t.push(r),r.type==="h1"&&(this.titleComponent=r),r.id=T()}),this.notDraggableList=t,this.filterForm.range_time=o.range_time,this.filterForm.filter_uuid=o.filter_uuid,o.content.splice(0,3),this.componentList=o.content},setActiveComponents(n){this.activeComponents=n},clearComponents(){this.activeComponents={},this.componentList=[],this.notDraggableList=[],this.titleComponent={},this.filterForm={range_time:1,filter_uuid:""}}}}),Ie={class:"catalogue"},Me=["href","title"],Pe=e.defineComponent({__name:"Catalogue",props:{data:{default:()=>[]}},setup(n){const o=n,t=e.computed(()=>o.data.filter(r=>["h2","h3","h4"].includes(r.type)));return(r,a)=>{const l=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",Ie,[a[0]||(a[0]=e.createElementVNode("div",{class:"cata-title el-anchor__link"},"目录",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,i=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("level"+i.type),key:i.value},[i.type==="h2"?(e.openBlock(),e.createBlock(l,{key:0,style:{"margin-top":"10px","margin-bottom":"10px"}})):e.createCommentVNode("",!0),e.createElementVNode("a",{class:"el-anchor__link",href:"#"+i.id,title:i.data},e.toDisplayString(i.data),9,Me)],2))),128))])}}}),Mt="",R=(n,o)=>{const t=n.__vccOpts||n;for(const[r,a]of o)t[r]=a;return t},je=R(Pe,[["__scopeId","data-v-1cd8aa2d"]]),He={class:"chart-components"},G=e.defineComponent({__name:"Bar",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return e.ref(!1),(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",He,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),Oe={class:"chart-components"},J=e.defineComponent({__name:"Line",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),We={class:"chart-components"},Q=e.defineComponent({__name:"Pie",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",We,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),Ye={key:0},q=e.defineComponent({__name:"ReportSelect",props:{value:{}},emits:["change"],setup(n,{emit:o}){const t=o,r=i=>{t("change",i)},a=n,l=e.ref(a.value);return(i,u)=>{const d=e.resolveComponent("el-option"),_=e.resolveComponent("el-select");return l.value.data?(e.openBlock(),e.createElementBlock("div",Ye,[e.createVNode(_,{modelValue:l.value.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value.value=m),multiple:"",style:{width:"100%"},onChange:r,placeholder:"全部"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.data,m=>(e.openBlock(),e.createBlock(d,{key:m.data,label:m.label,value:m.data},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0)}}}),z=e.defineComponent({__name:"RangeTime",props:{value:{}},emits:["change"],setup(n,{emit:o}){const t=o,r=n,a=e.ref(r.value),l=e.ref([]);function i(u){u?(a.value.data[0].start_time=u[0],a.value.data[0].end_time=u[1]):l.value=[],t("change",l.value)}return e.onMounted(()=>{l.value=[a.value.data[0].start_time,a.value.data[0].end_time]}),(u,d)=>{const _=e.resolveComponent("el-date-picker");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(_,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=m=>l.value=m),type:"datetimerange",placeholder:"Pick a Date",format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",onChange:i,clearable:!1},null,8,["modelValue"])])}}});function Ke(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const X=e.defineComponent({__name:"ReportTable",props:{value:{}},setup(n){const o=n,t=r=>{let a;return e.createVNode(e.resolveComponent("el-table"),{data:r.data,border:o.value.options.border,"show-header":!!o.value.options.showHeader,stripe:o.value.options.stripe},Ke(a=r.showColumn.map(l=>o.value.options.showColumn[l.key]===!0?e.createVNode(e.resolveComponent("el-table-column"),{prop:l.key,label:l.name},null):null))?a:{default:()=>[a]})};return(r,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(t,e.normalizeProps(e.guardReactiveProps(r.value)),null,16)]))}}),I=e.defineComponent({__name:"ReportText",props:{value:{}},setup(n){const o=n,t=()=>{const r=o.value.options||{};return{color:r.color,"font-size":r.size+"px","font-weight":r.fontWeight,"letter-spacing":r.letterSpacing+"px","text-indent":r.textIndent+"px","text-align":r.textAlign}};return(r,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(t())},e.toDisplayString(r.value.data),5))}}),Ge={class:"chart-components"},Z=e.defineComponent({__name:"ReportChart",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value),r=e.computed(()=>{if(t.value.type==="bar"){t.value.options.series=S([]).series;const a=[];let l="";t.value.data.forEach(i=>{l=i.data[0].name,a.push({name:i.label,value:i.data[0].value})}),Se(t.value.options,a,l)}if(t.value.type==="pie"&&(t.value.options=U({isLegend:!0}),Le({chartOption:t.value.options,data:t.value.data})),t.value.type==="line"){let a=[];t.value.data.forEach(u=>{a=u.data.map((d,_)=>({name:d.name,value:"value"+_}))});const l={name:"name",value:a},i=t.value.data.map(u=>{const d={name:u.label};return a.forEach((_,m)=>{d[_.value]=u.data[m].value}),d});console.log(L([],l),"chartsLine([], params)"),t.value.options.series=L([],l).series,Ue(t.value.options,i,l)}return t.value.options});return(a,l)=>{const i=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(i,{option:r.value},null,8,["option"])])}}});function Je(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const v=e.defineComponent({__name:"ReportDescribe",props:{value:{}},setup(n){const o=n,t=r=>{let a;return e.createVNode(e.resolveComponent("el-descriptions"),{title:o.value.options.title,border:o.value.options.border,column:o.value.options.column,direction:o.value.options.direction},Je(a=r.showColumn.map(l=>e.createVNode(e.resolveComponent("el-descriptions-item"),{label:l.name},{default:()=>[o.value.data[l.key]]})))?a:{default:()=>[a]})};return(r,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(t,e.normalizeProps(e.guardReactiveProps(r.value)),null,16)]))}}),Qe={class:"editor-box"},Xe={class:"editor",id:"editor",style:{width:"100%"}},Ze={class:"editor-content flex flex-start"},ve=["id"],et=["innerHTML"],tt=e.defineComponent({__name:"index",props:e.mergeModels({reportId:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=e.ref(!1),t={Bar:G,Line:J,Pie:Q,ReportSelect:q,RangeTime:z,ReportTable:X,ReportText:I,ReportChart:Z,ReportDescribe:v},r=N(),a=n,l=e.useModel(n,"modelValue"),i=e.ref([]),u=e.ref([]),d=e.ref([]),_=e.ref(""),m=e.ref("");function p(){l.value="table"}const h=s=>{d.value=s,b()},c=s=>{s&&s.length>0&&(_.value=s[0],m.value=s[1]),b()},b=async()=>{try{o.value=!0;const s={report_uuid:a.reportId,start_time:_.value,end_time:m.value,select_data:d.value.join(",")},f=await ue(s),y=[];f.data.forEach(x=>{(x.type==="report-select"||x.type==="range-time")&&y.push(x)}),i.value=y,f.data.splice(0,i.value.length),u.value=f.data,o.value=!1}catch(s){o.value=!1,console.error("Error setting loading state:",s)}};b();const g=()=>e.createVNode("div",null,[e.createTextVNode("未找到对应组件")]),C=s=>s==="h2"||s==="h3"||s==="h4"?$(t,"ReportText"):s==="bar"||s==="pie"||s==="line"?$(t,"ReportChart"):s?$(t,s):e.createVNode(g,null,null);return(s,f)=>{const y=e.resolveComponent("el-button"),x=e.resolveComponent("el-card"),ie=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(x,{class:"editor view","element-loading-text":"加载中..."},{default:e.withCtx(()=>[e.createElementVNode("div",Qe,[e.createVNode(je,{data:u.value},null,8,["data"]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,k=>(e.openBlock(),e.createElementBlock("div",{class:"item-input",key:k.id},[k.type==="report-select"?(e.openBlock(),e.createBlock(q,{key:0,onChange:h,value:k},null,8,["value"])):e.createCommentVNode("",!0),k.type==="range-time"&&e.unref(r).filterForm.range_time?(e.openBlock(),e.createBlock(z,{key:1,onChange:c,value:k},null,8,["value"])):e.createCommentVNode("",!0)]))),128)),e.createVNode(y,{plain:"",onClick:p,type:"primary",class:"custom-btn",style:{"margin-left":"auto"}},{default:e.withCtx(()=>f[0]||(f[0]=[e.createTextVNode("退出预览")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k.id,class:e.normalizeClass(["editor-content",["editor"+k.type]]),id:k.id},[k.type!=="p"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C(k.type)),{key:0,class:e.normalizeClass(["editor"+k.type]),value:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.data),1)]),_:2},1032,["class","value"])):(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:k.data},null,8,et))],10,ve))),128))])])]),_:1})),[[ie,o.value]])}}}),Pt="",ot=R(tt,[["__scopeId","data-v-db45c725"]]),nt={class:"editor"},lt={class:"editor-content edit"},rt=["onClick"],at=["onClick"],it=["innerHTML","draggable"],st=e.defineComponent({__name:"Editor",setup(n){const o={Bar:G,Line:J,Pie:Q,ReportSelect:q,RangeTime:z,ReportTable:X,ReportText:I,ReportChart:Z,ReportDescribe:v},{componentList:t,activeComponents:r,notDraggableList:a,titleComponent:l}=P.storeToRefs(N()),i=N(),u=C=>{t.value.forEach((s,f)=>{s.id===C&&(t.value.splice(f,1),i.activeComponents=[])})},d=C=>{i.setActiveComponents(C)},_=()=>e.createVNode("div",null,[e.createTextVNode("未找到对应组件")]),m=C=>C==="h2"||C==="h3"||C==="h4"?$(o,"ReportText"):C==="bar"||C==="pie"||C==="line"?$(o,"ReportChart"):C?$(o,C):e.createVNode(_,null,null),p=C=>{console.log(C,"evt")},h=e.ref(!1),c=()=>{h.value=!0},b=C=>{C.newIndex!==0&&(console.log(C),h.value=!1)},g=e.ref();return(C,s)=>{const f=e.resolveComponent("icon-material-symbols:cancel-outline");return e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",{class:e.normalizeClass(["editor-content edit flex flex-start",[{active:e.unref(r).id==="filter"}]]),onClick:s[0]||(s[0]=y=>d({id:"filter",type:"filter"}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),y=>(e.openBlock(),e.createElementBlock("div",{class:"item-input",key:y.id},[y.type==="report-select"||y.type==="range-time"&&e.unref(i).filterForm.range_time?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref($)(o,y.type)),{key:0,value:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.data),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)]))),128))],2),e.createElementVNode("div",lt,[e.createVNode(I,{value:e.unref(l),onClick:s[1]||(s[1]=y=>d(e.unref(l)))},null,8,["value"])]),e.createVNode(e.unref(de.VueDraggable),{ref_key:"el",ref:g,modelValue:e.unref(t),"onUpdate:modelValue":s[2]||(s[2]=y=>e.isRef(t)?t.value=y:null),"on-change":p,animation:150,onStart:c,onEnd:b},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t),y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,class:e.normalizeClass(["editor-content edit",["editor"+y.type,{active:y.id===e.unref(r).id}]]),onClick:x=>d(y)},[e.createElementVNode("i",{onClick:e.withModifiers(x=>u(y.id),["stop"])},[e.createVNode(f,{class:"color-red"})],8,at),y.type!=="p"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(y.type)),{key:0,class:e.normalizeClass(["editor"+y.type]),value:y,draggable:h.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.data),1)]),_:2},1032,["class","value","draggable"])):(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:y.data,draggable:h.value},null,8,it))],10,rt))),128))]),_:1},8,["modelValue"])])}}}),dt={class:"label"},pt={class:"flex item-switch"},ct={class:"flex item-switch"},mt={class:"flex item-switch"},ee=e.defineComponent({__name:"SettingTable",setup(n){const o=N(),t=e.computed(()=>o.getActiveComponents);return(r,a)=>{const l=e.resolveComponent("el-switch"),i=e.resolveComponent("el-form-item"),u=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{label:"控制列"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.showColumn,(d,_)=>(e.openBlock(),e.createElementBlock("p",{class:"flex item-switch",key:_},[e.createElementVNode("span",dt,e.toDisplayString(d.name),1),e.createVNode(l,{modelValue:t.value.options.showColumn[d.key],"onUpdate:modelValue":m=>t.value.options.showColumn[d.key]=m},null,8,["modelValue","onUpdate:modelValue"])]))),128))]),_:1}),e.createVNode(u),e.createVNode(i,{label:"表格样式"},{default:e.withCtx(()=>[e.createElementVNode("p",pt,[a[3]||(a[3]=e.createElementVNode("span",{class:"label"},"斑马纹",-1)),e.createVNode(l,{modelValue:t.value.options.stripe,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value.options.stripe=d)},null,8,["modelValue"])]),e.createElementVNode("p",ct,[a[4]||(a[4]=e.createElementVNode("span",{class:"label"},"边框",-1)),e.createVNode(l,{modelValue:t.value.options.border,"onUpdate:modelValue":a[1]||(a[1]=d=>t.value.options.border=d)},null,8,["modelValue"])]),e.createElementVNode("p",mt,[a[5]||(a[5]=e.createElementVNode("span",{class:"label"},"表头",-1)),e.createVNode(l,{modelValue:t.value.options.showHeader,"onUpdate:modelValue":a[2]||(a[2]=d=>t.value.options.showHeader=d)},null,8,["modelValue"])])]),_:1})])}}}),ut={key:0},_t=e.defineComponent({__name:"ChartsUniConfig",setup(n){const o=N(),t=e.computed(()=>o.activeComponents);function r(a){a?(t.value.options.series[0].radius=["10%","65%"],t.value.options.graphic[0].invisible=!0,t.value.options.graphic[1].invisible=!0):(t.value.options.series[0].radius=["45%","70%"],t.value.options.graphic[0].invisible=!1,t.value.options.graphic[1].invisible=!1)}return e.ref("rgb(46, 145, 255)"),(a,l)=>{const i=e.resolveComponent("el-input"),u=e.resolveComponent("el-form-item"),d=e.resolveComponent("el-switch"),_=e.resolveComponent("el-col"),m=e.resolveComponent("el-color-picker"),p=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-row"),c=e.resolveComponent("el-collapse-item"),b=e.resolveComponent("el-collapse");return t.value.options.title?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(u,{label:"标题"},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:t.value.options.title.text,"onUpdate:modelValue":l[0]||(l[0]=g=>t.value.options.title.text=g)},null,8,["modelValue"])]),_:1}),e.createVNode(b,null,{default:e.withCtx(()=>[e.createVNode(c,{title:"标题配置",name:"1"},{default:e.withCtx(()=>[e.createVNode(h,{class:"w-100%"},{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[8]||(l[8]=e.createElementVNode("span",{class:"switch-label"},"显示标题",-1)),e.createVNode(d,{modelValue:t.value.options.title.show,"onUpdate:modelValue":l[1]||(l[1]=g=>t.value.options.title.show=g)},null,8,["modelValue"])]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:t.value.options.title.textStyle.color,"onUpdate:modelValue":l[2]||(l[2]=g=>t.value.options.title.textStyle.color=g),"show-alpha":""},null,8,["modelValue"]),l[9]||(l[9]=e.createElementVNode("p",{class:"sub-title"},"颜色",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.textStyle.fontSize,"onUpdate:modelValue":l[3]||(l[3]=g=>t.value.options.title.textStyle.fontSize=g),"controls-position":"right"},null,8,["modelValue"]),l[10]||(l[10]=e.createElementVNode("p",{class:"sub-title"},"字体大小",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.x,"onUpdate:modelValue":l[4]||(l[4]=g=>t.value.options.title.x=g),"controls-position":"right"},null,8,["modelValue"]),l[11]||(l[11]=e.createElementVNode("p",{class:"sub-title"},"横向",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.y,"onUpdate:modelValue":l[5]||(l[5]=g=>t.value.options.title.y=g),"controls-position":"right"},null,8,["modelValue"]),l[12]||(l[12]=e.createElementVNode("p",{class:"sub-title"},"纵向",-1))]),_:1})]),_:1})]),_:1}),e.createVNode(c,{title:"图形配置",name:"2"},{default:e.withCtx(()=>[t.value.options.color&&t.value.options.color.length&&t.value.type==="pie"?(e.openBlock(),e.createBlock(h,{key:0},{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[13]||(l[13]=e.createElementVNode("span",{class:"switch-label"},"玫瑰图",-1)),e.createVNode(d,{onChange:r,modelValue:t.value.options.series[0].roseType,"onUpdate:modelValue":l[6]||(l[6]=g=>t.value.options.series[0].roseType=g)},null,8,["modelValue"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{title:"图例配置",name:"3"},{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[14]||(l[14]=e.createElementVNode("span",{class:"switch-label"},"显示图例",-1)),t.value.options.legend?(e.openBlock(),e.createBlock(d,{key:0,modelValue:t.value.options.legend.show,"onUpdate:modelValue":l[7]||(l[7]=g=>t.value.options.legend.show=g)},null,8,["modelValue"])):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1})])):e.createCommentVNode("",!0)}}}),jt="",ft=R(_t,[["__scopeId","data-v-e9859d3b"]]),te=e.defineComponent({__name:"SettingDescribe",setup(n){const o=N(),t=e.computed(()=>o.getActiveComponents);return(r,a)=>{const l=e.resolveComponent("el-input"),i=e.resolveComponent("el-form-item"),u=e.resolveComponent("el-switch"),d=e.resolveComponent("el-input-number"),_=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{label:"标题"},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:t.value.options.title,"onUpdate:modelValue":a[0]||(a[0]=p=>t.value.options.title=p)},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"边框"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:t.value.options.border,"onUpdate:modelValue":a[1]||(a[1]=p=>t.value.options.border=p)},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"每行展示数量"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:t.value.options.column,"onUpdate:modelValue":a[2]||(a[2]=p=>t.value.options.column=p),min:1,max:10,controls:!1},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"排列方向"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:t.value.options.direction,"onUpdate:modelValue":a[3]||(a[3]=p=>t.value.options.direction=p)},{default:e.withCtx(()=>[e.createVNode(_,{value:"horizontal"},{default:e.withCtx(()=>a[4]||(a[4]=[e.createTextVNode("横向")])),_:1}),e.createVNode(_,{value:"vertical"},{default:e.withCtx(()=>a[5]||(a[5]=[e.createTextVNode("纵向")])),_:1})]),_:1},8,["modelValue"])]),_:1})])}}}),bt=e.defineComponent({__name:"SettingCharts",setup(n){const o=N(),t=e.ref(!1),r=e.computed(()=>o.getActiveComponents),a=[{value:"report-describe",name:"描述列表"},{value:"report-table",name:"表格"},{value:"line",name:"趋势图"},{value:"pie",name:"扇形图"},{value:"bar",name:"柱状图"}],l=e.ref(""),i=e.ref();async function u(m){const p=await O({prod_type:window.$prodType,chart_type:m,filter_uuid:o.filterForm.filter_uuid});i.value=p.data}function d(m){let p=i.value.find(c=>c.rp_item_uuid===m);const h=p.rp_item_content;if(p.rp_item_content.type==="bar"&&(h.options=S()),h.type==="pie"&&(h.options=U({isLegend:!0})),h.type==="line"){let c=[];h.data.forEach(g=>{c=g.data.map((C,s)=>({name:C.name,value:"value"+s}))});const b={name:"name",value:c};h.options=L([],b)}if(h.type==="report-table"){const c={};h.showColumn.forEach(b=>{c[b.key]=!0}),h.options={...h.options,showColumn:c,border:!0,showHeader:!0,stripe:!1}}h.type==="report-describe"&&(h.options={...h.options,title:"",border:!0,column:1,direction:"horizontal",...r.value.options}),Object.assign(o.activeComponents,h),o.activeComponents.rp_item_uuid=p.rp_item_uuid}e.onMounted(async()=>{l.value=r.value.type,await u(l.value)});async function _(m){try{t.value=!0,await u(m),Object.assign(o.activeComponents,ze(m)),t.value=!1}catch{t.value=!1}}return e.watch(()=>r.value,m=>{console.log(m,"activeComponents"),~["bar","pie","line","report-table","report-describe"].indexOf(m.type)&&(l.value=r.value.type,u(l.value))}),(m,p)=>{const h=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),b=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-form"),C=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(b,{label:"图表类型"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=s=>l.value=s),onChange:_},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(s,f)=>e.createVNode(h,{key:f,label:s.name,value:s.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(b,{label:"组件库"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:e.unref(o).activeComponents.rp_item_uuid,"onUpdate:modelValue":p[1]||(p[1]=s=>e.unref(o).activeComponents.rp_item_uuid=s),onChange:d},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(s,f)=>(e.openBlock(),e.createBlock(h,{key:f,label:s.rp_item_name,value:s.rp_item_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value==="report-table"&&r.value.options.showColumn?(e.openBlock(),e.createBlock(ee,{key:0})):e.createCommentVNode("",!0),l.value==="pie"||l.value==="bar"||l.value==="line"?(e.openBlock(),e.createBlock(ft,{key:1})):e.createCommentVNode("",!0),l.value==="report-describe"?(e.openBlock(),e.createBlock(te,{key:2})):e.createCommentVNode("",!0)]),_:1})])),[[C,t.value]])}}}),ht={key:0},Ct={style:{border:"1px solid #ccc","border-radius":"3px"}},oe="default",gt=e.defineComponent({__name:"SettingText",setup(n){const o=N(),t=e.shallowRef(),r=e.ref();function a(m){const p=r.value.find(h=>h.rp_item_uuid===m);o.activeComponents.uri=p.rp_item_content.uri,t.value.setHtml((p==null?void 0:p.rp_item_content.data)||"")}async function l(){const m=await O({prod_type:window.$prodType,chart_type:"p",filter_uuid:o.filterForm.filter_uuid});r.value=m.data}l();const i={toolbarKeys:["bold","underline","italic","through","code","bulletedList","numberedList","clearStyle","color","bgColor","fontSize","fontFamily","justifyLeft","justifyRight","justifyCenter","justifyJustify","lineHeight"]},u={placeholder:"请输入内容..."},d=m=>{t.value=m},_=m=>{};return e.onBeforeUnmount(()=>{const m=t.value;m!=null&&m.destroy()}),(m,p)=>{const h=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),b=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-form");return e.unref(o).activeComponents.id?(e.openBlock(),e.createElementBlock("div",ht,[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(b,{label:"组件库"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:e.unref(o).activeComponents.rp_item_uuid,"onUpdate:modelValue":p[0]||(p[0]=C=>e.unref(o).activeComponents.rp_item_uuid=C),onChange:a},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(C,s)=>(e.openBlock(),e.createBlock(h,{key:s,label:C.rp_item_name,value:C.rp_item_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(b,{label:"文本内容"},{default:e.withCtx(()=>[e.createElementVNode("div",Ct,[e.createVNode(e.unref(j.Toolbar),{style:{"border-bottom":"1px solid #ccc"},editor:t.value,"default-config":i,mode:oe},null,8,["editor"]),e.createVNode(e.unref(j.Editor),{style:{height:"500px","overflow-y":"hidden"},onOnChange:_,modelValue:e.unref(o).activeComponents.data,"onUpdate:modelValue":p[1]||(p[1]=C=>e.unref(o).activeComponents.data=C),"default-config":u,mode:oe,onOnCreated:d},null,8,["modelValue"])])]),_:1})]),_:1})])):e.createCommentVNode("",!0)}}}),yt=e.defineComponent({__name:"SettingFilter",setup(n){const o=e.ref([]),t=N();async function r(){const a=await W({prod_type:window.$prodType});o.value=a.data}return r(),(a,l)=>{const i=e.resolveComponent("el-option"),u=e.resolveComponent("el-select"),d=e.resolveComponent("el-form-item"),_=e.resolveComponent("el-checkbox"),m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(m,{"label-width":"80px","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(d,{label:"筛选条件"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:e.unref(t).filterForm.filter_uuid,"onUpdate:modelValue":l[0]||(l[0]=p=>e.unref(t).filterForm.filter_uuid=p),disabled:!!e.unref(t).filterForm.filter_uuid},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createBlock(i,{key:p.filter_uuid,label:p.filter_name,value:p.filter_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:e.unref(t).filterForm.range_time,"onUpdate:modelValue":l[1]||(l[1]=p=>e.unref(t).filterForm.range_time=p),"true-value":1,"false-value":0,label:"时间范围"},null,8,["modelValue"])]),_:1})]),_:1})}}}),wt=e.defineComponent({__name:"SettingTitle",setup(n){const o=N();return(t,r)=>{const a=e.resolveComponent("el-input"),l=e.resolveComponent("el-form-item"),i=e.resolveComponent("el-color-picker"),u=e.resolveComponent("el-col"),d=e.resolveComponent("el-input-number"),_=e.resolveComponent("el-option"),m=e.resolveComponent("el-select"),p=e.resolveComponent("el-row"),h=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(h,{"label-width":"auto","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(l,{label:"名称"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:e.unref(o).activeComponents.data,"onUpdate:modelValue":r[0]||(r[0]=c=>e.unref(o).activeComponents.data=c),placeholder:"Please input",maxlength:"24","show-word-limit":""},null,8,["modelValue"])]),_:1}),e.createVNode(l,{label:"样式"},{default:e.withCtx(()=>[e.createVNode(p,{gutter:20},{default:e.withCtx(()=>[e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:e.unref(o).activeComponents.options.color,"onUpdate:modelValue":r[1]||(r[1]=c=>e.unref(o).activeComponents.options.color=c),"show-alpha":""},null,8,["modelValue"]),r[7]||(r[7]=e.createElementVNode("p",{class:"sub-title"},"颜色",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.size,"onUpdate:modelValue":r[2]||(r[2]=c=>e.unref(o).activeComponents.options.size=c),"controls-position":"right"},null,8,["modelValue"]),r[8]||(r[8]=e.createElementVNode("p",{class:"sub-title"},"字体大小",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:e.unref(o).activeComponents.options.fontWeight,"onUpdate:modelValue":r[3]||(r[3]=c=>e.unref(o).activeComponents.options.fontWeight=c)},{default:e.withCtx(()=>[e.createVNode(_,{label:"常规",value:500}),e.createVNode(_,{label:"加粗",value:600})]),_:1},8,["modelValue"]),r[9]||(r[9]=e.createElementVNode("p",{class:"sub-title"},"字体粗细",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.letterSpacing,"onUpdate:modelValue":r[4]||(r[4]=c=>e.unref(o).activeComponents.options.letterSpacing=c),"controls-position":"right"},null,8,["modelValue"]),r[10]||(r[10]=e.createElementVNode("p",{class:"sub-title"},"字间距",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.textIndent,"onUpdate:modelValue":r[5]||(r[5]=c=>e.unref(o).activeComponents.options.textIndent=c),"controls-position":"right"},null,8,["modelValue"]),r[11]||(r[11]=e.createElementVNode("p",{class:"sub-title"},"首行缩进",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:e.unref(o).activeComponents.options.textAlign,"onUpdate:modelValue":r[6]||(r[6]=c=>e.unref(o).activeComponents.options.textAlign=c)},{default:e.withCtx(()=>[e.createVNode(_,{label:"左对齐",value:"left"}),e.createVNode(_,{label:"居中对齐",value:"center"}),e.createVNode(_,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"]),r[12]||(r[12]=e.createElementVNode("p",{class:"sub-title"},"位置",-1))]),_:1})]),_:1})]),_:1})]),_:1})}}}),Ht="",Vt=R(wt,[["__scopeId","data-v-56fef84c"]]),kt=e.defineComponent({__name:"Setting",setup(n){const o={SettingTable:ee,SettingCharts:bt,SettingDescribe:te,SettingText:gt,SettingFilter:yt,SettingTitle:Vt},t=N(),r=e.computed(()=>t.activeComponents),a=["h1","h2","h3","h4"],l=["p"],i=["report-table","bar","line","pie","report-describe"],u=d=>a.includes(d)?$(o,"SettingTitle"):l.includes(d)?$(o,"SettingText"):i.includes(d)?$(o,"SettingCharts"):d==="filter"?$(o,"SettingFilter"):"DefaultEditor";return(d,_)=>{const m=e.resolveComponent("el-card");return e.openBlock(),e.createBlock(m,{class:"config-wrapper"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(r.value.type))))]),_:1})}}}),xt={class:"editor-wrapper flex items-center space-between start"},Nt={class:"flex items-center space-between"},$t={class:"btn-group"},Bt=e.defineComponent({__name:"index",props:e.mergeModels({reportId:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=N(),t=n,r=e.useModel(n,"modelValue"),a=d=>{const _=E(d);_.id=T(),o.componentList.push(_)};function l(){r.value="table"}function i(){o.getReportDemo(t.reportId)}e.onMounted(()=>{i()});async function u(){if(!o.filterForm.filter_uuid){se.ElMessage.error("请选择筛选条件");return}try{t.reportId?await fe({report_uuid:t.reportId,data:{report_name:o.titleComponent.data,prod_type:window.$prodType,content:[...o.notDraggableList,o.titleComponent,...o.componentList],...o.filterForm}}):await _e({data:{report_name:o.titleComponent.data,prod_type:window.$prodType,content:[...o.notDraggableList,o.titleComponent,...o.componentList],...o.filterForm}}),l()}catch(d){console.log(d,"error")}}return e.onUnmounted(()=>{o.clearComponents()}),(d,_)=>{const m=e.resolveComponent("el-button"),p=e.resolveComponent("el-button-group"),h=e.resolveComponent("el-card");return e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(h,{class:"view-wrapper"},{default:e.withCtx(()=>[e.createElementVNode("div",Nt,[e.createElementVNode("div",$t,[e.createVNode(p,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qe),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.type},[c!=null&&c.hide?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,onClick:b=>a(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.name),1)]),_:2},1032,["onClick"]))],64))),128))]),_:1})]),e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(m,{type:"primary",onClick:u},{default:e.withCtx(()=>_[0]||(_[0]=[e.createTextVNode("保存")])),_:1}),e.createVNode(m,{onClick:l},{default:e.withCtx(()=>_[1]||(_[1]=[e.createTextVNode("退出")])),_:1})]),_:1})]),e.createVNode(st)]),_:1}),e.createVNode(kt)])}}}),Tt={class:"table-box"},Et=e.defineComponent({__name:"Report",emits:["click"],setup(n,{emit:o}){const t=e.computed(()=>({prod_type:window.$prodType})),r=e.ref(),a=o,l=p=>{a("click",p.report_uuid,"review")},i=p=>{a("click",p.report_uuid,"editor")},u=()=>{a("click","","editor")},d=p=>{console.log(p)},_=p=>{window.$messageBox("确定要删除吗?","","删除","error").then(async()=>{await he({report_uuids:p}),r.value.getTableList()})},m=e.reactive([{type:"selection",width:80},{field:"report_name",name:"名称",search:{type:"input"}},{field:"report_desc",name:"报表描述"},{field:"create_time",name:"创建时间"},{field:"operation",width:140,name:"操作",align:"center",fixed:"right",render:p=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"View",title:"预览",onClick:()=>l(p.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"Edit",title:"编辑",onClick:()=>i(p.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:"删除",onClick:()=>_([p.row.report_uuid])},null)])}]);return(p,h)=>{const c=e.resolveComponent("el-button"),b=e.resolveComponent("TdsTable");return e.openBlock(),e.createElementBlock("div",Tt,[e.createVNode(b,{ref_key:"proTable",ref:r,columns:m,"request-api":e.unref(be),"init-param":t.value,"row-key":"report_uuid",options:p.$tableOptions(),"search-col":6,onSelectionChange:d},{tableHeader:e.withCtx(g=>[e.createVNode(c,{plain:"",type:"primary",class:"custom-btn",icon:"Plus",onClick:u},{default:e.withCtx(()=>h[0]||(h[0]=[e.createTextVNode("添加")])),_:1}),e.createVNode(c,{plain:"",type:"danger",icon:"Delete",onClick:C=>_(g.selectedListIds)},{default:e.withCtx(()=>h[1]||(h[1]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1},8,["columns","request-api","init-param","options"])])}}}),Ot="",St={style:{height:"100%"}},Lt=e.defineComponent({name:"TCReport",__name:"index",setup(n){const o=e.ref(),t=e.ref("table"),r=(a,l)=>{o.value=a,t.value=l};return(a,l)=>(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(e.TransitionGroup,{name:"slide-fade"},{default:e.withCtx(()=>[t.value==="table"?(e.openBlock(),e.createBlock(Et,{key:0,onClick:r})):e.createCommentVNode("",!0),t.value==="review"?(e.openBlock(),e.createBlock(ot,{key:1,"report-id":o.value,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},null,8,["report-id","modelValue"])):e.createCommentVNode("",!0),t.value==="editor"?(e.openBlock(),e.createBlock(Bt,{key:2,"report-id":o.value,modelValue:t.value,"onUpdate:modelValue":l[1]||(l[1]=i=>t.value=i)},null,8,["report-id","modelValue"])):e.createCommentVNode("",!0)]),_:1})]))}}),Wt="",M=(n,o)=>{if(n.install=t=>{for(const r of[n,...Object.values(o??{})])t.component(r.name,r)},o)for(const[t,r]of Object.entries(o))n[t]=r;return n},ne=M(Lt),Rt=[{label:"正文",value:"p"},{label:"表格",value:"report-table"},{label:"趋势图",value:"line"},{label:"扇形统计图",value:"pie"},{label:"柱形图",value:"bar"},{label:"描述列表",value:"report-describe"}],Ut=[{value:"p",fields:["table_key_relation"]},{value:"report-table",fields:["p_text"]},{value:"line",fields:["p_text","table_key_relation"]},{value:"pie",fields:["p_text","table_key_relation"]},{value:"bar",fields:["p_text","table_key_relation"]},{value:"report-describe",fields:["p_text"]}],Ft={class:"table-box"},Dt=e.defineComponent({name:"TCModule",__name:"index",setup(n){const o=e.ref(),t=e.ref(),r=e.ref({}),a=e.ref(""),l=e.reactive({prod_type:window.$prodType});function i(c){window.$messageBox("确定要删除吗?","","删除","error").then(async()=>{await ge({rp_item_uuids:c}),o.value.getTableList()})}function u(c){r.value=c?Object.assign({},c):{table_key_relation:[{name:"",key:"",id:new Date().getTime()}]},a.value=c?"编辑自定义组件":"新增自定义组件",t.value.open()}async function d(c){const b=Object.assign({},c);b.chart_type!=="report-table"&&b.chart_type!=="report-describe"&&delete b.table_key_relation,b.chart_type!=="p"&&(b.p_text=""),b.rp_item_uuid?await we({rp_item_uuid:b.rp_item_uuid,data:b}):(b.prod_type=window.$prodType,await ye({data:b})),o.value.getTableList(),t.value.close()}const _=c=>{r.value.table_key_relation.splice(c,1)},m=()=>{r.value.table_key_relation.push({name:"",key:"",id:new Date().getTime()})},p=(c,b,g)=>{delete c.message,b.forEach(C=>{C.name?C.key||g(new Error("请填写表头名称和KEY")):g(new Error("请填写表头名称和KEY"))}),g()},h=e.reactive([{type:"selection",width:60,field:"rp_item_uuid",align:"center"},{field:"rp_item_name",name:"组件名称",show:{type:"input"},rules:[{required:!0}]},{field:"filter_uuid",name:"筛选条件",enum:()=>W({prod_type:window.$prodType}),fieldNames:{label:"filter_name",value:"filter_uuid"},show:{type:"select"},rules:[{required:!0}]},{field:"chart_type",name:"组件类型",enum:Rt,show:{type:"select",display:Ut},rules:[{required:!0}]},{field:"data_uri",name:"URI",show:{type:"input"},rules:[{required:!0}]},{field:"table_key_relation",name:"表格数据",hide:!0,show:{render:()=>{var c;return e.createVNode("div",{style:"width:80%"},[e.createVNode("div",{class:"flex items-center space-between report-com-title",style:"gap:15px;"},[e.createVNode("span",{style:"width:50%"},[e.createTextVNode("表头名称")]),e.createVNode("span",{style:"width:50%"},[e.createTextVNode("KEY")])]),(c=r.value.table_key_relation)==null?void 0:c.map((b,g)=>e.createVNode("div",{class:"flex items-center space-between form-m0 w-100%",style:"gap:15px;margin-bottom:10px;",key:g},[e.createVNode(e.resolveComponent("el-form-item"),{style:"width:50%"},{default:()=>[e.createVNode(e.resolveComponent("el-input"),{modelValue:b.name,"onUpdate:modelValue":C=>b.name=C,class:"",placeholder:"表头"},null)]}),e.createVNode(e.resolveComponent("el-form-item"),{style:"width:50%"},{default:()=>[e.createVNode(e.resolveComponent("el-input"),{modelValue:b.key,"onUpdate:modelValue":C=>b.key=C,class:"",placeholder:"KEY"},null)]}),r.value.table_key_relation.length>1&&e.createVNode("div",{class:"report-btn-remove absolute right--13px text-#f56c6c hover:cursor-pointer"},[e.createVNode(e.resolveComponent("el-icon"),{onClick:()=>_(g)},{default:()=>[e.createVNode(pe.CircleClose,null,null)]})])])),e.createVNode(e.resolveComponent("el-button"),{class:"report-btn ",icon:"Plus",onClick:()=>m()},{default:()=>[e.createTextVNode("新增表头与KEY")]})])}},prop:{required:!0},rules:[{required:!0,validator:p,trigger:"blur"}]},{field:"p_text",name:"正文",hide:!0,show:{type:"input",prop:{type:"textarea",rows:4}},rules:[{required:!0}]},{field:"create_time",name:"创建时间"},{field:"operation",width:140,name:"操作",align:"center",fixed:"right",render:c=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"Edit",title:"编辑",onClick:()=>u(c.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:"删除",onClick:()=>i([c.row.rp_item_uuid])},null)])}]);return(c,b)=>{const g=e.resolveComponent("el-button"),C=e.resolveComponent("TdsTable"),s=e.resolveComponent("TdsForm");return e.openBlock(),e.createElementBlock("div",Ft,[e.createVNode(C,{ref_key:"refTdsTable",ref:o,columns:h,"request-api":e.unref(Ce),"init-param":l,"row-key":"rp_item_uuid",options:c.$tableOptions(),"search-col":6},{tableHeader:e.withCtx(f=>[e.createVNode(g,{plain:"",type:"primary",class:"custom-btn",icon:"Plus",onClick:b[0]||(b[0]=y=>u())},{default:e.withCtx(()=>b[1]||(b[1]=[e.createTextVNode("添加")])),_:1}),e.createVNode(g,{plain:"",type:"danger",icon:"Delete",onClick:y=>i(f.selectedListIds)},{default:e.withCtx(()=>b[2]||(b[2]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1},8,["columns","request-api","init-param","options"]),e.createVNode(s,e.mergeProps({ref_key:"refTdsForm",ref:t},c.$formBindProps({title:a.value,form:r.value,columns:h}),{onSubmit:d}),null,16)])}}}),Yt="",le=M(Dt),At={class:"table-box"};function re(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const ae=M(e.defineComponent({name:"TCSubscribe",__name:"index",setup(n){const o=e.ref(),t=e.ref(),{$t:r,$messageBox:a}=window,l=e.ref(""),i=e.ref({receiver:[]});function u(s){a(s,"subscript_name",r("button.delete"),"error").then(async()=>{await Ne({subscript_uuids:s.map(f=>f.subscript_uuid)}),o.value.getTableList()})}function d(){u(o.value.selectedList)}const _=s=>{i.value=s?Object.assign({},s):{receiver:[]},l.value=s?"编辑报表订阅":"新增报表订阅",t.value.open()};async function m(s){const f=Object.assign({},s);f.subscript_uuid?await xe({subscript_uuid:f.subscript_uuid,data:f}):await ke({data:f}),o.value.getTableList(),t.value.close()}function p(s,f,y){if(!f||f.length===0)return y(new Error("请输入收件人"));y()}const h=(s,f)=>{s.target.value&&i.value[f].push(s.target.value)},c=[{label:"周一",value:1},{label:"周二",value:2},{label:"周三",value:3},{label:"周四",value:4},{label:"周五",value:5},{label:"周六",value:6},{label:"周日",value:0}],b=[{label:"每天",value:0},{label:"每周",value:1},{label:"每月",value:2}],g=[],C=e.reactive([{type:"selection",align:"center",field:"subscript_uuid",width:80},{field:"subscript_name",name:"订阅名称",show:{type:"input",order:1},rules:[{required:!0,message:"请输入名称",trigger:"blur"}]},{field:"subscript_desc",name:"订阅描述",show:{type:"input",order:2}},{field:"report_uuid",name:"报表类型",enum:()=>Be({prod_type:window.$prodType}),fieldNames:{label:"report_name",value:"report_uuid"},show:{type:"select"},rules:[{required:!0,type:"any"}]},{field:"format",name:"报表格式",enum:Te,fieldNames:{label:"name",value:"id"},show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"select_data",name:"资产/任务",enum:Ee,fieldNames:{label:"label",value:"data"},hide:!0,show:{type:"select",prop:{multiple:!0}},params:{report_uuid:"report_uuid",prod_type:{type:2,key:window.$prodType}},render:s=>o.value.enumMap.get("dbsId").filter(x=>s.row.dbsId.indexOf(x.id)>-1).map(x=>e.createVNode(e.resolveComponent("el-tag"),{class:"mr-10px",type:"info"},{default:()=>[x.policy_name]}))},{field:"receiver_email",name:"收件人",width:300,render:s=>e.createVNode(e.Fragment,null,[s.row.receiver_email.map(f=>e.createVNode(e.resolveComponent("el-tag"),{class:"mr-10px",type:"info"},re(f)?f:{default:()=>[f]}))]),show:{type:"input",render:()=>{let s;return e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("el-select"),{class:"right-select",modelValue:i.value.receiver_email,"onUpdate:modelValue":f=>i.value.receiver_email=f,placeholder:"请输入",multiple:!0,filterable:!0,"allow-create":!0,"default-first-option":!0,"reserve-keyword":!1,onBlur:f=>h(f,"receiver_email")},re(s=g.map(f=>e.createVNode(e.resolveComponent("el-option"),{label:f.label,value:f.value},null)))?s:{default:()=>[s]}),e.createVNode("p",{style:"font-size:12px;color:#909399;line-height:20px"},[e.createTextVNode("可输入多个收件人邮箱,多个值间以“回车键”分隔,例:xxx@163.com xx@qq.com")])])}},rules:[{required:!0,validator:p,type:"any",trigger:"change"}]},{field:"show_timing_time",name:"发送周期"},{field:"loop_type",name:"发送周期",hide:!0,enum:b,show:{dataType:"number",type:"select",display:[{value:0,fields:["day","weekday"]},{value:1,fields:["day"]},{value:2,fields:["weekday"]}]},rules:[{required:!0,type:"number"}]},{field:"day",name:"日",hide:!0,enum:[...Array(28)].map((s,f)=>({label:f+1+"",value:f+1})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"weekday",name:"星期",hide:!0,enum:c,show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"hour",name:"小时",hide:!0,enum:[...Array(24)].map((s,f)=>({label:f+"时",value:f})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"minute",name:"分钟",hide:!0,enum:[...Array(60)].map((s,f)=>({label:f+"分",value:f})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"enable_status",name:"启用状态",render:s=>e.createVNode(e.resolveComponent("el-switch"),{modelValue:s.row.enable_status,"onUpdate:modelValue":f=>s.row.enable_status=f,"active-value":1,"inactive-value":0,onChange:f=>{$e({subscript_uuid:s.row.subscript_uuid,enable_status:f}),o.value.getTableList()}},null)},{field:"operation",name:"操作",fixed:"right",cardHide:!0,width:120,render:s=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",icon:"Edit",title:r("button.edit"),class:"custom-btn",onClick:()=>_(s.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:r("button.delete"),onClick:()=>u([s.row])},null)])}]);return(s,f)=>{const y=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(H.TdsTable),{ref_key:"refTdsTable",ref:o,"row-key":"subscript_uuid","request-api":e.unref(Ve),columns:C,options:s.$tableOptions()},{tableHeader:e.withCtx(x=>[e.createVNode(y,{type:"primary",icon:"Plus",class:"custom-btn",plain:"",onClick:f[0]||(f[0]=ie=>_())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("button.add")),1)]),_:1}),e.createVNode(y,{type:"danger",icon:"Delete",plain:"",onClick:d,disabled:!x.selectedListIds.length},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("button.delete")),1)]),_:2},1032,["disabled"])]),_:1},8,["request-api","columns","options"]),e.createVNode(e.unref(H.TdsForm),e.mergeProps({ref_key:"refTdsForm",ref:t},s.$formBindProps({title:l.value,form:i.value,columns:C}),{onSubmit:m}),null,16)])}}})),qt={TCReport:ne,TCModule:le,TCSubscribe:ae},zt={install(n,o){Object.entries(qt).forEach(([t,r])=>{n.component(t,r)}),o.prodType&&(window.$prodType=o.prodType),o.envURL&&(window.$reportURL=o.envURL)}};w.TCModule=le,w.TCReport=ne,w.TCSubscribe=ae,w.default=zt,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("element-plus"),require("vue-draggable-plus"),require("@wangeditor/editor-for-vue"),require("@element-plus/icons-vue"),require("topdatasec-ui")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","element-plus","vue-draggable-plus","@wangeditor/editor-for-vue","@element-plus/icons-vue","topdatasec-ui"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.TReportUI={},w.Vue,w.Pinia,w.ElementPlus,w.VueDraggable,w.Editor,w.IconsVue,w.TopdatasecUI))})(this,function(w,e,j,se,de,H,pe,O){"use strict";const T=()=>new Date().getTime().toString(36)+"-"+Math.random().toString(36).substring(2,9),E=n=>JSON.parse(JSON.stringify(n)),ce=n=>n.replace(/-([a-z])/g,(o,t)=>t.toUpperCase()).replace(/^[a-z]/,o=>o.toUpperCase()),$=(n,o)=>n[ce(o)],me=n=>window.$http.request({url:`${window.$reportURL}/tds/report/demo/get`,method:"get",params:n,isError:!1}),W=n=>window.$http.request({url:`${window.$reportURL}/tds/report/item/get`,method:"get",params:n,isError:!1}),ue=n=>window.$http.request({url:`${window.$reportURL}/tds/report/preview`,method:"get",params:n,isError:!1}),_e=n=>window.$http.request({url:`${window.$reportURL}/tds/report/add`,method:"post",data:n}),fe=n=>window.$http.request({url:`${window.$reportURL}/tds/report/put`,method:"put",data:n}),be=n=>window.$http.request({url:`${window.$reportURL}/tds/report/get`,method:"get",params:n,isError:!1}),Y=n=>window.$http.request({url:`${window.$reportURL}/tds/report/filter/get`,method:"get",params:n,isError:!1}),Ce=n=>window.$http.request({url:`${window.$reportURL}/tds/report/delete`,method:"delete",data:n}),he=n=>window.$http.request({url:`${window.$reportURL}/tds/report/item/list`,method:"get",params:n,isError:!1}),ge=n=>window.$http.request({url:`${window.$reportURL}/tds/report/item/delete`,method:"delete",data:n}),ye=n=>window.$http.request({url:`${window.$reportURL}/tds/report/item/add`,method:"post",data:n}),we=n=>window.$http.request({url:`${window.$reportURL}/tds/report/item/put`,method:"put",data:n}),Ve=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/get`,method:"get",params:n,isError:!1}),ke=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/add`,method:"post",data:n}),xe=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/put`,method:"put",data:n}),Ne=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/delete`,method:"delete",data:n}),$e=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/edit/state`,method:"post",data:n}),Be=n=>window.$http.request({url:`${window.$reportURL}/tds/report/all`,method:"get",params:n,isError:!1}),Te=n=>window.$http.request({url:`${window.$reportURL}/tds/report/sub/get_format`,method:"get",params:n,isError:!1}),Ee=n=>window.$http.request({url:`${window.$reportURL}/tds/report/filter/get_select_data`,method:"get",params:n,isError:!1}),K="rgba(51, 51, 51, 0.15)",B="rgba(51, 51, 51, 1)",G=(n=!1)=>{const o={left:"3%",right:"3%",bottom:"2%",containLabel:!0};return n&&(o.top="5%"),o},V=["46, 145, 255","48, 212, 183","108, 108, 255","109, 237, 124","128, 218, 236","58, 200, 218","146, 218, 89","118, 218, 218","143, 192, 244","192, 192, 145","153, 136, 204","212, 217, 230","124, 186, 255","209, 182, 225","255, 197, 84","249, 140, 106","246, 179, 82","100, 161, 206","246, 175, 159","238, 97, 97"],Se=(n,o,t="",r={name:"name",value:"value"})=>{const a=[],l=[];o.forEach(i=>{a.push(i[r.name]),l.push(i[r.value])}),n.xAxis[0].data=a,n.series[0].data=l,n.series[0].name=t,n.series[1].data=l,n.series[2].data=l},S=(n=[{name:"数据1",value:63},{name:"数据2",value:45},{name:"数据3",value:43}],o={name:"name",value:"value"})=>{const t=(a="rgba(46, 145, 255, 0.7)",l="rgba(46, 145, 255, 0.2)")=>({color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:a},{offset:.8,color:l}]}}),r=n.map(a=>a[o.value]);return{tooltip:{trigger:"item"},grid:G(),title:{show:!0,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},xAxis:[{type:"category",nameGap:8,nameRotate:0,axisLabel:{color:B,rotate:0},axisLine:{show:!0,lineStyle:{color:K,width:1}},axisTick:{show:!1},splitLine:{show:!1},data:n.map(a=>a[o.name])}],yAxis:[{type:"value",min:0,position:"left",nameTextStyle:{fontSize:12,color:B,fontWeight:"bold"},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:B,formatter:"{value}",inside:!1}}],series:[{type:"bar",barWidth:15,barGap:"0%",itemStyle:t(`rgba(${V[0]}, 0.7)`,`rgba(${V[0]}, 0.2)`),data:r,label:{show:!0,position:"top",color:"inherit",lineHeight:24}},{name:"",type:"pictorialBar",symbolSize:[15,10],symbolOffset:[0,5],itemStyle:t(`rgba(${V[0]}, 0.7)`,`rgba(${V[0]}, 0.2)`),data:r},{name:"",type:"pictorialBar",symbolSize:[15,10],symbolOffset:[0,-5],symbolPosition:"end",itemStyle:t(`rgba(${V[0]}, 0.9)`,`rgba(${V[0]}, 1)`),data:r}]}},Le=({chartOption:n,data:o,props:t={name:"label",value:"data"}})=>{let r=0;const a=o.map((l,i)=>(r+=Number(l[t.value]),{name:l[t.name],value:Number(l[t.value])}));n.legend.data=a,n.series[0].data=a,n.graphic[1].style.text=r},Re=()=>V.map(n=>`rgba(${n}, 1)`),F=({data:n=[{name:"数据1",value:63},{name:"数据2",value:45},{name:"数据3",value:43}],radiusType:o=1,roseType:t=!1,isLegend:r=!0,isLine:a=!1,center:l=["50%","50%"],isTitle:i=!0})=>{const u={color:Re(),toolbox:{show:!1},tooltip:{trigger:"item",show:!0,formatter:d=>{const{name:_,value:m}=d;return`<div style="color: ${d.color}; font-size: 14px;">${_} </div>
|
|
2
|
+
<div><span style="font-size: 14px; color: #86909c; float: right;">数量:${m}</span></div>`}},title:{show:i,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},legend:{show:r,left:"70%",formatter:d=>{var m;const _=(m=u.series[0])==null?void 0:m.data.find(p=>p.name===d).value;return` ${d} | ${_}`},textStyle:{fontSize:12,color:B},data:n,orient:"vertical",itemWidth:10,itemHeight:10,borderRadius:10,x:"left",top:"center",align:"left",itemGap:15},series:[{type:"pie",center:l,radius:o===1?t?["10%","65%"]:["45%","70%"]:["0%","65%"],roseType:t,itemStyle:{borderRadius:1},label:{show:a,position:"outside",alignTo:"labelLine",backgroundColor:"#fff",height:0,width:0,lineHeight:0,distanceToLabelLine:0,borderRadius:3,borderWidth:1,borderColor:"inherit",padding:[3,-3,3,-3],formatter:function(d){return`{a|${d.name}(${d.value})}`},rich:{a:{padding:[20,-80,40,-80],fontSize:"12px",fontFamily:"MicrosoftYaHei",color:"#091158"},b:{padding:[0,-80,55,-80],fontSize:"15px",fontFamily:"MicrosoftYaHei-Bold, MicrosoftYaHei",fontWeight:"bold",color:"#001F3D"}}},labelLine:{show:!0,length:40,length2:85,align:"right",lineStyle:{width:1}},data:n}],graphic:[{invisible:!1,type:"text",left:"center",top:"44%",style:{text:"总量",fontSize:14,fill:"#86909c",fontWeight:"bold"}},{invisible:!1,type:"text",left:"center",top:"50%",style:{text:"151",fontSize:18,fill:"#86909c",fontWeight:"bold"}}]};return u},Ue=(n,o,t={name:"name",value:"value"})=>{n.xAxis.data=o.map(r=>r[t.name]),Array.isArray(t.value)?t.value.forEach((r,a)=>{n.series[a].data=o.map(l=>l[r.value])}):typeof t.value=="string"&&(n.series[0].data=o.map(r=>r[t.value]))},Fe=()=>({name:"",type:"line",symbol:"circle",smooth:!0,lineStyle:{width:1,color:`rgba(${V[0]}, 1)`},showSymbol:!1,itemStyle:{color:`rgba(${V[0]}, 1)`,label:{show:!0,position:"top",formatter:function(n){return n.value?n.value:0}}},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${V[0]}, 0.7)`},{offset:1,color:`rgba(${V[0]}, 0.1)`}],global:!1}},data:[]}),L=(n=[{name:"2024-08",value:63},{name:"2024-09",value:45},{name:"2024-10",value:43}],o={name:"name",value:"value"})=>{const t={tooltip:{trigger:"axis"},title:{show:!0,text:"样例数据",textStyle:{color:"#333",fontSize:18},x:10,y:10},legend:{show:!0,itemWidth:30,textStyle:{color:B,fontSize:12,padding:[0,8,0,8]}},grid:G(),xAxis:{type:"category",splitLine:{show:!1},axisTick:{show:!1},axisLine:{show:!0,lineStyle:{color:K}},axisLabel:{show:!0,fontSize:12,color:B},boundaryGap:!1,data:n.map(l=>l[o.name])},yAxis:{name:"",type:"value",splitLine:{show:!1},axisLine:{show:!1},axisTick:{show:!1},nameTextStyle:{fontSize:12,color:B,padding:[0,60,0,0]},axisLabel:{show:!0,fontSize:12,color:B}},series:[]},r=Fe(),a=[];if(Array.isArray(o.value))o.value.forEach((l,i)=>{const u=E(r);u.name=l.name,u.lineStyle.color=`rgba(${V[i]}, 1)`,u.itemStyle.color=`rgba(${V[i]}, 1)`,u.areaStyle.color.colorStops[0].color=`rgba(${V[i]}, 0.7)`,u.areaStyle.color.colorStops[1].color=`rgba(${V[i]}, 0.1)`,u.data=n.map(d=>d[l.value]),a.push(u)});else if(typeof o.value=="string"){const l=E(r);l.data=n.map(i=>i[o.value]),a.push(l)}return t.series=a,t},D=[{key:"assets",name:"资产名称"},{key:"type",name:"资产类型"},{key:"data",name:"资产数据"}],A=[{assets:"name1",type:"type1",data:"data1"},{assets:"name2",type:"type2",data:"data2"},{assets:"name3",type:"type3",data:"data3"}],q=[{data:[{name:"默认数据",value:180}],label:"name1"},{data:[{name:"默认数据",value:311}],label:"name2"},{data:[{name:"默认数据",value:42}],label:"name3"},{data:[{name:"默认数据",value:32391}],label:"name4"}],De=[{data:63,label:"数据1"},{data:45,label:"数据2"},{data:43,label:"数据3"}],Ae=[{type:"report-select",label:"资产:",value:"0",data:[{label:"全部",data:"0"},{label:"10.10.2.20_root",data:"743dbb32-8a41-4990-9d76-48925b000a93"},{label:"10.10.4.206_sysdba",data:"23193788-c895-47a8-8123-65799540394c"},{label:"10.10.4.26_root@/root/files/",data:"bb7b07c9-b96b-4caf-ac76-bb45ae849844"}],uri:"/da/report/sens/get_asset_all",id:T()},{type:"range-time",data:[{start_time:"2024-08-20 19:49:34",end_time:"2024-09-12 19:49:34"}],id:T()},{type:"h1",data:"报表名称",options:{size:24,color:"rgba(0,0,0,0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:T()},{type:"h2",data:"一级标题",name:"一级标题",options:{size:18,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:T()},{type:"report-table",data:A,showColumn:D,name:"表格",options:{showColumn:{assets:!0,type:!0,data:!0},border:!0,showHeader:!0,stripe:!1},rp_item_uuid:"",id:T()}],qe=[{type:"h1",data:"报表名称",name:"报表名称",options:{size:24,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},hide:!0,id:""},{type:"h2",data:"一级标题",name:"一级标题",options:{size:18,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:""},{type:"h3",data:"二级标题",name:"二级标题",options:{size:14,color:" rgba(0, 0, 0, 0.85)",fontWeight:500,letterSpacing:0,textIndent:0,textAlign:"left"},id:""},{type:"p",data:"正文",name:"正文",rp_item_uuid:"",id:""},{type:"report-table",data:A,showColumn:D,name:"表格",options:{border:!0,showHeader:!0,stripe:!1,showColumn:{assect:!0,type:!0,data:!0}},rp_item_uuid:"",id:""},{type:"bar",data:q,showColumn:[{key:"label",value:"data"}],name:"图表",options:S(),rp_item_uuid:"",id:""}],ze=n=>({bar:{type:"bar",data:q,showColumn:[{key:"label",value:"data"}],name:"图表",options:S(),rp_item_uuid:"",id:""},line:{type:"line",data:q,showColumn:[{key:"label",value:"data"}],name:"图表",options:L(),rp_item_uuid:"",id:""},pie:{type:"pie",data:De,showColumn:[{key:"label",value:"data"}],name:"图表",options:F({isLegend:!0}),rp_item_uuid:"",id:""},"report-table":{type:"report-table",data:A,showColumn:D,name:"表格",options:{showColumn:{assect:!0,type:!0,data:!0},border:!0,showHeader:!0,stripe:!1},rp_item_uuid:"",id:""}})[n],N=j.defineStore("tds-report",{state:()=>({componentList:[],activeComponents:{},notDraggableList:[],titleComponent:{},filterForm:{range_time:1,filter_uuid:""}}),getters:{getActiveComponents:n=>n.activeComponents},actions:{setComponentList(n){this.componentList=n},async getReportDemo(n){let o=[];n?o=(await me({report_uuid:n})).data:o={content:E(Ae),range_time:1};const t=[];o.content.forEach(r=>{(r.type==="report-select"||r.type==="range-time")&&t.push(r),r.type==="h1"&&(this.titleComponent=r),r.id=T()}),this.notDraggableList=t,this.filterForm.range_time=o.range_time,this.filterForm.filter_uuid=o.filter_uuid,o.content.splice(0,3),this.componentList=o.content},setActiveComponents(n){this.activeComponents=n},clearComponents(){this.activeComponents={},this.componentList=[],this.notDraggableList=[],this.titleComponent={},this.filterForm={range_time:1,filter_uuid:""}}}}),Ie={class:"catalogue"},Me=["href","title"],Pe=e.defineComponent({__name:"Catalogue",props:{data:{default:()=>[]}},setup(n){const o=n,t=e.computed(()=>o.data.filter(r=>["h2","h3","h4"].includes(r.type)));return(r,a)=>{const l=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",Ie,[a[0]||(a[0]=e.createElementVNode("div",{class:"cata-title el-anchor__link"},"目录",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,i=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass("level"+i.type),key:i.value},[i.type==="h2"?(e.openBlock(),e.createBlock(l,{key:0,style:{"margin-top":"10px","margin-bottom":"10px"}})):e.createCommentVNode("",!0),e.createElementVNode("a",{class:"el-anchor__link",href:"#"+i.id,title:i.data},e.toDisplayString(i.data),9,Me)],2))),128))])}}}),Mt="",R=(n,o)=>{const t=n.__vccOpts||n;for(const[r,a]of o)t[r]=a;return t},je=R(Pe,[["__scopeId","data-v-1cd8aa2d"]]),He={class:"chart-components"},J=e.defineComponent({__name:"Bar",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return e.ref(!1),(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",He,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),Oe={class:"chart-components"},Q=e.defineComponent({__name:"Line",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),We={class:"chart-components"},X=e.defineComponent({__name:"Pie",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value.options);return(r,a)=>{const l=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",We,[e.createVNode(l,{option:t.value},null,8,["option"])])}}}),Ye={key:0},z=e.defineComponent({__name:"ReportSelect",props:{value:{}},emits:["change"],setup(n,{emit:o}){const t=o,r=i=>{t("change",i)},a=n,l=e.ref(a.value);return(i,u)=>{const d=e.resolveComponent("el-option"),_=e.resolveComponent("el-select");return l.value.data?(e.openBlock(),e.createElementBlock("div",Ye,[e.createVNode(_,{modelValue:l.value.value,"onUpdate:modelValue":u[0]||(u[0]=m=>l.value.value=m),multiple:"",style:{width:"100%"},onChange:r,placeholder:"全部"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value.data,m=>(e.openBlock(),e.createBlock(d,{key:m.data,label:m.label,value:m.data},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0)}}}),I=e.defineComponent({__name:"RangeTime",props:{value:{}},emits:["change"],setup(n,{emit:o}){const t=o,r=n,a=e.ref(r.value),l=e.ref([]);function i(u){u?(a.value.data[0].start_time=u[0],a.value.data[0].end_time=u[1]):l.value=[],t("change",l.value)}return e.onMounted(()=>{l.value=[a.value.data[0].start_time,a.value.data[0].end_time]}),(u,d)=>{const _=e.resolveComponent("el-date-picker");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(_,{modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=m=>l.value=m),type:"datetimerange",placeholder:"Pick a Date",format:"YYYY-MM-DD HH:mm:ss","value-format":"YYYY-MM-DD HH:mm:ss",onChange:i,clearable:!1},null,8,["modelValue"])])}}});function Ke(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const Z=e.defineComponent({__name:"ReportTable",props:{value:{}},setup(n){const o=n,t=r=>{let a;return e.createVNode(e.resolveComponent("el-table"),{data:r.data,border:o.value.options.border,"show-header":!!o.value.options.showHeader,stripe:o.value.options.stripe},Ke(a=r.showColumn.map(l=>o.value.options.showColumn[l.key]===!0?e.createVNode(e.resolveComponent("el-table-column"),{prop:l.key,label:l.name},null):null))?a:{default:()=>[a]})};return(r,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(t,e.normalizeProps(e.guardReactiveProps(r.value)),null,16)]))}}),M=e.defineComponent({__name:"ReportText",props:{value:{}},setup(n){const o=n,t=()=>{const r=o.value.options||{};return{color:r.color,"font-size":r.size+"px","font-weight":r.fontWeight,"letter-spacing":r.letterSpacing+"px","text-indent":r.textIndent+"px","text-align":r.textAlign}};return(r,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(t())},e.toDisplayString(r.value.data),5))}}),Ge={class:"chart-components"},v=e.defineComponent({__name:"ReportChart",props:{value:{}},setup(n){const o=n,t=e.computed(()=>o.value),r=e.computed(()=>{if(t.value.type==="bar"){t.value.options.series=S([]).series;const a=[];let l="";t.value.data.forEach(i=>{l=i.data[0].name,a.push({name:i.label,value:i.data[0].value})}),Se(t.value.options,a,l)}if(t.value.type==="pie"&&(t.value.options=F({isLegend:!0}),Le({chartOption:t.value.options,data:t.value.data})),t.value.type==="line"){let a=[];t.value.data.forEach(u=>{a=u.data.map((d,_)=>({name:d.name,value:"value"+_}))});const l={name:"name",value:a},i=t.value.data.map(u=>{const d={name:u.label};return a.forEach((_,m)=>{d[_.value]=u.data[m].value}),d});console.log(L([],l),"chartsLine([], params)"),t.value.options.series=L([],l).series,Ue(t.value.options,i,l)}return t.value.options});return(a,l)=>{const i=e.resolveComponent("TdsChart");return e.openBlock(),e.createElementBlock("div",Ge,[e.createVNode(i,{option:r.value},null,8,["option"])])}}});function Je(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const ee=e.defineComponent({__name:"ReportDescribe",props:{value:{}},setup(n){const o=n,t=r=>{let a;return e.createVNode(e.resolveComponent("el-descriptions"),{title:o.value.options.title,border:o.value.options.border,column:o.value.options.column,direction:o.value.options.direction},Je(a=r.showColumn.map(l=>e.createVNode(e.resolveComponent("el-descriptions-item"),{label:l.name},{default:()=>[o.value.data[l.key]]})))?a:{default:()=>[a]})};return(r,a)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(t,e.normalizeProps(e.guardReactiveProps(r.value)),null,16)]))}}),Qe={class:"editor-box"},Xe={class:"editor",id:"editor",style:{width:"100%"}},Ze={class:"editor-content flex flex-start"},ve=["id"],et=["innerHTML"],tt=e.defineComponent({__name:"index",props:e.mergeModels({reportId:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=e.ref(!1),t={Bar:J,Line:Q,Pie:X,ReportSelect:z,RangeTime:I,ReportTable:Z,ReportText:M,ReportChart:v,ReportDescribe:ee},r=N(),a=n,l=e.useModel(n,"modelValue"),i=e.ref([]),u=e.ref([]),d=e.ref([]),_=e.ref(""),m=e.ref("");function p(){l.value="table"}const C=s=>{d.value=s,b()},c=s=>{s&&s.length>0&&(_.value=s[0],m.value=s[1]),b()},b=async()=>{try{o.value=!0;const s={report_uuid:a.reportId,start_time:_.value,end_time:m.value,select_data:d.value.join(",")},f=await ue(s),k=[];f.data.forEach(y=>{(y.type==="report-select"||y.type==="range-time")&&k.push(y)}),i.value=k,f.data.splice(0,i.value.length),u.value=f.data,o.value=!1}catch(s){o.value=!1,console.error("Error setting loading state:",s)}};b();const g=()=>e.createVNode("div",null,[e.createTextVNode("未找到对应组件")]),h=s=>s==="h2"||s==="h3"||s==="h4"?$(t,"ReportText"):s==="bar"||s==="pie"||s==="line"?$(t,"ReportChart"):s?$(t,s):e.createVNode(g,null,null);return(s,f)=>{const k=e.resolveComponent("el-button"),y=e.resolveComponent("el-card"),U=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(y,{class:"editor view","element-loading-text":"加载中..."},{default:e.withCtx(()=>[e.createElementVNode("div",Qe,[e.createVNode(je,{data:u.value},null,8,["data"]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>(e.openBlock(),e.createElementBlock("div",{class:"item-input",key:x.id},[x.type==="report-select"?(e.openBlock(),e.createBlock(z,{key:0,onChange:C,value:x},null,8,["value"])):e.createCommentVNode("",!0),x.type==="range-time"&&e.unref(r).filterForm.range_time?(e.openBlock(),e.createBlock(I,{key:1,onChange:c,value:x},null,8,["value"])):e.createCommentVNode("",!0)]))),128)),e.createVNode(k,{plain:"",onClick:p,type:"primary",class:"custom-btn",style:{"margin-left":"auto"}},{default:e.withCtx(()=>f[0]||(f[0]=[e.createTextVNode("退出预览")])),_:1})]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,x=>(e.openBlock(),e.createElementBlock("div",{key:x.id,class:e.normalizeClass(["editor-content",["editor"+x.type]]),id:x.id},[x.type!=="p"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h(x.type)),{key:0,class:e.normalizeClass(["editor"+x.type]),value:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.data),1)]),_:2},1032,["class","value"])):(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:x.data},null,8,et))],10,ve))),128))])])]),_:1})),[[U,o.value]])}}}),Pt="",ot=R(tt,[["__scopeId","data-v-db45c725"]]),nt={class:"editor"},lt={class:"editor-content edit"},rt=["onClick"],at=["onClick"],it=["innerHTML","draggable"],st=e.defineComponent({__name:"Editor",setup(n){const o={Bar:J,Line:Q,Pie:X,ReportSelect:z,RangeTime:I,ReportTable:Z,ReportText:M,ReportChart:v,ReportDescribe:ee},{componentList:t,activeComponents:r,notDraggableList:a,titleComponent:l}=j.storeToRefs(N()),i=N(),u=h=>{t.value.forEach((s,f)=>{s.id===h&&(t.value.splice(f,1),i.activeComponents=[])})},d=h=>{i.setActiveComponents(h)},_=()=>e.createVNode("div",null,[e.createTextVNode("未找到对应组件")]),m=h=>h==="h2"||h==="h3"||h==="h4"?$(o,"ReportText"):h==="bar"||h==="pie"||h==="line"?$(o,"ReportChart"):h?$(o,h):e.createVNode(_,null,null),p=h=>{console.log(h,"evt")},C=e.ref(!1),c=()=>{C.value=!0},b=h=>{h.newIndex!==0&&(console.log(h),C.value=!1)},g=e.ref();return(h,s)=>{const f=e.resolveComponent("CircleClose"),k=e.resolveComponent("el-icon");return e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",{class:e.normalizeClass(["editor-content edit flex flex-start",[{active:e.unref(r).id==="filter"}]]),onClick:s[0]||(s[0]=y=>d({id:"filter",type:"filter"}))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),y=>(e.openBlock(),e.createElementBlock("div",{class:"item-input",key:y.id},[y.type==="report-select"||y.type==="range-time"&&e.unref(i).filterForm.range_time?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref($)(o,y.type)),{key:0,value:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.data),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)]))),128))],2),e.createElementVNode("div",lt,[e.createVNode(M,{value:e.unref(l),onClick:s[1]||(s[1]=y=>d(e.unref(l)))},null,8,["value"])]),e.createVNode(e.unref(de.VueDraggable),{ref_key:"el",ref:g,modelValue:e.unref(t),"onUpdate:modelValue":s[2]||(s[2]=y=>e.isRef(t)?t.value=y:null),"on-change":p,animation:150,onStart:c,onEnd:b},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t),y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,class:e.normalizeClass(["editor-content edit",["editor"+y.type,{active:y.id===e.unref(r).id}]]),onClick:U=>d(y)},[e.createElementVNode("i",{onClick:e.withModifiers(U=>u(y.id),["stop"]),style:{"z-index":"99"}},[e.createVNode(k,{size:"16px",color:"red"},{default:e.withCtx(()=>[e.createVNode(f)]),_:1})],8,at),y.type!=="p"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m(y.type)),{key:0,class:e.normalizeClass(["editor"+y.type]),value:y,draggable:C.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.data),1)]),_:2},1032,["class","value","draggable"])):(e.openBlock(),e.createElementBlock("p",{key:1,innerHTML:y.data,draggable:C.value},null,8,it))],10,rt))),128))]),_:1},8,["modelValue"])])}}}),dt={class:"label"},pt={class:"flex item-switch"},ct={class:"flex item-switch"},mt={class:"flex item-switch"},te=e.defineComponent({__name:"SettingTable",setup(n){const o=N(),t=e.computed(()=>o.getActiveComponents);return(r,a)=>{const l=e.resolveComponent("el-switch"),i=e.resolveComponent("el-form-item"),u=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{label:"控制列"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value.showColumn,(d,_)=>(e.openBlock(),e.createElementBlock("p",{class:"flex item-switch",key:_},[e.createElementVNode("span",dt,e.toDisplayString(d.name),1),e.createVNode(l,{modelValue:t.value.options.showColumn[d.key],"onUpdate:modelValue":m=>t.value.options.showColumn[d.key]=m},null,8,["modelValue","onUpdate:modelValue"])]))),128))]),_:1}),e.createVNode(u),e.createVNode(i,{label:"表格样式"},{default:e.withCtx(()=>[e.createElementVNode("p",pt,[a[3]||(a[3]=e.createElementVNode("span",{class:"label"},"斑马纹",-1)),e.createVNode(l,{modelValue:t.value.options.stripe,"onUpdate:modelValue":a[0]||(a[0]=d=>t.value.options.stripe=d)},null,8,["modelValue"])]),e.createElementVNode("p",ct,[a[4]||(a[4]=e.createElementVNode("span",{class:"label"},"边框",-1)),e.createVNode(l,{modelValue:t.value.options.border,"onUpdate:modelValue":a[1]||(a[1]=d=>t.value.options.border=d)},null,8,["modelValue"])]),e.createElementVNode("p",mt,[a[5]||(a[5]=e.createElementVNode("span",{class:"label"},"表头",-1)),e.createVNode(l,{modelValue:t.value.options.showHeader,"onUpdate:modelValue":a[2]||(a[2]=d=>t.value.options.showHeader=d)},null,8,["modelValue"])])]),_:1})])}}}),ut={key:0},_t=e.defineComponent({__name:"ChartsUniConfig",setup(n){const o=N(),t=e.computed(()=>o.activeComponents);function r(a){a?(t.value.options.series[0].radius=["10%","65%"],t.value.options.graphic[0].invisible=!0,t.value.options.graphic[1].invisible=!0):(t.value.options.series[0].radius=["45%","70%"],t.value.options.graphic[0].invisible=!1,t.value.options.graphic[1].invisible=!1)}return e.ref("rgb(46, 145, 255)"),(a,l)=>{const i=e.resolveComponent("el-input"),u=e.resolveComponent("el-form-item"),d=e.resolveComponent("el-switch"),_=e.resolveComponent("el-col"),m=e.resolveComponent("el-color-picker"),p=e.resolveComponent("el-input-number"),C=e.resolveComponent("el-row"),c=e.resolveComponent("el-collapse-item"),b=e.resolveComponent("el-collapse");return t.value.options.title?(e.openBlock(),e.createElementBlock("div",ut,[e.createVNode(u,{label:"标题"},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:t.value.options.title.text,"onUpdate:modelValue":l[0]||(l[0]=g=>t.value.options.title.text=g)},null,8,["modelValue"])]),_:1}),e.createVNode(b,null,{default:e.withCtx(()=>[e.createVNode(c,{title:"标题配置",name:"1"},{default:e.withCtx(()=>[e.createVNode(C,{class:"w-100%"},{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[8]||(l[8]=e.createElementVNode("span",{class:"switch-label"},"显示标题",-1)),e.createVNode(d,{modelValue:t.value.options.title.show,"onUpdate:modelValue":l[1]||(l[1]=g=>t.value.options.title.show=g)},null,8,["modelValue"])]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:t.value.options.title.textStyle.color,"onUpdate:modelValue":l[2]||(l[2]=g=>t.value.options.title.textStyle.color=g),"show-alpha":""},null,8,["modelValue"]),l[9]||(l[9]=e.createElementVNode("p",{class:"sub-title"},"颜色",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.textStyle.fontSize,"onUpdate:modelValue":l[3]||(l[3]=g=>t.value.options.title.textStyle.fontSize=g),"controls-position":"right"},null,8,["modelValue"]),l[10]||(l[10]=e.createElementVNode("p",{class:"sub-title"},"字体大小",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.x,"onUpdate:modelValue":l[4]||(l[4]=g=>t.value.options.title.x=g),"controls-position":"right"},null,8,["modelValue"]),l[11]||(l[11]=e.createElementVNode("p",{class:"sub-title"},"横向",-1))]),_:1}),e.createVNode(_,{span:12},{default:e.withCtx(()=>[e.createVNode(p,{modelValue:t.value.options.title.y,"onUpdate:modelValue":l[5]||(l[5]=g=>t.value.options.title.y=g),"controls-position":"right"},null,8,["modelValue"]),l[12]||(l[12]=e.createElementVNode("p",{class:"sub-title"},"纵向",-1))]),_:1})]),_:1})]),_:1}),e.createVNode(c,{title:"图形配置",name:"2"},{default:e.withCtx(()=>[t.value.options.color&&t.value.options.color.length&&t.value.type==="pie"?(e.openBlock(),e.createBlock(C,{key:0},{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[13]||(l[13]=e.createElementVNode("span",{class:"switch-label"},"玫瑰图",-1)),e.createVNode(d,{onChange:r,modelValue:t.value.options.series[0].roseType,"onUpdate:modelValue":l[6]||(l[6]=g=>t.value.options.series[0].roseType=g)},null,8,["modelValue"])]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{title:"图例配置",name:"3"},{default:e.withCtx(()=>[e.createVNode(C,null,{default:e.withCtx(()=>[e.createVNode(_,{span:24},{default:e.withCtx(()=>[l[14]||(l[14]=e.createElementVNode("span",{class:"switch-label"},"显示图例",-1)),t.value.options.legend?(e.openBlock(),e.createBlock(d,{key:0,modelValue:t.value.options.legend.show,"onUpdate:modelValue":l[7]||(l[7]=g=>t.value.options.legend.show=g)},null,8,["modelValue"])):e.createCommentVNode("",!0)]),_:1})]),_:1})]),_:1})]),_:1})])):e.createCommentVNode("",!0)}}}),jt="",ft=R(_t,[["__scopeId","data-v-e9859d3b"]]),oe=e.defineComponent({__name:"SettingDescribe",setup(n){const o=N(),t=e.computed(()=>o.getActiveComponents);return(r,a)=>{const l=e.resolveComponent("el-input"),i=e.resolveComponent("el-form-item"),u=e.resolveComponent("el-switch"),d=e.resolveComponent("el-input-number"),_=e.resolveComponent("el-radio"),m=e.resolveComponent("el-radio-group");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(i,{label:"标题"},{default:e.withCtx(()=>[e.createVNode(l,{modelValue:t.value.options.title,"onUpdate:modelValue":a[0]||(a[0]=p=>t.value.options.title=p)},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"边框"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:t.value.options.border,"onUpdate:modelValue":a[1]||(a[1]=p=>t.value.options.border=p)},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"每行展示数量"},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:t.value.options.column,"onUpdate:modelValue":a[2]||(a[2]=p=>t.value.options.column=p),min:1,max:10,controls:!1},null,8,["modelValue"])]),_:1}),e.createVNode(i,{label:"排列方向"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:t.value.options.direction,"onUpdate:modelValue":a[3]||(a[3]=p=>t.value.options.direction=p)},{default:e.withCtx(()=>[e.createVNode(_,{value:"horizontal"},{default:e.withCtx(()=>a[4]||(a[4]=[e.createTextVNode("横向")])),_:1}),e.createVNode(_,{value:"vertical"},{default:e.withCtx(()=>a[5]||(a[5]=[e.createTextVNode("纵向")])),_:1})]),_:1},8,["modelValue"])]),_:1})])}}}),bt=e.defineComponent({__name:"SettingCharts",setup(n){const o=N(),t=e.ref(!1),r=e.computed(()=>o.getActiveComponents),a=[{value:"report-describe",name:"描述列表"},{value:"report-table",name:"表格"},{value:"line",name:"趋势图"},{value:"pie",name:"扇形图"},{value:"bar",name:"柱状图"}],l=e.ref(""),i=e.ref();async function u(m){const p=await W({prod_type:window.$prodType,chart_type:m,filter_uuid:o.filterForm.filter_uuid});i.value=p.data}function d(m){let p=i.value.find(c=>c.rp_item_uuid===m);const C=p.rp_item_content;if(p.rp_item_content.type==="bar"&&(C.options=S()),C.type==="pie"&&(C.options=F({isLegend:!0})),C.type==="line"){let c=[];C.data.forEach(g=>{c=g.data.map((h,s)=>({name:h.name,value:"value"+s}))});const b={name:"name",value:c};C.options=L([],b)}if(C.type==="report-table"){const c={};C.showColumn.forEach(b=>{c[b.key]=!0}),C.options={...C.options,showColumn:c,border:!0,showHeader:!0,stripe:!1}}C.type==="report-describe"&&(C.options={...C.options,title:"",border:!0,column:1,direction:"horizontal",...r.value.options}),Object.assign(o.activeComponents,C),o.activeComponents.rp_item_uuid=p.rp_item_uuid}e.onMounted(async()=>{l.value=r.value.type,await u(l.value)});async function _(m){try{t.value=!0,await u(m),Object.assign(o.activeComponents,ze(m)),t.value=!1}catch{t.value=!1}}return e.watch(()=>r.value,m=>{console.log(m,"activeComponents"),~["bar","pie","line","report-table","report-describe"].indexOf(m.type)&&(l.value=r.value.type,u(l.value))}),(m,p)=>{const C=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),b=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-form"),h=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(b,{label:"图表类型"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:l.value,"onUpdate:modelValue":p[0]||(p[0]=s=>l.value=s),onChange:_},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(s,f)=>e.createVNode(C,{key:f,label:s.name,value:s.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(b,{label:"组件库"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:e.unref(o).activeComponents.rp_item_uuid,"onUpdate:modelValue":p[1]||(p[1]=s=>e.unref(o).activeComponents.rp_item_uuid=s),onChange:d},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(s,f)=>(e.openBlock(),e.createBlock(C,{key:f,label:s.rp_item_name,value:s.rp_item_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l.value==="report-table"&&r.value.options.showColumn?(e.openBlock(),e.createBlock(te,{key:0})):e.createCommentVNode("",!0),l.value==="pie"||l.value==="bar"||l.value==="line"?(e.openBlock(),e.createBlock(ft,{key:1})):e.createCommentVNode("",!0),l.value==="report-describe"?(e.openBlock(),e.createBlock(oe,{key:2})):e.createCommentVNode("",!0)]),_:1})])),[[h,t.value]])}}}),Ct={key:0},ht={style:{border:"1px solid #ccc","border-radius":"3px"}},ne="default",gt=e.defineComponent({__name:"SettingText",setup(n){const o=N(),t=e.shallowRef(),r=e.ref();function a(m){const p=r.value.find(C=>C.rp_item_uuid===m);o.activeComponents.uri=p.rp_item_content.uri,t.value.setHtml((p==null?void 0:p.rp_item_content.data)||"")}async function l(){const m=await W({prod_type:window.$prodType,chart_type:"p",filter_uuid:o.filterForm.filter_uuid});r.value=m.data}l();const i={toolbarKeys:["bold","underline","italic","through","code","bulletedList","numberedList","clearStyle","color","bgColor","fontSize","fontFamily","justifyLeft","justifyRight","justifyCenter","justifyJustify","lineHeight"]},u={placeholder:"请输入内容..."},d=m=>{t.value=m},_=m=>{};return e.onBeforeUnmount(()=>{const m=t.value;m!=null&&m.destroy()}),(m,p)=>{const C=e.resolveComponent("el-option"),c=e.resolveComponent("el-select"),b=e.resolveComponent("el-form-item"),g=e.resolveComponent("el-form");return e.unref(o).activeComponents.id?(e.openBlock(),e.createElementBlock("div",Ct,[e.createVNode(g,{"label-position":"top"},{default:e.withCtx(()=>[e.createVNode(b,{label:"组件库"},{default:e.withCtx(()=>[e.createVNode(c,{style:{width:"100%"},modelValue:e.unref(o).activeComponents.rp_item_uuid,"onUpdate:modelValue":p[0]||(p[0]=h=>e.unref(o).activeComponents.rp_item_uuid=h),onChange:a},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(h,s)=>(e.openBlock(),e.createBlock(C,{key:s,label:h.rp_item_name,value:h.rp_item_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e.createVNode(b,{label:"文本内容"},{default:e.withCtx(()=>[e.createElementVNode("div",ht,[e.createVNode(e.unref(H.Toolbar),{style:{"border-bottom":"1px solid #ccc"},editor:t.value,"default-config":i,mode:ne},null,8,["editor"]),e.createVNode(e.unref(H.Editor),{style:{height:"500px","overflow-y":"hidden"},onOnChange:_,modelValue:e.unref(o).activeComponents.data,"onUpdate:modelValue":p[1]||(p[1]=h=>e.unref(o).activeComponents.data=h),"default-config":u,mode:ne,onOnCreated:d},null,8,["modelValue"])])]),_:1})]),_:1})])):e.createCommentVNode("",!0)}}}),yt=e.defineComponent({__name:"SettingFilter",setup(n){const o=e.ref([]),t=N();async function r(){const a=await Y({prod_type:window.$prodType});o.value=a.data}return r(),(a,l)=>{const i=e.resolveComponent("el-option"),u=e.resolveComponent("el-select"),d=e.resolveComponent("el-form-item"),_=e.resolveComponent("el-checkbox"),m=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(m,{"label-width":"80px","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(d,{label:"筛选条件"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:e.unref(t).filterForm.filter_uuid,"onUpdate:modelValue":l[0]||(l[0]=p=>e.unref(t).filterForm.filter_uuid=p),disabled:!!e.unref(t).filterForm.filter_uuid},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,p=>(e.openBlock(),e.createBlock(i,{key:p.filter_uuid,label:p.filter_name,value:p.filter_uuid},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(_,{modelValue:e.unref(t).filterForm.range_time,"onUpdate:modelValue":l[1]||(l[1]=p=>e.unref(t).filterForm.range_time=p),"true-value":1,"false-value":0,label:"时间范围"},null,8,["modelValue"])]),_:1})]),_:1})}}}),wt=e.defineComponent({__name:"SettingTitle",setup(n){const o=N();return(t,r)=>{const a=e.resolveComponent("el-input"),l=e.resolveComponent("el-form-item"),i=e.resolveComponent("el-color-picker"),u=e.resolveComponent("el-col"),d=e.resolveComponent("el-input-number"),_=e.resolveComponent("el-option"),m=e.resolveComponent("el-select"),p=e.resolveComponent("el-row"),C=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(C,{"label-width":"auto","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(l,{label:"名称"},{default:e.withCtx(()=>[e.createVNode(a,{modelValue:e.unref(o).activeComponents.data,"onUpdate:modelValue":r[0]||(r[0]=c=>e.unref(o).activeComponents.data=c),placeholder:"Please input",maxlength:"24","show-word-limit":""},null,8,["modelValue"])]),_:1}),e.createVNode(l,{label:"样式"},{default:e.withCtx(()=>[e.createVNode(p,{gutter:20},{default:e.withCtx(()=>[e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:e.unref(o).activeComponents.options.color,"onUpdate:modelValue":r[1]||(r[1]=c=>e.unref(o).activeComponents.options.color=c),"show-alpha":""},null,8,["modelValue"]),r[7]||(r[7]=e.createElementVNode("p",{class:"sub-title"},"颜色",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.size,"onUpdate:modelValue":r[2]||(r[2]=c=>e.unref(o).activeComponents.options.size=c),"controls-position":"right"},null,8,["modelValue"]),r[8]||(r[8]=e.createElementVNode("p",{class:"sub-title"},"字体大小",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:e.unref(o).activeComponents.options.fontWeight,"onUpdate:modelValue":r[3]||(r[3]=c=>e.unref(o).activeComponents.options.fontWeight=c)},{default:e.withCtx(()=>[e.createVNode(_,{label:"常规",value:500}),e.createVNode(_,{label:"加粗",value:600})]),_:1},8,["modelValue"]),r[9]||(r[9]=e.createElementVNode("p",{class:"sub-title"},"字体粗细",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.letterSpacing,"onUpdate:modelValue":r[4]||(r[4]=c=>e.unref(o).activeComponents.options.letterSpacing=c),"controls-position":"right"},null,8,["modelValue"]),r[10]||(r[10]=e.createElementVNode("p",{class:"sub-title"},"字间距",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(d,{modelValue:e.unref(o).activeComponents.options.textIndent,"onUpdate:modelValue":r[5]||(r[5]=c=>e.unref(o).activeComponents.options.textIndent=c),"controls-position":"right"},null,8,["modelValue"]),r[11]||(r[11]=e.createElementVNode("p",{class:"sub-title"},"首行缩进",-1))]),_:1}),e.createVNode(u,{span:12},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:e.unref(o).activeComponents.options.textAlign,"onUpdate:modelValue":r[6]||(r[6]=c=>e.unref(o).activeComponents.options.textAlign=c)},{default:e.withCtx(()=>[e.createVNode(_,{label:"左对齐",value:"left"}),e.createVNode(_,{label:"居中对齐",value:"center"}),e.createVNode(_,{label:"右对齐",value:"right"})]),_:1},8,["modelValue"]),r[12]||(r[12]=e.createElementVNode("p",{class:"sub-title"},"位置",-1))]),_:1})]),_:1})]),_:1})]),_:1})}}}),Ht="",Vt=R(wt,[["__scopeId","data-v-56fef84c"]]),kt=e.defineComponent({__name:"Setting",setup(n){const o={SettingTable:te,SettingCharts:bt,SettingDescribe:oe,SettingText:gt,SettingFilter:yt,SettingTitle:Vt},t=N(),r=e.computed(()=>t.activeComponents),a=["h1","h2","h3","h4"],l=["p"],i=["report-table","bar","line","pie","report-describe"],u=d=>a.includes(d)?$(o,"SettingTitle"):l.includes(d)?$(o,"SettingText"):i.includes(d)?$(o,"SettingCharts"):d==="filter"?$(o,"SettingFilter"):"DefaultEditor";return(d,_)=>{const m=e.resolveComponent("el-card");return e.openBlock(),e.createBlock(m,{class:"config-wrapper"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u(r.value.type))))]),_:1})}}}),xt={class:"editor-wrapper flex items-center space-between start"},Nt={class:"flex items-center space-between"},$t={class:"btn-group"},Bt=e.defineComponent({__name:"index",props:e.mergeModels({reportId:{type:String,default:""}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const o=N(),t=n,r=e.useModel(n,"modelValue"),a=d=>{const _=E(d);_.id=T(),o.componentList.push(_)};function l(){r.value="table"}function i(){o.getReportDemo(t.reportId)}e.onMounted(()=>{i()});async function u(){if(!o.filterForm.filter_uuid){se.ElMessage.error("请选择筛选条件");return}try{t.reportId?await fe({report_uuid:t.reportId,data:{report_name:o.titleComponent.data,prod_type:window.$prodType,content:[...o.notDraggableList,o.titleComponent,...o.componentList],...o.filterForm}}):await _e({data:{report_name:o.titleComponent.data,prod_type:window.$prodType,content:[...o.notDraggableList,o.titleComponent,...o.componentList],...o.filterForm}}),l()}catch(d){console.log(d,"error")}}return e.onUnmounted(()=>{o.clearComponents()}),(d,_)=>{const m=e.resolveComponent("el-button"),p=e.resolveComponent("el-button-group"),C=e.resolveComponent("el-card");return e.openBlock(),e.createElementBlock("div",xt,[e.createVNode(C,{class:"view-wrapper"},{default:e.withCtx(()=>[e.createElementVNode("div",Nt,[e.createElementVNode("div",$t,[e.createVNode(p,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(qe),c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.type},[c!=null&&c.hide?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(m,{key:0,onClick:b=>a(c)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.name),1)]),_:2},1032,["onClick"]))],64))),128))]),_:1})]),e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(m,{type:"primary",onClick:u},{default:e.withCtx(()=>_[0]||(_[0]=[e.createTextVNode("保存")])),_:1}),e.createVNode(m,{onClick:l},{default:e.withCtx(()=>_[1]||(_[1]=[e.createTextVNode("退出")])),_:1})]),_:1})]),e.createVNode(st)]),_:1}),e.createVNode(kt)])}}}),Tt={class:"table-box"},Et=e.defineComponent({__name:"Report",emits:["click"],setup(n,{emit:o}){const t=e.computed(()=>({prod_type:window.$prodType})),r=e.ref(),a=o,l=p=>{a("click",p.report_uuid,"review")},i=p=>{a("click",p.report_uuid,"editor")},u=()=>{a("click","","editor")},d=p=>{console.log(p)},_=p=>{window.$messageBox("确定要删除吗?","","删除","error").then(async()=>{await Ce({report_uuids:p}),r.value.getTableList()})},m=e.reactive([{type:"selection",width:80},{field:"report_name",name:"名称",search:{type:"input"}},{field:"report_desc",name:"报表描述"},{field:"create_time",name:"创建时间"},{field:"operation",width:140,name:"操作",align:"center",fixed:"right",render:p=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"View",title:"预览",onClick:()=>l(p.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"Edit",title:"编辑",onClick:()=>i(p.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:"删除",onClick:()=>_([p.row.report_uuid])},null)])}]);return(p,C)=>{const c=e.resolveComponent("el-button"),b=e.resolveComponent("TdsTable");return e.openBlock(),e.createElementBlock("div",Tt,[e.createVNode(b,{ref_key:"proTable",ref:r,columns:m,"request-api":e.unref(be),"init-param":t.value,"row-key":"report_uuid",options:p.$tableOptions(),"search-col":6,onSelectionChange:d},{tableHeader:e.withCtx(g=>[e.createVNode(c,{plain:"",type:"primary",class:"custom-btn",icon:"Plus",onClick:u},{default:e.withCtx(()=>C[0]||(C[0]=[e.createTextVNode("添加")])),_:1}),e.createVNode(c,{plain:"",type:"danger",icon:"Delete",onClick:h=>_(g.selectedListIds)},{default:e.withCtx(()=>C[1]||(C[1]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1},8,["columns","request-api","init-param","options"])])}}}),Ot="",St={style:{height:"100%"}},Lt=e.defineComponent({name:"TCReport",__name:"index",setup(n){const o=e.ref(),t=e.ref("table"),r=(a,l)=>{o.value=a,t.value=l};return(a,l)=>(e.openBlock(),e.createElementBlock("div",St,[e.createVNode(e.TransitionGroup,{name:"slide-fade"},{default:e.withCtx(()=>[t.value==="table"?(e.openBlock(),e.createBlock(Et,{key:0,onClick:r})):e.createCommentVNode("",!0),t.value==="review"?(e.openBlock(),e.createBlock(ot,{key:1,"report-id":o.value,modelValue:t.value,"onUpdate:modelValue":l[0]||(l[0]=i=>t.value=i)},null,8,["report-id","modelValue"])):e.createCommentVNode("",!0),t.value==="editor"?(e.openBlock(),e.createBlock(Bt,{key:2,"report-id":o.value,modelValue:t.value,"onUpdate:modelValue":l[1]||(l[1]=i=>t.value=i)},null,8,["report-id","modelValue"])):e.createCommentVNode("",!0)]),_:1})]))}}),Wt="",P=(n,o)=>{if(n.install=t=>{for(const r of[n,...Object.values(o??{})])t.component(r.name,r)},o)for(const[t,r]of Object.entries(o))n[t]=r;return n},le=P(Lt),Rt=[{label:"正文",value:"p"},{label:"表格",value:"report-table"},{label:"趋势图",value:"line"},{label:"扇形统计图",value:"pie"},{label:"柱形图",value:"bar"},{label:"描述列表",value:"report-describe"}],Ut=[{value:"p",fields:["table_key_relation"]},{value:"report-table",fields:["p_text"]},{value:"line",fields:["p_text","table_key_relation"]},{value:"pie",fields:["p_text","table_key_relation"]},{value:"bar",fields:["p_text","table_key_relation"]},{value:"report-describe",fields:["p_text"]}],Ft={class:"table-box"},Dt=e.defineComponent({name:"TCModule",__name:"index",setup(n){const o=e.ref(),t=e.ref(),r=e.ref({}),a=e.ref(""),l=e.reactive({prod_type:window.$prodType});function i(c){window.$messageBox("确定要删除吗?","","删除","error").then(async()=>{await ge({rp_item_uuids:c}),o.value.getTableList()})}function u(c){r.value=c?Object.assign({},c):{table_key_relation:[{name:"",key:"",id:new Date().getTime()}]},a.value=c?"编辑自定义组件":"新增自定义组件",t.value.open()}async function d(c){const b=Object.assign({},c);b.chart_type!=="report-table"&&b.chart_type!=="report-describe"&&delete b.table_key_relation,b.chart_type!=="p"&&(b.p_text=""),b.rp_item_uuid?await we({rp_item_uuid:b.rp_item_uuid,data:b}):(b.prod_type=window.$prodType,await ye({data:b})),o.value.getTableList(),t.value.close()}const _=c=>{r.value.table_key_relation.splice(c,1)},m=()=>{r.value.table_key_relation.push({name:"",key:"",id:new Date().getTime()})},p=(c,b,g)=>{delete c.message,b.forEach(h=>{h.name?h.key||g(new Error("请填写表头名称和KEY")):g(new Error("请填写表头名称和KEY"))}),g()},C=e.reactive([{type:"selection",width:60,field:"rp_item_uuid",align:"center"},{field:"rp_item_name",name:"组件名称",show:{type:"input"},rules:[{required:!0}]},{field:"filter_uuid",name:"筛选条件",enum:()=>Y({prod_type:window.$prodType}),fieldNames:{label:"filter_name",value:"filter_uuid"},show:{type:"select"},rules:[{required:!0}]},{field:"chart_type",name:"组件类型",enum:Rt,show:{type:"select",display:Ut},rules:[{required:!0}]},{field:"data_uri",name:"URI",show:{type:"input"},rules:[{required:!0}]},{field:"table_key_relation",name:"表格数据",hide:!0,show:{render:()=>{var c;return e.createVNode("div",{style:"width:80%"},[e.createVNode("div",{class:"flex items-center space-between report-com-title",style:"gap:15px;"},[e.createVNode("span",{style:"width:50%"},[e.createTextVNode("表头名称")]),e.createVNode("span",{style:"width:50%"},[e.createTextVNode("KEY")])]),(c=r.value.table_key_relation)==null?void 0:c.map((b,g)=>e.createVNode("div",{class:"flex items-center space-between form-m0 w-100%",style:"gap:15px;margin-bottom:10px;",key:g},[e.createVNode(e.resolveComponent("el-form-item"),{style:"width:50%"},{default:()=>[e.createVNode(e.resolveComponent("el-input"),{modelValue:b.name,"onUpdate:modelValue":h=>b.name=h,class:"",placeholder:"表头"},null)]}),e.createVNode(e.resolveComponent("el-form-item"),{style:"width:50%"},{default:()=>[e.createVNode(e.resolveComponent("el-input"),{modelValue:b.key,"onUpdate:modelValue":h=>b.key=h,class:"",placeholder:"KEY"},null)]}),r.value.table_key_relation.length>1&&e.createVNode("div",{class:"report-btn-remove absolute right--13px text-#f56c6c hover:cursor-pointer"},[e.createVNode(e.resolveComponent("el-icon"),{onClick:()=>_(g)},{default:()=>[e.createVNode(pe.CircleClose,null,null)]})])])),e.createVNode(e.resolveComponent("el-button"),{class:"report-btn ",icon:"Plus",onClick:()=>m()},{default:()=>[e.createTextVNode("新增表头与KEY")]})])}},prop:{required:!0},rules:[{required:!0,validator:p,trigger:"blur"}]},{field:"p_text",name:"正文",hide:!0,show:{type:"input",prop:{type:"textarea",rows:4}},rules:[{required:!0}]},{field:"create_time",name:"创建时间"},{field:"operation",width:140,name:"操作",align:"center",fixed:"right",render:c=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",class:"custom-btn",icon:"Edit",title:"编辑",onClick:()=>u(c.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:"删除",onClick:()=>i([c.row.rp_item_uuid])},null)])}]);return(c,b)=>{const g=e.resolveComponent("el-button"),h=e.resolveComponent("TdsTable"),s=e.resolveComponent("TdsForm");return e.openBlock(),e.createElementBlock("div",Ft,[e.createVNode(h,{ref_key:"refTdsTable",ref:o,columns:C,"request-api":e.unref(he),"init-param":l,"row-key":"rp_item_uuid",options:c.$tableOptions(),"search-col":6},{tableHeader:e.withCtx(f=>[e.createVNode(g,{plain:"",type:"primary",class:"custom-btn",icon:"Plus",onClick:b[0]||(b[0]=k=>u())},{default:e.withCtx(()=>b[1]||(b[1]=[e.createTextVNode("添加")])),_:1}),e.createVNode(g,{plain:"",type:"danger",icon:"Delete",onClick:k=>i(f.selectedListIds)},{default:e.withCtx(()=>b[2]||(b[2]=[e.createTextVNode("删除")])),_:2},1032,["onClick"])]),_:1},8,["columns","request-api","init-param","options"]),e.createVNode(s,e.mergeProps({ref_key:"refTdsForm",ref:t},c.$formBindProps({title:a.value,form:r.value,columns:C}),{onSubmit:d}),null,16)])}}}),Yt="",re=P(Dt),At={class:"table-box"};function ae(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!e.isVNode(n)}const ie=P(e.defineComponent({name:"TCSubscribe",__name:"index",setup(n){const o=e.ref(),t=e.ref(),{$t:r,$messageBox:a}=window,l=e.ref(""),i=e.ref({receiver:[]});function u(s){a(s,"subscript_name",r("button.delete"),"error").then(async()=>{await Ne({subscript_uuids:s.map(f=>f.subscript_uuid)}),o.value.getTableList()})}function d(){u(o.value.selectedList)}const _=s=>{i.value=s?Object.assign({},s):{receiver:[]},l.value=s?"编辑报表订阅":"新增报表订阅",t.value.open()};async function m(s){const f=Object.assign({},s);f.subscript_uuid?await xe({subscript_uuid:f.subscript_uuid,data:f}):await ke({data:f}),o.value.getTableList(),t.value.close()}function p(s,f,k){if(!f||f.length===0)return k(new Error("请输入收件人"));k()}const C=(s,f)=>{s.target.value&&i.value[f].push(s.target.value)},c=[{label:"周一",value:1},{label:"周二",value:2},{label:"周三",value:3},{label:"周四",value:4},{label:"周五",value:5},{label:"周六",value:6},{label:"周日",value:0}],b=[{label:"每天",value:0},{label:"每周",value:1},{label:"每月",value:2}],g=[],h=e.reactive([{type:"selection",align:"center",field:"subscript_uuid",width:80},{field:"subscript_name",name:"订阅名称",show:{type:"input",order:1},rules:[{required:!0,message:"请输入名称",trigger:"blur"}]},{field:"subscript_desc",name:"订阅描述",show:{type:"input",order:2}},{field:"report_uuid",name:"报表类型",enum:()=>Be({prod_type:window.$prodType}),fieldNames:{label:"report_name",value:"report_uuid"},show:{type:"select"},rules:[{required:!0,type:"any"}]},{field:"format",name:"报表格式",enum:Te,fieldNames:{label:"name",value:"id"},show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"select_data",name:"资产/任务",enum:Ee,fieldNames:{label:"label",value:"data"},hide:!0,show:{type:"select",prop:{multiple:!0}},params:{report_uuid:"report_uuid",prod_type:{type:2,key:window.$prodType}},render:s=>o.value.enumMap.get("dbsId").filter(y=>s.row.dbsId.indexOf(y.id)>-1).map(y=>e.createVNode(e.resolveComponent("el-tag"),{class:"mr-10px",type:"info"},{default:()=>[y.policy_name]}))},{field:"receiver_email",name:"收件人",width:300,render:s=>e.createVNode(e.Fragment,null,[s.row.receiver_email.map(f=>e.createVNode(e.resolveComponent("el-tag"),{class:"mr-10px",type:"info"},ae(f)?f:{default:()=>[f]}))]),show:{type:"input",render:()=>{let s;return e.createVNode(e.Fragment,null,[e.createVNode(e.resolveComponent("el-select"),{class:"right-select",modelValue:i.value.receiver_email,"onUpdate:modelValue":f=>i.value.receiver_email=f,placeholder:"请输入",multiple:!0,filterable:!0,"allow-create":!0,"default-first-option":!0,"reserve-keyword":!1,onBlur:f=>C(f,"receiver_email")},ae(s=g.map(f=>e.createVNode(e.resolveComponent("el-option"),{label:f.label,value:f.value},null)))?s:{default:()=>[s]}),e.createVNode("p",{style:"font-size:12px;color:#909399;line-height:20px"},[e.createTextVNode("可输入多个收件人邮箱,多个值间以“回车键”分隔,例:xxx@163.com xx@qq.com")])])}},rules:[{required:!0,validator:p,type:"any",trigger:"change"}]},{field:"show_timing_time",name:"发送周期"},{field:"loop_type",name:"发送周期",hide:!0,enum:b,show:{dataType:"number",type:"select",display:[{value:0,fields:["day","weekday"]},{value:1,fields:["day"]},{value:2,fields:["weekday"]}]},rules:[{required:!0,type:"number"}]},{field:"day",name:"日",hide:!0,enum:[...Array(28)].map((s,f)=>({label:f+1+"",value:f+1})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"weekday",name:"星期",hide:!0,enum:c,show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"hour",name:"小时",hide:!0,enum:[...Array(24)].map((s,f)=>({label:f+"时",value:f})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"minute",name:"分钟",hide:!0,enum:[...Array(60)].map((s,f)=>({label:f+"分",value:f})),show:{type:"select"},rules:[{required:!0,type:"number"}]},{field:"enable_status",name:"启用状态",render:s=>e.createVNode(e.resolveComponent("el-switch"),{modelValue:s.row.enable_status,"onUpdate:modelValue":f=>s.row.enable_status=f,"active-value":1,"inactive-value":0,onChange:f=>{$e({subscript_uuid:s.row.subscript_uuid,enable_status:f}),o.value.getTableList()}},null)},{field:"operation",name:"操作",fixed:"right",cardHide:!0,width:120,render:s=>e.createVNode("div",null,[e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"primary",icon:"Edit",title:r("button.edit"),class:"custom-btn",onClick:()=>_(s.row)},null),e.createVNode(e.resolveComponent("el-button"),{link:!0,type:"danger",icon:"Delete",title:r("button.delete"),onClick:()=>u([s.row])},null)])}]);return(s,f)=>{const k=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",At,[e.createVNode(e.unref(O.TdsTable),{ref_key:"refTdsTable",ref:o,"row-key":"subscript_uuid","request-api":e.unref(Ve),columns:h,options:s.$tableOptions()},{tableHeader:e.withCtx(y=>[e.createVNode(k,{type:"primary",icon:"Plus",class:"custom-btn",plain:"",onClick:f[0]||(f[0]=U=>_())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("button.add")),1)]),_:1}),e.createVNode(k,{type:"danger",icon:"Delete",plain:"",onClick:d,disabled:!y.selectedListIds.length},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(r)("button.delete")),1)]),_:2},1032,["disabled"])]),_:1},8,["request-api","columns","options"]),e.createVNode(e.unref(O.TdsForm),e.mergeProps({ref_key:"refTdsForm",ref:t},s.$formBindProps({title:l.value,form:i.value,columns:h}),{onSubmit:m}),null,16)])}}})),qt={TCReport:le,TCModule:re,TCSubscribe:ie},zt={install(n,o){Object.entries(qt).forEach(([t,r])=>{n.component(t,r)}),o.prodType&&(window.$prodType=o.prodType),o.envURL&&(window.$reportURL=o.envURL)}};w.TCModule=re,w.TCReport=le,w.TCSubscribe=ie,w.default=zt,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|