@ningboyz/vue 1.0.86 → 1.0.88
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,54 +1,48 @@
|
|
|
1
1
|
import { decode as m } from "js-base64";
|
|
2
2
|
import n from "lodash";
|
|
3
|
-
import { Stimulsoft as
|
|
3
|
+
import { Stimulsoft as c } 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
|
-
class
|
|
8
|
+
class g {
|
|
9
9
|
static DATA_SET_NAME = "网络打印";
|
|
10
|
-
static
|
|
11
|
-
|
|
10
|
+
static createDataSet = (s, t) => {
|
|
11
|
+
this.getDataSet(s, t);
|
|
12
12
|
};
|
|
13
|
-
static
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
static getDataSet = (i, t) => {
|
|
20
|
-
const a = new l.System.Data.DataSet(this.DATA_SET_NAME);
|
|
21
|
-
for (let o = 0; o < t.length; o++) {
|
|
22
|
-
const e = t[o], s = new l.System.Data.DataTable(e.dataName);
|
|
23
|
-
this.listItem2DataTable(s, e), this.listData2DataTable(s, e), a.tables.add(s), i.regData(a.dataSetName, a.dataSetName, a);
|
|
13
|
+
static getDataSet = (s, t) => {
|
|
14
|
+
const a = new c.System.Data.DataSet(this.DATA_SET_NAME);
|
|
15
|
+
for (let i = 0; i < t.length; i++) {
|
|
16
|
+
const e = t[i], o = new c.System.Data.DataTable(e.dataName);
|
|
17
|
+
this.listItem2DataTable(o, e), this.listData2DataTable(o, e), a.tables.add(o), s.regData(a.dataSetName, a.dataSetName, a);
|
|
24
18
|
}
|
|
25
|
-
|
|
19
|
+
s.dictionary.synchronize();
|
|
26
20
|
};
|
|
27
|
-
static listItem2DataTable = (
|
|
21
|
+
static listItem2DataTable = (s, t) => {
|
|
28
22
|
for (let a = 0; a < t.listItem.length; a++) {
|
|
29
|
-
const
|
|
30
|
-
if (n.isEmpty(
|
|
23
|
+
const i = t.listItem[a];
|
|
24
|
+
if (n.isEmpty(i.printVal))
|
|
31
25
|
continue;
|
|
32
|
-
const e = new
|
|
33
|
-
|
|
26
|
+
const e = new c.System.Data.DataColumn(i.printVal);
|
|
27
|
+
s.columns.add(e);
|
|
34
28
|
}
|
|
35
29
|
};
|
|
36
|
-
static listData2DataTable = (
|
|
30
|
+
static listData2DataTable = (s, t) => {
|
|
37
31
|
for (let a = 0; a < t.listData.length; a++) {
|
|
38
|
-
const
|
|
39
|
-
|
|
32
|
+
const i = t.listData[a], e = this.getRow(s, t.listItem, i);
|
|
33
|
+
s.addRow(e);
|
|
40
34
|
}
|
|
41
35
|
};
|
|
42
|
-
static getRow = (
|
|
43
|
-
const
|
|
36
|
+
static getRow = (s, t, a) => {
|
|
37
|
+
const i = s.newRow();
|
|
44
38
|
for (let e = 0; e < t.length; e++) {
|
|
45
|
-
const
|
|
46
|
-
if (!n.isEmpty(
|
|
47
|
-
let
|
|
48
|
-
n.isEmpty(
|
|
39
|
+
const o = t[e];
|
|
40
|
+
if (!n.isEmpty(o.printVal)) {
|
|
41
|
+
let l = Reflect.get(a, o.itemCode);
|
|
42
|
+
n.isEmpty(o.jsMethod) || (l = this.execJsMethod(o.jsMethod, l)), i.setValue(o.printVal, l);
|
|
49
43
|
}
|
|
50
44
|
}
|
|
51
|
-
return
|
|
45
|
+
return i;
|
|
52
46
|
};
|
|
53
47
|
/**
|
|
54
48
|
* 执行js语句
|
|
@@ -56,10 +50,10 @@ class D {
|
|
|
56
50
|
* @param value
|
|
57
51
|
* @returns
|
|
58
52
|
*/
|
|
59
|
-
static execJsMethod = (
|
|
60
|
-
const a = m(
|
|
53
|
+
static execJsMethod = (s, t) => {
|
|
54
|
+
const a = m(s), i = new Function("value", a);
|
|
61
55
|
try {
|
|
62
|
-
const e =
|
|
56
|
+
const e = i(t);
|
|
63
57
|
n.isNil(e) || (t = e);
|
|
64
58
|
} catch (e) {
|
|
65
59
|
console.log(e.message);
|
|
@@ -68,5 +62,5 @@ class D {
|
|
|
68
62
|
};
|
|
69
63
|
}
|
|
70
64
|
export {
|
|
71
|
-
|
|
65
|
+
g as default
|
|
72
66
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "lodash";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
-
import
|
|
4
|
-
import { Stimulsoft as
|
|
3
|
+
import e from "../dataUtils/stimulsoftData.js";
|
|
4
|
+
import { Stimulsoft as t } 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 d {
|
|
9
9
|
jsonTemplate;
|
|
10
10
|
listData;
|
|
11
11
|
report;
|
|
12
|
-
constructor(
|
|
13
|
-
this.jsonTemplate =
|
|
12
|
+
constructor(i, o) {
|
|
13
|
+
this.jsonTemplate = i, this.listData = o, this.report = new t.Report.StiReport();
|
|
14
14
|
}
|
|
15
|
-
setLicense = () => (t.
|
|
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
16
|
/**
|
|
17
17
|
* 加载打印模版json
|
|
18
18
|
* @param json
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
loadJson = () => (
|
|
21
|
+
loadJson = () => (a.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
|
|
22
22
|
/**
|
|
23
23
|
* 加在数据
|
|
24
24
|
* @returns
|
|
25
25
|
*/
|
|
26
|
-
loadData = () => (this.report.dataSources.clear(), !
|
|
26
|
+
loadData = () => (this.report.dataSources.clear(), !a.isNil(this.listData) && this.listData.length > 0 && e.createDataSet(this.report, this.listData), this);
|
|
27
27
|
getReport = () => (this.setLicense().loadJson().loadData(), this.report);
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
|
-
|
|
30
|
+
d as default
|
|
31
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Stimulsoft as
|
|
1
|
+
import { Stimulsoft as r } 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 l from "../dataUtils/stimulsoftData.js";
|
|
7
|
+
import a from "lodash";
|
|
8
|
+
class U {
|
|
9
9
|
reports = [];
|
|
10
10
|
report;
|
|
11
11
|
printData;
|
|
@@ -16,25 +16,25 @@ class R {
|
|
|
16
16
|
* @param listData
|
|
17
17
|
*/
|
|
18
18
|
constructor(t) {
|
|
19
|
-
this.printData = t, this.report = new
|
|
19
|
+
this.printData = t, this.report = new r.Report.StiReport();
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* 初始化license
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
|
-
setLicense = () => (
|
|
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
26
|
/**
|
|
27
27
|
* 初始化报表
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
30
|
initReport = () => {
|
|
31
31
|
for (let t = 0; t < this.printData.length; t++) {
|
|
32
|
-
const
|
|
33
|
-
for (let
|
|
34
|
-
const
|
|
35
|
-
for (let
|
|
36
|
-
const
|
|
37
|
-
s.load(
|
|
32
|
+
const e = this.printData[t];
|
|
33
|
+
for (let i = 0; i < e.jsonTemplates.length; i++) {
|
|
34
|
+
const n = e.jsonTemplates[i];
|
|
35
|
+
for (let o = 0; o < e.listData.length; o++) {
|
|
36
|
+
const p = e.listData[o], s = new r.Report.StiReport();
|
|
37
|
+
s.load(n), l.createDataSet(s, p), this.reports.push(s);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -46,19 +46,19 @@ class R {
|
|
|
46
46
|
*/
|
|
47
47
|
mergeReport = async () => {
|
|
48
48
|
for (let t = 0; t < this.reports.length; t++) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
this.report.renderedPages.add(
|
|
49
|
+
const e = this.reports[t];
|
|
50
|
+
e.render(), t === 0 ? this.report = e : e.renderedPages.toList().forEach((i) => {
|
|
51
|
+
this.report.renderedPages.add(i.clone());
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
return this;
|
|
55
55
|
};
|
|
56
56
|
print() {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
a.isNil(this.printData) || this.printData.length === 0 || (this.printData.forEach((t) => {
|
|
58
|
+
a.isNil(t.jsonTemplates) || t.jsonTemplates.length === 0 || a.isNil(t.listData) || t.listData.length;
|
|
59
59
|
}), this.setLicense(), this.initReport(), this.mergeReport(), this.report.print());
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
U as default
|
|
64
64
|
};
|