import V from"./search-term-add.3506ccf0.js";import R from"./freq-setting.ecd99b01.js";import{c as B}from"./index.fdb4f26c.js";import{X as C}from"./index.ad3efb29.js";import{d as E,r as s,ai as o,o as F,c as q,U as e,O as l,S as n,a as u}from"./vue.adf17aba.js";const A=u("div",{class:"asj-h2"},"添加否定词",-1),S=u("span",{class:"asj-h3"},"模板名称",-1),U=u("span",{class:"asj-h3"},"匹配方式",-1),j={class:"auto-page-foot"},P=E({__name:"neg-keyword",props:{mode:{},data:{},submitFormData:{},candidateFields:{default:()=>[{label:"曝光量",value:"impressions"},{label:"点击量",value:"clicks"},{label:"转化率",value:"cr",suffix:"%"},{label:"单次点击费用",value:"cpc",prefix:"$"},{label:"关键词",value:"keyword",type:"array",options:[{label:"精确匹配",value:"exect"}]},{label:"否定词",value:"neg_keyword",type:"array"}]}},emits:["refresh"],setup(y,{emit:g}){const d=y,m=g,p=s(),f=s(),_=s(),a=s(d.data);a.value.rule.action.matchType||(a.value.rule.action.matchType=[]);const k=async()=>{const c=await f.value.validate(),t=!C.includes(await _.value.validate(),!1);p.value.validate(async r=>{r&&c&&t?(await d.submitFormData(),m("refresh")):console.log("验证失败：",[r,c,t])})},x=()=>{m("refresh")};return(c,t)=>{const r=o("el-input"),v=o("el-form-item"),h=o("el-checkbox"),w=o("el-checkbox-group"),T=o("el-form"),b=o("el-button");return F(),q("div",null,[A,e(T,{model:a.value,"label-position":"top",style:{"margin-top":"20px"},ref_key:"formRef",ref:p,disabled:!1},{default:l(()=>[e(v,{prop:"name",rules:{required:!0,message:"必填项",trigger:"blur"}},{label:l(()=>[S]),default:l(()=>[e(r,{modelValue:a.value.name,"onUpdate:modelValue":t[0]||(t[0]=i=>a.value.name=i),style:{width:"30%"}},null,8,["modelValue"])]),_:1}),e(V,{rule:a.value.rule,ref_key:"searchTermAddRef",ref:f},null,8,["rule"]),e(v,{prop:"rule.action.matchType",required:"",rules:{required:!0,message:"请至少选择一种匹配方式",trigger:"change"}},{label:l(()=>[U]),default:l(()=>[e(w,{modelValue:a.value.rule.action.matchType,"onUpdate:modelValue":t[1]||(t[1]=i=>a.value.rule.action.matchType=i)},{default:l(()=>[e(h,{label:"EXECT"},{default:l(()=>[n("精准")]),_:1}),e(h,{label:"PHRASE"},{default:l(()=>[n("词组")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"]),e(B,{data:a.value.rule.conditions,ref_key:"condiBuilderRef",ref:_},null,8,["data"]),e(R,{rule:a.value.rule},null,8,["rule"]),u("div",j,[e(b,{style:{width:"200px"},onClick:x},{default:l(()=>[n("取消")]),_:1}),e(b,{style:{width:"200px"},type:"primary",onClick:k},{default:l(()=>[n("提交")]),_:1})])])}}});export{P as _};
