@cainiaofe/cn-ui-m
Version:
56 lines (55 loc) • 1.97 kB
JavaScript
import React from 'react';
import { CnMiniTable, CnCard, CnDemoPage, CnProgress, } from "../../..";
export var 排行榜示例 = function () {
var columns = [
{
title: '排名',
align: 'left',
dataIndex: 'index',
width: 80,
},
{
title: '名称',
align: 'left',
dataIndex: 'area',
width: 150,
},
{
title: '进度',
align: 'left',
dataIndex: 'progress',
width: 100,
render: function (value) {
return React.createElement(CnProgress, { percent: value, textRender: function () { return ''; } });
},
},
{
title: '签约数',
align: 'left',
dataIndex: 'count',
width: 100,
render: function (value, record) {
return record.progress;
},
},
{
title: '大区经理',
align: 'left',
dataIndex: 'manager',
width: 130,
},
];
var data = [
{ index: 1, area: '西北大区', progress: 28, manager: '张三' },
{ index: 2, area: '西南大区', progress: 36, manager: '李四' },
{ index: 3, area: '西南大区2', progress: 2, manager: '王五' },
{ index: 4, area: '西南大区3', progress: 54, manager: '张三' },
{ index: 5, area: '西南大区4', progress: 12, manager: '张三' },
{ index: 6, area: '西南大区5', progress: 36, manager: '张三' },
{ index: 7, area: '西南大区6', progress: 100, manager: '张三' },
];
return (React.createElement(CnDemoPage, { title: "\u6392\u884C\u699C\u793A\u4F8B" },
React.createElement(CnCard, null,
React.createElement(CnMiniTable, { scroll: { x: 0 }, data: data, columns: columns }))));
};
export default { title: 'demo/CnMiniTable' };