2 lines
6.6 KiB
Python
2 lines
6.6 KiB
Python
import{r as k,i as D,g as _,a as E,u as j,t as H}from"./base-3569949a.js";import{u as M,a as G,_ as K,E as U}from"./CardTools.vue_vue_type_script_setup_true_lang-0a431899.js";import{E as Y,a as Z}from"./el-col-6cef30e9.js";import{u as J,E as Q}from"./el-button-cb4d7ad5.js";import{E as W}from"./el-tag-2075124c.js";import{r as L,a as N,c as X,t as ee,d as F,h as y,w as b,b as P,e as d,v as te,T as oe,n as R,i as O,f as q,g as le,j as ne,u as ae,k as se,o as re,l as ue,m as S,p as V,F as ie,q as ce,s as x,x as $,y as I,z as de}from"./index-4cf91ffb.js";import{r as fe}from"./request-53aeb44c.js";import"./focus-trap-82046fc4.js";import"./vnode-5a4b610e.js";function ve(t){let e;const o=L(!1),l=N({...t,originalPosition:"",originalOverflow:"",visible:!1});function r(n){l.text=n}function a(){const n=l.parent,f=i.ns;if(!n.vLoadingAddClassList){let v=n.getAttribute("loading-number");v=Number.parseInt(v)-1,v?n.setAttribute("loading-number",v.toString()):(k(n,f.bm("parent","relative")),n.removeAttribute("loading-number")),k(n,f.bm("parent","hidden"))}u(),p.unmount()}function u(){var n,f;(f=(n=i.$el)==null?void 0:n.parentNode)==null||f.removeChild(i.$el)}function g(){var n;t.beforeClose&&!t.beforeClose()||(o.value=!0,clearTimeout(e),e=window.setTimeout(c,400),l.visible=!1,(n=t.closed)==null||n.call(t))}function c(){if(!o.value)return;const n=l.parent;o.value=!1,n.vLoadingAddClassList=void 0,a()}const s=F({name:"ElLoading",setup(n,{expose:f}){const{ns:v,zIndex:h}=J("loading");return f({ns:v,zIndex:h}),()=>{const m=l.spinner||l.svg,B=y("svg",{class:"circular",viewBox:l.svgViewBox?l.svgViewBox:"0 0 50 50",...m?{innerHTML:m}:{}},[y("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),z=l.text?y("p",{class:v.b("text")},[l.text]):void 0;return y(oe,{name:v.b("fade"),onAfterLeave:c},{default:b(()=>[P(d("div",{style:{backgroundColor:l.background||""},class:[v.b("mask"),l.customClass,l.fullscreen?"is-fullscreen":""]},[y("div",{class:v.b("spinner")},[B,z])]),[[te,l.visible]])])})}}}),p=X(s),i=p.mount(document.createElement("div"));return{...ee(l),setText:r,removeElLoadingChild:u,close:g,handleAfterLeave:c,vm:i,get $el(){return i.$el}}}let C;const me=function(t={}){if(!D)return;const e=ge(t);if(e.fullscreen&&C)return C;const o=ve({...e,closed:()=>{var r;(r=e.closed)==null||r.call(e),e.fullscreen&&(C=void 0)}});pe(e,e.parent,o),A(e,e.parent,o),e.parent.vLoadingAddClassList=()=>A(e,e.parent,o);let l=e.parent.getAttribute("loading-number");return l?l=`${Number.parseInt(l)+1}`:l="1",e.parent.setAttribute("loading-number",l),e.parent.appendChild(o.$el),R(()=>o.visible.value=e.visible),e.fullscreen&&(C=o),o},ge=t=>{var e,o,l,r;let a;return O(t.target)?a=(e=document.querySelector(t.target))!=null?e:document.body:a=t.target||document.body,{parent:a===document.body||t.body?document.body:a,background:t.background||"",svg:t.svg||"",svgViewBox:t.svgViewBox||"",spinner:t.spinner||!1,text:t.text||"",fullscreen:a===document.body&&((o=t.fullscreen)!=null?o:!0),lock:(l=t.lock)!=null?l:!1,customClass:t.customClass||"",visible:(r=t.visible)!=null?r:!0,target:a}},pe=async(t,e,o)=>{const{nextZIndex:l}=o.vm.zIndex||o.vm._.exposed.zIndex,r={};if(t.fullscreen)o.originalPosition.value=_(document.body,"position"),o.originalOverflow.value=_(document.body,"overflow"),r.zIndex=l();else if(t.parent===document.body){o.originalPosition.value=_(document.body,"position"),await R();for(const a of["top","left"]){const u=a==="top"?"scrollTop":"scrollLeft";r[a]=`${t.target.getBoundingClientRect()[a]+document.body[u]+document.documentElement[u]-Number.parseInt(_(document.body,`margin-${a}`),10)}px`}for(const a of["height","width"])r[a]=`${t.target.getBoundingClientRect()[a]}px`}else o.originalPosition.value=_(e,"position");for(const[a,u]of Object.entries(r))o.$el.style[a]=u},A=(t,e,o)=>{const l=o.vm.ns||o.vm._.exposed.ns;["absolute","fixed","sticky"].includes(o.originalPosition.value)?k(e,l.bm("parent","relative")):E(e,l.bm("parent","relative")),t.fullscreen&&t.lock?E(e,l.bm("parent","hidden")):k(e,l.bm("parent","hidden"))},w=Symbol("ElLoading"),T=(t,e)=>{var o,l,r,a;const u=e.instance,g=n=>q(e.value)?e.value[n]:void 0,c=n=>{const f=O(n)&&(u==null?void 0:u[n])||n;return f&&L(f)},s=n=>c(g(n)||t.getAttribute(`element-loading-${ne(n)}`)),p=(o=g("fullscreen"))!=null?o:e.modifiers.fullscreen,i={text:s("text"),svg:s("svg"),svgViewBox:s("svgViewBox"),spinner:s("spinner"),background:s("background"),customClass:s("customClass"),fullscreen:p,target:(l=g("target"))!=null?l:p?void 0:t,body:(r=g("body"))!=null?r:e.modifiers.body,lock:(a=g("lock"))!=null?a:e.modifiers.lock};t[w]={options:i,instance:me(i)}},be=(t,e)=>{for(const o of Object.keys(e))le(e[o])&&(e[o].value=t[o])},_e={mounted(t,e){e.value&&T(t,e)},updated(t,e){const o=t[w];e.oldValue!==e.value&&(e.value&&!e.oldValue?T(t,e):e.value&&e.oldValue?q(e.value)&&be(e.value,o.options):o==null||o.instance.close())},unmounted(t){var e;(e=t[w])==null||e.instance.close()}};const ye=I("div",{style:{"text-align":"center","margin-top":"1rem",color:"#606266"}},[I("a",{style:{"text-decoration":"none",color:"#606266"},target:"_blank",href:"https://github.com/vastsa/FileCodeBox"},"FileCodeBox V2.0 Beta")],-1),Ve=F({__name:"HomeView",setup(t){const e=M(),o=G(),l=ae(),r=se(),a=L(""),u=N({readonly:!1,loading:!1});re(()=>{const c=r.query.code;c&&(a.value=c)}),ue(a,c=>{c.length===5&&(u.readonly=!0,u.loading=!0,fe({url:"/share/select/",method:"POST",data:{code:c}}).then(s=>{e.showFileBox=!0;let p=!0;o.receiveData.forEach(i=>{if(i.code===s.detail.code){p=!1;return}}),p&&o.addReceiveData(s.detail)}).finally(()=>{u.readonly=!1,u.loading=!1,a.value=""}))});const g=c=>{a.value.length<5&&(a.value+=c)};return(c,s)=>{const p=W,i=Y,n=Q,f=Z,v=U,h=_e;return S(),V("main",null,[d(v,{class:"card",style:{"padding-bottom":"1rem"}},{default:b(()=>[d(K),d(f,{style:{"text-align":"center"}},{default:b(()=>[d(i,{span:24},{default:b(()=>[P(d(p,{readonly:u.readonly,modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=m=>a.value=m),class:"code-input",round:"",autofocus:"",clearable:"",maxlength:"5",placeholder:"请输入五位取件码"},null,8,["readonly","modelValue"]),[[h,u.loading]])]),_:1}),(S(),V(ie,null,ce(9,m=>d(i,{span:8,key:m},{default:b(()=>[d(n,{class:"key-button",round:"",onClick:B=>g(m)},{default:b(()=>[$(de(m),1)]),_:2},1032,["onClick"])]),_:2},1024)),64)),d(i,{span:8},{default:b(()=>[d(n,{onClick:s[1]||(s[1]=m=>x(l).push({name:"send"})),class:"key-button",icon:x(j),round:""},null,8,["icon"])]),_:1}),d(i,{span:8},{default:b(()=>[d(n,{class:"key-button",round:"",onClick:s[2]||(s[2]=m=>g(0))},{default:b(()=>[$("0")]),_:1})]),_:1}),d(i,{span:8},{default:b(()=>[d(n,{class:"key-button",round:"",icon:x(H),onClick:s[3]||(s[3]=m=>x(e).showFileBox=!0)},null,8,["icon"])]),_:1})]),_:1})]),_:1}),ye])}}});export{Ve as default};
|