@cpzxrobot/sdk 1.2.63 → 1.2.64

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 CHANGED
@@ -47,6 +47,7 @@ const robot_gateway_1 = require("./robot_gateway");
47
47
  const quotation_gateway_1 = require("./quotation_gateway");
48
48
  const ai_gateway_1 = require("./ai_gateway");
49
49
  const construction_gateway_1 = require("./construction_gateway");
50
+ const system_gateway_1 = require("./system_gateway");
50
51
  class Cpzxrobot {
51
52
  constructor(appCode) {
52
53
  this.pigfarm = new pigfarm_gateway_1.PigfarmGateway(this);
@@ -67,6 +68,7 @@ class Cpzxrobot {
67
68
  this.quotation = new quotation_gateway_1.QuotationGateway(this);
68
69
  this.ai = new ai_gateway_1.AiGateway(this);
69
70
  this.construction = new construction_gateway_1.ConstructionGateway(this);
71
+ this.system = new system_gateway_1.SystemGateway(this);
70
72
  //获取当前浏览器的域名
71
73
  this.ready = new Promise((resolve, reject) => {
72
74
  this.resolveReady = resolve;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SystemGateway = void 0;
4
+ class SystemGateway extends Object {
5
+ constructor(context) {
6
+ super();
7
+ this.context = context;
8
+ }
9
+ /**
10
+ * 获取菜单列表
11
+ * @param roleId 角色ID
12
+ * @returns Promise
13
+ */
14
+ menuList(roleId) {
15
+ return this.context.ready.then((axios) => {
16
+ return axios.get(`/api/v2/coremde-sale/system/menu/list/${roleId}`);
17
+ });
18
+ }
19
+ }
20
+ exports.SystemGateway = SystemGateway;
package/index.ts CHANGED
@@ -2,7 +2,6 @@ import { DeviceGateway } from "./device_gateway";
2
2
  import { UserGateway } from "./user_gateway";
3
3
  import { FactoryGateway } from "./factory_gateway";
4
4
  import { TransportGateway } from "./transport_gateway";
5
- import axios from "axios";
6
5
  import { AssistantGateway } from "./assistant_gateway";
7
6
  import { EnergyGateway } from "./energy_gateway";
8
7
  import { CameraGateway } from "./camera_gateway";
@@ -22,6 +21,7 @@ import { RobotGateway } from "./robot_gateway";
22
21
  import { QuotationGateway } from "./quotation_gateway";
23
22
  import { AiGateway } from "./ai_gateway";
24
23
  import { ConstructionGateway } from "./construction_gateway";
24
+ import { SystemGateway } from "./system_gateway";
25
25
 
26
26
  export class Cpzxrobot {
27
27
  private static factorySelectorLoaded = false;
@@ -76,6 +76,7 @@ export class Cpzxrobot {
76
76
  quotation: QuotationGateway = new QuotationGateway(this);
77
77
  ai: AiGateway = new AiGateway(this);
78
78
  construction: ConstructionGateway = new ConstructionGateway(this);
79
+ system: SystemGateway = new SystemGateway(this);
79
80
 
80
81
 
81
82
  constructor(appCode: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.63",
3
+ "version": "1.2.64",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,21 @@
1
+ import { Cpzxrobot } from "./types";
2
+
3
+ export class SystemGateway extends Object {
4
+ context: Cpzxrobot;
5
+
6
+ constructor(context: Cpzxrobot) {
7
+ super();
8
+ this.context = context;
9
+ }
10
+
11
+ /**
12
+ * 获取菜单列表
13
+ * @param roleId 角色ID
14
+ * @returns Promise
15
+ */
16
+ menuList(roleId: number) {
17
+ return this.context.ready.then((axios) => {
18
+ return axios.get(`/api/v2/coremde-sale/system/menu/list/${roleId}`);
19
+ });
20
+ }
21
+ }
package/types.d.ts CHANGED
@@ -20,6 +20,7 @@ import { AiGateway } from "./ai_gateway";
20
20
  import { EnergyGateway } from "./energy_gateway";
21
21
  import { type ElectricMeterRate } from "./energy_types/electric_meter_gateway";
22
22
  import { ConstructionGateway } from "./construction_gateway";
23
+ import { SystemGateway } from "./system_gateway";
23
24
 
24
25
  type Device = {
25
26
  id: number;
@@ -349,6 +350,7 @@ class Cpzxrobot {
349
350
  ai: AiGateway;
350
351
  energy: EnergyGateway;
351
352
  construction: ConstructionGateway;
353
+ system: SystemGateway;
352
354
  dict: (key: string) => any;
353
355
  _getSelectedFarmFromMiniApp: () => Promise<Factory>;
354
356
  _getSelectedUnitFromMiniApp: () => Promise<Unit>;