@ningboyz/vue 1.0.85 → 1.0.87

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,16 +1,23 @@
1
1
  import { YzDesginer as r } from "./stimulsoft/desginer/index.js";
2
- import { StimulsoftFactory as a } from "./stimulsoft/desginer/index.js";
3
- import { YzLayout as e } from "./layout/index.js";
4
- import { StimulsoftPrinter as l } from "./stimulsoft/printer/index.js";
5
- import { YzMessage as x } from "./message/index.js";
6
- const m = [r, e], i = (o) => {
7
- m.forEach((t) => o.use(t));
2
+ import { StimulsoftFactory as g } from "./stimulsoft/desginer/index.js";
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));
8
15
  };
9
16
  export {
10
- a as StimulsoftFactory,
11
- l as StimulsoftPrinter,
17
+ g as StimulsoftFactory,
18
+ S as StimulsoftPrinter,
12
19
  r as YzDesginer,
13
- e as YzLayout,
14
- x as YzMessage,
15
- i as install
20
+ m as YzLayout,
21
+ D as YzMessage,
22
+ x as install
16
23
  };
@@ -1,48 +1,51 @@
1
1
  import { decode as m } from "js-base64";
2
2
  import n from "lodash";
3
- import { Stimulsoft as c } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
3
+ import { Stimulsoft as l } 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 createDataSet = (s, t) => {
11
- this.getDataSet(s, t);
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 = "中文";
12
12
  };
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);
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);
18
21
  }
19
- s.dictionary.synchronize();
22
+ i.dictionary.synchronize();
20
23
  };
21
- static listItem2DataTable = (s, t) => {
24
+ static listItem2DataTable = (i, t) => {
22
25
  for (let a = 0; a < t.listItem.length; a++) {
23
- const i = t.listItem[a];
24
- if (n.isEmpty(i.printVal))
26
+ const o = t.listItem[a];
27
+ if (n.isEmpty(o.printVal))
25
28
  continue;
26
- const e = new c.System.Data.DataColumn(i.printVal);
27
- s.columns.add(e);
29
+ const e = new l.System.Data.DataColumn(o.printVal);
30
+ i.columns.add(e);
28
31
  }
29
32
  };
30
- static listData2DataTable = (s, t) => {
33
+ static listData2DataTable = (i, t) => {
31
34
  for (let a = 0; a < t.listData.length; a++) {
32
- const i = t.listData[a], e = this.getRow(s, t.listItem, i);
33
- s.addRow(e);
35
+ const o = t.listData[a], e = this.getRow(i, t.listItem, o);
36
+ i.addRow(e);
34
37
  }
35
38
  };
36
- static getRow = (s, t, a) => {
37
- const i = s.newRow();
39
+ static getRow = (i, t, a) => {
40
+ const o = i.newRow();
38
41
  for (let e = 0; e < t.length; e++) {
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);
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);
43
46
  }
44
47
  }
45
- return i;
48
+ return o;
46
49
  };
47
50
  /**
48
51
  * 执行js语句
@@ -50,10 +53,10 @@ class g {
50
53
  * @param value
51
54
  * @returns
52
55
  */
