@etsoo/smarterp-core 1.1.48 → 1.1.49

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.
@@ -6,9 +6,10 @@ import { PublicApi } from "./PublicApi";
6
6
  import { UserApi } from "./UserApi";
7
7
  import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@etsoo/appscript";
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
- import { ListType } from "@etsoo/shared";
9
+ import { ListType, ListType1 } from "@etsoo/shared";
10
10
  import { CoreApiService } from "./dto/org/CoreApiService";
11
11
  import { DocumentApi } from "./DocumentApi";
12
+ import { DocumentKind } from "./dto/document/DocumentKind";
12
13
  type AppData = {
13
14
  id: number;
14
15
  appId?: number;
@@ -72,6 +73,19 @@ export interface ICoreApp {
72
73
  * @returns Name
73
74
  */
74
75
  getAppName(data: AppData): string;
76
+ /**
77
+ * Get document kind label
78
+ * 获取文档类型标签
79
+ * @param kind Kind
80
+ * @returns Label
81
+ */
82
+ getDocumentKind(kind?: DocumentKind): string | undefined;
83
+ /**
84
+ * Get document kinds
85
+ * 获取文档类型列表
86
+ * @returns List
87
+ */
88
+ getDocumentKinds(): ListType1[];
75
89
  /**
76
90
  * Get user identifier type label
77
91
  * 获取用户标识类型标签
@@ -192,6 +206,19 @@ export declare class CoreApp implements ICoreApp {
192
206
  * @returns Name
193
207
  */
194
208
  getAppName(data: AppData): string;
209
+ /**
210
+ * Get document kind label
211
+ * 获取文档类型标签
212
+ * @param kind Kind
213
+ * @returns Label
214
+ */
215
+ getDocumentKind(kind?: DocumentKind): string | undefined;
216
+ /**
217
+ * Get document kinds
218
+ * 获取文档类型列表
219
+ * @returns List
220
+ */
221
+ getDocumentKinds(): ListType1[];
195
222
  /**
196
223
  * Get user identifier type label
197
224
  * 获取用户标识类型标签
@@ -11,6 +11,7 @@ const AuthCodeApi_1 = require("./AuthCodeApi");
11
11
  const shared_1 = require("@etsoo/shared");
12
12
  const CoreApiService_1 = require("./dto/org/CoreApiService");
13
13
  const DocumentApi_1 = require("./DocumentApi");
14
+ const DocumentKind_1 = require("./dto/document/DocumentKind");
14
15
  /**
15
16
  * Core application
16
17
  * 核心应用程序
@@ -121,6 +122,26 @@ class CoreApp {
121
122
  getAppName(data) {
122
123
  return (data.localName ?? this.app.get(`app${data.appId ?? data.id}`) ?? data.name);
123
124
  }
125
+ /**
126
+ * Get document kind label
127
+ * 获取文档类型标签
128
+ * @param kind Kind
129
+ * @returns Label
130
+ */
131
+ getDocumentKind(kind) {
132
+ if (kind == null)
133
+ return undefined;
134
+ const key = DocumentKind_1.DocumentKind[kind];
135
+ return this.app.get("template" + key) ?? key;
136
+ }
137
+ /**
138
+ * Get document kinds
139
+ * 获取文档类型列表
140
+ * @returns List
141
+ */
142
+ getDocumentKinds() {
143
+ return this.app.getEnumStrList(DocumentKind_1.DocumentKind, "template");
144
+ }
124
145
  /**
125
146
  * Get user identifier type label
126
147
  * 获取用户标识类型标签
@@ -0,0 +1,8 @@
1
+ import { SelectExProps } from "@etsoo/materialui";
2
+ import { ListType1 } from "@etsoo/shared";
3
+ /**
4
+ * Document kind list component
5
+ * @param props Props
6
+ * @returns Component
7
+ */
8
+ export declare function DocumentKindList(props: Omit<SelectExProps<ListType1>, "options">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentKindList = DocumentKindList;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const materialui_1 = require("@etsoo/materialui");
6
+ const ICoreServiceApp_1 = require("../../ICoreServiceApp");
7
+ /**
8
+ * Document kind list component
9
+ * @param props Props
10
+ * @returns Component
11
+ */
12
+ function DocumentKindList(props) {
13
+ // App
14
+ const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
15
+ // Destruct
16
+ const { label = app.get("templateKind"), name = "kind", ...rest } = props;
17
+ // Layout
18
+ return ((0, jsx_runtime_1.jsx)(materialui_1.SelectEx, { label: label, name: name, options: app.core.getDocumentKinds(), ...rest }));
19
+ }
@@ -6,6 +6,7 @@ export * from "./app/IdentityTypeList";
6
6
  export * from "./app/SearchDays";
7
7
  export * from "./app/StatusList";
8
8
  export * from "./app/UserRoleList";
9
+ export * from "./document/DocumentKindList";
9
10
  export * from "./document/SystemDocumentTiplist";
10
11
  export * from "./org/ButtonApiServices";
11
12
  export * from "./org/OrgSwitchPopover";
@@ -25,6 +25,7 @@ __exportStar(require("./app/SearchDays"), exports);
25
25
  __exportStar(require("./app/StatusList"), exports);
26
26
  __exportStar(require("./app/UserRoleList"), exports);
27
27
  // document
28
+ __exportStar(require("./document/DocumentKindList"), exports);
28
29
  __exportStar(require("./document/SystemDocumentTiplist"), exports);
29
30
  // org
30
31
  __exportStar(require("./org/ButtonApiServices"), exports);
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Template document kind, the value should not exceed 20 characters
3
+ * 模板文档类型,值不能超过20个字符
4
+ */
5
+ export declare enum DocumentKind {
6
+ /**
7
+ * CMS asset check alert
8
+ * CMS资产检查警告
9
+ */
10
+ CMSASSETCHECKALERT = "CMSASSETCHECKALERT",
11
+ /**
12
+ * CMS asset expiry alert
13
+ * CMS资产过期警告
14
+ */
15
+ CMSASSETEXPIRYALERT = "CMSASSETEXPIRYALERT",
16
+ /**
17
+ * CMS customer data
18
+ * CMS客户数据
19
+ */
20
+ CMSCUSTOMERDATA = "CMSCUSTOMERDATA",
21
+ /**
22
+ * CMS order data
23
+ * CMS订单数据
24
+ */
25
+ CMSORDERDATA = "CMSORDERDATA",
26
+ /**
27
+ * CMS PO data
28
+ * CMS采购数据
29
+ */
30
+ CMSPODATA = "CMSPODATA",
31
+ /**
32
+ * CMS stock data
33
+ * CMS库存数据
34
+ */
35
+ CMSSTOCKDATA = "CMSSTOCKDATA"
36
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentKind = void 0;
4
+ /**
5
+ * Template document kind, the value should not exceed 20 characters
6
+ * 模板文档类型,值不能超过20个字符
7
+ */
8
+ var DocumentKind;
9
+ (function (DocumentKind) {
10
+ /**
11
+ * CMS asset check alert
12
+ * CMS资产检查警告
13
+ */
14
+ DocumentKind["CMSASSETCHECKALERT"] = "CMSASSETCHECKALERT";
15
+ /**
16
+ * CMS asset expiry alert
17
+ * CMS资产过期警告
18
+ */
19
+ DocumentKind["CMSASSETEXPIRYALERT"] = "CMSASSETEXPIRYALERT";
20
+ /**
21
+ * CMS customer data
22
+ * CMS客户数据
23
+ */
24
+ DocumentKind["CMSCUSTOMERDATA"] = "CMSCUSTOMERDATA";
25
+ /**
26
+ * CMS order data
27
+ * CMS订单数据
28
+ */
29
+ DocumentKind["CMSORDERDATA"] = "CMSORDERDATA";
30
+ /**
31
+ * CMS PO data
32
+ * CMS采购数据
33
+ */
34
+ DocumentKind["CMSPODATA"] = "CMSPODATA";
35
+ /**
36
+ * CMS stock data
37
+ * CMS库存数据
38
+ */
39
+ DocumentKind["CMSSTOCKDATA"] = "CMSSTOCKDATA";
40
+ })(DocumentKind || (exports.DocumentKind = DocumentKind = {}));
@@ -124,6 +124,13 @@
124
124
  "target": "Target",
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
+ "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
129
+ "templateCMSCUSTOMERDATA": "CMS customer data",
130
+ "templateCMSORDERDATA": "CMS order data",
131
+ "templateCMSPODATA": "CMS PO data",
132
+ "templateCMSSTOCKDATA": "CMS stock data",
133
+ "templateKind": "Template kind",
127
134
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
128
135
  "uiTypeEmail": "Email",
129
136
  "uiTypeMobile": "Mobile",
@@ -124,6 +124,13 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客户数据",
130
+ "templateCMSORDERDATA": "CMS订单数据",
131
+ "templateCMSPODATA": "CMS采购数据",
132
+ "templateCMSSTOCKDATA": "CMS库存数据",
133
+ "templateKind": "模板类型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "电子邮箱",
129
136
  "uiTypeMobile": "手机号",
@@ -124,6 +124,13 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
+ "templateCMSORDERDATA": "CMS訂單數據",
131
+ "templateCMSPODATA": "CMS採購數據",
132
+ "templateCMSSTOCKDATA": "CMS庫存數據",
133
+ "templateKind": "模板類型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "電子郵件",
129
136
  "uiTypeMobile": "手機號碼",
@@ -7,6 +7,7 @@ export * from "./dto/app/AppUpdateReadDto";
7
7
  export * from "./dto/app/CreateApiKeyData";
8
8
  export * from "./dto/authCode/AuthCodeAction";
9
9
  export * from "./rq/document/SystemDocumentListRQ";
10
+ export * from "./dto/document/DocumentKind";
10
11
  export * from "./dto/document/SystemDocumentListData";
11
12
  export * from "./dto/document/SystemDocumentViewData";
12
13
  export * from "./dto/member/MemberListDto";
package/lib/cjs/index.js CHANGED
@@ -24,6 +24,7 @@ __exportStar(require("./dto/app/AppUpdateReadDto"), exports);
24
24
  __exportStar(require("./dto/app/CreateApiKeyData"), exports);
25
25
  __exportStar(require("./dto/authCode/AuthCodeAction"), exports);
26
26
  __exportStar(require("./rq/document/SystemDocumentListRQ"), exports);
27
+ __exportStar(require("./dto/document/DocumentKind"), exports);
27
28
  __exportStar(require("./dto/document/SystemDocumentListData"), exports);
28
29
  __exportStar(require("./dto/document/SystemDocumentViewData"), exports);
29
30
  __exportStar(require("./dto/member/MemberListDto"), exports);
@@ -6,9 +6,10 @@ import { PublicApi } from "./PublicApi";
6
6
  import { UserApi } from "./UserApi";
7
7
  import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@etsoo/appscript";
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
- import { ListType } from "@etsoo/shared";
9
+ import { ListType, ListType1 } from "@etsoo/shared";
10
10
  import { CoreApiService } from "./dto/org/CoreApiService";
11
11
  import { DocumentApi } from "./DocumentApi";
12
+ import { DocumentKind } from "./dto/document/DocumentKind";
12
13
  type AppData = {
13
14
  id: number;
14
15
  appId?: number;
@@ -72,6 +73,19 @@ export interface ICoreApp {
72
73
  * @returns Name
73
74
  */
74
75
  getAppName(data: AppData): string;
76
+ /**
77
+ * Get document kind label
78
+ * 获取文档类型标签
79
+ * @param kind Kind
80
+ * @returns Label
81
+ */
82
+ getDocumentKind(kind?: DocumentKind): string | undefined;
83
+ /**
84
+ * Get document kinds
85
+ * 获取文档类型列表
86
+ * @returns List
87
+ */
88
+ getDocumentKinds(): ListType1[];
75
89
  /**
76
90
  * Get user identifier type label
77
91
  * 获取用户标识类型标签
@@ -192,6 +206,19 @@ export declare class CoreApp implements ICoreApp {
192
206
  * @returns Name
193
207
  */
194
208
  getAppName(data: AppData): string;
209
+ /**
210
+ * Get document kind label
211
+ * 获取文档类型标签
212
+ * @param kind Kind
213
+ * @returns Label
214
+ */
215
+ getDocumentKind(kind?: DocumentKind): string | undefined;
216
+ /**
217
+ * Get document kinds
218
+ * 获取文档类型列表
219
+ * @returns List
220
+ */
221
+ getDocumentKinds(): ListType1[];
195
222
  /**
196
223
  * Get user identifier type label
197
224
  * 获取用户标识类型标签
@@ -8,6 +8,7 @@ import { AuthCodeApi } from "./AuthCodeApi";
8
8
  import { DataTypes } from "@etsoo/shared";
9
9
  import { CoreApiService } from "./dto/org/CoreApiService";
10
10
  import { DocumentApi } from "./DocumentApi";
11
+ import { DocumentKind } from "./dto/document/DocumentKind";
11
12
  /**
12
13
  * Core application
13
14
  * 核心应用程序
@@ -118,6 +119,26 @@ export class CoreApp {
118
119
  getAppName(data) {
119
120
  return (data.localName ?? this.app.get(`app${data.appId ?? data.id}`) ?? data.name);
120
121
  }
122
+ /**
123
+ * Get document kind label
124
+ * 获取文档类型标签
125
+ * @param kind Kind
126
+ * @returns Label
127
+ */
128
+ getDocumentKind(kind) {
129
+ if (kind == null)
130
+ return undefined;
131
+ const key = DocumentKind[kind];
132
+ return this.app.get("template" + key) ?? key;
133
+ }
134
+ /**
135
+ * Get document kinds
136
+ * 获取文档类型列表
137
+ * @returns List
138
+ */
139
+ getDocumentKinds() {
140
+ return this.app.getEnumStrList(DocumentKind, "template");
141
+ }
121
142
  /**
122
143
  * Get user identifier type label
123
144
  * 获取用户标识类型标签
@@ -0,0 +1,8 @@
1
+ import { SelectExProps } from "@etsoo/materialui";
2
+ import { ListType1 } from "@etsoo/shared";
3
+ /**
4
+ * Document kind list component
5
+ * @param props Props
6
+ * @returns Component
7
+ */
8
+ export declare function DocumentKindList(props: Omit<SelectExProps<ListType1>, "options">): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { SelectEx } from "@etsoo/materialui";
3
+ import { useRequiredAppContext } from "../../ICoreServiceApp";
4
+ /**
5
+ * Document kind list component
6
+ * @param props Props
7
+ * @returns Component
8
+ */
9
+ export function DocumentKindList(props) {
10
+ // App
11
+ const app = useRequiredAppContext();
12
+ // Destruct
13
+ const { label = app.get("templateKind"), name = "kind", ...rest } = props;
14
+ // Layout
15
+ return (_jsx(SelectEx, { label: label, name: name, options: app.core.getDocumentKinds(), ...rest }));
16
+ }
@@ -6,6 +6,7 @@ export * from "./app/IdentityTypeList";
6
6
  export * from "./app/SearchDays";
7
7
  export * from "./app/StatusList";
8
8
  export * from "./app/UserRoleList";
9
+ export * from "./document/DocumentKindList";
9
10
  export * from "./document/SystemDocumentTiplist";
10
11
  export * from "./org/ButtonApiServices";
11
12
  export * from "./org/OrgSwitchPopover";
@@ -9,6 +9,7 @@ export * from "./app/SearchDays";
9
9
  export * from "./app/StatusList";
10
10
  export * from "./app/UserRoleList";
11
11
  // document
12
+ export * from "./document/DocumentKindList";
12
13
  export * from "./document/SystemDocumentTiplist";
13
14
  // org
14
15
  export * from "./org/ButtonApiServices";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Template document kind, the value should not exceed 20 characters
3
+ * 模板文档类型,值不能超过20个字符
4
+ */
5
+ export declare enum DocumentKind {
6
+ /**
7
+ * CMS asset check alert
8
+ * CMS资产检查警告
9
+ */
10
+ CMSASSETCHECKALERT = "CMSASSETCHECKALERT",
11
+ /**
12
+ * CMS asset expiry alert
13
+ * CMS资产过期警告
14
+ */
15
+ CMSASSETEXPIRYALERT = "CMSASSETEXPIRYALERT",
16
+ /**
17
+ * CMS customer data
18
+ * CMS客户数据
19
+ */
20
+ CMSCUSTOMERDATA = "CMSCUSTOMERDATA",
21
+ /**
22
+ * CMS order data
23
+ * CMS订单数据
24
+ */
25
+ CMSORDERDATA = "CMSORDERDATA",
26
+ /**
27
+ * CMS PO data
28
+ * CMS采购数据
29
+ */
30
+ CMSPODATA = "CMSPODATA",
31
+ /**
32
+ * CMS stock data
33
+ * CMS库存数据
34
+ */
35
+ CMSSTOCKDATA = "CMSSTOCKDATA"
36
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Template document kind, the value should not exceed 20 characters
3
+ * 模板文档类型,值不能超过20个字符
4
+ */
5
+ export var DocumentKind;
6
+ (function (DocumentKind) {
7
+ /**
8
+ * CMS asset check alert
9
+ * CMS资产检查警告
10
+ */
11
+ DocumentKind["CMSASSETCHECKALERT"] = "CMSASSETCHECKALERT";
12
+ /**
13
+ * CMS asset expiry alert
14
+ * CMS资产过期警告
15
+ */
16
+ DocumentKind["CMSASSETEXPIRYALERT"] = "CMSASSETEXPIRYALERT";
17
+ /**
18
+ * CMS customer data
19
+ * CMS客户数据
20
+ */
21
+ DocumentKind["CMSCUSTOMERDATA"] = "CMSCUSTOMERDATA";
22
+ /**
23
+ * CMS order data
24
+ * CMS订单数据
25
+ */
26
+ DocumentKind["CMSORDERDATA"] = "CMSORDERDATA";
27
+ /**
28
+ * CMS PO data
29
+ * CMS采购数据
30
+ */
31
+ DocumentKind["CMSPODATA"] = "CMSPODATA";
32
+ /**
33
+ * CMS stock data
34
+ * CMS库存数据
35
+ */
36
+ DocumentKind["CMSSTOCKDATA"] = "CMSSTOCKDATA";
37
+ })(DocumentKind || (DocumentKind = {}));
@@ -124,6 +124,13 @@
124
124
  "target": "Target",
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
+ "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
129
+ "templateCMSCUSTOMERDATA": "CMS customer data",
130
+ "templateCMSORDERDATA": "CMS order data",
131
+ "templateCMSPODATA": "CMS PO data",
132
+ "templateCMSSTOCKDATA": "CMS stock data",
133
+ "templateKind": "Template kind",
127
134
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
128
135
  "uiTypeEmail": "Email",
129
136
  "uiTypeMobile": "Mobile",
@@ -124,6 +124,13 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客户数据",
130
+ "templateCMSORDERDATA": "CMS订单数据",
131
+ "templateCMSPODATA": "CMS采购数据",
132
+ "templateCMSSTOCKDATA": "CMS库存数据",
133
+ "templateKind": "模板类型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "电子邮箱",
129
136
  "uiTypeMobile": "手机号",
@@ -124,6 +124,13 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
+ "templateCMSORDERDATA": "CMS訂單數據",
131
+ "templateCMSPODATA": "CMS採購數據",
132
+ "templateCMSSTOCKDATA": "CMS庫存數據",
133
+ "templateKind": "模板類型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "電子郵件",
129
136
  "uiTypeMobile": "手機號碼",
@@ -7,6 +7,7 @@ export * from "./dto/app/AppUpdateReadDto";
7
7
  export * from "./dto/app/CreateApiKeyData";
8
8
  export * from "./dto/authCode/AuthCodeAction";
9
9
  export * from "./rq/document/SystemDocumentListRQ";
10
+ export * from "./dto/document/DocumentKind";
10
11
  export * from "./dto/document/SystemDocumentListData";
11
12
  export * from "./dto/document/SystemDocumentViewData";
12
13
  export * from "./dto/member/MemberListDto";
package/lib/mjs/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./dto/app/AppUpdateReadDto";
8
8
  export * from "./dto/app/CreateApiKeyData";
9
9
  export * from "./dto/authCode/AuthCodeAction";
10
10
  export * from "./rq/document/SystemDocumentListRQ";
11
+ export * from "./dto/document/DocumentKind";
11
12
  export * from "./dto/document/SystemDocumentListData";
12
13
  export * from "./dto/document/SystemDocumentViewData";
13
14
  export * from "./dto/member/MemberListDto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "description": "TypeScript APIs for SmartERP Core",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
package/src/CoreApp.ts CHANGED
@@ -12,9 +12,10 @@ import {
12
12
  UserIdentifierType
13
13
  } from "@etsoo/appscript";
14
14
  import { AuthCodeApi } from "./AuthCodeApi";
15
- import { DataTypes, ListType } from "@etsoo/shared";
15
+ import { DataTypes, ListType, ListType1 } from "@etsoo/shared";
16
16
  import { CoreApiService } from "./dto/org/CoreApiService";
17
17
  import { DocumentApi } from "./DocumentApi";
18
+ import { DocumentKind } from "./dto/document/DocumentKind";
18
19
 
19
20
  type AppData = { id: number; appId?: number; name: string; localName?: string };
20
21
 
@@ -86,6 +87,21 @@ export interface ICoreApp {
86
87
  */
87
88
  getAppName(data: AppData): string;
88
89
 
90
+ /**
91
+ * Get document kind label
92
+ * 获取文档类型标签
93
+ * @param kind Kind
94
+ * @returns Label
95
+ */
96
+ getDocumentKind(kind?: DocumentKind): string | undefined;
97
+
98
+ /**
99
+ * Get document kinds
100
+ * 获取文档类型列表
101
+ * @returns List
102
+ */
103
+ getDocumentKinds(): ListType1[];
104
+
89
105
  /**
90
106
  * Get user identifier type label
91
107
  * 获取用户标识类型标签
@@ -257,6 +273,28 @@ export class CoreApp implements ICoreApp {
257
273
  );
258
274
  }
259
275
 
276
+ /**
277
+ * Get document kind label
278
+ * 获取文档类型标签
279
+ * @param kind Kind
280
+ * @returns Label
281
+ */
282
+ getDocumentKind(kind?: DocumentKind) {
283
+ if (kind == null) return undefined;
284
+
285
+ const key = DocumentKind[kind];
286
+ return this.app.get("template" + key) ?? key;
287
+ }
288
+
289
+ /**
290
+ * Get document kinds
291
+ * 获取文档类型列表
292
+ * @returns List
293
+ */
294
+ getDocumentKinds() {
295
+ return this.app.getEnumStrList(DocumentKind, "template");
296
+ }
297
+
260
298
  /**
261
299
  * Get user identifier type label
262
300
  * 获取用户标识类型标签
@@ -0,0 +1,28 @@
1
+ import { SelectEx, SelectExProps } from "@etsoo/materialui";
2
+ import { useRequiredAppContext } from "../../ICoreServiceApp";
3
+ import { ListType1 } from "@etsoo/shared";
4
+
5
+ /**
6
+ * Document kind list component
7
+ * @param props Props
8
+ * @returns Component
9
+ */
10
+ export function DocumentKindList(
11
+ props: Omit<SelectExProps<ListType1>, "options">
12
+ ) {
13
+ // App
14
+ const app = useRequiredAppContext();
15
+
16
+ // Destruct
17
+ const { label = app.get("templateKind"), name = "kind", ...rest } = props;
18
+
19
+ // Layout
20
+ return (
21
+ <SelectEx
22
+ label={label}
23
+ name={name}
24
+ options={app.core.getDocumentKinds()}
25
+ {...rest}
26
+ />
27
+ );
28
+ }
@@ -11,6 +11,7 @@ export * from "./app/StatusList";
11
11
  export * from "./app/UserRoleList";
12
12
 
13
13
  // document
14
+ export * from "./document/DocumentKindList";
14
15
  export * from "./document/SystemDocumentTiplist";
15
16
 
16
17
  // org
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Template document kind, the value should not exceed 20 characters
3
+ * 模板文档类型,值不能超过20个字符
4
+ */
5
+ export enum DocumentKind {
6
+ /**
7
+ * CMS asset check alert
8
+ * CMS资产检查警告
9
+ */
10
+ CMSASSETCHECKALERT = "CMSASSETCHECKALERT",
11
+
12
+ /**
13
+ * CMS asset expiry alert
14
+ * CMS资产过期警告
15
+ */
16
+ CMSASSETEXPIRYALERT = "CMSASSETEXPIRYALERT",
17
+
18
+ /**
19
+ * CMS customer data
20
+ * CMS客户数据
21
+ */
22
+ CMSCUSTOMERDATA = "CMSCUSTOMERDATA",
23
+
24
+ /**
25
+ * CMS order data
26
+ * CMS订单数据
27
+ */
28
+ CMSORDERDATA = "CMSORDERDATA",
29
+
30
+ /**
31
+ * CMS PO data
32
+ * CMS采购数据
33
+ */
34
+ CMSPODATA = "CMSPODATA",
35
+
36
+ /**
37
+ * CMS stock data
38
+ * CMS库存数据
39
+ */
40
+ CMSSTOCKDATA = "CMSSTOCKDATA"
41
+ }
package/src/i18n/en.json CHANGED
@@ -124,6 +124,13 @@
124
124
  "target": "Target",
125
125
  "targetId": "Target id",
126
126
  "template": "Template",
127
+ "templateCMSASSETCHECKALERT": "CMS asset check alert",
128
+ "templateCMSASSETEXPIRYALERT": "CMS asset expiry alert",
129
+ "templateCMSCUSTOMERDATA": "CMS customer data",
130
+ "templateCMSORDERDATA": "CMS order data",
131
+ "templateCMSPODATA": "CMS PO data",
132
+ "templateCMSSTOCKDATA": "CMS stock data",
133
+ "templateKind": "Template kind",
127
134
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
128
135
  "uiTypeEmail": "Email",
129
136
  "uiTypeMobile": "Mobile",
@@ -124,6 +124,13 @@
124
124
  "target": "目标",
125
125
  "targetId": "目标编号",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS资产检查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS资产过期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客户数据",
130
+ "templateCMSORDERDATA": "CMS订单数据",
131
+ "templateCMSPODATA": "CMS采购数据",
132
+ "templateCMSSTOCKDATA": "CMS库存数据",
133
+ "templateKind": "模板类型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "电子邮箱",
129
136
  "uiTypeMobile": "手机号",
@@ -124,6 +124,13 @@
124
124
  "target": "目標",
125
125
  "targetId": "目標編號",
126
126
  "template": "模板",
127
+ "templateCMSASSETCHECKALERT": "CMS資產檢查警告",
128
+ "templateCMSASSETEXPIRYALERT": "CMS資產過期警告",
129
+ "templateCMSCUSTOMERDATA": "CMS客戶數據",
130
+ "templateCMSORDERDATA": "CMS訂單數據",
131
+ "templateCMSPODATA": "CMS採購數據",
132
+ "templateCMSSTOCKDATA": "CMS庫存數據",
133
+ "templateKind": "模板類型",
127
134
  "years5": ["1年", "2年", "3年", "4年", "5年"],
128
135
  "uiTypeEmail": "電子郵件",
129
136
  "uiTypeMobile": "手機號碼",
package/src/index.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./dto/authCode/AuthCodeAction";
11
11
 
12
12
  export * from "./rq/document/SystemDocumentListRQ";
13
13
 
14
+ export * from "./dto/document/DocumentKind";
14
15
  export * from "./dto/document/SystemDocumentListData";
15
16
  export * from "./dto/document/SystemDocumentViewData";
16
17