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