@ningboyz/apis 1.0.16 → 1.0.18
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/index.ts +20 -21
- package/package.json +1 -1
- package/{src → packages}/antv/cnfg.ts +13 -18
- package/{src → packages}/antv/index.ts +1 -0
- package/{src → packages}/antv/main.ts +14 -22
- package/{src → packages}/antv/para.ts +11 -17
- package/packages/antv/type.ts +56 -0
- package/{src → packages}/axios.ts +25 -25
- package/{src → packages}/card/gblb.ts +38 -43
- package/{src → packages}/card/index.ts +1 -0
- package/packages/card/main.ts +210 -0
- package/packages/card/p4pz.ts +93 -0
- package/packages/card/type.ts +570 -0
- package/{src → packages}/card/zcbd.ts +33 -46
- package/{src → packages}/card/zccf.ts +34 -50
- package/{src → packages}/card/zccz.ts +39 -46
- package/packages/card/zcdb.ts +113 -0
- package/{src → packages}/card/zclb.ts +28 -29
- package/{src → packages}/card/zczj.ts +5 -10
- package/{src → packages}/card/zczjProp.ts +5 -12
- package/{src → packages}/cnfg/main.ts +9 -6
- package/{src → packages}/core/dept.ts +35 -52
- package/packages/core/dict.ts +61 -0
- package/{src → packages}/core/index.ts +2 -1
- package/packages/core/laid.ts +75 -0
- package/{src → packages}/core/part.ts +18 -22
- package/{src → packages}/core/path.ts +14 -24
- package/{src → packages}/core/sysbilltype.ts +5 -10
- package/{src → packages}/core/sysclas.ts +3 -7
- package/{src → packages}/core/sysmenu.ts +39 -26
- package/{src/core/tsystravel.ts → packages/core/systravel.ts} +13 -20
- package/{src → packages}/core/type.ts +13 -15
- package/packages/core/types.ts +451 -0
- package/{src → packages}/core/unit.ts +20 -34
- package/packages/core/user.ts +294 -0
- package/{src → packages}/expd/index.ts +1 -0
- package/{src → packages}/expd/main.ts +3 -5
- package/packages/expd/type.ts +8 -0
- package/packages/flow/type.ts +0 -0
- package/{src → packages}/gzjg/gzlm.ts +10 -2
- package/{src → packages}/gzjg/main.ts +8 -0
- package/packages/wtui/ctrl.ts +45 -0
- package/{src → packages}/wtui/form.ts +20 -33
- package/{src → packages}/wtui/item.ts +18 -32
- package/packages/wtui/main.ts +69 -0
- package/packages/wtui/menu.ts +37 -0
- package/packages/wtui/node.ts +37 -0
- package/packages/wtui/todo.ts +60 -0
- package/packages/wtui/type.ts +327 -0
- package/packages/wtui/user.ts +39 -0
- package/{src → packages}/wtui/view.ts +25 -28
- package/{src → packages}/wtui/zone.ts +11 -19
- package/src/card/main.ts +0 -234
- package/src/card/p4pz.ts +0 -145
- package/src/card/zcdb.ts +0 -141
- package/src/core/dict.ts +0 -77
- package/src/core/laid.ts +0 -96
- package/src/core/user.ts +0 -311
- package/src/wtui/ctrl.ts +0 -43
- package/src/wtui/main.ts +0 -65
- package/src/wtui/menu.ts +0 -44
- package/src/wtui/node.ts +0 -66
- package/src/wtui/todo.ts +0 -50
- package/src/wtui/user.ts +0 -33
- /package/{src → packages}/card/form.ts +0 -0
- /package/{src → packages}/cnfg/index.ts +0 -0
- /package/{src → packages}/core/sysenvr.ts +0 -0
- /package/{src → packages}/core/syskjnd.ts +0 -0
- /package/{src → packages}/flow/duty.ts +0 -0
- /package/{src → packages}/flow/flow.ts +0 -0
- /package/{src → packages}/flow/index.ts +0 -0
- /package/{src → packages}/flow/main.ts +0 -0
- /package/{src → packages}/flow/node.ts +0 -0
- /package/{src → packages}/gams/cnfg.ts +0 -0
- /package/{src → packages}/gams/index.ts +0 -0
- /package/{src → packages}/grow/grow.ts +0 -0
- /package/{src → packages}/grow/index.ts +0 -0
- /package/{src → packages}/gzjg/index.ts +0 -0
- /package/{src → packages}/gzjg/types.ts +0 -0
- /package/{src → packages}/gztb/index.ts +0 -0
- /package/{src → packages}/gztb/main.ts +0 -0
- /package/{src → packages}/load/index.ts +0 -0
- /package/{src → packages}/load/yqdw.ts +0 -0
- /package/{src → packages}/load/yqkm.ts +0 -0
- /package/{src → packages}/noti/index.ts +0 -0
- /package/{src → packages}/noti/main.ts +0 -0
- /package/{src → packages}/ocri/index.ts +0 -0
- /package/{src → packages}/ocri/path.ts +0 -0
- /package/{src → packages}/pzpt/cnfg.ts +0 -0
- /package/{src → packages}/pzpt/index.ts +0 -0
- /package/{src → packages}/pzpt/item.ts +0 -0
- /package/{src → packages}/pzpt/k0km.ts +0 -0
- /package/{src → packages}/pzpt/k8km.ts +0 -0
- /package/{src → packages}/pzpt/kbkm.ts +0 -0
- /package/{src → packages}/pzpt/type.ts +0 -0
- /package/{src → packages}/pzpt/yqkb.ts +0 -0
- /package/{src → packages}/pzpt/yqkm.ts +0 -0
- /package/{src → packages}/tabl/index.ts +0 -0
- /package/{src → packages}/tabl/main.ts +0 -0
- /package/{src → packages}/task/index.ts +0 -0
- /package/{src → packages}/task/main.ts +0 -0
- /package/{src → packages}/wldy/data.ts +0 -0
- /package/{src → packages}/wldy/index.ts +0 -0
- /package/{src → packages}/wldy/item.ts +0 -0
- /package/{src → packages}/wldy/page.ts +0 -0
- /package/{src → packages}/wtui/envr.ts +0 -0
- /package/{src → packages}/wtui/index.ts +0 -0
package/index.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import CoreRequest from "./
|
|
2
|
-
import FLowRequest from "./
|
|
3
|
-
import WtuiRequest from "./
|
|
4
|
-
import PzptRequest from "./
|
|
5
|
-
import ExpdRequest from "./
|
|
6
|
-
import GamsRequest from "./
|
|
7
|
-
import WldyRequest from "./
|
|
8
|
-
import GzjgRequest from "./
|
|
9
|
-
import TablRequest from "./
|
|
10
|
-
import CardRequest from "./
|
|
11
|
-
import CnfgRequest from "./
|
|
12
|
-
import LoadRequest from "./
|
|
13
|
-
import OcriRequest from "./
|
|
14
|
-
import GrowRequest from "./
|
|
15
|
-
import TaskRequest from "./
|
|
16
|
-
import GztbRequest from "./
|
|
17
|
-
import AntvRequest from "./
|
|
18
|
-
import NotiRequest from "./
|
|
19
|
-
import { IAxiosConfig } from "./
|
|
20
|
-
|
|
1
|
+
import CoreRequest from "./packages/core";
|
|
2
|
+
import FLowRequest from "./packages/flow";
|
|
3
|
+
import WtuiRequest from "./packages/wtui";
|
|
4
|
+
import PzptRequest from "./packages/pzpt";
|
|
5
|
+
import ExpdRequest from "./packages/expd";
|
|
6
|
+
import GamsRequest from "./packages/gams";
|
|
7
|
+
import WldyRequest from "./packages/wldy";
|
|
8
|
+
import GzjgRequest from "./packages/gzjg";
|
|
9
|
+
import TablRequest from "./packages/tabl";
|
|
10
|
+
import CardRequest from "./packages/card";
|
|
11
|
+
import CnfgRequest from "./packages/cnfg";
|
|
12
|
+
import LoadRequest from "./packages/load";
|
|
13
|
+
import OcriRequest from "./packages/ocri";
|
|
14
|
+
import GrowRequest from "./packages/grow";
|
|
15
|
+
import TaskRequest from "./packages/task";
|
|
16
|
+
import GztbRequest from "./packages/gztb/index";
|
|
17
|
+
import AntvRequest from "./packages/antv/index";
|
|
18
|
+
import NotiRequest from "./packages/noti/index";
|
|
19
|
+
import { IAxiosConfig } from "./packages/axios";
|
|
21
20
|
class Request {
|
|
22
21
|
public static core: CoreRequest;
|
|
23
22
|
public static flow: FLowRequest;
|
|
@@ -60,4 +59,4 @@ class Request {
|
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
export default Request;
|
|
62
|
+
export default Request;
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TAntv } from "@ningboyz/types";
|
|
2
2
|
import type { HttpRequest } from "../axios";
|
|
3
|
+
import { IAntvCnfgDetaildbQuerys, IAntvCnfgSelectdbQuerys } from "./type";
|
|
3
4
|
|
|
4
|
-
class
|
|
5
|
+
class CnfgRequest {
|
|
5
6
|
private httpRequest: HttpRequest;
|
|
6
7
|
constructor(httpRequest: HttpRequest) {
|
|
7
8
|
this.httpRequest = httpRequest;
|
|
@@ -10,43 +11,37 @@ class ParaRequest {
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取数字提取列表
|
|
12
13
|
*/
|
|
13
|
-
selectdb(
|
|
14
|
-
|
|
15
|
-
antvmain
|
|
16
|
-
};
|
|
17
|
-
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/selectdb", undefined, params);
|
|
14
|
+
selectdb(querys: IAntvCnfgSelectdbQuerys) {
|
|
15
|
+
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/selectdb", querys, undefined);
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
* 新增数字提取列表
|
|
22
20
|
*/
|
|
23
|
-
insertdb(
|
|
24
|
-
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/insertdb",
|
|
21
|
+
insertdb(Querys: object) {
|
|
22
|
+
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/insertdb", undefined, Querys);
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* 修改数字提取列表
|
|
29
27
|
*/
|
|
30
|
-
updatedb(
|
|
31
|
-
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/updatedb",
|
|
28
|
+
updatedb(Querys: object) {
|
|
29
|
+
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/updatedb", undefined, Querys);
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
/**
|
|
35
33
|
* 删除数字提取列表
|
|
36
34
|
*/
|
|
37
|
-
deletedb(
|
|
38
|
-
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/deletedb",
|
|
35
|
+
deletedb(Querys: object) {
|
|
36
|
+
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/deletedb", undefined, Querys);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/**
|
|
42
40
|
* 获取数字提取详情列表
|
|
43
41
|
*/
|
|
44
|
-
detaildb(
|
|
45
|
-
|
|
46
|
-
antvmain
|
|
47
|
-
};
|
|
48
|
-
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/detaildb", undefined, params);
|
|
42
|
+
detaildb(querys: IAntvCnfgDetaildbQuerys) {
|
|
43
|
+
return this.httpRequest.post<TAntv.IAntvCnfgResponse[]>("/antv/tcnfg/detaildb", querys, undefined);
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
46
|
|
|
52
|
-
export default
|
|
47
|
+
export default CnfgRequest;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { TAntv } from "@ningboyz/types";
|
|
2
2
|
import type { HttpRequest } from "../axios";
|
|
3
|
+
import { IAntvMainDetaildbQuerys, IAntvMainGet5DataQuerys } from "./type";
|
|
3
4
|
|
|
4
|
-
class
|
|
5
|
+
class MainRequest {
|
|
5
6
|
private httpRequest: HttpRequest;
|
|
6
7
|
constructor(httpRequest: HttpRequest) {
|
|
7
8
|
this.httpRequest = httpRequest;
|
|
@@ -17,46 +18,37 @@ class ParaRequest {
|
|
|
17
18
|
/**
|
|
18
19
|
* 新增数字提取类型列表
|
|
19
20
|
*/
|
|
20
|
-
insertdb(
|
|
21
|
-
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/insertdb",
|
|
21
|
+
insertdb(Querys: object) {
|
|
22
|
+
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/insertdb", undefined, Querys);
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* 修改数字提取类型列表
|
|
26
27
|
*/
|
|
27
|
-
updatedb(
|
|
28
|
-
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/updatedb",
|
|
28
|
+
updatedb(Querys: object) {
|
|
29
|
+
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/updatedb", undefined, Querys);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* 删除数字提取类型列表
|
|
33
34
|
*/
|
|
34
|
-
deletedb(
|
|
35
|
-
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/deletedb",
|
|
35
|
+
deletedb(Querys: object) {
|
|
36
|
+
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/deletedb", undefined, Querys);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
|
-
*
|
|
40
|
+
* 详情数字提取类型列表
|
|
40
41
|
*/
|
|
41
|
-
detaildb(
|
|
42
|
-
|
|
43
|
-
antvmain
|
|
44
|
-
};
|
|
45
|
-
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/detaildb", undefined, params);
|
|
42
|
+
detaildb(querys: IAntvMainDetaildbQuerys) {
|
|
43
|
+
return this.httpRequest.post<TAntv.IAntvMainResponse[]>("/antv/tmain/detaildb", querys, undefined);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* 动态取数
|
|
50
48
|
*/
|
|
51
|
-
get5data(
|
|
52
|
-
|
|
53
|
-
antvname,
|
|
54
|
-
cnfgname,
|
|
55
|
-
unitTypeText,
|
|
56
|
-
...cnfgPara
|
|
57
|
-
};
|
|
58
|
-
return this.httpRequest.post<any>("/gapi/antv/tmain/get5data", undefined, params);
|
|
49
|
+
get5data(querys: IAntvMainGet5DataQuerys) {
|
|
50
|
+
return this.httpRequest.post<any>("/gapi/antv/tmain/get5data", querys, undefined);
|
|
59
51
|
}
|
|
60
52
|
}
|
|
61
53
|
|
|
62
|
-
export default
|
|
54
|
+
export default MainRequest;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TAntv } from "@ningboyz/types";
|
|
2
2
|
import type { HttpRequest } from "../axios";
|
|
3
|
+
import { IAntvParaDetaildbQuerys, IAntvParaSelectdbQuerys } from "./type";
|
|
3
4
|
|
|
4
5
|
class ParaRequest {
|
|
5
6
|
private httpRequest: HttpRequest;
|
|
@@ -10,43 +11,36 @@ class ParaRequest {
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取数字提取参数列表
|
|
12
13
|
*/
|
|
13
|
-
selectdb(
|
|
14
|
-
|
|
15
|
-
antvmain,
|
|
16
|
-
antvcnfg
|
|
17
|
-
};
|
|
18
|
-
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/selectdb", undefined, params);
|
|
14
|
+
selectdb(querys: IAntvParaSelectdbQuerys) {
|
|
15
|
+
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/selectdb", querys, undefined);
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
/**
|
|
22
19
|
* 新增数字提取参数列表
|
|
23
20
|
*/
|
|
24
|
-
insertdb(
|
|
25
|
-
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/insertdb",
|
|
21
|
+
insertdb(Querys: object) {
|
|
22
|
+
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/insertdb", undefined, Querys);
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
/**
|
|
29
26
|
* 修改数字提取参数列表
|
|
30
27
|
*/
|
|
31
|
-
updatedb(
|
|
32
|
-
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/updatedb",
|
|
28
|
+
updatedb(Querys: object) {
|
|
29
|
+
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/updatedb", undefined, Querys);
|
|
33
30
|
}
|
|
34
31
|
|
|
35
32
|
/**
|
|
36
33
|
* 删除数字提取参数列表
|
|
37
34
|
*/
|
|
38
|
-
deletedb(
|
|
39
|
-
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/deletedb",
|
|
35
|
+
deletedb(Querys: object) {
|
|
36
|
+
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/deletedb", undefined, Querys);
|
|
40
37
|
}
|
|
41
38
|
|
|
42
39
|
/**
|
|
43
40
|
* 获取数字提取参数详情列表
|
|
44
41
|
*/
|
|
45
|
-
detaildb(
|
|
46
|
-
|
|
47
|
-
antvmain
|
|
48
|
-
};
|
|
49
|
-
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/detaildb", undefined, params);
|
|
42
|
+
detaildb(querys: IAntvParaDetaildbQuerys) {
|
|
43
|
+
return this.httpRequest.post<TAntv.IAntvParaResponse[]>("/antv/tpara/detaildb", querys, undefined);
|
|
50
44
|
}
|
|
51
45
|
}
|
|
52
46
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** cnfg */
|
|
2
|
+
export interface IAntvCnfgSelectdbQuerys {
|
|
3
|
+
antvmain: number;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export class TAntvCnfgSelectdbQuerys implements IAntvCnfgSelectdbQuerys {
|
|
7
|
+
antvmain: number = -1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IAntvCnfgDetaildbQuerys {
|
|
11
|
+
antvmain: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class TAntvCnfgDetaildbQuerys implements IAntvCnfgDetaildbQuerys {
|
|
15
|
+
antvmain: number = -1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** main */
|
|
19
|
+
export interface IAntvMainDetaildbQuerys {
|
|
20
|
+
antvmain: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export class TAntvMainDetaildbQuerys implements IAntvMainDetaildbQuerys {
|
|
24
|
+
antvmain: number = -1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IAntvMainGet5DataQuerys {
|
|
28
|
+
antvname: string;
|
|
29
|
+
cnfgname: string;
|
|
30
|
+
unittypetext: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class TAntvMainGet5DataQuerys implements IAntvMainGet5DataQuerys {
|
|
34
|
+
antvname: string = "";
|
|
35
|
+
cnfgname: string = "";
|
|
36
|
+
unittypetext: string = "";
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** para */
|
|
40
|
+
export interface IAntvParaSelectdbQuerys {
|
|
41
|
+
antvmain: number;
|
|
42
|
+
antvcnfg: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class TAntvParaSelectdbQuerys implements IAntvParaSelectdbQuerys {
|
|
46
|
+
antvmain: number = -1;
|
|
47
|
+
antvcnfg: number = -1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface IAntvParaDetaildbQuerys {
|
|
51
|
+
antvmain: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export class TAntvParaDetaildbQuerys implements IAntvParaDetaildbQuerys {
|
|
55
|
+
antvmain: number = -1;
|
|
56
|
+
}
|
|
@@ -14,7 +14,7 @@ const initUserInfo = {
|
|
|
14
14
|
whobuild: 0,
|
|
15
15
|
userindx: 0,
|
|
16
16
|
usrtoken: "",
|
|
17
|
-
dbconfig: ""
|
|
17
|
+
dbconfig: ""
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
class HttpRequest {
|
|
@@ -26,20 +26,18 @@ class HttpRequest {
|
|
|
26
26
|
const { baseURL, timeout = 60000, getUserInfo } = config;
|
|
27
27
|
this.instance = axios.create({
|
|
28
28
|
baseURL,
|
|
29
|
-
timeout
|
|
29
|
+
timeout
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
this.instance.interceptors.request.use((request) => {
|
|
33
|
-
const userInfo = !_.isNil(getUserInfo)
|
|
34
|
-
? getUserInfo()
|
|
35
|
-
: new TSessionUserInfo();
|
|
33
|
+
const userInfo = !_.isNil(getUserInfo) ? getUserInfo() : new TSessionUserInfo();
|
|
36
34
|
/** 添加随机数,防止浏览器接口缓存 */
|
|
37
35
|
const time = new Date().getTime() + Math.round(Math.random() * 1000);
|
|
38
36
|
request.params = {
|
|
39
37
|
whobuild: userInfo.whobuild !== 0 ? userInfo.whobuild : undefined,
|
|
40
38
|
userindx: userInfo.userIndx !== 0 ? userInfo.userIndx : undefined,
|
|
41
39
|
...request.params,
|
|
42
|
-
r: time
|
|
40
|
+
r: time
|
|
43
41
|
};
|
|
44
42
|
request.headers.usrtoken = userInfo.usrtoken;
|
|
45
43
|
request.headers.dbconfig = userInfo.dbConfig;
|
|
@@ -47,13 +45,22 @@ class HttpRequest {
|
|
|
47
45
|
});
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
getFormData(data: object) {
|
|
49
|
+
if (data instanceof FormData) {
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
const formData = new FormData();
|
|
53
|
+
formData.append("params", JSON.stringify(data));
|
|
54
|
+
return formData;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get<T>(url: string, querys?: object): Promise<IResponse<T>> {
|
|
51
58
|
return new Promise((resolve, reject) => {
|
|
52
59
|
this.instance
|
|
53
60
|
.request<T>({
|
|
54
61
|
method: this.METHOD_GET,
|
|
55
62
|
url,
|
|
56
|
-
params
|
|
63
|
+
params: querys
|
|
57
64
|
})
|
|
58
65
|
.then((res: AxiosResponse) => {
|
|
59
66
|
resolve(res.data as IResponse<T>);
|
|
@@ -64,22 +71,18 @@ class HttpRequest {
|
|
|
64
71
|
});
|
|
65
72
|
}
|
|
66
73
|
|
|
67
|
-
post<T>(
|
|
68
|
-
url: string,
|
|
69
|
-
data?: object,
|
|
70
|
-
params?: object,
|
|
71
|
-
headers?: object
|
|
72
|
-
): Promise<IResponse<T>> {
|
|
74
|
+
post<T>(url: string, querys?: object, params?: object, headers?: object): Promise<IResponse<T>> {
|
|
73
75
|
return new Promise((resolve, reject) => {
|
|
76
|
+
const data = !_.isNil(params) ? this.getFormData(params) : void 0;
|
|
74
77
|
this.instance
|
|
75
78
|
.request<T>({
|
|
76
79
|
method: this.METHOD_POST,
|
|
77
80
|
url,
|
|
78
|
-
params,
|
|
81
|
+
params: querys,
|
|
79
82
|
data,
|
|
80
83
|
headers: {
|
|
81
|
-
...headers
|
|
82
|
-
}
|
|
84
|
+
...headers
|
|
85
|
+
}
|
|
83
86
|
})
|
|
84
87
|
.then((res: AxiosResponse) => {
|
|
85
88
|
resolve(res.data as IResponse<T>);
|
|
@@ -90,21 +93,18 @@ class HttpRequest {
|
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
postFile<T>(
|
|
94
|
-
url: string,
|
|
95
|
-
data?: object,
|
|
96
|
-
params?: object
|
|
97
|
-
): Promise<IResponse<T>> {
|
|
96
|
+
postFile<T>(url: string, querys?: object, params?: object): Promise<IResponse<T>> {
|
|
98
97
|
return new Promise((resolve, reject) => {
|
|
98
|
+
const data = !_.isNil(params) ? this.getFormData(params) : void 0;
|
|
99
99
|
this.instance
|
|
100
100
|
.request({
|
|
101
101
|
url,
|
|
102
102
|
method: this.METHOD_POST,
|
|
103
|
-
params,
|
|
103
|
+
params: querys,
|
|
104
104
|
data,
|
|
105
105
|
headers: {
|
|
106
|
-
"Content-Type": `multipart/form-data;boundary=${new Date().getTime()}
|
|
107
|
-
}
|
|
106
|
+
"Content-Type": `multipart/form-data;boundary=${new Date().getTime()}`
|
|
107
|
+
}
|
|
108
108
|
})
|
|
109
109
|
.then((res: AxiosResponse) => {
|
|
110
110
|
resolve(res.data as IResponse<T>);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TCard } from "@ningboyz/types";
|
|
2
2
|
import type { HttpRequest } from "../axios";
|
|
3
|
+
import { ICardGblbCheckzclbQuerys, ICardGblbDetaildbQuerys, ICardGblbGet4zclbQuerys, ICardGblbNextYearQuerys, ICardGblbSelectdbQuerys, ICardGblbUploaddbQuerys } from "./type";
|
|
3
4
|
|
|
4
5
|
class GblbRequest {
|
|
5
6
|
private httpRequest: HttpRequest;
|
|
@@ -9,86 +10,83 @@ class GblbRequest {
|
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* 获取国标类别
|
|
13
|
+
* @param querys
|
|
14
|
+
* @returns
|
|
12
15
|
*/
|
|
13
|
-
selectdb(
|
|
14
|
-
|
|
15
|
-
sourcend
|
|
16
|
-
};
|
|
17
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/selectdb", undefined, params);
|
|
16
|
+
selectdb(querys: ICardGblbSelectdbQuerys) {
|
|
17
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/selectdb", querys, undefined);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* 添加国标类别
|
|
22
|
+
* @param params
|
|
23
|
+
* @returns
|
|
22
24
|
*/
|
|
23
|
-
insertdb(
|
|
24
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/insertdb`,
|
|
25
|
+
insertdb(params: object) {
|
|
26
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/insertdb`, undefined, params);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/**
|
|
28
30
|
* 编辑国标类别
|
|
29
|
-
* @param
|
|
31
|
+
* @param params
|
|
30
32
|
*/
|
|
31
|
-
updatedb(
|
|
32
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/updatedb",
|
|
33
|
+
updatedb(params: object) {
|
|
34
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/updatedb", undefined, params);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* 删除国标类别
|
|
37
|
-
* @param
|
|
39
|
+
* @param params
|
|
38
40
|
*/
|
|
39
|
-
deletedb(
|
|
40
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/deletedb",
|
|
41
|
+
deletedb(params: object) {
|
|
42
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/deletedb", undefined, params);
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* 国标类别详情
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @
|
|
47
|
+
* @param querys
|
|
48
|
+
* @param params
|
|
49
|
+
* @returns
|
|
48
50
|
*/
|
|
49
|
-
detaildb(
|
|
50
|
-
|
|
51
|
-
gblbmain,
|
|
52
|
-
sourcend
|
|
53
|
-
};
|
|
54
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/detaildb", data, params);
|
|
51
|
+
detaildb(querys: ICardGblbDetaildbQuerys, params: object) {
|
|
52
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/detaildb", querys, params);
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
/**
|
|
58
56
|
* 导入国标类别
|
|
57
|
+
* @param querys
|
|
58
|
+
* @param params
|
|
59
|
+
* @returns
|
|
59
60
|
*/
|
|
60
|
-
uploaddb(
|
|
61
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/uploaddb`,
|
|
61
|
+
uploaddb(querys: ICardGblbUploaddbQuerys, params: object) {
|
|
62
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/uploaddb`, querys, params);
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
* 判断国标类别关联资产卡片
|
|
66
67
|
* @param data
|
|
67
68
|
*/
|
|
68
|
-
judgedb(
|
|
69
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/judgedb",
|
|
69
|
+
judgedb(params: object) {
|
|
70
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>("/gapi/card/tgblb/judgedb", undefined, params);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* 根据国标类别获取资产类别
|
|
75
|
+
* @param querys
|
|
76
|
+
* @returns
|
|
74
77
|
*/
|
|
75
|
-
get4zclb(
|
|
76
|
-
|
|
77
|
-
gblbmain,
|
|
78
|
-
sourcend
|
|
79
|
-
};
|
|
80
|
-
return this.httpRequest.post<TCard.IZclbResponse[]>(`/gapi/card/tgblb/get4zclb`, undefined, params);
|
|
78
|
+
get4zclb(querys: ICardGblbGet4zclbQuerys) {
|
|
79
|
+
return this.httpRequest.post<TCard.IZclbResponse[]>(`/gapi/card/tgblb/get4zclb`, querys, undefined);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
/**
|
|
84
83
|
* 检查国标类别对应资产类别
|
|
84
|
+
* @param querys
|
|
85
|
+
* @param params
|
|
86
|
+
* @returns
|
|
85
87
|
*/
|
|
86
|
-
checkzclb(
|
|
87
|
-
|
|
88
|
-
zclbtype,
|
|
89
|
-
sourcend
|
|
90
|
-
};
|
|
91
|
-
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/checkzclb`, data, params);
|
|
88
|
+
checkzclb(querys: ICardGblbCheckzclbQuerys, params: object) {
|
|
89
|
+
return this.httpRequest.post<TCard.IGblbResponse[]>(`/gapi/card/tgblb/checkzclb`, querys, params);
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
/**
|
|
@@ -96,11 +94,8 @@ class GblbRequest {
|
|
|
96
94
|
* 结账时,调用该接口,将结账的那条年度传入sourcend
|
|
97
95
|
* 如果跨年度,则调用该接口
|
|
98
96
|
*/
|
|
99
|
-
nextYear(
|
|
100
|
-
|
|
101
|
-
sourcend
|
|
102
|
-
};
|
|
103
|
-
return this.httpRequest.post<TCard.IZclbResponse[]>(`/gapi/card/tgblb/nextyear`, undefined, params);
|
|
97
|
+
nextYear(querys: ICardGblbNextYearQuerys) {
|
|
98
|
+
return this.httpRequest.post<TCard.IZclbResponse[]>(`/gapi/card/tgblb/nextyear`, querys, undefined);
|
|
104
99
|
}
|
|
105
100
|
}
|
|
106
101
|
|