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: 'marker', key: 'marker' }, { title: '杆号范围', align: 'center', dataIndex: 'pillarArea', key: 'pillarArea' }, { title: '线路性质', align: 'center', dataIndex: 'lineType', key: 'lineType' }, { title: '采取措施', align: 'center', dataIndex: 'measures', key: 'measures' }, { title: '操作', dataIndex: 'action', width: 200, align: 'center', slots: { title: 'actionName' }, scopedSlots: { customRender: 'action' } } ] return cols } export default columns