@etsoo/smarterp-core 1.0.79 → 1.0.81
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/lib/cjs/CoreApp.d.ts +12 -0
- package/lib/cjs/CoreApp.js +9 -0
- package/lib/cjs/components/index.d.ts +1 -0
- package/lib/cjs/components/index.js +1 -0
- package/lib/cjs/components/org/ButtonApiServices.d.ts +16 -0
- package/lib/cjs/components/org/ButtonApiServices.js +20 -0
- package/lib/cjs/dto/org/OrgQueryApiData.d.ts +10 -0
- package/lib/cjs/dto/org/OrgQueryDto.d.ts +6 -1
- package/lib/cjs/i18n/en.json +6 -1
- package/lib/cjs/i18n/zh-Hans.json +6 -1
- package/lib/cjs/i18n/zh-Hant.json +6 -1
- package/lib/mjs/CoreApp.d.ts +12 -0
- package/lib/mjs/CoreApp.js +9 -0
- package/lib/mjs/components/index.d.ts +1 -0
- package/lib/mjs/components/index.js +1 -0
- package/lib/mjs/components/org/ButtonApiServices.d.ts +16 -0
- package/lib/mjs/components/org/ButtonApiServices.js +14 -0
- package/lib/mjs/dto/org/OrgQueryApiData.d.ts +10 -0
- package/lib/mjs/dto/org/OrgQueryDto.d.ts +6 -1
- package/lib/mjs/i18n/en.json +6 -1
- package/lib/mjs/i18n/zh-Hans.json +6 -1
- package/lib/mjs/i18n/zh-Hant.json +6 -1
- package/package.json +3 -3
- package/src/CoreApp.ts +17 -0
- package/src/components/index.ts +1 -0
- package/src/components/org/ButtonApiServices.tsx +56 -0
- package/src/dto/org/OrgQueryApiData.ts +12 -0
- package/src/dto/org/OrgQueryDto.ts +7 -1
- package/src/i18n/en.json +6 -1
- package/src/i18n/zh-Hans.json +6 -1
- package/src/i18n/zh-Hant.json +6 -1
package/lib/cjs/CoreApp.d.ts
CHANGED
|
@@ -46,6 +46,12 @@ export interface ICoreApp {
|
|
|
46
46
|
* User API
|
|
47
47
|
*/
|
|
48
48
|
readonly userApi: UserApi;
|
|
49
|
+
/**
|
|
50
|
+
* Get API services
|
|
51
|
+
* 获取API服务列表
|
|
52
|
+
* @returns List of API services
|
|
53
|
+
*/
|
|
54
|
+
getApiServices(): ListType[];
|
|
49
55
|
/**
|
|
50
56
|
* Get app name
|
|
51
57
|
* 获取应用名称
|
|
@@ -147,6 +153,12 @@ export declare class CoreApp implements ICoreApp {
|
|
|
147
153
|
* @param api API
|
|
148
154
|
*/
|
|
149
155
|
constructor(app: IApp, api: IApi);
|
|
156
|
+
/**
|
|
157
|
+
* Get API services
|
|
158
|
+
* 获取API服务列表
|
|
159
|
+
* @returns List of API services
|
|
160
|
+
*/
|
|
161
|
+
getApiServices(): ListType[];
|
|
150
162
|
/**
|
|
151
163
|
* Get app name
|
|
152
164
|
* 获取应用名称
|
package/lib/cjs/CoreApp.js
CHANGED
|
@@ -9,6 +9,7 @@ const UserApi_1 = require("./UserApi");
|
|
|
9
9
|
const appscript_1 = require("@etsoo/appscript");
|
|
10
10
|
const AuthCodeApi_1 = require("./AuthCodeApi");
|
|
11
11
|
const shared_1 = require("@etsoo/shared");
|
|
12
|
+
const CoreApiService_1 = require("./dto/org/CoreApiService");
|
|
12
13
|
/**
|
|
13
14
|
* Core application
|
|
14
15
|
* 核心应用程序
|
|
@@ -82,6 +83,14 @@ class CoreApp {
|
|
|
82
83
|
this.app = app;
|
|
83
84
|
this.api = api;
|
|
84
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Get API services
|
|
88
|
+
* 获取API服务列表
|
|
89
|
+
* @returns List of API services
|
|
90
|
+
*/
|
|
91
|
+
getApiServices() {
|
|
92
|
+
return this.app.getEnumList(CoreApiService_1.CoreApiService, "api");
|
|
93
|
+
}
|
|
85
94
|
/**
|
|
86
95
|
* Get app name
|
|
87
96
|
* 获取应用名称
|
|
@@ -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 "./org/ButtonApiServices";
|
|
9
10
|
export * from "./org/OrgSwitchPopover";
|
|
10
11
|
export * from "./org/OrgTiplist";
|
|
11
12
|
export * from "./public/ButtonCultures";
|
|
@@ -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
|
// org
|
|
28
|
+
__exportStar(require("./org/ButtonApiServices"), exports);
|
|
28
29
|
__exportStar(require("./org/OrgSwitchPopover"), exports);
|
|
29
30
|
__exportStar(require("./org/OrgTiplist"), exports);
|
|
30
31
|
// public
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ListType } from "@etsoo/shared";
|
|
2
|
+
import { ButtonPopupRadioProps } from "@etsoo/materialui";
|
|
3
|
+
import { CoreApiService } from "../../dto/org/CoreApiService";
|
|
4
|
+
export type ButtonApiServicesProps = Omit<ButtonPopupRadioProps<ListType>, "labelField" | "loadData" | "value" | "onValueChange"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Value
|
|
7
|
+
* 值
|
|
8
|
+
*/
|
|
9
|
+
value?: CoreApiService;
|
|
10
|
+
/**
|
|
11
|
+
* Value change handler
|
|
12
|
+
* @param value New value
|
|
13
|
+
*/
|
|
14
|
+
onValueChange: (value: CoreApiService) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function ButtonApiServices(props: ButtonApiServicesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ButtonApiServices = ButtonApiServices;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const materialui_1 = require("@etsoo/materialui");
|
|
10
|
+
const ICoreServiceApp_1 = require("../../ICoreServiceApp");
|
|
11
|
+
function ButtonApiServices(props) {
|
|
12
|
+
// App
|
|
13
|
+
const app = (0, ICoreServiceApp_1.useRequiredAppContext)();
|
|
14
|
+
// Labels
|
|
15
|
+
const labels = app.getLabels("clickToChoose", "apiService");
|
|
16
|
+
// Destruct
|
|
17
|
+
const { inputName = "service", label = labels.apiService, labelEnd = labels.clickToChoose, onValueChange, value, ...rest } = props;
|
|
18
|
+
const services = react_1.default.useMemo(() => app.core.getApiServices(), []);
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(materialui_1.ButtonPopupRadio, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData: services, onValueChange: (value) => onValueChange(value), value: value, ...rest }));
|
|
20
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityStatus } from "@etsoo/appscript";
|
|
1
|
+
import { EntityStatus, UserRole } from "@etsoo/appscript";
|
|
2
2
|
/**
|
|
3
3
|
* Organization query data
|
|
4
4
|
* 机构查询数据
|
|
@@ -36,6 +36,11 @@ export type OrgQueryDto = {
|
|
|
36
36
|
* Creation
|
|
37
37
|
*/
|
|
38
38
|
creation: Date | string;
|
|
39
|
+
/**
|
|
40
|
+
* User role
|
|
41
|
+
* 用户角色
|
|
42
|
+
*/
|
|
43
|
+
userRole?: UserRole;
|
|
39
44
|
/**
|
|
40
45
|
* User status
|
|
41
46
|
*/
|
package/lib/cjs/i18n/en.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "Current user",
|
|
3
3
|
"addApi": "Add API",
|
|
4
4
|
"addResource": "Add resource",
|
|
5
|
+
"allowInheritance": "Allow inheritance",
|
|
6
|
+
"apiService": "API service",
|
|
7
|
+
"appId": "App key or username",
|
|
5
8
|
"appKey": "App key",
|
|
6
9
|
"appSecret": "App secret",
|
|
7
10
|
"app": "App",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "ID",
|
|
64
67
|
"preferredName": "Preferred name",
|
|
65
68
|
"queryKeyword": "Query keyword",
|
|
69
|
+
"ratePolicy": "Rate policy",
|
|
66
70
|
"refreshTime": "Refresh time",
|
|
67
71
|
"relatedTarget": "Related target",
|
|
68
72
|
"reportTo": "Report to",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "WeChat",
|
|
99
103
|
"uiTypeAlipay": "Alipay",
|
|
100
104
|
"uiTypeGoogle": "Google",
|
|
101
|
-
"uiTypeMicrosoft": "Microsoft"
|
|
105
|
+
"uiTypeMicrosoft": "Microsoft",
|
|
106
|
+
"updatedAt": "Updated at"
|
|
102
107
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "当前用户",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加资源",
|
|
5
|
+
"allowInheritance": "允许继承",
|
|
6
|
+
"apiService": "接口服务",
|
|
7
|
+
"appId": "应用键或用户名",
|
|
5
8
|
"appKey": "应用键",
|
|
6
9
|
"appSecret": "应用密钥",
|
|
7
10
|
"app": "应用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份证号码",
|
|
64
67
|
"preferredName": "首选名称",
|
|
65
68
|
"queryKeyword": "查询关键字",
|
|
69
|
+
"ratePolicy": "频率策略",
|
|
66
70
|
"refreshTime": "刷新时间",
|
|
67
71
|
"relatedTarget": "关联对象",
|
|
68
72
|
"reportTo": "汇报对象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付宝",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微软"
|
|
105
|
+
"uiTypeMicrosoft": "微软",
|
|
106
|
+
"updatedAt": "更新时间"
|
|
102
107
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "當前用戶",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加資源",
|
|
5
|
+
"allowInheritance": "允許繼承",
|
|
6
|
+
"apiService": "接口服務",
|
|
7
|
+
"appId": "應用鍵或用戶名",
|
|
5
8
|
"appKey": "應用程式鍵",
|
|
6
9
|
"appSecret": "應用金鑰",
|
|
7
10
|
"app": "應用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份證號碼",
|
|
64
67
|
"preferredName": "首選名稱",
|
|
65
68
|
"queryKeyword": "查詢關鍵字",
|
|
69
|
+
"ratePolicy": "頻率策略",
|
|
66
70
|
"refreshTime": "刷新時間",
|
|
67
71
|
"relatedTarget": "關聯對象",
|
|
68
72
|
"reportTo": "匯報對象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付寶",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微軟"
|
|
105
|
+
"uiTypeMicrosoft": "微軟",
|
|
106
|
+
"updatedAt": "更新時間"
|
|
102
107
|
}
|
package/lib/mjs/CoreApp.d.ts
CHANGED
|
@@ -46,6 +46,12 @@ export interface ICoreApp {
|
|
|
46
46
|
* User API
|
|
47
47
|
*/
|
|
48
48
|
readonly userApi: UserApi;
|
|
49
|
+
/**
|
|
50
|
+
* Get API services
|
|
51
|
+
* 获取API服务列表
|
|
52
|
+
* @returns List of API services
|
|
53
|
+
*/
|
|
54
|
+
getApiServices(): ListType[];
|
|
49
55
|
/**
|
|
50
56
|
* Get app name
|
|
51
57
|
* 获取应用名称
|
|
@@ -147,6 +153,12 @@ export declare class CoreApp implements ICoreApp {
|
|
|
147
153
|
* @param api API
|
|
148
154
|
*/
|
|
149
155
|
constructor(app: IApp, api: IApi);
|
|
156
|
+
/**
|
|
157
|
+
* Get API services
|
|
158
|
+
* 获取API服务列表
|
|
159
|
+
* @returns List of API services
|
|
160
|
+
*/
|
|
161
|
+
getApiServices(): ListType[];
|
|
150
162
|
/**
|
|
151
163
|
* Get app name
|
|
152
164
|
* 获取应用名称
|
package/lib/mjs/CoreApp.js
CHANGED
|
@@ -6,6 +6,7 @@ import { UserApi } from "./UserApi";
|
|
|
6
6
|
import { AuthApi, IdentityType, IdentityTypeFlags, UserIdentifierType } from "@etsoo/appscript";
|
|
7
7
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
8
8
|
import { DataTypes } from "@etsoo/shared";
|
|
9
|
+
import { CoreApiService } from "./dto/org/CoreApiService";
|
|
9
10
|
/**
|
|
10
11
|
* Core application
|
|
11
12
|
* 核心应用程序
|
|
@@ -79,6 +80,14 @@ export class CoreApp {
|
|
|
79
80
|
this.app = app;
|
|
80
81
|
this.api = api;
|
|
81
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Get API services
|
|
85
|
+
* 获取API服务列表
|
|
86
|
+
* @returns List of API services
|
|
87
|
+
*/
|
|
88
|
+
getApiServices() {
|
|
89
|
+
return this.app.getEnumList(CoreApiService, "api");
|
|
90
|
+
}
|
|
82
91
|
/**
|
|
83
92
|
* Get app name
|
|
84
93
|
* 获取应用名称
|
|
@@ -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 "./org/ButtonApiServices";
|
|
9
10
|
export * from "./org/OrgSwitchPopover";
|
|
10
11
|
export * from "./org/OrgTiplist";
|
|
11
12
|
export * from "./public/ButtonCultures";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ListType } from "@etsoo/shared";
|
|
2
|
+
import { ButtonPopupRadioProps } from "@etsoo/materialui";
|
|
3
|
+
import { CoreApiService } from "../../dto/org/CoreApiService";
|
|
4
|
+
export type ButtonApiServicesProps = Omit<ButtonPopupRadioProps<ListType>, "labelField" | "loadData" | "value" | "onValueChange"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Value
|
|
7
|
+
* 值
|
|
8
|
+
*/
|
|
9
|
+
value?: CoreApiService;
|
|
10
|
+
/**
|
|
11
|
+
* Value change handler
|
|
12
|
+
* @param value New value
|
|
13
|
+
*/
|
|
14
|
+
onValueChange: (value: CoreApiService) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare function ButtonApiServices(props: ButtonApiServicesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ButtonPopupRadio } from "@etsoo/materialui";
|
|
4
|
+
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
5
|
+
export function ButtonApiServices(props) {
|
|
6
|
+
// App
|
|
7
|
+
const app = useRequiredAppContext();
|
|
8
|
+
// Labels
|
|
9
|
+
const labels = app.getLabels("clickToChoose", "apiService");
|
|
10
|
+
// Destruct
|
|
11
|
+
const { inputName = "service", label = labels.apiService, labelEnd = labels.clickToChoose, onValueChange, value, ...rest } = props;
|
|
12
|
+
const services = React.useMemo(() => app.core.getApiServices(), []);
|
|
13
|
+
return (_jsx(ButtonPopupRadio, { inputName: inputName, label: label, labelFormatter: (data) => data.label, labelEnd: labelEnd, labelField: "label", loadData: services, onValueChange: (value) => onValueChange(value), value: value, ...rest }));
|
|
14
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityStatus } from "@etsoo/appscript";
|
|
1
|
+
import { EntityStatus, UserRole } from "@etsoo/appscript";
|
|
2
2
|
/**
|
|
3
3
|
* Organization query data
|
|
4
4
|
* 机构查询数据
|
|
@@ -36,6 +36,11 @@ export type OrgQueryDto = {
|
|
|
36
36
|
* Creation
|
|
37
37
|
*/
|
|
38
38
|
creation: Date | string;
|
|
39
|
+
/**
|
|
40
|
+
* User role
|
|
41
|
+
* 用户角色
|
|
42
|
+
*/
|
|
43
|
+
userRole?: UserRole;
|
|
39
44
|
/**
|
|
40
45
|
* User status
|
|
41
46
|
*/
|
package/lib/mjs/i18n/en.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "Current user",
|
|
3
3
|
"addApi": "Add API",
|
|
4
4
|
"addResource": "Add resource",
|
|
5
|
+
"allowInheritance": "Allow inheritance",
|
|
6
|
+
"apiService": "API service",
|
|
7
|
+
"appId": "App key or username",
|
|
5
8
|
"appKey": "App key",
|
|
6
9
|
"appSecret": "App secret",
|
|
7
10
|
"app": "App",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "ID",
|
|
64
67
|
"preferredName": "Preferred name",
|
|
65
68
|
"queryKeyword": "Query keyword",
|
|
69
|
+
"ratePolicy": "Rate policy",
|
|
66
70
|
"refreshTime": "Refresh time",
|
|
67
71
|
"relatedTarget": "Related target",
|
|
68
72
|
"reportTo": "Report to",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "WeChat",
|
|
99
103
|
"uiTypeAlipay": "Alipay",
|
|
100
104
|
"uiTypeGoogle": "Google",
|
|
101
|
-
"uiTypeMicrosoft": "Microsoft"
|
|
105
|
+
"uiTypeMicrosoft": "Microsoft",
|
|
106
|
+
"updatedAt": "Updated at"
|
|
102
107
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "当前用户",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加资源",
|
|
5
|
+
"allowInheritance": "允许继承",
|
|
6
|
+
"apiService": "接口服务",
|
|
7
|
+
"appId": "应用键或用户名",
|
|
5
8
|
"appKey": "应用键",
|
|
6
9
|
"appSecret": "应用密钥",
|
|
7
10
|
"app": "应用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份证号码",
|
|
64
67
|
"preferredName": "首选名称",
|
|
65
68
|
"queryKeyword": "查询关键字",
|
|
69
|
+
"ratePolicy": "频率策略",
|
|
66
70
|
"refreshTime": "刷新时间",
|
|
67
71
|
"relatedTarget": "关联对象",
|
|
68
72
|
"reportTo": "汇报对象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付宝",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微软"
|
|
105
|
+
"uiTypeMicrosoft": "微软",
|
|
106
|
+
"updatedAt": "更新时间"
|
|
102
107
|
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "當前用戶",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加資源",
|
|
5
|
+
"allowInheritance": "允許繼承",
|
|
6
|
+
"apiService": "接口服務",
|
|
7
|
+
"appId": "應用鍵或用戶名",
|
|
5
8
|
"appKey": "應用程式鍵",
|
|
6
9
|
"appSecret": "應用金鑰",
|
|
7
10
|
"app": "應用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份證號碼",
|
|
64
67
|
"preferredName": "首選名稱",
|
|
65
68
|
"queryKeyword": "查詢關鍵字",
|
|
69
|
+
"ratePolicy": "頻率策略",
|
|
66
70
|
"refreshTime": "刷新時間",
|
|
67
71
|
"relatedTarget": "關聯對象",
|
|
68
72
|
"reportTo": "匯報對象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付寶",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微軟"
|
|
105
|
+
"uiTypeMicrosoft": "微軟",
|
|
106
|
+
"updatedAt": "更新時間"
|
|
102
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/smarterp-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
4
4
|
"description": "TypeScript APIs for SmartERP Core",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@vitejs/plugin-react": "^4.5.2",
|
|
51
51
|
"jsdom": "^26.1.0",
|
|
52
52
|
"typescript": "^5.8.3",
|
|
53
|
-
"vitest": "^3.2.
|
|
53
|
+
"vitest": "^3.2.4"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@etsoo/appscript": "^1.6.40",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@etsoo/react": "^1.8.49",
|
|
59
59
|
"@etsoo/shared": "^1.2.75",
|
|
60
60
|
"@etsoo/toolpad": "^1.0.39",
|
|
61
|
-
"@mui/material": "^7.1.
|
|
61
|
+
"@mui/material": "^7.1.2",
|
|
62
62
|
"react": "^18.3.1",
|
|
63
63
|
"react-dom": "^18.3.1"
|
|
64
64
|
}
|
package/src/CoreApp.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "@etsoo/appscript";
|
|
14
14
|
import { AuthCodeApi } from "./AuthCodeApi";
|
|
15
15
|
import { DataTypes, ListType } from "@etsoo/shared";
|
|
16
|
+
import { CoreApiService } from "./dto/org/CoreApiService";
|
|
16
17
|
|
|
17
18
|
type AppData = { id: number; appId?: number; name: string; localName?: string };
|
|
18
19
|
|
|
@@ -56,6 +57,13 @@ export interface ICoreApp {
|
|
|
56
57
|
*/
|
|
57
58
|
readonly userApi: UserApi;
|
|
58
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Get API services
|
|
62
|
+
* 获取API服务列表
|
|
63
|
+
* @returns List of API services
|
|
64
|
+
*/
|
|
65
|
+
getApiServices(): ListType[];
|
|
66
|
+
|
|
59
67
|
/**
|
|
60
68
|
* Get app name
|
|
61
69
|
* 获取应用名称
|
|
@@ -189,6 +197,15 @@ export class CoreApp implements ICoreApp {
|
|
|
189
197
|
*/
|
|
190
198
|
constructor(public readonly app: IApp, public readonly api: IApi) {}
|
|
191
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Get API services
|
|
202
|
+
* 获取API服务列表
|
|
203
|
+
* @returns List of API services
|
|
204
|
+
*/
|
|
205
|
+
getApiServices() {
|
|
206
|
+
return this.app.getEnumList(CoreApiService, "api");
|
|
207
|
+
}
|
|
208
|
+
|
|
192
209
|
/**
|
|
193
210
|
* Get app name
|
|
194
211
|
* 获取应用名称
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ListType } from "@etsoo/shared";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ButtonPopupRadio, ButtonPopupRadioProps } from "@etsoo/materialui";
|
|
4
|
+
import { CoreApiService } from "../../dto/org/CoreApiService";
|
|
5
|
+
import { useRequiredAppContext } from "../../ICoreServiceApp";
|
|
6
|
+
|
|
7
|
+
export type ButtonApiServicesProps = Omit<
|
|
8
|
+
ButtonPopupRadioProps<ListType>,
|
|
9
|
+
"labelField" | "loadData" | "value" | "onValueChange"
|
|
10
|
+
> & {
|
|
11
|
+
/**
|
|
12
|
+
* Value
|
|
13
|
+
* 值
|
|
14
|
+
*/
|
|
15
|
+
value?: CoreApiService;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Value change handler
|
|
19
|
+
* @param value New value
|
|
20
|
+
*/
|
|
21
|
+
onValueChange: (value: CoreApiService) => void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function ButtonApiServices(props: ButtonApiServicesProps) {
|
|
25
|
+
// App
|
|
26
|
+
const app = useRequiredAppContext();
|
|
27
|
+
|
|
28
|
+
// Labels
|
|
29
|
+
const labels = app.getLabels("clickToChoose", "apiService");
|
|
30
|
+
|
|
31
|
+
// Destruct
|
|
32
|
+
const {
|
|
33
|
+
inputName = "service",
|
|
34
|
+
label = labels.apiService,
|
|
35
|
+
labelEnd = labels.clickToChoose,
|
|
36
|
+
onValueChange,
|
|
37
|
+
value,
|
|
38
|
+
...rest
|
|
39
|
+
} = props;
|
|
40
|
+
|
|
41
|
+
const services = React.useMemo(() => app.core.getApiServices(), []);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<ButtonPopupRadio<ListType>
|
|
45
|
+
inputName={inputName}
|
|
46
|
+
label={label}
|
|
47
|
+
labelFormatter={(data) => data.label}
|
|
48
|
+
labelEnd={labelEnd}
|
|
49
|
+
labelField="label"
|
|
50
|
+
loadData={services}
|
|
51
|
+
onValueChange={(value) => onValueChange(value)}
|
|
52
|
+
value={value}
|
|
53
|
+
{...rest}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityStatus } from "@etsoo/appscript";
|
|
1
|
+
import { EntityStatus, UserRole } from "@etsoo/appscript";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Organization query data
|
|
@@ -45,6 +45,12 @@ export type OrgQueryDto = {
|
|
|
45
45
|
*/
|
|
46
46
|
creation: Date | string;
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* User role
|
|
50
|
+
* 用户角色
|
|
51
|
+
*/
|
|
52
|
+
userRole?: UserRole;
|
|
53
|
+
|
|
48
54
|
/**
|
|
49
55
|
* User status
|
|
50
56
|
*/
|
package/src/i18n/en.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "Current user",
|
|
3
3
|
"addApi": "Add API",
|
|
4
4
|
"addResource": "Add resource",
|
|
5
|
+
"allowInheritance": "Allow inheritance",
|
|
6
|
+
"apiService": "API service",
|
|
7
|
+
"appId": "App key or username",
|
|
5
8
|
"appKey": "App key",
|
|
6
9
|
"appSecret": "App secret",
|
|
7
10
|
"app": "App",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "ID",
|
|
64
67
|
"preferredName": "Preferred name",
|
|
65
68
|
"queryKeyword": "Query keyword",
|
|
69
|
+
"ratePolicy": "Rate policy",
|
|
66
70
|
"refreshTime": "Refresh time",
|
|
67
71
|
"relatedTarget": "Related target",
|
|
68
72
|
"reportTo": "Report to",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "WeChat",
|
|
99
103
|
"uiTypeAlipay": "Alipay",
|
|
100
104
|
"uiTypeGoogle": "Google",
|
|
101
|
-
"uiTypeMicrosoft": "Microsoft"
|
|
105
|
+
"uiTypeMicrosoft": "Microsoft",
|
|
106
|
+
"updatedAt": "Updated at"
|
|
102
107
|
}
|
package/src/i18n/zh-Hans.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "当前用户",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加资源",
|
|
5
|
+
"allowInheritance": "允许继承",
|
|
6
|
+
"apiService": "接口服务",
|
|
7
|
+
"appId": "应用键或用户名",
|
|
5
8
|
"appKey": "应用键",
|
|
6
9
|
"appSecret": "应用密钥",
|
|
7
10
|
"app": "应用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份证号码",
|
|
64
67
|
"preferredName": "首选名称",
|
|
65
68
|
"queryKeyword": "查询关键字",
|
|
69
|
+
"ratePolicy": "频率策略",
|
|
66
70
|
"refreshTime": "刷新时间",
|
|
67
71
|
"relatedTarget": "关联对象",
|
|
68
72
|
"reportTo": "汇报对象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付宝",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微软"
|
|
105
|
+
"uiTypeMicrosoft": "微软",
|
|
106
|
+
"updatedAt": "更新时间"
|
|
102
107
|
}
|
package/src/i18n/zh-Hant.json
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
"accountIconButtonAriaLabel": "當前用戶",
|
|
3
3
|
"addApi": "添加接口",
|
|
4
4
|
"addResource": "添加資源",
|
|
5
|
+
"allowInheritance": "允許繼承",
|
|
6
|
+
"apiService": "接口服務",
|
|
7
|
+
"appId": "應用鍵或用戶名",
|
|
5
8
|
"appKey": "應用程式鍵",
|
|
6
9
|
"appSecret": "應用金鑰",
|
|
7
10
|
"app": "應用",
|
|
@@ -63,6 +66,7 @@
|
|
|
63
66
|
"pin": "身份證號碼",
|
|
64
67
|
"preferredName": "首選名稱",
|
|
65
68
|
"queryKeyword": "查詢關鍵字",
|
|
69
|
+
"ratePolicy": "頻率策略",
|
|
66
70
|
"refreshTime": "刷新時間",
|
|
67
71
|
"relatedTarget": "關聯對象",
|
|
68
72
|
"reportTo": "匯報對象",
|
|
@@ -98,5 +102,6 @@
|
|
|
98
102
|
"uiTypeWechat": "微信",
|
|
99
103
|
"uiTypeAlipay": "支付寶",
|
|
100
104
|
"uiTypeGoogle": "谷歌",
|
|
101
|
-
"uiTypeMicrosoft": "微軟"
|
|
105
|
+
"uiTypeMicrosoft": "微軟",
|
|
106
|
+
"updatedAt": "更新時間"
|
|
102
107
|
}
|