yh-report 2.0.11 → 2.0.13
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/{StatementDesign-6c5fe32e.mjs → StatementDesign-b4a2f41e.mjs} +4692 -4699
- package/StatementDesign-b4a2f41e.mjs.map +1 -0
- package/{StatementDetail-f32c92b1.mjs → StatementDetail-edc9161f.mjs} +2 -2
- package/{StatementDetail-f32c92b1.mjs.map → StatementDetail-edc9161f.mjs.map} +1 -1
- package/{StatementList-0cdc088a.mjs → StatementList-5d581f19.mjs} +19 -19
- package/StatementList-5d581f19.mjs.map +1 -0
- package/{index-d33c144b.mjs → index-0e5f0fbf.mjs} +928 -942
- package/index-0e5f0fbf.mjs.map +1 -0
- package/index.es.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/StatementDesign-6c5fe32e.mjs.map +0 -1
- package/StatementList-0cdc088a.mjs.map +0 -1
- package/index-d33c144b.mjs.map +0 -1
|
@@ -5,7 +5,7 @@ import { cloneDeep } from "lodash-es";
|
|
|
5
5
|
import { useRouter } from "vue-router";
|
|
6
6
|
import * as echarts from "echarts";
|
|
7
7
|
const statementDesign = "";
|
|
8
|
-
var CellType = /* @__PURE__ */ ((
|
|
8
|
+
var CellType = /* @__PURE__ */ ((t) => (t.ROW = "row", t.COL = "col", t.CELL = "cell", t.HEAD = "head", t.TEXT = "text", t.ICON = "icon", t.FUN = "fun", t.IMAGE = "img", t.FIELD = "field", t))(CellType || {}), FormatType = /* @__PURE__ */ ((t) => (t.TEXT = "text", t.NUMBER = "number", t.CURRENCY = "currency", t.PERCENT = "percent", t.PROMILLE = "promille", t.SCIENTIFIC = "scientific", t.DATETIME = "datetime", t.STRING = "string", t))(FormatType || {}), DataSourceColumnDataType = /* @__PURE__ */ ((t) => (t[t.STRING = 0] = "STRING", t[t.PLONG = 1] = "PLONG", t[t.LONG = 2] = "LONG", t[t.DOUBLE = 3] = "DOUBLE", t[t.TEXT = 4] = "TEXT", t[t.BOOL = 5] = "BOOL", t[t.DATE = 6] = "DATE", t[t.TIME = 7] = "TIME", t[t.DATETIME = 8] = "DATETIME", t[t.PASSWORD = 9] = "PASSWORD", t[t.ID = 10] = "ID", t[t.LIST = 11] = "LIST", t[t.TABLE = 12] = "TABLE", t[t.TREE = 13] = "TREE", t[t.IMG = 14] = "IMG", t[t.OPEN = 15] = "OPEN", t[t.SQL = 16] = "SQL", t[t.COLOR = 17] = "COLOR", t[t.EDITOR = 18] = "EDITOR", t))(DataSourceColumnDataType || {});
|
|
9
9
|
const defaultCell = {
|
|
10
10
|
type: CellType.TEXT,
|
|
11
11
|
format: FormatType.TEXT,
|
|
@@ -34,64 +34,50 @@ const defaultCell = {
|
|
|
34
34
|
loop: !1,
|
|
35
35
|
index: 0
|
|
36
36
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
isComplete = !1;
|
|
41
|
-
const t = {
|
|
42
|
-
...e,
|
|
43
|
-
// @ts-ignore
|
|
44
|
-
options: ((r = e.options) == null ? void 0 : r.map((n) => n.type === "report" ? validateAndCompleteStatementOption(n) : n)) || []
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
isComplete,
|
|
48
|
-
data: t
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function validateAndCompleteStatementOption(e) {
|
|
52
|
-
Object.keys(defaultReport).length !== Object.keys(e).length && (isComplete = !0);
|
|
53
|
-
const t = {
|
|
37
|
+
function validateAndCompleteStatementOption(t) {
|
|
38
|
+
Object.keys(defaultReport).length, Object.keys(t).length;
|
|
39
|
+
const e = {
|
|
54
40
|
...defaultReport,
|
|
55
|
-
...
|
|
41
|
+
...t,
|
|
56
42
|
id: `report-${Date.now()}`
|
|
57
43
|
};
|
|
58
|
-
|
|
44
|
+
e.rowConfig.length === 0 && (e.rowConfig = Array.from({ length: 5 }, (n, c) => ({
|
|
59
45
|
size: 25,
|
|
60
46
|
data: void 0,
|
|
61
47
|
loop: !1,
|
|
62
48
|
index: c
|
|
63
|
-
}))),
|
|
49
|
+
}))), e.colConfig.length === 0 && (e.colConfig = Array.from({ length: 10 }, (n, c) => ({
|
|
64
50
|
...defaultCol
|
|
65
51
|
})));
|
|
66
|
-
const r =
|
|
67
|
-
return
|
|
52
|
+
const r = e.rowConfig.length, i = e.colConfig.length;
|
|
53
|
+
return e.config.length, e.config = e.config.map((n, c) => (n.length, n.slice(0, i).map((s, m) => (Object.keys(s).length, Object.keys(defaultCell).length, {
|
|
68
54
|
...defaultCell,
|
|
69
55
|
...s,
|
|
70
56
|
row: c,
|
|
71
57
|
col: m
|
|
72
58
|
})).concat(
|
|
73
|
-
Array.from({ length:
|
|
59
|
+
Array.from({ length: i - n.length }, (s, m) => ({
|
|
74
60
|
...defaultCell,
|
|
75
61
|
row: c,
|
|
76
|
-
col:
|
|
62
|
+
col: n.length + m
|
|
77
63
|
// 填充列时,列索引从当前行已有列数开始
|
|
78
64
|
}))
|
|
79
65
|
))).concat(
|
|
80
|
-
Array.from({ length: r -
|
|
81
|
-
const s =
|
|
82
|
-
return Array(
|
|
66
|
+
Array.from({ length: r - e.config.length }, (n, c) => {
|
|
67
|
+
const s = e.config.length + c;
|
|
68
|
+
return Array(i).fill(0).map((m, f) => ({
|
|
83
69
|
...defaultCell,
|
|
84
70
|
row: s,
|
|
85
71
|
col: f
|
|
86
72
|
}));
|
|
87
73
|
})
|
|
88
|
-
),
|
|
74
|
+
), e.rowConfig = e.rowConfig.map((n) => (Object.keys(n).length, Object.keys(defaultRow).length, {
|
|
89
75
|
...defaultRow,
|
|
90
|
-
...
|
|
91
|
-
})),
|
|
76
|
+
...n
|
|
77
|
+
})), e.colConfig = e.colConfig.map((n) => ({
|
|
92
78
|
...defaultCol,
|
|
93
|
-
...
|
|
94
|
-
})),
|
|
79
|
+
...n
|
|
80
|
+
})), e;
|
|
95
81
|
}
|
|
96
82
|
const TypeItems = ref([
|
|
97
83
|
{
|
|
@@ -139,16 +125,16 @@ const TypeItems = ref([
|
|
|
139
125
|
icon: "icon-books",
|
|
140
126
|
type: "label"
|
|
141
127
|
}
|
|
142
|
-
]), ItemTypes = computed(() => TypeItems.value.map((
|
|
143
|
-
const r =
|
|
144
|
-
let
|
|
145
|
-
Array.isArray(
|
|
146
|
-
const c =
|
|
147
|
-
let
|
|
148
|
-
|
|
128
|
+
]), ItemTypes = computed(() => TypeItems.value.map((t) => t.type)), colors = ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272"], renderItem = (t, e) => {
|
|
129
|
+
const r = t.dataIndex, i = e.value();
|
|
130
|
+
let n = e.value(1);
|
|
131
|
+
Array.isArray(n) && (n = n.map((N) => String.fromCharCode(N)).join(""));
|
|
132
|
+
const c = e.getWidth(), s = e.getHeight(), m = colors[r % 6], f = t.dataInsideLength;
|
|
133
|
+
let x = c * 0.01;
|
|
134
|
+
x < 10 && (x = 10), x > 15 && (x = 15);
|
|
149
135
|
let C = s * 0.5;
|
|
150
136
|
C < 60 && (C = 60);
|
|
151
|
-
const
|
|
137
|
+
const E = (c - x * 2 - x * (f - 1)) / f, v = 8, g = x + r * (E + x), b = (e.getHeight() - C) / 2;
|
|
152
138
|
return {
|
|
153
139
|
type: "group",
|
|
154
140
|
children: [
|
|
@@ -157,9 +143,9 @@ const TypeItems = ref([
|
|
|
157
143
|
shape: {
|
|
158
144
|
x: g,
|
|
159
145
|
y: b,
|
|
160
|
-
width:
|
|
146
|
+
width: E,
|
|
161
147
|
height: C,
|
|
162
|
-
r:
|
|
148
|
+
r: v
|
|
163
149
|
},
|
|
164
150
|
style: {
|
|
165
151
|
fill: m,
|
|
@@ -172,9 +158,9 @@ const TypeItems = ref([
|
|
|
172
158
|
{
|
|
173
159
|
type: "text",
|
|
174
160
|
style: {
|
|
175
|
-
text: `${
|
|
161
|
+
text: `${n}
|
|
176
162
|
|
|
177
|
-
${
|
|
163
|
+
${i}`,
|
|
178
164
|
fill: "#fff",
|
|
179
165
|
// 自动反色可改为:echarts.color.lift(color, 0.8)
|
|
180
166
|
fontSize: 14,
|
|
@@ -182,7 +168,7 @@ ${n}`,
|
|
|
182
168
|
align: "center",
|
|
183
169
|
verticalAlign: "middle"
|
|
184
170
|
},
|
|
185
|
-
position: [g +
|
|
171
|
+
position: [g + E / 2, b + C / 2]
|
|
186
172
|
}
|
|
187
173
|
]
|
|
188
174
|
};
|
|
@@ -701,457 +687,457 @@ ${n}`,
|
|
|
701
687
|
},
|
|
702
688
|
rowConfig: [],
|
|
703
689
|
colConfig: []
|
|
704
|
-
}, setXAxisData = (
|
|
705
|
-
let { option: r } =
|
|
706
|
-
if (
|
|
690
|
+
}, setXAxisData = (t, e) => {
|
|
691
|
+
let { option: r } = t, { xDataId: i } = r, n, c;
|
|
692
|
+
if (i.length === 3 ? (e && e[i[0]] && (n = e[i[0]][i[1]]), c = i[2]) : (n = e[i[0]], c = i[1]), !n)
|
|
707
693
|
return r;
|
|
708
694
|
let s = [];
|
|
709
|
-
if (
|
|
695
|
+
if (t.groupBy) {
|
|
710
696
|
let m = /* @__PURE__ */ new Set();
|
|
711
|
-
|
|
697
|
+
n.forEach((f) => {
|
|
712
698
|
m.add(f[c]);
|
|
713
699
|
}), s = [...m];
|
|
714
700
|
} else
|
|
715
|
-
s =
|
|
716
|
-
return
|
|
717
|
-
}, setYAxisData = (
|
|
718
|
-
let { option: r } =
|
|
719
|
-
if (r.xDataId && (r.xDataId.length === 3 ? (
|
|
720
|
-
if (
|
|
701
|
+
s = n.map((m) => m[c]);
|
|
702
|
+
return t.type == "rowBar" ? r.yAxis.data = s : ["line", "bar"].includes(t.type) ? r.xAxis.data = s : t.type == "radar" && (r.radar.indicator = s), r;
|
|
703
|
+
}, setYAxisData = (t, e) => {
|
|
704
|
+
let { option: r } = t, { yDataId: i } = r, n = [], c = "";
|
|
705
|
+
if (r.xDataId && (r.xDataId.length === 3 ? (e && e[r.xDataId[0]] && (n = e[r.xDataId[0]][r.xDataId[1]]), c = r.xDataId[2]) : (n = e[r.xDataId[0]], c = r.xDataId[1])), n)
|
|
706
|
+
if (t.groupBy) {
|
|
721
707
|
let s = /* @__PURE__ */ new Set();
|
|
722
|
-
|
|
708
|
+
n.forEach((m) => {
|
|
723
709
|
s.add(m[c]);
|
|
724
|
-
}),
|
|
710
|
+
}), n = [...s];
|
|
725
711
|
} else
|
|
726
|
-
|
|
727
|
-
if (
|
|
712
|
+
n = n.map((s) => s[c]);
|
|
713
|
+
if (t.type == "radar") {
|
|
728
714
|
r.series[0].data = [];
|
|
729
|
-
for (let s of
|
|
715
|
+
for (let s of i) {
|
|
730
716
|
let m, f;
|
|
731
|
-
s.length === 3 ? (
|
|
732
|
-
let
|
|
733
|
-
if (
|
|
717
|
+
s.length === 3 ? (e[s[0]] && (m = e[s[0]][s[1]]), f = s[2]) : (m = e[s[0]], f = s[1]);
|
|
718
|
+
let x = [];
|
|
719
|
+
if (t.groupBy && n) {
|
|
734
720
|
let C = {};
|
|
735
|
-
m.forEach((
|
|
736
|
-
let
|
|
737
|
-
|
|
738
|
-
}),
|
|
721
|
+
m.forEach((E) => {
|
|
722
|
+
let v = E[c], g = E[f];
|
|
723
|
+
v && !isNaN(g) && (C[v] || (C[v] = 0), C[v] = g);
|
|
724
|
+
}), x = n.map((E) => C[E]);
|
|
739
725
|
} else
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
value:
|
|
726
|
+
x = m.map((C) => C[f]);
|
|
727
|
+
t.orderBy && t.orderBy !== "NONE" && (x = x.sort((C, E) => t.orderBy === "ASC" ? C - E : E - C), !isNaN(t.cutLength) && t.cutLength > 0 && (x = x.slice(0, t.cutLength))), r.series[0].data.push({
|
|
728
|
+
value: x
|
|
743
729
|
});
|
|
744
730
|
}
|
|
745
|
-
} else if (
|
|
746
|
-
if (
|
|
747
|
-
let [s, m] =
|
|
748
|
-
if (
|
|
749
|
-
let f =
|
|
731
|
+
} else if (t.type == "treemap") {
|
|
732
|
+
if (i && i.length) {
|
|
733
|
+
let [s, m] = i[0];
|
|
734
|
+
if (e[s][0]) {
|
|
735
|
+
let f = e[s][0][m];
|
|
750
736
|
if (f) {
|
|
751
|
-
let
|
|
752
|
-
r.series[0].data[0].name = `${
|
|
737
|
+
let x = r.series[0].data[0].name.split(":")[0];
|
|
738
|
+
r.series[0].data[0].name = `${x}:${f}`;
|
|
753
739
|
}
|
|
754
740
|
}
|
|
755
741
|
}
|
|
756
742
|
} else {
|
|
757
743
|
let s = cloneDeep(r.series);
|
|
758
|
-
|
|
759
|
-
for (let m = 0; m <
|
|
760
|
-
let f =
|
|
761
|
-
f.length === 3 ? (
|
|
762
|
-
let
|
|
763
|
-
|
|
764
|
-
let
|
|
765
|
-
if (
|
|
766
|
-
switch (
|
|
744
|
+
i.length && (r.series = []);
|
|
745
|
+
for (let m = 0; m < i.length; m++) {
|
|
746
|
+
let f = i[m], x, C;
|
|
747
|
+
f.length === 3 ? (e[f[0]] && (x = e[f[0]][f[1]]), C = f[2]) : (x = e[f[0]], C = f[1]);
|
|
748
|
+
let E = cloneDeep(s[0]);
|
|
749
|
+
E.data = [];
|
|
750
|
+
let v = [];
|
|
751
|
+
if (x && c && n) {
|
|
752
|
+
switch (t.type) {
|
|
767
753
|
case "line":
|
|
768
754
|
case "rowBar":
|
|
769
755
|
case "bar":
|
|
770
|
-
if (
|
|
756
|
+
if (t.groupBy) {
|
|
771
757
|
let g = {};
|
|
772
|
-
|
|
773
|
-
let N = b[c],
|
|
774
|
-
N && !isNaN(
|
|
775
|
-
}),
|
|
758
|
+
x.forEach((b) => {
|
|
759
|
+
let N = b[c], B = b[C];
|
|
760
|
+
N && !isNaN(B) && (g[N] || (g[N] = 0), g[N] = B);
|
|
761
|
+
}), v = n.map((b) => g[b]);
|
|
776
762
|
} else
|
|
777
|
-
|
|
778
|
-
|
|
763
|
+
v = x.map((g) => g[C]);
|
|
764
|
+
t.orderBy && t.orderBy !== "NONE" && (v = v.sort((g, b) => t.orderBy === "ASC" ? g - b : b - g), !isNaN(t.cutLength) && t.cutLength > 0 && (v = v.slice(0, t.cutLength)));
|
|
779
765
|
break;
|
|
780
766
|
case "pie":
|
|
781
|
-
if (
|
|
767
|
+
if (t.groupBy) {
|
|
782
768
|
let g = {};
|
|
783
|
-
|
|
784
|
-
let N = b[c],
|
|
785
|
-
N && !isNaN(
|
|
786
|
-
}),
|
|
769
|
+
x.forEach((b) => {
|
|
770
|
+
let N = b[c], B = b[C];
|
|
771
|
+
N && !isNaN(B) && (g[N] || (g[N] = 0), g[N] = B);
|
|
772
|
+
}), v = n.map((b) => ({ value: g[b], name: b }));
|
|
787
773
|
} else
|
|
788
|
-
|
|
789
|
-
|
|
774
|
+
v = x.map((g) => ({ value: g[C], name: g[c] }));
|
|
775
|
+
t.orderBy && t.orderBy !== "NONE" && (v = v.sort((g, b) => t.orderBy === "ASC" ? g - b : b - g), !isNaN(t.cutLength) && t.cutLength > 0 && (v = v.slice(0, t.cutLength)));
|
|
790
776
|
break;
|
|
791
777
|
case "scatter":
|
|
792
|
-
if (
|
|
778
|
+
if (t.groupBy) {
|
|
793
779
|
let g = {};
|
|
794
|
-
|
|
795
|
-
let N = b[c],
|
|
796
|
-
N && !isNaN(
|
|
797
|
-
}),
|
|
780
|
+
x.forEach((b) => {
|
|
781
|
+
let N = b[c], B = b[C];
|
|
782
|
+
N && !isNaN(B) && (g[N] || (g[N] = 0), g[N] = B);
|
|
783
|
+
}), v = n.map((b) => [b, g[b]]);
|
|
798
784
|
} else
|
|
799
|
-
|
|
800
|
-
|
|
785
|
+
v = x.map((g) => [g[c], g[C]]);
|
|
786
|
+
t.orderBy && t.orderBy !== "NONE" && (v = v.sort((g, b) => t.orderBy === "ASC" ? g - b : b - g), !isNaN(t.cutLength) && t.cutLength > 0 && (v = v.slice(0, t.cutLength)));
|
|
801
787
|
break;
|
|
802
788
|
case "label":
|
|
803
|
-
if (
|
|
789
|
+
if (t.groupBy) {
|
|
804
790
|
let g = {};
|
|
805
|
-
|
|
806
|
-
let N = b[c],
|
|
807
|
-
N && !isNaN(
|
|
808
|
-
}),
|
|
809
|
-
const N = b ? b.split("").map((
|
|
791
|
+
x.forEach((b) => {
|
|
792
|
+
let N = b[c], B = b[C];
|
|
793
|
+
N && !isNaN(B) && (g[N] || (g[N] = 0), g[N] = B);
|
|
794
|
+
}), v = n.map((b) => {
|
|
795
|
+
const N = b ? b.split("").map((B) => B.charCodeAt()) : [];
|
|
810
796
|
return [g[b], N];
|
|
811
797
|
});
|
|
812
798
|
} else
|
|
813
|
-
|
|
799
|
+
v = x.map((g) => {
|
|
814
800
|
const b = g[c] ? g[c].split("").map((N) => N.charCodeAt()) : [];
|
|
815
801
|
return [g[C], b];
|
|
816
802
|
});
|
|
817
|
-
|
|
803
|
+
t.orderBy && t.orderBy !== "NONE" && (v = v.sort((g, b) => t.orderBy === "ASC" ? g - b : b - g), !isNaN(t.cutLength) && t.cutLength > 0 && (v = v.slice(0, t.cutLength))), E.renderItem = renderItem;
|
|
818
804
|
break;
|
|
819
805
|
}
|
|
820
|
-
|
|
806
|
+
E.data = v;
|
|
821
807
|
}
|
|
822
|
-
r.series.push(
|
|
808
|
+
r.series.push(E);
|
|
823
809
|
}
|
|
824
810
|
}
|
|
825
811
|
return r;
|
|
826
812
|
};
|
|
827
|
-
function getReportDefaultOption(
|
|
828
|
-
if (
|
|
813
|
+
function getReportDefaultOption(t) {
|
|
814
|
+
if (t === "report")
|
|
829
815
|
return validateAndCompleteStatementOption(defaultReport);
|
|
830
816
|
{
|
|
831
|
-
let
|
|
832
|
-
return
|
|
817
|
+
let e = cloneDeep(defaultChart);
|
|
818
|
+
return e.id = `${t}-${Date.now()}`, e.type = t, e.option = chartsOption[t], e;
|
|
833
819
|
}
|
|
834
820
|
}
|
|
835
|
-
function getList(
|
|
821
|
+
function getList(t) {
|
|
836
822
|
return axios.request({
|
|
837
823
|
url: "sysReport/list",
|
|
838
824
|
method: "post",
|
|
839
825
|
type: "form",
|
|
840
|
-
data:
|
|
826
|
+
data: t
|
|
841
827
|
});
|
|
842
828
|
}
|
|
843
|
-
function getConfig(
|
|
829
|
+
function getConfig(t) {
|
|
844
830
|
return axios.request({
|
|
845
831
|
url: "sysReport/config",
|
|
846
832
|
method: "post",
|
|
847
833
|
params: {
|
|
848
|
-
id:
|
|
834
|
+
id: t
|
|
849
835
|
}
|
|
850
|
-
}).then((
|
|
851
|
-
let r = JSON.parse(
|
|
836
|
+
}).then((e) => {
|
|
837
|
+
let r = JSON.parse(e.data.info), { id: i, name: n, code: c, description: s, config: m, chartConfig: f } = r, x = [];
|
|
852
838
|
if (m && (m = JSON.parse(m), Array.isArray(m) && m.length)) {
|
|
853
839
|
if (m[0].type === "tableSheet")
|
|
854
840
|
throw ElMessage.error("当前报表版本不支持老版本数据,请等待老版本数据转换工具上线"), useRouter().back(), new Error("当前报表版本不支持老版本数据,请等待老版本数据转换工具上线");
|
|
855
|
-
m = m.map((C) => (ItemTypes.value.includes(C.type) || (C.type = "report"), C)),
|
|
841
|
+
m = m.map((C) => (ItemTypes.value.includes(C.type) || (C.type = "report"), C)), x = x.concat(m);
|
|
856
842
|
}
|
|
857
843
|
return f && (f = JSON.parse(f), Array.isArray(f) && (f.forEach((C) => {
|
|
858
844
|
C.data || (C.data = { source: [] });
|
|
859
|
-
}),
|
|
860
|
-
id:
|
|
861
|
-
name:
|
|
845
|
+
}), x = x.concat(f))), Promise.resolve({
|
|
846
|
+
id: i,
|
|
847
|
+
name: n,
|
|
862
848
|
code: c,
|
|
863
849
|
description: s,
|
|
864
|
-
remoteOptions:
|
|
850
|
+
remoteOptions: x
|
|
865
851
|
});
|
|
866
852
|
});
|
|
867
853
|
}
|
|
868
|
-
function save(
|
|
854
|
+
function save(t) {
|
|
869
855
|
return axios.request({
|
|
870
856
|
url: "sysReport/save",
|
|
871
857
|
method: "post",
|
|
872
858
|
type: "json",
|
|
873
|
-
data:
|
|
859
|
+
data: t
|
|
874
860
|
});
|
|
875
861
|
}
|
|
876
|
-
function del(
|
|
862
|
+
function del(t) {
|
|
877
863
|
return axios.request({
|
|
878
864
|
url: "sysReport/delete",
|
|
879
865
|
method: "post",
|
|
880
866
|
type: "form",
|
|
881
|
-
data: { id:
|
|
867
|
+
data: { id: t }
|
|
882
868
|
});
|
|
883
869
|
}
|
|
884
870
|
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
885
|
-
function getDefaultExportFromCjs(
|
|
886
|
-
return
|
|
871
|
+
function getDefaultExportFromCjs(t) {
|
|
872
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
887
873
|
}
|
|
888
874
|
var dayjs_min = { exports: {} };
|
|
889
|
-
(function(
|
|
890
|
-
(function(r,
|
|
891
|
-
|
|
875
|
+
(function(t, e) {
|
|
876
|
+
(function(r, i) {
|
|
877
|
+
t.exports = i();
|
|
892
878
|
})(commonjsGlobal, function() {
|
|
893
|
-
var r = 1e3,
|
|
894
|
-
var l = ["th", "st", "nd", "rd"],
|
|
895
|
-
return "[" + u + (l[(
|
|
896
|
-
} }, W = function(u, l,
|
|
897
|
-
var
|
|
898
|
-
return !
|
|
879
|
+
var r = 1e3, i = 6e4, n = 36e5, c = "millisecond", s = "second", m = "minute", f = "hour", x = "day", C = "week", E = "month", v = "quarter", g = "year", b = "date", N = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, J = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, Y = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(u) {
|
|
880
|
+
var l = ["th", "st", "nd", "rd"], o = u % 100;
|
|
881
|
+
return "[" + u + (l[(o - 20) % 10] || l[o] || l[0]) + "]";
|
|
882
|
+
} }, W = function(u, l, o) {
|
|
883
|
+
var d = String(u);
|
|
884
|
+
return !d || d.length >= l ? u : "" + Array(l + 1 - d.length).join(o) + u;
|
|
899
885
|
}, ne = { s: W, z: function(u) {
|
|
900
|
-
var l = -u.utcOffset(),
|
|
901
|
-
return (l <= 0 ? "+" : "-") + W(
|
|
902
|
-
}, m: function u(l,
|
|
903
|
-
if (l.date() <
|
|
904
|
-
return -u(
|
|
905
|
-
var
|
|
906
|
-
return +(-(
|
|
886
|
+
var l = -u.utcOffset(), o = Math.abs(l), d = Math.floor(o / 60), p = o % 60;
|
|
887
|
+
return (l <= 0 ? "+" : "-") + W(d, 2, "0") + ":" + W(p, 2, "0");
|
|
888
|
+
}, m: function u(l, o) {
|
|
889
|
+
if (l.date() < o.date())
|
|
890
|
+
return -u(o, l);
|
|
891
|
+
var d = 12 * (o.year() - l.year()) + (o.month() - l.month()), p = l.clone().add(d, E), y = o - p < 0, a = l.clone().add(d + (y ? -1 : 1), E);
|
|
892
|
+
return +(-(d + (o - p) / (y ? p - a : a - p)) || 0);
|
|
907
893
|
}, a: function(u) {
|
|
908
894
|
return u < 0 ? Math.ceil(u) || 0 : Math.floor(u);
|
|
909
895
|
}, p: function(u) {
|
|
910
|
-
return { M:
|
|
896
|
+
return { M: E, y: g, w: C, d: x, D: b, h: f, m, s, ms: c, Q: v }[u] || String(u || "").toLowerCase().replace(/s$/, "");
|
|
911
897
|
}, u: function(u) {
|
|
912
898
|
return u === void 0;
|
|
913
899
|
} }, Q = "en", q = {};
|
|
914
900
|
q[Q] = Y;
|
|
915
901
|
var re = "$isDayjsObject", Z = function(u) {
|
|
916
902
|
return u instanceof O || !(!u || !u[re]);
|
|
917
|
-
}, ee = function u(l,
|
|
918
|
-
var
|
|
903
|
+
}, ee = function u(l, o, d) {
|
|
904
|
+
var p;
|
|
919
905
|
if (!l)
|
|
920
906
|
return Q;
|
|
921
907
|
if (typeof l == "string") {
|
|
922
|
-
var
|
|
923
|
-
q[
|
|
924
|
-
var
|
|
925
|
-
if (!
|
|
926
|
-
return u(
|
|
908
|
+
var y = l.toLowerCase();
|
|
909
|
+
q[y] && (p = y), o && (q[y] = o, p = y);
|
|
910
|
+
var a = l.split("-");
|
|
911
|
+
if (!p && a.length > 1)
|
|
912
|
+
return u(a[0]);
|
|
927
913
|
} else {
|
|
928
|
-
var
|
|
929
|
-
q[
|
|
914
|
+
var S = l.name;
|
|
915
|
+
q[S] = l, p = S;
|
|
930
916
|
}
|
|
931
|
-
return !
|
|
917
|
+
return !d && p && (Q = p), p || !d && Q;
|
|
932
918
|
}, X = function(u, l) {
|
|
933
919
|
if (Z(u))
|
|
934
920
|
return u.clone();
|
|
935
|
-
var
|
|
936
|
-
return
|
|
921
|
+
var o = typeof l == "object" ? l : {};
|
|
922
|
+
return o.date = u, o.args = arguments, new O(o);
|
|
937
923
|
}, j = ne;
|
|
938
924
|
j.l = ee, j.i = Z, j.w = function(u, l) {
|
|
939
925
|
return X(u, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
|
|
940
926
|
};
|
|
941
927
|
var O = function() {
|
|
942
|
-
function u(
|
|
943
|
-
this.$L = ee(
|
|
928
|
+
function u(o) {
|
|
929
|
+
this.$L = ee(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[re] = !0;
|
|
944
930
|
}
|
|
945
931
|
var l = u.prototype;
|
|
946
|
-
return l.parse = function(
|
|
947
|
-
this.$d = function(
|
|
948
|
-
var
|
|
949
|
-
if (
|
|
932
|
+
return l.parse = function(o) {
|
|
933
|
+
this.$d = function(d) {
|
|
934
|
+
var p = d.date, y = d.utc;
|
|
935
|
+
if (p === null)
|
|
950
936
|
return /* @__PURE__ */ new Date(NaN);
|
|
951
|
-
if (j.u(
|
|
937
|
+
if (j.u(p))
|
|
952
938
|
return /* @__PURE__ */ new Date();
|
|
953
|
-
if (
|
|
954
|
-
return new Date(
|
|
955
|
-
if (typeof
|
|
956
|
-
var
|
|
957
|
-
if (
|
|
958
|
-
var
|
|
959
|
-
return
|
|
939
|
+
if (p instanceof Date)
|
|
940
|
+
return new Date(p);
|
|
941
|
+
if (typeof p == "string" && !/Z$/i.test(p)) {
|
|
942
|
+
var a = p.match(B);
|
|
943
|
+
if (a) {
|
|
944
|
+
var S = a[2] - 1 || 0, $ = (a[7] || "0").substring(0, 3);
|
|
945
|
+
return y ? new Date(Date.UTC(a[1], S, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, $)) : new Date(a[1], S, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, $);
|
|
960
946
|
}
|
|
961
947
|
}
|
|
962
|
-
return new Date(
|
|
963
|
-
}(
|
|
948
|
+
return new Date(p);
|
|
949
|
+
}(o), this.init();
|
|
964
950
|
}, l.init = function() {
|
|
965
|
-
var
|
|
966
|
-
this.$y =
|
|
951
|
+
var o = this.$d;
|
|
952
|
+
this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds();
|
|
967
953
|
}, l.$utils = function() {
|
|
968
954
|
return j;
|
|
969
955
|
}, l.isValid = function() {
|
|
970
956
|
return this.$d.toString() !== N;
|
|
971
|
-
}, l.isSame = function(
|
|
972
|
-
var
|
|
973
|
-
return this.startOf(
|
|
974
|
-
}, l.isAfter = function(
|
|
975
|
-
return X(
|
|
976
|
-
}, l.isBefore = function(
|
|
977
|
-
return this.endOf(
|
|
978
|
-
}, l.$g = function(
|
|
979
|
-
return j.u(
|
|
957
|
+
}, l.isSame = function(o, d) {
|
|
958
|
+
var p = X(o);
|
|
959
|
+
return this.startOf(d) <= p && p <= this.endOf(d);
|
|
960
|
+
}, l.isAfter = function(o, d) {
|
|
961
|
+
return X(o) < this.startOf(d);
|
|
962
|
+
}, l.isBefore = function(o, d) {
|
|
963
|
+
return this.endOf(d) < X(o);
|
|
964
|
+
}, l.$g = function(o, d, p) {
|
|
965
|
+
return j.u(o) ? this[d] : this.set(p, o);
|
|
980
966
|
}, l.unix = function() {
|
|
981
967
|
return Math.floor(this.valueOf() / 1e3);
|
|
982
968
|
}, l.valueOf = function() {
|
|
983
969
|
return this.$d.getTime();
|
|
984
|
-
}, l.startOf = function(
|
|
985
|
-
var
|
|
986
|
-
var
|
|
987
|
-
return
|
|
988
|
-
},
|
|
989
|
-
return j.w(
|
|
970
|
+
}, l.startOf = function(o, d) {
|
|
971
|
+
var p = this, y = !!j.u(d) || d, a = j.p(o), S = function(T, k) {
|
|
972
|
+
var A = j.w(p.$u ? Date.UTC(p.$y, k, T) : new Date(p.$y, k, T), p);
|
|
973
|
+
return y ? A : A.endOf(x);
|
|
974
|
+
}, $ = function(T, k) {
|
|
975
|
+
return j.w(p.toDate()[T].apply(p.toDate("s"), (y ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(k)), p);
|
|
990
976
|
}, U = this.$W, F = this.$M, L = this.$D, M = "set" + (this.$u ? "UTC" : "");
|
|
991
|
-
switch (
|
|
977
|
+
switch (a) {
|
|
992
978
|
case g:
|
|
993
|
-
return
|
|
994
|
-
case
|
|
995
|
-
return
|
|
979
|
+
return y ? S(1, 0) : S(31, 11);
|
|
980
|
+
case E:
|
|
981
|
+
return y ? S(1, F) : S(0, F + 1);
|
|
996
982
|
case C:
|
|
997
983
|
var V = this.$locale().weekStart || 0, D = (U < V ? U + 7 : U) - V;
|
|
998
|
-
return
|
|
999
|
-
case
|
|
984
|
+
return S(y ? L - D : L + (6 - D), F);
|
|
985
|
+
case x:
|
|
1000
986
|
case b:
|
|
1001
|
-
return
|
|
987
|
+
return $(M + "Hours", 0);
|
|
1002
988
|
case f:
|
|
1003
|
-
return
|
|
989
|
+
return $(M + "Minutes", 1);
|
|
1004
990
|
case m:
|
|
1005
|
-
return
|
|
991
|
+
return $(M + "Seconds", 2);
|
|
1006
992
|
case s:
|
|
1007
|
-
return
|
|
993
|
+
return $(M + "Milliseconds", 3);
|
|
1008
994
|
default:
|
|
1009
995
|
return this.clone();
|
|
1010
996
|
}
|
|
1011
|
-
}, l.endOf = function(
|
|
1012
|
-
return this.startOf(
|
|
1013
|
-
}, l.$set = function(
|
|
1014
|
-
var
|
|
1015
|
-
if (
|
|
997
|
+
}, l.endOf = function(o) {
|
|
998
|
+
return this.startOf(o, !1);
|
|
999
|
+
}, l.$set = function(o, d) {
|
|
1000
|
+
var p, y = j.p(o), a = "set" + (this.$u ? "UTC" : ""), S = (p = {}, p[x] = a + "Date", p[b] = a + "Date", p[E] = a + "Month", p[g] = a + "FullYear", p[f] = a + "Hours", p[m] = a + "Minutes", p[s] = a + "Seconds", p[c] = a + "Milliseconds", p)[y], $ = y === x ? this.$D + (d - this.$W) : d;
|
|
1001
|
+
if (y === E || y === g) {
|
|
1016
1002
|
var U = this.clone().set(b, 1);
|
|
1017
|
-
U.$d[
|
|
1003
|
+
U.$d[S]($), U.init(), this.$d = U.set(b, Math.min(this.$D, U.daysInMonth())).$d;
|
|
1018
1004
|
} else
|
|
1019
|
-
|
|
1005
|
+
S && this.$d[S]($);
|
|
1020
1006
|
return this.init(), this;
|
|
1021
|
-
}, l.set = function(
|
|
1022
|
-
return this.clone().$set(
|
|
1023
|
-
}, l.get = function(
|
|
1024
|
-
return this[j.p(
|
|
1025
|
-
}, l.add = function(
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1028
|
-
var
|
|
1029
|
-
var L = X(
|
|
1030
|
-
return j.w(L.date(L.date() + Math.round(F *
|
|
1007
|
+
}, l.set = function(o, d) {
|
|
1008
|
+
return this.clone().$set(o, d);
|
|
1009
|
+
}, l.get = function(o) {
|
|
1010
|
+
return this[j.p(o)]();
|
|
1011
|
+
}, l.add = function(o, d) {
|
|
1012
|
+
var p, y = this;
|
|
1013
|
+
o = Number(o);
|
|
1014
|
+
var a = j.p(d), S = function(F) {
|
|
1015
|
+
var L = X(y);
|
|
1016
|
+
return j.w(L.date(L.date() + Math.round(F * o)), y);
|
|
1031
1017
|
};
|
|
1032
|
-
if (
|
|
1033
|
-
return this.set(
|
|
1034
|
-
if (
|
|
1035
|
-
return this.set(g, this.$y +
|
|
1036
|
-
if (
|
|
1037
|
-
return
|
|
1038
|
-
if (
|
|
1039
|
-
return
|
|
1040
|
-
var
|
|
1018
|
+
if (a === E)
|
|
1019
|
+
return this.set(E, this.$M + o);
|
|
1020
|
+
if (a === g)
|
|
1021
|
+
return this.set(g, this.$y + o);
|
|
1022
|
+
if (a === x)
|
|
1023
|
+
return S(1);
|
|
1024
|
+
if (a === C)
|
|
1025
|
+
return S(7);
|
|
1026
|
+
var $ = (p = {}, p[m] = i, p[f] = n, p[s] = r, p)[a] || 1, U = this.$d.getTime() + o * $;
|
|
1041
1027
|
return j.w(U, this);
|
|
1042
|
-
}, l.subtract = function(
|
|
1043
|
-
return this.add(-1 *
|
|
1044
|
-
}, l.format = function(
|
|
1045
|
-
var
|
|
1028
|
+
}, l.subtract = function(o, d) {
|
|
1029
|
+
return this.add(-1 * o, d);
|
|
1030
|
+
}, l.format = function(o) {
|
|
1031
|
+
var d = this, p = this.$locale();
|
|
1046
1032
|
if (!this.isValid())
|
|
1047
|
-
return
|
|
1048
|
-
var
|
|
1049
|
-
return k && (k[
|
|
1033
|
+
return p.invalidDate || N;
|
|
1034
|
+
var y = o || "YYYY-MM-DDTHH:mm:ssZ", a = j.z(this), S = this.$H, $ = this.$m, U = this.$M, F = p.weekdays, L = p.months, M = p.meridiem, V = function(k, A, _, I) {
|
|
1035
|
+
return k && (k[A] || k(d, y)) || _[A].slice(0, I);
|
|
1050
1036
|
}, D = function(k) {
|
|
1051
|
-
return j.s(
|
|
1052
|
-
},
|
|
1037
|
+
return j.s(S % 12 || 12, k, "0");
|
|
1038
|
+
}, T = M || function(k, A, _) {
|
|
1053
1039
|
var I = k < 12 ? "AM" : "PM";
|
|
1054
1040
|
return _ ? I.toLowerCase() : I;
|
|
1055
1041
|
};
|
|
1056
|
-
return
|
|
1057
|
-
return
|
|
1042
|
+
return y.replace(J, function(k, A) {
|
|
1043
|
+
return A || function(_) {
|
|
1058
1044
|
switch (_) {
|
|
1059
1045
|
case "YY":
|
|
1060
|
-
return String(
|
|
1046
|
+
return String(d.$y).slice(-2);
|
|
1061
1047
|
case "YYYY":
|
|
1062
|
-
return j.s(
|
|
1048
|
+
return j.s(d.$y, 4, "0");
|
|
1063
1049
|
case "M":
|
|
1064
1050
|
return U + 1;
|
|
1065
1051
|
case "MM":
|
|
1066
1052
|
return j.s(U + 1, 2, "0");
|
|
1067
1053
|
case "MMM":
|
|
1068
|
-
return V(
|
|
1054
|
+
return V(p.monthsShort, U, L, 3);
|
|
1069
1055
|
case "MMMM":
|
|
1070
1056
|
return V(L, U);
|
|
1071
1057
|
case "D":
|
|
1072
|
-
return
|
|
1058
|
+
return d.$D;
|
|
1073
1059
|
case "DD":
|
|
1074
|
-
return j.s(
|
|
1060
|
+
return j.s(d.$D, 2, "0");
|
|
1075
1061
|
case "d":
|
|
1076
|
-
return String(
|
|
1062
|
+
return String(d.$W);
|
|
1077
1063
|
case "dd":
|
|
1078
|
-
return V(
|
|
1064
|
+
return V(p.weekdaysMin, d.$W, F, 2);
|
|
1079
1065
|
case "ddd":
|
|
1080
|
-
return V(
|
|
1066
|
+
return V(p.weekdaysShort, d.$W, F, 3);
|
|
1081
1067
|
case "dddd":
|
|
1082
|
-
return F[
|
|
1068
|
+
return F[d.$W];
|
|
1083
1069
|
case "H":
|
|
1084
|
-
return String(
|
|
1070
|
+
return String(S);
|
|
1085
1071
|
case "HH":
|
|
1086
|
-
return j.s(
|
|
1072
|
+
return j.s(S, 2, "0");
|
|
1087
1073
|
case "h":
|
|
1088
1074
|
return D(1);
|
|
1089
1075
|
case "hh":
|
|
1090
1076
|
return D(2);
|
|
1091
1077
|
case "a":
|
|
1092
|
-
return
|
|
1078
|
+
return T(S, $, !0);
|
|
1093
1079
|
case "A":
|
|
1094
|
-
return
|
|
1080
|
+
return T(S, $, !1);
|
|
1095
1081
|
case "m":
|
|
1096
|
-
return String(
|
|
1082
|
+
return String($);
|
|
1097
1083
|
case "mm":
|
|
1098
|
-
return j.s(
|
|
1084
|
+
return j.s($, 2, "0");
|
|
1099
1085
|
case "s":
|
|
1100
|
-
return String(
|
|
1086
|
+
return String(d.$s);
|
|
1101
1087
|
case "ss":
|
|
1102
|
-
return j.s(
|
|
1088
|
+
return j.s(d.$s, 2, "0");
|
|
1103
1089
|
case "SSS":
|
|
1104
|
-
return j.s(
|
|
1090
|
+
return j.s(d.$ms, 3, "0");
|
|
1105
1091
|
case "Z":
|
|
1106
|
-
return
|
|
1092
|
+
return a;
|
|
1107
1093
|
}
|
|
1108
1094
|
return null;
|
|
1109
|
-
}(k) ||
|
|
1095
|
+
}(k) || a.replace(":", "");
|
|
1110
1096
|
});
|
|
1111
1097
|
}, l.utcOffset = function() {
|
|
1112
1098
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1113
|
-
}, l.diff = function(
|
|
1114
|
-
var
|
|
1115
|
-
return j.m(
|
|
1099
|
+
}, l.diff = function(o, d, p) {
|
|
1100
|
+
var y, a = this, S = j.p(d), $ = X(o), U = ($.utcOffset() - this.utcOffset()) * i, F = this - $, L = function() {
|
|
1101
|
+
return j.m(a, $);
|
|
1116
1102
|
};
|
|
1117
|
-
switch (
|
|
1103
|
+
switch (S) {
|
|
1118
1104
|
case g:
|
|
1119
|
-
|
|
1105
|
+
y = L() / 12;
|
|
1120
1106
|
break;
|
|
1121
|
-
case
|
|
1122
|
-
|
|
1107
|
+
case E:
|
|
1108
|
+
y = L();
|
|
1123
1109
|
break;
|
|
1124
|
-
case
|
|
1125
|
-
|
|
1110
|
+
case v:
|
|
1111
|
+
y = L() / 3;
|
|
1126
1112
|
break;
|
|
1127
1113
|
case C:
|
|
1128
|
-
|
|
1114
|
+
y = (F - U) / 6048e5;
|
|
1129
1115
|
break;
|
|
1130
|
-
case
|
|
1131
|
-
|
|
1116
|
+
case x:
|
|
1117
|
+
y = (F - U) / 864e5;
|
|
1132
1118
|
break;
|
|
1133
1119
|
case f:
|
|
1134
|
-
|
|
1120
|
+
y = F / n;
|
|
1135
1121
|
break;
|
|
1136
1122
|
case m:
|
|
1137
|
-
|
|
1123
|
+
y = F / i;
|
|
1138
1124
|
break;
|
|
1139
1125
|
case s:
|
|
1140
|
-
|
|
1126
|
+
y = F / r;
|
|
1141
1127
|
break;
|
|
1142
1128
|
default:
|
|
1143
|
-
|
|
1129
|
+
y = F;
|
|
1144
1130
|
}
|
|
1145
|
-
return
|
|
1131
|
+
return p ? y : j.a(y);
|
|
1146
1132
|
}, l.daysInMonth = function() {
|
|
1147
|
-
return this.endOf(
|
|
1133
|
+
return this.endOf(E).$D;
|
|
1148
1134
|
}, l.$locale = function() {
|
|
1149
1135
|
return q[this.$L];
|
|
1150
|
-
}, l.locale = function(
|
|
1151
|
-
if (!
|
|
1136
|
+
}, l.locale = function(o, d) {
|
|
1137
|
+
if (!o)
|
|
1152
1138
|
return this.$L;
|
|
1153
|
-
var
|
|
1154
|
-
return
|
|
1139
|
+
var p = this.clone(), y = ee(o, d, !0);
|
|
1140
|
+
return y && (p.$L = y), p;
|
|
1155
1141
|
}, l.clone = function() {
|
|
1156
1142
|
return j.w(this.$d, this);
|
|
1157
1143
|
}, l.toDate = function() {
|
|
@@ -1164,7 +1150,7 @@ var dayjs_min = { exports: {} };
|
|
|
1164
1150
|
return this.$d.toUTCString();
|
|
1165
1151
|
}, u;
|
|
1166
1152
|
}(), w = O.prototype;
|
|
1167
|
-
return X.prototype = w, [["$ms", c], ["$s", s], ["$m", m], ["$H", f], ["$W",
|
|
1153
|
+
return X.prototype = w, [["$ms", c], ["$s", s], ["$m", m], ["$H", f], ["$W", x], ["$M", E], ["$y", g], ["$D", b]].forEach(function(u) {
|
|
1168
1154
|
w[u[1]] = function(l) {
|
|
1169
1155
|
return this.$g(l, u[0], u[1]);
|
|
1170
1156
|
};
|
|
@@ -1177,66 +1163,66 @@ var dayjs_min = { exports: {} };
|
|
|
1177
1163
|
})(dayjs_min);
|
|
1178
1164
|
var dayjs_minExports = dayjs_min.exports;
|
|
1179
1165
|
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
1180
|
-
function copyString(
|
|
1166
|
+
function copyString(t) {
|
|
1181
1167
|
if (navigator.clipboard && window.isSecureContext)
|
|
1182
|
-
return navigator.clipboard.writeText(
|
|
1168
|
+
return navigator.clipboard.writeText(t), Promise.resolve();
|
|
1183
1169
|
{
|
|
1184
|
-
let
|
|
1185
|
-
|
|
1170
|
+
let e = document.createElement("textarea");
|
|
1171
|
+
e.value = t, e.style.position = "absolute", e.style.opacity = "0", e.style.left = "-200%", e.style.top = "-200%", document.body.appendChild(e), e.focus(), e.select();
|
|
1186
1172
|
let r = document.execCommand("copy");
|
|
1187
|
-
return
|
|
1173
|
+
return e.remove(), r ? Promise.resolve() : Promise.reject(new Error("copy error"));
|
|
1188
1174
|
}
|
|
1189
1175
|
}
|
|
1190
|
-
function componentTransition(
|
|
1191
|
-
let r = "ElInput",
|
|
1192
|
-
switch (
|
|
1176
|
+
function componentTransition(t, e = "date") {
|
|
1177
|
+
let r = "ElInput", i = "筛选", n = "";
|
|
1178
|
+
switch (t) {
|
|
1193
1179
|
case "STRING":
|
|
1194
|
-
r = "ElInput",
|
|
1180
|
+
r = "ElInput", i = "筛选", n = "text";
|
|
1195
1181
|
break;
|
|
1196
1182
|
case "LIST":
|
|
1197
|
-
r = "ElSelect",
|
|
1183
|
+
r = "ElSelect", i = "请选择";
|
|
1198
1184
|
break;
|
|
1199
1185
|
case "TABLE":
|
|
1200
|
-
r = "ElSelect",
|
|
1186
|
+
r = "ElSelect", i = "请选择";
|
|
1201
1187
|
break;
|
|
1202
1188
|
case "TREE":
|
|
1203
|
-
r = "ElTreeSelect",
|
|
1189
|
+
r = "ElTreeSelect", i = "请选择";
|
|
1204
1190
|
break;
|
|
1205
1191
|
case "EDITOR":
|
|
1206
|
-
r = "ElInput",
|
|
1192
|
+
r = "ElInput", i = "筛选", n = "textarea";
|
|
1207
1193
|
break;
|
|
1208
1194
|
case "BOOL":
|
|
1209
|
-
r = "ElSwitch",
|
|
1195
|
+
r = "ElSwitch", i = "请选择";
|
|
1210
1196
|
break;
|
|
1211
1197
|
case "LONG":
|
|
1212
|
-
r = "ElInputNumber",
|
|
1198
|
+
r = "ElInputNumber", i = "筛选";
|
|
1213
1199
|
break;
|
|
1214
1200
|
case "PLONG":
|
|
1215
|
-
r = "ElInputNumber",
|
|
1201
|
+
r = "ElInputNumber", i = "筛选";
|
|
1216
1202
|
break;
|
|
1217
1203
|
case "DOUBLE":
|
|
1218
|
-
r = "ElInputNumber",
|
|
1204
|
+
r = "ElInputNumber", i = "筛选";
|
|
1219
1205
|
break;
|
|
1220
1206
|
case "DATE":
|
|
1221
|
-
r = "ElDatePicker",
|
|
1207
|
+
r = "ElDatePicker", i = "请选择", n = e;
|
|
1222
1208
|
break;
|
|
1223
1209
|
case "DATETIME":
|
|
1224
|
-
r = "ElDatePicker",
|
|
1210
|
+
r = "ElDatePicker", i = "请选择", n = e;
|
|
1225
1211
|
break;
|
|
1226
1212
|
case "TIME":
|
|
1227
|
-
r = "ElTimePicker",
|
|
1213
|
+
r = "ElTimePicker", i = "请选择", n = "time";
|
|
1228
1214
|
break;
|
|
1229
1215
|
case "TEXT":
|
|
1230
|
-
r = "ElInput",
|
|
1216
|
+
r = "ElInput", i = "筛选", n = "text";
|
|
1231
1217
|
break;
|
|
1232
1218
|
case "COLOR":
|
|
1233
|
-
r = "ElColorPicker",
|
|
1219
|
+
r = "ElColorPicker", i = "请选择";
|
|
1234
1220
|
break;
|
|
1235
1221
|
default:
|
|
1236
|
-
r = "ElInput",
|
|
1222
|
+
r = "ElInput", i = "筛选", n = "text";
|
|
1237
1223
|
break;
|
|
1238
1224
|
}
|
|
1239
|
-
return { componentName: r, placeholerPrefix:
|
|
1225
|
+
return { componentName: r, placeholerPrefix: i, type: n };
|
|
1240
1226
|
}
|
|
1241
1227
|
const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1242
1228
|
__name: "report-conditions",
|
|
@@ -1244,8 +1230,8 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1244
1230
|
config: null
|
|
1245
1231
|
},
|
|
1246
1232
|
emits: ["change"],
|
|
1247
|
-
setup(
|
|
1248
|
-
const r =
|
|
1233
|
+
setup(t, { emit: e }) {
|
|
1234
|
+
const r = t, i = dayjs().startOf("day").format("YYYY-MM-DD HH:mm:ss"), n = dayjs().endOf("day").format("YYYY-MM-DD HH:mm:ss"), c = dayjs().startOf("month").format("YYYY-MM-DD HH:mm:ss"), s = dayjs().endOf("month").format("YYYY-MM-DD HH:mm:ss"), m = dayjs().add(-2, "month").startOf("month").format("YYYY-MM-DD HH:mm:ss"), f = dayjs().endOf("month").format("YYYY-MM-DD HH:mm:ss"), x = dayjs().startOf("year").format("YYYY-MM-DD HH:mm:ss"), C = dayjs().endOf("year").format("YYYY-MM-DD HH:mm:ss"), E = ref([]), v = ref([]);
|
|
1249
1235
|
watch(
|
|
1250
1236
|
() => r.config,
|
|
1251
1237
|
() => {
|
|
@@ -1257,8 +1243,8 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1257
1243
|
}
|
|
1258
1244
|
);
|
|
1259
1245
|
function g() {
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1246
|
+
let B = [];
|
|
1247
|
+
if (E.value = [], r.config && r.config.length) {
|
|
1262
1248
|
for (let J = 0; J < r.config.length; J++) {
|
|
1263
1249
|
const Y = cloneDeep(r.config[J]);
|
|
1264
1250
|
let { dataType: W, dateType: ne, type: Q, selectorId: q, name: re, columnName: Z, defaultValue: ee, isNull: X } = Y, j = [DataSourceColumnDataType.DATE, DataSourceColumnDataType.DATETIME].includes(W);
|
|
@@ -1268,7 +1254,7 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1268
1254
|
if (j)
|
|
1269
1255
|
switch (ee) {
|
|
1270
1256
|
case "today":
|
|
1271
|
-
l =
|
|
1257
|
+
l = i;
|
|
1272
1258
|
break;
|
|
1273
1259
|
case "thisMonth":
|
|
1274
1260
|
l = c;
|
|
@@ -1277,10 +1263,10 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1277
1263
|
l = m;
|
|
1278
1264
|
break;
|
|
1279
1265
|
case "thisYear":
|
|
1280
|
-
l =
|
|
1266
|
+
l = x;
|
|
1281
1267
|
break;
|
|
1282
1268
|
}
|
|
1283
|
-
if (Y.value = l,
|
|
1269
|
+
if (Y.value = l, E.value.push({
|
|
1284
1270
|
name: Z,
|
|
1285
1271
|
value: l,
|
|
1286
1272
|
type: Q,
|
|
@@ -1288,64 +1274,64 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1288
1274
|
}), q && axios.request({
|
|
1289
1275
|
url: `/windowDesign/getSelectorList?selectorId=${q}`,
|
|
1290
1276
|
method: "POST"
|
|
1291
|
-
}).then((
|
|
1292
|
-
|
|
1293
|
-
label:
|
|
1294
|
-
value:
|
|
1277
|
+
}).then((o) => {
|
|
1278
|
+
o.data && o.data.data && (Y.optionData = o.data.data.map(({ name: d, value: p }) => ({
|
|
1279
|
+
label: d,
|
|
1280
|
+
value: p
|
|
1295
1281
|
})));
|
|
1296
|
-
}),
|
|
1282
|
+
}), B.push(Y), Q === "LT_GT_EQ") {
|
|
1297
1283
|
Y.placeholder = w + "开始";
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
let
|
|
1284
|
+
const o = cloneDeep(Y);
|
|
1285
|
+
o.name = "-", o.columnName = `end_${Z}`, o.placeholder = w + "结束";
|
|
1286
|
+
let d = ee || "";
|
|
1301
1287
|
if (j)
|
|
1302
1288
|
switch (ee) {
|
|
1303
1289
|
case "today":
|
|
1304
|
-
|
|
1290
|
+
d = n;
|
|
1305
1291
|
break;
|
|
1306
1292
|
case "thisMonth":
|
|
1307
|
-
|
|
1293
|
+
d = s;
|
|
1308
1294
|
break;
|
|
1309
1295
|
case "threeMonth":
|
|
1310
|
-
|
|
1296
|
+
d = f;
|
|
1311
1297
|
break;
|
|
1312
1298
|
case "thisYear":
|
|
1313
|
-
|
|
1299
|
+
d = C;
|
|
1314
1300
|
break;
|
|
1315
1301
|
}
|
|
1316
|
-
|
|
1302
|
+
E.value.push({
|
|
1317
1303
|
name: `end_${Z}`,
|
|
1318
|
-
value:
|
|
1304
|
+
value: d,
|
|
1319
1305
|
type: Q,
|
|
1320
1306
|
isNull: X
|
|
1321
1307
|
}), q && axios.request({
|
|
1322
1308
|
url: `/windowDesign/getSelectorList?selectorId=${q}`,
|
|
1323
1309
|
method: "POST"
|
|
1324
|
-
}).then((
|
|
1325
|
-
|
|
1326
|
-
label:
|
|
1327
|
-
value:
|
|
1310
|
+
}).then((p) => {
|
|
1311
|
+
p.data && p.data.data && (o.optionData = p.data.data.map(({ name: y, value: a }) => ({
|
|
1312
|
+
label: y,
|
|
1313
|
+
value: a
|
|
1328
1314
|
})));
|
|
1329
|
-
}),
|
|
1315
|
+
}), B.push(o);
|
|
1330
1316
|
}
|
|
1331
1317
|
}
|
|
1332
1318
|
r.config.map((J) => J.isNull).includes(!0) && nextTick(() => {
|
|
1333
|
-
|
|
1319
|
+
e("change", E.value);
|
|
1334
1320
|
});
|
|
1335
1321
|
}
|
|
1336
|
-
|
|
1322
|
+
v.value = B;
|
|
1337
1323
|
}
|
|
1338
|
-
function b(
|
|
1339
|
-
let Y =
|
|
1340
|
-
J.value =
|
|
1324
|
+
function b(B, J) {
|
|
1325
|
+
let Y = E.value.findIndex((W) => W.name === J.columnName);
|
|
1326
|
+
J.value = B, E.value[Y].value = B, ["ElSelect", "ElTreeSelect", "ElSwitch", "ElDatePicker", "ElTimePicker", "ElColorPicker"].includes(J.formItemType) && e("change", E.value);
|
|
1341
1327
|
}
|
|
1342
|
-
function N(
|
|
1343
|
-
["ElInput", "ElInputNumber"].includes(
|
|
1328
|
+
function N(B) {
|
|
1329
|
+
["ElInput", "ElInputNumber"].includes(B.formItemType) && e("change", E.value);
|
|
1344
1330
|
}
|
|
1345
|
-
return (
|
|
1331
|
+
return (B, J) => (openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1346
1332
|
createVNode(unref(ElForm), { inline: "" }, {
|
|
1347
1333
|
default: withCtx(() => [
|
|
1348
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
1334
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(v.value, (Y) => withDirectives((openBlock(), createBlock(unref(ElFormItem), {
|
|
1349
1335
|
label: Y.name,
|
|
1350
1336
|
style: normalizeStyle(Y.columnName.indexOf("end_") > -1 ? { marginLeft: "-22px" } : {})
|
|
1351
1337
|
}, {
|
|
@@ -1386,7 +1372,7 @@ const _hoisted_1$1 = { class: "yh-statement-view-conditions" }, _sfc_main$4 = /*
|
|
|
1386
1372
|
]),
|
|
1387
1373
|
_: 1
|
|
1388
1374
|
}),
|
|
1389
|
-
renderSlot(
|
|
1375
|
+
renderSlot(B.$slots, "search")
|
|
1390
1376
|
]));
|
|
1391
1377
|
}
|
|
1392
1378
|
}), reportConditions_vue_vue_type_style_index_0_lang = "";
|
|
@@ -1396,137 +1382,137 @@ function getDateSourceList() {
|
|
|
1396
1382
|
method: "POST"
|
|
1397
1383
|
});
|
|
1398
1384
|
}
|
|
1399
|
-
function getDateSourceColumns(
|
|
1385
|
+
function getDateSourceColumns(t) {
|
|
1400
1386
|
return axios.request({
|
|
1401
1387
|
url: "/windowDesign/getColumns",
|
|
1402
1388
|
method: "POST",
|
|
1403
1389
|
data: {
|
|
1404
|
-
datasourceId:
|
|
1390
|
+
datasourceId: t
|
|
1405
1391
|
}
|
|
1406
|
-
}).then((
|
|
1392
|
+
}).then((e) => e.data && e.data.data ? Promise.resolve(e.data.data) : Promise.resolve([]));
|
|
1407
1393
|
}
|
|
1408
|
-
function getDateSourceData(
|
|
1394
|
+
function getDateSourceData(t, e = {
|
|
1409
1395
|
pageNumber: 1,
|
|
1410
1396
|
pageSize: 100
|
|
1411
1397
|
}) {
|
|
1412
1398
|
return axios.request({
|
|
1413
|
-
url: `/report/data/${
|
|
1399
|
+
url: `/report/data/${t}`,
|
|
1414
1400
|
type: "json",
|
|
1415
1401
|
method: "POST",
|
|
1416
|
-
data:
|
|
1402
|
+
data: e
|
|
1417
1403
|
}).then((r) => {
|
|
1418
|
-
var
|
|
1419
|
-
return r != null && r.data && ((
|
|
1404
|
+
var i;
|
|
1405
|
+
return r != null && r.data && ((i = r.data) != null && i.data) ? Promise.resolve(r.data) : Promise.resolve([]);
|
|
1420
1406
|
});
|
|
1421
1407
|
}
|
|
1422
|
-
function renderCellStyle(
|
|
1423
|
-
let
|
|
1424
|
-
return Object.keys(
|
|
1425
|
-
if (
|
|
1408
|
+
function renderCellStyle(t) {
|
|
1409
|
+
let e = "";
|
|
1410
|
+
return Object.keys(t).forEach((r) => {
|
|
1411
|
+
if (t[r])
|
|
1426
1412
|
switch (r) {
|
|
1427
1413
|
case "color":
|
|
1428
|
-
|
|
1414
|
+
e += `color:${t[r]};`;
|
|
1429
1415
|
break;
|
|
1430
1416
|
case "backgroundColor":
|
|
1431
|
-
|
|
1417
|
+
e += `background-color:${t[r]};`;
|
|
1432
1418
|
break;
|
|
1433
1419
|
case "fontWeight":
|
|
1434
|
-
|
|
1420
|
+
e += `font-weight:${t[r]};`;
|
|
1435
1421
|
break;
|
|
1436
1422
|
case "fontSize":
|
|
1437
|
-
|
|
1423
|
+
e += `font-size:${t[r]}px;`;
|
|
1438
1424
|
break;
|
|
1439
1425
|
case "textAlign":
|
|
1440
|
-
|
|
1426
|
+
e += `text-align:${t[r]};`;
|
|
1441
1427
|
break;
|
|
1442
1428
|
case "verticalAlign":
|
|
1443
|
-
|
|
1429
|
+
e += `vertical-align:${t[r]};`;
|
|
1444
1430
|
break;
|
|
1445
1431
|
case "fontFamily":
|
|
1446
|
-
|
|
1432
|
+
e += `font-family:${t[r]};`;
|
|
1447
1433
|
break;
|
|
1448
1434
|
}
|
|
1449
|
-
}),
|
|
1435
|
+
}), e;
|
|
1450
1436
|
}
|
|
1451
|
-
function formatNumber(
|
|
1452
|
-
typeof
|
|
1453
|
-
const
|
|
1437
|
+
function formatNumber(t, { numberDecimal: e, numberUseGrouping: r } = {}) {
|
|
1438
|
+
typeof t == "string" && (t = t.replace(/,/g, "")), t = parseFloat(t), isNaN(t) && (t = 0);
|
|
1439
|
+
const i = e === 0 ? Math.round(t) : t.toFixed(e);
|
|
1454
1440
|
if (r) {
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1441
|
+
const n = i.toString().split(".");
|
|
1442
|
+
return n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), n.join(".");
|
|
1457
1443
|
} else
|
|
1458
|
-
return
|
|
1444
|
+
return i;
|
|
1459
1445
|
}
|
|
1460
|
-
function formatCurrency(
|
|
1461
|
-
if (typeof
|
|
1446
|
+
function formatCurrency(t, { numberDecimal: e, currencySymbol: r, numberUseGrouping: i } = {}) {
|
|
1447
|
+
if (typeof t == "string" && (t = t.replace(/,/g, "")), t = parseFloat(t), isNaN(t))
|
|
1462
1448
|
throw new Error("Invalid number input");
|
|
1463
|
-
const
|
|
1464
|
-
let [c, s] =
|
|
1465
|
-
|
|
1449
|
+
const n = e === 0 ? Math.round(t) : parseFloat(t.toFixed(e));
|
|
1450
|
+
let [c, s] = n.toString().split(".");
|
|
1451
|
+
i && (c = c.replace(/\B(?=(\d{3})+(?!\d))/g, ","));
|
|
1466
1452
|
let m = `${r}${c}`;
|
|
1467
|
-
return
|
|
1453
|
+
return e > 0 && (m += `.${s}`), m;
|
|
1468
1454
|
}
|
|
1469
|
-
function formatPercentage(
|
|
1470
|
-
if (typeof
|
|
1471
|
-
return
|
|
1472
|
-
const
|
|
1473
|
-
return r ? `${
|
|
1455
|
+
function formatPercentage(t, { numberDecimal: e } = {}, r = !1) {
|
|
1456
|
+
if (typeof t == "string" && (t = t.replace(/,/g, "")), t = parseFloat(t), isNaN(t))
|
|
1457
|
+
return t;
|
|
1458
|
+
const i = e === 0 ? Math.round(t) : t.toFixed(e);
|
|
1459
|
+
return r ? `${i}‰` : `${i}%`;
|
|
1474
1460
|
}
|
|
1475
|
-
function formatScientific(
|
|
1476
|
-
return typeof
|
|
1461
|
+
function formatScientific(t, { scientificNotation: e = "e", digits: r = 6 } = {}) {
|
|
1462
|
+
return typeof t == "string" && (t = t.replace(/,/g, "")), t = parseFloat(t), isNaN(t) ? t : t.toExponential(r).replace(/e/, e);
|
|
1477
1463
|
}
|
|
1478
|
-
function formatDatetime(
|
|
1479
|
-
if (
|
|
1480
|
-
return
|
|
1464
|
+
function formatDatetime(t, { date: e = "YYYY-MM-DD HH:mm:ss" } = {}) {
|
|
1465
|
+
if (t == null)
|
|
1466
|
+
return t;
|
|
1481
1467
|
let r;
|
|
1482
|
-
if (typeof
|
|
1483
|
-
const
|
|
1484
|
-
r = dayjs(
|
|
1485
|
-
} else if (typeof
|
|
1486
|
-
const
|
|
1487
|
-
if (isNaN(
|
|
1488
|
-
r = dayjs(
|
|
1468
|
+
if (typeof t == "number") {
|
|
1469
|
+
const i = t < 1e10 ? t * 1e3 : t;
|
|
1470
|
+
r = dayjs(i);
|
|
1471
|
+
} else if (typeof t == "string") {
|
|
1472
|
+
const i = Number(t);
|
|
1473
|
+
if (isNaN(i))
|
|
1474
|
+
r = dayjs(t);
|
|
1489
1475
|
else {
|
|
1490
|
-
const
|
|
1491
|
-
r = dayjs(
|
|
1476
|
+
const n = i < 1e10 ? i * 1e3 : i;
|
|
1477
|
+
r = dayjs(n);
|
|
1492
1478
|
}
|
|
1493
1479
|
} else
|
|
1494
|
-
return
|
|
1495
|
-
return r.isValid() ? r.format(
|
|
1480
|
+
return t;
|
|
1481
|
+
return r.isValid() ? r.format(e) : t;
|
|
1496
1482
|
}
|
|
1497
|
-
function formatCellValue(
|
|
1498
|
-
switch (
|
|
1483
|
+
function formatCellValue(t, e, r) {
|
|
1484
|
+
switch (e) {
|
|
1499
1485
|
case "number":
|
|
1500
|
-
return formatNumber(
|
|
1486
|
+
return formatNumber(t, r);
|
|
1501
1487
|
case "currency":
|
|
1502
|
-
return formatCurrency(
|
|
1488
|
+
return formatCurrency(t, r);
|
|
1503
1489
|
case "percent":
|
|
1504
|
-
return formatPercentage(
|
|
1490
|
+
return formatPercentage(t, r, !1);
|
|
1505
1491
|
case "promille":
|
|
1506
|
-
return formatPercentage(
|
|
1492
|
+
return formatPercentage(t, r, !0);
|
|
1507
1493
|
case "scientific":
|
|
1508
|
-
return formatScientific(
|
|
1494
|
+
return formatScientific(t, r);
|
|
1509
1495
|
case "datetime":
|
|
1510
|
-
return formatDatetime(
|
|
1496
|
+
return formatDatetime(t, r);
|
|
1511
1497
|
default:
|
|
1512
|
-
return
|
|
1498
|
+
return t;
|
|
1513
1499
|
}
|
|
1514
1500
|
}
|
|
1515
1501
|
var zhCn$1 = { exports: {} };
|
|
1516
|
-
(function(
|
|
1517
|
-
(function(r,
|
|
1518
|
-
|
|
1502
|
+
(function(t, e) {
|
|
1503
|
+
(function(r, i) {
|
|
1504
|
+
t.exports = i(dayjs_minExports);
|
|
1519
1505
|
})(commonjsGlobal, function(r) {
|
|
1520
|
-
function
|
|
1506
|
+
function i(s) {
|
|
1521
1507
|
return s && typeof s == "object" && "default" in s ? s : { default: s };
|
|
1522
1508
|
}
|
|
1523
|
-
var
|
|
1509
|
+
var n = i(r), c = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(s, m) {
|
|
1524
1510
|
return m === "W" ? s + "周" : s + "日";
|
|
1525
1511
|
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(s, m) {
|
|
1526
1512
|
var f = 100 * s + m;
|
|
1527
1513
|
return f < 600 ? "凌晨" : f < 900 ? "早上" : f < 1100 ? "上午" : f < 1300 ? "中午" : f < 1800 ? "下午" : "晚上";
|
|
1528
1514
|
} };
|
|
1529
|
-
return
|
|
1515
|
+
return n.default.locale(c, null, !0), c;
|
|
1530
1516
|
});
|
|
1531
1517
|
})(zhCn$1);
|
|
1532
1518
|
var zhCnExports = zhCn$1.exports;
|
|
@@ -1542,8 +1528,8 @@ async function getProcessData(processData, data, params) {
|
|
|
1542
1528
|
);
|
|
1543
1529
|
}(axios, dayjs);
|
|
1544
1530
|
return await fun.call(this, data, params);
|
|
1545
|
-
} catch (
|
|
1546
|
-
return console.error(
|
|
1531
|
+
} catch (t) {
|
|
1532
|
+
return console.error(t), data;
|
|
1547
1533
|
}
|
|
1548
1534
|
}
|
|
1549
1535
|
class Hooks {
|
|
@@ -1565,13 +1551,13 @@ class Hooks {
|
|
|
1565
1551
|
* @param {?boolean} [first=false] Will add the hook to the top of the list (defaults to the bottom)
|
|
1566
1552
|
* @public
|
|
1567
1553
|
*/
|
|
1568
|
-
add(
|
|
1554
|
+
add(e, r, i) {
|
|
1569
1555
|
if (typeof arguments[0] != "string")
|
|
1570
|
-
for (let
|
|
1571
|
-
this.add(
|
|
1556
|
+
for (let n in arguments[0])
|
|
1557
|
+
this.add(n, arguments[0][n], arguments[1]);
|
|
1572
1558
|
else
|
|
1573
|
-
(Array.isArray(
|
|
1574
|
-
this[
|
|
1559
|
+
(Array.isArray(e) ? e : [e]).forEach(function(n) {
|
|
1560
|
+
this[n] = this[n] || [], r && this[n][i ? "unshift" : "push"](r);
|
|
1575
1561
|
}, this);
|
|
1576
1562
|
}
|
|
1577
1563
|
/**
|
|
@@ -1583,15 +1569,15 @@ class Hooks {
|
|
|
1583
1569
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
1584
1570
|
* @public
|
|
1585
1571
|
*/
|
|
1586
|
-
run(
|
|
1587
|
-
this[
|
|
1588
|
-
|
|
1572
|
+
run(e, r) {
|
|
1573
|
+
this[e] = this[e] || [], this[e].forEach(function(i) {
|
|
1574
|
+
i.call(r && r.context ? r.context : r, r);
|
|
1589
1575
|
});
|
|
1590
1576
|
}
|
|
1591
1577
|
}
|
|
1592
1578
|
class Plugins {
|
|
1593
|
-
constructor(
|
|
1594
|
-
this.jsep =
|
|
1579
|
+
constructor(e) {
|
|
1580
|
+
this.jsep = e, this.registered = {};
|
|
1595
1581
|
}
|
|
1596
1582
|
/**
|
|
1597
1583
|
* @callback PluginSetup
|
|
@@ -1606,8 +1592,8 @@ class Plugins {
|
|
|
1606
1592
|
* @param {PluginSetup} plugins.init The init function
|
|
1607
1593
|
* @public
|
|
1608
1594
|
*/
|
|
1609
|
-
register(...
|
|
1610
|
-
|
|
1595
|
+
register(...e) {
|
|
1596
|
+
e.forEach((r) => {
|
|
1611
1597
|
if (typeof r != "object" || !r.name || !r.init)
|
|
1612
1598
|
throw new Error("Invalid JSEP plugin format");
|
|
1613
1599
|
this.registered[r.name] || (r.init(this.jsep), this.registered[r.name] = r);
|
|
@@ -1633,8 +1619,8 @@ class Jsep {
|
|
|
1633
1619
|
* @param {string} op_name The name of the unary op to add
|
|
1634
1620
|
* @returns {Jsep}
|
|
1635
1621
|
*/
|
|
1636
|
-
static addUnaryOp(
|
|
1637
|
-
return Jsep.max_unop_len = Math.max(
|
|
1622
|
+
static addUnaryOp(e) {
|
|
1623
|
+
return Jsep.max_unop_len = Math.max(e.length, Jsep.max_unop_len), Jsep.unary_ops[e] = 1, Jsep;
|
|
1638
1624
|
}
|
|
1639
1625
|
/**
|
|
1640
1626
|
* @method jsep.addBinaryOp
|
|
@@ -1643,16 +1629,16 @@ class Jsep {
|
|
|
1643
1629
|
* @param {boolean} [isRightAssociative=false] whether operator is right-associative
|
|
1644
1630
|
* @returns {Jsep}
|
|
1645
1631
|
*/
|
|
1646
|
-
static addBinaryOp(
|
|
1647
|
-
return Jsep.max_binop_len = Math.max(
|
|
1632
|
+
static addBinaryOp(e, r, i) {
|
|
1633
|
+
return Jsep.max_binop_len = Math.max(e.length, Jsep.max_binop_len), Jsep.binary_ops[e] = r, i ? Jsep.right_associative.add(e) : Jsep.right_associative.delete(e), Jsep;
|
|
1648
1634
|
}
|
|
1649
1635
|
/**
|
|
1650
1636
|
* @method addIdentifierChar
|
|
1651
1637
|
* @param {string} char The additional character to treat as a valid part of an identifier
|
|
1652
1638
|
* @returns {Jsep}
|
|
1653
1639
|
*/
|
|
1654
|
-
static addIdentifierChar(
|
|
1655
|
-
return Jsep.additional_identifier_chars.add(
|
|
1640
|
+
static addIdentifierChar(e) {
|
|
1641
|
+
return Jsep.additional_identifier_chars.add(e), Jsep;
|
|
1656
1642
|
}
|
|
1657
1643
|
/**
|
|
1658
1644
|
* @method addLiteral
|
|
@@ -1660,16 +1646,16 @@ class Jsep {
|
|
|
1660
1646
|
* @param {*} literal_value The value of the literal
|
|
1661
1647
|
* @returns {Jsep}
|
|
1662
1648
|
*/
|
|
1663
|
-
static addLiteral(
|
|
1664
|
-
return Jsep.literals[
|
|
1649
|
+
static addLiteral(e, r) {
|
|
1650
|
+
return Jsep.literals[e] = r, Jsep;
|
|
1665
1651
|
}
|
|
1666
1652
|
/**
|
|
1667
1653
|
* @method removeUnaryOp
|
|
1668
1654
|
* @param {string} op_name The name of the unary op to remove
|
|
1669
1655
|
* @returns {Jsep}
|
|
1670
1656
|
*/
|
|
1671
|
-
static removeUnaryOp(
|
|
1672
|
-
return delete Jsep.unary_ops[
|
|
1657
|
+
static removeUnaryOp(e) {
|
|
1658
|
+
return delete Jsep.unary_ops[e], e.length === Jsep.max_unop_len && (Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops)), Jsep;
|
|
1673
1659
|
}
|
|
1674
1660
|
/**
|
|
1675
1661
|
* @method removeAllUnaryOps
|
|
@@ -1683,16 +1669,16 @@ class Jsep {
|
|
|
1683
1669
|
* @param {string} char The additional character to stop treating as a valid part of an identifier
|
|
1684
1670
|
* @returns {Jsep}
|
|
1685
1671
|
*/
|
|
1686
|
-
static removeIdentifierChar(
|
|
1687
|
-
return Jsep.additional_identifier_chars.delete(
|
|
1672
|
+
static removeIdentifierChar(e) {
|
|
1673
|
+
return Jsep.additional_identifier_chars.delete(e), Jsep;
|
|
1688
1674
|
}
|
|
1689
1675
|
/**
|
|
1690
1676
|
* @method removeBinaryOp
|
|
1691
1677
|
* @param {string} op_name The name of the binary op to remove
|
|
1692
1678
|
* @returns {Jsep}
|
|
1693
1679
|
*/
|
|
1694
|
-
static removeBinaryOp(
|
|
1695
|
-
return delete Jsep.binary_ops[
|
|
1680
|
+
static removeBinaryOp(e) {
|
|
1681
|
+
return delete Jsep.binary_ops[e], e.length === Jsep.max_binop_len && (Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops)), Jsep.right_associative.delete(e), Jsep;
|
|
1696
1682
|
}
|
|
1697
1683
|
/**
|
|
1698
1684
|
* @method removeAllBinaryOps
|
|
@@ -1706,8 +1692,8 @@ class Jsep {
|
|
|
1706
1692
|
* @param {string} literal_name The name of the literal to remove
|
|
1707
1693
|
* @returns {Jsep}
|
|
1708
1694
|
*/
|
|
1709
|
-
static removeLiteral(
|
|
1710
|
-
return delete Jsep.literals[
|
|
1695
|
+
static removeLiteral(e) {
|
|
1696
|
+
return delete Jsep.literals[e], Jsep;
|
|
1711
1697
|
}
|
|
1712
1698
|
/**
|
|
1713
1699
|
* @method removeAllLiterals
|
|
@@ -1733,66 +1719,66 @@ class Jsep {
|
|
|
1733
1719
|
* @param {string} expr a string with the passed in express
|
|
1734
1720
|
* @returns Jsep
|
|
1735
1721
|
*/
|
|
1736
|
-
constructor(
|
|
1737
|
-
this.expr =
|
|
1722
|
+
constructor(e) {
|
|
1723
|
+
this.expr = e, this.index = 0;
|
|
1738
1724
|
}
|
|
1739
1725
|
/**
|
|
1740
1726
|
* static top-level parser
|
|
1741
1727
|
* @returns {jsep.Expression}
|
|
1742
1728
|
*/
|
|
1743
|
-
static parse(
|
|
1744
|
-
return new Jsep(
|
|
1729
|
+
static parse(e) {
|
|
1730
|
+
return new Jsep(e).parse();
|
|
1745
1731
|
}
|
|
1746
1732
|
/**
|
|
1747
1733
|
* Get the longest key length of any object
|
|
1748
1734
|
* @param {object} obj
|
|
1749
1735
|
* @returns {number}
|
|
1750
1736
|
*/
|
|
1751
|
-
static getMaxKeyLen(
|
|
1752
|
-
return Math.max(0, ...Object.keys(
|
|
1737
|
+
static getMaxKeyLen(e) {
|
|
1738
|
+
return Math.max(0, ...Object.keys(e).map((r) => r.length));
|
|
1753
1739
|
}
|
|
1754
1740
|
/**
|
|
1755
1741
|
* `ch` is a character code in the next three functions
|
|
1756
1742
|
* @param {number} ch
|
|
1757
1743
|
* @returns {boolean}
|
|
1758
1744
|
*/
|
|
1759
|
-
static isDecimalDigit(
|
|
1760
|
-
return
|
|
1745
|
+
static isDecimalDigit(e) {
|
|
1746
|
+
return e >= 48 && e <= 57;
|
|
1761
1747
|
}
|
|
1762
1748
|
/**
|
|
1763
1749
|
* Returns the precedence of a binary operator or `0` if it isn't a binary operator. Can be float.
|
|
1764
1750
|
* @param {string} op_val
|
|
1765
1751
|
* @returns {number}
|
|
1766
1752
|
*/
|
|
1767
|
-
static binaryPrecedence(
|
|
1768
|
-
return Jsep.binary_ops[
|
|
1753
|
+
static binaryPrecedence(e) {
|
|
1754
|
+
return Jsep.binary_ops[e] || 0;
|
|
1769
1755
|
}
|
|
1770
1756
|
/**
|
|
1771
1757
|
* Looks for start of identifier
|
|
1772
1758
|
* @param {number} ch
|
|
1773
1759
|
* @returns {boolean}
|
|
1774
1760
|
*/
|
|
1775
|
-
static isIdentifierStart(
|
|
1776
|
-
return
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
Jsep.additional_identifier_chars.has(String.fromCharCode(
|
|
1761
|
+
static isIdentifierStart(e) {
|
|
1762
|
+
return e >= 65 && e <= 90 || // A...Z
|
|
1763
|
+
e >= 97 && e <= 122 || // a...z
|
|
1764
|
+
e >= 128 && !Jsep.binary_ops[String.fromCharCode(e)] || // any non-ASCII that is not an operator
|
|
1765
|
+
Jsep.additional_identifier_chars.has(String.fromCharCode(e));
|
|
1780
1766
|
}
|
|
1781
1767
|
/**
|
|
1782
1768
|
* @param {number} ch
|
|
1783
1769
|
* @returns {boolean}
|
|
1784
1770
|
*/
|
|
1785
|
-
static isIdentifierPart(
|
|
1786
|
-
return Jsep.isIdentifierStart(
|
|
1771
|
+
static isIdentifierPart(e) {
|
|
1772
|
+
return Jsep.isIdentifierStart(e) || Jsep.isDecimalDigit(e);
|
|
1787
1773
|
}
|
|
1788
1774
|
/**
|
|
1789
1775
|
* throw error at index of the expression
|
|
1790
1776
|
* @param {string} message
|
|
1791
1777
|
* @throws
|
|
1792
1778
|
*/
|
|
1793
|
-
throwError(
|
|
1794
|
-
const r = new Error(
|
|
1795
|
-
throw r.index = this.index, r.description =
|
|
1779
|
+
throwError(e) {
|
|
1780
|
+
const r = new Error(e + " at character " + this.index);
|
|
1781
|
+
throw r.index = this.index, r.description = e, r;
|
|
1796
1782
|
}
|
|
1797
1783
|
/**
|
|
1798
1784
|
* Run a given hook
|
|
@@ -1800,10 +1786,10 @@ class Jsep {
|
|
|
1800
1786
|
* @param {jsep.Expression|false} [node]
|
|
1801
1787
|
* @returns {?jsep.Expression}
|
|
1802
1788
|
*/
|
|
1803
|
-
runHook(
|
|
1804
|
-
if (Jsep.hooks[
|
|
1805
|
-
const
|
|
1806
|
-
return Jsep.hooks.run(
|
|
1789
|
+
runHook(e, r) {
|
|
1790
|
+
if (Jsep.hooks[e]) {
|
|
1791
|
+
const i = { context: this, node: r };
|
|
1792
|
+
return Jsep.hooks.run(e, i), i.node;
|
|
1807
1793
|
}
|
|
1808
1794
|
return r;
|
|
1809
1795
|
}
|
|
@@ -1812,11 +1798,11 @@ class Jsep {
|
|
|
1812
1798
|
* @param {string} name
|
|
1813
1799
|
* @returns {?jsep.Expression}
|
|
1814
1800
|
*/
|
|
1815
|
-
searchHook(
|
|
1816
|
-
if (Jsep.hooks[
|
|
1801
|
+
searchHook(e) {
|
|
1802
|
+
if (Jsep.hooks[e]) {
|
|
1817
1803
|
const r = { context: this };
|
|
1818
|
-
return Jsep.hooks[
|
|
1819
|
-
return
|
|
1804
|
+
return Jsep.hooks[e].find(function(i) {
|
|
1805
|
+
return i.call(r.context, r), r.node;
|
|
1820
1806
|
}), r.node;
|
|
1821
1807
|
}
|
|
1822
1808
|
}
|
|
@@ -1824,9 +1810,9 @@ class Jsep {
|
|
|
1824
1810
|
* Push `index` up to the next non-space character
|
|
1825
1811
|
*/
|
|
1826
1812
|
gobbleSpaces() {
|
|
1827
|
-
let
|
|
1828
|
-
for (;
|
|
1829
|
-
|
|
1813
|
+
let e = this.code;
|
|
1814
|
+
for (; e === Jsep.SPACE_CODE || e === Jsep.TAB_CODE || e === Jsep.LF_CODE || e === Jsep.CR_CODE; )
|
|
1815
|
+
e = this.expr.charCodeAt(++this.index);
|
|
1830
1816
|
this.runHook("gobble-spaces");
|
|
1831
1817
|
}
|
|
1832
1818
|
/**
|
|
@@ -1835,9 +1821,9 @@ class Jsep {
|
|
|
1835
1821
|
*/
|
|
1836
1822
|
parse() {
|
|
1837
1823
|
this.runHook("before-all");
|
|
1838
|
-
const
|
|
1824
|
+
const e = this.gobbleExpressions(), r = e.length === 1 ? e[0] : {
|
|
1839
1825
|
type: Jsep.COMPOUND,
|
|
1840
|
-
body:
|
|
1826
|
+
body: e
|
|
1841
1827
|
};
|
|
1842
1828
|
return this.runHook("after-all", r);
|
|
1843
1829
|
}
|
|
@@ -1846,15 +1832,15 @@ class Jsep {
|
|
|
1846
1832
|
* @param {number} [untilICode]
|
|
1847
1833
|
* @returns {jsep.Expression[]}
|
|
1848
1834
|
*/
|
|
1849
|
-
gobbleExpressions(
|
|
1850
|
-
let r = [],
|
|
1835
|
+
gobbleExpressions(e) {
|
|
1836
|
+
let r = [], i, n;
|
|
1851
1837
|
for (; this.index < this.expr.length; )
|
|
1852
|
-
if (
|
|
1838
|
+
if (i = this.code, i === Jsep.SEMCOL_CODE || i === Jsep.COMMA_CODE)
|
|
1853
1839
|
this.index++;
|
|
1854
|
-
else if (
|
|
1855
|
-
r.push(
|
|
1840
|
+
else if (n = this.gobbleExpression())
|
|
1841
|
+
r.push(n);
|
|
1856
1842
|
else if (this.index < this.expr.length) {
|
|
1857
|
-
if (
|
|
1843
|
+
if (i === e)
|
|
1858
1844
|
break;
|
|
1859
1845
|
this.throwError('Unexpected "' + this.char + '"');
|
|
1860
1846
|
}
|
|
@@ -1865,8 +1851,8 @@ class Jsep {
|
|
|
1865
1851
|
* @returns {?jsep.Expression}
|
|
1866
1852
|
*/
|
|
1867
1853
|
gobbleExpression() {
|
|
1868
|
-
const
|
|
1869
|
-
return this.gobbleSpaces(), this.runHook("after-expression",
|
|
1854
|
+
const e = this.searchHook("gobble-expression") || this.gobbleBinaryExpression();
|
|
1855
|
+
return this.gobbleSpaces(), this.runHook("after-expression", e);
|
|
1870
1856
|
}
|
|
1871
1857
|
/**
|
|
1872
1858
|
* Search for the operation portion of the string (e.g. `+`, `===`)
|
|
@@ -1877,11 +1863,11 @@ class Jsep {
|
|
|
1877
1863
|
*/
|
|
1878
1864
|
gobbleBinaryOp() {
|
|
1879
1865
|
this.gobbleSpaces();
|
|
1880
|
-
let
|
|
1866
|
+
let e = this.expr.substr(this.index, Jsep.max_binop_len), r = e.length;
|
|
1881
1867
|
for (; r > 0; ) {
|
|
1882
|
-
if (Jsep.binary_ops.hasOwnProperty(
|
|
1883
|
-
return this.index += r,
|
|
1884
|
-
|
|
1868
|
+
if (Jsep.binary_ops.hasOwnProperty(e) && (!Jsep.isIdentifierStart(this.code) || this.index + e.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + e.length))))
|
|
1869
|
+
return this.index += r, e;
|
|
1870
|
+
e = e.substr(0, --r);
|
|
1885
1871
|
}
|
|
1886
1872
|
return !1;
|
|
1887
1873
|
}
|
|
@@ -1891,33 +1877,33 @@ class Jsep {
|
|
|
1891
1877
|
* @returns {?jsep.BinaryExpression}
|
|
1892
1878
|
*/
|
|
1893
1879
|
gobbleBinaryExpression() {
|
|
1894
|
-
let
|
|
1880
|
+
let e, r, i, n, c, s, m, f, x;
|
|
1895
1881
|
if (s = this.gobbleToken(), !s || (r = this.gobbleBinaryOp(), !r))
|
|
1896
1882
|
return s;
|
|
1897
|
-
for (c = { value: r, prec: Jsep.binaryPrecedence(r), right_a: Jsep.right_associative.has(r) }, m = this.gobbleToken(), m || this.throwError("Expected expression after " + r),
|
|
1898
|
-
if (
|
|
1883
|
+
for (c = { value: r, prec: Jsep.binaryPrecedence(r), right_a: Jsep.right_associative.has(r) }, m = this.gobbleToken(), m || this.throwError("Expected expression after " + r), n = [s, c, m]; r = this.gobbleBinaryOp(); ) {
|
|
1884
|
+
if (i = Jsep.binaryPrecedence(r), i === 0) {
|
|
1899
1885
|
this.index -= r.length;
|
|
1900
1886
|
break;
|
|
1901
1887
|
}
|
|
1902
|
-
c = { value: r, prec:
|
|
1903
|
-
const C = (
|
|
1904
|
-
for (;
|
|
1905
|
-
m =
|
|
1888
|
+
c = { value: r, prec: i, right_a: Jsep.right_associative.has(r) }, x = r;
|
|
1889
|
+
const C = (E) => c.right_a && E.right_a ? i > E.prec : i <= E.prec;
|
|
1890
|
+
for (; n.length > 2 && C(n[n.length - 2]); )
|
|
1891
|
+
m = n.pop(), r = n.pop().value, s = n.pop(), e = {
|
|
1906
1892
|
type: Jsep.BINARY_EXP,
|
|
1907
1893
|
operator: r,
|
|
1908
1894
|
left: s,
|
|
1909
1895
|
right: m
|
|
1910
|
-
},
|
|
1911
|
-
|
|
1896
|
+
}, n.push(e);
|
|
1897
|
+
e = this.gobbleToken(), e || this.throwError("Expected expression after " + x), n.push(c, e);
|
|
1912
1898
|
}
|
|
1913
|
-
for (f =
|
|
1914
|
-
|
|
1899
|
+
for (f = n.length - 1, e = n[f]; f > 1; )
|
|
1900
|
+
e = {
|
|
1915
1901
|
type: Jsep.BINARY_EXP,
|
|
1916
|
-
operator:
|
|
1917
|
-
left:
|
|
1918
|
-
right:
|
|
1902
|
+
operator: n[f - 1].value,
|
|
1903
|
+
left: n[f - 2],
|
|
1904
|
+
right: e
|
|
1919
1905
|
}, f -= 2;
|
|
1920
|
-
return
|
|
1906
|
+
return e;
|
|
1921
1907
|
}
|
|
1922
1908
|
/**
|
|
1923
1909
|
* An individual part of a binary expression:
|
|
@@ -1925,19 +1911,19 @@ class Jsep {
|
|
|
1925
1911
|
* @returns {boolean|jsep.Expression}
|
|
1926
1912
|
*/
|
|
1927
1913
|
gobbleToken() {
|
|
1928
|
-
let
|
|
1929
|
-
if (this.gobbleSpaces(),
|
|
1930
|
-
return this.runHook("after-token",
|
|
1931
|
-
if (
|
|
1914
|
+
let e, r, i, n;
|
|
1915
|
+
if (this.gobbleSpaces(), n = this.searchHook("gobble-token"), n)
|
|
1916
|
+
return this.runHook("after-token", n);
|
|
1917
|
+
if (e = this.code, Jsep.isDecimalDigit(e) || e === Jsep.PERIOD_CODE)
|
|
1932
1918
|
return this.gobbleNumericLiteral();
|
|
1933
|
-
if (
|
|
1934
|
-
|
|
1935
|
-
else if (
|
|
1936
|
-
|
|
1919
|
+
if (e === Jsep.SQUOTE_CODE || e === Jsep.DQUOTE_CODE)
|
|
1920
|
+
n = this.gobbleStringLiteral();
|
|
1921
|
+
else if (e === Jsep.OBRACK_CODE)
|
|
1922
|
+
n = this.gobbleArray();
|
|
1937
1923
|
else {
|
|
1938
|
-
for (r = this.expr.substr(this.index, Jsep.max_unop_len),
|
|
1924
|
+
for (r = this.expr.substr(this.index, Jsep.max_unop_len), i = r.length; i > 0; ) {
|
|
1939
1925
|
if (Jsep.unary_ops.hasOwnProperty(r) && (!Jsep.isIdentifierStart(this.code) || this.index + r.length < this.expr.length && !Jsep.isIdentifierPart(this.expr.charCodeAt(this.index + r.length)))) {
|
|
1940
|
-
this.index +=
|
|
1926
|
+
this.index += i;
|
|
1941
1927
|
const c = this.gobbleToken();
|
|
1942
1928
|
return c || this.throwError("missing unaryOp argument"), this.runHook("after-token", {
|
|
1943
1929
|
type: Jsep.UNARY_EXP,
|
|
@@ -1946,15 +1932,15 @@ class Jsep {
|
|
|
1946
1932
|
prefix: !0
|
|
1947
1933
|
});
|
|
1948
1934
|
}
|
|
1949
|
-
r = r.substr(0, --
|
|
1935
|
+
r = r.substr(0, --i);
|
|
1950
1936
|
}
|
|
1951
|
-
Jsep.isIdentifierStart(
|
|
1937
|
+
Jsep.isIdentifierStart(e) ? (n = this.gobbleIdentifier(), Jsep.literals.hasOwnProperty(n.name) ? n = {
|
|
1952
1938
|
type: Jsep.LITERAL,
|
|
1953
|
-
value: Jsep.literals[
|
|
1954
|
-
raw:
|
|
1955
|
-
} :
|
|
1939
|
+
value: Jsep.literals[n.name],
|
|
1940
|
+
raw: n.name
|
|
1941
|
+
} : n.name === Jsep.this_str && (n = { type: Jsep.THIS_EXP })) : e === Jsep.OPAREN_CODE && (n = this.gobbleGroup());
|
|
1956
1942
|
}
|
|
1957
|
-
return
|
|
1943
|
+
return n ? (n = this.gobbleTokenProperty(n), this.runHook("after-token", n)) : this.runHook("after-token", !1);
|
|
1958
1944
|
}
|
|
1959
1945
|
/**
|
|
1960
1946
|
* Gobble properties of of identifiers/strings/arrays/groups.
|
|
@@ -1964,33 +1950,33 @@ class Jsep {
|
|
|
1964
1950
|
* @param {jsep.Expression} node
|
|
1965
1951
|
* @returns {jsep.Expression}
|
|
1966
1952
|
*/
|
|
1967
|
-
gobbleTokenProperty(
|
|
1953
|
+
gobbleTokenProperty(e) {
|
|
1968
1954
|
this.gobbleSpaces();
|
|
1969
1955
|
let r = this.code;
|
|
1970
1956
|
for (; r === Jsep.PERIOD_CODE || r === Jsep.OBRACK_CODE || r === Jsep.OPAREN_CODE || r === Jsep.QUMARK_CODE; ) {
|
|
1971
|
-
let
|
|
1957
|
+
let i;
|
|
1972
1958
|
if (r === Jsep.QUMARK_CODE) {
|
|
1973
1959
|
if (this.expr.charCodeAt(this.index + 1) !== Jsep.PERIOD_CODE)
|
|
1974
1960
|
break;
|
|
1975
|
-
|
|
1961
|
+
i = !0, this.index += 2, this.gobbleSpaces(), r = this.code;
|
|
1976
1962
|
}
|
|
1977
|
-
this.index++, r === Jsep.OBRACK_CODE ? (
|
|
1963
|
+
this.index++, r === Jsep.OBRACK_CODE ? (e = {
|
|
1978
1964
|
type: Jsep.MEMBER_EXP,
|
|
1979
1965
|
computed: !0,
|
|
1980
|
-
object:
|
|
1966
|
+
object: e,
|
|
1981
1967
|
property: this.gobbleExpression()
|
|
1982
|
-
},
|
|
1968
|
+
}, e.property || this.throwError('Unexpected "' + this.char + '"'), this.gobbleSpaces(), r = this.code, r !== Jsep.CBRACK_CODE && this.throwError("Unclosed ["), this.index++) : r === Jsep.OPAREN_CODE ? e = {
|
|
1983
1969
|
type: Jsep.CALL_EXP,
|
|
1984
1970
|
arguments: this.gobbleArguments(Jsep.CPAREN_CODE),
|
|
1985
|
-
callee:
|
|
1986
|
-
} : (r === Jsep.PERIOD_CODE ||
|
|
1971
|
+
callee: e
|
|
1972
|
+
} : (r === Jsep.PERIOD_CODE || i) && (i && this.index--, this.gobbleSpaces(), e = {
|
|
1987
1973
|
type: Jsep.MEMBER_EXP,
|
|
1988
1974
|
computed: !1,
|
|
1989
|
-
object:
|
|
1975
|
+
object: e,
|
|
1990
1976
|
property: this.gobbleIdentifier()
|
|
1991
|
-
}),
|
|
1977
|
+
}), i && (e.optional = !0), this.gobbleSpaces(), r = this.code;
|
|
1992
1978
|
}
|
|
1993
|
-
return
|
|
1979
|
+
return e;
|
|
1994
1980
|
}
|
|
1995
1981
|
/**
|
|
1996
1982
|
* Parse simple numeric literals: `12`, `3.4`, `.5`. Do this by using a string to
|
|
@@ -1998,21 +1984,21 @@ class Jsep {
|
|
|
1998
1984
|
* @returns {jsep.Literal}
|
|
1999
1985
|
*/
|
|
2000
1986
|
gobbleNumericLiteral() {
|
|
2001
|
-
let
|
|
1987
|
+
let e = "", r, i;
|
|
2002
1988
|
for (; Jsep.isDecimalDigit(this.code); )
|
|
2003
|
-
|
|
1989
|
+
e += this.expr.charAt(this.index++);
|
|
2004
1990
|
if (this.code === Jsep.PERIOD_CODE)
|
|
2005
|
-
for (
|
|
2006
|
-
|
|
1991
|
+
for (e += this.expr.charAt(this.index++); Jsep.isDecimalDigit(this.code); )
|
|
1992
|
+
e += this.expr.charAt(this.index++);
|
|
2007
1993
|
if (r = this.char, r === "e" || r === "E") {
|
|
2008
|
-
for (
|
|
2009
|
-
|
|
2010
|
-
Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" +
|
|
1994
|
+
for (e += this.expr.charAt(this.index++), r = this.char, (r === "+" || r === "-") && (e += this.expr.charAt(this.index++)); Jsep.isDecimalDigit(this.code); )
|
|
1995
|
+
e += this.expr.charAt(this.index++);
|
|
1996
|
+
Jsep.isDecimalDigit(this.expr.charCodeAt(this.index - 1)) || this.throwError("Expected exponent (" + e + this.char + ")");
|
|
2011
1997
|
}
|
|
2012
|
-
return
|
|
1998
|
+
return i = this.code, Jsep.isIdentifierStart(i) ? this.throwError("Variable names cannot start with a number (" + e + this.char + ")") : (i === Jsep.PERIOD_CODE || e.length === 1 && e.charCodeAt(0) === Jsep.PERIOD_CODE) && this.throwError("Unexpected period"), {
|
|
2013
1999
|
type: Jsep.LITERAL,
|
|
2014
|
-
value: parseFloat(
|
|
2015
|
-
raw:
|
|
2000
|
+
value: parseFloat(e),
|
|
2001
|
+
raw: e
|
|
2016
2002
|
};
|
|
2017
2003
|
}
|
|
2018
2004
|
/**
|
|
@@ -2021,44 +2007,44 @@ class Jsep {
|
|
|
2021
2007
|
* @returns {jsep.Literal}
|
|
2022
2008
|
*/
|
|
2023
2009
|
gobbleStringLiteral() {
|
|
2024
|
-
let
|
|
2025
|
-
const r = this.index,
|
|
2026
|
-
let
|
|
2010
|
+
let e = "";
|
|
2011
|
+
const r = this.index, i = this.expr.charAt(this.index++);
|
|
2012
|
+
let n = !1;
|
|
2027
2013
|
for (; this.index < this.expr.length; ) {
|
|
2028
2014
|
let c = this.expr.charAt(this.index++);
|
|
2029
|
-
if (c ===
|
|
2030
|
-
|
|
2015
|
+
if (c === i) {
|
|
2016
|
+
n = !0;
|
|
2031
2017
|
break;
|
|
2032
2018
|
} else if (c === "\\")
|
|
2033
2019
|
switch (c = this.expr.charAt(this.index++), c) {
|
|
2034
2020
|
case "n":
|
|
2035
|
-
|
|
2021
|
+
e += `
|
|
2036
2022
|
`;
|
|
2037
2023
|
break;
|
|
2038
2024
|
case "r":
|
|
2039
|
-
|
|
2025
|
+
e += "\r";
|
|
2040
2026
|
break;
|
|
2041
2027
|
case "t":
|
|
2042
|
-
|
|
2028
|
+
e += " ";
|
|
2043
2029
|
break;
|
|
2044
2030
|
case "b":
|
|
2045
|
-
|
|
2031
|
+
e += "\b";
|
|
2046
2032
|
break;
|
|
2047
2033
|
case "f":
|
|
2048
|
-
|
|
2034
|
+
e += "\f";
|
|
2049
2035
|
break;
|
|
2050
2036
|
case "v":
|
|
2051
|
-
|
|
2037
|
+
e += "\v";
|
|
2052
2038
|
break;
|
|
2053
2039
|
default:
|
|
2054
|
-
|
|
2040
|
+
e += c;
|
|
2055
2041
|
}
|
|
2056
2042
|
else
|
|
2057
|
-
|
|
2043
|
+
e += c;
|
|
2058
2044
|
}
|
|
2059
|
-
return
|
|
2045
|
+
return n || this.throwError('Unclosed quote after "' + e + '"'), {
|
|
2060
2046
|
type: Jsep.LITERAL,
|
|
2061
|
-
value:
|
|
2047
|
+
value: e,
|
|
2062
2048
|
raw: this.expr.substring(r, this.index)
|
|
2063
2049
|
};
|
|
2064
2050
|
}
|
|
@@ -2070,8 +2056,8 @@ class Jsep {
|
|
|
2070
2056
|
* @returns {jsep.Identifier}
|
|
2071
2057
|
*/
|
|
2072
2058
|
gobbleIdentifier() {
|
|
2073
|
-
let
|
|
2074
|
-
for (Jsep.isIdentifierStart(
|
|
2059
|
+
let e = this.code, r = this.index;
|
|
2060
|
+
for (Jsep.isIdentifierStart(e) ? this.index++ : this.throwError("Unexpected " + this.char); this.index < this.expr.length && (e = this.code, Jsep.isIdentifierPart(e)); )
|
|
2075
2061
|
this.index++;
|
|
2076
2062
|
return {
|
|
2077
2063
|
type: Jsep.IDENTIFIER,
|
|
@@ -2087,31 +2073,31 @@ class Jsep {
|
|
|
2087
2073
|
* @param {number} termination
|
|
2088
2074
|
* @returns {jsep.Expression[]}
|
|
2089
2075
|
*/
|
|
2090
|
-
gobbleArguments(
|
|
2076
|
+
gobbleArguments(e) {
|
|
2091
2077
|
const r = [];
|
|
2092
|
-
let
|
|
2078
|
+
let i = !1, n = 0;
|
|
2093
2079
|
for (; this.index < this.expr.length; ) {
|
|
2094
2080
|
this.gobbleSpaces();
|
|
2095
2081
|
let c = this.code;
|
|
2096
|
-
if (c ===
|
|
2097
|
-
|
|
2082
|
+
if (c === e) {
|
|
2083
|
+
i = !0, this.index++, e === Jsep.CPAREN_CODE && n && n >= r.length && this.throwError("Unexpected token " + String.fromCharCode(e));
|
|
2098
2084
|
break;
|
|
2099
2085
|
} else if (c === Jsep.COMMA_CODE) {
|
|
2100
|
-
if (this.index++,
|
|
2101
|
-
if (
|
|
2086
|
+
if (this.index++, n++, n !== r.length) {
|
|
2087
|
+
if (e === Jsep.CPAREN_CODE)
|
|
2102
2088
|
this.throwError("Unexpected token ,");
|
|
2103
|
-
else if (
|
|
2104
|
-
for (let s = r.length; s <
|
|
2089
|
+
else if (e === Jsep.CBRACK_CODE)
|
|
2090
|
+
for (let s = r.length; s < n; s++)
|
|
2105
2091
|
r.push(null);
|
|
2106
2092
|
}
|
|
2107
|
-
} else if (r.length !==
|
|
2093
|
+
} else if (r.length !== n && n !== 0)
|
|
2108
2094
|
this.throwError("Expected comma");
|
|
2109
2095
|
else {
|
|
2110
2096
|
const s = this.gobbleExpression();
|
|
2111
2097
|
(!s || s.type === Jsep.COMPOUND) && this.throwError("Expected comma"), r.push(s);
|
|
2112
2098
|
}
|
|
2113
2099
|
}
|
|
2114
|
-
return
|
|
2100
|
+
return i || this.throwError("Expected " + String.fromCharCode(e)), r;
|
|
2115
2101
|
}
|
|
2116
2102
|
/**
|
|
2117
2103
|
* Responsible for parsing a group of things within parentheses `()`
|
|
@@ -2124,11 +2110,11 @@ class Jsep {
|
|
|
2124
2110
|
*/
|
|
2125
2111
|
gobbleGroup() {
|
|
2126
2112
|
this.index++;
|
|
2127
|
-
let
|
|
2113
|
+
let e = this.gobbleExpressions(Jsep.CPAREN_CODE);
|
|
2128
2114
|
if (this.code === Jsep.CPAREN_CODE)
|
|
2129
|
-
return this.index++,
|
|
2115
|
+
return this.index++, e.length === 1 ? e[0] : e.length ? {
|
|
2130
2116
|
type: Jsep.SEQUENCE_EXP,
|
|
2131
|
-
expressions:
|
|
2117
|
+
expressions: e
|
|
2132
2118
|
} : !1;
|
|
2133
2119
|
this.throwError("Unclosed (");
|
|
2134
2120
|
}
|
|
@@ -2244,33 +2230,33 @@ Object.assign(Jsep, {
|
|
|
2244
2230
|
});
|
|
2245
2231
|
Jsep.max_unop_len = Jsep.getMaxKeyLen(Jsep.unary_ops);
|
|
2246
2232
|
Jsep.max_binop_len = Jsep.getMaxKeyLen(Jsep.binary_ops);
|
|
2247
|
-
const jsep = (
|
|
2233
|
+
const jsep = (t) => new Jsep(t).parse(), stdClassProps = Object.getOwnPropertyNames(class {
|
|
2248
2234
|
});
|
|
2249
|
-
Object.getOwnPropertyNames(Jsep).filter((
|
|
2250
|
-
jsep[
|
|
2235
|
+
Object.getOwnPropertyNames(Jsep).filter((t) => !stdClassProps.includes(t) && jsep[t] === void 0).forEach((t) => {
|
|
2236
|
+
jsep[t] = Jsep[t];
|
|
2251
2237
|
});
|
|
2252
2238
|
jsep.Jsep = Jsep;
|
|
2253
2239
|
const CONDITIONAL_EXP = "ConditionalExpression";
|
|
2254
2240
|
var ternary = {
|
|
2255
2241
|
name: "ternary",
|
|
2256
|
-
init(
|
|
2257
|
-
|
|
2258
|
-
if (r.node && this.code ===
|
|
2242
|
+
init(t) {
|
|
2243
|
+
t.hooks.add("after-expression", function(r) {
|
|
2244
|
+
if (r.node && this.code === t.QUMARK_CODE) {
|
|
2259
2245
|
this.index++;
|
|
2260
|
-
const
|
|
2261
|
-
if (
|
|
2246
|
+
const i = r.node, n = this.gobbleExpression();
|
|
2247
|
+
if (n || this.throwError("Expected expression"), this.gobbleSpaces(), this.code === t.COLON_CODE) {
|
|
2262
2248
|
this.index++;
|
|
2263
2249
|
const c = this.gobbleExpression();
|
|
2264
2250
|
if (c || this.throwError("Expected expression"), r.node = {
|
|
2265
2251
|
type: CONDITIONAL_EXP,
|
|
2266
|
-
test:
|
|
2267
|
-
consequent:
|
|
2252
|
+
test: i,
|
|
2253
|
+
consequent: n,
|
|
2268
2254
|
alternate: c
|
|
2269
|
-
},
|
|
2270
|
-
let s =
|
|
2271
|
-
for (; s.right.operator &&
|
|
2255
|
+
}, i.operator && t.binary_ops[i.operator] <= 0.9) {
|
|
2256
|
+
let s = i;
|
|
2257
|
+
for (; s.right.operator && t.binary_ops[s.right.operator] <= 0.9; )
|
|
2272
2258
|
s = s.right;
|
|
2273
|
-
r.node.test = s.right, s.right = r.node, r.node =
|
|
2259
|
+
r.node.test = s.right, s.right = r.node, r.node = i;
|
|
2274
2260
|
}
|
|
2275
2261
|
} else
|
|
2276
2262
|
this.throwError("Expected :");
|
|
@@ -2279,23 +2265,23 @@ var ternary = {
|
|
|
2279
2265
|
}
|
|
2280
2266
|
};
|
|
2281
2267
|
jsep.plugins.register(ternary);
|
|
2282
|
-
jsep.addBinaryOp("=", 0, (
|
|
2283
|
-
jsep.addBinaryOp("<>", 0, (
|
|
2284
|
-
jsep.addBinaryOp(">", 0, (
|
|
2285
|
-
jsep.addBinaryOp("<", 0, (
|
|
2286
|
-
jsep.addBinaryOp(">=", 0, (
|
|
2287
|
-
jsep.addBinaryOp("<=", 0, (
|
|
2268
|
+
jsep.addBinaryOp("=", 0, (t, e) => t === e);
|
|
2269
|
+
jsep.addBinaryOp("<>", 0, (t, e) => t !== e);
|
|
2270
|
+
jsep.addBinaryOp(">", 0, (t, e) => t > e);
|
|
2271
|
+
jsep.addBinaryOp("<", 0, (t, e) => t < e);
|
|
2272
|
+
jsep.addBinaryOp(">=", 0, (t, e) => t >= e);
|
|
2273
|
+
jsep.addBinaryOp("<=", 0, (t, e) => t <= e);
|
|
2288
2274
|
let innerConfig = {}, needComputedCell = /* @__PURE__ */ new Map();
|
|
2289
2275
|
function changeConfig(config) {
|
|
2290
2276
|
config.flat().forEach((cell) => {
|
|
2291
2277
|
let key = `${cell.row}:${cell.col}`;
|
|
2292
2278
|
if (cell.type === CellType.FUN && needComputedCell.set(key, cell), cell.colSpan !== 0 && cell.rowSpan !== 0) {
|
|
2293
2279
|
if (cell.type === CellType.FIELD && cell.format === FormatType.STRING && cell.fun && (cell.colData || cell.rowData)) {
|
|
2294
|
-
let
|
|
2280
|
+
let t = {
|
|
2295
2281
|
...cell.colData,
|
|
2296
2282
|
...cell.rowData
|
|
2297
2283
|
};
|
|
2298
|
-
cell.text = cell.fun.replace(/\$\{([a-zA-Z0-9\_\-]+)\}/g, (
|
|
2284
|
+
cell.text = cell.fun.replace(/\$\{([a-zA-Z0-9\_\-]+)\}/g, (e, r) => (r = r.toUpperCase(), t[r] ?? e));
|
|
2299
2285
|
}
|
|
2300
2286
|
if (cell.format && (cell.text = formatCellValue(cell.text || "", cell.format, cell.formatType)), cell.customRender) {
|
|
2301
2287
|
let data = {
|
|
@@ -2315,22 +2301,22 @@ function changeConfig(config) {
|
|
|
2315
2301
|
innerConfig[key] ? innerConfig[key].push(cell) : innerConfig[key] = [cell];
|
|
2316
2302
|
});
|
|
2317
2303
|
}
|
|
2318
|
-
function computeCell(
|
|
2319
|
-
changeConfig(
|
|
2320
|
-
if (
|
|
2321
|
-
const { isError: r, result:
|
|
2322
|
-
r || (
|
|
2304
|
+
function computeCell(t) {
|
|
2305
|
+
changeConfig(t), Array.from(needComputedCell.values()).forEach((e) => {
|
|
2306
|
+
if (e.type === CellType.FUN && e.fun) {
|
|
2307
|
+
const { isError: r, result: i } = parseExpression(e.fun, !0);
|
|
2308
|
+
r || (e.text = i, e.type = CellType.TEXT);
|
|
2323
2309
|
}
|
|
2324
2310
|
}), innerConfig = {}, needComputedCell = /* @__PURE__ */ new Map();
|
|
2325
2311
|
}
|
|
2326
|
-
function parseExpression(
|
|
2312
|
+
function parseExpression(t, e = !1) {
|
|
2327
2313
|
try {
|
|
2328
|
-
const r =
|
|
2314
|
+
const r = t.trim();
|
|
2329
2315
|
if (!r)
|
|
2330
2316
|
throw new Error("请输入一个表达式");
|
|
2331
|
-
const
|
|
2317
|
+
const i = r.startsWith("=") ? r.slice(1) : r, n = jsep(i);
|
|
2332
2318
|
let c = null;
|
|
2333
|
-
return
|
|
2319
|
+
return e && (c = evaluateExpression(n)), {
|
|
2334
2320
|
isError: !1,
|
|
2335
2321
|
result: c
|
|
2336
2322
|
};
|
|
@@ -2341,89 +2327,89 @@ function parseExpression(e, t = !1) {
|
|
|
2341
2327
|
};
|
|
2342
2328
|
}
|
|
2343
2329
|
}
|
|
2344
|
-
function evaluateExpression(
|
|
2345
|
-
if (!
|
|
2330
|
+
function evaluateExpression(t) {
|
|
2331
|
+
if (!t)
|
|
2346
2332
|
throw new Error("空节点");
|
|
2347
|
-
switch (
|
|
2333
|
+
switch (t.type) {
|
|
2348
2334
|
case "Literal":
|
|
2349
|
-
if (typeof
|
|
2350
|
-
const c =
|
|
2335
|
+
if (typeof t.value == "string") {
|
|
2336
|
+
const c = t.value.match(/^(['"]?)([A-Z]+\d+):([A-Z]+\d+)\1$/i);
|
|
2351
2337
|
if (c)
|
|
2352
2338
|
return getRangeValues(c[2], c[3]);
|
|
2353
2339
|
}
|
|
2354
|
-
return
|
|
2340
|
+
return t.value;
|
|
2355
2341
|
case "Identifier":
|
|
2356
|
-
if (/^[A-Z]+\d+$/.test(
|
|
2357
|
-
return getCellValue(
|
|
2358
|
-
throw new Error(`未定义的标识符: ${
|
|
2342
|
+
if (/^[A-Z]+\d+$/.test(t.name))
|
|
2343
|
+
return getCellValue(t.name);
|
|
2344
|
+
throw new Error(`未定义的标识符: ${t.name}`);
|
|
2359
2345
|
case "BinaryExpression":
|
|
2360
|
-
const
|
|
2361
|
-
switch (
|
|
2346
|
+
const e = evaluateExpression(t.left), r = evaluateExpression(t.right);
|
|
2347
|
+
switch (t.operator) {
|
|
2362
2348
|
case "+":
|
|
2363
|
-
return
|
|
2349
|
+
return e + r;
|
|
2364
2350
|
case "-":
|
|
2365
|
-
return
|
|
2351
|
+
return e - r;
|
|
2366
2352
|
case "*":
|
|
2367
|
-
return
|
|
2353
|
+
return e * r;
|
|
2368
2354
|
case "/":
|
|
2369
|
-
return
|
|
2355
|
+
return e / r;
|
|
2370
2356
|
case "^":
|
|
2371
|
-
return Math.pow(
|
|
2357
|
+
return Math.pow(e, r);
|
|
2372
2358
|
case "=":
|
|
2373
|
-
return
|
|
2359
|
+
return e === r ? 1 : 0;
|
|
2374
2360
|
case "<>":
|
|
2375
|
-
return
|
|
2361
|
+
return e !== r ? 1 : 0;
|
|
2376
2362
|
case ">":
|
|
2377
|
-
return
|
|
2363
|
+
return e > r ? 1 : 0;
|
|
2378
2364
|
case "<":
|
|
2379
|
-
return
|
|
2365
|
+
return e < r ? 1 : 0;
|
|
2380
2366
|
case ">=":
|
|
2381
|
-
return
|
|
2367
|
+
return e >= r ? 1 : 0;
|
|
2382
2368
|
case "<=":
|
|
2383
|
-
return
|
|
2369
|
+
return e <= r ? 1 : 0;
|
|
2384
2370
|
default:
|
|
2385
|
-
throw new Error(`不支持的操作符: ${
|
|
2371
|
+
throw new Error(`不支持的操作符: ${t.operator}`);
|
|
2386
2372
|
}
|
|
2387
2373
|
case "CallExpression":
|
|
2388
|
-
return evaluateFunction(
|
|
2374
|
+
return evaluateFunction(t.callee.name, t.arguments);
|
|
2389
2375
|
case "MemberExpression":
|
|
2390
|
-
if (
|
|
2391
|
-
const s =
|
|
2376
|
+
if (t.computed && t.property && t.property.type === "Literal") {
|
|
2377
|
+
const s = t.property.value.match(/^(['"]?)([A-Z]+\d+):([A-Z]+\d+)\1$/i);
|
|
2392
2378
|
if (s)
|
|
2393
2379
|
return getRangeValues(s[2], s[3]);
|
|
2394
2380
|
}
|
|
2395
|
-
const
|
|
2396
|
-
if (typeof
|
|
2397
|
-
return n
|
|
2398
|
-
throw new Error(`无法获取非对象值的属性: ${
|
|
2381
|
+
const i = evaluateExpression(t.object), n = t.computed ? evaluateExpression(t.property) : t.property.name;
|
|
2382
|
+
if (typeof i == "object" && i !== null)
|
|
2383
|
+
return i[n];
|
|
2384
|
+
throw new Error(`无法获取非对象值的属性: ${n}`);
|
|
2399
2385
|
default:
|
|
2400
|
-
throw new Error(`不支持的节点类型: ${
|
|
2386
|
+
throw new Error(`不支持的节点类型: ${t.type}`);
|
|
2401
2387
|
}
|
|
2402
2388
|
}
|
|
2403
|
-
function getRangeValues(
|
|
2389
|
+
function getRangeValues(t, e) {
|
|
2404
2390
|
let r = -1;
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2407
|
-
let
|
|
2408
|
-
const c =
|
|
2409
|
-
c && (
|
|
2391
|
+
const i = t.match(/[A-Z]+/);
|
|
2392
|
+
i && (r = columnToNumber(i[0]));
|
|
2393
|
+
let n = -1;
|
|
2394
|
+
const c = t.match(/\d+/);
|
|
2395
|
+
c && (n = parseInt(c[0]) - 1);
|
|
2410
2396
|
let s = -1;
|
|
2411
|
-
const m =
|
|
2397
|
+
const m = e.match(/[A-Z]+/);
|
|
2412
2398
|
m && (s = columnToNumber(m[0]));
|
|
2413
2399
|
let f = -1;
|
|
2414
|
-
const
|
|
2415
|
-
|
|
2400
|
+
const x = e.match(/\d+/);
|
|
2401
|
+
x && (f = parseInt(x[0]) - 1);
|
|
2416
2402
|
const C = [];
|
|
2417
|
-
for (let
|
|
2418
|
-
for (let
|
|
2419
|
-
const g = `${
|
|
2403
|
+
for (let E = n; E <= f; E++)
|
|
2404
|
+
for (let v = r; v <= s; v++) {
|
|
2405
|
+
const g = `${E}:${v}`;
|
|
2420
2406
|
C.push(...getCellValue(g));
|
|
2421
2407
|
}
|
|
2422
2408
|
return C;
|
|
2423
2409
|
}
|
|
2424
|
-
function evaluateFunction(
|
|
2425
|
-
const r =
|
|
2426
|
-
switch (
|
|
2410
|
+
function evaluateFunction(t, e) {
|
|
2411
|
+
const r = e.map((i) => evaluateExpression(i));
|
|
2412
|
+
switch (t.toUpperCase()) {
|
|
2427
2413
|
case "SUM":
|
|
2428
2414
|
return r.flat().reduce((s, m) => {
|
|
2429
2415
|
const f = parseFloat(m);
|
|
@@ -2431,8 +2417,8 @@ function evaluateFunction(e, t) {
|
|
|
2431
2417
|
}, 0);
|
|
2432
2418
|
case "AVERAGE":
|
|
2433
2419
|
case "AVG":
|
|
2434
|
-
const
|
|
2435
|
-
return
|
|
2420
|
+
const n = r.flat().filter((s) => !isNaN(parseFloat(s)));
|
|
2421
|
+
return n.length > 0 ? n.reduce((s, m) => s + parseFloat(m), 0) / n.length : 0;
|
|
2436
2422
|
case "IF":
|
|
2437
2423
|
if (r.length !== 3)
|
|
2438
2424
|
throw new Error(`IF函数需要3个参数,但提供了${r.length}个`);
|
|
@@ -2456,22 +2442,22 @@ function evaluateFunction(e, t) {
|
|
|
2456
2442
|
case "TEXTJOIN":
|
|
2457
2443
|
return r.map(String).join("");
|
|
2458
2444
|
default:
|
|
2459
|
-
throw new Error(`不支持的函数: ${
|
|
2445
|
+
throw new Error(`不支持的函数: ${t}`);
|
|
2460
2446
|
}
|
|
2461
2447
|
}
|
|
2462
|
-
function getCellValue(
|
|
2448
|
+
function getCellValue(t) {
|
|
2463
2449
|
try {
|
|
2464
|
-
return innerConfig[
|
|
2465
|
-
} catch (
|
|
2466
|
-
console.warn(`无法解析单元格: ${
|
|
2450
|
+
return innerConfig[t].map((e) => e.text);
|
|
2451
|
+
} catch (e) {
|
|
2452
|
+
console.warn(`无法解析单元格: ${t}`, e);
|
|
2467
2453
|
}
|
|
2468
2454
|
return [];
|
|
2469
2455
|
}
|
|
2470
|
-
function columnToNumber(
|
|
2471
|
-
let
|
|
2472
|
-
for (let r = 0; r <
|
|
2473
|
-
|
|
2474
|
-
return
|
|
2456
|
+
function columnToNumber(t) {
|
|
2457
|
+
let e = 0;
|
|
2458
|
+
for (let r = 0; r < t.length; r++)
|
|
2459
|
+
e = e * 26 + (t.charCodeAt(r) - 64) - 1;
|
|
2460
|
+
return e;
|
|
2475
2461
|
}
|
|
2476
2462
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2477
2463
|
__name: "report-view-item",
|
|
@@ -2480,8 +2466,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2480
2466
|
index: null
|
|
2481
2467
|
},
|
|
2482
2468
|
emits: ["updateData"],
|
|
2483
|
-
setup(
|
|
2484
|
-
const r =
|
|
2469
|
+
setup(t, { emit: e }) {
|
|
2470
|
+
const r = t, i = ref(), n = ref(), c = computed(() => ({
|
|
2485
2471
|
width: r.config.widthType === "%" ? `calc(${r.config.width}% - 10px)` : `${r.config.width - 10}px`,
|
|
2486
2472
|
height: r.config.fullHeight ? "calc(100% - 8px)" : `${r.config.height}px`
|
|
2487
2473
|
})), s = computed(() => r.config && r.config.data ? !!r.config.data.pagination : !1), m = computed(() => r.config.params && Array.isArray(r.config.params) && r.config.params.length > 0), f = reactive({
|
|
@@ -2489,17 +2475,17 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2489
2475
|
pageSizes: [10, 20, 50, 100, 200, 1e4],
|
|
2490
2476
|
pageIndex: 1,
|
|
2491
2477
|
total: 0
|
|
2492
|
-
}),
|
|
2478
|
+
}), x = ref([]);
|
|
2493
2479
|
function C(O) {
|
|
2494
|
-
|
|
2480
|
+
x.value = O, f.pageIndex = 1, Z();
|
|
2495
2481
|
}
|
|
2496
|
-
let
|
|
2482
|
+
let E = !1;
|
|
2497
2483
|
watch(
|
|
2498
2484
|
() => [f.pageSize, f.pageIndex],
|
|
2499
2485
|
(O, w) => {
|
|
2500
2486
|
if (O && w) {
|
|
2501
|
-
let [u, l] = O, [
|
|
2502
|
-
u !==
|
|
2487
|
+
let [u, l] = O, [o, d] = O;
|
|
2488
|
+
u !== o && (f.pageIndex = 1), E && Z();
|
|
2503
2489
|
}
|
|
2504
2490
|
},
|
|
2505
2491
|
{
|
|
@@ -2507,7 +2493,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2507
2493
|
deep: !0
|
|
2508
2494
|
}
|
|
2509
2495
|
);
|
|
2510
|
-
function
|
|
2496
|
+
function v() {
|
|
2511
2497
|
f.pageIndex = 1, Z();
|
|
2512
2498
|
}
|
|
2513
2499
|
const g = ref(!1);
|
|
@@ -2516,107 +2502,107 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2516
2502
|
}
|
|
2517
2503
|
function N(O) {
|
|
2518
2504
|
const w = O.length, u = O[0].length, l = [];
|
|
2519
|
-
for (let
|
|
2520
|
-
l[
|
|
2521
|
-
for (let
|
|
2522
|
-
l[
|
|
2505
|
+
for (let o = 0; o < u; o++) {
|
|
2506
|
+
l[o] = [];
|
|
2507
|
+
for (let d = 0; d < w; d++)
|
|
2508
|
+
l[o][d] = O[d][o];
|
|
2523
2509
|
}
|
|
2524
2510
|
return l;
|
|
2525
2511
|
}
|
|
2526
|
-
function
|
|
2512
|
+
function B(O, w, u, l, o) {
|
|
2527
2513
|
if (l) {
|
|
2528
|
-
let
|
|
2529
|
-
u = a
|
|
2514
|
+
let a = o.findIndex((S) => S === u);
|
|
2515
|
+
u = o[a - 1];
|
|
2530
2516
|
}
|
|
2531
|
-
let
|
|
2532
|
-
return Object.keys(O).filter((
|
|
2517
|
+
let d = O[w], p = `${u}-${d.join("-")}`;
|
|
2518
|
+
return Object.keys(O).filter((a) => a.indexOf(p) > -1).map((a) => O[a]).reduce((a, S) => a + S.length, 0);
|
|
2533
2519
|
}
|
|
2534
2520
|
function J(O, w) {
|
|
2535
2521
|
const u = O.filter((l) => l < w);
|
|
2536
2522
|
return u.length === 0 ? null : Math.max(...u);
|
|
2537
2523
|
}
|
|
2538
2524
|
function Y(O, w, u, l) {
|
|
2539
|
-
w.forEach((
|
|
2540
|
-
let
|
|
2541
|
-
|
|
2542
|
-
D.type === CellType.FIELD && D.data && D.isGroup &&
|
|
2525
|
+
w.forEach((o) => {
|
|
2526
|
+
let d = l[o.data], p = u[o.index], y = [];
|
|
2527
|
+
p.forEach((D, T) => {
|
|
2528
|
+
D.type === CellType.FIELD && D.data && D.isGroup && y.push(T);
|
|
2543
2529
|
});
|
|
2544
|
-
let
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
let
|
|
2548
|
-
if (
|
|
2549
|
-
|
|
2550
|
-
if (
|
|
2551
|
-
let I = _[
|
|
2530
|
+
let a = {};
|
|
2531
|
+
y.forEach((D, T) => {
|
|
2532
|
+
a[D] || (a[D] = /* @__PURE__ */ new Set());
|
|
2533
|
+
let A = p[D].data.replace("row:", "").toUpperCase();
|
|
2534
|
+
if (T === 0)
|
|
2535
|
+
d.forEach((_) => {
|
|
2536
|
+
if (A) {
|
|
2537
|
+
let I = _[A];
|
|
2552
2538
|
if (I) {
|
|
2553
|
-
const
|
|
2554
|
-
|
|
2539
|
+
const P = `${D}-${I}`;
|
|
2540
|
+
a[P] ? a[P].push(_) : a[P] = [_], a[D].add(I), a[I] = [I];
|
|
2555
2541
|
}
|
|
2556
2542
|
}
|
|
2557
2543
|
});
|
|
2558
2544
|
else {
|
|
2559
|
-
let _ =
|
|
2560
|
-
Array.from(
|
|
2561
|
-
const H = `${_}-${
|
|
2562
|
-
let z =
|
|
2563
|
-
if (
|
|
2564
|
-
let K = G[
|
|
2545
|
+
let _ = y[T - 1];
|
|
2546
|
+
Array.from(a[_]).forEach((P) => {
|
|
2547
|
+
const H = `${_}-${P}`;
|
|
2548
|
+
let z = a[H].map((G) => {
|
|
2549
|
+
if (A) {
|
|
2550
|
+
let K = G[A];
|
|
2565
2551
|
if (K) {
|
|
2566
2552
|
let te = !1;
|
|
2567
|
-
const ie = `${D}-${
|
|
2568
|
-
return
|
|
2553
|
+
const ie = `${D}-${P}-${K}`, ae = `${P}-${K}`;
|
|
2554
|
+
return a[ie] ? a[ie].push(G) : a[ie] = [G], a[D].has(ae) || (te = !0), a[D].add(ae), a[ae] = a[P].concat([K]), te ? K : null;
|
|
2569
2555
|
}
|
|
2570
2556
|
}
|
|
2571
2557
|
}).filter((G) => !!G);
|
|
2572
|
-
|
|
2558
|
+
a[H] = z;
|
|
2573
2559
|
});
|
|
2574
2560
|
}
|
|
2575
2561
|
});
|
|
2576
|
-
let
|
|
2577
|
-
const U =
|
|
2578
|
-
|
|
2579
|
-
let k =
|
|
2562
|
+
let S = 1, $ = Math.max(...y);
|
|
2563
|
+
const U = p.some((D) => D.isRowColCombine);
|
|
2564
|
+
y.length > 0 ? U ? S = a[$].size : S = Array.from(a[$]).reduce((D, T) => {
|
|
2565
|
+
let k = a[`${$}-${T}`];
|
|
2580
2566
|
return D + k.length;
|
|
2581
|
-
}, 0) :
|
|
2567
|
+
}, 0) : S = d.length;
|
|
2582
2568
|
const F = {
|
|
2583
|
-
...
|
|
2569
|
+
...o,
|
|
2584
2570
|
loop: !1
|
|
2585
|
-
}, L = Array.from({ length:
|
|
2586
|
-
O.splice(
|
|
2587
|
-
const M = Array.from({ length:
|
|
2588
|
-
|
|
2589
|
-
let k = M[
|
|
2590
|
-
if (
|
|
2591
|
-
Array.from(
|
|
2592
|
-
let
|
|
2571
|
+
}, L = Array.from({ length: S }, () => cloneDeep(F));
|
|
2572
|
+
O.splice(o.index, 1, ...L);
|
|
2573
|
+
const M = Array.from({ length: p.length }, () => []);
|
|
2574
|
+
p.forEach((D, T) => {
|
|
2575
|
+
let k = M[T];
|
|
2576
|
+
if (y.includes(D.col))
|
|
2577
|
+
console.log(a[D.col], T, D.col), Array.from(a[D.col]).forEach((_, I) => {
|
|
2578
|
+
let P = U && T === $ ? 1 : B(a, _, $, U, y), H = a[_], R = H[a[_].length - 1], z = {
|
|
2593
2579
|
...D,
|
|
2594
|
-
text:
|
|
2595
|
-
rowSpan:
|
|
2580
|
+
text: R,
|
|
2581
|
+
rowSpan: P,
|
|
2596
2582
|
rowData: H
|
|
2597
2583
|
};
|
|
2598
2584
|
k.push(z);
|
|
2599
2585
|
let G = {
|
|
2600
2586
|
...D,
|
|
2601
|
-
text:
|
|
2587
|
+
text: R,
|
|
2602
2588
|
type: "",
|
|
2603
2589
|
colSpan: 0,
|
|
2604
2590
|
rowSpan: 0
|
|
2605
2591
|
};
|
|
2606
|
-
for (let K = 0; K <
|
|
2592
|
+
for (let K = 0; K < P - 1; K++)
|
|
2607
2593
|
k.push(G);
|
|
2608
2594
|
});
|
|
2609
2595
|
else if (D.data) {
|
|
2610
|
-
let
|
|
2611
|
-
D.isRowColCombine ?
|
|
2612
|
-
let H =
|
|
2596
|
+
let A = a[$] ? Array.from(a[$]) : [], _ = D.data.replace("row:", "").toUpperCase();
|
|
2597
|
+
D.isRowColCombine ? A.length ? A.forEach((I, P) => {
|
|
2598
|
+
let H = a[`${$}-${I}`], R = D.combineKeys.map((K, te) => {
|
|
2613
2599
|
const ie = D.combineValues[te];
|
|
2614
2600
|
return {
|
|
2615
2601
|
key: K,
|
|
2616
2602
|
val: ie
|
|
2617
2603
|
};
|
|
2618
2604
|
});
|
|
2619
|
-
const z = H.filter((K) =>
|
|
2605
|
+
const z = H.filter((K) => R.every((te) => K[te.key] === te.val));
|
|
2620
2606
|
let G = {
|
|
2621
2607
|
...D
|
|
2622
2608
|
};
|
|
@@ -2626,121 +2612,121 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2626
2612
|
} else
|
|
2627
2613
|
G.text = "", G.rowData = {};
|
|
2628
2614
|
k.push(G);
|
|
2629
|
-
}) :
|
|
2615
|
+
}) : d.forEach((I) => {
|
|
2630
2616
|
let H = D.combineKeys.map((z, G) => {
|
|
2631
2617
|
const K = D.combineValues[G];
|
|
2632
2618
|
return {
|
|
2633
2619
|
key: z,
|
|
2634
2620
|
val: K
|
|
2635
2621
|
};
|
|
2636
|
-
}).every((z) => I[z.key] === z.val),
|
|
2622
|
+
}).every((z) => I[z.key] === z.val), R = {
|
|
2637
2623
|
...D
|
|
2638
2624
|
};
|
|
2639
|
-
delete
|
|
2640
|
-
}) :
|
|
2641
|
-
|
|
2625
|
+
delete R.combineKeys, delete R.combineValues, delete R.isRowColCombine, H ? (R.text = I[_], R.rowData = I) : R.text = "", k.push(R);
|
|
2626
|
+
}) : A.length ? A.forEach((I, P) => {
|
|
2627
|
+
a[`${$}-${I}`].forEach((R) => {
|
|
2642
2628
|
let z = {
|
|
2643
2629
|
...D
|
|
2644
2630
|
};
|
|
2645
|
-
delete z.combineKeys, delete z.combineValues, delete z.isRowColCombine,
|
|
2631
|
+
delete z.combineKeys, delete z.combineValues, delete z.isRowColCombine, R[_] ? (z.text = R[_], z.rowData = R) : z.text = "", k.push(z);
|
|
2646
2632
|
});
|
|
2647
|
-
}) :
|
|
2648
|
-
let
|
|
2633
|
+
}) : d.forEach((I) => {
|
|
2634
|
+
let P = {
|
|
2649
2635
|
...D
|
|
2650
2636
|
};
|
|
2651
|
-
delete
|
|
2637
|
+
delete P.combineKeys, delete P.combineValues, delete P.isRowColCombine, I[_] ? (P.text = I[_], P.rowData = I) : P.text = "", k.push(P);
|
|
2652
2638
|
});
|
|
2653
2639
|
} else {
|
|
2654
|
-
const
|
|
2640
|
+
const A = {
|
|
2655
2641
|
...D,
|
|
2656
|
-
rowData:
|
|
2642
|
+
rowData: d[0]
|
|
2657
2643
|
};
|
|
2658
2644
|
if (D.rowSpan === 0 && D.mergeTarget && D.mergeTarget.length === 2) {
|
|
2659
|
-
let [
|
|
2660
|
-
|
|
2645
|
+
let [P, H] = D.mergeTarget, R = u.reduce((z, G) => z.concat(G), []).filter((z) => z.row === P && z.col === H)[0];
|
|
2646
|
+
R && (R.rowSpan += S - 1);
|
|
2661
2647
|
} else
|
|
2662
|
-
|
|
2648
|
+
A.rowSpan += S - 1;
|
|
2663
2649
|
const _ = {
|
|
2664
2650
|
...D,
|
|
2665
2651
|
type: "",
|
|
2666
2652
|
colSpan: 0,
|
|
2667
2653
|
rowSpan: 0
|
|
2668
2654
|
};
|
|
2669
|
-
delete
|
|
2670
|
-
let I = Array.from({ length:
|
|
2671
|
-
k.push(
|
|
2655
|
+
delete A.isRowColCombine;
|
|
2656
|
+
let I = Array.from({ length: S - 1 }, () => cloneDeep(_));
|
|
2657
|
+
k.push(A, ...I);
|
|
2672
2658
|
}
|
|
2673
2659
|
});
|
|
2674
2660
|
const V = N(M);
|
|
2675
|
-
u.splice(
|
|
2661
|
+
u.splice(o.index, 1, ...V);
|
|
2676
2662
|
});
|
|
2677
2663
|
}
|
|
2678
2664
|
function W(O, w, u, l) {
|
|
2679
|
-
w.forEach((
|
|
2680
|
-
let
|
|
2665
|
+
w.forEach((o) => {
|
|
2666
|
+
let d = l[o.data], p = [], y = [];
|
|
2681
2667
|
u.forEach((L, M) => {
|
|
2682
|
-
let V = L[
|
|
2683
|
-
V.type === CellType.FIELD && V.data && V.isGroup &&
|
|
2668
|
+
let V = L[o.index];
|
|
2669
|
+
V.type === CellType.FIELD && V.data && V.isGroup && y.push(M), p.push(V);
|
|
2684
2670
|
});
|
|
2685
|
-
let
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
let D =
|
|
2671
|
+
let a = {};
|
|
2672
|
+
y.forEach((L, M) => {
|
|
2673
|
+
a[L] || (a[L] = /* @__PURE__ */ new Set());
|
|
2674
|
+
let D = p[L].data.replace("col:", "").toUpperCase();
|
|
2689
2675
|
if (M === 0)
|
|
2690
|
-
|
|
2676
|
+
d.forEach((T) => {
|
|
2691
2677
|
if (D) {
|
|
2692
|
-
let k =
|
|
2678
|
+
let k = T[D];
|
|
2693
2679
|
if (k) {
|
|
2694
|
-
const
|
|
2695
|
-
|
|
2680
|
+
const A = `${L}-${k}`;
|
|
2681
|
+
a[A] ? a[A].push(T) : a[A] = [T], a[L].add(k), a[k] = [k], a[`${k}-data`] = [T];
|
|
2696
2682
|
}
|
|
2697
2683
|
}
|
|
2698
2684
|
});
|
|
2699
2685
|
else {
|
|
2700
|
-
let
|
|
2701
|
-
Array.from(
|
|
2702
|
-
const _ = `${
|
|
2703
|
-
let
|
|
2686
|
+
let T = y[M - 1];
|
|
2687
|
+
Array.from(a[T]).forEach((A) => {
|
|
2688
|
+
const _ = `${T}-${A}`;
|
|
2689
|
+
let P = a[_].map((H) => {
|
|
2704
2690
|
if (D) {
|
|
2705
|
-
let
|
|
2706
|
-
if (
|
|
2691
|
+
let R = H[D];
|
|
2692
|
+
if (R) {
|
|
2707
2693
|
let z = !1;
|
|
2708
|
-
const G = `${L}-${
|
|
2709
|
-
return
|
|
2694
|
+
const G = `${L}-${A}-${R}`, K = `${A}-${R}`;
|
|
2695
|
+
return a[G] ? a[G].push(H) : a[G] = [H], a[K + "-data"] ? a[K + "-data"].push(H) : a[K + "-data"] = [H], a[L].has(K) || (z = !0), a[L].add(K), a[K] = a[A].concat([R]), z ? R : null;
|
|
2710
2696
|
}
|
|
2711
2697
|
}
|
|
2712
2698
|
}).filter((H) => !!H);
|
|
2713
|
-
|
|
2699
|
+
a[_] = P;
|
|
2714
2700
|
});
|
|
2715
2701
|
}
|
|
2716
2702
|
});
|
|
2717
|
-
let
|
|
2718
|
-
const F =
|
|
2719
|
-
|
|
2720
|
-
let V =
|
|
2703
|
+
let S = 1, $ = Math.max(...y), U = Math.min(...y);
|
|
2704
|
+
const F = p.some((L) => L.isRowColCombine);
|
|
2705
|
+
y.length > 0 ? F ? S = a[$].size : S = Array.from(a[$]).reduce((L, M) => {
|
|
2706
|
+
let V = a[`${$}-${M}`];
|
|
2721
2707
|
return L + V.length;
|
|
2722
|
-
}, 0) :
|
|
2723
|
-
for (let L = 0; L <
|
|
2724
|
-
const M =
|
|
2708
|
+
}, 0) : S = d.length;
|
|
2709
|
+
for (let L = 0; L < p.length; L++) {
|
|
2710
|
+
const M = p[L];
|
|
2725
2711
|
if (L === 0) {
|
|
2726
2712
|
const D = {
|
|
2727
|
-
...
|
|
2713
|
+
...o,
|
|
2728
2714
|
loop: !1
|
|
2729
|
-
},
|
|
2730
|
-
O.splice(
|
|
2715
|
+
}, T = Array.from({ length: S }, () => cloneDeep(D));
|
|
2716
|
+
O.splice(o.index, 1, ...T);
|
|
2731
2717
|
}
|
|
2732
2718
|
let V = u[M.row];
|
|
2733
2719
|
if (V && Array.isArray(V)) {
|
|
2734
2720
|
let D = [];
|
|
2735
|
-
if (
|
|
2736
|
-
Array.from(
|
|
2737
|
-
let _ = F && L ===
|
|
2721
|
+
if (y.includes(L))
|
|
2722
|
+
Array.from(a[M.row]).forEach((k, A) => {
|
|
2723
|
+
let _ = F && L === $ ? 1 : B(a, k, $, F, y), I = a[k][a[k].length - 1], P = {
|
|
2738
2724
|
...M,
|
|
2739
2725
|
text: I,
|
|
2740
2726
|
colSpan: _,
|
|
2741
|
-
colData:
|
|
2727
|
+
colData: a[k + "-data"]
|
|
2742
2728
|
};
|
|
2743
|
-
if (D.push(
|
|
2729
|
+
if (D.push(P), _ > 1) {
|
|
2744
2730
|
let H = {
|
|
2745
2731
|
...M,
|
|
2746
2732
|
text: I,
|
|
@@ -2748,75 +2734,75 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2748
2734
|
colSpan: 0,
|
|
2749
2735
|
rowSpan: 0
|
|
2750
2736
|
};
|
|
2751
|
-
for (let
|
|
2737
|
+
for (let R = 0; R < _ - 1; R++)
|
|
2752
2738
|
D.push(H);
|
|
2753
2739
|
}
|
|
2754
2740
|
}), V.splice(M.col, 1, ...D);
|
|
2755
2741
|
else {
|
|
2756
|
-
if (L > U && L <
|
|
2757
|
-
let
|
|
2758
|
-
if (
|
|
2759
|
-
let k = u[
|
|
2760
|
-
k = k.map((
|
|
2761
|
-
let _ =
|
|
2742
|
+
if (L > U && L < $) {
|
|
2743
|
+
let T = J(y, L);
|
|
2744
|
+
if (T !== null) {
|
|
2745
|
+
let k = u[T].slice(o.index, o.index + S);
|
|
2746
|
+
k = k.map((A) => {
|
|
2747
|
+
let _ = A.colData;
|
|
2762
2748
|
return Array.isArray(_) && (_ = _[0]), {
|
|
2763
2749
|
...M,
|
|
2764
2750
|
colData: _,
|
|
2765
|
-
colSpan:
|
|
2766
|
-
rowSpan:
|
|
2751
|
+
colSpan: A.colSpan,
|
|
2752
|
+
rowSpan: A.rowSpan
|
|
2767
2753
|
};
|
|
2768
|
-
}), V.splice(
|
|
2754
|
+
}), V.splice(o.index, 1, ...k);
|
|
2769
2755
|
continue;
|
|
2770
2756
|
}
|
|
2771
2757
|
}
|
|
2772
2758
|
if (M.data) {
|
|
2773
|
-
let
|
|
2759
|
+
let T = a[$] ? Array.from(a[$]) : [], k = M.data.replace("col:", "").toUpperCase();
|
|
2774
2760
|
if (M.isRowColCombine) {
|
|
2775
|
-
let
|
|
2776
|
-
|
|
2761
|
+
let A = y.map((I) => p[I].data.replace("col:", "").toUpperCase()), _ = [];
|
|
2762
|
+
T.forEach((I, P) => {
|
|
2777
2763
|
let H = {
|
|
2778
2764
|
...M,
|
|
2779
|
-
combineKeys:
|
|
2780
|
-
combineValues:
|
|
2765
|
+
combineKeys: A,
|
|
2766
|
+
combineValues: a[I]
|
|
2781
2767
|
};
|
|
2782
2768
|
_.push(H);
|
|
2783
2769
|
}), V.splice(M.col, 1, ..._);
|
|
2784
|
-
} else if (
|
|
2785
|
-
|
|
2786
|
-
let I =
|
|
2770
|
+
} else if (T.length)
|
|
2771
|
+
T.forEach((A, _) => {
|
|
2772
|
+
let I = a[`${$}-${A}`], P = [];
|
|
2787
2773
|
I.forEach((H) => {
|
|
2788
|
-
let
|
|
2774
|
+
let R = {
|
|
2789
2775
|
...M
|
|
2790
2776
|
};
|
|
2791
|
-
delete
|
|
2792
|
-
}), V.splice(M.col, 1, ...
|
|
2777
|
+
delete R.combineKeys, delete R.combineValues, delete R.isRowColCombine, H[k] ? (R.text = H[k], R.colData = H) : R.text = "", P.push(R);
|
|
2778
|
+
}), V.splice(M.col, 1, ...P);
|
|
2793
2779
|
});
|
|
2794
2780
|
else {
|
|
2795
|
-
let
|
|
2796
|
-
|
|
2781
|
+
let A = [];
|
|
2782
|
+
d.forEach((_) => {
|
|
2797
2783
|
let I = {
|
|
2798
2784
|
...M
|
|
2799
2785
|
};
|
|
2800
|
-
delete I.combineKeys, delete I.combineValues, delete I.isRowColCombine, _[k] ? (I.text = _[k], I.colData = _) : I.text = "",
|
|
2801
|
-
}), V.splice(M.col, 1,
|
|
2786
|
+
delete I.combineKeys, delete I.combineValues, delete I.isRowColCombine, _[k] ? (I.text = _[k], I.colData = _) : I.text = "", A.push(I);
|
|
2787
|
+
}), V.splice(M.col, 1, ...A);
|
|
2802
2788
|
}
|
|
2803
2789
|
} else {
|
|
2804
|
-
const
|
|
2790
|
+
const T = {
|
|
2805
2791
|
...M,
|
|
2806
|
-
colData:
|
|
2792
|
+
colData: d[0]
|
|
2807
2793
|
};
|
|
2808
2794
|
if (M.colSpan === 0 && M.mergeTarget && M.mergeTarget.length === 2 && M.row === M.mergeTarget[0]) {
|
|
2809
|
-
let [_, I] = M.mergeTarget,
|
|
2810
|
-
|
|
2795
|
+
let [_, I] = M.mergeTarget, P = u.reduce((H, R) => H.concat(R), []).filter((H) => H.row === _ && H.col === I)[0];
|
|
2796
|
+
P && (P.colSpan += S - 1);
|
|
2811
2797
|
} else
|
|
2812
|
-
(!Array.isArray(M.mergeTarget) || M.mergeTarget.length !== 2) && (
|
|
2798
|
+
(!Array.isArray(M.mergeTarget) || M.mergeTarget.length !== 2) && (T.colSpan = S);
|
|
2813
2799
|
const k = {
|
|
2814
2800
|
...M,
|
|
2815
2801
|
colSpan: 0,
|
|
2816
2802
|
rowSpan: 0
|
|
2817
2803
|
};
|
|
2818
|
-
let
|
|
2819
|
-
V.splice(M.col, 1,
|
|
2804
|
+
let A = Array.from({ length: S - 1 }, () => cloneDeep(k));
|
|
2805
|
+
V.splice(M.col, 1, T, ...A);
|
|
2820
2806
|
}
|
|
2821
2807
|
}
|
|
2822
2808
|
}
|
|
@@ -2824,19 +2810,19 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2824
2810
|
});
|
|
2825
2811
|
}
|
|
2826
2812
|
function ne(O) {
|
|
2827
|
-
if (r.config &&
|
|
2828
|
-
|
|
2829
|
-
let { rowConfig: w, colConfig: u, config: l } = cloneDeep(r.config),
|
|
2830
|
-
|
|
2813
|
+
if (r.config && n.value) {
|
|
2814
|
+
n.value.innerHTML = "", console.time("transformConfig");
|
|
2815
|
+
let { rowConfig: w, colConfig: u, config: l } = cloneDeep(r.config), o = b(u), d = b(w);
|
|
2816
|
+
o && W(u, o, l, O), d && Y(w, d, l, O), computeCell(l), console.timeEnd("transformConfig"), console.time("renderReportByDom"), re(w, u, l, n), console.timeEnd("renderReportByDom");
|
|
2831
2817
|
}
|
|
2832
2818
|
}
|
|
2833
2819
|
function Q(O) {
|
|
2834
2820
|
const w = document.createElement("colgroup");
|
|
2835
2821
|
let u = 0;
|
|
2836
2822
|
return O.forEach((l) => {
|
|
2837
|
-
const
|
|
2838
|
-
u += l.size,
|
|
2839
|
-
}),
|
|
2823
|
+
const o = document.createElement("col");
|
|
2824
|
+
u += l.size, o.style.width = `${l.size}px`, w.appendChild(o);
|
|
2825
|
+
}), n.value && (n.value.style.width = `${u}px`), w;
|
|
2840
2826
|
}
|
|
2841
2827
|
function q(O, w) {
|
|
2842
2828
|
const u = document.createElement("td");
|
|
@@ -2856,35 +2842,35 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2856
2842
|
return [CellType.TEXT, CellType.FIELD, CellType.ICON, CellType.FUN].includes(w.type) && w.style && u.setAttribute("style", renderCellStyle(w.style)), u.innerText = l, u;
|
|
2857
2843
|
}
|
|
2858
2844
|
function re(O, w, u, l) {
|
|
2859
|
-
const
|
|
2860
|
-
l.value.appendChild(
|
|
2861
|
-
let
|
|
2862
|
-
const
|
|
2863
|
-
for (let
|
|
2864
|
-
const
|
|
2865
|
-
|
|
2866
|
-
for (let
|
|
2867
|
-
const U = u[
|
|
2868
|
-
if (
|
|
2869
|
-
const F = q(
|
|
2870
|
-
F.setAttribute("data-cell-data", `${
|
|
2845
|
+
const o = Q(w);
|
|
2846
|
+
l.value.appendChild(o);
|
|
2847
|
+
let d = 0;
|
|
2848
|
+
const p = document.createDocumentFragment();
|
|
2849
|
+
for (let y = 0; y < O.length; y++) {
|
|
2850
|
+
const a = O[y], S = document.createElement("tr");
|
|
2851
|
+
a.isFixed && (S.style.top = `${d - 1}px`, S.classList.add("fixed-row")), d += a.size, S.style.height = `${a.size}px`;
|
|
2852
|
+
for (let $ = 0; $ < w.length; $++) {
|
|
2853
|
+
const U = u[y][$];
|
|
2854
|
+
if (a && U && a.size > 0) {
|
|
2855
|
+
const F = q(a, U);
|
|
2856
|
+
F.setAttribute("data-cell-data", `${y}-${$}`), U.rowSpan === 0 || U.colSpan === 0 || S.appendChild(F);
|
|
2871
2857
|
}
|
|
2872
2858
|
}
|
|
2873
|
-
|
|
2859
|
+
p.appendChild(S);
|
|
2874
2860
|
}
|
|
2875
|
-
l.value.appendChild(
|
|
2861
|
+
l.value.appendChild(p);
|
|
2876
2862
|
}
|
|
2877
2863
|
async function Z() {
|
|
2878
2864
|
g.value = !0;
|
|
2879
2865
|
let O = await X(), w = ee(O);
|
|
2880
|
-
r.config.data.processData && (w = await getProcessData(r.config.data.processData, w,
|
|
2866
|
+
r.config.data.processData && (w = await getProcessData(r.config.data.processData, w, x.value)), ne(w), g.value = !1;
|
|
2881
2867
|
}
|
|
2882
2868
|
function ee(O) {
|
|
2883
2869
|
let w = {};
|
|
2884
2870
|
return Array.isArray(O) || (O = [O]), O.map(({ key: u, data: l }) => {
|
|
2885
|
-
let
|
|
2886
|
-
w[u] =
|
|
2887
|
-
}),
|
|
2871
|
+
let o = l.filter((d) => d);
|
|
2872
|
+
w[u] = o;
|
|
2873
|
+
}), e("updateData", {
|
|
2888
2874
|
key: r.config.id,
|
|
2889
2875
|
data: w
|
|
2890
2876
|
}), w;
|
|
@@ -2892,13 +2878,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2892
2878
|
async function X() {
|
|
2893
2879
|
if (r.config.data.source) {
|
|
2894
2880
|
let O = {};
|
|
2895
|
-
m.value && (O.params = cloneDeep(
|
|
2881
|
+
m.value && (O.params = cloneDeep(x.value)), s.value && (O.pageSize = f.pageSize, O.pageNumber = f.pageIndex);
|
|
2896
2882
|
let w = [];
|
|
2897
2883
|
for (let u = 0; u < r.config.data.source.length; u++) {
|
|
2898
|
-
const { key: l, url:
|
|
2899
|
-
if (
|
|
2900
|
-
const
|
|
2901
|
-
w.push({ key: l, data:
|
|
2884
|
+
const { key: l, url: o } = r.config.data.source[u];
|
|
2885
|
+
if (o) {
|
|
2886
|
+
const d = await getDateSourceData(o, O);
|
|
2887
|
+
w.push({ key: l, data: d.data }), s.value && (f.total = d.count || d.data.length);
|
|
2902
2888
|
}
|
|
2903
2889
|
}
|
|
2904
2890
|
return w;
|
|
@@ -2910,12 +2896,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2910
2896
|
let O = r.config.data.pageSizes.split(",").map((w) => parseInt(w));
|
|
2911
2897
|
f.pageSizes = Array.isArray(O) ? O : [10, 20, 50, 100, 200];
|
|
2912
2898
|
}
|
|
2913
|
-
|
|
2899
|
+
E = !0;
|
|
2914
2900
|
}
|
|
2915
2901
|
return onMounted(async () => {
|
|
2916
2902
|
j();
|
|
2917
2903
|
}), (O, w) => {
|
|
2918
|
-
const u = resolveComponent("el-button"), l = resolveComponent("el-pagination"),
|
|
2904
|
+
const u = resolveComponent("el-button"), l = resolveComponent("el-pagination"), o = resolveDirective("loading");
|
|
2919
2905
|
return openBlock(), createElementBlock("div", {
|
|
2920
2906
|
class: "yh-report-view-container",
|
|
2921
2907
|
style: normalizeStyle(unref(c))
|
|
@@ -2928,7 +2914,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2928
2914
|
unref(m) ? (openBlock(), createBlock(u, {
|
|
2929
2915
|
key: 0,
|
|
2930
2916
|
type: "primary",
|
|
2931
|
-
onClick:
|
|
2917
|
+
onClick: v
|
|
2932
2918
|
}, {
|
|
2933
2919
|
default: withCtx(() => [
|
|
2934
2920
|
createTextVNode(" 搜索 ")
|
|
@@ -2941,21 +2927,21 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2941
2927
|
withDirectives((openBlock(), createElementBlock("div", {
|
|
2942
2928
|
class: "yh-statement-table-container",
|
|
2943
2929
|
ref_key: "statementTableRef",
|
|
2944
|
-
ref:
|
|
2930
|
+
ref: i
|
|
2945
2931
|
}, [
|
|
2946
2932
|
createElementVNode("table", {
|
|
2947
2933
|
ref_key: "tableBodyRef",
|
|
2948
|
-
ref:
|
|
2934
|
+
ref: n
|
|
2949
2935
|
}, null, 512)
|
|
2950
2936
|
])), [
|
|
2951
|
-
[
|
|
2937
|
+
[o, g.value]
|
|
2952
2938
|
]),
|
|
2953
2939
|
unref(s) ? (openBlock(), createBlock(l, {
|
|
2954
2940
|
key: 0,
|
|
2955
2941
|
pageSize: f.pageSize,
|
|
2956
|
-
"onUpdate:pageSize": w[0] || (w[0] = (
|
|
2942
|
+
"onUpdate:pageSize": w[0] || (w[0] = (d) => f.pageSize = d),
|
|
2957
2943
|
"current-page": f.pageIndex,
|
|
2958
|
-
"onUpdate:currentPage": w[1] || (w[1] = (
|
|
2944
|
+
"onUpdate:currentPage": w[1] || (w[1] = (d) => f.pageIndex = d),
|
|
2959
2945
|
"page-sizes": f.pageSizes,
|
|
2960
2946
|
total: f.total,
|
|
2961
2947
|
layout: "total, jumper, prev, pager, next, sizes"
|
|
@@ -2963,45 +2949,45 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
2963
2949
|
], 4);
|
|
2964
2950
|
};
|
|
2965
2951
|
}
|
|
2966
|
-
}), chartsTypeList = ["line", "rowBar", "bar", "scatter", "treemap", "label"], getChartData = async (
|
|
2952
|
+
}), chartsTypeList = ["line", "rowBar", "bar", "scatter", "treemap", "label"], getChartData = async (t, e) => {
|
|
2967
2953
|
const {
|
|
2968
2954
|
data: { source: r },
|
|
2969
|
-
seriesData:
|
|
2970
|
-
xAisData:
|
|
2955
|
+
seriesData: i,
|
|
2956
|
+
xAisData: n,
|
|
2971
2957
|
yAisData: c,
|
|
2972
2958
|
type: s
|
|
2973
|
-
} =
|
|
2959
|
+
} = t;
|
|
2974
2960
|
let m = {
|
|
2975
|
-
...
|
|
2961
|
+
...e
|
|
2976
2962
|
};
|
|
2977
2963
|
for (let f = 0; f < r.length; f++) {
|
|
2978
|
-
const { key:
|
|
2979
|
-
m[
|
|
2964
|
+
const { key: x, url: C } = r[f], E = (await getDateSourceData(C, {})).data;
|
|
2965
|
+
m[x] = E;
|
|
2980
2966
|
}
|
|
2981
2967
|
if (Object.keys(m).length === 0)
|
|
2982
2968
|
return !1;
|
|
2983
|
-
if (
|
|
2984
|
-
const
|
|
2985
|
-
|
|
2986
|
-
C.data =
|
|
2969
|
+
if (i) {
|
|
2970
|
+
const x = new Function("allData", i)(m);
|
|
2971
|
+
t.option.series.forEach((C) => {
|
|
2972
|
+
C.data = x;
|
|
2987
2973
|
});
|
|
2988
2974
|
} else
|
|
2989
|
-
|
|
2975
|
+
t.option = setYAxisData(t, m);
|
|
2990
2976
|
if (chartsTypeList.includes(s)) {
|
|
2991
|
-
if (
|
|
2992
|
-
const f = new Function("allData",
|
|
2993
|
-
|
|
2977
|
+
if (n) {
|
|
2978
|
+
const f = new Function("allData", n);
|
|
2979
|
+
t.option.xAxis.data = f(m);
|
|
2994
2980
|
} else
|
|
2995
|
-
|
|
2981
|
+
t.option = setXAxisData(t, m);
|
|
2996
2982
|
if (c) {
|
|
2997
|
-
const
|
|
2998
|
-
|
|
2983
|
+
const x = new Function("allData", c)(m);
|
|
2984
|
+
t.option.yAxis.data = x;
|
|
2999
2985
|
}
|
|
3000
2986
|
}
|
|
3001
|
-
}, chartItem_vue_vue_type_style_index_0_scoped_5bbf4c7d_lang = "", _export_sfc = (
|
|
3002
|
-
const r =
|
|
3003
|
-
for (const [
|
|
3004
|
-
r[
|
|
2987
|
+
}, chartItem_vue_vue_type_style_index_0_scoped_5bbf4c7d_lang = "", _export_sfc = (t, e) => {
|
|
2988
|
+
const r = t.__vccOpts || t;
|
|
2989
|
+
for (const [i, n] of e)
|
|
2990
|
+
r[i] = n;
|
|
3005
2991
|
return r;
|
|
3006
2992
|
}, _sfc_main$2 = {
|
|
3007
2993
|
__name: "chart-item",
|
|
@@ -3015,53 +3001,53 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3015
3001
|
default: !1
|
|
3016
3002
|
}
|
|
3017
3003
|
},
|
|
3018
|
-
setup(
|
|
3019
|
-
const r =
|
|
3004
|
+
setup(t, { expose: e }) {
|
|
3005
|
+
const r = t, i = ref(), n = ref(null);
|
|
3020
3006
|
let c = null;
|
|
3021
3007
|
watch(
|
|
3022
3008
|
() => r.chartData.option,
|
|
3023
|
-
(
|
|
3024
|
-
c && c.setOption(
|
|
3009
|
+
(E) => {
|
|
3010
|
+
c && c.setOption(E, {
|
|
3025
3011
|
notMerge: !0
|
|
3026
3012
|
});
|
|
3027
3013
|
},
|
|
3028
3014
|
{ deep: !0 }
|
|
3029
3015
|
), watch(
|
|
3030
3016
|
() => r.chartData.isSuspend,
|
|
3031
|
-
(
|
|
3032
|
-
|
|
3017
|
+
(E) => {
|
|
3018
|
+
E && C();
|
|
3033
3019
|
},
|
|
3034
3020
|
{ deep: !0 }
|
|
3035
3021
|
);
|
|
3036
|
-
const s = ref(!1), m = (
|
|
3037
|
-
if (
|
|
3038
|
-
const
|
|
3039
|
-
f(
|
|
3022
|
+
const s = ref(!1), m = (E) => {
|
|
3023
|
+
if (n.value = E, E && Object.keys(E).length > 0) {
|
|
3024
|
+
const v = cloneDeep(r.chartData);
|
|
3025
|
+
f(v);
|
|
3040
3026
|
}
|
|
3041
|
-
}, f = async (
|
|
3042
|
-
r.isView && await getChartData(
|
|
3043
|
-
|
|
3044
|
-
}), c.setOption(
|
|
3045
|
-
},
|
|
3046
|
-
s.value = !0, c = echarts.init(
|
|
3047
|
-
let
|
|
3048
|
-
await f(
|
|
3027
|
+
}, f = async (E) => {
|
|
3028
|
+
r.isView && await getChartData(E, n.value), E.type === "label" && E.option.series.forEach((v) => {
|
|
3029
|
+
v.renderItem = renderItem;
|
|
3030
|
+
}), c.setOption(E.option), s.value = !1;
|
|
3031
|
+
}, x = async () => {
|
|
3032
|
+
s.value = !0, c = echarts.init(i.value);
|
|
3033
|
+
let E = cloneDeep(r.chartData);
|
|
3034
|
+
await f(E);
|
|
3049
3035
|
}, C = () => {
|
|
3050
3036
|
nextTick(() => {
|
|
3051
3037
|
c.resize();
|
|
3052
3038
|
});
|
|
3053
3039
|
};
|
|
3054
|
-
return
|
|
3040
|
+
return e({
|
|
3055
3041
|
setOutData: m
|
|
3056
3042
|
}), onMounted(() => {
|
|
3057
|
-
|
|
3043
|
+
x(), window.addEventListener("resize", C);
|
|
3058
3044
|
}), onUnmounted(() => {
|
|
3059
3045
|
window.removeEventListener("resize", C);
|
|
3060
|
-
}), (
|
|
3046
|
+
}), (E, v) => {
|
|
3061
3047
|
const g = resolveDirective("loading");
|
|
3062
3048
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
3063
3049
|
ref_key: "chartRef",
|
|
3064
|
-
ref:
|
|
3050
|
+
ref: i,
|
|
3065
3051
|
"element-loading-text": "正在加载数据......",
|
|
3066
3052
|
class: "chart chart-common"
|
|
3067
3053
|
}, null, 512)), [
|
|
@@ -3076,8 +3062,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3076
3062
|
config: null,
|
|
3077
3063
|
outData: null
|
|
3078
3064
|
},
|
|
3079
|
-
setup(
|
|
3080
|
-
const r =
|
|
3065
|
+
setup(t, { expose: e }) {
|
|
3066
|
+
const r = t, i = ref();
|
|
3081
3067
|
watch(
|
|
3082
3068
|
() => r.outData,
|
|
3083
3069
|
(s) => {
|
|
@@ -3085,7 +3071,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3085
3071
|
},
|
|
3086
3072
|
{ deep: !0 }
|
|
3087
3073
|
);
|
|
3088
|
-
const
|
|
3074
|
+
const n = computed(() => {
|
|
3089
3075
|
let s = r.config.widthUnit || "px", m = r.config.heightUnit || "px";
|
|
3090
3076
|
if (r.config.isSuspend) {
|
|
3091
3077
|
let f = {
|
|
@@ -3103,19 +3089,19 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3103
3089
|
return s === "%" ? f.width = `calc( ${r.config.width}${s} - 10px)` : f.width = `${r.config.width - 10}${s}`, f;
|
|
3104
3090
|
}
|
|
3105
3091
|
});
|
|
3106
|
-
return
|
|
3092
|
+
return e({
|
|
3107
3093
|
setOutData: (s) => {
|
|
3108
3094
|
var m;
|
|
3109
|
-
(m =
|
|
3095
|
+
(m = i.value) == null || m.setOutData(s);
|
|
3110
3096
|
}
|
|
3111
3097
|
}), (s, m) => (openBlock(), createElementBlock("div", {
|
|
3112
3098
|
class: "yh-report-view-container chart-view-item",
|
|
3113
|
-
style: normalizeStyle(unref(
|
|
3099
|
+
style: normalizeStyle(unref(n))
|
|
3114
3100
|
}, [
|
|
3115
3101
|
createVNode(chartItem, {
|
|
3116
3102
|
"is-view": "",
|
|
3117
3103
|
ref_key: "chartItemRef",
|
|
3118
|
-
ref:
|
|
3104
|
+
ref: i,
|
|
3119
3105
|
"chart-data": r.config
|
|
3120
3106
|
}, null, 8, ["chart-data"])
|
|
3121
3107
|
], 4));
|
|
@@ -3128,10 +3114,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3128
3114
|
id: null
|
|
3129
3115
|
},
|
|
3130
3116
|
emits: ["updateData"],
|
|
3131
|
-
setup(
|
|
3132
|
-
const r =
|
|
3117
|
+
setup(t, { emit: e }) {
|
|
3118
|
+
const r = t;
|
|
3133
3119
|
ref();
|
|
3134
|
-
const
|
|
3120
|
+
const i = ref(!1), n = ref(!1), c = ref(""), s = ref(), m = ref(), f = ref([]), x = {};
|
|
3135
3121
|
watch(
|
|
3136
3122
|
() => r.id,
|
|
3137
3123
|
(g) => {
|
|
@@ -3139,17 +3125,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3139
3125
|
}
|
|
3140
3126
|
);
|
|
3141
3127
|
function C(g) {
|
|
3142
|
-
g ? (
|
|
3143
|
-
|
|
3128
|
+
g ? (n.value = !1, i.value = !0, getConfig(g).then(async (b) => {
|
|
3129
|
+
let { name: N, remoteOptions: B } = b;
|
|
3130
|
+
c.value = N, f.value = B;
|
|
3144
3131
|
}).finally(() => {
|
|
3145
|
-
|
|
3146
|
-
})) :
|
|
3132
|
+
i.value = !1;
|
|
3133
|
+
})) : n.value = !0;
|
|
3147
3134
|
}
|
|
3148
|
-
const
|
|
3149
|
-
function
|
|
3135
|
+
const E = ref(!1);
|
|
3136
|
+
function v(g) {
|
|
3150
3137
|
var b;
|
|
3151
|
-
|
|
3152
|
-
N.setOutData(
|
|
3138
|
+
x[g.key] = g.data, (b = m.value) == null || b.forEach((N) => {
|
|
3139
|
+
N.setOutData(x);
|
|
3153
3140
|
});
|
|
3154
3141
|
}
|
|
3155
3142
|
return onMounted(() => {
|
|
@@ -3158,7 +3145,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3158
3145
|
const N = resolveDirective("loading");
|
|
3159
3146
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
3160
3147
|
createElementVNode("div", _hoisted_1, toDisplayString(c.value), 1),
|
|
3161
|
-
|
|
3148
|
+
n.value ? (openBlock(), createBlock(unref(ElEmpty), {
|
|
3162
3149
|
key: 1,
|
|
3163
3150
|
class: "yh-statement-table-viewer-container",
|
|
3164
3151
|
description: "获取配置时出现错误"
|
|
@@ -3166,7 +3153,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3166
3153
|
default: withCtx(() => [
|
|
3167
3154
|
createVNode(unref(ElButton), {
|
|
3168
3155
|
type: "primary",
|
|
3169
|
-
onClick: b[0] || (b[0] = (
|
|
3156
|
+
onClick: b[0] || (b[0] = (B) => g.$router.back())
|
|
3170
3157
|
}, {
|
|
3171
3158
|
default: withCtx(() => [
|
|
3172
3159
|
createTextVNode(" 返回 ")
|
|
@@ -3181,15 +3168,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3181
3168
|
ref_key: "viewWrapper",
|
|
3182
3169
|
ref: s
|
|
3183
3170
|
}, [
|
|
3184
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (
|
|
3185
|
-
|
|
3171
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(f.value, (B, J) => (openBlock(), createElementBlock(Fragment, null, [
|
|
3172
|
+
B.type === "report" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
3186
3173
|
key: 0,
|
|
3187
3174
|
index: J,
|
|
3188
|
-
config:
|
|
3189
|
-
onUpdateData:
|
|
3175
|
+
config: B,
|
|
3176
|
+
onUpdateData: v
|
|
3190
3177
|
}, null, 8, ["index", "config"])) : (openBlock(), createBlock(_sfc_main$1, {
|
|
3191
3178
|
key: 1,
|
|
3192
|
-
config:
|
|
3179
|
+
config: B,
|
|
3193
3180
|
ref_for: !0,
|
|
3194
3181
|
ref_key: "chartViewItemRef",
|
|
3195
3182
|
ref: m,
|
|
@@ -3197,18 +3184,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3197
3184
|
}, null, 8, ["config", "index"]))
|
|
3198
3185
|
], 64))), 256)),
|
|
3199
3186
|
withDirectives(createElementVNode("div", _hoisted_2, _hoisted_4, 512), [
|
|
3200
|
-
[vShow,
|
|
3187
|
+
[vShow, E.value]
|
|
3201
3188
|
])
|
|
3202
3189
|
])), [
|
|
3203
|
-
[N,
|
|
3190
|
+
[N, i.value]
|
|
3204
3191
|
])
|
|
3205
3192
|
], 64);
|
|
3206
3193
|
};
|
|
3207
3194
|
}
|
|
3208
3195
|
}), reportRun_vue_vue_type_style_index_0_lang = "", index = {
|
|
3209
|
-
install(
|
|
3210
|
-
let { router: r, pinia:
|
|
3211
|
-
|
|
3196
|
+
install(t, e) {
|
|
3197
|
+
let { router: r, pinia: i, isAdmin: n = !1 } = e;
|
|
3198
|
+
n && (r.addRoute("Index", {
|
|
3212
3199
|
path: "statement/list",
|
|
3213
3200
|
name: "报表列表",
|
|
3214
3201
|
meta: {
|
|
@@ -3216,7 +3203,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3216
3203
|
title: "报表列表",
|
|
3217
3204
|
icon: "iconfont icon-s-grid"
|
|
3218
3205
|
},
|
|
3219
|
-
component: () => import("./StatementList-
|
|
3206
|
+
component: () => import("./StatementList-5d581f19.mjs")
|
|
3220
3207
|
}), r.addRoute("Index", {
|
|
3221
3208
|
path: "statement/design/:id",
|
|
3222
3209
|
name: "报表设计",
|
|
@@ -3225,16 +3212,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3225
3212
|
title: "报表设计",
|
|
3226
3213
|
icon: "iconfont icon-s-grid"
|
|
3227
3214
|
},
|
|
3228
|
-
component: () => import("./StatementDesign-
|
|
3215
|
+
component: () => import("./StatementDesign-b4a2f41e.mjs")
|
|
3229
3216
|
})), r.addRoute("Index", {
|
|
3230
|
-
path: "
|
|
3217
|
+
path: "innerStatementdetail/:id",
|
|
3231
3218
|
name: "后台报表查看",
|
|
3232
3219
|
meta: {
|
|
3233
|
-
id: "
|
|
3220
|
+
id: "innerStatementdetail",
|
|
3234
3221
|
title: "后台报表查看",
|
|
3235
3222
|
icon: "iconfont icon-s-grid"
|
|
3236
3223
|
},
|
|
3237
|
-
component: () => import("./StatementDetail-
|
|
3224
|
+
component: () => import("./StatementDetail-edc9161f.mjs")
|
|
3238
3225
|
}), r.addRoute({
|
|
3239
3226
|
path: "/statementdetail/:id",
|
|
3240
3227
|
name: "报表查看",
|
|
@@ -3243,29 +3230,29 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3243
3230
|
title: "报表查看",
|
|
3244
3231
|
icon: "iconfont icon-s-grid"
|
|
3245
3232
|
},
|
|
3246
|
-
component: () => import("./StatementDetail-
|
|
3233
|
+
component: () => import("./StatementDetail-edc9161f.mjs")
|
|
3247
3234
|
});
|
|
3248
3235
|
}
|
|
3249
3236
|
};
|
|
3250
3237
|
let dynamicReportIndex = 0;
|
|
3251
|
-
function dynamicReportView(
|
|
3238
|
+
function dynamicReportView(t) {
|
|
3252
3239
|
return dynamicReportIndex++, async () => Promise.resolve(
|
|
3253
3240
|
defineComponent({
|
|
3254
|
-
name:
|
|
3241
|
+
name: t || `report${dynamicReportIndex}`,
|
|
3255
3242
|
data() {
|
|
3256
3243
|
return {
|
|
3257
3244
|
id: ""
|
|
3258
3245
|
};
|
|
3259
3246
|
},
|
|
3260
3247
|
activated() {
|
|
3261
|
-
var
|
|
3262
|
-
(
|
|
3248
|
+
var e;
|
|
3249
|
+
(e = document.querySelector(".main-container")) == null || e.classList.add("statement-design-main");
|
|
3263
3250
|
},
|
|
3264
3251
|
deactivated() {
|
|
3265
|
-
var
|
|
3266
|
-
(
|
|
3252
|
+
var e;
|
|
3253
|
+
(e = document.querySelector(".main-container")) == null || e.classList.add("statement-design-main");
|
|
3267
3254
|
},
|
|
3268
|
-
render(
|
|
3255
|
+
render(e) {
|
|
3269
3256
|
return h("section", { class: "statement-detail-container" }, [h(_sfc_main, { id: this.id })]);
|
|
3270
3257
|
},
|
|
3271
3258
|
mounted() {
|
|
@@ -3297,7 +3284,6 @@ export {
|
|
|
3297
3284
|
dynamicReportView as n,
|
|
3298
3285
|
parseExpression as p,
|
|
3299
3286
|
renderCellStyle as r,
|
|
3300
|
-
save as s
|
|
3301
|
-
validateAndCompleteOptions as v
|
|
3287
|
+
save as s
|
|
3302
3288
|
};
|
|
3303
|
-
//# sourceMappingURL=index-
|
|
3289
|
+
//# sourceMappingURL=index-0e5f0fbf.mjs.map
|