@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 CHANGED
@@ -1,23 +1,18 @@
1
1
  import { YzDesginer as r } from "./stimulsoft/desginer/index.js";
2
- import { StimulsoftFactory as g } from "./stimulsoft/desginer/index.js";
2
+ import { StimulsoftFactory as a } from "./stimulsoft/desginer/index.js";
3
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));
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
- g as StimulsoftFactory,
18
- S as StimulsoftPrinter,
11
+ x as StimulsoftCommon,
12
+ a as StimulsoftFactory,
13
+ l as StimulsoftPrinter,
19
14
  r as YzDesginer,
20
15
  m as YzLayout,
21
- D as YzMessage,
22
- x as install
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 { YzMessage as x } from "./message/index.js";
6
- import { YzLayout as n } from "./layout/index.js";
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
- n as YzLayout,
12
- x as YzMessage,
13
+ z as YzLayout,
14
+ n as YzMessage,
13
15
  o as default,
14
16
  e as install
15
17
  };
@@ -0,0 +1,6 @@
1
+ import t from "./stimulsoftData.js";
2
+ import o from "./stimulsoftUtil.js";
3
+ const f = { StimulsoftData: t, StimulsoftUtil: o };
4
+ export {
5
+ f as StimulsoftCommon
6
+ };
@@ -1,51 +1,48 @@
1
1
  import { decode as m } from "js-base64";
2
2
  import n from "lodash";
3
- import { Stimulsoft as l } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
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 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 = "中文";
10
+ static createDataSet = (s, t) => {
11
+ this.getDataSet(s, t);
12
12
  };
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);
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
- i.dictionary.synchronize();
19
+ s.dictionary.synchronize();
23
20
  };
24
- static listItem2DataTable = (i, t) => {
21
+ static listItem2DataTable = (s, t) => {
25
22
  for (let a = 0; a < t.listItem.length; a++) {
26
- const o = t.listItem[a];
27
- if (n.isEmpty(o.printVal))
23
+ const i = t.listItem[a];
24
+ if (n.isEmpty(i.printVal))
28
25
  continue;
29
- const e = new l.System.Data.DataColumn(o.printVal);
30
- i.columns.add(e);
26
+ const e = new c.System.Data.DataColumn(i.printVal);
27
+ s.columns.add(e);
31
28
  }
32
29
  };
33
- static listData2DataTable = (i, t) => {
30
+ static listData2DataTable = (s, t) => {
34
31
  for (let a = 0; a < t.listData.length; a++) {
35
- const o = t.listData[a], e = this.getRow(i, t.listItem, o);
36
- i.addRow(e);
32
+ const i = t.listData[a], e = this.getRow(s, t.listItem, i);
33
+ s.addRow(e);
37
34
  }
38
35
  };
39
- static getRow = (i, t, a) => {
40
- const o = i.newRow();
36
+ static getRow = (s, t, a) => {
37
+ const i = s.newRow();
41
38
  for (let e = 0; e < t.length; e++) {
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);
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 o;
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 = (i, t) => {
57
- const a = m(i), o = new Function("value", a);
53
+ static execJsMethod = (s, t) => {
54
+ const a = m(s), i = new Function("value", a);
58
55
  try {
59
- const e = o(t);
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 v, ref as D, watch as S, createBlock as g, openBlock as R, unref as p } from "vue";
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 x from "lodash";
4
- import b from "./factory.js";
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 j = /* @__PURE__ */ v({
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(i, { expose: c, emit: m }) {
18
- y.initStimulsoft();
19
- const n = i, r = D(), s = new a.Designer.StiDesignerOptions();
20
- s.appearance.fullScreenMode = !0;
21
- const f = m;
22
- S(
23
- () => [n.templateJson, n.listData],
24
- (t) => {
25
- const o = t[0], e = t[1];
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 l = (t) => {
33
- t.preventDefault = !0;
34
- const o = t.report.saveToJsonString(), e = t.fileName;
35
- f("saveReport", e, o);
36
- }, u = () => x.isNil(r.value) ? "" : "data:application/pdf;base64," + r.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (t, o) => {
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 e = new b(t, o);
39
- r.value = e.getReport();
40
- } catch (e) {
41
- console.error(e.message);
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 c({
45
- getPdfBase64: u
46
- }), (t, o) => (R(), g(p(_), {
47
- report: r.value,
48
- options: p(s),
49
- onSaveReport: l
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
- j as default
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 i from "../dataUtils/stimulsoftData.js";
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, o) {
13
- this.jsonTemplate = r, this.listData = o, this.report = new s.Report.StiReport();
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.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
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 && i.createDataSet(this.report, this.listData), this);
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 p from "../dataUtils/stimulsoftData.js";
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 a = r.jsonTemplates[e];
29
+ const p = r.jsonTemplates[e];
30
30
  for (let i = 0; i < r.listData.length; i++) {
31
- const l = r.listData[i], s = new n.Report.StiReport();
32
- s.load(a), p.createDataSet(s, l), this.reports.push(s);
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
- }), p.initStimulsoft(), this.initReport(), this.mergeReport(), this.report.print());
54
+ }), this.initReport(), this.mergeReport(), this.report.print());
55
55
  }
56
56
  }
57
57
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/vue",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "宁波甬政vue-ui库",
@@ -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/StimulsoftData";
22
+ export * from "./stimulsoft/dataUtils";
23
23
  export * from "./message/message";
24
24
  export * from "./layout/layout";
@@ -0,0 +1,7 @@
1
+ import StimulsoftData from "./stimulsoftData";
2
+ import StimulsoftUtil from "./StimulsoftUtil";
3
+
4
+ export const StimulsoftCommon = {
5
+ StimulsoftData,
6
+ StimulsoftUtil
7
+ };
@@ -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;
@@ -0,0 +1,7 @@
1
+ declare class StimulsoftUtil {
2
+ private static loadLicense: () => void;
3
+ private static loadLanguage: () => void;
4
+ private static loadFonts: () => void;
5
+ public static initialize: () => boolean;
6
+ }
7
+ export default StimulsoftUtil;
@@ -17,6 +17,4 @@ export interface YzDesginerSlots {
17
17
  title?: () => any;
18
18
  }
19
19
 
20
- export type YzDesginerInstance = {
21
- getPdfBase64: () => string;
22
- };
20
+ export type YzDesginerInstance = {};