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