修改了一些小的声明

This commit is contained in:
Xu Chang 2024-06-27 18:38:57 +08:00
parent f9b58f983f
commit d7bc1122f1
14 changed files with 36 additions and 26 deletions

View File

@ -1,9 +1,9 @@
import { BRC } from '../types/RuntimeCxt';
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
import { EntityDict } from '../oak-app-domain';
export type AspectDict = {
export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: {
accountId: string;
price: number;
withdrawAccountId?: string;
}, context: BRC) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
};

View File

@ -1,4 +1,5 @@
import { EntityDict } from '../oak-app-domain';
import { AspectDict } from './AspectDict';
declare const aspectDict: AspectDict;
declare const aspectDict: AspectDict<EntityDict>;
export default aspectDict;
export { AspectDict, };

View File

@ -21,7 +21,12 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
hideHeader?: boolean | undefined;
disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined;
scroll?: any;
scroll?: ({
x?: string | number | true | undefined;
y?: string | number | undefined;
} & {
scrollToFirstRowOnChange?: boolean | undefined;
}) | undefined;
locale?: any;
opWidth?: number | undefined;
}>) => React.ReactElement;
@ -53,14 +58,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

@ -105,9 +105,7 @@ export default function render(props) {
<span className={Styles.value}>{ThousandCont(ToYuan(data.price || 0), 2)}</span>
</div>
<div className={Styles.bottom}>
<Button
// type="primary"
onClick={() => {
<Button onClick={() => {
setShowHistoryAcc({ entity, data });
setShowHistoryList(true);
}} style={{ marginRight: 8, }}>
@ -137,7 +135,10 @@ export default function render(props) {
<Modal destroyOnClose open={showHistoryList} onCancel={() => {
setShowHistoryAcc(undefined);
setShowHistoryList(false);
}} width={800} title={showHistoryAcc.entity === 'offlineAccount' ? `${t(`${showHistoryAcc.entity}:v.type.${showHistoryAcc.data.type}`)}-${t('history')}` : `${t(`${showHistoryAcc.entity}:name`)}-${t('history')}`} footer={null}>
}} width={800} title={showHistoryAcc.entity === 'offlineAccount' ?
(showHistoryAcc.data.type === 'bank' ?
`${t(`${showHistoryAcc.entity}:v.type.${showHistoryAcc.data.type}`)}-${showHistoryAcc.data.channel}-${t('history')}`
: `${t(`${showHistoryAcc.entity}:v.type.${showHistoryAcc.data.type}`)}-${showHistoryAcc.data.name}-${t('history')}`) : `${t(`${showHistoryAcc.entity}:name`)}-${t('history')}`} footer={null}>
<div style={{ height: '65vh' }}>
<SysAccountOperList entity={showHistoryAcc.entity} entityId={showHistoryAcc.data.id} oakPath="$opb-sysAccount-survery-operList"/>
</div>

View File

@ -34,7 +34,8 @@ export const desc = {
: {
type: "object"
},
entity: {
entity // 如果为true则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio则全额退款)
: {
type: "varchar",
params: {
length: 32

View File

@ -8,5 +8,5 @@ import { FeatureDict as Ogb0FeatureDict, AspectDict as Ogb0AspectDict } from "oa
export type BRC = BackendRuntimeContext<EntityDict>;
export type FRC = FrontendRuntimeContext<EntityDict>;
export type RuntimeCxt = FRC | BRC;
export type AAD = AspectDict & Ogb0AspectDict<EntityDict>;
export type AAD = AspectDict<EntityDict> & Ogb0AspectDict<EntityDict>;
export type AFD = FeatureDict<EntityDict> & BasicFeatures<EntityDict> & Ogb0FeatureDict<EntityDict>;

View File

@ -1,9 +1,9 @@
import { BRC } from '../types/RuntimeCxt';
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
import { EntityDict } from '../oak-app-domain';
export type AspectDict = {
export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: {
accountId: string;
price: number;
withdrawAccountId?: string;
}, context: BRC) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
};

View File

@ -1,4 +1,5 @@
import { EntityDict } from '../oak-app-domain';
import { AspectDict } from './AspectDict';
declare const aspectDict: AspectDict;
declare const aspectDict: AspectDict<EntityDict>;
export default aspectDict;
export { AspectDict, };

View File

@ -37,7 +37,8 @@ exports.desc = {
: {
type: "object"
},
entity: {
entity // 如果为true则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio则全额退款)
: {
type: "varchar",
params: {
length: 32

View File

@ -8,5 +8,5 @@ import { FeatureDict as Ogb0FeatureDict, AspectDict as Ogb0AspectDict } from "oa
export type BRC = BackendRuntimeContext<EntityDict>;
export type FRC = FrontendRuntimeContext<EntityDict>;
export type RuntimeCxt = FRC | BRC;
export type AAD = AspectDict & Ogb0AspectDict<EntityDict>;
export type AAD = AspectDict<EntityDict> & Ogb0AspectDict<EntityDict>;
export type AFD = FeatureDict<EntityDict> & BasicFeatures<EntityDict> & Ogb0FeatureDict<EntityDict>;

View File

@ -1,10 +1,10 @@
import { BRC } from '../types/RuntimeCxt';
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
import { EntityDict } from '../oak-app-domain';
export type AspectDict = {
export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: {
accountId: string;
price: number;
withdrawAccountId?: string;
}, context: BRC) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
};

View File

@ -1,9 +1,10 @@
import { EntityDict } from '../oak-app-domain';
import { AspectDict } from './AspectDict';
import { getWithdrawCreateData } from './withdraw';
const aspectDict = {
getWithdrawCreateData,
} as AspectDict;
} as AspectDict<EntityDict>;
export default aspectDict;
export {

View File

@ -8,5 +8,5 @@ import { FeatureDict as Ogb0FeatureDict, AspectDict as Ogb0AspectDict } from "oa
export type BRC = BackendRuntimeContext<EntityDict>;
export type FRC = FrontendRuntimeContext<EntityDict>;
export type RuntimeCxt = FRC | BRC;
export type AAD = AspectDict & Ogb0AspectDict<EntityDict>;
export type AAD = AspectDict<EntityDict> & Ogb0AspectDict<EntityDict>;
export type AFD = FeatureDict<EntityDict> & BasicFeatures<EntityDict> & Ogb0FeatureDict<EntityDict>;

View File

@ -69,8 +69,7 @@
"types": [
"node",
"wechat-miniprogram",
"react",
"react-native"
"react"
]
},
"include": [