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: 'deptName', key: 'deptName' }, { title: '线路', align: 'center', dataIndex: 'lineName', key: 'lineName' }, { title: '站场区间', align: 'center', dataIndex: 'stationName', key: 'stationName' }, { title: '行别', align: 'center', dataIndex: 'xingbieText', key: 'xingbieText' }, { title: '开始公里标', align: 'center', dataIndex: 'startMarker', key: 'startMarker' }, { title: '结束公里标', align: 'center', dataIndex: 'endMarker', key: 'endMarker' }, { title: '支柱号', align: 'center', dataIndex: 'pillarCode', key: 'pillarCode' }, { title: '规格型号', align: 'center', dataIndex: 'specification', key: 'specification' }, { title: '示数', align: 'center', dataIndex: 'displayNum', key: 'displayNum' }, { title: '操作', dataIndex: 'action', width: 200, align: 'center', slots: { title: 'actionName' }, scopedSlots: { customRender: 'action' } } ] return cols } export default columns