/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                 *//* empty css               *//* empty css                  *//* empty css                     */import{d as e,W as a,aE as l,q as r,z as s,Z as o,f as t,o as m,l as u,w as i,a as d,c as n,F as p,p as c,b,e as f,t as _,a5 as y,a6 as v,B as g,D as k,X as V,a0 as h,a2 as j}from"./index-545c1a76.js";import{b as q}from"./index-54c69a0a.js";import{t as x}from"./index-bf237e57.js";const U={class:"flex justify-end"},z=e({__name:"backConfig",props:{primary:Object},emits:["close"],setup(e,{emit:z}){const C=e,D=a();l();const I=r([]),w=r(),A=r(!1),B=r({videos:[]}),E=r([{id:1,value:1,name:"巨量账户级回传"}]),F=e=>{q({limit:30,...e}).then((e=>{I.value=e.data}))},O=()=>{D.push({path:"/payback/juliangAccount",query:{promotionId:C.primary.id}})},W=e=>{e?F({account_name:e}):F()};return C.primary&&(C.primary,B.value.name=C.primary.name,B.value.id=C.primary.id),s((async()=>{F()})),(e,a)=>{const l=y,r=v,s=g,q=k,D=V,F=h,X=j;return o((m(),u(F,{model:t(B),"label-width":"120px",ref_key:"form",ref:w,class:"pr-4"},{default:i((()=>[d(r,{label:"推广ID",prop:"name",rules:[{required:!0,message:"推广ID必须填写"}]},{default:i((()=>[d(l,{disabled:"",modelValue:t(B).id,"onUpdate:modelValue":a[0]||(a[0]=e=>t(B).id=e),name:"name",clearable:""},null,8,["modelValue"])])),_:1}),d(r,{label:"推广名称",prop:"total_episode_num",rules:[{required:!1,message:"推广名称必须填写"}]},{default:i((()=>[d(l,{disabled:"",modelValue:C.primary.name,"onUpdate:modelValue":a[1]||(a[1]=e=>C.primary.name=e),name:"author",clearable:""},null,8,["modelValue"])])),_:1}),d(r,{label:"回传类型",prop:"callback_type",rules:[{required:!0,message:"请选择回传类型",trigger:"change"}]},{default:i((()=>[d(q,{modelValue:t(B).callback_type,"onUpdate:modelValue":a[2]||(a[2]=e=>t(B).callback_type=e),filterable:"",clearable:"",placeholder:"选择回传类型"},{default:i((()=>[(m(!0),n(p,null,c(t(E),((e,a)=>(m(),u(s,{key:a,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),d(r,{label:"回传配置",prop:"callback_config_id",rules:[{required:!0,message:"请选择回传配置",trigger:"change"}]},{default:i((()=>[d(q,{modelValue:t(B).callback_config_id,"onUpdate:modelValue":a[3]||(a[3]=e=>t(B).callback_config_id=e),filterable:"",remote:"",clearable:"","remote-method":W,placeholder:"选择回传配置"},{default:i((()=>[(m(!0),n(p,null,c(t(I),((e,a)=>(m(),u(s,{key:a,label:e.adv_account_name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"]),d(D,{type:"primary",link:"",size:"default",onClick:O},{default:i((()=>[b("新增回传")])),_:1})])),_:1}),d(r,{label:"备注",prop:"name",rules:[{required:!1,message:"备注必须填写"}]},{default:i((()=>[d(l,{modelValue:t(B).remark,"onUpdate:modelValue":a[4]||(a[4]=e=>t(B).remark=e),clearable:""},null,8,["modelValue"])])),_:1}),f("div",U,[d(D,{type:"primary",onClick:a[5]||(a[5]=e=>{return a=t(w),A.value=!0,B.value,void(a&&a.validate((e=>{e?(x(B.value).then((e=>{A.value=!1,z("close")})).catch((e=>{A.value=!1})),B.value):A.value=!1})).then((()=>{})));var a})},{default:i((()=>[b(_(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[X,t(A)]])}}});export{z as _};
