yh-report 2.4.113 → 2.4.114
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-CifyKUGu.mjs → StatementDesign-Cxh5YK4D.mjs} +3 -4
- package/{StatementDesign-CifyKUGu.mjs.map → StatementDesign-Cxh5YK4D.mjs.map} +1 -1
- package/{StatementDetail-C3ewsmAA.mjs → StatementDetail-Cx7VdXGa.mjs} +2 -2
- package/{StatementDetail-C3ewsmAA.mjs.map → StatementDetail-Cx7VdXGa.mjs.map} +1 -1
- package/{StatementList-D5yfC4Bs.mjs → StatementList-DcYuvG-K.mjs} +2 -2
- package/{StatementList-D5yfC4Bs.mjs.map → StatementList-DcYuvG-K.mjs.map} +1 -1
- package/{index-B3P0BC8Z.mjs → index-Dm_dNt8a.mjs} +1261 -1236
- package/index-Dm_dNt8a.mjs.map +1 -0
- package/index.es.js +1 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/index-B3P0BC8Z.mjs.map +0 -1
|
@@ -61,16 +61,16 @@ function migrateBatchRender(t) {
|
|
|
61
61
|
delete t.batchRender;
|
|
62
62
|
}
|
|
63
63
|
function completeBasicReportProperties(t) {
|
|
64
|
-
const { id: e, type: r, tableConfig: n, data: o, ...i } = t, { id: a, type: s, tableConfig: l, data: c, ...u } = defaultReport,
|
|
65
|
-
for (const
|
|
66
|
-
if (!Object.hasOwn(u,
|
|
67
|
-
i[
|
|
64
|
+
const { id: e, type: r, tableConfig: n, data: o, ...i } = t, { id: a, type: s, tableConfig: l, data: c, ...u } = defaultReport, f = { ...t };
|
|
65
|
+
for (const d in u) {
|
|
66
|
+
if (!Object.hasOwn(u, d)) continue;
|
|
67
|
+
i[d] === void 0 && (f[d] = u[d]);
|
|
68
68
|
}
|
|
69
|
-
for (const
|
|
70
|
-
if (!Object.hasOwn(c,
|
|
71
|
-
o[
|
|
69
|
+
for (const d in c) {
|
|
70
|
+
if (!Object.hasOwn(c, d)) continue;
|
|
71
|
+
o[d] === void 0 && (f.data[d] = c[d]);
|
|
72
72
|
}
|
|
73
|
-
return
|
|
73
|
+
return f;
|
|
74
74
|
}
|
|
75
75
|
function validateAndCompleteTableConfig(t) {
|
|
76
76
|
t.rowConfig.length === 0 && (t.rowConfig = Array.from({ length: 5 }, (n, o) => ({
|
|
@@ -166,7 +166,7 @@ const TypeItems = ref([
|
|
|
166
166
|
c < 10 && (c = 10), c > 15 && (c = 15);
|
|
167
167
|
let u = a * 0.5;
|
|
168
168
|
u < 60 && (u = 60);
|
|
169
|
-
const
|
|
169
|
+
const f = (i - c * 2 - c * (l - 1)) / l, d = 8, p = c + r * (f + c), m = (e.getHeight() - u) / 2;
|
|
170
170
|
return {
|
|
171
171
|
type: "group",
|
|
172
172
|
children: [
|
|
@@ -175,9 +175,9 @@ const TypeItems = ref([
|
|
|
175
175
|
shape: {
|
|
176
176
|
x: p,
|
|
177
177
|
y: m,
|
|
178
|
-
width:
|
|
178
|
+
width: f,
|
|
179
179
|
height: u,
|
|
180
|
-
r:
|
|
180
|
+
r: d
|
|
181
181
|
},
|
|
182
182
|
style: {
|
|
183
183
|
fill: s,
|
|
@@ -200,7 +200,7 @@ ${n}`,
|
|
|
200
200
|
align: "center",
|
|
201
201
|
verticalAlign: "middle"
|
|
202
202
|
},
|
|
203
|
-
position: [p +
|
|
203
|
+
position: [p + f / 2, m + u / 2]
|
|
204
204
|
}
|
|
205
205
|
]
|
|
206
206
|
};
|
|
@@ -721,7 +721,14 @@ ${n}`,
|
|
|
721
721
|
} else
|
|
722
722
|
a = o.map((s) => s[i]);
|
|
723
723
|
return t.type == "rowBar" ? r.yAxis.data = a : ["line", "bar"].includes(t.type) ? r.xAxis.data = a : t.type == "radar" && (r.radar.indicator = a), r;
|
|
724
|
-
}
|
|
724
|
+
};
|
|
725
|
+
function mergeSeriesData(t, e) {
|
|
726
|
+
return !Array.isArray(t) || t.length === 0 || !t.some((n) => n && typeof n == "object" && !Array.isArray(n)) ? e : e.map((n, o) => {
|
|
727
|
+
const i = t[o];
|
|
728
|
+
return !i || typeof i != "object" || Array.isArray(i) ? n : n && typeof n == "object" && !Array.isArray(n) ? { ...i, ...n } : { ...i, value: n };
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
const setYAxisData = (t, e) => {
|
|
725
732
|
let { option: r } = t, { yDataId: n } = r;
|
|
726
733
|
if (n === void 0)
|
|
727
734
|
return console.error("请设置 Y 轴数据"), !1;
|
|
@@ -735,22 +742,21 @@ ${n}`,
|
|
|
735
742
|
} else
|
|
736
743
|
o = o.map((a) => a[i]);
|
|
737
744
|
if (t.type == "radar") {
|
|
745
|
+
const a = r.series[0].data;
|
|
738
746
|
r.series[0].data = [];
|
|
739
|
-
for (let
|
|
740
|
-
let
|
|
741
|
-
|
|
742
|
-
let
|
|
747
|
+
for (let s of n) {
|
|
748
|
+
let l, c;
|
|
749
|
+
s.length === 3 ? (e[s[0]] && (l = e[s[0]][s[1]]), c = s[2]) : (l = e[s[0]], c = s[1]);
|
|
750
|
+
let u = [];
|
|
743
751
|
if (t.groupBy && o) {
|
|
744
|
-
let
|
|
745
|
-
|
|
746
|
-
let
|
|
747
|
-
|
|
748
|
-
}),
|
|
752
|
+
let f = {};
|
|
753
|
+
l.forEach((d) => {
|
|
754
|
+
let p = d[i], m = d[c];
|
|
755
|
+
m = parseFloat(m), m = isNaN(m) ? 0 : m, p && !isNaN(m) && (f[p] || (f[p] = 0), f[p] += m);
|
|
756
|
+
}), u = o.map((d) => f[d]);
|
|
749
757
|
} else
|
|
750
|
-
|
|
751
|
-
t.orderBy && t.orderBy !== "NONE" && (
|
|
752
|
-
value: c
|
|
753
|
-
});
|
|
758
|
+
u = l.map((f) => f[c]);
|
|
759
|
+
t.orderBy && t.orderBy !== "NONE" && (u = u.sort((f, d) => t.orderBy === "ASC" ? f - d : d - f), !isNaN(t.cutLength) && t.cutLength > 0 && (u = u.slice(0, t.cutLength))), r.series[0].data.push(...mergeSeriesData(a, [{ value: u }]));
|
|
754
760
|
}
|
|
755
761
|
} else if (t.type == "treemap") {
|
|
756
762
|
if (n && n.length) {
|
|
@@ -769,67 +775,69 @@ ${n}`,
|
|
|
769
775
|
for (let s = 0; s < n.length; s++) {
|
|
770
776
|
let l = n[s], c, u;
|
|
771
777
|
l.length === 3 ? (e[l[0]] && (c = e[l[0]][l[1]]), u = l[2]) : (c = e[l[0]], u = l[1]);
|
|
772
|
-
let
|
|
773
|
-
|
|
774
|
-
|
|
778
|
+
let f = cloneDeep(a[s]);
|
|
779
|
+
f || (f = cloneDeep(a[s % a.length]));
|
|
780
|
+
const d = f.data;
|
|
781
|
+
f.data = [];
|
|
782
|
+
let p = [];
|
|
775
783
|
if (c && i && o) {
|
|
776
784
|
switch (t.type) {
|
|
777
785
|
case "line":
|
|
778
786
|
case "rowBar":
|
|
779
787
|
case "bar":
|
|
780
788
|
if (t.groupBy) {
|
|
781
|
-
let
|
|
782
|
-
c.forEach((
|
|
783
|
-
let
|
|
784
|
-
|
|
785
|
-
}),
|
|
789
|
+
let m = {};
|
|
790
|
+
c.forEach((g) => {
|
|
791
|
+
let _ = g[i], E = g[u];
|
|
792
|
+
E = parseFloat(E), E = isNaN(E) ? 0 : E, _ && !isNaN(E) && (m[_] || (m[_] = 0), m[_] += E);
|
|
793
|
+
}), p = o.map((g) => m[g]);
|
|
786
794
|
} else
|
|
787
|
-
|
|
788
|
-
t.orderBy && t.orderBy !== "NONE" && (
|
|
795
|
+
p = c.map((m) => m[u]);
|
|
796
|
+
t.orderBy && t.orderBy !== "NONE" && (p = p.sort((m, g) => t.orderBy === "ASC" ? m - g : g - m), !isNaN(t.cutLength) && t.cutLength > 0 && (p = p.slice(0, t.cutLength)));
|
|
789
797
|
break;
|
|
790
798
|
case "pie":
|
|
791
799
|
if (t.groupBy) {
|
|
792
|
-
let
|
|
793
|
-
c.forEach((
|
|
794
|
-
let
|
|
795
|
-
|
|
796
|
-
}),
|
|
800
|
+
let m = {};
|
|
801
|
+
c.forEach((g) => {
|
|
802
|
+
let _ = g[i], E = g[u];
|
|
803
|
+
E = parseFloat(E), E = isNaN(E) ? 0 : E, _ && !isNaN(E) && (m[_] || (m[_] = 0), m[_] += E);
|
|
804
|
+
}), p = o.map((g) => ({ value: m[g], name: g }));
|
|
797
805
|
} else
|
|
798
|
-
|
|
799
|
-
t.orderBy && t.orderBy !== "NONE" && (
|
|
806
|
+
p = c.map((m) => ({ value: m[u], name: m[i] }));
|
|
807
|
+
t.orderBy && t.orderBy !== "NONE" && (p = p.sort((m, g) => t.orderBy === "ASC" ? m - g : g - m), !isNaN(t.cutLength) && t.cutLength > 0 && (p = p.slice(0, t.cutLength)));
|
|
800
808
|
break;
|
|
801
809
|
case "scatter":
|
|
802
810
|
if (t.groupBy) {
|
|
803
|
-
let
|
|
804
|
-
c.forEach((
|
|
805
|
-
let
|
|
806
|
-
|
|
807
|
-
}),
|
|
811
|
+
let m = {};
|
|
812
|
+
c.forEach((g) => {
|
|
813
|
+
let _ = g[i], E = g[u];
|
|
814
|
+
E = parseFloat(E), E = isNaN(E) ? 0 : E, _ && !isNaN(E) && (m[_] || (m[_] = 0), m[_] += E);
|
|
815
|
+
}), p = o.map((g) => [g, m[g]]);
|
|
808
816
|
} else
|
|
809
|
-
|
|
810
|
-
t.orderBy && t.orderBy !== "NONE" && (
|
|
817
|
+
p = c.map((m) => [m[i], m[u]]);
|
|
818
|
+
t.orderBy && t.orderBy !== "NONE" && (p = p.sort((m, g) => t.orderBy === "ASC" ? m - g : g - m), !isNaN(t.cutLength) && t.cutLength > 0 && (p = p.slice(0, t.cutLength)));
|
|
811
819
|
break;
|
|
812
820
|
case "label":
|
|
813
821
|
if (t.groupBy) {
|
|
814
|
-
let
|
|
815
|
-
c.forEach((
|
|
816
|
-
let
|
|
817
|
-
|
|
818
|
-
}),
|
|
819
|
-
const
|
|
820
|
-
return [
|
|
822
|
+
let m = {};
|
|
823
|
+
c.forEach((g) => {
|
|
824
|
+
let _ = g[i], E = g[u];
|
|
825
|
+
E = parseFloat(E), E = isNaN(E) ? 0 : E, _ && !isNaN(E) && (m[_] || (m[_] = 0), m[_] += E);
|
|
826
|
+
}), p = o.map((g) => {
|
|
827
|
+
const _ = g ? g.split("").map((E) => E.charCodeAt()) : [];
|
|
828
|
+
return [m[g], _];
|
|
821
829
|
});
|
|
822
830
|
} else
|
|
823
|
-
|
|
824
|
-
const
|
|
825
|
-
return [
|
|
831
|
+
p = c.map((m) => {
|
|
832
|
+
const g = m[i] ? m[i].split("").map((_) => _.charCodeAt()) : [];
|
|
833
|
+
return [m[u], g];
|
|
826
834
|
});
|
|
827
|
-
t.orderBy && t.orderBy !== "NONE" && (
|
|
835
|
+
t.orderBy && t.orderBy !== "NONE" && (p = p.sort((m, g) => t.orderBy === "ASC" ? m - g : g - m), !isNaN(t.cutLength) && t.cutLength > 0 && (p = p.slice(0, t.cutLength))), f.renderItem = renderItem;
|
|
828
836
|
break;
|
|
829
837
|
}
|
|
830
|
-
|
|
838
|
+
f.data = mergeSeriesData(d, p);
|
|
831
839
|
}
|
|
832
|
-
r.series.push(
|
|
840
|
+
r.series.push(f);
|
|
833
841
|
}
|
|
834
842
|
}
|
|
835
843
|
return r;
|
|
@@ -867,16 +875,16 @@ function getConfig(t) {
|
|
|
867
875
|
if (s = JSON.parse(s), Array.isArray(s)) {
|
|
868
876
|
if (s.length && s[0].type === "tableSheet")
|
|
869
877
|
throw ElMessage.error("当前报表版本不支持老版本数据,如须使用老数据请不要升级本版"), useRouter().back(), new Error("当前报表版本不支持老版本数据,如须使用老数据请不要升级本版");
|
|
870
|
-
s = s.map((
|
|
878
|
+
s = s.map((f) => (ItemTypes.value.includes(f.type) || (f.type = "report"), f)), c = c.concat(s);
|
|
871
879
|
} else if (s && typeof s == "object" && Array.isArray(s.options)) {
|
|
872
|
-
let
|
|
873
|
-
if (
|
|
880
|
+
let f = s.options;
|
|
881
|
+
if (f.length && f[0].type === "tableSheet")
|
|
874
882
|
throw ElMessage.error("当前报表版本不支持老版本数据,如须使用老数据请不要升级本版"), useRouter().back(), new Error("当前报表版本不支持老版本数据,如须使用老数据请不要升级本版");
|
|
875
|
-
|
|
883
|
+
f = f.map((d) => (ItemTypes.value.includes(d.type) || (d.type = "report"), d)), c = c.concat(f), u = s.printConfig;
|
|
876
884
|
}
|
|
877
885
|
}
|
|
878
|
-
return l && (l = JSON.parse(l), Array.isArray(l) ? (l.forEach((
|
|
879
|
-
|
|
886
|
+
return l && (l = JSON.parse(l), Array.isArray(l) ? (l.forEach((f) => {
|
|
887
|
+
f.data || (f.data = { source: [] });
|
|
880
888
|
}), c = c.concat(l)) : l && typeof l == "object" && (u = l)), Promise.resolve({
|
|
881
889
|
id: n,
|
|
882
890
|
name: o,
|
|
@@ -946,13 +954,13 @@ function getLoopSourceColumns(t, e, r) {
|
|
|
946
954
|
if (t && e) {
|
|
947
955
|
const c = (o = t.rowConfig) == null ? void 0 : o[e.row];
|
|
948
956
|
if (c != null && c.loop && c.data) {
|
|
949
|
-
const
|
|
950
|
-
if ((i =
|
|
957
|
+
const f = r.find((d) => d.key === c.data);
|
|
958
|
+
if ((i = f == null ? void 0 : f.columns) != null && i.length) return f.columns;
|
|
951
959
|
}
|
|
952
960
|
const u = (a = t.colConfig) == null ? void 0 : a[e.col];
|
|
953
961
|
if (u != null && u.loop && u.data) {
|
|
954
|
-
const
|
|
955
|
-
if ((s =
|
|
962
|
+
const f = r.find((d) => d.key === u.data);
|
|
963
|
+
if ((s = f == null ? void 0 : f.columns) != null && s.length) return f.columns;
|
|
956
964
|
}
|
|
957
965
|
}
|
|
958
966
|
const n = r.find((c) => c.loopTable);
|
|
@@ -1121,32 +1129,32 @@ function getNeighborSide(t, e) {
|
|
|
1121
1129
|
function applyBorderOperation(t, e, r) {
|
|
1122
1130
|
if (!t || t.length === 0 || !e) return;
|
|
1123
1131
|
let n = 1 / 0, o = -1 / 0, i = 1 / 0, a = -1 / 0;
|
|
1124
|
-
t.forEach((
|
|
1125
|
-
|
|
1132
|
+
t.forEach((d) => {
|
|
1133
|
+
d.row < n && (n = d.row), d.row > o && (o = d.row), d.col < i && (i = d.col), d.col > a && (a = d.col);
|
|
1126
1134
|
});
|
|
1127
|
-
const s = new Set(t.map((
|
|
1128
|
-
var $, y,
|
|
1129
|
-
const _ = `${
|
|
1130
|
-
let
|
|
1131
|
-
|
|
1132
|
-
},
|
|
1133
|
-
t.forEach((
|
|
1134
|
-
var _,
|
|
1135
|
-
const p = (_ = e[
|
|
1135
|
+
const s = new Set(t.map((d) => `${d.row},${d.col}`)), l = /* @__PURE__ */ new Map(), c = r.color ? { style: r.style, color: r.color } : { style: r.style }, u = (d, p, m, g) => {
|
|
1136
|
+
var $, y, v;
|
|
1137
|
+
const _ = `${d},${p}`;
|
|
1138
|
+
let E = l.get(_);
|
|
1139
|
+
E || (E = { row: d, col: p, border: cloneBorder((v = (y = ($ = e[d]) == null ? void 0 : $[p]) == null ? void 0 : y.style) == null ? void 0 : v.border) }, l.set(_, E)), E.border[m] = { ...g };
|
|
1140
|
+
}, f = r.mode === "none";
|
|
1141
|
+
t.forEach((d) => {
|
|
1142
|
+
var _, E;
|
|
1143
|
+
const p = (_ = e[d.row]) == null ? void 0 : _[d.col];
|
|
1136
1144
|
if (!p || p.rowSpan === 0 || p.colSpan === 0) return;
|
|
1137
|
-
const m = cloneBorder((
|
|
1138
|
-
|
|
1145
|
+
const m = cloneBorder((E = p.style) == null ? void 0 : E.border);
|
|
1146
|
+
f ? (m.top = { style: "none" }, m.right = { style: "none" }, m.bottom = { style: "none" }, m.left = { style: "none" }) : getSidesForMode(d, n, o, i, a, r.mode).forEach((y) => {
|
|
1139
1147
|
m[y] = { ...c };
|
|
1140
|
-
}), l.set(`${
|
|
1141
|
-
var
|
|
1142
|
-
const y = getNeighborSide(
|
|
1148
|
+
}), l.set(`${d.row},${d.col}`, { row: d.row, col: d.col, border: m }), (f ? getSidesForMode(d, n, o, i, a, "outside") : getSidesForMode(d, n, o, i, a, r.mode)).forEach(($) => {
|
|
1149
|
+
var C;
|
|
1150
|
+
const y = getNeighborSide(d, $);
|
|
1143
1151
|
if (!y) return;
|
|
1144
|
-
const
|
|
1145
|
-
|
|
1152
|
+
const v = (C = e[y.row]) == null ? void 0 : C[y.col];
|
|
1153
|
+
v && (s.has(`${y.row},${y.col}`) || v.rowSpan === 0 || v.colSpan === 0 || u(y.row, y.col, y.side, f ? { style: "none" } : { ...c }));
|
|
1146
1154
|
});
|
|
1147
|
-
}), l.forEach(({ row:
|
|
1155
|
+
}), l.forEach(({ row: d, col: p, border: m }) => {
|
|
1148
1156
|
var _;
|
|
1149
|
-
const g = (_ = e[
|
|
1157
|
+
const g = (_ = e[d]) == null ? void 0 : _[p];
|
|
1150
1158
|
g && (g.style || (g.style = {}), g.style.border = m);
|
|
1151
1159
|
});
|
|
1152
1160
|
}
|
|
@@ -1215,13 +1223,13 @@ const exportExcel = async (t, e, r = "gray", n = 0) => {
|
|
|
1215
1223
|
if (c > 0 && (i.addRow([]), s += 1), l.type === "report" && ((u = l.reportConfig) != null && u.length))
|
|
1216
1224
|
s = writeReportConfigsToSheet(i, l.reportConfig, r, s);
|
|
1217
1225
|
else if (l.type === "image" && l.image) {
|
|
1218
|
-
const { base64:
|
|
1219
|
-
base64:
|
|
1226
|
+
const { base64: f, width: d, height: p } = l.image, m = o.addImage({
|
|
1227
|
+
base64: f.replace(/^data:image\/\w+;base64,/, ""),
|
|
1220
1228
|
extension: "png"
|
|
1221
1229
|
}), g = Math.ceil(p / 20) + 1;
|
|
1222
1230
|
for (let _ = 0; _ < g; _++)
|
|
1223
1231
|
i.addRow([]);
|
|
1224
|
-
i.addImage(m, { tl: { col: 0, row: s }, ext: { width:
|
|
1232
|
+
i.addImage(m, { tl: { col: 0, row: s }, ext: { width: d, height: p } }), s += g;
|
|
1225
1233
|
}
|
|
1226
1234
|
}), n.close(), o.xlsx.writeBuffer();
|
|
1227
1235
|
} catch (o) {
|
|
@@ -1232,25 +1240,25 @@ function writeReportConfigsToSheet(t, e, r, n) {
|
|
|
1232
1240
|
const o = [];
|
|
1233
1241
|
let i = n;
|
|
1234
1242
|
return e.forEach((a, s) => {
|
|
1235
|
-
var
|
|
1243
|
+
var f, d;
|
|
1236
1244
|
let { config: l, colConfig: c, rowConfig: u } = a;
|
|
1237
1245
|
for (let p = 0; p < l.length; p++) {
|
|
1238
1246
|
const m = u[p];
|
|
1239
1247
|
if (m && m.isHidden)
|
|
1240
1248
|
continue;
|
|
1241
1249
|
const g = c.filter((y) => y.isHidden).map((y) => y.index), _ = l[p].filter((y) => !g.includes(y.col));
|
|
1242
|
-
let
|
|
1243
|
-
p > 0 ? t.addRow(
|
|
1250
|
+
let E = _.map((y) => y.text);
|
|
1251
|
+
p > 0 ? t.addRow(E) : i === n ? t.getRow(n + 1).values = E : t.addRow(E);
|
|
1244
1252
|
const $ = t.getRow(i + p + 1);
|
|
1245
1253
|
m && m.size && !isNaN(m.size) ? m.size > 0 ? $.height = m.size < 25 ? 25 : m.size : $.hidden = !0 : $.height = 25;
|
|
1246
1254
|
for (let y = 0; y < _.length; y++) {
|
|
1247
|
-
const
|
|
1248
|
-
let { style:
|
|
1255
|
+
const v = _[y], C = $.getCell(y + 1);
|
|
1256
|
+
let { style: w, col: b, row: N, colSpan: R, rowSpan: A, format: k, formatType: F } = v;
|
|
1249
1257
|
const L = {};
|
|
1250
|
-
if (
|
|
1251
|
-
argb: "FF" + ((
|
|
1252
|
-
}),
|
|
1253
|
-
const T = normalizeBorder(
|
|
1258
|
+
if (w && w.color && (L.color = {
|
|
1259
|
+
argb: "FF" + ((f = w.color) == null ? void 0 : f.replace("#", ""))
|
|
1260
|
+
}), w && w.fontSize && (L.size = w.fontSize), w && w.fontFamily && (L.name = w.fontFamily), w && w.fontWeight && w.fontWeight === "bold" && (L.bold = !0), C.font = L, w && w.border) {
|
|
1261
|
+
const T = normalizeBorder(w.border);
|
|
1254
1262
|
if (T) {
|
|
1255
1263
|
const S = themeColors[r] || "#333333", I = (B) => {
|
|
1256
1264
|
if (!(!B || !B.style || B.style === "none"))
|
|
@@ -1259,30 +1267,30 @@ function writeReportConfigsToSheet(t, e, r, n) {
|
|
|
1259
1267
|
color: { argb: "FF" + (B.color || S).replace("#", "") }
|
|
1260
1268
|
};
|
|
1261
1269
|
};
|
|
1262
|
-
|
|
1270
|
+
C.border = {
|
|
1263
1271
|
top: I(T.top),
|
|
1264
1272
|
left: I(T.left),
|
|
1265
1273
|
bottom: I(T.bottom),
|
|
1266
1274
|
right: I(T.right)
|
|
1267
1275
|
};
|
|
1268
1276
|
}
|
|
1269
|
-
} else (!
|
|
1277
|
+
} else (!w || w.border !== !1) && (C.border = {
|
|
1270
1278
|
top: { style: "thin", color: { argb: "FF" + themeColors[r].replace("#", "") } },
|
|
1271
1279
|
left: { style: "thin", color: { argb: "FF" + themeColors[r].replace("#", "") } },
|
|
1272
1280
|
bottom: { style: "thin", color: { argb: "FF" + themeColors[r].replace("#", "") } },
|
|
1273
1281
|
right: { style: "thin", color: { argb: "FF" + themeColors[r].replace("#", "") } }
|
|
1274
1282
|
});
|
|
1275
|
-
if (
|
|
1276
|
-
|
|
1283
|
+
if (w && w.backgroundColor)
|
|
1284
|
+
C.fill = {
|
|
1277
1285
|
type: "pattern",
|
|
1278
1286
|
pattern: "solid",
|
|
1279
1287
|
fgColor: {
|
|
1280
|
-
argb: "FF" + ((
|
|
1288
|
+
argb: "FF" + ((d = w.backgroundColor) == null ? void 0 : d.replace("#", ""))
|
|
1281
1289
|
}
|
|
1282
1290
|
};
|
|
1283
1291
|
else {
|
|
1284
1292
|
const T = `${r}${p % 2}`;
|
|
1285
|
-
|
|
1293
|
+
C.fill = {
|
|
1286
1294
|
type: "pattern",
|
|
1287
1295
|
pattern: "solid",
|
|
1288
1296
|
fgColor: {
|
|
@@ -1295,7 +1303,7 @@ function writeReportConfigsToSheet(t, e, r, n) {
|
|
|
1295
1303
|
horizontal: "center",
|
|
1296
1304
|
wrapText: !0
|
|
1297
1305
|
};
|
|
1298
|
-
|
|
1306
|
+
w && w.textAlign && (O.horizontal = w.textAlign), w && w.verticalAlign && (O.vertical = w.verticalAlign === "center" ? "middle" : w.verticalAlign), C.alignment = O;
|
|
1299
1307
|
const x = A && !isNaN(A) && A > 1, D = R && !isNaN(R) && R > 1;
|
|
1300
1308
|
if (x || D) {
|
|
1301
1309
|
const T = i + p + 1, S = y + 1;
|
|
@@ -1304,7 +1312,7 @@ function writeReportConfigsToSheet(t, e, r, n) {
|
|
|
1304
1312
|
}
|
|
1305
1313
|
if (k && k === "number") {
|
|
1306
1314
|
let T = "", S = "";
|
|
1307
|
-
F && (F.numberUseGrouping && (T = F.numberUseGrouping), F.numberDecimal && (S = F.numberDecimal)),
|
|
1315
|
+
F && (F.numberUseGrouping && (T = F.numberUseGrouping), F.numberDecimal && (S = F.numberDecimal)), C.numFmt = generateNumFmt(T, S), C.value = Number(v.text);
|
|
1308
1316
|
}
|
|
1309
1317
|
}
|
|
1310
1318
|
}
|
|
@@ -1350,298 +1358,296 @@ var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u"
|
|
|
1350
1358
|
function getDefaultExportFromCjs(t) {
|
|
1351
1359
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1352
1360
|
}
|
|
1353
|
-
var dayjs_min = { exports: {} }
|
|
1354
|
-
function
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
})(
|
|
1359
|
-
var
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
return I ? new Date(Date.UTC(B[1], j, B[3] || 1, B[4] || 0, B[5] || 0, B[6] || 0, X)) : new Date(B[1], j, B[3] || 1, B[4] || 0, B[5] || 0, B[6] || 0, X);
|
|
1419
|
-
}
|
|
1361
|
+
var dayjs_min = { exports: {} };
|
|
1362
|
+
(function(t, e) {
|
|
1363
|
+
(function(r, n) {
|
|
1364
|
+
t.exports = n();
|
|
1365
|
+
})(commonjsGlobal, function() {
|
|
1366
|
+
var r = 1e3, n = 6e4, o = 36e5, i = "millisecond", a = "second", s = "minute", l = "hour", c = "day", u = "week", f = "month", d = "quarter", p = "year", m = "date", g = "Invalid Date", _ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, E = /\[([^\]]+)]|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, $ = { 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(O) {
|
|
1367
|
+
var x = ["th", "st", "nd", "rd"], D = O % 100;
|
|
1368
|
+
return "[" + O + (x[(D - 20) % 10] || x[D] || x[0]) + "]";
|
|
1369
|
+
} }, y = function(O, x, D) {
|
|
1370
|
+
var T = String(O);
|
|
1371
|
+
return !T || T.length >= x ? O : "" + Array(x + 1 - T.length).join(D) + O;
|
|
1372
|
+
}, v = { s: y, z: function(O) {
|
|
1373
|
+
var x = -O.utcOffset(), D = Math.abs(x), T = Math.floor(D / 60), S = D % 60;
|
|
1374
|
+
return (x <= 0 ? "+" : "-") + y(T, 2, "0") + ":" + y(S, 2, "0");
|
|
1375
|
+
}, m: function O(x, D) {
|
|
1376
|
+
if (x.date() < D.date()) return -O(D, x);
|
|
1377
|
+
var T = 12 * (D.year() - x.year()) + (D.month() - x.month()), S = x.clone().add(T, f), I = D - S < 0, B = x.clone().add(T + (I ? -1 : 1), f);
|
|
1378
|
+
return +(-(T + (D - S) / (I ? S - B : B - S)) || 0);
|
|
1379
|
+
}, a: function(O) {
|
|
1380
|
+
return O < 0 ? Math.ceil(O) || 0 : Math.floor(O);
|
|
1381
|
+
}, p: function(O) {
|
|
1382
|
+
return { M: f, y: p, w: u, d: c, D: m, h: l, m: s, s: a, ms: i, Q: d }[O] || String(O || "").toLowerCase().replace(/s$/, "");
|
|
1383
|
+
}, u: function(O) {
|
|
1384
|
+
return O === void 0;
|
|
1385
|
+
} }, C = "en", w = {};
|
|
1386
|
+
w[C] = $;
|
|
1387
|
+
var b = "$isDayjsObject", N = function(O) {
|
|
1388
|
+
return O instanceof F || !(!O || !O[b]);
|
|
1389
|
+
}, R = function O(x, D, T) {
|
|
1390
|
+
var S;
|
|
1391
|
+
if (!x) return C;
|
|
1392
|
+
if (typeof x == "string") {
|
|
1393
|
+
var I = x.toLowerCase();
|
|
1394
|
+
w[I] && (S = I), D && (w[I] = D, S = I);
|
|
1395
|
+
var B = x.split("-");
|
|
1396
|
+
if (!S && B.length > 1) return O(B[0]);
|
|
1397
|
+
} else {
|
|
1398
|
+
var j = x.name;
|
|
1399
|
+
w[j] = x, S = j;
|
|
1400
|
+
}
|
|
1401
|
+
return !T && S && (C = S), S || !T && C;
|
|
1402
|
+
}, A = function(O, x) {
|
|
1403
|
+
if (N(O)) return O.clone();
|
|
1404
|
+
var D = typeof x == "object" ? x : {};
|
|
1405
|
+
return D.date = O, D.args = arguments, new F(D);
|
|
1406
|
+
}, k = v;
|
|
1407
|
+
k.l = R, k.i = N, k.w = function(O, x) {
|
|
1408
|
+
return A(O, { locale: x.$L, utc: x.$u, x: x.$x, $offset: x.$offset });
|
|
1409
|
+
};
|
|
1410
|
+
var F = function() {
|
|
1411
|
+
function O(D) {
|
|
1412
|
+
this.$L = R(D.locale, null, !0), this.parse(D), this.$x = this.$x || D.x || {}, this[b] = !0;
|
|
1413
|
+
}
|
|
1414
|
+
var x = O.prototype;
|
|
1415
|
+
return x.parse = function(D) {
|
|
1416
|
+
this.$d = function(T) {
|
|
1417
|
+
var S = T.date, I = T.utc;
|
|
1418
|
+
if (S === null) return /* @__PURE__ */ new Date(NaN);
|
|
1419
|
+
if (k.u(S)) return /* @__PURE__ */ new Date();
|
|
1420
|
+
if (S instanceof Date) return new Date(S);
|
|
1421
|
+
if (typeof S == "string" && !/Z$/i.test(S)) {
|
|
1422
|
+
var B = S.match(_);
|
|
1423
|
+
if (B) {
|
|
1424
|
+
var j = B[2] - 1 || 0, X = (B[7] || "0").substring(0, 3);
|
|
1425
|
+
return I ? new Date(Date.UTC(B[1], j, B[3] || 1, B[4] || 0, B[5] || 0, B[6] || 0, X)) : new Date(B[1], j, B[3] || 1, B[4] || 0, B[5] || 0, B[6] || 0, X);
|
|
1420
1426
|
}
|
|
1421
|
-
return new Date(S);
|
|
1422
|
-
}(D), this.init();
|
|
1423
|
-
}, x.init = function() {
|
|
1424
|
-
var D = this.$d;
|
|
1425
|
-
this.$y = D.getFullYear(), this.$M = D.getMonth(), this.$D = D.getDate(), this.$W = D.getDay(), this.$H = D.getHours(), this.$m = D.getMinutes(), this.$s = D.getSeconds(), this.$ms = D.getMilliseconds();
|
|
1426
|
-
}, x.$utils = function() {
|
|
1427
|
-
return k;
|
|
1428
|
-
}, x.isValid = function() {
|
|
1429
|
-
return this.$d.toString() !== g;
|
|
1430
|
-
}, x.isSame = function(D, T) {
|
|
1431
|
-
var S = A(D);
|
|
1432
|
-
return this.startOf(T) <= S && S <= this.endOf(T);
|
|
1433
|
-
}, x.isAfter = function(D, T) {
|
|
1434
|
-
return A(D) < this.startOf(T);
|
|
1435
|
-
}, x.isBefore = function(D, T) {
|
|
1436
|
-
return this.endOf(T) < A(D);
|
|
1437
|
-
}, x.$g = function(D, T, S) {
|
|
1438
|
-
return k.u(D) ? this[T] : this.set(S, D);
|
|
1439
|
-
}, x.unix = function() {
|
|
1440
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
1441
|
-
}, x.valueOf = function() {
|
|
1442
|
-
return this.$d.getTime();
|
|
1443
|
-
}, x.startOf = function(D, T) {
|
|
1444
|
-
var S = this, I = !!k.u(T) || T, B = k.p(D), j = function(U, G) {
|
|
1445
|
-
var V = k.w(S.$u ? Date.UTC(S.$y, G, U) : new Date(S.$y, G, U), S);
|
|
1446
|
-
return I ? V : V.endOf(c);
|
|
1447
|
-
}, X = function(U, G) {
|
|
1448
|
-
return k.w(S.toDate()[U].apply(S.toDate("s"), (I ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(G)), S);
|
|
1449
|
-
}, Z = this.$W, Q = this.$M, ee = this.$D, ie = "set" + (this.$u ? "UTC" : "");
|
|
1450
|
-
switch (B) {
|
|
1451
|
-
case p:
|
|
1452
|
-
return I ? j(1, 0) : j(31, 11);
|
|
1453
|
-
case d:
|
|
1454
|
-
return I ? j(1, Q) : j(0, Q + 1);
|
|
1455
|
-
case u:
|
|
1456
|
-
var ae = this.$locale().weekStart || 0, se = (Z < ae ? Z + 7 : Z) - ae;
|
|
1457
|
-
return j(I ? ee - se : ee + (6 - se), Q);
|
|
1458
|
-
case c:
|
|
1459
|
-
case m:
|
|
1460
|
-
return X(ie + "Hours", 0);
|
|
1461
|
-
case l:
|
|
1462
|
-
return X(ie + "Minutes", 1);
|
|
1463
|
-
case s:
|
|
1464
|
-
return X(ie + "Seconds", 2);
|
|
1465
|
-
case a:
|
|
1466
|
-
return X(ie + "Milliseconds", 3);
|
|
1467
|
-
default:
|
|
1468
|
-
return this.clone();
|
|
1469
|
-
}
|
|
1470
|
-
}, x.endOf = function(D) {
|
|
1471
|
-
return this.startOf(D, !1);
|
|
1472
|
-
}, x.$set = function(D, T) {
|
|
1473
|
-
var S, I = k.p(D), B = "set" + (this.$u ? "UTC" : ""), j = (S = {}, S[c] = B + "Date", S[m] = B + "Date", S[d] = B + "Month", S[p] = B + "FullYear", S[l] = B + "Hours", S[s] = B + "Minutes", S[a] = B + "Seconds", S[i] = B + "Milliseconds", S)[I], X = I === c ? this.$D + (T - this.$W) : T;
|
|
1474
|
-
if (I === d || I === p) {
|
|
1475
|
-
var Z = this.clone().set(m, 1);
|
|
1476
|
-
Z.$d[j](X), Z.init(), this.$d = Z.set(m, Math.min(this.$D, Z.daysInMonth())).$d;
|
|
1477
|
-
} else j && this.$d[j](X);
|
|
1478
|
-
return this.init(), this;
|
|
1479
|
-
}, x.set = function(D, T) {
|
|
1480
|
-
return this.clone().$set(D, T);
|
|
1481
|
-
}, x.get = function(D) {
|
|
1482
|
-
return this[k.p(D)]();
|
|
1483
|
-
}, x.add = function(D, T) {
|
|
1484
|
-
var S, I = this;
|
|
1485
|
-
D = Number(D);
|
|
1486
|
-
var B = k.p(T), j = function(Q) {
|
|
1487
|
-
var ee = A(I);
|
|
1488
|
-
return k.w(ee.date(ee.date() + Math.round(Q * D)), I);
|
|
1489
|
-
};
|
|
1490
|
-
if (B === d) return this.set(d, this.$M + D);
|
|
1491
|
-
if (B === p) return this.set(p, this.$y + D);
|
|
1492
|
-
if (B === c) return j(1);
|
|
1493
|
-
if (B === u) return j(7);
|
|
1494
|
-
var X = (S = {}, S[s] = n, S[l] = o, S[a] = r, S)[B] || 1, Z = this.$d.getTime() + D * X;
|
|
1495
|
-
return k.w(Z, this);
|
|
1496
|
-
}, x.subtract = function(D, T) {
|
|
1497
|
-
return this.add(-1 * D, T);
|
|
1498
|
-
}, x.format = function(D) {
|
|
1499
|
-
var T = this, S = this.$locale();
|
|
1500
|
-
if (!this.isValid()) return S.invalidDate || g;
|
|
1501
|
-
var I = D || "YYYY-MM-DDTHH:mm:ssZ", B = k.z(this), j = this.$H, X = this.$m, Z = this.$M, Q = S.weekdays, ee = S.months, ie = S.meridiem, ae = function(G, V, Y, q) {
|
|
1502
|
-
return G && (G[V] || G(T, I)) || Y[V].slice(0, q);
|
|
1503
|
-
}, se = function(G) {
|
|
1504
|
-
return k.s(j % 12 || 12, G, "0");
|
|
1505
|
-
}, U = ie || function(G, V, Y) {
|
|
1506
|
-
var q = G < 12 ? "AM" : "PM";
|
|
1507
|
-
return Y ? q.toLowerCase() : q;
|
|
1508
|
-
};
|
|
1509
|
-
return I.replace(C, function(G, V) {
|
|
1510
|
-
return V || function(Y) {
|
|
1511
|
-
switch (Y) {
|
|
1512
|
-
case "YY":
|
|
1513
|
-
return String(T.$y).slice(-2);
|
|
1514
|
-
case "YYYY":
|
|
1515
|
-
return k.s(T.$y, 4, "0");
|
|
1516
|
-
case "M":
|
|
1517
|
-
return Z + 1;
|
|
1518
|
-
case "MM":
|
|
1519
|
-
return k.s(Z + 1, 2, "0");
|
|
1520
|
-
case "MMM":
|
|
1521
|
-
return ae(S.monthsShort, Z, ee, 3);
|
|
1522
|
-
case "MMMM":
|
|
1523
|
-
return ae(ee, Z);
|
|
1524
|
-
case "D":
|
|
1525
|
-
return T.$D;
|
|
1526
|
-
case "DD":
|
|
1527
|
-
return k.s(T.$D, 2, "0");
|
|
1528
|
-
case "d":
|
|
1529
|
-
return String(T.$W);
|
|
1530
|
-
case "dd":
|
|
1531
|
-
return ae(S.weekdaysMin, T.$W, Q, 2);
|
|
1532
|
-
case "ddd":
|
|
1533
|
-
return ae(S.weekdaysShort, T.$W, Q, 3);
|
|
1534
|
-
case "dddd":
|
|
1535
|
-
return Q[T.$W];
|
|
1536
|
-
case "H":
|
|
1537
|
-
return String(j);
|
|
1538
|
-
case "HH":
|
|
1539
|
-
return k.s(j, 2, "0");
|
|
1540
|
-
case "h":
|
|
1541
|
-
return se(1);
|
|
1542
|
-
case "hh":
|
|
1543
|
-
return se(2);
|
|
1544
|
-
case "a":
|
|
1545
|
-
return U(j, X, !0);
|
|
1546
|
-
case "A":
|
|
1547
|
-
return U(j, X, !1);
|
|
1548
|
-
case "m":
|
|
1549
|
-
return String(X);
|
|
1550
|
-
case "mm":
|
|
1551
|
-
return k.s(X, 2, "0");
|
|
1552
|
-
case "s":
|
|
1553
|
-
return String(T.$s);
|
|
1554
|
-
case "ss":
|
|
1555
|
-
return k.s(T.$s, 2, "0");
|
|
1556
|
-
case "SSS":
|
|
1557
|
-
return k.s(T.$ms, 3, "0");
|
|
1558
|
-
case "Z":
|
|
1559
|
-
return B;
|
|
1560
|
-
}
|
|
1561
|
-
return null;
|
|
1562
|
-
}(G) || B.replace(":", "");
|
|
1563
|
-
});
|
|
1564
|
-
}, x.utcOffset = function() {
|
|
1565
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1566
|
-
}, x.diff = function(D, T, S) {
|
|
1567
|
-
var I, B = this, j = k.p(T), X = A(D), Z = (X.utcOffset() - this.utcOffset()) * n, Q = this - X, ee = function() {
|
|
1568
|
-
return k.m(B, X);
|
|
1569
|
-
};
|
|
1570
|
-
switch (j) {
|
|
1571
|
-
case p:
|
|
1572
|
-
I = ee() / 12;
|
|
1573
|
-
break;
|
|
1574
|
-
case d:
|
|
1575
|
-
I = ee();
|
|
1576
|
-
break;
|
|
1577
|
-
case f:
|
|
1578
|
-
I = ee() / 3;
|
|
1579
|
-
break;
|
|
1580
|
-
case u:
|
|
1581
|
-
I = (Q - Z) / 6048e5;
|
|
1582
|
-
break;
|
|
1583
|
-
case c:
|
|
1584
|
-
I = (Q - Z) / 864e5;
|
|
1585
|
-
break;
|
|
1586
|
-
case l:
|
|
1587
|
-
I = Q / o;
|
|
1588
|
-
break;
|
|
1589
|
-
case s:
|
|
1590
|
-
I = Q / n;
|
|
1591
|
-
break;
|
|
1592
|
-
case a:
|
|
1593
|
-
I = Q / r;
|
|
1594
|
-
break;
|
|
1595
|
-
default:
|
|
1596
|
-
I = Q;
|
|
1597
1427
|
}
|
|
1598
|
-
return
|
|
1599
|
-
},
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1428
|
+
return new Date(S);
|
|
1429
|
+
}(D), this.init();
|
|
1430
|
+
}, x.init = function() {
|
|
1431
|
+
var D = this.$d;
|
|
1432
|
+
this.$y = D.getFullYear(), this.$M = D.getMonth(), this.$D = D.getDate(), this.$W = D.getDay(), this.$H = D.getHours(), this.$m = D.getMinutes(), this.$s = D.getSeconds(), this.$ms = D.getMilliseconds();
|
|
1433
|
+
}, x.$utils = function() {
|
|
1434
|
+
return k;
|
|
1435
|
+
}, x.isValid = function() {
|
|
1436
|
+
return this.$d.toString() !== g;
|
|
1437
|
+
}, x.isSame = function(D, T) {
|
|
1438
|
+
var S = A(D);
|
|
1439
|
+
return this.startOf(T) <= S && S <= this.endOf(T);
|
|
1440
|
+
}, x.isAfter = function(D, T) {
|
|
1441
|
+
return A(D) < this.startOf(T);
|
|
1442
|
+
}, x.isBefore = function(D, T) {
|
|
1443
|
+
return this.endOf(T) < A(D);
|
|
1444
|
+
}, x.$g = function(D, T, S) {
|
|
1445
|
+
return k.u(D) ? this[T] : this.set(S, D);
|
|
1446
|
+
}, x.unix = function() {
|
|
1447
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
1448
|
+
}, x.valueOf = function() {
|
|
1449
|
+
return this.$d.getTime();
|
|
1450
|
+
}, x.startOf = function(D, T) {
|
|
1451
|
+
var S = this, I = !!k.u(T) || T, B = k.p(D), j = function(U, G) {
|
|
1452
|
+
var V = k.w(S.$u ? Date.UTC(S.$y, G, U) : new Date(S.$y, G, U), S);
|
|
1453
|
+
return I ? V : V.endOf(c);
|
|
1454
|
+
}, X = function(U, G) {
|
|
1455
|
+
return k.w(S.toDate()[U].apply(S.toDate("s"), (I ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(G)), S);
|
|
1456
|
+
}, Z = this.$W, Q = this.$M, ee = this.$D, ie = "set" + (this.$u ? "UTC" : "");
|
|
1457
|
+
switch (B) {
|
|
1458
|
+
case p:
|
|
1459
|
+
return I ? j(1, 0) : j(31, 11);
|
|
1460
|
+
case f:
|
|
1461
|
+
return I ? j(1, Q) : j(0, Q + 1);
|
|
1462
|
+
case u:
|
|
1463
|
+
var ae = this.$locale().weekStart || 0, se = (Z < ae ? Z + 7 : Z) - ae;
|
|
1464
|
+
return j(I ? ee - se : ee + (6 - se), Q);
|
|
1465
|
+
case c:
|
|
1466
|
+
case m:
|
|
1467
|
+
return X(ie + "Hours", 0);
|
|
1468
|
+
case l:
|
|
1469
|
+
return X(ie + "Minutes", 1);
|
|
1470
|
+
case s:
|
|
1471
|
+
return X(ie + "Seconds", 2);
|
|
1472
|
+
case a:
|
|
1473
|
+
return X(ie + "Milliseconds", 3);
|
|
1474
|
+
default:
|
|
1475
|
+
return this.clone();
|
|
1476
|
+
}
|
|
1477
|
+
}, x.endOf = function(D) {
|
|
1478
|
+
return this.startOf(D, !1);
|
|
1479
|
+
}, x.$set = function(D, T) {
|
|
1480
|
+
var S, I = k.p(D), B = "set" + (this.$u ? "UTC" : ""), j = (S = {}, S[c] = B + "Date", S[m] = B + "Date", S[f] = B + "Month", S[p] = B + "FullYear", S[l] = B + "Hours", S[s] = B + "Minutes", S[a] = B + "Seconds", S[i] = B + "Milliseconds", S)[I], X = I === c ? this.$D + (T - this.$W) : T;
|
|
1481
|
+
if (I === f || I === p) {
|
|
1482
|
+
var Z = this.clone().set(m, 1);
|
|
1483
|
+
Z.$d[j](X), Z.init(), this.$d = Z.set(m, Math.min(this.$D, Z.daysInMonth())).$d;
|
|
1484
|
+
} else j && this.$d[j](X);
|
|
1485
|
+
return this.init(), this;
|
|
1486
|
+
}, x.set = function(D, T) {
|
|
1487
|
+
return this.clone().$set(D, T);
|
|
1488
|
+
}, x.get = function(D) {
|
|
1489
|
+
return this[k.p(D)]();
|
|
1490
|
+
}, x.add = function(D, T) {
|
|
1491
|
+
var S, I = this;
|
|
1492
|
+
D = Number(D);
|
|
1493
|
+
var B = k.p(T), j = function(Q) {
|
|
1494
|
+
var ee = A(I);
|
|
1495
|
+
return k.w(ee.date(ee.date() + Math.round(Q * D)), I);
|
|
1622
1496
|
};
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1497
|
+
if (B === f) return this.set(f, this.$M + D);
|
|
1498
|
+
if (B === p) return this.set(p, this.$y + D);
|
|
1499
|
+
if (B === c) return j(1);
|
|
1500
|
+
if (B === u) return j(7);
|
|
1501
|
+
var X = (S = {}, S[s] = n, S[l] = o, S[a] = r, S)[B] || 1, Z = this.$d.getTime() + D * X;
|
|
1502
|
+
return k.w(Z, this);
|
|
1503
|
+
}, x.subtract = function(D, T) {
|
|
1504
|
+
return this.add(-1 * D, T);
|
|
1505
|
+
}, x.format = function(D) {
|
|
1506
|
+
var T = this, S = this.$locale();
|
|
1507
|
+
if (!this.isValid()) return S.invalidDate || g;
|
|
1508
|
+
var I = D || "YYYY-MM-DDTHH:mm:ssZ", B = k.z(this), j = this.$H, X = this.$m, Z = this.$M, Q = S.weekdays, ee = S.months, ie = S.meridiem, ae = function(G, V, Y, q) {
|
|
1509
|
+
return G && (G[V] || G(T, I)) || Y[V].slice(0, q);
|
|
1510
|
+
}, se = function(G) {
|
|
1511
|
+
return k.s(j % 12 || 12, G, "0");
|
|
1512
|
+
}, U = ie || function(G, V, Y) {
|
|
1513
|
+
var q = G < 12 ? "AM" : "PM";
|
|
1514
|
+
return Y ? q.toLowerCase() : q;
|
|
1515
|
+
};
|
|
1516
|
+
return I.replace(E, function(G, V) {
|
|
1517
|
+
return V || function(Y) {
|
|
1518
|
+
switch (Y) {
|
|
1519
|
+
case "YY":
|
|
1520
|
+
return String(T.$y).slice(-2);
|
|
1521
|
+
case "YYYY":
|
|
1522
|
+
return k.s(T.$y, 4, "0");
|
|
1523
|
+
case "M":
|
|
1524
|
+
return Z + 1;
|
|
1525
|
+
case "MM":
|
|
1526
|
+
return k.s(Z + 1, 2, "0");
|
|
1527
|
+
case "MMM":
|
|
1528
|
+
return ae(S.monthsShort, Z, ee, 3);
|
|
1529
|
+
case "MMMM":
|
|
1530
|
+
return ae(ee, Z);
|
|
1531
|
+
case "D":
|
|
1532
|
+
return T.$D;
|
|
1533
|
+
case "DD":
|
|
1534
|
+
return k.s(T.$D, 2, "0");
|
|
1535
|
+
case "d":
|
|
1536
|
+
return String(T.$W);
|
|
1537
|
+
case "dd":
|
|
1538
|
+
return ae(S.weekdaysMin, T.$W, Q, 2);
|
|
1539
|
+
case "ddd":
|
|
1540
|
+
return ae(S.weekdaysShort, T.$W, Q, 3);
|
|
1541
|
+
case "dddd":
|
|
1542
|
+
return Q[T.$W];
|
|
1543
|
+
case "H":
|
|
1544
|
+
return String(j);
|
|
1545
|
+
case "HH":
|
|
1546
|
+
return k.s(j, 2, "0");
|
|
1547
|
+
case "h":
|
|
1548
|
+
return se(1);
|
|
1549
|
+
case "hh":
|
|
1550
|
+
return se(2);
|
|
1551
|
+
case "a":
|
|
1552
|
+
return U(j, X, !0);
|
|
1553
|
+
case "A":
|
|
1554
|
+
return U(j, X, !1);
|
|
1555
|
+
case "m":
|
|
1556
|
+
return String(X);
|
|
1557
|
+
case "mm":
|
|
1558
|
+
return k.s(X, 2, "0");
|
|
1559
|
+
case "s":
|
|
1560
|
+
return String(T.$s);
|
|
1561
|
+
case "ss":
|
|
1562
|
+
return k.s(T.$s, 2, "0");
|
|
1563
|
+
case "SSS":
|
|
1564
|
+
return k.s(T.$ms, 3, "0");
|
|
1565
|
+
case "Z":
|
|
1566
|
+
return B;
|
|
1567
|
+
}
|
|
1568
|
+
return null;
|
|
1569
|
+
}(G) || B.replace(":", "");
|
|
1570
|
+
});
|
|
1571
|
+
}, x.utcOffset = function() {
|
|
1572
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1573
|
+
}, x.diff = function(D, T, S) {
|
|
1574
|
+
var I, B = this, j = k.p(T), X = A(D), Z = (X.utcOffset() - this.utcOffset()) * n, Q = this - X, ee = function() {
|
|
1575
|
+
return k.m(B, X);
|
|
1576
|
+
};
|
|
1577
|
+
switch (j) {
|
|
1578
|
+
case p:
|
|
1579
|
+
I = ee() / 12;
|
|
1580
|
+
break;
|
|
1581
|
+
case f:
|
|
1582
|
+
I = ee();
|
|
1583
|
+
break;
|
|
1584
|
+
case d:
|
|
1585
|
+
I = ee() / 3;
|
|
1586
|
+
break;
|
|
1587
|
+
case u:
|
|
1588
|
+
I = (Q - Z) / 6048e5;
|
|
1589
|
+
break;
|
|
1590
|
+
case c:
|
|
1591
|
+
I = (Q - Z) / 864e5;
|
|
1592
|
+
break;
|
|
1593
|
+
case l:
|
|
1594
|
+
I = Q / o;
|
|
1595
|
+
break;
|
|
1596
|
+
case s:
|
|
1597
|
+
I = Q / n;
|
|
1598
|
+
break;
|
|
1599
|
+
case a:
|
|
1600
|
+
I = Q / r;
|
|
1601
|
+
break;
|
|
1602
|
+
default:
|
|
1603
|
+
I = Q;
|
|
1604
|
+
}
|
|
1605
|
+
return S ? I : k.a(I);
|
|
1606
|
+
}, x.daysInMonth = function() {
|
|
1607
|
+
return this.endOf(f).$D;
|
|
1608
|
+
}, x.$locale = function() {
|
|
1609
|
+
return w[this.$L];
|
|
1610
|
+
}, x.locale = function(D, T) {
|
|
1611
|
+
if (!D) return this.$L;
|
|
1612
|
+
var S = this.clone(), I = R(D, T, !0);
|
|
1613
|
+
return I && (S.$L = I), S;
|
|
1614
|
+
}, x.clone = function() {
|
|
1615
|
+
return k.w(this.$d, this);
|
|
1616
|
+
}, x.toDate = function() {
|
|
1617
|
+
return new Date(this.valueOf());
|
|
1618
|
+
}, x.toJSON = function() {
|
|
1619
|
+
return this.isValid() ? this.toISOString() : null;
|
|
1620
|
+
}, x.toISOString = function() {
|
|
1621
|
+
return this.$d.toISOString();
|
|
1622
|
+
}, x.toString = function() {
|
|
1623
|
+
return this.$d.toUTCString();
|
|
1624
|
+
}, O;
|
|
1625
|
+
}(), L = F.prototype;
|
|
1626
|
+
return A.prototype = L, [["$ms", i], ["$s", a], ["$m", s], ["$H", l], ["$W", c], ["$M", f], ["$y", p], ["$D", m]].forEach(function(O) {
|
|
1627
|
+
L[O[1]] = function(x) {
|
|
1628
|
+
return this.$g(x, O[0], O[1]);
|
|
1629
|
+
};
|
|
1630
|
+
}), A.extend = function(O, x) {
|
|
1631
|
+
return O.$i || (O(x, F, A), O.$i = !0), A;
|
|
1632
|
+
}, A.locale = R, A.isDayjs = N, A.unix = function(O) {
|
|
1633
|
+
return A(1e3 * O);
|
|
1634
|
+
}, A.en = w[C], A.Ls = w, A.p = {}, A;
|
|
1635
|
+
});
|
|
1636
|
+
})(dayjs_min);
|
|
1637
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
1632
1638
|
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
|
|
1633
1639
|
function buildPrintParamsFromConfig(t, e = {}) {
|
|
1634
1640
|
const r = t.params || [], n = [];
|
|
1635
1641
|
for (const o of r) {
|
|
1636
|
-
const { columnName: i, defaultValue: a, dataType: s, dateType: l, type: c, isNull: u } = o,
|
|
1637
|
-
let
|
|
1642
|
+
const { columnName: i, defaultValue: a, dataType: s, dateType: l, type: c, isNull: u } = o, f = [DataSourceColumnDataType.DATE, DataSourceColumnDataType.DATETIME].includes(s);
|
|
1643
|
+
let d;
|
|
1638
1644
|
if ([DataSourceColumnDataType.LIST, DataSourceColumnDataType.TABLE].includes(s))
|
|
1639
1645
|
if (e[i] !== void 0) {
|
|
1640
1646
|
const p = e[i];
|
|
1641
|
-
|
|
1642
|
-
} else Array.isArray(a) ?
|
|
1643
|
-
else
|
|
1644
|
-
n.push({ name: i, value:
|
|
1647
|
+
d = Array.isArray(p) ? p : String(p).split(",");
|
|
1648
|
+
} else Array.isArray(a) ? d = a : typeof a == "string" && a ? d = a.split(",") : d = [];
|
|
1649
|
+
else f && a ? d = resolveDateDefaultValue(a, l, o.startTime, o.endTime) : d = e[i] !== void 0 ? e[i] : a ?? "";
|
|
1650
|
+
n.push({ name: i, value: d, type: c, isNull: u }), c === "LT_GT_EQ" && !f && n.push({
|
|
1645
1651
|
name: `end_${i}`,
|
|
1646
1652
|
value: a ?? "",
|
|
1647
1653
|
type: c,
|
|
@@ -1749,10 +1755,10 @@ function collectCellQueryConditions(t, e) {
|
|
|
1749
1755
|
const c = l[0].toUpperCase(), u = n.get(c);
|
|
1750
1756
|
if (!u) return;
|
|
1751
1757
|
o.has(c) || o.set(c, /* @__PURE__ */ new Map());
|
|
1752
|
-
const
|
|
1753
|
-
for (const
|
|
1754
|
-
const p = l[1 +
|
|
1755
|
-
p === void 0 || p === "" || (
|
|
1758
|
+
const f = o.get(c);
|
|
1759
|
+
for (const d of u) {
|
|
1760
|
+
const p = l[1 + d.index];
|
|
1761
|
+
p === void 0 || p === "" || (f.has(d.paramName) || f.set(d.paramName, /* @__PURE__ */ new Set()), f.get(d.paramName).add(p));
|
|
1756
1762
|
}
|
|
1757
1763
|
}, a = (s) => {
|
|
1758
1764
|
if (!s || typeof s != "string") return;
|
|
@@ -1772,8 +1778,8 @@ function collectCellQueryConditions(t, e) {
|
|
|
1772
1778
|
}
|
|
1773
1779
|
return o.forEach((s, l) => {
|
|
1774
1780
|
const c = [];
|
|
1775
|
-
s.forEach((u,
|
|
1776
|
-
u.size && c.push({ name:
|
|
1781
|
+
s.forEach((u, f) => {
|
|
1782
|
+
u.size && c.push({ name: f, value: Array.from(u).join(","), type: "IN" });
|
|
1777
1783
|
}), c.length && r.set(l, c);
|
|
1778
1784
|
}), r;
|
|
1779
1785
|
}
|
|
@@ -1838,25 +1844,25 @@ async function fetchReportData(t, e, r, n = !1) {
|
|
|
1838
1844
|
let s;
|
|
1839
1845
|
r.isPagination ? n ? (i.pageSize = FULL_FETCH_PAGE_SIZE, s = 1) : (i.pageSize = r.pageSize, s = r.pageIndex) : n ? (i.pageSize = FULL_FETCH_PAGE_SIZE, s = 1) : (i.pageSize = r.pageSize, s = 1), i.pageNumber = s;
|
|
1840
1846
|
let l = [], c = {};
|
|
1841
|
-
e.forEach(({ name:
|
|
1842
|
-
|
|
1847
|
+
e.forEach(({ name: f, value: d }) => {
|
|
1848
|
+
f && (c[f.toUpperCase()] = d);
|
|
1843
1849
|
}), l.push({ key: "PARAM", data: c });
|
|
1844
1850
|
let u = 0;
|
|
1845
|
-
for (let
|
|
1846
|
-
const { key:
|
|
1851
|
+
for (let f = 0; f < t.data.source.length; f++) {
|
|
1852
|
+
const { key: d, url: p } = t.data.source[f];
|
|
1847
1853
|
if (p) {
|
|
1848
1854
|
const m = a.get(p.toUpperCase()), g = m != null && m.length ? { ...i, params: [...i.params || [], ...m] } : i, _ = await getDateSourceData(p, g);
|
|
1849
|
-
let
|
|
1850
|
-
if (n && Array.isArray(
|
|
1851
|
-
const $ = _.count ||
|
|
1852
|
-
for (let
|
|
1853
|
-
const
|
|
1854
|
-
if (!Array.isArray(
|
|
1855
|
+
let E = _.data;
|
|
1856
|
+
if (n && Array.isArray(E)) {
|
|
1857
|
+
const $ = _.count || E.length, y = i.pageSize > 0 ? i.pageSize : FULL_FETCH_PAGE_SIZE, v = Math.min(Math.ceil($ / y), FULL_FETCH_MAX_PAGES);
|
|
1858
|
+
for (let C = 2; C <= v; C++) {
|
|
1859
|
+
const w = await getDateSourceData(p, { ...g, pageNumber: C });
|
|
1860
|
+
if (!Array.isArray(w.data) || w.data.length === 0)
|
|
1855
1861
|
break;
|
|
1856
|
-
|
|
1862
|
+
E = E.concat(w.data);
|
|
1857
1863
|
}
|
|
1858
1864
|
}
|
|
1859
|
-
l.push({ key:
|
|
1865
|
+
l.push({ key: d, data: E }), r.isPagination && (u = Math.max(u, _.count || (Array.isArray(E) ? E.length : 0)));
|
|
1860
1866
|
}
|
|
1861
1867
|
}
|
|
1862
1868
|
return { resData: l, total: u };
|
|
@@ -1874,7 +1880,7 @@ function toUpdateData(t) {
|
|
|
1874
1880
|
var zhCn$1 = { exports: {} };
|
|
1875
1881
|
(function(t, e) {
|
|
1876
1882
|
(function(r, n) {
|
|
1877
|
-
t.exports = n(
|
|
1883
|
+
t.exports = n(dayjs_minExports);
|
|
1878
1884
|
})(commonjsGlobal, function(r) {
|
|
1879
1885
|
function n(a) {
|
|
1880
1886
|
return a && typeof a == "object" && "default" in a ? a : { default: a };
|
|
@@ -2259,7 +2265,7 @@ class Jsep {
|
|
|
2259
2265
|
break;
|
|
2260
2266
|
}
|
|
2261
2267
|
i = { value: r, prec: n, right_a: Jsep.right_associative.has(r) }, c = r;
|
|
2262
|
-
const u = (
|
|
2268
|
+
const u = (f) => i.right_a && f.right_a ? n > f.prec : n <= f.prec;
|
|
2263
2269
|
for (; o.length > 2 && u(o[o.length - 2]); )
|
|
2264
2270
|
s = o.pop(), r = o.pop().value, a = o.pop(), e = {
|
|
2265
2271
|
type: Jsep.BINARY_EXP,
|
|
@@ -2733,9 +2739,9 @@ P.cosine = P.cos = function() {
|
|
|
2733
2739
|
return r.d ? r.d[0] ? (t = n.precision, e = n.rounding, n.precision = t + Math.max(r.e, r.sd()) + LOG_BASE, n.rounding = 1, r = cosine(n, toLessThanHalfPi(n, r)), n.precision = t, n.rounding = e, finalise(quadrant == 2 || quadrant == 3 ? r.neg() : r, t, e, !0)) : new n(1) : new n(NaN);
|
|
2734
2740
|
};
|
|
2735
2741
|
P.cubeRoot = P.cbrt = function() {
|
|
2736
|
-
var t, e, r, n, o, i, a, s, l, c, u = this,
|
|
2737
|
-
if (!u.isFinite() || u.isZero()) return new
|
|
2738
|
-
for (external = !1, i = u.s * mathpow(u.s * u, 1 / 3), !i || Math.abs(i) == 1 / 0 ? (r = digitsToString(u.d), t = u.e, (i = (t - r.length + 1) % 3) && (r += i == 1 || i == -2 ? "0" : "00"), i = mathpow(r, 1 / 3), t = mathfloor((t + 1) / 3) - (t % 3 == (t < 0 ? -1 : 2)), i == 1 / 0 ? r = "5e" + t : (r = i.toExponential(), r = r.slice(0, r.indexOf("e") + 1) + t), n = new
|
|
2742
|
+
var t, e, r, n, o, i, a, s, l, c, u = this, f = u.constructor;
|
|
2743
|
+
if (!u.isFinite() || u.isZero()) return new f(u);
|
|
2744
|
+
for (external = !1, i = u.s * mathpow(u.s * u, 1 / 3), !i || Math.abs(i) == 1 / 0 ? (r = digitsToString(u.d), t = u.e, (i = (t - r.length + 1) % 3) && (r += i == 1 || i == -2 ? "0" : "00"), i = mathpow(r, 1 / 3), t = mathfloor((t + 1) / 3) - (t % 3 == (t < 0 ? -1 : 2)), i == 1 / 0 ? r = "5e" + t : (r = i.toExponential(), r = r.slice(0, r.indexOf("e") + 1) + t), n = new f(r), n.s = u.s) : n = new f(i.toString()), a = (t = f.precision) + 3; ; )
|
|
2739
2745
|
if (s = n, l = s.times(s).times(s), c = l.plus(u), n = divide(c.plus(u).times(s), c.plus(l), a + 2, 1), digitsToString(s.d).slice(0, a) === (r = digitsToString(n.d)).slice(0, a))
|
|
2740
2746
|
if (r = r.slice(a - 3, a + 1), r == "9999" || !o && r == "4999") {
|
|
2741
2747
|
if (!o && (finalise(s, t + 1, 0), s.times(s).times(s).eq(u))) {
|
|
@@ -2747,7 +2753,7 @@ P.cubeRoot = P.cbrt = function() {
|
|
|
2747
2753
|
(!+r || !+r.slice(1) && r.charAt(0) == "5") && (finalise(n, t + 1, 1), e = !n.times(n).times(n).eq(u));
|
|
2748
2754
|
break;
|
|
2749
2755
|
}
|
|
2750
|
-
return external = !0, finalise(n, t,
|
|
2756
|
+
return external = !0, finalise(n, t, f.rounding, e);
|
|
2751
2757
|
};
|
|
2752
2758
|
P.decimalPlaces = P.dp = function() {
|
|
2753
2759
|
var t, e = this.d, r = NaN;
|
|
@@ -2823,21 +2829,21 @@ P.inverseSine = P.asin = function() {
|
|
|
2823
2829
|
return o.isZero() ? new i(o) : (e = o.abs().cmp(1), r = i.precision, n = i.rounding, e !== -1 ? e === 0 ? (t = getPi(i, r + 4, n).times(0.5), t.s = o.s, t) : new i(NaN) : (i.precision = r + 6, i.rounding = 1, o = o.div(new i(1).minus(o.times(o)).sqrt().plus(1)).atan(), i.precision = r, i.rounding = n, o.times(2)));
|
|
2824
2830
|
};
|
|
2825
2831
|
P.inverseTangent = P.atan = function() {
|
|
2826
|
-
var t, e, r, n, o, i, a, s, l, c = this, u = c.constructor,
|
|
2832
|
+
var t, e, r, n, o, i, a, s, l, c = this, u = c.constructor, f = u.precision, d = u.rounding;
|
|
2827
2833
|
if (c.isFinite()) {
|
|
2828
2834
|
if (c.isZero())
|
|
2829
2835
|
return new u(c);
|
|
2830
|
-
if (c.abs().eq(1) &&
|
|
2831
|
-
return a = getPi(u,
|
|
2836
|
+
if (c.abs().eq(1) && f + 4 <= PI_PRECISION)
|
|
2837
|
+
return a = getPi(u, f + 4, d).times(0.25), a.s = c.s, a;
|
|
2832
2838
|
} else {
|
|
2833
2839
|
if (!c.s) return new u(NaN);
|
|
2834
|
-
if (
|
|
2835
|
-
return a = getPi(u,
|
|
2840
|
+
if (f + 4 <= PI_PRECISION)
|
|
2841
|
+
return a = getPi(u, f + 4, d).times(0.5), a.s = c.s, a;
|
|
2836
2842
|
}
|
|
2837
|
-
for (u.precision = s =
|
|
2843
|
+
for (u.precision = s = f + 10, u.rounding = 1, r = Math.min(28, s / LOG_BASE + 2 | 0), t = r; t; --t) c = c.div(c.times(c).plus(1).sqrt().plus(1));
|
|
2838
2844
|
for (external = !1, e = Math.ceil(s / LOG_BASE), n = 1, l = c.times(c), a = new u(c), o = c; t !== -1; )
|
|
2839
2845
|
if (o = o.times(l), i = a.minus(o.div(n += 2)), o = o.times(l), a = i.plus(o.div(n += 2)), a.d[e] !== void 0) for (t = e; a.d[t] === i.d[t] && t--; ) ;
|
|
2840
|
-
return r && (a = a.times(2 << r - 1)), external = !0, finalise(a, u.precision =
|
|
2846
|
+
return r && (a = a.times(2 << r - 1)), external = !0, finalise(a, u.precision = f, u.rounding = d, !0);
|
|
2841
2847
|
};
|
|
2842
2848
|
P.isFinite = function() {
|
|
2843
2849
|
return !!this.d;
|
|
@@ -2864,7 +2870,7 @@ P.lessThanOrEqualTo = P.lte = function(t) {
|
|
|
2864
2870
|
return this.cmp(t) < 1;
|
|
2865
2871
|
};
|
|
2866
2872
|
P.logarithm = P.log = function(t) {
|
|
2867
|
-
var e, r, n, o, i, a, s, l, c = this, u = c.constructor,
|
|
2873
|
+
var e, r, n, o, i, a, s, l, c = this, u = c.constructor, f = u.precision, d = u.rounding, p = 5;
|
|
2868
2874
|
if (t == null)
|
|
2869
2875
|
t = new u(10), e = !0;
|
|
2870
2876
|
else {
|
|
@@ -2880,45 +2886,45 @@ P.logarithm = P.log = function(t) {
|
|
|
2880
2886
|
for (o = r[0]; o % 10 === 0; ) o /= 10;
|
|
2881
2887
|
i = o !== 1;
|
|
2882
2888
|
}
|
|
2883
|
-
if (external = !1, s =
|
|
2889
|
+
if (external = !1, s = f + p, a = naturalLogarithm(c, s), n = e ? getLn10(u, s + 10) : naturalLogarithm(t, s), l = divide(a, n, s, 1), checkRoundingDigits(l.d, o = f, d))
|
|
2884
2890
|
do
|
|
2885
2891
|
if (s += 10, a = naturalLogarithm(c, s), n = e ? getLn10(u, s + 10) : naturalLogarithm(t, s), l = divide(a, n, s, 1), !i) {
|
|
2886
|
-
+digitsToString(l.d).slice(o + 1, o + 15) + 1 == 1e14 && (l = finalise(l,
|
|
2892
|
+
+digitsToString(l.d).slice(o + 1, o + 15) + 1 == 1e14 && (l = finalise(l, f + 1, 0));
|
|
2887
2893
|
break;
|
|
2888
2894
|
}
|
|
2889
|
-
while (checkRoundingDigits(l.d, o += 10,
|
|
2890
|
-
return external = !0, finalise(l,
|
|
2895
|
+
while (checkRoundingDigits(l.d, o += 10, d));
|
|
2896
|
+
return external = !0, finalise(l, f, d);
|
|
2891
2897
|
};
|
|
2892
2898
|
P.minus = P.sub = function(t) {
|
|
2893
|
-
var e, r, n, o, i, a, s, l, c, u,
|
|
2899
|
+
var e, r, n, o, i, a, s, l, c, u, f, d, p = this, m = p.constructor;
|
|
2894
2900
|
if (t = new m(t), !p.d || !t.d)
|
|
2895
2901
|
return !p.s || !t.s ? t = new m(NaN) : p.d ? t.s = -t.s : t = new m(t.d || p.s !== t.s ? p : NaN), t;
|
|
2896
2902
|
if (p.s != t.s)
|
|
2897
2903
|
return t.s = -t.s, p.plus(t);
|
|
2898
|
-
if (c = p.d,
|
|
2899
|
-
if (
|
|
2904
|
+
if (c = p.d, d = t.d, s = m.precision, l = m.rounding, !c[0] || !d[0]) {
|
|
2905
|
+
if (d[0]) t.s = -t.s;
|
|
2900
2906
|
else if (c[0]) t = new m(p);
|
|
2901
2907
|
else return new m(l === 3 ? -0 : 0);
|
|
2902
2908
|
return external ? finalise(t, s, l) : t;
|
|
2903
2909
|
}
|
|
2904
2910
|
if (r = mathfloor(t.e / LOG_BASE), u = mathfloor(p.e / LOG_BASE), c = c.slice(), i = u - r, i) {
|
|
2905
|
-
for (
|
|
2911
|
+
for (f = i < 0, f ? (e = c, i = -i, a = d.length) : (e = d, r = u, a = c.length), n = Math.max(Math.ceil(s / LOG_BASE), a) + 2, i > n && (i = n, e.length = 1), e.reverse(), n = i; n--; ) e.push(0);
|
|
2906
2912
|
e.reverse();
|
|
2907
2913
|
} else {
|
|
2908
|
-
for (n = c.length, a =
|
|
2909
|
-
if (c[n] !=
|
|
2910
|
-
|
|
2914
|
+
for (n = c.length, a = d.length, f = n < a, f && (a = n), n = 0; n < a; n++)
|
|
2915
|
+
if (c[n] != d[n]) {
|
|
2916
|
+
f = c[n] < d[n];
|
|
2911
2917
|
break;
|
|
2912
2918
|
}
|
|
2913
2919
|
i = 0;
|
|
2914
2920
|
}
|
|
2915
|
-
for (
|
|
2916
|
-
for (n =
|
|
2917
|
-
if (c[--n] <
|
|
2921
|
+
for (f && (e = c, c = d, d = e, t.s = -t.s), a = c.length, n = d.length - a; n > 0; --n) c[a++] = 0;
|
|
2922
|
+
for (n = d.length; n > i; ) {
|
|
2923
|
+
if (c[--n] < d[n]) {
|
|
2918
2924
|
for (o = n; o && c[--o] === 0; ) c[o] = BASE - 1;
|
|
2919
2925
|
--c[o], c[n] += BASE;
|
|
2920
2926
|
}
|
|
2921
|
-
c[n] -=
|
|
2927
|
+
c[n] -= d[n];
|
|
2922
2928
|
}
|
|
2923
2929
|
for (; c[--a] === 0; ) c.pop();
|
|
2924
2930
|
for (; c[0] === 0; c.shift()) --r;
|
|
@@ -2939,14 +2945,14 @@ P.negated = P.neg = function() {
|
|
|
2939
2945
|
return t.s = -t.s, finalise(t);
|
|
2940
2946
|
};
|
|
2941
2947
|
P.plus = P.add = function(t) {
|
|
2942
|
-
var e, r, n, o, i, a, s, l, c, u,
|
|
2943
|
-
if (t = new
|
|
2944
|
-
return !
|
|
2945
|
-
if (
|
|
2946
|
-
return t.s = -t.s,
|
|
2947
|
-
if (c =
|
|
2948
|
-
return u[0] || (t = new f
|
|
2949
|
-
if (i = mathfloor(
|
|
2948
|
+
var e, r, n, o, i, a, s, l, c, u, f = this, d = f.constructor;
|
|
2949
|
+
if (t = new d(t), !f.d || !t.d)
|
|
2950
|
+
return !f.s || !t.s ? t = new d(NaN) : f.d || (t = new d(t.d || f.s === t.s ? f : NaN)), t;
|
|
2951
|
+
if (f.s != t.s)
|
|
2952
|
+
return t.s = -t.s, f.minus(t);
|
|
2953
|
+
if (c = f.d, u = t.d, s = d.precision, l = d.rounding, !c[0] || !u[0])
|
|
2954
|
+
return u[0] || (t = new d(f)), external ? finalise(t, s, l) : t;
|
|
2955
|
+
if (i = mathfloor(f.e / LOG_BASE), n = mathfloor(t.e / LOG_BASE), c = c.slice(), o = i - n, o) {
|
|
2950
2956
|
for (o < 0 ? (r = c, o = -o, a = u.length) : (r = u, n = i, a = c.length), i = Math.ceil(s / LOG_BASE), a = i > a ? i + 1 : a + 1, o > a && (o = a, r.length = 1), r.reverse(); o--; ) r.push(0);
|
|
2951
2957
|
r.reverse();
|
|
2952
2958
|
}
|
|
@@ -2991,17 +2997,17 @@ P.tangent = P.tan = function() {
|
|
|
2991
2997
|
return r.isFinite() ? r.isZero() ? new n(r) : (t = n.precision, e = n.rounding, n.precision = t + 10, n.rounding = 1, r = r.sin(), r.s = 1, r = divide(r, new n(1).minus(r.times(r)).sqrt(), t + 10, 0), n.precision = t, n.rounding = e, finalise(quadrant == 2 || quadrant == 4 ? r.neg() : r, t, e, !0)) : new n(NaN);
|
|
2992
2998
|
};
|
|
2993
2999
|
P.times = P.mul = function(t) {
|
|
2994
|
-
var e, r, n, o, i, a, s, l, c, u = this,
|
|
2995
|
-
if (t.s *= u.s, !
|
|
2996
|
-
return new
|
|
2997
|
-
for (r = mathfloor(u.e / LOG_BASE) + mathfloor(t.e / LOG_BASE), l =
|
|
3000
|
+
var e, r, n, o, i, a, s, l, c, u = this, f = u.constructor, d = u.d, p = (t = new f(t)).d;
|
|
3001
|
+
if (t.s *= u.s, !d || !d[0] || !p || !p[0])
|
|
3002
|
+
return new f(!t.s || d && !d[0] && !p || p && !p[0] && !d ? NaN : !d || !p ? t.s / 0 : t.s * 0);
|
|
3003
|
+
for (r = mathfloor(u.e / LOG_BASE) + mathfloor(t.e / LOG_BASE), l = d.length, c = p.length, l < c && (i = d, d = p, p = i, a = l, l = c, c = a), i = [], a = l + c, n = a; n--; ) i.push(0);
|
|
2998
3004
|
for (n = c; --n >= 0; ) {
|
|
2999
3005
|
for (e = 0, o = l + n; o > n; )
|
|
3000
|
-
s = i[o] + p[n] *
|
|
3006
|
+
s = i[o] + p[n] * d[o - n - 1] + e, i[o--] = s % BASE | 0, e = s / BASE | 0;
|
|
3001
3007
|
i[o] = (i[o] + e) % BASE | 0;
|
|
3002
3008
|
}
|
|
3003
3009
|
for (; !i[--a]; ) i.pop();
|
|
3004
|
-
return e ? ++r : i.shift(), t.d = i, t.e = getBase10Exponent(i, r), external ? finalise(t,
|
|
3010
|
+
return e ? ++r : i.shift(), t.d = i, t.e = getBase10Exponent(i, r), external ? finalise(t, f.precision, f.rounding) : t;
|
|
3005
3011
|
};
|
|
3006
3012
|
P.toBinary = function(t, e) {
|
|
3007
3013
|
return toStringBinary(this, 2, t, e);
|
|
@@ -3019,7 +3025,7 @@ P.toFixed = function(t, e) {
|
|
|
3019
3025
|
return t === void 0 ? r = finiteToString(o) : (checkInt32(t, 0, MAX_DIGITS), e === void 0 ? e = i.rounding : checkInt32(e, 0, 8), n = finalise(new i(o), t + o.e + 1, e), r = finiteToString(n, !1, t + n.e + 1)), o.isNeg() && !o.isZero() ? "-" + r : r;
|
|
3020
3026
|
};
|
|
3021
3027
|
P.toFraction = function(t) {
|
|
3022
|
-
var e, r, n, o, i, a, s, l, c, u,
|
|
3028
|
+
var e, r, n, o, i, a, s, l, c, u, f, d, p = this, m = p.d, g = p.constructor;
|
|
3023
3029
|
if (!m) return new g(p);
|
|
3024
3030
|
if (c = r = new g(1), n = l = new g(0), e = new g(n), i = e.e = getPrecision(m) - p.e - 1, a = i % LOG_BASE, e.d[0] = mathpow(10, a < 0 ? LOG_BASE + a : a), t == null)
|
|
3025
3031
|
t = i > 0 ? e : c;
|
|
@@ -3027,9 +3033,9 @@ P.toFraction = function(t) {
|
|
|
3027
3033
|
if (s = new g(t), !s.isInt() || s.lt(c)) throw Error(invalidArgument + s);
|
|
3028
3034
|
t = s.gt(e) ? i > 0 ? e : c : s;
|
|
3029
3035
|
}
|
|
3030
|
-
for (external = !1, s = new g(digitsToString(m)), u = g.precision, g.precision = i = m.length * LOG_BASE * 2;
|
|
3031
|
-
r = n, n = o, o = c, c = l.plus(
|
|
3032
|
-
return o = divide(t.minus(r), n, 0, 1, 1), l = l.plus(o.times(c)), r = r.plus(o.times(n)), l.s = c.s = p.s,
|
|
3036
|
+
for (external = !1, s = new g(digitsToString(m)), u = g.precision, g.precision = i = m.length * LOG_BASE * 2; f = divide(s, e, 0, 1, 1), o = r.plus(f.times(n)), o.cmp(t) != 1; )
|
|
3037
|
+
r = n, n = o, o = c, c = l.plus(f.times(o)), l = o, o = e, e = s.minus(f.times(o)), s = o;
|
|
3038
|
+
return o = divide(t.minus(r), n, 0, 1, 1), l = l.plus(o.times(c)), r = r.plus(o.times(n)), l.s = c.s = p.s, d = divide(c, n, i, 1).minus(p).abs().cmp(divide(l, r, i, 1).minus(p).abs()) < 1 ? [c, n] : [l, r], g.precision = u, external = !0, d;
|
|
3033
3039
|
};
|
|
3034
3040
|
P.toHexadecimal = P.toHex = function(t, e) {
|
|
3035
3041
|
return toStringBinary(this, 16, t, e);
|
|
@@ -3148,7 +3154,7 @@ var divide = /* @__PURE__ */ function() {
|
|
|
3148
3154
|
for (; !n[0] && n.length > 1; ) n.shift();
|
|
3149
3155
|
}
|
|
3150
3156
|
return function(n, o, i, a, s, l) {
|
|
3151
|
-
var c, u,
|
|
3157
|
+
var c, u, f, d, p, m, g, _, E, $, y, v, C, w, b, N, R, A, k, F, L = n.constructor, O = n.s == o.s ? 1 : -1, x = n.d, D = o.d;
|
|
3152
3158
|
if (!x || !x[0] || !D || !D[0])
|
|
3153
3159
|
return new L(
|
|
3154
3160
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
@@ -3157,65 +3163,65 @@ var divide = /* @__PURE__ */ function() {
|
|
|
3157
3163
|
x && x[0] == 0 || !D ? O * 0 : O / 0
|
|
3158
3164
|
)
|
|
3159
3165
|
);
|
|
3160
|
-
for (l ? (p = 1, u = n.e - o.e) : (l = BASE, p = LOG_BASE, u = mathfloor(n.e / p) - mathfloor(o.e / p)), k = D.length, R = x.length,
|
|
3161
|
-
if (D[
|
|
3166
|
+
for (l ? (p = 1, u = n.e - o.e) : (l = BASE, p = LOG_BASE, u = mathfloor(n.e / p) - mathfloor(o.e / p)), k = D.length, R = x.length, E = new L(O), $ = E.d = [], f = 0; D[f] == (x[f] || 0); f++) ;
|
|
3167
|
+
if (D[f] > (x[f] || 0) && u--, i == null ? (w = i = L.precision, a = L.rounding) : s ? w = i + (n.e - o.e) + 1 : w = i, w < 0)
|
|
3162
3168
|
$.push(1), m = !0;
|
|
3163
3169
|
else {
|
|
3164
|
-
if (
|
|
3165
|
-
for (
|
|
3166
|
-
b =
|
|
3167
|
-
m =
|
|
3170
|
+
if (w = w / p + 2 | 0, f = 0, k == 1) {
|
|
3171
|
+
for (d = 0, D = D[0], w++; (f < R || d) && w--; f++)
|
|
3172
|
+
b = d * l + (x[f] || 0), $[f] = b / D | 0, d = b % D | 0;
|
|
3173
|
+
m = d || f < R;
|
|
3168
3174
|
} else {
|
|
3169
|
-
for (
|
|
3175
|
+
for (d = l / (D[0] + 1) | 0, d > 1 && (D = t(D, d, l), x = t(x, d, l), k = D.length, R = x.length), N = k, y = x.slice(0, k), v = y.length; v < k; ) y[v++] = 0;
|
|
3170
3176
|
F = D.slice(), F.unshift(0), A = D[0], D[1] >= l / 2 && ++A;
|
|
3171
3177
|
do
|
|
3172
|
-
|
|
3173
|
-
while ((N++ < R || y[0] !== void 0) &&
|
|
3178
|
+
d = 0, c = e(D, y, k, v), c < 0 ? (C = y[0], k != v && (C = C * l + (y[1] || 0)), d = C / A | 0, d > 1 ? (d >= l && (d = l - 1), g = t(D, d, l), _ = g.length, v = y.length, c = e(g, y, _, v), c == 1 && (d--, r(g, k < _ ? F : D, _, l))) : (d == 0 && (c = d = 1), g = D.slice()), _ = g.length, _ < v && g.unshift(0), r(y, g, v, l), c == -1 && (v = y.length, c = e(D, y, k, v), c < 1 && (d++, r(y, k < v ? F : D, v, l))), v = y.length) : c === 0 && (d++, y = [0]), $[f++] = d, c && y[0] ? y[v++] = x[N] || 0 : (y = [x[N]], v = 1);
|
|
3179
|
+
while ((N++ < R || y[0] !== void 0) && w--);
|
|
3174
3180
|
m = y[0] !== void 0;
|
|
3175
3181
|
}
|
|
3176
3182
|
$[0] || $.shift();
|
|
3177
3183
|
}
|
|
3178
3184
|
if (p == 1)
|
|
3179
|
-
|
|
3185
|
+
E.e = u, inexact = m;
|
|
3180
3186
|
else {
|
|
3181
|
-
for (
|
|
3182
|
-
|
|
3187
|
+
for (f = 1, d = $[0]; d >= 10; d /= 10) f++;
|
|
3188
|
+
E.e = f + u * p - 1, finalise(E, s ? i + E.e + 1 : i, a, m);
|
|
3183
3189
|
}
|
|
3184
|
-
return
|
|
3190
|
+
return E;
|
|
3185
3191
|
};
|
|
3186
3192
|
}();
|
|
3187
3193
|
function finalise(t, e, r, n) {
|
|
3188
|
-
var o, i, a, s, l, c, u,
|
|
3194
|
+
var o, i, a, s, l, c, u, f, d, p = t.constructor;
|
|
3189
3195
|
e: if (e != null) {
|
|
3190
|
-
if (
|
|
3191
|
-
for (o = 1, s =
|
|
3196
|
+
if (f = t.d, !f) return t;
|
|
3197
|
+
for (o = 1, s = f[0]; s >= 10; s /= 10) o++;
|
|
3192
3198
|
if (i = e - o, i < 0)
|
|
3193
|
-
i += LOG_BASE, a = e, u = d
|
|
3194
|
-
else if (
|
|
3199
|
+
i += LOG_BASE, a = e, u = f[d = 0], l = u / mathpow(10, o - a - 1) % 10 | 0;
|
|
3200
|
+
else if (d = Math.ceil((i + 1) / LOG_BASE), s = f.length, d >= s)
|
|
3195
3201
|
if (n) {
|
|
3196
|
-
for (; s++ <=
|
|
3202
|
+
for (; s++ <= d; ) f.push(0);
|
|
3197
3203
|
u = l = 0, o = 1, i %= LOG_BASE, a = i - LOG_BASE + 1;
|
|
3198
3204
|
} else
|
|
3199
3205
|
break e;
|
|
3200
3206
|
else {
|
|
3201
|
-
for (u = s = d
|
|
3207
|
+
for (u = s = f[d], o = 1; s >= 10; s /= 10) o++;
|
|
3202
3208
|
i %= LOG_BASE, a = i - LOG_BASE + o, l = a < 0 ? 0 : u / mathpow(10, o - a - 1) % 10 | 0;
|
|
3203
3209
|
}
|
|
3204
|
-
if (n = n || e < 0 || d
|
|
3205
|
-
(i > 0 ? a > 0 ? u / mathpow(10, o - a) : 0 : d
|
|
3206
|
-
return
|
|
3207
|
-
if (i == 0 ? (
|
|
3210
|
+
if (n = n || e < 0 || f[d + 1] !== void 0 || (a < 0 ? u : u % mathpow(10, o - a - 1)), c = r < 4 ? (l || n) && (r == 0 || r == (t.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (r == 4 || n || r == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
3211
|
+
(i > 0 ? a > 0 ? u / mathpow(10, o - a) : 0 : f[d - 1]) % 10 & 1 || r == (t.s < 0 ? 8 : 7)), e < 1 || !f[0])
|
|
3212
|
+
return f.length = 0, c ? (e -= t.e + 1, f[0] = mathpow(10, (LOG_BASE - e % LOG_BASE) % LOG_BASE), t.e = -e || 0) : f[0] = t.e = 0, t;
|
|
3213
|
+
if (i == 0 ? (f.length = d, s = 1, d--) : (f.length = d + 1, s = mathpow(10, LOG_BASE - i), f[d] = a > 0 ? (u / mathpow(10, o - a) % mathpow(10, a) | 0) * s : 0), c)
|
|
3208
3214
|
for (; ; )
|
|
3209
|
-
if (
|
|
3210
|
-
for (i = 1, a =
|
|
3211
|
-
for (a =
|
|
3212
|
-
i != s && (t.e++,
|
|
3215
|
+
if (d == 0) {
|
|
3216
|
+
for (i = 1, a = f[0]; a >= 10; a /= 10) i++;
|
|
3217
|
+
for (a = f[0] += s, s = 1; a >= 10; a /= 10) s++;
|
|
3218
|
+
i != s && (t.e++, f[0] == BASE && (f[0] = 1));
|
|
3213
3219
|
break;
|
|
3214
3220
|
} else {
|
|
3215
|
-
if (d
|
|
3216
|
-
d
|
|
3221
|
+
if (f[d] += s, f[d] != BASE) break;
|
|
3222
|
+
f[d--] = 0, s = 1;
|
|
3217
3223
|
}
|
|
3218
|
-
for (i =
|
|
3224
|
+
for (i = f.length; f[--i] === 0; ) f.pop();
|
|
3219
3225
|
}
|
|
3220
3226
|
return external && (t.e > p.maxE ? (t.d = null, t.e = NaN) : t.e < p.minE && (t.e = 0, t.d = [0])), t;
|
|
3221
3227
|
}
|
|
@@ -3275,44 +3281,44 @@ function maxOrMin(t, e, r) {
|
|
|
3275
3281
|
return i;
|
|
3276
3282
|
}
|
|
3277
3283
|
function naturalExponential(t, e) {
|
|
3278
|
-
var r, n, o, i, a, s, l, c = 0, u = 0,
|
|
3284
|
+
var r, n, o, i, a, s, l, c = 0, u = 0, f = 0, d = t.constructor, p = d.rounding, m = d.precision;
|
|
3279
3285
|
if (!t.d || !t.d[0] || t.e > 17)
|
|
3280
|
-
return new
|
|
3281
|
-
for (e == null ? (external = !1, l = m) : l = e, s = new
|
|
3282
|
-
t = t.times(s),
|
|
3283
|
-
for (n = Math.log(mathpow(2,
|
|
3286
|
+
return new d(t.d ? t.d[0] ? t.s < 0 ? 0 : 1 / 0 : 1 : t.s ? t.s < 0 ? 0 : t : NaN);
|
|
3287
|
+
for (e == null ? (external = !1, l = m) : l = e, s = new d(0.03125); t.e > -2; )
|
|
3288
|
+
t = t.times(s), f += 5;
|
|
3289
|
+
for (n = Math.log(mathpow(2, f)) / Math.LN10 * 2 + 5 | 0, l += n, r = i = a = new d(1), d.precision = l; ; ) {
|
|
3284
3290
|
if (i = finalise(i.times(t), l, 1), r = r.times(++u), s = a.plus(divide(i, r, l, 1)), digitsToString(s.d).slice(0, l) === digitsToString(a.d).slice(0, l)) {
|
|
3285
|
-
for (o =
|
|
3291
|
+
for (o = f; o--; ) a = finalise(a.times(a), l, 1);
|
|
3286
3292
|
if (e == null)
|
|
3287
3293
|
if (c < 3 && checkRoundingDigits(a.d, l - n, p, c))
|
|
3288
|
-
|
|
3294
|
+
d.precision = l += 10, r = i = s = new d(1), u = 0, c++;
|
|
3289
3295
|
else
|
|
3290
|
-
return finalise(a,
|
|
3296
|
+
return finalise(a, d.precision = m, p, external = !0);
|
|
3291
3297
|
else
|
|
3292
|
-
return
|
|
3298
|
+
return d.precision = m, a;
|
|
3293
3299
|
}
|
|
3294
3300
|
a = s;
|
|
3295
3301
|
}
|
|
3296
3302
|
}
|
|
3297
3303
|
function naturalLogarithm(t, e) {
|
|
3298
|
-
var r, n, o, i, a, s, l, c, u,
|
|
3304
|
+
var r, n, o, i, a, s, l, c, u, f, d, p = 1, m = 10, g = t, _ = g.d, E = g.constructor, $ = E.rounding, y = E.precision;
|
|
3299
3305
|
if (g.s < 0 || !_ || !_[0] || !g.e && _[0] == 1 && _.length == 1)
|
|
3300
|
-
return new
|
|
3301
|
-
if (e == null ? (external = !1, u = y) : u = e,
|
|
3306
|
+
return new E(_ && !_[0] ? -1 / 0 : g.s != 1 ? NaN : _ ? 0 : g);
|
|
3307
|
+
if (e == null ? (external = !1, u = y) : u = e, E.precision = u += m, r = digitsToString(_), n = r.charAt(0), Math.abs(i = g.e) < 15e14) {
|
|
3302
3308
|
for (; n < 7 && n != 1 || n == 1 && r.charAt(1) > 3; )
|
|
3303
3309
|
g = g.times(t), r = digitsToString(g.d), n = r.charAt(0), p++;
|
|
3304
|
-
i = g.e, n > 1 ? (g = new
|
|
3310
|
+
i = g.e, n > 1 ? (g = new E("0." + r), i++) : g = new E(n + "." + r.slice(1));
|
|
3305
3311
|
} else
|
|
3306
|
-
return c = getLn10(
|
|
3307
|
-
for (
|
|
3308
|
-
if (a = finalise(a.times(
|
|
3309
|
-
if (l = l.times(2), i !== 0 && (l = l.plus(getLn10(
|
|
3312
|
+
return c = getLn10(E, u + 2, y).times(i + ""), g = naturalLogarithm(new E(n + "." + r.slice(1)), u - m).plus(c), E.precision = y, e == null ? finalise(g, y, $, external = !0) : g;
|
|
3313
|
+
for (f = g, l = a = g = divide(g.minus(1), g.plus(1), u, 1), d = finalise(g.times(g), u, 1), o = 3; ; ) {
|
|
3314
|
+
if (a = finalise(a.times(d), u, 1), c = l.plus(divide(a, new E(o), u, 1)), digitsToString(c.d).slice(0, u) === digitsToString(l.d).slice(0, u))
|
|
3315
|
+
if (l = l.times(2), i !== 0 && (l = l.plus(getLn10(E, u + 2, y).times(i + ""))), l = divide(l, new E(p), u, 1), e == null)
|
|
3310
3316
|
if (checkRoundingDigits(l.d, u - m, $, s))
|
|
3311
|
-
|
|
3317
|
+
E.precision = u += m, c = a = g = divide(f.minus(1), f.plus(1), u, 1), d = finalise(g.times(g), u, 1), o = s = 1;
|
|
3312
3318
|
else
|
|
3313
|
-
return finalise(l,
|
|
3319
|
+
return finalise(l, E.precision = y, $, external = !0);
|
|
3314
3320
|
else
|
|
3315
|
-
return
|
|
3321
|
+
return E.precision = y, l;
|
|
3316
3322
|
l = c, o += 2;
|
|
3317
3323
|
}
|
|
3318
3324
|
}
|
|
@@ -3390,25 +3396,25 @@ function toLessThanHalfPi(t, e) {
|
|
|
3390
3396
|
return e.minus(o).abs();
|
|
3391
3397
|
}
|
|
3392
3398
|
function toStringBinary(t, e, r, n) {
|
|
3393
|
-
var o, i, a, s, l, c, u,
|
|
3399
|
+
var o, i, a, s, l, c, u, f, d, p = t.constructor, m = r !== void 0;
|
|
3394
3400
|
if (m ? (checkInt32(r, 1, MAX_DIGITS), n === void 0 ? n = p.rounding : checkInt32(n, 0, 8)) : (r = p.precision, n = p.rounding), !t.isFinite())
|
|
3395
3401
|
u = nonFiniteToString(t);
|
|
3396
3402
|
else {
|
|
3397
|
-
for (u = finiteToString(t), a = u.indexOf("."), m ? (o = 2, e == 16 ? r = r * 4 - 3 : e == 8 && (r = r * 3 - 2)) : o = e, a >= 0 && (u = u.replace(".", ""),
|
|
3398
|
-
if (!
|
|
3403
|
+
for (u = finiteToString(t), a = u.indexOf("."), m ? (o = 2, e == 16 ? r = r * 4 - 3 : e == 8 && (r = r * 3 - 2)) : o = e, a >= 0 && (u = u.replace(".", ""), d = new p(1), d.e = u.length - a, d.d = convertBase(finiteToString(d), 10, o), d.e = d.d.length), f = convertBase(u, 10, o), i = l = f.length; f[--l] == 0; ) f.pop();
|
|
3404
|
+
if (!f[0])
|
|
3399
3405
|
u = m ? "0p+0" : "0";
|
|
3400
3406
|
else {
|
|
3401
|
-
if (a < 0 ? i-- : (t = new p(t), t.d =
|
|
3402
|
-
for (; ++
|
|
3403
|
-
|
|
3404
|
-
for (l =
|
|
3405
|
-
for (a = 0, u = ""; a < l; a++) u += NUMERALS.charAt(
|
|
3407
|
+
if (a < 0 ? i-- : (t = new p(t), t.d = f, t.e = i, t = divide(t, d, r, n, 0, o), f = t.d, i = t.e, c = inexact), a = f[r], s = o / 2, c = c || f[r + 1] !== void 0, c = n < 4 ? (a !== void 0 || c) && (n === 0 || n === (t.s < 0 ? 3 : 2)) : a > s || a === s && (n === 4 || c || n === 6 && f[r - 1] & 1 || n === (t.s < 0 ? 8 : 7)), f.length = r, c)
|
|
3408
|
+
for (; ++f[--r] > o - 1; )
|
|
3409
|
+
f[r] = 0, r || (++i, f.unshift(1));
|
|
3410
|
+
for (l = f.length; !f[l - 1]; --l) ;
|
|
3411
|
+
for (a = 0, u = ""; a < l; a++) u += NUMERALS.charAt(f[a]);
|
|
3406
3412
|
if (m) {
|
|
3407
3413
|
if (l > 1)
|
|
3408
3414
|
if (e == 16 || e == 8) {
|
|
3409
3415
|
for (a = e == 16 ? 4 : 3, --l; l % a; l++) u += "0";
|
|
3410
|
-
for (
|
|
3411
|
-
for (a = 1, u = "1."; a < l; a++) u += NUMERALS.charAt(
|
|
3416
|
+
for (f = convertBase(u, o, e), l = f.length; !f[l - 1]; --l) ;
|
|
3417
|
+
for (a = 1, u = "1."; a < l; a++) u += NUMERALS.charAt(f[a]);
|
|
3412
3418
|
} else
|
|
3413
3419
|
u = u.charAt(0) + "." + u.slice(1);
|
|
3414
3420
|
u = u + (i < 0 ? "p" : "p+") + i;
|
|
@@ -6485,11 +6491,11 @@ var maskPattern = {};
|
|
|
6485
6491
|
}, t.getPenaltyN1 = function(o) {
|
|
6486
6492
|
const i = o.size;
|
|
6487
6493
|
let a = 0, s = 0, l = 0, c = null, u = null;
|
|
6488
|
-
for (let
|
|
6494
|
+
for (let f = 0; f < i; f++) {
|
|
6489
6495
|
s = l = 0, c = u = null;
|
|
6490
|
-
for (let
|
|
6491
|
-
let p = o.get(
|
|
6492
|
-
p === c ? s++ : (s >= 5 && (a += e.N1 + (s - 5)), c = p, s = 1), p = o.get(
|
|
6496
|
+
for (let d = 0; d < i; d++) {
|
|
6497
|
+
let p = o.get(f, d);
|
|
6498
|
+
p === c ? s++ : (s >= 5 && (a += e.N1 + (s - 5)), c = p, s = 1), p = o.get(d, f), p === u ? l++ : (l >= 5 && (a += e.N1 + (l - 5)), u = p, l = 1);
|
|
6493
6499
|
}
|
|
6494
6500
|
s >= 5 && (a += e.N1 + (s - 5)), l >= 5 && (a += e.N1 + (l - 5));
|
|
6495
6501
|
}
|
|
@@ -7060,24 +7066,24 @@ regex.testAlphanumeric = function t(e) {
|
|
|
7060
7066
|
})(mode);
|
|
7061
7067
|
(function(t) {
|
|
7062
7068
|
const e = utils$1, r = errorCorrectionCode, n = errorCorrectionLevel, o = mode, i = versionCheck, a = 7973, s = e.getBCHDigit(a);
|
|
7063
|
-
function l(
|
|
7069
|
+
function l(d, p, m) {
|
|
7064
7070
|
for (let g = 1; g <= 40; g++)
|
|
7065
|
-
if (p <= t.getCapacity(g, m,
|
|
7071
|
+
if (p <= t.getCapacity(g, m, d))
|
|
7066
7072
|
return g;
|
|
7067
7073
|
}
|
|
7068
|
-
function c(
|
|
7069
|
-
return o.getCharCountIndicator(
|
|
7074
|
+
function c(d, p) {
|
|
7075
|
+
return o.getCharCountIndicator(d, p) + 4;
|
|
7070
7076
|
}
|
|
7071
|
-
function u(
|
|
7077
|
+
function u(d, p) {
|
|
7072
7078
|
let m = 0;
|
|
7073
|
-
return
|
|
7079
|
+
return d.forEach(function(g) {
|
|
7074
7080
|
const _ = c(g.mode, p);
|
|
7075
7081
|
m += _ + g.getBitsLength();
|
|
7076
7082
|
}), m;
|
|
7077
7083
|
}
|
|
7078
|
-
function d
|
|
7084
|
+
function f(d, p) {
|
|
7079
7085
|
for (let m = 1; m <= 40; m++)
|
|
7080
|
-
if (u(
|
|
7086
|
+
if (u(d, m) <= t.getCapacity(m, p, o.MIXED))
|
|
7081
7087
|
return m;
|
|
7082
7088
|
}
|
|
7083
7089
|
t.from = function(p, m) {
|
|
@@ -7086,7 +7092,7 @@ regex.testAlphanumeric = function t(e) {
|
|
|
7086
7092
|
if (!i.isValid(p))
|
|
7087
7093
|
throw new Error("Invalid QR Code version");
|
|
7088
7094
|
typeof g > "u" && (g = o.BYTE);
|
|
7089
|
-
const _ = e.getSymbolTotalCodewords(p),
|
|
7095
|
+
const _ = e.getSymbolTotalCodewords(p), E = r.getTotalCodewordsCount(p, m), $ = (_ - E) * 8;
|
|
7090
7096
|
if (g === o.MIXED) return $;
|
|
7091
7097
|
const y = $ - c(g, p);
|
|
7092
7098
|
switch (g) {
|
|
@@ -7105,7 +7111,7 @@ regex.testAlphanumeric = function t(e) {
|
|
|
7105
7111
|
const _ = n.from(m, n.M);
|
|
7106
7112
|
if (Array.isArray(p)) {
|
|
7107
7113
|
if (p.length > 1)
|
|
7108
|
-
return
|
|
7114
|
+
return f(p, _);
|
|
7109
7115
|
if (p.length === 0)
|
|
7110
7116
|
return 1;
|
|
7111
7117
|
g = p[0];
|
|
@@ -7275,14 +7281,14 @@ var kanjiData = KanjiData, dijkstra = { exports: {} };
|
|
|
7275
7281
|
a[n] = 0;
|
|
7276
7282
|
var s = e.PriorityQueue.make();
|
|
7277
7283
|
s.push(n, 0);
|
|
7278
|
-
for (var l, c, u,
|
|
7279
|
-
l = s.pop(), c = l.value,
|
|
7280
|
-
for (u in
|
|
7281
|
-
|
|
7284
|
+
for (var l, c, u, f, d, p, m, g, _; !s.empty(); ) {
|
|
7285
|
+
l = s.pop(), c = l.value, f = l.cost, d = r[c] || {};
|
|
7286
|
+
for (u in d)
|
|
7287
|
+
d.hasOwnProperty(u) && (p = d[u], m = f + p, g = a[u], _ = typeof a[u] > "u", (_ || g > m) && (a[u] = m, s.push(u, m), i[u] = c));
|
|
7282
7288
|
}
|
|
7283
7289
|
if (typeof o < "u" && typeof a[o] > "u") {
|
|
7284
|
-
var
|
|
7285
|
-
throw new Error(
|
|
7290
|
+
var E = ["Could not find a path from ", n, " to ", o, "."].join("");
|
|
7291
|
+
throw new Error(E);
|
|
7286
7292
|
}
|
|
7287
7293
|
return i;
|
|
7288
7294
|
},
|
|
@@ -7336,25 +7342,25 @@ var kanjiData = KanjiData, dijkstra = { exports: {} };
|
|
|
7336
7342
|
var dijkstraExports = dijkstra.exports;
|
|
7337
7343
|
(function(t) {
|
|
7338
7344
|
const e = mode, r = numericData, n = alphanumericData, o = byteData, i = kanjiData, a = regex, s = utils$1, l = dijkstraExports;
|
|
7339
|
-
function c(
|
|
7340
|
-
return unescape(encodeURIComponent(
|
|
7341
|
-
}
|
|
7342
|
-
function u(
|
|
7343
|
-
const
|
|
7344
|
-
let
|
|
7345
|
-
for (; (
|
|
7346
|
-
|
|
7347
|
-
data:
|
|
7348
|
-
index:
|
|
7345
|
+
function c(E) {
|
|
7346
|
+
return unescape(encodeURIComponent(E)).length;
|
|
7347
|
+
}
|
|
7348
|
+
function u(E, $, y) {
|
|
7349
|
+
const v = [];
|
|
7350
|
+
let C;
|
|
7351
|
+
for (; (C = E.exec(y)) !== null; )
|
|
7352
|
+
v.push({
|
|
7353
|
+
data: C[0],
|
|
7354
|
+
index: C.index,
|
|
7349
7355
|
mode: $,
|
|
7350
|
-
length:
|
|
7356
|
+
length: C[0].length
|
|
7351
7357
|
});
|
|
7352
|
-
return
|
|
7358
|
+
return v;
|
|
7353
7359
|
}
|
|
7354
|
-
function
|
|
7355
|
-
const $ = u(a.NUMERIC, e.NUMERIC,
|
|
7356
|
-
let
|
|
7357
|
-
return s.isKanjiModeEnabled() ? (
|
|
7360
|
+
function f(E) {
|
|
7361
|
+
const $ = u(a.NUMERIC, e.NUMERIC, E), y = u(a.ALPHANUMERIC, e.ALPHANUMERIC, E);
|
|
7362
|
+
let v, C;
|
|
7363
|
+
return s.isKanjiModeEnabled() ? (v = u(a.BYTE, e.BYTE, E), C = u(a.KANJI, e.KANJI, E)) : (v = u(a.BYTE_KANJI, e.BYTE, E), C = []), $.concat(y, v, C).sort(function(b, N) {
|
|
7358
7364
|
return b.index - N.index;
|
|
7359
7365
|
}).map(function(b) {
|
|
7360
7366
|
return {
|
|
@@ -7364,104 +7370,104 @@ var dijkstraExports = dijkstra.exports;
|
|
|
7364
7370
|
};
|
|
7365
7371
|
});
|
|
7366
7372
|
}
|
|
7367
|
-
function
|
|
7373
|
+
function d(E, $) {
|
|
7368
7374
|
switch ($) {
|
|
7369
7375
|
case e.NUMERIC:
|
|
7370
|
-
return r.getBitsLength(
|
|
7376
|
+
return r.getBitsLength(E);
|
|
7371
7377
|
case e.ALPHANUMERIC:
|
|
7372
|
-
return n.getBitsLength(
|
|
7378
|
+
return n.getBitsLength(E);
|
|
7373
7379
|
case e.KANJI:
|
|
7374
|
-
return i.getBitsLength(
|
|
7380
|
+
return i.getBitsLength(E);
|
|
7375
7381
|
case e.BYTE:
|
|
7376
|
-
return o.getBitsLength(
|
|
7382
|
+
return o.getBitsLength(E);
|
|
7377
7383
|
}
|
|
7378
7384
|
}
|
|
7379
|
-
function p(
|
|
7380
|
-
return
|
|
7381
|
-
const
|
|
7382
|
-
return
|
|
7385
|
+
function p(E) {
|
|
7386
|
+
return E.reduce(function($, y) {
|
|
7387
|
+
const v = $.length - 1 >= 0 ? $[$.length - 1] : null;
|
|
7388
|
+
return v && v.mode === y.mode ? ($[$.length - 1].data += y.data, $) : ($.push(y), $);
|
|
7383
7389
|
}, []);
|
|
7384
7390
|
}
|
|
7385
|
-
function m(
|
|
7391
|
+
function m(E) {
|
|
7386
7392
|
const $ = [];
|
|
7387
|
-
for (let y = 0; y <
|
|
7388
|
-
const
|
|
7389
|
-
switch (
|
|
7393
|
+
for (let y = 0; y < E.length; y++) {
|
|
7394
|
+
const v = E[y];
|
|
7395
|
+
switch (v.mode) {
|
|
7390
7396
|
case e.NUMERIC:
|
|
7391
7397
|
$.push([
|
|
7392
|
-
|
|
7393
|
-
{ data:
|
|
7394
|
-
{ data:
|
|
7398
|
+
v,
|
|
7399
|
+
{ data: v.data, mode: e.ALPHANUMERIC, length: v.length },
|
|
7400
|
+
{ data: v.data, mode: e.BYTE, length: v.length }
|
|
7395
7401
|
]);
|
|
7396
7402
|
break;
|
|
7397
7403
|
case e.ALPHANUMERIC:
|
|
7398
7404
|
$.push([
|
|
7399
|
-
|
|
7400
|
-
{ data:
|
|
7405
|
+
v,
|
|
7406
|
+
{ data: v.data, mode: e.BYTE, length: v.length }
|
|
7401
7407
|
]);
|
|
7402
7408
|
break;
|
|
7403
7409
|
case e.KANJI:
|
|
7404
7410
|
$.push([
|
|
7405
|
-
|
|
7406
|
-
{ data:
|
|
7411
|
+
v,
|
|
7412
|
+
{ data: v.data, mode: e.BYTE, length: c(v.data) }
|
|
7407
7413
|
]);
|
|
7408
7414
|
break;
|
|
7409
7415
|
case e.BYTE:
|
|
7410
7416
|
$.push([
|
|
7411
|
-
{ data:
|
|
7417
|
+
{ data: v.data, mode: e.BYTE, length: c(v.data) }
|
|
7412
7418
|
]);
|
|
7413
7419
|
}
|
|
7414
7420
|
}
|
|
7415
7421
|
return $;
|
|
7416
7422
|
}
|
|
7417
|
-
function g(
|
|
7418
|
-
const y = {},
|
|
7419
|
-
let
|
|
7420
|
-
for (let
|
|
7421
|
-
const b =
|
|
7423
|
+
function g(E, $) {
|
|
7424
|
+
const y = {}, v = { start: {} };
|
|
7425
|
+
let C = ["start"];
|
|
7426
|
+
for (let w = 0; w < E.length; w++) {
|
|
7427
|
+
const b = E[w], N = [];
|
|
7422
7428
|
for (let R = 0; R < b.length; R++) {
|
|
7423
|
-
const A = b[R], k = "" +
|
|
7424
|
-
N.push(k), y[k] = { node: A, lastCount: 0 },
|
|
7425
|
-
for (let F = 0; F <
|
|
7426
|
-
const L =
|
|
7427
|
-
y[L] && y[L].node.mode === A.mode ? (
|
|
7429
|
+
const A = b[R], k = "" + w + R;
|
|
7430
|
+
N.push(k), y[k] = { node: A, lastCount: 0 }, v[k] = {};
|
|
7431
|
+
for (let F = 0; F < C.length; F++) {
|
|
7432
|
+
const L = C[F];
|
|
7433
|
+
y[L] && y[L].node.mode === A.mode ? (v[L][k] = d(y[L].lastCount + A.length, A.mode) - d(y[L].lastCount, A.mode), y[L].lastCount += A.length) : (y[L] && (y[L].lastCount = A.length), v[L][k] = d(A.length, A.mode) + 4 + e.getCharCountIndicator(A.mode, $));
|
|
7428
7434
|
}
|
|
7429
7435
|
}
|
|
7430
|
-
|
|
7436
|
+
C = N;
|
|
7431
7437
|
}
|
|
7432
|
-
for (let
|
|
7433
|
-
|
|
7434
|
-
return { map:
|
|
7438
|
+
for (let w = 0; w < C.length; w++)
|
|
7439
|
+
v[C[w]].end = 0;
|
|
7440
|
+
return { map: v, table: y };
|
|
7435
7441
|
}
|
|
7436
|
-
function _(
|
|
7442
|
+
function _(E, $) {
|
|
7437
7443
|
let y;
|
|
7438
|
-
const
|
|
7439
|
-
if (y = e.from($,
|
|
7440
|
-
throw new Error('"' +
|
|
7441
|
-
Suggested mode is: ` + e.toString(
|
|
7444
|
+
const v = e.getBestModeForData(E);
|
|
7445
|
+
if (y = e.from($, v), y !== e.BYTE && y.bit < v.bit)
|
|
7446
|
+
throw new Error('"' + E + '" cannot be encoded with mode ' + e.toString(y) + `.
|
|
7447
|
+
Suggested mode is: ` + e.toString(v));
|
|
7442
7448
|
switch (y === e.KANJI && !s.isKanjiModeEnabled() && (y = e.BYTE), y) {
|
|
7443
7449
|
case e.NUMERIC:
|
|
7444
|
-
return new r(
|
|
7450
|
+
return new r(E);
|
|
7445
7451
|
case e.ALPHANUMERIC:
|
|
7446
|
-
return new n(
|
|
7452
|
+
return new n(E);
|
|
7447
7453
|
case e.KANJI:
|
|
7448
|
-
return new i(
|
|
7454
|
+
return new i(E);
|
|
7449
7455
|
case e.BYTE:
|
|
7450
|
-
return new o(
|
|
7456
|
+
return new o(E);
|
|
7451
7457
|
}
|
|
7452
7458
|
}
|
|
7453
7459
|
t.fromArray = function($) {
|
|
7454
|
-
return $.reduce(function(y,
|
|
7455
|
-
return typeof
|
|
7460
|
+
return $.reduce(function(y, v) {
|
|
7461
|
+
return typeof v == "string" ? y.push(_(v, null)) : v.data && y.push(_(v.data, v.mode)), y;
|
|
7456
7462
|
}, []);
|
|
7457
7463
|
}, t.fromString = function($, y) {
|
|
7458
|
-
const
|
|
7464
|
+
const v = f($, s.isKanjiModeEnabled()), C = m(v), w = g(C, y), b = l.find_path(w.map, "start", "end"), N = [];
|
|
7459
7465
|
for (let R = 1; R < b.length - 1; R++)
|
|
7460
|
-
N.push(
|
|
7466
|
+
N.push(w.table[b[R]].node);
|
|
7461
7467
|
return t.fromArray(p(N));
|
|
7462
7468
|
}, t.rawSplit = function($) {
|
|
7463
7469
|
return t.fromArray(
|
|
7464
|
-
|
|
7470
|
+
f($, s.isKanjiModeEnabled())
|
|
7465
7471
|
);
|
|
7466
7472
|
};
|
|
7467
7473
|
})(segments);
|
|
@@ -7535,23 +7541,23 @@ function createData(t, e, r) {
|
|
|
7535
7541
|
return createCodewords(n, t, e);
|
|
7536
7542
|
}
|
|
7537
7543
|
function createCodewords(t, e, r) {
|
|
7538
|
-
const n = Utils$1.getSymbolTotalCodewords(e), o = ECCode.getTotalCodewordsCount(e, r), i = n - o, a = ECCode.getBlocksCount(e, r), s = n % a, l = a - s, c = Math.floor(n / a), u = Math.floor(i / a),
|
|
7544
|
+
const n = Utils$1.getSymbolTotalCodewords(e), o = ECCode.getTotalCodewordsCount(e, r), i = n - o, a = ECCode.getBlocksCount(e, r), s = n % a, l = a - s, c = Math.floor(n / a), u = Math.floor(i / a), f = u + 1, d = c - u, p = new ReedSolomonEncoder(d);
|
|
7539
7545
|
let m = 0;
|
|
7540
7546
|
const g = new Array(a), _ = new Array(a);
|
|
7541
|
-
let
|
|
7547
|
+
let E = 0;
|
|
7542
7548
|
const $ = new Uint8Array(t.buffer);
|
|
7543
7549
|
for (let b = 0; b < a; b++) {
|
|
7544
|
-
const N = b < l ? u :
|
|
7545
|
-
g[b] = $.slice(m, m + N), _[b] = p.encode(g[b]), m += N,
|
|
7550
|
+
const N = b < l ? u : f;
|
|
7551
|
+
g[b] = $.slice(m, m + N), _[b] = p.encode(g[b]), m += N, E = Math.max(E, N);
|
|
7546
7552
|
}
|
|
7547
7553
|
const y = new Uint8Array(n);
|
|
7548
|
-
let
|
|
7549
|
-
for (
|
|
7550
|
-
for (
|
|
7551
|
-
|
|
7552
|
-
for (
|
|
7553
|
-
for (
|
|
7554
|
-
y[
|
|
7554
|
+
let v = 0, C, w;
|
|
7555
|
+
for (C = 0; C < E; C++)
|
|
7556
|
+
for (w = 0; w < a; w++)
|
|
7557
|
+
C < g[w].length && (y[v++] = g[w][C]);
|
|
7558
|
+
for (C = 0; C < d; C++)
|
|
7559
|
+
for (w = 0; w < a; w++)
|
|
7560
|
+
y[v++] = _[w][C];
|
|
7555
7561
|
return y;
|
|
7556
7562
|
}
|
|
7557
7563
|
function createSymbol(t, e, r, n) {
|
|
@@ -7637,13 +7643,13 @@ var canvas = {}, utils = {};
|
|
|
7637
7643
|
const i = t.getScale(n, o);
|
|
7638
7644
|
return Math.floor((n + o.margin * 2) * i);
|
|
7639
7645
|
}, t.qrToImageData = function(n, o, i) {
|
|
7640
|
-
const a = o.modules.size, s = o.modules.data, l = t.getScale(a, i), c = Math.floor((a + i.margin * 2) * l), u = i.margin * l,
|
|
7641
|
-
for (let
|
|
7646
|
+
const a = o.modules.size, s = o.modules.data, l = t.getScale(a, i), c = Math.floor((a + i.margin * 2) * l), u = i.margin * l, f = [i.color.light, i.color.dark];
|
|
7647
|
+
for (let d = 0; d < c; d++)
|
|
7642
7648
|
for (let p = 0; p < c; p++) {
|
|
7643
|
-
let m = (
|
|
7644
|
-
if (
|
|
7645
|
-
const _ = Math.floor((
|
|
7646
|
-
g =
|
|
7649
|
+
let m = (d * c + p) * 4, g = i.color.light;
|
|
7650
|
+
if (d >= u && p >= u && d < c - u && p < c - u) {
|
|
7651
|
+
const _ = Math.floor((d - u) / l), E = Math.floor((p - u) / l);
|
|
7652
|
+
g = f[s[_ * a + E] ? 1 : 0];
|
|
7647
7653
|
}
|
|
7648
7654
|
n[m++] = g.r, n[m++] = g.g, n[m++] = g.b, n[m] = g.a;
|
|
7649
7655
|
}
|
|
@@ -7664,13 +7670,13 @@ var canvas = {}, utils = {};
|
|
|
7664
7670
|
t.render = function(i, a, s) {
|
|
7665
7671
|
let l = s, c = a;
|
|
7666
7672
|
typeof l > "u" && (!a || !a.getContext) && (l = a, a = void 0), a || (c = n()), l = e.getOptions(l);
|
|
7667
|
-
const u = e.getImageWidth(i.modules.size, l),
|
|
7668
|
-
return e.qrToImageData(
|
|
7673
|
+
const u = e.getImageWidth(i.modules.size, l), f = c.getContext("2d"), d = f.createImageData(u, u);
|
|
7674
|
+
return e.qrToImageData(d.data, i, l), r(f, c, u), f.putImageData(d, 0, 0), c;
|
|
7669
7675
|
}, t.renderToDataURL = function(i, a, s) {
|
|
7670
7676
|
let l = s;
|
|
7671
7677
|
typeof l > "u" && (!a || !a.getContext) && (l = a, a = void 0), l || (l = {});
|
|
7672
|
-
const c = t.render(i, a, l), u = l.type || "image/png",
|
|
7673
|
-
return c.toDataURL(u,
|
|
7678
|
+
const c = t.render(i, a, l), u = l.type || "image/png", f = l.rendererOpts || {};
|
|
7679
|
+
return c.toDataURL(u, f.quality);
|
|
7674
7680
|
};
|
|
7675
7681
|
})(canvas);
|
|
7676
7682
|
var svgTag = {};
|
|
@@ -7692,9 +7698,9 @@ function qrToPath(t, e, r) {
|
|
|
7692
7698
|
return n;
|
|
7693
7699
|
}
|
|
7694
7700
|
svgTag.render = function t(e, r, n) {
|
|
7695
|
-
const o = Utils.getOptions(r), i = e.modules.size, a = e.modules.data, s = i + o.margin * 2, l = o.color.light.a ? "<path " + getColorAttrib(o.color.light, "fill") + ' d="M0 0h' + s + "v" + s + 'H0z"/>' : "", c = "<path " + getColorAttrib(o.color.dark, "stroke") + ' d="' + qrToPath(a, i, o.margin) + '"/>', u = 'viewBox="0 0 ' + s + " " + s + '"',
|
|
7701
|
+
const o = Utils.getOptions(r), i = e.modules.size, a = e.modules.data, s = i + o.margin * 2, l = o.color.light.a ? "<path " + getColorAttrib(o.color.light, "fill") + ' d="M0 0h' + s + "v" + s + 'H0z"/>' : "", c = "<path " + getColorAttrib(o.color.dark, "stroke") + ' d="' + qrToPath(a, i, o.margin) + '"/>', u = 'viewBox="0 0 ' + s + " " + s + '"', d = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + u + ' shape-rendering="crispEdges">' + l + c + `</svg>
|
|
7696
7702
|
`;
|
|
7697
|
-
return typeof n == "function" && n(null,
|
|
7703
|
+
return typeof n == "function" && n(null, d), d;
|
|
7698
7704
|
};
|
|
7699
7705
|
const canPromise = canPromise$1, QRCode = qrcode, CanvasRenderer = canvas, SvgRenderer = svgTag;
|
|
7700
7706
|
function renderCanvas(t, e, r, n, o) {
|
|
@@ -7917,51 +7923,51 @@ function renderImageStyle(t) {
|
|
|
7917
7923
|
return t.width !== void 0 && e.push(`width:${t.width}px`), t.height !== void 0 && e.push(`height:${t.height}px`), t.fit && e.push(`object-fit:${t.fit}`), e.length ? e.join(";") : "";
|
|
7918
7924
|
}
|
|
7919
7925
|
function renderCell(t, e, r) {
|
|
7920
|
-
var $, y,
|
|
7926
|
+
var $, y, v, C, w;
|
|
7921
7927
|
const n = document.createElement("td");
|
|
7922
7928
|
n.setAttribute("data-cell-config", `${e.row}-${e.col}`), n.setAttribute("rowspan", e.rowSpan), n.setAttribute("colspan", e.colSpan);
|
|
7923
7929
|
const o = (($ = e.style) == null ? void 0 : $.allowContentOverflow) === !0;
|
|
7924
7930
|
n.style.boxSizing = "border-box", n.style.position = "relative", e.rowSpan <= 1 && (o ? n.style.minHeight = `${t.size ?? 25}px` : n.style.height = `${t.size ?? 25}px`);
|
|
7925
|
-
const i = { left: "flex-start", center: "center", right: "flex-end" }, a = { top: "flex-start", center: "center", bottom: "flex-end" }, s = i[(y = e.style) == null ? void 0 : y.textAlign] || "center", l = a[(
|
|
7931
|
+
const i = { left: "flex-start", center: "center", right: "flex-end" }, a = { top: "flex-start", center: "center", bottom: "flex-end" }, s = i[(y = e.style) == null ? void 0 : y.textAlign] || "center", l = a[(v = e.style) == null ? void 0 : v.verticalAlign] || "center", c = document.createElement("div");
|
|
7926
7932
|
o ? c.style.cssText = `overflow:visible;position:relative;display:flex;align-items:${l};justify-content:${s};` : c.style.cssText = `overflow:hidden;position:absolute;inset:0;display:flex;align-items:${l};justify-content:${s};`;
|
|
7927
|
-
let u = "",
|
|
7933
|
+
let u = "", f = !1, d = "";
|
|
7928
7934
|
switch (e.type) {
|
|
7929
7935
|
case CellType.ICON:
|
|
7930
|
-
|
|
7936
|
+
d = `<i class="iconfont ${e.data}"></i>`, f = !0;
|
|
7931
7937
|
break;
|
|
7932
7938
|
case CellType.IMAGE: {
|
|
7933
7939
|
const b = renderImageStyle(e.imageOptions);
|
|
7934
|
-
|
|
7940
|
+
d = `<img src="${e.rawData ?? e.data}" alt="" style="max-width:100%;max-height:100%;object-fit:contain${b ? ";" + b : ""}">`, f = !0;
|
|
7935
7941
|
break;
|
|
7936
7942
|
}
|
|
7937
7943
|
case CellType.RICH: {
|
|
7938
|
-
const b = [void 0, null, ""].includes(e.text) ? ((
|
|
7939
|
-
b && (
|
|
7944
|
+
const b = [void 0, null, ""].includes(e.text) ? ((C = e.formatType) == null ? void 0 : C.defaultCellContent) || "" : String(e.text);
|
|
7945
|
+
b && (d = b, f = !0);
|
|
7940
7946
|
break;
|
|
7941
7947
|
}
|
|
7942
7948
|
default:
|
|
7943
|
-
u = [void 0, null, ""].includes(e.text) ? ((
|
|
7949
|
+
u = [void 0, null, ""].includes(e.text) ? ((w = e.formatType) == null ? void 0 : w.defaultCellContent) || "" : e.text;
|
|
7944
7950
|
break;
|
|
7945
7951
|
}
|
|
7946
|
-
if (!
|
|
7952
|
+
if (!f && e.format === FormatType.BARCODE)
|
|
7947
7953
|
try {
|
|
7948
7954
|
const b = e.barcodeUrl || canvasPool.generateBarcode(u, e.barcodeOptions);
|
|
7949
|
-
b && (
|
|
7955
|
+
b && (d = `<img src="${b}" alt="barcode" style="max-width:100%;max-height:100%;object-fit:contain">`, f = !0);
|
|
7950
7956
|
} catch (b) {
|
|
7951
7957
|
console.error(`条形码生成失败 [${e.row}:${e.col}]:`, b);
|
|
7952
7958
|
}
|
|
7953
|
-
else if (!
|
|
7959
|
+
else if (!f && e.format === FormatType.QRCODE) {
|
|
7954
7960
|
const b = e.qrcodeData;
|
|
7955
|
-
b && (
|
|
7961
|
+
b && (d = `<img src="${b}" alt="qrcode" style="max-width:100%;max-height:100%;object-fit:contain">`, f = !0);
|
|
7956
7962
|
}
|
|
7957
|
-
if (
|
|
7958
|
-
c.innerHTML =
|
|
7963
|
+
if (f)
|
|
7964
|
+
c.innerHTML = d;
|
|
7959
7965
|
else {
|
|
7960
7966
|
const b = document.createElement("span");
|
|
7961
7967
|
b.style.cssText = "word-break:break-word;overflow-wrap:anywhere;", b.innerText = String(u), c.appendChild(b);
|
|
7962
7968
|
}
|
|
7963
|
-
const p = e.style || {}, m = p.paddingTop ?? TD_DEFAULT_PADDING_VERTICAL, g = p.paddingRight ?? TD_DEFAULT_PADDING_HORIZONTAL, _ = p.paddingBottom ?? TD_DEFAULT_PADDING_VERTICAL,
|
|
7964
|
-
if (c.style.paddingTop = `${m}px`, c.style.paddingRight = `${g}px`, c.style.paddingBottom = `${_}px`, c.style.paddingLeft = `${
|
|
7969
|
+
const p = e.style || {}, m = p.paddingTop ?? TD_DEFAULT_PADDING_VERTICAL, g = p.paddingRight ?? TD_DEFAULT_PADDING_HORIZONTAL, _ = p.paddingBottom ?? TD_DEFAULT_PADDING_VERTICAL, E = p.paddingLeft ?? TD_DEFAULT_PADDING_HORIZONTAL;
|
|
7970
|
+
if (c.style.paddingTop = `${m}px`, c.style.paddingRight = `${g}px`, c.style.paddingBottom = `${_}px`, c.style.paddingLeft = `${E}px`, n.appendChild(c), e.style && (n.setAttribute("style", renderCellStyle(e.style)), e.style.border)) {
|
|
7965
7971
|
const b = normalizeBorder(e.style.border);
|
|
7966
7972
|
b && (n.style.borderTop = getBorderCss(b.top, r), n.style.borderRight = getBorderCss(b.right, r), n.style.borderBottom = getBorderCss(b.bottom, r), n.style.borderLeft = getBorderCss(b.left, r));
|
|
7967
7973
|
}
|
|
@@ -8019,37 +8025,37 @@ function renderReportByDomForPrint(t, e, r, n, o) {
|
|
|
8019
8025
|
const s = renderColgroup(e, a);
|
|
8020
8026
|
a.appendChild(s);
|
|
8021
8027
|
const l = o ? getThemeColors(o) : null;
|
|
8022
|
-
let c = 0, u = 0,
|
|
8023
|
-
const
|
|
8028
|
+
let c = 0, u = 0, f = 0;
|
|
8029
|
+
const d = document.createDocumentFragment();
|
|
8024
8030
|
for (let m = 0; m < t.length; m++) {
|
|
8025
8031
|
const g = t[m];
|
|
8026
8032
|
if (g.isHidden) continue;
|
|
8027
8033
|
c += 1;
|
|
8028
8034
|
const _ = document.createElement("tr");
|
|
8029
8035
|
if (g.isFixed && (_.style.top = `${u - 1}px`, _.classList.add("fixed-row")), l) {
|
|
8030
|
-
const
|
|
8031
|
-
_.style.backgroundColor = g.isFixed ?
|
|
8036
|
+
const E = c % 2 === 0;
|
|
8037
|
+
_.style.backgroundColor = g.isFixed ? E ? l.fixedEvenBackground : l.fixedBackground : E ? l.evenBackground : l.background;
|
|
8032
8038
|
}
|
|
8033
|
-
u += (g.size ?? 25) - 1, _.style.height = `${g.size ?? 25}px`,
|
|
8034
|
-
for (let
|
|
8035
|
-
const $ = e[
|
|
8039
|
+
u += (g.size ?? 25) - 1, _.style.height = `${g.size ?? 25}px`, f = 0;
|
|
8040
|
+
for (let E = 0; E < e.length; E++) {
|
|
8041
|
+
const $ = e[E];
|
|
8036
8042
|
if ($.isHidden) continue;
|
|
8037
|
-
const y = r[m][
|
|
8043
|
+
const y = r[m][E];
|
|
8038
8044
|
if (g && y && (g.size ?? 25) > 0) {
|
|
8039
|
-
const
|
|
8040
|
-
if ($.isFixed === !0 && (
|
|
8045
|
+
const v = renderCell(g, y, n);
|
|
8046
|
+
if ($.isFixed === !0 && (v.classList.add("fixed-td"), v.style.left = `${f - 1}px`), f += ($.size ?? 80) - 1, v.setAttribute("data-cell-data", `${m}-${E}`), y.rowSpan !== 0 && y.colSpan !== 0) {
|
|
8041
8047
|
if ([CellType.TEXT, CellType.FIELD, CellType.ICON, CellType.FUN, CellType.IMAGE, CellType.RICH].includes(y.type)) {
|
|
8042
|
-
y.style &&
|
|
8043
|
-
const
|
|
8044
|
-
|
|
8048
|
+
y.style && v.setAttribute("style", renderCellPrintStyle(y.style, n)), y.style && y.style.border === !1 && v.classList.add("no-border");
|
|
8049
|
+
const C = ((p = y.style) == null ? void 0 : p.allowContentOverflow) === !0, w = y.style || {}, b = w.paddingTop ?? TD_DEFAULT_PADDING_VERTICAL, N = w.paddingRight ?? TD_DEFAULT_PADDING_HORIZONTAL, R = w.paddingBottom ?? TD_DEFAULT_PADDING_VERTICAL, A = w.paddingLeft ?? TD_DEFAULT_PADDING_HORIZONTAL;
|
|
8050
|
+
v.style.paddingTop = `${b}px`, v.style.paddingRight = `${N}px`, v.style.paddingBottom = `${R}px`, v.style.paddingLeft = `${A}px`, v.style.boxSizing = "border-box", v.style.position = "relative", y.rowSpan <= 1 && (C ? v.style.minHeight = `${g.size ?? 25}px` : v.style.height = `${g.size ?? 25}px`);
|
|
8045
8051
|
}
|
|
8046
|
-
_.appendChild(
|
|
8052
|
+
_.appendChild(v);
|
|
8047
8053
|
}
|
|
8048
8054
|
}
|
|
8049
8055
|
}
|
|
8050
|
-
|
|
8056
|
+
d.appendChild(_);
|
|
8051
8057
|
}
|
|
8052
|
-
return a.appendChild(
|
|
8058
|
+
return a.appendChild(d), i;
|
|
8053
8059
|
}
|
|
8054
8060
|
function renderReportByDom(t, e, r, n, o, i) {
|
|
8055
8061
|
var _;
|
|
@@ -8058,31 +8064,31 @@ function renderReportByDom(t, e, r, n, o, i) {
|
|
|
8058
8064
|
const l = renderColgroup(e, s);
|
|
8059
8065
|
s.appendChild(l);
|
|
8060
8066
|
let c = 0, u = 0;
|
|
8061
|
-
const
|
|
8067
|
+
const f = document.createDocumentFragment(), d = [], p = [], m = /* @__PURE__ */ new Map();
|
|
8062
8068
|
let g = 0;
|
|
8063
|
-
for (let
|
|
8064
|
-
const $ = t[
|
|
8069
|
+
for (let E = 0; E < t.length; E++) {
|
|
8070
|
+
const $ = t[E];
|
|
8065
8071
|
if ($.isHidden)
|
|
8066
8072
|
continue;
|
|
8067
8073
|
const y = document.createElement("tr");
|
|
8068
8074
|
y.dataset.ri = String(g), $.isFixed && (y.style.top = `${c - 1}px`, y.classList.add("fixed-row")), c += ($.size ?? 25) - 1, y.style.height = `${$.size ?? 25}px`, u = 0;
|
|
8069
|
-
for (let
|
|
8070
|
-
const
|
|
8071
|
-
if (
|
|
8075
|
+
for (let v = 0; v < e.length; v++) {
|
|
8076
|
+
const C = e[v];
|
|
8077
|
+
if (C.isHidden)
|
|
8072
8078
|
continue;
|
|
8073
|
-
const
|
|
8074
|
-
if ($ &&
|
|
8075
|
-
const b = renderCell($,
|
|
8076
|
-
if (
|
|
8077
|
-
b.classList.add("click-sort-cell"), b.setAttribute("data-click-sort-field",
|
|
8079
|
+
const w = r[E][v];
|
|
8080
|
+
if ($ && w && ($.size ?? 25) > 0) {
|
|
8081
|
+
const b = renderCell($, w, i);
|
|
8082
|
+
if (w.clickSortField) {
|
|
8083
|
+
b.classList.add("click-sort-cell"), b.setAttribute("data-click-sort-field", w.clickSortField), b.setAttribute("data-click-sort-numeric", w.clickSortNumeric ? "1" : "0");
|
|
8078
8084
|
const N = document.createElement("span");
|
|
8079
8085
|
N.className = "click-sort-arrow", (_ = b.querySelector(":scope > div")) == null || _.appendChild(N);
|
|
8080
8086
|
}
|
|
8081
|
-
if (
|
|
8082
|
-
if (
|
|
8083
|
-
const N =
|
|
8084
|
-
|
|
8085
|
-
for (let R = 1; R <
|
|
8087
|
+
if (C.isFixed === !0 && (b.classList.add("fixed-td"), b.style.position = "sticky", b.style.left = `${u - 1}px`), u += (C.size ?? 80) - 1, b.setAttribute("data-cell-data", `${E}-${v}`), !(w.rowSpan === 0 || w.colSpan === 0)) {
|
|
8088
|
+
if (w.style && w.style.border === !1 && b.classList.add("no-border"), y.appendChild(b), w.rowSpan > 1) {
|
|
8089
|
+
const N = d.length;
|
|
8090
|
+
d.push(b), p.push(w.rowSpan);
|
|
8091
|
+
for (let R = 1; R < w.rowSpan; R++) {
|
|
8086
8092
|
const A = g + R;
|
|
8087
8093
|
m.has(A) || m.set(A, []), m.get(A).push(N);
|
|
8088
8094
|
}
|
|
@@ -8090,23 +8096,23 @@ function renderReportByDom(t, e, r, n, o, i) {
|
|
|
8090
8096
|
}
|
|
8091
8097
|
}
|
|
8092
8098
|
}
|
|
8093
|
-
|
|
8099
|
+
f.appendChild(y), g++;
|
|
8094
8100
|
}
|
|
8095
|
-
if (
|
|
8096
|
-
let
|
|
8101
|
+
if (d.length > 0) {
|
|
8102
|
+
let E = -1;
|
|
8097
8103
|
const $ = () => {
|
|
8098
8104
|
var y;
|
|
8099
|
-
|
|
8105
|
+
E >= 0 && ((y = m.get(E)) == null || y.forEach((v) => d[v].classList.remove("merge-hover"))), E = -1;
|
|
8100
8106
|
};
|
|
8101
8107
|
s.addEventListener("mouseover", (y) => {
|
|
8102
|
-
var
|
|
8103
|
-
const
|
|
8104
|
-
if (!
|
|
8105
|
-
const
|
|
8106
|
-
|
|
8108
|
+
var w;
|
|
8109
|
+
const v = y.target.closest("tr");
|
|
8110
|
+
if (!v) return;
|
|
8111
|
+
const C = Number(v.dataset.ri);
|
|
8112
|
+
C !== E && ($(), E = C, (w = m.get(C)) == null || w.forEach((b) => d[b].classList.add("merge-hover")));
|
|
8107
8113
|
}), s.addEventListener("mouseleave", $);
|
|
8108
8114
|
}
|
|
8109
|
-
s.appendChild(
|
|
8115
|
+
s.appendChild(f);
|
|
8110
8116
|
}
|
|
8111
8117
|
function clearReportByDom(t) {
|
|
8112
8118
|
t.innerHTML = "";
|
|
@@ -8163,8 +8169,8 @@ function changeConfig(t, e) {
|
|
|
8163
8169
|
if (a.format === FormatType.STRING && a.fun)
|
|
8164
8170
|
a.rawData = a.fun.replace(StringFunRex, (c, u) => {
|
|
8165
8171
|
u = u.toUpperCase();
|
|
8166
|
-
const
|
|
8167
|
-
return
|
|
8172
|
+
const f = get(l, u, c);
|
|
8173
|
+
return f === c ? "" : f;
|
|
8168
8174
|
});
|
|
8169
8175
|
else if (a.data && a.data.startsWith("row:") && a.rowData) {
|
|
8170
8176
|
let c = a.data.replace("row:", "").toUpperCase();
|
|
@@ -8173,22 +8179,22 @@ function changeConfig(t, e) {
|
|
|
8173
8179
|
}
|
|
8174
8180
|
if (a.type === CellType.IMAGE && a.data && (a.rawData = a.data), a.type === CellType.FUN && a.fun)
|
|
8175
8181
|
a.fun = a.fun.replace(StringFunRex, (c, u) => {
|
|
8176
|
-
const
|
|
8177
|
-
return String(
|
|
8182
|
+
const f = get(l, u.toUpperCase());
|
|
8183
|
+
return String(f ?? "").trim() === "" ? 0 : f;
|
|
8178
8184
|
}), a.computedType === ComputedType.loopRow ? needComputedCell.set(`${s}:${a.index}`, a) : a.computedType === ComputedType.loopGroup && Array.isArray(a.groupIndices) && a.groupLevel !== void 0 ? needComputedCell.set(`${s}:${a.groupIndices[a.groupLevel]}:${a.groupLevel}`, a) : a.colGroupIndex !== void 0 && a.colGroupIndex !== null ? needComputedCell.set(`${s}:c${a.colGroupIndex}`, a) : needComputedCell.set(s, a);
|
|
8179
8185
|
else {
|
|
8180
8186
|
let c = !1;
|
|
8181
8187
|
if (a.type === CellType.TEXT && a.text && /\$\{/.test(a.text)) {
|
|
8182
|
-
let u = a.text.replace(StringFunRex, (
|
|
8183
|
-
|
|
8184
|
-
const p = get(l,
|
|
8188
|
+
let u = a.text.replace(StringFunRex, (f, d) => {
|
|
8189
|
+
d = d.toUpperCase();
|
|
8190
|
+
const p = get(l, d);
|
|
8185
8191
|
return p !== void 0 ? p : "";
|
|
8186
8192
|
});
|
|
8187
8193
|
a.rawData = u, /\$\{=/.test(u) && (needComputedCell.set(s, a), c = !0);
|
|
8188
|
-
} else a.type === CellType.RICH && a.text && /\$\{/.test(a.text) && (a.rawData = a.text.replace(StringFunRex, (u,
|
|
8189
|
-
|
|
8190
|
-
const
|
|
8191
|
-
return
|
|
8194
|
+
} else a.type === CellType.RICH && a.text && /\$\{/.test(a.text) && (a.rawData = a.text.replace(StringFunRex, (u, f) => {
|
|
8195
|
+
f = f.toUpperCase();
|
|
8196
|
+
const d = get(l, f);
|
|
8197
|
+
return d !== void 0 ? String(d) : "";
|
|
8192
8198
|
}), c = !0, a.text = a.rawData);
|
|
8193
8199
|
a.rawData === void 0 && (a.rawData = a.text), c || (a.format ? a.text = formatCellValue(a.rawData ?? a.text ?? "", a.format, a.formatType) : a.text = a.rawData ?? a.text ?? "");
|
|
8194
8200
|
}
|
|
@@ -8217,9 +8223,9 @@ function expandRangeToRefs(t, e) {
|
|
|
8217
8223
|
const r = t.match(/[A-Za-z]+/), n = t.match(/\d+/), o = e.match(/[A-Za-z]+/), i = e.match(/\d+/);
|
|
8218
8224
|
if (!r || !n || !o || !i) return [];
|
|
8219
8225
|
const a = columnToNumber(r[0].toUpperCase()), s = columnToNumber(o[0].toUpperCase()), l = parseInt(n[0]) - 1, c = parseInt(i[0]) - 1, u = [];
|
|
8220
|
-
for (let
|
|
8221
|
-
for (let
|
|
8222
|
-
u.push(`${
|
|
8226
|
+
for (let f = Math.min(l, c); f <= Math.max(l, c); f++)
|
|
8227
|
+
for (let d = Math.min(a, s); d <= Math.max(a, s); d++)
|
|
8228
|
+
u.push(`${f}:${d}`);
|
|
8223
8229
|
return u;
|
|
8224
8230
|
}
|
|
8225
8231
|
function extractCellRefs(t) {
|
|
@@ -8258,10 +8264,10 @@ function computeTopoOrder(t, e) {
|
|
|
8258
8264
|
r.forEach((l) => o.set(l, /* @__PURE__ */ new Set()));
|
|
8259
8265
|
for (const [l, c] of t) {
|
|
8260
8266
|
const u = extractRefsForCell(c);
|
|
8261
|
-
for (const
|
|
8262
|
-
if (!e[
|
|
8263
|
-
const
|
|
8264
|
-
|
|
8267
|
+
for (const f of u) {
|
|
8268
|
+
if (!e[f]) continue;
|
|
8269
|
+
const d = n.get(f);
|
|
8270
|
+
d && d.forEach((p) => {
|
|
8265
8271
|
p !== l && o.get(l).add(p);
|
|
8266
8272
|
});
|
|
8267
8273
|
}
|
|
@@ -8277,8 +8283,8 @@ function computeTopoOrder(t, e) {
|
|
|
8277
8283
|
const l = a.shift();
|
|
8278
8284
|
s.push(l), o.forEach((c, u) => {
|
|
8279
8285
|
if (c.has(l)) {
|
|
8280
|
-
const
|
|
8281
|
-
i.set(u,
|
|
8286
|
+
const f = (i.get(u) ?? 0) - 1;
|
|
8287
|
+
i.set(u, f), f === 0 && a.push(u);
|
|
8282
8288
|
}
|
|
8283
8289
|
});
|
|
8284
8290
|
}
|
|
@@ -8309,15 +8315,15 @@ function computeCell(t, e, r, n) {
|
|
|
8309
8315
|
}), r && r.length > 0 && Object.keys(innerConfig).length > 0 && Object.entries(innerConfig).forEach(([i, a]) => {
|
|
8310
8316
|
let s = n !== void 0 ? `${n}:${i}` : i;
|
|
8311
8317
|
if (r.includes(s)) {
|
|
8312
|
-
let [l, c] = i.split(":"), u = numberToColumn(parseInt(c) + 1),
|
|
8318
|
+
let [l, c] = i.split(":"), u = numberToColumn(parseInt(c) + 1), f = /* @__PURE__ */ new Set();
|
|
8313
8319
|
a.forEach((g) => {
|
|
8314
|
-
g.text && g.type === CellType.FIELD &&
|
|
8320
|
+
g.text && g.type === CellType.FIELD && f.add(g.text);
|
|
8315
8321
|
});
|
|
8316
|
-
let
|
|
8322
|
+
let d = Array.from(f).sort().map((g) => ({
|
|
8317
8323
|
label: g,
|
|
8318
8324
|
value: g
|
|
8319
8325
|
})), p = `${u}${parseInt(l) + 1}`, m = n !== void 0 ? `cell-change:${n}!${p}` : `cell-change:${p}`;
|
|
8320
|
-
trigger(m,
|
|
8326
|
+
trigger(m, d);
|
|
8321
8327
|
}
|
|
8322
8328
|
}), innerConfig = {}, needComputedCell = /* @__PURE__ */ new Map();
|
|
8323
8329
|
}
|
|
@@ -8375,10 +8381,10 @@ function evaluateExpression(t, e) {
|
|
|
8375
8381
|
switch (t.type) {
|
|
8376
8382
|
case "Literal":
|
|
8377
8383
|
if (typeof t.value == "string") {
|
|
8378
|
-
const
|
|
8379
|
-
if (
|
|
8380
|
-
let [
|
|
8381
|
-
return getRangeValues(
|
|
8384
|
+
const f = parseRange(t.value);
|
|
8385
|
+
if (f) {
|
|
8386
|
+
let [d, p] = f;
|
|
8387
|
+
return getRangeValues(d, p, e);
|
|
8382
8388
|
}
|
|
8383
8389
|
}
|
|
8384
8390
|
return t.value;
|
|
@@ -8388,8 +8394,8 @@ function evaluateExpression(t, e) {
|
|
|
8388
8394
|
return t.name;
|
|
8389
8395
|
const n = parseRange(r);
|
|
8390
8396
|
if (n) {
|
|
8391
|
-
let [
|
|
8392
|
-
return getRangeValues(
|
|
8397
|
+
let [f, d] = n;
|
|
8398
|
+
return getRangeValues(f, d, e);
|
|
8393
8399
|
} else
|
|
8394
8400
|
return t.name;
|
|
8395
8401
|
case "BinaryExpression":
|
|
@@ -8421,13 +8427,13 @@ function evaluateExpression(t, e) {
|
|
|
8421
8427
|
throw new Error(`不支持的操作符: ${t.operator}`);
|
|
8422
8428
|
}
|
|
8423
8429
|
case "UnaryExpression": {
|
|
8424
|
-
const
|
|
8425
|
-
let
|
|
8426
|
-
switch (isNaN(
|
|
8430
|
+
const f = evaluateExpression(t.argument, e || 0);
|
|
8431
|
+
let d = Number(f);
|
|
8432
|
+
switch (isNaN(d) && (d = 0), t.operator) {
|
|
8427
8433
|
case "-":
|
|
8428
|
-
return -
|
|
8434
|
+
return -d;
|
|
8429
8435
|
case "+":
|
|
8430
|
-
return
|
|
8436
|
+
return d;
|
|
8431
8437
|
default:
|
|
8432
8438
|
throw new Error(`不支持的一元操作符: ${t.operator}`);
|
|
8433
8439
|
}
|
|
@@ -8436,9 +8442,9 @@ function evaluateExpression(t, e) {
|
|
|
8436
8442
|
return evaluateFunction(getCalleeName(t.callee), t.arguments, e);
|
|
8437
8443
|
case "MemberExpression":
|
|
8438
8444
|
if (t.computed && t.property && t.property.type === "Literal") {
|
|
8439
|
-
const
|
|
8440
|
-
if (
|
|
8441
|
-
let [p, m] =
|
|
8445
|
+
const f = t.property.value, d = parseRange(f);
|
|
8446
|
+
if (d) {
|
|
8447
|
+
let [p, m] = d;
|
|
8442
8448
|
return getRangeValues(p, m, e);
|
|
8443
8449
|
}
|
|
8444
8450
|
}
|
|
@@ -8448,8 +8454,8 @@ function evaluateExpression(t, e) {
|
|
|
8448
8454
|
throw new Error(`无法获取非对象值的属性: ${c}`);
|
|
8449
8455
|
case "Compound":
|
|
8450
8456
|
const u = [];
|
|
8451
|
-
for (const
|
|
8452
|
-
u.push(evaluateExpression(
|
|
8457
|
+
for (const f of t.body)
|
|
8458
|
+
u.push(evaluateExpression(f, e));
|
|
8453
8459
|
return u.join(" ");
|
|
8454
8460
|
default:
|
|
8455
8461
|
throw new Error(`不支持的节点类型: ${t.type}`);
|
|
@@ -8468,42 +8474,42 @@ function getRangeValues(t, e, r) {
|
|
|
8468
8474
|
let c = -1;
|
|
8469
8475
|
const u = e.match(/\d+/);
|
|
8470
8476
|
u && (c = parseInt(u[0]) - 1);
|
|
8471
|
-
let
|
|
8472
|
-
for (let
|
|
8477
|
+
let f = [];
|
|
8478
|
+
for (let d = i; d <= c; d++)
|
|
8473
8479
|
for (let p = n; p <= s; p++) {
|
|
8474
|
-
const m = `${
|
|
8480
|
+
const m = `${d}:${p}`;
|
|
8475
8481
|
if (r !== void 0) {
|
|
8476
8482
|
if (!isNaN(r))
|
|
8477
|
-
|
|
8483
|
+
f = getCellValue(m)[r].rawData;
|
|
8478
8484
|
else if (r.indexOf("g-") > -1) {
|
|
8479
|
-
let [g, _,
|
|
8480
|
-
_ && (_ = parseInt(_)),
|
|
8481
|
-
(
|
|
8482
|
-
var
|
|
8483
|
-
return [null, void 0, ""].includes(
|
|
8485
|
+
let [g, _, E] = r.split("-");
|
|
8486
|
+
_ && (_ = parseInt(_)), E && (E = parseInt(E)), f = getCellValue(m).filter((v) => v.groupIndices[E] === _).map(
|
|
8487
|
+
(v) => {
|
|
8488
|
+
var C;
|
|
8489
|
+
return [null, void 0, ""].includes(v.rawData) ? (C = v.formatType) == null ? void 0 : C.defaultCellContent : v.rawData;
|
|
8484
8490
|
}
|
|
8485
8491
|
);
|
|
8486
8492
|
} else if (r.indexOf("c-") > -1) {
|
|
8487
8493
|
const g = parseInt(r.split("-")[1]);
|
|
8488
|
-
|
|
8494
|
+
f = getCellValue(m).filter(($) => $.colGroupIndex === g).map(
|
|
8489
8495
|
($) => {
|
|
8490
8496
|
var y;
|
|
8491
8497
|
return [null, void 0, ""].includes($.rawData) ? (y = $.formatType) == null ? void 0 : y.defaultCellContent : $.rawData;
|
|
8492
8498
|
}
|
|
8493
8499
|
);
|
|
8494
8500
|
}
|
|
8495
|
-
|
|
8501
|
+
f || (f = getCellValue(m)[0].rawData);
|
|
8496
8502
|
} else {
|
|
8497
8503
|
let g = getCellValue(m).map(
|
|
8498
8504
|
(_) => {
|
|
8499
|
-
var
|
|
8500
|
-
return [null, void 0, ""].includes(_.rawData) ? (
|
|
8505
|
+
var E;
|
|
8506
|
+
return [null, void 0, ""].includes(_.rawData) ? (E = _.formatType) == null ? void 0 : E.defaultCellContent : _.rawData;
|
|
8501
8507
|
}
|
|
8502
8508
|
);
|
|
8503
|
-
|
|
8509
|
+
f.push(...g);
|
|
8504
8510
|
}
|
|
8505
8511
|
}
|
|
8506
|
-
return
|
|
8512
|
+
return f;
|
|
8507
8513
|
}
|
|
8508
8514
|
const funHandlers = {
|
|
8509
8515
|
SUM(t) {
|
|
@@ -8557,7 +8563,7 @@ function evaluateFunction(t, e, r) {
|
|
|
8557
8563
|
case "RANK.EQ": {
|
|
8558
8564
|
if (n.length < 2)
|
|
8559
8565
|
throw new Error(`RANK.EQ函数至少需要2个参数,但提供了${n.length}个`);
|
|
8560
|
-
const g = parseFloat(n[0]), _ = [n[1]].flat().map(Number).filter((
|
|
8566
|
+
const g = parseFloat(n[0]), _ = [n[1]].flat().map(Number).filter((v) => !isNaN(v)), y = (Number(n[2] ?? 0) === 0 ? [..._].sort((v, C) => C - v) : [..._].sort((v, C) => v - C)).indexOf(g);
|
|
8561
8567
|
return y === -1 ? "#N/A" : y + 1;
|
|
8562
8568
|
}
|
|
8563
8569
|
case "SUMPRODUCT":
|
|
@@ -8567,8 +8573,8 @@ function evaluateFunction(t, e, r) {
|
|
|
8567
8573
|
let s = new Decimal(0);
|
|
8568
8574
|
for (let g = 0; g < a; g++) {
|
|
8569
8575
|
let _ = new Decimal(1);
|
|
8570
|
-
for (const
|
|
8571
|
-
const $ = parseFloat(
|
|
8576
|
+
for (const E of i) {
|
|
8577
|
+
const $ = parseFloat(E[g]);
|
|
8572
8578
|
_ = _.times(isNaN($) ? 0 : $);
|
|
8573
8579
|
}
|
|
8574
8580
|
s = s.plus(_);
|
|
@@ -8603,13 +8609,13 @@ function evaluateFunction(t, e, r) {
|
|
|
8603
8609
|
case "HOUR":
|
|
8604
8610
|
if (n.length !== 1)
|
|
8605
8611
|
throw new Error(`HOUR函数需要1个参数,但提供了${n.length}个`);
|
|
8606
|
-
const
|
|
8607
|
-
return
|
|
8612
|
+
const f = dayjs(n[0]);
|
|
8613
|
+
return f.isValid() ? f.hour() : null;
|
|
8608
8614
|
case "WEEK":
|
|
8609
8615
|
if (n.length !== 1)
|
|
8610
8616
|
throw new Error(`WEEK函数需要1个参数,但提供了${n.length}个`);
|
|
8611
|
-
const
|
|
8612
|
-
return
|
|
8617
|
+
const d = dayjs(n[0]);
|
|
8618
|
+
return d.isValid() ? d.day() : null;
|
|
8613
8619
|
case "RUNNING_SUM":
|
|
8614
8620
|
case "CUSUM":
|
|
8615
8621
|
let p = e.map((g) => evaluateExpression(g));
|
|
@@ -8693,24 +8699,24 @@ function loopGroupCols(t, e, r, n) {
|
|
|
8693
8699
|
if (g === 0)
|
|
8694
8700
|
i.forEach((y) => {
|
|
8695
8701
|
if ($) {
|
|
8696
|
-
let
|
|
8697
|
-
|
|
8698
|
-
const
|
|
8699
|
-
l[
|
|
8702
|
+
let v = y[$];
|
|
8703
|
+
v || (v = "-");
|
|
8704
|
+
const C = getSeparatorKey("child", m, v), w = getSeparatorKey("data", v);
|
|
8705
|
+
l[C] ? l[C].push(y) : l[C] = [y], l[_].add(v), l[v] = [v], l[w] = [y];
|
|
8700
8706
|
}
|
|
8701
8707
|
});
|
|
8702
8708
|
else {
|
|
8703
8709
|
let y = s[g - 1];
|
|
8704
|
-
const
|
|
8705
|
-
Array.from(l[
|
|
8706
|
-
const b = getSeparatorKey("child", y,
|
|
8710
|
+
const v = getSeparatorKey("key", y);
|
|
8711
|
+
Array.from(l[v]).forEach((w) => {
|
|
8712
|
+
const b = getSeparatorKey("child", y, w);
|
|
8707
8713
|
let R = (l[b] || []).map((A) => {
|
|
8708
8714
|
if ($) {
|
|
8709
8715
|
let k = A[$];
|
|
8710
8716
|
k || (k = "-");
|
|
8711
8717
|
let F = !1;
|
|
8712
|
-
const L = getSeparatorKey("child", m,
|
|
8713
|
-
return l[L] ? l[L].push(A) : l[L] = [A], l[x] ? l[x].push(A) : l[x] = [A], l[_].has(O) || (F = !0), l[_].add(O), l[O] = l[
|
|
8718
|
+
const L = getSeparatorKey("child", m, w, k), O = getSeparatorKey(w, k), x = getSeparatorKey("data", O);
|
|
8719
|
+
return l[L] ? l[L].push(A) : l[L] = [A], l[x] ? l[x].push(A) : l[x] = [A], l[_].has(O) || (F = !0), l[_].add(O), l[O] = l[w].concat([k]), F ? k : null;
|
|
8714
8720
|
}
|
|
8715
8721
|
}).filter((A) => !!A);
|
|
8716
8722
|
l[b] = R;
|
|
@@ -8724,17 +8730,17 @@ function loopGroupCols(t, e, r, n) {
|
|
|
8724
8730
|
if (c !== void 0) {
|
|
8725
8731
|
const m = a[c], g = { order: m.groupSortOrder, numeric: m.groupSortNumeric };
|
|
8726
8732
|
s.forEach((_) => {
|
|
8727
|
-
const
|
|
8728
|
-
$.length > 1 && $.sort(createGroupSortComparator(g)), l[
|
|
8733
|
+
const E = getSeparatorKey("key", _), $ = Array.from(l[E]);
|
|
8734
|
+
$.length > 1 && $.sort(createGroupSortComparator(g)), l[E] = new Set($);
|
|
8729
8735
|
});
|
|
8730
8736
|
}
|
|
8731
|
-
let u = 1,
|
|
8737
|
+
let u = 1, f = Math.max(...s), d = Math.min(...s);
|
|
8732
8738
|
const p = a.some((m) => m.isRowColCombine);
|
|
8733
8739
|
if (s.length > 0) {
|
|
8734
|
-
const m = getSeparatorKey("key",
|
|
8740
|
+
const m = getSeparatorKey("key", f);
|
|
8735
8741
|
p ? u = l[m].size : u = Array.from(l[m]).reduce((g, _) => {
|
|
8736
|
-
const
|
|
8737
|
-
let $ = l[
|
|
8742
|
+
const E = getSeparatorKey("child", f, _);
|
|
8743
|
+
let $ = l[E];
|
|
8738
8744
|
return g + $.length;
|
|
8739
8745
|
}, 0);
|
|
8740
8746
|
} else
|
|
@@ -8748,13 +8754,13 @@ function loopGroupCols(t, e, r, n) {
|
|
|
8748
8754
|
}, y = Array.from({ length: u }, () => cloneDeep($));
|
|
8749
8755
|
t.splice(_, 1, ...y);
|
|
8750
8756
|
}
|
|
8751
|
-
let
|
|
8752
|
-
if (
|
|
8757
|
+
let E = r[g.row];
|
|
8758
|
+
if (E && Array.isArray(E)) {
|
|
8753
8759
|
let $ = [];
|
|
8754
8760
|
if (s.includes(m)) {
|
|
8755
8761
|
const y = getSeparatorKey("key", g.row);
|
|
8756
|
-
Array.from(l[y]).forEach((
|
|
8757
|
-
const b = p && m ===
|
|
8762
|
+
Array.from(l[y]).forEach((C, w) => {
|
|
8763
|
+
const b = p && m === f ? 1 : getGroupMinChildrenLength(l, C, f, p, s), N = l[C], R = N[N.length - 1], A = getSeparatorKey("data", C), k = l[A];
|
|
8758
8764
|
let F = {
|
|
8759
8765
|
...g,
|
|
8760
8766
|
text: R,
|
|
@@ -8772,83 +8778,83 @@ function loopGroupCols(t, e, r, n) {
|
|
|
8772
8778
|
for (let O = 0; O < b - 1; O++)
|
|
8773
8779
|
$.push(L);
|
|
8774
8780
|
}
|
|
8775
|
-
}),
|
|
8781
|
+
}), E.splice(g.col, 1, ...$);
|
|
8776
8782
|
} else {
|
|
8777
|
-
if (m >
|
|
8783
|
+
if (m > d && m < f) {
|
|
8778
8784
|
let y = findMaxLessThan(s, m);
|
|
8779
8785
|
if (y !== null) {
|
|
8780
|
-
let
|
|
8781
|
-
|
|
8782
|
-
let
|
|
8783
|
-
return Array.isArray(
|
|
8786
|
+
let v = r[y].slice(o.index, o.index + u);
|
|
8787
|
+
v = v.map((C) => {
|
|
8788
|
+
let w = C.colData;
|
|
8789
|
+
return Array.isArray(w) && (w = w[0]), {
|
|
8784
8790
|
...g,
|
|
8785
|
-
colData:
|
|
8786
|
-
colSpan:
|
|
8787
|
-
rowSpan:
|
|
8791
|
+
colData: w,
|
|
8792
|
+
colSpan: C.colSpan,
|
|
8793
|
+
rowSpan: C.rowSpan
|
|
8788
8794
|
};
|
|
8789
|
-
}),
|
|
8795
|
+
}), E.splice(o.index, 1, ...v);
|
|
8790
8796
|
continue;
|
|
8791
8797
|
}
|
|
8792
8798
|
}
|
|
8793
8799
|
if (g.data) {
|
|
8794
|
-
const y = getSeparatorKey("key",
|
|
8795
|
-
let
|
|
8800
|
+
const y = getSeparatorKey("key", f);
|
|
8801
|
+
let v = l[y] ? Array.from(l[y]) : [], C = g.data.replace("col:", "").toUpperCase();
|
|
8796
8802
|
if (g.isRowColCombine) {
|
|
8797
|
-
let
|
|
8798
|
-
|
|
8803
|
+
let w = s.map((N) => a[N].data.replace("col:", "").toUpperCase()), b = [];
|
|
8804
|
+
v.forEach((N, R) => {
|
|
8799
8805
|
let A = {
|
|
8800
8806
|
...g,
|
|
8801
|
-
combineKeys:
|
|
8807
|
+
combineKeys: w,
|
|
8802
8808
|
combineValues: l[N],
|
|
8803
8809
|
colGroupIndex: R
|
|
8804
8810
|
};
|
|
8805
8811
|
b.push(A);
|
|
8806
|
-
}),
|
|
8807
|
-
} else if (
|
|
8808
|
-
|
|
8812
|
+
}), E.splice(g.col, 1, ...b);
|
|
8813
|
+
} else if (v.length)
|
|
8814
|
+
v.forEach((w, b) => {
|
|
8809
8815
|
let N = [];
|
|
8810
|
-
const R = getSeparatorKey("data",
|
|
8816
|
+
const R = getSeparatorKey("data", w);
|
|
8811
8817
|
l[R].forEach((k) => {
|
|
8812
8818
|
let F = {
|
|
8813
8819
|
...g
|
|
8814
8820
|
};
|
|
8815
|
-
delete F.combineKeys, delete F.combineValues, delete F.isRowColCombine, k[
|
|
8816
|
-
}),
|
|
8821
|
+
delete F.combineKeys, delete F.combineValues, delete F.isRowColCombine, k[C] !== void 0 ? (F.rawData = k[C], F.colData = k) : F.rawData = "", N.push(F);
|
|
8822
|
+
}), E.splice(g.col, 1, ...N);
|
|
8817
8823
|
});
|
|
8818
8824
|
else {
|
|
8819
|
-
let
|
|
8825
|
+
let w = [];
|
|
8820
8826
|
i.forEach((b) => {
|
|
8821
8827
|
let N = {
|
|
8822
8828
|
...g
|
|
8823
8829
|
};
|
|
8824
|
-
delete N.combineKeys, delete N.combineValues, delete N.isRowColCombine, b[
|
|
8825
|
-
}),
|
|
8830
|
+
delete N.combineKeys, delete N.combineValues, delete N.isRowColCombine, b[C] !== void 0 ? (N.rawData = b[C], N.colData = b) : N.rawData = "", w.push(N);
|
|
8831
|
+
}), E.splice(g.col, 1, ...w);
|
|
8826
8832
|
}
|
|
8827
8833
|
} else if (g.type === CellType.FUN && p && g.colSpan !== 0) {
|
|
8828
8834
|
let y = [];
|
|
8829
|
-
for (let
|
|
8835
|
+
for (let v = 0; v < u; v++)
|
|
8830
8836
|
y.push({
|
|
8831
8837
|
...g,
|
|
8832
8838
|
colData: i[0],
|
|
8833
|
-
colGroupIndex:
|
|
8839
|
+
colGroupIndex: v
|
|
8834
8840
|
});
|
|
8835
|
-
|
|
8841
|
+
E.splice(g.col, 1, ...y);
|
|
8836
8842
|
} else {
|
|
8837
8843
|
const y = {
|
|
8838
8844
|
...g,
|
|
8839
8845
|
colData: i[0]
|
|
8840
8846
|
};
|
|
8841
8847
|
if (g.colSpan === 0 && g.mergeTarget && g.mergeTarget.length === 2 && g.row === g.mergeTarget[0]) {
|
|
8842
|
-
let [
|
|
8848
|
+
let [w, b] = g.mergeTarget, N = r.reduce((R, A) => R.concat(A), []).filter((R) => R.row === w && R.col === b)[0];
|
|
8843
8849
|
N && (N.colSpan += u - 1);
|
|
8844
8850
|
} else (!Array.isArray(g.mergeTarget) || g.mergeTarget.length !== 2) && (y.colSpan = u);
|
|
8845
|
-
const
|
|
8851
|
+
const v = {
|
|
8846
8852
|
...g,
|
|
8847
8853
|
colSpan: 0,
|
|
8848
8854
|
rowSpan: 0
|
|
8849
8855
|
};
|
|
8850
|
-
let
|
|
8851
|
-
|
|
8856
|
+
let C = Array.from({ length: u - 1 }, () => cloneDeep(v));
|
|
8857
|
+
E.splice(g.col, 1, y, ...C);
|
|
8852
8858
|
}
|
|
8853
8859
|
}
|
|
8854
8860
|
}
|
|
@@ -8903,16 +8909,16 @@ function mergeSameCells(t) {
|
|
|
8903
8909
|
let l = i;
|
|
8904
8910
|
s.mergeTarget && (l = s.mergeTarget[0]);
|
|
8905
8911
|
const c = e[l][o].rowSpan || 1, u = [];
|
|
8906
|
-
for (let
|
|
8907
|
-
const p = l +
|
|
8912
|
+
for (let d = 0; d < c; d++) {
|
|
8913
|
+
const p = l + d;
|
|
8908
8914
|
e[p] && e[p][n] && u.push(e[p][n].rawData);
|
|
8909
8915
|
}
|
|
8910
|
-
const
|
|
8916
|
+
const f = aggregateMergedValues(u, a.mergedValueAggregation);
|
|
8911
8917
|
e[i][n] = {
|
|
8912
8918
|
...a,
|
|
8913
8919
|
rowSpan: c,
|
|
8914
8920
|
colSpan: 1,
|
|
8915
|
-
rawData:
|
|
8921
|
+
rawData: f
|
|
8916
8922
|
// 使用处理后的合并值
|
|
8917
8923
|
}, l !== i && (e[i][n] = {
|
|
8918
8924
|
...e[i][n],
|
|
@@ -8922,7 +8928,7 @@ function mergeSameCells(t) {
|
|
|
8922
8928
|
rowSpan: 0,
|
|
8923
8929
|
mergeTarget: [l, n],
|
|
8924
8930
|
// 指向合并的起始单元格
|
|
8925
|
-
rawData:
|
|
8931
|
+
rawData: f
|
|
8926
8932
|
// 使用处理后的合并值
|
|
8927
8933
|
});
|
|
8928
8934
|
}
|
|
@@ -8948,26 +8954,26 @@ function getGroupData(t, e, r) {
|
|
|
8948
8954
|
if (a === 0)
|
|
8949
8955
|
r.forEach((u) => {
|
|
8950
8956
|
if (c) {
|
|
8951
|
-
let
|
|
8952
|
-
|
|
8953
|
-
const
|
|
8954
|
-
n[
|
|
8957
|
+
let f = u[c];
|
|
8958
|
+
f || (f = "[" + c + "]");
|
|
8959
|
+
const d = getSeparatorKey("child", i, f), p = getSeparatorKey("data", f);
|
|
8960
|
+
n[d] ? n[d].push(u) : n[d] = [u], n[s].add(f), n[f] = [f], n[p] = [u];
|
|
8955
8961
|
}
|
|
8956
8962
|
});
|
|
8957
8963
|
else {
|
|
8958
8964
|
let u = t[a - 1];
|
|
8959
|
-
const
|
|
8960
|
-
Array.from(n[
|
|
8965
|
+
const f = getSeparatorKey("key", u);
|
|
8966
|
+
Array.from(n[f]).forEach((p) => {
|
|
8961
8967
|
const m = getSeparatorKey("child", u, p);
|
|
8962
|
-
let _ = (n[m] || []).map((
|
|
8968
|
+
let _ = (n[m] || []).map((E) => {
|
|
8963
8969
|
if (c) {
|
|
8964
|
-
let $ =
|
|
8970
|
+
let $ = E[c];
|
|
8965
8971
|
$ || ($ = "[" + c + "]");
|
|
8966
8972
|
let y = !1;
|
|
8967
|
-
const
|
|
8968
|
-
return n[
|
|
8973
|
+
const v = getSeparatorKey("child", i, p, $), C = getSeparatorKey(p, $), w = getSeparatorKey("data", C);
|
|
8974
|
+
return n[v] ? n[v].push(E) : n[v] = [E], n[w] ? n[w].push(E) : n[w] = [E], n[s].has(C) || (y = !0), n[s].add(C), n[C] = n[p].concat([$]), y ? $ : null;
|
|
8969
8975
|
}
|
|
8970
|
-
}).filter((
|
|
8976
|
+
}).filter((E) => !!E);
|
|
8971
8977
|
n[m] = _;
|
|
8972
8978
|
});
|
|
8973
8979
|
}
|
|
@@ -8993,10 +8999,10 @@ function analyzeGroupStructure(t, e, r, n) {
|
|
|
8993
8999
|
const u = getSeparatorKey("key", c);
|
|
8994
9000
|
o = n[u].size;
|
|
8995
9001
|
} else {
|
|
8996
|
-
let u = e.map((
|
|
8997
|
-
const
|
|
8998
|
-
return Array.from(n[
|
|
8999
|
-
const g = getSeparatorKey("child",
|
|
9002
|
+
let u = e.map((f) => {
|
|
9003
|
+
const d = getSeparatorKey("key", f);
|
|
9004
|
+
return Array.from(n[d]).reduce((p, m) => {
|
|
9005
|
+
const g = getSeparatorKey("child", f, m);
|
|
9000
9006
|
let _ = n[g];
|
|
9001
9007
|
return p + ((_ == null ? void 0 : _.length) || 0);
|
|
9002
9008
|
}, 0);
|
|
@@ -9013,18 +9019,18 @@ function analyzeGroupStructure(t, e, r, n) {
|
|
|
9013
9019
|
};
|
|
9014
9020
|
}
|
|
9015
9021
|
function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
9016
|
-
const u = Array.from({ length: t.length }, () => []),
|
|
9017
|
-
let
|
|
9022
|
+
const u = Array.from({ length: t.length }, () => []), f = /* @__PURE__ */ new Map();
|
|
9023
|
+
let d = -1, p = null;
|
|
9018
9024
|
const m = [], g = new Array(o).fill(!1);
|
|
9019
|
-
return t.forEach((_,
|
|
9020
|
-
let $ = u[
|
|
9025
|
+
return t.forEach((_, E) => {
|
|
9026
|
+
let $ = u[E];
|
|
9021
9027
|
if (e.includes(_.col)) {
|
|
9022
9028
|
const y = getSeparatorKey("key", _.col);
|
|
9023
|
-
let
|
|
9024
|
-
const
|
|
9025
|
-
|
|
9029
|
+
let v = Array.from(n[y]), C = d;
|
|
9030
|
+
const w = e.indexOf(_.col);
|
|
9031
|
+
v.forEach((b, N) => {
|
|
9026
9032
|
let R;
|
|
9027
|
-
|
|
9033
|
+
E === s && (i || a) ? R = 1 : R = getGroupMinChildrenLength(n, b, s, a, i);
|
|
9028
9034
|
const A = n[b], k = A[A.length - 1], F = getSeparatorKey("data", b);
|
|
9029
9035
|
n[F];
|
|
9030
9036
|
let L = {
|
|
@@ -9033,7 +9039,7 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9033
9039
|
index: N,
|
|
9034
9040
|
rowSpan: R,
|
|
9035
9041
|
rawData: formatGroupText(k),
|
|
9036
|
-
groupLevel:
|
|
9042
|
+
groupLevel: w,
|
|
9037
9043
|
groupIndices: N,
|
|
9038
9044
|
groupChildIndex: 0,
|
|
9039
9045
|
computedType: ComputedType.loopRow
|
|
@@ -9045,25 +9051,25 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9045
9051
|
rawData: formatGroupText(k),
|
|
9046
9052
|
colSpan: 0,
|
|
9047
9053
|
rowSpan: 0,
|
|
9048
|
-
groupLevel:
|
|
9054
|
+
groupLevel: w,
|
|
9049
9055
|
groupIndices: N,
|
|
9050
9056
|
computedType: ComputedType.loopRow,
|
|
9051
9057
|
mergeTarget: [L.row, L.col]
|
|
9052
9058
|
};
|
|
9053
9059
|
for (let x = 0; x < R - 1; x++) {
|
|
9054
9060
|
let D = cloneDeep(O);
|
|
9055
|
-
D.index =
|
|
9061
|
+
D.index = C + x + 1, D.groupChildIndex = x + 1, $.push(D);
|
|
9056
9062
|
}
|
|
9057
|
-
if (g[
|
|
9058
|
-
let x = cloneDeep(l[L.loopGroupRowIndex]), D = cloneDeep(c[L.loopGroupRowIndex]).map((S) => (S.type === CellType.FUN && S.fun && (S.groupIndices = N, S.groupLevel =
|
|
9059
|
-
if (
|
|
9060
|
-
let S =
|
|
9063
|
+
if (g[E] = !0, C += R, L.loopGroupRowIndex !== void 0 && L.loopGroupRowIndex !== "" && !isNaN(L.loopGroupRowIndex)) {
|
|
9064
|
+
let x = cloneDeep(l[L.loopGroupRowIndex]), D = cloneDeep(c[L.loopGroupRowIndex]).map((S) => (S.type === CellType.FUN && S.fun && (S.groupIndices = N, S.groupLevel = w, S.computedType = ComputedType.loopGroup), S)), T = 0;
|
|
9065
|
+
if (w >= 0) {
|
|
9066
|
+
let S = w;
|
|
9061
9067
|
for (; S >= 0; ) {
|
|
9062
|
-
let I = e[S], j = u[I][
|
|
9068
|
+
let I = e[S], j = u[I][C];
|
|
9063
9069
|
j && j.groupIndices !== void 0 && !isNaN(j.groupIndices) && (T = T + j.groupIndices), S--;
|
|
9064
9070
|
}
|
|
9065
9071
|
}
|
|
9066
|
-
|
|
9072
|
+
f.set(`${N}:${w}:${C}`, {
|
|
9067
9073
|
row: x,
|
|
9068
9074
|
cells: D,
|
|
9069
9075
|
removeCount: T
|
|
@@ -9073,10 +9079,10 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9073
9079
|
} else if (_.data || _.type === CellType.FUN) {
|
|
9074
9080
|
let y = _.data ? _.data.replace("row:", "").toUpperCase() : void 0;
|
|
9075
9081
|
if (_.isRowColCombine) {
|
|
9076
|
-
const
|
|
9077
|
-
let
|
|
9078
|
-
|
|
9079
|
-
const N = getSeparatorKey("child", s,
|
|
9082
|
+
const v = getSeparatorKey("key", s);
|
|
9083
|
+
let C = n[v] ? Array.from(n[v]) : [];
|
|
9084
|
+
C.length ? C.forEach((w, b) => {
|
|
9085
|
+
const N = getSeparatorKey("child", s, w);
|
|
9080
9086
|
let R = n[N], A = _.combineKeys ? _.combineKeys.map((L, O) => {
|
|
9081
9087
|
const x = _.combineValues ? _.combineValues[O] : void 0;
|
|
9082
9088
|
return {
|
|
@@ -9095,31 +9101,31 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9095
9101
|
} else
|
|
9096
9102
|
F.rawData = "", F.rowData = {};
|
|
9097
9103
|
$.push(F);
|
|
9098
|
-
}) : r.forEach((
|
|
9104
|
+
}) : r.forEach((w, b) => {
|
|
9099
9105
|
let R = (_.combineKeys ? _.combineKeys.map((k, F) => {
|
|
9100
9106
|
const L = _.combineValues ? _.combineValues[F] : void 0;
|
|
9101
9107
|
return {
|
|
9102
9108
|
key: k,
|
|
9103
9109
|
val: L
|
|
9104
9110
|
};
|
|
9105
|
-
}) : []).every((k) =>
|
|
9111
|
+
}) : []).every((k) => w[k.key] === k.val), A = {
|
|
9106
9112
|
..._,
|
|
9107
9113
|
index: b
|
|
9108
9114
|
};
|
|
9109
|
-
delete A.combineKeys, delete A.combineValues, delete A.isRowColCombine, R ? (A.rawData = y ?
|
|
9115
|
+
delete A.combineKeys, delete A.combineValues, delete A.isRowColCombine, R ? (A.rawData = y ? w[y] : "", A.rowData = w) : (A.rawData = "", A.rowData = w), A.type === CellType.FUN && A.fun && (A.computedType = ComputedType.loopRow), $.push(A);
|
|
9110
9116
|
});
|
|
9111
9117
|
} else if (e.length === 0)
|
|
9112
|
-
r.forEach((
|
|
9113
|
-
let
|
|
9114
|
-
index:
|
|
9118
|
+
r.forEach((v, C) => {
|
|
9119
|
+
let w = {
|
|
9120
|
+
index: C,
|
|
9115
9121
|
..._
|
|
9116
9122
|
};
|
|
9117
|
-
delete
|
|
9123
|
+
delete w.combineKeys, delete w.combineValues, delete w.isRowColCombine, y && v[y] !== void 0 ? w.rawData = v[y] : w.rawData = "", w.rowData = v, w.computedType = ComputedType.loopRow, $.push(w);
|
|
9118
9124
|
});
|
|
9119
9125
|
else {
|
|
9120
|
-
const
|
|
9121
|
-
let
|
|
9122
|
-
if (
|
|
9126
|
+
const v = getSeparatorKey("key", s);
|
|
9127
|
+
let C = n[v] ? Array.from(n[v]) : [];
|
|
9128
|
+
if (C.length === 0) {
|
|
9123
9129
|
r.forEach((b, N) => {
|
|
9124
9130
|
let R = {
|
|
9125
9131
|
index: N,
|
|
@@ -9129,12 +9135,12 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9129
9135
|
});
|
|
9130
9136
|
return;
|
|
9131
9137
|
}
|
|
9132
|
-
const
|
|
9133
|
-
if (
|
|
9138
|
+
const w = [];
|
|
9139
|
+
if (C.forEach((b, N) => {
|
|
9134
9140
|
if (a) {
|
|
9135
9141
|
const R = getSeparatorKey("child", s, b);
|
|
9136
9142
|
let A = n[R] || [];
|
|
9137
|
-
|
|
9143
|
+
w.push(A);
|
|
9138
9144
|
} else {
|
|
9139
9145
|
const R = getSeparatorKey("child", s, b);
|
|
9140
9146
|
let A = n[R] || [];
|
|
@@ -9154,16 +9160,16 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9154
9160
|
});
|
|
9155
9161
|
}
|
|
9156
9162
|
}), a) {
|
|
9157
|
-
const b = Math.max(...
|
|
9163
|
+
const b = Math.max(...w.map((R) => R.length));
|
|
9158
9164
|
p || (p = {
|
|
9159
9165
|
count: b,
|
|
9160
9166
|
row: _.row,
|
|
9161
|
-
index:
|
|
9167
|
+
index: E
|
|
9162
9168
|
});
|
|
9163
9169
|
const N = {
|
|
9164
|
-
colIndex:
|
|
9170
|
+
colIndex: E,
|
|
9165
9171
|
maxCount: b,
|
|
9166
|
-
groupColumnLoopItems:
|
|
9172
|
+
groupColumnLoopItems: w,
|
|
9167
9173
|
dataKey: _.data ? _.data.replace("row:", "").toUpperCase() : void 0,
|
|
9168
9174
|
cell: _
|
|
9169
9175
|
};
|
|
@@ -9171,7 +9177,7 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9171
9177
|
}
|
|
9172
9178
|
}
|
|
9173
9179
|
} else if (_.isMergeInLoop !== !1) {
|
|
9174
|
-
const
|
|
9180
|
+
const v = {
|
|
9175
9181
|
..._,
|
|
9176
9182
|
rowData: r[0],
|
|
9177
9183
|
index: 0
|
|
@@ -9180,20 +9186,20 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9180
9186
|
let [b, N] = _.mergeTarget, R = c.reduce((A, k) => A.concat(k), []).filter((A) => A.row === b && A.col === N)[0];
|
|
9181
9187
|
R && (R.rowSpan += o - 1);
|
|
9182
9188
|
} else
|
|
9183
|
-
|
|
9184
|
-
const
|
|
9189
|
+
v.rowSpan += o - 1;
|
|
9190
|
+
const C = {
|
|
9185
9191
|
..._,
|
|
9186
9192
|
colSpan: 0,
|
|
9187
9193
|
rowSpan: 0,
|
|
9188
|
-
mergeTarget: [
|
|
9194
|
+
mergeTarget: [v.row, v.col]
|
|
9189
9195
|
};
|
|
9190
|
-
delete
|
|
9191
|
-
let
|
|
9192
|
-
$.push(
|
|
9196
|
+
delete v.isRowColCombine;
|
|
9197
|
+
let w = Array.from({ length: o - 1 }, () => cloneDeep(C));
|
|
9198
|
+
$.push(v, ...w);
|
|
9193
9199
|
} else if ((i || a) && e.length > 0) {
|
|
9194
|
-
const
|
|
9195
|
-
(n[
|
|
9196
|
-
const N = getSeparatorKey("data",
|
|
9200
|
+
const v = getSeparatorKey("key", s);
|
|
9201
|
+
(n[v] ? Array.from(n[v]) : []).forEach((w, b) => {
|
|
9202
|
+
const N = getSeparatorKey("data", w), R = n[N];
|
|
9197
9203
|
$.push({
|
|
9198
9204
|
index: b,
|
|
9199
9205
|
..._,
|
|
@@ -9204,41 +9210,41 @@ function generateRowStructure(t, e, r, n, o, i, a, s, l, c) {
|
|
|
9204
9210
|
});
|
|
9205
9211
|
});
|
|
9206
9212
|
} else if (e.length > 0)
|
|
9207
|
-
for (let
|
|
9213
|
+
for (let v = 0; v < o; v++)
|
|
9208
9214
|
$.push({
|
|
9209
|
-
index:
|
|
9215
|
+
index: v,
|
|
9210
9216
|
..._,
|
|
9211
9217
|
computedType: ComputedType.loopRow,
|
|
9212
9218
|
rowSpan: 1,
|
|
9213
9219
|
colSpan: 1,
|
|
9214
|
-
rowData: r[
|
|
9220
|
+
rowData: r[v]
|
|
9215
9221
|
});
|
|
9216
9222
|
else
|
|
9217
|
-
r.forEach((
|
|
9223
|
+
r.forEach((v, C) => {
|
|
9218
9224
|
$.push({
|
|
9219
|
-
index:
|
|
9225
|
+
index: C,
|
|
9220
9226
|
..._,
|
|
9221
9227
|
computedType: ComputedType.loopRow,
|
|
9222
9228
|
rowSpan: 1,
|
|
9223
9229
|
colSpan: 1,
|
|
9224
|
-
rowData:
|
|
9230
|
+
rowData: v
|
|
9225
9231
|
});
|
|
9226
9232
|
});
|
|
9227
|
-
}), a && m.length > 0 && m.forEach(({ colIndex: _, maxCount:
|
|
9228
|
-
for (let
|
|
9229
|
-
const
|
|
9233
|
+
}), a && m.length > 0 && m.forEach(({ colIndex: _, maxCount: E, cell: $, groupColumnLoopItems: y, dataKey: v }) => {
|
|
9234
|
+
for (let C = 0; C < E; C++) {
|
|
9235
|
+
const w = [];
|
|
9230
9236
|
y.forEach((b, N) => {
|
|
9231
|
-
const R = b[
|
|
9237
|
+
const R = b[C];
|
|
9232
9238
|
let A = {
|
|
9233
9239
|
index: N,
|
|
9234
9240
|
...$
|
|
9235
9241
|
};
|
|
9236
|
-
delete A.combineKeys, delete A.combineValues, delete A.isRowColCombine,
|
|
9237
|
-
}),
|
|
9242
|
+
delete A.combineKeys, delete A.combineValues, delete A.isRowColCombine, v && R && R[v] !== void 0 ? (A.rawData = R[v], A.rowData = R) : (A.rawData = "", A.rowData = R || {}), A.computedType = ComputedType.loopRow, w.push(A);
|
|
9243
|
+
}), C === 0 ? u[_] = w : u.splice(_ + C, 0, w);
|
|
9238
9244
|
}
|
|
9239
9245
|
}), {
|
|
9240
9246
|
rowBaseCols: u,
|
|
9241
|
-
loopGroupRows:
|
|
9247
|
+
loopGroupRows: f,
|
|
9242
9248
|
groupColumnLoopData: p
|
|
9243
9249
|
};
|
|
9244
9250
|
}
|
|
@@ -9247,50 +9253,50 @@ function loopGroupRows(t, e, r, n, o) {
|
|
|
9247
9253
|
let s = e[a], l = o[s.data];
|
|
9248
9254
|
if (!l || !l.length)
|
|
9249
9255
|
continue;
|
|
9250
|
-
let c = t.findIndex((b) => b.index === s.index), u = r[c],
|
|
9251
|
-
const { groupLen: p, hasRowColCombine: m, hasGroupColumnLoop: g, maxGroupIndex: _ } = analyzeGroupStructure(u,
|
|
9256
|
+
let c = t.findIndex((b) => b.index === s.index), u = r[c], f = findGroupIndexs(u), d = getGroupData(f, u, l);
|
|
9257
|
+
const { groupLen: p, hasRowColCombine: m, hasGroupColumnLoop: g, maxGroupIndex: _ } = analyzeGroupStructure(u, f, l, d);
|
|
9252
9258
|
if (m && g)
|
|
9253
9259
|
throw new Error("不能同时设置交叉和分组列循环");
|
|
9254
|
-
const
|
|
9260
|
+
const E = {
|
|
9255
9261
|
...s,
|
|
9256
9262
|
loop: !1
|
|
9257
|
-
}, $ = [], { rowBaseCols: y, loopGroupRows:
|
|
9258
|
-
let
|
|
9259
|
-
if (
|
|
9260
|
-
$.push(cloneDeep(
|
|
9261
|
-
}),
|
|
9263
|
+
}, $ = [], { rowBaseCols: y, loopGroupRows: v, groupColumnLoopData: C } = generateRowStructure(u, f, l, d, p, m, g, _, t, r);
|
|
9264
|
+
let w = transpose(y);
|
|
9265
|
+
if (w.forEach(() => {
|
|
9266
|
+
$.push(cloneDeep(E));
|
|
9267
|
+
}), v.forEach(({ row: b, cells: N, removeCount: R }, A) => {
|
|
9262
9268
|
let [k, F, L] = A.split(":").map((T) => parseInt(T));
|
|
9263
9269
|
b.isLoopGroupComputed = !1;
|
|
9264
9270
|
const O = L + R;
|
|
9265
|
-
let x =
|
|
9271
|
+
let x = w[O];
|
|
9266
9272
|
N = N.map((T, S) => {
|
|
9267
9273
|
let I = x[S];
|
|
9268
9274
|
if (S < F) {
|
|
9269
9275
|
let B = [];
|
|
9270
|
-
|
|
9276
|
+
w.forEach((Z, Q) => {
|
|
9271
9277
|
Q <= O && Z.forEach((ee, ie) => {
|
|
9272
9278
|
ie === S && ee.rowSpan >= 1 && ["", "field"].includes(ee.type) && B.push(Q);
|
|
9273
9279
|
});
|
|
9274
9280
|
});
|
|
9275
|
-
let j = Math.max(...B), X =
|
|
9281
|
+
let j = Math.max(...B), X = w[j][S];
|
|
9276
9282
|
X && (X.rowSpan += 1, T.mergeTarget = [X.row, X.col]), T.rowSpan = 0, T.colSpan = 0;
|
|
9277
9283
|
} else if (I && I.type === CellType.TEXT) {
|
|
9278
|
-
let B =
|
|
9284
|
+
let B = w[0][S];
|
|
9279
9285
|
B.rowSpan += 1, T.rowSpan = 0, T.colSpan = 0, T.mergeTarget = [B.row, B.col];
|
|
9280
9286
|
}
|
|
9281
9287
|
return T.type === CellType.FUN && T.fun && (T.computedType = ComputedType.loopGroup), T.isGroup = I ? !!I.isGroup : !1, T.groupIndices = I ? I.groupIndices : !1, T.linkedMergeCell = I ? !!I.linkedMergeCell : !1, T.linkedColIndex = I ? I.linkedColIndex : { rowSpan: 1, colSpan: 1 }, T.isLoopGroupComputedCell = !0, T;
|
|
9282
9288
|
});
|
|
9283
9289
|
const D = O + 1;
|
|
9284
|
-
$.splice(D, 0, b),
|
|
9285
|
-
}),
|
|
9290
|
+
$.splice(D, 0, b), w.splice(D, 0, N);
|
|
9291
|
+
}), w = mergeSameCells(w), w.forEach((b, N) => {
|
|
9286
9292
|
let R = [];
|
|
9287
9293
|
b.forEach((A) => {
|
|
9288
9294
|
A && A.groupIndices !== void 0 && !isNaN(A.groupIndices) && R.push(A.groupIndices);
|
|
9289
9295
|
}), R.length > 0 && b.forEach((A) => {
|
|
9290
9296
|
A && (A.groupIndices = R);
|
|
9291
9297
|
});
|
|
9292
|
-
}), t.splice(c, 1, ...$), r.splice(c, 1, ...
|
|
9293
|
-
const { index: b, count: N } =
|
|
9298
|
+
}), t.splice(c, 1, ...$), r.splice(c, 1, ...w), C) {
|
|
9299
|
+
const { index: b, count: N } = C, R = n[b], A = [];
|
|
9294
9300
|
for (let F = 0; F < N; F++)
|
|
9295
9301
|
A.push(cloneDeep(R));
|
|
9296
9302
|
n.splice(b, 1, ...A);
|
|
@@ -9302,7 +9308,7 @@ function loopGroupRows(t, e, r, n, o) {
|
|
|
9302
9308
|
}
|
|
9303
9309
|
L.splice(b, L.length - b, ...O);
|
|
9304
9310
|
}
|
|
9305
|
-
const k = c +
|
|
9311
|
+
const k = c + w.length;
|
|
9306
9312
|
for (let F = k; F < r.length; F++) {
|
|
9307
9313
|
const L = r[F], O = [];
|
|
9308
9314
|
for (let x = 0; x < N; x++) {
|
|
@@ -9337,17 +9343,17 @@ function getLoopItem(t, e, r, n) {
|
|
|
9337
9343
|
if (l) {
|
|
9338
9344
|
if (a = { ...a, data: l }, r === "row" && a.index !== void 0 && a.index >= 0 && a.index < n.length) {
|
|
9339
9345
|
const c = n[a.index], u = c.length;
|
|
9340
|
-
for (let
|
|
9341
|
-
const
|
|
9342
|
-
|
|
9346
|
+
for (let f = 0; f < u; f++) {
|
|
9347
|
+
const d = c[f];
|
|
9348
|
+
d.data && (d.rowData = a.data);
|
|
9343
9349
|
}
|
|
9344
9350
|
} else if (r === "col" && a.index !== void 0 && a.index >= 0) {
|
|
9345
9351
|
const c = n.length;
|
|
9346
9352
|
for (let u = 0; u < c; u++) {
|
|
9347
|
-
const
|
|
9348
|
-
if (a.index <
|
|
9349
|
-
const
|
|
9350
|
-
|
|
9353
|
+
const f = n[u];
|
|
9354
|
+
if (a.index < f.length) {
|
|
9355
|
+
const d = f[a.index];
|
|
9356
|
+
d.data && (d.colData = a.data);
|
|
9351
9357
|
}
|
|
9352
9358
|
}
|
|
9353
9359
|
}
|
|
@@ -9428,21 +9434,21 @@ function transformArrayToObject(t, e) {
|
|
|
9428
9434
|
for (const s of a) {
|
|
9429
9435
|
let l = r[i];
|
|
9430
9436
|
for (let c = 0; c < n.toObjectSetting.length; c++) {
|
|
9431
|
-
const u = n.toObjectSetting[c],
|
|
9432
|
-
if (
|
|
9437
|
+
const u = n.toObjectSetting[c], f = u.field.toUpperCase(), d = s[f];
|
|
9438
|
+
if (d === void 0) continue;
|
|
9433
9439
|
let p;
|
|
9434
9440
|
switch (u.format) {
|
|
9435
9441
|
case "text":
|
|
9436
|
-
p = formatText(
|
|
9442
|
+
p = formatText(d, u.formatType);
|
|
9437
9443
|
break;
|
|
9438
9444
|
case "number":
|
|
9439
|
-
p = formatNumber(
|
|
9445
|
+
p = formatNumber(d, u.formatType);
|
|
9440
9446
|
break;
|
|
9441
9447
|
case "datetime":
|
|
9442
|
-
p = formatDateTime(
|
|
9448
|
+
p = formatDateTime(d, u.formatType);
|
|
9443
9449
|
break;
|
|
9444
9450
|
default:
|
|
9445
|
-
p =
|
|
9451
|
+
p = d;
|
|
9446
9452
|
}
|
|
9447
9453
|
const m = String(p).toUpperCase();
|
|
9448
9454
|
c < n.toObjectSetting.length - 1 ? (l[m] || (l[m] = {}), l = l[m]) : l[m] = s;
|
|
@@ -9483,9 +9489,9 @@ async function renderReportToConfigs(t, e, r, n = [], o) {
|
|
|
9483
9489
|
const s = [];
|
|
9484
9490
|
for (const l of a) {
|
|
9485
9491
|
const c = { ...e, ...l }, u = [];
|
|
9486
|
-
for (const
|
|
9487
|
-
const
|
|
9488
|
-
u.push(
|
|
9492
|
+
for (const f of t) {
|
|
9493
|
+
const d = await renderOneTableConfig(f, c, r, n);
|
|
9494
|
+
u.push(d);
|
|
9489
9495
|
}
|
|
9490
9496
|
s.push(u);
|
|
9491
9497
|
}
|
|
@@ -9594,11 +9600,11 @@ function getMaxRowSpanFrom(t, e, r) {
|
|
|
9594
9600
|
return n;
|
|
9595
9601
|
}
|
|
9596
9602
|
function createReportSplitState(t, e, r) {
|
|
9597
|
-
var
|
|
9603
|
+
var d, p;
|
|
9598
9604
|
const { rowConfig: n, colConfig: o, config: i } = cloneDeep(t), a = getFixedRows(n), s = fixedRowsHeight(a), l = [];
|
|
9599
9605
|
for (let m = 0; m < n.length; m++)
|
|
9600
9606
|
n[m].isHidden || l.push(m);
|
|
9601
|
-
const c = (
|
|
9607
|
+
const c = (d = r == null ? void 0 : r.header) != null && d.enabled ? mmToPx(r.header.height) : 0, u = (p = r == null ? void 0 : r.footer) != null && p.enabled ? mmToPx(r.footer.height) : 0, f = s + c + u;
|
|
9602
9608
|
return {
|
|
9603
9609
|
rowConfig: n,
|
|
9604
9610
|
colConfig: o,
|
|
@@ -9609,7 +9615,7 @@ function createReportSplitState(t, e, r) {
|
|
|
9609
9615
|
currentRowIdx: 0,
|
|
9610
9616
|
themeColor: e,
|
|
9611
9617
|
theme: r == null ? void 0 : r.theme,
|
|
9612
|
-
reservedHeight:
|
|
9618
|
+
reservedHeight: f,
|
|
9613
9619
|
header: r == null ? void 0 : r.header,
|
|
9614
9620
|
footer: r == null ? void 0 : r.footer,
|
|
9615
9621
|
watermark: r == null ? void 0 : r.watermark,
|
|
@@ -9640,43 +9646,43 @@ function renderWatermarkLayer(t, e, r) {
|
|
|
9640
9646
|
const o = t.fontSize, i = t.text.length * o * 0.6 + o * 2, a = o * 2, s = Math.max(1, Math.ceil(e / i)), l = Math.max(1, Math.ceil(r / a));
|
|
9641
9647
|
for (let c = 0; c < l; c++)
|
|
9642
9648
|
for (let u = 0; u < s; u++) {
|
|
9643
|
-
const
|
|
9644
|
-
|
|
9645
|
-
const
|
|
9646
|
-
|
|
9649
|
+
const f = document.createElement("div");
|
|
9650
|
+
f.className = "print-watermark-item", f.textContent = t.text, f.style.fontSize = `${o}px`, f.style.color = "#000", f.style.opacity = String(t.opacity), f.style.transform = `rotate(${t.rotate}deg)`;
|
|
9651
|
+
const d = c % 2 === 0 ? 0 : i / 2;
|
|
9652
|
+
f.style.left = `${u * i + d}px`, f.style.top = `${c * a}px`, n.appendChild(f);
|
|
9647
9653
|
}
|
|
9648
9654
|
return n;
|
|
9649
9655
|
}
|
|
9650
9656
|
function buildPageDom(t, e, r, n) {
|
|
9651
|
-
const { rowConfig: o, colConfig: i, config: a, fixedRows: s, watermark: l, header: c, footer: u, pageNumber:
|
|
9652
|
-
m.className = "print-page-wrapper", l != null && l.enabled && m.appendChild(renderWatermarkLayer(l, r, n)), c != null && c.enabled && m.appendChild(renderPrintArea(c, { page:
|
|
9657
|
+
const { rowConfig: o, colConfig: i, config: a, fixedRows: s, watermark: l, header: c, footer: u, pageNumber: f, totalPages: d, title: p } = t, m = document.createElement("div");
|
|
9658
|
+
m.className = "print-page-wrapper", l != null && l.enabled && m.appendChild(renderWatermarkLayer(l, r, n)), c != null && c.enabled && m.appendChild(renderPrintArea(c, { page: f, total: d, title: p }, "center"));
|
|
9653
9659
|
const g = [], _ = [];
|
|
9654
9660
|
for (const $ of s)
|
|
9655
9661
|
g.push({ ...$.row }), _.push(cloneDeep(a[$.index]));
|
|
9656
9662
|
for (const $ of e)
|
|
9657
9663
|
o[$].isFixed || (g.push({ ...o[$] }), _.push(cloneDeep(a[$])));
|
|
9658
|
-
const
|
|
9659
|
-
return m.appendChild(
|
|
9664
|
+
const E = renderReportByDomForPrint(g, i, _, t.themeColor, t.theme);
|
|
9665
|
+
return m.appendChild(E), u != null && u.enabled && m.appendChild(renderPrintArea(u, { page: f, total: d, title: p }, "center")), m;
|
|
9660
9666
|
}
|
|
9661
9667
|
function splitNextReportPage(t, e, r, n, o = !1) {
|
|
9662
9668
|
const { rowConfig: i, config: a, reservedHeight: s, visibleRows: l } = t;
|
|
9663
9669
|
if (t.currentRowIdx >= l.length) return null;
|
|
9664
9670
|
const c = e - s, u = i[l[t.currentRowIdx]].size;
|
|
9665
9671
|
if (!o && u > c) return null;
|
|
9666
|
-
let
|
|
9672
|
+
let f = 0, d = [], p = t.currentRowIdx;
|
|
9667
9673
|
for (; p < l.length; ) {
|
|
9668
|
-
const _ = l[p],
|
|
9669
|
-
if (
|
|
9670
|
-
|
|
9674
|
+
const _ = l[p], E = i[_].size;
|
|
9675
|
+
if (f + E > c && d.length > 0) break;
|
|
9676
|
+
d.push(_), f += E, p++;
|
|
9671
9677
|
}
|
|
9672
|
-
const m = getMaxRowSpanFrom(a,
|
|
9673
|
-
for (; m >
|
|
9678
|
+
const m = getMaxRowSpanFrom(a, d[0], d);
|
|
9679
|
+
for (; m > d[d.length - 1] + 1 && p < l.length; ) {
|
|
9674
9680
|
const _ = l[p];
|
|
9675
|
-
|
|
9681
|
+
d.push(_), f += i[_].size, p++;
|
|
9676
9682
|
}
|
|
9677
9683
|
t.pageNumber += 1;
|
|
9678
|
-
const g = buildPageDom(t,
|
|
9679
|
-
return t.currentRowIdx = p, { dom: g, height:
|
|
9684
|
+
const g = buildPageDom(t, d, r, n);
|
|
9685
|
+
return t.currentRowIdx = p, { dom: g, height: f };
|
|
9680
9686
|
}
|
|
9681
9687
|
function computePageBreaks(t, e, r) {
|
|
9682
9688
|
const n = createReportSplitState(t, void 0, {
|
|
@@ -9685,34 +9691,37 @@ function computePageBreaks(t, e, r) {
|
|
|
9685
9691
|
}), { rowConfig: o, reservedHeight: i, visibleRows: a, config: s } = n, l = e - i, c = [];
|
|
9686
9692
|
let u = 0;
|
|
9687
9693
|
for (; u < a.length; ) {
|
|
9688
|
-
let
|
|
9694
|
+
let f = 0, d = [];
|
|
9689
9695
|
for (; u < a.length; ) {
|
|
9690
9696
|
const m = a[u], g = o[m].size;
|
|
9691
|
-
if (
|
|
9692
|
-
|
|
9697
|
+
if (f + g > l && d.length > 0) break;
|
|
9698
|
+
d.push(m), f += g, u++;
|
|
9693
9699
|
}
|
|
9694
|
-
const p = getMaxRowSpanFrom(s,
|
|
9695
|
-
for (; p >
|
|
9700
|
+
const p = getMaxRowSpanFrom(s, d[0], d);
|
|
9701
|
+
for (; p > d[d.length - 1] + 1 && u < a.length; ) {
|
|
9696
9702
|
const m = a[u];
|
|
9697
|
-
|
|
9703
|
+
d.push(m), f += o[m].size, u++;
|
|
9698
9704
|
}
|
|
9699
|
-
c.push(
|
|
9705
|
+
c.push(d[d.length - 1]);
|
|
9700
9706
|
}
|
|
9701
9707
|
return c;
|
|
9702
9708
|
}
|
|
9709
|
+
function escapeHtml(t) {
|
|
9710
|
+
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
9711
|
+
}
|
|
9703
9712
|
function buildPrintDocumentHTML(t) {
|
|
9704
|
-
const { pages: e, printConfig: r, contentWidthPx: n, pageHeightOverrideMm: o } = t,
|
|
9705
|
-
const
|
|
9706
|
-
const
|
|
9707
|
-
return `<div class="print-page-content" style="width:${n}px">${
|
|
9713
|
+
const { pages: e, printConfig: r, contentWidthPx: n, pageHeightOverrideMm: o, docTitle: i } = t, a = r, s = mmToPx(a.width), l = a.height != null || o != null, c = o != null ? `${o}mm` : a.height != null ? `${a.height}mm` : "auto", u = l ? o != null ? mmToPx(o) : mmToPx(a.height) : "auto", f = e.map((d) => {
|
|
9714
|
+
const p = d.map((m) => {
|
|
9715
|
+
const _ = new XMLSerializer().serializeToString(m.dom);
|
|
9716
|
+
return `<div class="print-page-content" style="width:${n}px">${_}</div>`;
|
|
9708
9717
|
}).join("");
|
|
9709
|
-
return `<div class="print-page" style="width:${
|
|
9718
|
+
return `<div class="print-page" style="width:${s}px;min-width:${s}px;${l ? `height:${u}px;min-height:${u}px;` : ""}padding:${mmToPx(a.marginTop)}px ${mmToPx(a.marginRight)}px ${mmToPx(a.marginBottom)}px ${mmToPx(a.marginLeft)}px;box-sizing:border-box">${p}</div>`;
|
|
9710
9719
|
}).join("");
|
|
9711
9720
|
return `<!DOCTYPE html>
|
|
9712
9721
|
<html>
|
|
9713
9722
|
<head>
|
|
9714
9723
|
<meta charset="utf-8">
|
|
9715
|
-
<title
|
|
9724
|
+
<title>${i ? escapeHtml(i) : "打印预览"}</title>
|
|
9716
9725
|
<style>
|
|
9717
9726
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9718
9727
|
body { background: #e8e8e8; font-family: Arial, sans-serif; }
|
|
@@ -9722,7 +9731,7 @@ function buildPrintDocumentHTML(t) {
|
|
|
9722
9731
|
${getPrintTableStylesString()}
|
|
9723
9732
|
.print-page-content img { max-width: 100%; }
|
|
9724
9733
|
@page {
|
|
9725
|
-
size: ${
|
|
9734
|
+
size: ${a.width}mm ${c};
|
|
9726
9735
|
margin: 0;
|
|
9727
9736
|
}
|
|
9728
9737
|
@media print {
|
|
@@ -9735,7 +9744,7 @@ function buildPrintDocumentHTML(t) {
|
|
|
9735
9744
|
</style>
|
|
9736
9745
|
</head>
|
|
9737
9746
|
<body>
|
|
9738
|
-
<div class="print-container">${
|
|
9747
|
+
<div class="print-container">${f}</div>
|
|
9739
9748
|
</body>
|
|
9740
9749
|
</html>`;
|
|
9741
9750
|
}
|
|
@@ -9745,8 +9754,8 @@ async function printReportByBrowser(t, e, r) {
|
|
|
9745
9754
|
...DEFAULT_PRINT_CONFIG,
|
|
9746
9755
|
...n.printConfig || {},
|
|
9747
9756
|
...(r == null ? void 0 : r.printConfig) || {}
|
|
9748
|
-
}, i = await buildPendingItems(n.id, n.remoteOptions || [], e || {}), a = await paginate(i, o, n.name), s = getPrintContentWidthPx(o), l = buildPrintDocumentHTML({ pages: a, printConfig: o, contentWidthPx: s });
|
|
9749
|
-
printHTMLViaIframe(l);
|
|
9757
|
+
}, i = await buildPendingItems(n.id, n.remoteOptions || [], e || {}), a = await paginate(i, o, n.name), s = getPrintContentWidthPx(o), l = buildPrintDocumentHTML({ pages: a, printConfig: o, contentWidthPx: s, docTitle: n.name });
|
|
9758
|
+
printHTMLViaIframe(l, n.name);
|
|
9750
9759
|
}
|
|
9751
9760
|
async function buildPendingItems(t, e, r) {
|
|
9752
9761
|
const n = [];
|
|
@@ -9761,31 +9770,31 @@ async function buildPendingItems(t, e, r) {
|
|
|
9761
9770
|
{ pageSize: 5e3, pageIndex: 1, total: 0, isPagination: !!s.pagination },
|
|
9762
9771
|
!0
|
|
9763
9772
|
);
|
|
9764
|
-
let
|
|
9765
|
-
s.processData && (
|
|
9773
|
+
let f = toUpdateData(u);
|
|
9774
|
+
s.processData && (f = await getProcessData(s.processData, f, c, {
|
|
9766
9775
|
pageSize: 5e3,
|
|
9767
9776
|
pageIndex: 1,
|
|
9768
9777
|
total: 0
|
|
9769
9778
|
}));
|
|
9770
|
-
const
|
|
9779
|
+
const d = s.source, p = getThemeColors(a.theme || "none").border, m = d.find((g) => g.loopTable);
|
|
9771
9780
|
if (m && m.key) {
|
|
9772
9781
|
const g = await renderReportToConfigs(
|
|
9773
9782
|
l,
|
|
9774
|
-
d,
|
|
9775
9783
|
f,
|
|
9784
|
+
d,
|
|
9776
9785
|
[],
|
|
9777
9786
|
m.key
|
|
9778
9787
|
);
|
|
9779
9788
|
for (let _ = 0; _ < g.length; _++) {
|
|
9780
9789
|
_ > 0 && n.push({ kind: "break" });
|
|
9781
|
-
for (const
|
|
9782
|
-
n.push({ kind: "report", reportConfig:
|
|
9790
|
+
for (const E of g[_])
|
|
9791
|
+
n.push({ kind: "report", reportConfig: E, themeColor: p, theme: a.theme || "none" });
|
|
9783
9792
|
}
|
|
9784
9793
|
} else {
|
|
9785
9794
|
const g = await renderReportToConfigs(
|
|
9786
9795
|
l,
|
|
9787
|
-
d,
|
|
9788
9796
|
f,
|
|
9797
|
+
d,
|
|
9789
9798
|
[]
|
|
9790
9799
|
);
|
|
9791
9800
|
for (const _ of g)
|
|
@@ -9801,29 +9810,29 @@ async function paginate(t, e, r, n) {
|
|
|
9801
9810
|
watermark: e.watermark,
|
|
9802
9811
|
title: r
|
|
9803
9812
|
}, l = [];
|
|
9804
|
-
let c = [], u = 0,
|
|
9805
|
-
const
|
|
9813
|
+
let c = [], u = 0, f = 0;
|
|
9814
|
+
const d = [];
|
|
9806
9815
|
async function p() {
|
|
9807
|
-
c.length > 0 && (l.push({ items: c }), c = [], u = 0,
|
|
9816
|
+
c.length > 0 && (l.push({ items: c }), c = [], u = 0, f += 1, n && (n(f), await yieldToUI()));
|
|
9808
9817
|
}
|
|
9809
9818
|
async function m() {
|
|
9810
9819
|
if (i)
|
|
9811
|
-
for (;
|
|
9812
|
-
const g =
|
|
9820
|
+
for (; d.length > 0; ) {
|
|
9821
|
+
const g = d[0], _ = o - u;
|
|
9813
9822
|
if (_ <= 0) {
|
|
9814
9823
|
if (c.length === 0) break;
|
|
9815
9824
|
await p();
|
|
9816
9825
|
continue;
|
|
9817
9826
|
}
|
|
9818
|
-
let
|
|
9819
|
-
if (!
|
|
9827
|
+
let E = splitNextReportPage(g, _, a, o);
|
|
9828
|
+
if (!E) {
|
|
9820
9829
|
if (c.length > 0) {
|
|
9821
9830
|
await p();
|
|
9822
9831
|
continue;
|
|
9823
9832
|
}
|
|
9824
|
-
|
|
9833
|
+
E = splitNextReportPage(g, _, a, o, !0);
|
|
9825
9834
|
}
|
|
9826
|
-
c.push({ type: "report", dom:
|
|
9835
|
+
c.push({ type: "report", dom: E.dom }), u += E.height, g.currentRowIdx >= g.visibleRows.length && d.shift();
|
|
9827
9836
|
}
|
|
9828
9837
|
}
|
|
9829
9838
|
if (i) {
|
|
@@ -9833,46 +9842,52 @@ async function paginate(t, e, r, n) {
|
|
|
9833
9842
|
continue;
|
|
9834
9843
|
}
|
|
9835
9844
|
if (g.kind === "image") {
|
|
9836
|
-
let y = g.width,
|
|
9837
|
-
if (
|
|
9838
|
-
const
|
|
9839
|
-
y = Math.round(y *
|
|
9845
|
+
let y = g.width, v = g.height;
|
|
9846
|
+
if (g.stretch && y > 0 && (v = Math.round(v * (a / y)), y = a), v > o) {
|
|
9847
|
+
const C = o / v;
|
|
9848
|
+
y = Math.round(y * C), v = o;
|
|
9840
9849
|
}
|
|
9841
|
-
|
|
9850
|
+
v > o - u && c.length > 0 && await p(), c.push({ type: "image", dom: createImageDom(g.src, y, v) }), u += v;
|
|
9842
9851
|
continue;
|
|
9843
9852
|
}
|
|
9844
9853
|
const _ = createReportSplitState(g.reportConfig, g.themeColor, { ...s, theme: g.theme });
|
|
9845
9854
|
await m();
|
|
9846
|
-
const
|
|
9847
|
-
$ ? (c.push({ type: "report", dom: $.dom }), u += $.height, _.currentRowIdx < _.visibleRows.length &&
|
|
9855
|
+
const E = o - u, $ = splitNextReportPage(_, E, a, o);
|
|
9856
|
+
$ ? (c.push({ type: "report", dom: $.dom }), u += $.height, _.currentRowIdx < _.visibleRows.length && d.push(_)) : (c.length > 0 && await p(), d.push(_));
|
|
9848
9857
|
}
|
|
9849
9858
|
await m(), await p();
|
|
9850
9859
|
} else {
|
|
9851
9860
|
const g = mmToPx(e.marginTop + e.marginBottom), _ = [];
|
|
9852
|
-
for (const
|
|
9853
|
-
if (
|
|
9854
|
-
const
|
|
9855
|
-
|
|
9861
|
+
for (const E of t) {
|
|
9862
|
+
if (E.kind === "break") {
|
|
9863
|
+
const w = document.createElement("div");
|
|
9864
|
+
w.style.height = `${g}px`, _.push({ type: "spacer", dom: w });
|
|
9856
9865
|
continue;
|
|
9857
9866
|
}
|
|
9858
|
-
if (
|
|
9859
|
-
|
|
9867
|
+
if (E.kind === "image") {
|
|
9868
|
+
let w = E.width, b = E.height;
|
|
9869
|
+
E.stretch && w > 0 && (b = Math.round(b * (a / w)), w = a), _.push({ type: "image", dom: createImageDom(E.src, w, b) });
|
|
9860
9870
|
continue;
|
|
9861
9871
|
}
|
|
9862
|
-
const { rowConfig: $, colConfig: y, config:
|
|
9863
|
-
_.push({ type: "report", dom:
|
|
9872
|
+
const { rowConfig: $, colConfig: y, config: v } = E.reportConfig, C = renderReportByDomForPrint($, y, v, E.themeColor, E.theme);
|
|
9873
|
+
_.push({ type: "report", dom: C });
|
|
9864
9874
|
}
|
|
9865
9875
|
l.push({ items: _ });
|
|
9866
9876
|
}
|
|
9867
9877
|
return l.map((g) => g.items);
|
|
9868
9878
|
}
|
|
9869
|
-
function printHTMLViaIframe(t) {
|
|
9870
|
-
const
|
|
9871
|
-
|
|
9872
|
-
const
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9879
|
+
function printHTMLViaIframe(t, e) {
|
|
9880
|
+
const r = document.createElement("iframe");
|
|
9881
|
+
r.style.position = "fixed", r.style.left = "-9999px", r.style.top = "-9999px", r.style.width = "0", r.style.height = "0", r.style.border = "none", document.body.appendChild(r);
|
|
9882
|
+
const n = r.contentDocument;
|
|
9883
|
+
n.open(), n.write(t), n.close(), r.onload = () => {
|
|
9884
|
+
const o = r.contentWindow, i = document.title;
|
|
9885
|
+
e && (document.title = e);
|
|
9886
|
+
const a = () => {
|
|
9887
|
+
document.title = i;
|
|
9888
|
+
};
|
|
9889
|
+
o.addEventListener("afterprint", a), o.print(), a(), setTimeout(() => {
|
|
9890
|
+
o.removeEventListener("afterprint", a), r.remove();
|
|
9876
9891
|
}, 500);
|
|
9877
9892
|
};
|
|
9878
9893
|
}
|
|
@@ -9888,7 +9903,7 @@ async function exportReportByBrowser(t, e, r, n) {
|
|
|
9888
9903
|
reportConfig: p.reportConfig,
|
|
9889
9904
|
themeColor: p.themeColor,
|
|
9890
9905
|
theme: p.theme
|
|
9891
|
-
}) : p.type === "image" && p.src && i.push({ kind: "image", src: p.src, width: p.width || 600, height: p.height || 400 });
|
|
9906
|
+
}) : p.type === "image" && p.src && i.push({ kind: "image", src: p.src, width: p.width || 600, height: p.height || 400, stretch: p.stretch });
|
|
9892
9907
|
}), n != null && n.singlePage) {
|
|
9893
9908
|
await exportSinglePagePdf(i, e, r, o);
|
|
9894
9909
|
return;
|
|
@@ -9905,14 +9920,14 @@ async function exportReportByBrowser(t, e, r, n) {
|
|
|
9905
9920
|
p.type === "report" && p.reportConfig ? l += Math.max(1, computePageBreaks(p.reportConfig, s, a).length) : p.type === "image" && p.src && (l += 1);
|
|
9906
9921
|
const c = o && l > 0 ? (p) => o(`正在生成分页(${p}/${l} 页)...`) : void 0, u = await paginate(i, a, r, c);
|
|
9907
9922
|
o == null || o("正在调起打印,请在打印对话框中选择「另存为 PDF」...");
|
|
9908
|
-
const
|
|
9909
|
-
printHTMLViaIframe(
|
|
9923
|
+
const f = getPrintContentWidthPx(a), d = buildPrintDocumentHTML({ pages: u, printConfig: a, contentWidthPx: f, docTitle: r });
|
|
9924
|
+
printHTMLViaIframe(d, r);
|
|
9910
9925
|
}
|
|
9911
9926
|
async function exportSinglePagePdf(t, e, r, n) {
|
|
9912
9927
|
n == null || n("正在生成单页 PDF...");
|
|
9913
9928
|
const o = Math.max(
|
|
9914
9929
|
600,
|
|
9915
|
-
...t.map((
|
|
9930
|
+
...t.map((d) => d.kind === "report" ? d.reportConfig.colConfig.reduce((p, m) => p + (m.size || 0), 0) : d.kind === "image" ? d.width : 0)
|
|
9916
9931
|
), i = {
|
|
9917
9932
|
...e,
|
|
9918
9933
|
width: pxToMm(o + mmToPx(e.marginLeft + e.marginRight)),
|
|
@@ -9921,17 +9936,17 @@ async function exportSinglePagePdf(t, e, r, n) {
|
|
|
9921
9936
|
n == null || n("正在测量页面高度...");
|
|
9922
9937
|
const l = document.createElement("div");
|
|
9923
9938
|
l.style.cssText = `position:absolute;left:-99999px;top:0;visibility:hidden;width:${o + mmToPx(i.marginLeft + i.marginRight)}px;padding:${mmToPx(i.marginTop)}px ${mmToPx(i.marginRight)}px ${mmToPx(i.marginBottom)}px ${mmToPx(i.marginLeft)}px;box-sizing:border-box;`;
|
|
9924
|
-
for (const
|
|
9939
|
+
for (const d of s) {
|
|
9925
9940
|
const p = document.createElement("div");
|
|
9926
|
-
p.style.width = `${o}px`, p.appendChild(
|
|
9941
|
+
p.style.width = `${o}px`, p.appendChild(d.dom), l.appendChild(p);
|
|
9927
9942
|
}
|
|
9928
9943
|
document.body.appendChild(l);
|
|
9929
9944
|
const c = l.getBoundingClientRect().height;
|
|
9930
9945
|
document.body.removeChild(l);
|
|
9931
9946
|
const u = Math.ceil(pxToMm(c)) + 1;
|
|
9932
9947
|
n == null || n("正在调起打印,请在打印对话框中选择「另存为 PDF」...");
|
|
9933
|
-
const
|
|
9934
|
-
printHTMLViaIframe(
|
|
9948
|
+
const f = buildPrintDocumentHTML({ pages: a, printConfig: i, contentWidthPx: o, pageHeightOverrideMm: u, docTitle: r });
|
|
9949
|
+
printHTMLViaIframe(f, r);
|
|
9935
9950
|
}
|
|
9936
9951
|
var quarterOfYear$1 = { exports: {} };
|
|
9937
9952
|
(function(t, e) {
|
|
@@ -9950,10 +9965,10 @@ var quarterOfYear$1 = { exports: {} };
|
|
|
9950
9965
|
};
|
|
9951
9966
|
var l = a.startOf;
|
|
9952
9967
|
a.startOf = function(c, u) {
|
|
9953
|
-
var
|
|
9954
|
-
if (
|
|
9968
|
+
var f = this.$utils(), d = !!f.u(u) || u;
|
|
9969
|
+
if (f.p(c) === n) {
|
|
9955
9970
|
var p = this.quarter() - 1;
|
|
9956
|
-
return
|
|
9971
|
+
return d ? this.month(3 * p).startOf(r).startOf("day") : this.month(3 * p + 2).endOf(r).endOf("day");
|
|
9957
9972
|
}
|
|
9958
9973
|
return l.bind(this)(c, u);
|
|
9959
9974
|
};
|
|
@@ -9993,16 +10008,16 @@ function parseShiftConfig(t) {
|
|
|
9993
10008
|
if (!t) return [];
|
|
9994
10009
|
const e = t.split(",").map((n) => n.trim()).filter(Boolean), r = [];
|
|
9995
10010
|
return e.forEach((n, o) => {
|
|
9996
|
-
const i = n.split("|").map((
|
|
10011
|
+
const i = n.split("|").map((d) => d.trim());
|
|
9997
10012
|
if (i.length !== 3) return;
|
|
9998
10013
|
const [a, s, l] = i, c = parseShiftOffset(s), u = parseShiftOffset(l);
|
|
9999
10014
|
if (c === null || !u) return;
|
|
10000
|
-
let
|
|
10001
|
-
|
|
10015
|
+
let f = a;
|
|
10016
|
+
f || (f = e.length === 2 ? o === 0 ? "早班" : "晚班" : e.length === 3 ? ["早班", "中班", "晚班"][o] : `班次${o + 1}`), r.push({ label: f, startMinutes: c, endMinutes: u });
|
|
10002
10017
|
}), r;
|
|
10003
10018
|
}
|
|
10004
10019
|
function getDateRanges() {
|
|
10005
|
-
const t = "YYYY-MM-DD HH:mm:ss", e = dayjs(), r = e.startOf("day").format(t), n = e.endOf("day").format(t), o = e.startOf("week").format(t), i = e.endOf("week").format(t), a = e.startOf("month").format(t), s = e.endOf("month").format(t), l = e.subtract(1, "month").startOf("month").format(t), c = e.subtract(1, "month").endOf("month").format(t), u = e.startOf("quarter").format(t),
|
|
10020
|
+
const t = "YYYY-MM-DD HH:mm:ss", e = dayjs(), r = e.startOf("day").format(t), n = e.endOf("day").format(t), o = e.startOf("week").format(t), i = e.endOf("week").format(t), a = e.startOf("month").format(t), s = e.endOf("month").format(t), l = e.subtract(1, "month").startOf("month").format(t), c = e.subtract(1, "month").endOf("month").format(t), u = e.startOf("quarter").format(t), f = e.endOf("quarter").format(t), d = e.subtract(1, "quarter").startOf("quarter").format(t), p = e.subtract(1, "quarter").endOf("quarter").format(t), m = e.startOf("year").format(t), g = e.endOf("year").format(t), _ = e.subtract(1, "year").startOf("year").format(t), E = e.subtract(1, "year").endOf("year").format(t), $ = e.format(t), y = e.subtract(2, "day").format(t), v = e.subtract(3, "day").format(t), C = e.subtract(7, "day").format(t), w = e.subtract(15, "day").format(t), b = e.subtract(30, "day").format(t), N = e.subtract(2, "week").startOf("week").format(t), R = e.subtract(2, "month").format(t), A = e.subtract(3, "month").format(t), k = e.subtract(6, "month").format(t), F = e.subtract(1, "year").startOf("year").format(t), L = e.subtract(2, "year").startOf("year").format(t), O = e.subtract(3, "year").format(t), x = e.subtract(5, "year").format(t);
|
|
10006
10021
|
return {
|
|
10007
10022
|
dateFormat: t,
|
|
10008
10023
|
thisDayStart: r,
|
|
@@ -10014,18 +10029,18 @@ function getDateRanges() {
|
|
|
10014
10029
|
lastMonthStart: l,
|
|
10015
10030
|
lastMonthEnd: c,
|
|
10016
10031
|
thisQuarterStart: u,
|
|
10017
|
-
thisQuarterEnd:
|
|
10018
|
-
lastQuarterStart:
|
|
10032
|
+
thisQuarterEnd: f,
|
|
10033
|
+
lastQuarterStart: d,
|
|
10019
10034
|
lastQuarterEnd: p,
|
|
10020
10035
|
thisYearStart: m,
|
|
10021
10036
|
thisYearEnd: g,
|
|
10022
10037
|
lastYearStart: _,
|
|
10023
|
-
lastYearEnd:
|
|
10038
|
+
lastYearEnd: E,
|
|
10024
10039
|
now: $,
|
|
10025
10040
|
twoDay: y,
|
|
10026
|
-
threeDay:
|
|
10027
|
-
sevenDay:
|
|
10028
|
-
fifteenDay:
|
|
10041
|
+
threeDay: v,
|
|
10042
|
+
sevenDay: C,
|
|
10043
|
+
fifteenDay: w,
|
|
10029
10044
|
thirtyDay: b,
|
|
10030
10045
|
twoWeek: N,
|
|
10031
10046
|
twoMonth: R,
|
|
@@ -10094,7 +10109,7 @@ const _hoisted_1$6 = { class: "yh-report-view-conditions" }, _sfc_main$7 = /* @_
|
|
|
10094
10109
|
},
|
|
10095
10110
|
emits: ["change", "addCell"],
|
|
10096
10111
|
setup(t, { expose: e, emit: r }) {
|
|
10097
|
-
const n = t, o = r, i = useRoute(), { dateFormat: a, thisDayStart: s, thisDayEnd: l, thisWeekStart: c, thisMonthStart: u, thisMonthEnd:
|
|
10112
|
+
const n = t, o = r, i = useRoute(), { dateFormat: a, thisDayStart: s, thisDayEnd: l, thisWeekStart: c, thisMonthStart: u, thisMonthEnd: f, lastMonthStart: d, lastMonthEnd: p, thisQuarterStart: m, lastQuarterStart: g, thisYearStart: _, thisYearEnd: E, lastYearStart: $, lastYearEnd: y, now: v, twoDay: C, threeDay: w, sevenDay: b, fifteenDay: N, thirtyDay: R, twoWeek: A, twoMonth: k, threeMonth: F, sixMonth: L, oneYear: O, twoYear: x, threeYear: D, fiveYear: T } = getDateRanges(), S = ref([]), I = ref([]), B = computed(() => {
|
|
10098
10113
|
let M = reactive({});
|
|
10099
10114
|
return I.value.forEach((H) => {
|
|
10100
10115
|
M[H.columnName] = H;
|
|
@@ -10190,22 +10205,22 @@ const _hoisted_1$6 = { class: "yh-report-view-conditions" }, _sfc_main$7 = /* @_
|
|
|
10190
10205
|
function ee(M, H, z) {
|
|
10191
10206
|
let K = {
|
|
10192
10207
|
thisDay: [s, l],
|
|
10193
|
-
thisMonth: [u,
|
|
10194
|
-
lastMonth: [
|
|
10195
|
-
thisYear: [_,
|
|
10208
|
+
thisMonth: [u, f],
|
|
10209
|
+
lastMonth: [d, p],
|
|
10210
|
+
thisYear: [_, E],
|
|
10196
10211
|
lastYear: [$, y],
|
|
10197
|
-
now: [s,
|
|
10198
|
-
twoDay: [
|
|
10199
|
-
threeDay: [
|
|
10200
|
-
sevenDay: [b,
|
|
10201
|
-
fifteenDay: [N,
|
|
10202
|
-
thirtyDay: [R,
|
|
10203
|
-
threeMonth: [F,
|
|
10204
|
-
sixMonth: [L,
|
|
10205
|
-
oneYear: [O,
|
|
10206
|
-
twoYear: [x,
|
|
10207
|
-
threeYear: [D,
|
|
10208
|
-
fiveYear: [T,
|
|
10212
|
+
now: [s, v],
|
|
10213
|
+
twoDay: [C, v],
|
|
10214
|
+
threeDay: [w, v],
|
|
10215
|
+
sevenDay: [b, v],
|
|
10216
|
+
fifteenDay: [N, v],
|
|
10217
|
+
thirtyDay: [R, v],
|
|
10218
|
+
threeMonth: [F, v],
|
|
10219
|
+
sixMonth: [L, v],
|
|
10220
|
+
oneYear: [O, v],
|
|
10221
|
+
twoYear: [x, v],
|
|
10222
|
+
threeYear: [D, v],
|
|
10223
|
+
fiveYear: [T, v]
|
|
10209
10224
|
}[M] || [s, l];
|
|
10210
10225
|
return H && (K[0] = re(K[0], H, a)), z && (K[1] = re(K[1], z, a)), K;
|
|
10211
10226
|
}
|
|
@@ -10223,17 +10238,17 @@ const _hoisted_1$6 = { class: "yh-report-view-conditions" }, _sfc_main$7 = /* @_
|
|
|
10223
10238
|
twoWeek: A,
|
|
10224
10239
|
thisQuarter: m,
|
|
10225
10240
|
lastQuarter: g,
|
|
10226
|
-
now:
|
|
10241
|
+
now: v,
|
|
10227
10242
|
thisDay: s,
|
|
10228
|
-
twoDay:
|
|
10229
|
-
threeDay:
|
|
10243
|
+
twoDay: C,
|
|
10244
|
+
threeDay: w,
|
|
10230
10245
|
sevenDay: b,
|
|
10231
10246
|
fifteenDay: N,
|
|
10232
10247
|
thirtyDay: R
|
|
10233
10248
|
}[H];
|
|
10234
10249
|
if (!K) {
|
|
10235
10250
|
let oe = dayjs().startOf(M);
|
|
10236
|
-
oe.isValid() ? K = oe.format(a) : K =
|
|
10251
|
+
oe.isValid() ? K = oe.format(a) : K = v;
|
|
10237
10252
|
}
|
|
10238
10253
|
return z && (K = re(K, z, a)), K;
|
|
10239
10254
|
}
|
|
@@ -10455,15 +10470,15 @@ function resolveFieldKey(t, e) {
|
|
|
10455
10470
|
function sortRowsByField(t, e, r, n = !1) {
|
|
10456
10471
|
const o = resolveFieldKey(t, e), i = r === "desc" ? -1 : 1;
|
|
10457
10472
|
return [...t].sort((a, s) => {
|
|
10458
|
-
const l = a == null ? void 0 : a[o], c = s == null ? void 0 : s[o], u = l == null || l === "",
|
|
10459
|
-
if (u ||
|
|
10460
|
-
let
|
|
10473
|
+
const l = a == null ? void 0 : a[o], c = s == null ? void 0 : s[o], u = l == null || l === "", f = c == null || c === "";
|
|
10474
|
+
if (u || f) return u && f ? 0 : u ? 1 : -1;
|
|
10475
|
+
let d;
|
|
10461
10476
|
if (n) {
|
|
10462
10477
|
const p = parseFloat(l), m = parseFloat(c), g = isNaN(p) ? Number.POSITIVE_INFINITY : p, _ = isNaN(m) ? Number.POSITIVE_INFINITY : m;
|
|
10463
|
-
|
|
10478
|
+
d = g - _;
|
|
10464
10479
|
} else
|
|
10465
|
-
|
|
10466
|
-
return
|
|
10480
|
+
d = String(l).localeCompare(String(c), "zh-CN");
|
|
10481
|
+
return d * i;
|
|
10467
10482
|
});
|
|
10468
10483
|
}
|
|
10469
10484
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
@@ -10490,7 +10505,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10490
10505
|
"isPrintMode",
|
|
10491
10506
|
computed(() => !1)
|
|
10492
10507
|
), a = inject("printConfig", void 0), s = ref(), l = ref(), c = ref();
|
|
10493
|
-
let u = null,
|
|
10508
|
+
let u = null, f = null, d = null;
|
|
10494
10509
|
const p = shallowRef([]), m = shallowRef([]), g = computed(() => {
|
|
10495
10510
|
if (i.value && (a != null && a.value)) {
|
|
10496
10511
|
const U = a.value;
|
|
@@ -10503,24 +10518,24 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10503
10518
|
width: n.config.widthType === "%" ? `calc(${n.config.width}% - 10px)` : `${n.config.width - 10}px`,
|
|
10504
10519
|
height: n.config.fullHeight ? "calc(100% - 8px)" : `${n.config.height}px`
|
|
10505
10520
|
};
|
|
10506
|
-
}), _ = computed(() => getThemeColors(n.config.theme || "none")),
|
|
10521
|
+
}), _ = computed(() => getThemeColors(n.config.theme || "none")), E = computed(() => n.config && n.config.data ? !!n.config.data.pagination : !1), $ = computed(() => n.config.params && Array.isArray(n.config.params) && n.config.params.filter((U) => U.isShow).length > 0), y = reactive({
|
|
10507
10522
|
pageSize: 100,
|
|
10508
10523
|
pageSizes: [10, 20, 50, 100, 200, 1e4],
|
|
10509
10524
|
pageIndex: 1,
|
|
10510
10525
|
total: 0
|
|
10511
|
-
}),
|
|
10526
|
+
}), v = ref([]), C = ref([]), w = (U) => {
|
|
10512
10527
|
let G = 0, V = U;
|
|
10513
10528
|
if (U.includes("!")) {
|
|
10514
10529
|
let J = U.split("!");
|
|
10515
10530
|
G = parseInt(J[0]), V = J[1];
|
|
10516
10531
|
}
|
|
10517
10532
|
let Y = V.match(/[A-Z]+/)[0], q = V.match(/\d+/)[0] - 1, W = columnToNumber(Y), re = `${G}:${q}:${W}`;
|
|
10518
|
-
|
|
10533
|
+
C.value.includes(re) || C.value.push(re);
|
|
10519
10534
|
};
|
|
10520
10535
|
function b(U) {
|
|
10521
10536
|
if (R && n.config.data.autoQuery === !1)
|
|
10522
10537
|
return R = !1, !1;
|
|
10523
|
-
|
|
10538
|
+
v.value = U, y.pageIndex = 1, X();
|
|
10524
10539
|
}
|
|
10525
10540
|
let N = !1, R = !0;
|
|
10526
10541
|
watch(
|
|
@@ -10576,7 +10591,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10576
10591
|
}), null;
|
|
10577
10592
|
}
|
|
10578
10593
|
let G = ie(U);
|
|
10579
|
-
if (n.config.data.processData && (G = await getProcessData(n.config.data.processData, G,
|
|
10594
|
+
if (n.config.data.processData && (G = await getProcessData(n.config.data.processData, G, v.value, y)), u && u.order !== "none") {
|
|
10580
10595
|
const q = G[u.key];
|
|
10581
10596
|
Array.isArray(q) && (G[u.key] = sortRowsByField(q, u.field, u.order, u.numeric));
|
|
10582
10597
|
}
|
|
@@ -10613,7 +10628,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10613
10628
|
let V = !1, { rowConfig: Y, colConfig: q, config: W } = cloneDeep(U), re = getLoopItem(q, G, "col", W), J = getLoopItem(Y, G, "row", W);
|
|
10614
10629
|
re.length && (V = !0, loopGroupCols(q, re, W, G)), J.length && (V = !0, loopGroupRows(Y, J, W, q, G));
|
|
10615
10630
|
const M = transformArrayToObject(G, n.config.data.source);
|
|
10616
|
-
return computeCell(W, M,
|
|
10631
|
+
return computeCell(W, M, C.value), await preGenerateBarcodes([{ config: W }]), {
|
|
10617
10632
|
reportConfig: { config: W, rowConfig: Y, colConfig: q },
|
|
10618
10633
|
hasLoop: V
|
|
10619
10634
|
};
|
|
@@ -10649,7 +10664,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10649
10664
|
let q = !1, { rowConfig: W, colConfig: re, config: J } = cloneDeep(Y), M = getLoopItem(re, U, "col", J), H = getLoopItem(W, U, "row", J);
|
|
10650
10665
|
M.length && (q = !0, loopGroupCols(re, M, J, U)), H.length && (q = !0, loopGroupRows(W, H, J, re, U));
|
|
10651
10666
|
const z = transformArrayToObject(U, n.config.data.source);
|
|
10652
|
-
computeCell(J, z,
|
|
10667
|
+
computeCell(J, z, C.value, V), G.push({ config: J, rowConfig: W, colConfig: re, hasLoop: q }), p.value.push({
|
|
10653
10668
|
config: J,
|
|
10654
10669
|
rowConfig: W,
|
|
10655
10670
|
colConfig: re
|
|
@@ -10708,7 +10723,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10708
10723
|
let G = !1, { rowConfig: V, colConfig: Y, config: q } = cloneDeep(n.config), W = getLoopItem(Y, U, "col", q), re = getLoopItem(V, U, "row", q);
|
|
10709
10724
|
W.length && (G = !0, loopGroupCols(Y, W, q, U)), re.length && (G = !0, loopGroupRows(V, re, q, Y, U));
|
|
10710
10725
|
const J = transformArrayToObject(U, n.config.data.source);
|
|
10711
|
-
computeCell(q, J,
|
|
10726
|
+
computeCell(q, J, C.value), await preGenerateBarcodes([{ config: q }]), p.value.push({
|
|
10712
10727
|
config: q,
|
|
10713
10728
|
rowConfig: V,
|
|
10714
10729
|
colConfig: Y
|
|
@@ -10719,7 +10734,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10719
10734
|
let U = 0, G = [], V = {};
|
|
10720
10735
|
return n.config.params.forEach((Y) => {
|
|
10721
10736
|
Y.isNull && (V[Y.columnName] = Y);
|
|
10722
|
-
}),
|
|
10737
|
+
}), v.value.forEach((Y) => {
|
|
10723
10738
|
Y.name && V[Y.name] && !Y.value && (G.push(V[Y.name].name), U++);
|
|
10724
10739
|
}), U > 0 && Object.keys(V).length > 0 ? (ElMessage.warning({
|
|
10725
10740
|
message: `请填写必填项:${G.join(",")}`,
|
|
@@ -10735,9 +10750,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10735
10750
|
n.config.data.processData && (Y = await getProcessData(
|
|
10736
10751
|
n.config.data.processData,
|
|
10737
10752
|
Y,
|
|
10738
|
-
|
|
10753
|
+
v.value,
|
|
10739
10754
|
y
|
|
10740
|
-
)),
|
|
10755
|
+
)), d = Y, f = { ...Y }, Z(), Y = f;
|
|
10741
10756
|
const q = (G = n.config.data.source) == null ? void 0 : G.find((W) => W.loopTable);
|
|
10742
10757
|
q && q.key ? await I(Y, q.key) : await B(Y), nextTick(ee);
|
|
10743
10758
|
} catch (V) {
|
|
@@ -10752,9 +10767,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10752
10767
|
clearReportByDom(l);
|
|
10753
10768
|
}
|
|
10754
10769
|
function Z() {
|
|
10755
|
-
if (!
|
|
10756
|
-
const U =
|
|
10757
|
-
Array.isArray(U) && (u.order === "none" ?
|
|
10770
|
+
if (!f || !d || !u) return;
|
|
10771
|
+
const U = d[u.key];
|
|
10772
|
+
Array.isArray(U) && (u.order === "none" ? f[u.key] = U : f[u.key] = sortRowsByField(U, u.field, u.order, u.numeric));
|
|
10758
10773
|
}
|
|
10759
10774
|
async function Q(U) {
|
|
10760
10775
|
var M;
|
|
@@ -10763,11 +10778,11 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10763
10778
|
const V = G.getAttribute("data-click-sort-field") || "", Y = V.indexOf(".");
|
|
10764
10779
|
if (Y < 1) return;
|
|
10765
10780
|
const q = V.slice(0, Y).toUpperCase(), W = V.slice(Y + 1).toUpperCase();
|
|
10766
|
-
if (!q || !W || !
|
|
10781
|
+
if (!q || !W || !f) return;
|
|
10767
10782
|
const re = G.getAttribute("data-click-sort-numeric") === "1";
|
|
10768
10783
|
u && u.key === q && u.field === W ? u.order = u.order === "asc" ? "desc" : u.order === "desc" ? "none" : "asc" : u = { key: q, field: W, order: "asc", numeric: re }, Z();
|
|
10769
10784
|
const J = (M = n.config.data.source) == null ? void 0 : M.find((H) => H.loopTable);
|
|
10770
|
-
J && J.key ? await I(
|
|
10785
|
+
J && J.key ? await I(f, J.key) : await B(f), nextTick(ee);
|
|
10771
10786
|
}
|
|
10772
10787
|
function ee() {
|
|
10773
10788
|
var U;
|
|
@@ -10799,16 +10814,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10799
10814
|
return [];
|
|
10800
10815
|
const { resData: G, total: V } = await fetchReportData(
|
|
10801
10816
|
{ id: n.id, data: n.config.data, tableConfig: n.config.tableConfig },
|
|
10802
|
-
|
|
10817
|
+
v.value,
|
|
10803
10818
|
{
|
|
10804
10819
|
pageSize: y.pageSize,
|
|
10805
10820
|
pageIndex: y.pageIndex,
|
|
10806
10821
|
total: y.total,
|
|
10807
|
-
isPagination:
|
|
10822
|
+
isPagination: E.value
|
|
10808
10823
|
},
|
|
10809
10824
|
U
|
|
10810
10825
|
);
|
|
10811
|
-
return
|
|
10826
|
+
return E.value && (y.total = V), G;
|
|
10812
10827
|
}
|
|
10813
10828
|
function se() {
|
|
10814
10829
|
if (n.config.data.pageSize !== void 0 && (y.pageSize = isNaN(n.config.data.pageSize) ? n.config.data.pagination ? 10 : 5e3 : n.config.data.pageSize), n.config.data.pagination && n.config.data.pageSizes !== void 0) {
|
|
@@ -10835,7 +10850,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10835
10850
|
data: n.config.data,
|
|
10836
10851
|
ref_key: "conditionsRef",
|
|
10837
10852
|
ref: s,
|
|
10838
|
-
onAddCell:
|
|
10853
|
+
onAddCell: w,
|
|
10839
10854
|
onChange: b
|
|
10840
10855
|
}, {
|
|
10841
10856
|
search: withCtx(() => [
|
|
@@ -10860,7 +10875,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10860
10875
|
]),
|
|
10861
10876
|
_: 1
|
|
10862
10877
|
})) : createCommentVNode("", !0),
|
|
10863
|
-
|
|
10878
|
+
E.value && k.value ? (openBlock(), createBlock(V, {
|
|
10864
10879
|
key: 2,
|
|
10865
10880
|
text: "",
|
|
10866
10881
|
type: "primary",
|
|
@@ -10888,7 +10903,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10888
10903
|
])), [
|
|
10889
10904
|
[q, D.value]
|
|
10890
10905
|
]),
|
|
10891
|
-
|
|
10906
|
+
E.value ? withDirectives((openBlock(), createBlock(Y, {
|
|
10892
10907
|
key: 0,
|
|
10893
10908
|
pageSize: y.pageSize,
|
|
10894
10909
|
"onUpdate:pageSize": G[0] || (G[0] = (W) => y.pageSize = W),
|
|
@@ -10981,32 +10996,32 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
10981
10996
|
let i = null;
|
|
10982
10997
|
watch(
|
|
10983
10998
|
() => r.chartData.option,
|
|
10984
|
-
(
|
|
10985
|
-
i && i.setOption(
|
|
10999
|
+
(d) => {
|
|
11000
|
+
i && i.setOption(d, {
|
|
10986
11001
|
notMerge: !0
|
|
10987
11002
|
});
|
|
10988
11003
|
},
|
|
10989
11004
|
{ deep: !0 }
|
|
10990
11005
|
), watch(
|
|
10991
11006
|
() => r.chartData.isSuspend,
|
|
10992
|
-
(
|
|
10993
|
-
|
|
11007
|
+
(d) => {
|
|
11008
|
+
d && u();
|
|
10994
11009
|
},
|
|
10995
11010
|
{ deep: !0 }
|
|
10996
11011
|
);
|
|
10997
|
-
const a = ref(!1), s = (
|
|
10998
|
-
if (o.value =
|
|
11012
|
+
const a = ref(!1), s = (d) => {
|
|
11013
|
+
if (o.value = d, d && Object.keys(d).length > 0) {
|
|
10999
11014
|
const p = cloneDeep(r.chartData);
|
|
11000
11015
|
l(p);
|
|
11001
11016
|
}
|
|
11002
|
-
}, l = async (
|
|
11003
|
-
r.isView && await getChartData(
|
|
11017
|
+
}, l = async (d) => {
|
|
11018
|
+
r.isView && await getChartData(d, o.value, r.id), d.type === "label" && d.option.series.forEach((p) => {
|
|
11004
11019
|
p.renderItem = renderItem;
|
|
11005
|
-
}),
|
|
11020
|
+
}), d.option.colors = colors, i.setOption(d.option), a.value = !1;
|
|
11006
11021
|
}, c = async () => {
|
|
11007
11022
|
a.value = !0, i = echarts.init(n.value);
|
|
11008
|
-
let
|
|
11009
|
-
|
|
11023
|
+
let d = cloneDeep(r.chartData);
|
|
11024
|
+
d && await l(d);
|
|
11010
11025
|
}, u = () => {
|
|
11011
11026
|
nextTick(() => {
|
|
11012
11027
|
i.resize();
|
|
@@ -11014,16 +11029,20 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11014
11029
|
};
|
|
11015
11030
|
return e({
|
|
11016
11031
|
setOutData: s,
|
|
11017
|
-
getChartImage: () => i ?
|
|
11018
|
-
|
|
11019
|
-
|
|
11020
|
-
|
|
11021
|
-
|
|
11032
|
+
getChartImage: () => i ? {
|
|
11033
|
+
base64: i.getDataURL({
|
|
11034
|
+
type: "png",
|
|
11035
|
+
pixelRatio: 3,
|
|
11036
|
+
backgroundColor: "#fff"
|
|
11037
|
+
}),
|
|
11038
|
+
width: i.getWidth(),
|
|
11039
|
+
height: i.getHeight()
|
|
11040
|
+
} : null
|
|
11022
11041
|
}), onMounted(() => {
|
|
11023
11042
|
c(), window.addEventListener("resize", u);
|
|
11024
11043
|
}), onUnmounted(() => {
|
|
11025
11044
|
window.removeEventListener("resize", u);
|
|
11026
|
-
}), (
|
|
11045
|
+
}), (d, p) => {
|
|
11027
11046
|
const m = resolveDirective("loading");
|
|
11028
11047
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
11029
11048
|
ref_key: "chartRef",
|
|
@@ -11035,7 +11054,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11035
11054
|
]);
|
|
11036
11055
|
};
|
|
11037
11056
|
}
|
|
11038
|
-
}, chartItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
11057
|
+
}, chartItem = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-03ca93ce"]]), _hoisted_1$4 = {
|
|
11039
11058
|
key: 0,
|
|
11040
11059
|
class: "chart-print-mask"
|
|
11041
11060
|
}, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
@@ -11056,28 +11075,28 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11056
11075
|
);
|
|
11057
11076
|
const a = computed(() => {
|
|
11058
11077
|
if (n.value && (o != null && o.value)) {
|
|
11059
|
-
const
|
|
11078
|
+
const f = o.value, d = mmToPx(f.width), p = r.config.widthUnit === "%" ? d : r.config.width, m = d / p;
|
|
11060
11079
|
return {
|
|
11061
|
-
width: `${
|
|
11062
|
-
padding: `${r.index === 0 ? mmToPx(
|
|
11080
|
+
width: `${d}px`,
|
|
11081
|
+
padding: `${r.index === 0 ? mmToPx(f.marginTop) : 0}px ${mmToPx(f.marginLeft)}px ${r.index === r.length - 1 ? mmToPx(f.marginBottom) : 0}px ${mmToPx(f.marginLeft)}px`,
|
|
11063
11082
|
height: `${Math.round(r.config.height * m)}px`
|
|
11064
11083
|
};
|
|
11065
11084
|
}
|
|
11066
11085
|
let c = r.config.widthUnit || "px", u = r.config.heightUnit || "px";
|
|
11067
11086
|
if (r.config.isSuspend) {
|
|
11068
|
-
let
|
|
11087
|
+
let f = {
|
|
11069
11088
|
position: "absolute",
|
|
11070
11089
|
left: r.config.left + "px",
|
|
11071
11090
|
top: r.config.top + "px",
|
|
11072
11091
|
zIndex: 100,
|
|
11073
11092
|
height: r.config.height + u
|
|
11074
11093
|
};
|
|
11075
|
-
return c === "%" ?
|
|
11094
|
+
return c === "%" ? f.width = `calc( ${r.config.width}${c} - 10px)` : f.width = `${r.config.width - 10}${c}`, f;
|
|
11076
11095
|
} else {
|
|
11077
|
-
let
|
|
11096
|
+
let f = {
|
|
11078
11097
|
height: r.config.height + u
|
|
11079
11098
|
};
|
|
11080
|
-
return c === "%" ?
|
|
11099
|
+
return c === "%" ? f.width = `calc( ${r.config.width}${c} - 10px)` : f.width = `${r.config.width - 10}${c}`, f;
|
|
11081
11100
|
}
|
|
11082
11101
|
});
|
|
11083
11102
|
return e({
|
|
@@ -11117,7 +11136,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11117
11136
|
},
|
|
11118
11137
|
emits: ["report-error"],
|
|
11119
11138
|
setup(t, { expose: e, emit: r }) {
|
|
11120
|
-
useCssVars((
|
|
11139
|
+
useCssVars((C) => ({
|
|
11121
11140
|
v32f98b85: m.value,
|
|
11122
11141
|
v1268eb48: g.value,
|
|
11123
11142
|
v56272e74: s.value.color0,
|
|
@@ -11131,47 +11150,47 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11131
11150
|
v56272e64: s.value.color8
|
|
11132
11151
|
}));
|
|
11133
11152
|
const n = t, o = r, i = inject("isPrintMode", computed(() => !1)), a = inject("printConfig", void 0), s = computed(() => {
|
|
11134
|
-
let
|
|
11135
|
-
return colors.forEach((
|
|
11136
|
-
|
|
11137
|
-
}),
|
|
11138
|
-
}), l = ref(!1), c = ref(), u = ref([]),
|
|
11153
|
+
let C = {};
|
|
11154
|
+
return colors.forEach((w, b) => {
|
|
11155
|
+
C[`color${b}`] = w;
|
|
11156
|
+
}), C;
|
|
11157
|
+
}), l = ref(!1), c = ref(), u = ref([]), f = computed(() => u.value.length === 1), d = computed(() => u.value[0]), p = computed(() => f.value ? {
|
|
11139
11158
|
backgroundColor: n.config.singleColor || colors[0]
|
|
11140
11159
|
} : {}), m = computed(() => {
|
|
11141
11160
|
if (i.value && (a != null && a.value)) {
|
|
11142
|
-
const
|
|
11143
|
-
return `${mmToPx(
|
|
11161
|
+
const C = a.value;
|
|
11162
|
+
return `${mmToPx(C.width - C.marginLeft - C.marginRight)}px`;
|
|
11144
11163
|
}
|
|
11145
11164
|
if (n.config) {
|
|
11146
|
-
let
|
|
11147
|
-
return
|
|
11165
|
+
let C = n.config.widthUnit || "px";
|
|
11166
|
+
return C === "%" ? `calc( ${n.config.width}${C} - 10px)` : `${n.config.width - 10}${C}`;
|
|
11148
11167
|
} else
|
|
11149
11168
|
return "100%";
|
|
11150
|
-
}), g = computed(() => n.config ? `${n.config.height}px` : "10px"), _ = async (
|
|
11151
|
-
if (
|
|
11152
|
-
const
|
|
11153
|
-
await $(
|
|
11169
|
+
}), g = computed(() => n.config ? `${n.config.height}px` : "10px"), _ = async (C) => {
|
|
11170
|
+
if (C && Object.keys(C).length > 0) {
|
|
11171
|
+
const w = cloneDeep(n.config);
|
|
11172
|
+
await $(w, C);
|
|
11154
11173
|
}
|
|
11155
|
-
},
|
|
11156
|
-
SUM(
|
|
11157
|
-
return
|
|
11174
|
+
}, E = {
|
|
11175
|
+
SUM(C) {
|
|
11176
|
+
return C.map((b) => Number(b)).filter((b) => !isNaN(b)).reduce((b, N) => b + N, 0);
|
|
11158
11177
|
},
|
|
11159
|
-
AVG(
|
|
11160
|
-
const
|
|
11161
|
-
return
|
|
11178
|
+
AVG(C) {
|
|
11179
|
+
const w = C.map((b) => Number(b)).filter((b) => !isNaN(b));
|
|
11180
|
+
return w.length ? E.SUM(w) / w.length : 0;
|
|
11162
11181
|
},
|
|
11163
|
-
MAX(
|
|
11164
|
-
const
|
|
11165
|
-
return
|
|
11182
|
+
MAX(C) {
|
|
11183
|
+
const w = C.map((b) => Number(b)).filter((b) => !isNaN(b));
|
|
11184
|
+
return w.length ? Math.max(...w) : 0;
|
|
11166
11185
|
},
|
|
11167
|
-
MIN(
|
|
11168
|
-
const
|
|
11169
|
-
return
|
|
11186
|
+
MIN(C) {
|
|
11187
|
+
const w = C.map((b) => Number(b)).filter((b) => !isNaN(b));
|
|
11188
|
+
return w.length ? Math.min(...w) : 0;
|
|
11170
11189
|
},
|
|
11171
|
-
COUNT(
|
|
11172
|
-
return
|
|
11190
|
+
COUNT(C) {
|
|
11191
|
+
return C.length;
|
|
11173
11192
|
}
|
|
11174
|
-
}, $ = async (
|
|
11193
|
+
}, $ = async (C, w) => {
|
|
11175
11194
|
const {
|
|
11176
11195
|
data: { source: b },
|
|
11177
11196
|
notSingle: N,
|
|
@@ -11183,10 +11202,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11183
11202
|
singleComputed: O,
|
|
11184
11203
|
singleKey: x,
|
|
11185
11204
|
singleData: D
|
|
11186
|
-
} =
|
|
11205
|
+
} = C;
|
|
11187
11206
|
let T = {};
|
|
11188
|
-
|
|
11189
|
-
...
|
|
11207
|
+
w && (T = {
|
|
11208
|
+
...w
|
|
11190
11209
|
});
|
|
11191
11210
|
for (let S = 0; S < b.length; S++) {
|
|
11192
11211
|
const { key: I, url: B } = b[S];
|
|
@@ -11225,7 +11244,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11225
11244
|
let se = ee[ae];
|
|
11226
11245
|
return {
|
|
11227
11246
|
label: ae,
|
|
11228
|
-
value:
|
|
11247
|
+
value: E.SUM(se)
|
|
11229
11248
|
};
|
|
11230
11249
|
})), !isNaN(L) && L > 0 && (Q = Q.splice(0, L)), u.value = Q;
|
|
11231
11250
|
} else {
|
|
@@ -11237,7 +11256,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11237
11256
|
if (!B)
|
|
11238
11257
|
return l.value = !1, !1;
|
|
11239
11258
|
let j = B.map((X) => X[I]);
|
|
11240
|
-
O && (j =
|
|
11259
|
+
O && (j = E[O](j)), u.value.push({
|
|
11241
11260
|
label: x,
|
|
11242
11261
|
value: j
|
|
11243
11262
|
});
|
|
@@ -11245,46 +11264,46 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11245
11264
|
l.value = !1;
|
|
11246
11265
|
}, y = async () => {
|
|
11247
11266
|
l.value = !0;
|
|
11248
|
-
let
|
|
11249
|
-
|
|
11267
|
+
let C = cloneDeep(n.config);
|
|
11268
|
+
C && $(C);
|
|
11250
11269
|
};
|
|
11251
11270
|
e({
|
|
11252
11271
|
setOutData: _,
|
|
11253
|
-
getLabelImage:
|
|
11272
|
+
getLabelImage: v
|
|
11254
11273
|
}), onMounted(() => {
|
|
11255
11274
|
y();
|
|
11256
11275
|
});
|
|
11257
|
-
function
|
|
11276
|
+
function v() {
|
|
11258
11277
|
var O;
|
|
11259
11278
|
if (!u.value.length) return null;
|
|
11260
|
-
const
|
|
11261
|
-
N.width = Math.round(
|
|
11279
|
+
const C = Math.max(((O = c.value) == null ? void 0 : O.offsetWidth) || n.config.width || 200, 100), w = n.config.height || 100, b = 2, N = document.createElement("canvas");
|
|
11280
|
+
N.width = Math.round(C * b), N.height = Math.round(w * b);
|
|
11262
11281
|
const R = N.getContext("2d");
|
|
11263
11282
|
if (!R) return null;
|
|
11264
11283
|
R.scale(b, b);
|
|
11265
|
-
const A = u.value, k =
|
|
11284
|
+
const A = u.value, k = C / A.length, F = 14, L = Math.max(Math.round(w / 3.5), 12);
|
|
11266
11285
|
return A.forEach((x, D) => {
|
|
11267
11286
|
const T = D * k;
|
|
11268
|
-
R.fillStyle =
|
|
11269
|
-
}), { base64: N.toDataURL("image/png"), width:
|
|
11287
|
+
R.fillStyle = f.value ? n.config.singleColor || colors[0] : colors[D % colors.length], R.fillRect(T, 0, k, w), R.fillStyle = "#fff", R.textAlign = "center", R.textBaseline = "top", R.font = `${F}px sans-serif`, R.fillText(String(x.label ?? ""), T + k / 2, w * 0.08, k - 8), R.font = `bold ${L}px sans-serif`, R.fillText(String(x.value ?? ""), T + k / 2, w * 0.28, k - 8);
|
|
11288
|
+
}), { base64: N.toDataURL("image/png"), width: C, height: w };
|
|
11270
11289
|
}
|
|
11271
|
-
return (
|
|
11290
|
+
return (C, w) => {
|
|
11272
11291
|
const b = resolveDirective("loading");
|
|
11273
11292
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
11274
11293
|
ref_key: "rootRef",
|
|
11275
11294
|
ref: c,
|
|
11276
11295
|
"element-loading-text": unref(rct)("正在加载数据......"),
|
|
11277
|
-
class: normalizeClass(`yh-report-view-container yh-statement-label-item${
|
|
11296
|
+
class: normalizeClass(`yh-report-view-container yh-statement-label-item${f.value ? "" : " not-single"}`),
|
|
11278
11297
|
style: normalizeStyle(p.value)
|
|
11279
11298
|
}, [
|
|
11280
|
-
|
|
11281
|
-
createElementVNode("div", _hoisted_2$3, toDisplayString(
|
|
11282
|
-
createElementVNode("div", _hoisted_3$2, toDisplayString(
|
|
11299
|
+
f.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
11300
|
+
createElementVNode("div", _hoisted_2$3, toDisplayString(d.value.label), 1),
|
|
11301
|
+
createElementVNode("div", _hoisted_3$2, toDisplayString(d.value.value), 1)
|
|
11283
11302
|
], 64)) : (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(u.value, (N, R) => (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
11284
11303
|
createElementVNode("div", _hoisted_5$2, toDisplayString(N.label), 1),
|
|
11285
11304
|
createElementVNode("div", _hoisted_6$2, toDisplayString(N.value), 1)
|
|
11286
11305
|
]))), 256)),
|
|
11287
|
-
unref(i) ? (openBlock(), createElementBlock("div", _hoisted_7$1, [...
|
|
11306
|
+
unref(i) ? (openBlock(), createElementBlock("div", _hoisted_7$1, [...w[0] || (w[0] = [
|
|
11288
11307
|
createElementVNode("span", null, "仅展示,打印时会忽略", -1)
|
|
11289
11308
|
])])) : createCommentVNode("", !0)
|
|
11290
11309
|
], 14, _hoisted_1$3)), [
|
|
@@ -11308,12 +11327,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11308
11327
|
},
|
|
11309
11328
|
emits: ["update:visible"],
|
|
11310
11329
|
setup(t, { emit: e }) {
|
|
11311
|
-
const r = t, n = e, o = ref(), i = ref([]), a = ref([]), s = ref([]), l = ref(!1), c = useRoute(), u = ref(/* @__PURE__ */ new Map()),
|
|
11312
|
-
function
|
|
11330
|
+
const r = t, n = e, o = ref(), i = ref([]), a = ref([]), s = ref([]), l = ref(!1), c = useRoute(), u = ref(/* @__PURE__ */ new Map()), f = ref(/* @__PURE__ */ new Map());
|
|
11331
|
+
function d() {
|
|
11313
11332
|
return u.value.size > 0 ? u.value : r.tableConfigs || /* @__PURE__ */ new Map();
|
|
11314
11333
|
}
|
|
11315
11334
|
function p() {
|
|
11316
|
-
return
|
|
11335
|
+
return f.value.size > 0 ? f.value : r.batchTableConfigs || /* @__PURE__ */ new Map();
|
|
11317
11336
|
}
|
|
11318
11337
|
const m = computed(() => {
|
|
11319
11338
|
const y = r.printConfig;
|
|
@@ -11333,18 +11352,24 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11333
11352
|
function _() {
|
|
11334
11353
|
n("update:visible", !1);
|
|
11335
11354
|
}
|
|
11336
|
-
function
|
|
11355
|
+
function E() {
|
|
11337
11356
|
l.value = !0;
|
|
11338
|
-
const y = getPrintContentWidthPxMeasured(r.printConfig),
|
|
11357
|
+
const y = getPrintContentWidthPxMeasured(r.printConfig), v = buildPrintDocumentHTML({
|
|
11339
11358
|
pages: a.value,
|
|
11340
11359
|
printConfig: r.printConfig,
|
|
11341
|
-
contentWidthPx: y
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11345
|
-
|
|
11346
|
-
|
|
11347
|
-
|
|
11360
|
+
contentWidthPx: y,
|
|
11361
|
+
docTitle: r.statementName
|
|
11362
|
+
}), C = document.createElement("iframe");
|
|
11363
|
+
C.style.position = "fixed", C.style.left = "-9999px", C.style.top = "-9999px", C.style.width = "0", C.style.height = "0", C.style.border = "none", document.body.appendChild(C);
|
|
11364
|
+
const w = C.contentDocument;
|
|
11365
|
+
w.open(), w.write(v), w.close(), C.onload = () => {
|
|
11366
|
+
const b = C.contentWindow, N = document.title;
|
|
11367
|
+
r.statementName && (document.title = r.statementName);
|
|
11368
|
+
const R = () => {
|
|
11369
|
+
document.title = N;
|
|
11370
|
+
};
|
|
11371
|
+
b.addEventListener("afterprint", R), b.print(), R(), setTimeout(() => {
|
|
11372
|
+
b.removeEventListener("afterprint", R), C.remove(), l.value = !1;
|
|
11348
11373
|
}, 500);
|
|
11349
11374
|
};
|
|
11350
11375
|
}
|
|
@@ -11352,27 +11377,27 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11352
11377
|
() => r.visible,
|
|
11353
11378
|
async (y) => {
|
|
11354
11379
|
if (!y) return;
|
|
11355
|
-
const
|
|
11380
|
+
const v = ElLoading.service({
|
|
11356
11381
|
target: o.value,
|
|
11357
11382
|
text: "正在生成打印预览..."
|
|
11358
11383
|
});
|
|
11359
11384
|
await nextTick();
|
|
11360
11385
|
try {
|
|
11361
|
-
let
|
|
11386
|
+
let C = function() {
|
|
11362
11387
|
L.length > 0 && (F.push({ items: L }), L = [], O = 0);
|
|
11363
|
-
},
|
|
11388
|
+
}, w = function() {
|
|
11364
11389
|
if (R)
|
|
11365
11390
|
for (; x.length > 0; ) {
|
|
11366
11391
|
const T = x[0], S = N - O;
|
|
11367
11392
|
if (S <= 0) {
|
|
11368
11393
|
if (L.length === 0) break;
|
|
11369
|
-
|
|
11394
|
+
C();
|
|
11370
11395
|
continue;
|
|
11371
11396
|
}
|
|
11372
11397
|
let I = splitNextReportPage(T.state, S, A, N);
|
|
11373
11398
|
if (!I) {
|
|
11374
11399
|
if (L.length > 0) {
|
|
11375
|
-
|
|
11400
|
+
C();
|
|
11376
11401
|
continue;
|
|
11377
11402
|
}
|
|
11378
11403
|
I = splitNextReportPage(T.state, S, A, N, !0);
|
|
@@ -11385,7 +11410,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11385
11410
|
for (let T = 0; T < r.configs.length; T++) {
|
|
11386
11411
|
const S = r.configs[T];
|
|
11387
11412
|
if (S.type === "report") {
|
|
11388
|
-
const I =
|
|
11413
|
+
const I = d().get(T);
|
|
11389
11414
|
if (I && I.length > 0)
|
|
11390
11415
|
for (const j of I) {
|
|
11391
11416
|
const X = createReportSplitState(
|
|
@@ -11430,17 +11455,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11430
11455
|
if (R) {
|
|
11431
11456
|
for (const T of k) {
|
|
11432
11457
|
if (T.kind === "break") {
|
|
11433
|
-
|
|
11458
|
+
C();
|
|
11434
11459
|
continue;
|
|
11435
11460
|
}
|
|
11436
11461
|
if (T.kind === "report") {
|
|
11437
11462
|
const S = T.pending;
|
|
11438
|
-
|
|
11463
|
+
w();
|
|
11439
11464
|
const I = N - O, B = splitNextReportPage(S.state, I, A, N);
|
|
11440
|
-
B ? (L.push({ type: "report", dom: B.dom }), O += B.height, S.state.currentRowIdx < S.state.visibleRows.length && x.push(S)) : (L.length > 0 &&
|
|
11465
|
+
B ? (L.push({ type: "report", dom: B.dom }), O += B.height, S.state.currentRowIdx < S.state.visibleRows.length && x.push(S)) : (L.length > 0 && C(), x.push(S));
|
|
11441
11466
|
}
|
|
11442
11467
|
}
|
|
11443
|
-
|
|
11468
|
+
w(), C();
|
|
11444
11469
|
} else {
|
|
11445
11470
|
const T = r.printConfig, S = mmToPx(T.marginTop + T.marginBottom), I = [];
|
|
11446
11471
|
for (const B of k) {
|
|
@@ -11467,23 +11492,23 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11467
11492
|
S.appendChild(j), s.value.push(j);
|
|
11468
11493
|
}
|
|
11469
11494
|
}
|
|
11470
|
-
b && (await nextTick(),
|
|
11495
|
+
b && (await nextTick(), E(), setTimeout(() => {
|
|
11471
11496
|
n("update:visible", !1);
|
|
11472
11497
|
}, 1e3));
|
|
11473
11498
|
} finally {
|
|
11474
|
-
|
|
11499
|
+
v.close();
|
|
11475
11500
|
}
|
|
11476
11501
|
}
|
|
11477
11502
|
);
|
|
11478
11503
|
async function $() {
|
|
11479
|
-
u.value = /* @__PURE__ */ new Map(),
|
|
11504
|
+
u.value = /* @__PURE__ */ new Map(), f.value = /* @__PURE__ */ new Map();
|
|
11480
11505
|
const y = r.fetchAll !== !1;
|
|
11481
|
-
for (let
|
|
11482
|
-
const
|
|
11483
|
-
if (
|
|
11484
|
-
const
|
|
11506
|
+
for (let v = 0; v < r.configs.length; v++) {
|
|
11507
|
+
const C = r.configs[v];
|
|
11508
|
+
if (C.type !== "report") continue;
|
|
11509
|
+
const w = C, b = w.data, N = w.tableConfig;
|
|
11485
11510
|
if (!b || !N || !b.source) continue;
|
|
11486
|
-
const R = buildPrintParamsFromConfig(
|
|
11511
|
+
const R = buildPrintParamsFromConfig(w, c.query), { resData: A } = await fetchReportData(
|
|
11487
11512
|
{ id: r.reportId ?? "", data: b, tableConfig: N },
|
|
11488
11513
|
R,
|
|
11489
11514
|
{ pageSize: 5e3, pageIndex: 1, total: 0, isPagination: !!b.pagination },
|
|
@@ -11504,7 +11529,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11504
11529
|
[],
|
|
11505
11530
|
L.key
|
|
11506
11531
|
);
|
|
11507
|
-
|
|
11532
|
+
f.value.set(v, O);
|
|
11508
11533
|
} else {
|
|
11509
11534
|
const O = await renderReportToConfigs(
|
|
11510
11535
|
N,
|
|
@@ -11512,13 +11537,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11512
11537
|
F,
|
|
11513
11538
|
[]
|
|
11514
11539
|
);
|
|
11515
|
-
u.value.set(
|
|
11540
|
+
u.value.set(v, O);
|
|
11516
11541
|
}
|
|
11517
11542
|
}
|
|
11518
11543
|
}
|
|
11519
11544
|
return onBeforeUnmount(() => {
|
|
11520
11545
|
s.value.forEach((y) => y.remove());
|
|
11521
|
-
}), (y,
|
|
11546
|
+
}), (y, v) => (openBlock(), createBlock(unref(ElDialog), {
|
|
11522
11547
|
fullscreen: "",
|
|
11523
11548
|
"model-value": r.visible,
|
|
11524
11549
|
onClose: _,
|
|
@@ -11528,7 +11553,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11528
11553
|
default: withCtx(() => [
|
|
11529
11554
|
createElementVNode("div", _hoisted_1$2, [
|
|
11530
11555
|
createVNode(unref(ElButton), { onClick: _ }, {
|
|
11531
|
-
default: withCtx(() => [...
|
|
11556
|
+
default: withCtx(() => [...v[0] || (v[0] = [
|
|
11532
11557
|
createTextVNode("关闭", -1)
|
|
11533
11558
|
])]),
|
|
11534
11559
|
_: 1
|
|
@@ -11536,9 +11561,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11536
11561
|
createVNode(unref(ElButton), {
|
|
11537
11562
|
type: "primary",
|
|
11538
11563
|
loading: l.value,
|
|
11539
|
-
onClick:
|
|
11564
|
+
onClick: E
|
|
11540
11565
|
}, {
|
|
11541
|
-
default: withCtx(() => [...
|
|
11566
|
+
default: withCtx(() => [...v[1] || (v[1] = [
|
|
11542
11567
|
createTextVNode(" 打印 ", -1)
|
|
11543
11568
|
])]),
|
|
11544
11569
|
_: 1
|
|
@@ -11550,8 +11575,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11550
11575
|
ref: o
|
|
11551
11576
|
}, [
|
|
11552
11577
|
createElementVNode("div", _hoisted_2$2, [
|
|
11553
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (
|
|
11554
|
-
key:
|
|
11578
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (C, w) => (openBlock(), createElementBlock("div", {
|
|
11579
|
+
key: w,
|
|
11555
11580
|
class: "print-preview-page",
|
|
11556
11581
|
style: normalizeStyle(m.value)
|
|
11557
11582
|
}, [
|
|
@@ -11587,13 +11612,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11587
11612
|
setup(t, { emit: e }) {
|
|
11588
11613
|
const r = t;
|
|
11589
11614
|
ref();
|
|
11590
|
-
const n = ref(!1), o = ref(""), i = ref(""), a = ref([]), s = ref(), l = ref([]), c = ref([]), u = ref({ ...DEFAULT_PRINT_CONFIG }),
|
|
11615
|
+
const n = ref(!1), o = ref(""), i = ref(""), a = ref([]), s = ref(), l = ref([]), c = ref([]), u = ref({ ...DEFAULT_PRINT_CONFIG }), f = {}, d = computed(() => {
|
|
11591
11616
|
var O;
|
|
11592
11617
|
return !!((O = u.value) != null && O.enabled);
|
|
11593
11618
|
});
|
|
11594
|
-
provide("printConfig", u), provide("isPrintMode",
|
|
11619
|
+
provide("printConfig", u), provide("isPrintMode", d);
|
|
11595
11620
|
const p = computed(() => {
|
|
11596
|
-
if (!
|
|
11621
|
+
if (!d.value) return {};
|
|
11597
11622
|
const O = u.value;
|
|
11598
11623
|
return {
|
|
11599
11624
|
"--print-content-width": `${mmToPx(O.width - O.marginLeft - O.marginRight)}px`
|
|
@@ -11622,17 +11647,17 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11622
11647
|
const x = a.value.indexOf(O);
|
|
11623
11648
|
x > -1 && a.value.splice(x, 1);
|
|
11624
11649
|
}
|
|
11625
|
-
const
|
|
11650
|
+
const E = ref(!1);
|
|
11626
11651
|
function $(O) {
|
|
11627
|
-
|
|
11652
|
+
f[O.key] = O.data, l.value.forEach((x) => {
|
|
11628
11653
|
var D;
|
|
11629
|
-
(D = x == null ? void 0 : x.setOutData) == null || D.call(x,
|
|
11654
|
+
(D = x == null ? void 0 : x.setOutData) == null || D.call(x, f);
|
|
11630
11655
|
});
|
|
11631
11656
|
}
|
|
11632
11657
|
function y(O, x) {
|
|
11633
11658
|
O ? l.value[x] = O : delete l.value[x];
|
|
11634
11659
|
}
|
|
11635
|
-
async function
|
|
11660
|
+
async function v() {
|
|
11636
11661
|
var j, X;
|
|
11637
11662
|
const O = F.value || [], x = c.value.filter((Z) => Z.type === "report").length, D = c.value.length - x;
|
|
11638
11663
|
let T = 0, S = 0;
|
|
@@ -11642,51 +11667,51 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11642
11667
|
if (Q.type === "report") {
|
|
11643
11668
|
const ee = O[T];
|
|
11644
11669
|
if (T += 1, !(ee != null && ee.buildExportConfigs)) continue;
|
|
11645
|
-
|
|
11670
|
+
w(`正在获取表格数据(${T}/${x})...`);
|
|
11646
11671
|
const ie = await ee.buildExportConfigs();
|
|
11647
11672
|
if (!ie) continue;
|
|
11648
11673
|
const ae = getThemeColors(Q.theme || "none").border;
|
|
11649
11674
|
I.push({ type: "report", reportConfig: ie, subReportIndex: Q.subReprotIndex || 0 }), ie.forEach((se) => B.push({ type: "report", reportConfig: se, themeColor: ae, theme: Q.theme || "none" }));
|
|
11650
11675
|
} else {
|
|
11651
|
-
S += 1,
|
|
11676
|
+
S += 1, w(`正在截取图表/指标卡(${S}/${D})...`);
|
|
11652
11677
|
const ee = l.value[Z];
|
|
11653
11678
|
if (!ee) continue;
|
|
11654
11679
|
let ie = null;
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
|
|
11658
|
-
|
|
11659
|
-
|
|
11660
|
-
|
|
11661
|
-
|
|
11680
|
+
Q.type === "label" ? ie = ((j = ee.getLabelImage) == null ? void 0 : j.call(ee)) || null : ie = ((X = ee.getChartImage) == null ? void 0 : X.call(ee)) || null, ie && (I.push({ type: "image", image: ie }), B.push({
|
|
11681
|
+
type: "image",
|
|
11682
|
+
src: ie.base64,
|
|
11683
|
+
width: ie.width,
|
|
11684
|
+
height: ie.height,
|
|
11685
|
+
stretch: Q.type !== "label"
|
|
11686
|
+
}));
|
|
11662
11687
|
}
|
|
11663
11688
|
}
|
|
11664
11689
|
return { mergeItems: I, printItems: B };
|
|
11665
11690
|
}
|
|
11666
|
-
let
|
|
11667
|
-
function
|
|
11668
|
-
|
|
11691
|
+
let C = null;
|
|
11692
|
+
function w(O) {
|
|
11693
|
+
C || (C = ElLoading.service({
|
|
11669
11694
|
target: s.value ?? void 0,
|
|
11670
11695
|
background: "rgba(255, 255, 255, 0.75)"
|
|
11671
|
-
})),
|
|
11696
|
+
})), C.setText(O);
|
|
11672
11697
|
}
|
|
11673
11698
|
function b() {
|
|
11674
|
-
|
|
11699
|
+
C == null || C.close(), C = null;
|
|
11675
11700
|
}
|
|
11676
11701
|
async function N(O) {
|
|
11677
|
-
|
|
11702
|
+
w("正在准备导出...");
|
|
11678
11703
|
try {
|
|
11679
|
-
const { mergeItems: x, printItems: D } = await
|
|
11704
|
+
const { mergeItems: x, printItems: D } = await v();
|
|
11680
11705
|
if (!x.length) {
|
|
11681
11706
|
ElMessage.warning("当前报表没有可导出的内容");
|
|
11682
11707
|
return;
|
|
11683
11708
|
}
|
|
11684
11709
|
if (O === "excel") {
|
|
11685
|
-
|
|
11710
|
+
w("正在生成 Excel 文件...");
|
|
11686
11711
|
const T = await exportReportMerged(x, o.value || "报表导出", "gray");
|
|
11687
11712
|
T && downloadReport(T, o.value || "报表导出", "excel");
|
|
11688
11713
|
} else O.startsWith("pdf") && await exportReportByBrowser(D, u.value, o.value, {
|
|
11689
|
-
onProgress: (T) =>
|
|
11714
|
+
onProgress: (T) => w(T),
|
|
11690
11715
|
orientation: O === "pdf-landscape" ? "landscape" : "portrait",
|
|
11691
11716
|
singlePage: O === "pdf-single"
|
|
11692
11717
|
});
|
|
@@ -11721,7 +11746,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11721
11746
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
11722
11747
|
createElementVNode("div", _hoisted_1$1, [
|
|
11723
11748
|
createElementVNode("span", _hoisted_2$1, toDisplayString(o.value), 1),
|
|
11724
|
-
|
|
11749
|
+
d.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
11725
11750
|
createVNode(unref(ElDropdown), {
|
|
11726
11751
|
trigger: "click",
|
|
11727
11752
|
onCommand: N
|
|
@@ -11780,7 +11805,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11780
11805
|
})
|
|
11781
11806
|
]))
|
|
11782
11807
|
]),
|
|
11783
|
-
|
|
11808
|
+
d.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
11784
11809
|
createVNode(unref(ElButton), {
|
|
11785
11810
|
type: "primary",
|
|
11786
11811
|
size: "small",
|
|
@@ -11800,7 +11825,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11800
11825
|
}, null, 8, ["sub-title"])
|
|
11801
11826
|
])) : withDirectives((openBlock(), createElementBlock("section", {
|
|
11802
11827
|
key: 2,
|
|
11803
|
-
class: normalizeClass(["yh-report-viewer-wrapper", { "print-mode":
|
|
11828
|
+
class: normalizeClass(["yh-report-viewer-wrapper", { "print-mode": d.value }]),
|
|
11804
11829
|
style: normalizeStyle(p.value),
|
|
11805
11830
|
ref_key: "viewWrapper",
|
|
11806
11831
|
ref: s
|
|
@@ -11817,7 +11842,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11817
11842
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(c.value, (T, S) => (openBlock(), createElementBlock(Fragment, null, [
|
|
11818
11843
|
T.type === "report" ? (openBlock(), createBlock(_sfc_main$6, {
|
|
11819
11844
|
key: 0,
|
|
11820
|
-
"is-print-mode":
|
|
11845
|
+
"is-print-mode": d.value,
|
|
11821
11846
|
ref_for: !0,
|
|
11822
11847
|
ref_key: "reportViewItemRefs",
|
|
11823
11848
|
ref: F,
|
|
@@ -11850,7 +11875,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
11850
11875
|
withDirectives(createElementVNode("div", _hoisted_6$1, [...x[7] || (x[7] = [
|
|
11851
11876
|
createElementVNode("i", { class: "iconfont icon-backtop" }, null, -1)
|
|
11852
11877
|
])], 512), [
|
|
11853
|
-
[vShow,
|
|
11878
|
+
[vShow, E.value]
|
|
11854
11879
|
])
|
|
11855
11880
|
], 6)), [
|
|
11856
11881
|
[D, n.value]
|
|
@@ -12050,8 +12075,8 @@ async function fetchReportForPrint(t, e, r) {
|
|
|
12050
12075
|
for (const c of n.remoteOptions || []) {
|
|
12051
12076
|
if (c.type !== "report")
|
|
12052
12077
|
continue;
|
|
12053
|
-
const u = c,
|
|
12054
|
-
if (!
|
|
12078
|
+
const u = c, f = u.data, d = u.tableConfig;
|
|
12079
|
+
if (!f || !d || !f.source)
|
|
12055
12080
|
continue;
|
|
12056
12081
|
const p = buildPrintParamsFromConfig(u, e || {}), m = {
|
|
12057
12082
|
pageSize: s,
|
|
@@ -12059,13 +12084,13 @@ async function fetchReportForPrint(t, e, r) {
|
|
|
12059
12084
|
total: 0,
|
|
12060
12085
|
isPagination: a
|
|
12061
12086
|
}, { resData: g } = await fetchReportData(
|
|
12062
|
-
{ id: n.id, data:
|
|
12087
|
+
{ id: n.id, data: f, tableConfig: d },
|
|
12063
12088
|
p,
|
|
12064
12089
|
m,
|
|
12065
12090
|
!a
|
|
12066
12091
|
);
|
|
12067
12092
|
let _ = toUpdateData(g);
|
|
12068
|
-
|
|
12093
|
+
f.processData && (_ = await getProcessData(f.processData, _, p, {
|
|
12069
12094
|
pageSize: s,
|
|
12070
12095
|
pageIndex: l,
|
|
12071
12096
|
total: 0
|
|
@@ -12101,29 +12126,29 @@ function usePrinterClient() {
|
|
|
12101
12126
|
function a(l) {
|
|
12102
12127
|
printerClient.setUrl(l);
|
|
12103
12128
|
}
|
|
12104
|
-
async function s(l, c, u,
|
|
12129
|
+
async function s(l, c, u, f = 1, d) {
|
|
12105
12130
|
if (printerClient.status.value !== "connected")
|
|
12106
12131
|
throw ElMessage.error("打印服务未连接"), new Error("打印服务未连接");
|
|
12107
12132
|
printerClient.printing.value = !0;
|
|
12108
12133
|
try {
|
|
12109
|
-
const { config: p, tableData: m } = await fetchReportForPrint(l, c,
|
|
12134
|
+
const { config: p, tableData: m } = await fetchReportForPrint(l, c, d);
|
|
12110
12135
|
let g = u || printerClient.selectedPrinter.value;
|
|
12111
12136
|
if (!g) {
|
|
12112
|
-
const y = printerClient.printers.value.find((
|
|
12137
|
+
const y = printerClient.printers.value.find((v) => v.isDefault) || printerClient.printers.value[0];
|
|
12113
12138
|
g = y == null ? void 0 : y.name;
|
|
12114
12139
|
}
|
|
12115
12140
|
if (!g)
|
|
12116
12141
|
throw ElMessage.error("未找到可用打印机"), new Error("未找到可用打印机");
|
|
12117
|
-
const _ = p.printConfig,
|
|
12142
|
+
const _ = p.printConfig, E = _ && typeof _.width == "number" ? { widthMm: _.width, heightMm: typeof _.height == "number" ? _.height : 297 } : void 0, $ = await printerClient.printReport({
|
|
12118
12143
|
options: p.remoteOptions,
|
|
12119
12144
|
printConfig: p.printConfig,
|
|
12120
12145
|
statementName: p.name,
|
|
12121
12146
|
tableData: m,
|
|
12122
12147
|
printerName: g,
|
|
12123
|
-
copies:
|
|
12124
|
-
pageSize:
|
|
12148
|
+
copies: f,
|
|
12149
|
+
pageSize: E
|
|
12125
12150
|
});
|
|
12126
|
-
return $.success ? ElMessage.success(`打印已发送:${g},共 ${$.copies ||
|
|
12151
|
+
return $.success ? ElMessage.success(`打印已发送:${g},共 ${$.copies || f} 份`) : ElMessage.error($.message || "打印失败"), $;
|
|
12127
12152
|
} finally {
|
|
12128
12153
|
printerClient.printing.value = !1;
|
|
12129
12154
|
}
|
|
@@ -12184,10 +12209,10 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12184
12209
|
}
|
|
12185
12210
|
o.setUrl(m), ElMessage.success("正在连接:" + m);
|
|
12186
12211
|
}
|
|
12187
|
-
function
|
|
12212
|
+
function f() {
|
|
12188
12213
|
o.manualReconnect(), ElMessage.info("正在重新连接...");
|
|
12189
12214
|
}
|
|
12190
|
-
async function
|
|
12215
|
+
async function d() {
|
|
12191
12216
|
if (e.value !== "connected") {
|
|
12192
12217
|
ElMessage.warning("打印服务未连接");
|
|
12193
12218
|
return;
|
|
@@ -12219,8 +12244,8 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12219
12244
|
`打印机:${n.value}`,
|
|
12220
12245
|
`时间:${m}`,
|
|
12221
12246
|
"如能正常打印,说明连接与打印机配置正确"
|
|
12222
|
-
], _ = g.map((
|
|
12223
|
-
const y = { ...defaultCell, text:
|
|
12247
|
+
], _ = g.map((E, $) => {
|
|
12248
|
+
const y = { ...defaultCell, text: E, row: $ + 1, col: 1 };
|
|
12224
12249
|
return y.style = { ...y.style, fontWeight: $ === 0 ? "bold" : "normal" }, [y];
|
|
12225
12250
|
});
|
|
12226
12251
|
return [
|
|
@@ -12248,8 +12273,8 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12248
12273
|
];
|
|
12249
12274
|
}
|
|
12250
12275
|
return (m, g) => {
|
|
12251
|
-
const _ = resolveComponent("YhIcon"),
|
|
12252
|
-
return openBlock(), createBlock(
|
|
12276
|
+
const _ = resolveComponent("YhIcon"), E = resolveComponent("el-button"), $ = resolveComponent("el-input"), y = resolveComponent("el-divider"), v = resolveComponent("el-popover");
|
|
12277
|
+
return openBlock(), createBlock(v, {
|
|
12253
12278
|
placement: "bottom",
|
|
12254
12279
|
"popper-class": "yh-printer-popover",
|
|
12255
12280
|
width: 280,
|
|
@@ -12281,13 +12306,13 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12281
12306
|
createElementVNode("div", _hoisted_5, [
|
|
12282
12307
|
createVNode($, {
|
|
12283
12308
|
modelValue: i.value,
|
|
12284
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
12309
|
+
"onUpdate:modelValue": g[0] || (g[0] = (C) => i.value = C),
|
|
12285
12310
|
size: "small",
|
|
12286
12311
|
placeholder: "ws://127.0.0.1:17891",
|
|
12287
12312
|
onKeyup: withKeys(u, ["enter"])
|
|
12288
12313
|
}, {
|
|
12289
12314
|
append: withCtx(() => [
|
|
12290
|
-
createVNode(
|
|
12315
|
+
createVNode(E, {
|
|
12291
12316
|
size: "small",
|
|
12292
12317
|
onClick: u
|
|
12293
12318
|
}, {
|
|
@@ -12306,19 +12331,19 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12306
12331
|
])]),
|
|
12307
12332
|
_: 1
|
|
12308
12333
|
}),
|
|
12309
|
-
unref(r).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(unref(e) === "connected" ? "未检测到打印机" : "连接后显示打印机列表"), 1)) : (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(unref(r), (
|
|
12310
|
-
key:
|
|
12334
|
+
unref(r).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(unref(e) === "connected" ? "未检测到打印机" : "连接后显示打印机列表"), 1)) : (openBlock(!0), createElementBlock(Fragment, { key: 1 }, renderList(unref(r), (C) => (openBlock(), createElementBlock("div", {
|
|
12335
|
+
key: C.name,
|
|
12311
12336
|
class: "action-item printer-item",
|
|
12312
|
-
onClick: (
|
|
12337
|
+
onClick: (w) => n.value = C.name
|
|
12313
12338
|
}, [
|
|
12314
12339
|
createElementVNode("span", {
|
|
12315
|
-
class: normalizeClass(["printer-radio", { active: unref(n) ===
|
|
12340
|
+
class: normalizeClass(["printer-radio", { active: unref(n) === C.name }])
|
|
12316
12341
|
}, null, 2),
|
|
12317
|
-
createElementVNode("span", _hoisted_8, toDisplayString(
|
|
12342
|
+
createElementVNode("span", _hoisted_8, toDisplayString(C.displayName), 1),
|
|
12318
12343
|
createElementVNode("span", {
|
|
12319
|
-
class: normalizeClass(["printer-state", `state-${
|
|
12320
|
-
}, toDisplayString(
|
|
12321
|
-
|
|
12344
|
+
class: normalizeClass(["printer-state", `state-${C.statusText}`])
|
|
12345
|
+
}, toDisplayString(C.statusText), 3),
|
|
12346
|
+
C.isDefault ? (openBlock(), createElementBlock("span", _hoisted_9, "默认")) : createCommentVNode("", !0)
|
|
12322
12347
|
], 8, _hoisted_7))), 128)),
|
|
12323
12348
|
createVNode(y, { "content-position": "left" }, {
|
|
12324
12349
|
default: withCtx(() => [...g[3] || (g[3] = [
|
|
@@ -12329,11 +12354,11 @@ const _hoisted_1 = ["title"], _hoisted_2 = { class: "user-actions" }, _hoisted_3
|
|
|
12329
12354
|
unref(e) === "retry_stopped" ? (openBlock(), createElementBlock("div", {
|
|
12330
12355
|
key: 2,
|
|
12331
12356
|
class: normalizeClass(["action-item", { disabled: a.value }]),
|
|
12332
|
-
onClick:
|
|
12357
|
+
onClick: f
|
|
12333
12358
|
}, toDisplayString(a.value ? "重连中..." : "重新连接"), 3)) : createCommentVNode("", !0),
|
|
12334
12359
|
createElementVNode("div", {
|
|
12335
12360
|
class: normalizeClass(["action-item", { disabled: unref(e) !== "connected" || !unref(n) || a.value }]),
|
|
12336
|
-
onClick:
|
|
12361
|
+
onClick: d
|
|
12337
12362
|
}, toDisplayString(a.value ? "打印中..." : "打印测试页"), 3)
|
|
12338
12363
|
])
|
|
12339
12364
|
]),
|
|
@@ -12357,7 +12382,7 @@ async function registerRoute(t, e) {
|
|
|
12357
12382
|
title: "报表列表",
|
|
12358
12383
|
icon: "iconfont icon-s-grid"
|
|
12359
12384
|
},
|
|
12360
|
-
component: () => import("./StatementList-
|
|
12385
|
+
component: () => import("./StatementList-DcYuvG-K.mjs")
|
|
12361
12386
|
}), e.addRoute("Index", {
|
|
12362
12387
|
path: "statement/design/:id",
|
|
12363
12388
|
name: "报表设计",
|
|
@@ -12366,7 +12391,7 @@ async function registerRoute(t, e) {
|
|
|
12366
12391
|
title: "报表设计",
|
|
12367
12392
|
icon: "iconfont icon-s-grid"
|
|
12368
12393
|
},
|
|
12369
|
-
component: () => import("./StatementDesign-
|
|
12394
|
+
component: () => import("./StatementDesign-Cxh5YK4D.mjs")
|
|
12370
12395
|
}), e.addRoute("Index", {
|
|
12371
12396
|
path: "statement/detail/:id",
|
|
12372
12397
|
name: "后台报表查看",
|
|
@@ -12375,7 +12400,7 @@ async function registerRoute(t, e) {
|
|
|
12375
12400
|
title: "后台报表查看",
|
|
12376
12401
|
icon: "iconfont icon-s-grid"
|
|
12377
12402
|
},
|
|
12378
|
-
component: () => import("./StatementDetail-
|
|
12403
|
+
component: () => import("./StatementDetail-Cx7VdXGa.mjs")
|
|
12379
12404
|
})), e.addRoute({
|
|
12380
12405
|
path: "/statementdetail/:id",
|
|
12381
12406
|
name: "报表查看",
|
|
@@ -12386,7 +12411,7 @@ async function registerRoute(t, e) {
|
|
|
12386
12411
|
isWhite: !0
|
|
12387
12412
|
},
|
|
12388
12413
|
props: !0,
|
|
12389
|
-
component: () => import("./StatementDetail-
|
|
12414
|
+
component: () => import("./StatementDetail-Cx7VdXGa.mjs")
|
|
12390
12415
|
}), e.hasRoute("Index") && e.addRoute("Index", {
|
|
12391
12416
|
path: "innerStatementdetail/:id",
|
|
12392
12417
|
name: "系统内报表查看",
|
|
@@ -12397,7 +12422,7 @@ async function registerRoute(t, e) {
|
|
|
12397
12422
|
noPadding: !0
|
|
12398
12423
|
},
|
|
12399
12424
|
props: !0,
|
|
12400
|
-
component: () => import("./StatementDetail-
|
|
12425
|
+
component: () => import("./StatementDetail-Cx7VdXGa.mjs")
|
|
12401
12426
|
});
|
|
12402
12427
|
}
|
|
12403
12428
|
const index = {
|
|
@@ -12516,4 +12541,4 @@ export {
|
|
|
12516
12541
|
numberToColumn as y,
|
|
12517
12542
|
getLoopSourceColumns as z
|
|
12518
12543
|
};
|
|
12519
|
-
//# sourceMappingURL=index-
|
|
12544
|
+
//# sourceMappingURL=index-Dm_dNt8a.mjs.map
|