@ningboyz/vue 1.0.89 → 1.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,48 +1,51 @@
|
|
|
1
1
|
import { decode as m } from "js-base64";
|
|
2
2
|
import n from "lodash";
|
|
3
|
-
import { Stimulsoft as
|
|
3
|
+
import { Stimulsoft as l } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
4
4
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.js";
|
|
5
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.export.js";
|
|
6
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.import.xlsx.js";
|
|
7
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.maps.js";
|
|
8
8
|
class g {
|
|
9
9
|
static DATA_SET_NAME = "网络打印";
|
|
10
|
-
static
|
|
11
|
-
|
|
10
|
+
static initStimulsoft = () => {
|
|
11
|
+
l.Base.StiLicense.key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkVaUjYnRU/wphl9h6TkK9UtvGvwIZ/qCzU7vjHmM5RWbvCAfAhZhn+eMayEo4PRtUFJINrdMkfnVj1/HeyPgSgAKdpQpP1wzGj2ri5UgGNU8p7Pi59UAegRyUxjTI96rT+khTJIcSoTTPkqZwt0uC+IGtEdehlDchk7madvSLA9guSEZZuSHsc+adQ93NZogak6uo7LbqRh2xC23iGH4sValMR9CBxAsjWUYJH0yrcXODeYrX6ARDlVCW40MGOMrYnx/2W3O8L26oTyAFEdQ1TN1KzYjP4zenjvu4KBAWIopWG6Gk2ydffI0zldxHaPeEl0Lt6U77ykFtsXqW5fN/9t040SfeZfzMAq2ZoVGXPXKCjBo+asFZHrxn7iLpsxF7zwWkYIto8ObpimosoY0on8aLx7At7Qo3VaUOST48gIdqBabUpVz3O9h8UULJa23nlwMVMXheIMMmp6ACD9Bupla/giERFXIYIfpE4eFCD93sR2Cq2f8jdm5Z9B/faB8j4iz0IugVhK4BYhw2q9jAufdWTIx3nsE2Qw7ah0jNsgkR9kWWnHQ3qI/lwFLcFr81SVgyNpFzZ/zcV6vM+xaqbuEMivQx5uFx9WLOMU/ZYkyV8Hi/IEmU+O72NObJtWDxnhUkl4iV0WsYT2V2EU8t0NZP9SBCrLU+rd0SERAdGnRUfoJrm8mXPgcN6+FGNyTgiw0Do8oLU/Skqa/TohVeT", l.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), l.Base.Localization.StiLocalization.cultureName = "中文";
|
|
12
12
|
};
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
static createDataSet = (i, t) => {
|
|
14
|
+
this.getDataSet(i, t);
|
|
15
|
+
};
|
|
16
|
+
static getDataSet = (i, t) => {
|
|
17
|
+
const a = new l.System.Data.DataSet(this.DATA_SET_NAME);
|
|
18
|
+
for (let o = 0; o < t.length; o++) {
|
|
19
|
+
const e = t[o], s = new l.System.Data.DataTable(e.dataName);
|
|
20
|
+
this.listItem2DataTable(s, e), this.listData2DataTable(s, e), a.tables.add(s), i.regData(a.dataSetName, a.dataSetName, a);
|
|
18
21
|
}
|
|
19
|
-
|
|
22
|
+
i.dictionary.synchronize();
|
|
20
23
|
};
|
|
21
|
-
static listItem2DataTable = (
|
|
24
|
+
static listItem2DataTable = (i, t) => {
|
|
22
25
|
for (let a = 0; a < t.listItem.length; a++) {
|
|
23
|
-
const
|
|
24
|
-
if (n.isEmpty(
|
|
26
|
+
const o = t.listItem[a];
|
|
27
|
+
if (n.isEmpty(o.printVal))
|
|
25
28
|
continue;
|
|
26
|
-
const e = new
|
|
27
|
-
|
|
29
|
+
const e = new l.System.Data.DataColumn(o.printVal);
|
|
30
|
+
i.columns.add(e);
|
|
28
31
|
}
|
|
29
32
|
};
|
|
30
|
-
static listData2DataTable = (
|
|
33
|
+
static listData2DataTable = (i, t) => {
|
|
31
34
|
for (let a = 0; a < t.listData.length; a++) {
|
|
32
|
-
const
|
|
33
|
-
|
|
35
|
+
const o = t.listData[a], e = this.getRow(i, t.listItem, o);
|
|
36
|
+
i.addRow(e);
|
|
34
37
|
}
|
|
35
38
|
};
|
|
36
|
-
static getRow = (
|
|
37
|
-
const
|
|
39
|
+
static getRow = (i, t, a) => {
|
|
40
|
+
const o = i.newRow();
|
|
38
41
|
for (let e = 0; e < t.length; e++) {
|
|
39
|
-
const
|
|
40
|
-
if (!n.isEmpty(
|
|
41
|
-
let
|
|
42
|
-
n.isEmpty(
|
|
42
|
+
const s = t[e];
|
|
43
|
+
if (!n.isEmpty(s.printVal)) {
|
|
44
|
+
let c = Reflect.get(a, s.itemCode);
|
|
45
|
+
n.isEmpty(s.jsMethod) || (c = this.execJsMethod(s.jsMethod, c)), o.setValue(s.printVal, c);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
|
-
return
|
|
48
|
+
return o;
|
|
46
49
|
};
|
|
47
50
|
/**
|
|
48
51
|
* 执行js语句
|
|
@@ -50,10 +53,10 @@ class g {
|
|
|
50
53
|
* @param value
|
|
51
54
|
* @returns
|
|
52
55
|
*/
|
|
53
|
-
static execJsMethod = (
|
|
54
|
-
const a = m(
|
|
56
|
+
static execJsMethod = (i, t) => {
|
|
57
|
+
const a = m(i), o = new Function("value", a);
|
|
55
58
|
try {
|
|
56
|
-
const e =
|
|
59
|
+
const e = o(t);
|
|
57
60
|
n.isNil(e) || (t = e);
|
|
58
61
|
} catch (e) {
|
|
59
62
|
console.log(e.message);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as v, ref as
|
|
1
|
+
import { defineComponent as v, ref as D, watch as S, createBlock as g, openBlock as R, unref as p } from "vue";
|
|
2
2
|
import { Designer as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
3
|
import x from "lodash";
|
|
4
4
|
import b from "./factory.js";
|
|
5
|
+
import y from "../dataUtils/stimulsoftData.js";
|
|
5
6
|
import { Stimulsoft as a } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
6
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
7
8
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
8
9
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
9
|
-
const
|
|
10
|
+
const j = /* @__PURE__ */ v({
|
|
10
11
|
__name: "desginer",
|
|
11
12
|
props: {
|
|
12
13
|
templateJson: {},
|
|
@@ -14,34 +15,35 @@ const O = /* @__PURE__ */ v({
|
|
|
14
15
|
},
|
|
15
16
|
emits: ["saveReport"],
|
|
16
17
|
setup(i, { expose: c, emit: m }) {
|
|
17
|
-
|
|
18
|
+
y.initStimulsoft();
|
|
19
|
+
const n = i, r = D(), s = new a.Designer.StiDesignerOptions();
|
|
18
20
|
s.appearance.fullScreenMode = !0;
|
|
19
21
|
const f = m;
|
|
20
|
-
|
|
22
|
+
S(
|
|
21
23
|
() => [n.templateJson, n.listData],
|
|
22
|
-
(
|
|
23
|
-
const o =
|
|
24
|
-
d(o,
|
|
24
|
+
(t) => {
|
|
25
|
+
const o = t[0], e = t[1];
|
|
26
|
+
d(o, e);
|
|
25
27
|
},
|
|
26
28
|
{
|
|
27
29
|
deep: !0
|
|
28
30
|
}
|
|
29
31
|
);
|
|
30
|
-
const l = (
|
|
31
|
-
|
|
32
|
-
const o =
|
|
33
|
-
f("saveReport",
|
|
34
|
-
}, u = () => x.isNil(r.value) ? "" : "data:application/pdf;base64," + r.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (
|
|
32
|
+
const l = (t) => {
|
|
33
|
+
t.preventDefault = !0;
|
|
34
|
+
const o = t.report.saveToJsonString(), e = t.fileName;
|
|
35
|
+
f("saveReport", e, o);
|
|
36
|
+
}, u = () => x.isNil(r.value) ? "" : "data:application/pdf;base64," + r.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (t, o) => {
|
|
35
37
|
try {
|
|
36
|
-
const
|
|
37
|
-
r.value =
|
|
38
|
-
} catch (
|
|
39
|
-
console.error(
|
|
38
|
+
const e = new b(t, o);
|
|
39
|
+
r.value = e.getReport();
|
|
40
|
+
} catch (e) {
|
|
41
|
+
console.error(e.message);
|
|
40
42
|
}
|
|
41
43
|
};
|
|
42
44
|
return c({
|
|
43
45
|
getPdfBase64: u
|
|
44
|
-
}), (
|
|
46
|
+
}), (t, o) => (R(), g(p(_), {
|
|
45
47
|
report: r.value,
|
|
46
48
|
options: p(s),
|
|
47
49
|
onSaveReport: l
|
|
@@ -49,5 +51,5 @@ const O = /* @__PURE__ */ v({
|
|
|
49
51
|
}
|
|
50
52
|
});
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
j as default
|
|
53
55
|
};
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import t from "lodash";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
-
import
|
|
4
|
-
import { Stimulsoft as
|
|
3
|
+
import i from "../dataUtils/stimulsoftData.js";
|
|
4
|
+
import { Stimulsoft as s } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
5
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
6
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
7
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
8
|
-
class
|
|
8
|
+
class f {
|
|
9
9
|
jsonTemplate;
|
|
10
10
|
listData;
|
|
11
11
|
report;
|
|
12
|
-
constructor(
|
|
13
|
-
this.jsonTemplate =
|
|
12
|
+
constructor(r, o) {
|
|
13
|
+
this.jsonTemplate = r, this.listData = o, this.report = new s.Report.StiReport();
|
|
14
14
|
}
|
|
15
|
-
setLicense = () => (t.Base.StiLicense.key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkVaUjYnRU/wphl9h6TkK9UtvGvwIZ/qCzU7vjHmM5RWbvCAfAhZhn+eMayEo4PRtUFJINrdMkfnVj1/HeyPgSgAKdpQpP1wzGj2ri5UgGNU8p7Pi59UAegRyUxjTI96rT+khTJIcSoTTPkqZwt0uC+IGtEdehlDchk7madvSLA9guSEZZuSHsc+adQ93NZogak6uo7LbqRh2xC23iGH4sValMR9CBxAsjWUYJH0yrcXODeYrX6ARDlVCW40MGOMrYnx/2W3O8L26oTyAFEdQ1TN1KzYjP4zenjvu4KBAWIopWG6Gk2ydffI0zldxHaPeEl0Lt6U77ykFtsXqW5fN/9t040SfeZfzMAq2ZoVGXPXKCjBo+asFZHrxn7iLpsxF7zwWkYIto8ObpimosoY0on8aLx7At7Qo3VaUOST48gIdqBabUpVz3O9h8UULJa23nlwMVMXheIMMmp6ACD9Bupla/giERFXIYIfpE4eFCD93sR2Cq2f8jdm5Z9B/faB8j4iz0IugVhK4BYhw2q9jAufdWTIx3nsE2Qw7ah0jNsgkR9kWWnHQ3qI/lwFLcFr81SVgyNpFzZ/zcV6vM+xaqbuEMivQx5uFx9WLOMU/ZYkyV8Hi/IEmU+O72NObJtWDxnhUkl4iV0WsYT2V2EU8t0NZP9SBCrLU+rd0SERAdGnRUfoJrm8mXPgcN6+FGNyTgiw0Do8oLU/Skqa/TohVeT", t.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), t.Base.Localization.StiLocalization.cultureName = "中文", this);
|
|
16
15
|
/**
|
|
17
16
|
* 加载打印模版json
|
|
18
17
|
* @param json
|
|
19
18
|
* @returns
|
|
20
19
|
*/
|
|
21
|
-
loadJson = () => (
|
|
20
|
+
loadJson = () => (t.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
|
|
22
21
|
/**
|
|
23
22
|
* 加在数据
|
|
24
23
|
* @returns
|
|
25
24
|
*/
|
|
26
|
-
loadData = () => (this.report.dataSources.clear(), !
|
|
27
|
-
getReport = () => (this.
|
|
25
|
+
loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 && i.createDataSet(this.report, this.listData), this);
|
|
26
|
+
getReport = () => (this.loadJson(), this.loadData(), this.report);
|
|
28
27
|
}
|
|
29
28
|
export {
|
|
30
|
-
|
|
29
|
+
f as default
|
|
31
30
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Stimulsoft as
|
|
1
|
+
import { Stimulsoft as n } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.js";
|
|
3
3
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.export.js";
|
|
4
4
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.import.xlsx.js";
|
|
5
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.maps.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
class
|
|
6
|
+
import p from "../dataUtils/stimulsoftData.js";
|
|
7
|
+
import o from "lodash";
|
|
8
|
+
class d {
|
|
9
9
|
reports = [];
|
|
10
10
|
report;
|
|
11
11
|
printData;
|
|
@@ -16,25 +16,20 @@ class U {
|
|
|
16
16
|
* @param listData
|
|
17
17
|
*/
|
|
18
18
|
constructor(t) {
|
|
19
|
-
this.printData = t, this.report = new
|
|
19
|
+
this.printData = t, this.report = new n.Report.StiReport();
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
* 初始化license
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
setLicense = () => (r.Base.StiLicense.key = "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkVaUjYnRU/wphl9h6TkK9UtvGvwIZ/qCzU7vjHmM5RWbvCAfAhZhn+eMayEo4PRtUFJINrdMkfnVj1/HeyPgSgAKdpQpP1wzGj2ri5UgGNU8p7Pi59UAegRyUxjTI96rT+khTJIcSoTTPkqZwt0uC+IGtEdehlDchk7madvSLA9guSEZZuSHsc+adQ93NZogak6uo7LbqRh2xC23iGH4sValMR9CBxAsjWUYJH0yrcXODeYrX6ARDlVCW40MGOMrYnx/2W3O8L26oTyAFEdQ1TN1KzYjP4zenjvu4KBAWIopWG6Gk2ydffI0zldxHaPeEl0Lt6U77ykFtsXqW5fN/9t040SfeZfzMAq2ZoVGXPXKCjBo+asFZHrxn7iLpsxF7zwWkYIto8ObpimosoY0on8aLx7At7Qo3VaUOST48gIdqBabUpVz3O9h8UULJa23nlwMVMXheIMMmp6ACD9Bupla/giERFXIYIfpE4eFCD93sR2Cq2f8jdm5Z9B/faB8j4iz0IugVhK4BYhw2q9jAufdWTIx3nsE2Qw7ah0jNsgkR9kWWnHQ3qI/lwFLcFr81SVgyNpFzZ/zcV6vM+xaqbuEMivQx5uFx9WLOMU/ZYkyV8Hi/IEmU+O72NObJtWDxnhUkl4iV0WsYT2V2EU8t0NZP9SBCrLU+rd0SERAdGnRUfoJrm8mXPgcN6+FGNyTgiw0Do8oLU/Skqa/TohVeT", r.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), r.Base.Localization.StiLocalization.cultureName = "中文", this);
|
|
26
21
|
/**
|
|
27
22
|
* 初始化报表
|
|
28
23
|
* @returns
|
|
29
24
|
*/
|
|
30
25
|
initReport = () => {
|
|
31
26
|
for (let t = 0; t < this.printData.length; t++) {
|
|
32
|
-
const
|
|
33
|
-
for (let
|
|
34
|
-
const
|
|
35
|
-
for (let
|
|
36
|
-
const
|
|
37
|
-
s.load(
|
|
27
|
+
const r = this.printData[t];
|
|
28
|
+
for (let e = 0; e < r.jsonTemplates.length; e++) {
|
|
29
|
+
const a = r.jsonTemplates[e];
|
|
30
|
+
for (let i = 0; i < r.listData.length; i++) {
|
|
31
|
+
const l = r.listData[i], s = new n.Report.StiReport();
|
|
32
|
+
s.load(a), p.createDataSet(s, l), this.reports.push(s);
|
|
38
33
|
}
|
|
39
34
|
}
|
|
40
35
|
}
|
|
@@ -46,19 +41,19 @@ class U {
|
|
|
46
41
|
*/
|
|
47
42
|
mergeReport = async () => {
|
|
48
43
|
for (let t = 0; t < this.reports.length; t++) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
this.report.renderedPages.add(
|
|
44
|
+
const r = this.reports[t];
|
|
45
|
+
r.render(), t === 0 ? this.report = r : r.renderedPages.toList().forEach((e) => {
|
|
46
|
+
this.report.renderedPages.add(e.clone());
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
49
|
return this;
|
|
55
50
|
};
|
|
56
51
|
print() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}),
|
|
52
|
+
o.isNil(this.printData) || this.printData.length === 0 || (this.printData.forEach((t) => {
|
|
53
|
+
o.isNil(t.jsonTemplates) || t.jsonTemplates.length === 0 || o.isNil(t.listData) || t.listData.length;
|
|
54
|
+
}), p.initStimulsoft(), this.initReport(), this.mergeReport(), this.report.print());
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
export {
|
|
63
|
-
|
|
58
|
+
d as default
|
|
64
59
|
};
|