@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.
@@ -1,33 +1,29 @@
1
- import { Stimulsoft as o } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
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 c {
6
+ class h {
7
7
  // 创建字体配置对象
8
8
  static fonts = [
9
9
  {
10
- fontName: "有色标题黑",
11
- fontPath: "/printer/fonts/YouSheBiaoTiHei.ttf",
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: "/printer/fonts/SimSun.ttf",
18
- fontStyle: void 0,
16
+ fontPath: "SimSun.ttf",
19
17
  fontType: "ttf"
20
18
  },
21
19
  {
22
20
  fontName: "YZ-仿宋GB2312",
23
- fontPath: "/printer/fonts/FangSong_GB2312.ttf",
24
- fontStyle: void 0,
21
+ fontPath: "FangSong_GB2312.ttf",
25
22
  fontType: "ttf"
26
23
  },
27
24
  {
28
25
  fontName: "YZ-微软雅黑",
29
- fontPath: "/printer/fonts/MicrosoftYaHei.ttf",
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
- this.fonts.forEach((t) => {
39
- switch (t.fontType) {
34
+ const a = "printer/fonts/";
35
+ this.fonts.forEach((o) => {
36
+ switch (o.fontType) {
40
37
  case "ttf":
41
- o.Base.StiFontCollection.addFontFile(t.fontPath, t.fontName, t.fontStyle);
38
+ t.Base.StiFontCollection.addFontFile(a + o.fontPath, o.fontName);
42
39
  break;
43
40
  case "otf":
44
- o.Base.StiFontCollection.addOpentypeFontFile(t.fontPath, t.fontName, t.fontStyle);
41
+ t.Base.StiFontCollection.addOpentypeFontFile(a + o.fontPath, o.fontName);
45
42
  break;
46
43
  }
47
44
  });
48
- const a = o.Base.StiFontCollection.getBinFonts();
49
- console.log("已注册字体 =>", a);
45
+ const i = t.Base.StiFontCollection.getBinFonts();
46
+ console.log("已注册字体 =>", i);
50
47
  };
51
48
  /**
52
49
  * 加载授权
53
50
  */
54
51
  static loadLicense = () => {
55
- 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";
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
- o.Base.Localization.StiLocalization.addLocalizationFile("/printer/localizations/zh.xml", !1, "中文"), o.Base.Localization.StiLocalization.cultureName = "中文";
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
- c as default
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 i } from "vue";
2
- import { Designer as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
3
- import y from "./factory.js";
4
- import { Stimulsoft as S } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
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 F = /* @__PURE__ */ d({
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: 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;
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
- () => [r.templateJson, r.listData],
22
+ () => [s.templateJson, s.listData],
21
23
  async (e) => {
22
24
  const o = e[0], t = e[1];
23
- v(o, t), s.value = !0;
25
+ p(o, t);
24
26
  },
25
27
  {
26
28
  deep: !0
27
29
  }
28
30
  );
29
- const f = (e) => {
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
- }, v = async (e, o) => {
35
+ }, p = async (e, o) => {
34
36
  try {
35
- const t = new y(e, o);
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 l(), (e, o) => (R(), g(i(_), {
42
- visible: s.value,
43
+ return m({
44
+ renderReport: p
45
+ }), (e, o) => (R(), g(l(S), {
46
+ visible: i.value,
43
47
  report: n.value,
44
- options: i(p),
45
- onSaveReport: f
48
+ options: l(r),
49
+ onSaveReport: v
46
50
  }, null, 8, ["visible", "report", "options"]));
47
51
  }
48
52
  });
49
53
  export {
50
- F as default
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 s } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
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(r, i) {
13
- this.jsonTemplate = r, this.listData = i, this.report = new s.Report.StiReport();
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) || this.report.load(this.jsonTemplate), this);
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 n } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
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 l from "../dataUtils/stimulsoftData.js";
7
- import o from "lodash";
6
+ import p from "../dataUtils/stimulsoftData.js";
7
+ import s from "lodash";
8
8
  class d {
9
9
  reports = [];
10
10
  report;
11
- printData;
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.printData = t, this.report = new n.Report.StiReport();
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.printData.length; t++) {
27
- const r = this.printData[t];
28
- for (let e = 0; e < r.jsonTemplates.length; e++) {
29
- const p = r.jsonTemplates[e];
30
- for (let i = 0; i < r.listData.length; i++) {
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
- o.isNil(this.printData) || this.printData.length === 0 || (this.printData.forEach((t) => {
53
- o.isNil(t.jsonTemplates) || t.jsonTemplates.length === 0 || o.isNil(t.listData) || t.listData.length;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/vue",
3
- "version": "1.0.96",
3
+ "version": "1.0.98",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "宁波甬政vue-ui库",
@@ -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;
@@ -17,4 +17,6 @@ export interface YzDesginerSlots {
17
17
  title?: () => any;
18
18
  }
19
19
 
20
- export type YzDesginerInstance = {};
20
+ export type YzDesginerInstance = {
21
+ renderReport: (jsonTemplate: string, listData: TWldy.IWldyDataResponse[]) => void;
22
+ };