53
- static execJsMethod = (s, t) => {
54
- const a = m(s), i = new Function("value", a);
56
+ static execJsMethod = (i, t) => {
57
+ const a = m(i), o = new Function("value", a);
55
58
  try {
56
- const e = i(t);
59
+ const e = o(t);
57
60
  n.isNil(e) || (t = e);
58
61
  } catch (e) {
59
62
  console.log(e.message);
@@ -1,28 +1,25 @@
1
- import { defineComponent as g, ref as U, watch as S, createBlock as h, openBlock as L, unref as i } from "vue";
2
- import { Designer as v } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
3
- import z from "lodash";
4
- import x from "./factory.js";
1
+ import { defineComponent as v, ref as g, watch as D, createBlock as R, openBlock as S, unref as p } from "vue";
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
5
  import { Stimulsoft as a } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
6
6
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
7
7
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
8
8
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
9
- const N = /* @__PURE__ */ g({
9
+ const O = /* @__PURE__ */ v({
10
10
  __name: "desginer",
11
11
  props: {
12
12
  templateJson: {},
13
- listData: {},
14
- registerTable: { type: Function }
13
+ listData: {}
15
14
  },
16
15
  emits: ["saveReport"],
17
- setup(p, { expose: c, emit: l }) {
18
- a.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", a.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), a.Base.Localization.StiLocalization.cultureName = "中文";
19
- const r = p, n = U(), s = new a.Designer.StiDesignerOptions();
16
+ setup(i, { expose: c, emit: m }) {
17
+ const n = i, r = g(), s = new a.Designer.StiDesignerOptions();
20
18
  s.appearance.fullScreenMode = !0;
21
- const m = l;
22
- S(
23
- () => [r.templateJson, r.listData],
19
+ const f = m;
20
+ D(
21
+ () => [n.templateJson, n.listData],
24
22
  (e) => {
25
- console.log(e);
26
23
  const o = e[0], t = e[1];
27
24
  d(o, t);
28
25
  },
@@ -30,27 +27,27 @@ const N = /* @__PURE__ */ g({
30
27
  deep: !0
31
28
  }
32
29
  );
33
- const f = (e) => {
30
+ const l = (e) => {
34
31
  e.preventDefault = !0;
35
32
  const o = e.report.saveToJsonString(), t = e.fileName;
36
- m("saveReport", t, o);
37
- }, u = () => z.isNil(n.value) ? "" : "data:application/pdf;base64," + n.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (e, o) => {
33
+ f("saveReport", t, o);
34
+ }, u = () => x.isNil(r.value) ? "" : "data:application/pdf;base64," + r.value.exportDocument(a.Report.StiExportFormat.Pdf).toString("base64"), d = async (e, o) => {
38
35
  try {
39
- const t = new x();
40
- n.value = t.setListData(o).loadJson(e).getReport();
36
+ const t = new b(e, o);
37
+ r.value = t.getReport();
41
38
  } catch (t) {
42
- console.log(t.message);
39
+ console.error(t.message);
43
40
  }
44
41
  };
45
42
  return c({
46
43
  getPdfBase64: u
47
- }), (e, o) => (L(), h(i(v), {
48
- report: n.value,
49
- options: i(s),
50
- onSaveReport: f
44
+ }), (e, o) => (S(), R(p(_), {
45
+ report: r.value,
46
+ options: p(s),
47
+ onSaveReport: l
51
48
  }, null, 8, ["report", "options"]));
52
49
  }
53
50
  });
54
51
  export {
55
- N as default
52
+ O as default
56
53
  };
@@ -1,28 +1,31 @@
1
- import r from "lodash";
1
+ import t from "lodash";
2
2
  import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
3
- import o from "../dataUtils/stimulsoftData.js";
4
- import { Stimulsoft as i } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
3
+ import i from "../dataUtils/stimulsoftData.js";
4
+ import { Stimulsoft as o } 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";
8
- class f {
9
- listData = void 0;
8
+ class c {
9
+ jsonTemplate;
10
+ listData;
10
11
  report;
11
- constructor(t) {
12
- r.isNil(t) || (this.listData = t), this.report = new i.Report.StiReport();
12
+ constructor(s, r) {
13
+ this.jsonTemplate = s, this.listData = r, this.report = new o.Report.StiReport();
13
14
  }
14
- initLicense = () => (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", i.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), i.Base.Localization.StiLocalization.cultureName = "中文", this);
15
- setListData = (t) => (this.listData = t, this);
15
+ setLicense = () => (i.initStimulsoft(), this);
16
16
  /**
17
17
  * 加载打印模版json
18
18
  * @param json
19
19
  * @returns
20
20
  */
21
- loadJson = (t) => (r.isEmpty(t) || this.report.load(t), this);
22
- getReport = () => (this.report.dataSources.clear(), r.isNil(this.listData) || this.listData.length === 0 ? this.report : (o.createDataSet(this.report, this.listData), this.report));
23
- print = () => (this.report.print(), this);
24
- printToPdf = () => (this.report.printToPdf(), this);
21
+ loadJson = () => (t.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
22
+ /**
23
+ * 加在数据
24
+ * @returns
25
+ */
26
+ loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 && i.createDataSet(this.report, this.listData), this);
27
+ getReport = () => (this.setLicense().loadJson().loadData(), this.report);
25
28
  }
26
29
  export {
27
- f as default
30
+ c as default
28
31
  };