import{o as n,c as h,w as u,u as o,g as l,h as d,b as r,a as e,F as v,D as C,f as p,t as c,i as _,L as k,d as w,e as N}from"./app-BYcXwl4U.js";import{P as $}from"./app-Doj30F-n.js";import{i as P,c as V}from"./app-a6cKceqE.js";import{_ as D}from"./app-CQ-vNlMj.js";import"./app-CrjU8lgK.js";import{_ as U,a as g}from"./app-DxbU-QrX.js";import{_ as b}from"./app-DiDEoOb6.js";import{_ as O}from"./app-DY-0PadZ.js";import{_ as x}from"./app-DwtlHtUX.js";import{_ as G}from"./app-CignoBaV.js";import{T}from"./app-D2Wz0BUQ.js";import{P as S}from"./app-0YmIdYYs.js";import{D as B}from"./app-7GBSHA5C.js";import"./app-Ceh-tphd.js";import"./app-Cp3gmk2J.js";import"./app--MWyBMkA.js";import"./app-BG60hdvp.js";import"./app-CNARLpXE.js";import"./app-SxAW7vhf.js";import"./app-D5k1HLu9.js";import"./app-ysQ8KbGS.js";import"./app-BDgR0DSb.js";import"./app-BHl80pFw.js";import"./app-D3zbrzdO.js";function I(){const{utils:m}=P(this);this.success=this.$NotifyPopup,this.group={connector:"and",description:"",isReverse:!1,conds:[],isOn:!0},this.isUpdating=!1,this.$delay(function(){window.parent.UPDATING_COND_GROUP!=null?(this.group=window.parent.UPDATING_COND_GROUP,this.isUpdating=!0):this.group.conds.length==0&&this.addCond()}),this.typeName=function(t){let a=this.components.$find(function(i,s){return s.type==t.type});return a!=null?a.name:t.param+" "+t.operator},this.addCond=function(){window.UPDATING_COND=null;let t=this;m.popup("/servers/server/settings/conds/addCondPopup",{width:"40em",callback:function(a){t.group.conds.push(a.data.cond)}})},this.removeCond=function(t){let a=this;m.confirm("确定要删除此条件？",function(){a.group.conds.$remove(t)})},this.updateCond=function(t,a){window.UPDATING_COND=a;let i=this;m.popup("/servers/server/settings/conds/addCondPopup",{width:"40em",callback:function(s){i.group.conds[t]=s.data.cond}})}}const A={key:0},L={key:1},R=["value"],F=e("td",{class:"title"},"子条件列表",-1),J={style:{"word-break":"break-all"}},E={key:0,class:"label-group"},M={key:0,style:{"font-style":"normal"}},j={key:1,style:{"font-style":"normal"}},q={key:2,title:"不区分大小写"},z=e("i",{class:"icon info small"},null,-1),H=[z],K=["onClick"],Q=e("i",{class:"pi pi-pencil small"},null,-1),W=[Q],X=["onClick"],Y=e("i",{class:"pi pi-remove"},null,-1),Z=[Y],tt={key:0},et=e("td",null,"子条件之间关系",-1),ot={key:0,class:"comment"},st={key:1,class:"comment"},nt={colspan:"2"},it=e("td",null,"补充说明",-1),rt=e("td",null,"启用当前分组",-1),xt={__name:"addGroupPopup",setup(m){const t=V(new I);return(a,i)=>(n(),h($,null,{default:u(()=>[o(t).isUpdating?d("",!0):(n(),l("header",A,"添加条件分组")),o(t).isUpdating?(n(),l("header",L,"修改条件分组")):d("",!0),r(D,{onSuccess:o(t).success,action:"$"},{default:u(()=>[e("input",{type:"hidden",name:"condGroupJSON",value:JSON.stringify(o(t).group)},null,8,R),r(B,null,{default:u(()=>[e("tbody",null,[e("tr",null,[F,e("td",J,[o(t).group.conds.length>0?(n(),l("div",E,[(n(!0),l(v,null,C(o(t).group.conds,(s,f)=>(n(),h(T,{outlined:""},{default:u(()=>[e("span",null,[s.type.length==0||s.type=="params"?(n(),l("var",M,[p(c(s.param)+" ",1),e("var",null,c(s.operator),1)])):d("",!0),s.type.length>0&&s.type!="params"?(n(),l("var",j,c(o(t).typeName(s))+": ",1)):d("",!0),p(" "+c(s.value)+" ",1),s.isCaseInsensitive?(n(),l("sup",q,H)):d("",!0),p("   "),e("a",{href:"",title:"修改",onClick:_(y=>o(t).updateCond(f,s),["prevent"])},W,8,K),p(),e("a",{href:"",title:"删除",onClick:_(y=>o(t).removeCond(f),["prevent"])},Z,8,X)]),o(t).index<o(t).group.conds.length-1?(n(),l("var",tt,c(o(t).group.connector)+"  ",1)):d("",!0)]),_:2},1024))),256)),r(k)])):d("",!0),r(S,{type:"button",onClick:i[0]||(i[0]=_(s=>o(t).addCond(),["prevent"]))},{default:u(()=>[p("+")]),_:1})])]),e("tr",null,[et,e("td",null,[r(U,{modelValue:o(t).group.connector,"onUpdate:modelValue":i[1]||(i[1]=s=>o(t).group.connector=s)},{default:u(()=>[r(g,{value:"and"},{default:u(()=>[p("和")]),_:1}),r(g,{value:"or"},{default:u(()=>[p("或")]),_:1})]),_:1},8,["modelValue"]),o(t).group.connector=="and"?(n(),l("p",ot,"必须满足所有条件才能成立。")):d("",!0),o(t).group.connector=="or"?(n(),l("p",st,"只要满足其中一个条件即可成立。")):d("",!0)])]),e("tr",null,[e("td",nt,[r(b)])])]),w(e("tbody",null,[e("tr",null,[it,e("td",null,[r(O,{rows:"3",modelValue:o(t).group.description,"onUpdate:modelValue":i[2]||(i[2]=s=>o(t).group.description=s),maxlength:"100",class:"w-full"},null,8,["modelValue"])])]),e("tr",null,[rt,e("td",null,[r(x,{modelValue:o(t).group.isOn,"onUpdate:modelValue":i[3]||(i[3]=s=>o(t).group.isOn=s)},null,8,["modelValue"])])])],512),[[N,o(t).moreOptionsVisible]])]),_:1}),r(G,null,{default:u(()=>[p("确定")]),_:1})]),_:1},8,["onSuccess"])]),_:1}))}};export{xt as default};
