import{Z as N,Y as Q,a3 as T,$ as Z,Q as $,b as q,D as z,C as A,F as G}from"./element-plus.9cae3cb1.js";import{P as H}from"./index.3b15f80f.js";import{d as J,b as K}from"./master_worker_credential_images.5de2572f.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as b,s as v,r as X,b as ee,_ as g,o as c,c as F,V as e,M as r,u as i,U as D,aa as B,L as y}from"./@vue.96c135a1.js";import"./lodash-es.bdeecbdb.js";import"./async-validator.fb49d0f5.js";import"./@vueuse.f4694335.js";import"./@element-plus.07bd0514.js";import"./@ctrl.b082b0c1.js";import"./normalize-wheel-es.8aeb3683.js";import"./@popperjs.36402333.js";import"./index.60ed7c6d.js";import"./axios.c6b9fe3d.js";import"./@amap.8a62addd.js";import"./vue-router.64fdcd9a.js";import"./pinia.aebd7275.js";import"./css-color-function.7f53c13d.js";import"./color.4952d479.js";import"./clone.dd01d7ea.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.f73355d0.js";import"./vue-clipboard3.dca5bca3.js";import"./clipboard.16e4491b.js";import"./echarts.80787eb0.js";import"./tslib.60310f1a.js";import"./zrender.6f33727c.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.3d7ee361.js";const te={class:"edit-popup"},oe=b({name:"masterWorkerCredentialImagesEdit"}),Pe=b({...oe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(h,{expose:V,emit:I}){const k=I,E=v(),f=v(),w=X("add"),R=ee(()=>w.value=="edit"?"\u7F16\u8F91\u5E08\u5085\u8BC1\u4EF6\u7167\u7247\u8868":"\u65B0\u589E\u5E08\u5085\u8BC1\u4EF6\u7167\u7247\u8868"),m=g({credential_images:[],worker_register_id:""}),Y=async a=>{console.log("setWorkerRegisterId",a),m.worker_register_id=a.id;const o=a.credential_images;for(const l in o){const n=g({id:0,image_name:"",worker_register_id:a.id,image:o[l],start_time:"",end_time:""});m.credential_images[l]=n}console.log("setWorkerRegisterId",m)},t=g({worker_register_id:"",credential_images:[]}),M=g({}),U=async a=>{const o=await J({worker_register_id:m.worker_register_id});if(o.count==0)console.log("getDetail-no",o),t.worker_register_id=m.worker_register_id,t.credential_images=m.credential_images;else{console.log("getDetail-ok",o),t.worker_register_id=m.worker_register_id;var l=0;o.lists.forEach(n=>{console.log("getDetail-element",n),t.credential_images[l]=n,l++})}console.log("getDetail",t)},W=async()=>{var o,l;await((o=E.value)==null?void 0:o.validate());const a={...t};console.log("handleSubmit",a),await K(a),(l=f.value)==null||l.close(),k("success")},x=(a="add")=>{var o;w.value=a,(o=f.value)==null||o.open()},L=()=>{k("close")};return V({open:x,setWorkerRegisterId:Y,getDetail:U}),(a,o)=>{const l=$,n=q,p=z,d=N,P=A,C=Q,O=T,S=Z,j=G;return c(),F("div",te,[e(H,{ref_key:"popupRef",ref:f,title:i(R),async:!0,width:"80%",onConfirm:W,onClose:L},{default:r(()=>[e(j,{ref_key:"formRef",ref:E,model:i(t),rules:i(M)},{default:r(()=>[(c(!0),F(D,null,B(h.dictData.retention_money_status,(u,s)=>(c(),y(l,{key:s,label:u.name,value:parseInt(u.value)},null,8,["label","value"]))),128)),(c(!0),F(D,null,B(i(t).credential_images,(u,s)=>(c(),y(S,{key:s},{default:r(()=>[e(d,{span:4},{default:r(()=>[e(p,{label:"",prop:"item.image"},{default:r(()=>[e(n,{style:{width:"100%","max-height":"100%"},src:u.image,"preview-src-list":[u.image]},null,8,["src","preview-src-list"])]),_:2},1024)]),_:2},1024),e(d,{span:5},{default:r(()=>[e(p,{label:"\u8BC1\u4EF6\u540D\u79F0",prop:"item.image_name"},{default:r(()=>[e(P,{modelValue:i(t).credential_images[s].image_name,"onUpdate:modelValue":_=>i(t).credential_images[s].image_name=_,clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),e(d,{span:5},{default:r(()=>[e(p,{label:"\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4",prop:"item.start_time"},{default:r(()=>[e(C,{class:"flex-1 !flex",modelValue:i(t).credential_images[s].start_time,"onUpdate:modelValue":_=>i(t).credential_images[s].start_time=_,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),e(d,{span:5},{default:r(()=>[e(p,{label:"\u8BC1\u4EF6\u7ED3\u675F\u65F6\u95F4",prop:"item.end_time"},{default:r(()=>[e(C,{class:"flex-1 !flex",modelValue:i(t).credential_images[s].end_time,"onUpdate:modelValue":_=>i(t).credential_images[s].end_time=_,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4EF6\u5F00\u59CB\u65F6\u95F4"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),e(O)]),_:2},1024))),128))]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Pe as default};
