12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- /**
- * 配合比标准库业务模型
- *
- * @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;
|