import{P}from"./index.8afed1db.js";import{M as T,N as j,O as K,D as M,C as G,F as H}from"./element-plus.8e273e86.js";import{a as J}from"./store_category.8ced4c6e.js";import{r as d}from"./index.2078eb25.js";import{d as x,s as E,r as V,b as Q,Z as k,o as b,c as z,U as u,L as n,u as o,T as W,a9 as X,K as Y}from"./@vue.76ce7aa3.js";function ne(a){return d.get({url:"/activityzoneform/lists",params:a})}function $(a){return d.post({url:"/activityzoneform/add",params:a})}function ee(a){return d.post({url:"/activityzoneform/edit",params:a})}function ie(a){return d.post({url:"/activityzoneform/delete",params:a})}function pe(a){return d.get({url:"/activityzoneform/export",params:a})}const te={class:"edit-popup"},le=x({name:"categoryEdit"}),ce=x({...le,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:w,emit:D}){const B=D,C=E(),m=E(),f=V("add"),h=Q(()=>f.value=="edit"?"\u7F16\u8F91\u8868\u5355":"\u65B0\u589E\u8868\u5355"),l=k({type:"",title:"",cate_ids:[],remark:""});let _,v;const y=V(!1);let F;const A=t=>(F=t,y.value=!0,g.lazyLoad(v,_),!1),g={value:"id",label:"name",lazy:!0,multiple:!0,lazyLoad(t,e){_||(_=e),v||(v=t);const s=t.value||0;let i={};y.value?(i={name:F},F||(i={pid:s,page_size:1e4})):i={pid:s,page_size:1e4},J({...i}).then(p=>{e(p.lists.map(c=>(c.leaf=c.is_children==0,y.value=!1,c)))})}},L=k({type:[{required:!0,message:"\u8BF7\u8F93\u5165\u8868\u5355\u7C7B\u578B",trigger:["blur"]}],title:[{required:!0,message:"\u8BF7\u8F93\u5165\u8868\u5355\u540D\u79F0",trigger:["blur"]}],cate_ids:[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u54C1\u5206\u7C7B",trigger:["blur"]}]}),R=async t=>{for(const e in l)t[e]!=null&&t[e]!=null&&(l[e]=t[e])},Z=async()=>{var e,s;await((e=C.value)==null?void 0:e.validate());const t={...l};f.value=="edit"?await ee(t):await $(t),(s=m.value)==null||s.close(),B("success")},U=(t="add")=>{var e;f.value=t,(e=m.value)==null||e.open()},q=()=>{B("close")};return w({open:U,setFormData:R}),(t,e)=>{const s=j,i=K,p=M,c=G,O=T,S=H,I=P;return b(),z("div",te,[u(I,{ref_key:"popupRef",ref:m,title:o(h),async:!0,width:"550px",onConfirm:Z,onClose:q},{default:n(()=>[u(S,{ref_key:"formRef",ref:C,model:o(l),"label-width":"90px",rules:o(L)},{default:n(()=>[u(p,{label:"\u7C7B\u578B",prop:"type"},{default:n(()=>[u(i,{modelValue:o(l).type,"onUpdate:modelValue":e[0]||(e[0]=r=>o(l).type=r),placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B"},{default:n(()=>[u(s,{label:"\u5168\u90E8",value:""}),(b(!0),z(W,null,X(a.dictData.activity_zone,(r,N)=>(b(),Y(s,{key:N,label:r.remark,value:r.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(p,{label:"\u8868\u5355\u6807\u9898",prop:"title"},{default:n(()=>[u(c,{modelValue:o(l).title,"onUpdate:modelValue":e[1]||(e[1]=r=>o(l).title=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8868\u5355\u6807\u9898"},null,8,["modelValue"])]),_:1}),u(p,{label:"\u5546\u54C1\u5206\u7C7B",prop:"cate_ids"},{default:n(()=>[u(O,{class:"w-[500px]",modelValue:o(l).cate_ids,"onUpdate:modelValue":e[2]||(e[2]=r=>o(l).cate_ids=r),filterable:"",clearable:"","before-filter":A,props:g,placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1\u5206\u7C7B"},null,8,["modelValue"])]),_:1}),u(p,{label:"\u5907\u6CE8",prop:"remark"},{default:n(()=>[u(c,{rows:3,type:"textarea",modelValue:o(l).remark,"onUpdate:modelValue":e[3]||(e[3]=r=>o(l).remark=r),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{ce as _,ie as a,pe as b,ne as c};
