@ningboyz/vue 1.0.74 → 1.0.76
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,61 +1,58 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "lodash";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
-
import { Stimulsoft as
|
|
3
|
+
import { Stimulsoft as s } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
4
4
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
5
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
6
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
7
|
-
class
|
|
7
|
+
class u {
|
|
8
8
|
listData = void 0;
|
|
9
9
|
report;
|
|
10
10
|
constructor(t) {
|
|
11
|
-
|
|
11
|
+
r.isNil(t) || (this.listData = t), this.report = new s.Report.StiReport();
|
|
12
12
|
}
|
|
13
|
+
initLicense = () => (s.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", s.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), s.Base.Localization.StiLocalization.cultureName = "中文", this);
|
|
13
14
|
setListData = (t) => (this.listData = t, this);
|
|
14
15
|
/**
|
|
15
16
|
* 加载打印模版json
|
|
16
17
|
* @param json
|
|
17
18
|
* @returns
|
|
18
19
|
*/
|
|
19
|
-
loadJson = (t) => (
|
|
20
|
-
getReport = () => (this.report.dataSources.clear(),
|
|
21
|
-
print = () =>
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
printToPdf = () => {
|
|
25
|
-
this.report.printToPdf();
|
|
26
|
-
};
|
|
20
|
+
loadJson = (t) => (r.isEmpty(t) || this.report.load(t), this);
|
|
21
|
+
getReport = () => (this.report.dataSources.clear(), r.isNil(this.listData) || this.listData.length === 0 ? this.report : (this.getDataSet(this.listData), this.report));
|
|
22
|
+
print = () => (this.report.print(), this);
|
|
23
|
+
printToPdf = () => (this.report.printToPdf(), this);
|
|
27
24
|
getDataSet = (t) => {
|
|
28
|
-
const a = new
|
|
29
|
-
for (let
|
|
30
|
-
const
|
|
31
|
-
this.listItem2DataTable(
|
|
25
|
+
const a = new s.System.Data.DataSet("网络打印");
|
|
26
|
+
for (let i = 0; i < t.length; i++) {
|
|
27
|
+
const e = t[i], o = new s.System.Data.DataTable(e.dataName);
|
|
28
|
+
this.listItem2DataTable(o, e), this.listData2DataTable(o, e), a.tables.add(o), this.report.regData(a.dataSetName, a.dataSetName, a);
|
|
32
29
|
}
|
|
33
30
|
this.report.dictionary.synchronize();
|
|
34
31
|
};
|
|
35
32
|
listItem2DataTable = (t, a) => {
|
|
36
|
-
for (let
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
33
|
+
for (let i = 0; i < a.listItem.length; i++) {
|
|
34
|
+
const e = a.listItem[i];
|
|
35
|
+
if (r.isEmpty(e.printVal))
|
|
39
36
|
continue;
|
|
40
|
-
const
|
|
41
|
-
t.columns.add(
|
|
37
|
+
const o = new s.System.Data.DataColumn(e.printVal);
|
|
38
|
+
t.columns.add(o);
|
|
42
39
|
}
|
|
43
40
|
};
|
|
44
41
|
listData2DataTable = (t, a) => {
|
|
45
|
-
for (let
|
|
46
|
-
const
|
|
47
|
-
t.addRow(
|
|
42
|
+
for (let i = 0; i < a.listData.length; i++) {
|
|
43
|
+
const e = a.listData[i], o = this.getRow(t, a.listItem, e);
|
|
44
|
+
t.addRow(o);
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
|
-
getRow = (t, a,
|
|
51
|
-
const
|
|
52
|
-
for (let
|
|
53
|
-
const
|
|
54
|
-
|
|
47
|
+
getRow = (t, a, i) => {
|
|
48
|
+
const e = t.newRow();
|
|
49
|
+
for (let o = 0; o < a.length; o++) {
|
|
50
|
+
const n = a[o];
|
|
51
|
+
r.isEmpty(n.printVal) || e.setValue(n.printVal, Reflect.get(i, n.itemCode));
|
|
55
52
|
}
|
|
56
|
-
return
|
|
53
|
+
return e;
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
56
|
export {
|
|
60
|
-
|
|
57
|
+
u as default
|
|
61
58
|
};
|
package/package.json
CHANGED
|
@@ -4,12 +4,12 @@ declare class Factory {
|
|
|
4
4
|
private listData;
|
|
5
5
|
private report;
|
|
6
6
|
constructor(listData?: TWldy.IWldyDataResponse[]);
|
|
7
|
-
initLicense: () =>
|
|
8
|
-
setListData: (listData: TWldy.IWldyDataResponse[]) =>
|
|
9
|
-
loadJson: (json: string | undefined) =>
|
|
7
|
+
initLicense: () => Factory;
|
|
8
|
+
setListData: (listData: TWldy.IWldyDataResponse[]) => Factory;
|
|
9
|
+
loadJson: (json: string | undefined) => Factory;
|
|
10
10
|
getReport: () => Stimulsoft.Report.StiReport;
|
|
11
|
-
print: () =>
|
|
12
|
-
printToPdf: () =>
|
|
11
|
+
print: () => Factory;
|
|
12
|
+
printToPdf: () => Factory;
|
|
13
13
|
private getDataSet;
|
|
14
14
|
private listItem2DataTable;
|
|
15
15
|
private listData2DataTable;
|