import E from"./select-tmpl.1269a265.js";import C from"./search-term-add.3506ccf0.js";import A from"./freq-setting.ecd99b01.js";import{c as F}from"./index.fdb4f26c.js";import{X as U}from"./index.ad3efb29.js";import{u as q}from"./common.89e0f16e.js";import N from"./save-rule-dialog.e22020b1.js";import{E as X}from"./elementPlus.4833989a.js";import{d as j,r as n,w as H,ai as l,o as M,c as O,U as e,u as a,O as o,S as u,a as p}from"./vue.adf17aba.js";const P={class:"mx-5"},z=p("div",{class:"asj-h2"},"添加否定词",-1),G=p("span",{class:"asj-h3"},"匹配方式",-1),I={class:"auto-page-foot"},te=j({__name:"neg-keyword",props:{data:{},RuleStatusButton:{}},emits:["refresh","updateRuleStatusButton"],setup(T,{emit:g}){const k=T,d=g,i=n(),_=n(),b=n(),{formData:t,submitFormData:S}=q(k),m=n(!1),h=async()=>{await S(),X.success("保存成功"),d("refresh")},x=()=>{d("refresh")};async function w(){const r=await _.value.validate(),s=!U.includes(await b.value.validate(),!1);i.value.validate(async c=>{!c||!r||!s||(t.value.useTmpl?await h():m.value=!0)})}return H(()=>t.value,r=>{d("updateRuleStatusButton",r.RuleStatusButton)}),(r,s)=>{const c=l("el-divider"),v=l("el-checkbox"),B=l("el-checkbox-group"),V=l("el-form-item"),D=l("el-form"),y=l("el-card"),R=l("el-button");return M(),O("div",P,[z,e(E,{data:a(t)},null,8,["data"]),e(y,{class:"mt-3"},{default:o(()=>[e(A,{disabled:a(t).useTmpl,rule:a(t).rule},null,8,["disabled","rule"]),e(c),e(D,{ref_key:"formRef",ref:i,disabled:a(t).useTmpl,model:a(t),"label-position":"top"},{default:o(()=>[e(C,{ref_key:"searchTermAddRef",ref:_,disabled:a(t).useTmpl,rule:a(t).rule},null,8,["disabled","rule"]),e(V,{rules:{required:!0,message:"请至少选择一种匹配方式",trigger:"change"},prop:"rule.action.matchType",required:""},{label:o(()=>[G]),default:o(()=>[e(B,{modelValue:a(t).rule.action.matchType,"onUpdate:modelValue":s[0]||(s[0]=f=>a(t).rule.action.matchType=f)},{default:o(()=>[e(v,{label:"EXECT"},{default:o(()=>[u("精准")]),_:1}),e(v,{label:"PHRASE"},{default:o(()=>[u("词组")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["disabled","model"])]),_:1}),e(y,{class:"mt-3"},{default:o(()=>[e(F,{ref_key:"condiBuilderRef",ref:b,data:a(t).rule.conditions,disabled:a(t).useTmpl},null,8,["data","disabled"])]),_:1}),e(N,{modelValue:m.value,"onUpdate:modelValue":s[1]||(s[1]=f=>m.value=f),formData:a(t),formRef:i.value,onSubmit:h},null,8,["modelValue","formData","formRef"]),p("div",I,[e(R,{style:{width:"200px"},onClick:x},{default:o(()=>[u("取消")]),_:1}),e(R,{style:{width:"200px"},type:"primary",onClick:w},{default:o(()=>[u("提交")]),_:1})])])}}});export{te as _};
