1.0.6-pub

This commit is contained in:
Xu Chang 2024-05-17 16:31:55 +08:00
parent 2dd04c7cef
commit 022570d700
7 changed files with 89 additions and 10 deletions

View File

@ -20,7 +20,7 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
rowSelection?: any;
hideHeader?: boolean | undefined;
disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined;
size?: "small" | "large" | "middle" | undefined;
scroll?: ({
x?: string | number | true | undefined;
y?: string | number | undefined;
@ -45,7 +45,7 @@ declare const ListPro: <T extends keyof EntityDict>(props: {
tablePagination?: any;
rowSelection?: any;
disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined;
size?: "small" | "large" | "middle" | undefined;
scroll?: any;
locale?: any;
opWidth?: number | undefined;
@ -57,14 +57,14 @@ declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<En
data: Partial<EntityDict[T]["Schema"]>;
title?: string | undefined;
bordered?: boolean | undefined;
layout?: "vertical" | "horizontal" | undefined;
layout?: "horizontal" | "vertical" | undefined;
}>) => React.ReactElement;
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
helps: Record<string, string>;
entity: T;
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
data: EntityDict[T]["Schema"];
layout: "vertical" | "horizontal";
layout: "horizontal" | "vertical";
mode: "default" | "card";
}>) => React.ReactElement;
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };

View File

@ -4,5 +4,6 @@ import { RuntimeContext } from './RuntimeContext';
import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext';
export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends DependentBackendRuntimeContext<ED> implements RuntimeContext {
toString(): Promise<string>;
refineOpRecords(): Promise<void>;
}
export default BackendRuntimeContext;

View File

@ -1,9 +1,33 @@
import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext';
import { unset } from 'oak-domain/lib/utils/lodash';
export class BackendRuntimeContext extends DependentBackendRuntimeContext {
async toString() {
const data = await this.getSerializedData();
return JSON.stringify(data);
}
async refineOpRecords() {
await super.refineOpRecords();
for (const opRecord of this.opRecords) {
if (opRecord.a === 's') {
const { d } = opRecord;
for (const entity in d) {
if (['application', 'system'].includes(entity)) {
// todo 删除掉config中的敏感返回信息
const rowDict = d[entity];
for (const id in rowDict) {
const { payConfig } = rowDict[id];
if (payConfig) {
payConfig.forEach((config) => {
unset(config, 'publicKeyFilePath');
unset(config, 'privateKeyFilePath');
});
}
}
}
}
}
}
}
}
;
export default BackendRuntimeContext;

View File

@ -4,5 +4,6 @@ import { RuntimeContext } from './RuntimeContext';
import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext';
export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends DependentBackendRuntimeContext<ED> implements RuntimeContext {
toString(): Promise<string>;
refineOpRecords(): Promise<void>;
}
export default BackendRuntimeContext;

View File

@ -2,11 +2,35 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.BackendRuntimeContext = void 0;
const DependentContext_1 = require("./DependentContext");
const lodash_1 = require("oak-domain/lib/utils/lodash");
class BackendRuntimeContext extends DependentContext_1.BackendRuntimeContext {
async toString() {
const data = await this.getSerializedData();
return JSON.stringify(data);
}
async refineOpRecords() {
await super.refineOpRecords();
for (const opRecord of this.opRecords) {
if (opRecord.a === 's') {
const { d } = opRecord;
for (const entity in d) {
if (['application', 'system'].includes(entity)) {
// todo 删除掉config中的敏感返回信息
const rowDict = d[entity];
for (const id in rowDict) {
const { payConfig } = rowDict[id];
if (payConfig) {
payConfig.forEach((config) => {
(0, lodash_1.unset)(config, 'publicKeyFilePath');
(0, lodash_1.unset)(config, 'privateKeyFilePath');
});
}
}
}
}
}
}
}
}
exports.BackendRuntimeContext = BackendRuntimeContext;
;

View File

@ -50,11 +50,11 @@
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"oak-domain": "file:../oak-domain",
"oak-external-sdk": "file:../oak-external-sdk",
"oak-frontend-base": "file:../oak-frontend-base",
"oak-memory-tree-store": "file:../oak-memory-tree-store",
"oak-general-business": "file:../oak-general-business",
"oak-domain": "~5.0.7",
"oak-external-sdk": "~2.3.0",
"oak-frontend-base": "~5.0.8",
"oak-memory-tree-store": "~3.3.0",
"oak-general-business": "~5.0.8",
"react": "^18.2.0",
"react-dom": "^18.1.0",
"react-image-gallery": "^1.2.11",

View File

@ -1,13 +1,42 @@
import { EntityDict } from '@project/oak-app-domain';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
import { EntityDict as BaseEntityDict, SelectOpResult } from 'oak-domain/lib/types/Entity';
import { RuntimeContext } from './RuntimeContext';
import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext';
import { unset } from 'oak-domain/lib/utils/lodash';
export class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends DependentBackendRuntimeContext<ED> implements RuntimeContext {
async toString() {
const data = await this.getSerializedData();
return JSON.stringify(data);
}
async refineOpRecords(): Promise<void> {
await super.refineOpRecords();
for (const opRecord of this.opRecords) {
if (opRecord.a === 's') {
const { d } = opRecord as SelectOpResult<ED>;
for (const entity in d) {
if (
['application', 'system'].includes(entity)
) {
// todo 删除掉config中的敏感返回信息
const rowDict = d[entity as 'system'];
for (const id in rowDict) {
const { payConfig } = rowDict[id] as EntityDict['system']['OpSchema'];
if (payConfig) {
payConfig.forEach(
(config) => {
unset(config, 'publicKeyFilePath');
unset(config, 'privateKeyFilePath');
}
);
}
}
}
}
}
}
}
};
export default BackendRuntimeContext;