1 |
- import{m as s}from"./index-3887ab05.js";class u{constructor(t={}){this.attributes={},Object.assign(this.attributes,t)}getAttribute(t){return this.attributes[t]}setAttribute(t,e){this.attributes[t]=e}listAttributes(){return Object.keys(this.attributes).map(t=>`${t}: ${this.attributes[t]}`).join(", ")}checkDimension(t,e){console.log(e);const i=["length","width"];for(const r of i){if(e[r]<t[r].min||e[r]>t[r].max)return s.error({content:`自定义${r=="length"?"长度":"宽度"}超出可选范围!`,key:1}),!1;if(!e[r])return s.error({content:`${r=="length"?"长度":"宽度"}定制选项不能为空!`,key:1}),!1;if(!this.hasDecimal(e[r],r))return!1}return!0}hasDecimal(t,e){return t.toString().indexOf(".")!==-1?(s.error(`${e=="length"?"长度":"宽度"}请输入整数`),!1):!0}}export{u as P};
|