import React from 'react'; import { Table, Popconfirm, message, Space } from 'antd'; import { useStore } from '../index'; import {ShopVo, banConfigApi, ListResult} from '../api'; import { isNil } from 'lodash'; import moment from 'moment'; interface Props { addedValueType?: number // 附加值类型 } const Column = Table.Column; export default function LargeList({addedValueType} : Props) { const {list, paginationConfig, loading, setLoading, setCurrentData, setShopData} = useStore(); const handleDeleteConfig = (id?:number) => { banConfigApi({id}) .then(res => { message.success(res.result); setLoading(true); }).catch(e => { message.error(e.message); }); }; function handleRenderShop(value: ShopVo[] = []) { if (value.length === 0) { return '--'; } else if (value.length > 2) { return `${value[0].shopName}等${value.length}个门店`; } return value.map(v => v.shopName).join(","); } function handleEdit(value: ListResult = {}) { setCurrentData({visible: true, title: "编辑", data: value}); } return ( (isNil(_text) ? '-' : {_text}元/台)} /> (isNil(_text) ? '-' :
{_text}元/台(含驾意险)
)} /> (
商业险金额*{record.vciOutputValueRatio}% 交强险金额*{record.tciOutputValueRatio}% 架意险产值*{record.jcxOutputValueRatio}%
)} /> (isNil(_text) ? '-' : {_text}元/台)} /> `装潢产值*${_text}%`} /> setShopData({visible: true, data: record.shopList})}>{handleRenderShop(record.shopList)}} /> {moment(record.beginTime).format("YYYY.MM")}-{moment(record.endTime).format("YYYY.MM")}} /> ( handleEdit(record)} style={{color: "#4189FD"}}>编辑 handleDeleteConfig(record.id)} okText="确定" cancelText="取消" > 删除 )} />
); }