From c27398a9d19525e67e329b6062903113581d36d5 Mon Sep 17 00:00:00 2001 From: "ext.pangzhaoqun1" Date: Thu, 27 Jan 2022 16:47:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=A6=E6=83=85=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/detail/detailInfo/index.tsx | 45 ++++++++++++++++++++++ src/components/detail/index.tsx | 4 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/components/detail/detailInfo/index.tsx diff --git a/src/components/detail/detailInfo/index.tsx b/src/components/detail/detailInfo/index.tsx new file mode 100644 index 0000000..de63460 --- /dev/null +++ b/src/components/detail/detailInfo/index.tsx @@ -0,0 +1,45 @@ +import React from 'react' +import { DetailInfoField } from 'ccms' +import { IInfoProps, InfoDetailConfig } from 'ccms/dist/src/components/detail/detailInfo' +import { Modal, Tooltip } from 'antd' +import { InfoCircleOutlined } from '@ant-design/icons' + +export const PropsType = (props: InfoDetailConfig) => {} + +export default class InfoDetailComponent extends DetailInfoField { + renderComponent = (props: IInfoProps) => { + const { + description + } = props + + return ( +
+ {(description && description?.descType === 'text' && description?.label !== undefined && description?.label !== "") && + {(description.showIcon) && ()} + {description?.label} + } + {(description && description?.descType === 'tooltip' && description?.label !== undefined && description?.label !== "") && + ele.parentElement || document.body}> + {(description.showIcon) && ()} + {description?.label} + + } + {(description && description?.descType === 'modal' && description?.label !== undefined && description?.label !== "") && + { + Modal.success({ + getContainer: () => document.getElementById('ccms-antd') || document.body, + content: description?.content, + }); + }}> + {(description.showIcon) && ()} + {description?.label} + + } +
+ ) + } +} diff --git a/src/components/detail/index.tsx b/src/components/detail/index.tsx index 2bcd753..69eac01 100644 --- a/src/components/detail/index.tsx +++ b/src/components/detail/index.tsx @@ -3,11 +3,13 @@ import GroupField from './group' import StatementDetail from './statement' import EnumDetailComponent from './enum' import ImportSubformField from './importSubform' +import InfoDetail from './detailInfo' export default { text: TextField, group: GroupField, statement: StatementDetail, detail_enum: EnumDetailComponent, - import_subform: ImportSubformField + import_subform: ImportSubformField, + detail_info: InfoDetail } -- Gitee From 04a85bc170de25cc6dfd3c3f4b40242eefcc9bbb Mon Sep 17 00:00:00 2001 From: "ext.pangzhaoqun1" Date: Thu, 17 Mar 2022 17:20:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/detail/detailInfo/index.tsx | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/components/detail/detailInfo/index.tsx b/src/components/detail/detailInfo/index.tsx index de63460..7d9459e 100644 --- a/src/components/detail/detailInfo/index.tsx +++ b/src/components/detail/detailInfo/index.tsx @@ -14,32 +14,34 @@ export default class InfoDetailComponent extends DetailInfoField { return (
- {(description && description?.descType === 'text' && description?.label !== undefined && description?.label !== "") && - {(description.showIcon) && ()} - {description?.label} + {(description && description.descType === 'text' && description.label !== undefined && description.label !== "") && + {(description.showIcon) && ()} + {description.label} + } - {(description && description?.descType === 'tooltip' && description?.label !== undefined && description?.label !== "") && + {(description && description.descType === 'tooltip' && description.label !== undefined && description.label !== "") && ele.parentElement || document.body}> - {(description.showIcon) && ()} - {description?.label} + {(description.showIcon) && ()} + {description.label} } - {(description && description?.descType === 'modal' && description?.label !== undefined && description?.label !== "") && + {(description && description.descType === 'modal' && description.label !== undefined && description.label !== "") && { - Modal.success({ + Modal.info({ getContainer: () => document.getElementById('ccms-antd') || document.body, - content: description?.content, + content: (
{description.content}
), + okText: '知道了' }); }}> - {(description.showIcon) && ()} - {description?.label} + {(description.showIcon) && ()} + {description.label}
}
) } -} +} \ No newline at end of file -- Gitee From 3108eedb2c7cf03909747d3f4928bc94462abc83 Mon Sep 17 00:00:00 2001 From: "ext.pangzhaoqun1" Date: Thu, 17 Mar 2022 17:32:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/detail/detailInfo/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/detail/detailInfo/index.tsx b/src/components/detail/detailInfo/index.tsx index 7d9459e..6b3af5f 100644 --- a/src/components/detail/detailInfo/index.tsx +++ b/src/components/detail/detailInfo/index.tsx @@ -11,7 +11,7 @@ export default class InfoDetailComponent extends DetailInfoField { const { description } = props - + return (
{(description && description.descType === 'text' && description.label !== undefined && description.label !== "") && -- Gitee