@cpzxrobot/sdk 1.3.133 → 1.3.134

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 CHANGED
@@ -143,7 +143,7 @@ if (response.code === 200) {
143
143
  console.error('模板创建失败:', response.message);
144
144
  }
145
145
  ```
146
-
146
+ ac
147
147
  #### 修改模板
148
148
 
149
149
  ```javascript
package/aiform_gateway.ts CHANGED
@@ -561,12 +561,13 @@ export class AiformGateway extends Object {
561
561
  return {
562
562
  /**
563
563
  * 按工厂 + structType 查询已落库表头列表
564
- * GET /api/v2/form/pigfarm/list
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): Promise<AiformStructListResponse> => {
570
+ list: async (factoryId: number, structType: string, searchParams?: object): Promise<AiformStructListResponse> => {
570
571
  const axios = await this.context.ready;
571
572
 
572
573
  if (!factoryId) {
@@ -576,7 +577,7 @@ export class AiformGateway extends Object {
576
577
  throw new Error('结构化类型不能为空');
577
578
  }
578
579
 
579
- return axios.get(`/api/v2/form/pigfarm/list`, {
580
+ return axios.post(`/api/v2/form/pigfarm/list`,searchParams, {
580
581
  params: {
581
582
  factoryId,
582
583
  structType
@@ -473,12 +473,13 @@ class AiformGateway extends Object {
473
473
  return {
474
474
  /**
475
475
  * 按工厂 + structType 查询已落库表头列表
476
- * GET /api/v2/form/pigfarm/list
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, searchParams) => __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,7 +487,7 @@ class AiformGateway extends Object {
486
487
  if (!structType) {
487
488
  throw new Error('结构化类型不能为空');
488
489
  }
489
- return axios.get(`/api/v2/form/pigfarm/list`, {
490
+ return axios.post(`/api/v2/form/pigfarm/list`, searchParams, {
490
491
  params: {
491
492
  factoryId,
492
493
  structType
@@ -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 this.fetchWithAuth(url, {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.133",
3
+ "version": "1.3.134",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
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 this.fetchWithAuth(url, {
211
+ const response = await instance.fetchWithAuth(url, {
211
212
  method: 'POST',
212
213
  headers: isFormData ? config?.headers : {
213
214
  'Content-Type': 'application/json',