import {extendInclude, extendRule, initFilter} from "../../utils/common";

/**
 * @return {string}
 */

export default {
    onBeforeEdit:({isNew,dispatch,login,setFieldValueByBatch})=>{
if(isNew)
{
    const json=initFilter(login.OrgId);
    json.Count=1;
    json.CodeType=5000

      dispatch({
        type: 'lastVersion/getLastVersion',
        payload: json,
        onComplete: (ret) => {
          if (ret) {
            const temps=[];
            temps.push({field:'LAST_VERSION',value:ret});
            setFieldValueByBatch(temps);
          }
        }
      })
}
    },
};