修改了一些小的声明

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'; import { EntityDict } from '../oak-app-domain';
export type AspectDict = { export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: { getWithdrawCreateData: (params: {
accountId: string; accountId: string;
price: number; price: number;
withdrawAccountId?: string; 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'; import { AspectDict } from './AspectDict';
declare const aspectDict: AspectDict; declare const aspectDict: AspectDict<EntityDict>;
export default aspectDict; export default aspectDict;
export { AspectDict, }; export { AspectDict, };

View File

@ -21,7 +21,12 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
hideHeader?: boolean | undefined; hideHeader?: boolean | undefined;
disableSerialNumber?: boolean | undefined; disableSerialNumber?: boolean | undefined;
size?: "small" | "middle" | "large" | undefined; size?: "small" | "middle" | "large" | undefined;
scroll?: any; scroll?: ({
x?: string | number | true | undefined;
y?: string | number | undefined;
} & {
scrollToFirstRowOnChange?: boolean | undefined;
}) | undefined;
locale?: any; locale?: any;
opWidth?: number | undefined; opWidth?: number | undefined;
}>) => React.ReactElement; }>) => React.ReactElement;
@ -53,14 +58,14 @@ declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<En
data: Partial<EntityDict[T]["Schema"]>; data: Partial<EntityDict[T]["Schema"]>;
title?: string | undefined; title?: string | undefined;
bordered?: boolean | undefined; bordered?: boolean | undefined;
layout?: "vertical" | "horizontal" | undefined; layout?: "horizontal" | "vertical" | undefined;
}>) => React.ReactElement; }>) => React.ReactElement;
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, { declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
helps: Record<string, string>; helps: Record<string, string>;
entity: T; entity: T;
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[]; attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
data: EntityDict[T]["Schema"]; data: EntityDict[T]["Schema"];
layout: "vertical" | "horizontal"; layout: "horizontal" | "vertical";
mode: "default" | "card"; mode: "default" | "card";
}>) => React.ReactElement; }>) => React.ReactElement;
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, }; 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> <span className={Styles.value}>{ThousandCont(ToYuan(data.price || 0), 2)}</span>
</div> </div>
<div className={Styles.bottom}> <div className={Styles.bottom}>
<Button <Button onClick={() => {
// type="primary"
onClick={() => {
setShowHistoryAcc({ entity, data }); setShowHistoryAcc({ entity, data });
setShowHistoryList(true); setShowHistoryList(true);
}} style={{ marginRight: 8, }}> }} style={{ marginRight: 8, }}>
@ -137,7 +135,10 @@ export default function render(props) {
<Modal destroyOnClose open={showHistoryList} onCancel={() => { <Modal destroyOnClose open={showHistoryList} onCancel={() => {
setShowHistoryAcc(undefined); setShowHistoryAcc(undefined);
setShowHistoryList(false); 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' }}> <div style={{ height: '65vh' }}>
<SysAccountOperList entity={showHistoryAcc.entity} entityId={showHistoryAcc.data.id} oakPath="$opb-sysAccount-survery-operList"/> <SysAccountOperList entity={showHistoryAcc.entity} entityId={showHistoryAcc.data.id} oakPath="$opb-sysAccount-survery-operList"/>
</div> </div>

View File

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

View File

@ -8,5 +8,5 @@ import { FeatureDict as Ogb0FeatureDict, AspectDict as Ogb0AspectDict } from "oa
export type BRC = BackendRuntimeContext<EntityDict>; export type BRC = BackendRuntimeContext<EntityDict>;
export type FRC = FrontendRuntimeContext<EntityDict>; export type FRC = FrontendRuntimeContext<EntityDict>;
export type RuntimeCxt = FRC | BRC; 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>; 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'; import { EntityDict } from '../oak-app-domain';
export type AspectDict = { export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: { getWithdrawCreateData: (params: {
accountId: string; accountId: string;
price: number; price: number;
withdrawAccountId?: string; 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'; import { AspectDict } from './AspectDict';
declare const aspectDict: AspectDict; declare const aspectDict: AspectDict<EntityDict>;
export default aspectDict; export default aspectDict;
export { AspectDict, }; export { AspectDict, };

View File

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

View File

@ -8,5 +8,5 @@ import { FeatureDict as Ogb0FeatureDict, AspectDict as Ogb0AspectDict } from "oa
export type BRC = BackendRuntimeContext<EntityDict>; export type BRC = BackendRuntimeContext<EntityDict>;
export type FRC = FrontendRuntimeContext<EntityDict>; export type FRC = FrontendRuntimeContext<EntityDict>;
export type RuntimeCxt = FRC | BRC; 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>; 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'; import { EntityDict } from '../oak-app-domain';
export type AspectDict = { export type AspectDict<ED extends EntityDict> = {
getWithdrawCreateData: (params: { getWithdrawCreateData: (params: {
accountId: string; accountId: string;
price: number; price: number;
withdrawAccountId?: string; 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 { AspectDict } from './AspectDict';
import { getWithdrawCreateData } from './withdraw'; import { getWithdrawCreateData } from './withdraw';
const aspectDict = { const aspectDict = {
getWithdrawCreateData, getWithdrawCreateData,
} as AspectDict; } as AspectDict<EntityDict>;
export default aspectDict; export default aspectDict;
export { export {

View File

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

View File

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