@ningboyz/vue 1.0.96 → 1.0.98
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/stimulsoft/dataUtils/stimulsoftUtil.js +17 -20
- package/es/stimulsoft/desginer/desginer.vue.js +24 -20
- package/es/stimulsoft/desginer/factory.js +4 -4
- package/es/stimulsoft/printer/printer.js +12 -15
- package/package.json +1 -1
- package/types/stimulsoft/dataUtils/stimulsoftUtil.d.ts +1 -1
- package/types/stimulsoft/desginer/desginer.d.ts +3 -1
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import { Stimulsoft as
|
|
1
|
+
import { Stimulsoft as t } 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
|
-
class
|
|
6
|
+
class h {
|
|
7
7
|
// 创建字体配置对象
|
|
8
8
|
static fonts = [
|
|
9
9
|
{
|
|
10
|
-
fontName: "
|
|
11
|
-
fontPath: "
|
|
12
|
-
fontStyle: void 0,
|
|
10
|
+
fontName: "YZ-有色标题黑",
|
|
11
|
+
fontPath: "YouSheBiaoTiHei.ttf",
|
|
13
12
|
fontType: "ttf"
|
|
14
13
|
},
|
|
15
14
|
{
|
|
16
15
|
fontName: "YZ-宋体",
|
|
17
|
-
fontPath: "
|
|
18
|
-
fontStyle: void 0,
|
|
16
|
+
fontPath: "SimSun.ttf",
|
|
19
17
|
fontType: "ttf"
|
|
20
18
|
},
|
|
21
19
|
{
|
|
22
20
|
fontName: "YZ-仿宋GB2312",
|
|
23
|
-
fontPath: "
|
|
24
|
-
fontStyle: void 0,
|
|
21
|
+
fontPath: "FangSong_GB2312.ttf",
|
|
25
22
|
fontType: "ttf"
|
|
26
23
|
},
|
|
27
24
|
{
|
|
28
25
|
fontName: "YZ-微软雅黑",
|
|
29
|
-
fontPath: "
|
|
30
|
-
fontStyle: void 0,
|
|
26
|
+
fontPath: "MicrosoftYaHei.ttf",
|
|
31
27
|
fontType: "ttf"
|
|
32
28
|
}
|
|
33
29
|
];
|
|
@@ -35,30 +31,31 @@ class c {
|
|
|
35
31
|
* 加载字体
|
|
36
32
|
*/
|
|
37
33
|
static loadFonts = () => {
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const a = "printer/fonts/";
|
|
35
|
+
this.fonts.forEach((o) => {
|
|
36
|
+
switch (o.fontType) {
|
|
40
37
|
case "ttf":
|
|
41
|
-
|
|
38
|
+
t.Base.StiFontCollection.addFontFile(a + o.fontPath, o.fontName);
|
|
42
39
|
break;
|
|
43
40
|
case "otf":
|
|
44
|
-
|
|
41
|
+
t.Base.StiFontCollection.addOpentypeFontFile(a + o.fontPath, o.fontName);
|
|
45
42
|
break;
|
|
46
43
|
}
|
|
47
44
|
});
|
|
48
|
-
const
|
|
49
|
-
console.log("已注册字体 =>",
|
|
45
|
+
const i = t.Base.StiFontCollection.getBinFonts();
|
|
46
|
+
console.log("已注册字体 =>", i);
|
|
50
47
|
};
|
|
51
48
|
/**
|
|
52
49
|
* 加载授权
|
|
53
50
|
*/
|
|
54
51
|
static loadLicense = () => {
|
|
55
|
-
|
|
52
|
+
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";
|
|
56
53
|
};
|
|
57
54
|
/**
|
|
58
55
|
* 加载语言
|
|
59
56
|
*/
|
|
60
57
|
static loadLanguage = () => {
|
|
61
|
-
|
|
58
|
+
t.Base.Localization.StiLocalization.addLocalizationFile("printer/localizations/zh.xml", !1, "中文"), t.Base.Localization.StiLocalization.cultureName = "中文";
|
|
62
59
|
};
|
|
63
60
|
/**
|
|
64
61
|
* 初始化
|
|
@@ -68,5 +65,5 @@ class c {
|
|
|
68
65
|
};
|
|
69
66
|
}
|
|
70
67
|
export {
|
|
71
|
-
|
|
68
|
+
h as default
|
|
72
69
|
};
|
|
@@ -1,51 +1,55 @@
|
|
|
1
|
-
import { defineComponent as d, ref as a, watch as D, createBlock as g, openBlock as R, unref as
|
|
2
|
-
import { Designer as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as d, ref as a, watch as D, createBlock as g, openBlock as R, unref as l } from "vue";
|
|
2
|
+
import { Designer as S } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
+
import _ from "./factory.js";
|
|
4
|
+
import y from "../dataUtils/stimulsoftUtil.js";
|
|
5
|
+
import { Stimulsoft as b } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
5
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
6
7
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
7
8
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
8
|
-
const
|
|
9
|
+
const N = /* @__PURE__ */ d({
|
|
9
10
|
__name: "desginer",
|
|
10
11
|
props: {
|
|
11
12
|
templateJson: {},
|
|
12
13
|
listData: {}
|
|
13
14
|
},
|
|
14
15
|
emits: ["saveReport"],
|
|
15
|
-
setup(c, { expose:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
setup(c, { expose: m, emit: f }) {
|
|
17
|
+
y.initialize();
|
|
18
|
+
const s = c, n = a(), i = a(!1), r = new b.Designer.StiDesignerOptions();
|
|
19
|
+
r.appearance.fullScreenMode = !0, r.toolbar.showFileMenu = !1;
|
|
20
|
+
const u = f;
|
|
19
21
|
D(
|
|
20
|
-
() => [
|
|
22
|
+
() => [s.templateJson, s.listData],
|
|
21
23
|
async (e) => {
|
|
22
24
|
const o = e[0], t = e[1];
|
|
23
|
-
|
|
25
|
+
p(o, t);
|
|
24
26
|
},
|
|
25
27
|
{
|
|
26
28
|
deep: !0
|
|
27
29
|
}
|
|
28
30
|
);
|
|
29
|
-
const
|
|
31
|
+
const v = (e) => {
|
|
30
32
|
e.preventDefault = !0;
|
|
31
33
|
const o = e.report.saveToJsonString(), t = e.fileName;
|
|
32
34
|
u("saveReport", t, o);
|
|
33
|
-
},
|
|
35
|
+
}, p = async (e, o) => {
|
|
34
36
|
try {
|
|
35
|
-
const t = new
|
|
36
|
-
n.value = t.getReport();
|
|
37
|
+
const t = new _(e, o);
|
|
38
|
+
n.value = t.getReport(), i.value = !0;
|
|
37
39
|
} catch (t) {
|
|
38
40
|
console.error(t.message);
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
+
return m({
|
|
44
|
+
renderReport: p
|
|
45
|
+
}), (e, o) => (R(), g(l(S), {
|
|
46
|
+
visible: i.value,
|
|
43
47
|
report: n.value,
|
|
44
|
-
options:
|
|
45
|
-
onSaveReport:
|
|
48
|
+
options: l(r),
|
|
49
|
+
onSaveReport: v
|
|
46
50
|
}, null, 8, ["visible", "report", "options"]));
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
53
|
export {
|
|
50
|
-
|
|
54
|
+
N as default
|
|
51
55
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "lodash";
|
|
2
2
|
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
3
|
import o from "../dataUtils/stimulsoftData.js";
|
|
4
|
-
import { Stimulsoft as
|
|
4
|
+
import { Stimulsoft as r } 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";
|
|
@@ -9,15 +9,15 @@ class f {
|
|
|
9
9
|
jsonTemplate;
|
|
10
10
|
listData;
|
|
11
11
|
report;
|
|
12
|
-
constructor(
|
|
13
|
-
this.jsonTemplate =
|
|
12
|
+
constructor(i, s) {
|
|
13
|
+
this.jsonTemplate = i, this.listData = s, this.report = new r.Report.StiReport();
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* 加载打印模版json
|
|
17
17
|
* @param json
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
loadJson = () => (t.isNil(this.jsonTemplate)
|
|
20
|
+
loadJson = () => (!t.isNil(this.jsonTemplate) && !t.isEmpty(this.jsonTemplate) && this.report.load(this.jsonTemplate), this);
|
|
21
21
|
/**
|
|
22
22
|
* 加在数据
|
|
23
23
|
* @returns
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Stimulsoft as
|
|
1
|
+
import { Stimulsoft as o } 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
|
|
6
|
+
import p from "../dataUtils/stimulsoftData.js";
|
|
7
|
+
import s from "lodash";
|
|
8
8
|
class d {
|
|
9
9
|
reports = [];
|
|
10
10
|
report;
|
|
11
|
-
|
|
11
|
+
printDatas;
|
|
12
12
|
/**
|
|
13
13
|
* json模版
|
|
14
14
|
* 打印数据
|
|
@@ -16,21 +16,18 @@ class d {
|
|
|
16
16
|
* @param listData
|
|
17
17
|
*/
|
|
18
18
|
constructor(t) {
|
|
19
|
-
this.
|
|
19
|
+
this.printDatas = t, this.report = new o.Report.StiReport();
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* 初始化报表
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
25
|
initReport = () => {
|
|
26
|
-
for (let t = 0; t < this.
|
|
27
|
-
const r = this.
|
|
28
|
-
for (let e = 0; e < r.
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
const a = r.listData[i], s = new n.Report.StiReport();
|
|
32
|
-
s.load(p), l.createDataSet(s, a), this.reports.push(s);
|
|
33
|
-
}
|
|
26
|
+
for (let t = 0; t < this.printDatas.length; t++) {
|
|
27
|
+
const r = this.printDatas[t];
|
|
28
|
+
for (let e = 0; e < r.listData.length; e++) {
|
|
29
|
+
const a = r.listData[e], i = new o.Report.StiReport();
|
|
30
|
+
i.load(r.jsonTemplate), p.createDataSet(i, a), this.reports.push(i);
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
return this;
|
|
@@ -49,8 +46,8 @@ class d {
|
|
|
49
46
|
return this;
|
|
50
47
|
};
|
|
51
48
|
print() {
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
s.isNil(this.printDatas) || this.printDatas.length === 0 || (this.printDatas.forEach((t) => {
|
|
50
|
+
s.isEmpty(t.jsonTemplate) || s.isNil(t.listData) || t.listData.length;
|
|
54
51
|
}), this.initReport(), this.mergeReport(), this.report.print());
|
|
55
52
|
}
|
|
56
53
|
}
|
package/package.json
CHANGED
|
@@ -2,6 +2,6 @@ declare class StimulsoftUtil {
|
|
|
2
2
|
private static loadLicense: () => void;
|
|
3
3
|
private static loadLanguage: () => void;
|
|
4
4
|
private static loadFonts: () => void;
|
|
5
|
-
public static initialize: () => boolean
|
|
5
|
+
public static initialize: () => Promise<boolean>;
|
|
6
6
|
}
|
|
7
7
|
export default StimulsoftUtil;
|