| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 | /** * 配合比标准库业务模型 * * @author CaiAoLin * @date 2017/7/10 * @version */import BaseModel from "../base/base_model";import STDMixRatioSchema from "./schemas/std_mix_ratio";class STDMixRatioModel extends BaseModel {    /**     * 构造函数     *     * @return {void}     */    constructor() {        let parent = super();        parent.model = STDMixRatioSchema;        parent.init();    }    /**     * 根据编码获取对应的组成物信息     *     * @param {String} code     * @return {Promise}     */    async getDataByCode(code) {        let result = [];        code = code.trim();        try {            if (code === '') {                throw '编码为空';            }            result = await this.findDataByCondition({connect_code: code}, null, false);        } catch (error) {            console.log('std_mix_ratio_model:' + error);            result = [];        }        return result;    }}export default STDMixRatioModel;
 |