From e4e0cf1de9c04644ebcf81116cbd3ba2eb4610ad Mon Sep 17 00:00:00 2001 From: LiuJiaNan <15703339975@163.com> Date: Wed, 24 Dec 2025 15:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E7=B3=BB=E5=88=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Cascader/Area/index.d.ts | 2 +- components/Cascader/Industry/index.d.ts | 2 +- components/FormBuilder/FormBuilder.d.ts | 4 +- components/FormBuilder/FormBuilder.js | 44 +- components/FormBuilder/FormItemsRenderer.d.ts | 6 +- components/HeaderBack/index.d.ts | 6 +- components/HeaderBack/index.js | 4 +- components/HeaderBack/index.less | 2 +- components/HiddenInfo/gwj/index.d.ts | 2 - components/HiddenInfo/gwj/index.js | 756 +++++++++--------- components/Map/MapSelector.js | 2 + components/Map/index.js | 2 + components/Page/index.d.ts | 30 + components/Page/index.js | 49 ++ components/Pdf/index.d.ts | 2 +- components/Pdf/index.js | 20 +- components/PreviewImg/index.js | 4 +- components/PreviewPdf/index.js | 2 + components/Search/index.js | 94 +-- components/Select/Personnel/Gwj/index.js | 2 +- components/SelectCreate/index.d.ts | 2 +- components/SelectCreate/index.js | 2 + components/Signature/index.d.ts | 4 +- components/Signature/index.js | 2 + components/Table/index.d.ts | 10 +- components/Table/index.js | 59 +- components/Table/index.less | 3 +- components/TooltipPreviewImg/index.js | 2 + components/Upload/index.d.ts | 2 +- components/Upload/index.js | 4 +- css/common.less | 31 + package.json | 1 + 32 files changed, 671 insertions(+), 486 deletions(-) create mode 100644 components/Page/index.d.ts create mode 100644 components/Page/index.js create mode 100644 css/common.less diff --git a/components/Cascader/Area/index.d.ts b/components/Cascader/Area/index.d.ts index 65af4fd..f788bd9 100644 --- a/components/Cascader/Area/index.d.ts +++ b/components/Cascader/Area/index.d.ts @@ -5,7 +5,7 @@ import type { BasicCascaderProps } from "../Basic"; * 组件属性 */ export interface AreaCascaderProps extends Omit { - /** 占位符,默认为"属地" */ + /** 占位符,默认 "属地" */ placeholder?: string; } diff --git a/components/Cascader/Industry/index.d.ts b/components/Cascader/Industry/index.d.ts index 7afa017..708b380 100644 --- a/components/Cascader/Industry/index.d.ts +++ b/components/Cascader/Industry/index.d.ts @@ -5,7 +5,7 @@ import type { BasicCascaderProps } from "../Basic"; * 组件属性 */ export interface IndustryCascaderProps extends Omit { - /** 占位符,默认为"行业类型" */ + /** 占位符,默认 "行业类型" */ placeholder?: string; } diff --git a/components/FormBuilder/FormBuilder.d.ts b/components/FormBuilder/FormBuilder.d.ts index 2b99d3c..a71b064 100644 --- a/components/FormBuilder/FormBuilder.d.ts +++ b/components/FormBuilder/FormBuilder.d.ts @@ -19,9 +19,9 @@ export interface FormBuilderProps extends FormProps { useAutoGenerateRequired?: boolean; /** 是否显示操作按钮区域,默认 true */ showActionButtons?: boolean; - /** 提交按钮文字,默认为"提交" */ + /** 提交按钮文字,默认 "提交" */ submitButtonText?: string; - /** 取消按钮文字,默认为"取消" */ + /** 取消按钮文字,默认 "取消" */ cancelButtonText?: string; /** 是否显示提交按钮,默认 true */ showSubmitButton?: boolean; diff --git a/components/FormBuilder/FormBuilder.js b/components/FormBuilder/FormBuilder.js index 8d30286..83d9f93 100644 --- a/components/FormBuilder/FormBuilder.js +++ b/components/FormBuilder/FormBuilder.js @@ -51,25 +51,31 @@ const FormBuilder = (props) => { /> {showActionButtons && ( - - - {customActionButtons || ( - - {showSubmitButton && ( - - )} - {extraActionButtons} - {showCancelButton && ( - - )} - - )} - - + <> +
+ + + {customActionButtons || ( + + {showSubmitButton && ( + + )} + {extraActionButtons} + {showCancelButton && ( + + )} + + )} + + + )} diff --git a/components/FormBuilder/FormItemsRenderer.d.ts b/components/FormBuilder/FormItemsRenderer.d.ts index 10f2ca8..8b98319 100644 --- a/components/FormBuilder/FormItemsRenderer.d.ts +++ b/components/FormBuilder/FormItemsRenderer.d.ts @@ -21,9 +21,9 @@ export interface OptionItem { * 字段键配置 */ export interface itemsFieldConfig { - /** 值字段的键名,默认为 'bianma' */ + /** 值字段的键名,默认 'bianma' */ valueKey?: string; - /** 标签字段的键名,默认为 'name' */ + /** 标签字段的键名,默认 'name' */ labelKey?: string | ((item: Record) => ReactNode); } @@ -106,7 +106,7 @@ export interface FormOption FormItemProps); /** label 栅格配置,默认直接使用外层的 labelCol,如果 span 等于 24,是外层的 labelCol.span 一半 */ labelCol?: ColProps; - /** wrapper 栅格配置,默认为 24 - labelCol.span */ + /** wrapper 栅格配置,默认 24 - labelCol.span */ wrapperCol?: ColProps; /** 是否应该更新(用于表单联动) */ shouldUpdate?: boolean | ((prevValues: FormValues, nextValues: FormValues, info: { source?: string }) => boolean); diff --git a/components/HeaderBack/index.d.ts b/components/HeaderBack/index.d.ts index e8c0c7a..d6d6079 100644 --- a/components/HeaderBack/index.d.ts +++ b/components/HeaderBack/index.d.ts @@ -1,4 +1,4 @@ -import type { CSSProperties, FC, ReactNode } from "react"; +import type { FC, ReactNode } from "react"; export interface HeaderBackProps { /** 标题 */ @@ -8,10 +8,8 @@ export interface HeaderBackProps { goBack?: () => void; [key: string]: any; }; - /** 是否显示返回按钮,默认为 true */ + /** 是否显示返回按钮,默认 true */ previous?: boolean; - /** 自定义样式 */ - style?: CSSProperties; } /** 头部返回组件 */ diff --git a/components/HeaderBack/index.js b/components/HeaderBack/index.js index 70e265d..93df5b6 100644 --- a/components/HeaderBack/index.js +++ b/components/HeaderBack/index.js @@ -6,10 +6,10 @@ import "./index.less"; * 头部返回组件 */ function HeaderBack(props) { - const { title, history, previous = true, style = {} } = props; + const { title, history, previous = true } = props; return ( -
+
{ previous diff --git a/components/HeaderBack/index.less b/components/HeaderBack/index.less index 79a8116..73024d2 100644 --- a/components/HeaderBack/index.less +++ b/components/HeaderBack/index.less @@ -1,7 +1,7 @@ .header-back { padding: 10px 20px; border-bottom: 1px solid #dcdfe6; - margin-bottom: 10px; + margin-bottom: 0; position: sticky; top: 0; background-color: #fff; diff --git a/components/HiddenInfo/gwj/index.d.ts b/components/HiddenInfo/gwj/index.d.ts index d51f292..243fb6b 100644 --- a/components/HiddenInfo/gwj/index.d.ts +++ b/components/HiddenInfo/gwj/index.d.ts @@ -12,8 +12,6 @@ export interface HiddenInfoProps { hiddenId?: string; /** hiddenId 的字段,默认 hiddenId */ hiddenIdKey?: string; - /** 是否显示头部的返回,默认 true */ - isShowHeaderBack?: boolean; /** 是否是过往记录,后端会返回详细的步骤信息,默认 false */ history?: boolean; /** 获取数据 */ diff --git a/components/HiddenInfo/gwj/index.js b/components/HiddenInfo/gwj/index.js index aa4040f..b46c6fb 100644 --- a/components/HiddenInfo/gwj/index.js +++ b/components/HiddenInfo/gwj/index.js @@ -8,7 +8,6 @@ import useDownloadFile from "../../../hooks/useDownloadFile"; import useGetFile from "../../../hooks/useGetFile"; import useGetUrlQuery from "../../../hooks/useGetUrlQuery"; import { getFileName, getFileSuffix, getLabelName } from "../../../utils"; -import HeaderBack from "../../HeaderBack"; import VideoIcon from "../../Icon/VideoIcon"; import PreviewImg from "../../PreviewImg"; import PreviewPdf from "../../PreviewPdf"; @@ -23,7 +22,6 @@ function HiddenInfo(props) { idKey = "id", hiddenId = "", hiddenIdKey = "hiddenId", - isShowHeaderBack = true, history = false, onGetData, } = props; @@ -116,386 +114,390 @@ function HiddenInfo(props) { return (
- {isShowHeaderBack && } -
- 隐患信息 - 0) - ? [ - { label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints }, - { label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations }, - { label: "存在风险", children: info.hiddenCheckListCO.existingRisks }, - { label: "风险分级", children: info.hiddenCheckListCO.riskLevel }, - { label: "隐患清单", children: info.hiddenCheckListCO.listName }, - { label: "检查内容", children: info.hiddenCheckListCO.inspectionContent }, - ] - : [] - ), - ...(info.longitude ? [{ - label: "隐患上报位置(经纬度)", - children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "), - }] : []), - ...(info.positionDesc ? [{ label: "隐患位置描述", children: info.positionDesc }] : []), - { label: "隐患发现人", children: info.creatorName }, - { label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") }, - { - label: "整改类型", - children: getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: info.rectificationType }), - }, - { - label: "是否相关方", - children: getLabelName({ - list: [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }], - status: info.isRelated, - }), - }, - ...(info.isRelated === 1 ? [{ label:'相关方项目',children:info.projectName }] : []), - { label: "隐患图片", children: }, - ...(hiddenVideoFiles.length > 0 - ? [{ - label: "隐患视频", - children: ( - { - setVideoModalOpen(true); - }} - /> - ), - }] - : []), - ]} - /> - { - (info.hiddenUserPresetsCO && Object.keys(info.hiddenUserPresetsCO).length > 0) && ( - <> - 整改信息(发现人预填) - - - ) - } - { - (info.hiddenConfirmUserCO && info.hiddenConfirmUserCO.length > 0) && ( - <> - 隐患确认 - { - info.hiddenConfirmUserCO.map(item => ( - - )) - } - - ) - } - { - info.hiddenExtensionList && info.hiddenExtensionList.length > 0 && ( - <> - 延期信息 - { - info.hiddenExtensionList.map(item => ( - - : ( - - {getFileName(item.disposalFile)} - - - ) - ), - }] : []), - ] - : []), - { - label: "延期审核状态", - children: ( - <> - {item.state === 1 && 待审核} - {item.state === 2 && 审批中} - {item.state === 3 && 已通过} - {item.state === 4 && 已拒绝} - {item.state === 5 && 已撤回} - - ), - }, - ...((item.state === 3 || item.state === 4) - ? [{ - label: "延期审核时间", - children: item.updateTime, - }] - : []), - ]} + 隐患信息 + 0) + ? [ + { label: "风险点(单元)", children: info.hiddenCheckListCO.listRiskPoints }, + { label: "辨识部位", children: info.hiddenCheckListCO.identifiedLocations }, + { label: "存在风险", children: info.hiddenCheckListCO.existingRisks }, + { label: "风险分级", children: info.hiddenCheckListCO.riskLevel }, + { label: "隐患清单", children: info.hiddenCheckListCO.listName }, + { label: "检查内容", children: info.hiddenCheckListCO.inspectionContent }, + ] + : [] + ), + ...(info.longitude + ? [{ + label: "隐患上报位置(经纬度)", + children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "), + }] + : []), + ...(info.positionDesc ? [{ label: "隐患位置描述", children: info.positionDesc }] : []), + { label: "隐患发现人", children: info.creatorName }, + { label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") }, + { + label: "整改类型", + children: getLabelName({ list: HIDDEN_RECTIFICATION_TYPE_ENUM, status: info.rectificationType }), + }, + { + label: "是否相关方", + children: getLabelName({ + list: [{ bianma: "1", name: "是" }, { bianma: "0", name: "否" }], + status: info.isRelated, + }), + }, + ...(info.isRelated === 1 ? [{ label: "相关方项目", children: info.projectName }] : []), + { label: "隐患图片", children: }, + ...(hiddenVideoFiles.length > 0 + ? [{ + label: "隐患视频", + children: ( + { + setVideoModalOpen(true); + }} /> ), - ) - } - - ) - } - { - info.hiddenSpecialList && info.hiddenSpecialList.length > 0 && ( - <> - 特殊处置审核信息 - { - info.hiddenSpecialList.map(item => ( - - : ( - - {getFileName(item.disposalFile)} - - - ) - ), - }] : []), - { - label: "是否更换整改负责人", - children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否", - }, - ...( - item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 - ? [{ label: "整改负责人", children: item.rectifyUserCO.userName }] - : []), - ] - : []), + }] + : []), + ]} + /> + { + (info.hiddenUserPresetsCO && Object.keys(info.hiddenUserPresetsCO).length > 0) && ( + <> + 整改信息(发现人预填) + - {item.state === 1 && 待审核} - {item.state === 2 && 审批中} - {item.state === 3 && 已通过} - {item.state === 4 && 已拒绝} - {item.state === 5 && 已撤回} - - ), + label: "整改期限", + children: dayjs(info.hiddenUserPresetsCO.rectifyDeadline).format("YYYY-MM-DD"), }, - ]} - /> - ), - ) - } - - ) - } - { - (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) && ( - <> - 整改信息 - { - info.hiddenRectifyUserCO.map((item, index) => ( - }, + ] + : []), + ...(info.rectificationType === 1 + ? [ + { label: "验收部门", children: info.hiddenUserPresetsCO.checkDeptName }, + { label: "验收人", children: info.hiddenUserPresetsCO.checkUserName }, + ] + : []), + ]} + /> + + ) + } + { + (info.hiddenConfirmUserCO && info.hiddenConfirmUserCO.length > 0) && ( + <> + 隐患确认 + { + info.hiddenConfirmUserCO.map(item => ( + + )) + } + + ) + } + { + info.hiddenExtensionList && info.hiddenExtensionList.length > 0 && ( + <> + 延期信息 + { + info.hiddenExtensionList.map(item => ( + + : ( + + {getFileName(item.disposalFile)} + + + ) + ), + }] + : []), + ] + : []), + { + label: "延期审核状态", + children: ( + <> + {item.state === 1 && 待审核} + {item.state === 2 && 审批中} + {item.state === 3 && 已通过} + {item.state === 4 && 已拒绝} + {item.state === 5 && 已撤回} + + ), + }, + ...((item.state === 3 || item.state === 4) + ? [{ + label: "延期审核时间", + children: item.updateTime, + }] + : []), + ]} + /> + ), + ) + } + + ) + } + { + info.hiddenSpecialList && info.hiddenSpecialList.length > 0 && ( + <> + 特殊处置审核信息 + { + info.hiddenSpecialList.map(item => ( + + : ( + + {getFileName(item.disposalFile)} + + + ) + ), + }] + : []), + { + label: "是否更换整改负责人", + children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否", + }, + ...( + item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 + ? [{ label: "整改负责人", children: item.rectifyUserCO.userName }] + : []), + ] + : []), + { + label: "特殊处置审核状态", + children: ( + <> + {item.state === 1 && 待审核} + {item.state === 2 && 审批中} + {item.state === 3 && 已通过} + {item.state === 4 && 已拒绝} + {item.state === 5 && 已撤回} + + ), + }, + ]} + /> + ), + ) + } + + ) + } + { + (info.hiddenRectifyUserCO && info.hiddenRectifyUserCO.length > 0) && ( + <> + 整改信息 + { + info.hiddenRectifyUserCO.map((item, index) => ( + }, + { + label: "整改方案", + children: ( + <> + {item.isRectificationScheme === 0 && } + {item.isRectificationScheme === 1 && } + + ), + }, + ...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0) + ? [ + { label: "治理标准", children: item.hiddenSchemeCO.governStanDards }, + { label: "治理方法", children: item.hiddenSchemeCO.governMethod }, + { label: "经费落实", children: item.hiddenSchemeCO.expenditure }, + { label: "负责人员", children: item.hiddenSchemeCO.principal }, + { label: "工时安排", children: item.hiddenSchemeCO.programming }, + { label: "时限要求", children: item.hiddenSchemeCO.timeLimitFor }, + { label: "工作要求", children: item.hiddenSchemeCO.jobRequireMent }, + { label: "其他事项", children: item.hiddenSchemeCO.otherBusiness }, + { label: "方案图片", children: }, + ] + : []), + ]} + /> + )) + } + + ) + } + { + (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0) + ? ( + info.isQualified === 1 + ? ( + <> + 验收信息 { - label: "整改方案", children: ( - <> - {item.isRectificationScheme === 0 && } - {item.isRectificationScheme === 1 && } - - ) - }, - ...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0) - ? [ - { label: "治理标准", children: item.hiddenSchemeCO.governStanDards }, - { label: "治理方法", children: item.hiddenSchemeCO.governMethod }, - { label: "经费落实", children: item.hiddenSchemeCO.expenditure }, - { label: "负责人员", children: item.hiddenSchemeCO.principal }, - { label: "工时安排", children: item.hiddenSchemeCO.programming }, - { label: "时限要求", children: item.hiddenSchemeCO.timeLimitFor }, - { label: "工作要求", children: item.hiddenSchemeCO.jobRequireMent }, - { label: "其他事项", children: item.hiddenSchemeCO.otherBusiness }, - { label: "方案图片", children: }, - ] - : []), - ]} - /> - )) - } - - ) - } - { - (info.hiddenAcceptUserCO && info.hiddenAcceptUserCO.length > 0) - ? ( - info.isQualified === 1 - ? ( - <> - 验收信息 - { - info.hiddenAcceptUserCO.map((item, index) => ( - 0) ? [{ label: "验收图片", children: }] : []), - ]} - /> - )) - } - - ) - : ( - <> - 验收打回信息 - { - info.hiddenAcceptUserCO.map(item => ( - - )) - } - - ) - ) - : null - } - { - (info.hiddenInspecCO && Object.keys(info.hiddenInspecCO).length > 0) - ? ( - <> - 安全环保验收信息 - }, - ]} - /> - - ) - : null - } -
+ info.hiddenAcceptUserCO.map((item, index) => ( + 0) ? [{ label: "验收图片", children: }] : []), + ]} + /> + )) + } + + ) + : ( + <> + 验收打回信息 + { + info.hiddenAcceptUserCO.map(item => ( + + )) + } + + ) + ) + : null + } + { + (info.hiddenInspecCO && Object.keys(info.hiddenInspecCO).length > 0) + ? ( + <> + 安全环保验收信息 + }, + ]} + /> + + ) + : null + }
{ videoModalOpen && ( @@ -511,4 +513,6 @@ function HiddenInfo(props) { ); } +HiddenInfo.displayName = "HiddenInfo"; + export default HiddenInfo; diff --git a/components/Map/MapSelector.js b/components/Map/MapSelector.js index 3dcd4d7..d2dd01b 100644 --- a/components/Map/MapSelector.js +++ b/components/Map/MapSelector.js @@ -249,4 +249,6 @@ const MapSelector = (props) => { ); }; +MapSelector.displayName = "MapSelector"; + export default MapSelector; diff --git a/components/Map/index.js b/components/Map/index.js index 27c4990..9f9223c 100644 --- a/components/Map/index.js +++ b/components/Map/index.js @@ -72,4 +72,6 @@ const Map = (props) => { ); }; +Map.displayName = "Map"; + export default Map; diff --git a/components/Page/index.d.ts b/components/Page/index.d.ts new file mode 100644 index 0000000..1002f57 --- /dev/null +++ b/components/Page/index.d.ts @@ -0,0 +1,30 @@ +import type { FC, ReactNode } from "react"; + +export interface PageProps { + /** 头部返回组件的标题 */ + headerTitle?: ReactNode; + /** 历史记录对象,用于返回上一页,默认使用 window.history.back */ + history?: { + goBack?: () => void; + [key: string]: any; + }; + /** 是否显示头部组件,默认 true */ + isShowHeader?: boolean; + /** 是否显示头部组件返回按钮,默认 true */ + headerPrevious?: boolean; + /** 是否显示底部组件,默认 true */ + isShowFooter?: boolean; + /** 是否显示头部和底部组件,默认 true */ + isShowAllAction?: boolean; + /** 取消按钮文字,默认 "关闭" */ + backButtonText?: string; + /** 自定义底部操作按钮组 */ + customActionButtons?: ReactNode; + /** 额外底部操作按钮组 */ + extraActionButtons?: ReactNode; +} + +/** 页面布局组件 */ +declare const Page: FC; + +export default Page; diff --git a/components/Page/index.js b/components/Page/index.js new file mode 100644 index 0000000..0f82295 --- /dev/null +++ b/components/Page/index.js @@ -0,0 +1,49 @@ +import { Button, Space } from "antd"; +import HeaderBack from "../HeaderBack"; + +/** + * 页面布局组件 + */ +function Page(props) { + const { + headerTitle, + history, + isShowHeader = true, + headerPrevious = true, + isShowFooter = true, + isShowAllAction = true, + backButtonText = "关闭", + customActionButtons, + extraActionButtons, + } = props; + + return ( +
+ {(isShowAllAction && isShowHeader) && } +
+ {props.children} +
+ { + (isShowAllAction && isShowFooter) && ( + <> +
+
+ {customActionButtons || ( + + {extraActionButtons} + + + )} +
+ + ) + } +
+ ); +} + +Page.displayName = "Page"; + +export default Page; diff --git a/components/Pdf/index.d.ts b/components/Pdf/index.d.ts index 0d23d75..5f98608 100644 --- a/components/Pdf/index.d.ts +++ b/components/Pdf/index.d.ts @@ -9,7 +9,7 @@ export interface PdfProps { visible?: boolean; /** 关闭弹窗的方法 */ onCancel?: () => void; - /** 是否使用内联模式,true为不使用弹窗,默认为false */ + /** 是否使用内联模式,true为不使用弹窗,默认 false */ inline?: boolean; /** 内联模式下的样式 */ style?: CSSProperties; diff --git a/components/Pdf/index.js b/components/Pdf/index.js index 3dae089..86ae661 100644 --- a/components/Pdf/index.js +++ b/components/Pdf/index.js @@ -110,14 +110,16 @@ function Pdf(props) { > 关闭 , - !loading && , + !loading && ( + + ), , ]} > @@ -127,4 +129,6 @@ function Pdf(props) { ); } +Pdf.displayName = "Pdf"; + export default Pdf; diff --git a/components/PreviewImg/index.js b/components/PreviewImg/index.js index d284c73..2b4d10a 100644 --- a/components/PreviewImg/index.js +++ b/components/PreviewImg/index.js @@ -12,7 +12,7 @@ const PreviewImg = (props) => { return ( { - files.filter(Boolean).map((item) => ( + files.filter(Boolean).map(item => ( { ); }; +PreviewImg.displayName = "PreviewImg"; + export default PreviewImg; diff --git a/components/PreviewPdf/index.js b/components/PreviewPdf/index.js index 085bdd9..b053095 100644 --- a/components/PreviewPdf/index.js +++ b/components/PreviewPdf/index.js @@ -81,4 +81,6 @@ const PreviewPdf = (props) => { return null; }; +PreviewPdf.displayName = "PreviewPdf"; + export default PreviewPdf; diff --git a/components/Search/index.js b/components/Search/index.js index df4a754..d88ad12 100644 --- a/components/Search/index.js +++ b/components/Search/index.js @@ -83,54 +83,56 @@ const Search = (props) => { }; return ( -
- - - - - {showSearchButton && ( - - )} - {showResetButton && ( - - )} - {showCollapseButton && ( - - )} - - - {extraButtons && ( - - - {extraButtons} +
+ + + + + + {showSearchButton && ( + + )} + {showResetButton && ( + + )} + {showCollapseButton && ( + + )} - )} - - + {extraButtons && ( + + + {extraButtons} + + + )} + + +
); }; diff --git a/components/Select/Personnel/Gwj/index.js b/components/Select/Personnel/Gwj/index.js index e6920cc..28555dc 100644 --- a/components/Select/Personnel/Gwj/index.js +++ b/components/Select/Personnel/Gwj/index.js @@ -12,7 +12,7 @@ function PersonnelSelect(props) { isNeedCorpInfoId = false, isNeedDepartmentId = true, isNeedPostId = false, - extraParams= { + extraParams = { noMain: "", eqEmploymentFlag: 1, }, diff --git a/components/SelectCreate/index.d.ts b/components/SelectCreate/index.d.ts index c4734e6..eb5e7c5 100644 --- a/components/SelectCreate/index.d.ts +++ b/components/SelectCreate/index.d.ts @@ -13,7 +13,7 @@ export interface SelectCreateOption { export interface SelectCreateProps extends SelectProps { /** 选项列表 */ items: SelectCreateOption[]; - /** 是否显示删除图标,默认为 true */ + /** 是否显示删除图标,默认 true */ showDelete?: boolean; /** 标签名称,用于占位符显示 */ label?: string; diff --git a/components/SelectCreate/index.js b/components/SelectCreate/index.js index 6f6fbaa..ea3ca29 100644 --- a/components/SelectCreate/index.js +++ b/components/SelectCreate/index.js @@ -50,4 +50,6 @@ function SelectCreate(props) { ); } +SelectCreate.displayName = "SelectCreate"; + export default SelectCreate; diff --git a/components/Signature/index.d.ts b/components/Signature/index.d.ts index cae62af..ce28c2f 100644 --- a/components/Signature/index.d.ts +++ b/components/Signature/index.d.ts @@ -12,9 +12,9 @@ export interface SignatureValue { export interface SignatureProps { /** 确认签字回调 */ onConfirm: (value: SignatureValue) => void; - /** 签字区域宽度,默认为 752 */ + /** 签字区域宽度,默认 752 */ width?: number; - /** 签字区域高度,默认为 300 */ + /** 签字区域高度,默认 300 */ height?: number; /** 回显的签字图片 */ url?: string; diff --git a/components/Signature/index.js b/components/Signature/index.js index 29e7614..ff1ecef 100644 --- a/components/Signature/index.js +++ b/components/Signature/index.js @@ -89,4 +89,6 @@ function Signature(props) { ); } +Signature.displayName = "Signature"; + export default Signature; diff --git a/components/Table/index.d.ts b/components/Table/index.d.ts index 5d096d3..29a17fd 100644 --- a/components/Table/index.d.ts +++ b/components/Table/index.d.ts @@ -5,7 +5,7 @@ import type { FC } from "react"; /** * TablePro 组件属性 */ -export type TableProps = Omit & ProTableProps & { +export type TableProps = Omit & ProTableProps & { /** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */ storeIndex?: string; /** 是否禁用内容区滚动,默认 false */ @@ -14,9 +14,11 @@ export type TableProps = Omit= CLEANUP_INTERVAL_DAYS) { + // 查找并清理符合条件的key + const keysToRemove = []; + for (let i = 0; i < localStorage.length; i++) { + const key = localStorage.key(i); + if (key && (key.endsWith('#columnState') || + key.endsWith('#size') || + key.endsWith('#resizable'))) { + keysToRemove.push(key); + } + } + + // 删除匹配的key + keysToRemove.forEach(key => { + localStorage.removeItem(key); + }); + + // 更新最后清理时间 + localStorage.setItem(LAST_CLEANUP_KEY, now.toISOString()); + } +} + function Table(props) { const { columns = [], showIndexColumn = true, - useAlignCenter = true, + ellipsis = true, + align = "center", indexColumnFixed = "left", rowKey = "id", ...restProps } = props; - function calcColumns() { - showIndexColumn && columns.unshift({...getIndexColumn(props.pagination), fixed: indexColumnFixed}); - const setAlign = (column) => ({ - align: useAlignCenter ? "center" : "left", + // 组件初始化时执行清理 + cleanupTableLocalStorage(); + + function settingColumns() { + showIndexColumn && columns.unshift({ ...getIndexColumn(props.pagination), fixed: indexColumnFixed }); + + const setAlign = column => ({ + align, + ellipsis, ...column, - ...(column.children ? { children: column.children.map(setAlign) } : {}) + ...(column.children ? { children: column.children.map(setAlign) } : {}), }); return columns.map(setAlign); } - return ; + return ( +
+ +
+ ); } +Table.displayName = "Table"; + export default Table; diff --git a/components/Table/index.less b/components/Table/index.less index 748d664..d1adc46 100644 --- a/components/Table/index.less +++ b/components/Table/index.less @@ -9,5 +9,6 @@ } .@{ant-prefix}-pro-table-list-toolbar-container { - padding-block: 16px !important; + padding-top: 26px !important; + padding-bottom: 16px; } diff --git a/components/TooltipPreviewImg/index.js b/components/TooltipPreviewImg/index.js index 20832fe..07bf796 100644 --- a/components/TooltipPreviewImg/index.js +++ b/components/TooltipPreviewImg/index.js @@ -22,4 +22,6 @@ const TooltipPreviewImg = (props) => { ); }; +TooltipPreviewImg.displayName = "TooltipPreviewImg"; + export default TooltipPreviewImg; diff --git a/components/Upload/index.d.ts b/components/Upload/index.d.ts index 768e9a9..dacc23a 100644 --- a/components/Upload/index.d.ts +++ b/components/Upload/index.d.ts @@ -17,7 +17,7 @@ export interface UploadProps extends Omit { tipContent?: ReactNode; /** listType 为 text 时上传按钮文本 */ uploadButtonText?: string; - /** 要上传的文件类型,默认为 image */ + /** 要上传的文件类型,默认 image */ fileType?: "image" | "video" | "document"; /** 获取上传过服务器删除的附件 */ onGetRemoveFile?: (file: Omit) => void; diff --git a/components/Upload/index.js b/components/Upload/index.js index 5256c0c..b371bbf 100644 --- a/components/Upload/index.js +++ b/components/Upload/index.js @@ -132,7 +132,7 @@ const Upload = (props) => { const handleBeforeUpload = (file, fileList) => { if (beforeUpload) - return beforeUpload(file, fileList) + return beforeUpload(file, fileList); return false; }; @@ -196,7 +196,7 @@ const Upload = (props) => { if (!file.originFileObj) onGetRemoveFile?.(file); return onRemove?.(file); - } + }; // 预览文件 const handlePreview = (file) => { diff --git a/css/common.less b/css/common.less new file mode 100644 index 0000000..3928ae3 --- /dev/null +++ b/css/common.less @@ -0,0 +1,31 @@ +.@{ant-prefix}-modal-header { + border-bottom: 1px solid #ccc !important; + margin: 0 -24px 15px -24px !important; + padding: 0 24px 15px 24px !important; +} + +.@{ant-prefix}-modal-footer { + text-align: center !important; +} + +.search-layout { + position: relative; + + &::after { + content: ''; + position: absolute; + bottom: -10px; + left: -20px; + right: -20px; + height: 10px; + background-color: rgb(241, 241, 242); + } +} + +.table-layout { +} + +.card-layout { + background-color: #fff; + border-radius: 6px; +} diff --git a/package.json b/package.json index d3cce22..0de7686 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "license": "MIT", "files": [ "components", + "css", "enum", "hooks", "json",