@ningboyz/vue 1.0.89 → 1.0.91

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,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,12 +1,13 @@
1
- import { defineComponent as v, ref as g, watch as D, createBlock as R, openBlock as S, unref as p } from "vue";
1
+ import { defineComponent as v, ref as D, watch as S, createBlock as g, openBlock as R, unref as p } from "vue";
2
2
  import { Designer as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
3
3
  import x from "lodash";
4
4
  import b from "./factory.js";
5
+ import y from "../dataUtils/stimulsoftData.js";
5
6
  import { Stimulsoft as a } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
6
7
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
7
8
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
8
9
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
9
- const O = /* @__PURE__ */ v({
10
+ const j = /* @__PURE__ */ v({
10
11
  __name: "desginer",
11
12
  props: {
12
13
  templateJson: {},
@@ -14,34 +15,35 @@ const O = /* @__PURE__ */ v({
14
15
  },
15
16
  emits: ["saveReport"],
16
17
  setup(i, { expose: c, emit: m }) {
17
- const n = i, r = g(), s = new a.Designer.StiDesignerOptions();
18
+ y.initStimulsoft();
19
+ const n = i, r = D(), s = new a.Designer.StiDesignerOptions();
18
20
  s.appearance.fullScreenMode = !0;
19
21
  const f = m;
20
- D(
22
+ S(
21
23
  () => [n.templateJson, n.listData],
22
- (e) => {
23
- const o = e[0], t = e[1];
24
- d(o, t);
24
+ (t) => {
25
+ const o = t[0], e = t[1];
26
+ d(o, e);
25
27
  },
26
28
  {
27
29
  deep: !0
28
30
  }
29
31
  );
30
- const l = (e) => {
31
- e.preventDefault = !0;
32
- const o = e.report.saveToJsonString(), t = e.fileName;
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) => {
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) => {
35
37
  try {
36
- const t = new b(e, o);
37
- r.value = t.getReport();
38
- } catch (t) {
39
- console.error(t.message);
38
+ const e = new b(t, o);
39
+ r.value = e.getReport();
40
+ } catch (e) {
41
+ console.error(e.message);
40
42
  }
41
43
  };
42
44
  return c({
43
45
  getPdfBase64: u
44
- }), (e, o) => (S(), R(p(_), {
46
+ }), (t, o) => (R(), g(p(_), {
45
47
  report: r.value,
46
48
  options: p(s),
47
49
  onSaveReport: l
@@ -49,5 +51,5 @@ const O = /* @__PURE__ */ v({
49
51
  }
50
52
  });
51
53
  export {
52
- O as default
54
+ j as default
53
55
  };
@@ -1,31 +1,30 @@
1
- import a from "lodash";
1
+ import t from "lodash";
2
2
  import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
3
- import s from "../dataUtils/stimulsoftData.js";
4
- import { Stimulsoft as t } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
3
+ import i from "../dataUtils/stimulsoftData.js";
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";
7
7
  import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
8
- class d {
8
+ class f {
9
9
  jsonTemplate;
10
10
  listData;
11
11
  report;
12
- constructor(i, o) {
13
- this.jsonTemplate = i, this.listData = o, this.report = new t.Report.StiReport();
12
+ constructor(r, o) {
13
+ this.jsonTemplate = r, this.listData = o, this.report = new s.Report.StiReport();
14
14
  }
15
- setLicense = () => (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", t.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), t.Base.Localization.StiLocalization.cultureName = "中文", this);
16
15
  /**
17
16
  * 加载打印模版json
18
17
  * @param json
19
18
  * @returns
20
19
  */
21
- loadJson = () => (a.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
20
+ loadJson = () => (t.isEmpty(this.jsonTemplate) || this.report.load(this.jsonTemplate), this);
22
21
  /**
23
22
  * 加在数据
24
23
  * @returns
25
24
  */
26
- loadData = () => (this.report.dataSources.clear(), !a.isNil(this.listData) && this.listData.length > 0 && s.createDataSet(this.report, this.listData), this);
27
- getReport = () => (this.setLicense(), this.loadJson(), this.loadData(), this.report);
25
+ loadData = () => (this.report.dataSources.clear(), !t.isNil(this.listData) && this.listData.length > 0 && i.createDataSet(this.report, this.listData), this);
26
+ getReport = () => (this.loadJson(), this.loadData(), this.report);
28
27
  }
29
28
  export {
30
- d as default
29
+ f as default
31
30
  };
@@ -1,11 +1,11 @@
1
- import { Stimulsoft as r } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
1
+ import { Stimulsoft as n } 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 a from "lodash";
8
- class U {
6
+ import p from "../dataUtils/stimulsoftData.js";
7
+ import o from "lodash";
8
+ class d {
9
9
  reports = [];
10
10
  report;
11
11
  printData;
@@ -16,25 +16,20 @@ class U {
16
16
  * @param listData
17
17
  */
18
18
  constructor(t) {
19
- this.printData = t, this.report = new r.Report.StiReport();
19
+ this.printData = t, this.report = new n.Report.StiReport();
20
20
  }
21
- /**
22
- * 初始化license
23
- * @returns
24
- */
25
- setLicense = () => (r.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", r.Base.Localization.StiLocalization.addLocalizationFile("../localizations/zh.xml", !1, "中文"), r.Base.Localization.StiLocalization.cultureName = "中文", this);
26
21
  /**
27
22
  * 初始化报表
28
23
  * @returns
29
24
  */
30
25
  initReport = () => {
31
26
  for (let t = 0; t < this.printData.length; t++) {
32
- const e = this.printData[t];
33
- for (let i = 0; i < e.jsonTemplates.length; i++) {
34
- const n = e.jsonTemplates[i];
35
- for (let o = 0; o < e.listData.length; o++) {
36
- const p = e.listData[o], s = new r.Report.StiReport();
37
- s.load(n), l.createDataSet(s, p), this.reports.push(s);
27
+ const r = this.printData[t];
28
+ for (let e = 0; e < r.jsonTemplates.length; e++) {
29
+ const a = r.jsonTemplates[e];
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);
38
33
  }
39
34
  }
40
35
  }
@@ -46,19 +41,19 @@ class U {
46
41
  */
47
42
  mergeReport = async () => {
48
43
  for (let t = 0; t < this.reports.length; t++) {
49
- const e = this.reports[t];
50
- e.render(), t === 0 ? this.report = e : e.renderedPages.toList().forEach((i) => {
51
- this.report.renderedPages.add(i.clone());
44
+ const r = this.reports[t];
45
+ r.render(), t === 0 ? this.report = r : r.renderedPages.toList().forEach((e) => {
46
+ this.report.renderedPages.add(e.clone());
52
47
  });
53
48
  }
54
49
  return this;
55
50
  };
56
51
  print() {
57
- a.isNil(this.printData) || this.printData.length === 0 || (this.printData.forEach((t) => {
58
- a.isNil(t.jsonTemplates) || t.jsonTemplates.length === 0 || a.isNil(t.listData) || t.listData.length;
59
- }), this.setLicense(), this.initReport(), this.mergeReport(), this.report.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;
54
+ }), p.initStimulsoft(), this.initReport(), this.mergeReport(), this.report.print());
60
55
  }
61
56
  }
62
57
  export {
63
- U as default
58
+ d as default
64
59
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ningboyz/vue",
3
- "version": "1.0.89",
3
+ "version": "1.0.91",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "宁波甬政vue-ui库",