@etsoo/smarterp-core 1.0.0 → 1.0.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.
Files changed (187) hide show
  1. package/__tests__/tsconfig.json +13 -12
  2. package/lib/{mjs/AppApi.js → AppApi.js} +1 -1
  3. package/lib/{mjs/CoreApp.d.ts → CoreApp.d.ts} +12 -7
  4. package/lib/{mjs/CoreApp.js → CoreApp.js} +22 -6
  5. package/lib/{mjs/PublicApi.js → PublicApi.js} +2 -2
  6. package/lib/{mjs/UserApi.js → UserApi.js} +1 -1
  7. package/lib/components/index.d.ts +1 -0
  8. package/lib/components/index.js +2 -0
  9. package/lib/components/org/OrgTiplist.d.ts +36 -0
  10. package/lib/components/org/OrgTiplist.js +22 -0
  11. package/lib/dto/org/OrgListDto.d.ts +12 -0
  12. package/lib/{cjs/i18n → i18n}/en.json +10 -0
  13. package/lib/{mjs/i18n → i18n}/zh-Hans.json +10 -0
  14. package/lib/{mjs/i18n → i18n}/zh-Hant.json +10 -0
  15. package/package.json +18 -8
  16. package/src/AppApi.ts +1 -1
  17. package/src/CoreApp.ts +16 -7
  18. package/src/components/index.ts +2 -0
  19. package/src/components/org/OrgTiplist.tsx +73 -0
  20. package/src/dto/org/OrgListDto.ts +7 -1
  21. package/src/i18n/en.json +10 -0
  22. package/src/i18n/zh-Hans.json +10 -0
  23. package/src/i18n/zh-Hant.json +10 -0
  24. package/tsconfig.json +6 -5
  25. package/lib/cjs/AppApi.js +0 -54
  26. package/lib/cjs/CoreApp.d.ts +0 -58
  27. package/lib/cjs/CoreApp.js +0 -68
  28. package/lib/cjs/MemberApi.js +0 -45
  29. package/lib/cjs/OrgApi.js +0 -110
  30. package/lib/cjs/PublicApi.js +0 -143
  31. package/lib/cjs/UserApi.js +0 -68
  32. package/lib/cjs/dto/IdentityType.js +0 -25
  33. package/lib/cjs/dto/app/AppData.js +0 -2
  34. package/lib/cjs/dto/app/AppListDto.js +0 -2
  35. package/lib/cjs/dto/app/AppPurchasedQueryData.js +0 -2
  36. package/lib/cjs/dto/app/AppQueryData.js +0 -2
  37. package/lib/cjs/dto/member/MemberListDto.js +0 -2
  38. package/lib/cjs/dto/member/MemberQueryDto.js +0 -2
  39. package/lib/cjs/dto/org/OrgGetMyData.js +0 -2
  40. package/lib/cjs/dto/org/OrgListDto.d.ts +0 -6
  41. package/lib/cjs/dto/org/OrgListDto.js +0 -2
  42. package/lib/cjs/dto/org/OrgQueryDto.js +0 -2
  43. package/lib/cjs/dto/org/OrgReadDto.js +0 -2
  44. package/lib/cjs/dto/org/OrgUpdateReadDto.js +0 -2
  45. package/lib/cjs/dto/public/CurrencyItem.js +0 -2
  46. package/lib/cjs/dto/public/PlaceCommon.js +0 -2
  47. package/lib/cjs/dto/public/PlaceLocation.js +0 -2
  48. package/lib/cjs/dto/public/RegionData.js +0 -2
  49. package/lib/cjs/dto/user/AuditHistoryDto.js +0 -2
  50. package/lib/cjs/dto/user/DeviceListDto.js +0 -2
  51. package/lib/cjs/i18n/CoreCulture.js +0 -52
  52. package/lib/cjs/i18n/zh-Hans.json +0 -40
  53. package/lib/cjs/i18n/zh-Hant.json +0 -40
  54. package/lib/cjs/index.js +0 -59
  55. package/lib/cjs/rq/app/AppGetMyRQ.js +0 -2
  56. package/lib/cjs/rq/app/AppListRQ.js +0 -2
  57. package/lib/cjs/rq/app/AppPurchasedQueryRQ.js +0 -2
  58. package/lib/cjs/rq/app/AppQueryRQ.js +0 -2
  59. package/lib/cjs/rq/member/MemberListRQ.js +0 -2
  60. package/lib/cjs/rq/member/MemberQueryRQ.js +0 -2
  61. package/lib/cjs/rq/org/OrgCreateRQ.js +0 -2
  62. package/lib/cjs/rq/org/OrgGetMyRQ.js +0 -2
  63. package/lib/cjs/rq/org/OrgListRQ.js +0 -2
  64. package/lib/cjs/rq/org/OrgQueryRQ.js +0 -2
  65. package/lib/cjs/rq/org/OrgUpdateRQ.js +0 -2
  66. package/lib/cjs/rq/public/CreateBarcodeRQ.js +0 -2
  67. package/lib/cjs/rq/public/PinyinRQ.js +0 -21
  68. package/lib/cjs/rq/public/PlaceQueryRQ.js +0 -21
  69. package/lib/cjs/rq/user/AuditHistoryRQ.js +0 -2
  70. package/lib/mjs/AppApi.d.ts +0 -48
  71. package/lib/mjs/MemberApi.d.ts +0 -38
  72. package/lib/mjs/OrgApi.d.ts +0 -95
  73. package/lib/mjs/PublicApi.d.ts +0 -105
  74. package/lib/mjs/UserApi.d.ts +0 -53
  75. package/lib/mjs/dto/IdentityType.d.ts +0 -21
  76. package/lib/mjs/dto/app/AppData.d.ts +0 -31
  77. package/lib/mjs/dto/app/AppListDto.d.ts +0 -6
  78. package/lib/mjs/dto/app/AppPurchasedQueryData.d.ts +0 -28
  79. package/lib/mjs/dto/app/AppQueryData.d.ts +0 -42
  80. package/lib/mjs/dto/member/MemberListDto.d.ts +0 -6
  81. package/lib/mjs/dto/member/MemberQueryDto.d.ts +0 -35
  82. package/lib/mjs/dto/org/OrgGetMyData.d.ts +0 -21
  83. package/lib/mjs/dto/org/OrgListDto.d.ts +0 -6
  84. package/lib/mjs/dto/org/OrgQueryDto.d.ts +0 -39
  85. package/lib/mjs/dto/org/OrgReadDto.d.ts +0 -47
  86. package/lib/mjs/dto/org/OrgUpdateReadDto.d.ts +0 -39
  87. package/lib/mjs/dto/public/CurrencyItem.d.ts +0 -31
  88. package/lib/mjs/dto/public/PlaceCommon.d.ts +0 -43
  89. package/lib/mjs/dto/public/PlaceLocation.d.ts +0 -14
  90. package/lib/mjs/dto/public/RegionData.d.ts +0 -36
  91. package/lib/mjs/dto/user/AuditHistoryDto.d.ts +0 -26
  92. package/lib/mjs/dto/user/DeviceListDto.d.ts +0 -8
  93. package/lib/mjs/i18n/CoreCulture.d.ts +0 -44
  94. package/lib/mjs/i18n/en.json +0 -40
  95. package/lib/mjs/index.d.ts +0 -39
  96. package/lib/mjs/rq/app/AppGetMyRQ.d.ts +0 -19
  97. package/lib/mjs/rq/app/AppListRQ.d.ts +0 -18
  98. package/lib/mjs/rq/app/AppPurchasedQueryRQ.d.ts +0 -17
  99. package/lib/mjs/rq/app/AppQueryRQ.d.ts +0 -6
  100. package/lib/mjs/rq/member/MemberListRQ.d.ts +0 -18
  101. package/lib/mjs/rq/member/MemberQueryRQ.d.ts +0 -10
  102. package/lib/mjs/rq/org/OrgCreateRQ.d.ts +0 -37
  103. package/lib/mjs/rq/org/OrgGetMyRQ.d.ts +0 -11
  104. package/lib/mjs/rq/org/OrgListRQ.d.ts +0 -12
  105. package/lib/mjs/rq/org/OrgQueryRQ.d.ts +0 -11
  106. package/lib/mjs/rq/org/OrgUpdateRQ.d.ts +0 -37
  107. package/lib/mjs/rq/public/CreateBarcodeRQ.d.ts +0 -56
  108. package/lib/mjs/rq/public/PinyinRQ.d.ts +0 -38
  109. package/lib/mjs/rq/public/PlaceQueryRQ.d.ts +0 -58
  110. package/lib/mjs/rq/user/AuditHistoryRQ.d.ts +0 -19
  111. package/tsconfig.cjs.json +0 -19
  112. /package/lib/{cjs/AppApi.d.ts → AppApi.d.ts} +0 -0
  113. /package/lib/{cjs/MemberApi.d.ts → MemberApi.d.ts} +0 -0
  114. /package/lib/{mjs/MemberApi.js → MemberApi.js} +0 -0
  115. /package/lib/{cjs/OrgApi.d.ts → OrgApi.d.ts} +0 -0
  116. /package/lib/{mjs/OrgApi.js → OrgApi.js} +0 -0
  117. /package/lib/{cjs/PublicApi.d.ts → PublicApi.d.ts} +0 -0
  118. /package/lib/{cjs/UserApi.d.ts → UserApi.d.ts} +0 -0
  119. /package/lib/{cjs/dto → dto}/IdentityType.d.ts +0 -0
  120. /package/lib/{mjs/dto → dto}/IdentityType.js +0 -0
  121. /package/lib/{cjs/dto → dto}/app/AppData.d.ts +0 -0
  122. /package/lib/{mjs/dto → dto}/app/AppData.js +0 -0
  123. /package/lib/{cjs/dto → dto}/app/AppListDto.d.ts +0 -0
  124. /package/lib/{mjs/dto → dto}/app/AppListDto.js +0 -0
  125. /package/lib/{cjs/dto → dto}/app/AppPurchasedQueryData.d.ts +0 -0
  126. /package/lib/{mjs/dto → dto}/app/AppPurchasedQueryData.js +0 -0
  127. /package/lib/{cjs/dto → dto}/app/AppQueryData.d.ts +0 -0
  128. /package/lib/{mjs/dto → dto}/app/AppQueryData.js +0 -0
  129. /package/lib/{cjs/dto → dto}/member/MemberListDto.d.ts +0 -0
  130. /package/lib/{mjs/dto → dto}/member/MemberListDto.js +0 -0
  131. /package/lib/{cjs/dto → dto}/member/MemberQueryDto.d.ts +0 -0
  132. /package/lib/{mjs/dto → dto}/member/MemberQueryDto.js +0 -0
  133. /package/lib/{cjs/dto → dto}/org/OrgGetMyData.d.ts +0 -0
  134. /package/lib/{mjs/dto → dto}/org/OrgGetMyData.js +0 -0
  135. /package/lib/{mjs/dto → dto}/org/OrgListDto.js +0 -0
  136. /package/lib/{cjs/dto → dto}/org/OrgQueryDto.d.ts +0 -0
  137. /package/lib/{mjs/dto → dto}/org/OrgQueryDto.js +0 -0
  138. /package/lib/{cjs/dto → dto}/org/OrgReadDto.d.ts +0 -0
  139. /package/lib/{mjs/dto → dto}/org/OrgReadDto.js +0 -0
  140. /package/lib/{cjs/dto → dto}/org/OrgUpdateReadDto.d.ts +0 -0
  141. /package/lib/{mjs/dto → dto}/org/OrgUpdateReadDto.js +0 -0
  142. /package/lib/{cjs/dto → dto}/public/CurrencyItem.d.ts +0 -0
  143. /package/lib/{mjs/dto → dto}/public/CurrencyItem.js +0 -0
  144. /package/lib/{cjs/dto → dto}/public/PlaceCommon.d.ts +0 -0
  145. /package/lib/{mjs/dto → dto}/public/PlaceCommon.js +0 -0
  146. /package/lib/{cjs/dto → dto}/public/PlaceLocation.d.ts +0 -0
  147. /package/lib/{mjs/dto → dto}/public/PlaceLocation.js +0 -0
  148. /package/lib/{cjs/dto → dto}/public/RegionData.d.ts +0 -0
  149. /package/lib/{mjs/dto → dto}/public/RegionData.js +0 -0
  150. /package/lib/{cjs/dto → dto}/user/AuditHistoryDto.d.ts +0 -0
  151. /package/lib/{mjs/dto → dto}/user/AuditHistoryDto.js +0 -0
  152. /package/lib/{cjs/dto → dto}/user/DeviceListDto.d.ts +0 -0
  153. /package/lib/{mjs/dto → dto}/user/DeviceListDto.js +0 -0
  154. /package/lib/{cjs/i18n → i18n}/CoreCulture.d.ts +0 -0
  155. /package/lib/{mjs/i18n → i18n}/CoreCulture.js +0 -0
  156. /package/lib/{cjs/index.d.ts → index.d.ts} +0 -0
  157. /package/lib/{mjs/index.js → index.js} +0 -0
  158. /package/lib/{cjs/rq → rq}/app/AppGetMyRQ.d.ts +0 -0
  159. /package/lib/{mjs/rq → rq}/app/AppGetMyRQ.js +0 -0
  160. /package/lib/{cjs/rq → rq}/app/AppListRQ.d.ts +0 -0
  161. /package/lib/{mjs/rq → rq}/app/AppListRQ.js +0 -0
  162. /package/lib/{cjs/rq → rq}/app/AppPurchasedQueryRQ.d.ts +0 -0
  163. /package/lib/{mjs/rq → rq}/app/AppPurchasedQueryRQ.js +0 -0
  164. /package/lib/{cjs/rq → rq}/app/AppQueryRQ.d.ts +0 -0
  165. /package/lib/{mjs/rq → rq}/app/AppQueryRQ.js +0 -0
  166. /package/lib/{cjs/rq → rq}/member/MemberListRQ.d.ts +0 -0
  167. /package/lib/{mjs/rq → rq}/member/MemberListRQ.js +0 -0
  168. /package/lib/{cjs/rq → rq}/member/MemberQueryRQ.d.ts +0 -0
  169. /package/lib/{mjs/rq → rq}/member/MemberQueryRQ.js +0 -0
  170. /package/lib/{cjs/rq → rq}/org/OrgCreateRQ.d.ts +0 -0
  171. /package/lib/{mjs/rq → rq}/org/OrgCreateRQ.js +0 -0
  172. /package/lib/{cjs/rq → rq}/org/OrgGetMyRQ.d.ts +0 -0
  173. /package/lib/{mjs/rq → rq}/org/OrgGetMyRQ.js +0 -0
  174. /package/lib/{cjs/rq → rq}/org/OrgListRQ.d.ts +0 -0
  175. /package/lib/{mjs/rq → rq}/org/OrgListRQ.js +0 -0
  176. /package/lib/{cjs/rq → rq}/org/OrgQueryRQ.d.ts +0 -0
  177. /package/lib/{mjs/rq → rq}/org/OrgQueryRQ.js +0 -0
  178. /package/lib/{cjs/rq → rq}/org/OrgUpdateRQ.d.ts +0 -0
  179. /package/lib/{mjs/rq → rq}/org/OrgUpdateRQ.js +0 -0
  180. /package/lib/{cjs/rq → rq}/public/CreateBarcodeRQ.d.ts +0 -0
  181. /package/lib/{mjs/rq → rq}/public/CreateBarcodeRQ.js +0 -0
  182. /package/lib/{cjs/rq → rq}/public/PinyinRQ.d.ts +0 -0
  183. /package/lib/{mjs/rq → rq}/public/PinyinRQ.js +0 -0
  184. /package/lib/{cjs/rq → rq}/public/PlaceQueryRQ.d.ts +0 -0
  185. /package/lib/{mjs/rq → rq}/public/PlaceQueryRQ.js +0 -0
  186. /package/lib/{cjs/rq → rq}/user/AuditHistoryRQ.d.ts +0 -0
  187. /package/lib/{mjs/rq → rq}/user/AuditHistoryRQ.js +0 -0
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ESNext",
5
- "moduleResolution": "Node10",
3
+ /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
+ "target": "ES2022",
5
+ "module": "ES2022",
6
+ "moduleResolution": "bundler",
6
7
  "allowJs": false,
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "resolveJsonModule": true,
13
8
  "isolatedModules": true,
