import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-a13809b7.js";/* empty css             *//* empty css                          *//* empty css                    *//* empty css                  */import{d as a,S as l,b2 as t,a4 as s,aG as r,_ as o,o as i,c as n,a as u,w as p,b as d,m as c,x as m,e as v,t as b,z as _,l as y,F as f,y as g,b0 as h,Z as j,bi as w}from"./index-2b50ecca.js";/* empty css                   *//* empty css                 */import{a as x}from"./index-403f799c.js";/* empty css                    */import"./http-aa208300.js";/* empty css                 *//* empty css                   */const k=o(a({components:{ElButton:l},props:{urls:{type:Array,required:!0},fileName:{type:String,default:""}},setup:e=>({download:()=>{const a=t.service({text:"正在解析视频",background:"rgba(0,0,0,.2)"});if(!e.urls.length)return void s.error("没有可下载的文件");const l=document.createElement("a");l.style.display="none",l.href="#",document.body.appendChild(l),e.urls.forEach((t=>{r.get(t.download_video_url,{responseType:"blob"}).then((s=>{l.download=`《${e.fileName}》${t.series_name}.mp4`;const r=new Blob([s.data]),o=URL.createObjectURL(r);l.href=o,l.click(),URL.revokeObjectURL(o),a.close()})).catch((e=>{console.error(e),s.error("下载失败"),a.close()}))}))}})}),[["render",function(e,a,t,s,r,o){const c=l;return i(),n("div",null,[u(c,{type:"primary",onClick:e.download},{default:p((()=>[d("下载")])),_:1},8,["onClick"])])}]]),C={class:"wrapper"},N=["src"],L={class:"video-wrapper"},R={class:"flex items-center justify-between h-10"},U={class:"w-full text-base font-medium"},V={class:"ml-2 text-lg font-bold text-dark-600"},E={key:0},S=o(a({__name:"videoDL",props:{primary:String|Number},setup(a){const l=a,t=c(),s=c([]),r=c({page:1,limit:100}),o=c([]);l.primary;const S=c({}),q=c({}),z=c([]),B=e=>{x({video_id:l.primary.id,...e}).then((e=>{o.value=e.data,S.value={limit:e.limit,total:e.total}}))},O=e=>{r.value.page=Number(e.page),B(r.value)};return m((()=>{B(r.value)})),(a,r)=>{const c=h,m=k,x=j,B=w,$=e;return i(),n(f,null,[u(c,{title:"注：如需批量下载，则多选目标集数，点击下载按钮即可",type:"warning","show-icon":"",closable:!1}),v("div",C,[(i(),n("video",{id:"my-player",style:{width:"500px"},key:q.value.public_video_url,class:"video-js",controls:"",autoplay:"",ref_key:"myVideo",ref:t},[v("source",{src:q.value.public_video_url,type:"video/mp4"},null,8,N)])),v("div",L,[v("div",R,[v("div",U,[d("剧名: "),v("span",V,b(l.primary.name),1),d(),q.value.series_name?(i(),n("span",E,"(当前播放"+b(q.value.series_name)+")",1)):_("",!0)]),s.value.length>0?(i(),y(m,{key:0,urls:z.value,fileName:l.primary.name},null,8,["urls","fileName"])):_("",!0)]),S.value.total?(i(),y($,{key:0,meta:S.value,onChange:O},{content:p((()=>[u(B,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=e=>s.value=e),size:"large",class:"flex flex-wrap items-center"},{default:p((()=>[(i(!0),n(f,null,g(o.value,((e,a)=>(i(),y(x,{border:"",class:"video-item",onChange:a=>(e=>{q.value=s.value.find((a=>a.public_video_url==e.public_video_url))??{},z.value=s.value,z.value})(e),key:a,label:e},{default:p((()=>[d(b(e.series_sequence),1)])),_:2},1032,["onChange","label"])))),128))])),_:1},8,["modelValue"])])),_:1},8,["meta"])):_("",!0)])])],64)}}}),[["__scopeId","data-v-f7f57b5b"]]);export{S as default};
