@etsoo/smarterp-core 1.1.44 → 1.1.45

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 (50) hide show
  1. package/lib/cjs/CoreApp.d.ts +11 -0
  2. package/lib/cjs/CoreApp.js +9 -0
  3. package/lib/cjs/DocumentApi.d.ts +29 -0
  4. package/lib/cjs/DocumentApi.js +36 -0
  5. package/lib/cjs/components/document/SystemDocumentList.d.ts +33 -0
  6. package/lib/cjs/components/document/SystemDocumentList.js +27 -0
  7. package/lib/cjs/components/index.d.ts +1 -0
  8. package/lib/cjs/components/index.js +2 -0
  9. package/lib/cjs/dto/document/SystemDocumentListData.d.ts +16 -0
  10. package/lib/cjs/dto/document/SystemDocumentListData.js +2 -0
  11. package/lib/cjs/dto/document/SystemDocumentViewData.d.ts +36 -0
  12. package/lib/cjs/dto/document/SystemDocumentViewData.js +2 -0
  13. package/lib/cjs/i18n/en.json +5 -0
  14. package/lib/cjs/i18n/zh-Hans.json +5 -0
  15. package/lib/cjs/i18n/zh-Hant.json +5 -0
  16. package/lib/cjs/index.d.ts +3 -0
  17. package/lib/cjs/index.js +3 -0
  18. package/lib/cjs/rq/document/SystemDocumentListRQ.d.ts +12 -0
  19. package/lib/cjs/rq/document/SystemDocumentListRQ.js +2 -0
  20. package/lib/mjs/CoreApp.d.ts +11 -0
  21. package/lib/mjs/CoreApp.js +9 -0
  22. package/lib/mjs/DocumentApi.d.ts +29 -0
  23. package/lib/mjs/DocumentApi.js +32 -0
  24. package/lib/mjs/components/document/SystemDocumentList.d.ts +33 -0
  25. package/lib/mjs/components/document/SystemDocumentList.js +24 -0
  26. package/lib/mjs/components/index.d.ts +1 -0
  27. package/lib/mjs/components/index.js +2 -0
  28. package/lib/mjs/dto/document/SystemDocumentListData.d.ts +16 -0
  29. package/lib/mjs/dto/document/SystemDocumentListData.js +1 -0
  30. package/lib/mjs/dto/document/SystemDocumentViewData.d.ts +36 -0
  31. package/lib/mjs/dto/document/SystemDocumentViewData.js +1 -0
  32. package/lib/mjs/i18n/en.json +5 -0
  33. package/lib/mjs/i18n/zh-Hans.json +5 -0
  34. package/lib/mjs/i18n/zh-Hant.json +5 -0
  35. package/lib/mjs/index.d.ts +3 -0
  36. package/lib/mjs/index.js +3 -0
  37. package/lib/mjs/rq/document/SystemDocumentListRQ.d.ts +12 -0
  38. package/lib/mjs/rq/document/SystemDocumentListRQ.js +1 -0
  39. package/package.json +1 -1
  40. package/src/CoreApp.ts +15 -0
  41. package/src/DocumentApi.ts +41 -0
  42. package/src/components/document/SystemDocumentList.tsx +82 -0
  43. package/src/components/index.ts +3 -0
  44. package/src/dto/document/SystemDocumentListData.ts +16 -0
  45. package/src/dto/document/SystemDocumentViewData.ts +36 -0
  46. package/src/i18n/en.json +5 -0
  47. package/src/i18n/zh-Hans.json +5 -0
  48. package/src/i18n/zh-Hant.json +5 -0
  49. package/src/index.ts +5 -0
  50. package/src/rq/document/SystemDocumentListRQ.ts +13 -0
@@ -8,6 +8,7 @@ import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } fr
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
9
  import { ListType } from "@etsoo/shared";
10
10
  import { CoreApiService } from "./dto/org/CoreApiService";
