@cpzxrobot/sdk 1.2.0 → 1.2.1

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.
@@ -99,10 +99,23 @@ class UnitGateway extends Object {
99
99
  return axios.post(`/api/v2/batch/unit/empty`, args);
100
100
  });
101
101
  },
102
- //获取某个单元的批次信息
103
- get: (unitNo) => {
102
+ //获取某个批次的所有单元信息
103
+ // deperacated
104
+ get: (batchNo) => {
104
105
  return this.context.ready.then((axios) => {
105
- return axios.get(`/api/v2/batch/unit/${unitNo}`);
106
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
107
+ });
108
+ },
109
+ //获取某个批次的所有单元信息
110
+ getUnits: (batchNo) => {
111
+ return this.context.ready.then((axios) => {
112
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
113
+ });
114
+ },
115
+ //查询某个单元的所有批次信息
116
+ searchInUnit: (unitId, args) => {
117
+ return this.context.ready.then((axios) => {
118
+ return axios.post(`/api/v2/batch/${unitId}?`, args);
106
119
  });
107
120
  },
108
121
  list: (unitIds) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -146,7 +146,8 @@ baseURL: "/"
146
146
  | cpzxrobot().unit.thresholdConfig.delete | 删除单元的阈值配置信息,传入get获取的条目的具体id或对象本身 |
147
147
  | cpzxrobot().unit.batch.bind | 绑定单元和生产批次关系 |
148
148
  | cpzxrobot().unit.batch.clear | 清除单元绑定的生产批次 |
149
- | cpzxrobot().unit.batch.get | 获取单元绑定的生产批次 |
149
+ | cpzxrobot().unit.batch.getUnits | 获取批次的绑定单元信息 |
150
+ | cpzxrobot().unit.batch.searchInUnit | 搜索单元的生产批次信息 |
150
151
  | cpzxrobot().unit.batch.list | 获取多个单元的生产批次信息 |
151
152
  | cpzxrobot().user.add | 添加用户 |
152
153
  | cpzxrobot().user.update | 更新用户 |
package/unit_gateway.ts CHANGED
@@ -121,10 +121,23 @@ export class UnitGateway extends Object {
121
121
  `/api/v2/batch/unit/empty`,args);
122
122
  });
123
123
  },
124
- //获取某个单元的批次信息
125
- get: (unitNo: Number) => {
124
+ //获取某个批次的所有单元信息
125
+ // deperacated
126
+ get: (batchNo: Number) => {
126
127
  return this.context.ready.then((axios) => {
127
- return axios.get(`/api/v2/batch/unit/${unitNo}`);
128
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
129
+ });
130
+ },
131
+ //获取某个批次的所有单元信息
132
+ getUnits: (batchNo: Number) => {
133
+ return this.context.ready.then((axios) => {
134
+ return axios.get(`/api/v2/batch/unit/${batchNo}?`);
135
+ });
136
+ },
137
+ //查询某个单元的所有批次信息
138
+ searchInUnit: (unitId: Number,args :any) => {
139
+ return this.context.ready.then((axios) => {
140
+ return axios.post(`/api/v2/batch/${unitId}?`,args);
128
141
  });
129
142
  },
130
143
  list: (unitIds: Number[]) => {