import V from"./search-term-add.3506ccf0.js";import g from"./search-term-bid.cef6800d.js";import C from"./select-tmpl.1269a265.js";import E from"./freq-setting.ecd99b01.js";import{c as F}from"./index.fdb4f26c.js";import{u as A}from"./common.89e0f16e.js";import{X as N}from"./index.ad3efb29.js";import U from"./save-rule-dialog.e22020b1.js";import{E as X}from"./elementPlus.4833989a.js";import{d as j,r as o,w as q,ai as n,o as M,c as O,U as t,u as a,O as l,a as B,S as R}from"./vue.adf17aba.js";const z={class:"mx-5"},G=B("div",{class:"asj-h2"},"添加搜索词",-1),H={class:"auto-page-foot"},ee=j({__name:"search-term",props:{data:{},RuleStatusButton:{}},emits:["refresh","updateRuleStatusButton"],setup(T,{emit:y}){const S=T,d=y,u=o(),p=o(),_=o(),v=o(),{formData:e,submitFormData:w}=A(S),m=o(!1);async function h(){await w(),X.success("保存成功"),d("refresh")}const k=()=>{d("refresh")};async function x(){const s=await p.value.validate(),r=_.value.valid,c=!N.includes(await v.value.validate(),!1);u.value.validate(async f=>{if(!(!f||!s||!r||!c))try{e.value.useTmpl?await h():m.value=!0}catch(i){console.error("提交失败:",i)}})}return q(()=>e.value,s=>{d("updateRuleStatusButton",s.RuleStatusButton)}),(s,r)=>{const c=n("el-divider"),f=n("el-form"),i=n("el-card"),b=n("el-button");return M(),O("div",z,[G,t(C,{data:a(e)},null,8,["data"]),t(i,{class:"mt-3"},{default:l(()=>[t(E,{rule:a(e).rule,disabled:a(e).useTmpl},null,8,["rule","disabled"]),t(c),t(f,{model:a(e),"label-position":"top",ref_key:"formRef",ref:u,disabled:a(e).useTmpl},{default:l(()=>[t(V,{rule:a(e).rule,disabled:a(e).useTmpl,ref_key:"searchTermAddRef",ref:p},null,8,["rule","disabled"]),t(g,{action:a(e).rule.action,ref_key:"searchTermBidRef",ref:_},null,8,["action"])]),_:1},8,["model","disabled"])]),_:1}),t(i,{class:"mt-3"},{default:l(()=>[t(F,{data:a(e).rule.conditions,ref_key:"condiBuilderRef",ref:v,disabled:a(e).useTmpl},null,8,["data","disabled"])]),_:1}),t(U,{modelValue:m.value,"onUpdate:modelValue":r[0]||(r[0]=D=>m.value=D),formData:a(e),formRef:u.value,onSubmit:h},null,8,["modelValue","formData","formRef"]),B("div",H,[t(b,{style:{width:"200px"},onClick:k},{default:l(()=>[R("取消")]),_:1}),t(b,{style:{width:"200px"},type:"primary",onClick:x},{default:l(()=>[R("提交")]),_:1})])])}}});export{ee as _};
