/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  */import{_ as e}from"./myUpload-552dbfd4.js";/* empty css                 *//* empty css               *//* empty css                  *//* empty css                     *//* empty css                  */import{b as l,c as a}from"./index-a3b26a8d.js";import{v as i}from"./index-7475c2a5.js";/* empty css                 *//* empty css                   */import{d as r,m as u,V as o,x as s,X 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 _,b as f,t as y,f as b,a5 as h,a3 as j,A as x,B as w,a4 as V,U as L,Z as q,a0 as z}from"./index-0ffeeea6.js";const F={class:"flex flex-row justify-between"},k={class:"w-full"},U={style:{"margin-left":"150px"}},S={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),A=u([]),C=e=>{i({limit:999,...e}).then((e=>{A.value=e.data}))},E=e=>{e?C({videoName:e}):C()},H=e=>{B.value.production_license_img=e,B.value.fileList=[{uid:N.primary.id,url:e}]},I=e=>{B.value.production_license_img=""},K=e=>{B.value.authorized_img=e,B.value.fileListTwo=[{uid:N.primary.id,url:e}]},X=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((()=>{C()})),(i,r)=>{const u=j,o=x,s=w,C=V,Z=e,$=L,D=q,G=z;return t((d(),m(D,{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(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":E,placeholder:"请选择剧目名称"},{default:p((()=>[(d(!0),v(g,null,_(A.value,(e=>(d(),m(o,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]))]})),_:1}),c(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(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(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(C,{"label-width":"300px",label:"剧目制作方的《广播电视节目制作许可证》",prop:"production_license_img",class:"flex flex-col"},{default:p((()=>[n("div",U,[(d(),m(Z,{key:Math.random(),acceptType:".png,.jpg,.jpeg",maxFileSize:20,isMultiple:!1,onFileRemove:I,onFileSuccess:H,fileList:B.value.fileList,action:"/qiniu/upload/image"},null,8,["fileList"]))])])),_:1}),c(C,{"label-width":"150px",label:"剧目播放授权材料",prop:"authorized_img",class:"flex flex-col"},{default:p((()=>[n("div",S,[(d(),m(Z,{key:Math.random(),acceptType:".png,.jpg,.jpeg",maxFileSize:20,isMultiple:!1,onFileRemove:X,onFileSuccess:K,fileList:B.value.fileListTwo,action:"/qiniu/upload/image"},null,8,["fileList"]))])])),_:1})])]),n("div",T,[c($,{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((()=>[f(y(i.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[G,R.value]])}}});export{M as _};
