/**
 * Created by CSL on 2017-10-17.
 */
class LabourCoe {
    constructor (project) {
        this.project = project;
        this.datas = [];
        project.registerModule(ModuleNames.labour_coe, this);
    };

    getSourceType () {
        return ModuleNames.labour_coe;
    };

    loadData (datas) {
        this.datas = datas;
    };

    doAfterUpdate (err, data) {
        if(!err){
            // do
        }
    };

    refreshData (data){
        let me = this;
        if (data.libID && data.libID != me.datas.libID){
            me.datas.libID = data.libID;
            me.datas.libName = data.libName;
        };

        for (let newItem of data.newItemArr){
              for (let oldItem of me.datas.coes){
                   if (oldItem.ID == newItem.ID){
                       oldItem.coe = newItem.coe;
                       break;
                   }
              };
        };
    }
}

