niucloud-admin/niucloud/public/admin/assets/edit-form-number-5d075e25.js
zhangxingye ef5f8839e3 1.5.0
2025-02-22 17:28:27 +08:00

2 lines
2.7 KiB
JavaScript

import{d as v,k as s,N as V,h as y,c as C,J as f,a9 as c,u as l,a as i,b as r,e as o,w as d,t as x,bh as S,aK as T,F as E,D as $,G as F,T as M,ax as D,H as N}from"./index-785a2eda.js";/* empty css */import"./el-tooltip-4ed993c7.js";/* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{u as P}from"./diy-9f040720.js";const B={class:"content-wrap"},U={class:"flex items-center"},k={class:"mr-[3px]"},I={class:"style-wrap"},j=v({__name:"edit-form-number",setup(K,{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 y(),C(E,null,[f(i("div",B,[r(a.$slots,"field"),o(p,{"label-width":"100px",class:"px-[10px]",onSubmit:e[4]||(e[4]=T(()=>{},["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,x(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(S)(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:j},Symbol.toStringTag,{value:"Module"}));export{Z as _};