2 lines
9.8 KiB
JavaScript
2 lines
9.8 KiB
JavaScript
import{d as T,H as E,K as G,r as p,a4 as K,F as m,z as r,D as u,A as o,C as n,B as x,I as l,y as C,a6 as J,a5 as z,V as y,aL as Q,E as Y,ah as L,U as D,a7 as O,bD as q,u as ee,h as ae,aI as le,bE as te,o as se,bF as ne,ap as oe,aa as ue,an as re,ar as ie,N as de,a0 as ve,bG as pe,bH as ce}from"./BYv1load.js";import{B}from"./D-ODqOh1.js";import{e as M}from"./DWEdiVkG.js";import{i as R}from"./Bz3IdW9v.js";import{B as U}from"./B3A7H1Au.js";import{B as me}from"./BInDpaeT.js";import{B as fe,a as ge}from"./BuDFX7ij.js";import{B as be}from"./WJauvQ4P.js";import{B as W}from"./866GWx42.js";import{I as b}from"./DmgADoS6.js";import{B as ye}from"./QnL3siKh.js";import{N as xe,Q as we,V as ke}from"./DKHLutQT.js";const _e={class:"px-4 pb-4 flex flex-col justify-between h-70vh"},Se={class:"flex flex-col gap-2 mt-5 mb-5"},he={flex:"","p-2":""},Ue={"mt-1":"","font-semibold":""},Ce={class:"max-h-[50vh] overflow-auto"},Be=["onClick"],He=T({__name:"JobSelector",props:{open:{type:Boolean},id:{}},emits:["update:open","setField"],setup(F,{emit:_}){const s=E();G();const g=p(null),w=p([]);p();const H=F,S=_,k=p();function h(v,f=null){return v.filter(c=>c.parent_id===f).map(c=>({...c,children:h(v,c.id)}))}const j=async()=>{try{y.value=!0;const v=await q();w.value=h(v)}catch(v){console.log("e ===>",v)}finally{y.value=!1}};async function e(){H.id&&(k.value=H.id),w.value?.length==0&&j(),await L(),await g.value?.setOpen()}async function N(){await L(),await g.value?.setClose()}K(H,v=>{v.open?e():N()});const I=v=>{N(),S("setField",v)};return(v,f)=>{const c=Q;return r(),m(ye,{title:"",ref_key:"sheetRef",ref:g,headerCls:"",closeOnClickOutside:"",onOnClickOutside:f[0]||(f[0]=i=>S("update:open",!1)),onOnClose:f[1]||(f[1]=i=>S("update:open",!1))},{header:u(()=>f[2]||(f[2]=[o("div",null,null,-1)])),default:u(()=>[o("div",_e,[o("div",Se,[o("div",null,[o("div",he,[o("div",Ue,x(l(s).useString("allCollection")),1)]),n(c,{spinning:l(y)},{default:u(()=>[o("div",Ce,[(r(!0),C(z,null,J(w.value,i=>(r(),m(l(xe),{as:"div",class:"mt-2"},{default:u(({open:P})=>[n(l(we),{class:"flex w-full items-center rounded-lg px-4 justify-start text-sm focus:outline-none focus-visible:ring bg-transparent",onClick:()=>i?.children?.length?null:I(i)},{default:u(()=>[o("div",{class:O(["w-full flex items-center gap2 rounded-md p-2 text-start",[k.value===i.id?"border-primary border-solid border-1 ":"",i?.children?.length?l(s).isNightStore?"text-gray-2":"text-gray-8":l(s).isNightStore?"text-gray-2":"text-gray-8"]])},[o("span",null,[n(B,{icon:i?.children?.length?"vuesax-linear:main-component":"vuesax-linear:component"},null,8,["icon"])]),o("span",null,x(i.title),1)],2),i.children?.length?(r(),m(B,{key:0,class:O([P?"":"rotate-180","transform"]),icon:"tabler:chevron-up"},null,8,["class"])):D("",!0)]),_:2},1032,["onClick"]),n(l(ke),{class:"px-4 flex flex-col gap-2 text-sm mt2 mb5"},{default:u(()=>[(r(!0),C(z,null,J(i?.children,$=>(r(),C("div",{class:O(["w-full flex items-center gap2 rounded-md p-2 text-start ms2",[k.value===$.id?"border-primary border-solid border-1 ":"",l(s).isNightStore?"text-gray-2":"text-gray-8"]]),onClick:V=>I($)},[o("span",null,[n(B,{icon:"vuesax-linear:component"})]),o("span",null,x($.title),1)],10,Be))),256))]),_:2},1024)]),_:2},1024))),256))])]),_:1},8,["spinning"])])]),n(W,{block:"",class:"!h-unset !rounded-lg mt-5",onClick:N},{default:u(()=>[Y(x(l(s).useString("close")),1)]),_:1})])]),_:1},512)}}}),Ne={class:"px-4 flex items-center justify-between"},$e={class:"flex gap-5 py-4"},Oe={class:"font-semibold"},je={class:"pt-4rem pb-6rem overflow-y-auto"},Ie={class:"w-full flex justify-center"},Re=["alt"],De={class:"px-1rem mt-2rem"},Pe={class:"flex items-center"},ze={key:0,class:"text-gray-3 mt2 mr2"},qe=T({__name:"index",setup(F){const _=ee(),s=E(),g=G(),w=p(!1),H=p(""),S=p(),k=p(),h=p(),j=p([]),e=p({avatar:"",birthday:"",website:"",name:"",first_name:"",last_name:"",phone:"",email:"",bio:"",skill:""});function N(d){e.value.job=d.id,h.value=d}function I(){w.value=!0,H.value=e.value.avatar}function v(d){e.value.avatar=d}function f(){S.value.validateFields().then(async()=>{try
|