14
- "noEmit": true,
15
- "declaration": true
9
+ "outDir": "./lib",
10
+ "noEmit": false,
11
+ "declaration": true,
12
+ "strict": true,
13
+ "esModuleInterop": true,
14
+ "skipLibCheck": true,
15
+ "jsx": "react-jsx",
16
+ "forceConsistentCasingInFileNames": true
16
17
  },
17
- "include": [".."]
18
+ "include": ["src"]
18
19
  }
@@ -45,6 +45,6 @@ export class AppApi extends EntityApi {
45
45
  * @returns Result
46
46
  */
47
47
  queryPurchased(rq, payload) {
48
- return this.queryBase(rq, payload);
48
+ return this.queryBase(rq, payload, "Purchased");
49
49
  }
50
50
  }
@@ -10,39 +10,39 @@ import { AuthApi, IApp } from "@etsoo/appscript";
10
10
  * 核心应用程序
11
11
  */
12
12
  export declare class CoreApp {
13
- protected app: IApp;
13
+ app: IApp;
14
14
  protected api: IApi;
15
- _appApi?: AppApi;
15
+ private _appApi?;
16
16
  /**
17
17
  * Application API
18
18
  * 应用程序接口
19
19
  */
20
20
  get appApi(): AppApi;
21
- _authApi?: AuthApi;
21
+ private _authApi?;
22
22
  /**
23
23
  * Authentication API
24
24
  * 认证接口
25
25
  */
26
26
  get authApi(): AuthApi;
27
- _memberApi?: MemberApi;
27
+ private _memberApi?;
28
28
  /**
29
29
  * Member API
30
30
  * 会员接口
31
31
  */
32
32
  get memberApi(): MemberApi;
33
- _orgApi?: OrgApi;
33
+ private _orgApi?;
34
34
  /**
35
35
  * Organization API
36
36
  * 机构接口
37
37
  */
38
38
  get orgApi(): OrgApi;
39
- _publicApi?: PublicApi;
39
+ private _publicApi?;
40
40
  /**
41
41
  * Public API
42
42
  * 公共接口
43
43
  */
44
44
  get publicApi(): PublicApi;
45
- _userApi?: UserApi;
45
+ private _userApi?;
46
46
  /**
47
47
  * User API
48
48
  * 用户接口
@@ -55,4 +55,9 @@ export declare class CoreApp {
55
55
  * @param api API
56
56
  */
57
57
  constructor(app: IApp, api: IApi);
58
+ /**
59
+ * Get identities
60
+ * @returns List
61
+ */
62
+ getIdentities(): import("@etsoo/shared").ListType[];
58
63
  }
