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-SC54XQDl.js";import{P as $}from"./app-BGgVpkqZ.js";import{i as P,c as V}from"./app-Ba7ZqSpq.js";import{_ as D}from"./app-DFulsyXy.js";import"./app-CNHjdV6U.js";import{_ as U,a as g}from"./app-PrSv7rSt.js";import{_ as b}from"./app-huVLEujn.js";import{_ as O}from"./app-T1ysvErZ.js";import{_ as x}from"./app-FlPLZh9D.js";import{_ as G}from"./app-DWUwCFNm.js";import{T}from"./app-DoVkxbmA.js";import{P as S}from"./app-BxWqoSpr.js";import{D as B}from"./app-ZeVDYyDS.js";import"./app-yUrwy8EY.js";import"./app-BZGObKCm.js";import"./app-BPIIxVwk.js";import"./app-PPG0ZS4d.js";import"./app-DgoEZtNT.js";import"./app-Ch8j4za4.js";import"./app-Dw0jKdCD.js";import"./app-DnXuoh8P.js";import"./app-CCkWSX4Q.js";import"./app-DZaelcLs.js";import"./app-C2mBgI5Z.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};
