2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{B as H}from"./fSnp-cKK.js";import{d as E,G,J as Q,r as c,a0 as Y,F as m,z as v,D as i,A as r,C as o,B as x,H as t,y as N,a2 as P,a1 as I,T as w,E as q,ac as M,S as J,a3 as R,d4 as K,u as ee,h as le,at as ae,d5 as te,o as se,d6 as ne,ai as oe,a6 as re,ah as ue,aj as ie,d7 as de}from"./CwKn53hw.js";import{e as A}from"./DWEdiVkG.js";import{i as D}from"./CqiG-ZxM.js";import{_ as $}from"./K7xQsdil.js";/* empty css */import{_ as ve}from"./Dv4ra97r.js";import{_ as pe,a as ce}from"./DjTUbjKF.js";import{_ as fe}from"./DWqpXcs9.js";import{_ as W}from"./CfNh9OFJ.js";/* empty css */import{_}from"./DsJUqIrb.js";import{B as me}from"./DdjqH3QY.js";import{S as X}from"./BvGIWt3c.js";import{N as ge,Q as be,V as ye}from"./vYGQJoxU.js";import{F as _e}from"./C6tgcEro.js";const we={class:"px-4 pb-4 flex flex-col justify-between h-70vh"},xe={class:"flex flex-col gap-2 mt-5 mb-5"},ke={flex:"","p-2":""},Se={"mt-1":"","font-semibold":""},he={class:"max-h-[50vh] overflow-auto"},Ce=["onClick"],Ue=E({__name:"JobSelector",props:{open:{type:Boolean},id:{}},emits:["update:open","setField"],setup(L,{emit:h}){const s=G();Q();const g=c(null),k=c([]);c();const j=L,C=h,S=c();function U(u,p=null){return u.filter(f=>f.parent_id===p).map(f=>({...f,children:U(u,f.id)}))}const F=async()=>{try{w.value=!0;const u=await K();k.value=U(u)}catch(u){console.log("e ===>",u)}finally{w.value=!1}};async function e(){var u,p;j.id&&(S.value=j.id),((u=k.value)==null?void 0:u.length)==0&&F(),await M(),await((p=g.value)==null?void 0:p.setOpen())}async function O(){var u;await M(),await((u=g.value)==null?void 0:u.setClose())}Y(j,u=>{u.open?e():O()});const V=u=>{O(),C("setField",u)};return(u,p)=>{const f=X;return v(),m(me,{title:"",ref_key:"sheetRef",ref:g,headerCls:"",closeOnClickOutside:"",onOnClickOutside:p[0]||(p[0]=n=>C("update:open",!1)),onOnClose:p[1]||(p[1]=n=>C("update:open",!1))},{header:i(()=>p[2]||(p[2]=[r("div",null,null,-1)])),default:i(()=>[r("div",we,[r("div",xe,[r("div",null,[r("div",ke,[r("div",Se,x(t(s).useString("allCollection")),1)]),o(f,{spinning:t(w)},{default:i(()=>[r("div",he,[(v(!0),N(I,null,P(k.value,n=>(v(),m(t(ge),{as:"div",class:"mt-2"},{default:i(({open:T})=>[o(t(be),{class:"flex w-full items-center rounded-lg px-4 justify-start text-sm focus:outline-none focus-visible:ring bg-transparent",onClick:()=>{var b;return(b=n==null?void 0:n.children)!=null&&b.length?null:V(n)}},{default:i(()=>{var b,z,d;return[r("div",{class:R(["w-full flex items-center gap2 rounded-md p-2 font-azar text-start",[S.value===n.id?"border-primary border-solid border-1 ":"",(b=n==null?void 0:n.children)!=null&&b.length?t(s).isNightStore?"text-gray-2":"text-gray-8":t(s).isNightStore?"text-gray-2":"text-gray-8"]])},[r("span",null,[o(H,{icon:(z=n==null?void 0:n.children)!=null&&z.length?"vuesax-linear:main-component":"vuesax-linear:component"},null,8,["icon"])]),r("span",null,x(n.title),1)],2),(d=n.children)!=null&&d.length?(v(),m(H,{key:0,class:R([T?"":"rotate-180","transform"]),icon:"tabler:chevron-up"},null,8,["class"])):J("",!0)]}),_:2},1032,["onClick"]),o(t(ye),{class:"px-4 flex flex-col gap-2 text-sm mt2 mb5"},{default:i(()=>[(v(!0),N(I,null,P(n==null?void 0:n.children,b=>(v(),N("div",{class:R(["w-full flex items-center gap2 rounded-md p-2 font-azar text-start ms2",[S.value===b.id?"border-primary border-solid border-1 ":"",t(s).isNightStore?"text-gray-2":"text-gray-8"]]),onClick:z=>V(b)},[r("span",null,[o(H,{icon:"vuesax-linear:component"})]),r("span",null,x(b.title),1)],10,Ce))),256))]),_:2},1024)]),_:2},1024))),256))])]),_:1},8,["spinning"])])]),o(W,{block:"",class:"!h-unset !rounded-lg mt-5",onClick:O},{default:i(()=>[q(x(t(s).useString("close")),1)]),_:1})])]),_:1},512)}}}),$e={class:"px-4 flex items-center justify-between"},He={class:"flex gap-5 py-4"},Ne={class:"font-semibold"},je={class:"pt-4rem pb-6rem overflow-y-auto"},Oe={class:"w-full flex justify-center"},ze=["alt"],Be={class:"px-1rem mt-2rem"},Re={class:"flex items-center"},Fe={key:0,class:"text-gray-3 mt2 mr2"},Xe=E({__name:"index",setup(L){const h=ee(),s=G(),g=Q(),k=c(!1),j=c(""),C=c(),S=
|