@cpzxrobot/sdk 1.2.99 → 1.3.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.
- package/dist/index.js +8 -0
- package/dist/user_gateway.js +8 -2
- package/index.ts +8 -0
- package/package.json +1 -1
- package/user_gateway.ts +13 -2
package/dist/index.js
CHANGED
|
@@ -302,6 +302,14 @@ class Cpzxrobot {
|
|
|
302
302
|
// 检查当前域名是否在本地开发域名列表中
|
|
303
303
|
return localDomains.includes(domain);
|
|
304
304
|
}
|
|
305
|
+
setTitle(title) {
|
|
306
|
+
if (this.platform) {
|
|
307
|
+
this.platform.setTitle(title);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
console.warn("platform not ready, title will be set later");
|
|
311
|
+
}
|
|
312
|
+
}
|
|
305
313
|
}
|
|
306
314
|
exports.Cpzxrobot = Cpzxrobot;
|
|
307
315
|
Cpzxrobot.factorySelectorLoaded = false;
|
package/dist/user_gateway.js
CHANGED
|
@@ -13,8 +13,8 @@ class UserGateway extends Object {
|
|
|
13
13
|
async selectUnit(unit) {
|
|
14
14
|
if ((typeof unit === "string") || (typeof unit === "number")) {
|
|
15
15
|
var axios = await this.context.ready;
|
|
16
|
-
|
|
17
|
-
this.context.platform.setSelectedUnit(
|
|
16
|
+
var resp = await this.context.unit.get(unit);
|
|
17
|
+
this.context.platform.setSelectedUnit(resp.data);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
this.context.platform.setSelectedUnit(unit);
|
|
@@ -275,6 +275,12 @@ class UserGateway extends Object {
|
|
|
275
275
|
}
|
|
276
276
|
});
|
|
277
277
|
});
|
|
278
|
+
},
|
|
279
|
+
// 任务审核功能
|
|
280
|
+
approve: (params) => {
|
|
281
|
+
return this.context.ready.then((axios) => {
|
|
282
|
+
return axios.post('/api/v2/coremde-sale/task/approve', params);
|
|
283
|
+
});
|
|
278
284
|
}
|
|
279
285
|
};
|
|
280
286
|
}
|
package/index.ts
CHANGED
|
@@ -311,6 +311,14 @@ export class Cpzxrobot {
|
|
|
311
311
|
// 检查当前域名是否在本地开发域名列表中
|
|
312
312
|
return localDomains.includes(domain);
|
|
313
313
|
}
|
|
314
|
+
|
|
315
|
+
setTitle(title: string) {
|
|
316
|
+
if (this.platform) {
|
|
317
|
+
this.platform.setTitle(title);
|
|
318
|
+
} else {
|
|
319
|
+
console.warn("platform not ready, title will be set later");
|
|
320
|
+
}
|
|
321
|
+
}
|
|
314
322
|
}
|
|
315
323
|
|
|
316
324
|
export default function (
|
package/package.json
CHANGED
package/user_gateway.ts
CHANGED
|
@@ -16,8 +16,8 @@ export class UserGateway extends Object {
|
|
|
16
16
|
public async selectUnit(unit: Unit | String | Number) {
|
|
17
17
|
if ((typeof unit === "string") || (typeof unit === "number")) {
|
|
18
18
|
var axios = await this.context.ready;
|
|
19
|
-
|
|
20
|
-
this.context.platform.setSelectedUnit(
|
|
19
|
+
var resp = await this.context.unit.get(unit);
|
|
20
|
+
this.context.platform.setSelectedUnit(resp.data);
|
|
21
21
|
} else {
|
|
22
22
|
this.context.platform.setSelectedUnit(unit);
|
|
23
23
|
}
|
|
@@ -321,6 +321,17 @@ export class UserGateway extends Object {
|
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
});
|
|
324
|
+
},
|
|
325
|
+
// 任务审核功能
|
|
326
|
+
approve: (params: {
|
|
327
|
+
taskId: number,
|
|
328
|
+
taskType: string,
|
|
329
|
+
approveResult: number,
|
|
330
|
+
approveNotes?: string
|
|
331
|
+
}) => {
|
|
332
|
+
return this.context.ready.then((axios) => {
|
|
333
|
+
return axios.post('/api/v2/coremde-sale/task/approve', params);
|
|
334
|
+
});
|
|
324
335
|
}
|
|
325
336
|
}
|
|
326
337
|
}
|