@ningboyz/vue 1.0.85 → 1.0.87
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/es/components.js +18 -11
- package/es/stimulsoft/dataUtils/stimulsoftData.js +30 -27
- package/es/stimulsoft/desginer/desginer.vue.js +22 -25
- package/es/stimulsoft/desginer/factory.js +17 -14
- package/es/stimulsoft/localizations/en.xml +5525 -0
- package/es/stimulsoft/localizations/zh.xml +5398 -0
- package/es/stimulsoft/printer/printer.js +16 -16
- package/package.json +1 -1
- package/types/components.d.ts +1 -0
- package/types/stimulsoft/dataUtils/stimulsoftData.d.ts +14 -0
- package/types/stimulsoft/desginer/desginer.d.ts +0 -4
- package/types/stimulsoft/desginer/factory.d.ts +7 -8
package/es/components.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { YzDesginer as r } from "./stimulsoft/desginer/index.js";
|
|
2
|
-
import { StimulsoftFactory as
|
|
3
|
-
import { YzLayout as
|
|
4
|
-
import { StimulsoftPrinter as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { StimulsoftFactory as g } from "./stimulsoft/desginer/index.js";
|
|
3
|
+
import { YzLayout as m } from "./layout/index.js";
|
|
4
|
+
import { StimulsoftPrinter as S } from "./stimulsoft/printer/index.js";
|
|
5
|
+
import "js-base64";
|
|
6
|
+
import "lodash";
|
|
7
|
+
import "./node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
8
|
+
import "./node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.js";
|
|
9
|
+
import "./node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.export.js";
|
|
10
|
+
import "./node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.import.xlsx.js";
|
|
11
|
+
import "./node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.maps.js";
|
|
12
|
+
import { YzMessage as D } from "./message/index.js";
|
|
13
|
+
const i = [r, m], x = (o) => {
|
|
14
|
+
i.forEach((t) => o.use(t));
|
|
8
15
|
};
|
|
9
16
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
17
|
+
g as StimulsoftFactory,
|
|
18
|
+
S as StimulsoftPrinter,
|
|
12
19
|
r as YzDesginer,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
m as YzLayout,
|
|
21
|
+
D as YzMessage,
|
|
22
|
+
x as install
|
|
16
23
|
};
|
|
@@ -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,28 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Designer as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as v, ref as g, watch as D, createBlock as R, openBlock as S, unref as p } from "vue";
|
|
2
|
+
import { Designer as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
+
import x from "lodash";
|
|
4
|
+
import b from "./factory.js";
|
|
5
5
|
import { Stimulsoft as a } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
6
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
7
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
8
8
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
9
|
-
const
|
|
9
|
+
const O = /* @__PURE__ */ v({
|
|
10
10
|
__name: "desginer",
|
|
11
11
|
props: {
|
|
12
12
|
templateJson: {},
|
|
13
|
-
listData: {}
|
|
14
|
-
registerTable: { type: Function }
|
|
13
|
+
listData: {}
|
|
15
14
|
},
|
|
16
15
|
emits: ["saveReport"],
|
|
17
|
-
setup(
|
|
18
|
-
|
|
19
|
-
const r = p, n = U(), s = new a.Designer.StiDesignerOptions();
|
|
16
|
+
setup(i, { expose: c, emit: m }) {
|
|
17
|
+
const n = i, r = g(), s = new a.Designer.StiDesignerOptions();
|
|
20
18
|
s.appearance.fullScreenMode = !0;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
() => [
|
|
19
|
+
const f = m;
|
|
20
|
+
D(
|
|
21
|
+
() => [n.templateJson, n.listData],
|
|
24
22
|
(e) => {
|
|
25
|
-
console.log(e);
|
|
26
23
|
const o = e[0], t = e[1];
|
|
27
24
|
d(o, t);
|
|
28
25
|
},
|
|
@@ -30,27 +27,27 @@ const N = /* @__PURE__ */ g({
|
|
|
30
27
|
deep: !0
|
|
31
28
|
}
|
|
32
29
|
);
|
|
33
|
-
const
|
|
30
|
+
const l = (e) => {
|
|
34
31
|
e.preventDefault = !0;
|
|
35
32
|
const o = e.report.saveToJsonString(), t = e.fileName;
|
|
36
|
-
|
|
37
|
-
}, u = () =>
|
|
33
|
+
f("saveReport", t, o);
|
|
34
|
+
}, u = () => x.isNil(r.value) ? "" : "data:application/pdf;base64," + r.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (e, o) => {
|
|
38
35
|
try {
|
|
39
|
-
const t = new
|
|
40
|
-
|
|
36
|
+
const t = new b(e, o);
|
|
37
|
+
r.value = t.getReport();
|
|
41
38
|
} catch (t) {
|
|
42
|
-
console.
|
|
39
|
+
console.error(t.message);
|
|
43
40
|
}
|
|
44
41
|
};
|
|
45
42
|
return c({
|
|
46
43
|
getPdfBase64: u
|
|
47
|
-
}), (e, o) => (
|
|
48
|
-
report:
|
|
49
|
-
options:
|
|
50
|
-
onSaveReport:
|
|
44
|
+
}), (e, o) => (S(), R(p(_), {
|
|
45
|
+
report: r.value,
|
|
46
|
+
options: p(s),
|
|
47
|
+
onSaveReport: l
|
|
51
48
|
}, null, 8, ["report", "options"]));
|
|
52
49
|
}
|
|
53
50
|
});
|
|
54
51
|
export {
|
|
55
|
-
|
|
52
|
+
O as default
|
|
56
53
|
};
|
|
@@ -1,28 +1,31 @@
|
|
|
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 o } 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
|
|
9
|
-
|
|
8
|
+
class c {
|
|
9
|
+
jsonTemplate;
|
|
10
|
+
listData;
|
|
10
11
|
report;
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
12
|
+
constructor(s, r) {
|
|
13
|
+
this.jsonTemplate = s, this.listData = r, this.report = new o.Report.StiReport();
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
setListData = (t) => (this.listData = t, this);
|
|
15
|
+
setLicense = () => (i.initStimulsoft(), this);
|
|
16
16
|
/**
|
|
17
17
|
* 加载打印模版json
|
|
18
18
|
* @param json
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
loadJson = (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
loadJson = () => (t.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
|
|
22
|
+
/**
|
|
23
|
+
* 加在数据
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 && i.createDataSet(this.report, this.listData), this);
|
|
27
|
+
getReport = () => (this.setLicense().loadJson().loadData(), this.report);
|
|
25
28
|
}
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
c as default
|
|
28
31
|
};
|