import{_ as q,d as U,r as _,f as u,g as p,K as $,m as l,h as i,G as j,L as x,l as a,$ as N,j as T,p as M,q as A}from"./index.9fabe127.js";const B=["onClick"],F=U({name:"safetyInput"}),P=Object.assign(F,{setup(J,{expose:d}){const{proxy:y}=A(),e=_({safetyInput:[{}]}),c=_(),I=(s,r,o)=>{r||o(),/^\d+(\.\d{1,6})?$/.test(r)?r*1>=1e8?o("\u8BF7\u8F93\u5165\u6B63\u786E\u683C\u5F0F\uFF0C\u5C0F\u4E8E100000000"):o():o("\u8BF7\u8F93\u5165\u6B63\u786E\u683C\u5F0F\uFF0C\u6700\u591A\u4FDD\u7559\u516D\u4F4D\u5C0F\u6570")},g={safetyInputTitle:[{required:!0,message:"\u8BF7\u8F93\u5165\u6295\u5165\u9879",trigger:"blur"}],safetyInputDescribe:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9\u63CF\u8FF0",trigger:"blur"}],safetyInputAmount:[{required:!0,message:"\u8BF7\u8F93\u5165\u91D1\u989D",trigger:"blur"},{validator:I,trigger:"blur"}]},v=s=>{c.value.validate(r=>{s(r)})},b=s=>{e.value={safetyInput:s.safetyInputDescribe?JSON.parse(s.safetyInputDescribe):[{}]}},h=()=>{if(e.value.safetyInput.length>=10){y.$message.warning("\u6700\u591A\u6DFB\u52A010\u9879");return}e.value.safetyInput.push({})},V=s=>{e.value.safetyInput.splice(s,1)};return d({validForm:v,formData:e,setFormData:b}),(s,r)=>{const o=u("el-input"),f=u("el-form-item"),m=u("el-col"),D=u("el-input-number"),w=u("el-row"),k=u("el-button"),C=u("el-form");return p(),$(C,{ref_key:"formRef",ref:c,model:e.value,rules:g,"label-position":"right","label-width":"180px","label-suffix":":","scroll-to-error":""},{default:l(()=>[(p(!0),i(j,null,x(e.value.safetyInput,(K,t)=>(p(),i("div",{key:t,style:{background:"#f5f8fa"},class:"p-8 mb-16 relative"},[a(w,{gutter:40},{default:l(()=>[a(m,{span:12},{default:l(()=>[a(f,{label:"\u6295\u5165\u9879",prop:`safetyInput[${t}].safetyInputTitle`,rules:{required:!0,message:"\u8BF7\u8F93\u5165"}},{default:l(()=>[a(o,{modelValue:e.value.safetyInput[t].safetyInputTitle,"onUpdate:modelValue":n=>e.value.safetyInput[t].safetyInputTitle=n,placeholder:"\u8BF7\u8F93\u5165",maxlength:50},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(m,{span:24},{default:l(()=>[a(f,{label:"\u5185\u5BB9\u63CF\u8FF0",prop:`safetyInput[${t}].safetyInputDescribe`,rules:{required:!0,message:"\u8BF7\u8F93\u5165"}},{default:l(()=>[a(o,{modelValue:e.value.safetyInput[t].safetyInputDescribe,"onUpdate:modelValue":n=>e.value.safetyInput[t].safetyInputDescribe=n,rows:4,maxlength:"2000",type:"textarea","show-word-limit":"",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),a(m,{span:12},{default:l(()=>[a(f,{label:"\u91D1\u989D(\u4E07\u5143)",prop:`safetyInput[${t}].safetyInputDescribe`,rules:{required:!0,message:"\u8BF7\u8F93\u5165"}},{default:l(()=>[a(D,{modelValue:e.value.safetyInput[t].safetyInputAmount,"onUpdate:modelValue":n=>e.value.safetyInput[t].safetyInputAmount=n,placeholder:"\u8BF7\u586B\u5199",min:0,controls:!1,onMousewheel:r[0]||(r[0]=N(()=>{},["prevent"]))},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024)]),_:2},1024),e.value.safetyInput.length>1?(p(),i("span",{key:0,class:"text-danger absolute right-8 top-8 cursor-pointer",onClick:n=>V(t)},"\u5220\u9664",8,B)):T("v-if",!0)]))),128)),a(k,{type:"primary",icon:"Plus",plain:"",onClick:h},{default:l(()=>[M("\u6DFB\u52A0\u6295\u5165\u9879")]),_:1})]),_:1},8,["model"])}}}),O=q(P,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/declareManage/projectDeclare/declarePage/components/safetyInput.vue"]]);export{O as default};
