微调了upload接口的逻辑
This commit is contained in:
parent
4e6eec9c38
commit
cefe8fc20e
|
|
@ -1,2 +1,2 @@
|
||||||
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
declare const checkers: (import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "applicationPassport", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "token", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "mobile", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "message", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Checker<import("../oak-app-domain").EntityDict, "parasite", import("..").RuntimeCxt<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default checkers;
|
export default checkers;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", true, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", true, {
|
||||||
articleMenuId: string | undefined;
|
articleMenuId: string | undefined;
|
||||||
onChildEditArticleChange: (data: string) => void;
|
onChildEditArticleChange: (data: string) => void;
|
||||||
show: "edit" | "doc" | "preview";
|
show: "preview" | "edit" | "doc";
|
||||||
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
|
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
|
||||||
breadcrumbItems: string[];
|
breadcrumbItems: string[];
|
||||||
drawerOpen: boolean;
|
drawerOpen: boolean;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
onRemove: () => void;
|
onRemove: () => void;
|
||||||
onUpdateName: (name: string) => Promise<void>;
|
onUpdateName: (name: string) => Promise<void>;
|
||||||
onChildEditArticleChange: (data: string) => void;
|
onChildEditArticleChange: (data: string) => void;
|
||||||
show: "edit" | "doc" | "preview";
|
show: "preview" | "edit" | "doc";
|
||||||
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
|
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
|
||||||
breadItems: string[];
|
breadItems: string[];
|
||||||
drawerOpen: boolean;
|
drawerOpen: boolean;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
entityId: string;
|
entityId: string;
|
||||||
parentId: string | undefined;
|
parentId: string | undefined;
|
||||||
onGrandChildEditArticleChange: (data: string) => void;
|
onGrandChildEditArticleChange: (data: string) => void;
|
||||||
show: "edit" | "doc" | "preview";
|
show: "preview" | "edit" | "doc";
|
||||||
articleMenuId: string;
|
articleMenuId: string;
|
||||||
articleId: string;
|
articleId: string;
|
||||||
getBreadcrumbItems: (breadcrumbItems: string[]) => void;
|
getBreadcrumbItems: (breadcrumbItems: string[]) => void;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "articleMenu", true, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "articleMenu", true, {
|
||||||
entity: string;
|
entity: string;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
show: "edit" | "doc" | "preview";
|
show: "preview" | "edit" | "doc";
|
||||||
articleMenuId: string;
|
articleMenuId: string;
|
||||||
articleId: string;
|
articleId: string;
|
||||||
tocPosition: "none" | "left" | "right";
|
tocPosition: "none" | "left" | "right";
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import { ReactComponentProps } from 'oak-frontend-base';
|
||||||
import { ECode } from '../../../types/ErrorPage';
|
import { ECode } from '../../../types/ErrorPage';
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
|
||||||
code: ECode;
|
code: ECode;
|
||||||
title?: string;
|
title?: string | undefined;
|
||||||
desc?: string;
|
desc?: string | undefined;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Style } from '../../../../types/Style';
|
import { Style } from '../../../../types/Style';
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||||
style: Style;
|
style: Style;
|
||||||
entity: "application" | "platform" | "system";
|
entity: "application" | "system" | "platform";
|
||||||
entityId: string;
|
entityId: string;
|
||||||
name: string;
|
name: string;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Config } from '../../../types/Config';
|
import { Config } from '../../../types/Config';
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
|
||||||
config: Config;
|
config: Config;
|
||||||
entity: "platform" | "system";
|
entity: "system" | "platform";
|
||||||
name: string;
|
name: string;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
/// <reference types="react" />
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||||
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
|
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
|
||||||
|
|
@ -8,14 +9,31 @@ type AfterCommit = (() => void) | undefined;
|
||||||
type BeforeCommit = (() => boolean | undefined | Promise<boolean | undefined>) | undefined;
|
type BeforeCommit = (() => boolean | undefined | Promise<boolean | undefined>) | undefined;
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
action?: string;
|
action?: string | undefined;
|
||||||
size?: ButtonProps['size'] | AmButtonProps['size'];
|
size?: ButtonProps['size'] | AmButtonProps['size'];
|
||||||
block?: boolean;
|
block?: boolean | undefined;
|
||||||
type?: ButtonProps['type'] | AmButtonProps['type'];
|
type?: ButtonProps['type'] | AmButtonProps['type'];
|
||||||
executeText?: string;
|
executeText?: string | undefined;
|
||||||
buttonProps?: ButtonProps & AmButtonProps;
|
buttonProps?: (ButtonProps & {
|
||||||
|
color?: "default" | "success" | "primary" | "warning" | "danger" | undefined;
|
||||||
|
fill?: "solid" | "outline" | "none" | undefined;
|
||||||
|
size?: "mini" | "small" | "middle" | "large" | undefined;
|
||||||
|
block?: boolean | undefined;
|
||||||
|
loading?: boolean | "auto" | undefined;
|
||||||
|
loadingText?: string | undefined;
|
||||||
|
loadingIcon?: import("react").ReactNode;
|
||||||
|
disabled?: boolean | undefined;
|
||||||
|
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||||
|
type?: "submit" | "reset" | "button" | undefined;
|
||||||
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||||
|
children?: import("react").ReactNode;
|
||||||
|
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & {
|
||||||
|
className?: string | undefined;
|
||||||
|
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
|
||||||
|
tabIndex?: number | undefined;
|
||||||
|
} & import("react").AriaAttributes) | undefined;
|
||||||
afterCommit?: AfterCommit;
|
afterCommit?: AfterCommit;
|
||||||
beforeCommit?: BeforeCommit;
|
beforeCommit?: BeforeCommit;
|
||||||
messageProps?: MessageProps | boolean;
|
messageProps?: boolean | MessageProps | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ export default OakComponent({
|
||||||
if (['local', 'failed'].includes(state)) {
|
if (['local', 'failed'].includes(state)) {
|
||||||
promises.push((async () => {
|
promises.push((async () => {
|
||||||
try {
|
try {
|
||||||
await this.features.extraFile.upload(id, entity);
|
await this.features.extraFile.upload(id);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
failureIds.push(id);
|
failureIds.push(id);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
tag2: string;
|
tag2: string;
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
style?: string;
|
style?: string | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,6 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
entityId: string;
|
entityId: string;
|
||||||
theme: Theme;
|
theme: Theme;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
style?: string;
|
style?: string | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { EntityDict } from '../../../oak-app-domain';
|
import { EntityDict } from '../../../oak-app-domain';
|
||||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "userEntityGrant", false, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "userEntityGrant", false, {
|
||||||
picker: ((props: {
|
picker: ((props: {
|
||||||
disabled?: boolean;
|
disabled?: boolean | undefined;
|
||||||
entity: keyof EntityDict;
|
entity: keyof EntityDict;
|
||||||
entityFilter: object;
|
entityFilter: object;
|
||||||
relationIds: string[];
|
relationIds: string[];
|
||||||
|
|
@ -9,8 +9,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
||||||
onPickRelations: (ids: string[]) => void;
|
onPickRelations: (ids: string[]) => void;
|
||||||
onPickRows: (ids: string[]) => void;
|
onPickRows: (ids: string[]) => void;
|
||||||
pickedRowIds?: string[];
|
pickedRowIds?: string[] | undefined;
|
||||||
pickedRelationIds?: string[];
|
pickedRelationIds?: string[] | undefined;
|
||||||
oakPath: string;
|
oakPath: string;
|
||||||
}) => React.ReactElement) | undefined;
|
}) => React.ReactElement) | undefined;
|
||||||
hideInfo: boolean;
|
hideInfo: boolean;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
entity: keyof EntityDict;
|
entity: keyof EntityDict;
|
||||||
entityFilter: any;
|
entityFilter: any;
|
||||||
relationIds: string[];
|
relationIds: string[];
|
||||||
rule: "single" | "all" | "free";
|
rule: "all" | "single" | "free";
|
||||||
ruleOnRow: "single" | "all" | "free";
|
ruleOnRow: "all" | "single" | "free";
|
||||||
onPickRelations: (ids: string[]) => void;
|
onPickRelations: (ids: string[]) => void;
|
||||||
onPickRows: (ids: string[]) => void;
|
onPickRows: (ids: string[]) => void;
|
||||||
pickedRowIds: string[] | undefined;
|
pickedRowIds: string[] | undefined;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
claimUrl: string;
|
claimUrl: string;
|
||||||
qrCodeType: QrCodeType;
|
qrCodeType: QrCodeType;
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
rule: "single" | "all" | "free";
|
rule: "all" | "single" | "free";
|
||||||
ruleOnRow: "single" | "all" | "free";
|
ruleOnRow: "all" | "single" | "free";
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { ReactComponentProps } from 'oak-frontend-base';
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
redirectToAfterConfirm: ED2['userEntityGrant']['Schema']['redirectTo'];
|
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
|
||||||
qrCodeType: string;
|
qrCodeType: string;
|
||||||
showTitle: true;
|
showTitle: true;
|
||||||
showBack: false;
|
showBack: false;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
relations: EntityDict['relation']['OpSchema'][];
|
relations: EntityDict['relation']['OpSchema'][];
|
||||||
passwordRequire?: boolean;
|
passwordRequire?: boolean | undefined;
|
||||||
allowUpdateName?: boolean;
|
allowUpdateName?: boolean | undefined;
|
||||||
allowUpdateNickname?: boolean;
|
allowUpdateNickname?: boolean | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
allowUpdateName?: boolean;
|
allowUpdateName?: boolean | undefined;
|
||||||
allowUpdateNickname?: boolean;
|
allowUpdateNickname?: boolean | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { ReactComponentProps } from 'oak-frontend-base';
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
redirectToAfterConfirm: ED2['userEntityGrant']['Schema']['redirectTo'];
|
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
|
||||||
qrCodeType: QrCodeType;
|
qrCodeType: QrCodeType;
|
||||||
type: EntityDict['userEntityGrant']['Schema']['type'];
|
type: EntityDict['userEntityGrant']['Schema']['type'];
|
||||||
relations: EntityDict['relation']['OpSchema'][];
|
relations: EntityDict['relation']['OpSchema'][];
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||||||
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
redirectToAfterConfirm: ED2['userEntityGrant']['Schema']['redirectTo'];
|
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
|
||||||
claimUrl: string;
|
claimUrl: string;
|
||||||
qrCodeType: string;
|
qrCodeType: string;
|
||||||
passwordRequire?: boolean;
|
passwordRequire?: boolean | undefined;
|
||||||
allowUpdateName?: boolean;
|
allowUpdateName?: boolean | undefined;
|
||||||
allowUpdateNickname?: boolean;
|
allowUpdateNickname?: boolean | undefined;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export declare class ExtraFile<ED extends EntityDict> extends Feature {
|
||||||
registerCos(clazzes: Array<new () => Cos<ED>>): void;
|
registerCos(clazzes: Array<new () => Cos<ED>>): void;
|
||||||
addLocalFile(id: string, file: File | string): void;
|
addLocalFile(id: string, file: File | string): void;
|
||||||
removeLocalFiles(ids: string[]): void;
|
removeLocalFiles(ids: string[]): void;
|
||||||
upload(id: string, entity: keyof ED): Promise<void>;
|
upload(id: string): Promise<void>;
|
||||||
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
|
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
|
||||||
getFileState(id: string): {
|
getFileState(id: string): {
|
||||||
state: FileState;
|
state: FileState;
|
||||||
|
|
|
||||||
|
|
@ -31,42 +31,39 @@ export class ExtraFile extends Feature {
|
||||||
ids.forEach((id) => unset(this.files, id));
|
ids.forEach((id) => unset(this.files, id));
|
||||||
this.publish();
|
this.publish();
|
||||||
}
|
}
|
||||||
async upload(id, entity) {
|
async upload(id) {
|
||||||
/**
|
/**
|
||||||
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
||||||
*/
|
*/
|
||||||
const { toModi } = this.cache.getSchema()[entity];
|
|
||||||
let modiEntityId = '';
|
let modiEntityId = '';
|
||||||
const getExtraFileData = () => {
|
const getExtraFileData = () => {
|
||||||
if (toModi) {
|
const [extraFile] = this.cache.get('extraFile', {
|
||||||
const [modi] = this.cache.get('modi', {
|
data: extraFileProjection,
|
||||||
data: {
|
filter: {
|
||||||
id: 1,
|
id,
|
||||||
data: 1,
|
},
|
||||||
entity: 1,
|
});
|
||||||
entityId: 1,
|
if (extraFile) {
|
||||||
},
|
return extraFile;
|
||||||
filter: {
|
|
||||||
entity: entity,
|
|
||||||
targetEntity: 'extraFile',
|
|
||||||
action: 'create',
|
|
||||||
filter: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
modiEntityId = modi.entityId;
|
|
||||||
return modi.data;
|
|
||||||
}
|
}
|
||||||
else {
|
// 否则再去modi中查看
|
||||||
const [extraFile] = this.cache.get('extraFile', {
|
const [modi] = this.cache.get('modi', {
|
||||||
data: extraFileProjection,
|
data: {
|
||||||
|
id: 1,
|
||||||
|
data: 1,
|
||||||
|
entity: 1,
|
||||||
|
entityId: 1,
|
||||||
|
},
|
||||||
|
filter: {
|
||||||
|
targetEntity: 'extraFile',
|
||||||
|
action: 'create',
|
||||||
filter: {
|
filter: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
return extraFile;
|
});
|
||||||
}
|
modiEntityId = modi.entityId;
|
||||||
|
return modi.data;
|
||||||
};
|
};
|
||||||
const extraFile = getExtraFileData();
|
const extraFile = getExtraFileData();
|
||||||
assert(extraFile && extraFile.uploadState === 'uploading');
|
assert(extraFile && extraFile.uploadState === 'uploading');
|
||||||
|
|
@ -99,30 +96,10 @@ export class ExtraFile extends Feature {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (toModi) {
|
await this.cache.exec('operate', {
|
||||||
await this.cache.exec('operate', {
|
entity: 'extraFile',
|
||||||
entity: 'modi',
|
operation,
|
||||||
operation: {
|
});
|
||||||
id: await generateNewIdAsync(),
|
|
||||||
action: 'create',
|
|
||||||
data: {
|
|
||||||
id: await generateNewIdAsync(),
|
|
||||||
entity: entity,
|
|
||||||
entityId: modiEntityId,
|
|
||||||
data: operation.data,
|
|
||||||
action: 'update',
|
|
||||||
filter: operation.filter,
|
|
||||||
targetEntity: 'extraFile',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
await this.cache.exec('operate', {
|
|
||||||
entity: 'extraFile',
|
|
||||||
operation,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
await informServer();
|
await informServer();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
export declare namespace RelationId {
|
||||||
|
const enum Session {
|
||||||
|
Partner = "session-partner"
|
||||||
|
}
|
||||||
|
const enum ToDo {
|
||||||
|
Collaborator = "toDo-collaborator"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export {};
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export declare function createToDo<ED extends EntityDict & BaseEntityDict, T ext
|
||||||
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
|
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
|
||||||
entity: any;
|
entity: any;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
}, userIds?: string[]): Promise<0 | 1>;
|
}, userIds?: string[]): Promise<1 | 0>;
|
||||||
/**
|
/**
|
||||||
* 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成
|
* 完成todo例程,当在entity对象上进行action操作时(操作条件是filter),将对应的todo完成
|
||||||
* 必须在entity的action的后trigger中调用
|
* 必须在entity的action的后trigger中调用
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export declare class ExtraFile<ED extends EntityDict> extends Feature {
|
||||||
registerCos(clazzes: Array<new () => Cos<ED>>): void;
|
registerCos(clazzes: Array<new () => Cos<ED>>): void;
|
||||||
addLocalFile(id: string, file: File | string): void;
|
addLocalFile(id: string, file: File | string): void;
|
||||||
removeLocalFiles(ids: string[]): void;
|
removeLocalFiles(ids: string[]): void;
|
||||||
upload(id: string, entity: keyof ED): Promise<void>;
|
upload(id: string): Promise<void>;
|
||||||
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
|
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
|
||||||
getFileState(id: string): {
|
getFileState(id: string): {
|
||||||
state: FileState;
|
state: FileState;
|
||||||
|
|
|
||||||
|
|
@ -34,42 +34,39 @@ class ExtraFile extends Feature_1.Feature {
|
||||||
ids.forEach((id) => (0, lodash_1.unset)(this.files, id));
|
ids.forEach((id) => (0, lodash_1.unset)(this.files, id));
|
||||||
this.publish();
|
this.publish();
|
||||||
}
|
}
|
||||||
async upload(id, entity) {
|
async upload(id) {
|
||||||
/**
|
/**
|
||||||
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
||||||
*/
|
*/
|
||||||
const { toModi } = this.cache.getSchema()[entity];
|
|
||||||
let modiEntityId = '';
|
let modiEntityId = '';
|
||||||
const getExtraFileData = () => {
|
const getExtraFileData = () => {
|
||||||
if (toModi) {
|
const [extraFile] = this.cache.get('extraFile', {
|
||||||
const [modi] = this.cache.get('modi', {
|
data: Projection_1.extraFileProjection,
|
||||||
data: {
|
filter: {
|
||||||
id: 1,
|
id,
|
||||||
data: 1,
|
},
|
||||||
entity: 1,
|
});
|
||||||
entityId: 1,
|
if (extraFile) {
|
||||||
},
|
return extraFile;
|
||||||
filter: {
|
|
||||||
entity: entity,
|
|
||||||
targetEntity: 'extraFile',
|
|
||||||
action: 'create',
|
|
||||||
filter: {
|
|
||||||
id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
modiEntityId = modi.entityId;
|
|
||||||
return modi.data;
|
|
||||||
}
|
}
|
||||||
else {
|
// 否则再去modi中查看
|
||||||
const [extraFile] = this.cache.get('extraFile', {
|
const [modi] = this.cache.get('modi', {
|
||||||
data: Projection_1.extraFileProjection,
|
data: {
|
||||||
|
id: 1,
|
||||||
|
data: 1,
|
||||||
|
entity: 1,
|
||||||
|
entityId: 1,
|
||||||
|
},
|
||||||
|
filter: {
|
||||||
|
targetEntity: 'extraFile',
|
||||||
|
action: 'create',
|
||||||
filter: {
|
filter: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
return extraFile;
|
});
|
||||||
}
|
modiEntityId = modi.entityId;
|
||||||
|
return modi.data;
|
||||||
};
|
};
|
||||||
const extraFile = getExtraFileData();
|
const extraFile = getExtraFileData();
|
||||||
(0, assert_1.assert)(extraFile && extraFile.uploadState === 'uploading');
|
(0, assert_1.assert)(extraFile && extraFile.uploadState === 'uploading');
|
||||||
|
|
@ -102,30 +99,10 @@ class ExtraFile extends Feature_1.Feature {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (toModi) {
|
await this.cache.exec('operate', {
|
||||||
await this.cache.exec('operate', {
|
entity: 'extraFile',
|
||||||
entity: 'modi',
|
operation,
|
||||||
operation: {
|
});
|
||||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
|
||||||
action: 'create',
|
|
||||||
data: {
|
|
||||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
|
||||||
entity: entity,
|
|
||||||
entityId: modiEntityId,
|
|
||||||
data: operation.data,
|
|
||||||
action: 'update',
|
|
||||||
filter: operation.filter,
|
|
||||||
targetEntity: 'extraFile',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
await this.cache.exec('operate', {
|
|
||||||
entity: 'extraFile',
|
|
||||||
operation,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
await informServer();
|
await informServer();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
export declare namespace RelationId {
|
||||||
|
const enum Session {
|
||||||
|
Partner = "session-partner"
|
||||||
|
}
|
||||||
|
const enum ToDo {
|
||||||
|
Collaborator = "toDo-collaborator"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
|
@ -139,10 +139,7 @@ export default OakComponent({
|
||||||
promises.push(
|
promises.push(
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await this.features.extraFile.upload(
|
await this.features.extraFile.upload(id);
|
||||||
id,
|
|
||||||
entity
|
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
failureIds.push(id);
|
failureIds.push(id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,41 +51,40 @@ export class ExtraFile<ED extends EntityDict> extends Feature {
|
||||||
this.publish();
|
this.publish();
|
||||||
}
|
}
|
||||||
|
|
||||||
async upload(id: string, entity: keyof ED) {
|
async upload(id: string) {
|
||||||
/**
|
/**
|
||||||
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
* 这个函数假设了前台知道后台会产生modi的行为和数据结构,不是很好的设计
|
||||||
*/
|
*/
|
||||||
const { toModi } = this.cache.getSchema()[entity];
|
|
||||||
let modiEntityId = '';
|
let modiEntityId = '';
|
||||||
const getExtraFileData = () => {
|
const getExtraFileData = () => {
|
||||||
if (toModi) {
|
const [extraFile] = this.cache.get('extraFile', {
|
||||||
const [modi] = this.cache.get('modi', {
|
data: extraFileProjection,
|
||||||
data: {
|
filter: {
|
||||||
id: 1,
|
id,
|
||||||
data: 1,
|
},
|
||||||
entity: 1,
|
});
|
||||||
entityId: 1,
|
if (extraFile) {
|
||||||
},
|
return extraFile;
|
||||||
filter: {
|
}
|
||||||
entity: entity as string,
|
|
||||||
targetEntity: 'extraFile',
|
// 否则再去modi中查看
|
||||||
action: 'create',
|
const [modi] = this.cache.get('modi', {
|
||||||
filter: {
|
data: {
|
||||||
id,
|
id: 1,
|
||||||
},
|
data: 1,
|
||||||
},
|
entity: 1,
|
||||||
});
|
entityId: 1,
|
||||||
modiEntityId = modi.entityId!;
|
},
|
||||||
return modi.data as ED['extraFile']['OpSchema'];
|
filter: {
|
||||||
} else {
|
targetEntity: 'extraFile',
|
||||||
const [extraFile] = this.cache.get('extraFile', {
|
action: 'create',
|
||||||
data: extraFileProjection,
|
|
||||||
filter: {
|
filter: {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
});
|
},
|
||||||
return extraFile as ED['extraFile']['OpSchema'];
|
});
|
||||||
}
|
modiEntityId = modi.entityId!;
|
||||||
|
return modi.data as ED['extraFile']['OpSchema'];
|
||||||
};
|
};
|
||||||
|
|
||||||
const extraFile = getExtraFileData();
|
const extraFile = getExtraFileData();
|
||||||
|
|
@ -125,29 +124,10 @@ export class ExtraFile<ED extends EntityDict> extends Feature {
|
||||||
id,
|
id,
|
||||||
},
|
},
|
||||||
} as ED['extraFile']['Operation'];
|
} as ED['extraFile']['Operation'];
|
||||||
if (toModi) {
|
await this.cache.exec('operate', {
|
||||||
await this.cache.exec('operate', {
|
entity: 'extraFile',
|
||||||
entity: 'modi',
|
operation,
|
||||||
operation: {
|
});
|
||||||
id: await generateNewIdAsync(),
|
|
||||||
action: 'create',
|
|
||||||
data: {
|
|
||||||
id: await generateNewIdAsync(),
|
|
||||||
entity: entity as string,
|
|
||||||
entityId: modiEntityId,
|
|
||||||
data: operation.data,
|
|
||||||
action: 'update',
|
|
||||||
filter: operation.filter,
|
|
||||||
targetEntity: 'extraFile',
|
|
||||||
},
|
|
||||||
} as ED['modi']['Operation'],
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await this.cache.exec('operate', {
|
|
||||||
entity: 'extraFile',
|
|
||||||
operation,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
await informServer();
|
await informServer();
|
||||||
}
|
}
|
||||||
|
|
@ -196,9 +176,9 @@ export class ExtraFile<ED extends EntityDict> extends Feature {
|
||||||
|
|
||||||
getFileState(id: string):
|
getFileState(id: string):
|
||||||
| {
|
| {
|
||||||
state: FileState;
|
state: FileState;
|
||||||
percentage?: number;
|
percentage?: number;
|
||||||
}
|
}
|
||||||
| undefined {
|
| undefined {
|
||||||
if (this.files[id]) {
|
if (this.files[id]) {
|
||||||
return this.files[id];
|
return this.files[id];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue