import{S as C}from"./select-tmpl.c030a538.js";import E from"./search-term-add.6bb4bd7e.js";import A from"./freq-setting.2f72d98d.js";import{c as F}from"./index.d32a0333.js";import{X as q}from"./index.ae7ce77b.js";import{u as N}from"./common.398ceae3.js";import U from"./save-rule-dialog.45f1312e.js";import{d as X,r as n,a9 as s,o as j,c as G,M as e,u as t,G as a,K as d,a as f}from"./vue.6daa721c.js";const H={class:"mx-5"},K=f("div",{class:"asj-h2"},"添加否定词",-1),M=f("span",{class:"asj-h3"},"匹配方式",-1),P={class:"auto-page-foot"},Z=X({__name:"neg-keyword",props:{data:{},RuleStatusButton:{}},emits:["refresh"],setup(g,{emit:k}){const x=g,p=k,i=n(),_=n(),b=n(),{formData:o,submitFormData:R}=N(x),m=n(!1),h=async()=>{const c=await _.value.validate(),l=!q.includes(await b.value.validate(),!1);i.value.validate(async r=>{r&&c&&l?(await R(),p("refresh")):console.log("验证失败：",[r,c,l])})},V=()=>{p("refresh")};function S(){o.value.useTmpl?h():m.value=!0}return(c,l)=>{const r=s("el-divider"),v=s("el-checkbox"),w=s("el-checkbox-group"),B=s("el-form-item"),D=s("el-form"),T=s("el-card"),y=s("el-button");return j(),G("div",H,[K,e(C,{data:t(o)},null,8,["data"]),e(T,{class:"mt-3"},{default:a(()=>[e(A,{rule:t(o).rule,disabled:t(o).useTmpl},null,8,["rule","disabled"]),e(r),e(D,{model:t(o),"label-position":"top",ref_key:"formRef",ref:i,disabled:t(o).useTmpl},{default:a(()=>[e(E,{rule:t(o).rule,ref_key:"searchTermAddRef",ref:_,disabled:t(o).useTmpl},null,8,["rule","disabled"]),e(B,{prop:"rule.action.matchType",required:"",rules:{required:!0,message:"请至少选择一种匹配方式",trigger:"change"}},{label:a(()=>[M]),default:a(()=>[e(w,{modelValue:t(o).rule.action.matchType,"onUpdate:modelValue":l[0]||(l[0]=u=>t(o).rule.action.matchType=u)},{default:a(()=>[e(v,{label:"EXECT"},{default:a(()=>[d("精准")]),_:1}),e(v,{label:"PHRASE"},{default:a(()=>[d("词组")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","disabled"])]),_:1}),e(T,{class:"mt-3"},{default:a(()=>[e(F,{data:t(o).rule.conditions,ref_key:"condiBuilderRef",ref:b,disabled:t(o).useTmpl},null,8,["data","disabled"])]),_:1}),e(U,{modelValue:m.value,"onUpdate:modelValue":l[1]||(l[1]=u=>m.value=u),formData:t(o),formRef:i.value,onSubmit:h},null,8,["modelValue","formData","formRef"]),f("div",P,[e(y,{style:{width:"200px"},onClick:V},{default:a(()=>[d("取消")]),_:1}),e(y,{style:{width:"200px"},type:"primary",onClick:S},{default:a(()=>[d("提交")]),_:1})])])}}});export{Z as _};
