import React, { useState } from 'react';
import Table from 'components/table';
import Button from 'components/button';
import Modal from 'components/modal';
import Line from 'components/line-ellipsis';

type IProps = {};
const Test = function(props: IProps) {
    const [show, set] = useState(false);
    return (
        <div>
            <Button onClick={() => set(true)}>test</Button>
            <Modal visible={show} onCancel={() => set(false)}>
                <Table rowId="materialId" columns={DeliveryColumns} dataSource={data} />
            </Modal>
        </div>
    );
};
Test.defaultProps = {};
export default Test;

export const DeliveryColumns: any = [
    {
        title: '物料名称',
        align: 'left',
        key: 'materialName',
        render({ value }: any): any {
            return <Line>{value}</Line>;
        },
    },
    {
        title: '服务商',
        align: 'left',
        render({ row }: any) {
            return <Line>{row.supplierInfo.name}</Line>;
        },
    },
    {
        title: '物料名称',
        align: 'left',
        render({ row }: any): any {
            return <Line>{row.photoCaption}</Line>;
        },
    },
];

const data = [
    {
        materialId: 1,
        materialName: '气江作近特心大器千其心县行叫',
        orderId: 323432432,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '组文地世天日变准阶连开真酸所样北外证完几活色多严对向都状接成会往达料量便市道正广为按发产律边越断听除战带通思片保动增平特她集容大条质类管义多平名开小用共文党你价',
        photoCoverUrls: [
            'http://dummyimage.com/160x600',
            'http://dummyimage.com/120x240',
            'http://dummyimage.com/300x600',
            'http://dummyimage.com/180x150',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '料火消外日与存教土划',
        supplierInfo: {
            accountId: 23434,
            name: '备质眼史反府',
        },
        actualNumber: 97,
        estimateNumber: 196,
    },
    {
        materialId: 2,
        materialName: '米群身根整总然离非那委无采厂',
        orderId: 323432433,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '线这争离进可下去越日济就器劳每离一表而省光委维难书众极示进毛联认界条花习北好切话角声表一多再收识第先称着至参生明都边局过总基书运保技就传手易改上心更高加子路也次',
        photoCoverUrls: [
            'http://dummyimage.com/160x600',
            'http://dummyimage.com/300x250',
            'http://dummyimage.com/120x600',
            'http://dummyimage.com/120x240',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '土进与率就记争是际米',
        supplierInfo: {
            accountId: 23435,
            name: '小常的采解才',
        },
        actualNumber: 43,
        estimateNumber: 160,
    },
    {
        materialId: 3,
        materialName: '细先热手导着极温由精东这了白',
        orderId: 323432434,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '山东手系格其即具之共合世节史都之取东北消至面然边十局流西处基就空党装水现至花力形我她认收采究指则影给见区级圆界而水小里打叫科是用太总场群眼后带五争作那使众以采更',
        photoCoverUrls: [
            'http://dummyimage.com/180x150',
            'http://dummyimage.com/250x250',
            'http://dummyimage.com/336x280',
            'http://dummyimage.com/120x600',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '单高志感合华下关家矿',
        supplierInfo: {
            accountId: 23436,
            name: '么好素取深确',
        },
        actualNumber: 84,
        estimateNumber: 195,
    },
    {
        materialId: 4,
        materialName: '重众达张者引层大车示信压以值',
        orderId: 323432435,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '风么而战到员阶它按取的质声真京书众开报标是口使京处还厂社运进现厂团题立东其克行上进直想路她习音现确火阶然型般这级直速验还王话性所展心打调越严克料没转因展信状这者',
        photoCoverUrls: [
            'http://dummyimage.com/88x31',
            'http://dummyimage.com/234x60',
            'http://dummyimage.com/125x125',
            'http://dummyimage.com/180x150',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '十家满县育即结种计造',
        supplierInfo: {
            accountId: 23437,
            name: '总方行它员运',
        },
        actualNumber: 77,
        estimateNumber: 122,
    },
    {
        materialId: 5,
        materialName: '具门有造接小很展革许由何构空',
        orderId: 323432436,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '属压际研光过二万压把马认联观或表此算往养志八其称相示王二干常子族相会水实角形律下场去省及选建公史验保清出色京有采角断同多存得新七被之八重到种加称很青要价心需据响',
        photoCoverUrls: [
            'http://dummyimage.com/120x600',
            'http://dummyimage.com/336x280',
            'http://dummyimage.com/180x150',
            'http://dummyimage.com/120x90',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '间思格因专音龙识党路',
        supplierInfo: {
            accountId: 23438,
            name: '阶消除始术拉',
        },
        actualNumber: 36,
        estimateNumber: 132,
    },
    {
        materialId: 6,
        materialName: '系品集来多分志圆技中并花将或',
        orderId: 323432437,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '决置候改却以再受素能于议类争是正般万基说去提里程须复油层每位子发类变难级出单上专变包话说便应采看共法技都半政至称次素色别物规几门只术即增教学属商东时听外科路山等',
        photoCoverUrls: [
            'http://dummyimage.com/720x300',
            'http://dummyimage.com/125x125',
            'http://dummyimage.com/180x150',
            'http://dummyimage.com/120x600',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '还历叫果得位认受工十',
        supplierInfo: {
            accountId: 23439,
            name: '七石此此回单',
        },
        actualNumber: 88,
        estimateNumber: 184,
    },
    {
        materialId: 7,
        materialName: '点响备近持采带调转全合示节世',
        orderId: 323432438,
        photoUrl: 'https://txmov2.a.yximgs.com/bs2/newWatermark/OTExODg3MDM2Nw_zh_4.mp4',
        photoCaption:
            '格干织能状前标可素正家美式争争西在温也它而被平习石速况深适感界西本县利记现有在关思至带老达清场红叫也能确位离区部方南根观省切空容反织查而社么名听越眼龙史万样体九',
        photoCoverUrls: [
            'http://dummyimage.com/234x60',
            'http://dummyimage.com/300x250',
            'http://dummyimage.com/250x250',
            'http://dummyimage.com/88x31',
        ],
        materialStatus: 2,
        materialStatusDes: '待确认',
        disapproveReason: '米命造生何上成目直属',
        supplierInfo: {
            accountId: 23440,
            name: '员置么水以样',
        },
        actualNumber: 86,
        estimateNumber: 162,
    },
];
