/** * 计算程序标准库业务模型 * * @author CaiAoLin * @date 2017/10/23 * @version */ import BaseModel from "../base/base_model"; import STDCalcProgramSchema from "./schemas/std_calc_program"; class STDCalcProgramModel extends BaseModel { /** * 构造函数 * * @return {void} */ constructor() { let parent = super(); parent.model = STDCalcProgramSchema; parent.init(); } /** * 获取计算程序列表 * * @return {Promise} */ async getProgramList() { let result = []; let field = {ID: 1, libName: 1}; let programList = await this.findDataByCondition({ID: {$ne: ''}}, field, false); if (programList === null) { return result; } // 整理数据 for(let program of programList) { let tmpData = { id: program.ID, name: program.libName }; result.push(tmpData); } return result; } } export default STDCalcProgramModel;