@cpzxrobot/sdk 1.1.71 → 1.1.73
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/dist/index.js +1 -1
- package/dist/product_gateway.js +10 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/product_gateway.ts +19 -6
package/dist/index.js
CHANGED
|
@@ -96,7 +96,7 @@ class Cpzxrobot {
|
|
|
96
96
|
button.type = "file";
|
|
97
97
|
button.style.display = "none";
|
|
98
98
|
document.body.appendChild(button);
|
|
99
|
-
button.
|
|
99
|
+
button.onclick = (e) => {
|
|
100
100
|
var _a;
|
|
101
101
|
var file = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
102
102
|
if (file) {
|
package/dist/product_gateway.js
CHANGED
|
@@ -74,6 +74,16 @@ class ProductGateway extends Object {
|
|
|
74
74
|
return axios.get(`/api/v2/coremde-sale/product/price/history/get?id=${id}`);
|
|
75
75
|
});
|
|
76
76
|
},
|
|
77
|
+
export: (args) => {
|
|
78
|
+
if (!args.fileName) {
|
|
79
|
+
args.fileName = "报价单历史记录.xlsx";
|
|
80
|
+
}
|
|
81
|
+
return this.context.ready.then((axios) => {
|
|
82
|
+
return axios.getAndSave(`/api/v2/coremde-sale/product/price/history/export`, {
|
|
83
|
+
params: args,
|
|
84
|
+
}, args.fileName);
|
|
85
|
+
});
|
|
86
|
+
},
|
|
77
87
|
},
|
|
78
88
|
};
|
|
79
89
|
}
|
package/index.ts
CHANGED
|
@@ -132,7 +132,7 @@ export class Cpzxrobot {
|
|
|
132
132
|
button.type = "file";
|
|
133
133
|
button.style.display = "none";
|
|
134
134
|
document.body.appendChild(button);
|
|
135
|
-
button.
|
|
135
|
+
button.onclick = (e: Event) => {
|
|
136
136
|
var file = (e.target as HTMLInputElement).files?.[0];
|
|
137
137
|
if (file) {
|
|
138
138
|
const formData = new FormData();
|
package/package.json
CHANGED
package/product_gateway.ts
CHANGED
|
@@ -28,18 +28,18 @@ export class ProductGateway extends Object {
|
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
types(companyId: number,pageNo:number| undefined = undefined,pageSize:number| undefined = undefined) {
|
|
32
|
-
var args
|
|
31
|
+
types(companyId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) {
|
|
32
|
+
var args: {
|
|
33
33
|
companyId: number,
|
|
34
|
-
pageNo?:number,
|
|
35
|
-
pageSize?:number,
|
|
34
|
+
pageNo?: number,
|
|
35
|
+
pageSize?: number,
|
|
36
36
|
} = {
|
|
37
37
|
companyId: companyId,
|
|
38
38
|
}
|
|
39
|
-
if(pageNo){
|
|
39
|
+
if (pageNo) {
|
|
40
40
|
args.pageNo = pageNo
|
|
41
41
|
}
|
|
42
|
-
if(pageSize){
|
|
42
|
+
if (pageSize) {
|
|
43
43
|
args.pageSize = pageSize
|
|
44
44
|
}
|
|
45
45
|
return this.context.ready.then((axios) => {
|
|
@@ -120,6 +120,19 @@ export class ProductGateway extends Object {
|
|
|
120
120
|
);
|
|
121
121
|
});
|
|
122
122
|
},
|
|
123
|
+
export: (args: {
|
|
124
|
+
id: number;
|
|
125
|
+
fileName?: string;
|
|
126
|
+
}) => {
|
|
127
|
+
if (!args.fileName) {
|
|
128
|
+
args.fileName = "报价单历史记录.xlsx";
|
|
129
|
+
}
|
|
130
|
+
return this.context.ready.then((axios) => {
|
|
131
|
+
return axios.getAndSave(`/api/v2/coremde-sale/product/price/history/export`, {
|
|
132
|
+
params: args,
|
|
133
|
+
}, args.fileName);
|
|
134
|
+
});
|
|
135
|
+
},
|
|
123
136
|
},
|
|
124
137
|
};
|
|
125
138
|
}
|