@ningboyz/vue 1.0.91 → 1.0.92
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 +11 -16
- package/es/index.js +6 -4
- package/es/stimulsoft/dataUtils/index.js +6 -0
- package/es/stimulsoft/dataUtils/stimulsoftData.js +27 -30
- package/es/stimulsoft/dataUtils/stimulsoftUtil.js +66 -0
- package/es/stimulsoft/desginer/desginer.vue.js +29 -33
- package/es/stimulsoft/desginer/factory.js +5 -5
- package/es/stimulsoft/printer/printer.js +5 -5
- package/package.json +1 -1
- package/types/components.d.ts +1 -1
- package/types/stimulsoft/dataUtils/index.d.ts +7 -0
- package/types/stimulsoft/dataUtils/stimulsoftData.d.ts +0 -2
- package/types/stimulsoft/dataUtils/stimulsoftUtil.d.ts +7 -0
- package/types/stimulsoft/desginer/desginer.d.ts +1 -3
package/es/components.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
import { YzDesginer as r } from "./stimulsoft/desginer/index.js";
|
|
2
|
-
import { StimulsoftFactory as
|
|
2
|
+
import { StimulsoftFactory as a } from "./stimulsoft/desginer/index.js";
|
|
3
3
|
import { YzLayout as m } from "./layout/index.js";
|
|
4
|
-
import { StimulsoftPrinter as
|
|
5
|
-
import "js
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
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));
|
|
4
|
+
import { StimulsoftPrinter as l } from "./stimulsoft/printer/index.js";
|
|
5
|
+
import { StimulsoftCommon as x } from "./stimulsoft/dataUtils/index.js";
|
|
6
|
+
import { YzMessage as S } from "./message/index.js";
|
|
7
|
+
const e = [r, m], i = (o) => {
|
|
8
|
+
e.forEach((t) => o.use(t));
|
|
15
9
|
};
|
|
16
10
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
x as StimulsoftCommon,
|
|
12
|
+
a as StimulsoftFactory,
|
|
13
|
+
l as StimulsoftPrinter,
|
|
19
14
|
r as YzDesginer,
|
|
20
15
|
m as YzLayout,
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
S as YzMessage,
|
|
17
|
+
i as install
|
|
23
18
|
};
|
package/es/index.js
CHANGED
|
@@ -2,14 +2,16 @@ import * as o from "./components.js";
|
|
|
2
2
|
import { install as e } from "./components.js";
|
|
3
3
|
import { StimulsoftFactory as f, YzDesginer as s } from "./stimulsoft/desginer/index.js";
|
|
4
4
|
import { StimulsoftPrinter as a } from "./stimulsoft/printer/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { StimulsoftCommon as x } from "./stimulsoft/dataUtils/index.js";
|
|
6
|
+
import { YzMessage as n } from "./message/index.js";
|
|
7
|
+
import { YzLayout as z } from "./layout/index.js";
|
|
7
8
|
export {
|
|
9
|
+
x as StimulsoftCommon,
|
|
8
10
|
f as StimulsoftFactory,
|
|
9
11
|
a as StimulsoftPrinter,
|
|
10
12
|
s as YzDesginer,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
z as YzLayout,
|
|
14
|
+
n as YzMessage,
|
|
13
15
|
o as default,
|
|
14
16
|
e as install
|
|
15
17
|
};
|
|
@@ -1,51 +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
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
|
-
this.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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);
|
|
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);
|
|
21
18
|
}
|
|
22
|
-
|
|
19
|
+
s.dictionary.synchronize();
|
|
23
20
|
};
|
|
24
|
-
static listItem2DataTable = (
|
|
21
|
+
static listItem2DataTable = (s, t) => {
|
|
25
22
|
for (let a = 0; a < t.listItem.length; a++) {
|
|
26
|
-
const
|
|
27
|
-
if (n.isEmpty(
|
|
23
|
+
const i = t.listItem[a];
|
|
24
|
+
if (n.isEmpty(i.printVal))
|
|
28
25
|
continue;
|
|
29
|
-
const e = new
|
|
30
|
-
|
|
26
|
+
const e = new c.System.Data.DataColumn(i.printVal);
|
|
27
|
+
s.columns.add(e);
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
|
-
static listData2DataTable = (
|
|
30
|
+
static listData2DataTable = (s, t) => {
|
|
34
31
|
for (let a = 0; a < t.listData.length; a++) {
|
|
35
|
-
const
|
|
36
|
-
|
|
32
|
+
const i = t.listData[a], e = this.getRow(s, t.listItem, i);
|
|
33
|
+
s.addRow(e);
|
|
37
34
|
}
|
|
38
35
|
};
|
|
39
|
-
static getRow = (
|
|
40
|
-
const
|
|
36
|
+
static getRow = (s, t, a) => {
|
|
37
|
+
const i = s.newRow();
|
|
41
38
|
for (let e = 0; e < t.length; e++) {
|
|
42
|
-
const
|
|
43
|
-
if (!n.isEmpty(
|
|
44
|
-
let
|
|
45
|
-
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);
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
|
-
return
|
|
45
|
+
return i;
|
|
49
46
|
};
|
|
50
47
|
/**
|
|
51
48
|
* 执行js语句
|
|
@@ -53,10 +50,10 @@ class g {
|
|
|
53
50
|
* @param value
|
|
54
51
|
* @returns
|
|
55
52
|
*/
|
|
56
|
-
static execJsMethod = (
|
|
57
|
-
const a = m(
|
|
53
|
+
static execJsMethod = (s, t) => {
|
|
54
|
+
const a = m(s), i = new Function("value", a);
|
|
58
55
|
try {
|
|
59
|
-
const e =
|
|
56
|
+
const e = i(t);
|
|
60
57
|
n.isNil(e) || (t = e);
|
|
61
58
|
} catch (e) {
|
|
62
59
|
console.log(e.message);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Stimulsoft as o } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
2
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.js";
|
|
3
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.export.js";
|
|
4
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.import.xlsx.js";
|
|
5
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.maps.js";
|
|
6
|
+
class c {
|
|
7
|
+
// 创建字体配置对象
|
|
8
|
+
static fonts = [
|
|
9
|
+
{
|
|
10
|
+
fontName: "有色标题黑",
|
|
11
|
+
fontPath: "printer/fonts/YouSheBiaoTiHei.ttf",
|
|
12
|
+
fontStyle: void 0,
|
|
13
|
+
fontType: "ttf"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
fontName: "YZ-宋体",
|
|
17
|
+
fontPath: "printer/fonts/SimSun.ttf",
|
|
18
|
+
fontStyle: void 0,
|
|
19
|
+
fontType: "ttf"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
fontName: "YZ-N宋体",
|
|
23
|
+
fontPath: "printer/fonts/NSimSun.ttf",
|
|
24
|
+
fontStyle: void 0,
|
|
25
|
+
fontType: "ttf"
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* 加载字体
|
|
30
|
+
*/
|
|
31
|
+
static loadFonts = () => {
|
|
32
|
+
this.fonts.forEach((t) => {
|
|
33
|
+
switch (t.fontType) {
|
|
34
|
+
case "ttf":
|
|
35
|
+
o.Base.StiFontCollection.addFontFile(t.fontPath, t.fontName, t.fontStyle);
|
|
36
|
+
break;
|
|
37
|
+
case "otf":
|
|
38
|
+
o.Base.StiFontCollection.addOpentypeFontFile(t.fontPath, t.fontName, t.fontStyle);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const a = o.Base.StiFontCollection.getBinFonts();
|
|
43
|
+
console.log("已注册字体 =>", a);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* 加载授权
|
|
47
|
+
*/
|
|
48
|
+
static loadLicense = () => {
|
|
49
|
+
o.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";
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* 加载语言
|
|
53
|
+
*/
|
|
54
|
+
static loadLanguage = () => {
|
|
55
|
+
o.Base.Localization.StiLocalization.addLocalizationFile("printer/localizations/zh.xml", !1, "中文"), o.Base.Localization.StiLocalization.cultureName = "中文";
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* 初始化
|
|
59
|
+
*/
|
|
60
|
+
static initialize = () => {
|
|
61
|
+
this.loadLicense(), this.loadLanguage(), this.loadFonts();
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
c as default
|
|
66
|
+
};
|
|
@@ -1,55 +1,51 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as d, ref as a, watch as D, createBlock as g, openBlock as R, unref as i } from "vue";
|
|
2
2
|
import { Designer as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import y from "../dataUtils/stimulsoftData.js";
|
|
6
|
-
import { Stimulsoft as a } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
3
|
+
import y from "./factory.js";
|
|
4
|
+
import { Stimulsoft as S } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
7
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
8
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
9
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
10
|
-
const
|
|
8
|
+
const F = /* @__PURE__ */ d({
|
|
11
9
|
__name: "desginer",
|
|
12
10
|
props: {
|
|
13
11
|
templateJson: {},
|
|
14
12
|
listData: {}
|
|
15
13
|
},
|
|
16
14
|
emits: ["saveReport"],
|
|
17
|
-
setup(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
() =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
d(o, e);
|
|
15
|
+
setup(c, { expose: l, emit: m }) {
|
|
16
|
+
const r = c, s = a(!1), n = a(), p = new S.Designer.StiDesignerOptions();
|
|
17
|
+
p.appearance.fullScreenMode = !0;
|
|
18
|
+
const u = m;
|
|
19
|
+
D(
|
|
20
|
+
() => [r.templateJson, r.listData],
|
|
21
|
+
async (e) => {
|
|
22
|
+
const o = e[0], t = e[1];
|
|
23
|
+
v(o, t), s.value = !0;
|
|
27
24
|
},
|
|
28
25
|
{
|
|
29
26
|
deep: !0
|
|
30
27
|
}
|
|
31
28
|
);
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
const o =
|
|
35
|
-
|
|
36
|
-
},
|
|
29
|
+
const f = (e) => {
|
|
30
|
+
e.preventDefault = !0;
|
|
31
|
+
const o = e.report.saveToJsonString(), t = e.fileName;
|
|
32
|
+
u("saveReport", t, o);
|
|
33
|
+
}, v = async (e, o) => {
|
|
37
34
|
try {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
} catch (
|
|
41
|
-
console.error(
|
|
35
|
+
const t = new y(e, o);
|
|
36
|
+
n.value = t.getReport();
|
|
37
|
+
} catch (t) {
|
|
38
|
+
console.error(t.message);
|
|
42
39
|
}
|
|
43
40
|
};
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, null, 8, ["report", "options"]));
|
|
41
|
+
return l(), (e, o) => (R(), g(i(_), {
|
|
42
|
+
visible: s.value,
|
|
43
|
+
report: n.value,
|
|
44
|
+
options: i(p),
|
|
45
|
+
onSaveReport: f
|
|
46
|
+
}, null, 8, ["visible", "report", "options"]));
|
|
51
47
|
}
|
|
52
48
|
});
|
|
53
49
|
export {
|
|
54
|
-
|
|
50
|
+
F as default
|
|
55
51
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import t from "lodash";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
-
import
|
|
3
|
+
import o from "../dataUtils/stimulsoftData.js";
|
|
4
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";
|
|
@@ -9,20 +9,20 @@ class f {
|
|
|
9
9
|
jsonTemplate;
|
|
10
10
|
listData;
|
|
11
11
|
report;
|
|
12
|
-
constructor(r,
|
|
13
|
-
this.jsonTemplate = r, this.listData =
|
|
12
|
+
constructor(r, i) {
|
|
13
|
+
this.jsonTemplate = r, this.listData = i, this.report = new s.Report.StiReport();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* 加载打印模版json
|
|
17
17
|
* @param json
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
loadJson = () => (t.
|
|
20
|
+
loadJson = () => (t.isNil(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
|
|
21
21
|
/**
|
|
22
22
|
* 加在数据
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
|
-
loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 &&
|
|
25
|
+
loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 && o.createDataSet(this.report, this.listData), this);
|
|
26
26
|
getReport = () => (this.loadJson(), this.loadData(), this.report);
|
|
27
27
|
}
|
|
28
28
|
export {
|
|
@@ -3,7 +3,7 @@ import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.
|
|
|
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
|
|
6
|
+
import l from "../dataUtils/stimulsoftData.js";
|
|
7
7
|
import o from "lodash";
|
|
8
8
|
class d {
|
|
9
9
|
reports = [];
|
|
@@ -26,10 +26,10 @@ class d {
|
|
|
26
26
|
for (let t = 0; t < this.printData.length; t++) {
|
|
27
27
|
const r = this.printData[t];
|
|
28
28
|
for (let e = 0; e < r.jsonTemplates.length; e++) {
|
|
29
|
-
const
|
|
29
|
+
const p = r.jsonTemplates[e];
|
|
30
30
|
for (let i = 0; i < r.listData.length; i++) {
|
|
31
|
-
const
|
|
32
|
-
s.load(
|
|
31
|
+
const a = r.listData[i], s = new n.Report.StiReport();
|
|
32
|
+
s.load(p), l.createDataSet(s, a), this.reports.push(s);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -51,7 +51,7 @@ class d {
|
|
|
51
51
|
print() {
|
|
52
52
|
o.isNil(this.printData) || this.printData.length === 0 || (this.printData.forEach((t) => {
|
|
53
53
|
o.isNil(t.jsonTemplates) || t.jsonTemplates.length === 0 || o.isNil(t.listData) || t.listData.length;
|
|
54
|
-
}),
|
|
54
|
+
}), this.initReport(), this.mergeReport(), this.report.print());
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
export {
|
package/package.json
CHANGED
package/types/components.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export * from "./components/core/core";
|
|
|
19
19
|
export * from "./stimulsoft/desginer/desginer";
|
|
20
20
|
export * from "./stimulsoft/desginer/factory";
|
|
21
21
|
export * from "./stimulsoft/printer/printer";
|
|
22
|
-
export * from "./stimulsoft/dataUtils
|
|
22
|
+
export * from "./stimulsoft/dataUtils";
|
|
23
23
|
export * from "./message/message";
|
|
24
24
|
export * from "./layout/layout";
|
|
@@ -2,8 +2,6 @@ import { TWldy } from "@ningboyz/types";
|
|
|
2
2
|
import { Stimulsoft } from "stimulsoft-reports-js-vuejs/designer";
|
|
3
3
|
declare class StimulsoftData {
|
|
4
4
|
private static DATA_SET_NAME: string;
|
|
5
|
-
public loadLicense: () => void;
|
|
6
|
-
public loadLanguage: () => void;
|
|
7
5
|
public createDataSet: (report: Stimulsoft.Report.StiReport, listData: TWldy.IWldyDataResponse[]) => void;
|
|
8
6
|
private getDataSet: (report: Stimulsoft.Report.StiReport, listData: TWldy.IWldyDataResponse[]) => void;
|
|
9
7
|
private listItem2DataTable: (dataTable: Stimulsoft.System.Data.DataTable, wldyData: TWldy.IWldyDataResponse) => void;
|