@@ -4,52 +4,61 @@ import { AppApi } from "./AppApi";
4
4
  import { PublicApi } from "./PublicApi";
5
5
  import { UserApi } from "./UserApi";
6
6
  import { AuthApi } from "@etsoo/appscript";
7
+ import { IdentityType } from "./dto/IdentityType";
7
8
  /**
8
9
  * Core application
9
10
  * 核心应用程序
10
11
  */
11
12
  export class CoreApp {
13
+ app;
14
+ api;
15
+ _appApi;
12
16
  /**
13
17
  * Application API
14
18
  * 应用程序接口
15
19
  */
16
20
  get appApi() {
17
- return (this._appApi ?? (this._appApi = new AppApi(this.app, this.api)));
21
+ return (this._appApi ??= new AppApi(this.app, this.api));
18
22
  }
23
+ _authApi;
19
24
  /**
20
25
  * Authentication API
21
26
  * 认证接口
22
27
  */
23
28
  get authApi() {
24
- return (this._authApi ?? (this._authApi = new AuthApi(this.app, this.api)));
29
+ return (this._authApi ??= new AuthApi(this.app, this.api));
25
30
  }
31
+ _memberApi;
26
32
  /**
27
33
  * Member API
28
34
  * 会员接口
29
35
  */
30
36
  get memberApi() {
31
- return (this._memberApi ?? (this._memberApi = new MemberApi(this.app, this.api)));
37
+ return (this._memberApi ??= new MemberApi(this.app, this.api));
32
38
  }
39
+ _orgApi;
33
40
  /**
34
41
  * Organization API
35
42
  * 机构接口
36
43
  */
37
44
  get orgApi() {
38
- return (this._orgApi ?? (this._orgApi = new OrgApi(this.app, this.api)));
45
+ return (this._orgApi ??= new OrgApi(this.app, this.api));
39
46
  }
47
+ _publicApi;
40
48
  /**
41
49
  * Public API
42
50
  * 公共接口
43
51
  */
44
52
  get publicApi() {
45
- return (this._publicApi ?? (this._publicApi = new PublicApi(this.app, this.api)));
53
+ return (this._publicApi ??= new PublicApi(this.app, this.api));
46
54
  }
55
+ _userApi;
47
56
  /**
48
57
  * User API
49
58
  * 用户接口
50
59
  */
51
60
  get userApi() {
52
- return (this._userApi ?? (this._userApi = new UserApi(this.app, this.api)));
61
+ return (this._userApi ??= new UserApi(this.app, this.api));
53
62
  }
54
63
  /**
55
64
  * Constructor
@@ -61,4 +70,11 @@ export class CoreApp {
61
70
  this.app = app;
62
71
  this.api = api;
63
72
  }
73
+ /**
74
+ * Get identities
75
+ * @returns List
76
+ */
77
+ getIdentities() {
78
+ return this.app.getEnumList(IdentityType, "id");
79
+ }
64
80
  }
