2 lines
51 KiB
JavaScript
2 lines
51 KiB
JavaScript
var ct=Object.defineProperty,pt=Object.defineProperties;var ft=Object.getOwnPropertyDescriptors;var il=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable;var dl=(e,l,t)=>l in e?ct(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,F=(e,l)=>{for(var t in l||(l={}))mt.call(l,t)&&dl(e,t,l[t]);if(il)for(var t of il(l))vt.call(l,t)&&dl(e,t,l[t]);return e},J=(e,l)=>pt(e,ft(l));var _e=(e,l,t)=>new Promise((a,r)=>{var s=d=>{try{n(t.next(d))}catch(i){r(i)}},h=d=>{try{n(t.throw(d))}catch(i){r(i)}},n=d=>d.done?a(d.value):Promise.resolve(d.value).then(s,h);n((t=t.apply(e,l)).next())});import{aL as cl,aM as Be,aN as He,aO as bt,aP as ht,aQ as gt,aR as yt,aS as _t,aT as ne,r as D,K as xe,aU as Et,h as o,aV as Vt,aW as wl,aX as Pl,aY as kt,aZ as wt,ah as Ae,a_ as Pt,a$ as te,d as q,H as B,b0 as Ct,b1 as Ge,b2 as St,b3 as We,b4 as Cl,V as Q,Y as Sl,b5 as Tl,ap as A,b6 as me,b7 as ye,o as c,f as L,$ as ke,a2 as ue,aG as $,b8 as Tt,b9 as It,b as y,w as u,a0 as Y,m as O,a5 as x,p as j,ba as $t,bb as Ft,bc as ve,c as k,bd as Dt,e as de,be as Fe,bf as Rt,a6 as At,aH as G,aI as le,bg as Il,bh as Lt,bi as $l,bj as pl,bk as Fl,bl as Ot,bm as Bt,bn as Ut,bo as Nt,bp as jt,bq as Mt,br as qt,g as ee,a1 as K,bs as Ue,bt as zt,bu as Ht,bv as Dl,bw as Gt,bx as Kt,by as Yt,bz as xt,bA as Wt,bB as Xt,bC as we,bD as Qt,bE as Zt,bF as Rl,bG as Jt,bH as ea,bI as Al,bJ as la,bK as ta,bL as Ll,bM as aa,bN as Ol,bO as Bl,bP as oa,bQ as na,bR as sa,bS as Ul,bT as ra,bU as ua,bV as ia,bW as da,bX as ca,bY as pa,bZ as De,b_ as fa,b$ as ma,c0 as va,c1 as Nl,c2 as ba,c3 as ha,c4 as ga,c5 as ya,c6 as _a,c7 as jl,c8 as Xe,c9 as Le,ca as Ea,cb as Va,cc as Pe,cd as Ml,ce as ql,cf as ka,cg as wa,ch as Pa,ci as Ca,cj as Sa,ck as Ta,cl as Ia,cm as $a,cn as Fa,co as Da,cp as Re,cq as Ra,cr as Qe,cs as zl,ct as Aa,cu as Hl,cv as La,cw as Ze,cx as Je,cy as Oa,cz as Ba,cA as Ua,cB as Na,cC as Gl,cD as ja,cE as Ma,cF as qa,cG as za,cH as Ha,cI as Kl,cJ as Ga,cK as Ka,cL as Ya,cM as xa,cN as Wa,cO as Yl,cP as xl,cQ as Wl,cR as Xl,cS as Xa,cT as Qa,cU as Ql,cV as Zl,cW as Za,cX as Jl,cY as Ja,cZ as eo,c_ as lo,c$ as to,d0 as ao,d1 as oo,d2 as no,d3 as so,d4 as ro,d5 as Ke,d6 as et,d7 as uo,d8 as io,d9 as Ce,da as Se,a as W,db as co,dc as po,ab as X,dd as fo,aK as lt,de as ie,y as tt,df as at,dg as fl,a4 as ml,dh as mo,aE as ot,di as vo,dj as bo,dk as ho,dl as go,j as Ne,k as je,N as vl,_ as yo}from"./index-C6A9XM5L.js";function _o(e,l){var t=e.length;for(e.sort(l);t--;)e[t]=e[t].value;return e}function Eo(e,l){if(e!==l){var t=e!==void 0,a=e===null,r=e===e,s=cl(e),h=l!==void 0,n=l===null,d=l===l,i=cl(l);if(!n&&!i&&!s&&e>l||s&&h&&d&&!n&&!i||a&&h&&d||!t&&d||!r)return 1;if(!a&&!s&&!i&&e<l||i&&t&&r&&!a&&!s||n&&t&&r||!h&&r||!d)return-1}return 0}function Vo(e,l,t){for(var a=-1,r=e.criteria,s=l.criteria,h=r.length,n=t.length;++a<h;){var d=Eo(r[a],s[a]);if(d){if(a>=n)return d;var i=t[a];return d*(i=="desc"?-1:1)}}return e.index-l.index}function ko(e,l,t){l.length?l=Be(l,function(s){return He(s)?function(h){return bt(h,s.length===1?s[0]:s)}:s}):l=[ht];var a=-1;l=Be(l,gt(yt));var r=_t(e,function(s,h,n){var d=Be(l,function(i){return i(s)});return{criteria:d,index:++a,value:s}});return _o(r,function(s,h){return Vo(s,h,t)})}function wo(e,l,t,a){return e==null?[]:(He(l)||(l=l==null?[]:[l]),t=t,He(t)||(t=t==null?[]:[t]),ko(e,l,t))}const bl=Symbol("INSTALLED_KEY");ne({});const Po=e=>{if(!wl)return;if(!e)return e;const l=Pl(e);return l||(Ae(e)?l:e)},Co=({middleware:e,placement:l,strategy:t})=>{const a=D(),r=D(),s=D(),h=D(),n=D({}),d={x:s,y:h,placement:l,strategy:t,middlewareData:n},i=()=>_e(void 0,null,function*(){if(!wl)return;const T=Po(a),_=Pl(r);if(!T||!_)return;const S=yield kt(T,_,{placement:o(l),strategy:o(t),middleware:o(e)});wt(d).forEach(E=>{d[E].value=S[E]})});return xe(()=>{Et(()=>{i()})}),J(F({},d),{update:i,referenceRef:a,contentRef:r})},So=({arrowRef:e,padding:l})=>({name:"arrow",options:{element:e,padding:l},fn(t){const a=o(e);return a?Vt({element:a,padding:l}).fn(t):{}}}),To="2.7.1",Io=(e=[])=>({version:To,install:(t,a)=>{t[bl]||(t[bl]=!0,e.forEach(r=>t.use(r)),a&&Pt(a,t,!0))}}),nt=ne({nowrap:Boolean});var st=(e=>(e.top="top",e.bottom="bottom",e.left="left",e.right="right",e))(st||{});const $o=Object.values(st),el=ne({width:{type:Number,default:10},height:{type:Number,default:10},style:{type:te(Object),default:null}}),Fo=ne({side:{type:te(String),values:$o,required:!0}}),Do=["absolute","fixed"],Ro=["top-start","top-end","top","bottom-start","bottom-end","bottom","left-start","left-end","left","right-start","right-end","right"],ll=ne({ariaLabel:String,arrowPadding:{type:te(Number),default:5},effect:{type:String,default:""},contentClass:String,placement:{type:te(String),values:Ro,default:"bottom"},reference:{type:te(Object),default:null},offset:{type:Number,default:8},strategy:{type:te(String),values:Do,default:"absolute"},showArrow:{type:Boolean,default:!1}}),tl=ne({delayDuration:{type:Number,default:300},defaultOpen:Boolean,open:{type:Boolean,default:void 0},onOpenChange:{type:te(Function)},"onUpdate:open":{type:te(Function)}}),be={type:te(Function)},al=ne({onBlur:be,onClick:be,onFocus:be,onMouseDown:be,onMouseEnter:be,onMouseLeave:be}),Ao=ne(J(F(F(F(F({},tl),el),al),ll),{alwaysOn:Boolean,fullTransition:Boolean,transitionProps:{type:te(Object),default:null},teleported:Boolean,to:{type:te(String),default:"body"}})),Oe=Symbol("tooltipV2"),rt=Symbol("tooltipV2Content"),Me="tooltip_v2.open",Lo=q({name:"ElTooltipV2Root"}),Oo=q(J(F({},Lo),{props:tl,setup(e,{expose:l}){const t=e,a=D(t.defaultOpen),r=D(null),s=B({get:()=>Ct(t.open)?a.value:t.open,set:f=>{var v;a.value=f,(v=t["onUpdate:open"])==null||v.call(t,f)}}),h=B(()=>Ge(t.delayDuration)&&t.delayDuration>0),{start:n,stop:d}=St(()=>{s.value=!0},B(()=>t.delayDuration),{immediate:!1}),i=We("tooltip-v2"),T=Cl(),_=()=>{d(),s.value=!0},S=()=>{o(h)?n():_()},E=_,V=()=>{d(),s.value=!1};return Q(s,f=>{var v;f&&(document.dispatchEvent(new CustomEvent(Me)),E()),(v=t.onOpenChange)==null||v.call(t,f)}),xe(()=>{document.addEventListener(Me,V)}),Sl(()=>{d(),document.removeEventListener(Me,V)}),Tl(Oe,{contentId:T,triggerRef:r,ns:i,onClose:V,onDelayOpen:S,onOpen:E}),l({onOpen:E,onClose:V}),(f,v)=>A(f.$slots,"default",{open:o(s)})}}));var Bo=me(Oo,[["__file","root.vue"]]);const Uo=q({name:"ElTooltipV2Arrow"}),No=q(J(F({},Uo),{props:F(F({},el),Fo),setup(e){const l=e,{ns:t}=ye(Oe),{arrowRef:a}=ye(rt),r=B(()=>{const{style:s,width:h,height:n}=l,d=t.namespace.value;return F({[`--${d}-tooltip-v2-arrow-width`]:`${h}px`,[`--${d}-tooltip-v2-arrow-height`]:`${n}px`,[`--${d}-tooltip-v2-arrow-border-width`]:`${h/2}px`,[`--${d}-tooltip-v2-arrow-cover-width`]:h/2-1},s||{})});return(s,h)=>(c(),L("span",{ref_key:"arrowRef",ref:a,style:ke(o(r)),class:ue(o(t).e("arrow"))},null,6))}}));var hl=me(No,[["__file","arrow.vue"]]);const jo=ne({style:{type:te([String,Object,Array]),default:()=>({})}}),Mo=q({name:"ElVisuallyHidden"}),qo=q(J(F({},Mo),{props:jo,setup(e){const l=e,t=B(()=>[l.style,{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}]);return(a,r)=>(c(),L("span",$(a.$attrs,{style:o(t)}),[A(a.$slots,"default")],16))}}));var zo=me(qo,[["__file","visual-hidden.vue"]]);const Ho=["data-side"],Go=q({name:"ElTooltipV2Content"}),Ko=q(J(F({},Go),{props:F(F({},ll),nt),setup(e){const l=e,{triggerRef:t,contentId:a}=ye(Oe),r=D(l.placement),s=D(l.strategy),h=D(null),{referenceRef:n,contentRef:d,middlewareData:i,x:T,y:_,update:S}=Co({placement:r,strategy:s,middleware:B(()=>{const m=[Tt(l.offset)];return l.showArrow&&m.push(So({arrowRef:h})),m})}),E=It().nextZIndex(),V=We("tooltip-v2"),I=B(()=>r.value.split("-")[0]),f=B(()=>({position:o(s),top:`${o(_)||0}px`,left:`${o(T)||0}px`,zIndex:E})),v=B(()=>{if(!l.showArrow)return{};const{arrow:m}=o(i);return{[`--${V.namespace.value}-tooltip-v2-arrow-x`]:`${m==null?void 0:m.x}px`||"",[`--${V.namespace.value}-tooltip-v2-arrow-y`]:`${m==null?void 0:m.y}px`||""}}),p=B(()=>[V.e("content"),V.is("dark",l.effect==="dark"),V.is(o(s)),l.contentClass]);return Q(h,()=>S()),Q(()=>l.placement,m=>r.value=m),xe(()=>{Q(()=>l.reference||t.value,m=>{n.value=m||void 0},{immediate:!0})}),Tl(rt,{arrowRef:h}),(m,P)=>(c(),L("div",{ref_key:"contentRef",ref:d,style:ke(o(f)),"data-tooltip-v2-root":""},[m.nowrap?j("v-if",!0):(c(),L("div",{key:0,"data-side":o(I),class:ue(o(p))},[A(m.$slots,"default",{contentStyle:o(f),contentClass:o(p)}),y(o(zo),{id:o(a),role:"tooltip"},{default:u(()=>[m.ariaLabel?(c(),L(Y,{key:0},[O(x(m.ariaLabel),1)],64)):A(m.$slots,"default",{key:1})]),_:3},8,["id"]),A(m.$slots,"arrow",{style:ke(o(v)),side:o(I)})],10,Ho))],4))}}));var gl=me(Ko,[["__file","content.vue"]]);const Yo=ne({setRef:{type:te(Function),required:!0},onlyChild:Boolean});var xo=q({props:Yo,setup(e,{slots:l}){const t=D(),a=Ft(t,r=>{r?e.setRef(r.nextElementSibling):e.setRef(null)});return()=>{var r;const[s]=((r=l.default)==null?void 0:r.call(l))||[],h=e.onlyChild?$t(s.children):s.children;return y(Y,{ref:a},[h])}}});const Wo=q({name:"ElTooltipV2Trigger"}),Xo=q(J(F({},Wo),{props:F(F({},nt),al),setup(e){const l=e,{onClose:t,onOpen:a,onDelayOpen:r,triggerRef:s,contentId:h}=ye(Oe);let n=!1;const d=p=>{s.value=p},i=()=>{n=!1},T=ve(l.onMouseEnter,r),_=ve(l.onMouseLeave,t),S=ve(l.onMouseDown,()=>{t(),n=!0,document.addEventListener("mouseup",i,{once:!0})}),E=ve(l.onFocus,()=>{n||a()}),V=ve(l.onBlur,t),I=ve(l.onClick,p=>{p.detail===0&&t()}),f={blur:V,click:I,focus:E,mousedown:S,mouseenter:T,mouseleave:_},v=(p,m,P)=>{p&&Object.entries(m).forEach(([b,R])=>{p[P](b,R)})};return Q(s,(p,m)=>{v(p,f,"addEventListener"),v(m,f,"removeEventListener"),p&&p.setAttribute("aria-describedby",h.value)}),Sl(()=>{v(s.value,f,"removeEventListener"),document.removeEventListener("mouseup",i)}),(p,m)=>p.nowrap?(c(),k(o(xo),{key:0,"set-ref":d,"only-child":""},{default:u(()=>[A(p.$slots,"default")]),_:3})):(c(),L("button",$({key:1,ref_key:"triggerRef",ref:s},p.$attrs),[A(p.$slots,"default")],16))}}));var Qo=me(Xo,[["__file","trigger.vue"]]);const Zo=q({name:"ElTooltipV2"}),Jo=q(J(F({},Zo),{props:Ao,setup(e){const t=Dt(e),a=de(Fe(t,Object.keys(el))),r=de(Fe(t,Object.keys(ll))),s=de(Fe(t,Object.keys(tl))),h=de(Fe(t,Object.keys(al)));return(n,d)=>(c(),k(Bo,G(le(s)),{default:u(({open:i})=>[y(Qo,$(h,{nowrap:""}),{default:u(()=>[A(n.$slots,"trigger")]),_:3},16),(c(),k(Rt,{to:n.to,disabled:!n.teleported},[n.fullTransition?(c(),k(At,G($({key:0},n.transitionProps)),{default:u(()=>[n.alwaysOn||i?(c(),k(gl,G($({key:0},r)),{arrow:u(({style:T,side:_})=>[n.showArrow?(c(),k(hl,$({key:0},a,{style:T,side:_}),null,16,["style","side"])):j("v-if",!0)]),default:u(()=>[A(n.$slots,"default")]),_:3},16)):j("v-if",!0)]),_:2},1040)):(c(),L(Y,{key:1},[n.alwaysOn||i?(c(),k(gl,G($({key:0},r)),{arrow:u(({style:T,side:_})=>[n.showArrow?(c(),k(hl,$({key:0},a,{style:T,side:_}),null,16,["style","side"])):j("v-if",!0)]),default:u(()=>[A(n.$slots,"default")]),_:3},16)):j("v-if",!0)],64))],8,["to","disabled"]))]),_:3},16))}}));var en=me(Jo,[["__file","tooltip.vue"]]);const ln=Il(en),tn=ne({options:{type:te(Array),default:()=>[]},modelValue:{type:[String,Number,Boolean],default:void 0},block:Boolean,size:Lt,disabled:Boolean,validateEvent:{type:Boolean,default:!0},id:String,name:String,ariaLabel:String}),an={[$l]:e=>pl(e)||Ge(e),[Fl]:e=>pl(e)||Ge(e)},on=["id","aria-label","aria-labelledby"],nn=["name","disabled","checked","onChange"],sn=q({name:"ElSegmented"}),rn=q(J(F({},sn),{props:tn,emits:an,setup(e,{emit:l}){const t=e,a=We("segmented"),r=Cl(),s=Ot(),h=Bt(),{formItem:n}=Ut(),{inputId:d,isLabeledByFormItem:i}=Nt(t,{formItemContext:n}),T=D(null),_=jt(),S=de({isInit:!1,width:0,translateX:0,disabled:!1,focusVisible:!1}),E=C=>{const z=V(C);l($l,z),l(Fl,z)},V=C=>Ue(C)?C.value:C,I=C=>Ue(C)?C.label:C,f=C=>!!(h.value||Ue(C)&&C.disabled),v=C=>t.modelValue===V(C),p=C=>t.options.find(z=>V(z)===C),m=C=>[a.e("item"),a.is("selected",v(C)),a.is("disabled",f(C))],P=()=>{if(!T.value)return;const C=T.value.querySelector(".is-selected"),z=T.value.querySelector(".is-selected input");if(!C||!z){S.width=0,S.translateX=0,S.disabled=!1,S.focusVisible=!1;return}const ae=C.getBoundingClientRect();S.isInit=!0,S.width=ae.width,S.translateX=C.offsetLeft,S.disabled=f(p(t.modelValue));try{S.focusVisible=z.matches(":focus-visible")}catch(pe){}},b=B(()=>[a.b(),a.m(s.value),a.is("block",t.block)]),R=B(()=>({width:`${S.width}px`,transform:`translateX(${S.translateX}px)`,display:S.isInit?"block":"none"})),N=B(()=>[a.e("item-selected"),a.is("disabled",S.disabled),a.is("focus-visible",S.focusVisible)]),H=B(()=>t.name||r.value);return Mt(T,P),Q(_,P),Q(()=>t.modelValue,()=>{var C;P(),t.validateEvent&&((C=n==null?void 0:n.validate)==null||C.call(n,"change").catch(z=>qt()))},{flush:"post"}),(C,z)=>(c(),L("div",{id:o(d),ref_key:"segmentedRef",ref:T,class:ue(o(b)),role:"radiogroup","aria-label":o(i)?void 0:C.ariaLabel||"segmented","aria-labelledby":o(i)?o(n).labelId:void 0},[ee("div",{class:ue(o(a).e("group"))},[ee("div",{style:ke(o(R)),class:ue(o(N))},null,6),(c(!0),L(Y,null,K(C.options,(ae,pe)=>(c(),L("label",{key:pe,class:ue(m(ae))},[ee("input",{class:ue(o(a).e("item-input")),type:"radio",name:o(H),disabled:f(ae),checked:v(ae),onChange:$e=>E(ae)},null,42,nn),ee("div",{class:ue(o(a).e("item-label"))},[A(C.$slots,"default",{item:ae},()=>[O(x(I(ae)),1)])],2)],2))),128))],2)],10,on))}}));var un=me(rn,[["__file","segmented.vue"]]);const dn=Il(un);var cn=[zt,Ht,Dl,Gt,Kt,Yt,xt,Wt,Xt,we,Qt,Zt,Rl,Jt,ea,Al,la,ta,Ll,aa,Ol,Bl,oa,na,sa,Ul,ra,ua,ia,da,ca,pa,De,fa,ma,va,Nl,ba,ha,ga,ya,_a,jl,Xe,Le,Ea,Va,Pe,Ml,ql,ka,wa,Pa,Ca,Sa,Ta,Ia,$a,Fa,Da,Re,Ra,Qe,zl,Aa,Hl,La,Ze,Je,Oa,Ba,Ua,Na,Gl,ja,Ma,qa,za,Ha,Kl,Ga,Ka,Ya,xa,Wa,Yl,xl,Wl,Xl,Xa,Qa,Ql,ln,Zl,Za,Jl,Ja,eo,lo,to,ao,oo,no,dn],pn=[so,ro,Ke,et,uo,io],fn=Io([...cn,...pn]);const mn=fn.version,vn=e=>Ce.request("get",Se("/client/list"),{params:e}),bn=e=>Ce.request("post",Se("/client/download/"+e),null,{responseType:"arraybuffer"}),hn=e=>Ce.request("post",Se("/client/generate-qrcode/"+e)),yl=e=>Ce.request("post",Se("/client/save"),{data:e}),gn=e=>Ce.request("delete",Se("/client/"+e)),yn=q({__name:"qrCode",props:{formInline:{default:()=>({id:"",qrCodeStr:""})}},setup(e){const l=e,t=D(l.formInline);return(r=>{hn(r).then(s=>{s.code===200&&(t.value.qrCodeStr=s.data.qrCode)})})(l.formInline.id),(r,s)=>{const h=W("el-image"),n=W("el-card");return c(),k(n,{"body-style":"padding: inherit",shadow:"hover"},{default:u(()=>[y(h,{src:t.value.qrCodeStr,"preview-teleported":!0,style:{width:"100%",height:"100%"}},null,8,["src"])]),_:1})}}}),_n=de({name:[{required:!0,message:"名称不能为空",trigger:"blur"}],ipAllocation:[{required:!0,message:"客户端IP不能为空",trigger:"blur"}],allowedIPS:[{required:!0,message:"允许链接IP不能为空",trigger:"blur"}],enabled:[{required:!0,message:"状态不能为空",trigger:"blur"}]}),_l=q({__name:"detail",props:{formInline:{default:()=>({id:"",serverId:"",name:"",email:"",subnetRange:"",ipAllocation:[],allowedIPS:[],extraAllowedIPS:[],endpoint:"",useServerDNS:0,enableAfterCreation:0,keys:{privateKey:"",publicKey:"",presharedKey:""},enabled:1})}},setup(e,{expose:l}){const a=D(e.formInline),r=D();function s(){return r.value}return l({getDetailFormRef:s}),(h,n)=>{const d=W("el-input"),i=W("el-form-item"),T=W("el-select"),_=W("el-radio"),S=W("el-radio-group"),E=W("el-form");return c(),k(E,{ref_key:"detailFormRef",ref:r,model:a.value,rules:o(_n),"label-width":"20%","label-position":"right"},{default:u(()=>[y(i,{prop:"name",label:"名称"},{default:u(()=>[y(d,{modelValue:a.value.name,"onUpdate:modelValue":n[0]||(n[0]=V=>a.value.name=V)},null,8,["modelValue"])]),_:1}),y(i,{prop:"email",label:"邮箱"},{default:u(()=>[y(d,{modelValue:a.value.email,"onUpdate:modelValue":n[1]||(n[1]=V=>a.value.email=V)},null,8,["modelValue"])]),_:1}),y(i,{prop:"subnetRange",label:"子网范围"},{default:u(()=>[y(d,{modelValue:a.value.subnetRange,"onUpdate:modelValue":n[2]||(n[2]=V=>a.value.subnetRange=V)},null,8,["modelValue"])]),_:1}),y(i,{prop:"ipAllocation",label:"客户端IP"},{default:u(()=>[y(T,{modelValue:a.value.ipAllocation,"onUpdate:modelValue":n[3]||(n[3]=V=>a.value.ipAllocation=V),clearable:!0,"reserve-keyword":!1,"suffix-icon":"","tag-type":"warning","popper-class":"options-class",placeholder:"",multiple:"",filterable:"","allow-create":"","default-first-option":""},null,8,["modelValue"])]),_:1}),y(i,{prop:"allowedIPS",label:"允许访问的IP段"},{default:u(()=>[y(T,{modelValue:a.value.allowedIPS,"onUpdate:modelValue":n[4]||(n[4]=V=>a.value.allowedIPS=V),clearable:!0,"reserve-keyword":!1,"suffix-icon":"","tag-type":"warning","popper-class":"options-class",placeholder:"",multiple:"",filterable:"","allow-create":"","default-first-option":""},null,8,["modelValue"])]),_:1}),y(i,{prop:"extraAllowedIPS",label:"其他允许访问的IP段"},{default:u(()=>[y(T,{modelValue:a.value.extraAllowedIPS,"onUpdate:modelValue":n[5]||(n[5]=V=>a.value.extraAllowedIPS=V),clearable:!0,"reserve-keyword":!1,"suffix-icon":"","tag-type":"warning","popper-class":"options-class",placeholder:"",multiple:"",filterable:"","allow-create":"","default-first-option":""},null,8,["modelValue"])]),_:1}),y(i,{prop:"endpoint",label:"链接端点"},{default:u(()=>[y(d,{modelValue:a.value.endpoint,"onUpdate:modelValue":n[6]||(n[6]=V=>a.value.endpoint=V)},null,8,["modelValue"])]),_:1}),y(i,{prop:"useServerDNS",label:"是否使用服务端DNS"},{default:u(()=>[y(S,{modelValue:a.value.useServerDNS,"onUpdate:modelValue":n[7]||(n[7]=V=>a.value.useServerDNS=V)},{default:u(()=>[y(_,{value:1},{default:u(()=>[O("是")]),_:1}),y(_,{value:0},{default:u(()=>[O("否")]),_:1})]),_:1},8,["modelValue"])]),_:1}),y(i,{prop:"enableAfterCreation",label:"确认后创建"},{default:u(()=>[y(S,{modelValue:a.value.enableAfterCreation,"onUpdate:modelValue":n[8]||(n[8]=V=>a.value.enableAfterCreation=V)},{default:u(()=>[y(_,{value:1},{default:u(()=>[O("是")]),_:1}),y(_,{value:0},{default:u(()=>[O("否")]),_:1})]),_:1},8,["modelValue"])]),_:1}),y(i,{prop:"enabled",label:"状态"},{default:u(()=>[y(S,{modelValue:a.value.enabled,"onUpdate:modelValue":n[9]||(n[9]=V=>a.value.enabled=V)},{default:u(()=>[y(_,{value:1},{default:u(()=>[O("启用")]),_:1}),y(_,{value:0},{default:u(()=>[O("禁用")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])}}}),En=Object.prototype.toString,ol=e=>En.call(e),ut=e=>ol(e).slice(8,-1),Te=Array.isArray,qe=e=>ol(e)==="[object Date]",Z=e=>typeof e=="function",nl=e=>typeof e=="string",Vn=e=>e!==null&&typeof e=="object",Ye=e=>Vn(e)&&Z(e.then)&&Z(e.catch),sl=e=>ol(e)==="[object Object]",kn=e=>{if(nl(e))return{content:e};if(sl(e))return e},wn=(e,l)=>{if(!sl(e))throw new Error(`${l} expected Object but got ${ut(e)}`)},El=(e,l,t,a,r)=>_e(void 0,null,function*(){try{let s={};const h={row:t,index:a};return e?Ae(e)?s=e.value:sl(e)?s=F({},e):Z(e)?s=yield e(l,h):Ye(e)?s=yield e:s=e:s={},wn(s,r),s}catch(s){return Promise.reject(s)}}),rl=(e,l)=>l?`plus-${e}-${l}`:`plus-${e}`,fe=e=>`${rl("field",e)}`,he=e=>`${rl("label",e)}`,Ve=e=>`${rl("extra",e)}`,ge=(e,l)=>{const t={};return Object.keys(e||{}).forEach(a=>{a.startsWith(l)&&(t[a]=e[a])}),t},Pn=(e,l)=>{const t=e.split(".").map(s=>Number(s)),a=l.split(".").map(s=>Number(s)),r=Math.max(t.length,a.length);for(let s=0;s<r;s++){if((t[s]||0)>(a[s]||0))return 1;if((t[s]||0)<(a[s]||0))return-1}return 0},it=Pn(mn,"2.6.0")<0,Cn=e=>e?o(e):"",ze=e=>{Te(e)||console.error("Uncaught TypeError: ",`options expected Array but got ${ut(e)}`)},Sn=e=>{const l=D([]),t=D(!1);if(!e.options)l.value=[],t.value=!0;else if(Ae(e.options))Q(e.options,a=>{l.value=a,t.value=!0},{immediate:!0});else if(Te(e.options))l.value=[...e.options],t.value=!0;else if(Z(e.options)){const a=e.options,r=a(e);Ye(r)?r.then(s=>{l.value=s,t.value=!0,ze(l.value)}).catch(s=>{throw s}):(l.value=r,t.value=!0)}else Ye(e.options)?e.options.then(r=>{l.value=r,t.value=!0,ze(l.value)}).catch(r=>{throw r}):(t.value=!0,ze(e.options));return{customOptions:l,customOptionsIsReady:t}};var Tn={name:"en",plus:{dialog:{confirmText:"Yes",cancelText:"No",title:"Dialog"},datepicker:{startPlaceholder:"Please select start time",endPlaceholder:"Please select end time"},dialogForm:{title:"Dialog form"},drawerForm:{title:"Drawer form",confirmText:"Yes",cancelText:"No"},form:{submitText:"Submit",resetText:"Reset",errorTip:"Please complete the form and submit again!"},field:{pleaseEnter:"Please enter ",pleaseSelect:"Please select "},popover:{confirmText:"Yes",cancelText:"No"},search:{searchText:"Search",resetText:"Reset",expand:"Expand",retract:"Retract"},table:{title:"Table",density:"Density",refresh:"Refresh",columnSettings:"Column settings",selectAll:"Select all",default:"Default",loose:"Loose",compact:"Compact",action:"Action",more:"More",confirmToPerformThisOperation:"Confirm to perform this operation?",prompt:"Prompt",sort:"Sort"},stepsForm:{nextText:"Next step",preText:"Previous step",submitText:"Submit"},inputTag:{placeholder:"Please enter keywords and press enter or space key"},header:{logout:"logout"}}};const In=e=>(l,t)=>$n(l,t,o(e)),$n=(e,l,t)=>po(t,e,e).replace(/\{(\w+)\}/g,(a,r)=>{var s;return`${(s=l==null?void 0:l[r])!=null?s:`{${r}}`}`}),Fn=e=>{const l=B(()=>o(e).name),t=Ae(e)?e:D(e);return{lang:l,locale:t,t:In(e)}},Ie=e=>{const l=ye(co,D());return Fn(B(()=>l.value||Tn))},Dn=Symbol("tableFormFieldRefInjectionKey"),Rn=["datetimerange","daterange","monthrange"],An=["rate","input-number","slider"],Ln=["switch"],On=["checkbox","cascader","plus-date-picker","plus-input-tag","transfer"];var ce=(e,l)=>{const t=e.__vccOpts||e;for(const[a,r]of l)t[a]=r;return t},Bn=q({name:"PlusRender",__name:"index",props:{renderType:{default:void 0},callbackValue:{default:""},customFieldProps:{default:()=>({})},render:{},params:{default:()=>({})},handleChange:{}},setup(e){const l=e,t=D();Q(()=>l.callbackValue,r=>{t.value=r},{flush:"post",immediate:!0});const a=()=>{if(!l.render)return;const r=F({},l.params),s=l.renderType==="form"?l.render(t.value,l.handleChange,r):l.render(t.value,r);if(fo(s)){const h=l.renderType==="form"?F(F({modelValue:t.value},l.customFieldProps),s.props):F(F({},l.customFieldProps),s.props);return J(F({},s),{props:h})}else if(nl(s))return s};return(r,s)=>r.renderType==="form"?(c(),k(X(a),$({key:0,modelValue:t.value,"onUpdate:modelValue":s[0]||(s[0]=h=>t.value=h)},r.customFieldProps),null,16,["modelValue"])):(c(),k(X(a),G($({key:1},r.customFieldProps)),null,16))}}),Un=ce(Bn,[["__file","index.vue"]]);const Vl=Un;var Nn=q({name:"PlusRadio",__name:"index",props:{modelValue:{type:[String,Number,Boolean],default:""},options:{default:()=>[]},isCancel:{type:Boolean,default:!0},fieldSlots:{default:void 0},fieldChildrenSlot:{default:void 0}},emits:["change","update:modelValue"],setup(e,{expose:l,emit:t}){const a=e,r=t,s=D(),h=D(),n=de({radio:""});Q(()=>a.modelValue,_=>{n.radio=_},{immediate:!0});const d=lt(),i=(_,S,E)=>{if(!(Reflect.has(d,"disabled")||E!=null&&E.disabled)){if(a.isCancel)_.preventDefault();else return;n.radio===S?n.radio="":n.radio=S,r("update:modelValue",n.radio),r("change",n.radio)}},T=_=>{a.isCancel||(r("update:modelValue",_),r("change",_))};return l({radioInstance:s,radioGroupInstance:h}),(_,S)=>(c(),k(o(Qe),$({ref_key:"radioGroupInstance",ref:h,modelValue:n.radio,"onUpdate:modelValue":S[0]||(S[0]=E=>n.radio=E),class:"plus-radio"},_.$attrs),ie({default:u(()=>[o(it)?(c(!0),L(Y,{key:0},K(_.options,E=>(c(),k(o(Re),$({key:E.value,ref_for:!0,ref_key:"radioInstance",ref:s,label:E.value},E.fieldItemProps,{onClick:V=>i(V,E.value,E.fieldItemProps),onChange:V=>T(E.value)}),{default:u(()=>[o(Z)(E.fieldSlot)?(c(),k(X(E.fieldSlot),$({key:0,"model-value":n.radio,column:a},E),null,16,["model-value"])):o(Z)(_.fieldChildrenSlot)?(c(),k(X(_.fieldChildrenSlot),$({key:1,"model-value":n.radio,column:a},E),null,16,["model-value"])):(c(),L(Y,{key:2},[O(x(E==null?void 0:E.label),1)],64))]),_:2},1040,["label","onClick","onChange"]))),128)):(c(),L(Y,{key:1},[j(" element-plus 版本号大于等于2.6.0 "),(c(!0),L(Y,null,K(_.options,E=>(c(),k(o(Re),$({key:E.value,ref_for:!0,ref_key:"radioInstance",ref:s,value:E.value},E.fieldItemProps,{onClick:V=>i(V,E.value,E.fieldItemProps),onChange:V=>T(E.value)}),{default:u(()=>[o(Z)(E.fieldSlot)?(c(),k(X(E.fieldSlot),$({key:0,"model-value":n.radio,column:a},E),null,16,["model-value"])):o(Z)(_.fieldChildrenSlot)?(c(),k(X(_.fieldChildrenSlot),$({key:1,"model-value":n.radio,column:a},E),null,16,["model-value"])):(c(),L(Y,{key:2},[O(x(E==null?void 0:E.label),1)],64))]),_:2},1040,["value","onClick","onChange"]))),128))],64))]),_:2},[K(_.fieldSlots,(E,V)=>({name:V,fn:u(I=>[(c(),k(X(E),G(le(I)),null,16))])}))]),1040,["modelValue"]))}}),jn=ce(Nn,[["__file","index.vue"]]);const Mn=jn,qn={class:"plus-date-picker__middle"};var zn=q({name:"PlusDatePicker",__name:"index",props:{modelValue:{default:()=>[]},rangeSeparator:{default:"/"},valueFormat:{default:"YYYY-MM-DD HH:mm:ss"},type:{default:"datetime"},startProps:{default:()=>({})},endProps:{default:()=>({})},startDisabledDate:{type:Function,default:(e,l)=>l?e.getTime()>new Date(l).getTime():!1},endDisabledDate:{type:Function,default:(e,l)=>l?e.getTime()<new Date(l).getTime():!1}},emits:["change","focus","update:modelValue"],setup(e,{expose:l,emit:t}){const a=e,r=t,{t:s}=Ie(),h=lt(),n=B(()=>F(F({},h),a.startProps)),d=B(()=>F(F({},h),a.endProps)),i=D(),T=D(),_=de({start:"",end:""}),S=D(!1),E=p=>{S.value=!0,r("focus",p)},V=()=>{S.value=!1},I=p=>a.startDisabledDate&&Z(a.startDisabledDate)?a.startDisabledDate(p,_.end):!1,f=p=>a.endDisabledDate&&Z(a.endDisabledDate)?a.endDisabledDate(p,_.start):!1;Q(()=>a.modelValue,p=>{const[m,P]=p;_.start=m,_.end=P},{immediate:!0});const v=()=>{const p=[_.start,_.end];r("update:modelValue",p),r("change",p)};return l({startPickerInstance:i,endPickerInstance:T}),(p,m)=>tt((c(),L("div",{class:ue(["plus-date-picker",{"is-focus":S.value}])},[y(o(De),$({ref_key:"startPickerInstance",ref:i,modelValue:_.start,"onUpdate:modelValue":m[0]||(m[0]=P=>_.start=P),type:p.type,"value-format":p.valueFormat,placeholder:o(s)("plus.datepicker.startPlaceholder"),"disabled-date":I,class:"plus-date-picker__start",clearable:""},n.value,{onChange:v,onFocus:E}),null,16,["modelValue","type","value-format","placeholder"]),ee("span",qn,x(p.rangeSeparator),1),y(o(De),$({ref_key:"endPickerInstance",ref:T,modelValue:_.end,"onUpdate:modelValue":m[1]||(m[1]=P=>_.end=P),"value-format":p.valueFormat,type:p.type,placeholder:o(s)("plus.datepicker.endPlaceholder"),"disabled-date":f,class:"plus-date-picker__end",clearable:""},d.value,{onChange:v,onFocus:E}),null,16,["modelValue","value-format","type","placeholder"])],2)),[[o(at),V]])}}),Hn=ce(zn,[["__file","index.vue"]]);const Gn=Hn;var Kn=q({name:"PlusInputTag",__name:"index",props:{modelValue:{default:()=>[]},trigger:{default:()=>["blur","enter","space"]},inputProps:{default:()=>({})},tagProps:{default:()=>({})},limit:{default:1/0},formatTag:{type:Function,default:void 0},retainInputValue:{type:Boolean,default:!1}},emits:["update:modelValue","change","remove","blur","enter","space"],setup(e,{expose:l,emit:t}){const a=e,r=t,s=D(),h=D(),n=D(),d=de({tags:[],inputValue:"",isFocus:!1}),{t:i}=Ie();Q(()=>a.modelValue,I=>{d.tags=I.slice(0,a.limit)},{immediate:!0});const T=()=>{d.isFocus=!1},_=()=>{var I;d.isFocus=!0,(I=s.value)==null||I.focus()},S=I=>{d.tags=d.tags.filter(f=>f!==I),r("remove",I),r("update:modelValue",d.tags),r("change",d.tags)},E=()=>{d.inputValue.trim()&&!d.tags.includes(d.inputValue.trim())&&d.tags.length<a.limit&&d.tags.push(d.inputValue.trim()),a.retainInputValue||(d.inputValue=""),r("update:modelValue",d.tags),r("change",d.tags)},V=(I,f)=>{r(f,d.inputValue,I),(Te(a.trigger)?a.trigger:nl(a.trigger)?[a.trigger]:["blur","enter","space"]).includes(f)&&E()};return l({inputInstance:s,tagInstance:h}),(I,f)=>tt((c(),L("div",{ref_key:"plusInputTagInstance",ref:n,class:ue(["plus-input-tag",{"is-focus":d.isFocus}]),onClick:_},[(c(!0),L(Y,null,K(d.tags,v=>(c(),k(o(Yl),$({ref_for:!0,ref_key:"tagInstance",ref:h,key:v,class:"plus-input-tag__tag"},I.tagProps,{closable:"",onClose:p=>S(v)}),{default:u(()=>[O(x(I.formatTag&&o(Z)(I.formatTag)?I.formatTag(v):v),1)]),_:2},1040,["onClose"]))),128)),d.tags.length<I.limit?(c(),k(o(Pe),$({key:0,ref_key:"inputInstance",ref:s,modelValue:d.inputValue,"onUpdate:modelValue":f[0]||(f[0]=v=>d.inputValue=v),class:"plus-input-tag__input",placeholder:d.tags.length?"":o(i)("plus.inputTag.placeholder"),disabled:d.tags.length>=I.limit},I.inputProps,{clearable:"",onBlur:f[1]||(f[1]=v=>V(v,"blur")),onKeyup:[f[2]||(f[2]=fl(ml(v=>V(v,"enter"),["exact"]),["enter"])),f[3]||(f[3]=fl(ml(v=>V(v,"space"),["exact"]),["space"]))]}),null,16,["modelValue","placeholder","disabled"])):j("v-if",!0)],2)),[[o(at),T]])}}),Yn=ce(Kn,[["__file","index.vue"]]);const xn=Yn,dt={"plus-radio":{component:Mn,hasOptions:!0},"plus-date-picker":{component:Gn},"plus-input-tag":{component:xn},autocomplete:{component:Dl,props:{placeholder:"plus.field.pleaseEnter"},hasSelectEvent:!0},cascader:{component:Al,hasOptions:!0},checkbox:{component:Ol,children:Ll,hasVersionCompatibility:!0},"color-picker":{component:Ul},"date-picker":{component:De,props:{startPlaceholder:"plus.datepicker.startPlaceholder",endPlaceholder:"plus.datepicker.endPlaceholder"}},"input-number":{component:Ml,props:{placeholder:"plus.field.pleaseEnter"}},radio:{component:Qe,children:Re,hasVersionCompatibility:!0},rate:{component:zl},select:{component:Ze,children:Je},slider:{component:Gl},switch:{component:Kl},"time-picker":{component:Wl},"time-select":{component:Xl},transfer:{component:Zl},input:{component:Pe,props:{placeholder:"plus.field.pleaseEnter"}},textarea:{component:Pe,props:{type:"textarea",placeholder:"plus.field.pleaseEnter"}},"tree-select":{component:Jl}},Wn=e=>Object.keys(dt).includes(e),Ee=e=>Reflect.get(dt,e)||{},Xn={class:"plus-form-item__label"};var Qn=q({name:"PlusFormItem",__name:"index",props:{modelValue:{default:""},hasLabel:{default:!0},label:{default:""},prop:{},fieldProps:{default:()=>({})},valueType:{default:void 0},options:{default:()=>[]},formItemProps:{default:()=>({})},renderField:{default:void 0},renderLabel:{default:void 0},tooltip:{default:""},fieldSlots:{default:()=>({})},fieldChildrenSlot:{default:void 0},index:{default:0}},emits:["update:modelValue","change"],setup(e,{expose:l,emit:t}){const a=Xe,r=Ql,s=Le,h=Pe,n=Ze,d=Je,i=e,T=t,{t:_}=Ie(),{customOptions:S,customOptionsIsReady:E}=Sn(i),V=D(),I=D(),f=D({}),v=D({}),p=D(),m=D(!1),P=D(!1),b=B(()=>Cn(i.label)),R=B(()=>J(F({},i),{label:b.value})),N=ye(Dn,{}),H=B(()=>{var g,M,w,se,re,ul;return i.valueType==="cascader"&&((M=(g=v.value)==null?void 0:g.props)==null?void 0:M.emitPath)===!1?!1:!!(On.includes(i.valueType)||i.valueType==="select"&&((w=v.value)==null?void 0:w.multiple)===!0||i.valueType==="date-picker"&&Rn.includes((se=v.value)==null?void 0:se.type)||i.valueType==="time-picker"&&((re=v.value)==null?void 0:re.isRange)===!0||i.valueType==="tree-select"&&((ul=v.value)==null?void 0:ul.multiple)===!0)}),C=B(()=>!!An.includes(i.valueType)),z=B(()=>!!Ln.includes(i.valueType)),ae=g=>{if(H.value)if(Te(g)){const[M,w]=g;qe(M)||qe(w)?p.value=[String(M),String(w)]:p.value=g}else p.value=[];else C.value?p.value=Number(g):z.value?p.value=!!g:qe(g)?p.value=String(g):p.value=g;P.value=!0},pe=B(()=>{const{hasOptions:g,hasSelectEvent:M,props:w}=Ee(i.valueType);return F(F(J(F(F(F({},g?{options:S.value}:null),M?{onSelect:oe}:null),w),{placeholder:w!=null&&w.placeholder?_(w==null?void 0:w.placeholder)+b.value:_("plus.field.pleaseSelect")+b.value}),i.valueType==="date-picker"?{startPlaceholder:w!=null&&w.startPlaceholder?_(w==null?void 0:w.startPlaceholder):"",endPlaceholder:w!=null&&w.startPlaceholder?_(w==null?void 0:w.endPlaceholder):""}:null),v.value)}),$e=g=>F(F({},i.valueType==="select"?{label:g.label,value:g.value}:it?{label:g.value}:{label:g.label,value:g.value}),g.fieldItemProps);Q(()=>i.formItemProps,g=>{El(g,p.value,i,i.index,"formItemProps").then(M=>{f.value=M}).catch(M=>{throw M})},{immediate:!0,deep:!0}),Q(()=>i.fieldProps,g=>{El(g,p.value,i,i.index,"fieldProps").then(M=>{v.value=M,m.value=!0}).catch(M=>{throw M})},{immediate:!0,deep:!0}),Q(B(()=>[i.modelValue,m.value,E.value]),([g,M,w])=>{M&&w&&ae(g)},{immediate:!0,flush:"post"});const U=g=>{T("update:modelValue",g),T("change",g)},oe=({value:g})=>{U(g)};return Q(I,()=>{N.value={fieldInstance:I.value,valueIsReady:P}}),l({formItemInstance:V,fieldInstance:I}),(g,M)=>P.value?(c(),k(o(a),$({key:0,ref_key:"formItemInstance",ref:V,label:g.hasLabel?b.value:"",prop:g.prop,class:"plus-form-item"},f.value),ie({default:u(()=>[g.renderField&&o(Z)(g.renderField)?(c(),L(Y,{key:0},[P.value?(c(),k(o(Vl),{key:0,render:g.renderField,params:R.value,"callback-value":p.value,"custom-field-props":v.value,"render-type":"form","handle-change":U},null,8,["render","params","callback-value","custom-field-props"])):j("v-if",!0)],64)):g.$slots[o(fe)(g.prop)]?A(g.$slots,o(fe)(g.prop),{key:1,prop:g.prop,label:b.value,fieldProps:v.value,valueType:g.valueType,column:i}):g.valueType==="select"&&v.value.multiple===!0?(c(),k(o(n),$({key:2,ref_key:"fieldInstance",ref:I,modelValue:p.value,"onUpdate:modelValue":M[0]||(M[0]=w=>p.value=w),placeholder:o(_)("plus.field.pleaseSelect")+b.value,class:"plus-form-item-field",clearable:""},v.value,{"onUpdate:modelValue":U}),ie({default:u(()=>[(c(!0),L(Y,null,K(o(S),w=>(c(),k(o(d),$({key:w.label,label:w.label,value:w.value},w.fieldItemProps),{default:u(()=>[o(Z)(w.fieldSlot)?(c(),k(X(w.fieldSlot),G($({key:0},w)),null,16)):o(Z)(g.fieldChildrenSlot)?(c(),k(X(g.fieldChildrenSlot),G($({key:1},w)),null,16)):(c(),L(Y,{key:2},[O(x(w.label),1)],64))]),_:2},1040,["label","value"]))),128))]),_:2},[K(g.fieldSlots,(w,se)=>({name:se,fn:u(re=>[(c(),k(X(w),G(le(re)),null,16))])}))]),1040,["modelValue","placeholder"])):o(Wn)(g.valueType)?(c(),L(Y,{key:3},[j(" 统一处理 "),j(" has-children "),o(Ee)(g.valueType).children?(c(),k(X(o(Ee)(g.valueType).component),$({key:0,ref_key:"fieldInstance",ref:I,modelValue:p.value,"onUpdate:modelValue":M[1]||(M[1]=w=>p.value=w),class:"plus-form-item-field",clearable:""},pe.value,{"onUpdate:modelValue":U}),ie({default:u(()=>[(c(!0),L(Y,null,K(o(S),w=>(c(),k(X(o(Ee)(g.valueType).children),$({key:w.label},$e(w)),{default:u(()=>[o(Z)(w.fieldSlot)?(c(),k(X(w.fieldSlot),$({key:0,"model-value":p.value,column:R.value},w),null,16,["model-value","column"])):o(Z)(g.fieldChildrenSlot)?(c(),k(X(g.fieldChildrenSlot),$({key:1,"model-value":p.value,column:R.value},w),null,16,["model-value","column"])):(c(),L(Y,{key:2},[O(x(w.label),1)],64))]),_:2},1040))),128))]),_:2},[K(g.fieldSlots,(w,se)=>({name:se,fn:u(re=>[(c(),k(X(w),$({value:p.value,column:R.value},re),null,16,["value","column"]))])}))]),1040,["modelValue"])):(c(),L(Y,{key:1},[j(" no-children "),(c(),k(X(o(Ee)(g.valueType).component),$({ref_key:"fieldInstance",ref:I,modelValue:p.value,"onUpdate:modelValue":M[2]||(M[2]=w=>p.value=w),class:"plus-form-item-field",clearable:"","field-children-slot":g.fieldChildrenSlot},pe.value,{"onUpdate:modelValue":U}),ie({_:2},[K(g.fieldSlots,(w,se)=>({name:se,fn:u(re=>[(c(),k(X(w),$({"model-value":p.value,column:R.value},re),null,16,["model-value","column"]))])}))]),1040,["modelValue","field-children-slot"]))],2112))],64)):g.valueType==="text"?(c(),k(o(xl),$({key:4,ref_key:"fieldInstance",ref:I,class:"plus-form-item-field"},v.value),{default:u(()=>[O(x(p.value),1)]),_:1},16)):g.valueType==="divider"?(c(),k(o(Nl),$({key:5,ref_key:"fieldInstance",ref:I,class:"plus-form-item-field"},v.value),{default:u(()=>[O(x(p.value),1)]),_:1},16)):(c(),k(o(h),$({key:6,ref_key:"fieldInstance",ref:I,modelValue:p.value,"onUpdate:modelValue":M[3]||(M[3]=w=>p.value=w),class:"plus-form-item-field",placeholder:o(_)("plus.field.pleaseEnter")+b.value,autocomplete:"off",clearable:""},v.value,{"onUpdate:modelValue":U}),ie({_:2},[K(g.fieldSlots,(w,se)=>({name:se,fn:u(re=>[(c(),k(X(w),$({"model-value":p.value,column:R.value},re),null,16,["model-value","column"]))])}))]),1040,["modelValue","placeholder"]))]),_:2},[g.hasLabel?{name:"label",fn:u(({label:w})=>[ee("span",Xn,[g.renderLabel&&o(Z)(g.renderLabel)?(c(),L(Y,{key:0},[P.value?(c(),k(o(Vl),{key:0,render:g.renderLabel,params:R.value,"callback-value":w,"custom-field-props":v.value},null,8,["render","params","callback-value","custom-field-props"])):j("v-if",!0)],64)):A(g.$slots,o(he)(g.prop),{key:1,prop:g.prop,label:b.value,fieldProps:v.value,valueType:g.valueType,column:R.value},()=>[O(x(w),1)]),g.tooltip?(c(),k(o(r),$({key:2,placement:"top"},o(kn)(g.tooltip)),{default:u(()=>[A(g.$slots,"tooltip-icon",{},()=>[y(o(s),{class:"plus-table-column__label__icon",size:16},{default:u(()=>[y(o(mo))]),_:1})])]),_:3},16)):j("v-if",!0)])]),key:"0"}:void 0]),1040,["label","prop"])):j("v-if",!0)}}),Zn=ce(Qn,[["__file","index.vue"]]);const Jn=Zn,es={key:0,class:"plus-form-item-extra"};var ls=q({name:"PlusFormContent",__name:"form-content",props:{modelValue:{default:()=>({})},hasLabel:{type:Boolean,default:!0},columns:{default:()=>[]},rowProps:{default:()=>({})},colProps:{default:()=>({})}},emits:["update:modelValue","change"],setup(e,{emit:l}){const t=e,a=l,r=D({}),s=n=>{const d=o(n);return typeof d=="boolean"?d:t.hasLabel};Q(()=>t.modelValue,n=>{r.value=n},{immediate:!0});const h=(n,d)=>{a("update:modelValue",r.value),a("change",r.value,d)};return(n,d)=>(c(),k(o(Hl),$(n.rowProps,{class:"plus-form__row"}),{default:u(()=>[(c(!0),L(Y,null,K(n.columns,i=>(c(),k(o(Bl),$({key:i.prop},i.colProps||n.colProps),{default:u(()=>[y(o(Jn),$({modelValue:r.value[i.prop],"onUpdate:modelValue":T=>r.value[i.prop]=T},i,{"has-label":s(i.hasLabel),"label-width":s(i.hasLabel)?i.labelWidth:"0px",onChange:T=>h(T,i)}),ie({_:2},[n.$slots[o(he)(i.prop)]?{name:o(he)(i.prop),fn:u(T=>[A(n.$slots,o(he)(i.prop),G(le(T)))]),key:"0"}:void 0,n.$slots[o(fe)(i.prop)]?{name:o(fe)(i.prop),fn:u(T=>[A(n.$slots,o(fe)(i.prop),G(le(T)))]),key:"1"}:void 0,n.$slots["tooltip-icon"]?{name:"tooltip-icon",fn:u(()=>[A(n.$slots,"tooltip-icon")]),key:"2"}:void 0]),1040,["modelValue","onUpdate:modelValue","has-label","label-width","onChange"]),j(" el-form-item 下一行额外的内容 "),i.renderExtra||n.$slots[o(Ve)(i.prop)]?(c(),L("div",es,[i.renderExtra&&o(Z)(i.renderExtra)?(c(),k(X(i.renderExtra),G($({key:0},i)),null,16)):n.$slots[o(Ve)(i.prop)]?A(n.$slots,o(Ve)(i.prop),G($({key:1},i))):j("v-if",!0)])):j("v-if",!0)]),_:2},1040))),128)),j(" 搜索的footer插槽 "),A(n.$slots,"search-footer")]),_:3},16))}}),kl=ce(ls,[["__file","form-content.vue"]]);const ts={class:"plus-form__group__item__icon"};var as=q({name:"PlusForm",__name:"index",props:{modelValue:{default:()=>({})},defaultValues:{default:()=>({})},columns:{default:()=>[]},labelWidth:{default:"80px"},labelPosition:{default:"left"},rowProps:{default:()=>({})},colProps:{default:()=>({})},labelSuffix:{default:":"},hasErrorTip:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},hasReset:{type:Boolean,default:!0},hasLabel:{type:Boolean,default:!0},submitText:{default:""},resetText:{default:""},submitLoading:{type:Boolean,default:!1},footerAlign:{default:"left"},rules:{default:()=>({})},group:{type:[Boolean,Array],default:!1},cardProps:{default:()=>({})}},emits:["update:modelValue","submit","change","reset","submitError"],setup(e,{expose:l,emit:t}){const a=e,r=t,{t:s}=Ie(),h=D(null),n=D({}),d=b=>b.filter(R=>o(R.hideInForm)!==!0),i=B(()=>n.value),T=B(()=>({justifyContent:a.footerAlign==="left"?"flex-start":a.footerAlign==="center"?"center":"flex-end"})),_=B(()=>d(a.columns)),S=B(()=>{var b;return Te(a.group)?(b=a.group)==null?void 0:b.filter(R=>o(R.hideInGroup)!==!0):a.group}),E=ot(),V=ge(E,he()),I=ge(E,fe()),f=ge(E,Ve());Q(()=>a.modelValue,b=>{n.value=b},{immediate:!0});const v=(b,R)=>{r("update:modelValue",n.value),r("change",n.value,R)},p=()=>{var b;(b=h.value)==null||b.clearValidate()},m=()=>_e(this,null,function*(){var b,R,N;try{if(yield(b=h.value)==null?void 0:b.validate())return r("submit",n.value),!0}catch(H){if(a.hasErrorTip){Ke.closeAll();const C=Object.values(H);Ke.warning(((N=(R=C[0])==null?void 0:R[0])==null?void 0:N.message)||s("plus.form.errorTip"))}r("submitError",H)}return!1}),P=()=>{p(),n.value=F({},a.defaultValues),r("update:modelValue",n.value),r("reset",n.value)};return l({formInstance:h,handleSubmit:m,handleReset:P}),(b,R)=>(c(),k(o(jl),$({ref_key:"formInstance",ref:h,rules:b.rules,"label-width":b.hasLabel?b.labelWidth:0,class:["plus-form",b.hasLabel?"":"no-has-label"],"label-position":b.labelPosition,"validate-on-rule-change":!1,"label-suffix":b.hasLabel?b.labelSuffix:""},b.$attrs,{model:i.value}),{default:u(()=>[A(b.$slots,"default",{},()=>[j(" 分组表单 "),S.value?(c(!0),L(Y,{key:0},K(S.value,N=>(c(),k(o(Rl),$({key:N.title},N.cardProps||b.cardProps,{class:"plus-form__group__item"}),{header:u(()=>[A(b.$slots,"group-header",{title:N.title,columns:N.columns,icon:N.icon},()=>[ee("div",ts,[N.icon?(c(),k(o(Le),{key:0},{default:u(()=>[(c(),k(X(N.icon)))]),_:2},1024)):j("v-if",!0),O(" "+x(N.title),1)])])]),default:u(()=>[y(kl,{modelValue:n.value,"onUpdate:modelValue":R[0]||(R[0]=H=>n.value=H),"row-props":b.rowProps,"col-props":b.colProps,columns:d(N.columns),onChange:v},ie({_:2},[K(o(V),(H,C)=>({name:C,fn:u(z=>[A(b.$slots,C,G(le(z)))])})),K(o(I),(H,C)=>({name:C,fn:u(z=>[A(b.$slots,C,G(le(z)))])})),K(o(f),(H,C)=>({name:C,fn:u(z=>[A(b.$slots,C,G(le(z)))])})),b.$slots["tooltip-icon"]?{name:"tooltip-icon",fn:u(()=>[A(b.$slots,"tooltip-icon")]),key:"0"}:void 0]),1032,["modelValue","row-props","col-props","columns"])]),_:2},1040))),128)):(c(),L(Y,{key:1},[j(" 普通表单 "),y(kl,{modelValue:n.value,"onUpdate:modelValue":R[1]||(R[1]=N=>n.value=N),"row-props":b.rowProps,"col-props":b.colProps,columns:_.value,"has-label":b.hasLabel,onChange:v},ie({_:2},[K(o(V),(N,H)=>({name:H,fn:u(C=>[A(b.$slots,H,G(le(C)))])})),K(o(I),(N,H)=>({name:H,fn:u(C=>[A(b.$slots,H,G(le(C)))])})),K(o(f),(N,H)=>({name:H,fn:u(C=>[A(b.$slots,H,G(le(C)))])})),b.$slots["search-footer"]?{name:"search-footer",fn:u(()=>[A(b.$slots,"search-footer")]),key:"0"}:void 0,b.$slots["tooltip-icon"]?{name:"tooltip-icon",fn:u(()=>[A(b.$slots,"tooltip-icon")]),key:"1"}:void 0]),1032,["modelValue","row-props","col-props","columns","has-label"])],64))]),b.hasFooter?(c(),L("div",{key:0,class:"plus-form__footer",style:ke(T.value)},[A(b.$slots,"footer",G(le({handleReset:P,handleSubmit:m})),()=>[b.hasReset?(c(),k(o(we),{key:0,onClick:P},{default:u(()=>[j(" 重置 "),O(" "+x(b.resetText||o(s)("plus.form.resetText")),1)]),_:1})):j("v-if",!0),y(o(we),{type:"primary",loading:b.submitLoading,onClick:m},{default:u(()=>[j(" 提交 "),O(" "+x(b.submitText||o(s)("plus.form.submitText")),1)]),_:1},8,["loading"])])],4)):j("v-if",!0)]),_:3},16,["rules","label-width","class","label-position","label-suffix","model"]))}}),os=ce(as,[["__file","index.vue"]]);const ns=os;var ss=q({name:"PlusSearch",__name:"index",props:{modelValue:{default:()=>({})},defaultValues:{default:()=>({})},columns:{default:()=>[]},hasFooter:{type:Boolean,default:!0},hasReset:{type:Boolean,default:!0},hasUnfold:{type:Boolean,default:!0},searchText:{default:""},resetText:{default:""},searchLoading:{type:Boolean,default:!1},inline:{type:Boolean,default:!0},showNumber:{default:2},rowProps:{default:()=>({gutter:20})},colProps:{default:()=>({xs:24,sm:12,md:8,lg:8,xl:6})}},emits:["update:modelValue","search","change","reset","collapse"],setup(e,{expose:l,emit:t}){const a=e,r=t,{t:s}=Ie(),h=D(),n=D(!1),d=D({}),i=ot(),T=ge(i,he()),_=ge(i,fe()),S=ge(i,Ve()),E=B(()=>{const m=a.columns.filter(P=>o(P.hideInSearch)!==!0).map(P=>J(F({},P),{hideInForm:!1})).map(P=>J(F({},P),{order:P!=null&&P.order?o(P.order):0}));return wo(m,["order"],["desc"])}),V=B(()=>a.hasUnfold&&!n.value?E.value.slice(0,a.showNumber):E.value);Q(()=>a.modelValue,m=>{d.value=m},{immediate:!0});const I=(m,P)=>_e(this,null,function*(){r("update:modelValue",m),r("change",m,P)}),f=()=>{r("search",d.value)},v=()=>{d.value=F({},a.defaultValues),r("update:modelValue",d.value),r("reset",d.value)},p=m=>{m.preventDefault(),n.value=!n.value,r("collapse",n.value)};return l({plusFormInstance:h,handleReset:v,handleSearch:f,handleUnfold:p}),(m,P)=>(c(),k(o(ns),$({ref_key:"plusFormInstance",ref:h},m.$attrs,{modelValue:d.value,"onUpdate:modelValue":P[0]||(P[0]=b=>d.value=b),inline:m.inline,"row-props":m.rowProps,"col-props":m.colProps,columns:V.value,class:"plus-search","has-footer":!1,onChange:I}),ie({"search-footer":u(()=>[m.hasFooter?(c(),k(o(Xe),{key:0,class:"plus-search__button__wrapper"},{default:u(()=>[A(m.$slots,"footer",{isShowUnfold:n.value,handleReset:v,handleSearch:f,handleUnfold:p},()=>[m.hasReset?(c(),k(o(we),{key:0,icon:o(vo),onClick:v},{default:u(()=>[O(x(m.resetText||o(s)("plus.search.resetText")),1)]),_:1},8,["icon"])):j("v-if",!0),y(o(we),{type:"primary",loading:m.searchLoading,icon:o(bo),onClick:f},{default:u(()=>[O(x(m.searchText||o(s)("plus.search.searchText")),1)]),_:1},8,["loading","icon"]),m.hasUnfold&&E.value.length>m.showNumber?(c(),k(o(ql),{key:1,class:"plus-search__unfold",type:"primary",underline:!1,href:"javaScript:;",onClick:p},{default:u(()=>[O(x(n.value?o(s)("plus.search.retract"):o(s)("plus.search.expand"))+" ",1),y(o(Le),null,{default:u(()=>[n.value?(c(),k(o(ho),{key:0})):(c(),k(o(go),{key:1}))]),_:1})]),_:1})):j("v-if",!0)])]),_:3})):j("v-if",!0)]),_:2},[K(o(T),(b,R)=>({name:R,fn:u(N=>[A(m.$slots,R,G(le(N)))])})),K(o(_),(b,R)=>({name:R,fn:u(N=>[A(m.$slots,R,G(le(N)))])})),K(o(S),(b,R)=>({name:R,fn:u(N=>[A(m.$slots,R,G(le(N)))])})),m.$slots["tooltip-icon"]?{name:"tooltip-icon",fn:u(()=>[A(m.$slots,"tooltip-icon")]),key:"0"}:void 0]),1040,["modelValue","inline","row-props","col-props","columns"]))}}),rs=ce(ss,[["__file","index.vue"]]);const us=rs,is={class:"search-header",style:{"padding-bottom":"5px"}},ds={style:{"margin-top":"5px"}},cs={class:"content"},ps={class:"flex flex-wrap gap-4"},fs={class:"card-header"},ms={class:"paginate",style:{"background-color":"#ffffff","margin-top":"5px"}},vs=q({name:"Clients",__name:"clients",setup(e){const l=D(),t=D({name:"",email:"",ip:"",createUser:"",enabled:void 0,current:1,size:9}),a={gutter:0},r=[{label:"名称",prop:"name",valueType:"copy",fieldProps:{placeholder:"请输入"}},{label:"邮箱",prop:"email",valueType:"copy",fieldProps:{placeholder:"请输入"}},{label:"IP",prop:"ip",valueType:"copy",fieldProps:{placeholder:"请输入"}},{label:"创建人",prop:"createUser",valueType:"copy",fieldProps:{placeholder:"请输入"}},{label:"状态",prop:"enabled",valueType:"select",options:[{label:"启用",value:1},{label:"禁用",value:0}],fieldProps:{placeholder:"请选择"}}],s=de({data:[],total:0}),h=f=>{vn(f).then(v=>{v.code===200&&(s.data=v.data.records,s.total=v.data.total)})},n=(f,v)=>{bn(f).then(p=>{if(p){const m=new Blob([p],{type:"text/plain"}),P=document.createElement("a");P.download=v+".conf",P.style.display="none",P.href=URL.createObjectURL(m),document.body.appendChild(P),P.click(),URL.revokeObjectURL(P.href),document.body.removeChild(P)}})},d=(f,v)=>{Ne({width:"20%",title:f,contentRenderer:()=>je(yn),props:{formInline:{id:v}},hideFooter:!0})},i=()=>{const f=vl().getItem("server-info");Ne({width:"40%",title:"新增",contentRenderer:()=>je(_l,{ref:l}),props:{formInline:{id:"",serverId:f.id,name:"",email:"",subnetRange:"",ipAllocation:"",allowedIPS:"",extraAllowedIPS:"",endpoint:"",useServerDNS:0,enableAfterCreation:0,keys:null,enabled:1}},beforeSure:(v,{options:p})=>{l.value.getDetailFormRef().validate(P=>{P&&yl(p.props.formInline).then(b=>{b.code===200&&(v(),h(t.value))})})}})},T=f=>{const v=vl().getItem("server-info");Ne({width:"40%",title:f.name,contentRenderer:()=>je(_l,{ref:l}),props:{formInline:{id:f.id,serverId:v.id,name:f.name,email:f.email,subnetRange:f.subnetRange,ipAllocation:f.ipAllocation,allowedIPS:f.allowedIPS,extraAllowedIPS:f.extraAllowedIPS,endpoint:f.endpoint,useServerDNS:f.useServerDNS,enableAfterCreation:f.enableAfterCreation,keys:f.keys,enabled:Number(f.enabled)}},beforeSure:(p,{options:m})=>{l.value.getDetailFormRef().validate(b=>{b&&yl(m.props.formInline).then(R=>{R.code===200&&(p(),h(t.value))})})}})},_=(f,v)=>{et.confirm("是否删除:"+f,"删除",{distinguishCancelAndClose:!0,confirmButtonText:"确认",cancelButtonText:"取消",type:"warning",center:!0}).then(()=>{gn(v).then(p=>{p.code===200&&h(t.value)})})},S=f=>{h(f)},E=f=>{h({current:1,size:9}),t.value.current=1,t.value.size=9},V=(f,v)=>{t.value.size=v,t.value.current=f,h(t.value)},I=f=>f?f.length>=10?f.slice(0,10)+"...":f:"";return h(t.value),(f,v)=>{const p=W("el-card"),m=W("el-button"),P=W("el-tag"),b=W("el-tooltip"),R=W("el-dropdown-item"),N=W("el-dropdown-menu"),H=W("el-dropdown"),C=W("el-input"),z=W("el-form-item"),ae=W("el-select"),pe=W("el-form"),$e=W("el-pagination");return c(),L("div",null,[ee("div",is,[y(p,null,{default:u(()=>[y(o(us),{modelValue:t.value,"onUpdate:modelValue":v[0]||(v[0]=U=>t.value=U),resetText:"重置",searchText:"搜索",hasUnfold:!1,columns:r,rowProps:a,"label-width":"80","label-position":"right",onSearch:S,onReset:E},null,8,["modelValue"])]),_:1}),ee("div",ds,[y(p,null,{default:u(()=>[y(m,{type:"primary",onClick:i},{default:u(()=>[O("新增客户端")]),_:1})]),_:1})])]),ee("div",cs,[y(p,{"body-style":"padding: inherit",shadow:"hover"},{default:u(()=>[ee("div",ps,[(c(!0),L(Y,null,K(s.data,U=>(c(),k(p,{style:{width:"540px"},shadow:"hover"},{header:u(()=>[ee("div",fs,[y(b,{content:U.name,placement:"top"},{default:u(()=>[y(P,{size:"large"},{default:u(()=>[O(x(I(U.name)),1)]),_:2},1024)]),_:2},1032,["content"]),y(H,{trigger:"click",type:"primary","split-button":"",style:{float:"right"}},{dropdown:u(()=>[y(N,null,{default:u(()=>[y(R,null,{default:u(()=>[y(m,{type:"warning",onClick:oe=>n(U.id,U.name)},{default:u(()=>[O("下载")]),_:2},1032,["onClick"])]),_:2},1024),y(R,null,{default:u(()=>[y(m,{type:"danger",onClick:oe=>_(U.name,U.id)},{default:u(()=>[O("删除")]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),default:u(()=>[O(" 更多 ")]),_:2},1024),y(m,{type:"success",style:{float:"right","margin-right":"5px"},onClick:oe=>d(U.name,U.id)},{default:u(()=>[O("二维码")]),_:2},1032,["onClick"]),y(m,{type:"primary",style:{float:"right","margin-right":"5px"},onClick:oe=>T(U)},{default:u(()=>[O(" 详情 ")]),_:2},1032,["onClick"])])]),default:u(()=>[y(pe,{"label-position":"top"},{default:u(()=>[y(z,{prop:"name",label:"名称"},{default:u(()=>[y(C,{modelValue:U.name,"onUpdate:modelValue":oe=>U.name=oe},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),y(z,{prop:"email",label:"邮箱"},{default:u(()=>[y(C,{modelValue:U.email,"onUpdate:modelValue":oe=>U.email=oe},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),y(z,{prop:"ipAllocation",label:"客户端IP"},{default:u(()=>[y(ae,{modelValue:U.ipAllocation,"onUpdate:modelValue":oe=>U.ipAllocation=oe,clearable:!0,"reserve-keyword":!1,"suffix-icon":"","tag-type":"primary","popper-class":"options-class",placeholder:"",multiple:"",filterable:"","allow-create":"","default-first-option":""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),y(z,{prop:"allowedIPS",label:"允许的IP范围"},{default:u(()=>[y(ae,{modelValue:U.allowedIPS,"onUpdate:modelValue":oe=>U.allowedIPS=oe,clearable:!0,"reserve-keyword":!1,"suffix-icon":"","tag-type":"danger","popper-class":"options-class",placeholder:"",multiple:"",filterable:"","allow-create":"","default-first-option":""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),y(z,{label:"创建人"},{default:u(()=>[y(P,{effect:"dark",type:"primary"},{default:u(()=>[O(x(U.createUser),1)]),_:2},1024)]),_:2},1024),y(z,{label:"客户端状态"},{default:u(()=>[U.enabled?(c(),k(P,{key:0,effect:"dark",type:"success"},{default:u(()=>[O("启用")]),_:1})):(c(),k(P,{key:1,effect:"dark",type:"warning"},{default:u(()=>[O("禁用")]),_:1}))]),_:2},1024),y(z,{class:"timeItem"},{default:u(()=>[ee("p",null,"创建时间: "+x(U.createdAt),1),ee("p",null,"更新时间: "+x(U.updatedAt),1)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),ee("div",ms,[y(p,null,{default:u(()=>[y($e,{small:"",background:"",layout:"total,prev,pager,next","page-size":t.value.size,total:s.total,onChange:V},null,8,["page-size","total"])]),_:1})])]),_:1})])])}}}),gs=yo(vs,[["__scopeId","data-v-78d4c767"]]);export{gs as default};
|