@cpzxrobot/sdk 1.0.42 → 1.0.43

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/camera_gateway.ts CHANGED
@@ -7,6 +7,7 @@ export class CameraGateway extends Object {
7
7
  this.context = context;
8
8
  }
9
9
 
10
+ //查询摄像头,如果传unit,按单元搜索,或者有unit_id,优先使用unit_id,然后使用workshop_id,最后使用factory_id,查询对应的摄像头
10
11
  async search(
11
12
  data:
12
13
  | Unit
@@ -6,6 +6,7 @@ class CameraGateway extends Object {
6
6
  super();
7
7
  this.context = context;
8
8
  }
9
+ //查询摄像头,如果传unit,按单元搜索,或者有unit_id,优先使用unit_id,然后使用workshop_id,最后使用factory_id,查询对应的摄像头
9
10
  async search(data) {
10
11
  var axios = await this.context.ready;
11
12
  var params = {};
package/dist/index.js CHANGED
@@ -229,6 +229,22 @@ class Cpzxrobot {
229
229
  }
230
230
  this.resolveReady(this.axios);
231
231
  });
232
+ //load www.cpzxrobot.com/web_components.js as web components
233
+ // const script = document.createElement("script");
234
+ // script.src = "https://www.cpzxrobot.com/web_components.js";
235
+ // document.body.appendChild(script);
236
+ // //insert cpzxrobot_web_components into body
237
+ // const div = document.createElement("cpzxrobot_web_components");
238
+ // document.body.appendChild(div);
239
+ // //register onUnitChanged and onFactoryChanged on div
240
+ // div.addEventListener("unitChanged", function (e: any) {
241
+ // // @ts-ignore
242
+ // window._notifyUnitChanged(e.detail);
243
+ // });
244
+ // div.addEventListener("factoryChanged", function (e: any) {
245
+ // // @ts-ignore
246
+ // window._notifyFactoryChanged(e.detail);
247
+ // });
232
248
  return;
233
249
  }
234
250
  else {
@@ -61,7 +61,7 @@ class PigfarmGateway extends Object {
61
61
  },
62
62
  update: async (lamp) => {
63
63
  var axios = await this.context.ready;
64
- return axios.get(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
64
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
65
65
  },
66
66
  };
67
67
  }
package/index.ts CHANGED
@@ -264,6 +264,22 @@ export class Cpzxrobot {
264
264
  }
265
265
  this.resolveReady(this.axios);
266
266
  });
267
+ //load www.cpzxrobot.com/web_components.js as web components
268
+ // const script = document.createElement("script");
269
+ // script.src = "https://www.cpzxrobot.com/web_components.js";
270
+ // document.body.appendChild(script);
271
+ // //insert cpzxrobot_web_components into body
272
+ // const div = document.createElement("cpzxrobot_web_components");
273
+ // document.body.appendChild(div);
274
+ // //register onUnitChanged and onFactoryChanged on div
275
+ // div.addEventListener("unitChanged", function (e: any) {
276
+ // // @ts-ignore
277
+ // window._notifyUnitChanged(e.detail);
278
+ // });
279
+ // div.addEventListener("factoryChanged", function (e: any) {
280
+ // // @ts-ignore
281
+ // window._notifyFactoryChanged(e.detail);
282
+ // });
267
283
  return;
268
284
  } else {
269
285
  //if url has access_token and app_code, use it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.0.42",
3
+ "version": "1.0.43",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -73,7 +73,7 @@ export class PigfarmGateway extends Object {
73
73
  },
74
74
  update:async (lamp: HeatLamp):Promise<any>=> {
75
75
  var axios = await this.context.ready;
76
- return axios.get(`/api/v1/pigfarm/heatLamp/config/update`,lamp)
76
+ return axios.post(`/api/v1/pigfarm/heatLamp/config/update`,lamp)
77
77
  },
78
78
  };
79
79
  }