@@ -108,7 +108,7 @@ export class PublicApi extends BaseApi {
108
108
  * @returns Result
109
109
  */
110
110
  repeatOptions(options, isJoined = true) {
111
- options ?? (options = DataTypes.getEnumKeys(RepeatOption));
111
+ options ??= DataTypes.getEnumKeys(RepeatOption);
112
112
  return this.units(options, isJoined);
113
113
  }
114
114
  /**
@@ -127,7 +127,7 @@ export class PublicApi extends BaseApi {
127
127
  * @returns Units
128
128
  */
129
129
  units(options, isJoined) {
130
- options ?? (options = DataTypes.getEnumKeys(ProductUnit));
130
+ options ??= DataTypes.getEnumKeys(ProductUnit);
131
131
  return options.map((key) => {
132
132
  const id = DataTypes.getEnumByKey(ProductUnit, key);
133
133
  return {
@@ -55,7 +55,7 @@ export class UserApi extends EntityApi {
55
55
  * @returns Result
56
56
  */
57
57
  updateAvatar(data, payload) {
58
- payload ?? (payload = { config: {} });
58
+ payload ??= { config: {} };
59
59
  // Credentials for anti-forgery cookie sending
60
60
  if (payload.config && payload.config.credentials == null)
61
61
  payload.config.credentials = "include";
@@ -0,0 +1 @@
1
+ export * from "./org/OrgTiplist";
@@ -0,0 +1,2 @@
1
+ // Components
2
+ export * from "./org/OrgTiplist";
@@ -0,0 +1,36 @@
1
+ import { CoreApp } from "../../CoreApp";
2
+ /**
3
+ * Organization tiplist properties
4
+ * 机构提示列表属性
5
+ */
6
+ export type OrgTiplistProps = {
7
+ /**
8
+ * API Application
9
+ * 接口应用
10
+ */
11
+ api: CoreApp;
12
+ /**
13
+ * Label
14
+ * 标签
15
+ */
16
+ label?: string;
17
+ /**
18
+ * Max items
19
+ * 最大项目
20
+ * @default 10
21
+ */
22
+ maxItems?: number;
23
+ /**
24
+ * Name
25
+ * 名称
26
+ * @default 'organizationId'
27
+ */
28
+ name?: string;
29
+ };
30
+ /**
31
+ * Organization tiplist
32
+ * 机构提示列表
33
+ * @param props Properties
34
+ * @returns Component
35
+ */
36
+ export declare function OrgTiplist(props: OrgTiplistProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Tiplist } from "@etsoo/materialui";
3
+ /**
4
+ * Organization tiplist
5
+ * 机构提示列表
6
+ * @param props Properties
7
+ * @returns Component
8
+ */
9
+ export function OrgTiplist(props) {
10
+ // Destruct
11
+ const { api, label = api.app.get("org"), maxItems = 10, name = "organizationId" } = props;
12
+ // Layout
13
+ return (_jsx(Tiplist, { label: label, getOptionLabel: (data) => data.name + "(" + data.pin + ")", name: name, fullWidth: true, maxItems: maxItems, loadData: (keyword, id, maxItems) => api.orgApi.list({
14
+ enabled: true,
15
+ keyword,
16
+ id,
17
+ queryPaging: {
18
+ batchSize: maxItems,
19
+ orderBy: [{ field: "name" }]
20
+ }
21
+ }) }));
22
+ }
@@ -0,0 +1,12 @@
1
+ import { DataTypes } from "@etsoo/shared";
2
+ /**
3
+ * Organization list data
4
+ * 机构列表数据
5
+ */
6
+ export type OrgListDto = DataTypes.IdNameItem & {
7
+ /**
8
+ * Unique identifier
9
+ * 唯一标识符
10
+ */
11
+ pin?: number;
12
+ };
@@ -5,7 +5,11 @@
5
5
  "app3": "Business Mgt.",
6
6
  "app4": "Finance System",
7
7
  "app5": "Progress Mgt.",
8
+ "appHelpUrl": "Help URL",
9
+ "appName": "App name",
10
+ "appWebUrl": "Web URL",
8
11
  "brand": "Brand",
12
+ "buy": "Buy",
9
13
  "collapseMenu": "Collapse menu",
10
14
  "collapseNavMenuAriaLabel": "Collapse navigation menu",
11
15
  "companyNo": "Company No.",
@@ -13,8 +17,14 @@
13
17
  "darkMode": "Dark mode",
14
18
  "expandMenu": "Expand menu",
15
19
  "expandNavMenuAriaLabel": "Expand navigation menu",
20
+ "idCustomer": "Customer",
21
+ "idSupplier": "Supplier",
22
+ "idUser": "User/Org.",
23
+ "identityType": "Identity type",
16
24
  "lightMode": "Light mode",
25
+ "org": "Organization",
17
26
  "orgName": "Org name",
27
+ "orgPin": "Org No.",
18
28
  "parentOrg": "Parent org",
19
29
  "role": "Role",
20
30
  "roleAdmin": "Admin",
@@ -5,7 +5,11 @@
5
5
  "app3": "业务管理",
6
6
  "app4": "财务系统",
7
7
  "app5": "进度管理",
8
+ "appHelpUrl": "帮助网址",
9
+ "appName": "应用名称",
10
+ "appWebUrl": "Web网址",
8
11
  "brand": "品牌",
12
+ "buy": "购买",
9
13
  "collapseMenu": "折叠菜单",
10
14
  "collapseNavMenuAriaLabel": "折叠导航菜单",
11
15
  "companyNo": "机构编号",
@@ -13,8 +17,14 @@
13
17
  "darkMode": "深色模式",
14
18
  "expandMenu": "展开菜单",
15
19
  "expandNavMenuAriaLabel": "展开导航菜单",
20
+ "idCustomer": "客户",
21
+ "idSupplier": "供应商",
22
+ "idUser": "用户/机构",
23
+ "identityType": "对象身份",
16
24
  "lightMode": "浅色模式",
25
+ "org": "机构",
17
26
  "orgName": "机构名称",
27
+ "orgPin": "机构编号",
18
28
  "parentOrg": "上级机构",
19
29
  "role": "角色",
20
30
  "roleAdmin": "管理员",
@@ -5,7 +5,11 @@
5
5
  "app3": "業務管理",
6
6
  "app4": "財務系統",
7
7
  "app5": "進度管理",
8
+ "appHelpUrl": "幫助網址",
9
+ "appName": "應用名稱",
10
+ "appWebUrl": "Web網址",
8
11
  "brand": "品牌",
12
+ "buy": "購買",
9
13
  "collapseMenu": "折疊菜單",
10
14
  "collapseNavMenuAriaLabel": "折疊導航菜單",
11
15
  "companyNo": "機構編號",
@@ -14,7 +18,13 @@
14
18
  "expandMenu": "展開菜單",
15
19
  "expandNavMenuAriaLabel": "展開導航菜單",
16
20
  "lightMode": "淺色模式",
21
+ "idCustomer": "客戶",
22
+ "idSupplier": "供應商",
23
+ "idUser": "使用者/機構",
24
+ "identityType": "對象身份",
25
+ "org": "機構",
17
26
  "orgName": "機構名稱",
27
+ "orgPin": "機構編號",
18
28
  "parentOrg": "上級機構",
19
29
  "role": "角色",
20
30
  "roleAdmin": "管理員",
package/package.json CHANGED
@@ -1,19 +1,22 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
- "main": "lib/cjs/index.js",
6
- "module": "lib/mjs/index.js",
7
- "types": "lib/mjs/index.d.ts",
5
+ "main": "lib/index.js",
6
+ "module": "lib/index.js",
8
7
  "exports": {
9
8
  ".": {
10
- "import": "./lib/mjs/index.js",
11
- "require": "./lib/cjs/index.js"
9
+ "types": "./lib/index.d.ts",
10
+ "import": "./lib/index.js"
11
+ },
12
+ "./components": {
13
+ "types": "./lib/components/index.d.ts",
14
+ "import": "./lib/components/index.js"
12
15
  }
13
16
  },
14
17
  "sideEffects": false,
15
18
  "scripts": {
16
- "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json",
19
+ "build": "tsc",
17
20
  "test": "jest",
18
21
  "localtest": "set NODE_ENV=local&&jest"
19
22
  },
@@ -63,6 +66,8 @@
63
66
  "@babel/preset-env": "^7.26.0",
64
67
  "@babel/runtime-corejs3": "^7.26.0",
65
68
  "@types/jest": "^29.5.14",
69
+ "@types/react": "^19.0.1",
70
+ "@types/react-dom": "^19.0.2",
66
71
  "jest": "^29.7.0",
67
72
  "jest-environment-jsdom": "^29.7.0",
68
73
  "ts-jest": "^29.2.5",
@@ -70,6 +75,11 @@
70
75
  },
71
76
  "dependencies": {
72
77
  "@etsoo/appscript": "^1.5.79",
73
- "@etsoo/shared": "^1.2.55"
78
+ "@etsoo/materialui": "^1.4.51",
79
+ "@etsoo/react": "^1.8.14",
80
+ "@etsoo/shared": "^1.2.55",
81
+ "@mui/material": "^6.2.0",
82
+ "react": "^19.0.0",
83
+ "react-dom": "^19.0.0"
74
84
  }
75
85
  }
package/src/AppApi.ts CHANGED
@@ -61,6 +61,6 @@ export class AppApi extends EntityApi {
61
61
  rq: AppPurchasedQueryRQ,
62
62
  payload?: IApiPayload<AppPurchasedQueryData[]>
63
63
  ) {
64
- return this.queryBase(rq, payload);
64
+ return this.queryBase(rq, payload, "Purchased");
65
65
  }
66
66
  }
package/src/CoreApp.ts CHANGED
@@ -5,13 +5,14 @@ import { AppApi } from "./AppApi";
5
5
  import { PublicApi } from "./PublicApi";
6
6
  import { UserApi } from "./UserApi";
7
7
  import { AuthApi, IApp } from "@etsoo/appscript";
8
+ import { IdentityType } from "./dto/IdentityType";
8
9
 
9
10
  /**
10
11
  * Core application
11
12
  * 核心应用程序
12
13
  */
13
14
  export class CoreApp {
14
- _appApi?: AppApi;
15
+ private _appApi?: AppApi;
15
16
  /**
16
17
  * Application API
17
18
  * 应用程序接口
@@ -20,7 +21,7 @@ export class CoreApp {
20
21
  return (this._appApi ??= new AppApi(this.app, this.api));
21
22
  }
22
23
 
23
- _authApi?: AuthApi;
24
+ private _authApi?: AuthApi;
24
25
  /**
25
26
  * Authentication API
26
27
  * 认证接口
@@ -29,7 +30,7 @@ export class CoreApp {
29
30
  return (this._authApi ??= new AuthApi(this.app, this.api));
30
31
  }
31
32
 
32
- _memberApi?: MemberApi;
33
+ private _memberApi?: MemberApi;
33
34
  /**
34
35
  * Member API
35
36
  * 会员接口
@@ -38,7 +39,7 @@ export class CoreApp {
38
39
  return (this._memberApi ??= new MemberApi(this.app, this.api));
39
40
  }
40
41
 
41
- _orgApi?: OrgApi;
42
+ private _orgApi?: OrgApi;
42
43
  /**
43
44
  * Organization API
44
45
  * 机构接口
@@ -47,7 +48,7 @@ export class CoreApp {
47
48
  return (this._orgApi ??= new OrgApi(this.app, this.api));
48
49
  }
49
50
 
50
- _publicApi?: PublicApi;
51
+ private _publicApi?: PublicApi;
51
52
  /**
52
53
  * Public API
53
54
  * 公共接口
@@ -56,7 +57,7 @@ export class CoreApp {
56
57
  return (this._publicApi ??= new PublicApi(this.app, this.api));
57
58
  }
58
59
 
59
- _userApi?: UserApi;
60
+ private _userApi?: UserApi;
60
61
  /**
61
62
  * User API
62
63
  * 用户接口
@@ -71,5 +72,13 @@ export class CoreApp {
71
72
  * @param app Base application
72
73
  * @param api API
73
74
  */
74
- constructor(protected app: IApp, protected api: IApi) {}
75
+ constructor(public app: IApp, protected api: IApi) {}
76
+
77
+ /**
78
+ * Get identities
79
+ * @returns List
80
+ */
81
+ getIdentities() {
82
+ return this.app.getEnumList(IdentityType, "id");
83
+ }
75
84
  }
@@ -0,0 +1,2 @@
1
+ // Components
2
+ export * from "./org/OrgTiplist";
@@ -0,0 +1,73 @@
1
+ import { Tiplist } from "@etsoo/materialui";
2
+ import { OrgListDto } from "../../dto/org/OrgListDto";
3
+ import { CoreApp } from "../../CoreApp";
4
+
5
+ /**
6
+ * Organization tiplist properties
7
+ * 机构提示列表属性
8
+ */
9
+ export type OrgTiplistProps = {
10
+ /**
11
+ * API Application
12
+ * 接口应用
13
+ */
14
+ api: CoreApp;
15
+
16
+ /**
17
+ * Label
18
+ * 标签
19
+ */
20
+ label?: string;
21
+
22
+ /**
23
+ * Max items
24
+ * 最大项目
25
+ * @default 10
26
+ */
27
+ maxItems?: number;
28
+
29
+ /**
30
+ * Name
31
+ * 名称
32
+ * @default 'organizationId'
33
+ */
34
+ name?: string;
35
+ };
36
+
37
+ /**
38
+ * Organization tiplist
39
+ * 机构提示列表
40
+ * @param props Properties
41
+ * @returns Component
42
+ */
43
+ export function OrgTiplist(props: OrgTiplistProps) {
44
+ // Destruct
45
+ const {
46
+ api,
47
+ label = api.app.get("org")!,
48
+ maxItems = 10,
49
+ name = "organizationId"
50
+ } = props;
51
+
52
+ // Layout
53
+ return (
54
+ <Tiplist<OrgListDto>
55
+ label={label}
56
+ getOptionLabel={(data) => data.name + "(" + data.pin + ")"}
57
+ name={name}
58
+ fullWidth
59
+ maxItems={maxItems}
60
+ loadData={(keyword, id, maxItems) =>
61
+ api.orgApi.list({
62
+ enabled: true,
63
+ keyword,
64
+ id,
65
+ queryPaging: {
66
+ batchSize: maxItems,
67
+ orderBy: [{ field: "name" }]
68
+ }
69
+ })
70
+ }
71
+ />
72
+ );
73
+ }
@@ -4,4 +4,10 @@ import { DataTypes } from "@etsoo/shared";
4
4
  * Organization list data
5
5
  * 机构列表数据
6
6
  */
7
- export type OrgListDto = DataTypes.IdNameItem & {};
7
+ export type OrgListDto = DataTypes.IdNameItem & {
8
+ /**
9
+ * Unique identifier
10
+ * 唯一标识符
11
+ */
12
+ pin?: number;
13
+ };
package/src/i18n/en.json CHANGED
@@ -5,7 +5,11 @@
5
5
  "app3": "Business Mgt.",
6
6
  "app4": "Finance System",
7
7
  "app5": "Progress Mgt.",
8
+ "appHelpUrl": "Help URL",
9
+ "appName": "App name",
10
+ "appWebUrl": "Web URL",
8
11
  "brand": "Brand",
12
+ "buy": "Buy",
9
13
  "collapseMenu": "Collapse menu",
10
14
  "collapseNavMenuAriaLabel": "Collapse navigation menu",
11
15
  "companyNo": "Company No.",
@@ -13,8 +17,14 @@
13
17
  "darkMode": "Dark mode",
14
18
  "expandMenu": "Expand menu",
15
19
  "expandNavMenuAriaLabel": "Expand navigation menu",
20
+ "idCustomer": "Customer",
21
+ "idSupplier": "Supplier",
22
+ "idUser": "User/Org.",
23
+ "identityType": "Identity type",
16
24
  "lightMode": "Light mode",
25
+ "org": "Organization",
17
26
  "orgName": "Org name",
27
+ "orgPin": "Org No.",
18
28
  "parentOrg": "Parent org",
19
29
  "role": "Role",
20
30
  "roleAdmin": "Admin",
@@ -5,7 +5,11 @@
5
5
  "app3": "业务管理",
6
6
  "app4": "财务系统",
7
7
  "app5": "进度管理",
8
+ "appHelpUrl": "帮助网址",
9
+ "appName": "应用名称",
10
+ "appWebUrl": "Web网址",
8
11
  "brand": "品牌",
12
+ "buy": "购买",
9
13
  "collapseMenu": "折叠菜单",
10
14
  "collapseNavMenuAriaLabel": "折叠导航菜单",
11
15
  "companyNo": "机构编号",
@@ -13,8 +17,14 @@
13
17
  "darkMode": "深色模式",
14
18
  "expandMenu": "展开菜单",
15
19
  "expandNavMenuAriaLabel": "展开导航菜单",
20
+ "idCustomer": "客户",
21
+ "idSupplier": "供应商",
22
+ "idUser": "用户/机构",
23
+ "identityType": "对象身份",
16
24
  "lightMode": "浅色模式",
25
+ "org": "机构",
17
26
  "orgName": "机构名称",
27
+ "orgPin": "机构编号",
18
28
  "parentOrg": "上级机构",
19
29
  "role": "角色",
20
30
  "roleAdmin": "管理员",
@@ -5,7 +5,11 @@
5
5
  "app3": "業務管理",
6
6
  "app4": "財務系統",
7
7
  "app5": "進度管理",
8
+ "appHelpUrl": "幫助網址",
9
+ "appName": "應用名稱",
10
+ "appWebUrl": "Web網址",
8
11
  "brand": "品牌",
12
+ "buy": "購買",
9
13
  "collapseMenu": "折疊菜單",
10
14
  "collapseNavMenuAriaLabel": "折疊導航菜單",
11
15
  "companyNo": "機構編號",
@@ -14,7 +18,13 @@
14
18
  "expandMenu": "展開菜單",
15
19
  "expandNavMenuAriaLabel": "展開導航菜單",
16
20
  "lightMode": "淺色模式",
21
+ "idCustomer": "客戶",
22
+ "idSupplier": "供應商",
23
+ "idUser": "使用者/機構",
24
+ "identityType": "對象身份",
25
+ "org": "機構",
17
26
  "orgName": "機構名稱",
27
+ "orgPin": "機構編號",
18
28
  "parentOrg": "上級機構",
19
29
  "role": "角色",
20
30
  "roleAdmin": "管理員",