import{G as w,H as k,C as x,D as g,v as y,F as R}from"./element-plus.fa1aa32c.js";import{P as h}from"./index.082aefea.js";import{a as U,b as I}from"./dict.b623686f.js";import{f as N}from"./index.0abf9e5c.js";import{d as q,s as c,r as A,e as T,a0 as G,o as P,c as S,V as l,M as a,a as f,u as z,T as _}from"./@vue.cab01781.js";const H={class:"edit-popup"},M=f("div",{class:"form-tips"},"\u6570\u503C\u8D8A\u5927\u8D8A\u6392\u524D",-1),j=_("\u6B63\u5E38"),J=_("\u505C\u7528"),$=q({__name:"edit",emits:["success","close"],setup(K,{expose:F,emit:m}){const p=c(),d=c(),n=A("add"),b=T(()=>n.value=="edit"?"\u7F16\u8F91\u5B57\u5178\u6570\u636E":"\u65B0\u589E\u5B57\u5178\u6570\u636E"),u=G({id:"",typeValue:"",name:"",value:"",sort:0,status:1,remark:"",typeId:0}),V={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6570\u636E\u540D\u79F0",trigger:["blur"]}],value:[{required:!0,message:"\u8BF7\u8F93\u5165\u6570\u636E\u503C",trigger:["blur"]}]},v=async()=>{var o,e;await((o=p.value)==null?void 0:o.validate()),n.value=="edit"?await U(u):await I(u),(e=d.value)==null||e.close(),N.msgSuccess("\u64CD\u4F5C\u6210\u529F"),m("success")},E=()=>{m("close")};return F({open:(o="add")=>{var e;n.value=o,(e=d.value)==null||e.open()},setFormData:o=>{for(const e in u)o[e]!=null&&o[e]!=null&&(u[e]=o[e])}}),(o,e)=>{const r=x,s=g,B=y,i=w,C=k,D=R;return P(),S("div",H,[l(h,{ref_key:"popupRef",ref:d,title:z(b),async:!0,width:"550px",onConfirm:v,onClose:E},{default:a(()=>[l(D,{class:"ls-form",ref_key:"formRef",ref:p,rules:V,model:u,"label-width":"84px"},{default:a(()=>[l(s,{label:"\u5B57\u5178\u7C7B\u578B"},{default:a(()=>[l(r,{"model-value":u.typeValue,placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u7C7B\u578B",disabled:"",clearable:""},null,8,["model-value"])]),_:1}),l(s,{label:"\u6570\u636E\u540D\u79F0",prop:"name"},{default:a(()=>[l(r,{modelValue:u.name,"onUpdate:modelValue":e[0]||(e[0]=t=>u.name=t),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u540D\u79F0",clearable:""},null,8,["modelValue"])]),_:1}),l(s,{label:"\u6570\u636E\u503C",prop:"value"},{default:a(()=>[l(r,{modelValue:u.value,"onUpdate:modelValue":e[1]||(e[1]=t=>u.value=t),placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u503C",clearable:""},null,8,["modelValue"])]),_:1}),l(s,{label:"\u6392\u5E8F",prop:"sort"},{default:a(()=>[f("div",null,[l(B,{modelValue:u.sort,"onUpdate:modelValue":e[2]||(e[2]=t=>u.sort=t),min:0,max:9999},null,8,["modelValue"]),M])]),_:1}),l(s,{label:"\u72B6\u6001",required:"",prop:"status"},{default:a(()=>[l(C,{modelValue:u.status,"onUpdate:modelValue":e[3]||(e[3]=t=>u.status=t)},{default:a(()=>[l(i,{label:1},{default:a(()=>[j]),_:1}),l(i,{label:0},{default:a(()=>[J]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(s,{label:"\u5907\u6CE8",prop:"remark"},{default:a(()=>[l(r,{modelValue:u.remark,"onUpdate:modelValue":e[4]||(e[4]=t=>u.remark=t),type:"textarea",autosize:{minRows:4,maxRows:6},clearable:"",maxlength:"200","show-word-limit":""},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["title"])])}}});export{$ as _};
