import React from 'react'; import { Table, Divider } from 'antd'; import { useStore } from '../index'; import { history } from 'umi'; import style from '../index.less'; import defaultThum from '@/assets/defaultThum.png'; import { render } from 'react-dom'; export default function CarList() { const { list, paginationConfig, loading, setCurrentItem, setVisible, setCopyVisible } = useStore(); const columns = [ { title: '编号', dataIndex: 'id', align: "center" }, { title: '整车型号代码', dataIndex: 'specCode', align: "center", }, { title: '车型分类名称', dataIndex: 'classifyName', align: "center", }, { title: '配置名称', dataIndex: 'name', width: "13%", align: "center" }, { title: '配置代码', dataIndex: 'specCodeList', align: "center", render: (text:any, record:any) => (text ? text.map((res:any, index:any) =>
{res}
) : '——'), }, { title: '品牌', dataIndex: 'brandName', align: "center" }, { title: '厂商', width: "13%", dataIndex: 'factoryName', align: "center" }, { title: '车系', dataIndex: 'seriesName', align: "center" }, { title: '缩略图', dataIndex: 'thumbnail', width: 120, align: "center", render: (val: string) => }, { title: '生产状态', dataIndex: 'proStatus', align: "center", render: (val: any) => { switch (val) { case 1: return (
在产
); case 0: return (
停产
); default: return (
未知
); } } }, { title: '销售状态', dataIndex: 'saleStatus', align: "center", render: (val: any) => { switch (val) { case 2: return (
预售
); case 1: return (
在售
); case 0: return (
停售
); default: return (
未知
); } } }, // { // title: '是否有效', // dataIndex: 'yn', // align: "center", // render: (val: any) => { // switch (val) { // case true: // return (
有效
); // case false: // return (
无效
); // default: // return (
未知
); // } // } // }, { title: '操作', align: "center", render: (text: any, row: any) => ( { e.preventDefault(); setCurrentItem(row); setVisible(true); }}>编辑 {/* changeStatus(e, row)}> {row.yn ? '禁用' : '启用'} */} {/* { history.push(`/oop/carPara?id=${row.id}`); }}>参数 */} { setCurrentItem(row); setCopyVisible(true); }}>复制 history.push(`/oop/car/atlas/${row.seriesId}`)}>图集 ) } ]; return ( record.id} dataSource={list} columns={columns} pagination={paginationConfig} size="small" /> ); }