import { Button, Form, Tag, Table, Typography, Select } from "antd"; import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm"; import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper"; import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction"; import { CHONGQING_DISTRICTS } from "~/enumerate/enterpriseOptions"; import { FILING_FORM_MODE, getFilingStatusOptions, isQualFilingEditable, QUAL_FILING_STATUS_COLOR, } from "~/enumerate/qualFilingOptions"; import { CHANGE_COUNT_STYLE, getChangeCount } from "~/utils/enterpriseForm"; export default function FilingListTable({ dataSource, total, loading, searchForm, onSearch, onPageChange, scrollY, mode, showChangeCount = false, onChangeCountClick, onCreate, createLabel, listTitle, listDesc, PageLayout, onDelete, extraActions, history, }) { const statusOptions = getFilingStatusOptions(mode); const canEditRow = (record) => { if (mode === FILING_FORM_MODE.FILED) { return record.filingStatusCode === 2; } return isQualFilingEditable(record.filingStatusCode); }; const columns = [ { title: "备案属地", dataIndex: "filingTerritoryName", width: 120, ellipsis: true }, { title: "备案单位", dataIndex: "filingUnitName", ellipsis: true }, { title: "备案编号", dataIndex: "filingNo", width: 200}, { title: "安全评价业务范围", dataIndex: "businessScope", ellipsis: true }, ]; if (showChangeCount) { columns.push({ title: "变更次数", dataIndex: "changeCount", width: 90, render: (_, record) => { const count = getChangeCount(record); const style = count > 0 ? CHANGE_COUNT_STYLE.active : CHANGE_COUNT_STYLE.zero; if (count <= 0) { return {count}; } return ( onChangeCountClick?.(record)} > {count} ); }, }); } columns.push({ title: "备案状态", dataIndex: "filingStatusName", width: 110, render: (_, record) => { const obj= QUAL_FILING_STATUS_COLOR[record.filingStatusCode] const color = obj?.color || "default"; const name= obj?.label || "-"; return ( obj? {name || "-"} :"--" ); }, }); columns.push({ title: "操作", width: 180, fixed: "right", render: (_, record) => ( {extraActions?.(record)} {canEditRow(record) && mode !== FILING_FORM_MODE.CHANGE && ( )} {mode === FILING_FORM_MODE.APPLICATION && isQualFilingEditable(record.filingStatusCode) && onDelete && ( )} ), }); return ( {listTitle}
{listDesc}
) : ( listTitle ) } extra={onCreate && ( )} > , {CHONGQING_DISTRICTS.map((d) => ( {d.label} ))} , , {statusOptions.map((opt) => ( {opt.label} ))} , ]} onFinish={(values) => onSearch(values)} onReset={(values) => onSearch(values)} /> `共 ${t} 条`, }} onChange={(pagination) => { if (onPageChange) onPageChange(pagination); }} /> ); }