import{_ as e}from"./VideoUploader-21753a6d.js";import{e as a}from"./index-a3908905.js";import{d as l,k as s,p as i,r,K as o,J as t,f as d,o as u,j as m,w as p,a as n,e as v,b as _,t as f,B as c,D as y,_ as b}from"./index-018fb6dd.js";import"./http-338d117f.js";/* empty css             *//* empty css                   */const g=(e=>(c("data-v-aff76613"),e=e(),y(),e))((()=>v("div",{class:"items-center w-full withdraw-popup-warn"},[v("div",{class:"text-red-400"},"支持MP4格式"),v("div",{class:"text-red-400"},"1.上传文件统一命名格式要求,例：1.mp4; 11.mp4; 333.mp4")],-1))),h={class:"w-full"},x={class:"flex justify-end"},j=b(l({__name:"uploadVideo",props:{primary:String|Number},emits:["close"],setup(l,{emit:c}){const y=l,b=s(),j=s(!1),V=s({videos:[]}),w=s([]),k=e=>{V.value.videos=V.value.videos.filter((a=>a.name!=e.name)),V.value},q=e=>{V.value.videos.push({name:e.fname,duration:parseInt(e.duration),url:e.url,key:e.key}),V.value};return y.primary&&(y.primary,V.value.video_id=y.primary.id,V.value.name=y.primary.name,V.value.total_episode_num=y.primary.total_episode_num,V.value.cover_image=y.primary.cover_image),i((async()=>{})),(l,s)=>{const i=r("el-input"),y=r("el-form-item"),I=e,U=r("el-button"),L=r("el-form"),S=o("loading");return t((u(),m(L,{model:d(V),"label-width":"120px",ref_key:"form",ref:b,class:"pr-4"},{default:p((()=>[n(y,{label:"短剧名称",style:{height:"50px"},prop:"name",rules:[{required:!0,message:"短剧名称必须填写"}]},{default:p((()=>[n(i,{disabled:"",modelValue:d(V).name,"onUpdate:modelValue":s[0]||(s[0]=e=>d(V).name=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),n(y,{label:"集数",style:{height:"50px"},prop:"total_episode_num",rules:[{required:!0,message:"集数必须填写"}]},{default:p((()=>[n(i,{disabled:"",modelValue:d(V).total_episode_num,"onUpdate:modelValue":s[1]||(s[1]=e=>d(V).total_episode_num=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),n(y,{label:"上传",prop:"videos",rules:[{required:!0,message:"请上传文件",trigger:"change"}]},{default:p((()=>[g,v("div",h,[n(I,{fileList:d(w),public_video_url:d(V).cover_image,onFileRemove:k,onSuccess:q},null,8,["fileList","public_video_url"])])])),_:1}),v("div",x,[n(U,{type:"primary",onClick:s[2]||(s[2]=e=>{return l=d(b),j.value=!0,V.value,void(l&&l.validate((e=>{if(e){let e={video_id:V.value.video_id,videos:V.value.videos};a(e).then((e=>{j.value=!1,w.value=[],c("close")})).catch((e=>{j.value=!1})),V.value}else j.value=!1})).then((()=>{})));var l})},{default:p((()=>[_(f(l.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[S,d(j)]])}}}),[["__scopeId","data-v-aff76613"]]);export{j as default};
