import{S as U,T as q,D as S,C as I,F as L}from"./element-plus.55d71530.js";import{d as b,s as C,r as O,b as N,_ as w,o as _,c as D,V as a,M as s,u as r,U as P,aa as T,L as j,a as f,O as z,W as G}from"./@vue.96c135a1.js";import{P as H}from"./index.8e3b20a1.js";import{r as n}from"./index.75e08341.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";function oe(t){return n.get({url:"/master_worker.master_worker_rule/lists",params:t})}function J(t){return n.post({url:"/master_worker.master_worker_rule/add",params:t})}function K(t){return n.post({url:"/master_worker.master_worker_rule/edit",params:t})}function ae(t){return n.post({url:"/master_worker.master_worker_rule/delete",params:t})}function Q(t){return n.get({url:"/master_worker.master_worker_rule/detail",params:t})}const X={class:"edit-popup"},Y={class:"form-tips"},Z=b({name:"masterWorkerRuleEdit"}),se=b({...Z,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(t,{expose:B,emit:v}){const F=v,E=C(),p=C(),c=O("add"),V=N(()=>c.value=="edit"?"\u7F16\u8F91\u5DE5\u7A0B\u5E08\u6D3E\u5355\u89C4\u5219\u8868":"\u65B0\u589E\u5DE5\u7A0B\u5E08\u6D3E\u5355\u89C4\u5219\u8868"),u=w({id:"",rule_name:"",description:"",sort:"",scene_id:""}),g=w({rule_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u89C4\u5219\u540D\u79F0",trigger:["blur"]}],scene_id:[{required:!0,message:"\u8BF7\u9009\u62E9\u573A\u666F",trigger:["blur"]}],description:[{required:!0,message:"\u8BF7\u8F93\u5165\u89C4\u5219\u503C",trigger:["blur"]}]}),k=async l=>{for(const e in u)l[e]!=null&&l[e]!=null&&(u[e]=l[e])},R=async l=>{const e=await Q({id:l.id});k(e)},A=async()=>{var e,i;await((e=E.value)==null?void 0:e.validate());const l={...u};c.value=="edit"?await K(l):await J(l),(i=p.value)==null||i.close(),F("success")},y=(l="add")=>{var e;c.value=l,(e=p.value)==null||e.open()},h=()=>{F("close")};return B({open:y,setFormData:k,getDetail:R}),(l,e)=>{const i=U,x=q,d=S,m=I,W=L;return _(),D("div",X,[a(H,{ref_key:"popupRef",ref:p,title:r(V),async:!0,width:"550px",onConfirm:A,onClose:h},{default:s(()=>[a(W,{ref_key:"formRef",ref:E,model:r(u),"label-width":"90px",rules:r(g)},{default:s(()=>[a(d,{label:"\u573A\u666F",prop:"scene_id"},{default:s(()=>[a(x,{class:"flex-1",modelValue:r(u).scene_id,"onUpdate:modelValue":e[0]||(e[0]=o=>r(u).scene_id=o),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u573A\u666F"},{default:s(()=>[(_(!0),D(P,null,T(t.dictData.worker_scene_id,(o,M)=>(_(),j(i,{key:M,label:o.name,value:parseInt(o.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(d,{label:"\u89C4\u5219\u540D\u79F0",prop:"rule_name"},{default:s(()=>[a(m,{modelValue:r(u).rule_name,"onUpdate:modelValue":e[1]||(e[1]=o=>r(u).rule_name=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(d,{label:"\u89C4\u5219\u503C",prop:"description"},{default:s(()=>[a(m,{modelValue:r(u).description,"onUpdate:modelValue":e[2]||(e[2]=o=>r(u).description=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u503C"},null,8,["modelValue"]),f("div",Y,[f("div",null,[z(f("span",null,"\u89C4\u5219\u503C\u8BF4\u660E\uFF1A\u7ECF\u5EA6,\u7EAC\u5EA6,\u8DDD\u79BB(\u7C73)\u3002\u4E4B\u95F4\u7528\u82F1\u6587\u9017\u53F7\u9694\u5F00",512),[[G,r(u).scene_id=="103"]])])])]),_:1}),a(d,{label:"\u6392\u5E8F",prop:"sort"},{default:s(()=>[a(m,{modelValue:r(u).sort,"onUpdate:modelValue":e[3]||(e[3]=o=>r(u).sort=o),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{se as _,ae as a,oe as b};
