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