import React from "react"; import { Card, List, Empty } from "antd"; import Item from "./item"; import { FieldConfig, CardListConfig } from "../../tmpl/interface"; import "./index.less"; type VerticalListProps = { hiddenRowCodes?: string[]; dataSource?: object[]; columnConfigs?: FieldConfig[]; serverKey: string; columns: any[]; errorText?: string; listConfig?: CardListConfig; }; const VerticalList = (props: VerticalListProps) => { const { columnConfigs, columns, serverKey, errorText, listConfig } = props; const renderOpt = (item: unknown) => { const actionCol = columns.find(col => col["操作"] == 1); return actionCol?.render(item, item); } const getUnHidenDataSource = () => { const { hiddenRowCodes, dataSource } = props; let ds: object[] = []; if (dataSource) { for (let d of dataSource) { if (!hiddenRowCodes?.includes(d['code'])) { ds.push(d); } } } return ds; }; return ( ( )} locale={{ emptyText: errorText ? : undefined }} /> ); }; export default VerticalList;