import{ResultDto2 as f}from"./interfaces.64daf53d.js";class s{static BeforeUploadVerify(i,l,r){let t=new f;if(t.status=!0,r&&!l.includes(i.type))return t.status=!1,t.message="OnlySupportPictureFile",t;const e=i.size/1024/1024<this.maxProfilPictureBytesValue;if(!e)return t.status=!1,t.message="ProfilePicture_Warn_SizeLimit",t;const u=e;return t.status=u,t}static GetExtendModelValue(i,l,r){if(i)for(let t=0;t<l.length;t++){const e=l[t];e.field!=null&&e.field.toUpperCase().indexOf("Default".toUpperCase())>-1&&i.entity[e.field]&&e.ifShow&&(r[e.field]=i.entity[e.field])}return r}static SetExtendModelValue(i,l,r){if(i)for(let t=0;t<l.length;t++){const e=l[t];e.field!=null&&e.field.toUpperCase().indexOf("Default".toUpperCase())>-1&&r[e.field]&&e.ifShow&&(i.entity[e.field]=r[e.field])}return r}static VerifyExtendModelValue(i,l){let r="";if(i==null)return r;for(let t=0;t<l.length;t++){const e=l[t];if(e.field!=null&&e.field.toUpperCase().indexOf("Default".toUpperCase())>-1&&e.ifRequire&&!i.entity[e.field])return e.title+"\u4E0D\u80FD\u4E3A\u7A7A\u3002"}return r}static GetEditRules(i,l){let r={};if(i)for(let t=0;t<l.length;t++){const e=l[t];e.field!=null&&e.ifRequire&&(e.field.toUpperCase().indexOf("Default".toUpperCase())>-1?i.rules[e.field]=[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165"}]:r[e.field]=[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165"}])}return r}static GetLotEditRules(i,l){let r={};if(i)for(let t=0;t<l.length;t++){const e=l[t];e.field!=null&&e.ifRequire&&(e.field.toUpperCase().indexOf("lotDefault".toUpperCase())>-1?i.rules[e.field]=[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165"}]:r[e.field]=[{required:!0,trigger:"blur",message:"\u8BF7\u8F93\u5165"}])}return r}}s.maxProfilPictureBytesValue=100;export{s as IcsHelper};
