@cpzxrobot/sdk 1.2.10 → 1.2.12
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 +23 -17
- package/dist/robot_gateway.js +86 -45
- package/index.ts +46 -41
- package/package.json +1 -1
- package/readme.md +19 -32
- package/robot_gateway.ts +132 -50
package/dist/index.js
CHANGED
|
@@ -405,24 +405,30 @@ class Cpzxrobot {
|
|
|
405
405
|
else {
|
|
406
406
|
this.initAxios(baseURL);
|
|
407
407
|
this.auth = auth;
|
|
408
|
-
this.
|
|
409
|
-
.
|
|
410
|
-
appCode: this.appCode,
|
|
411
|
-
auth: auth,
|
|
412
|
-
})
|
|
413
|
-
.then((res) => {
|
|
414
|
-
if (res.data.Error) {
|
|
415
|
-
throw res.data.Error;
|
|
416
|
-
}
|
|
417
|
-
else {
|
|
418
|
-
this.token = "Bearer " + res.data.token;
|
|
419
|
-
}
|
|
408
|
+
if (this.auth.startsWith("Bearer ")) {
|
|
409
|
+
this.token = auth;
|
|
420
410
|
this.resolveReady(this.axios);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
this.axios
|
|
414
|
+
.post("/api/v1/user/auth", {
|
|
415
|
+
appCode: this.appCode,
|
|
416
|
+
auth: auth,
|
|
417
|
+
})
|
|
418
|
+
.then((res) => {
|
|
419
|
+
if (res.data.Error) {
|
|
420
|
+
throw res.data.Error;
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
this.token = "Bearer " + res.data.token;
|
|
424
|
+
}
|
|
425
|
+
this.resolveReady(this.axios);
|
|
426
|
+
})
|
|
427
|
+
.catch((err) => {
|
|
428
|
+
console.log("shzx ready caller reject", err);
|
|
429
|
+
this.rejectReady(err);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
426
432
|
}
|
|
427
433
|
}
|
|
428
434
|
isLocalDomain(domain) {
|
package/dist/robot_gateway.js
CHANGED
|
@@ -6,55 +6,96 @@ class RobotGateway extends Object {
|
|
|
6
6
|
super();
|
|
7
7
|
this.context = context;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
get alarm() {
|
|
10
|
+
return {
|
|
11
|
+
list: (unitId) => {
|
|
12
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/alarm/list/${unitId}`));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
13
15
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
get task() {
|
|
17
|
+
return {
|
|
18
|
+
list: (unitId) => {
|
|
19
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectTask/list/${unitId}`));
|
|
20
|
+
},
|
|
21
|
+
add: (data) => {
|
|
22
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectTask/add', data));
|
|
23
|
+
},
|
|
24
|
+
update: (data) => {
|
|
25
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectTask/update', data));
|
|
26
|
+
},
|
|
27
|
+
delete: (id) => {
|
|
28
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectTask/delete/${id}`));
|
|
29
|
+
},
|
|
30
|
+
dispatch: (taskId) => {
|
|
31
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectTask/dispatch/${taskId}`));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
18
34
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
get record() {
|
|
36
|
+
return {
|
|
37
|
+
list: (taskId) => {
|
|
38
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
23
41
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
get cage() {
|
|
43
|
+
return {
|
|
44
|
+
list: (unitId) => {
|
|
45
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/cage/list/${unitId}`));
|
|
46
|
+
},
|
|
47
|
+
addList: (data) => {
|
|
48
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/addList', data));
|
|
49
|
+
},
|
|
50
|
+
updateList: (data) => {
|
|
51
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/updateList', data));
|
|
52
|
+
},
|
|
53
|
+
update: (data) => {
|
|
54
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/cage/update', data));
|
|
55
|
+
},
|
|
56
|
+
delete: (id) => {
|
|
57
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/cage/delete/${id}`));
|
|
58
|
+
},
|
|
59
|
+
deleteList: (unitId) => {
|
|
60
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/cage/deleteList/${unitId}`));
|
|
61
|
+
}
|
|
62
|
+
};
|
|
28
63
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
get path() {
|
|
65
|
+
return {
|
|
66
|
+
list: (unitId) => {
|
|
67
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectPath/list/${unitId}`));
|
|
68
|
+
},
|
|
69
|
+
add: (data) => {
|
|
70
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/add', data));
|
|
71
|
+
},
|
|
72
|
+
update: (data) => {
|
|
73
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/update', data));
|
|
74
|
+
},
|
|
75
|
+
delete: (data) => {
|
|
76
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPath/delete', data));
|
|
77
|
+
},
|
|
78
|
+
point: {
|
|
79
|
+
list: (pathId) => {
|
|
80
|
+
return this.context.ready.then(axios => axios.get(`/api/v2/robot/inspectPathPoint/list/${pathId}`));
|
|
81
|
+
},
|
|
82
|
+
addList: (data) => {
|
|
83
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/addList', data));
|
|
84
|
+
},
|
|
85
|
+
updateList: (data) => {
|
|
86
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/updateList', data));
|
|
87
|
+
},
|
|
88
|
+
update: (data) => {
|
|
89
|
+
return this.context.ready.then(axios => axios.post('/api/v2/robot/inspectPathPoint/update', data));
|
|
90
|
+
},
|
|
91
|
+
delete: (id) => {
|
|
92
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectPathPoint/delete/${id}`));
|
|
93
|
+
},
|
|
94
|
+
deleteList: (pathId) => {
|
|
95
|
+
return this.context.ready.then(axios => axios.post(`/api/v2/robot/inspectPathPoint/deleteList/${pathId}`));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
58
99
|
}
|
|
59
100
|
}
|
|
60
101
|
exports.RobotGateway = RobotGateway;
|
package/index.ts
CHANGED
|
@@ -132,29 +132,29 @@ export class Cpzxrobot {
|
|
|
132
132
|
instance.upload = (url: string, option?: {
|
|
133
133
|
[key: string]: any;
|
|
134
134
|
}) => {
|
|
135
|
-
return new Promise<any>((resolve, reject)=>{
|
|
135
|
+
return new Promise<any>((resolve, reject) => {
|
|
136
136
|
//add a file button to the body
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
137
|
+
var button = document.createElement("input");
|
|
138
|
+
button.type = "file";
|
|
139
|
+
button.style.display = "none";
|
|
140
|
+
document.body.appendChild(button);
|
|
141
|
+
button.onclick = (e: Event) => {
|
|
142
|
+
var file = (e.target as HTMLInputElement).files?.[0];
|
|
143
|
+
if (file) {
|
|
144
|
+
const formData = new FormData();
|
|
145
|
+
formData.append(option?.["fileField"] || "file", file);
|
|
146
|
+
for (let key in option?.["data"]) {
|
|
147
|
+
formData.append(key, option!["data"][key]);
|
|
148
|
+
}
|
|
149
|
+
instance.post(url, formData).then((res) => {
|
|
150
|
+
button.remove();
|
|
151
|
+
resolve(res);
|
|
152
|
+
});
|
|
153
|
+
} else {
|
|
150
154
|
button.remove();
|
|
151
|
-
resolve(
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
button.remove();
|
|
155
|
-
resolve({data:{Error:"没有选择文件"}})
|
|
156
|
-
}
|
|
157
|
-
};
|
|
155
|
+
resolve({ data: { Error: "没有选择文件" } })
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
158
|
})
|
|
159
159
|
}
|
|
160
160
|
// @ts-ignore
|
|
@@ -197,7 +197,7 @@ export class Cpzxrobot {
|
|
|
197
197
|
// @ts-ignore
|
|
198
198
|
this.vibrate = window.miniapp.vibrate;
|
|
199
199
|
// @ts-ignore
|
|
200
|
-
this.reloadGroup= window.miniapp.reloadGroup;
|
|
200
|
+
this.reloadGroup = window.miniapp.reloadGroup;
|
|
201
201
|
this.saveBlob = this._saveBlobAsBase64;
|
|
202
202
|
// @ts-ignore
|
|
203
203
|
this.getGeo = window.miniapp.getGeo;
|
|
@@ -432,9 +432,9 @@ export class Cpzxrobot {
|
|
|
432
432
|
window.location.href = "/login.html?error=" + res.data.Error;
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
if (res.data.token){
|
|
435
|
+
if (res.data.token) {
|
|
436
436
|
this.token = "Bearer " + res.data.token;
|
|
437
|
-
}else if (access_token.startsWith("Bearer ")){
|
|
437
|
+
} else if (access_token.startsWith("Bearer ")) {
|
|
438
438
|
this.token = access_token;
|
|
439
439
|
}
|
|
440
440
|
localStorage.setItem("token", this.token);
|
|
@@ -450,23 +450,28 @@ export class Cpzxrobot {
|
|
|
450
450
|
} else {
|
|
451
451
|
this.initAxios(baseURL);
|
|
452
452
|
this.auth = auth;
|
|
453
|
-
this.
|
|
454
|
-
.
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
453
|
+
if (this.auth.startsWith("Bearer ")) {
|
|
454
|
+
this.token = auth;
|
|
455
|
+
this.resolveReady(this.axios);
|
|
456
|
+
} else {
|
|
457
|
+
this.axios
|
|
458
|
+
.post("/api/v1/user/auth", {
|
|
459
|
+
appCode: this.appCode,
|
|
460
|
+
auth: auth,
|
|
461
|
+
})
|
|
462
|
+
.then((res) => {
|
|
463
|
+
if (res.data.Error) {
|
|
464
|
+
throw res.data.Error;
|
|
465
|
+
} else {
|
|
466
|
+
this.token = "Bearer " + res.data.token;
|
|
467
|
+
}
|
|
468
|
+
this.resolveReady(this.axios);
|
|
469
|
+
})
|
|
470
|
+
.catch((err) => {
|
|
471
|
+
console.log("shzx ready caller reject", err);
|
|
472
|
+
this.rejectReady(err);
|
|
473
|
+
});
|
|
474
|
+
}
|
|
470
475
|
}
|
|
471
476
|
}
|
|
472
477
|
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -320,73 +320,60 @@ heatlamp 属性提供了一组方法,用于管理猪场的热灯配置。它
|
|
|
320
320
|
|
|
321
321
|
### 巡检任务相关接口
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
以下是更新后的巡检任务相关接口,分组在 `cpzxrobot().task` 和 `cpzxrobot().record` 命名空间下:
|
|
324
|
+
|
|
325
|
+
#### 任务管理 (cpzxrobot().task)
|
|
324
326
|
|
|
325
327
|
1. **获取任务列表**
|
|
326
328
|
```typescript
|
|
327
|
-
cpzxrobot().
|
|
329
|
+
cpzxrobot().task.list(unitId: number)
|
|
328
330
|
```
|
|
329
331
|
- 描述:获取指定单元的巡检任务列表
|
|
330
332
|
- 参数:`unitId` - 单元ID
|
|
331
333
|
- HTTP方法:GET
|
|
332
334
|
- 接口路径:`/api/v2/robot/inspectTask/list/{unitId}`
|
|
333
335
|
|
|
334
|
-
2.
|
|
335
|
-
```typescript
|
|
336
|
-
cpzxrobot().robot.getInspectTaskDetail(id: number)
|
|
337
|
-
```
|
|
338
|
-
- 描述:获取指定巡检任务的详细信息
|
|
339
|
-
- 参数:`id` - 任务ID
|
|
340
|
-
- HTTP方法:GET
|
|
341
|
-
- 接口路径:`/api/v2/robot/inspectTask/{id}`
|
|
342
|
-
|
|
343
|
-
3. **新增任务**
|
|
336
|
+
2. **新增任务**
|
|
344
337
|
```typescript
|
|
345
|
-
cpzxrobot().
|
|
338
|
+
cpzxrobot().task.add(data: any)
|
|
346
339
|
```
|
|
347
340
|
- 描述:添加新的巡检任务
|
|
348
341
|
- 参数:`data` - 包含任务信息的对象
|
|
349
342
|
- HTTP方法:POST
|
|
350
343
|
- 接口路径:`/api/v2/robot/inspectTask/add`
|
|
351
344
|
|
|
352
|
-
|
|
345
|
+
3. **修改任务**
|
|
353
346
|
```typescript
|
|
354
|
-
cpzxrobot().
|
|
347
|
+
cpzxrobot().task.update(data: any)
|
|
355
348
|
```
|
|
356
349
|
- 描述:更新现有的巡检任务
|
|
357
350
|
- 参数:`data` - 包含更新信息的对象
|
|
358
351
|
- HTTP方法:POST
|
|
359
352
|
- 接口路径:`/api/v2/robot/inspectTask/update`
|
|
360
353
|
|
|
361
|
-
|
|
354
|
+
4. **删除任务**
|
|
362
355
|
```typescript
|
|
363
|
-
cpzxrobot().
|
|
356
|
+
cpzxrobot().task.delete(id: number)
|
|
364
357
|
```
|
|
365
358
|
- 描述:删除指定的巡检任务
|
|
366
359
|
- 参数:`id` - 任务ID
|
|
367
|
-
- HTTP方法:
|
|
360
|
+
- HTTP方法:POST
|
|
368
361
|
- 接口路径:`/api/v2/robot/inspectTask/delete/{id}`
|
|
369
362
|
|
|
370
|
-
|
|
363
|
+
5. **下发任务**
|
|
371
364
|
```typescript
|
|
372
|
-
cpzxrobot().
|
|
373
|
-
```
|
|
374
|
-
- 描述:获取所有未下发的巡检任务列表
|
|
375
|
-
- HTTP方法:GET
|
|
376
|
-
- 接口路径:`/api/v2/robot/inspectTask/notAssignedList`
|
|
377
|
-
|
|
378
|
-
7. **下发任务**
|
|
379
|
-
```typescript
|
|
380
|
-
cpzxrobot().robot.assignInspectTask(taskId: number)
|
|
365
|
+
cpzxrobot().task.dispatch(taskId: number)
|
|
381
366
|
```
|
|
382
367
|
- 描述:下发指定的巡检任务
|
|
383
368
|
- 参数:`taskId` - 任务ID
|
|
384
|
-
- HTTP方法:
|
|
385
|
-
- 接口路径:`/api/v2/robot/inspectTask/
|
|
369
|
+
- HTTP方法:POST
|
|
370
|
+
- 接口路径:`/api/v2/robot/inspectTask/dispatch/{taskId}`
|
|
371
|
+
|
|
372
|
+
#### 巡检记录 (cpzxrobot().record)
|
|
386
373
|
|
|
387
|
-
|
|
374
|
+
1. **获取巡检结果**
|
|
388
375
|
```typescript
|
|
389
|
-
cpzxrobot().
|
|
376
|
+
cpzxrobot().record.list(taskId: number)
|
|
390
377
|
```
|
|
391
378
|
- 描述:获取指定巡检任务的结果列表
|
|
392
379
|
- 参数:`taskId` - 任务ID
|
package/robot_gateway.ts
CHANGED
|
@@ -8,63 +8,145 @@ export class RobotGateway extends Object {
|
|
|
8
8
|
this.context = context;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
get alarm() {
|
|
12
|
+
return {
|
|
13
|
+
list: (unitId: number) => {
|
|
14
|
+
return this.context.ready.then(axios =>
|
|
15
|
+
axios.get(`/api/v2/robot/alarm/list/${unitId}`)
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
15
19
|
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
get task() {
|
|
22
|
+
return {
|
|
23
|
+
list: (unitId: number) => {
|
|
24
|
+
return this.context.ready.then(axios =>
|
|
25
|
+
axios.get(`/api/v2/robot/inspectTask/list/${unitId}`)
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
add: (data: any) => {
|
|
29
|
+
return this.context.ready.then(axios =>
|
|
30
|
+
axios.post('/api/v2/robot/inspectTask/add', data)
|
|
31
|
+
);
|
|
32
|
+
},
|
|
33
|
+
update: (data: any) => {
|
|
34
|
+
return this.context.ready.then(axios =>
|
|
35
|
+
axios.post('/api/v2/robot/inspectTask/update', data)
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
delete: (id: number) => {
|
|
39
|
+
return this.context.ready.then(axios =>
|
|
40
|
+
axios.post(`/api/v2/robot/inspectTask/delete/${id}`)
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
dispatch: (taskId: number) => {
|
|
44
|
+
return this.context.ready.then(axios =>
|
|
45
|
+
axios.post(`/api/v2/robot/inspectTask/dispatch/${taskId}`)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
21
49
|
}
|
|
22
50
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
51
|
+
get record() {
|
|
52
|
+
return {
|
|
53
|
+
list: (taskId: number) => {
|
|
54
|
+
return this.context.ready.then(axios =>
|
|
55
|
+
axios.get(`/api/v2/robot/inspectRecord/list/${taskId}`)
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
27
59
|
}
|
|
28
60
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
get cage() {
|
|
62
|
+
return {
|
|
63
|
+
list: (unitId: number) => {
|
|
64
|
+
return this.context.ready.then(axios =>
|
|
65
|
+
axios.get(`/api/v2/robot/cage/list/${unitId}`)
|
|
66
|
+
);
|
|
67
|
+
},
|
|
68
|
+
addList: (data: any) => {
|
|
69
|
+
return this.context.ready.then(axios =>
|
|
70
|
+
axios.post('/api/v2/robot/cage/addList', data)
|
|
71
|
+
);
|
|
72
|
+
},
|
|
73
|
+
updateList: (data: any) => {
|
|
74
|
+
return this.context.ready.then(axios =>
|
|
75
|
+
axios.post('/api/v2/robot/cage/updateList', data)
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
update: (data: any) => {
|
|
79
|
+
return this.context.ready.then(axios =>
|
|
80
|
+
axios.post('/api/v2/robot/cage/update', data)
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
delete: (id: number) => {
|
|
84
|
+
return this.context.ready.then(axios =>
|
|
85
|
+
axios.post(`/api/v2/robot/cage/delete/${id}`)
|
|
86
|
+
);
|
|
87
|
+
},
|
|
88
|
+
deleteList: (unitId: number) => {
|
|
89
|
+
return this.context.ready.then(axios =>
|
|
90
|
+
axios.post(`/api/v2/robot/cage/deleteList/${unitId}`)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
33
94
|
}
|
|
34
95
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
96
|
+
get path() {
|
|
97
|
+
return {
|
|
98
|
+
list: (unitId: number) => {
|
|
99
|
+
return this.context.ready.then(axios =>
|
|
100
|
+
axios.get(`/api/v2/robot/inspectPath/list/${unitId}`)
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
add: (data: any) => {
|
|
104
|
+
return this.context.ready.then(axios =>
|
|
105
|
+
axios.post('/api/v2/robot/inspectPath/add', data)
|
|
106
|
+
);
|
|
107
|
+
},
|
|
108
|
+
update: (data: any) => {
|
|
109
|
+
return this.context.ready.then(axios =>
|
|
110
|
+
axios.post('/api/v2/robot/inspectPath/update', data)
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
delete: (data: any) => {
|
|
114
|
+
return this.context.ready.then(axios =>
|
|
115
|
+
axios.post('/api/v2/robot/inspectPath/delete', data)
|
|
116
|
+
);
|
|
117
|
+
},
|
|
118
|
+
point: {
|
|
119
|
+
list: (pathId: number) => {
|
|
120
|
+
return this.context.ready.then(axios =>
|
|
121
|
+
axios.get(`/api/v2/robot/inspectPathPoint/list/${pathId}`)
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
addList: (data: any) => {
|
|
125
|
+
return this.context.ready.then(axios =>
|
|
126
|
+
axios.post('/api/v2/robot/inspectPathPoint/addList', data)
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
updateList: (data: any) => {
|
|
130
|
+
return this.context.ready.then(axios =>
|
|
131
|
+
axios.post('/api/v2/robot/inspectPathPoint/updateList', data)
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
update: (data: any) => {
|
|
135
|
+
return this.context.ready.then(axios =>
|
|
136
|
+
axios.post('/api/v2/robot/inspectPathPoint/update', data)
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
delete: (id: number) => {
|
|
140
|
+
return this.context.ready.then(axios =>
|
|
141
|
+
axios.post(`/api/v2/robot/inspectPathPoint/delete/${id}`)
|
|
142
|
+
);
|
|
143
|
+
},
|
|
144
|
+
deleteList: (pathId: number) => {
|
|
145
|
+
return this.context.ready.then(axios =>
|
|
146
|
+
axios.post(`/api/v2/robot/inspectPathPoint/deleteList/${pathId}`)
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
69
151
|
}
|
|
70
152
|
}
|