niucloud-admin/niucloud/public/admin/assets/edit-form-number-de6733ed.js
全栈小学生 c665981070 up
2025-05-23 14:56:18 +08:00

2 lines
2.7 KiB
JavaScript

import{d as w,k as s,M as V,h as y,c as C,J as f,a7 as c,u as l,a as i,b as r,e as o,w as d,t as S,bj as x,aI as E,F as T,D as M,G as $,P as F,av as P,H as D}from"./index-08dd4327.js";/* empty css */import"./el-tooltip-4ed993c7.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{u as B}from"./diy-84497d46.js";const I={class:"content-wrap"},N={class:"flex items-center"},U={class:"mr-[3px]"},j={class:"style-wrap"},k=w({__name:"edit-form-number",setup(O,{expose:_}){const t=B();t.editComponent.ignore=["componentBgUrl"],t.editComponent.verify=a=>{const e={code:!0,message:""};return t.value[a].field.default&&(isNaN(t.value[a].field.default)||!h.digit.test(t.value[a].field.default)?(e.code=!1,e.message=s("defaultErrorTips")):t.value[a].field.default<0&&(e.code=!1,e.message=s("defaultMustZeroTips"))),e};const h={required:/[\S]+/,number:/^\d{0,10}$/,digit:/^\d{0,10}(.?\d{0,2})$/,special:/^\d{0,10}(.?\d{0,3})$/};return _({}),(a,e)=>{const m=M,u=$,b=V("QuestionFilled"),g=F,v=P,p=D;return y(),C(T,null,[f(i("div",I,[r(a.$slots,"field"),o(p,{"label-width":"100px",class:"px-[10px]",onSubmit:e[4]||(e[4]=E(()=>{},["prevent"]))},{default:d(()=>[o(u,{label:l(s)("formPlaceholder")},{default:d(()=>[o(m,{modelValue:l(t).editComponent.placeholder,"onUpdate:modelValue":e[0]||(e[0]=n=>l(t).editComponent.placeholder=n),modelModifiers:{trim:!0},placeholder:l(s)("formPlaceholderTips"),clearable:"",maxlength:"15","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(u,{label:l(s)("unit")},{default:d(()=>[o(m,{modelValue:l(t).editComponent.unit,"onUpdate:modelValue":e[1]||(e[1]=n=>l(t).editComponent.unit=n),modelModifiers:{trim:!0},placeholder:l(s)("unitPlaceholder"),clearable:"",maxlength:"5","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),o(u,null,{label:d(()=>[i("div",N,[i("span",U,S(l(s)("defaultValue")),1),o(v,{effect:"light",content:l(s)("defaultValueTips"),placement:"top"},{default:d(()=>[o(g,null,{default:d(()=>[o(b,{color:"#999999"})]),_:1})]),_:1},8,["content"])])]),default:d(()=>[o(m,{modelValue:l(t).editComponent.field.default,"onUpdate:modelValue":e[2]||(e[2]=n=>l(t).editComponent.field.default=n),modelModifiers:{trim:!0},placeholder:l(s)("defaultValuePlaceholder"),onKeyup:e[3]||(e[3]=n=>l(x)(n)),clearable:"",maxlength:"18","show-word-limit":""},null,8,["modelValue","placeholder"])]),_:1})]),_:1}),r(a.$slots,"other"),o(p,{"label-width":"100px",class:"px-[10px]"})],512),[[c,l(t).editTab=="content"]]),f(i("div",j,[r(a.$slots,"style-field"),r(a.$slots,"style")],512),[[c,l(t).editTab=="style"]])],64)}}}),Z=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));export{Z as _};