@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,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"assets": "資產",
|
|
3
|
+
"contacts": "聯絡人",
|
|
4
|
+
"cultures": "語言/文化",
|
|
5
|
+
"currencies": "貨幣",
|
|
6
|
+
"customers": "客戶",
|
|
7
|
+
"degreeBachelor": "學士",
|
|
8
|
+
"degreeDoctor": "博士",
|
|
9
|
+
"degreeMaster": "碩士",
|
|
10
|
+
"degreePreBachelor": "副學士",
|
|
11
|
+
"educationHighSchool": "高中",
|
|
12
|
+
"educationHighSchool1": "高中1年級",
|
|
13
|
+
"educationHighSchool2": "高中2年級",
|
|
14
|
+
"educationHighSchool3": "高中3年級",
|
|
15
|
+
"educationMiddleSchool": "初中",
|
|
16
|
+
"educationMiddleSchool1": "初中1年級",
|
|
17
|
+
"educationMiddleSchool2": "初中2年級",
|
|
18
|
+
"educationMiddleSchool3": "初中3年級",
|
|
19
|
+
"educationPrimarySchool": "小學",
|
|
20
|
+
"educationPrimarySchool2": "小學2年級",
|
|
21
|
+
"educationPrimarySchool3": "小學3年級",
|
|
22
|
+
"educationPrimarySchool4": "小學4年級",
|
|
23
|
+
"educationPrimarySchool5": "小學5年級",
|
|
24
|
+
"educationPrimarySchool6": "小學6年級",
|
|
25
|
+
"educationUniversity10": "大學本科畢業且獲得學士學位",
|
|
26
|
+
"educationUniversity12": "研究生畢業(無學位證書)",
|
|
27
|
+
"educationUniversity14": "碩士學位畢業",
|
|
28
|
+
"educationUniversity2": "大專畢業",
|
|
29
|
+
"educationUniversity4": "五大學歷畢業(自考、電大、夜大、黨校、函授)",
|
|
30
|
+
"educationUniversity6": "大學在讀",
|
|
31
|
+
"educationUniversity8": "大學本科畢業(無學士學位)",
|
|
32
|
+
"employees": "員工",
|
|
33
|
+
"idUser": "用戶",
|
|
34
|
+
"isLegalPerson": "是否企業",
|
|
35
|
+
"isOrg": "是否本機構",
|
|
36
|
+
"jobTitle": "職位",
|
|
37
|
+
"latinName": "拼音名",
|
|
38
|
+
"maritalDivorced": "離異",
|
|
39
|
+
"maritalMarried": "已婚",
|
|
40
|
+
"maritalPartnership": "同居伴侶",
|
|
41
|
+
"maritalSeparated": "分居",
|
|
42
|
+
"maritalSingle": "未婚",
|
|
43
|
+
"maritalWidowed": "喪偶",
|
|
44
|
+
"offerings": "產品和服務",
|
|
45
|
+
"orders": "訂單",
|
|
46
|
+
"personBirthday": "生日",
|
|
47
|
+
"personDegree": "學位",
|
|
48
|
+
"personEducation": "學歷",
|
|
49
|
+
"personEthnicity": "民族",
|
|
50
|
+
"personFemale": "女",
|
|
51
|
+
"personGender": "性別",
|
|
52
|
+
"personMale": "男",
|
|
53
|
+
"personMaritalStatus": "婚姻狀況",
|
|
54
|
+
"personName": "名稱 / 姓名",
|
|
55
|
+
"personTitle": "稱謂",
|
|
56
|
+
"personTitleDR": "博士",
|
|
57
|
+
"personTitleMR": "先生",
|
|
58
|
+
"personTitleMRS": "夫人",
|
|
59
|
+
"personTitleMS": "女士",
|
|
60
|
+
"personTitleMiss": "小姐",
|
|
61
|
+
"personTitleProf": "教授",
|
|
62
|
+
"personHeight": "身高 (厘米)",
|
|
63
|
+
"personWeight": "體重 (公斤)",
|
|
64
|
+
"politicalStatus": "政治面貌",
|
|
65
|
+
"profiles": "檔案",
|
|
66
|
+
"products": "產品",
|
|
67
|
+
"purchases": "採購",
|
|
68
|
+
"regions": "國家或地區",
|
|
69
|
+
"reports": "報表",
|
|
70
|
+
"stockIn": "入庫",
|
|
71
|
+
"stockOut": "出庫",
|
|
72
|
+
"system": "系統",
|
|
73
|
+
"suppliers": "供應商"
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./dto/person/AddressItem";
|
|
2
|
+
export * from "./dto/person/CategoryItem";
|
|
3
|
+
export * from "./dto/person/ContactItem";
|
|
4
|
+
export * from "./dto/person/PersonListDto";
|
|
5
|
+
export * from "./dto/person/PersonQueryData";
|
|
6
|
+
export * from "./dto/person/PersonReadDto";
|
|
7
|
+
export * from "./rq/person/PersonListRQ";
|
|
8
|
+
export * from "./rq/person/PersonQueryRQ";
|
|
9
|
+
export * from "./dto/personProfile/PersonProfileKind";
|
|
10
|
+
export * from "./dto/personProfile/PersonProfileListData";
|
|
11
|
+
export * from "./dto/personProfile/PersonProfileQueryData";
|
|
12
|
+
export * from "./dto/personProfile/PersonProfileUpdateReadData";
|
|
13
|
+
export * from "./dto/personProfile/PersonProfileViewData";
|
|
14
|
+
export * from "./rq/personProfile/PersonProfileCreateRQ";
|
|
15
|
+
export * from "./rq/personProfile/PersonProfileListRQ";
|
|
16
|
+
export * from "./rq/personProfile/PersonProfileQueryRQ";
|
|
17
|
+
export * from "./i18n/CrmCulture";
|
|
18
|
+
export * from "./PersonApi";
|
|
19
|
+
export * from "./PersonProfileApi";
|
|
20
|
+
export * from "./CrmApp";
|
package/lib/mjs/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Person
|
|
2
|
+
export * from "./dto/person/AddressItem";
|
|
3
|
+
export * from "./dto/person/CategoryItem";
|
|
4
|
+
export * from "./dto/person/ContactItem";
|
|
5
|
+
export * from "./dto/person/PersonListDto";
|
|
6
|
+
export * from "./dto/person/PersonQueryData";
|
|
7
|
+
export * from "./dto/person/PersonReadDto";
|
|
8
|
+
export * from "./rq/person/PersonListRQ";
|
|
9
|
+
export * from "./rq/person/PersonQueryRQ";
|
|
10
|
+
// PersonProfile
|
|
11
|
+
export * from "./dto/personProfile/PersonProfileKind";
|
|
12
|
+
export * from "./dto/personProfile/PersonProfileListData";
|
|
13
|
+
export * from "./dto/personProfile/PersonProfileQueryData";
|
|
14
|
+
export * from "./dto/personProfile/PersonProfileUpdateReadData";
|
|
15
|
+
export * from "./dto/personProfile/PersonProfileViewData";
|
|
16
|
+
export * from "./rq/personProfile/PersonProfileCreateRQ";
|
|
17
|
+
export * from "./rq/personProfile/PersonProfileListRQ";
|
|
18
|
+
export * from "./rq/personProfile/PersonProfileQueryRQ";
|
|
19
|
+
// i18n
|
|
20
|
+
export * from "./i18n/CrmCulture";
|
|
21
|
+
// APIs
|
|
22
|
+
export * from "./PersonApi";
|
|
23
|
+
export * from "./PersonProfileApi";
|
|
24
|
+
export * from "./CrmApp";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EntityStatus, UserRole } from "@etsoo/appscript";
|
|
2
|
+
import { PersonProfileKind } from "../../dto/personProfile/PersonProfileKind";
|
|
3
|
+
/**
|
|
4
|
+
* Person profile create request data
|
|
5
|
+
* 人员档案创建请求数据
|
|
6
|
+
*/
|
|
7
|
+
export type PersonProfileCreateRQ = {
|
|
8
|
+
/**
|
|
9
|
+
* Person id
|
|
10
|
+
* 人员编号
|
|
11
|
+
*/
|
|
12
|
+
personId: number;
|
|
13
|
+
/**
|
|
14
|
+
* Other participants
|
|
15
|
+
* 其他参与者
|
|
16
|
+
*/
|
|
17
|
+
persons?: number[];
|
|
18
|
+
/**
|
|
19
|
+
* Order / purchase id
|
|
20
|
+
* 订单 / 采购编号
|
|
21
|
+
*/
|
|
22
|
+
orderId?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Kind
|
|
25
|
+
* 类型
|
|
26
|
+
*/
|
|
27
|
+
kind: PersonProfileKind;
|
|
28
|
+
/**
|
|
29
|
+
* Title
|
|
30
|
+
* 标题
|
|
31
|
+
*/
|
|
32
|
+
title: string;
|
|
33
|
+
/**
|
|
34
|
+
* Comment
|
|
35
|
+
* 评论
|
|
36
|
+
*/
|
|
37
|
+
comment: string;
|
|
38
|
+
/**
|
|
39
|
+
* Location
|
|
40
|
+
* 位置
|
|
41
|
+
*/
|
|
42
|
+
location?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Location id
|
|
45
|
+
* 位置编号
|
|
46
|
+
*/
|
|
47
|
+
locationId?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Happen date
|
|
50
|
+
* 发生日期
|
|
51
|
+
*/
|
|
52
|
+
happenDate?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Happen date end
|
|
55
|
+
* 发生日期结束
|
|
56
|
+
*/
|
|
57
|
+
happenDateEnd?: string;
|
|
58
|
+
/**
|
|
59
|
+
* User role for privacy
|
|
60
|
+
* 控制隐私的用户角色
|
|
61
|
+
*/
|
|
62
|
+
userRole?: UserRole;
|
|
63
|
+
/**
|
|
64
|
+
* JSON data
|
|
65
|
+
* JSON 数据
|
|
66
|
+
*/
|
|
67
|
+
data?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Status
|
|
70
|
+
* 状况
|
|
71
|
+
*/
|
|
72
|
+
status: EntityStatus;
|
|
73
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@etsoo/smarterp-crm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript APIs for SmartERP Customer Relationship Management (CRM)",
|
|
5
|
+
"main": "lib/cjs/index.js",
|
|
6
|
+
"module": "lib/mjs/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./lib/mjs/index.d.ts",
|
|
10
|
+
"import": "./lib/mjs/index.js",
|
|
11
|
+
"require": "./lib/cjs/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./components": {
|
|
14
|
+
"types": "./lib/mjs/components/index.d.ts",
|
|
15
|
+
"import": "./lib/mjs/components/index.js",
|
|
16
|
+
"require": "./lib/cjs/components/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
|
|
22
|
+
"test": "vitest",
|
|
23
|
+
"localtest": "set NODE_ENV=local&&vitest"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/ETSOO/etsoo-smarterp-crm.git"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"TypeScript",
|
|
31
|
+
"ETSOO",
|
|
32
|
+
"SmartERP",
|
|
33
|
+
"SmartERP Core APIs",
|
|
34
|
+
"青岛亿速思维",
|
|
35
|
+
"上海亿商",
|
|
36
|
+
"司友云平台",
|
|
37
|
+
"司友云平台核心接口"
|
|
38
|
+
],
|
|
39
|
+
"author": "ETSOO",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"homepage": "https://github.com/ETSOO/etsoo-smarterp-crm#readme",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/cli": "^7.26.4",
|
|
44
|
+
"@babel/core": "^7.26.10",
|
|
45
|
+
"@babel/plugin-transform-runtime": "^7.26.10",
|
|
46
|
+
"@babel/preset-env": "^7.26.9",
|
|
47
|
+
"@babel/runtime-corejs3": "^7.26.10",
|
|
48
|
+
"@types/react": "^18.3.19",
|
|
49
|
+
"@types/react-dom": "^18.3.1",
|
|
50
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
51
|
+
"jsdom": "^26.0.0",
|
|
52
|
+
"typescript": "^5.8.2",
|
|
53
|
+
"vitest": "^3.0.9"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"@etsoo/appscript": "^1.6.19",
|
|
57
|
+
"@etsoo/materialui": "^1.5.2",
|
|
58
|
+
"@etsoo/react": "^1.8.33",
|
|
59
|
+
"@etsoo/shared": "^1.2.63",
|
|
60
|
+
"@mui/material": "^6.4.8",
|
|
61
|
+
"react": "^18.3.1",
|
|
62
|
+
"react-dom": "^18.3.1"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/CrmApp.ts
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { IApi, IApp, IdentityType } from "@etsoo/appscript";
|
|
2
|
+
import { PersonApi } from "./PersonApi";
|
|
3
|
+
import { useRequiredContext } from "@etsoo/react";
|
|
4
|
+
import { IServiceApp, ReactAppContext } from "@etsoo/materialui";
|
|
5
|
+
import { IdentityTypeData } from "./dto/person/ContactItem";
|
|
6
|
+
import { PersonTitle } from "./dto/person/PersonTitle";
|
|
7
|
+
import { ListType } from "@etsoo/shared";
|
|
8
|
+
import { MaritalStatus } from "./dto/person/MaritalStatus";
|
|
9
|
+
import { PersonDegree } from "./dto/person/PersonDegree";
|
|
10
|
+
import { PersonEducation } from "./dto/person/PersonEducation";
|
|
11
|
+
import { PersonProfileApi } from "./PersonProfileApi";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Get CRM app context hook
|
|
15
|
+
* @returns CRM app
|
|
16
|
+
*/
|
|
17
|
+
export function useRequiredCrmContext(): ICrmApp {
|
|
18
|
+
// Get the app context
|
|
19
|
+
const app = useRequiredContext(ReactAppContext) as ICrmServiceApp;
|
|
20
|
+
|
|
21
|
+
// Check the app type
|
|
22
|
+
if ("crm" in app) {
|
|
23
|
+
return app.crm;
|
|
24
|
+
} else {
|
|
25
|
+
return app;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* CRM service app interface
|
|
31
|
+
* CRM 服务应用程序接口
|
|
32
|
+
*/
|
|
33
|
+
export type ICrmServiceApp = IServiceApp & (ICrmApp | { crm: ICrmApp });
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* CRM application interface
|
|
37
|
+
* CRM应用程序接口
|
|
38
|
+
*/
|
|
39
|
+
export interface ICrmApp {
|
|
40
|
+
/**
|
|
41
|
+
* Application
|
|
42
|
+
* 应用程序
|
|
43
|
+
*/
|
|
44
|
+
get app(): IApp;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Person API
|
|
48
|
+
* 人员接口
|
|
49
|
+
*/
|
|
50
|
+
readonly personApi: PersonApi;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Person profile API
|
|
54
|
+
* 人员档案接口
|
|
55
|
+
*/
|
|
56
|
+
readonly personProfileApi: PersonProfileApi;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Get marital status
|
|
60
|
+
* 获取婚姻状况
|
|
61
|
+
* @param status
|
|
62
|
+
*/
|
|
63
|
+
getMaritalStatus(status?: MaritalStatus): string | undefined;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Get marital statuses
|
|
67
|
+
* 获取婚姻状况列表
|
|
68
|
+
* @param status
|
|
69
|
+
*/
|
|
70
|
+
getMaritalStatuses(): ListType[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get person degree
|
|
74
|
+
* 获取人员学历
|
|
75
|
+
* @param degree
|
|
76
|
+
*/
|
|
77
|
+
getPersonDegree(degree?: PersonDegree): string | undefined;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get person degree list
|
|
81
|
+
* 获取人员学历列表
|
|
82
|
+
*/
|
|
83
|
+
getPersonDegrees(): ListType[];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Get person education
|
|
87
|
+
* 获取人员学历
|
|
88
|
+
* @param education
|
|
89
|
+
*/
|
|
90
|
+
getPersonEducation(education?: PersonEducation): string | undefined;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Get person education list
|
|
94
|
+
* 获取人员学历列表
|
|
95
|
+
*/
|
|
96
|
+
getPersonEducations(): ListType[];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Get person gender
|
|
100
|
+
* 获取人员性别
|
|
101
|
+
* @param gender Gender value
|
|
102
|
+
* @returns Label
|
|
103
|
+
*/
|
|
104
|
+
getPersonGender(gender?: string): string | undefined;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Get identity type
|
|
108
|
+
* 获取身份类型
|
|
109
|
+
* @param data Identity type data
|
|
110
|
+
*/
|
|
111
|
+
getIdentityType(data?: IdentityTypeData): string;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get person title
|
|
115
|
+
* 获取人员头衔
|
|
116
|
+
* @param title
|
|
117
|
+
*/
|
|
118
|
+
getPersonTitle(title?: PersonTitle): string | undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get person titles
|
|
122
|
+
* 获取人员头衔
|
|
123
|
+
*/
|
|
124
|
+
getPersonTitles(): ListType[];
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* CRM application
|
|
129
|
+
* CRM应用程序
|
|
130
|
+
*/
|
|
131
|
+
export class CrmApp implements ICrmApp {
|
|
132
|
+
private _personApi?: PersonApi;
|
|
133
|
+
/**
|
|
134
|
+
* Person API
|
|
135
|
+
* 人员接口
|
|
136
|
+
*/
|
|
137
|
+
get personApi() {
|
|
138
|
+
return (this._personApi ??= new PersonApi(this.app, this.api));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
private _personProfileApi?: PersonProfileApi;
|
|
142
|
+
/**
|
|
143
|
+
* Person profile API
|
|
144
|
+
* 人员档案接口
|
|
145
|
+
*/
|
|
146
|
+
get personProfileApi() {
|
|
147
|
+
return (this._personProfileApi ??= new PersonProfileApi(
|
|
148
|
+
this.app,
|
|
149
|
+
this.api
|
|
150
|
+
));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Constructor
|
|
155
|
+
* 构造函数
|
|
156
|
+
* @param app Base application
|
|
157
|
+
* @param api API
|
|
158
|
+
*/
|
|
159
|
+
constructor(public readonly app: IApp, public readonly api: IApi) {}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Get person gender
|
|
163
|
+
* 获取人员性别
|
|
164
|
+
* @param gender Gender value
|
|
165
|
+
* @returns Label
|
|
166
|
+
*/
|
|
167
|
+
getPersonGender(gender?: string) {
|
|
168
|
+
if (gender === "M") return this.app.get("personMale") ?? "Male";
|
|
169
|
+
else if (gender === "F") return this.app.get("personFemale") ?? "Female";
|
|
170
|
+
else return undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Get identity type
|
|
175
|
+
* 获取身份类型
|
|
176
|
+
* @param data Identity type data
|
|
177
|
+
*/
|
|
178
|
+
getIdentityType(data?: IdentityTypeData) {
|
|
179
|
+
if (data == null) return "";
|
|
180
|
+
|
|
181
|
+
if (data.isOrg) {
|
|
182
|
+
return this.app.get("org")!;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const type = data.identityType;
|
|
186
|
+
return this.app
|
|
187
|
+
.getEnumList(IdentityType, "id", (id, _key) => {
|
|
188
|
+
if ((id & type) > 0) return id;
|
|
189
|
+
})
|
|
190
|
+
.map((d) => d.label)
|
|
191
|
+
.join(", ");
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Get marital status
|
|
196
|
+
* 获取婚姻状况
|
|
197
|
+
* @param status
|
|
198
|
+
*/
|
|
199
|
+
getMaritalStatus(status?: MaritalStatus) {
|
|
200
|
+
if (status == null) return undefined;
|
|
201
|
+
const key = MaritalStatus[status];
|
|
202
|
+
return this.app.get("marital" + key) ?? key;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Get marital statuses
|
|
207
|
+
* 获取婚姻状况列表
|
|
208
|
+
* @param status
|
|
209
|
+
*/
|
|
210
|
+
getMaritalStatuses() {
|
|
211
|
+
return this.app.getEnumList(MaritalStatus, "marital");
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Get person degree
|
|
216
|
+
* 获取人员学历
|
|
217
|
+
* @param degree
|
|
218
|
+
*/
|
|
219
|
+
getPersonDegree(degree?: PersonDegree) {
|
|
220
|
+
if (degree == null) return undefined;
|
|
221
|
+
const key = PersonDegree[degree];
|
|
222
|
+
return this.app.get("degree" + key) ?? key;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get person degree list
|
|
227
|
+
* 获取人员学历列表
|
|
228
|
+
*/
|
|
229
|
+
getPersonDegrees() {
|
|
230
|
+
return this.app.getEnumList(PersonDegree, "degree");
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get person education
|
|
235
|
+
* 获取人员学历
|
|
236
|
+
* @param education
|
|
237
|
+
*/
|
|
238
|
+
getPersonEducation(education?: PersonEducation) {
|
|
239
|
+
if (education == null) return undefined;
|
|
240
|
+
const key = PersonEducation[education];
|
|
241
|
+
return this.app.get("education" + key) ?? key;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Get person education list
|
|
246
|
+
* 获取人员学历列表
|
|
247
|
+
*/
|
|
248
|
+
getPersonEducations() {
|
|
249
|
+
return this.app.getEnumList(PersonEducation, "education");
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Get person title
|
|
254
|
+
* 获取人员头衔
|
|
255
|
+
* @param title
|
|
256
|
+
*/
|
|
257
|
+
getPersonTitle(title?: PersonTitle) {
|
|
258
|
+
if (title == null) return undefined;
|
|
259
|
+
const key = PersonTitle[title];
|
|
260
|
+
return this.app.get("personTitle" + key) ?? key;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Get person titles
|
|
265
|
+
* 获取人员头衔
|
|
266
|
+
*/
|
|
267
|
+
getPersonTitles() {
|
|
268
|
+
return this.app.getEnumList(PersonTitle, "personTitle");
|
|
269
|
+
}
|
|
270
|
+
}
|
package/src/PersonApi.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* Person API
|
|
10
|
+
*/
|
|
11
|
+
export class PersonApi extends EntityApi {
|
|
12
|
+
/**
|
|
13
|
+
* Constructor
|
|
14
|
+
* @param app Application
|
|
15
|
+
* @param api API
|
|
16
|
+
*/
|
|
17
|
+
constructor(app: IApp, api: IApi = app.api) {
|
|
18
|
+
super("Person", app, api);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* List
|
|
23
|
+
* @param rq Request data
|
|
24
|
+
* @param payload Payload
|
|
25
|
+
* @returns Result
|
|
26
|
+
*/
|
|
27
|
+
list(rq: PersonListRQ, payload: IApiPayload<PersonListDto[]>) {
|
|
28
|
+
return this.listBase(rq, payload);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Query
|
|
33
|
+
* @param rq Request data
|
|
34
|
+
* @param payload Payload
|
|
35
|
+
* @returns Result
|
|
36
|
+
*/
|
|
37
|
+
query(rq: PersonQueryRQ, payload?: IApiPayload<PersonQueryData[]>) {
|
|
38
|
+
return this.queryBase(rq, payload);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Read
|
|
43
|
+
* @param id Id
|
|
44
|
+
* @param payload Payload
|
|
45
|
+
* @returns Result
|
|
46
|
+
*/
|
|
47
|
+
read(id: number, payload?: IApiPayload<PersonViewData>) {
|
|
48
|
+
return this.readBase(id, payload);
|
|
49
|
+
}
|
|
50
|
+
}
|