@etsoo/smarterp-crm 1.0.0
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/.gitattributes +2 -0
- package/.github/workflows/main.yml +60 -0
- package/LICENSE +21 -0
- package/README.md +17 -0
- package/__tests__/PersonApi.ts +15 -0
- package/__tests__/app/TestApp.ts +139 -0
- package/__tests__/tsconfig.json +20 -0
- package/babel.config.json +11 -0
- package/lib/cjs/CrmApp.d.ts +186 -0
- package/lib/cjs/CrmApp.js +170 -0
- package/lib/cjs/PersonApi.d.ts +38 -0
- package/lib/cjs/PersonApi.js +45 -0
- package/lib/cjs/PersonProfileApi.d.ts +54 -0
- package/lib/cjs/PersonProfileApi.js +63 -0
- package/lib/cjs/components/index.d.ts +1 -0
- package/lib/cjs/components/index.js +18 -0
- package/lib/cjs/components/person/PersonTiplist.d.ts +28 -0
- package/lib/cjs/components/person/PersonTiplist.js +27 -0
- package/lib/cjs/dto/person/AddressItem.d.ts +36 -0
- package/lib/cjs/dto/person/AddressItem.js +12 -0
- package/lib/cjs/dto/person/CategoryItem.d.ts +16 -0
- package/lib/cjs/dto/person/CategoryItem.js +2 -0
- package/lib/cjs/dto/person/ContactItem.d.ts +30 -0
- package/lib/cjs/dto/person/ContactItem.js +2 -0
- package/lib/cjs/dto/person/MaritalStatus.d.ts +36 -0
- package/lib/cjs/dto/person/MaritalStatus.js +40 -0
- package/lib/cjs/dto/person/PersonDegree.d.ts +26 -0
- package/lib/cjs/dto/person/PersonDegree.js +30 -0
- package/lib/cjs/dto/person/PersonEducation.d.ts +111 -0
- package/lib/cjs/dto/person/PersonEducation.js +115 -0
- package/lib/cjs/dto/person/PersonListDto.d.ts +6 -0
- package/lib/cjs/dto/person/PersonListDto.js +2 -0
- package/lib/cjs/dto/person/PersonQueryData.d.ts +24 -0
- package/lib/cjs/dto/person/PersonQueryData.js +2 -0
- package/lib/cjs/dto/person/PersonReadDto.d.ts +206 -0
- package/lib/cjs/dto/person/PersonReadDto.js +2 -0
- package/lib/cjs/dto/person/PersonTitle.d.ts +36 -0
- package/lib/cjs/dto/person/PersonTitle.js +40 -0
- package/lib/cjs/dto/personProfile/PersonProfileKind.d.ts +26 -0
- package/lib/cjs/dto/personProfile/PersonProfileKind.js +30 -0
- package/lib/cjs/dto/personProfile/PersonProfileListData.d.ts +16 -0
- package/lib/cjs/dto/personProfile/PersonProfileListData.js +2 -0
- package/lib/cjs/dto/personProfile/PersonProfileQueryData.d.ts +43 -0
- package/lib/cjs/dto/personProfile/PersonProfileQueryData.js +2 -0
- package/lib/cjs/dto/personProfile/PersonProfileUpdateReadData.d.ts +73 -0
- package/lib/cjs/dto/personProfile/PersonProfileUpdateReadData.js +2 -0
- package/lib/cjs/dto/personProfile/PersonProfileViewData.d.ts +5 -0
- package/lib/cjs/dto/personProfile/PersonProfileViewData.js +2 -0
- package/lib/cjs/i18n/CrmCulture.d.ts +244 -0
- package/lib/cjs/i18n/CrmCulture.js +23 -0
- package/lib/cjs/i18n/en.json +74 -0
- package/lib/cjs/i18n/zh-Hans.json +74 -0
- package/lib/cjs/i18n/zh-Hant.json +74 -0
- package/lib/cjs/index.d.ts +20 -0
- package/lib/cjs/index.js +40 -0
- package/lib/cjs/rq/person/PersonListRQ.d.ts +6 -0
- package/lib/cjs/rq/person/PersonListRQ.js +2 -0
- package/lib/cjs/rq/person/PersonQueryRQ.d.ts +6 -0
- package/lib/cjs/rq/person/PersonQueryRQ.js +2 -0
- package/lib/cjs/rq/personProfile/PersonProfileCreateRQ.d.ts +73 -0
- package/lib/cjs/rq/personProfile/PersonProfileCreateRQ.js +2 -0
- package/lib/cjs/rq/personProfile/PersonProfileListRQ.d.ts +48 -0
- package/lib/cjs/rq/personProfile/PersonProfileListRQ.js +2 -0
- package/lib/cjs/rq/personProfile/PersonProfileQueryRQ.d.ts +12 -0
- package/lib/cjs/rq/personProfile/PersonProfileQueryRQ.js +2 -0
- package/lib/mjs/CrmApp.d.ts +186 -0
- package/lib/mjs/CrmApp.js +165 -0
- package/lib/mjs/PersonApi.d.ts +38 -0
- package/lib/mjs/PersonApi.js +41 -0
- package/lib/mjs/PersonProfileApi.d.ts +54 -0
- package/lib/mjs/PersonProfileApi.js +59 -0
- package/lib/mjs/components/index.d.ts +1 -0
- package/lib/mjs/components/index.js +2 -0
- package/lib/mjs/components/person/PersonTiplist.d.ts +28 -0
- package/lib/mjs/components/person/PersonTiplist.js +24 -0
- package/lib/mjs/dto/person/AddressItem.d.ts +36 -0
- package/lib/mjs/dto/person/AddressItem.js +11 -0
- package/lib/mjs/dto/person/CategoryItem.d.ts +16 -0
- package/lib/mjs/dto/person/CategoryItem.js +1 -0
- package/lib/mjs/dto/person/ContactItem.d.ts +30 -0
- package/lib/mjs/dto/person/ContactItem.js +1 -0
- package/lib/mjs/dto/person/MaritalStatus.d.ts +36 -0
- package/lib/mjs/dto/person/MaritalStatus.js +37 -0
- package/lib/mjs/dto/person/PersonDegree.d.ts +26 -0
- package/lib/mjs/dto/person/PersonDegree.js +27 -0
- package/lib/mjs/dto/person/PersonEducation.d.ts +111 -0
- package/lib/mjs/dto/person/PersonEducation.js +112 -0
- package/lib/mjs/dto/person/PersonListDto.d.ts +6 -0
- package/lib/mjs/dto/person/PersonListDto.js +1 -0
- package/lib/mjs/dto/person/PersonQueryData.d.ts +24 -0
- package/lib/mjs/dto/person/PersonQueryData.js +1 -0
- package/lib/mjs/dto/person/PersonReadDto.d.ts +206 -0
- package/lib/mjs/dto/person/PersonReadDto.js +1 -0
- package/lib/mjs/dto/person/PersonTitle.d.ts +36 -0
- package/lib/mjs/dto/person/PersonTitle.js +37 -0
- package/lib/mjs/dto/personProfile/PersonProfileKind.d.ts +26 -0
- package/lib/mjs/dto/personProfile/PersonProfileKind.js +27 -0
- package/lib/mjs/dto/personProfile/PersonProfileListData.d.ts +16 -0
- package/lib/mjs/dto/personProfile/PersonProfileListData.js +1 -0
- package/lib/mjs/dto/personProfile/PersonProfileQueryData.d.ts +43 -0
- package/lib/mjs/dto/personProfile/PersonProfileQueryData.js +1 -0
- package/lib/mjs/dto/personProfile/PersonProfileUpdateReadData.d.ts +73 -0
- package/lib/mjs/dto/personProfile/PersonProfileUpdateReadData.js +1 -0
- package/lib/mjs/dto/personProfile/PersonProfileViewData.d.ts +5 -0
- package/lib/mjs/dto/personProfile/PersonProfileViewData.js +1 -0
- package/lib/mjs/i18n/CrmCulture.d.ts +460 -0
- package/lib/mjs/i18n/CrmCulture.js +20 -0
- package/lib/mjs/i18n/en.json +74 -0
- package/lib/mjs/i18n/zh-Hans.json +74 -0
- package/lib/mjs/i18n/zh-Hant.json +74 -0
- package/lib/mjs/index.d.ts +20 -0
- package/lib/mjs/index.js +24 -0
- package/lib/mjs/rq/person/PersonListRQ.d.ts +6 -0
- package/lib/mjs/rq/person/PersonListRQ.js +1 -0
- package/lib/mjs/rq/person/PersonQueryRQ.d.ts +6 -0
- package/lib/mjs/rq/person/PersonQueryRQ.js +1 -0
- package/lib/mjs/rq/personProfile/PersonProfileCreateRQ.d.ts +73 -0
- package/lib/mjs/rq/personProfile/PersonProfileCreateRQ.js +1 -0
- package/lib/mjs/rq/personProfile/PersonProfileListRQ.d.ts +48 -0
- package/lib/mjs/rq/personProfile/PersonProfileListRQ.js +1 -0
- package/lib/mjs/rq/personProfile/PersonProfileQueryRQ.d.ts +12 -0
- package/lib/mjs/rq/personProfile/PersonProfileQueryRQ.js +1 -0
- package/package.json +64 -0
- package/src/CrmApp.ts +270 -0
- package/src/PersonApi.ts +50 -0
- package/src/PersonProfileApi.ts +81 -0
- package/src/components/index.ts +2 -0
- package/src/components/person/PersonTiplist.tsx +75 -0
- package/src/dto/person/AddressItem.ts +39 -0
- package/src/dto/person/CategoryItem.ts +17 -0
- package/src/dto/person/ContactItem.ts +38 -0
- package/src/dto/person/MaritalStatus.ts +41 -0
- package/src/dto/person/PersonDegree.ts +29 -0
- package/src/dto/person/PersonEducation.ts +131 -0
- package/src/dto/person/PersonListDto.ts +7 -0
- package/src/dto/person/PersonQueryData.ts +28 -0
- package/src/dto/person/PersonReadDto.ts +242 -0
- package/src/dto/person/PersonTitle.ts +41 -0
- package/src/dto/personProfile/PersonProfileKind.ts +29 -0
- package/src/dto/personProfile/PersonProfileListData.ts +17 -0
- package/src/dto/personProfile/PersonProfileQueryData.ts +50 -0
- package/src/dto/personProfile/PersonProfileUpdateReadData.ts +86 -0
- package/src/dto/personProfile/PersonProfileViewData.ts +5 -0
- package/src/i18n/CrmCulture.ts +21 -0
- package/src/i18n/en.json +74 -0
- package/src/i18n/zh-Hans.json +74 -0
- package/src/i18n/zh-Hant.json +74 -0
- package/src/index.ts +30 -0
- package/src/rq/person/PersonListRQ.ts +7 -0
- package/src/rq/person/PersonQueryRQ.ts +7 -0
- package/src/rq/personProfile/PersonProfileCreateRQ.ts +86 -0
- package/src/rq/personProfile/PersonProfileListRQ.ts +56 -0
- package/src/rq/personProfile/PersonProfileQueryRQ.ts +13 -0
- package/tsconfig.cjs.json +20 -0
- package/tsconfig.json +20 -0
- package/vite.config.mts +12 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { QueryRQ } from "@etsoo/appscript";
|
|
2
|
+
import { PersonProfileKind } from "../../dto/personProfile/PersonProfileKind";
|
|
3
|
+
/**
|
|
4
|
+
* Person profile list request data
|
|
5
|
+
* 人员档案列表请求数据
|
|
6
|
+
*/
|
|
7
|
+
export type PersonProfileListRQ = QueryRQ & {
|
|
8
|
+
/**
|
|
9
|
+
* Core user id who created the profile
|
|
10
|
+
* 创建档案的核心用户id
|
|
11
|
+
*/
|
|
12
|
+
coreUserId?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Person id
|
|
15
|
+
* 人员编号
|
|
16
|
+
*/
|
|
17
|
+
personId?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Kind
|
|
20
|
+
* 类型
|
|
21
|
+
*/
|
|
22
|
+
kind?: PersonProfileKind;
|
|
23
|
+
/**
|
|
24
|
+
* Order / PO id
|
|
25
|
+
* 订单 / 采购编号
|
|
26
|
+
*/
|
|
27
|
+
orderId?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Happen date start
|
|
30
|
+
* 发生日期开始
|
|
31
|
+
*/
|
|
32
|
+
happenDateStart?: string | Date;
|
|
33
|
+
/**
|
|
34
|
+
* Happen date end
|
|
35
|
+
* 发生日期结束
|
|
36
|
+
*/
|
|
37
|
+
happenDateEnd?: string | Date;
|
|
38
|
+
/**
|
|
39
|
+
* Creation start
|
|
40
|
+
* 登记日期开始
|
|
41
|
+
*/
|
|
42
|
+
creationStart?: string | Date;
|
|
43
|
+
/**
|
|
44
|
+
* Creation end
|
|
45
|
+
* 登记日期结束
|
|
46
|
+
*/
|
|
47
|
+
creationEnd?: string | Date;
|
|
48
|
+
};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { IApi, IApp } from "@etsoo/appscript";
|
|
2
|
+
import { PersonApi } from "./PersonApi";
|
|
3
|
+
import { IServiceApp } from "@etsoo/materialui";
|
|
4
|
+
import { IdentityTypeData } from "./dto/person/ContactItem";
|
|
5
|
+
import { PersonTitle } from "./dto/person/PersonTitle";
|
|
6
|
+
import { ListType } from "@etsoo/shared";
|
|
7
|
+
import { MaritalStatus } from "./dto/person/MaritalStatus";
|
|
8
|
+
import { PersonDegree } from "./dto/person/PersonDegree";
|
|
9
|
+
import { PersonEducation } from "./dto/person/PersonEducation";
|
|
10
|
+
import { PersonProfileApi } from "./PersonProfileApi";
|
|
11
|
+
/**
|
|
12
|
+
* Get CRM app context hook
|
|
13
|
+
* @returns CRM app
|
|
14
|
+
*/
|
|
15
|
+
export declare function useRequiredCrmContext(): ICrmApp;
|
|
16
|
+
/**
|
|
17
|
+
* CRM service app interface
|
|
18
|
+
* CRM 服务应用程序接口
|
|
19
|
+
*/
|
|
20
|
+
export type ICrmServiceApp = IServiceApp & (ICrmApp | {
|
|
21
|
+
crm: ICrmApp;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* CRM application interface
|
|
25
|
+
* CRM应用程序接口
|
|
26
|
+
*/
|
|
27
|
+
export interface ICrmApp {
|
|
28
|
+
/**
|
|
29
|
+
* Application
|
|
30
|
+
* 应用程序
|
|
31
|
+
*/
|
|
32
|
+
get app(): IApp;
|
|
33
|
+
/**
|
|
34
|
+
* Person API
|
|
35
|
+
* 人员接口
|
|
36
|
+
*/
|
|
37
|
+
readonly personApi: PersonApi;
|
|
38
|
+
/**
|
|
39
|
+
* Person profile API
|
|
40
|
+
* 人员档案接口
|
|
41
|
+
*/
|
|
42
|
+
readonly personProfileApi: PersonProfileApi;
|
|
43
|
+
/**
|
|
44
|
+
* Get marital status
|
|
45
|
+
* 获取婚姻状况
|
|
46
|
+
* @param status
|
|
47
|
+
*/
|
|
48
|
+
getMaritalStatus(status?: MaritalStatus): string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Get marital statuses
|
|
51
|
+
* 获取婚姻状况列表
|
|
52
|
+
* @param status
|
|
53
|
+
*/
|
|
54
|
+
getMaritalStatuses(): ListType[];
|
|
55
|
+
/**
|
|
56
|
+
* Get person degree
|
|
57
|
+
* 获取人员学历
|
|
58
|
+
* @param degree
|
|
59
|
+
*/
|
|
60
|
+
getPersonDegree(degree?: PersonDegree): string | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Get person degree list
|
|
63
|
+
* 获取人员学历列表
|
|
64
|
+
*/
|
|
65
|
+
getPersonDegrees(): ListType[];
|
|
66
|
+
/**
|
|
67
|
+
* Get person education
|
|
68
|
+
* 获取人员学历
|
|
69
|
+
* @param education
|
|
70
|
+
*/
|
|
71
|
+
getPersonEducation(education?: PersonEducation): string | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Get person education list
|
|
74
|
+
* 获取人员学历列表
|
|
75
|
+
*/
|
|
76
|
+
getPersonEducations(): ListType[];
|
|
77
|
+
/**
|
|
78
|
+
* Get person gender
|
|
79
|
+
* 获取人员性别
|
|
80
|
+
* @param gender Gender value
|
|
81
|
+
* @returns Label
|
|
82
|
+
*/
|
|
83
|
+
getPersonGender(gender?: string): string | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Get identity type
|
|
86
|
+
* 获取身份类型
|
|
87
|
+
* @param data Identity type data
|
|
88
|
+
*/
|
|
89
|
+
getIdentityType(data?: IdentityTypeData): string;
|
|
90
|
+
/**
|
|
91
|
+
* Get person title
|
|
92
|
+
* 获取人员头衔
|
|
93
|
+
* @param title
|
|
94
|
+
*/
|
|
95
|
+
getPersonTitle(title?: PersonTitle): string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* Get person titles
|
|
98
|
+
* 获取人员头衔
|
|
99
|
+
*/
|
|
100
|
+
getPersonTitles(): ListType[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* CRM application
|
|
104
|
+
* CRM应用程序
|
|
105
|
+
*/
|
|
106
|
+
export declare class CrmApp implements ICrmApp {
|
|
107
|
+
readonly app: IApp;
|
|
108
|
+
readonly api: IApi;
|
|
109
|
+
private _personApi?;
|
|
110
|
+
/**
|
|
111
|
+
* Person API
|
|
112
|
+
* 人员接口
|
|
113
|
+
*/
|
|
114
|
+
get personApi(): PersonApi;
|
|
115
|
+
private _personProfileApi?;
|
|
116
|
+
/**
|
|
117
|
+
* Person profile API
|
|
118
|
+
* 人员档案接口
|
|
119
|
+
*/
|
|
120
|
+
get personProfileApi(): PersonProfileApi;
|
|
121
|
+
/**
|
|
122
|
+
* Constructor
|
|
123
|
+
* 构造函数
|
|
124
|
+
* @param app Base application
|
|
125
|
+
* @param api API
|
|
126
|
+
*/
|
|
127
|
+
constructor(app: IApp, api: IApi);
|
|
128
|
+
/**
|
|
129
|
+
* Get person gender
|
|
130
|
+
* 获取人员性别
|
|
131
|
+
* @param gender Gender value
|
|
132
|
+
* @returns Label
|
|
133
|
+
*/
|
|
134
|
+
getPersonGender(gender?: string): string | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Get identity type
|
|
137
|
+
* 获取身份类型
|
|
138
|
+
* @param data Identity type data
|
|
139
|
+
*/
|
|
140
|
+
getIdentityType(data?: IdentityTypeData): string;
|
|
141
|
+
/**
|
|
142
|
+
* Get marital status
|
|
143
|
+
* 获取婚姻状况
|
|
144
|
+
* @param status
|
|
145
|
+
*/
|
|
146
|
+
getMaritalStatus(status?: MaritalStatus): string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Get marital statuses
|
|
149
|
+
* 获取婚姻状况列表
|
|
150
|
+
* @param status
|
|
151
|
+
*/
|
|
152
|
+
getMaritalStatuses(): ListType[];
|
|
153
|
+
/**
|
|
154
|
+
* Get person degree
|
|
155
|
+
* 获取人员学历
|
|
156
|
+
* @param degree
|
|
157
|
+
*/
|
|
158
|
+
getPersonDegree(degree?: PersonDegree): string | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* Get person degree list
|
|
161
|
+
* 获取人员学历列表
|
|
162
|
+
*/
|
|
163
|
+
getPersonDegrees(): ListType[];
|
|
164
|
+
/**
|
|
165
|
+
* Get person education
|
|
166
|
+
* 获取人员学历
|
|
167
|
+
* @param education
|
|
168
|
+
*/
|
|
169
|
+
getPersonEducation(education?: PersonEducation): string | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Get person education list
|
|
172
|
+
* 获取人员学历列表
|
|
173
|
+
*/
|
|
174
|
+
getPersonEducations(): ListType[];
|
|
175
|
+
/**
|
|
176
|
+
* Get person title
|
|
177
|
+
* 获取人员头衔
|
|
178
|
+
* @param title
|
|
179
|
+
*/
|
|
180
|
+
getPersonTitle(title?: PersonTitle): string | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Get person titles
|
|
183
|
+
* 获取人员头衔
|
|
184
|
+
*/
|
|
185
|
+
getPersonTitles(): ListType[];
|
|
186
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { IdentityType } from "@etsoo/appscript";
|
|
2
|
+
import { PersonApi } from "./PersonApi";
|
|
3
|
+
import { useRequiredContext } from "@etsoo/react";
|
|
4
|
+
import { ReactAppContext } from "@etsoo/materialui";
|
|
5
|
+
import { PersonTitle } from "./dto/person/PersonTitle";
|
|
6
|
+
import { MaritalStatus } from "./dto/person/MaritalStatus";
|
|
7
|
+
import { PersonDegree } from "./dto/person/PersonDegree";
|
|
8
|
+
import { PersonEducation } from "./dto/person/PersonEducation";
|
|
9
|
+
import { PersonProfileApi } from "./PersonProfileApi";
|
|
10
|
+
/**
|
|
11
|
+
* Get CRM app context hook
|
|
12
|
+
* @returns CRM app
|
|
13
|
+
*/
|
|
14
|
+
export function useRequiredCrmContext() {
|
|
15
|
+
// Get the app context
|
|
16
|
+
const app = useRequiredContext(ReactAppContext);
|
|
17
|
+
// Check the app type
|
|
18
|
+
if ("crm" in app) {
|
|
19
|
+
return app.crm;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return app;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* CRM application
|
|
27
|
+
* CRM应用程序
|
|
28
|
+
*/
|
|
29
|
+
export class CrmApp {
|
|
30
|
+
app;
|
|
31
|
+
api;
|
|
32
|
+
_personApi;
|
|
33
|
+
/**
|
|
34
|
+
* Person API
|
|
35
|
+
* 人员接口
|
|
36
|
+
*/
|
|
37
|
+
get personApi() {
|
|
38
|
+
return (this._personApi ??= new PersonApi(this.app, this.api));
|
|
39
|
+
}
|
|
40
|
+
_personProfileApi;
|
|
41
|
+
/**
|
|
42
|
+
* Person profile API
|
|
43
|
+
* 人员档案接口
|
|
44
|
+
*/
|
|
45
|
+
get personProfileApi() {
|
|
46
|
+
return (this._personProfileApi ??= new PersonProfileApi(this.app, this.api));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Constructor
|
|
50
|
+
* 构造函数
|
|
51
|
+
* @param app Base application
|
|
52
|
+
* @param api API
|
|
53
|
+
*/
|
|
54
|
+
constructor(app, api) {
|
|
55
|
+
this.app = app;
|
|
56
|
+
this.api = api;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get person gender
|
|
60
|
+
* 获取人员性别
|
|
61
|
+
* @param gender Gender value
|
|
62
|
+
* @returns Label
|
|
63
|
+
*/
|
|
64
|
+
getPersonGender(gender) {
|
|
65
|
+
if (gender === "M")
|
|
66
|
+
return this.app.get("personMale") ?? "Male";
|
|
67
|
+
else if (gender === "F")
|
|
68
|
+
return this.app.get("personFemale") ?? "Female";
|
|
69
|
+
else
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get identity type
|
|
74
|
+
* 获取身份类型
|
|
75
|
+
* @param data Identity type data
|
|
76
|
+
*/
|
|
77
|
+
getIdentityType(data) {
|
|
78
|
+
if (data == null)
|
|
79
|
+
return "";
|
|
80
|
+
if (data.isOrg) {
|
|
81
|
+
return this.app.get("org");
|
|
82
|
+
}
|
|
83
|
+
const type = data.identityType;
|
|
84
|
+
return this.app
|
|
85
|
+
.getEnumList(IdentityType, "id", (id, _key) => {
|
|
86
|
+
if ((id & type) > 0)
|
|
87
|
+
return id;
|
|
88
|
+
})
|
|
89
|
+
.map((d) => d.label)
|
|
90
|
+
.join(", ");
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get marital status
|
|
94
|
+
* 获取婚姻状况
|
|
95
|
+
* @param status
|
|
96
|
+
*/
|
|
97
|
+
getMaritalStatus(status) {
|
|
98
|
+
if (status == null)
|
|
99
|
+
return undefined;
|
|
100
|
+
const key = MaritalStatus[status];
|
|
101
|
+
return this.app.get("marital" + key) ?? key;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get marital statuses
|
|
105
|
+
* 获取婚姻状况列表
|
|
106
|
+
* @param status
|
|
107
|
+
*/
|
|
108
|
+
getMaritalStatuses() {
|
|
109
|
+
return this.app.getEnumList(MaritalStatus, "marital");
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get person degree
|
|
113
|
+
* 获取人员学历
|
|
114
|
+
* @param degree
|
|
115
|
+
*/
|
|
116
|
+
getPersonDegree(degree) {
|
|
117
|
+
if (degree == null)
|
|
118
|
+
return undefined;
|
|
119
|
+
const key = PersonDegree[degree];
|
|
120
|
+
return this.app.get("degree" + key) ?? key;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get person degree list
|
|
124
|
+
* 获取人员学历列表
|
|
125
|
+
*/
|
|
126
|
+
getPersonDegrees() {
|
|
127
|
+
return this.app.getEnumList(PersonDegree, "degree");
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Get person education
|
|
131
|
+
* 获取人员学历
|
|
132
|
+
* @param education
|
|
133
|
+
*/
|
|
134
|
+
getPersonEducation(education) {
|
|
135
|
+
if (education == null)
|
|
136
|
+
return undefined;
|
|
137
|
+
const key = PersonEducation[education];
|
|
138
|
+
return this.app.get("education" + key) ?? key;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Get person education list
|
|
142
|
+
* 获取人员学历列表
|
|
143
|
+
*/
|
|
144
|
+
getPersonEducations() {
|
|
145
|
+
return this.app.getEnumList(PersonEducation, "education");
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Get person title
|
|
149
|
+
* 获取人员头衔
|
|
150
|
+
* @param title
|
|
151
|
+
*/
|
|
152
|
+
getPersonTitle(title) {
|
|
153
|
+
if (title == null)
|
|
154
|
+
return undefined;
|
|
155
|
+
const key = PersonTitle[title];
|
|
156
|
+
return this.app.get("personTitle" + key) ?? key;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Get person titles
|
|
160
|
+
* 获取人员头衔
|
|
161
|
+
*/
|
|
162
|
+
getPersonTitles() {
|
|
163
|
+
return this.app.getEnumList(PersonTitle, "personTitle");
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EntityApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
|
|
2
|
+
import { PersonListRQ } from "./rq/person/PersonListRQ";
|
|
3
|
+
import { PersonQueryRQ } from "./rq/person/PersonQueryRQ";
|
|
4
|
+
import { PersonListDto } from "./dto/person/PersonListDto";
|
|
5
|
+
import { PersonQueryData } from "./dto/person/PersonQueryData";
|
|
6
|
+
import { PersonViewData } from "./dto/person/PersonReadDto";
|
|
7
|
+
/**
|
|
8
|
+
* Person API
|
|
9
|
+
*/
|
|
10
|
+
export declare class PersonApi extends EntityApi {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor
|
|
13
|
+
* @param app Application
|
|
14
|
+
* @param api API
|
|
15
|
+
*/
|
|
16
|
+
constructor(app: IApp, api?: IApi);
|
|
17
|
+
/**
|
|
18
|
+
* List
|
|
19
|
+
* @param rq Request data
|
|
20
|
+
* @param payload Payload
|
|
21
|
+
* @returns Result
|
|
22
|
+
*/
|
|
23
|
+
list(rq: PersonListRQ, payload: IApiPayload<PersonListDto[]>): Promise<PersonListDto[] | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Query
|
|
26
|
+
* @param rq Request data
|
|
27
|
+
* @param payload Payload
|
|
28
|
+
* @returns Result
|
|
29
|
+
*/
|
|
30
|
+
query(rq: PersonQueryRQ, payload?: IApiPayload<PersonQueryData[]>): Promise<PersonQueryData[] | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Read
|
|
33
|
+
* @param id Id
|
|
34
|
+
* @param payload Payload
|
|
35
|
+
* @returns Result
|
|
36
|
+
*/
|
|
37
|
+
read(id: number, payload?: IApiPayload<PersonViewData>): Promise<PersonViewData | undefined>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EntityApi } from "@etsoo/appscript";
|
|
2
|
+
/**
|
|
3
|
+
* Person API
|
|
4
|
+
*/
|
|
5
|
+
export class PersonApi extends EntityApi {
|
|
6
|
+
/**
|
|
7
|
+
* Constructor
|
|
8
|
+
* @param app Application
|
|
9
|
+
* @param api API
|
|
10
|
+
*/
|
|
11
|
+
constructor(app, api = app.api) {
|
|
12
|
+
super("Person", app, api);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* List
|
|
16
|
+
* @param rq Request data
|
|
17
|
+
* @param payload Payload
|
|
18
|
+
* @returns Result
|
|
19
|
+
*/
|
|
20
|
+
list(rq, payload) {
|
|
21
|
+
return this.listBase(rq, payload);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Query
|
|
25
|
+
* @param rq Request data
|
|
26
|
+
* @param payload Payload
|
|
27
|
+
* @returns Result
|
|
28
|
+
*/
|
|
29
|
+
query(rq, payload) {
|
|
30
|
+
return this.queryBase(rq, payload);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Read
|
|
34
|
+
* @param id Id
|
|
35
|
+
* @param payload Payload
|
|
36
|
+
* @returns Result
|
|
37
|
+
*/
|
|
38
|
+
read(id, payload) {
|
|
39
|
+
return this.readBase(id, payload);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EntityApi, IApi, IApiPayload, IApp, IdResultPayload } from "@etsoo/appscript";
|
|
2
|
+
import { PersonProfileListData } from "./dto/personProfile/PersonProfileListData";
|
|
3
|
+
import { PersonProfileListRQ } from "./rq/personProfile/PersonProfileListRQ";
|
|
4
|
+
import { PersonProfileQueryRQ } from "./rq/personProfile/PersonProfileQueryRQ";
|
|
5
|
+
import { PersonProfileUpdateReadData } from "./dto/personProfile/PersonProfileUpdateReadData";
|
|
6
|
+
import { PersonProfileQueryData } from "./dto/personProfile/PersonProfileQueryData";
|
|
7
|
+
import { PersonProfileViewData } from "./dto/personProfile/PersonProfileViewData";
|
|
8
|
+
import { PersonProfileCreateRQ } from "./rq/personProfile/PersonProfileCreateRQ";
|
|
9
|
+
/**
|
|
10
|
+
* Person profile API
|
|
11
|
+
*/
|
|
12
|
+
export declare class PersonProfileApi extends EntityApi {
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param app Application
|
|
16
|
+
* @param api API
|
|
17
|
+
*/
|
|
18
|
+
constructor(app: IApp, api?: IApi);
|
|
19
|
+
/**
|
|
20
|
+
* Create
|
|
21
|
+
* @param rq Request data
|
|
22
|
+
* @param payload Payload
|
|
23
|
+
* @returns Result
|
|
24
|
+
*/
|
|
25
|
+
create(rq: PersonProfileCreateRQ, payload?: IdResultPayload): Promise<import("@etsoo/shared").IdActionResult | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* List
|
|
28
|
+
* @param rq Request data
|
|
29
|
+
* @param payload Payload
|
|
30
|
+
* @returns Result
|
|
31
|
+
*/
|
|
32
|
+
list(rq: PersonProfileListRQ, payload: IApiPayload<PersonProfileListData[]>): Promise<PersonProfileListData[] | undefined>;
|
|
33
|
+
/**
|
|
34
|
+
* Query
|
|
35
|
+
* @param rq Request data
|
|
36
|
+
* @param payload Payload
|
|
37
|
+
* @returns Result
|
|
38
|
+
*/
|
|
39
|
+
query(rq: PersonProfileQueryRQ, payload?: IApiPayload<PersonProfileQueryData[]>): Promise<PersonProfileQueryData[] | undefined>;
|
|
40
|
+
/**
|
|
41
|
+
* Read
|
|
42
|
+
* @param id Id
|
|
43
|
+
* @param payload Payload
|
|
44
|
+
* @returns Result
|
|
45
|
+
*/
|
|
46
|
+
read(id: number, payload?: IApiPayload<PersonProfileViewData>): Promise<PersonProfileViewData | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Update read
|
|
49
|
+
* @param id Id
|
|
50
|
+
* @param payload Payload
|
|
51
|
+
* @returns Result
|
|
52
|
+
*/
|
|
53
|
+
updateRead(id: number, payload?: IApiPayload<PersonProfileUpdateReadData>): Promise<PersonProfileUpdateReadData | undefined>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { EntityApi } from "@etsoo/appscript";
|
|
2
|
+
/**
|
|
3
|
+
* Person profile API
|
|
4
|
+
*/
|
|
5
|
+
export class PersonProfileApi extends EntityApi {
|
|
6
|
+
/**
|
|
7
|
+
* Constructor
|
|
8
|
+
* @param app Application
|
|
9
|
+
* @param api API
|
|
10
|
+
*/
|
|
11
|
+
constructor(app, api = app.api) {
|
|
12
|
+
super("PersonProfile", app, api);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create
|
|
16
|
+
* @param rq Request data
|
|
17
|
+
* @param payload Payload
|
|
18
|
+
* @returns Result
|
|
19
|
+
*/
|
|
20
|
+
create(rq, payload) {
|
|
21
|
+
return this.createBase(rq, payload);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List
|
|
25
|
+
* @param rq Request data
|
|
26
|
+
* @param payload Payload
|
|
27
|
+
* @returns Result
|
|
28
|
+
*/
|
|
29
|
+
list(rq, payload) {
|
|
30
|
+
return this.listBase(rq, payload);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Query
|
|
34
|
+
* @param rq Request data
|
|
35
|
+
* @param payload Payload
|
|
36
|
+
* @returns Result
|
|
37
|
+
*/
|
|
38
|
+
query(rq, payload) {
|
|
39
|
+
return this.queryBase(rq, payload);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Read
|
|
43
|
+
* @param id Id
|
|
44
|
+
* @param payload Payload
|
|
45
|
+
* @returns Result
|
|
46
|
+
*/
|
|
47
|
+
read(id, payload) {
|
|
48
|
+
return this.readBase(id, payload);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Update read
|
|
52
|
+
* @param id Id
|
|
53
|
+
* @param payload Payload
|
|
54
|
+
* @returns Result
|
|
55
|
+
*/
|
|
56
|
+
updateRead(id, payload) {
|
|
57
|
+
return this.updateReadBase(id, payload);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./person/PersonTiplist";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TiplistProps } from "@etsoo/materialui";
|
|
2
|
+
import { PersonListDto } from "../../dto/person/PersonListDto";
|
|
3
|
+
import { PersonListRQ } from "../../rq/person/PersonListRQ";
|
|
4
|
+
/**
|
|
5
|
+
* Person tiplist properties
|
|
6
|
+
* 人员提示列表属性
|
|
7
|
+
*/
|
|
8
|
+
export type PersonTiplistProps = Omit<TiplistProps<PersonListDto, "id">, "loadData" | "label" | "name"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Label
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Name
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Default request data
|
|
19
|
+
*/
|
|
20
|
+
rq?: Partial<PersonListRQ>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Person tiplist
|
|
24
|
+
* 人员提示列表
|
|
25
|
+
* @param props Properties
|
|
26
|
+
* @returns Component
|
|
27
|
+
*/
|
|
28
|
+
export declare function PersonTiplist(props: PersonTiplistProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Tiplist } from "@etsoo/materialui";
|
|
3
|
+
import { useRequiredCrmContext } from "../../CrmApp";
|
|
4
|
+
/**
|
|
5
|
+
* Person tiplist
|
|
6
|
+
* 人员提示列表
|
|
7
|
+
* @param props Properties
|
|
8
|
+
* @returns Component
|
|
9
|
+
*/
|
|
10
|
+
export function PersonTiplist(props) {
|
|
11
|
+
// CRM app
|
|
12
|
+
const crm = useRequiredCrmContext();
|
|
13
|
+
// Destruct
|
|
14
|
+
const { fullWidth = true, label = crm.app.get("user"), maxItems = 10, getOptionLabel = (data) => data.name, name = "personId", rq = { enabled: true }, ...rest } = props;
|
|
15
|
+
// Layout
|
|
16
|
+
return (_jsx(Tiplist, { label: label, getOptionLabel: getOptionLabel, name: name, fullWidth: fullWidth, maxItems: maxItems, loadData: (keyword, id, maxItems) => crm.personApi.list({
|
|
17
|
+
...rq,
|
|
18
|
+
keyword,
|
|
19
|
+
id,
|
|
20
|
+
queryPaging: {
|
|
21
|
+
batchSize: maxItems
|
|
22
|
+
}
|
|
23
|
+
}, { showLoading: false, defaultValue: [] }), ...rest }));
|
|
24
|
+
}
|