/** * Created by Tony on 2017/7/14. * 报表数据提取class,是协助报表模板里指标字段自主提取数据的工具类 */ class Rpt_Common{ initialize(Projects) { this.Projects = Projects; }; }; class Rpt_Data_Extractor { initialize(Projects) { this.Projects = Projects; //Projects对象应该从前端传送过来,无需在后端重复查询及构建 /* 结构: { currentPrjId: int, topPrj: [ //单项工程 { subPrjName: String, subPrjId: int, detailPrj: [ //单位工程 { detailPrjName: String, subPrjId: int, } ... ] } ... ] } */ }; prepareData($CURRENT_RPT) { //在报表提取数据前的准备工作,主要有: //1. 确认指标数据的类型(离散/主/从) //2. 根据类型提取数据,排序 // 2.1. header类型 // 2.2. 章类型 // 2.3. detail类型 // 2.4. 排序 }; }