1 |
- /* empty css *//* empty css */import{d as e,q as a,z as l,o as t,l as o,w as s,c as r,F as n,p as i,I as u,aA as c,aB as d,X as p,cG as m,a7 as v,cs as b,_ as f,a as _,b as y,e as g,t as h,A as j,a1 as k,cI as x}from"./index-fe6c8641.js";/* empty css *//* empty css *//* empty css *//* empty css */import{e as w}from"./index-677364c7.js";import"./http-3c23965b.js";const $=e({__name:"index",props:{meta:Object},emits:["change"],setup(e,{emit:p}){const m=e,v=a([]);a([]);const b=a({page:1,limit:5});m.meta&&m.meta;const f=e=>{b.value.page=Number(e)+1,p("change",b.value)};return l((()=>{(()=>{const e=m.meta.limit,a=m.meta.total,l=Math.ceil(a/e);for(let t=0;t<l;t++){const o=t*e+1;let s;s=t===l-1?o===a?`${a}`:`${o}-${a}`:`${o}-${t===l-1?a:(t+1)*e}`,v.value[t]={title:s,page:l},v.value}})()})),(e,a)=>{const l=c,p=d;return t(),o(p,{onTabChange:f},{default:s((()=>[(t(!0),r(n,null,i(v.value,((a,r)=>(t(),o(l,{label:a.title,key:r},{default:s((()=>[u(e.$slots,"content")])),_:2},1032,["label"])))),128))])),_:3})}}});const C=f(e({components:{ElButton:p},props:{urls:{type:Array,required:!0},fileName:{type:String,default:""}},setup:e=>({download:()=>{const a=m.service({text:"正在解析视频",background:"rgba(0,0,0,.2)"});if(!e.urls.length)return void v.error("没有可下载的文件");const l=document.createElement("a");l.style.display="none",l.href="#",document.body.appendChild(l),e.urls.forEach((t=>{b.get(t.download_video_url,{responseType:"blob"}).then((o=>{l.download=`《${e.fileName}》${t.series_name}.mp4`;const s=new Blob([o.data]),r=URL.createObjectURL(s);l.href=r,l.click(),URL.revokeObjectURL(r),a.close()})).catch((e=>{console.error(e),v.error("下载失败"),a.close()}))}))}})}),[["render",function(e,a,l,o,n,i){const u=p;return t(),r("div",null,[_(u,{type:"primary",onClick:e.download},{default:s((()=>[y("下载")])),_:1},8,["onClick"])])}]]),N={class:"wrapper"},L=["src"],R={class:"video-wrapper"},U={class:"flex items-center justify-between h-10"},V={class:"text-base font-medium"},q={class:"ml-2 text-lg font-bold text-dark-600"},A=f(e({__name:"videoDL",props:{primary:String|Number},setup(e){const u=e,c=a(),d=a([]),p=a({page:1,limit:5}),m=a([]);u.primary;const v=a({}),b=a({}),f=a([]),A=e=>{w({video_id:u.primary.id,...e}).then((e=>{m.value=e.data,v.value={limit:e.limit,total:e.total}}))},B=e=>{p.value.page=Number(e.page),A(p.value)};return l((()=>{A(p.value)})),(e,a)=>{const l=C,p=k,w=x,A=$;return t(),r("div",N,[(t(),r("video",{id:"my-player",key:b.value.public_video_url,class:"video-js",controls:"",autoplay:"",preload:"auto",ref_key:"myVideo",ref:c},[g("source",{src:b.value.public_video_url,type:"video/mp4"},null,8,L)])),g("div",R,[g("div",U,[g("div",V,[y("剧名: "),g("span",q,h(u.primary.name),1)]),d.value.length>0?(t(),o(l,{key:0,urls:f.value,fileName:u.primary.name},null,8,["urls","fileName"])):j("",!0)]),v.value.total?(t(),o(A,{key:0,meta:v.value,onChange:B},{content:s((()=>[_(w,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=e=>d.value=e),size:"large",class:"flex items-center"},{default:s((()=>[(t(!0),r(n,null,i(m.value,((e,a)=>(t(),o(p,{border:"",class:"video-item",onChange:a=>(e=>{b.value=d.value.find((a=>a.public_video_url==e.public_video_url))??{},f.value=d.value,f.value})(e),key:a,label:e},{default:s((()=>[y(h(e.series_sequence),1)])),_:2},1032,["onChange","label"])))),128))])),_:1},8,["modelValue"])])),_:1},8,["meta"])):j("",!0)])])}}}),[["__scopeId","data-v-04d26fc2"]]);export{A as default};
|