import{_ as U}from"./Modal.vue_vue_type_script_setup_true_lang-C3R_8Jnq.js";import{b3 as S,b4 as j,b5 as z}from"./template-rpthWlT9.js";import{d as F,f as M,V as R,r as x,a4 as $,aw as q,c as _,o as a,w as t,h as m,D as W,j as o,aI as G,p as E,A as y,l as d,B as J,i as N,U as K,F as Q,a9 as X,M as Y,W as Z,df as ee,N as te,ij as oe,n as ne,cS as se}from"./index-9PRMimni.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./BasicForm-dL_oCSPM.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./SingleImageUpload-CNx4b9eC.js";import"./ImageUpload.vue_vue_type_style_index_0_scoped_cb086928_lang-D-28kXvw.js";import"./componentSetting-DVhNDBTO.js";import"./ImageUpload-DUsnro3W.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./BasicUpload.vue_vue_type_style_index_0_scoped_a4d0e930_lang-DxRbtP01.js";import"./tabsView-BXskTdVh.js";import"./BasicForm.vue_vue_type_style_index_0_scoped_b9e995ec_lang-CEvcLwxD.js";import"./propTypes-CebMRUpe.js";import"./BasicSelect-C_uwzMkE.js";import"./BasicSelect.vue_vue_type_style_index_0_scoped_772d51cc_lang-Brp6PjEU.js";import"./dictionary-BRse4lkf.js";import"./index-DkvzUEqh.js";import"./index-kKnqLkWM.js";import"./AutoComplete-Dv1Bqed4.js";import"./TreeSelect-BZh2DeCh.js";import"./jobOrder-CGbsc7bp.js";import"./useModal-CO65vga3.js";import"./useForm-CKmgcynv.js";import"./usePageCache-DluHn7Yy.js";const ae={key:0,class:"flex justify-end"},ce={class:"flex justify-between absolute right-2 top-2 z-10 w-full"},ie={key:1},He=F({__name:"index",props:["isEdit"],setup(p){const w=M(),{id:f}=w.query,{t:g}=R(),h=x(),c={PHOTOUNABLE:0,PHOTOENABLED:1},i=$(()=>{const e=n.value.findIndex(s=>s.isDefault===c.PHOTOENABLED);return e===-1?null:{...n.value[e],index:e}}),n=x();function D(){h.value.showModal()}function O(e,s){e&&(i.value&&(i.value.isDefault=c.PHOTOUNABLE,n.value[i.value.index].checked=c.PHOTOENABLED),n.value[s].isDefault=e,P(n.value[s].id),console.log(i.value))}async function P(e){await S(e),await l()}async function l(){f&&(n.value=await j(f.toString()))}async function b(e){await z(e.id),await l()}return q(()=>{l()}),(e,s)=>{const k=J,B=G,C=te,T=ee,A=ne,L=se,v=Z,V=Y,H=K;return a(),_(v,{bordered:!1,class:"proCard"},{default:t(()=>[p.isEdit?(a(),m("div",ae,[o(B,{trigger:"hover"},{trigger:t(()=>[o(k,{type:"primary",strong:"",bordered:"",secondary:"",class:"size-8",onClick:D},{icon:t(()=>s[0]||(s[0]=[N("i",{class:"iconfont icon-ADD"},null,-1)])),_:1})]),default:t(()=>[E(" "+y(d(g)("common.addText")),1)]),_:1})])):W("",!0),o(H,{"x-gap":80,"y-gap":12,cols:5,class:"mt-4"},{default:t(()=>[(a(!0),m(Q,null,X(d(n),(r,I)=>(a(),_(V,{class:"flex flex-row w-[180px]"},{default:t(()=>[o(v,{segmented:"","content-class":"p-0 flex flex-col"},{default:t(()=>[N("div",ce,[p.isEdit?(a(),_(T,{key:0,onPositiveClick:u=>b(r)},{trigger:t(()=>[o(k,{text:"",class:"text-[20px] pl-3"},{default:t(()=>[o(C,null,{default:t(()=>[o(d(oe))]),_:1})]),_:1})]),default:t(()=>[E(" "+y(d(g)("common.dialogContentDeleteText")),1)]),_:2},1032,["onPositiveClick"])):(a(),m("div",ie)),o(A,{size:"large",checked:r.isDefault,"onUpdate:checked":u=>r.isDefault=u,"unchecked-value":c.PHOTOUNABLE,"checked-value":c.PHOTOENABLED,disabled:!p.isEdit,"on-update:checked":u=>O(u,I)},null,8,["checked","onUpdate:checked","unchecked-value","checked-value","disabled","on-update:checked"])]),o(L,{width:"100%",src:r.pictureUrl},null,8,["src"])]),_:2},1024)]),_:2},1024))),256))]),_:1}),o(U,{ref_key:"modalRef",ref:h,onSuccess:l},null,512)]),_:1})}}});export{He as default};
