import{_ as e}from"./index.vue_vue_type_script_setup_true_lang-81145dcf.js";import{d as a,c7 as l,b_ as t,O as s,bR as r,_ as o,r as i,o as n,c as u,a as d,w as c,b as p,k as m,p as v,e as _,t as y,s as b,j as f,F as g,q as h}from"./index-018fb6dd.js";/* empty css             *//* empty css                   */import{a as k}from"./index-a3908905.js";import"./http-338d117f.js";const w=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,l,t,s,r){const o=i("el-button");return n(),u("div",null,[d(o,{type:"primary",onClick:e.download},{default:c((()=>[p("下载")])),_:1},8,["onClick"])])}]]),x={class:"wrapper"},j=["src"],C={class:"video-wrapper"},N={class:"flex items-center justify-between h-10"},L={class:"w-full text-base font-medium"},R={class:"ml-2 text-lg font-bold text-dark-600"},U={key:0},V=o(a({__name:"videoDL",props:{primary:String|Number},setup(a){const l=a,t=m(),s=m([]),r=m({page:1,limit:100}),o=m([]);l.primary;const V=m({}),q=m({}),E=m([]),O=e=>{k({video_id:l.primary.id,...e}).then((e=>{o.value=e.data,V.value={limit:e.limit,total:e.total}}))},z=e=>{r.value.page=Number(e.page),O(r.value)};return v((()=>{O(r.value)})),(a,r)=>{const m=i("el-alert"),v=w,k=i("el-checkbox"),O=i("el-checkbox-group"),B=e;return n(),u(g,null,[d(m,{title:"注：如需批量下载，则多选目标集数，点击下载按钮即可",type:"warning","show-icon":"",closable:!1}),_("div",x,[(n(),u("video",{id:"my-player",style:{width:"500px"},key:q.value.public_video_url,class:"video-js",controls:"",autoplay:"",ref_key:"myVideo",ref:t},[_("source",{src:q.value.public_video_url,type:"video/mp4"},null,8,j)])),_("div",C,[_("div",N,[_("div",L,[p("剧名: "),_("span",R,y(l.primary.name),1),p(),q.value.series_name?(n(),u("span",U,"(当前播放"+y(q.value.series_name)+")",1)):b("",!0)]),s.value.length>0?(n(),f(v,{key:0,urls:E.value,fileName:l.primary.name},null,8,["urls","fileName"])):b("",!0)]),V.value.total?(n(),f(B,{key:0,meta:V.value,onChange:z},{content:c((()=>[d(O,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=e=>s.value=e),size:"large",class:"flex flex-wrap items-center"},{default:c((()=>[(n(!0),u(g,null,h(o.value,((e,a)=>(n(),f(k,{border:"",class:"video-item",onChange:a=>(e=>{q.value=s.value.find((a=>a.public_video_url==e.public_video_url))??{},E.value=s.value,E.value})(e),key:a,label:e},{default:c((()=>[p(y(e.series_sequence),1)])),_:2},1032,["onChange","label"])))),128))])),_:1},8,["modelValue"])])),_:1},8,["meta"])):b("",!0)])])],64)}}}),[["__scopeId","data-v-211692ee"]]);export{V as default};
