@ningboyz/vue 1.0.100 → 1.0.101
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,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "lodash";
|
|
2
|
+
import { Stimulsoft as i } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
2
3
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.chart.js";
|
|
3
4
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.export.js";
|
|
4
5
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.import.xlsx.js";
|
|
5
6
|
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.maps.js";
|
|
6
|
-
class
|
|
7
|
+
class m {
|
|
8
|
+
static url = "";
|
|
7
9
|
// 创建字体配置对象
|
|
8
10
|
static fonts = [
|
|
9
11
|
{
|
|
@@ -30,40 +32,44 @@ class h {
|
|
|
30
32
|
/**
|
|
31
33
|
* 加载字体
|
|
32
34
|
*/
|
|
33
|
-
static loadFonts = () => {
|
|
34
|
-
|
|
35
|
-
this.fonts.forEach((
|
|
36
|
-
switch (
|
|
35
|
+
static loadFonts = (o) => {
|
|
36
|
+
let t = "/printer/fonts/";
|
|
37
|
+
e.isEmpty(o) || (t = `${o}/upload` + t), this.fonts.forEach((a) => {
|
|
38
|
+
switch (a.fontType) {
|
|
37
39
|
case "ttf":
|
|
38
|
-
|
|
40
|
+
i.Base.StiFontCollection.addFontFile(t + a.fontPath, a.fontName);
|
|
39
41
|
break;
|
|
40
42
|
case "otf":
|
|
41
|
-
|
|
43
|
+
i.Base.StiFontCollection.addOpentypeFontFile(t + a.fontPath, a.fontName);
|
|
42
44
|
break;
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
|
-
const
|
|
46
|
-
console.log("已注册字体 =>",
|
|
47
|
+
const n = i.Base.StiFontCollection.getBinFonts();
|
|
48
|
+
console.log("已注册字体 =>", n);
|
|
47
49
|
};
|
|
48
50
|
/**
|
|
49
51
|
* 加载授权
|
|
50
52
|
*/
|
|
51
53
|
static loadLicense = () => {
|
|
52
|
-
|
|
54
|
+
i.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";
|
|
53
55
|
};
|
|
54
56
|
/**
|
|
55
57
|
* 加载语言
|
|
56
58
|
*/
|
|
57
|
-
static loadLanguage = () => {
|
|
58
|
-
t
|
|
59
|
+
static loadLanguage = (o) => {
|
|
60
|
+
let t = "/printer/localizations/";
|
|
61
|
+
e.isEmpty(o) || (t = `${o}/upload` + t), i.Base.Localization.StiLocalization.addLocalizationFile(`${t}zh.xml`, !1, "中文"), i.Base.Localization.StiLocalization.cultureName = "中文";
|
|
62
|
+
};
|
|
63
|
+
static setUrl = (o) => {
|
|
64
|
+
this.url = o;
|
|
59
65
|
};
|
|
60
66
|
/**
|
|
61
67
|
* 初始化
|
|
62
68
|
*/
|
|
63
69
|
static initialize = () => {
|
|
64
|
-
this.loadLicense(), this.loadLanguage(), this.loadFonts();
|
|
70
|
+
console.info("打印控件初始化, url:=>", this.url), this.loadLicense(), this.loadLanguage(this.url), this.loadFonts(this.url);
|
|
65
71
|
};
|
|
66
72
|
}
|
|
67
73
|
export {
|
|
68
|
-
|
|
74
|
+
m as default
|
|
69
75
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
declare class StimulsoftUtil {
|
|
2
2
|
private static loadLicense: () => void;
|
|
3
|
-
private static loadLanguage: () => void;
|
|
4
|
-
private static loadFonts: () => void;
|
|
3
|
+
private static loadLanguage: (url: string) => void;
|
|
4
|
+
private static loadFonts: (url: string) => void;
|
|
5
|
+
public static setUrl: (url: string) => void;
|
|
5
6
|
public static initialize: () => Promise<boolean>;
|
|
6
7
|
}
|
|
7
8
|
export default StimulsoftUtil;
|