import{d as w,r as S,ai as d,o as s,c as u,U as l,O as t,S as r,F as U,a8 as G,M as B,a as _,P as M,V as $,u as h,R as q,aF as N,aG as F}from"./vue.adf17aba.js";import{g as R,p as P}from"./elementPlus.4833989a.js";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang.b7a88915.js";import{_ as D}from"./index.vue_vue_type_script_setup_true_lang.577ff081.js";import{_ as E}from"./_plugin-vue_export-helper.c27b6911.js";import"./index.ad3efb29.js";import"./echarts.72dc8373.js";const L=n=>(N("data-v-998d3479"),n=n(),F(),n),O=L(()=>_("div",{class:"asj-h3"},[_("span",{class:"custom-title-icon"}),r(" 添加到 ")],-1)),z={key:0,style:{"margin-left":"23px"}},H={style:{display:"flex","align-items":"center",gap:"10px"}},J=w({__name:"search-term-add",props:{rule:{},disabled:{type:Boolean}},setup(n,{expose:V}){const p=n,c=S();function g(){p.rule.campaignAd.push({campaignType:"sp",campaignId:"",adGroupId:""})}p.rule.campaignAd.length===0&&g(),p.rule.activeModel||(p.rule.activeModel="all");function I(e){p.rule.campaignAd.splice(e,1)}async function C(e){e.campaignId="",e.adGroupId=""}async function b(){let e=!0;return c.value&&await c.value.validate(async i=>{e=i}),e}return V({validate:b}),(e,i)=>{const m=d("el-radio"),f=d("el-option"),T=d("el-select"),y=d("el-button"),k=d("el-form-item"),x=d("el-form"),A=d("el-radio-group");return s(),u("div",null,[O,l(A,{style:{display:"flex","flex-direction":"column","align-items":"flex-start","margin-bottom":"20px"},modelValue:e.rule.activeModel,"onUpdate:modelValue":i[0]||(i[0]=a=>e.rule.activeModel=a)},{default:t(()=>[l(m,{label:"all"},{default:t(()=>[r("当前广告活动（所有广告组）")]),_:1}),l(m,{label:"current"},{default:t(()=>[r("当前广告活动（当前广告组）")]),_:1}),l(m,{label:"specified"},{default:t(()=>[r("指定广告活动的广告组")]),_:1}),e.rule.activeModel==="specified"?(s(),u("div",z,[l(x,{inline:!0,model:e.rule,disabled:e.disabled,ref_key:"formRef",ref:c},{default:t(()=>[(s(!0),u(U,null,G(e.rule.campaignAd,(a,v)=>(s(),B(k,{style:{margin:"10px auto"},prop:`campaignAd[${v}].adGroupId`,rules:{required:!0,message:"广告组必填"}},{default:t(()=>[_("div",H,[l(T,{modelValue:a.campaignType,"onUpdate:modelValue":o=>a.campaignType=o,style:{width:"100px"},onChange:o=>C(a)},{default:t(()=>[l(f,{label:"SP",value:"sp"}),l(f,{label:"SB",value:"sb"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"]),l(j,{modelValue:a.campaignId,"onUpdate:modelValue":o=>a.campaignId=o,query:{profileId:"3006125408623189",campaignType:a.campaignType},onChange:o=>a.adGroupId="",width:"450px"},null,8,["modelValue","onUpdate:modelValue","query","onChange"]),l(D,{modelValue:a.adGroupId,"onUpdate:modelValue":o=>a.adGroupId=o,width:"450px",query:{profileId:"3006125408623189",campaignType:a.campaignType,campaignId:a.campaignId}},null,8,["modelValue","onUpdate:modelValue","query"]),M(l(y,{link:"",icon:h(R),type:"danger",onClick:o=>I(v)},null,8,["icon","onClick"]),[[$,e.rule.campaignAd.length>1]])])]),_:2},1032,["prop"]))),256))]),_:1},8,["model","disabled"]),l(y,{link:"",icon:h(P),type:"primary",onClick:g},{default:t(()=>[r("添加")]),_:1},8,["icon"])])):q("",!0)]),_:1},8,["modelValue"])])}}});const ae=E(J,[["__scopeId","data-v-998d3479"]]);export{ae as default};
