@cpzxrobot/sdk 1.3.133 → 1.3.135
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/AIFORM_GATEWAY.md +1 -1
- package/aiform_gateway.ts +13 -4
- package/dist/aiform_gateway.js +8 -4
- package/dist/web_platform.js +2 -1
- package/package.json +1 -1
- package/web_platform.ts +2 -1
package/AIFORM_GATEWAY.md
CHANGED
package/aiform_gateway.ts
CHANGED
|
@@ -561,12 +561,17 @@ export class AiformGateway extends Object {
|
|
|
561
561
|
return {
|
|
562
562
|
/**
|
|
563
563
|
* 按工厂 + structType 查询已落库表头列表
|
|
564
|
-
*
|
|
564
|
+
* POST /api/v2/form/pigfarm/list
|
|
565
565
|
* @param factoryId 工厂ID
|
|
566
566
|
* @param structType 报表结构化类型
|
|
567
|
+
* @param searchParams 搜索条件(可选)
|
|
567
568
|
* @returns Promise 包含表头列表
|
|
568
569
|
*/
|
|
569
|
-
list: async (factoryId: number, structType: string
|
|
570
|
+
list: async (factoryId: number, structType: string, params?: {
|
|
571
|
+
searchParams?: object,
|
|
572
|
+
pageNum?: number,
|
|
573
|
+
pageSize?: number,
|
|
574
|
+
}): Promise<AiformStructListResponse> => {
|
|
570
575
|
const axios = await this.context.ready;
|
|
571
576
|
|
|
572
577
|
if (!factoryId) {
|
|
@@ -576,10 +581,14 @@ export class AiformGateway extends Object {
|
|
|
576
581
|
throw new Error('结构化类型不能为空');
|
|
577
582
|
}
|
|
578
583
|
|
|
579
|
-
|
|
584
|
+
const { searchParams, pageNum = 1, pageSize = 10 } = params || {};
|
|
585
|
+
|
|
586
|
+
return axios.post(`/api/v2/form/pigfarm/list`,searchParams, {
|
|
580
587
|
params: {
|
|
581
588
|
factoryId,
|
|
582
|
-
structType
|
|
589
|
+
structType,
|
|
590
|
+
pageNum,
|
|
591
|
+
pageSize,
|
|
583
592
|
}
|
|
584
593
|
}).then((res) => {
|
|
585
594
|
if (res.data.code !== 200) {
|
package/dist/aiform_gateway.js
CHANGED
|
@@ -473,12 +473,13 @@ class AiformGateway extends Object {
|
|
|
473
473
|
return {
|
|
474
474
|
/**
|
|
475
475
|
* 按工厂 + structType 查询已落库表头列表
|
|
476
|
-
*
|
|
476
|
+
* POST /api/v2/form/pigfarm/list
|
|
477
477
|
* @param factoryId 工厂ID
|
|
478
478
|
* @param structType 报表结构化类型
|
|
479
|
+
* @param searchParams 搜索条件(可选)
|
|
479
480
|
* @returns Promise 包含表头列表
|
|
480
481
|
*/
|
|
481
|
-
list: (factoryId, structType) => __awaiter(this, void 0, void 0, function* () {
|
|
482
|
+
list: (factoryId, structType, params) => __awaiter(this, void 0, void 0, function* () {
|
|
482
483
|
const axios = yield this.context.ready;
|
|
483
484
|
if (!factoryId) {
|
|
484
485
|
throw new Error('工厂ID不能为空');
|
|
@@ -486,10 +487,13 @@ class AiformGateway extends Object {
|
|
|
486
487
|
if (!structType) {
|
|
487
488
|
throw new Error('结构化类型不能为空');
|
|
488
489
|
}
|
|
489
|
-
|
|
490
|
+
const { searchParams, pageNum = 1, pageSize = 10 } = params || {};
|
|
491
|
+
return axios.post(`/api/v2/form/pigfarm/list`, searchParams, {
|
|
490
492
|
params: {
|
|
491
493
|
factoryId,
|
|
492
|
-
structType
|
|
494
|
+
structType,
|
|
495
|
+
pageNum,
|
|
496
|
+
pageSize,
|
|
493
497
|
}
|
|
494
498
|
}).then((res) => {
|
|
495
499
|
if (res.data.code !== 200) {
|
package/dist/web_platform.js
CHANGED
|
@@ -194,8 +194,9 @@ class WebPlatform {
|
|
|
194
194
|
return { data: yield response.json() };
|
|
195
195
|
}),
|
|
196
196
|
post: (url, data, config) => __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
url = instance.processQueryParams(url, config);
|
|
197
198
|
const isFormData = data instanceof FormData;
|
|
198
|
-
const response = yield
|
|
199
|
+
const response = yield instance.fetchWithAuth(url, {
|
|
199
200
|
method: 'POST',
|
|
200
201
|
headers: isFormData ? config === null || config === void 0 ? void 0 : config.headers : Object.assign({ 'Content-Type': 'application/json' }, config === null || config === void 0 ? void 0 : config.headers),
|
|
201
202
|
body: isFormData ? data : JSON.stringify(data)
|
package/package.json
CHANGED
package/web_platform.ts
CHANGED
|
@@ -206,8 +206,9 @@ export class WebPlatform implements PlatformInterface {
|
|
|
206
206
|
return { data: await response.json() };
|
|
207
207
|
},
|
|
208
208
|
post: async (url: string, data?: any, config?: any) => {
|
|
209
|
+
url = instance.processQueryParams(url, config);
|
|
209
210
|
const isFormData = data instanceof FormData;
|
|
210
|
-
const response = await
|
|
211
|
+
const response = await instance.fetchWithAuth(url, {
|
|
211
212
|
method: 'POST',
|
|
212
213
|
headers: isFormData ? config?.headers : {
|
|
213
214
|
'Content-Type': 'application/json',
|