一系列优化

master
LiuJiaNan 2025-12-24 15:45:07 +08:00
parent 74c64385fe
commit e4e0cf1de9
32 changed files with 671 additions and 486 deletions

View File

@ -5,7 +5,7 @@ import type { BasicCascaderProps } from "../Basic";
* *
*/ */
export interface AreaCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface AreaCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> {
/** 占位符,默认"属地" */ /** 占位符,默认 "属地" */
placeholder?: string; placeholder?: string;
} }

View File

@ -5,7 +5,7 @@ import type { BasicCascaderProps } from "../Basic";
* *
*/ */
export interface IndustryCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> { export interface IndustryCascaderProps extends Omit<BasicCascaderProps, "options" | "placeholder" | "nameKey" | "idKey" | "childrenKey"> {
/** 占位符,默认"行业类型" */ /** 占位符,默认 "行业类型" */
placeholder?: string; placeholder?: string;
} }

View File

@ -19,9 +19,9 @@ export interface FormBuilderProps extends FormProps {
useAutoGenerateRequired?: boolean; useAutoGenerateRequired?: boolean;
/** 是否显示操作按钮区域,默认 true */ /** 是否显示操作按钮区域,默认 true */
showActionButtons?: boolean; showActionButtons?: boolean;
/** 提交按钮文字,默认"提交" */ /** 提交按钮文字,默认 "提交" */
submitButtonText?: string; submitButtonText?: string;
/** 取消按钮文字,默认"取消" */ /** 取消按钮文字,默认 "取消" */
cancelButtonText?: string; cancelButtonText?: string;
/** 是否显示提交按钮,默认 true */ /** 是否显示提交按钮,默认 true */
showSubmitButton?: boolean; showSubmitButton?: boolean;

View File

@ -51,7 +51,12 @@ const FormBuilder = (props) => {
/> />
</Row> </Row>
{showActionButtons && ( {showActionButtons && (
<Row gutter={gutter} style={{ marginTop: 24 }}> <>
<div style={{ height: "52px" }}></div>
<Row
gutter={gutter}
style={{ textAlign: "center", backgroundColor: "rgb(241, 241, 242)", margin: "0px -44px", padding: "10px 0", position: "fixed", bottom: "0", width: "100%" }}
>
<Col span={24} style={{ textAlign: "center" }}> <Col span={24} style={{ textAlign: "center" }}>
{customActionButtons || ( {customActionButtons || (
<Space> <Space>
@ -70,6 +75,7 @@ const FormBuilder = (props) => {
)} )}
</Col> </Col>
</Row> </Row>
</>
)} )}
</Form> </Form>
</Spin> </Spin>

View File

@ -21,9 +21,9 @@ export interface OptionItem {
* *
*/ */
export interface itemsFieldConfig { export interface itemsFieldConfig {
/** 值字段的键名,默认 'bianma' */ /** 值字段的键名,默认 'bianma' */
valueKey?: string; valueKey?: string;
/** 标签字段的键名,默认 'name' */ /** 标签字段的键名,默认 'name' */
labelKey?: string | ((item: Record<string, any>) => ReactNode); labelKey?: string | ((item: Record<string, any>) => ReactNode);
} }
@ -106,7 +106,7 @@ export interface FormOption<T extends keyof FORM_ITEM_RENDER_TYPE_MAP = keyof FO
formItemProps?: FormItemProps | ((formValues: FormValues) => FormItemProps); formItemProps?: FormItemProps | ((formValues: FormValues) => FormItemProps);
/** label 栅格配置,默认直接使用外层的 labelCol如果 span 等于 24是外层的 labelCol.span 一半 */ /** label 栅格配置,默认直接使用外层的 labelCol如果 span 等于 24是外层的 labelCol.span 一半 */
labelCol?: ColProps; labelCol?: ColProps;
/** wrapper 栅格配置,默认 24 - labelCol.span */ /** wrapper 栅格配置,默认 24 - labelCol.span */
wrapperCol?: ColProps; wrapperCol?: ColProps;
/** 是否应该更新(用于表单联动) */ /** 是否应该更新(用于表单联动) */
shouldUpdate?: boolean | ((prevValues: FormValues, nextValues: FormValues, info: { source?: string }) => boolean); shouldUpdate?: boolean | ((prevValues: FormValues, nextValues: FormValues, info: { source?: string }) => boolean);

View File

@ -1,4 +1,4 @@
import type { CSSProperties, FC, ReactNode } from "react"; import type { FC, ReactNode } from "react";
export interface HeaderBackProps { export interface HeaderBackProps {
/** 标题 */ /** 标题 */
@ -8,10 +8,8 @@ export interface HeaderBackProps {
goBack?: () => void; goBack?: () => void;
[key: string]: any; [key: string]: any;
}; };
/** 是否显示返回按钮,默认 true */ /** 是否显示返回按钮,默认 true */
previous?: boolean; previous?: boolean;
/** 自定义样式 */
style?: CSSProperties;
} }
/** 头部返回组件 */ /** 头部返回组件 */

View File

@ -6,10 +6,10 @@ import "./index.less";
* 头部返回组件 * 头部返回组件
*/ */
function HeaderBack(props) { function HeaderBack(props) {
const { title, history, previous = true, style = {} } = props; const { title, history, previous = true } = props;
return ( return (
<div className="header-back" style={style}> <div className="header-back">
<div className="action"> <div className="action">
{ {
previous previous

View File

@ -1,7 +1,7 @@
.header-back { .header-back {
padding: 10px 20px; padding: 10px 20px;
border-bottom: 1px solid #dcdfe6; border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px; margin-bottom: 0;
position: sticky; position: sticky;
top: 0; top: 0;
background-color: #fff; background-color: #fff;

View File

@ -12,8 +12,6 @@ export interface HiddenInfoProps {
hiddenId?: string; hiddenId?: string;
/** hiddenId 的字段,默认 hiddenId */ /** hiddenId 的字段,默认 hiddenId */
hiddenIdKey?: string; hiddenIdKey?: string;
/** 是否显示头部的返回,默认 true */
isShowHeaderBack?: boolean;
/** 是否是过往记录,后端会返回详细的步骤信息,默认 false */ /** 是否是过往记录,后端会返回详细的步骤信息,默认 false */
history?: boolean; history?: boolean;
/** 获取数据 */ /** 获取数据 */

View File

@ -8,7 +8,6 @@ import useDownloadFile from "../../../hooks/useDownloadFile";
import useGetFile from "../../../hooks/useGetFile"; import useGetFile from "../../../hooks/useGetFile";
import useGetUrlQuery from "../../../hooks/useGetUrlQuery"; import useGetUrlQuery from "../../../hooks/useGetUrlQuery";
import { getFileName, getFileSuffix, getLabelName } from "../../../utils"; import { getFileName, getFileSuffix, getLabelName } from "../../../utils";
import HeaderBack from "../../HeaderBack";
import VideoIcon from "../../Icon/VideoIcon"; import VideoIcon from "../../Icon/VideoIcon";
import PreviewImg from "../../PreviewImg"; import PreviewImg from "../../PreviewImg";
import PreviewPdf from "../../PreviewPdf"; import PreviewPdf from "../../PreviewPdf";
@ -23,7 +22,6 @@ function HiddenInfo(props) {
idKey = "id", idKey = "id",
hiddenId = "", hiddenId = "",
hiddenIdKey = "hiddenId", hiddenIdKey = "hiddenId",
isShowHeaderBack = true,
history = false, history = false,
onGetData, onGetData,
} = props; } = props;
@ -116,9 +114,7 @@ function HiddenInfo(props) {
return ( return (
<div> <div>
{isShowHeaderBack && <HeaderBack title="查看" />}
<Spin spinning={loading || downloadFileLoading}> <Spin spinning={loading || downloadFileLoading}>
<div style={{ padding: 20 }}>
<Divider orientation="left">隐患信息</Divider> <Divider orientation="left">隐患信息</Divider>
<Descriptions <Descriptions
bordered bordered
@ -143,10 +139,12 @@ function HiddenInfo(props) {
] ]
: [] : []
), ),
...(info.longitude ? [{ ...(info.longitude
? [{
label: "隐患上报位置(经纬度)", label: "隐患上报位置(经纬度)",
children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "), children: [info.longitude && `经度:${info.longitude}`, info.latitude && `纬度:${info.latitude}`].filter(Boolean).join(" "),
}] : []), }]
: []),
...(info.positionDesc ? [{ label: "隐患位置描述", children: info.positionDesc }] : []), ...(info.positionDesc ? [{ label: "隐患位置描述", children: info.positionDesc }] : []),
{ label: "隐患发现人", children: info.creatorName }, { label: "隐患发现人", children: info.creatorName },
{ label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") }, { label: "隐患发现时间", children: dayjs(info.hiddenFindTime).format("YYYY-MM-DD HH:mm:ss") },
@ -161,7 +159,7 @@ function HiddenInfo(props) {
status: info.isRelated, status: info.isRelated,
}), }),
}, },
...(info.isRelated === 1 ? [{ label:'相关方项目',children:info.projectName }] : []), ...(info.isRelated === 1 ? [{ label: "相关方项目", children: info.projectName }] : []),
{ label: "隐患图片", children: <PreviewImg files={hiddenImageFiles} /> }, { label: "隐患图片", children: <PreviewImg files={hiddenImageFiles} /> },
...(hiddenVideoFiles.length > 0 ...(hiddenVideoFiles.length > 0
? [{ ? [{
@ -257,7 +255,8 @@ function HiddenInfo(props) {
...(item.state === 3 ...(item.state === 3
? [ ? [
...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []), ...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []),
...(item.disposalFile ? [{ ...(item.disposalFile
? [{
label: "处置方案附件", label: "处置方案附件",
children: ( children: (
getFileSuffix(item.disposalFile) === "pdf" getFileSuffix(item.disposalFile) === "pdf"
@ -275,7 +274,8 @@ function HiddenInfo(props) {
</Space> </Space>
) )
), ),
}] : []), }]
: []),
] ]
: []), : []),
{ {
@ -326,7 +326,8 @@ function HiddenInfo(props) {
...(item.state === 3 ...(item.state === 3
? [ ? [
...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []), ...(item.disposalPlan ? [{ label: "处置方案", children: item.disposalPlan }] : []),
...(item.disposalFile ? [{ ...(item.disposalFile
? [{
label: "处置方案附件", label: "处置方案附件",
children: ( children: (
getFileSuffix(item.disposalFile) === "pdf" getFileSuffix(item.disposalFile) === "pdf"
@ -344,7 +345,8 @@ function HiddenInfo(props) {
</Space> </Space>
) )
), ),
}] : []), }]
: []),
{ {
label: "是否更换整改负责人", label: "是否更换整改负责人",
children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否", children: item.rectifyUserCO && Object.keys(item.rectifyUserCO).length > 0 ? "是" : "否",
@ -395,12 +397,13 @@ function HiddenInfo(props) {
...(info.tempSafeMeasure ? [{ label: "临时安全措施", children: info.tempSafeMeasure }] : []), ...(info.tempSafeMeasure ? [{ label: "临时安全措施", children: info.tempSafeMeasure }] : []),
{ label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> }, { label: "整改后图片", children: <PreviewImg files={afterRectificationImageFiles[index]} /> },
{ {
label: "整改方案", children: ( label: "整改方案",
children: (
<> <>
{item.isRectificationScheme === 0 && <span></span>} {item.isRectificationScheme === 0 && <span></span>}
{item.isRectificationScheme === 1 && <span></span>} {item.isRectificationScheme === 1 && <span></span>}
</> </>
) ),
}, },
...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0) ...((item.isRectificationScheme === 1 && item.hiddenSchemeCO && Object.keys(item.hiddenSchemeCO).length > 0)
? [ ? [
@ -495,7 +498,6 @@ function HiddenInfo(props) {
) )
: null : null
} }
</div>
</Spin> </Spin>
{ {
videoModalOpen && ( videoModalOpen && (
@ -511,4 +513,6 @@ function HiddenInfo(props) {
); );
} }
HiddenInfo.displayName = "HiddenInfo";
export default HiddenInfo; export default HiddenInfo;

View File

@ -249,4 +249,6 @@ const MapSelector = (props) => {
); );
}; };
MapSelector.displayName = "MapSelector";
export default MapSelector; export default MapSelector;

View File

@ -72,4 +72,6 @@ const Map = (props) => {
); );
}; };
Map.displayName = "Map";
export default Map; export default Map;

30
components/Page/index.d.ts vendored Normal file
View File

@ -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<PageProps>;
export default Page;

49
components/Page/index.js Normal file
View File

@ -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 (
<div className="page">
{(isShowAllAction && isShowHeader) && <HeaderBack title={headerTitle} history={history} previous={headerPrevious} />}
<div style={{ padding: 20 }}>
{props.children}
</div>
{
(isShowAllAction && isShowFooter) && (
<>
<div style={{ height: "52px" }}></div>
<div style={{ textAlign: "center", backgroundColor: "rgb(241, 241, 242)", margin: "0 -20px", padding: "10px 0", position: "fixed", bottom: "0", width: "100%" }}>
{customActionButtons || (
<Space>
{extraActionButtons}
<Button onClick={() => history?.goBack?.() || window.history.back()}>
{backButtonText}
</Button>
</Space>
)}
</div>
</>
)
}
</div>
);
}
Page.displayName = "Page";
export default Page;

View File

@ -9,7 +9,7 @@ export interface PdfProps {
visible?: boolean; visible?: boolean;
/** 关闭弹窗的方法 */ /** 关闭弹窗的方法 */
onCancel?: () => void; onCancel?: () => void;
/** 是否使用内联模式true为不使用弹窗默认false */ /** 是否使用内联模式true为不使用弹窗默认 false */
inline?: boolean; inline?: boolean;
/** 内联模式下的样式 */ /** 内联模式下的样式 */
style?: CSSProperties; style?: CSSProperties;

View File

@ -110,14 +110,16 @@ function Pdf(props) {
> >
关闭 关闭
</Button>, </Button>,
!loading && <Button !loading && (
<Button
key="fullScreen" key="fullScreen"
onClick={() => { onClick={() => {
isFullscreen ? exitFullscreen() : enterFullscreen(); isFullscreen ? exitFullscreen() : enterFullscreen();
}} }}
> >
{isFullscreen ? "退出全屏" : "全屏"} {isFullscreen ? "退出全屏" : "全屏"}
</Button>, </Button>
),
<Button key="download" type="primary" onClick={onDownloadFile}>下载</Button>, <Button key="download" type="primary" onClick={onDownloadFile}>下载</Button>,
]} ]}
> >
@ -127,4 +129,6 @@ function Pdf(props) {
); );
} }
Pdf.displayName = "Pdf";
export default Pdf; export default Pdf;

View File

@ -12,7 +12,7 @@ const PreviewImg = (props) => {
return ( return (
<Image.PreviewGroup> <Image.PreviewGroup>
{ {
files.filter(Boolean).map((item) => ( files.filter(Boolean).map(item => (
<Image <Image
key={item[fileUrlKey] || item} key={item[fileUrlKey] || item}
src={item[fileUrlKey] ? fileUrl + item[fileUrlKey] : fileUrl + item} src={item[fileUrlKey] ? fileUrl + item[fileUrlKey] : fileUrl + item}
@ -27,4 +27,6 @@ const PreviewImg = (props) => {
); );
}; };
PreviewImg.displayName = "PreviewImg";
export default PreviewImg; export default PreviewImg;

View File

@ -81,4 +81,6 @@ const PreviewPdf = (props) => {
return null; return null;
}; };
PreviewPdf.displayName = "PreviewPdf";
export default PreviewPdf; export default PreviewPdf;

View File

@ -83,6 +83,7 @@ const Search = (props) => {
}; };
return ( return (
<div className="search-layout card-layout">
<Form <Form
form={form} form={form}
labelCol={labelCol} labelCol={labelCol}
@ -131,6 +132,7 @@ const Search = (props) => {
)} )}
</Row> </Row>
</Form> </Form>
</div>
); );
}; };

View File

@ -12,7 +12,7 @@ function PersonnelSelect(props) {
isNeedCorpInfoId = false, isNeedCorpInfoId = false,
isNeedDepartmentId = true, isNeedDepartmentId = true,
isNeedPostId = false, isNeedPostId = false,
extraParams= { extraParams = {
noMain: "", noMain: "",
eqEmploymentFlag: 1, eqEmploymentFlag: 1,
}, },

View File

@ -13,7 +13,7 @@ export interface SelectCreateOption {
export interface SelectCreateProps extends SelectProps { export interface SelectCreateProps extends SelectProps {
/** 选项列表 */ /** 选项列表 */
items: SelectCreateOption[]; items: SelectCreateOption[];
/** 是否显示删除图标,默认 true */ /** 是否显示删除图标,默认 true */
showDelete?: boolean; showDelete?: boolean;
/** 标签名称,用于占位符显示 */ /** 标签名称,用于占位符显示 */
label?: string; label?: string;

View File

@ -50,4 +50,6 @@ function SelectCreate(props) {
); );
} }
SelectCreate.displayName = "SelectCreate";
export default SelectCreate; export default SelectCreate;

View File

@ -12,9 +12,9 @@ export interface SignatureValue {
export interface SignatureProps { export interface SignatureProps {
/** 确认签字回调 */ /** 确认签字回调 */
onConfirm: (value: SignatureValue) => void; onConfirm: (value: SignatureValue) => void;
/** 签字区域宽度,默认 752 */ /** 签字区域宽度,默认 752 */
width?: number; width?: number;
/** 签字区域高度,默认 300 */ /** 签字区域高度,默认 300 */
height?: number; height?: number;
/** 回显的签字图片 */ /** 回显的签字图片 */
url?: string; url?: string;

View File

@ -89,4 +89,6 @@ function Signature(props) {
); );
} }
Signature.displayName = "Signature";
export default Signature; export default Signature;

View File

@ -5,7 +5,7 @@ import type { FC } from "react";
/** /**
* TablePro * TablePro
*/ */
export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, 'columns'> & ProTableProps<DataSource, U, ValueType> & { export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, "columns"> & ProTableProps<DataSource, U, ValueType> & {
/** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */ /** 当一个路由下存在多个表格的情况下 需要给每一个表格设置一个唯一存储索引 若没有设置则使用默认索引,请注意缓存数据会被覆盖 */
storeIndex?: string; storeIndex?: string;
/** 是否禁用内容区滚动,默认 false */ /** 是否禁用内容区滚动,默认 false */
@ -14,9 +14,11 @@ export type TableProps<DataSource, U, ValueType> = Omit<AntdTableProps, 'columns
showIndexColumn?: boolean; showIndexColumn?: boolean;
/** 索引列是否固定,默认 left */ /** 索引列是否固定,默认 left */
indexColumnFixed?: "left" | "right" | boolean; indexColumnFixed?: "left" | "right" | boolean;
/** 是否使用居中布局,默认 true */ /** 列的对齐方式,默认 center */
useAlignCenter?: boolean; align?: "left" | "right" | "center";
} /** 超过宽度是否自动省略,默认 true */
ellipsis?: boolean;
};
/** /**
* *

View File

@ -1,28 +1,73 @@
import TablePro from "@cqsjjb/jjb-react-admin-component/Table"; import TablePro from "@cqsjjb/jjb-react-admin-component/Table";
import { getIndexColumn } from "../../utils/index"; import { getIndexColumn } from "../../utils/index";
import dayjs from 'dayjs';
import "./index.less"; import "./index.less";
const CLEANUP_INTERVAL_DAYS = 10; // 清理间隔天数
const LAST_CLEANUP_KEY = 'tableLocalStorageLastCleanup'; // 最后清理时间存储key
// 清理本地存储中特定后缀的key
function cleanupTableLocalStorage() {
const now = dayjs();
const lastCleanupStr = localStorage.getItem(LAST_CLEANUP_KEY);
const lastCleanup = lastCleanupStr ? dayjs(lastCleanupStr) : null;
// 如果没有上次清理时间或距离上次清理已超过10天
if (!lastCleanup || now.diff(lastCleanup, 'day') >= 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) { function Table(props) {
const { const {
columns = [], columns = [],
showIndexColumn = true, showIndexColumn = true,
useAlignCenter = true, ellipsis = true,
align = "center",
indexColumnFixed = "left", indexColumnFixed = "left",
rowKey = "id", rowKey = "id",
...restProps ...restProps
} = props; } = 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,
...(column.children ? { children: column.children.map(setAlign) } : {}) ...(column.children ? { children: column.children.map(setAlign) } : {}),
}); });
return columns.map(setAlign); return columns.map(setAlign);
} }
return <TablePro rowKey={rowKey} columns={calcColumns()} bordered {...restProps} />; return (
<div className="table-layout card-layout">
<TablePro rowKey={rowKey} columns={settingColumns()} bordered size="small" {...restProps} />
</div>
);
} }
Table.displayName = "Table";
export default Table; export default Table;

View File

@ -9,5 +9,6 @@
} }
.@{ant-prefix}-pro-table-list-toolbar-container { .@{ant-prefix}-pro-table-list-toolbar-container {
padding-block: 16px !important; padding-top: 26px !important;
padding-bottom: 16px;
} }

View File

@ -22,4 +22,6 @@ const TooltipPreviewImg = (props) => {
); );
}; };
TooltipPreviewImg.displayName = "TooltipPreviewImg";
export default TooltipPreviewImg; export default TooltipPreviewImg;

View File

@ -17,7 +17,7 @@ export interface UploadProps extends Omit<AntUploadProps, "fileList"> {
tipContent?: ReactNode; tipContent?: ReactNode;
/** listType 为 text 时上传按钮文本 */ /** listType 为 text 时上传按钮文本 */
uploadButtonText?: string; uploadButtonText?: string;
/** 要上传的文件类型,默认 image */ /** 要上传的文件类型,默认 image */
fileType?: "image" | "video" | "document"; fileType?: "image" | "video" | "document";
/** 获取上传过服务器删除的附件 */ /** 获取上传过服务器删除的附件 */
onGetRemoveFile?: (file: Omit<UploadFile, "originFileObj">) => void; onGetRemoveFile?: (file: Omit<UploadFile, "originFileObj">) => void;

View File

@ -132,7 +132,7 @@ const Upload = (props) => {
const handleBeforeUpload = (file, fileList) => { const handleBeforeUpload = (file, fileList) => {
if (beforeUpload) if (beforeUpload)
return beforeUpload(file, fileList) return beforeUpload(file, fileList);
return false; return false;
}; };
@ -196,7 +196,7 @@ const Upload = (props) => {
if (!file.originFileObj) if (!file.originFileObj)
onGetRemoveFile?.(file); onGetRemoveFile?.(file);
return onRemove?.(file); return onRemove?.(file);
} };
// 预览文件 // 预览文件
const handlePreview = (file) => { const handlePreview = (file) => {

31
css/common.less Normal file
View File

@ -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;
}

View File

@ -8,6 +8,7 @@
"license": "MIT", "license": "MIT",
"files": [ "files": [
"components", "components",
"css",
"enum", "enum",
"hooks", "hooks",
"json", "json",