From a8abc55461e85e1e408505b3ddeaa23cca47ecf7 Mon Sep 17 00:00:00 2001 From: wkj <278599135@.com> Date: Thu, 7 Aug 2025 13:59:22 +0800 Subject: [PATCH] =?UTF-8?q?oakIcon=20=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=BA=A7=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/aspects/AspectService.d.ts | 2 +- es/components/actionTabPanel/index.js | 6 +++--- es/components/detail/index.d.ts | 10 +++++----- es/components/detail/index.js | 2 +- es/components/errorPage/index.d.ts | 4 ++-- es/components/errorPage/index.js | 2 +- es/components/filter/index.js | 2 +- es/components/icon/index.d.ts | 2 +- es/components/icon/index.js | 2 +- es/components/icon/index.less | 1 + es/components/icon/index.xml | 2 +- es/components/icon/web.d.ts | 2 +- es/components/list/index.d.ts | 19 ++++++++++++------- es/components/list/index.js | 2 +- es/components/pageHeader/index.d.ts | 19 ++++++++++--------- es/components/pageHeader2/index.d.ts | 21 +++++++++++---------- es/components/pagination/index.d.ts | 13 +++++++------ es/components/refAttr/index.js | 2 +- es/components/upsert/index.d.ts | 2 +- es/components/upsert/index.js | 2 +- es/features/cache.js | 2 +- es/page.react.d.ts | 14 +++++++------- es/platforms/web/responsive/context.js | 2 +- es/types/ErrorPage.d.ts | 4 ++-- lib/aspects/AspectService.d.ts | 2 +- lib/features/cache.js | 2 +- lib/page.react.d.ts | 14 +++++++------- lib/platforms/web/responsive/context.js | 2 +- lib/types/ErrorPage.d.ts | 4 ++-- src/components/icon/index.less | 1 + src/components/icon/index.ts | 2 +- src/components/icon/index.xml | 2 +- src/components/icon/web.tsx | 6 ++---- 33 files changed, 91 insertions(+), 83 deletions(-) diff --git a/es/aspects/AspectService.d.ts b/es/aspects/AspectService.d.ts index cbd45209..6c2660ea 100644 --- a/es/aspects/AspectService.d.ts +++ b/es/aspects/AspectService.d.ts @@ -8,5 +8,5 @@ type TransformAspectDict, ED extends BaseEntityDic [K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise ? (params: P, callback?: (result: R, opRecords?: OpRecord[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never; }; export type AspectDictTrans, BCT extends AsyncContext> = TransformAspectDict, ED, BCT>; -export declare const createService: >(cache: BasicFeatures["cache"]) => TransformAspectDict, ED, any>; +export declare const createService: >(cache: import("../features/cache").Cache) => TransformAspectDict, ED, any>; export {}; diff --git a/es/components/actionTabPanel/index.js b/es/components/actionTabPanel/index.js index 1019b0e6..334680cc 100644 --- a/es/components/actionTabPanel/index.js +++ b/es/components/actionTabPanel/index.js @@ -1,9 +1,9 @@ export default OakComponent({ isList: false, data: { - slideWidth: 0, //小程序使用 - slideLeft: 0, //小程序使用 - slideShow: false, //小程序使用 + slideWidth: 0, + slideLeft: 0, + slideShow: false, commonAction: [ 'create', 'update', diff --git a/es/components/detail/index.d.ts b/es/components/detail/index.d.ts index 633eebb3..bc0497c0 100644 --- a/es/components/detail/index.d.ts +++ b/es/components/detail/index.d.ts @@ -2,12 +2,12 @@ import { ED, OakAbsAttrDef } from '../../types/AbstractComponent'; import { ReactComponentProps } from '../../types/Page'; import { Breakpoint } from 'antd'; declare const _default: (props: ReactComponentProps; + column?: number | Record | undefined; entity: T2; attributes: OakAbsAttrDef[]; - data: Partial; - title?: string; - bordered?: boolean; - layout?: 'horizontal' | 'vertical'; + data: Partial; + title?: string | undefined; + bordered?: boolean | undefined; + layout?: "horizontal" | "vertical" | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/detail/index.js b/es/components/detail/index.js index dad92ccb..7b47665b 100644 --- a/es/components/detail/index.js +++ b/es/components/detail/index.js @@ -61,7 +61,7 @@ export default OakComponent({ let currentUrl = event.currentTarget.dataset.src; let urlList = event.currentTarget.dataset.list; wx.previewImage({ - current: currentUrl, // 当前显示图片的http链接 + current: currentUrl, urls: urlList, // 需要预览的图片http链接列表 }); }, diff --git a/es/components/errorPage/index.d.ts b/es/components/errorPage/index.d.ts index 46dc8001..87426da6 100644 --- a/es/components/errorPage/index.d.ts +++ b/es/components/errorPage/index.d.ts @@ -3,8 +3,8 @@ import { ReactComponentProps } from '../../types/Page'; import { ECode } from '../../types/ErrorPage'; declare const _default: (props: ReactComponentProps declare const _default: (props: import("../..").ReactComponentProps) => import("react").ReactElement>; export default _default; diff --git a/es/components/icon/index.js b/es/components/icon/index.js index 0f3ffa1c..b678eba8 100644 --- a/es/components/icon/index.js +++ b/es/components/icon/index.js @@ -5,7 +5,7 @@ export default OakComponent({ }, properties: { name: '', - size: 12, + size: undefined, color: 'primary', }, }); diff --git a/es/components/icon/index.less b/es/components/icon/index.less index e0d95c9a..7263cd12 100644 --- a/es/components/icon/index.less +++ b/es/components/icon/index.less @@ -1,6 +1,7 @@ @import './iconfont.less'; @import '../../config/styles/mp/index.less'; + .oak-icon__primary { color: @oak-color-primary; } diff --git a/es/components/icon/index.xml b/es/components/icon/index.xml index 18e6baf4..46d639b0 100644 --- a/es/components/icon/index.xml +++ b/es/components/icon/index.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/es/components/icon/web.d.ts b/es/components/icon/web.d.ts index a8ae2ca9..0b512793 100644 --- a/es/components/icon/web.d.ts +++ b/es/components/icon/web.d.ts @@ -5,7 +5,7 @@ import './web.less'; export default function Render(props: WebComponentProps): React.JSX.Element; diff --git a/es/components/list/index.d.ts b/es/components/list/index.d.ts index fee0097c..dba7ca05 100644 --- a/es/components/list/index.d.ts +++ b/es/components/list/index.d.ts @@ -10,13 +10,18 @@ declare const _default: (props: ReactCompo data: RowWithActions[]; loading: boolean; tablePagination?: React.ReactNode | false; - rowSelection?: TableProps>['rowSelection']; - hideHeader?: boolean; - disableSerialNumber?: boolean; - size?: 'large' | 'middle' | 'small'; - scroll?: TableProps>['scroll']; + rowSelection?: import("antd/es/table/interface").TableRowSelection> | undefined; + hideHeader?: boolean | undefined; + disableSerialNumber?: boolean | undefined; + size?: "small" | "large" | "middle" | undefined; + scroll?: ({ + x?: string | number | true | undefined; + y?: string | number | undefined; + } & { + scrollToFirstRowOnChange?: boolean | undefined; + }) | undefined; empty?: React.ReactNode; - opWidth?: number; - ellipsis?: boolean; + opWidth?: number | undefined; + ellipsis?: boolean | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/list/index.js b/es/components/list/index.js index 59480dd7..33980d7e 100644 --- a/es/components/list/index.js +++ b/es/components/list/index.js @@ -13,7 +13,7 @@ export default OakComponent({ tablePagination: undefined, rowSelection: undefined, hideHeader: false, - disableSerialNumber: false, //是否禁用序号 默认启用 + disableSerialNumber: false, size: 'large', scroll: undefined, empty: undefined, diff --git a/es/components/pageHeader/index.d.ts b/es/components/pageHeader/index.d.ts index de716fe3..f25d157d 100644 --- a/es/components/pageHeader/index.d.ts +++ b/es/components/pageHeader/index.d.ts @@ -1,20 +1,21 @@ +/// import { ReactComponentProps } from '../../types/Page'; import { ED } from '../../types/AbstractComponent'; declare const _default: (props: ReactComponentProps void; + showBack?: boolean | undefined; + onBack?: (() => void) | undefined; backIcon?: React.ReactNode; - delta?: number; + delta?: number | undefined; extra?: React.ReactNode; subTitle?: React.ReactNode; - contentMargin?: boolean; - contentStyle?: React.CSSProperties; - contentClassName?: string; + contentMargin?: boolean | undefined; + contentStyle?: import("react").CSSProperties | undefined; + contentClassName?: string | undefined; tags?: React.ReactNode; children?: React.ReactNode; - showHeader?: boolean; + showHeader?: boolean | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/pageHeader2/index.d.ts b/es/components/pageHeader2/index.d.ts index 7e219729..554c89f9 100644 --- a/es/components/pageHeader2/index.d.ts +++ b/es/components/pageHeader2/index.d.ts @@ -1,22 +1,23 @@ +/// import { ReactComponentProps } from '../../types/Page'; import { ED } from '../../types/AbstractComponent'; declare const _default: (props: ReactComponentProps void; + style?: import("react").CSSProperties | undefined; + className?: string | undefined; + showHeader?: boolean | undefined; + showBack?: boolean | undefined; + onBack?: (() => void) | undefined; backIcon?: React.ReactNode; - delta?: number; + delta?: number | undefined; title?: React.ReactNode; subTitle?: React.ReactNode; tags?: React.ReactNode; extra?: React.ReactNode; children?: React.ReactNode; content: React.ReactNode; - contentStyle?: React.CSSProperties; - contentClassName?: string; - bodyStyle?: React.CSSProperties; - bodyClassName?: string; + contentStyle?: import("react").CSSProperties | undefined; + contentClassName?: string | undefined; + bodyStyle?: import("react").CSSProperties | undefined; + bodyClassName?: string | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/pagination/index.d.ts b/es/components/pagination/index.d.ts index 7e393cff..0e7e783f 100644 --- a/es/components/pagination/index.d.ts +++ b/es/components/pagination/index.d.ts @@ -1,12 +1,13 @@ +/// import { ReactComponentProps } from '../../types/Page'; import { ED } from '../../types/AbstractComponent'; declare const _default: (props: ReactComponentProps React.ReactNode; + style?: import("react").CSSProperties | undefined; + className?: string | undefined; + showQuickJumper?: boolean | undefined; + size?: "small" | "default" | undefined; + showSizeChanger?: boolean | undefined; + showTotal?: ((total: number, range: [number, number]) => React.ReactNode) | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/refAttr/index.js b/es/components/refAttr/index.js index 6c92bb93..a98ea981 100644 --- a/es/components/refAttr/index.js +++ b/es/components/refAttr/index.js @@ -9,7 +9,7 @@ export default OakComponent({ multiple: false, entityId: '', entityIds: [], - pickerRender: {}, // OakAbsRefAttrPickerRender + pickerRender: {}, onChange: (() => undefined), }, formData() { diff --git a/es/components/upsert/index.d.ts b/es/components/upsert/index.d.ts index b81a5408..35a7fb5e 100644 --- a/es/components/upsert/index.d.ts +++ b/es/components/upsert/index.d.ts @@ -4,7 +4,7 @@ declare const _default: ; entity: T2; attributes: OakAbsAttrUpsertDef[]; - data: ED2[T2]['Schema']; + data: ED2[T2]["Schema"]; layout: 'horizontal' | 'vertical'; mode: 'default' | 'card'; }>) => React.ReactElement; diff --git a/es/components/upsert/index.js b/es/components/upsert/index.js index 38d769fd..d9561533 100644 --- a/es/components/upsert/index.js +++ b/es/components/upsert/index.js @@ -5,7 +5,7 @@ export default OakComponent({ return this.props.entity; }, properties: { - helps: {}, // Record; + helps: {}, entity: '', attributes: [], layout: 'horizontal', diff --git a/es/features/cache.js b/es/features/cache.js index b5d69ffb..b5d16e1a 100644 --- a/es/features/cache.js +++ b/es/features/cache.js @@ -427,7 +427,7 @@ export class Cache extends Feature { opers.forEach((oper) => { const { entity, operation } = oper; this.cacheStore.operate(entity, operation, this.context, { - checkerTypes: ['logical'], // 这里不能检查data,不然在数据没填完前会有大量异常 + checkerTypes: ['logical'], dontCollect: true, }); }); diff --git a/es/page.react.d.ts b/es/page.react.d.ts index 1f2d2781..4004b3b2 100644 --- a/es/page.react.d.ts +++ b/es/page.react.d.ts @@ -49,21 +49,21 @@ export declare function createComponent(options: { url: string; } & OakNavigateToParameters, state?: Record | undefined, disableNamespace?: boolean | undefined): Promise; - addItem(data: Omit & { + addItem(data: Omit & { id?: string | undefined; }, path?: string | undefined): string; - addItems(data: (Omit & { + addItems(data: (Omit & { id?: string | undefined; })[], path?: string | undefined): string[]; removeItem(id: string, path?: string | undefined): void; removeItems(ids: string[], path?: string | undefined): void; - updateItem(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void; - updateItems(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void; + updateItem(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void; + updateItems(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void; recoverItem(id: string, path?: string | undefined): void; recoverItems(ids: string[], path?: string | undefined): void; resetItem(id: string, path?: string | undefined): void; - update(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void; - create(data: Omit, path?: string | undefined): void; + update(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void; + create(data: Omit, path?: string | undefined): void; remove(path?: string | undefined): void; isCreation(path?: string | undefined): boolean; clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void; @@ -78,7 +78,7 @@ export declare function createComponent(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial[]; checkOperation(entity: T2_3, operation: Omit, checkerTypes?: CheckerType[] | undefined, cacheInsensative?: true | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException; }[ED[T2_3]["Action"]]; tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException; }[ED[keyof ED]["Action"]]; - getOperations(path?: string | undefined): { + getOperations(path?: string | undefined): { entity: keyof ED; operation: ED[keyof ED]["Operation"]; }[] | undefined; diff --git a/es/platforms/web/responsive/context.js b/es/platforms/web/responsive/context.js index 1f1c4d3f..160db654 100644 --- a/es/platforms/web/responsive/context.js +++ b/es/platforms/web/responsive/context.js @@ -1,7 +1,7 @@ import React from 'react'; export const keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl']; export const values = { - xs: 576, //小于576 + xs: 576, sm: 576, md: 768, lg: 992, diff --git a/es/types/ErrorPage.d.ts b/es/types/ErrorPage.d.ts index 1cea1fe7..8c638fbc 100644 --- a/es/types/ErrorPage.d.ts +++ b/es/types/ErrorPage.d.ts @@ -5,7 +5,7 @@ export declare enum ECode { networkError = "network-error", browserIncompatible = "browser-incompatible", maintenance = "maintenance", - pageCrash = "pageCrash",// 页面崩溃 - pageUpdate = "pageUpdate",// 页面更新 + pageCrash = "pageCrash", + pageUpdate = "pageUpdate", pageDataCacheFailure = "pageDataCacheFailure" } diff --git a/lib/aspects/AspectService.d.ts b/lib/aspects/AspectService.d.ts index cbd45209..6c2660ea 100644 --- a/lib/aspects/AspectService.d.ts +++ b/lib/aspects/AspectService.d.ts @@ -8,5 +8,5 @@ type TransformAspectDict, ED extends BaseEntityDic [K in keyof T]: T[K] extends (params: infer P, context: BCT) => infer R ? R extends Promise ? (params: P, callback?: (result: R, opRecords?: OpRecord[]) => void, dontPublish?: true, ignoreContext?: true) => R : never : never; }; export type AspectDictTrans, BCT extends AsyncContext> = TransformAspectDict, ED, BCT>; -export declare const createService: >(cache: BasicFeatures["cache"]) => TransformAspectDict, ED, any>; +export declare const createService: >(cache: import("../features/cache").Cache) => TransformAspectDict, ED, any>; export {}; diff --git a/lib/features/cache.js b/lib/features/cache.js index a50c0c20..40c98ff5 100644 --- a/lib/features/cache.js +++ b/lib/features/cache.js @@ -430,7 +430,7 @@ class Cache extends Feature_1.Feature { opers.forEach((oper) => { const { entity, operation } = oper; this.cacheStore.operate(entity, operation, this.context, { - checkerTypes: ['logical'], // 这里不能检查data,不然在数据没填完前会有大量异常 + checkerTypes: ['logical'], dontCollect: true, }); }); diff --git a/lib/page.react.d.ts b/lib/page.react.d.ts index 1f2d2781..4004b3b2 100644 --- a/lib/page.react.d.ts +++ b/lib/page.react.d.ts @@ -49,21 +49,21 @@ export declare function createComponent(options: { url: string; } & OakNavigateToParameters, state?: Record | undefined, disableNamespace?: boolean | undefined): Promise; - addItem(data: Omit & { + addItem(data: Omit & { id?: string | undefined; }, path?: string | undefined): string; - addItems(data: (Omit & { + addItems(data: (Omit & { id?: string | undefined; })[], path?: string | undefined): string[]; removeItem(id: string, path?: string | undefined): void; removeItems(ids: string[], path?: string | undefined): void; - updateItem(data: ED[T_3]["Update"]["data"], id: string, action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void; - updateItems(data: ED[T_4]["Update"]["data"], ids: string[], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void; + updateItem(data: ED[T_2]["Update"]["data"], id: string, action?: ED[T_2]["Action"] | undefined, path?: string | undefined): void; + updateItems(data: ED[T_3]["Update"]["data"], ids: string[], action?: ED[T_3]["Action"] | undefined, path?: string | undefined): void; recoverItem(id: string, path?: string | undefined): void; recoverItems(ids: string[], path?: string | undefined): void; resetItem(id: string, path?: string | undefined): void; - update(data: ED[T_5]["Update"]["data"], action?: ED[T_5]["Action"] | undefined, path?: string | undefined): void; - create(data: Omit, path?: string | undefined): void; + update(data: ED[T_4]["Update"]["data"], action?: ED[T_4]["Action"] | undefined, path?: string | undefined): void; + create(data: Omit, path?: string | undefined): void; remove(path?: string | undefined): void; isCreation(path?: string | undefined): boolean; clean(lsn?: number | undefined, dontPublish?: true | undefined, path?: string | undefined): void; @@ -78,7 +78,7 @@ export declare function createComponent(entity: T2_2, selection: ED[T2_2]["Selection"]): Partial[]; checkOperation(entity: T2_3, operation: Omit, checkerTypes?: CheckerType[] | undefined, cacheInsensative?: true | undefined): boolean | { [A in ED[T2_3]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException; }[ED[T2_3]["Action"]]; tryExecute(path?: string | undefined, action?: string | undefined): boolean | { [A_1 in ED[keyof ED]["Action"]]: boolean | import("oak-domain/lib/types").OakUserException; }[ED[keyof ED]["Action"]]; - getOperations(path?: string | undefined): { + getOperations(path?: string | undefined): { entity: keyof ED; operation: ED[keyof ED]["Operation"]; }[] | undefined; diff --git a/lib/platforms/web/responsive/context.js b/lib/platforms/web/responsive/context.js index adacafce..55d0f20e 100644 --- a/lib/platforms/web/responsive/context.js +++ b/lib/platforms/web/responsive/context.js @@ -5,7 +5,7 @@ const tslib_1 = require("tslib"); const react_1 = tslib_1.__importDefault(require("react")); exports.keys = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl']; exports.values = { - xs: 576, //小于576 + xs: 576, sm: 576, md: 768, lg: 992, diff --git a/lib/types/ErrorPage.d.ts b/lib/types/ErrorPage.d.ts index 1cea1fe7..8c638fbc 100644 --- a/lib/types/ErrorPage.d.ts +++ b/lib/types/ErrorPage.d.ts @@ -5,7 +5,7 @@ export declare enum ECode { networkError = "network-error", browserIncompatible = "browser-incompatible", maintenance = "maintenance", - pageCrash = "pageCrash",// 页面崩溃 - pageUpdate = "pageUpdate",// 页面更新 + pageCrash = "pageCrash", + pageUpdate = "pageUpdate", pageDataCacheFailure = "pageDataCacheFailure" } diff --git a/src/components/icon/index.less b/src/components/icon/index.less index e0d95c9a..7263cd12 100644 --- a/src/components/icon/index.less +++ b/src/components/icon/index.less @@ -1,6 +1,7 @@ @import './iconfont.less'; @import '../../config/styles/mp/index.less'; + .oak-icon__primary { color: @oak-color-primary; } diff --git a/src/components/icon/index.ts b/src/components/icon/index.ts index ba3c6141..fa010993 100644 --- a/src/components/icon/index.ts +++ b/src/components/icon/index.ts @@ -6,7 +6,7 @@ export default OakComponent({ }, properties: { name: '', - size: 12 as number, + size: undefined as number | undefined | null, color: 'primary' as 'primary' | 'success' | 'error' | 'waring' | 'info' | string, }, }); \ No newline at end of file diff --git a/src/components/icon/index.xml b/src/components/icon/index.xml index 18e6baf4..46d639b0 100644 --- a/src/components/icon/index.xml +++ b/src/components/icon/index.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/icon/web.tsx b/src/components/icon/web.tsx index 03c948ce..3d828c28 100644 --- a/src/components/icon/web.tsx +++ b/src/components/icon/web.tsx @@ -17,7 +17,7 @@ export default function Render( | 'waring' | 'info' | string; - size?: string; + size?: number; className?: string; style?: React.CSSProperties; }, @@ -28,9 +28,7 @@ export default function Render( const { name, color = '', size, className, style = {} } = data; - const isColor = ['primary', 'info', 'success', 'error', 'warning'].includes( - color - ); + const isColor = ['primary', 'info', 'success', 'error', 'warning'].includes(color); let class_name = 'oak-icon ' + 'oak-icon-' + name; if (isColor || color === '') {