@ningboyz/vue 1.0.36 → 1.0.38
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/{packages/stimulsoft → stimulsoft}/desginer/desginer.vue.js +5 -5
- package/es/{packages/stimulsoft → stimulsoft}/desginer/factory.js +5 -5
- package/package.json +1 -3
- package/types/all.d.ts +1 -1
- package/types/index.d.ts +0 -5
- package/packages/components.ts +0 -9
- package/packages/index.ts +0 -3
- package/packages/stimulsoft/desginer/desginer.vue +0 -49
- package/packages/stimulsoft/desginer/factory.ts +0 -74
- package/packages/stimulsoft/desginer/index.ts +0 -8
- /package/es/{packages/components.js → components.js} +0 -0
- /package/es/{packages/index.js → index.js} +0 -0
- /package/es/{packages/stimulsoft → stimulsoft}/desginer/desginer.vue2.js +0 -0
- /package/es/{packages/stimulsoft → stimulsoft}/desginer/index.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defineComponent as f, ref as u, watch as v, createBlock as d, openBlock as g, unref as s } from "vue";
|
|
2
|
-
import { Designer as D } from "
|
|
2
|
+
import { Designer as D } from "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
3
|
import R from "./factory.js";
|
|
4
|
-
import { Stimulsoft as _ } from "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
4
|
+
import { Stimulsoft as _ } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
5
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
6
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
7
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
8
8
|
const N = /* @__PURE__ */ f({
|
|
9
9
|
__name: "desginer",
|
|
10
10
|
props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import l from "lodash";
|
|
2
|
-
import "
|
|
3
|
-
import { Stimulsoft as o } from "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
2
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/designer.js";
|
|
3
|
+
import { Stimulsoft as o } from "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.reports.engine.js";
|
|
4
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.viewer.js";
|
|
5
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.designer.js";
|
|
6
|
+
import "../../node_modules/stimulsoft-reports-js-vuejs/stimulsoft.blockly.editor.js";
|
|
7
7
|
class f {
|
|
8
8
|
listData = [];
|
|
9
9
|
report;
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ningboyz/vue",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
5
|
"description": "宁波甬政vue-ui库",
|
|
7
6
|
"author": "nbyt-syq",
|
|
8
7
|
"license": "ISC",
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
"files": [
|
|
22
21
|
"es",
|
|
23
22
|
"types",
|
|
24
|
-
"packages",
|
|
25
23
|
"styles"
|
|
26
24
|
],
|
|
27
25
|
"scripts": {
|
package/types/all.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/packages/components.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { App } from "vue";
|
|
2
|
-
import { YzDesginer } from "./stimulsoft/desginer";
|
|
3
|
-
const components = [YzDesginer];
|
|
4
|
-
|
|
5
|
-
export const install = (app: App) => {
|
|
6
|
-
components.forEach((component) => app.use(component));
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export * from "./stimulsoft/desginer";
|
package/packages/index.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { Designer as StimulsoftDesginer, Stimulsoft } from "stimulsoft-reports-js-vuejs/designer";
|
|
3
|
-
import { ref, watch } from "vue";
|
|
4
|
-
import _ from "lodash";
|
|
5
|
-
import ReportFactory from "./factory";
|
|
6
|
-
import type { TWldy } from "@ningboyz/types";
|
|
7
|
-
import { YzDesginerEmits, YzDesginerProps, YzDesginerSlots } from "../../../types/components/stimulsoft/desginer/desginer";
|
|
8
|
-
const props = defineProps<YzDesginerProps>();
|
|
9
|
-
defineSlots<YzDesginerSlots>();
|
|
10
|
-
const report = ref<Stimulsoft.Report.StiReport>();
|
|
11
|
-
const designerOptions = new Stimulsoft.Designer.StiDesignerOptions();
|
|
12
|
-
designerOptions.appearance.fullScreenMode = true;
|
|
13
|
-
|
|
14
|
-
const emits = defineEmits<YzDesginerEmits>();
|
|
15
|
-
|
|
16
|
-
watch(
|
|
17
|
-
() => props.listData,
|
|
18
|
-
(newValue) => {
|
|
19
|
-
renderReport(newValue);
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
deep: true
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const saveReport = (args: Stimulsoft.Designer.SaveReportArgs) => {
|
|
27
|
-
args.preventDefault = true;
|
|
28
|
-
const json = args.report.saveToJsonString();
|
|
29
|
-
const fileName = args.fileName;
|
|
30
|
-
emits("saveReport", fileName, json);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const renderReport = async (listData: TWldy.IWldyDataResponse[]) => {
|
|
34
|
-
try {
|
|
35
|
-
const instance = new ReportFactory();
|
|
36
|
-
instance.setListData(listData);
|
|
37
|
-
const reportInst = instance.getReport();
|
|
38
|
-
report.value = reportInst;
|
|
39
|
-
} catch (e: any) {
|
|
40
|
-
console.log(e.message);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<StimulsoftDesginer :report="report" :options="designerOptions" @save-report="saveReport" />
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<style scoped lang="scss"></style>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { TWldy } from "@ningboyz/types";
|
|
2
|
-
import type { IWldyDataResponse, IWldyItemResponse } from "@ningboyz/types/src/wldy";
|
|
3
|
-
import _ from "lodash";
|
|
4
|
-
import { Stimulsoft } from "stimulsoft-reports-js-vuejs/designer";
|
|
5
|
-
|
|
6
|
-
class Factory {
|
|
7
|
-
private listData: TWldy.IWldyDataResponse[] = [];
|
|
8
|
-
private report: Stimulsoft.Report.StiReport;
|
|
9
|
-
|
|
10
|
-
constructor(listData?: TWldy.IWldyDataResponse[]) {
|
|
11
|
-
if (!_.isNil(listData)) {
|
|
12
|
-
this.listData = listData;
|
|
13
|
-
}
|
|
14
|
-
this.report = new Stimulsoft.Report.StiReport();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
public setListData = (listData: TWldy.IWldyDataResponse[]) => {
|
|
18
|
-
this.listData = listData;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
public getReport = () => {
|
|
22
|
-
this.report.dataSources.clear();
|
|
23
|
-
this.getDataSet();
|
|
24
|
-
return this.report;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
private getDataSet = () => {
|
|
28
|
-
if (this.listData.length === 0) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const dataSet = new Stimulsoft.System.Data.DataSet("网络打印");
|
|
32
|
-
for (let i = 0; i < this.listData.length; i++) {
|
|
33
|
-
const wldyData = this.listData[i];
|
|
34
|
-
const dataTable = new Stimulsoft.System.Data.DataTable(wldyData.dataName);
|
|
35
|
-
this.listItem2DataTable(dataTable, wldyData);
|
|
36
|
-
this.listData2DataTable(dataTable, wldyData);
|
|
37
|
-
dataSet.tables.add(dataTable);
|
|
38
|
-
this.report.regData(dataSet.dataSetName, dataSet.dataSetName, dataSet);
|
|
39
|
-
}
|
|
40
|
-
this.report.dictionary.synchronize();
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
private listItem2DataTable = (dataTable: Stimulsoft.System.Data.DataTable, wldyData: IWldyDataResponse) => {
|
|
44
|
-
for (let i = 0; i < wldyData.listItem.length; i++) {
|
|
45
|
-
const item = wldyData.listItem[i];
|
|
46
|
-
if (_.isEmpty(item.printVal)) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
const dataColumn = new Stimulsoft.System.Data.DataColumn(item.printVal);
|
|
50
|
-
dataTable.columns.add(dataColumn);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
private listData2DataTable = (dataTable: Stimulsoft.System.Data.DataTable, wldyData: IWldyDataResponse) => {
|
|
55
|
-
for (let i = 0; i < wldyData.listData.length; i++) {
|
|
56
|
-
const data = wldyData.listData[i];
|
|
57
|
-
const dataRow = this.getRow(dataTable, wldyData.listItem, data);
|
|
58
|
-
dataTable.addRow(dataRow);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
private getRow = (dataTable: Stimulsoft.System.Data.DataTable, listItem: IWldyItemResponse[], data: any) => {
|
|
63
|
-
const dataRow = dataTable.newRow();
|
|
64
|
-
for (let j = 0; j < listItem.length; j++) {
|
|
65
|
-
const wldyItem = listItem[j];
|
|
66
|
-
if (!_.isEmpty(wldyItem.printVal)) {
|
|
67
|
-
dataRow.setValue(wldyItem.printVal, Reflect.get(data, wldyItem.itemCode));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return dataRow;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export default Factory;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|