import{_ as B}from"./TermsItem.vue_vue_type_script_setup_true_name_TermsItem_lang.1703796278973.js";import{u as _}from"./scene.1703796278973.js";import g from"./DropdownButton.1703796278973.js";import"./Menus.1703796278973.js";import"./Time.vue_vue_type_style_index_0_lang.1703796278973.js";import{d as b,s as F,l as L,r as S,o as m,x as u,z as i,b as y,u as n,B as f,F as C,h as D,c as T}from"./vue.1703796278973.js";import{r as v}from"./utils.1703796278973.js";const I={class:"terms-params"},V={class:"terms-params-warp"},$={key:0,class:"term-type-warp"},A={class:"terms-content"},O=i("span",null,"分组",-1),W=b({name:"WhenItem"}),R=b({...W,props:{isFirst:{type:Boolean,default:!0},data:{type:Object,default:()=>({when:[],shakeLimit:{},then:[]})},showDeleteBtn:{type:Boolean,default:!0},class:{type:String,default:""},name:{type:Number,default:0},branchName:{type:Number,default:0},isLast:{type:Boolean,default:!0}},setup(e){const a=e,N=_(),{data:r}=F(N),d=L(()=>a.data.terms),w=l=>{r.value.options.when[a.name].terms[a.name].termType=l.label},k=()=>{var o,c,t,s,p,h;const l={type:"and",terms:[{column:void 0,value:{source:"manual",value:void 0},termType:void 0,key:`params_${v()}`,type:"and"}],key:`terms_${v()}`};(t=(c=(o=r.value.branches)==null?void 0:o[a.branchName])==null?void 0:c.when)==null||t.push(l),(h=(p=(s=r.value.options)==null?void 0:s.when)==null?void 0:p[a.branchName])==null||h.terms.push({termType:"并且",terms:[["","eq","","and"]]})};return(l,o)=>{const c=S("AIcon");return m(),u("div",I,[i("div",V,[e.isFirst?f("",!0):(m(),u("div",$,[y(n(g),{options:[{label:"并且",value:"and"},{label:"或者",value:"or"}],type:"type",value:n(r).branches[e.branchName].when[e.name].type,"onUpdate:value":o[0]||(o[0]=t=>n(r).branches[e.branchName].when[e.name].type=t),onSelect:w},null,8,["value"])])),(m(!0),u(C,null,D(n(d),(t,s)=>(m(),T(B,{key:t.key,branchName:e.branchName,whenName:a.name,name:s,showDeleteBtn:n(d).length>1,isFirst:s===0,isLast:s===n(d).length-1,data:t},null,8,["branchName","whenName","name","showDeleteBtn","isFirst","isLast","data"]))),128)),e.isLast?(m(),u("div",{key:1,class:"terms-group-add",onClick:k},[i("div",A,[y(c,{type:"PlusOutlined"}),O])])):f("",!0)])])}}});export{R as _};
