'use strict'; /** * 指标库-项目节参数 * * @author Mai * @date 2018/4/25 * @version */ $(document).ready(function() { const billsSpread = SpreadJsObj.createNewSpread($('#bills-spread')[0]); const billsTree = createNewPathTree({ id: 'n_id', pid: 'n_pid', order: 'n_order', level: 'n_level', full_path: 'n_full_path', is_leaf: 'n_is_leaf', rootId: -1, keys: ['id', 'lib_id', 'n_id'], preUrl: '/lib/detail', }); billsTree.loadDatas(bills); SpreadJsObj.initSheet(billsSpread.getActiveSheet(), { cols: [ {title: '项目节编号', field: 'code', width: 120, cellType: 'tree'}, {title: '清单编号', field: 'b_code', width: 80}, {title: '名称', field: 'name', width: 200}, {title: '单位', field: 'unit', width: 50}, {title: '数量1', field: 'dgn_quantity1', width: 60, type: 'Number'}, {title: '数量2', field: 'dgn_quantity2', width: 60, type: 'Number'}, {title: '金额', field: 'total_price', width: 60, type: 'Number'}, ], treeCol: 0, emptyRows: 3, headRows: 2, headRowHeight: [40, 40], defaultRowHeight: 21, }); SpreadJsObj.loadSheetData(billsSpread.getActiveSheet(), 'tree', billsTree); });