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