@cpzxrobot/sdk 1.3.67 → 1.3.69
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/company_gateway.ts +15 -0
- package/dist/company_gateway.js +14 -0
- package/dist/user_gateway.js +3 -2
- package/package.json +1 -1
- package/types.d.ts +1 -0
- package/user_gateway.ts +4 -2
package/company_gateway.ts
CHANGED
|
@@ -37,6 +37,21 @@ export class CompanyGateway extends Object {
|
|
|
37
37
|
return axios.get(`/api/v2/company/delete?id=${id}`);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
get data() {
|
|
41
|
+
return {
|
|
42
|
+
export: async (companyId: string, supplier?: string, startDate?: string, endDate?: string) => {
|
|
43
|
+
var axios = await this.context.ready;
|
|
44
|
+
return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
|
|
45
|
+
params: {
|
|
46
|
+
supplier,
|
|
47
|
+
startDate,
|
|
48
|
+
endDate
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
40
55
|
get rank() {
|
|
41
56
|
return {
|
|
42
57
|
byRevenue: async () => {
|
package/dist/company_gateway.js
CHANGED
|
@@ -30,6 +30,20 @@ class CompanyGateway extends Object {
|
|
|
30
30
|
var axios = await this.context.ready;
|
|
31
31
|
return axios.get(`/api/v2/company/delete?id=${id}`);
|
|
32
32
|
}
|
|
33
|
+
get data() {
|
|
34
|
+
return {
|
|
35
|
+
export: async (companyId, supplier, startDate, endDate) => {
|
|
36
|
+
var axios = await this.context.ready;
|
|
37
|
+
return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
|
|
38
|
+
params: {
|
|
39
|
+
supplier,
|
|
40
|
+
startDate,
|
|
41
|
+
endDate
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
33
47
|
get rank() {
|
|
34
48
|
return {
|
|
35
49
|
byRevenue: async () => {
|
package/dist/user_gateway.js
CHANGED
|
@@ -19,11 +19,12 @@ class UserGateway extends Object {
|
|
|
19
19
|
this.context.platform.setSelectedUnit(unit);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
async factories() {
|
|
22
|
+
async factories(userId = 0) {
|
|
23
23
|
var selectedFarm = await this.context.user.getSelectedFarm();
|
|
24
24
|
var axios = await this.context.ready;
|
|
25
25
|
return axios.post('/api/v1/user/factories', {
|
|
26
|
-
selected_factory: selectedFarm
|
|
26
|
+
selected_factory: selectedFarm,
|
|
27
|
+
user_id: userId,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
//获得当前用户选择的单元
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
package/user_gateway.ts
CHANGED
|
@@ -22,11 +22,13 @@ export class UserGateway extends Object {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
public async factories() {
|
|
25
|
+
public async factories(userId: number = 0) {
|
|
26
26
|
var selectedFarm = await this.context.user.getSelectedFarm()
|
|
27
27
|
var axios = await this.context.ready;
|
|
28
|
+
|
|
28
29
|
return axios.post('/api/v1/user/factories', {
|
|
29
|
-
selected_factory: selectedFarm
|
|
30
|
+
selected_factory: selectedFarm,
|
|
31
|
+
user_id: userId,
|
|
30
32
|
})
|
|
31
33
|
}
|
|
32
34
|
|