import{a0 as x,D as W,C as A,F as M}from"./element-plus.9cae3cb1.js";import{P as T}from"./index.b375235f.js";import{r as s}from"./index.7f83e315.js";import"./lodash.fc1b942f.js";import"./dayjs.37feae28.js";import{a as q}from"./goods.da5748c3.js";import{d as B,s as k,r as w,b as G,_ as y,o as I,c as L,V as u,M as n,u as a}from"./@vue.96c135a1.js";function $(r){return s.get({url:"/platform_rule.performance_worker_rules/lists",params:r})}function S(r){return s.post({url:"/platform_rule.performance_worker_rules/add",params:r})}function U(r){return s.post({url:"/platform_rule.performance_worker_rules/edit",params:r})}function ee(r){return s.post({url:"/platform_rule.performance_worker_rules/delete",params:r})}function j(r){return s.get({url:"/platform_rule.performance_worker_rules/detail",params:r})}const N={class:"edit-popup"},O=B({name:"performanceWorkerRulesEdit"}),oe=B({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(r,{expose:D,emit:F}){const d=F,m=k(),c=k(),i=w("add"),v=G(()=>i.value=="edit"?"\u7F16\u8F91\u5DE5\u7A0B\u5E08\u52A0\u5355\u5956\u52B1":"\u65B0\u589E\u5DE5\u7A0B\u5E08\u52A0\u5355\u5956\u52B1"),t=y({id:"",goods_category_ids:[],rate:""}),E=y({rate:[{required:!0,message:"\u8BF7\u8F93\u5165\u63D0\u6210\u6BD4\u4F8B",trigger:["blur"]}]}),f=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e]);console.log(t)},R=async o=>{const e=await j({id:o.id});f(e)},C=async()=>{var e,l;await((e=m.value)==null?void 0:e.validate());const o={...t};i.value=="edit"?await U(o):await S(o),(l=c.value)==null||l.close(),d("success")},b=(o="add")=>{var e;i.value=o,(e=c.value)==null||e.open()},h=()=>{d("close")},_=w([]);return(async()=>{const o=await q({});_.value=o})(),D({open:b,setFormData:f,getDetail:R}),(o,e)=>{const l=x,g=W,P=A,V=M;return I(),L("div",N,[u(T,{ref_key:"popupRef",ref:c,title:a(v),async:!0,width:"550px",onConfirm:C,onClose:h},{default:n(()=>[u(V,{ref_key:"formRef",ref:m,model:a(t),"label-width":"90px",rules:a(E)},{default:n(()=>[u(g,{label:"\u5206\u7C7B\u96C6\u5408",prop:"goods_category_ids"},{default:n(()=>[u(l,{modelValue:a(t).goods_category_ids,"onUpdate:modelValue":e[0]||(e[0]=p=>a(t).goods_category_ids=p),options:a(_),width:"500",props:{expandTrigger:"hover",checkStrictly:!1,multiple:!0,emitPath:!1},clearable:"",with:"300"},null,8,["modelValue","options"])]),_:1}),u(g,{label:"\u63D0\u6210\u6BD4\u4F8B",prop:"rate"},{default:n(()=>[u(P,{modelValue:a(t).rate,"onUpdate:modelValue":e[1]||(e[1]=p=>a(t).rate=p),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u63D0\u6210\u6BD4\u4F8B"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{oe as _,ee as a,$ as b};
