From 17f83945b33d41a506f4553a5b07e048173ebba8 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Tue, 20 Dec 2022 18:32:44 +0800 Subject: [PATCH 1/8] =?UTF-8?q?mp=20=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=20dialog=20=E5=BC=95=E5=85=A5=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/common/empty/empty.d.ts | 1 - lib/components/common/empty/simple.d.ts | 1 - .../common/weChatLoginQrCode/index.d.ts | 1 - lib/components/config/application/web.pc.d.ts | 1 - .../config/application/web/index.d.ts | 1 - .../config/application/wechatMp/index.d.ts | 1 - .../application/wechatPublic/index.d.ts | 1 - .../config/upsert/account/index.d.ts | 1 - lib/components/config/upsert/cos/index.d.ts | 1 - lib/components/config/upsert/live/index.d.ts | 1 - lib/components/config/upsert/map/index.d.ts | 1 - lib/components/config/upsert/web.pc.d.ts | 1 - lib/components/extraFile/display/web.d.ts | 1 - lib/components/extraFile/gallery/web.d.ts | 1 - lib/components/func/actionPanel/web.d.ts | 1 - lib/components/func/debugPanel/web.d.ts | 1 - lib/components/icon/web.d.ts | 1 - lib/components/message/web.d.ts | 1 - lib/components/my/avatar/web.d.ts | 1 - lib/components/my/info/web.d.ts | 1 - lib/components/my/info/web.pc.d.ts | 1 - .../userEntityGrant/cellButton/web.d.ts | 1 - lib/pages/address/list/web.d.ts | 1 - lib/pages/address/upsert/web.d.ts | 1 - .../application/config/upsert/web.pc.d.ts | 1 - lib/pages/application/detail/web.d.ts | 1 - lib/pages/application/list/web.pc.d.ts | 1 - lib/pages/application/upsert/web.pc.d.ts | 1 - lib/pages/article/detail/web.d.ts | 1 - lib/pages/article/list/web.d.ts | 1 - lib/pages/article/preview/web.d.ts | 1 - lib/pages/article/upsert/web.d.ts | 1 - lib/pages/domain/detail/web.d.ts | 1 - lib/pages/domain/list/web.pc.d.ts | 1 - lib/pages/domain/upsert/web.pc.d.ts | 1 - lib/pages/login/web.d.ts | 1 - lib/pages/mobile/login/web.d.ts | 1 - lib/pages/mobile/me/web.d.ts | 1 - lib/pages/personal/web.d.ts | 1 - lib/pages/personal/web.pc.d.ts | 1 - lib/pages/pickers/area/web.d.ts | 1 - lib/pages/platform/config/upsert/web.pc.d.ts | 1 - lib/pages/platform/detail/web.d.ts | 1 - lib/pages/platform/list/web.pc.d.ts | 1 - lib/pages/platform/upsert/web.pc.d.ts | 1 - lib/pages/system/config/upsert/web.pc.d.ts | 1 - lib/pages/system/detail/web.d.ts | 1 - lib/pages/system/list/web.pc.d.ts | 1 - lib/pages/system/upsert/web.pc.d.ts | 1 - lib/pages/token/me/web.d.ts | 1 - lib/pages/user/manage/detail/web.d.ts | 1 - lib/pages/user/manage/upsert/web.d.ts | 1 - lib/pages/user/manage/web.d.ts | 1 - lib/pages/user/manage/web.pc.d.ts | 1 - lib/pages/user/search/web.d.ts | 1 - lib/pages/userEntityGrant/confirm/web.d.ts | 1 - lib/pages/userEntityGrant/detail/web.d.ts | 1 - lib/pages/userEntityGrant/detail/web.pc.d.ts | 1 - lib/pages/userEntityGrant/grant/web.d.ts | 1 - lib/pages/userEntityGrant/list/web.d.ts | 1 - lib/pages/userRelation/list/web.d.ts | 1 - lib/pages/userRelation/list/web.pc.d.ts | 1 - lib/pages/userRelation/manage/web.d.ts | 1 - lib/pages/userRelation/onEntity/web.d.ts | 1 - lib/pages/userRelation/onUser/web.d.ts | 1 - .../userRelation/upsert/byMobile/web.pc.d.ts | 1 - .../userRelation/upsert/byUser/web.pc.d.ts | 1 - .../upsert/byUserEntityGrant/web.d.ts | 1 - .../upsert/byUserEntityGrant/web.pc.d.ts | 1 - .../upsert/onUser/userRelation/web.pc.d.ts | 1 - lib/pages/userRelation/upsert/onUser/web.d.ts | 1 - .../userRelation/upsert/onUser/web.pc.d.ts | 1 - lib/pages/userRelation/upsert/web.d.ts | 1 - lib/pages/userRelation/upsert/web.pc.d.ts | 1 - lib/pages/wechatQrCode/scan/web.d.ts | 1 - lib/pages/wechatUser/login/web.d.ts | 1 - lib/utils/dialog/index.mp.d.ts | 11 +++- lib/utils/dialog/index.mp.js | 54 +++++++++++++++++- lib/utils/message/index.mp.js | 2 +- src/components/message/index.xml | 2 +- src/utils/dialog/index.mp.ts | 56 ++++++++++++++++++- src/utils/message/index.mp.ts | 2 +- 82 files changed, 116 insertions(+), 87 deletions(-) diff --git a/lib/components/common/empty/empty.d.ts b/lib/components/common/empty/empty.d.ts index a67bcf109..5ad33b8bc 100644 --- a/lib/components/common/empty/empty.d.ts +++ b/lib/components/common/empty/empty.d.ts @@ -1,4 +1,3 @@ -/// import './index.less'; declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/common/empty/simple.d.ts b/lib/components/common/empty/simple.d.ts index a67bcf109..5ad33b8bc 100644 --- a/lib/components/common/empty/simple.d.ts +++ b/lib/components/common/empty/simple.d.ts @@ -1,4 +1,3 @@ -/// import './index.less'; declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/common/weChatLoginQrCode/index.d.ts b/lib/components/common/weChatLoginQrCode/index.d.ts index 54e2e93ee..261b368ef 100644 --- a/lib/components/common/weChatLoginQrCode/index.d.ts +++ b/lib/components/common/weChatLoginQrCode/index.d.ts @@ -1,4 +1,3 @@ -/// import './index.less'; interface QrCodeProps { id?: string; diff --git a/lib/components/config/application/web.pc.d.ts b/lib/components/config/application/web.pc.d.ts index 0dd74c034..289c251d1 100644 --- a/lib/components/config/application/web.pc.d.ts +++ b/lib/components/config/application/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/components/config/application/web/index.d.ts b/lib/components/config/application/web/index.d.ts index 90b02d1c5..b7f7da3d0 100644 --- a/lib/components/config/application/web/index.d.ts +++ b/lib/components/config/application/web/index.d.ts @@ -1,4 +1,3 @@ -/// import { WebConfig } from '../../../../general-app-domain/Application/Schema'; export default function Web(props: { config: WebConfig; diff --git a/lib/components/config/application/wechatMp/index.d.ts b/lib/components/config/application/wechatMp/index.d.ts index e70206643..cad38df4f 100644 --- a/lib/components/config/application/wechatMp/index.d.ts +++ b/lib/components/config/application/wechatMp/index.d.ts @@ -1,4 +1,3 @@ -/// import { WechatMpConfig } from '../../../../general-app-domain/Application/Schema'; export default function WechatMp(props: { config: WechatMpConfig; diff --git a/lib/components/config/application/wechatPublic/index.d.ts b/lib/components/config/application/wechatPublic/index.d.ts index c9c21655c..51cd047a7 100644 --- a/lib/components/config/application/wechatPublic/index.d.ts +++ b/lib/components/config/application/wechatPublic/index.d.ts @@ -1,4 +1,3 @@ -/// import { WechatPublicConfig } from '../../../../general-app-domain/Application/Schema'; export default function WechatPublic(props: { config: WechatPublicConfig; diff --git a/lib/components/config/upsert/account/index.d.ts b/lib/components/config/upsert/account/index.d.ts index ed8ae19c5..d12966ca5 100644 --- a/lib/components/config/upsert/account/index.d.ts +++ b/lib/components/config/upsert/account/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Account(props: { account: Required['Account']; diff --git a/lib/components/config/upsert/cos/index.d.ts b/lib/components/config/upsert/cos/index.d.ts index 1be008bf7..e597fb133 100644 --- a/lib/components/config/upsert/cos/index.d.ts +++ b/lib/components/config/upsert/cos/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { cos: Required['Cos']; diff --git a/lib/components/config/upsert/live/index.d.ts b/lib/components/config/upsert/live/index.d.ts index 35e0ce993..e6e06424f 100644 --- a/lib/components/config/upsert/live/index.d.ts +++ b/lib/components/config/upsert/live/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { live: Required['Live']; diff --git a/lib/components/config/upsert/map/index.d.ts b/lib/components/config/upsert/map/index.d.ts index 7b865bc39..84db02c1b 100644 --- a/lib/components/config/upsert/map/index.d.ts +++ b/lib/components/config/upsert/map/index.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../../types/Config'; export default function Cos(props: { map: Required['Map']; diff --git a/lib/components/config/upsert/web.pc.d.ts b/lib/components/config/upsert/web.pc.d.ts index 55df3262a..529956e31 100644 --- a/lib/components/config/upsert/web.pc.d.ts +++ b/lib/components/config/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { Config } from '../../../types/Config'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/components/extraFile/display/web.d.ts b/lib/components/extraFile/display/web.d.ts index 5eaeadcc2..cfaabf286 100644 --- a/lib/components/extraFile/display/web.d.ts +++ b/lib/components/extraFile/display/web.d.ts @@ -1,2 +1 @@ -/// export default function render(): JSX.Element; diff --git a/lib/components/extraFile/gallery/web.d.ts b/lib/components/extraFile/gallery/web.d.ts index e0125b1e0..99a59a462 100644 --- a/lib/components/extraFile/gallery/web.d.ts +++ b/lib/components/extraFile/gallery/web.d.ts @@ -1,4 +1,3 @@ -/// import { UploadFile } from 'antd'; import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; diff --git a/lib/components/func/actionPanel/web.d.ts b/lib/components/func/actionPanel/web.d.ts index bdf44b412..2ae338d31 100644 --- a/lib/components/func/actionPanel/web.d.ts +++ b/lib/components/func/actionPanel/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from "oak-frontend-base"; import { EntityDict } from "../../../general-app-domain"; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; import './web.less'; diff --git a/lib/components/message/web.d.ts b/lib/components/message/web.d.ts index ee53e17bd..2ee2d0046 100644 --- a/lib/components/message/web.d.ts +++ b/lib/components/message/web.d.ts @@ -1,4 +1,3 @@ -/// import { MessageProps } from 'oak-frontend-base/lib/types/Message'; export default function render(props: { data: { diff --git a/lib/components/my/avatar/web.d.ts b/lib/components/my/avatar/web.d.ts index b6d4120e5..14968938d 100644 --- a/lib/components/my/avatar/web.d.ts +++ b/lib/components/my/avatar/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; import { AvatarSize } from 'antd/es/avatar/SizeContext'; diff --git a/lib/components/my/info/web.d.ts b/lib/components/my/info/web.d.ts index 7a0240a16..b5bc0e9c6 100644 --- a/lib/components/my/info/web.d.ts +++ b/lib/components/my/info/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { AppType, WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/application/detail/web.d.ts b/lib/pages/application/detail/web.d.ts index 466f965ed..abf9578b3 100644 --- a/lib/pages/application/detail/web.d.ts +++ b/lib/pages/application/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebConfig, WechatPublicConfig, WechatMpConfig } from '../../../general-app-domain/Application/Schema'; import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/application/list/web.pc.d.ts b/lib/pages/application/list/web.pc.d.ts index 7d9c794d6..f83736a11 100644 --- a/lib/pages/application/list/web.pc.d.ts +++ b/lib/pages/application/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from './../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import '@wangeditor/editor/dist/css/style.css'; import { EntityDict } from './../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/domain/detail/web.d.ts b/lib/pages/domain/detail/web.d.ts index 54de6e3ae..0fde0e02e 100644 --- a/lib/pages/domain/detail/web.d.ts +++ b/lib/pages/domain/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../general-app-domain'; export default function render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/mobile/me/web.d.ts b/lib/pages/mobile/me/web.d.ts index bcd7e916b..90d439ce1 100644 --- a/lib/pages/mobile/me/web.d.ts +++ b/lib/pages/mobile/me/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps export default function Render(): JSX.Element; diff --git a/lib/pages/personal/web.pc.d.ts b/lib/pages/personal/web.pc.d.ts index aa9c8f0b9..baca2f3aa 100644 --- a/lib/pages/personal/web.pc.d.ts +++ b/lib/pages/personal/web.pc.d.ts @@ -1,2 +1 @@ -/// export default function Render(): JSX.Element; diff --git a/lib/pages/pickers/area/web.d.ts b/lib/pages/pickers/area/web.d.ts index 402dea2d5..96962c2b8 100644 --- a/lib/pages/pickers/area/web.d.ts +++ b/lib/pages/pickers/area/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { Config } from '../../../../types/Config'; import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/platform/detail/web.d.ts b/lib/pages/platform/detail/web.d.ts index 5cf6f9d31..e934cc279 100644 --- a/lib/pages/platform/detail/web.d.ts +++ b/lib/pages/platform/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { Config } from '../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/platform/list/web.pc.d.ts b/lib/pages/platform/list/web.pc.d.ts index 938411724..34feac623 100644 --- a/lib/pages/platform/list/web.pc.d.ts +++ b/lib/pages/platform/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../../general-app-domain'; import { Config } from '../../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/system/detail/web.d.ts b/lib/pages/system/detail/web.d.ts index b5371919f..cce76388c 100644 --- a/lib/pages/system/detail/web.d.ts +++ b/lib/pages/system/detail/web.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { Config } from '../../../types/Config'; import { WebComponentProps } from 'oak-frontend-base'; diff --git a/lib/pages/system/list/web.pc.d.ts b/lib/pages/system/list/web.pc.d.ts index 843a9d166..3f7e8af66 100644 --- a/lib/pages/system/list/web.pc.d.ts +++ b/lib/pages/system/list/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function render(props: WebComponentProps import { EntityDict } from '../../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/user/search/web.d.ts b/lib/pages/user/search/web.d.ts index 5eaeadcc2..cfaabf286 100644 --- a/lib/pages/user/search/web.d.ts +++ b/lib/pages/user/search/web.d.ts @@ -1,2 +1 @@ -/// export default function render(): JSX.Element; diff --git a/lib/pages/userEntityGrant/confirm/web.d.ts b/lib/pages/userEntityGrant/confirm/web.d.ts index 1674e7f9a..c567cdf19 100644 --- a/lib/pages/userEntityGrant/confirm/web.d.ts +++ b/lib/pages/userEntityGrant/confirm/web.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function render(props: WebComponentProps export default function Render(props: any): JSX.Element; diff --git a/lib/pages/userEntityGrant/detail/web.pc.d.ts b/lib/pages/userEntityGrant/detail/web.pc.d.ts index b88b8c10f..17acc3779 100644 --- a/lib/pages/userEntityGrant/detail/web.pc.d.ts +++ b/lib/pages/userEntityGrant/detail/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/onEntity/web.d.ts b/lib/pages/userRelation/onEntity/web.d.ts index ad0b8f2aa..11df1296a 100644 --- a/lib/pages/userRelation/onEntity/web.d.ts +++ b/lib/pages/userRelation/onEntity/web.d.ts @@ -1,2 +1 @@ -/// export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/onUser/web.d.ts b/lib/pages/userRelation/onUser/web.d.ts index ad0b8f2aa..11df1296a 100644 --- a/lib/pages/userRelation/onUser/web.d.ts +++ b/lib/pages/userRelation/onUser/web.d.ts @@ -1,2 +1 @@ -/// export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts b/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts index ef231e514..8c8945357 100644 --- a/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/byMobile/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts b/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts index d4ffe02e7..7de5e2f13 100644 --- a/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/byUserEntityGrant/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function render(props: WebComponentProps import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/onUser/web.pc.d.ts b/lib/pages/userRelation/upsert/onUser/web.pc.d.ts index e17464587..dc6832f7c 100644 --- a/lib/pages/userRelation/upsert/onUser/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/onUser/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../general-app-domain'; export default function Render(props: WebComponentProps export default function render(this: any): JSX.Element; diff --git a/lib/pages/userRelation/upsert/web.pc.d.ts b/lib/pages/userRelation/upsert/web.pc.d.ts index 9779d29cb..fbdc2b78b 100644 --- a/lib/pages/userRelation/upsert/web.pc.d.ts +++ b/lib/pages/userRelation/upsert/web.pc.d.ts @@ -1,4 +1,3 @@ -/// import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; export default function Render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps import { EntityDict } from '../../../general-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps): any; + success(options: Record): any; + warning(options: Record): any; + error(options: Record): any; + confirm(options: Record): any; + hide(context: any): void; +}; +export default Message; diff --git a/lib/utils/dialog/index.mp.js b/lib/utils/dialog/index.mp.js index 251130122..495d81ee7 100644 --- a/lib/utils/dialog/index.mp.js +++ b/lib/utils/dialog/index.mp.js @@ -1,6 +1,54 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); -// @ts-ignore -var index_1 = tslib_1.__importDefault(require("../../miniprogram_npm/tdesign/dialog/index")); -exports.default = index_1.default; +var DialogType = { + info: 'info', + success: 'success', + warning: 'warning', + error: 'error', + confirm: 'confirm', +}; +function getInstance(context, selector) { + if (selector === void 0) { selector = '#oak-dialog'; } + var instance = context.selectComponent(selector); + if (!instance) { + return Promise.reject(new Error('未找到Dialog组件, 请检查selector是否正确')); + } + return instance; +} +function showDialog(options, type) { + if (type === void 0) { type = DialogType.info; } + var options2 = tslib_1.__assign({}, options); + var context = options2.context; + delete options.context; + var instance = getInstance(context); + instance.resetData(function () { + instance.setData(Object.assign({ type: type }, options), instance.show); + }); + return instance; +} +var Message = { + info: function (options) { + return showDialog(options, DialogType.info); + }, + success: function (options) { + return showDialog(options, DialogType.success); + }, + warning: function (options) { + return showDialog(options, DialogType.warning); + }, + error: function (options) { + return showDialog(options, DialogType.error); + }, + confirm: function (options) { + return showDialog(options, DialogType.confirm); + }, + hide: function (context) { + var instance = getInstance(context); + if (!instance) { + return; + } + instance.linHide(); + }, +}; +exports.default = Message; diff --git a/lib/utils/message/index.mp.js b/lib/utils/message/index.mp.js index 306544bc0..5cba043fa 100644 --- a/lib/utils/message/index.mp.js +++ b/lib/utils/message/index.mp.js @@ -8,7 +8,7 @@ var MessageType = { error: 'error', }; function getInstance(context, selector) { - if (selector === void 0) { selector = '#t-message'; } + if (selector === void 0) { selector = '#oak-message'; } var instance = context.selectComponent(selector); if (!instance) { return Promise.reject(new Error('未找到Message组件, 请检查selector是否正确')); diff --git a/src/components/message/index.xml b/src/components/message/index.xml index e523fe35b..f0536c57d 100644 --- a/src/components/message/index.xml +++ b/src/components/message/index.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/utils/dialog/index.mp.ts b/src/utils/dialog/index.mp.ts index 962cc50a3..84306f1c5 100644 --- a/src/utils/dialog/index.mp.ts +++ b/src/utils/dialog/index.mp.ts @@ -1,4 +1,54 @@ -// @ts-ignore -import Dialog from '../../miniprogram_npm/tdesign/dialog/index'; +const DialogType = { + info: 'info', + success: 'success', + warning: 'warning', + error: 'error', + confirm: 'confirm', +}; -export default Dialog; +function getInstance(context: any, selector = '#oak-dialog') { + const instance = context.selectComponent(selector); + if (!instance) { + return Promise.reject( + new Error('未找到Dialog组件, 请检查selector是否正确') + ); + } + return instance; +} +function showDialog(options: Record, type = DialogType.info) { + const options2 = { ...options }; + const { context } = options2; + delete options.context; + const instance = getInstance(context); + instance.resetData(() => { + instance.setData(Object.assign({ type }, options), instance.show); + }); + return instance; +} + +const Message = { + info(options: Record) { + return showDialog(options, DialogType.info); + }, + success(options: Record) { + return showDialog(options, DialogType.success); + }, + warning(options: Record) { + return showDialog(options, DialogType.warning); + }, + error(options: Record) { + return showDialog(options, DialogType.error); + }, + confirm(options: Record) { + return showDialog(options, DialogType.confirm); + }, + hide(context: any) { + const instance = getInstance(context); + if (!instance) { + return; + } + instance.linHide(); + }, +}; + +export default Message; diff --git a/src/utils/message/index.mp.ts b/src/utils/message/index.mp.ts index 2fa258a1a..5b093b5e0 100644 --- a/src/utils/message/index.mp.ts +++ b/src/utils/message/index.mp.ts @@ -5,7 +5,7 @@ const MessageType = { error: 'error', }; -function getInstance(context: any, selector = '#t-message') { +function getInstance(context: any, selector = '#oak-message') { const instance = context.selectComponent(selector); if (!instance) { return Promise.reject( From d0fcb399c7697e562d24145a7cecaef3521aa22c Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Tue, 20 Dec 2022 19:00:35 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20icon=E5=BC=95=E5=85=A5=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/extraFile/gallery/index.json | 2 +- lib/components/extraFile/gallery/index.xml | 2 +- src/components/extraFile/gallery/index.json | 2 +- src/components/extraFile/gallery/index.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/components/extraFile/gallery/index.json b/lib/components/extraFile/gallery/index.json index aff4724a6..94c8fb3a5 100644 --- a/lib/components/extraFile/gallery/index.json +++ b/lib/components/extraFile/gallery/index.json @@ -1,7 +1,7 @@ { "component": true, "usingComponents": { - "t-icon": "../../../miniprogram_npm/tdesign/icon/icon" + "l-icon": "../../../miniprogram_npm/lin-ui/icon/index" }, "componentGenerics": { "item": true diff --git a/lib/components/extraFile/gallery/index.xml b/lib/components/extraFile/gallery/index.xml index 205a2decf..02ba6827f 100644 --- a/lib/components/extraFile/gallery/index.xml +++ b/lib/components/extraFile/gallery/index.xml @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/src/components/extraFile/gallery/index.json b/src/components/extraFile/gallery/index.json index 9832a9bcc..7214fb2f0 100644 --- a/src/components/extraFile/gallery/index.json +++ b/src/components/extraFile/gallery/index.json @@ -1,7 +1,7 @@ { "component": true, "usingComponents": { - "t-icon": "../../../miniprogram_npm/tdesign/icon/icon" + "l-icon": "../../../miniprogram_npm/lin-ui/icon/index" }, "componentGenerics": { "item": true diff --git a/src/components/extraFile/gallery/index.xml b/src/components/extraFile/gallery/index.xml index 205a2decf..02ba6827f 100644 --- a/src/components/extraFile/gallery/index.xml +++ b/src/components/extraFile/gallery/index.xml @@ -14,7 +14,7 @@ - + \ No newline at end of file From ceb579aa45537db3738b9360dd4d6b167ac2f241 Mon Sep 17 00:00:00 2001 From: wenjiarui Date: Wed, 21 Dec 2022 13:03:26 +0800 Subject: [PATCH 3/8] lib --- lib/entities/Article.d.ts | 1 + lib/entities/Article.js | 1 + lib/entities/MessageSent.d.ts | 2 +- lib/entities/MessageSent.js | 4 +- lib/entities/Subscription.d.ts | 14 ++ lib/entities/Subscription.js | 36 +++++ lib/general-app-domain/Article/Schema.d.ts | 7 + lib/general-app-domain/Article/Storage.js | 3 + .../Article/locales/zh_CN.json | 2 +- lib/general-app-domain/EntityDict.d.ts | 2 + .../MessageSent/Schema.d.ts | 6 +- .../MessageSent/locales/zh_CN.json | 2 +- lib/general-app-domain/Storage.js | 26 +-- .../Subscription/Schema.d.ts | 129 +++++++++++++++ lib/general-app-domain/Subscription/Schema.js | 2 + .../Subscription/Storage.d.ts | 3 + .../Subscription/Storage.js | 56 +++++++ .../Subscription/locales/zh_CN.json | 1 + lib/general-app-domain/_SubQuery.d.ts | 6 + lib/triggers/message.d.ts | 3 + lib/triggers/message.js | 150 ++++++++++-------- lib/triggers/messageSent.d.ts | 5 + lib/triggers/messageSent.js | 85 ++++++++++ src/triggers/message.ts | 2 +- 24 files changed, 463 insertions(+), 85 deletions(-) create mode 100644 lib/entities/Subscription.d.ts create mode 100644 lib/entities/Subscription.js create mode 100644 lib/general-app-domain/Subscription/Schema.d.ts create mode 100644 lib/general-app-domain/Subscription/Schema.js create mode 100644 lib/general-app-domain/Subscription/Storage.d.ts create mode 100644 lib/general-app-domain/Subscription/Storage.js create mode 100644 lib/general-app-domain/Subscription/locales/zh_CN.json create mode 100644 lib/triggers/messageSent.d.ts create mode 100644 lib/triggers/messageSent.js diff --git a/lib/entities/Article.d.ts b/lib/entities/Article.d.ts index 8680e37e1..d25e0e5b7 100644 --- a/lib/entities/Article.d.ts +++ b/lib/entities/Article.d.ts @@ -8,6 +8,7 @@ export interface Schema extends EntityShape { author: String<32>; abstract?: Text; content?: Text; + url?: Text; files: Array; sign: String<32>; } diff --git a/lib/entities/Article.js b/lib/entities/Article.js index d62cd3272..71f29d999 100644 --- a/lib/entities/Article.js +++ b/lib/entities/Article.js @@ -17,6 +17,7 @@ var locale = { content: '正文', files: '封面图', iState: '状态', + url: '外部链接', entity: '关联对象', entityId: '关联对象id', sign: '唯一标志', diff --git a/lib/entities/MessageSent.d.ts b/lib/entities/MessageSent.d.ts index f2653ff85..21c3ecb95 100644 --- a/lib/entities/MessageSent.d.ts +++ b/lib/entities/MessageSent.d.ts @@ -1,7 +1,7 @@ import { Schema as Message } from './Message'; import { EntityShape } from 'oak-domain/lib/types/Entity'; export interface Schema extends EntityShape { - channel: 'public' | 'jPush' | 'jim' | 'mp' | 'gsm'; + channel: 'wechat' | 'jPush' | 'jim' | 'mp' | 'sms'; data: Object; message: Message; data1: Object; diff --git a/lib/entities/MessageSent.js b/lib/entities/MessageSent.js index f271d2063..182987e39 100644 --- a/lib/entities/MessageSent.js +++ b/lib/entities/MessageSent.js @@ -29,11 +29,11 @@ var locale = { failure: '发送失败', }, channel: { - public: '公众号', + wechat: '公众号', jPush: '极光推送', jim: '极光消息', mp: '小程序', - gsm: '短信', + sms: '短信', } } }, diff --git a/lib/entities/Subscription.d.ts b/lib/entities/Subscription.d.ts new file mode 100644 index 000000000..d703bae55 --- /dev/null +++ b/lib/entities/Subscription.d.ts @@ -0,0 +1,14 @@ +import { String, Text } from 'oak-domain/lib/types/DataType'; +import { EntityShape } from 'oak-domain/lib/types/Entity'; +export declare type WechatPublicConfig = { + type: 'wechatPublic'; + appId: string; + appSecret: string; +}; +export interface Schema extends EntityShape { + entity: String<32>; + entityId: String<64>; + name: String<32>; + description: Text; + config: WechatPublicConfig; +} diff --git a/lib/entities/Subscription.js b/lib/entities/Subscription.js new file mode 100644 index 000000000..79a51660e --- /dev/null +++ b/lib/entities/Subscription.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +; +var indexes = [ + //索引 + { + name: 'index_name', + attributes: [ + { + name: 'name', + }, + ], + }, + { + name: 'index_entity', + attributes: [ + { + name: 'entity', + }, + { + name: 'entityId', + } + ], + }, +]; +var locale = { + zh_CN: { + attr: { + name: '名称', + entity: '对象名称', + entityId: '对象Id', + description: '描述', + config: '配置', + }, + }, +}; diff --git a/lib/general-app-domain/Article/Schema.d.ts b/lib/general-app-domain/Article/Schema.d.ts index 52ee1fd3f..a1c622c21 100644 --- a/lib/general-app-domain/Article/Schema.d.ts +++ b/lib/general-app-domain/Article/Schema.d.ts @@ -12,6 +12,7 @@ export declare type OpSchema = EntityShape & { author: String<32>; abstract?: Text | null; content?: Text | null; + url?: Text | null; sign: String<32>; iState?: IState | null; }; @@ -23,6 +24,7 @@ export declare type Schema = EntityShape & { author: String<32>; abstract?: Text | null; content?: Text | null; + url?: Text | null; sign: String<32>; iState?: IState | null; extraFile$entity?: Array; @@ -40,6 +42,7 @@ declare type AttrFilter = { author: Q_StringValue; abstract: Q_StringValue; content: Q_StringValue; + url: Q_StringValue; sign: Q_StringValue; iState: Q_EnumValue; }; @@ -57,6 +60,7 @@ export declare type Projection = { author?: number; abstract?: number; content?: number; + url?: number; sign?: number; iState?: number; extraFile$entity?: ExtraFile.Selection & { @@ -76,6 +80,7 @@ export declare type ExportProjection = { author?: string; abstract?: string; content?: string; + url?: string; sign?: string; iState?: string; extraFile$entity?: ExtraFile.Exportation & { @@ -105,6 +110,8 @@ export declare type SortAttr = { abstract: number; } | { content: number; +} | { + url: number; } | { sign: number; } | { diff --git a/lib/general-app-domain/Article/Storage.js b/lib/general-app-domain/Article/Storage.js index a5f010a66..9f075b09d 100644 --- a/lib/general-app-domain/Article/Storage.js +++ b/lib/general-app-domain/Article/Storage.js @@ -34,6 +34,9 @@ exports.desc = { content: { type: "text" }, + url: { + type: "text" + }, sign: { type: "varchar", params: { diff --git a/lib/general-app-domain/Article/locales/zh_CN.json b/lib/general-app-domain/Article/locales/zh_CN.json index 0a56bdcea..55e0aca25 100644 --- a/lib/general-app-domain/Article/locales/zh_CN.json +++ b/lib/general-app-domain/Article/locales/zh_CN.json @@ -1 +1 @@ -{ "attr": { "title": "标题", "author": "作者", "abstract": "简介", "content": "正文", "files": "封面图", "iState": "状态", "entity": "关联对象", "entityId": "关联对象id", "sign": "唯一标志" }, "action": { "online": "上架", "offline": "下架", "disabled": "禁用" }, "v": { "iState": { "online": "已上架", "offline": "已下架", "disabled": "已禁用" } } } +{ "attr": { "title": "标题", "author": "作者", "abstract": "简介", "content": "正文", "files": "封面图", "iState": "状态", "url": "外部链接", "entity": "关联对象", "entityId": "关联对象id", "sign": "唯一标志" }, "action": { "online": "上架", "offline": "下架", "disabled": "禁用" }, "v": { "iState": { "online": "已上架", "offline": "已下架", "disabled": "已禁用" } } } diff --git a/lib/general-app-domain/EntityDict.d.ts b/lib/general-app-domain/EntityDict.d.ts index 440c346a5..a659656ae 100644 --- a/lib/general-app-domain/EntityDict.d.ts +++ b/lib/general-app-domain/EntityDict.d.ts @@ -18,6 +18,7 @@ import { EntityDef as Mobile } from "./Mobile/Schema"; import { EntityDef as Platform } from "./Platform/Schema"; import { EntityDef as UserRole } from "./UserRole/Schema"; import { EntityDef as Role } from "./Role/Schema"; +import { EntityDef as Subscription } from "./Subscription/Schema"; import { EntityDef as System } from "./System/Schema"; import { EntityDef as Token } from "./Token/Schema"; import { EntityDef as UserEntityGrant } from "./UserEntityGrant/Schema"; @@ -45,6 +46,7 @@ export declare type EntityDict = { platform: Platform; userRole: UserRole; role: Role; + subscription: Subscription; system: System; token: Token; userEntityGrant: UserEntityGrant; diff --git a/lib/general-app-domain/MessageSent/Schema.d.ts b/lib/general-app-domain/MessageSent/Schema.d.ts index 10e7b4ea2..f8768b0f9 100644 --- a/lib/general-app-domain/MessageSent/Schema.d.ts +++ b/lib/general-app-domain/MessageSent/Schema.d.ts @@ -6,7 +6,7 @@ import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction a import { Action, ParticularAction, IState } from "./Action"; import * as Message from "../Message/Schema"; export declare type OpSchema = EntityShape & { - channel: 'public' | 'jPush' | 'jim' | 'mp' | 'gsm'; + channel: 'wechat' | 'jPush' | 'jim' | 'mp' | 'sms'; data: Object; messageId: ForeignKey<"message">; data1: Object; @@ -15,7 +15,7 @@ export declare type OpSchema = EntityShape & { }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { - channel: 'public' | 'jPush' | 'jim' | 'mp' | 'gsm'; + channel: 'wechat' | 'jPush' | 'jim' | 'mp' | 'sms'; data: Object; messageId: ForeignKey<"message">; data1: Object; @@ -30,7 +30,7 @@ declare type AttrFilter = { $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; - channel: Q_EnumValue<'public' | 'jPush' | 'jim' | 'mp' | 'gsm'>; + channel: Q_EnumValue<'wechat' | 'jPush' | 'jim' | 'mp' | 'sms'>; data: Object; messageId: Q_StringValue | SubQuery.MessageIdSubQuery; message: Message.Filter; diff --git a/lib/general-app-domain/MessageSent/locales/zh_CN.json b/lib/general-app-domain/MessageSent/locales/zh_CN.json index acb42b335..d4b3d5504 100644 --- a/lib/general-app-domain/MessageSent/locales/zh_CN.json +++ b/lib/general-app-domain/MessageSent/locales/zh_CN.json @@ -1 +1 @@ -{ "attr": { "channel": "消息渠道", "data": "消息数据", "message": "消息", "data1": "数据1", "data2": "数据2", "iState": "状态" }, "action": { "succeed": "成功", "fail": "失败" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "channel": { "public": "公众号", "jPush": "极光推送", "jim": "极光消息", "mp": "小程序", "gsm": "短信" } } } +{ "attr": { "channel": "消息渠道", "data": "消息数据", "message": "消息", "data1": "数据1", "data2": "数据2", "iState": "状态" }, "action": { "succeed": "成功", "fail": "失败" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "channel": { "wechat": "公众号", "jPush": "极光推送", "jim": "极光消息", "mp": "小程序", "sms": "短信" } } } diff --git a/lib/general-app-domain/Storage.js b/lib/general-app-domain/Storage.js index 6ac23f207..f5fd11d5c 100644 --- a/lib/general-app-domain/Storage.js +++ b/lib/general-app-domain/Storage.js @@ -21,12 +21,13 @@ var Storage_17 = require("./Mobile/Storage"); var Storage_18 = require("./Platform/Storage"); var Storage_19 = require("./UserRole/Storage"); var Storage_20 = require("./Role/Storage"); -var Storage_21 = require("./System/Storage"); -var Storage_22 = require("./Token/Storage"); -var Storage_23 = require("./UserEntityGrant/Storage"); -var Storage_24 = require("./UserSystem/Storage"); -var Storage_25 = require("./WechatQrCode/Storage"); -var Storage_26 = require("./WechatUser/Storage"); +var Storage_21 = require("./Subscription/Storage"); +var Storage_22 = require("./System/Storage"); +var Storage_23 = require("./Token/Storage"); +var Storage_24 = require("./UserEntityGrant/Storage"); +var Storage_25 = require("./UserSystem/Storage"); +var Storage_26 = require("./WechatQrCode/Storage"); +var Storage_27 = require("./WechatUser/Storage"); exports.storageSchema = { modi: Storage_1.desc, modiEntity: Storage_2.desc, @@ -48,10 +49,11 @@ exports.storageSchema = { platform: Storage_18.desc, userRole: Storage_19.desc, role: Storage_20.desc, - system: Storage_21.desc, - token: Storage_22.desc, - userEntityGrant: Storage_23.desc, - userSystem: Storage_24.desc, - wechatQrCode: Storage_25.desc, - wechatUser: Storage_26.desc + subscription: Storage_21.desc, + system: Storage_22.desc, + token: Storage_23.desc, + userEntityGrant: Storage_24.desc, + userSystem: Storage_25.desc, + wechatQrCode: Storage_26.desc, + wechatUser: Storage_27.desc }; diff --git a/lib/general-app-domain/Subscription/Schema.d.ts b/lib/general-app-domain/Subscription/Schema.d.ts new file mode 100644 index 000000000..0418709f4 --- /dev/null +++ b/lib/general-app-domain/Subscription/Schema.d.ts @@ -0,0 +1,129 @@ +import { String, Text } from "oak-domain/lib/types/DataType"; +import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; +import { OneOf } from "oak-domain/lib/types/Polyfill"; +import * as SubQuery from "../_SubQuery"; +import { FormCreateData, FormUpdateData, Operation as OakOperation, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity"; +import { GenericAction } from "oak-domain/lib/actions/action"; +export declare type WechatPublicConfig = { + type: 'wechatPublic'; + appId: string; + appSecret: string; +}; +export declare type OpSchema = EntityShape & { + entity: String<32>; + entityId: String<64>; + name: String<32>; + description: Text; + config: WechatPublicConfig; +}; +export declare type OpAttr = keyof OpSchema; +export declare type Schema = EntityShape & { + entity: String<32>; + entityId: String<64>; + name: String<32>; + description: Text; + config: WechatPublicConfig; +} & { + [A in ExpressionKey]?: any; +}; +declare type AttrFilter = { + id: Q_StringValue | SubQuery.SubscriptionIdSubQuery; + $$createAt$$: Q_DateValue; + $$seq$$: Q_StringValue; + $$updateAt$$: Q_DateValue; + entity: Q_StringValue; + entityId: Q_StringValue; + name: Q_StringValue; + description: Q_StringValue; + config: Q_EnumValue; +}; +export declare type Filter = MakeFilter>; +export declare type Projection = { + "#id"?: NodeId; + [k: string]: any; + id: number; + $$createAt$$?: number; + $$updateAt$$?: number; + $$seq$$?: number; + entity?: number; + entityId?: number; + name?: number; + description?: number; + config?: number; +} & Partial>; +export declare type ExportProjection = { + "#id"?: NodeId; + [k: string]: any; + id?: string; + $$createAt$$?: string; + $$updateAt$$?: string; + $$seq$$?: string; + entity?: string; + entityId?: string; + name?: string; + description?: string; + config?: string; +} & Partial>; +declare type SubscriptionIdProjection = OneOf<{ + id: number; +}>; +export declare type SortAttr = { + id: number; +} | { + $$createAt$$: number; +} | { + $$seq$$: number; +} | { + $$updateAt$$: number; +} | { + entity: number; +} | { + entityId: number; +} | { + name: number; +} | { + description: number; +} | { + config: number; +} | { + [k: string]: any; +} | OneOf>; +export declare type SortNode = { + $attr: SortAttr; + $direction?: "asc" | "desc"; +}; +export declare type Sorter = SortNode[]; +export declare type SelectOperation

