function columns(vm) { const cols = [ { title: '序号', key: 'rowIndex', width: 60, align: 'center', customRender: function(t, r, index) { return parseInt(index) + 1 } }, { title: '缺陷设备名称', align: 'center', dataIndex: 'qxsbmc', key: 'qxsbmc' }, { title: '工区', align: 'center', dataIndex: 'ssgq', key: 'ssgq' }, { title: '线别', align: 'center', dataIndex: 'lineName', key: 'lineName' }, { title: '发现日期', align: 'center', dataIndex: 'foundDate', key: 'foundDate' }, { title: '缺陷内容', align: 'center', dataIndex: 'qxnr', key: 'qxnr' }, { title: '故障类别', align: 'center', dataIndex: 'gzlb', key: 'gzlb' }, { title: '原因', align: 'center', dataIndex: 'reason', key: 'reason' }, { title: '严重性', align: 'center', dataIndex: 'gravity', key: 'gravity' }, { title: '处理措施', align: 'center', dataIndex: 'rectifyWay', key: 'rectifyWay' } ] return cols } export default columns