import{C as v,D as I,F as y}from"./element-plus.9cae3cb1.js";import{P as x}from"./index.3b15f80f.js";import{a as R,b as h,c as q}from"./master_worker_credential_images.5de2572f.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as f,s as _,r as M,b as U,_ as c,o as W,c as P,V as r,M as s,u as a}from"./@vue.96c135a1.js";const j={class:"edit-popup"},A=f({name:"masterWorkerCredentialImagesEdit"}),J=f({...A,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(N,{expose:C,emit:g}){const n=g,p=_(),d=_(),m=M("add"),E=U(()=>m.value=="edit"?"\u7F16\u8F91\u5E08\u5085\u8BC1\u4EF6\u7167\u7247\u8868":"\u65B0\u589E\u5E08\u5085\u8BC1\u4EF6\u7167\u7247\u8868"),u=c({id:"",worker_register_id:"",image:"",start_time:"",end_time:""}),B=c({worker_register_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u6CE8\u518C\u8868ID",trigger:["blur"]}],image:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u7167\u7247",trigger:["blur"]}],start_time:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4",trigger:["blur"]}],end_time:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u7ED3\u675F\u65F6\u95F4",trigger:["blur"]}]}),F=async t=>{for(const e in u)t[e]!=null&&t[e]!=null&&(u[e]=t[e])},b=async t=>{const e=await R({id:t.id});F(e)},k=async()=>{var e,o;await((e=p.value)==null?void 0:e.validate());const t={...u};m.value=="edit"?await h(t):await q(t),(o=d.value)==null||o.close(),n("success")},V=(t="add")=>{var e;m.value=t,(e=d.value)==null||e.open()},w=()=>{n("close")};return C({open:V,setFormData:F,getDetail:b}),(t,e)=>{const o=v,i=I,D=y;return W(),P("div",j,[r(x,{ref_key:"popupRef",ref:d,title:a(E),async:!0,width:"550px",onConfirm:k,onClose:w},{default:s(()=>[r(D,{ref_key:"formRef",ref:p,model:a(u),"label-width":"90px",rules:a(B)},{default:s(()=>[r(i,{label:"\u6CE8\u518C\u8868ID",prop:"worker_register_id"},{default:s(()=>[r(o,{modelValue:a(u).worker_register_id,"onUpdate:modelValue":e[0]||(e[0]=l=>a(u).worker_register_id=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6CE8\u518C\u8868ID"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u8BC1\u4EF6\u7167\u7247",prop:"image"},{default:s(()=>[r(o,{modelValue:a(u).image,"onUpdate:modelValue":e[1]||(e[1]=l=>a(u).image=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u7167\u7247"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4",prop:"start_time"},{default:s(()=>[r(o,{modelValue:a(u).start_time,"onUpdate:modelValue":e[2]||(e[2]=l=>a(u).start_time=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4"},null,8,["modelValue"])]),_:1}),r(i,{label:"\u8BC1\u4EF6\u7ED3\u675F\u65F6\u95F4",prop:"end_time"},{default:s(()=>[r(o,{modelValue:a(u).end_time,"onUpdate:modelValue":e[3]||(e[3]=l=>a(u).end_time=l),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u7ED3\u675F\u65F6\u95F4"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{J as _};
