2 lines
9.8 KiB
JavaScript
2 lines
9.8 KiB
JavaScript
import{B as C}from"./sroyubh1.js";import{d as M,H as E,J as Q,r as p,a0 as Y,F as c,z as r,D as u,A as o,C as n,B as x,I as a,y as B,a2 as P,a1 as V,T as y,E as q,ad as L,S as z,a3 as O,d4 as G,u as ee,h as le,as as ae,o as te,d5 as se,ah as ne,a6 as oe,ai as ue,d6 as re,d7 as ie}from"./BAjARngS.js";import{e as A}from"./DWEdiVkG.js";import{i as I}from"./BpD_6mz8.js";import{B as U}from"./B7wqwN_w.js";import{B as de}from"./3l5V6q_Q.js";import{B as ve,a as pe}from"./CscPGYs4.js";import{B as me}from"./CDHaK7Br.js";import{B as K}from"./DlKYmSOP.js";import{I as b}from"./7u7LQCxB.js";import{B as ce}from"./CLgN2r-F.js";import{S as W}from"./n5o86z8W.js";import{N as fe,Q as ge,V as be}from"./M7tOD7sj.js";import{d as ye,F as xe}from"./Lb6ve5HJ.js";const we={class:"px-4 pb-4 flex flex-col justify-between h-70vh"},ke={class:"flex flex-col gap-2 mt-5 mb-5"},Se={flex:"","p-2":""},_e={"mt-1":"","font-semibold":""},he={class:"max-h-[50vh] overflow-auto"},Ue=["onClick"],Ce=M({__name:"JobSelector",props:{open:{type:Boolean},id:{}},emits:["update:open","setField"],setup(D,{emit:S}){const s=E();Q();const g=p(null),w=p([]);p();const H=D,_=S,k=p();function h(v,f=null){return v.filter(m=>m.parent_id===f).map(m=>({...m,children:h(v,m.id)}))}const j=async()=>{try{y.value=!0;const v=await G();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()}Y(H,v=>{v.open?e():N()});const R=v=>{N(),_("setField",v)};return(v,f)=>{const m=W;return r(),c(ce,{title:"",ref_key:"sheetRef",ref:g,headerCls:"",closeOnClickOutside:"",onOnClickOutside:f[0]||(f[0]=i=>_("update:open",!1)),onOnClose:f[1]||(f[1]=i=>_("update:open",!1))},{header:u(()=>f[2]||(f[2]=[o("div",null,null,-1)])),default:u(()=>[o("div",we,[o("div",ke,[o("div",null,[o("div",Se,[o("div",_e,x(a(s).useString("allCollection")),1)]),n(m,{spinning:a(y)},{default:u(()=>[o("div",he,[(r(!0),B(V,null,P(w.value,i=>(r(),c(a(fe),{as:"div",class:"mt-2"},{default:u(({open:F})=>[n(a(ge),{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:R(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?a(s).isNightStore?"text-gray-2":"text-gray-8":a(s).isNightStore?"text-gray-2":"text-gray-8"]])},[o("span",null,[n(C,{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(),c(C,{key:0,class:O([F?"":"rotate-180","transform"]),icon:"tabler:chevron-up"},null,8,["class"])):z("",!0)]),_:2},1032,["onClick"]),n(a(be),{class:"px-4 flex flex-col gap-2 text-sm mt2 mb5"},{default:u(()=>[(r(!0),B(V,null,P(i?.children,$=>(r(),B("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 ":"",a(s).isNightStore?"text-gray-2":"text-gray-8"]]),onClick:J=>R($)},[o("span",null,[n(C,{icon:"vuesax-linear:component"})]),o("span",null,x($.title),1)],10,Ue))),256))]),_:2},1024)]),_:2},1024))),256))])]),_:1},8,["spinning"])])]),n(K,{block:"",class:"!h-unset !rounded-lg mt-5",onClick:N},{default:u(()=>[q(x(a(s).useString("close")),1)]),_:1})])]),_:1},512)}}}),Be={class:"px-4 flex items-center justify-between"},He={class:"flex gap-5 py-4"},Ne={class:"font-semibold"},$e={class:"pt-4rem pb-6rem overflow-y-auto"},Oe={class:"w-full flex justify-center"},je=["alt"],Re={class:"px-1rem mt-2rem"},Ie={class:"flex items-center"},ze={key:0,class:"text-gray-3 mt2 mr2"},Ke=M({__name:"index",setup(D){const S=ee(),s=E(),g=Q(),w=p(!1),H=p(""),_=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 R(){w.value=!0,H.value=e.value.avatar}function v(d){e.value.avatar=d}function f(){_.va
|