import w from"./search-term-add.3d455180.js";import g from"./search-term-bid.92146657.js";import{S as C}from"./select-tmpl.7954c02d.js";import F from"./freq-setting.0ccfd6aa.js";import{c as A}from"./index.4ebb480f.js";import{u as N}from"./common.2084ef18.js";import{X as E}from"./index.0d411246.js";import U from"./save-rule-dialog.3e2d4102.js";import{d as X,r as l,a9 as d,o as j,c as q,M as a,u as t,G as s,a as R,K as T}from"./vue.3f733908.js";const G={class:"mx-5"},K=R("div",{class:"asj-h2"},"添加搜索词",-1),M={class:"auto-page-foot"},Y=X({__name:"search-term",props:{data:{},RuleStatusButton:{}},emits:["refresh"],setup(y,{emit:B}){const S=y,u=B,n=l(),f=l(),p=l(),_=l(),{formData:e,submitFormData:k}=N(S),m=l(!1),v=async()=>{const c=await f.value.validate(),o=p.value.valid,r=!E.includes(await _.value.validate(),!1);n.value.validate(async i=>{i&&c&&o&&r?(await k(),u("refresh")):console.log("验证失败：",[i,c,o,r])})},x=()=>{u("refresh")};function D(){e.value.useTmpl?v():m.value=!0}return(c,o)=>{const r=d("el-divider"),i=d("el-form"),b=d("el-card"),h=d("el-button");return j(),q("div",G,[K,a(C,{data:t(e)},null,8,["data"]),a(b,{class:"mt-3"},{default:s(()=>[a(F,{rule:t(e).rule,disabled:t(e).useTmpl},null,8,["rule","disabled"]),a(r),a(i,{model:t(e),"label-position":"top",ref_key:"formRef",ref:n,disabled:t(e).useTmpl},{default:s(()=>[a(w,{rule:t(e).rule,disabled:t(e).useTmpl,ref_key:"searchTermAddRef",ref:f},null,8,["rule","disabled"]),a(g,{action:t(e).rule.action,ref_key:"searchTermBidRef",ref:p},null,8,["action"])]),_:1},8,["model","disabled"])]),_:1}),a(b,{class:"mt-3"},{default:s(()=>[a(A,{data:t(e).rule.conditions,ref_key:"condiBuilderRef",ref:_,disabled:t(e).useTmpl},null,8,["data","disabled"])]),_:1}),a(U,{modelValue:m.value,"onUpdate:modelValue":o[0]||(o[0]=V=>m.value=V),formData:t(e),formRef:n.value,onSubmit:v},null,8,["modelValue","formData","formRef"]),R("div",M,[a(h,{style:{width:"200px"},onClick:x},{default:s(()=>[T("取消")]),_:1}),a(h,{style:{width:"200px"},type:"primary",onClick:D},{default:s(()=>[T("提交")]),_:1})])])}}});export{Y as _};
