niucloud-admin/niucloud/public/admin/assets/edit-form-number-6499deb8.js
全栈小学生 eff269ab88 up
2025-09-20 09:12:11 +08:00

2 lines
2.7 KiB
JavaScript

import{d as v,k as s,N as V,h as C,c as y,J as f,ae as c,u as l,a as i,b as r,e as o,w as d,t as S,bl as x,aO as E,F as T,D as $,G as F,Q as M,aC as D,H as N}from"./index-9f163f98.js";/* empty css */import"./el-tooltip-4ed993c7.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{u as P}from"./diy-700f9c59.js";const B={class:"content-wrap"},U={class:"flex items-center"},k={class:"mr-[3px]"},I={class:"style-wrap"},O=v({__name:"edit-form-number",setup(Q,{expose:_}){const t=P();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=$,u=F,b=V("QuestionFilled"),g=M,w=D,p=N;return C(),y(T,null,[f(i("div",B,[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",U,[i("span",k,S(l(s)("defaultValue")),1),o(w,{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",I,[r(a.$slots,"style-field"),r(a.$slots,"style")],512),[[c,l(t).editTab=="style"]])],64)}}}),Z=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));export{Z as _};