/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import{_ as e}from"./VideoUploader-ead3cb9d.js";/* empty css                 */import{e as a}from"./index-f69c28c3.js";import{d as l,m as s,x as i,Z as r,f as o,o as t,l as d,w as m,a as u,e as p,b as n,t as v,a5 as _,a6 as c,W as f,a0 as y,a2 as b,R as g,S as j,_ as h}from"./index-41bf27b7.js";/* empty css                    *//* empty css                */import"./http-e55ef919.js";/* empty css                   */const x=(e=>(g("data-v-0dfa8665"),e=e(),j(),e))((()=>p("div",{class:"items-center w-full withdraw-popup-warn"},[p("div",{class:"text-red-400"},"支持MP4格式"),p("div",{class:"text-red-400"},"1.上传文件统一命名格式要求,例：1.mp4; 11.mp4; 333.mp4"),p("div",{class:"text-red-400"},"2.上传视频时，如果新视频和已上传的视频文件同名，原有视频将被新视频覆盖，所以务必提前为视频文件合理命名")],-1))),V={class:"w-full"},w={class:"flex justify-end"},k=h(l({__name:"uploadVideo",props:{primary:String|Number},emits:["close"],setup(l,{emit:g}){const j=l,h=s(),k=s(!1),q=s({videos:[]}),R=s([]),S=e=>{q.value.videos=q.value.videos.filter((a=>a.name!=e.name)),q.value},U=e=>{q.value.videos.push({name:e.fname,duration:parseInt(e.duration),url:e.url,key:e.key}),q.value};return j.primary&&(j.primary,q.value.video_id=j.primary.id,q.value.name=j.primary.name,q.value.total_episode_num=j.primary.total_episode_num,q.value.cover_image=j.primary.cover_image),i((async()=>{})),(l,s)=>{const i=_,j=c,I=e,L=f,W=y,$=b;return r((t(),d(W,{model:o(q),"label-width":"120px",ref_key:"form",ref:h,class:"pr-4"},{default:m((()=>[u(j,{label:"短剧名称",style:{height:"50px"},prop:"name",rules:[{required:!0,message:"短剧名称必须填写"}]},{default:m((()=>[u(i,{disabled:"",modelValue:o(q).name,"onUpdate:modelValue":s[0]||(s[0]=e=>o(q).name=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),u(j,{label:"集数",style:{height:"50px"},prop:"total_episode_num",rules:[{required:!0,message:"集数必须填写"}]},{default:m((()=>[u(i,{disabled:"",modelValue:o(q).total_episode_num,"onUpdate:modelValue":s[1]||(s[1]=e=>o(q).total_episode_num=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),u(j,{label:"上传",prop:"videos",rules:[{required:!0,message:"请上传文件",trigger:"change"}]},{default:m((()=>[x,p("div",V,[u(I,{fileList:o(R),public_video_url:o(q).cover_image,onFileRemove:S,onSuccess:U},null,8,["fileList","public_video_url"])])])),_:1}),p("div",w,[u(L,{type:"primary",onClick:s[2]||(s[2]=e=>{return l=o(h),k.value=!0,q.value,void(l&&l.validate((e=>{if(e){let e={video_id:q.value.video_id,videos:q.value.videos};a(e).then((e=>{k.value=!1,R.value=[],g("close")})).catch((e=>{k.value=!1})),q.value}else k.value=!1})).then((()=>{})));var l})},{default:m((()=>[n(v(l.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[$,o(k)]])}}}),[["__scopeId","data-v-0dfa8665"]]);export{k as default};