11
+ import { DocumentApi } from "./DocumentApi";
11
12
  type AppData = {
12
13
  id: number;
13
14
  appId?: number;
@@ -31,6 +32,10 @@ export interface ICoreApp {
31
32
  * Auth code API
32
33
  */
33
34
  readonly authCodeApi: AuthCodeApi;
35
+ /**
36
+ * Document API
37
+ */
38
+ readonly documentApi: DocumentApi;
34
39
  /**
35
40
  * Member API
36
41
  */
@@ -130,6 +135,12 @@ export declare class CoreApp implements ICoreApp {
130
135
  * 认证接口
131
136
  */
132
137
  get authCodeApi(): AuthCodeApi;
138
+ private _documentApi?;
139
+ /**
140
+ * Document API
141
+ * 文档接口
142
+ */
143
+ get documentApi(): DocumentApi;
133
144
  private _memberApi?;
134
145
  /**
135
146
  * Member API
@@ -10,6 +10,7 @@ const appscript_1 = require("@etsoo/appscript");
10
10
  const AuthCodeApi_1 = require("./AuthCodeApi");
11
11
  const shared_1 = require("@etsoo/shared");
12
12
  const CoreApiService_1 = require("./dto/org/CoreApiService");
13
+ const DocumentApi_1 = require("./DocumentApi");
13
14
  /**
14
15
  * Core application
15
16
  * 核心应用程序
@@ -41,6 +42,14 @@ class CoreApp {
41
42
  get authCodeApi() {
42
43
  return (this._authCodeApi ??= new AuthCodeApi_1.AuthCodeApi(this.app, this.api));
43
44
  }
45
+ _documentApi;
46
+ /**
47
+ * Document API
48
+ * 文档接口
49
+ */
50
+ get documentApi() {
51
+ return (this._documentApi ??= new DocumentApi_1.DocumentApi(this.app, this.api));
52
+ }
44
53
  _memberApi;
45
54
  /**
46
55
  * Member API
@@ -0,0 +1,29 @@
1
+ import { EntityApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
+ import { SystemDocumentListRQ } from "./rq/document/SystemDocumentListRQ";
3
+ import { SystemDocumentListData } from "./dto/document/SystemDocumentListData";
4
+ import { SystemDocumentViewData } from "./dto/document/SystemDocumentViewData";
5
+ /**
6
+ * Document API
7
+ */
8
+ export declare class DocumentApi extends EntityApi {
9
+ /**
10
+ * Constructor
11
+ * @param app Application
12
+ * @param api API
13
+ */
14
+ constructor(app: IApp, api?: IApi);
15
+ /**
16
+ * List
17
+ * @param rq Request data
18
+ * @param payload Payload
19
+ * @returns Result
20
+ */
21
+ list(rq: SystemDocumentListRQ, payload: IApiPayload<SystemDocumentListData[]>): Promise<SystemDocumentListData[] | undefined>;
22
+ /**
23
+ * Read
24
+ * @param id Id
25
+ * @param payload Payload
26
+ * @returns Result
27
+ */
28
+ read(id: number, payload?: IApiPayload<SystemDocumentViewData>): Promise<SystemDocumentViewData | undefined>;
29
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentApi = void 0;
4
+ const appscript_1 = require("@etsoo/appscript");
5
+ /**
6
+ * Document API
7
+ */
8
+ class DocumentApi extends appscript_1.EntityApi {
9
+ /**
10
+ * Constructor
11
+ * @param app Application
12
+ * @param api API
13
+ */
14
+ constructor(app, api = app.api) {
15
+ super("Document", app, api);
16
+ }
17
+ /**
18
+ * List
19
+ * @param rq Request data
20
+ * @param payload Payload
21
+ * @returns Result
22
+ */
23
+ list(rq, payload) {
24
+ return this.listBase(rq, payload);
25
+ }
26
+ /**
27
+ * Read
28
+ * @param id Id
29
+ * @param payload Payload
30
+ * @returns Result
31
+ */
32
+ read(id, payload) {
33
+ return this.readBase(id, payload);
34
+ }
35
+ }
36
+ exports.DocumentApi = DocumentApi;
@@ -0,0 +1,33 @@
1
+ import { TiplistProps } from "@etsoo/materialui";
2
+ import { SystemDocumentListData } from "../../dto/document/SystemDocumentListData";
3
+ import { SystemDocumentListRQ } from "../../rq/document/SystemDocumentListRQ";
4
+ /**
5
+ * System document tiplist properties
6
+ * 系统文档提示列表属性
7
+ */
8
+ export type SystemDocumentTiplistProps = Omit<TiplistProps<SystemDocumentListData, "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<SystemDocumentListRQ>;
21
+ /**
22
+ * Load data handler
23
+ * @param rq Request data
24
+ */
25
+ onLoadData?: (rq: SystemDocumentListRQ) => SystemDocumentListRQ;
26
+ };
27
+ /**
28
+ * System document tiplist
29
+ * 系统文档提示列表
30
+ * @param props Properties
31
+ * @returns Component
32
+ */
33
+ export declare function SystemDocumentTiplist(props: SystemDocumentTiplistProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SystemDocumentTiplist = SystemDocumentTiplist;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const materialui_1 = require("@etsoo/materialui");
6
+ const ICoreServiceApp_1 = require("../../ICoreServiceApp");
7
+ /**
8
+ * System document tiplist
9
+ * 系统文档提示列表
10
+ * @param props Properties
11
+ * @returns Component
12
+ */
13
+ function SystemDocumentTiplist(props) {
14
+ // App
15
+ const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
16
+ // Destruct
17
+ const { fullWidth = true, label = app.get("systemTemplate"), maxItems = 10, getOptionLabel = (data) => data.title, onLoadData = (rq) => rq, name = "systemDocumentId", rq = { enabled: true }, ...rest } = props;
18
+ // Layout
19
+ return ((0, jsx_runtime_1.jsx)(materialui_1.Tiplist, { label: label, getOptionLabel: getOptionLabel, name: name, fullWidth: fullWidth, maxItems: maxItems, loadData: (keyword, id, maxItems) => app.core.documentApi.list(onLoadData({
20
+ ...rq,
21
+ keyword,
22
+ id,
23
+ queryPaging: {
24
+ batchSize: maxItems
25
+ }
26
+ }), { showLoading: false, defaultValue: [] }), ...rest }));
27
+ }
@@ -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/SystemDocumentList";
9
10
  export * from "./org/ButtonApiServices";
10
11
  export * from "./org/OrgSwitchPopover";
11
12
  export * from "./org/OrgTiplist";
@@ -24,6 +24,8 @@ __exportStar(require("./app/IdentityTypeList"), exports);
24
24
  __exportStar(require("./app/SearchDays"), exports);
25
25
  __exportStar(require("./app/StatusList"), exports);
26
26
  __exportStar(require("./app/UserRoleList"), exports);
27
+ // document
28
+ __exportStar(require("./document/SystemDocumentList"), exports);
27
29
  // org
28
30
  __exportStar(require("./org/ButtonApiServices"), exports);
29
31
  __exportStar(require("./org/OrgSwitchPopover"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * System document list data
3
+ * 系统文档列表数据
4
+ */
5
+ export type SystemDocumentListData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Title
13
+ * 标题
14
+ */
15
+ title: string;
16
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
1
+ /**
2
+ * System document view data
3
+ * 系统文档浏览数据
4
+ */
5
+ export type SystemDocumentViewData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Kind
13
+ * 类型
14
+ */
15
+ kind: string;
16
+ /**
17
+ * Title
18
+ * 标题
19
+ */
20
+ title: string;
21
+ /**
22
+ * Parameters
23
+ * 参数
24
+ */
25
+ parameters?: unknown;
26
+ /**
27
+ * Template
28
+ * 模板
29
+ */
30
+ template: string;
31
+ /**
32
+ * Refresh time
33
+ * 刷新时间
34
+ */
35
+ refreshTime: Date | string;
36
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -33,11 +33,14 @@
33
33
  "days": "Days",
34
34
  "details": "Details",
35
35
  "directReports": "Direct reports",
36
+ "documentPreview": "Document preview",
37
+ "documentTemplates": "Document templates",
36
38
  "editAvatar": "Edit avatar",
37
39
  "editLogo": "Edit logo",
38
40
  "editResource": "Edit resource",
39
41
  "expandMenu": "Expand menu",
40
42
  "expandNavMenuAriaLabel": "Expand navigation menu",
43
+ "exportDocument": "Export document",
41
44
  "externalApis": "External APIs",
42
45
  "fileName": "File name",
43
46
  "fullName": "Full name",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "Switch to light mode",
115
118
  "switchOrg": "Switch organization",
116
119
  "subscribed": "Subscribed",
120
+ "systemTemplate": "System template",
117
121
  "target": "Target",
118
122
  "targetId": "Target id",
123
+ "template": "Template",
119
124
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
120
125
  "uiTypeEmail": "Email",
121
126
  "uiTypeMobile": "Mobile",
@@ -33,11 +33,14 @@
33
33
  "days": "天数",
34
34
  "details": "细节",
35
35
  "directReports": "直接下属",
36
+ "documentPreview": "文档预览",
37
+ "documentTemplates": "文档模板",
36
38
  "editAvatar": "修改头像",
37
39
  "editLogo": "修改图标",
38
40
  "editResource": "编辑资源",
39
41
  "expandMenu": "展开菜单",
40
42
  "expandNavMenuAriaLabel": "展开导航菜单",
43
+ "exportDocument": "导出文档",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全称",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切换到浅色模式",
115
118
  "switchOrg": "切换机构",
116
119
  "subscribed": "已订阅",
120
+ "systemTemplate": "系统模板",
117
121
  "target": "目标",
118
122
  "targetId": "目标编号",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "电子邮箱",
121
126
  "uiTypeMobile": "手机号",
@@ -33,11 +33,14 @@
33
33
  "days": "天數",
34
34
  "details": "細節",
35
35
  "directReports": "直接下屬",
36
+ "documentPreview": "文檔預覽",
37
+ "documentTemplates": "文檔模板",
36
38
  "editAvatar": "修改頭像",
37
39
  "editLogo": "修改圖標",
38
40
  "editResource": "編輯資源",
39
41
  "expandMenu": "展開菜單",
40
42
  "expandNavMenuAriaLabel": "展開導航菜單",
43
+ "exportDocument": "導出文檔",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全稱",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切換到淺色模式",
115
118
  "switchOrg": "切換機構",
116
119
  "subscribed": "已訂閱",
120
+ "systemTemplate": "系統模板",
117
121
  "target": "目標",
118
122
  "targetId": "目標編號",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "電子郵件",
121
126
  "uiTypeMobile": "手機號碼",
@@ -6,6 +6,9 @@ export * from "./dto/app/AppReadDto";
6
6
  export * from "./dto/app/AppUpdateReadDto";
7
7
  export * from "./dto/app/CreateApiKeyData";
8
8
  export * from "./dto/authCode/AuthCodeAction";
9
+ export * from "./rq/document/SystemDocumentListRQ";
10
+ export * from "./dto/document/SystemDocumentListData";
11
+ export * from "./dto/document/SystemDocumentViewData";
9
12
  export * from "./dto/member/MemberListDto";
10
13
  export * from "./dto/member/MemberQueryDto";
11
14
  export * from "./dto/member/MemberReadDto";
package/lib/cjs/index.js CHANGED
@@ -23,6 +23,9 @@ __exportStar(require("./dto/app/AppReadDto"), exports);
23
23
  __exportStar(require("./dto/app/AppUpdateReadDto"), exports);
24
24
  __exportStar(require("./dto/app/CreateApiKeyData"), exports);
25
25
  __exportStar(require("./dto/authCode/AuthCodeAction"), exports);
26
+ __exportStar(require("./rq/document/SystemDocumentListRQ"), exports);
27
+ __exportStar(require("./dto/document/SystemDocumentListData"), exports);
28
+ __exportStar(require("./dto/document/SystemDocumentViewData"), exports);
26
29
  __exportStar(require("./dto/member/MemberListDto"), exports);
27
30
  __exportStar(require("./dto/member/MemberQueryDto"), exports);
28
31
  __exportStar(require("./dto/member/MemberReadDto"), exports);
@@ -0,0 +1,12 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+ /**
3
+ * System Document list request data
4
+ * 系统文档列表请求数据
5
+ */
6
+ export type SystemDocumentListRQ = QueryRQ<number> & {
7
+ /**
8
+ * Kind
9
+ * 类型
10
+ */
11
+ kind?: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -8,6 +8,7 @@ import { AuthApi, IApp, IdentityType, IdentityTypeFlags, UserIdentifierType } fr
8
8
  import { AuthCodeApi } from "./AuthCodeApi";
9
9
  import { ListType } from "@etsoo/shared";
10
10
  import { CoreApiService } from "./dto/org/CoreApiService";
11
+ import { DocumentApi } from "./DocumentApi";
11
12
  type AppData = {
12
13
  id: number;
13
14
  appId?: number;
@@ -31,6 +32,10 @@ export interface ICoreApp {
31
32
  * Auth code API
32
33
  */
33
34
  readonly authCodeApi: AuthCodeApi;
35
+ /**
36
+ * Document API
37
+ */
38
+ readonly documentApi: DocumentApi;
34
39
  /**
35
40
  * Member API
36
41
  */
@@ -130,6 +135,12 @@ export declare class CoreApp implements ICoreApp {
130
135
  * 认证接口
131
136
  */
132
137
  get authCodeApi(): AuthCodeApi;
138
+ private _documentApi?;
139
+ /**
140
+ * Document API
141
+ * 文档接口
142
+ */
143
+ get documentApi(): DocumentApi;
133
144
  private _memberApi?;
134
145
  /**
135
146
  * Member API
@@ -7,6 +7,7 @@ import { AuthApi, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@e
7
7
  import { AuthCodeApi } from "./AuthCodeApi";
8
8
  import { DataTypes } from "@etsoo/shared";
9
9
  import { CoreApiService } from "./dto/org/CoreApiService";
10
+ import { DocumentApi } from "./DocumentApi";
10
11
  /**
11
12
  * Core application
12
13
  * 核心应用程序
@@ -38,6 +39,14 @@ export class CoreApp {
38
39
  get authCodeApi() {
39
40
  return (this._authCodeApi ??= new AuthCodeApi(this.app, this.api));
40
41
  }
42
+ _documentApi;
43
+ /**
44
+ * Document API
45
+ * 文档接口
46
+ */
47
+ get documentApi() {
48
+ return (this._documentApi ??= new DocumentApi(this.app, this.api));
49
+ }
41
50
  _memberApi;
42
51
  /**
43
52
  * Member API
@@ -0,0 +1,29 @@
1
+ import { EntityApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
+ import { SystemDocumentListRQ } from "./rq/document/SystemDocumentListRQ";
3
+ import { SystemDocumentListData } from "./dto/document/SystemDocumentListData";
4
+ import { SystemDocumentViewData } from "./dto/document/SystemDocumentViewData";
5
+ /**
6
+ * Document API
7
+ */
8
+ export declare class DocumentApi extends EntityApi {
9
+ /**
10
+ * Constructor
11
+ * @param app Application
12
+ * @param api API
13
+ */
14
+ constructor(app: IApp, api?: IApi);
15
+ /**
16
+ * List
17
+ * @param rq Request data
18
+ * @param payload Payload
19
+ * @returns Result
20
+ */
21
+ list(rq: SystemDocumentListRQ, payload: IApiPayload<SystemDocumentListData[]>): Promise<SystemDocumentListData[] | undefined>;
22
+ /**
23
+ * Read
24
+ * @param id Id
25
+ * @param payload Payload
26
+ * @returns Result
27
+ */
28
+ read(id: number, payload?: IApiPayload<SystemDocumentViewData>): Promise<SystemDocumentViewData | undefined>;
29
+ }
@@ -0,0 +1,32 @@
1
+ import { EntityApi } from "@etsoo/appscript";
2
+ /**
3
+ * Document API
4
+ */
5
+ export class DocumentApi extends EntityApi {
6
+ /**
7
+ * Constructor
8
+ * @param app Application
9
+ * @param api API
10
+ */
11
+ constructor(app, api = app.api) {
12
+ super("Document", 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
+ * Read
25
+ * @param id Id
26
+ * @param payload Payload
27
+ * @returns Result
28
+ */
29
+ read(id, payload) {
30
+ return this.readBase(id, payload);
31
+ }
32
+ }
@@ -0,0 +1,33 @@
1
+ import { TiplistProps } from "@etsoo/materialui";
2
+ import { SystemDocumentListData } from "../../dto/document/SystemDocumentListData";
3
+ import { SystemDocumentListRQ } from "../../rq/document/SystemDocumentListRQ";
4
+ /**
5
+ * System document tiplist properties
6
+ * 系统文档提示列表属性
7
+ */
8
+ export type SystemDocumentTiplistProps = Omit<TiplistProps<SystemDocumentListData, "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<SystemDocumentListRQ>;
21
+ /**
22
+ * Load data handler
23
+ * @param rq Request data
24
+ */
25
+ onLoadData?: (rq: SystemDocumentListRQ) => SystemDocumentListRQ;
26
+ };
27
+ /**
28
+ * System document tiplist
29
+ * 系统文档提示列表
30
+ * @param props Properties
31
+ * @returns Component
32
+ */
33
+ export declare function SystemDocumentTiplist(props: SystemDocumentTiplistProps): 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 { useRequiredAppContext } from "../../ICoreServiceApp";
4
+ /**
5
+ * System document tiplist
6
+ * 系统文档提示列表
7
+ * @param props Properties
8
+ * @returns Component
9
+ */
10
+ export function SystemDocumentTiplist(props) {
11
+ // App
12
+ const app = useRequiredAppContext();
13
+ // Destruct
14
+ const { fullWidth = true, label = app.get("systemTemplate"), maxItems = 10, getOptionLabel = (data) => data.title, onLoadData = (rq) => rq, name = "systemDocumentId", 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) => app.core.documentApi.list(onLoadData({
17
+ ...rq,
18
+ keyword,
19
+ id,
20
+ queryPaging: {
21
+ batchSize: maxItems
22
+ }
23
+ }), { showLoading: false, defaultValue: [] }), ...rest }));
24
+ }
@@ -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/SystemDocumentList";
9
10
  export * from "./org/ButtonApiServices";
10
11
  export * from "./org/OrgSwitchPopover";
11
12
  export * from "./org/OrgTiplist";
@@ -8,6 +8,8 @@ export * from "./app/IdentityTypeList";
8
8
  export * from "./app/SearchDays";
9
9
  export * from "./app/StatusList";
10
10
  export * from "./app/UserRoleList";
11
+ // document
12
+ export * from "./document/SystemDocumentList";
11
13
  // org
12
14
  export * from "./org/ButtonApiServices";
13
15
  export * from "./org/OrgSwitchPopover";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * System document list data
3
+ * 系统文档列表数据
4
+ */
5
+ export type SystemDocumentListData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Title
13
+ * 标题
14
+ */
15
+ title: string;
16
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ /**
2
+ * System document view data
3
+ * 系统文档浏览数据
4
+ */
5
+ export type SystemDocumentViewData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Kind
13
+ * 类型
14
+ */
15
+ kind: string;
16
+ /**
17
+ * Title
18
+ * 标题
19
+ */
20
+ title: string;
21
+ /**
22
+ * Parameters
23
+ * 参数
24
+ */
25
+ parameters?: unknown;
26
+ /**
27
+ * Template
28
+ * 模板
29
+ */
30
+ template: string;
31
+ /**
32
+ * Refresh time
33
+ * 刷新时间
34
+ */
35
+ refreshTime: Date | string;
36
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -33,11 +33,14 @@
33
33
  "days": "Days",
34
34
  "details": "Details",
35
35
  "directReports": "Direct reports",
36
+ "documentPreview": "Document preview",
37
+ "documentTemplates": "Document templates",
36
38
  "editAvatar": "Edit avatar",
37
39
  "editLogo": "Edit logo",
38
40
  "editResource": "Edit resource",
39
41
  "expandMenu": "Expand menu",
40
42
  "expandNavMenuAriaLabel": "Expand navigation menu",
43
+ "exportDocument": "Export document",
41
44
  "externalApis": "External APIs",
42
45
  "fileName": "File name",
43
46
  "fullName": "Full name",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "Switch to light mode",
115
118
  "switchOrg": "Switch organization",
116
119
  "subscribed": "Subscribed",
120
+ "systemTemplate": "System template",
117
121
  "target": "Target",
118
122
  "targetId": "Target id",
123
+ "template": "Template",
119
124
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
120
125
  "uiTypeEmail": "Email",
121
126
  "uiTypeMobile": "Mobile",
@@ -33,11 +33,14 @@
33
33
  "days": "天数",
34
34
  "details": "细节",
35
35
  "directReports": "直接下属",
36
+ "documentPreview": "文档预览",
37
+ "documentTemplates": "文档模板",
36
38
  "editAvatar": "修改头像",
37
39
  "editLogo": "修改图标",
38
40
  "editResource": "编辑资源",
39
41
  "expandMenu": "展开菜单",
40
42
  "expandNavMenuAriaLabel": "展开导航菜单",
43
+ "exportDocument": "导出文档",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全称",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切换到浅色模式",
115
118
  "switchOrg": "切换机构",
116
119
  "subscribed": "已订阅",
120
+ "systemTemplate": "系统模板",
117
121
  "target": "目标",
118
122
  "targetId": "目标编号",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "电子邮箱",
121
126
  "uiTypeMobile": "手机号",
@@ -33,11 +33,14 @@
33
33
  "days": "天數",
34
34
  "details": "細節",
35
35
  "directReports": "直接下屬",
36
+ "documentPreview": "文檔預覽",
37
+ "documentTemplates": "文檔模板",
36
38
  "editAvatar": "修改頭像",
37
39
  "editLogo": "修改圖標",
38
40
  "editResource": "編輯資源",
39
41
  "expandMenu": "展開菜單",
40
42
  "expandNavMenuAriaLabel": "展開導航菜單",
43
+ "exportDocument": "導出文檔",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全稱",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切換到淺色模式",
115
118
  "switchOrg": "切換機構",
116
119
  "subscribed": "已訂閱",
120
+ "systemTemplate": "系統模板",
117
121
  "target": "目標",
118
122
  "targetId": "目標編號",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "電子郵件",
121
126
  "uiTypeMobile": "手機號碼",
@@ -6,6 +6,9 @@ export * from "./dto/app/AppReadDto";
6
6
  export * from "./dto/app/AppUpdateReadDto";
7
7
  export * from "./dto/app/CreateApiKeyData";
8
8
  export * from "./dto/authCode/AuthCodeAction";
9
+ export * from "./rq/document/SystemDocumentListRQ";
10
+ export * from "./dto/document/SystemDocumentListData";
11
+ export * from "./dto/document/SystemDocumentViewData";
9
12
  export * from "./dto/member/MemberListDto";
10
13
  export * from "./dto/member/MemberQueryDto";
11
14
  export * from "./dto/member/MemberReadDto";
package/lib/mjs/index.js CHANGED
@@ -7,6 +7,9 @@ export * from "./dto/app/AppReadDto";
7
7
  export * from "./dto/app/AppUpdateReadDto";
8
8
  export * from "./dto/app/CreateApiKeyData";
9
9
  export * from "./dto/authCode/AuthCodeAction";
10
+ export * from "./rq/document/SystemDocumentListRQ";
11
+ export * from "./dto/document/SystemDocumentListData";
12
+ export * from "./dto/document/SystemDocumentViewData";
10
13
  export * from "./dto/member/MemberListDto";
11
14
  export * from "./dto/member/MemberQueryDto";
12
15
  export * from "./dto/member/MemberReadDto";
@@ -0,0 +1,12 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+ /**
3
+ * System Document list request data
4
+ * 系统文档列表请求数据
5
+ */
6
+ export type SystemDocumentListRQ = QueryRQ<number> & {
7
+ /**
8
+ * Kind
9
+ * 类型
10
+ */
11
+ kind?: string;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-core",
3
- "version": "1.1.44",
3
+ "version": "1.1.45",
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
@@ -14,6 +14,7 @@ import {
14
14
  import { AuthCodeApi } from "./AuthCodeApi";
15
15
  import { DataTypes, ListType } from "@etsoo/shared";
16
16
  import { CoreApiService } from "./dto/org/CoreApiService";
17
+ import { DocumentApi } from "./DocumentApi";
17
18
 
18
19
  type AppData = { id: number; appId?: number; name: string; localName?: string };
19
20
 
@@ -37,6 +38,11 @@ export interface ICoreApp {
37
38
  */
38
39
  readonly authCodeApi: AuthCodeApi;
39
40
 
41
+ /**
42
+ * Document API
43
+ */
44
+ readonly documentApi: DocumentApi;
45
+
40
46
  /**
41
47
  * Member API
42
48
  */
@@ -161,6 +167,15 @@ export class CoreApp implements ICoreApp {
161
167
  return (this._authCodeApi ??= new AuthCodeApi(this.app, this.api));
162
168
  }
163
169
 
170
+ private _documentApi?: DocumentApi;
171
+ /**
172
+ * Document API
173
+ * 文档接口
174
+ */
175
+ get documentApi() {
176
+ return (this._documentApi ??= new DocumentApi(this.app, this.api));
177
+ }
178
+
164
179
  private _memberApi?: MemberApi;
165
180
  /**
166
181
  * Member API
@@ -0,0 +1,41 @@
1
+ import { EntityApi, IApi, IApiPayload, IApp } from "@etsoo/appscript";
2
+ import { SystemDocumentListRQ } from "./rq/document/SystemDocumentListRQ";
3
+ import { SystemDocumentListData } from "./dto/document/SystemDocumentListData";
4
+ import { SystemDocumentViewData } from "./dto/document/SystemDocumentViewData";
5
+
6
+ /**
7
+ * Document API
8
+ */
9
+ export class DocumentApi extends EntityApi {
10
+ /**
11
+ * Constructor
12
+ * @param app Application
13
+ * @param api API
14
+ */
15
+ constructor(app: IApp, api: IApi = app.api) {
16
+ super("Document", app, api);
17
+ }
18
+
19
+ /**
20
+ * List
21
+ * @param rq Request data
22
+ * @param payload Payload
23
+ * @returns Result
24
+ */
25
+ list(
26
+ rq: SystemDocumentListRQ,
27
+ payload: IApiPayload<SystemDocumentListData[]>
28
+ ) {
29
+ return this.listBase(rq, payload);
30
+ }
31
+
32
+ /**
33
+ * Read
34
+ * @param id Id
35
+ * @param payload Payload
36
+ * @returns Result
37
+ */
38
+ read(id: number, payload?: IApiPayload<SystemDocumentViewData>) {
39
+ return this.readBase(id, payload);
40
+ }
41
+ }
@@ -0,0 +1,82 @@
1
+ import { Tiplist, TiplistProps } from "@etsoo/materialui";
2
+ import { useRequiredAppContext } from "../../ICoreServiceApp";
3
+ import { SystemDocumentListData } from "../../dto/document/SystemDocumentListData";
4
+ import { SystemDocumentListRQ } from "../../rq/document/SystemDocumentListRQ";
5
+
6
+ /**
7
+ * System document tiplist properties
8
+ * 系统文档提示列表属性
9
+ */
10
+ export type SystemDocumentTiplistProps = Omit<
11
+ TiplistProps<SystemDocumentListData, "id">,
12
+ "loadData" | "label" | "name"
13
+ > & {
14
+ /**
15
+ * Label
16
+ */
17
+ label?: string;
18
+
19
+ /**
20
+ * Name
21
+ */
22
+ name?: string;
23
+
24
+ /**
25
+ * Default request data
26
+ */
27
+ rq?: Partial<SystemDocumentListRQ>;
28
+
29
+ /**
30
+ * Load data handler
31
+ * @param rq Request data
32
+ */
33
+ onLoadData?: (rq: SystemDocumentListRQ) => SystemDocumentListRQ;
34
+ };
35
+
36
+ /**
37
+ * System document tiplist
38
+ * 系统文档提示列表
39
+ * @param props Properties
40
+ * @returns Component
41
+ */
42
+ export function SystemDocumentTiplist(props: SystemDocumentTiplistProps) {
43
+ // App
44
+ const app = useRequiredAppContext();
45
+
46
+ // Destruct
47
+ const {
48
+ fullWidth = true,
49
+ label = app.get("systemTemplate")!,
50
+ maxItems = 10,
51
+ getOptionLabel = (data) => data.title,
52
+ onLoadData = (rq) => rq,
53
+ name = "systemDocumentId",
54
+ rq = { enabled: true },
55
+ ...rest
56
+ } = props;
57
+
58
+ // Layout
59
+ return (
60
+ <Tiplist<SystemDocumentListData, "id">
61
+ label={label}
62
+ getOptionLabel={getOptionLabel}
63
+ name={name}
64
+ fullWidth={fullWidth}
65
+ maxItems={maxItems}
66
+ loadData={(keyword, id, maxItems) =>
67
+ app.core.documentApi.list(
68
+ onLoadData({
69
+ ...rq,
70
+ keyword,
71
+ id,
72
+ queryPaging: {
73
+ batchSize: maxItems
74
+ }
75
+ }),
76
+ { showLoading: false, defaultValue: [] }
77
+ )
78
+ }
79
+ {...rest}
80
+ />
81
+ );
82
+ }
@@ -10,6 +10,9 @@ export * from "./app/SearchDays";
10
10
  export * from "./app/StatusList";
11
11
  export * from "./app/UserRoleList";
12
12
 
13
+ // document
14
+ export * from "./document/SystemDocumentList";
15
+
13
16
  // org
14
17
  export * from "./org/ButtonApiServices";
15
18
  export * from "./org/OrgSwitchPopover";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * System document list data
3
+ * 系统文档列表数据
4
+ */
5
+ export type SystemDocumentListData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Title
13
+ * 标题
14
+ */
15
+ title: string;
16
+ };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * System document view data
3
+ * 系统文档浏览数据
4
+ */
5
+ export type SystemDocumentViewData = {
6
+ /**
7
+ * Id
8
+ * 编号
9
+ */
10
+ id: number;
11
+ /**
12
+ * Kind
13
+ * 类型
14
+ */
15
+ kind: string;
16
+ /**
17
+ * Title
18
+ * 标题
19
+ */
20
+ title: string;
21
+ /**
22
+ * Parameters
23
+ * 参数
24
+ */
25
+ parameters?: unknown;
26
+ /**
27
+ * Template
28
+ * 模板
29
+ */
30
+ template: string;
31
+ /**
32
+ * Refresh time
33
+ * 刷新时间
34
+ */
35
+ refreshTime: Date | string;
36
+ };
package/src/i18n/en.json CHANGED
@@ -33,11 +33,14 @@
33
33
  "days": "Days",
34
34
  "details": "Details",
35
35
  "directReports": "Direct reports",
36
+ "documentPreview": "Document preview",
37
+ "documentTemplates": "Document templates",
36
38
  "editAvatar": "Edit avatar",
37
39
  "editLogo": "Edit logo",
38
40
  "editResource": "Edit resource",
39
41
  "expandMenu": "Expand menu",
40
42
  "expandNavMenuAriaLabel": "Expand navigation menu",
43
+ "exportDocument": "Export document",
41
44
  "externalApis": "External APIs",
42
45
  "fileName": "File name",
43
46
  "fullName": "Full name",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "Switch to light mode",
115
118
  "switchOrg": "Switch organization",
116
119
  "subscribed": "Subscribed",
120
+ "systemTemplate": "System template",
117
121
  "target": "Target",
118
122
  "targetId": "Target id",
123
+ "template": "Template",
119
124
  "years5": ["1 year", "2 years", "3 years", "4 years", "5 years"],
120
125
  "uiTypeEmail": "Email",
121
126
  "uiTypeMobile": "Mobile",
@@ -33,11 +33,14 @@
33
33
  "days": "天数",
34
34
  "details": "细节",
35
35
  "directReports": "直接下属",
36
+ "documentPreview": "文档预览",
37
+ "documentTemplates": "文档模板",
36
38
  "editAvatar": "修改头像",
37
39
  "editLogo": "修改图标",
38
40
  "editResource": "编辑资源",
39
41
  "expandMenu": "展开菜单",
40
42
  "expandNavMenuAriaLabel": "展开导航菜单",
43
+ "exportDocument": "导出文档",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全称",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切换到浅色模式",
115
118
  "switchOrg": "切换机构",
116
119
  "subscribed": "已订阅",
120
+ "systemTemplate": "系统模板",
117
121
  "target": "目标",
118
122
  "targetId": "目标编号",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "电子邮箱",
121
126
  "uiTypeMobile": "手机号",
@@ -33,11 +33,14 @@
33
33
  "days": "天數",
34
34
  "details": "細節",
35
35
  "directReports": "直接下屬",
36
+ "documentPreview": "文檔預覽",
37
+ "documentTemplates": "文檔模板",
36
38
  "editAvatar": "修改頭像",
37
39
  "editLogo": "修改圖標",
38
40
  "editResource": "編輯資源",
39
41
  "expandMenu": "展開菜單",
40
42
  "expandNavMenuAriaLabel": "展開導航菜單",
43
+ "exportDocument": "導出文檔",
41
44
  "externalApis": "外部接口",
42
45
  "fileName": "文件名",
43
46
  "fullName": "全稱",
@@ -114,8 +117,10 @@
114
117
  "switchToLightModeAriaLabel": "切換到淺色模式",
115
118
  "switchOrg": "切換機構",
116
119
  "subscribed": "已訂閱",
120
+ "systemTemplate": "系統模板",
117
121
  "target": "目標",
118
122
  "targetId": "目標編號",
123
+ "template": "模板",
119
124
  "years5": ["1年", "2年", "3年", "4年", "5年"],
120
125
  "uiTypeEmail": "電子郵件",
121
126
  "uiTypeMobile": "手機號碼",
package/src/index.ts CHANGED
@@ -9,6 +9,11 @@ export * from "./dto/app/CreateApiKeyData";
9
9
 
10
10
  export * from "./dto/authCode/AuthCodeAction";
11
11
 
12
+ export * from "./rq/document/SystemDocumentListRQ";
13
+
14
+ export * from "./dto/document/SystemDocumentListData";
15
+ export * from "./dto/document/SystemDocumentViewData";
16
+
12
17
  export * from "./dto/member/MemberListDto";
13
18
  export * from "./dto/member/MemberQueryDto";
14
19
  export * from "./dto/member/MemberReadDto";
@@ -0,0 +1,13 @@
1
+ import { QueryRQ } from "@etsoo/appscript";
2
+
3
+ /**
4
+ * System Document list request data
5
+ * 系统文档列表请求数据
6
+ */
7
+ export type SystemDocumentListRQ = QueryRQ<number> & {
8
+ /**
9
+ * Kind
10
+ * 类型
11
+ */
12
+ kind?: string;
13
+ };