/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import{_ as e}from"./myUpload-5c17dffa.js";/* empty css                 *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                  */import{b as l,c as a}from"./index-2e4b9a93.js";import{f as i}from"./index-403f799c.js";/* empty css                 *//* empty css                   */import{d as r,m as u,U as o,x as s,W as t,o as d,l as m,w as p,e as n,a as c,c as v,F as g,y as f,b as _,t as y,f as b,a4 as h,a2 as j,A as x,B as w,a3 as V,S as L,Y as z,$ as q}from"./index-2b50ecca.js";const F={class:"flex flex-row justify-between"},k={class:"w-full"},S={style:{"margin-left":"150px"}},U={style:{"margin-left":"150px"}},T={class:"flex justify-end"},M=r({__name:"create",props:{primary:Object},emits:["close"],setup(r,{emit:M}){const N=r,O=u(),B=u({}),J=o({registration_number:[{required:!0,message:"请输入剧目备案号",trigger:"blur"}],producer:[{required:!0,message:"请输入剧目制作方名称",trigger:"blur"}],playwright:[{required:!0,message:"请输入编剧姓名",trigger:"blur"}],video_id:[{required:!0,message:"请选择剧目名称",trigger:"change"}],production_license_img:[{required:!0,message:"请上传剧目制作方的《广播电视节目制作许可证》"}],authorized_img:[{required:!0,message:"请上传剧目播放授权材料"}]}),R=u(!1),Y=u([]),$=e=>{i({limit:999,...e}).then((e=>{Y.value=e.data}))},A=e=>{e?$({videoName:e}):$()},C=e=>{B.value.production_license_img=e,B.value.fileList=[{uid:N.primary.id,url:e}]},W=e=>{B.value.production_license_img=""},X=e=>{B.value.authorized_img=e,B.value.fileListTwo=[{uid:N.primary.id,url:e}]},Z=e=>{B.value.authorized_img=""};return N.primary?(N.primary,B.value=JSON.parse(JSON.stringify(N.primary)),B.value.fileList=[{uid:N.primary.id,url:N.primary.production_license_img}],B.value.fileListTwo=[{uid:N.primary.id,url:N.primary.authorized_img}]):(B.value.fileList=[],B.value.fileListTwo=[]),s((()=>{$()})),(i,r)=>{const u=j,o=x,s=w,$=V,D=e,E=L,G=z,H=q;return t((d(),m(G,{model:B.value,"label-width":"150px",ref_key:"ruleForm",ref:O,rules:b(J),class:"pr-4"},{default:p((()=>[n("div",F,[n("div",k,[c($,{label:"剧目名称",prop:"video_id"},{default:p((()=>{var e,l;return[(null==(e=N.primary)?void 0:e.id)?(d(),m(u,{key:0,modelValue:B.value.name,"onUpdate:modelValue":r[0]||(r[0]=e=>B.value.name=e),disabled:Boolean(null==(l=N.primary)?void 0:l.id),placeholder:"请输入剧目制作方名称"},null,8,["modelValue","disabled"])):(d(),m(s,{key:1,modelValue:B.value.video_id,"onUpdate:modelValue":r[1]||(r[1]=e=>B.value.video_id=e),class:"w-full",clearable:"",filterable:"",remote:"","remote-method":A,placeholder:"请选择剧目名称"},{default:p((()=>[(d(!0),v(g,null,f(Y.value,(e=>(d(),m(o,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]))]})),_:1}),c($,{label:"剧目制作方名称",prop:"producer"},{default:p((()=>[c(u,{modelValue:B.value.producer,"onUpdate:modelValue":r[2]||(r[2]=e=>B.value.producer=e),placeholder:"请输入剧目制作方名称"},null,8,["modelValue"])])),_:1}),c($,{label:"编剧姓名",prop:"playwright"},{default:p((()=>[c(u,{modelValue:B.value.playwright,"onUpdate:modelValue":r[3]||(r[3]=e=>B.value.playwright=e),placeholder:"请输入编剧姓名"},null,8,["modelValue"])])),_:1}),c($,{label:"剧目备案号",prop:"registration_number"},{default:p((()=>[c(u,{modelValue:B.value.registration_number,"onUpdate:modelValue":r[4]||(r[4]=e=>B.value.registration_number=e),placeholder:"请输入剧目备案号"},null,8,["modelValue"])])),_:1}),c($,{"label-width":"300px",label:"剧目制作方的《广播电视节目制作许可证》",prop:"production_license_img",class:"flex flex-col"},{default:p((()=>[n("div",S,[(d(),m(D,{key:Math.random(),acceptType:".png,.jpg,.jpeg",maxFileSize:20,isMultiple:!1,onFileRemove:W,onFileSuccess:C,fileList:B.value.fileList,action:"/qiniu/upload/image"},null,8,["fileList"]))])])),_:1}),c($,{"label-width":"150px",label:"剧目播放授权材料",prop:"authorized_img",class:"flex flex-col"},{default:p((()=>[n("div",U,[(d(),m(D,{key:Math.random(),acceptType:".png,.jpg,.jpeg",maxFileSize:20,isMultiple:!1,onFileRemove:Z,onFileSuccess:X,fileList:B.value.fileListTwo,action:"/qiniu/upload/image"},null,8,["fileList"]))])])),_:1})])]),n("div",T,[c(E,{type:"primary",onClick:r[5]||(r[5]=e=>{return i=O.value,B.value,void(i&&i.validate((e=>{if(e){let e,i={video_id:B.value.video_id,producer:B.value.producer,playwright:B.value.playwright,production_license_img:B.value.production_license_img,authorized_img:B.value.authorized_img,registration_number:B.value.registration_number};N.primary?(e=l,i.id=B.value.id):e=a,e(i).then((e=>{h.success(e.message),M("close")}))}else R.value=!1})).then((()=>{})));var i})},{default:p((()=>[_(y(i.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[H,R.value]])}}});export{M as _};