= Omit, "id">; +export declare type Selection

= Omit, "action">; +export declare type Exportation = OakOperation<"export", ExportProjection, Filter, Sorter>; +export declare type CreateOperationData = FormCreateData> & ({ + entity?: string; + entityId?: string; + [K: string]: any; +}); +export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>; +export declare type CreateMultipleOperation = OakOperation<"create", Array>; +export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; +export declare type UpdateOperationData = FormUpdateData & { + [k: string]: any; +}; +export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>; +export declare type RemoveOperationData = {}; +export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; +export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation | SelectOperation; +export declare type SubscriptionIdSubQuery = Selection; +export declare type NativeAttr = OpAttr; +export declare type FullAttr = NativeAttr; +export declare type EntityDef = { + Schema: Schema; + OpSchema: OpSchema; + Action: OakMakeAction | string; + Selection: Selection; + Operation: Operation; + Create: CreateOperation; + Update: UpdateOperation; + Remove: RemoveOperation; + CreateSingle: CreateSingleOperation; + CreateMulti: CreateMultipleOperation; +}; +export {}; diff --git a/lib/general-app-domain/Subscription/Schema.js b/lib/general-app-domain/Subscription/Schema.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/lib/general-app-domain/Subscription/Schema.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/general-app-domain/Subscription/Storage.d.ts b/lib/general-app-domain/Subscription/Storage.d.ts new file mode 100644 index 000000000..a3f0fbbb0 --- /dev/null +++ b/lib/general-app-domain/Subscription/Storage.d.ts @@ -0,0 +1,3 @@ +import { StorageDesc } from "oak-domain/lib/types/Storage"; +import { OpSchema } from "./Schema"; +export declare const desc: StorageDesc; diff --git a/lib/general-app-domain/Subscription/Storage.js b/lib/general-app-domain/Subscription/Storage.js new file mode 100644 index 000000000..233cb5c00 --- /dev/null +++ b/lib/general-app-domain/Subscription/Storage.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.desc = void 0; +var action_1 = require("oak-domain/lib/actions/action"); +exports.desc = { + attributes: { + entity: { + type: "varchar", + params: { + length: 32 + } + }, + entityId: { + type: "varchar", + params: { + length: 64 + } + }, + name: { + type: "varchar", + params: { + length: 32 + } + }, + description: { + type: "text" + }, + config: { + type: "object" + } + }, + actionType: "crud", + actions: action_1.genericActions, + indexes: [ + //索引 + { + name: 'index_name', + attributes: [ + { + name: 'name' + }, + ] + }, + { + name: 'index_entity', + attributes: [ + { + name: 'entity' + }, + { + name: 'entityId' + } + ] + } + ] +}; diff --git a/lib/general-app-domain/Subscription/locales/zh_CN.json b/lib/general-app-domain/Subscription/locales/zh_CN.json new file mode 100644 index 000000000..c19190e92 --- /dev/null +++ b/lib/general-app-domain/Subscription/locales/zh_CN.json @@ -0,0 +1 @@ +{ "attr": { "name": "名称", "entity": "对象名称", "entityId": "对象Id", "description": "描述", "config": "配置" } } diff --git a/lib/general-app-domain/_SubQuery.d.ts b/lib/general-app-domain/_SubQuery.d.ts index aec8dd2ff..4a9298815 100644 --- a/lib/general-app-domain/_SubQuery.d.ts +++ b/lib/general-app-domain/_SubQuery.d.ts @@ -18,6 +18,7 @@ import * as Mobile from "./Mobile/Schema"; import * as Platform from "./Platform/Schema"; import * as UserRole from "./UserRole/Schema"; import * as Role from "./Role/Schema"; +import * as Subscription from "./Subscription/Schema"; import * as System from "./System/Schema"; import * as Token from "./Token/Schema"; import * as UserEntityGrant from "./UserEntityGrant/Schema"; @@ -164,6 +165,11 @@ export declare type RoleIdSubQuery = { entity: "role"; }) | any; }; +export declare type SubscriptionIdSubQuery = { + [K in "$in" | "$nin"]?: (Subscription.SubscriptionIdSubQuery & { + entity: "subscription"; + }) | any; +}; export declare type SystemIdSubQuery = { [K in "$in" | "$nin"]?: (Application.SystemIdSubQuery & { entity: "application"; diff --git a/lib/triggers/message.d.ts b/lib/triggers/message.d.ts index 15e9b007e..d79650ded 100644 --- a/lib/triggers/message.d.ts +++ b/lib/triggers/message.d.ts @@ -1,10 +1,13 @@ import { Trigger } from 'oak-domain/lib/types/Trigger'; import { EntityDict } from '../general-app-domain/EntityDict'; +import { CreateOperationData as CreateMessageData } from '../general-app-domain/Message/Schema'; import { RuntimeCxt } from '../types/RuntimeCxt'; +import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; import { MessagePropsToSms, MessagePropsToWechat } from '../types/Message'; export declare function registerMessagePropsConverter(converter: { sms?: MessagePropsToSms; wechat?: MessagePropsToWechat; }): void; +export declare function addMessageSent(message: CreateMessageData, context: BackendRuntimeContext): Promise<0 | 1>; declare const triggers: Trigger[]; export default triggers; diff --git a/lib/triggers/message.js b/lib/triggers/message.js index 77f978cdd..e4280097f 100644 --- a/lib/triggers/message.js +++ b/lib/triggers/message.js @@ -1,7 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registerMessagePropsConverter = void 0; +exports.addMessageSent = exports.registerMessagePropsConverter = void 0; var tslib_1 = require("tslib"); +var uuid_1 = require("oak-domain/lib/utils/uuid"); var assert_1 = require("oak-domain/lib/utils/assert"); var SmsCoverter; var WechatConverter; @@ -13,37 +14,67 @@ function registerMessagePropsConverter(converter) { exports.registerMessagePropsConverter = registerMessagePropsConverter; function tryAddMessageSent(message, channel, context) { return tslib_1.__awaiter(this, void 0, void 0, function () { - return tslib_1.__generator(this, function (_a) { - // const { systemId, type } = message; - // const disperse = MessageDisperse && MessageDisperse[systemId] && MessageDisperse[systemId][type] && MessageDisperse[systemId][type][channel]; - // if (!disperse) { - // return 0; - // } - // // 有配置也未必一定能发,比如说用户没有注册手机号,则无法发gsm - // const data = disperse(message); - // if (!data) { - // return 0; - // } - // const messageSent = { - // messageId: message.id, - // iState: 'sending', - // channel, - // }; - // await context.operate('messageSent', { - // id: await generateNewIdAsync(), - // action: 'create', - // data: { - // id: await generateNewId(), - // ...messageSent, - // } as EntityDict['messageSent']['OpSchema'], - // }, {}); - return [2 /*return*/, 1]; + var systemId, props, type, _a, application, config2, appId, dispersedData, _b, _c, _d; + var _e; + return tslib_1.__generator(this, function (_f) { + switch (_f.label) { + case 0: + if (!WechatConverter) { + return [2 /*return*/, 0]; + } + systemId = message.systemId, props = message.props, type = message.type; + return [4 /*yield*/, context.select('application', { + data: { + id: 1, + name: 1, + config: 1, + type: 1, + systemId: 1, + style: 1, + }, + filter: { + type: 'wechatPublic', + systemId: systemId, + }, + }, {})]; + case 1: + _a = tslib_1.__read.apply(void 0, [_f.sent(), 1]), application = _a[0]; + config2 = application.config; + appId = config2.appId; + switch (channel) { + case 'weChat': { + dispersedData = WechatConverter(type, props, appId); + break; + } + default: { + break; + } + } + if (!dispersedData) { + return [2 /*return*/, 0]; + } + _c = (_b = context).operate; + _d = ['messageSent']; + _e = {}; + return [4 /*yield*/, (0, uuid_1.generateNewIdAsync)()]; + case 2: return [4 /*yield*/, _c.apply(_b, _d.concat([(_e.id = _f.sent(), + _e.action = 'create', + _e.data = { + messageId: message.id, + data: dispersedData, + channel: channel, + }, + _e), {}]))]; + case 3: + _f.sent(); + return [2 /*return*/, 1]; + } }); }); } function addMessageSent(message, context) { return tslib_1.__awaiter(this, void 0, void 0, function () { - var weight, _a, result, count, result, count2, result, result; + var weight, _a, result, count, result, count2, result; return tslib_1.__generator(this, function (_b) { switch (_b.label) { case 0: @@ -52,16 +83,12 @@ function addMessageSent(message, context) { switch (_a) { case 'high': return [3 /*break*/, 1]; case 'medium': return [3 /*break*/, 3]; - case 'low': return [3 /*break*/, 10]; - case 'data': return [3 /*break*/, 12]; + case 'low': return [3 /*break*/, 9]; } - return [3 /*break*/, 14]; + return [3 /*break*/, 11]; case 1: return [4 /*yield*/, Promise.all([ - tryAddMessageSent(message, 'public', context), - tryAddMessageSent(message, 'jPush', context), - tryAddMessageSent(message, 'jim', context), - tryAddMessageSent(message, 'mp', context), - tryAddMessageSent(message, 'gsm', context), + tryAddMessageSent(message, 'wechat', context), + tryAddMessageSent(message, 'sms', context), ])]; case 2: result = _b.sent(); @@ -69,52 +96,41 @@ function addMessageSent(message, context) { case 3: return [4 /*yield*/, context.count('messageSent', { filter: { messageId: message.id, - } + }, }, {})]; case 4: count = _b.sent(); - if (!(count < 1)) return [3 /*break*/, 8]; + if (!(count < 1)) return [3 /*break*/, 7]; return [4 /*yield*/, Promise.all([ - tryAddMessageSent(message, 'public', context), - tryAddMessageSent(message, 'jPush', context), - tryAddMessageSent(message, 'jim', context), - tryAddMessageSent(message, 'mp', context), + tryAddMessageSent(message, 'wechat', context), ])]; case 5: result = _b.sent(); count2 = result.reduce(function (a, b) { return a || b; }); - if (!(count2 === 0)) return [3 /*break*/, 7]; - return [4 /*yield*/, tryAddMessageSent(message, 'gsm', context)]; + if (count2 > 0) { + return [2 /*return*/, count2]; + } + return [4 /*yield*/, tryAddMessageSent(message, 'sms', context)]; case 6: return [2 /*return*/, _b.sent()]; - case 7: return [2 /*return*/, count2]; - case 8: return [4 /*yield*/, tryAddMessageSent(message, 'gsm', context)]; - case 9: return [2 /*return*/, _b.sent()]; - case 10: return [4 /*yield*/, Promise.all([ - tryAddMessageSent(message, 'public', context), - tryAddMessageSent(message, 'jPush', context), - tryAddMessageSent(message, 'jim', context), - tryAddMessageSent(message, 'mp', context), + case 7: return [4 /*yield*/, tryAddMessageSent(message, 'sms', context)]; + case 8: return [2 /*return*/, _b.sent()]; + case 9: return [4 /*yield*/, Promise.all([ + tryAddMessageSent(message, 'wechat', context), ])]; + case 10: + result = _b.sent(); + return [2 /*return*/, result.reduce(function (a, b) { return a || b; })]; case 11: - result = _b.sent(); - return [2 /*return*/, result.reduce(function (a, b) { return a || b; })]; - case 12: return [4 /*yield*/, Promise.all([ - tryAddMessageSent(message, 'jPush', context), - tryAddMessageSent(message, 'jim', context), - ])]; - case 13: - result = _b.sent(); - return [2 /*return*/, result.reduce(function (a, b) { return a || b; })]; - case 14: { (0, assert_1.assert)(false); } - _b.label = 15; - case 15: return [2 /*return*/]; + _b.label = 12; + case 12: return [2 /*return*/]; } }); }); } +exports.addMessageSent = addMessageSent; var triggers = [ { name: '当创建message时,创建相应的messageSent', @@ -130,11 +146,17 @@ var triggers = [ case 0: data = operation.data, filter = operation.filter; fn = function (messageData) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { + var result; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, addMessageSent(messageData, context)]; case 1: - _a.sent(); + result = _a.sent(); + if (result === 0) { + Object.assign(messageData, { + iState: 'fail', + }); + } return [2 /*return*/]; } }); diff --git a/lib/triggers/messageSent.d.ts b/lib/triggers/messageSent.d.ts new file mode 100644 index 000000000..c48e3a374 --- /dev/null +++ b/lib/triggers/messageSent.d.ts @@ -0,0 +1,5 @@ +import { Trigger } from 'oak-domain/lib/types/Trigger'; +import { EntityDict } from '../general-app-domain/EntityDict'; +import { RuntimeCxt } from '../types/RuntimeCxt'; +declare const triggers: Trigger[]; +export default triggers; diff --git a/lib/triggers/messageSent.js b/lib/triggers/messageSent.js new file mode 100644 index 000000000..412fd24e7 --- /dev/null +++ b/lib/triggers/messageSent.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var assert_1 = require("oak-domain/lib/utils/assert"); +function sendMessage(messageSentData, context) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var data, channel, messageId, _a, message, _b, application, config2, appId; + return tslib_1.__generator(this, function (_c) { + switch (_c.label) { + case 0: + data = messageSentData.data, channel = messageSentData.channel, messageId = messageSentData.messageId; + return [4 /*yield*/, context.select('message', { + data: { + id: 1, + systemId: 1, + }, + filter: { + id: messageId, + }, + }, {})]; + case 1: + _a = tslib_1.__read.apply(void 0, [_c.sent(), 1]), message = _a[0]; + return [4 /*yield*/, context.select('application', { + data: { + id: 1, + name: 1, + config: 1, + type: 1, + systemId: 1, + style: 1, + }, + filter: { + type: 'wechatPublic', + systemId: message.systemId, + }, + }, {})]; + case 2: + _b = tslib_1.__read.apply(void 0, [_c.sent(), 1]), application = _b[0]; + config2 = application.config; + appId = config2.appId; + return [2 /*return*/]; + } + }); + }); +} +var triggers = [ + { + name: '当创建messageSent后,业务提交后再进行推送', + entity: 'messageSent', + action: 'create', + when: 'commit', + strict: 'makeSure', + fn: function (_a, context, params) { + var operation = _a.operation; + return tslib_1.__awaiter(void 0, void 0, void 0, function () { + var data, filter, fn; + return tslib_1.__generator(this, function (_b) { + switch (_b.label) { + case 0: + data = operation.data, filter = operation.filter; + fn = function (messageSentData) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, sendMessage(messageSentData, context)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); }; + if (!(data instanceof Array)) return [3 /*break*/, 1]; + (0, assert_1.assert)('不存在一对多的情况'); + return [3 /*break*/, 3]; + case 1: return [4 /*yield*/, fn(data)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: return [2 /*return*/, 0]; + } + }); + }); + } + }, +]; +exports.default = triggers; diff --git a/src/triggers/message.ts b/src/triggers/message.ts index d8ff75061..aafe67610 100644 --- a/src/triggers/message.ts +++ b/src/triggers/message.ts @@ -69,7 +69,7 @@ async function tryAddMessageSent(message: CreateMessageData, channel: string, co data: dispersedData, channel, }, - }, {}); + } as EntityDict['messageSent']['CreateSingle'], {}); return 1; } From c4557e65ffd65ba9653d259ff0381f7d0e06a600 Mon Sep 17 00:00:00 2001 From: wenjiarui Date: Wed, 21 Dec 2022 13:17:10 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=AC=E4=BC=97?= =?UTF-8?q?=E5=8F=B7=E6=95=B0=E6=8D=AE=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entities/Subscription.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/entities/Subscription.ts b/src/entities/Subscription.ts index 8df557da4..caa662c07 100644 --- a/src/entities/Subscription.ts +++ b/src/entities/Subscription.ts @@ -2,6 +2,7 @@ import { String, Boolean, Text, + Int, } from 'oak-domain/lib/types/DataType'; import { ActionDef } from 'oak-domain/lib/types/Action'; import { EntityShape } from 'oak-domain/lib/types/Entity'; @@ -20,6 +21,7 @@ export interface Schema extends EntityShape { name: String<32>; description: Text; config: WechatPublicConfig; + offset: Int<4>; }; @@ -60,6 +62,7 @@ const locale: LocaleDef< entityId: '对象Id', description: '描述', config: '配置', + offset: '已同步素材位置', }, }, }; From 0ce7322c32bb7f101756b4bc6f9a3cd82f9128d4 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Wed, 21 Dec 2022 13:20:06 +0800 Subject: [PATCH 5/8] =?UTF-8?q?build=20=E5=8F=8A=20style=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/aspects/AspectDict.d.ts | 5 ++ lib/aspects/config.d.ts | 5 ++ lib/aspects/config.js | 27 +++++- lib/aspects/index.d.ts | 3 +- lib/aspects/index.js | 3 +- lib/components/config/application/index.js | 2 +- lib/components/config/style/index.d.ts | 7 ++ lib/components/config/style/index.js | 42 ++++++++++ lib/components/config/style/index.module.less | 5 ++ lib/components/message/index.xml | 2 +- lib/entities/Subscription.d.ts | 3 +- lib/entities/Subscription.js | 1 + lib/features/config.d.ts | 1 + lib/features/config.js | 19 ++++- lib/miniprogram_npm/lin-ui/album/index.less | 48 ----------- lib/pages/application/detail/web.js | 2 +- lib/pages/application/upsert/index.js | 5 +- lib/pages/application/upsert/web.pc.d.ts | 1 + lib/pages/application/upsert/web.pc.js | 9 +- lib/pages/domain/detail/index.js | 4 + lib/pages/domain/detail/web.d.ts | 1 + lib/pages/domain/detail/web.js | 5 +- lib/pages/domain/list/web.pc.js | 5 ++ lib/pages/platform/detail/index.js | 1 + lib/pages/platform/detail/web.js | 2 +- lib/pages/platform/upsert/index.js | 3 +- lib/pages/platform/upsert/web.pc.d.ts | 1 + lib/pages/platform/upsert/web.pc.js | 9 +- lib/pages/system/detail/web.js | 2 +- lib/pages/system/list/web.pc.js | 2 +- lib/pages/system/upsert/web.pc.js | 19 ++--- lib/types/Style.d.ts | 7 +- package.json | 3 +- src/aspects/AspectDict.ts | 8 ++ src/aspects/config.ts | 29 +++++++ src/aspects/index.ts | 8 +- src/components/config/application/index.ts | 2 +- src/components/config/style/index.module.less | 5 ++ src/components/config/style/index.tsx | 84 +++++++++++++++++++ src/features/config.ts | 23 ++++- src/pages/application/detail/web.tsx | 6 +- src/pages/application/upsert/index.ts | 5 +- src/pages/application/upsert/web.pc.tsx | 16 ++++ src/pages/domain/detail/index.ts | 4 + src/pages/domain/detail/web.tsx | 45 +++++++++- src/pages/domain/list/web.pc.tsx | 11 +++ src/pages/platform/detail/index.ts | 1 + src/pages/platform/detail/web.tsx | 28 +++++-- src/pages/platform/upsert/index.ts | 3 +- src/pages/platform/upsert/web.pc.tsx | 22 ++++- src/pages/system/detail/web.tsx | 6 +- src/pages/system/list/web.pc.tsx | 2 +- src/pages/system/upsert/web.pc.tsx | 35 ++------ src/types/Style.ts | 13 +-- 54 files changed, 461 insertions(+), 149 deletions(-) create mode 100644 lib/components/config/style/index.d.ts create mode 100644 lib/components/config/style/index.js create mode 100644 lib/components/config/style/index.module.less create mode 100644 src/components/config/style/index.module.less create mode 100644 src/components/config/style/index.tsx diff --git a/lib/aspects/AspectDict.d.ts b/lib/aspects/AspectDict.d.ts index 77fd4771e..436acbde5 100644 --- a/lib/aspects/AspectDict.d.ts +++ b/lib/aspects/AspectDict.d.ts @@ -44,6 +44,11 @@ declare type GeneralAspectDict Promise; + updateApplicationConfig: (params: { + entity: 'application'; + entityId: string; + config: EntityDict['application']['Schema']['config']; + }, context: Cxt) => Promise; }; export declare type AspectDict> = GeneralAspectDict; export {}; diff --git a/lib/aspects/config.d.ts b/lib/aspects/config.d.ts index 8cf2822a1..8c4c993a8 100644 --- a/lib/aspects/config.d.ts +++ b/lib/aspects/config.d.ts @@ -6,3 +6,8 @@ export declare function updateConfig; +export declare function updateApplicationConfig>(params: { + entity: 'application'; + entityId: string; + config: EntityDict['application']['Schema']['config']; +}, context: Cxt): Promise; diff --git a/lib/aspects/config.js b/lib/aspects/config.js index 309863772..6d05f41b1 100644 --- a/lib/aspects/config.js +++ b/lib/aspects/config.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateConfig = void 0; +exports.updateApplicationConfig = exports.updateConfig = void 0; var tslib_1 = require("tslib"); var uuid_1 = require("oak-domain/lib/utils/uuid"); function updateConfig(params, context) { @@ -28,3 +28,28 @@ function updateConfig(params, context) { }); } exports.updateConfig = updateConfig; +function updateApplicationConfig(params, context) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var entity, entityId, config; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + entity = params.entity, entityId = params.entityId, config = params.config; + return [4 /*yield*/, context.operate(entity, { + id: (0, uuid_1.generateNewId)(), + action: 'update', + data: { + config: config, + }, + filter: { + id: entityId, + }, + }, {})]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); +} +exports.updateApplicationConfig = updateApplicationConfig; diff --git a/lib/aspects/index.d.ts b/lib/aspects/index.d.ts index 3060b2856..0792c2feb 100644 --- a/lib/aspects/index.d.ts +++ b/lib/aspects/index.d.ts @@ -1,7 +1,7 @@ import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCaptcha } from './token'; import { getUploadInfo } from './extraFile'; import { getApplication } from './application'; -import { updateConfig } from './config'; +import { updateConfig, updateApplicationConfig } from './config'; export declare const aspectDict: { loginByMobile: typeof loginByMobile; loginWechat: typeof loginWechat; @@ -11,4 +11,5 @@ export declare const aspectDict: { sendCaptcha: typeof sendCaptcha; getApplication: typeof getApplication; updateConfig: typeof updateConfig; + updateApplicationConfig: typeof updateApplicationConfig; }; diff --git a/lib/aspects/index.js b/lib/aspects/index.js index 22643d992..48812e998 100644 --- a/lib/aspects/index.js +++ b/lib/aspects/index.js @@ -5,7 +5,6 @@ var token_1 = require("./token"); var extraFile_1 = require("./extraFile"); var application_1 = require("./application"); var config_1 = require("./config"); -// import commonAspectDict from 'oak-common-aspect'; exports.aspectDict = { loginByMobile: token_1.loginByMobile, loginWechat: token_1.loginWechat, @@ -15,5 +14,5 @@ exports.aspectDict = { sendCaptcha: token_1.sendCaptcha, getApplication: application_1.getApplication, updateConfig: config_1.updateConfig, + updateApplicationConfig: config_1.updateApplicationConfig, }; -// export type AspectDict = TokenAD & CrudAD; diff --git a/lib/components/config/application/index.js b/lib/components/config/application/index.js index bfedc9a63..54497f070 100644 --- a/lib/components/config/application/index.js +++ b/lib/components/config/application/index.js @@ -77,7 +77,7 @@ exports.default = OakComponent({ case 0: currentConfig = this.state.currentConfig; _a = this.props, entity = _a.entity, entityId = _a.entityId; - return [4 /*yield*/, this.features.config.updateConfig(entity, entityId, currentConfig)]; + return [4 /*yield*/, this.features.config.updateApplicationConfig(entity, entityId, currentConfig)]; case 1: _b.sent(); this.setMessage({ diff --git a/lib/components/config/style/index.d.ts b/lib/components/config/style/index.d.ts new file mode 100644 index 000000000..2469d4262 --- /dev/null +++ b/lib/components/config/style/index.d.ts @@ -0,0 +1,7 @@ +import { Style as StyleType } from '../../../types/Style'; +declare type StyleProps = { + value?: StyleType | null; + onChange: (value: StyleType) => void; +}; +export default function Render(props: StyleProps): JSX.Element; +export {}; diff --git a/lib/components/config/style/index.js b/lib/components/config/style/index.js new file mode 100644 index 000000000..8d855d03f --- /dev/null +++ b/lib/components/config/style/index.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var lodash_1 = require("oak-domain/lib/utils/lodash"); +var Colors = ['primary', 'success', 'error', 'warning', 'info']; +function Color(props) { + var _a = props.value, value = _a === void 0 ? {} : _a, setValue = props.setValue; + ; + return ((0, jsx_runtime_1.jsx)(antd_1.Form, { children: Colors.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: ele, requiredMark: true, name: "folder", tooltip: "\u8BBE\u7F6E\u7CFB\u7EDF\u3010".concat(ele, "\u3011\u989C\u8272"), rules: [ + { + required: true, + }, + ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) { + setValue(ele, e.target.value); + }, value: (0, lodash_1.get)(value, ele) }) }) }), ele)); }) })); +} +function Render(props) { + var styleValue = props.value, onChange = props.onChange; + var setStyle = function (path, value) { + var newStyle = (0, lodash_1.set)(styleValue || {}, path, value); + onChange(newStyle); + }; + return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { onChange: function () { }, type: "card", items: [ + { + label: '颜色', + key: 'color', + component: Color, + }, + ].map(function (ele, i) { + var ItemComponent = ele.component; + return { + label: ele.label, + key: ele.key, + children: ((0, jsx_runtime_1.jsx)(ItemComponent, { value: (0, lodash_1.get)(styleValue, ele.key), setValue: function (path, value) { + setStyle("".concat(ele.key, ".").concat(path), value); + } })), + }; + }) }) })); +} +exports.default = Render; diff --git a/lib/components/config/style/index.module.less b/lib/components/config/style/index.module.less new file mode 100644 index 000000000..7c0f8675f --- /dev/null +++ b/lib/components/config/style/index.module.less @@ -0,0 +1,5 @@ + + +.box { + display: block; +} \ No newline at end of file diff --git a/lib/components/message/index.xml b/lib/components/message/index.xml index e523fe35b..f0536c57d 100644 --- a/lib/components/message/index.xml +++ b/lib/components/message/index.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/lib/entities/Subscription.d.ts b/lib/entities/Subscription.d.ts index d703bae55..322fe8770 100644 --- a/lib/entities/Subscription.d.ts +++ b/lib/entities/Subscription.d.ts @@ -1,4 +1,4 @@ -import { String, Text } from 'oak-domain/lib/types/DataType'; +import { String, Text, Int } from 'oak-domain/lib/types/DataType'; import { EntityShape } from 'oak-domain/lib/types/Entity'; export declare type WechatPublicConfig = { type: 'wechatPublic'; @@ -11,4 +11,5 @@ export interface Schema extends EntityShape { name: String<32>; description: Text; config: WechatPublicConfig; + offset: Int<4>; } diff --git a/lib/entities/Subscription.js b/lib/entities/Subscription.js index 79a51660e..77d028e4c 100644 --- a/lib/entities/Subscription.js +++ b/lib/entities/Subscription.js @@ -31,6 +31,7 @@ var locale = { entityId: '对象Id', description: '描述', config: '配置', + offset: '已同步素材位置', }, }, }; diff --git a/lib/features/config.d.ts b/lib/features/config.d.ts index f3e1c4576..1f976a97d 100644 --- a/lib/features/config.d.ts +++ b/lib/features/config.d.ts @@ -10,4 +10,5 @@ export declare class Config>); updateConfig(entity: 'platform' | 'system', entityId: string, config: ConfigDef): Promise; + updateApplicationConfig(entity: 'application', entityId: string, config: EntityDict['application']['Schema']['config']): Promise; } diff --git a/lib/features/config.js b/lib/features/config.js index 54e9cc549..783dccf38 100644 --- a/lib/features/config.js +++ b/lib/features/config.js @@ -17,7 +17,24 @@ var Config = /** @class */ (function (_super) { case 0: return [4 /*yield*/, this.cache.exec('updateConfig', { entity: entity, entityId: entityId, - config: config + config: config, + })]; + case 1: + _a.sent(); + this.publish(); + return [2 /*return*/]; + } + }); + }); + }; + Config.prototype.updateApplicationConfig = function (entity, entityId, config) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.cache.exec('updateApplicationConfig', { + entity: entity, + entityId: entityId, + config: config, })]; case 1: _a.sent(); diff --git a/lib/miniprogram_npm/lin-ui/album/index.less b/lib/miniprogram_npm/lin-ui/album/index.less index 558ca1aa8..e69de29bb 100644 --- a/lib/miniprogram_npm/lin-ui/album/index.less +++ b/lib/miniprogram_npm/lin-ui/album/index.less @@ -1,48 +0,0 @@ -/* miniprogram_npm/lin-ui/picture-album/index.wxss */ -.container { - display: grid; -} - -.vertical { - height: 360rpx; -} - -.parent { - display: inline-grid; - grid-template-columns: repeat(auto-fill); -} - -.child { - box-sizing: border-box; - background-color: white; - flex: 0 0 44%; - height: 100px; - border: 1px solid red; - margin-top: 4%; - margin-left: 2%; - margin-right: 2%; -} - -.dimback { - background: #000; -} - -.dim { - opacity: 0.6; - filter: alpha(opacity=60); -} - - -.imageContainer { - position: relative; -} - -.imageContainer:last-child>.text { - color: white; - font-weight: bold; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - font-size: larger; -} diff --git a/lib/pages/application/detail/web.js b/lib/pages/application/detail/web.js index 19a59693d..f8d0e7e3a 100644 --- a/lib/pages/application/detail/web.js +++ b/lib/pages/application/detail/web.js @@ -12,7 +12,7 @@ function Render(props) { { label: '应用概览', key: 'detail', - children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.type') }, { children: t("application:v.type.".concat(type)) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.system') + + children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.type') }, { children: t("application:v.type.".concat(type)) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('application:attr.system') + t('system:attr.name') }, { children: system === null || system === void 0 ? void 0 : system.name }))] }))), }, ] }) })) })) }))); diff --git a/lib/pages/application/upsert/index.js b/lib/pages/application/upsert/index.js index f6988d76e..fcddfc790 100644 --- a/lib/pages/application/upsert/index.js +++ b/lib/pages/application/upsert/index.js @@ -11,6 +11,7 @@ exports.default = OakComponent({ description: 1, type: 1, systemId: 1, + style: 1, }, formData: function (_a) { var data = _a.data; @@ -22,10 +23,10 @@ exports.default = OakComponent({ value: 'web', }, { - value: "wechatMp", + value: 'wechatMp', }, { - value: "wechatPublic", + value: 'wechatPublic', }, ], }, diff --git a/lib/pages/application/upsert/web.pc.d.ts b/lib/pages/application/upsert/web.pc.d.ts index c775ea403..90a5cdac0 100644 --- a/lib/pages/application/upsert/web.pc.d.ts +++ b/lib/pages/application/upsert/web.pc.d.ts @@ -13,6 +13,7 @@ export default function Render(props: WebComponentProps; systemId: string; oakId: string; + style: EntityDict['system']['Schema']['style']; }, { confirm: () => void; }>): JSX.Element; diff --git a/lib/pages/application/upsert/web.pc.js b/lib/pages/application/upsert/web.pc.js index 3beb53385..527a4ea7c 100644 --- a/lib/pages/application/upsert/web.pc.js +++ b/lib/pages/application/upsert/web.pc.js @@ -4,9 +4,10 @@ var tslib_1 = require("tslib"); var jsx_runtime_1 = require("react/jsx-runtime"); var antd_1 = require("antd"); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); +var style_1 = tslib_1.__importDefault(require("../../../components/config/style")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); function Render(props) { - var _a = props.data, name = _a.name, description = _a.description, type = _a.type, typeArr = _a.typeArr, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, systemId = _a.systemId, oakId = _a.oakId; + var _a = props.data, name = _a.name, description = _a.description, type = _a.type, typeArr = _a.typeArr, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b, systemId = _a.systemId, oakId = _a.oakId, style = _a.style; var _c = props.methods, t = _c.t, update = _c.update, navigateBack = _c.navigateBack, confirm = _c.confirm; return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ variant: variant, showBack: showBack }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 6 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [ { @@ -31,7 +32,11 @@ function Render(props) { update({ type: value, }); - } }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { + } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) { + update({ + style: value, + }); + }, value: style }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { confirm(); } }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () { navigateBack(); diff --git a/lib/pages/domain/detail/index.js b/lib/pages/domain/detail/index.js index 854279906..51809af30 100644 --- a/lib/pages/domain/detail/index.js +++ b/lib/pages/domain/detail/index.js @@ -6,6 +6,10 @@ exports.default = OakComponent({ projection: { id: 1, systemId: 1, + system: { + id: 1, + name: 1, + }, url: 1, apiPath: 1, port: 1, diff --git a/lib/pages/domain/detail/web.d.ts b/lib/pages/domain/detail/web.d.ts index 0fde0e02e..8703ed615 100644 --- a/lib/pages/domain/detail/web.d.ts +++ b/lib/pages/domain/detail/web.d.ts @@ -8,6 +8,7 @@ export default function Render(props: WebComponentProps void; }>): JSX.Element; diff --git a/lib/pages/domain/detail/web.js b/lib/pages/domain/detail/web.js index edea38d8f..e5d1dc467 100644 --- a/lib/pages/domain/detail/web.js +++ b/lib/pages/domain/detail/web.js @@ -6,7 +6,7 @@ var antd_1 = require("antd"); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); function Render(props) { - var _a = props.data, oakId = _a.oakId, url = _a.url, tabValue = _a.tabValue; + var _a = props.data, oakId = _a.oakId, url = _a.url, tabValue = _a.tabValue, system = _a.system, apiPath = _a.apiPath, protocol = _a.protocol, port = _a.port; var _b = props.methods, t = _b.t, navigateBack = _b.navigateBack, onTabClick = _b.onTabClick; return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u57DF\u540D\u6982\u89C8" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Card, tslib_1.__assign({ title: url, bordered: false }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { activeKey: tabValue, onTabClick: function (key) { onTabClick(key); @@ -14,7 +14,8 @@ function Render(props) { { label: '域名概览', key: 'detail', - children: (0, jsx_runtime_1.jsx)("div", { children: "\u8BE6\u60C5" }), + children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.url') }, { children: url })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.apiPath') }, { children: apiPath })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.port') }, { children: port })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.protocol') }, { children: protocol })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('domain:attr.system') + + t('system:attr.name') }, { children: system === null || system === void 0 ? void 0 : system.name }))] }))), }, ] }) })) })) }))); } diff --git a/lib/pages/domain/list/web.pc.js b/lib/pages/domain/list/web.pc.js index 6da24787f..cf3870980 100644 --- a/lib/pages/domain/list/web.pc.js +++ b/lib/pages/domain/list/web.pc.js @@ -22,6 +22,11 @@ function Render(props) { { dataIndex: 'url', title: '域名', + render: function (value, record, index) { + return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () { + goDetail(record.id); + } }, { children: value }))); + }, }, { dataIndex: 'apiPath', diff --git a/lib/pages/platform/detail/index.js b/lib/pages/platform/detail/index.js index 014f67765..f7631038b 100644 --- a/lib/pages/platform/detail/index.js +++ b/lib/pages/platform/detail/index.js @@ -8,6 +8,7 @@ exports.default = OakComponent({ name: 1, config: 1, description: 1, + style: 1, }, formData: function (_a) { var data = _a.data; diff --git a/lib/pages/platform/detail/web.js b/lib/pages/platform/detail/web.js index b03ae07f0..5b461918a 100644 --- a/lib/pages/platform/detail/web.js +++ b/lib/pages/platform/detail/web.js @@ -15,7 +15,7 @@ function Render(props) { { label: '平台信息', key: 'detail', - children: (0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.description') }, { children: description }))] })), + children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('platform:attr.description') }, { children: description }))] }))), }, { label: '系统管理', diff --git a/lib/pages/platform/upsert/index.js b/lib/pages/platform/upsert/index.js index 08d6c4dbe..36aef985d 100644 --- a/lib/pages/platform/upsert/index.js +++ b/lib/pages/platform/upsert/index.js @@ -9,6 +9,7 @@ exports.default = OakComponent({ name: 1, config: 1, description: 1, + style: 1, }, formData: function (_a) { var data = _a.data; @@ -27,6 +28,6 @@ exports.default = OakComponent({ } }); }); - } + }, }, }); diff --git a/lib/pages/platform/upsert/web.pc.d.ts b/lib/pages/platform/upsert/web.pc.d.ts index edcc6ab29..d7aefb70d 100644 --- a/lib/pages/platform/upsert/web.pc.d.ts +++ b/lib/pages/platform/upsert/web.pc.d.ts @@ -3,6 +3,7 @@ import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps void; }>): JSX.Element; diff --git a/lib/pages/platform/upsert/web.pc.js b/lib/pages/platform/upsert/web.pc.js index 52e0f4b14..55fd2b2b4 100644 --- a/lib/pages/platform/upsert/web.pc.js +++ b/lib/pages/platform/upsert/web.pc.js @@ -4,9 +4,10 @@ var tslib_1 = require("tslib"); var jsx_runtime_1 = require("react/jsx-runtime"); var antd_1 = require("antd"); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); +var style_1 = tslib_1.__importDefault(require("../../../components/config/style")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); function Render(props) { - var _a = props.data, name = _a.name, description = _a.description; + var _a = props.data, name = _a.name, description = _a.description, style = _a.style; var _b = props.methods, t = _b.t, update = _b.update, navigateBack = _b.navigateBack, confirm = _b.confirm; return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u5E73\u53F0\u7F16\u8F91" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [ { @@ -20,7 +21,11 @@ function Render(props) { update({ description: e.target.value, }); - }, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { + }, value: description }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) { + update({ + style: value, + }); + }, value: style }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { confirm(); } }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () { navigateBack(); diff --git a/lib/pages/system/detail/web.js b/lib/pages/system/detail/web.js index 233582c84..f53536ada 100644 --- a/lib/pages/system/detail/web.js +++ b/lib/pages/system/detail/web.js @@ -16,7 +16,7 @@ function Render(props) { { label: '系统概览', key: 'detail', - children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: oakId })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.super') }, { children: isSuper ? '是' : '否' })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.folder') }, { children: folder })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.platform') + + children: ((0, jsx_runtime_1.jsxs)(antd_1.Descriptions, tslib_1.__assign({ column: 1, bordered: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: "id" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Typography.Paragraph, tslib_1.__assign({ copyable: true }, { children: oakId })) })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.name') }, { children: name })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.description') }, { children: description })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.super') }, { children: isSuper ? '是' : '否' })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.folder') }, { children: folder })), (0, jsx_runtime_1.jsx)(antd_1.Descriptions.Item, tslib_1.__assign({ label: t('system:attr.platform') + t('platform:attr.name') }, { children: platform === null || platform === void 0 ? void 0 : platform.name }))] }))), }, { diff --git a/lib/pages/system/list/web.pc.js b/lib/pages/system/list/web.pc.js index aaabc5d66..57f3cc7a4 100644 --- a/lib/pages/system/list/web.pc.js +++ b/lib/pages/system/list/web.pc.js @@ -47,7 +47,7 @@ function Render(props) { title: '访问域名', render: function (value, record, index) { return value - ? value.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, { children: ele.url }) })); }) + ? value.map(function (ele) { return ((0, jsx_runtime_1.jsx)(antd_1.Space, tslib_1.__assign({ direction: "vertical" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, { children: ele.url }) }))); }) : ''; }, }, diff --git a/lib/pages/system/upsert/web.pc.js b/lib/pages/system/upsert/web.pc.js index a61b69b65..94aa5594d 100644 --- a/lib/pages/system/upsert/web.pc.js +++ b/lib/pages/system/upsert/web.pc.js @@ -4,16 +4,11 @@ var tslib_1 = require("tslib"); var jsx_runtime_1 = require("react/jsx-runtime"); var antd_1 = require("antd"); var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); +var style_1 = tslib_1.__importDefault(require("../../../components/config/style")); var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); -var lodash_1 = require("oak-domain/lib/utils/lodash"); function Render(props) { var _a = props.data, name = _a.name, description = _a.description, folder = _a.folder, super2 = _a.super, style = _a.style, variant = _a.variant, _b = _a.showBack, showBack = _b === void 0 ? true : _b; var _c = props.methods, t = _c.t, update = _c.update, navigateBack = _c.navigateBack, confirm = _c.confirm; - var setStyle = function (path, value) { - update({ - style: (0, lodash_1.set)(style || {}, path, value), - }); - }; return ((0, jsx_runtime_1.jsx)(Container, tslib_1.__assign({ variant: variant, showBack: showBack }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 12 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 6 }, wrapperCol: { span: 16 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u540D\u79F0", requiredMark: true, name: "name", rules: [ { required: true, @@ -38,13 +33,11 @@ function Render(props) { update({ super: checked, }); - } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u4E3B\u9898\u8272", requiredMark: true, name: "folder", tooltip: "\u8BBE\u7F6E\u7CFB\u7EDF\u4E3B\u9898\u989C\u8272", rules: [ - { - required: true, - }, - ] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) { - setStyle('color.primary', e.target.value); - }, value: (0, lodash_1.get)(style || {}, 'color.primary') }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { + } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u6837\u5F0F", requiredMark: true, name: "style" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(style_1.default, { onChange: function (value) { + update({ + style: value, + }); + }, value: style }) }) })), (0, jsx_runtime_1.jsx)(Action, tslib_1.__assign({ variant: variant }, { children: (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 6 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () { confirm(); } }, { children: "\u786E\u5B9A" })), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () { navigateBack(); diff --git a/lib/types/Style.d.ts b/lib/types/Style.d.ts index 9790ea60a..5b0330583 100644 --- a/lib/types/Style.d.ts +++ b/lib/types/Style.d.ts @@ -1,9 +1,6 @@ +export declare type ColorType = 'primary' | 'success' | 'error' | 'warning' | 'info'; export declare type Color = { - primary: string; - success?: string; - error?: string; - warning?: string; - info?: string; + [k in ColorType]?: string; }; export declare type Style = { color?: Color; diff --git a/package.json b/package.json index a0f8d79ca..86e45edb1 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,8 @@ "gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts", "clean:dir": "ts-node ./scripts/cleanDtsAndJs", "test": "ts-node ./test/test.ts", - "prepare": "rimraf node_modules/react & rimraf node_modules/react-dom & rimraf node_modules/react-router" + "prepare": "rimraf node_modules/react & rimraf node_modules/react-dom & rimraf node_modules/react-router", + "remove-antd": "rimraf node_modules/antd & rimraf node_modules/antd-mobile & rimraf node_modules/@ant-design & rimraf node_modules/antd-mobile-icons & rimraf node_modules/antd-mobile-v5-count" }, "main": "lib/index" } diff --git a/src/aspects/AspectDict.ts b/src/aspects/AspectDict.ts index 0b4949499..f3783093e 100644 --- a/src/aspects/AspectDict.ts +++ b/src/aspects/AspectDict.ts @@ -81,6 +81,14 @@ type GeneralAspectDict< }, context: Cxt ) => Promise; + updateApplicationConfig: ( + params: { + entity: 'application'; + entityId: string; + config: EntityDict['application']['Schema']['config']; + }, + context: Cxt + ) => Promise; }; export type AspectDict> = GeneralAspectDict; \ No newline at end of file diff --git a/src/aspects/config.ts b/src/aspects/config.ts index fd82918b9..3cb2dbffc 100644 --- a/src/aspects/config.ts +++ b/src/aspects/config.ts @@ -19,4 +19,33 @@ export async function updateConfig +>( + params: { + entity: 'application'; + entityId: string; + config: EntityDict['application']['Schema']['config']; + }, + context: Cxt +) { + const { entity, entityId, config } = params; + await context.operate( + entity, + { + id: generateNewId(), + action: 'update', + data: { + config, + }, + filter: { + id: entityId, + }, + }, + {} + ); } \ No newline at end of file diff --git a/src/aspects/index.ts b/src/aspects/index.ts index a03bd06aa..e5a89771b 100644 --- a/src/aspects/index.ts +++ b/src/aspects/index.ts @@ -7,8 +7,7 @@ import { } from './token'; import { getUploadInfo } from './extraFile'; import { getApplication } from './application'; -import { updateConfig } from './config'; -// import commonAspectDict from 'oak-common-aspect'; +import { updateConfig, updateApplicationConfig } from './config'; export const aspectDict = { loginByMobile, @@ -19,6 +18,5 @@ export const aspectDict = { sendCaptcha, getApplication, updateConfig, -}; - -// export type AspectDict = TokenAD & CrudAD; \ No newline at end of file + updateApplicationConfig, +}; \ No newline at end of file diff --git a/src/components/config/application/index.ts b/src/components/config/application/index.ts index dbb809194..5983f4849 100644 --- a/src/components/config/application/index.ts +++ b/src/components/config/application/index.ts @@ -78,7 +78,7 @@ export default OakComponent({ const { currentConfig } = this.state; const { entity, entityId } = this.props; - await this.features.config.updateConfig( + await this.features.config.updateApplicationConfig( entity, entityId, currentConfig diff --git a/src/components/config/style/index.module.less b/src/components/config/style/index.module.less new file mode 100644 index 000000000..7c0f8675f --- /dev/null +++ b/src/components/config/style/index.module.less @@ -0,0 +1,5 @@ + + +.box { + display: block; +} \ No newline at end of file diff --git a/src/components/config/style/index.tsx b/src/components/config/style/index.tsx new file mode 100644 index 000000000..f1345b91a --- /dev/null +++ b/src/components/config/style/index.tsx @@ -0,0 +1,84 @@ +import React from 'react'; +import { Button, Form, Input, Tooltip, Tabs } from 'antd'; +import { Style as StyleType, ColorType } from '../../../types/Style'; +import { set, get } from 'oak-domain/lib/utils/lodash'; + +import Style from './index.module.less'; + +type StyleProps = { + value?: StyleType | null; + onChange: (value: StyleType) => void; +}; + +const Colors: ColorType[] = ['primary', 'success', 'error', 'warning', 'info']; + +function Color(props: { value: StyleType['color'], setValue: (path: string, value: string) => void }) { + const { value = {}, setValue } = props;; + return ( +

+ {Colors.map((ele) => ( + + <> + { + setValue(ele, e.target.value); + }} + value={get(value, ele)} + /> + + + ))} +
+ ); +} + +export default function Render(props: StyleProps) { + const { value: styleValue, onChange } = props; + + const setStyle = (path: string, value: string) => { + const newStyle = set(styleValue || {}, path, value); + onChange(newStyle); + }; + + return ( +
+ {}} + type="card" + items={[ + { + label: '颜色', + key: 'color', + component: Color, + }, + ].map((ele, i) => { + const ItemComponent = ele.component; + return { + label: ele.label, + key: ele.key, + children: ( + { + setStyle(`${ele.key}.${path}`, value); + }} + /> + ), + }; + })} + /> +
+ ); +} + diff --git a/src/features/config.ts b/src/features/config.ts index cdba20056..13d76bf7b 100644 --- a/src/features/config.ts +++ b/src/features/config.ts @@ -13,10 +13,12 @@ export class Config< Cxt extends BackendRuntimeContext, FrontCxt extends FrontendRuntimeContext, AD extends AspectDict & CommonAspectDict - > extends Feature { +> extends Feature { private cache: Cache>; - constructor(cache: Cache>) { + constructor( + cache: Cache> + ) { super(); this.cache = cache; } @@ -24,12 +26,25 @@ export class Config< async updateConfig( entity: 'platform' | 'system', entityId: string, - config: ConfigDef, + config: ConfigDef ) { await this.cache.exec('updateConfig', { entity, entityId, - config + config, + }); + this.publish(); + } + + async updateApplicationConfig( + entity: 'application', + entityId: string, + config: EntityDict['application']['Schema']['config'] + ) { + await this.cache.exec('updateApplicationConfig', { + entity, + entityId, + config, }); this.publish(); } diff --git a/src/pages/application/detail/web.tsx b/src/pages/application/detail/web.tsx index a18a60430..ca415dbf5 100644 --- a/src/pages/application/detail/web.tsx +++ b/src/pages/application/detail/web.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Tabs, Card, Descriptions } from 'antd'; +import { Tabs, Card, Descriptions, Typography } from 'antd'; import PageHeader from '../../../components/common/pageHeader'; import Style from './web.module.less'; @@ -51,7 +51,9 @@ export default function Render( children: ( - {oakId} + + {oakId} + ; systemId: string; oakId: string; + style: EntityDict['system']['Schema']['style']; }, { confirm: () => void; @@ -39,6 +41,7 @@ export default function Render( showBack = true, systemId, oakId, + style, } = props.data; const { t, update, navigateBack, confirm } = props.methods; return ( @@ -115,6 +118,19 @@ export default function Render( + + <> + { + update({ + style: value, + }); + }} + value={style} + /> + + + diff --git a/src/pages/domain/detail/index.ts b/src/pages/domain/detail/index.ts index 6ba35835c..5e6a9c3f6 100644 --- a/src/pages/domain/detail/index.ts +++ b/src/pages/domain/detail/index.ts @@ -4,6 +4,10 @@ export default OakComponent({ projection: { id: 1, systemId: 1, + system: { + id: 1, + name: 1, + }, url: 1, apiPath: 1, port: 1, diff --git a/src/pages/domain/detail/web.tsx b/src/pages/domain/detail/web.tsx index cdd37ee94..6501ace63 100644 --- a/src/pages/domain/detail/web.tsx +++ b/src/pages/domain/detail/web.tsx @@ -1,7 +1,6 @@ import React from 'react'; -import { Tabs, Card } from 'antd'; +import { Tabs, Card, Descriptions, Typography } from 'antd'; import PageHeader from '../../../components/common/pageHeader'; -import ApplicationList from '../../../pages/application/list'; import Style from './web.module.less'; @@ -21,13 +20,15 @@ export default function Render( port: string; protocol: EntityDict['domain']['Schema']['protocol']; tabValue: 'detail'; + system: EntityDict['system']['Schema']; }, { onTabClick: (key: string) => void; } > ) { - const { oakId, url, tabValue } = props.data; + const { oakId, url, tabValue, system, apiPath, protocol, port } = + props.data; const { t, navigateBack, onTabClick } = props.methods; return ( @@ -42,7 +43,43 @@ export default function Render( { label: '域名概览', key: 'detail', - children:
详情
, + children: ( + + + + {oakId} + + + + {url} + + + {apiPath} + + + {port} + + + {protocol} + + + {system?.name} + + + ), }, ]} /> diff --git a/src/pages/domain/list/web.pc.tsx b/src/pages/domain/list/web.pc.tsx index eaff16570..3bf437642 100644 --- a/src/pages/domain/list/web.pc.tsx +++ b/src/pages/domain/list/web.pc.tsx @@ -75,6 +75,17 @@ export default function Render( { dataIndex: 'url', title: '域名', + render: (value, record, index) => { + return ( + { + goDetail(record.id); + }} + > + {value} + + ); + }, }, { dataIndex: 'apiPath', diff --git a/src/pages/platform/detail/index.ts b/src/pages/platform/detail/index.ts index cca66eff4..7008e0da1 100644 --- a/src/pages/platform/detail/index.ts +++ b/src/pages/platform/detail/index.ts @@ -6,6 +6,7 @@ export default OakComponent({ name: 1, config: 1, description: 1, + style: 1, }, formData({ data }) { return data || {}; diff --git a/src/pages/platform/detail/web.tsx b/src/pages/platform/detail/web.tsx index b98682006..8e973a695 100644 --- a/src/pages/platform/detail/web.tsx +++ b/src/pages/platform/detail/web.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Tabs, Card, Descriptions } from 'antd'; +import { Tabs, Card, Descriptions, Typography } from 'antd'; import PageHeader from '../../../components/common/pageHeader'; import SystemList from '../../system/list'; @@ -42,11 +42,27 @@ export default function Render( { label: '平台信息', key: 'detail', - children: - {oakId} - {name} - {description} - , + children: ( + + + + {oakId} + + + + {name} + + + {description} + + + ), }, { label: '系统管理', diff --git a/src/pages/platform/upsert/index.ts b/src/pages/platform/upsert/index.ts index 4b30e7bbd..c10c206dc 100644 --- a/src/pages/platform/upsert/index.ts +++ b/src/pages/platform/upsert/index.ts @@ -6,6 +6,7 @@ export default OakComponent({ name: 1, config: 1, description: 1, + style: 1, }, formData({ data }) { return data || {}; @@ -14,6 +15,6 @@ export default OakComponent({ async confirm() { await this.execute(); this.navigateBack(); - } + }, }, }); diff --git a/src/pages/platform/upsert/web.pc.tsx b/src/pages/platform/upsert/web.pc.tsx index a118f6b71..4ecdc12d0 100644 --- a/src/pages/platform/upsert/web.pc.tsx +++ b/src/pages/platform/upsert/web.pc.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { Button, Form, Row, Col, Input, Space } from 'antd'; import PageHeader from '../../../components/common/pageHeader'; +import ComponentStyle from '../../../components/config/style'; + import Style from './web.module.less'; @@ -15,13 +17,14 @@ export default function Render( { name: string; description: string; + style: EntityDict['system']['Schema']['style']; }, { confirm: () => void; } > ) { - const { name, description } = props.data; + const { name, description, style } = props.data; const { t, update, navigateBack, confirm } = props.methods; return ( @@ -70,6 +73,23 @@ export default function Render( />
+ + <> + { + update({ + style: value, + }); + }} + value={style} + /> + + + + + + { + // return index + 1; + // }, + // }, + { + dataIndex: 'name', + title: '订阅号名称', + width: 300, + render: (value, record, index) => { + return ( + { + goDetail(record.id); + }} + > + {value} + + ); + }, + }, + { + dataIndex: 'description', + title: '描述', + width: 200, + ellipsis: true, + }, + { + dataIndex: 'config', + title: '配置', + align: 'center', + render: (value, record, index) => { + return ( + <> + + + ); + }, + }, + { + dataIndex: 'op', + width: 200, + title: '操作', + align: 'center', + render: (value, record, index) => { + return ( + <> + + + + + ); + }, + fixed: 'right', + }, + ]} + pagination={{ + total, + pageSize, + current: currentPage, + onShowSizeChange: (pageSize: number) => { + setPageSize(pageSize); + }, + onChange: (current: number) => { + setCurrentPage(current); + }, + }} + /> + + ); +} + +function Container(props: { + children: React.ReactNode; + variant?: 'inline' | 'alone' | 'dialog'; + showBack?: boolean; +}) { + const { children, variant = 'alone', showBack } = props; + if (['inline', 'dialog'].includes(variant)) { + return <>{children}; + } + return ( + +
{children}
+
+ ); +} diff --git a/src/pages/subscription/upsert/index.ts b/src/pages/subscription/upsert/index.ts new file mode 100644 index 000000000..3c435e547 --- /dev/null +++ b/src/pages/subscription/upsert/index.ts @@ -0,0 +1,39 @@ + + +export default OakComponent({ + isList: false, + entity: 'subscription', + projection: { + id: 1, + name: 1, + config: 1, + description: 1, + entity: 1, + entityId: 1, + }, + formData({ data }) { + return data || {}; + }, + data: { + }, + lifetimes: { + ready() { + const { entityId, entity, oakId } = this.props; + + if (!oakId) { + if (entityId) { + this.update({ + entityId, + entity, + }); + } + } + }, + }, + methods: { + async confirm() { + await this.execute(); + this.navigateBack(); + }, + }, +}); diff --git a/src/pages/subscription/upsert/web.module.less b/src/pages/subscription/upsert/web.module.less new file mode 100644 index 000000000..9f3d17c7f --- /dev/null +++ b/src/pages/subscription/upsert/web.module.less @@ -0,0 +1,6 @@ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; +} \ No newline at end of file diff --git a/src/pages/subscription/upsert/web.pc.tsx b/src/pages/subscription/upsert/web.pc.tsx new file mode 100644 index 000000000..b6556ee6f --- /dev/null +++ b/src/pages/subscription/upsert/web.pc.tsx @@ -0,0 +1,136 @@ +import React from 'react'; +import { Button, Form, Row, Col, Select, Space, Input } from 'antd'; +import PageHeader from '../../../components/common/pageHeader'; +import Style from './web.module.less'; + +import { EntityDict } from '../../../general-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; + +export default function Render( + props: WebComponentProps< + EntityDict, + 'subscription', + false, + { + name: string; + description: string; + variant: 'inline' | 'alone' | 'dialog'; + showBack: boolean; + entity: string; + entityId: string; + oakId: string; + }, + { + confirm: () => void; + } + > +) { + const { + name, + description, + variant, + showBack = true, + entityId, + entity, + oakId, + } = props.data; + const { t, update, navigateBack, confirm } = props.methods; + return ( + + + + + + <> + { + update({ + name: e.target.value, + }); + }} + value={name} + /> + + + + <> + { + update({ + description: e.target.value, + }); + }} + value={description} + /> + + + + + + + + + + + + + + + + ); +} + +function Action(props: { + children: React.ReactNode; + variant?: 'inline' | 'alone' | 'dialog'; +}) { + const { children, variant } = props; + if (variant === 'dialog') { + return null; + } + return ( + <>{children} + ) +} + +function Container(props: { + children: React.ReactNode; + variant?: 'inline' | 'alone' | 'dialog'; + showBack?: boolean; +}) { + const { children, variant, showBack } = props; + if (variant === 'inline' || variant === 'dialog') { + return <>{children}; + } + return ( + +
{children}
+
+ ); +} From 0b4813ffa6e3628dd79adbcdc6ee8c3e6b7008f0 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 22 Dec 2022 11:31:44 +0800 Subject: [PATCH 7/8] =?UTF-8?q?message=20=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/message/cell/index.d.ts | 3 + lib/components/message/cell/index.js | 27 +++ lib/components/message/cell/web.d.ts | 14 ++ lib/components/message/cell/web.js | 33 ++++ lib/components/message/cell/web.module.less | 46 +++++ lib/components/message/cellButton/index.d.ts | 3 + lib/components/message/cellButton/index.js | 32 ++++ lib/components/message/cellButton/web.d.ts | 5 + lib/components/message/cellButton/web.js | 29 ++++ .../message/cellButton/web.module.less | 0 lib/pages/message/detail/index.d.ts | 3 + lib/pages/message/detail/index.js | 48 ++++++ lib/pages/message/detail/index.json | 4 + lib/pages/message/detail/mobile.module.less | 32 ++++ lib/pages/message/detail/web.d.ts | 13 ++ lib/pages/message/detail/web.js | 16 ++ lib/pages/message/detail/web.module.less | 46 +++++ lib/pages/message/detail/web.pc.d.ts | 13 ++ lib/pages/message/detail/web.pc.js | 17 ++ lib/pages/message/drawerList/index.d.ts | 3 + lib/pages/message/drawerList/index.js | 69 ++++++++ lib/pages/message/drawerList/index.json | 4 + lib/pages/message/drawerList/web.d.ts | 10 ++ lib/pages/message/drawerList/web.js | 26 +++ lib/pages/message/drawerList/web.module.less | 6 + lib/pages/message/list/index.d.ts | 3 + lib/pages/message/list/index.js | 64 +++++++ lib/pages/message/list/index.json | 4 + lib/pages/message/list/mobile.module.less | 6 + lib/pages/message/list/web.d.ts | 7 + lib/pages/message/list/web.js | 18 ++ lib/pages/message/list/web.module.less | 7 + lib/pages/message/list/web.pc.d.ts | 12 ++ lib/pages/message/list/web.pc.js | 88 ++++++++++ src/components/message/cell/index.ts | 24 +++ src/components/message/cell/web.module.less | 46 +++++ src/components/message/cell/web.tsx | 107 ++++++++++++ src/components/message/cellButton/index.ts | 22 +++ .../message/cellButton/web.module.less | 0 src/components/message/cellButton/web.tsx | 46 +++++ src/pages/message/detail/index.json | 4 + src/pages/message/detail/index.ts | 52 ++++++ src/pages/message/detail/mobile.module.less | 32 ++++ src/pages/message/detail/web.module.less | 46 +++++ src/pages/message/detail/web.pc.tsx | 61 +++++++ src/pages/message/detail/web.tsx | 54 ++++++ src/pages/message/drawerList/index.json | 4 + src/pages/message/drawerList/index.ts | 67 ++++++++ src/pages/message/drawerList/web.module.less | 6 + src/pages/message/drawerList/web.tsx | 92 ++++++++++ src/pages/message/list/index.json | 4 + src/pages/message/list/index.ts | 62 +++++++ src/pages/message/list/mobile.module.less | 6 + src/pages/message/list/web.module.less | 7 + src/pages/message/list/web.pc.tsx | 161 ++++++++++++++++++ src/pages/message/list/web.tsx | 57 +++++++ 56 files changed, 1671 insertions(+) create mode 100644 lib/components/message/cell/index.d.ts create mode 100644 lib/components/message/cell/index.js create mode 100644 lib/components/message/cell/web.d.ts create mode 100644 lib/components/message/cell/web.js create mode 100644 lib/components/message/cell/web.module.less create mode 100644 lib/components/message/cellButton/index.d.ts create mode 100644 lib/components/message/cellButton/index.js create mode 100644 lib/components/message/cellButton/web.d.ts create mode 100644 lib/components/message/cellButton/web.js create mode 100644 lib/components/message/cellButton/web.module.less create mode 100644 lib/pages/message/detail/index.d.ts create mode 100644 lib/pages/message/detail/index.js create mode 100644 lib/pages/message/detail/index.json create mode 100644 lib/pages/message/detail/mobile.module.less create mode 100644 lib/pages/message/detail/web.d.ts create mode 100644 lib/pages/message/detail/web.js create mode 100644 lib/pages/message/detail/web.module.less create mode 100644 lib/pages/message/detail/web.pc.d.ts create mode 100644 lib/pages/message/detail/web.pc.js create mode 100644 lib/pages/message/drawerList/index.d.ts create mode 100644 lib/pages/message/drawerList/index.js create mode 100644 lib/pages/message/drawerList/index.json create mode 100644 lib/pages/message/drawerList/web.d.ts create mode 100644 lib/pages/message/drawerList/web.js create mode 100644 lib/pages/message/drawerList/web.module.less create mode 100644 lib/pages/message/list/index.d.ts create mode 100644 lib/pages/message/list/index.js create mode 100644 lib/pages/message/list/index.json create mode 100644 lib/pages/message/list/mobile.module.less create mode 100644 lib/pages/message/list/web.d.ts create mode 100644 lib/pages/message/list/web.js create mode 100644 lib/pages/message/list/web.module.less create mode 100644 lib/pages/message/list/web.pc.d.ts create mode 100644 lib/pages/message/list/web.pc.js create mode 100644 src/components/message/cell/index.ts create mode 100644 src/components/message/cell/web.module.less create mode 100644 src/components/message/cell/web.tsx create mode 100644 src/components/message/cellButton/index.ts create mode 100644 src/components/message/cellButton/web.module.less create mode 100644 src/components/message/cellButton/web.tsx create mode 100644 src/pages/message/detail/index.json create mode 100644 src/pages/message/detail/index.ts create mode 100644 src/pages/message/detail/mobile.module.less create mode 100644 src/pages/message/detail/web.module.less create mode 100644 src/pages/message/detail/web.pc.tsx create mode 100644 src/pages/message/detail/web.tsx create mode 100644 src/pages/message/drawerList/index.json create mode 100644 src/pages/message/drawerList/index.ts create mode 100644 src/pages/message/drawerList/web.module.less create mode 100644 src/pages/message/drawerList/web.tsx create mode 100644 src/pages/message/list/index.json create mode 100644 src/pages/message/list/index.ts create mode 100644 src/pages/message/list/mobile.module.less create mode 100644 src/pages/message/list/web.module.less create mode 100644 src/pages/message/list/web.pc.tsx create mode 100644 src/pages/message/list/web.tsx diff --git a/lib/components/message/cell/index.d.ts b/lib/components/message/cell/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/components/message/cell/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/components/message/cell/index.js b/lib/components/message/cell/index.js new file mode 100644 index 000000000..f484b5152 --- /dev/null +++ b/lib/components/message/cell/index.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = OakComponent({ + isList: false, + entity: 'message', + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + formData: function (_a) { + var message = _a.data, features = _a.features, props = _a.props; + return message || {}; + }, + methods: {}, + actions: ['visit'], +}); diff --git a/lib/components/message/cell/web.d.ts b/lib/components/message/cell/web.d.ts new file mode 100644 index 000000000..cd388ec18 --- /dev/null +++ b/lib/components/message/cell/web.d.ts @@ -0,0 +1,14 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; + $$createAt$$: number; + type: string; + title: string; + params: EntityDict['message']['Schema']['params']; + visitState: EntityDict['message']['Schema']['visitState']; + id: string; +}, {}>): JSX.Element; diff --git a/lib/components/message/cell/web.js b/lib/components/message/cell/web.js new file mode 100644 index 000000000..48993f5c0 --- /dev/null +++ b/lib/components/message/cell/web.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var dayjs_1 = tslib_1.__importDefault(require("dayjs")); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +var MessageType = { + adminNotification: '系统通知', + conversationMessage: '客服消息', +}; +// success、 processing、error、default、warning +var MessageTypeToColor = { + adminNotification: 'processing', + conversationMessage: 'warning', +}; +function Render(props) { + var data = props.data, methods = props.methods; + var id = data.id, params = data.params, title = data.title, type = data.type, $$createAt$$ = data.$$createAt$$, visitState = data.visitState, _a = data.oakLegalActions, oakLegalActions = _a === void 0 ? [] : _a, onItemClicked = data.onItemClicked; + var navigateTo = methods.navigateTo, execute = methods.execute; + return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list, onClick: onItemClicked + ? function () { + onItemClicked({ + id: id, + params: params, + }); + } + : undefined }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list__notify }, { children: [visitState === 'unvisited' && ((0, jsx_runtime_1.jsx)(antd_1.Badge, { style: { marginRight: 5 }, status: "processing" })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.notify_deadline }, { children: title })), oakLegalActions.includes('visit') && ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.notify_mask, onClick: function (event) { + execute('visit', false); + event.stopPropagation(); + } }, { children: "\u6807\u8BB0\u5DF2\u8BFB" })))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.list__info }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.tags }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tag, tslib_1.__assign({ color: MessageTypeToColor[type] }, { children: MessageType[type] })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.create_time }, { children: (0, dayjs_1.default)($$createAt$$).format('YYYY-MM-DD HH:mm:ss') }))] }))] }))); +} +exports.default = Render; diff --git a/lib/components/message/cell/web.module.less b/lib/components/message/cell/web.module.less new file mode 100644 index 000000000..8e3a0e282 --- /dev/null +++ b/lib/components/message/cell/web.module.less @@ -0,0 +1,46 @@ +.list { + padding: 10px 20px 10px 31px; + border-bottom: 1px solid #ddd; + cursor: pointer; + position: relative; +} + +.list__notify { + margin-bottom: 5px; + display: flex; + flex-direction: row; + justify-content: space-between; + + .notify_mask { + // display: none; + color: var(--oak-color-primary); + flex-grow: 0; + flex-shrink: 0; + white-space: nowrap; + font-size: 12px; + } + + .notify_deadline { + color: #000; + font-weight: 600; + line-height: 20px; + flex: 1 1 auto; + min-width: 20px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } +} + +.list__info { + display: flex; + flex-direction: row; + justify-content: space-between; + + + .create_time { + color: rgba(0, 0, 0, .4); + line-height: 20px; + font-size: 12px; + } +} \ No newline at end of file diff --git a/lib/components/message/cellButton/index.d.ts b/lib/components/message/cellButton/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/components/message/cellButton/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/components/message/cellButton/index.js b/lib/components/message/cellButton/index.js new file mode 100644 index 000000000..0b552b395 --- /dev/null +++ b/lib/components/message/cellButton/index.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +exports.default = OakComponent({ + entity: 'message', + isList: false, + formData: function (_a) { + var data = _a.data; + return {}; + }, + actions: ['visit'], + methods: { + tapAction: function (action) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var id; + return tslib_1.__generator(this, function (_a) { + id = this.props.oakId; + switch (action) { + case 'visit': { + this.execute('visit', false); + break; + } + default: { + break; + } + } + return [2 /*return*/]; + }); + }); + }, + }, +}); diff --git a/lib/components/message/cellButton/web.d.ts b/lib/components/message/cellButton/web.d.ts new file mode 100644 index 000000000..416690e8d --- /dev/null +++ b/lib/components/message/cellButton/web.d.ts @@ -0,0 +1,5 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element[] | null; diff --git a/lib/components/message/cellButton/web.js b/lib/components/message/cellButton/web.js new file mode 100644 index 000000000..110bfedfa --- /dev/null +++ b/lib/components/message/cellButton/web.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +function Render(props) { + var data = props.data, methods = props.methods; + var t = methods.t, tapAction = methods.tapAction; + var oakLegalActions = data.oakLegalActions; + return oakLegalActions && (oakLegalActions === null || oakLegalActions === void 0 ? void 0 : oakLegalActions.length) > 0 + ? oakLegalActions.map(function (ele) { + return ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function (event) { + var modal = antd_1.Modal.confirm({ + title: "\u786E\u8BA4\u8BE5\u6D88\u606F\u6807\u4E3A\u5DF2\u8BFB\u5417\uFF1F", + okText: '确定', + cancelText: '取消', + onOk: function (e) { + tapAction(ele); + modal.destroy(); + }, + onCancel: function (e) { + modal.destroy(); + }, + }); + } }, { children: "\u6807\u4E3A\u5DF2\u8BFB" }))); + }) + : null; +} +exports.default = Render; diff --git a/lib/components/message/cellButton/web.module.less b/lib/components/message/cellButton/web.module.less new file mode 100644 index 000000000..e69de29bb diff --git a/lib/pages/message/detail/index.d.ts b/lib/pages/message/detail/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/pages/message/detail/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/pages/message/detail/index.js b/lib/pages/message/detail/index.js new file mode 100644 index 000000000..222257bf2 --- /dev/null +++ b/lib/pages/message/detail/index.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +exports.default = OakComponent({ + entity: 'message', + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + isList: false, + formData: function (_a) { + var message = _a.data; + return message || {}; + }, + observers: { + 'visitState,userId': function (visitState, userId) { + var userId2 = this.features.token.getUserId(true); + if (userId === userId2) { + if (visitState === 'unvisited') { + this.execute('visit', false); + } + } + }, + }, + methods: { + goPage: function () { + var params = this.state.params; + var pathname = params === null || params === void 0 ? void 0 : params.pathname; + var props = (params === null || params === void 0 ? void 0 : params.props) || {}; + var state = params === null || params === void 0 ? void 0 : params.state; + if (!pathname) { + return; + } + this.redirectTo(tslib_1.__assign({ url: pathname }, props), state); + }, + }, +}); diff --git a/lib/pages/message/detail/index.json b/lib/pages/message/detail/index.json new file mode 100644 index 000000000..2b99d3cf1 --- /dev/null +++ b/lib/pages/message/detail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息详情", + "usingComponents": {} +} diff --git a/lib/pages/message/detail/mobile.module.less b/lib/pages/message/detail/mobile.module.less new file mode 100644 index 000000000..0db2cfa99 --- /dev/null +++ b/lib/pages/message/detail/mobile.module.less @@ -0,0 +1,32 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; + + margin: 20px; +} + + +.title { + font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 20px; + line-height: 36px; + margin: 0px 0px 22px; +} + +.content { + font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 14px; + color: rgb(51, 51, 51); + line-height: 24px; + margin: 6px 0px 0px; + overflow-wrap: break-word; + word-break: break-all; + font-size: 14px; +} + +.btn { + margin-top: 30px; +} \ No newline at end of file diff --git a/lib/pages/message/detail/web.d.ts b/lib/pages/message/detail/web.d.ts new file mode 100644 index 000000000..096610138 --- /dev/null +++ b/lib/pages/message/detail/web.d.ts @@ -0,0 +1,13 @@ +import { EntityDict } from '../../../general-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/pages/message/detail/web.js b/lib/pages/message/detail/web.js new file mode 100644 index 000000000..c0d1144d5 --- /dev/null +++ b/lib/pages/message/detail/web.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less")); +function Render(props) { + var data = props.data, methods = props.methods; + var title = data.title, content = data.content, params = data.params; + var t = methods.t, goPage = methods.goPage; + var pathname = params === null || params === void 0 ? void 0 : params.pathname; + return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: mobile_module_less_1.default.container }, { children: [(0, jsx_runtime_1.jsx)("h1", tslib_1.__assign({ className: mobile_module_less_1.default.title }, { children: title })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.content }, { children: content })), pathname && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: mobile_module_less_1.default.btn, block: true, type: "primary", onClick: function () { + goPage(); + } }, { children: "\u524D\u5F80" })))] }))); +} +exports.default = Render; diff --git a/lib/pages/message/detail/web.module.less b/lib/pages/message/detail/web.module.less new file mode 100644 index 000000000..1338af954 --- /dev/null +++ b/lib/pages/message/detail/web.module.less @@ -0,0 +1,46 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; +} + +.warp { + word-break: break-all; + min-width: 320px; + max-width: 600px; + border: 1px solid rgb(246, 246, 246); + background-color: rgb(247, 248, 250); + margin: auto; + padding: 30px; +} + +.inner { + background-color: rgb(255, 255, 255); + padding: 30px; + box-shadow: rgb(122 55 55 / 20%) 0px 1px 1px 0px; +} + + +.title { + // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 20px; + line-height: 36px; + margin: 0px 0px 22px; +} + +.content { + // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 14px; + color: rgb(51, 51, 51); + line-height: 24px; + margin: 6px 0px 0px; + overflow-wrap: break-word; + word-break: break-all; + font-size: 14px; +} + +.btn { + margin-top: 30px; +} \ No newline at end of file diff --git a/lib/pages/message/detail/web.pc.d.ts b/lib/pages/message/detail/web.pc.d.ts new file mode 100644 index 000000000..096610138 --- /dev/null +++ b/lib/pages/message/detail/web.pc.d.ts @@ -0,0 +1,13 @@ +import { EntityDict } from '../../../general-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/pages/message/detail/web.pc.js b/lib/pages/message/detail/web.pc.js new file mode 100644 index 000000000..64c710684 --- /dev/null +++ b/lib/pages/message/detail/web.pc.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +function Render(props) { + var data = props.data, methods = props.methods; + var title = data.title, content = data.content, params = data.params; + var t = methods.t, goPage = methods.goPage; + var pathname = params === null || params === void 0 ? void 0 : params.pathname; + return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u6D88\u606F\u8BE6\u60C5", showBack: true }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.warp }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.inner }, { children: [(0, jsx_runtime_1.jsx)("h1", tslib_1.__assign({ className: web_module_less_1.default.title }, { children: title })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.content }, { children: content })), pathname && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: web_module_less_1.default.btn, block: true, type: "primary", onClick: function () { + goPage(); + } }, { children: "\u524D\u5F80" })))] })) })) })) }))); +} +exports.default = Render; diff --git a/lib/pages/message/drawerList/index.d.ts b/lib/pages/message/drawerList/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/pages/message/drawerList/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/pages/message/drawerList/index.js b/lib/pages/message/drawerList/index.js new file mode 100644 index 000000000..9601b0595 --- /dev/null +++ b/lib/pages/message/drawerList/index.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = OakComponent({ + entity: 'message', + isList: true, + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + filters: [ + { + filter: function (_a) { + var features = _a.features, props = _a.props; + var userId = features.token.getUserId(true); + var application = features.application.getApplication(); + var systemId = application.systemId; + return { + userId: userId, + // systemId, + // visitState: 'unvisited', + }; + }, + }, + ], + sorters: [ + { + sorter: function () { + return { + $attr: { + $$createAt$$: 1, + }, + $direction: 'desc', + }; + }, + }, + ], + formData: function (_a) { + var messages = _a.data, features = _a.features, props = _a.props; + var pagination = this.getPagination(); + return { + messages: messages, + pagination: pagination, + }; + }, + methods: { + goDetailById: function (id) { + this.navigateTo({ + url: "/message/detail", + oakId: id, + }); + }, + goMessageList: function () { + this.navigateTo({ + url: '/message/list', + }); + }, + }, +}); diff --git a/lib/pages/message/drawerList/index.json b/lib/pages/message/drawerList/index.json new file mode 100644 index 000000000..a07c620d3 --- /dev/null +++ b/lib/pages/message/drawerList/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息", + "oakDisablePulldownRefresh": true +} diff --git a/lib/pages/message/drawerList/web.d.ts b/lib/pages/message/drawerList/web.d.ts new file mode 100644 index 000000000..942f0fbde --- /dev/null +++ b/lib/pages/message/drawerList/web.d.ts @@ -0,0 +1,10 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; + open: boolean; +}, { + goDetailById: (id: string) => void; + goMessageList: () => void; +}>): JSX.Element; diff --git a/lib/pages/message/drawerList/web.js b/lib/pages/message/drawerList/web.js new file mode 100644 index 000000000..986988cf8 --- /dev/null +++ b/lib/pages/message/drawerList/web.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +var cell_1 = tslib_1.__importDefault(require("../../../components/message/cell")); +var empty_1 = tslib_1.__importDefault(require("../../../components/common/empty")); +function Render(props) { + var data = props.data, methods = props.methods; + var messages = data.messages, open = data.open, onClose = data.onClose, oakFullpath = data.oakFullpath; + var goDetailById = methods.goDetailById, goMessageList = methods.goMessageList; + return ((0, jsx_runtime_1.jsx)(antd_1.Drawer, tslib_1.__assign({ title: "\u6D88\u606F", placement: "right", onClose: onClose, open: open, extra: (0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", type: "text", onClick: function () { + onClose && onClose(); + goMessageList(); + } }, { children: "\u67E5\u770B\u66F4\u591A" })) }), bodyStyle: { + padding: 0, + }, destroyOnClose: true }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", { children: messages === null || messages === void 0 ? void 0 : messages.map(function (message, index) { return ((0, jsx_runtime_1.jsx)(cell_1.default, { oakId: message.id, oakPath: oakFullpath + ? "".concat(oakFullpath, ".").concat(message.id) + : '', onItemClicked: function (item) { + var params = item.params, id = item.id; + onClose && onClose(); + goDetailById(id); + } }, message.id)); }) })) : ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.noData }, { children: (0, jsx_runtime_1.jsx)(empty_1.default, { description: "\u6682\u65E0\u6D88\u606F", image: empty_1.default.PRESENTED_IMAGE_SIMPLE }) }))) })) }))); +} +exports.default = Render; diff --git a/lib/pages/message/drawerList/web.module.less b/lib/pages/message/drawerList/web.module.less new file mode 100644 index 000000000..ea50e8b2c --- /dev/null +++ b/lib/pages/message/drawerList/web.module.less @@ -0,0 +1,6 @@ +/** index.wxss **/ +.container { + display: flex; + flex-direction: column; + background-color: var(--oak-bg-color-page); +} \ No newline at end of file diff --git a/lib/pages/message/list/index.d.ts b/lib/pages/message/list/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/pages/message/list/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/pages/message/list/index.js b/lib/pages/message/list/index.js new file mode 100644 index 000000000..39a12994e --- /dev/null +++ b/lib/pages/message/list/index.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = OakComponent({ + entity: 'message', + isList: true, + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + filters: [ + { + filter: function (_a) { + var features = _a.features, props = _a.props; + var userId = features.token.getUserId(true); + var application = features.application.getApplication(); + var systemId = application.systemId; + return { + userId: userId, + // systemId, + // visitState: 'unvisited', + }; + }, + }, + ], + sorters: [ + { + sorter: function () { + return { + $attr: { + $$createAt$$: 1, + }, + $direction: 'desc', + }; + }, + }, + ], + formData: function (_a) { + var messages = _a.data, features = _a.features, props = _a.props; + var pagination = this.getPagination(); + return { + messages: messages, + pagination: pagination, + }; + }, + methods: { + goDetailById: function (id) { + this.navigateTo({ + url: "/message/detail", + oakId: id, + }); + }, + }, +}); diff --git a/lib/pages/message/list/index.json b/lib/pages/message/list/index.json new file mode 100644 index 000000000..23ae42df6 --- /dev/null +++ b/lib/pages/message/list/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息通知", + "usingComponents": {} +} diff --git a/lib/pages/message/list/mobile.module.less b/lib/pages/message/list/mobile.module.less new file mode 100644 index 000000000..ea50e8b2c --- /dev/null +++ b/lib/pages/message/list/mobile.module.less @@ -0,0 +1,6 @@ +/** index.wxss **/ +.container { + display: flex; + flex-direction: column; + background-color: var(--oak-bg-color-page); +} \ No newline at end of file diff --git a/lib/pages/message/list/web.d.ts b/lib/pages/message/list/web.d.ts new file mode 100644 index 000000000..1ae79b66a --- /dev/null +++ b/lib/pages/message/list/web.d.ts @@ -0,0 +1,7 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/pages/message/list/web.js b/lib/pages/message/list/web.js new file mode 100644 index 000000000..87e52feab --- /dev/null +++ b/lib/pages/message/list/web.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less")); +var cell_1 = tslib_1.__importDefault(require("../../../components/message/cell")); +var empty_1 = tslib_1.__importDefault(require("../../../components/common/empty")); +function Render(props) { + var data = props.data, methods = props.methods; + var messages = data.messages, oakFullpath = data.oakFullpath; + var goDetailById = methods.goDetailById; + return ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.container }, { children: (messages === null || messages === void 0 ? void 0 : messages.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", { children: messages === null || messages === void 0 ? void 0 : messages.map(function (message, index) { return ((0, jsx_runtime_1.jsx)(cell_1.default, { oakId: message.id, oakPath: oakFullpath + ? "".concat(oakFullpath, ".").concat(message.id) + : '', onItemClicked: function (item) { + goDetailById(item.id); + } }, message.id)); }) })) : ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: mobile_module_less_1.default.noData }, { children: (0, jsx_runtime_1.jsx)(empty_1.default, { description: "\u6682\u65E0\u6D88\u606F", image: empty_1.default.PRESENTED_IMAGE_SIMPLE }) }))) }))); +} +exports.default = Render; diff --git a/lib/pages/message/list/web.module.less b/lib/pages/message/list/web.module.less new file mode 100644 index 000000000..b8e6934cf --- /dev/null +++ b/lib/pages/message/list/web.module.less @@ -0,0 +1,7 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; +} \ No newline at end of file diff --git a/lib/pages/message/list/web.pc.d.ts b/lib/pages/message/list/web.pc.d.ts new file mode 100644 index 000000000..03c6b10fc --- /dev/null +++ b/lib/pages/message/list/web.pc.d.ts @@ -0,0 +1,12 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/pages/message/list/web.pc.js b/lib/pages/message/list/web.pc.js new file mode 100644 index 000000000..956c54b3b --- /dev/null +++ b/lib/pages/message/list/web.pc.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_1 = require("antd"); +var dayjs_1 = tslib_1.__importDefault(require("dayjs")); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader")); +var cellButton_1 = tslib_1.__importDefault(require("../../../components/message/cellButton")); +var MessageType = { + adminNotification: '系统通知', + conversationMessage: '客服消息', +}; +function Render(props) { + var data = props.data, methods = props.methods; + var t = methods.t, setPageSize = methods.setPageSize, setCurrentPage = methods.setCurrentPage, goDetailById = methods.goDetailById; + var messages = data.messages, oakFullpath = data.oakFullpath, oakLoading = data.oakLoading, pagination = data.pagination; + var _a = pagination || {}, pageSize = _a.pageSize, total = _a.total, currentPage = _a.currentPage; + return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u6D88\u606F\u901A\u77E5" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)(antd_1.Table, { loading: oakLoading, dataSource: messages || [], rowKey: "id", + // scroll={{ x: 1200 }} + columns: [ + // { + // dataIndex: 'serial-number', + // title: '序号', + // render: (value, record, index) => { + // return index + 1; + // }, + // }, + { + dataIndex: 'title', + title: '消息内容', + render: function (value, record, index) { + if (record.visitState === 'unvisited') { + return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, { style: { marginRight: 5 }, status: "processing" }), (0, jsx_runtime_1.jsx)(antd_1.Typography.Link, tslib_1.__assign({ onClick: function () { + goDetailById(record.id); + } }, { children: value }))] })); + } + return ((0, jsx_runtime_1.jsx)(antd_1.Typography.Text, tslib_1.__assign({ onClick: function () { + goDetailById(record.id); + } }, { children: value }))); + }, + }, + { + dataIndex: 'type', + title: '类型', + render: function (value, record, index) { + return MessageType[value]; + }, + }, + { + dataIndex: 'visitState', + title: '是否已读', + render: function (value, record, index) { + return value === 'unvisited' ? '未读' : '已读'; + }, + }, + { + dataIndex: '$$createAt$$', + title: '接收时间', + render: function (value, record, index) { + return ((0, jsx_runtime_1.jsx)("div", { children: (0, dayjs_1.default)(value).format('YYYY-MM-DD HH:mm:ss') })); + }, + }, + { + dataIndex: 'op', + width: 300, + title: '操作', + align: 'center', + render: function (value, record, index) { + return ((0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ wrap: true }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () { + goDetailById(record === null || record === void 0 ? void 0 : record.id); + } }, { children: "\u8BE6\u60C5" })), (0, jsx_runtime_1.jsx)(cellButton_1.default, { oakId: record.id, oakPath: "".concat(oakFullpath, ".").concat(record.id) })] }))); + }, + fixed: 'right', + }, + ], pagination: { + total: total, + pageSize: pageSize, + current: currentPage, + onShowSizeChange: function (current, pageSize) { + setPageSize(pageSize); + }, + onChange: function (page, pageSize) { + setCurrentPage(page); + }, + } }) })) }))); +} +exports.default = Render; diff --git a/src/components/message/cell/index.ts b/src/components/message/cell/index.ts new file mode 100644 index 000000000..a6e17eedd --- /dev/null +++ b/src/components/message/cell/index.ts @@ -0,0 +1,24 @@ +export default OakComponent({ + isList: false, + entity: 'message', + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + formData: function ({ data: message, features, props }) { + return message || {}; + }, + methods: {}, + actions: ['visit'], +}); diff --git a/src/components/message/cell/web.module.less b/src/components/message/cell/web.module.less new file mode 100644 index 000000000..8e3a0e282 --- /dev/null +++ b/src/components/message/cell/web.module.less @@ -0,0 +1,46 @@ +.list { + padding: 10px 20px 10px 31px; + border-bottom: 1px solid #ddd; + cursor: pointer; + position: relative; +} + +.list__notify { + margin-bottom: 5px; + display: flex; + flex-direction: row; + justify-content: space-between; + + .notify_mask { + // display: none; + color: var(--oak-color-primary); + flex-grow: 0; + flex-shrink: 0; + white-space: nowrap; + font-size: 12px; + } + + .notify_deadline { + color: #000; + font-weight: 600; + line-height: 20px; + flex: 1 1 auto; + min-width: 20px; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } +} + +.list__info { + display: flex; + flex-direction: row; + justify-content: space-between; + + + .create_time { + color: rgba(0, 0, 0, .4); + line-height: 20px; + font-size: 12px; + } +} \ No newline at end of file diff --git a/src/components/message/cell/web.tsx b/src/components/message/cell/web.tsx new file mode 100644 index 000000000..d6f1b645a --- /dev/null +++ b/src/components/message/cell/web.tsx @@ -0,0 +1,107 @@ +import React from 'react'; +import { Tag, Badge } from 'antd'; +import dayjs from 'dayjs'; +import Style from './web.module.less'; + +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; + +const MessageType = { + adminNotification: '系统通知', + conversationMessage: '客服消息', +}; + +// success、 processing、error、default、warning +const MessageTypeToColor = { + adminNotification: 'processing', + conversationMessage: 'warning', +}; + + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + false, + { + onItemClicked: (item: { + id: string; + params: EntityDict['message']['Schema']['params']; + }) => void; + $$createAt$$: number; + type: string; + title: string; + params: EntityDict['message']['Schema']['params']; + visitState: EntityDict['message']['Schema']['visitState']; + id: string; + }, + {} + > +) { + const { data, methods } = props; + const { + id, + params, + title, + type, + $$createAt$$, + visitState, + oakLegalActions = [], + onItemClicked, + } = data; + const { navigateTo, execute } = methods; + + return ( +
{ + onItemClicked({ + id, + params, + }); + } + : undefined + } + > +
+ {visitState === 'unvisited' && ( + + )} +
{title}
+ {oakLegalActions.includes('visit') && ( +
{ + execute('visit', false); + event.stopPropagation(); + }} + > + 标记已读 +
+ )} +
+
+
+ + {MessageType[type as keyof typeof MessageType]} + +
+ +
+ {dayjs($$createAt$$).format('YYYY-MM-DD HH:mm:ss')} +
+
+
+ ); +} diff --git a/src/components/message/cellButton/index.ts b/src/components/message/cellButton/index.ts new file mode 100644 index 000000000..7ab5cd5ce --- /dev/null +++ b/src/components/message/cellButton/index.ts @@ -0,0 +1,22 @@ +export default OakComponent({ + entity: 'message', + isList: false, + formData({ data }) { + return {}; + }, + actions: ['visit'], + methods: { + async tapAction(action: string) { + const { oakId: id } = this.props; + switch (action) { + case 'visit': { + this.execute('visit', false); + break; + } + default: { + break; + } + } + }, + }, +}); diff --git a/src/components/message/cellButton/web.module.less b/src/components/message/cellButton/web.module.less new file mode 100644 index 000000000..e69de29bb diff --git a/src/components/message/cellButton/web.tsx b/src/components/message/cellButton/web.tsx new file mode 100644 index 000000000..bd506e156 --- /dev/null +++ b/src/components/message/cellButton/web.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import { Button, Modal } from 'antd'; +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + false, + {}, + { + tapAction: (action: string) => void; + } + > +) { + const { data, methods } = props; + const { t, tapAction } = methods; + const { oakLegalActions } = data; + + return oakLegalActions && oakLegalActions?.length > 0 + ? oakLegalActions.map((ele: string) => { + return ( + + ); + }) + : null; +} diff --git a/src/pages/message/detail/index.json b/src/pages/message/detail/index.json new file mode 100644 index 000000000..2b99d3cf1 --- /dev/null +++ b/src/pages/message/detail/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息详情", + "usingComponents": {} +} diff --git a/src/pages/message/detail/index.ts b/src/pages/message/detail/index.ts new file mode 100644 index 000000000..61bc1f180 --- /dev/null +++ b/src/pages/message/detail/index.ts @@ -0,0 +1,52 @@ + +export default OakComponent({ + entity: 'message', + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + isList: false, + formData: ({ data: message }) => { + return message || {}; + }, + observers: { + 'visitState,userId': function (visitState, userId) { + const userId2 = this.features.token.getUserId(true); + if (userId === userId2) { + if (visitState === 'unvisited') { + this.execute('visit', false); + } + } + }, + }, + methods: { + goPage() { + const { params } = this.state; + const pathname = params?.pathname; + const props = params?.props || {}; + const state = params?.state; + if (!pathname) { + return; + } + + this.redirectTo( + { + url: pathname, + ...props, + }, + state + ); + }, + }, +}); diff --git a/src/pages/message/detail/mobile.module.less b/src/pages/message/detail/mobile.module.less new file mode 100644 index 000000000..0db2cfa99 --- /dev/null +++ b/src/pages/message/detail/mobile.module.less @@ -0,0 +1,32 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; + + margin: 20px; +} + + +.title { + font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 20px; + line-height: 36px; + margin: 0px 0px 22px; +} + +.content { + font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 14px; + color: rgb(51, 51, 51); + line-height: 24px; + margin: 6px 0px 0px; + overflow-wrap: break-word; + word-break: break-all; + font-size: 14px; +} + +.btn { + margin-top: 30px; +} \ No newline at end of file diff --git a/src/pages/message/detail/web.module.less b/src/pages/message/detail/web.module.less new file mode 100644 index 000000000..1338af954 --- /dev/null +++ b/src/pages/message/detail/web.module.less @@ -0,0 +1,46 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; +} + +.warp { + word-break: break-all; + min-width: 320px; + max-width: 600px; + border: 1px solid rgb(246, 246, 246); + background-color: rgb(247, 248, 250); + margin: auto; + padding: 30px; +} + +.inner { + background-color: rgb(255, 255, 255); + padding: 30px; + box-shadow: rgb(122 55 55 / 20%) 0px 1px 1px 0px; +} + + +.title { + // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 20px; + line-height: 36px; + margin: 0px 0px 22px; +} + +.content { + // font-family: "helvetica neue", PingFangSC-Light, arial, "hiragino sans gb", "microsoft yahei ui", "microsoft yahei", simsun, sans-serif; + font-size: 14px; + color: rgb(51, 51, 51); + line-height: 24px; + margin: 6px 0px 0px; + overflow-wrap: break-word; + word-break: break-all; + font-size: 14px; +} + +.btn { + margin-top: 30px; +} \ No newline at end of file diff --git a/src/pages/message/detail/web.pc.tsx b/src/pages/message/detail/web.pc.tsx new file mode 100644 index 000000000..2cf72473e --- /dev/null +++ b/src/pages/message/detail/web.pc.tsx @@ -0,0 +1,61 @@ +import React from 'react'; +import { + Card, + Button, +} from 'antd'; +import PageHeader from '../../../components/common/pageHeader'; +import { EntityDict } from '../../../general-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; +import Style from './web.module.less'; + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + false, + { + title: string; + content: string; + id: string; + $$createAt$$: number; + type: string; + visitState: EntityDict['message']['Schema']['visitState']; + params: EntityDict['message']['Schema']['params']; + }, + { + goPage: () => void; + } + > +) { + const { data, methods } = props; + const { title, content, params } = data; + const { t, goPage } = methods; + const pathname = params?.pathname; + + + return ( + +
+
+
+

{title}

+
{content}
+ + {pathname && ( + + )} +
+
+
+
+ ); +} diff --git a/src/pages/message/detail/web.tsx b/src/pages/message/detail/web.tsx new file mode 100644 index 000000000..f2eb8d18e --- /dev/null +++ b/src/pages/message/detail/web.tsx @@ -0,0 +1,54 @@ +import React from 'react'; +import { + Card, + Button, +} from 'antd'; +import { EntityDict } from '../../../general-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; +import Style from './mobile.module.less'; + + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + false, + { + title: string; + content: string; + id: string; + $$createAt$$: number; + type: string; + visitState: EntityDict['message']['Schema']['visitState']; + params: EntityDict['message']['Schema']['params']; + }, + { + goPage: () => void; + } + > +) { + const { data, methods } = props; + const { title, content, params } = data; + const { t, goPage } = methods; + const pathname = params?.pathname; + + return ( +
+

{title}

+
{content}
+ + {pathname && ( + + )} +
+ ); +} diff --git a/src/pages/message/drawerList/index.json b/src/pages/message/drawerList/index.json new file mode 100644 index 000000000..a07c620d3 --- /dev/null +++ b/src/pages/message/drawerList/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息", + "oakDisablePulldownRefresh": true +} diff --git a/src/pages/message/drawerList/index.ts b/src/pages/message/drawerList/index.ts new file mode 100644 index 000000000..2c3398fd4 --- /dev/null +++ b/src/pages/message/drawerList/index.ts @@ -0,0 +1,67 @@ + +export default OakComponent({ + entity: 'message', + isList: true, + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + filters: [ + { + filter: ({ features, props }) => { + const userId = features.token.getUserId(true); + const application = features.application.getApplication(); + const { systemId } = application; + + return { + userId, + // systemId, + // visitState: 'unvisited', + }; + }, + }, + ], + sorters: [ + { + sorter: () => { + return { + $attr: { + $$createAt$$: 1, + }, + $direction: 'desc', + }; + }, + }, + ], + formData: function ({ data: messages, features, props }) { + const pagination = this.getPagination(); + return { + messages, + pagination, + }; + }, + methods: { + goDetailById(id: string) { + this.navigateTo({ + url: `/message/detail`, + oakId: id, + }); + }, + goMessageList() { + this.navigateTo({ + url: '/message/list', + }); + }, + }, +}); diff --git a/src/pages/message/drawerList/web.module.less b/src/pages/message/drawerList/web.module.less new file mode 100644 index 000000000..ea50e8b2c --- /dev/null +++ b/src/pages/message/drawerList/web.module.less @@ -0,0 +1,6 @@ +/** index.wxss **/ +.container { + display: flex; + flex-direction: column; + background-color: var(--oak-bg-color-page); +} \ No newline at end of file diff --git a/src/pages/message/drawerList/web.tsx b/src/pages/message/drawerList/web.tsx new file mode 100644 index 000000000..49f1acf16 --- /dev/null +++ b/src/pages/message/drawerList/web.tsx @@ -0,0 +1,92 @@ +import React from 'react'; +import { Button, Space, Drawer } from 'antd'; +import Style from './web.module.less'; +import MessageCell from '../../../components/message/cell'; +import Empty from '../../../components/common/empty'; + +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; + + + + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + false, + { + messages: EntityDict['message']['Schema'][]; + onClose: () => void; + open: boolean; + }, + { + goDetailById: (id: string) => void; + goMessageList: () => void; + } + > +) { + const { data, methods } = props; + const { messages, open, onClose, oakFullpath } = data; + const { goDetailById, goMessageList } = methods; + + return ( + + + + } + bodyStyle={{ + padding: 0, + }} + destroyOnClose={true} + > +
+ {messages?.length > 0 ? ( +
+ {messages?.map((message, index: number) => ( + { + const { params, id } = item; + onClose && onClose(); + goDetailById(id); + }} + /> + ))} +
+ ) : ( +
+ +
+ )} +
+
+ ); +} diff --git a/src/pages/message/list/index.json b/src/pages/message/list/index.json new file mode 100644 index 000000000..23ae42df6 --- /dev/null +++ b/src/pages/message/list/index.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "消息通知", + "usingComponents": {} +} diff --git a/src/pages/message/list/index.ts b/src/pages/message/list/index.ts new file mode 100644 index 000000000..e69c4d44f --- /dev/null +++ b/src/pages/message/list/index.ts @@ -0,0 +1,62 @@ + +export default OakComponent({ + entity: 'message', + isList: true, + projection: { + id: 1, + $$createAt$$: 1, + type: 1, + title: 1, + content: 1, + visitState: 1, + userId: 1, + user: { + id: 1, + name: 1, + }, + params: 1, + props: 1, + }, + filters: [ + { + filter: ({ features, props }) => { + const userId = features.token.getUserId(true); + const application = features.application.getApplication(); + const { systemId } = application; + + return { + userId, + // systemId, + // visitState: 'unvisited', + }; + }, + }, + ], + sorters: [ + { + sorter: () => { + return { + $attr: { + $$createAt$$: 1, + }, + $direction: 'desc', + }; + }, + }, + ], + formData: function ({ data: messages, features, props }) { + const pagination = this.getPagination(); + return { + messages, + pagination, + }; + }, + methods: { + goDetailById(id: string) { + this.navigateTo({ + url: `/message/detail`, + oakId: id, + }); + }, + }, +}); diff --git a/src/pages/message/list/mobile.module.less b/src/pages/message/list/mobile.module.less new file mode 100644 index 000000000..ea50e8b2c --- /dev/null +++ b/src/pages/message/list/mobile.module.less @@ -0,0 +1,6 @@ +/** index.wxss **/ +.container { + display: flex; + flex-direction: column; + background-color: var(--oak-bg-color-page); +} \ No newline at end of file diff --git a/src/pages/message/list/web.module.less b/src/pages/message/list/web.module.less new file mode 100644 index 000000000..b8e6934cf --- /dev/null +++ b/src/pages/message/list/web.module.less @@ -0,0 +1,7 @@ +/** index.wxss **/ +.container { + background: var(--oak-bg-color-container); + box-shadow: 0 2px 3px #0000001a; + border-radius: 3px; + padding: 30px 32px; +} \ No newline at end of file diff --git a/src/pages/message/list/web.pc.tsx b/src/pages/message/list/web.pc.tsx new file mode 100644 index 000000000..fdaff4358 --- /dev/null +++ b/src/pages/message/list/web.pc.tsx @@ -0,0 +1,161 @@ +import React from 'react'; +import { Button, Badge, Table, Space, Typography } from 'antd'; +import dayjs from 'dayjs'; +import Style from './web.module.less'; +import PageHeader from '../../../components/common/pageHeader'; +import CellButton from '../../../components/message/cellButton'; + +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; + +const MessageType = { + adminNotification: '系统通知', + conversationMessage: '客服消息', +}; + + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + true, + { + pagination?: { + pageSize: number; + total: number; + currentPage: number; + }; + messages: EntityDict['message']['Schema'][]; + }, + { + goDetailById: (id: string) => void; + } + > +) { + const { data, methods } = props; + const { t, setPageSize, setCurrentPage, goDetailById } = methods; + const { messages, oakFullpath, oakLoading, pagination } = data; + const { pageSize, total, currentPage } = pagination || {}; + + return ( + +
+
{ + // return index + 1; + // }, + // }, + { + dataIndex: 'title', + title: '消息内容', + render: (value, record, index) => { + if (record.visitState === 'unvisited') { + return ( + <> + + { + goDetailById(record.id); + }} + > + {value} + + + ); + } + return ( + { + goDetailById(record.id); + }} + > + {value} + + ); + }, + }, + { + dataIndex: 'type', + title: '类型', + render: (value, record, index) => { + return MessageType[ + value as keyof typeof MessageType + ]; + }, + }, + { + dataIndex: 'visitState', + title: '是否已读', + render: (value, record, index) => { + return value === 'unvisited' ? '未读' : '已读'; + }, + }, + { + dataIndex: '$$createAt$$', + title: '接收时间', + render: (value, record, index) => { + return ( +
+ {dayjs(value).format( + 'YYYY-MM-DD HH:mm:ss' + )} +
+ ); + }, + }, + { + dataIndex: 'op', + width: 300, + title: '操作', + align: 'center', + render: (value, record, index) => { + return ( + + + + + ); + }, + fixed: 'right', + }, + ]} + pagination={{ + total: total, + pageSize: pageSize, + current: currentPage, + onShowSizeChange: ( + current: number, + pageSize: number + ) => { + setPageSize(pageSize); + }, + onChange: (page: number, pageSize: number) => { + setCurrentPage(page); + }, + }} + /> + + + ); +} diff --git a/src/pages/message/list/web.tsx b/src/pages/message/list/web.tsx new file mode 100644 index 000000000..8f0a287d9 --- /dev/null +++ b/src/pages/message/list/web.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { Tag, Badge } from 'antd'; +import Style from './mobile.module.less'; +import MessageCell from '../../../components/message/cell'; +import Empty from '../../../components/common/empty'; + +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; + + +export default function Render( + props: WebComponentProps< + EntityDict, + 'message', + true, + { + messages: EntityDict['message']['Schema'][]; + }, + { + goDetailById: (id: string) => void; + } + > +) { + const { data, methods } = props; + const { messages, oakFullpath } = data; + const { goDetailById } = methods; + + return ( +
+ {messages?.length > 0 ? ( +
+ {messages?.map((message, index: number) => ( + { + goDetailById(item.id); + }} + /> + ))} +
+ ) : ( +
+ +
+ )} +
+ ); +} From b69e9f775dcbcd7ded0469a31fbbb6db206c88eb Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Thu, 22 Dec 2022 12:15:14 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=88=91=E7=9A=84message=20=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=9B=BE=E6=A0=87=20=E7=94=A8=E6=9D=A5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=B6=88=E6=81=AF=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/my/message/index.d.ts | 3 ++ lib/components/my/message/index.js | 52 ++++++++++++++++++++ lib/components/my/message/mobile.module.less | 4 ++ lib/components/my/message/web.d.ts | 7 +++ lib/components/my/message/web.js | 16 ++++++ lib/components/my/message/web.module.less | 8 +++ lib/components/my/message/web.pc.d.ts | 7 +++ lib/components/my/message/web.pc.js | 20 ++++++++ package.json | 5 +- src/components/my/info/web.tsx | 3 +- src/components/my/message/index.ts | 39 +++++++++++++++ src/components/my/message/mobile.module.less | 4 ++ src/components/my/message/web.module.less | 8 +++ src/components/my/message/web.pc.tsx | 48 ++++++++++++++++++ src/components/my/message/web.tsx | 38 ++++++++++++++ 15 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 lib/components/my/message/index.d.ts create mode 100644 lib/components/my/message/index.js create mode 100644 lib/components/my/message/mobile.module.less create mode 100644 lib/components/my/message/web.d.ts create mode 100644 lib/components/my/message/web.js create mode 100644 lib/components/my/message/web.module.less create mode 100644 lib/components/my/message/web.pc.d.ts create mode 100644 lib/components/my/message/web.pc.js create mode 100644 src/components/my/message/index.ts create mode 100644 src/components/my/message/mobile.module.less create mode 100644 src/components/my/message/web.module.less create mode 100644 src/components/my/message/web.pc.tsx create mode 100644 src/components/my/message/web.tsx diff --git a/lib/components/my/message/index.d.ts b/lib/components/my/message/index.d.ts new file mode 100644 index 000000000..42765aac1 --- /dev/null +++ b/lib/components/my/message/index.d.ts @@ -0,0 +1,3 @@ +/// +declare const _default: import("react").ComponentType; +export default _default; diff --git a/lib/components/my/message/index.js b/lib/components/my/message/index.js new file mode 100644 index 000000000..ca5aa503c --- /dev/null +++ b/lib/components/my/message/index.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +exports.default = OakComponent({ + isList: false, + lifetimes: { + attached: function () { + this.getMessageCount(); + }, + }, + data: { + count: undefined, + }, + methods: { + goMessageList: function () { + this.navigateTo({ + url: '/message/list', + }); + }, + getMessageCount: function () { + return tslib_1.__awaiter(this, void 0, void 0, function () { + var userId, application, systemId, result; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + userId = this.features.token.getUserId(true); + application = this.features.application.getApplication(); + systemId = application.systemId; + if (!userId) return [3 /*break*/, 2]; + return [4 /*yield*/, this.features.cache.count('message', { + data: { + id: 1, + }, + filter: { + userId: userId, + systemId: systemId, + visitState: 'unvisited', + }, + })]; + case 1: + result = _a.sent(); + this.setState({ + count: result, + }); + _a.label = 2; + case 2: return [2 /*return*/]; + } + }); + }); + }, + }, +}); diff --git a/lib/components/my/message/mobile.module.less b/lib/components/my/message/mobile.module.less new file mode 100644 index 000000000..9594d0233 --- /dev/null +++ b/lib/components/my/message/mobile.module.less @@ -0,0 +1,4 @@ + .icon { + font-size: 20px; + color: var(--oak-color-primary); + } \ No newline at end of file diff --git a/lib/components/my/message/web.d.ts b/lib/components/my/message/web.d.ts new file mode 100644 index 000000000..6be12245f --- /dev/null +++ b/lib/components/my/message/web.d.ts @@ -0,0 +1,7 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/components/my/message/web.js b/lib/components/my/message/web.js new file mode 100644 index 000000000..13733ff45 --- /dev/null +++ b/lib/components/my/message/web.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var antd_mobile_1 = require("antd-mobile"); +var icons_1 = require("@ant-design/icons"); +var mobile_module_less_1 = tslib_1.__importDefault(require("./mobile.module.less")); +function Render(props) { + var data = props.data, methods = props.methods; + var count = data.count; + var goMessageList = methods.goMessageList; + return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_mobile_1.Badge, tslib_1.__assign({ content: count || '' }, { children: (0, jsx_runtime_1.jsx)(icons_1.BellOutlined, { className: mobile_module_less_1.default.icon, onClick: function () { + goMessageList(); + } }) })) })); +} +exports.default = Render; diff --git a/lib/components/my/message/web.module.less b/lib/components/my/message/web.module.less new file mode 100644 index 000000000..42071e75e --- /dev/null +++ b/lib/components/my/message/web.module.less @@ -0,0 +1,8 @@ +.btn { + padding-inline-start: 5px; + padding-inline-end: 5px; +} + +.icon { + font-size: 20px; +} \ No newline at end of file diff --git a/lib/components/my/message/web.pc.d.ts b/lib/components/my/message/web.pc.d.ts new file mode 100644 index 000000000..6be12245f --- /dev/null +++ b/lib/components/my/message/web.pc.d.ts @@ -0,0 +1,7 @@ +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +export default function Render(props: WebComponentProps void; +}>): JSX.Element; diff --git a/lib/components/my/message/web.pc.js b/lib/components/my/message/web.pc.js new file mode 100644 index 000000000..14f86f4e8 --- /dev/null +++ b/lib/components/my/message/web.pc.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var jsx_runtime_1 = require("react/jsx-runtime"); +var react_1 = require("react"); +var antd_1 = require("antd"); +var icons_1 = require("@ant-design/icons"); +var drawerList_1 = tslib_1.__importDefault(require("../../../pages/message/drawerList")); +var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less")); +function Render(props) { + var data = props.data; + var count = data.count; + var _a = tslib_1.__read((0, react_1.useState)(false), 2), open = _a[0], setOpen = _a[1]; + return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Badge, tslib_1.__assign({ count: count }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, { className: web_module_less_1.default.btn, type: "text", shape: "circle", icon: (0, jsx_runtime_1.jsx)(icons_1.BellOutlined, {}), onClick: function () { + setOpen(true); + } }) })), (0, jsx_runtime_1.jsx)(drawerList_1.default, { open: open, onClose: function () { + setOpen(false); + } })] })); +} +exports.default = Render; diff --git a/package.json b/package.json index 86e45edb1..4826b3347 100644 --- a/package.json +++ b/package.json @@ -75,8 +75,9 @@ "scripts": { "make:domain": "ts-node ./scripts/make.ts", "clean": "rimraf lib/*", - "copy-files": "copyfiles -u 1 src/**/*.less lib/ & copyfiles -u 1 src/**/*.svg lib/ & copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.wxml lib/ & copyfiles -u 1 src/**/*.wxs lib/ & copyfiles -u 1 src/miniprogram_npm/**/*.js lib/ ", - "build": "tsc && npm run copy-files", + "copy-files": "copyfiles -u 1 src/**/*.svg lib/ & copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.wxml lib/ & copyfiles -u 1 src/**/*.wxs lib/ & copyfiles -u 1 src/miniprogram_npm/**/*.js lib/ ", + "copy-less": "copyfiles -u 1 src/**/*.less lib/", + "build": "tsc && npm run copy-files && npm run copy-less", "gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts", "clean:dir": "ts-node ./scripts/cleanDtsAndJs", "test": "ts-node ./test/test.ts", diff --git a/src/components/my/info/web.tsx b/src/components/my/info/web.tsx index 79e61ed69..a9b300856 100644 --- a/src/components/my/info/web.tsx +++ b/src/components/my/info/web.tsx @@ -1,5 +1,6 @@ -import { WebComponentProps } from 'oak-frontend-base'; import React, { useState } from 'react'; + +import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../general-app-domain'; import Styles from './web.pc.module.less'; import { Button, List, Popup, Tag, Input, Radio, Form, Space } from 'antd-mobile'; diff --git a/src/components/my/message/index.ts b/src/components/my/message/index.ts new file mode 100644 index 000000000..09cb495ca --- /dev/null +++ b/src/components/my/message/index.ts @@ -0,0 +1,39 @@ + +export default OakComponent({ + isList: false, + lifetimes: { + attached() { + this.getMessageCount(); + }, + }, + data: { + count: undefined, + }, + methods: { + goMessageList() { + this.navigateTo({ + url: '/message/list', + }); + }, + async getMessageCount() { + const userId = this.features.token.getUserId(true); + const application = this.features.application.getApplication(); + const { systemId } = application; + if (userId) { + const result = await this.features.cache.count('message', { + data: { + id: 1, + }, + filter: { + userId, + systemId, + visitState: 'unvisited', + }, + }); + this.setState({ + count: result, + }); + } + }, + }, +}); diff --git a/src/components/my/message/mobile.module.less b/src/components/my/message/mobile.module.less new file mode 100644 index 000000000..9594d0233 --- /dev/null +++ b/src/components/my/message/mobile.module.less @@ -0,0 +1,4 @@ + .icon { + font-size: 20px; + color: var(--oak-color-primary); + } \ No newline at end of file diff --git a/src/components/my/message/web.module.less b/src/components/my/message/web.module.less new file mode 100644 index 000000000..42071e75e --- /dev/null +++ b/src/components/my/message/web.module.less @@ -0,0 +1,8 @@ +.btn { + padding-inline-start: 5px; + padding-inline-end: 5px; +} + +.icon { + font-size: 20px; +} \ No newline at end of file diff --git a/src/components/my/message/web.pc.tsx b/src/components/my/message/web.pc.tsx new file mode 100644 index 000000000..ed857947a --- /dev/null +++ b/src/components/my/message/web.pc.tsx @@ -0,0 +1,48 @@ +import React, { useState } from 'react'; +import { Button, Badge } from 'antd'; +import { BellOutlined } from '@ant-design/icons'; +import { WebComponentProps } from 'oak-frontend-base'; +import { EntityDict } from '../../../general-app-domain'; +import MessageDrawerList from '../../../pages/message/drawerList'; + +import Style from './web.module.less'; + +export default function Render( + props: WebComponentProps< + EntityDict, + 'user', + false, + { + count?: number; + }, + { + goMessageList: () => void; + } + > +) { + const { data } = props; + const { count } = data; + const [open, setOpen] = useState(false); + + return ( + <> + +