2025-06-30 09:38:03 +08:00

2 lines
48 KiB
JavaScript

var $t=Object.defineProperty,Ot=Object.defineProperties;var Ht=Object.getOwnPropertyDescriptors;var We=Object.getOwnPropertySymbols;var Yt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable;var Ge=(e,n,t)=>n in e?$t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,I=(e,n)=>{for(var t in n||(n={}))Yt.call(n,t)&&Ge(e,t,n[t]);if(We)for(var t of We(n))Ut.call(n,t)&&Ge(e,t,n[t]);return e},j=(e,n)=>Ot(e,Ht(n));var W=(e,n,t)=>new Promise((h,A)=>{var y=s=>{try{o(t.next(s))}catch(g){A(g)}},a=s=>{try{o(t.throw(s))}catch(g){A(g)}},o=s=>s.done?h(s.value):Promise.resolve(s.value).then(y,a);o((t=t.apply(e,n)).next())});import{X as Vt,Y as jt,Z as qt,$ as zt,a0 as Qt,a1 as Xt,a2 as Jt,a3 as Ze,a4 as Wt,b as z,a5 as ft,r as O,a6 as Gt,u as De,e as Zt,c as R,L as et,a as u,a7 as en,a8 as Z,a9 as Le,aa as ht,ab as Be,E as Ee,ac as ye,ad as tn,h as _,q as Y,k as D,ae as Ue,af as Pe,j as P,ag as Fe,ah as Ve,ai as je,aj as le,m as q,w as Ne,i as $,ak as tt,s as ie,al as N,f as ee,am as gt,an as nn,ao as ae,ap as un,aq as mt,ar as ge,as as an,at as yt,au as nt,p as be,l as ce,av as ut,aw as ln,ax as on,ay as sn,az as rn,aA as qe,aB as Ft,t as de,aC as cn,aD as bt,aE as Ae,aF as re,aG as Re,aH as Et,aI as ze,aJ as At,aK as Bt,aL as dn,V as pn,G as $e,aM as Dt,aN as Ct,aO as vt,aP as fn,aQ as hn,aR as gn,aS as mn,aT as yn,aU as Fn,v as at,aV as bn,aW as lt,aX as En,aY as An,aZ as ot,a_ as Bn,a$ as Dn,b0 as _e}from"./index.f451ea46.js";import{P as Cn,b as vn,u as Te,a as Qe,B as we,c as Xe,d as kn,e as Oe,f as kt,g as St,T as _t,h as Pt,i as st,D as Sn,j as _n,t as Pn,k as Ln,l as Tn}from"./header.92f6bcbe.js";import{d as G}from"./user.bf6a5ac8.js";var wn=200;function xn(e,n,t,h){var A=-1,y=zt,a=!0,o=e.length,s=[],g=n.length;if(!o)return s;t&&(n=Vt(n,jt(t))),h?(y=Qt,a=!1):n.length>=wn&&(y=Xt,a=!1,n=new qt(n));e:for(;++A<o;){var i=e[A],B=t==null?i:t(i);if(i=h||i!==0?i:0,a&&B===B){for(var F=g;F--;)if(n[F]===B)continue e;s.push(i)}else y(n,B,h)||s.push(i)}return s}var Mn=Jt(function(e,n){return Ze(e)?xn(e,Wt(n,1,Ze,!0)):[]}),In=Mn;const Kn=z({components:{ScrollContainer:ft,PopupHeader:Cn},inheritAttrs:!1,props:vn,emits:["visible-change","ok","close","register"],setup(e,{emit:n}){const t=O(!1),h=Gt({excludeDefaultKeys:!1}),A=O(null),{t:y}=De(),{prefixCls:a}=Zt("basic-popup"),o={setPopupProps:b,emitVisible:void 0},s=Be();s&&n("register",o,s.uid);const g=R(()=>et(e,u(A))),i=R(()=>j(I(I({},u(h)),u(g)),{visible:u(t)})),B=R(()=>I(I({},h),u(i))),F=R(()=>{const{width:l,zIndex:c}=u(i);return{zIndex:c,width:l?en(l)?`${l}px`:l:"100%",margin:"0 auto"}}),r=R(()=>({position:"relative",height:"100%"})),d=R(()=>{var l;return!!((l=u(i))!=null&&l.loading)});Z(()=>e.visible,(l,c)=>{l!==c&&(t.value=l)},{deep:!0}),Z(()=>t.value,l=>{Le(()=>{var c;n("visible-change",l),s&&((c=o.emitVisible)==null||c.call(o,l,s.uid))})});function p(l){return W(this,null,function*(){const{closeFunc:c}=u(i);if(n("close",l),c&&Ee(c)){const C=yield c();t.value=!C;return}t.value=!1})}function b(l){A.value=et(u(A)||{},l),Reflect.has(l,"visible")&&(t.value=!!l.visible)}function f(){n("ok")}return{visibleRef:t,onClose:p,t:y,prefixCls:a,getMergeProps:g,getBodyStyle:F,getScrollContentStyle:r,getProps:i,getLoading:d,getBindValues:B,handleOk:f}}});function Nn(e,n,t,h,A,y){const a=ye("PopupHeader"),o=ye("ScrollContainer"),s=tn("loading");return e.visibleRef?(_(),Y("div",{key:0,class:ie([e.prefixCls,e.$attrs.class])},[D(a,le(e.getProps,{onClose:e.onClose,onOk:e.handleOk}),Ue({_:2},[Pe(Object.keys(e.$slots),g=>({name:g,fn:P(i=>[Fe(e.$slots,g,Ve(je(i||{})))])}))]),1040,["onClose","onOk"]),q("div",{class:ie(e.prefixCls+"-body")},[Ne((_(),$(o,{style:tt(e.getScrollContentStyle),"loading-tip":e.loadingText||e.t("common.loadingText")},{default:P(()=>[q("div",{style:tt(e.getBodyStyle)},[Fe(e.$slots,"default")],4)]),_:3},8,["style","loading-tip"])),[[s,e.getLoading]])],2)],2)):N("",!0)}var Rn=ht(Kn,[["render",Nn]]);const me=ee({}),He=ee({});function rt(){if(!Be())throw new Error("usePopup() can only be used inside setup() or functional components!");const e=O(null),n=O(!1),t=O("");function h(a,o){gt(()=>{e.value=null,n.value=null,me[u(t)]=null}),!(u(n)&&nn()&&a===u(e))&&(t.value=o,e.value=a,n.value=!0,a.emitVisible=(s,g)=>{He[g]=s})}const A=()=>{const a=u(e);return a||mt("usePopup instance is undefined!"),a},y={setPopupProps:a=>{var o;(o=A())==null||o.setPopupProps(a)},getVisible:R(()=>He[~~u(t)]),openPopup:(a=!0,o,s=!0)=>{var i;if((i=A())==null||i.setPopupProps({visible:a,confirmLoading:!1}),!o)return;if(s){me[u(t)]=null,me[u(t)]=ae(o);return}un(ae(me[u(t)]),ae(o))||(me[u(t)]=ae(o))},closePopup:()=>{var a;(a=A())==null||a.setPopupProps({visible:!1})}};return[h,y]}const Lt=e=>{const n=O(null),t=Be(),h=O("");if(!Be())throw new Error("usePopupInner() can only be used inside setup() or functional components!");const A=()=>{const a=u(n);if(!a){mt("usePopupInner instance is undefined!");return}return a},y=(a,o)=>{gt(()=>{n.value=null}),h.value=o,n.value=a,t==null||t.emit("register",a,o)};return ge(()=>{const a=me[u(h)];!a||!e||!Ee(e)||Le(()=>{e(a)})}),[y,{changeLoading:(a=!0)=>{var o;(o=A())==null||o.setPopupProps({loading:a})},changeOkLoading:(a=!0)=>{var o;(o=A())==null||o.setPopupProps({confirmLoading:a})},changeContinueLoading:(a=!0)=>{var o;(o=A())==null||o.setPopupProps({continueLoading:a})},getVisible:R(()=>He[~~u(h)]),closePopup:()=>{var a;(a=A())==null||a.setPopupProps({visible:!1})},setPopupProps:a=>{var o;(o=A())==null||o.setPopupProps(a)}}]},Tt=an(Rn);function $n(e){return G.get({url:"/api/tenant",data:e})}function On(e){return G.post({url:"/api/tenant",data:e})}function Hn(e){return G.put({url:`/api/tenant/${e.id}`,data:e})}function Yn(e,n){return G.delete({url:`/api/tenant/${e}`,data:n})}function Un(e){return G.get({url:`/api/tenant/${e}`})}function Vn(e){return G.post({url:"/api/tenant/Actions/Test",data:e})}function jn(e){return G.post({url:`/api/tenant/${e.id}/ResetPassword`,data:e})}function qn(e){return G.get({url:`/api/tenant/${e}/Menu`})}function zn(e,n){return G.post({url:`/api/tenant/${e}/SaveMenu`,data:n})}function wt(e){return G.get({url:`/api/tenant/${e}/AdminInfo`})}function Qn(e,n){return G.post({url:`/api/tenant/${e}/UpdateAdminInfo`,data:n})}const Xn=z({__name:"ExtraFormModal",emits:["register","change"],setup(e,{emit:n}){const t=ee({dataForm:{id:""},configOptions:[],dbType:"",testLoading:!1}),{testLoading:h,dbType:A}=yt(t),{createMessage:y}=be(),a=[{field:"configType",label:"\u8FDE\u63A5\u7C7B\u578B",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u8FDE\u63A5\u7C7B\u578B"},rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u8FDE\u63A5\u7C7B\u578B",type:"number"}]},{field:"fullName",label:"\u8FDE\u63A5\u540D\u79F0",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u540D\u79F0"},rules:[{required:!0,trigger:"blur",message:"\u8FDE\u63A5\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"host",label:"\u4E3B\u673A\u5730\u5740",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u4E3B\u673A\u5730\u5740"},rules:[{required:!0,trigger:"blur",message:"\u4E3B\u673A\u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"port",label:"\u7AEF\u53E3",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3"},rules:[{required:!0,trigger:"blur",message:"\u7AEF\u53E3\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"userName",label:"\u7528\u6237",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237"},rules:[{required:!0,trigger:"blur",message:"\u7528\u6237\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"password",label:"\u5BC6\u7801",component:"InputPassword",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801"},rules:[{required:!0,trigger:"blur",message:"\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A"}]},{ifShow:()=>t.dbType!=="DM"&&t.dbType!=="Oracle",field:"serviceName",label:"\u5E93\u540D",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u5E93\u540D"},rules:[{required:!0,trigger:"blur",message:"\u5E93\u540D\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"connectionStr",label:"\u81EA\u5B9A\u4E49URL",component:"Input",slot:"connectionStr"},{ifShow:()=>t.dbType!=="MySQL"&&t.dbType!=="SQLServer"&&t.dbType!=="PostgreSQL",field:"dbSchema",label:"\u6A21\u5F0F\u540D",component:"Input",slot:"dbSchema"}],[o,{setFieldsValue:s,resetFields:g,validate:i,updateSchema:B}]=Te({labelWidth:80,schemas:a}),[F,{closeModal:r}]=Qe(p),d=R(()=>t.dataForm.id?"\u7F16\u8F91":"\u65B0\u5EFA");function p(l){g(),t.dataForm.id=l.id||"",t.configOptions=l.configureList||[],t.dbType=l.dbType,B([{field:"configType",componentProps:{options:t.configOptions}}]),t.dataForm.id?s(l.record||{}):l.port&&s({port:l.port})}function b(){return W(this,null,function*(){const l=yield i();if(!l)return;let c=I({},l);c.id||(c.id=kn()),n("change",c),r()})}function f(){return W(this,null,function*(){const l=yield i();if(!l)return;t.testLoading=!0,l.oracleExtend=!!l.oracleExtend;const c=j(I({},l),{dbType:t.dbType});Vn(c).then(C=>{y.success(C.msg),t.testLoading=!1}).catch(()=>{t.testLoading=!1})})}return(l,c)=>{const C=ye("a-input");return _(),$(u(Xe),le(l.$attrs,{onRegister:u(F),width:"600px",title:d.value,onOk:b}),{default:P(()=>[D(u(we),{onRegister:u(o)},{connectionStr:P(({model:L,field:m})=>[u(A)!=="MySQL"&&u(A)!=="SQLServer"&&u(A)!=="PostgreSQL"?(_(),$(C,{key:0,value:L[m],"onUpdate:value":S=>L[m]=S,allowClear:"",placeholder:"\u8BF7\u8F93\u5165URL"},null,8,["value","onUpdate:value"])):(_(),$(C,{key:1,value:L[m],"onUpdate:value":S=>L[m]=S,allowClear:"",placeholder:"\u8BF7\u8F93\u5165URL"},{addonAfter:P(()=>[u(h)?(_(),$(u(nt),{key:0,class:"mr-5px"})):N("",!0),q("span",{class:"cursor-pointer",onClick:c[0]||(c[0]=S=>f())},"\u8FDE\u63A5\u6D4B\u8BD5")]),_:2},1032,["value","onUpdate:value"]))]),dbSchema:P(({model:L,field:m})=>[D(C,{value:L[m],"onUpdate:value":S=>L[m]=S,allowClear:"",placeholder:"\u8BF7\u8F93\u5165\u6A21\u5F0F\u540D"},{addonAfter:P(()=>[u(h)?(_(),$(u(nt),{key:0,class:"mr-5px"})):N("",!0),q("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=S=>f())},"\u8FDE\u63A5\u6D4B\u8BD5")]),_:2},1032,["value","onUpdate:value"])]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title"])}}});const Jn=z({__name:"Form",emits:["register","reload"],setup(e,{emit:n}){const t=ee({dataForm:{id:""},configList:[],port:""}),{createMessage:h}=be(),[A,{openModal:y}]=Oe(),s=[{field:"groupTitleField1",label:"",component:"GroupTitle",componentProps:{content:"\u8D26\u6237\u4FE1\u606F"},colProps:{sm:24,span:24}},{field:"fullName",label:"\u79DF\u6237\u540D\u79F0",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u79DF\u6237\u540D\u79F0"},rules:[{required:!0,trigger:"blur",message:"\u79DF\u6237\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"enCode",label:"\u79DF\u6237\u53F7",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u79DF\u6237\u53F7"},rules:[{required:!0,trigger:"blur",message:"\u79DF\u6237\u53F7\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^[A-Za-z0-9]+$/,message:"\u53EA\u80FD\u8F93\u5165\u5927\u5C0F\u5199\u82F1\u6587\u5B57\u6BCD\u3001\u6570\u5B57\u7EC4\u5408",trigger:"blur"}]},{field:"effectiveTime",label:"\u6709\u6548\u671F",component:"DateRange",componentProps:{placeholder:["\u8BF7\u9009\u62E9\u8D77\u59CB\u65F6\u95F4","\u8BF7\u9009\u62E9\u8FC7\u671F\u65F6\u95F4"],format:"YYYY-MM-DD HH:mm:ss"},rules:[{required:!0,trigger:"blur",message:"\u8BF7\u9009\u62E9\u6709\u6548\u671F"}]},{field:"domainName",label:"\u57DF\u540D",component:"Input",componentProps:{placeholder:"\u79DF\u6237\u53F7+\u540E\u53F0\u914D\u7F6E\u7684\u57DF\u540D\u751F\u6210",disabled:!0}},{field:"accountNum",label:"\u8D26\u53F7\u989D\u5EA6",component:"InputNumber",defaultValue:0,componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7\u989D\u5EA6",min:0,onBlur:Me}},{field:"type",label:"\u7C7B\u578B",component:"Radio",defaultValue:0,componentProps:{options:[{fullName:"\u5E93\u9694\u79BB",id:0},{fullName:"ID\u9694\u79BB",id:1},{fullName:"\u8FDE\u63A5\u9694\u79BB",id:2}]}},{ifShow:({values:v})=>v.type===2,field:"dbType",label:"\u8FDE\u63A5\u9A71\u52A8",component:"Select",defaultValue:"MySQL",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u8FDE\u63A5\u9A71\u52A8",options:[{fullName:"MySQL",id:"MySQL"},{fullName:"SQLServer",id:"SQLServer"},{fullName:"Oracle",id:"Oracle"},{fullName:"DM",id:"DM"},{fullName:"KingbaseES",id:"KingbaseES"},{fullName:"PostgreSQL",id:"PostgreSQL"}],showSearch:!0,onChange:Ce},rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u8FDE\u63A5\u9A71\u52A8"}]},{ifShow:({values:v})=>v.type===2,field:"config",label:"\u8FDE\u63A5\u914D\u7F6E",component:"Input",slot:"config",colProps:{sm:24,span:24}},{field:"groupTitleField2",label:"",component:"GroupTitle",componentProps:{content:"\u5355\u4F4D\u4FE1\u606F"},colProps:{sm:24,span:24}},{field:"unitInfoJson.unitShortName",label:"\u5355\u4F4D\u7B80\u79F0",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D\u7B80\u79F0"}},{field:"unitInfoJson.unitCreditCode",label:"\u4FE1\u7528\u4EE3\u7801",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u4FE1\u7528\u4EE3\u7801"}},{field:"unitInfoJson.unitNature",label:"\u5355\u4F4D\u6027\u8D28",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u5355\u4F4D\u6027\u8D28",options:[{fullName:"\u4E2A\u4F53\u6237",id:0},{fullName:"\u5408\u4F19\u4F01\u4E1A",id:1},{fullName:"\u96C6\u4F53\u4F01\u4E1A",id:2},{fullName:"\u79C1\u8425\u4F01\u4E1A",id:3},{fullName:"\u56FD\u6709\u4F01\u4E1A",id:4}],showSearch:!0}},{field:"unitInfoJson.unitAddress",label:"\u8BE6\u7EC6\u5730\u5740",component:"Textarea",componentProps:{rows:3,placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"},colProps:{sm:24,span:24}},{field:"unitInfoJson.unitDescription",label:"\u5355\u4F4D\u7B80\u4ECB",component:"Textarea",componentProps:{rows:3,placeholder:"\u8BF7\u8F93\u5165\u5355\u4F4D\u7B80\u4ECB"},colProps:{sm:24,span:24}},{field:"groupTitleField3",label:"",component:"GroupTitle",componentProps:{content:"\u8054\u7CFB\u4EBA\u4FE1\u606F"},colProps:{sm:24,span:24}},{field:"userInfoJson.contacts",label:"\u8054\u7CFB\u4EBA",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u4EBA"}},{field:"userInfoJson.contactPhone",label:"\u8054\u7CFB\u7535\u8BDD",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u7535\u8BDD"},rules:[{pattern:/^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8054\u7CFB\u7535\u8BDD",trigger:"blur"}]},{field:"userInfoJson.contactEmail",label:"\u8054\u7CFB\u90AE\u7BB1",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8054\u7CFB\u90AE\u7BB1"},rules:[{pattern:/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u8054\u7CFB\u90AE\u7BB1",trigger:"blur"}]},{field:"groupTitleField4",label:"",component:"GroupTitle",componentProps:{content:"\u5176\u4ED6\u4FE1\u606F"},colProps:{sm:24,span:24}},{field:"sortCode",label:"\u6392\u5E8F",defaultValue:0,component:"InputNumber",componentProps:{min:0,max:999999}},{field:"enabledMark",label:"\u72B6\u6001",component:"Switch",defaultValue:1},{field:"description",label:"\u8BF4\u660E",component:"Textarea",componentProps:{rows:3,placeholder:"\u8BF7\u8F93\u5165\u8BF4\u660E"},colProps:{sm:24,span:24}}],[g,{setFieldsValue:i,getFieldsValue:B,resetFields:F,validate:r,updateSchema:d}]=Te({baseColProps:{sm:12,xs:24},labelWidth:90,schemas:s,fieldMapToTime:[["effectiveTime",["startTime","endTime"]]]}),[p,{changeLoading:b,closePopup:f,changeOkLoading:l}]=Lt(S),c=[{fullName:"\u4E3B\u6570\u636E\u5E93",id:0},{fullName:"\u4ECE\u6570\u636E\u5E93",id:1}],C=[{title:"\u8FDE\u63A5\u7C7B\u578B",dataIndex:"configType",width:120,align:"center",customRender:({record:v})=>v.configType==1?"\u4ECE\u6570\u636E\u5E93":"\u4E3B\u6570\u636E\u5E93"},{title:"\u8FDE\u63A5\u540D\u79F0",dataIndex:"fullName",width:120,align:"center"},{title:"\u4E3B\u673A\u5730\u5740",dataIndex:"host",width:160,align:"center"},{title:"\u7AEF\u53E3",dataIndex:"port",width:80,align:"center"}],[L]=kt({columns:C,useSearchForm:!1,showTableSetting:!1,pagination:!1,isCanResizeParent:!0,showIndexColumn:!1,actionColumn:{width:100,title:"\u64CD\u4F5C",dataIndex:"action"}}),m=R(()=>t.dataForm.id?"\u7F16\u8F91":"\u65B0\u5EFA");function S(v){F(),t.dataForm.id=v.id||"",t.configList=[],t.port="3306",t.dataForm.id&&(b(!0),Un(t.dataForm.id).then(H=>{b(!1),t.dataForm=JSON.parse(JSON.stringify(H.data)),t.dataForm.effectiveTime=[t.dataForm.startTime,t.dataForm.endTime],i(t.dataForm),t.configList=t.dataForm.linkList||[],Ce(t.dataForm.dbType,!1)})),d([{field:"dataSchema",componentProps:{disabled:!!t.dataForm.id}},{field:"enCode",componentProps:{disabled:!!t.dataForm.id}},{field:"type",componentProps:{disabled:!!t.dataForm.id}}])}function U(){return W(this,null,function*(){const v=yield r();if(!v)return;if(t.configList=t.configList.map(X=>j(I({},X),{port:Number(X.port),dbType:v.dbType})),!t.configList.filter(X=>X.configType==0).length&&!!v.dataSchema)return h.error("\u8FDE\u63A5\u914D\u7F6E\u672A\u914D\u7F6E\u3010\u4E3B\u6570\u636E\u5E93\u3011");l(!0);const oe=j(I(j(I({},v),{unitInfoJson:{},userInfoJson:{}}),B()),{id:t.dataForm.id,linkList:t.configList});(t.dataForm.id?Hn:On)(oe).then(X=>{h.success(X.msg),l(!1),f(),n("reload")}).catch(()=>{l(!1)})})}function pe(v,H){return[{label:"\u7F16\u8F91",onClick:te.bind(null,v)},{label:"\u5220\u9664",color:"error",modelConfirm:{onOk:Q.bind(null,H)}}]}function te(v){const H=B();if(!H.dbType)return h.warning("\u8BF7\u5148\u9009\u62E9\u6570\u636E\u9A71\u52A8");y(!0,{id:(v==null?void 0:v.id)||"",configureList:c,dbType:H.dbType,port:t.port,record:v})}function Q(v){t.configList.splice(v,1)}function Ce(v,H=!0){H&&(t.configList=[]),v==="SQLServer"&&(t.port="1433"),v==="MySQL"&&(t.port="3306"),v==="Oracle"&&(t.port="1521"),v==="DM"&&(t.port="5236"),v==="KingbaseES"&&(t.port="54321"),v==="PostgreSQL"&&(t.port="5432")}function ve(v){const H=t.configList.findIndex(oe=>oe.id===v.id);if(H==-1)return t.configList.push(v);t.configList[H]=v}function Me(v){v.target.value||i({accountNum:0})}return(v,H)=>{const oe=ye("a-button");return _(),$(u(Tt),le(v.$attrs,{onRegister:u(p),title:m.value,showOkBtn:"",onOk:U}),{default:P(()=>[D(u(we),{onRegister:u(g),class:"!px-30px"},{config:P(()=>[q("div",null,[D(u(St),{onRegister:u(L),"data-source":t.configList,class:"!mb-20px !h-200px"},{bodyCell:P(({column:ke,record:X,index:fe})=>[ke.key==="action"?(_(),$(u(_t),{key:0,actions:pe(X,fe)},null,8,["actions"])):N("",!0)]),_:1},8,["onRegister","data-source"]),q("div",{class:"table-add-action",onClick:te},[D(oe,{type:"link"},{default:P(()=>[D(u(Pt)),ce("\u65B0\u5EFA")]),_:1})])])]),_:1},8,["onRegister"]),D(Xn,{onRegister:u(A),onChange:ve},null,8,["onRegister"])]),_:1},16,["onRegister","title"])}}});var Wn=ht(Jn,[["__scopeId","data-v-15327fb8"]]);const Gn=z({__name:"AdminModal",setup(e){const n=ee({dataForm:{id:""},configList:[],port:""}),{createMessage:t}=be(),h=[{field:"account",label:"\u8D26\u53F7",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7",disabled:!0}},{field:"realName",label:"\u59D3\u540D",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D"},rules:[{required:!0,trigger:"blur",message:"\u59D3\u540D\u4E0D\u80FD\u4E3A\u7A7A"}]},{field:"gender",label:"\u6027\u522B",component:"Select",componentProps:{placeholder:"\u9009\u62E9\u6027\u522B",options:[{fullName:"\u4FDD\u5BC6",id:0},{fullName:"\u7537",id:1},{fullName:"\u5973",id:2}]},rules:[{required:!0,trigger:"change",message:"\u8BF7\u9009\u62E9\u6027\u522B",type:"number"}]},{field:"mobilePhone",label:"\u624B\u673A\u53F7\u7801",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7\u7801"},rules:[{required:!0,trigger:"blur",message:"\u624B\u673A\u53F7\u7801\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^1[3456789]\d{9}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}]},{field:"email",label:"\u7535\u5B50\u90AE\u7BB1",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u7BB1"},rules:[{required:!0,trigger:"blur",message:"\u7535\u5B50\u90AE\u7BB1\u4E0D\u80FD\u4E3A\u7A7A"},{pattern:/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u7535\u5B50\u90AE\u7BB1",trigger:"blur"}]}],[A,{setFieldsValue:y,resetFields:a,validate:o}]=Te({labelWidth:80,schemas:h}),[s,{changeLoading:g,closeModal:i,changeOkLoading:B}]=Qe(F);function F(d){a(),n.dataForm.id=d.id||"",g(!0),wt(n.dataForm.id).then(p=>{n.dataForm=j(I({},p.data),{id:n.dataForm.id}),y(n.dataForm),g(!1)}).catch(()=>{i()})}function r(){return W(this,null,function*(){const d=yield o();!d||(B(!0),Qn(n.dataForm.id,d).then(p=>{t.success(p.msg),B(!1),i()}).catch(()=>{B(!1)}))})}return(d,p)=>(_(),$(u(Xe),le(d.$attrs,{onRegister:u(s),width:"500px",title:"\u7BA1\u7406\u5458\u7EF4\u62A4",onOk:r}),{default:P(()=>[D(u(we),{onRegister:u(A)},null,8,["onRegister"])]),_:1},16,["onRegister"]))}}),Zn=z({__name:"ResetPwdModal",emits:["register"],setup(e){const n=(f,l)=>W(this,null,function*(){return l&&(l.toString().length<6||l.toString().length>18)?Promise.reject("\u5BC6\u7801\u957F\u5EA6\u4E3A6 - 18\u4E2A\u5B57\u7B26"):(y().validatePassword!==""&&o(["validatePassword"]),Promise.resolve())}),t=(f,l)=>W(this,null,function*(){return l&&l!==y().userPassword?Promise.reject("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4"):Promise.resolve()}),[h,{setFieldsValue:A,getFieldsValue:y,resetFields:a,validate:o}]=Te({labelWidth:90,schemas:[{field:"account",label:"\u8D26\u53F7",component:"Input",componentProps:{disabled:!0,placeholder:"\u8BF7\u8F93\u5165\u8D26\u53F7"}},{field:"userPassword",label:"\u65B0\u5BC6\u7801",component:"InputPassword",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"},rules:[{required:!0,trigger:"blur",message:"\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A"},{validator:n,trigger:"blur"}]},{field:"validatePassword",label:"\u786E\u8BA4\u65B0\u5BC6\u7801",component:"InputPassword",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u786E\u8BA4\u65B0\u5BC6\u7801"},rules:[{required:!0,trigger:"blur",message:"\u786E\u8BA4\u65B0\u5BC6\u7801\u4E0D\u80FD\u4E3A\u7A7A"},{validator:t,trigger:"blur"}]}]}),[s,{changeOkLoading:g,changeLoading:i,closeModal:B}]=Qe(p),F=O(""),r=ee({dataForm:{}}),{createMessage:d}=be();function p(f){a(),F.value=f.id,i(!0),wt(F.value).then(l=>{i(!1),r.dataForm=l.data||{},A({account:l.data.account||""})}).catch(()=>{B()})}function b(){return W(this,null,function*(){const f=yield o();if(!f)return;g(!0);const l=j(I(j(I({},r.dataForm),{id:F.value}),f),{userPassword:ut(f.userPassword),validatePassword:ut(f.validatePassword)});jn(l).then(c=>{d.success(c.msg),g(!1),B()}).catch(()=>{g(!1)})})}return(f,l)=>(_(),$(u(Xe),le(f.$attrs,{onRegister:u(s),width:"500px",title:"\u91CD\u7F6E\u5BC6\u7801",onOk:b}),{default:P(()=>[D(u(we),{onRegister:u(h)},null,8,["onRegister"])]),_:1},16,["onRegister"]))}});function Ye(e,n){return n?typeof n=="string"?` ${e}--${n}`:Array.isArray(n)?n.reduce((t,h)=>t+Ye(e,h),""):Object.keys(n).reduce((t,h)=>t+(n[h]?Ye(e,h):""),""):""}function eu(e){return(n,t)=>(n&&typeof n!="string"&&(t=n,n=""),n=n?`${e}__${n}`:e,`${n}${Ye(n,t)}`)}function xe(e){return[eu(`${ln}-${e}`)]}const it=Symbol(),ct=Symbol();function tu(e,n){if(!sn(e)||!!e[ct])return e;const{values:t,required:h,default:A,type:y,validator:a}=e,o=t||a?s=>{let g=!1,i=[];if(t&&(i=[...t,A],g||(g=i.includes(s))),a&&(g||(g=a(s))),!g&&i.length>0){const B=[...new Set(i)].map(F=>JSON.stringify(F)).join(", ");rn(`Invalid prop: validation failed${n?` for prop "${n}"`:""}. Expected one of [${B}], got value ${JSON.stringify(s)}.`)}return g}:void 0;return{type:typeof y=="object"&&Object.getOwnPropertySymbols(y).includes(it)?y[it]:y,required:!!h,default:A,validator:o,[ct]:!0}}const nu=e=>on(Object.entries(e).map(([n,t])=>[n,tu(t,n)]));var T=(e=>(e[e.RELOAD=0]="RELOAD",e[e.SELECT_ALL=1]="SELECT_ALL",e[e.UN_SELECT_ALL=2]="UN_SELECT_ALL",e[e.EXPAND_ALL=3]="EXPAND_ALL",e[e.UN_EXPAND_ALL=4]="UN_EXPAND_ALL",e[e.CHECK_STRICTLY=5]="CHECK_STRICTLY",e[e.CHECK_UN_STRICTLY=6]="CHECK_UN_STRICTLY",e))(T||{});const uu=["update:expandedKeys","update:selectedKeys","update:value","change","check","update:searchValue","select"],au=nu({value:{type:[Object,Array]},renderIcon:{type:Function},helpMessage:{type:[String,Array],default:""},title:{type:String,default:""},toolbar:Boolean,search:Boolean,searchValue:{type:String,default:""},checkStrictly:Boolean,clickRowToExpand:{type:Boolean,default:!1},checkable:Boolean,defaultExpandLevel:{type:[String,Number],default:""},defaultExpandAll:Boolean,fieldNames:{type:Object,default:()=>({key:"id",title:"fullName",children:"children"})},treeData:{type:Array},actionList:{type:Array,default:()=>[]},expandedKeys:{type:Array,default:()=>[]},selectedKeys:{type:Array,default:()=>[]},checkedKeys:{type:[Array,Object],default:()=>[]},beforeRightClick:{type:Function,default:void 0},rightMenuList:{type:Array},filterFn:{type:Function,default:void 0},highlight:{type:[Boolean,String],default:!0},expandOnSearch:Boolean,checkOnSearch:Boolean,selectedOnSearch:Boolean,loading:{type:Boolean,default:!1},treeWrapperClassName:String}),lu={key:2,class:"flex items-center flex-1 cursor-pointer justify-self-stretch"},ou=z({__name:"TreeHeader",props:{helpMessage:{type:[String,Array],default:""},title:{type:String,default:""},toolbar:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},search:{type:Boolean,default:!1},searchText:{type:String,default:""},checkAll:{type:Function,default:void 0},expandAll:{type:Function,default:void 0}},emits:["strictly-change","search"],setup(e,{emit:n}){const t=e,h=O(""),[A]=xe("tree-header"),y=qe(),{t:a}=De(),o=R(()=>{const F=y.headerTitle||t.title;return["mr-1","w-full",{["ml-5"]:F}]}),s=R(()=>{const{checkable:F}=t,r=[{label:a("component.tree.expandAll"),value:T.EXPAND_ALL},{label:a("component.tree.unExpandAll"),value:T.UN_EXPAND_ALL,divider:F}];return F?[{label:a("component.tree.selectAll"),value:T.SELECT_ALL},{label:a("component.tree.unSelectAll"),value:T.UN_SELECT_ALL,divider:F},...r,{label:a("component.tree.checkStrictly"),value:T.CHECK_STRICTLY},{label:a("component.tree.checkUnStrictly"),value:T.CHECK_UN_STRICTLY}]:r});function g(F){var d,p,b,f;const{key:r}=F;switch(r){case T.SELECT_ALL:(d=t.checkAll)==null||d.call(t,!0);break;case T.UN_SELECT_ALL:(p=t.checkAll)==null||p.call(t,!1);break;case T.EXPAND_ALL:(b=t.expandAll)==null||b.call(t,!0);break;case T.UN_EXPAND_ALL:(f=t.expandAll)==null||f.call(t,!1);break;case T.CHECK_STRICTLY:n("strictly-change",!1);break;case T.CHECK_UN_STRICTLY:n("strictly-change",!0);break}}function i(F){n("search",F)}const B=Ft(i,200);return Z(()=>h.value,F=>{B(F)}),Z(()=>t.searchText,F=>{F!==h.value&&(h.value=F)}),(F,r)=>(_(),Y("div",{class:ie([u(A)(),"flex px-2 py-1.5 items-center"])},[u(y).headerTitle?Fe(F.$slots,"headerTitle",{key:0}):N("",!0),!u(y).headerTitle&&F.title?(_(),$(u(cn),{key:1,helpMessage:F.helpMessage},{default:P(()=>[ce(de(F.title),1)]),_:1},8,["helpMessage"])):N("",!0),F.search||F.toolbar?(_(),Y("div",lu,[F.search?(_(),Y("div",{key:0,class:ie(o.value)},[D(u(bt),{placeholder:u(a)("common.searchText"),size:"small",allowClear:"",value:h.value,"onUpdate:value":r[0]||(r[0]=d=>h.value=d)},null,8,["placeholder","value"])],2)):N("",!0),F.toolbar?(_(),$(u(Bt),{key:1,onClick:r[1]||(r[1]=At(()=>{},["prevent"]))},{overlay:P(()=>[D(u(Ae),{onClick:g},{default:P(()=>[(_(!0),Y(re,null,Pe(s.value,d=>(_(),Y(re,{key:d.value},[D(u(Re),Ve(je({key:d.value})),{default:P(()=>[ce(de(d.label),1)]),_:2},1040),d.divider?(_(),$(u(Et),{key:0})):N("",!0)],64))),128))]),_:1})]),default:P(()=>[D(u(ze),{icon:"ion:ellipsis-vertical"})]),_:1})):N("",!0)])):N("",!0)],2))}}),su=({icon:e})=>e?dn(e)?pn("i",{class:"icon-my mr-6px "+e}):ze:null;function ru(e,n){function t(r){const d=[],p=r||u(e),{key:b,children:f}=u(n);if(!f||!b)return d;for(let l=0;l<p.length;l++){const c=p[l];d.push(c[b]);const C=c[f];C&&C.length&&d.push(...t(C))}return d}function h(r){const d=[],p=r||u(e),{key:b,children:f}=u(n);if(!f||!b)return d;for(let l=0;l<p.length;l++){const c=p[l];c.disabled!==!0&&c.selectable!==!1&&d.push(c[b]);const C=c[f];C&&C.length&&d.push(...h(C))}return d}function A(r,d){const p=[],b=d||u(e),{key:f,children:l}=u(n);if(!l||!f)return p;for(let c=0;c<b.length;c++){const C=b[c],L=C[l];r===C[f]?(p.push(C[f]),L&&L.length&&p.push(...t(L))):L&&L.length&&p.push(...A(r,L))}return p}function y(r,d,p){if(!r)return;const b=p||u(e),{key:f,children:l}=u(n);if(!(!l||!f))for(let c=0;c<b.length;c++){const C=b[c],L=C[l];if(C[f]===r){b[c]=I(I({},b[c]),d);break}else L&&L.length&&y(r,d,C[l])}}function a(r=1,d,p=1){if(!r)return[];const b=[],f=d||u(e)||[];for(let l=0;l<f.length;l++){const c=f[l],{key:C,children:L}=u(n),m=C?c[C]:"",S=L?c[L]:[];b.push(m),S&&S.length&&p<r&&(p+=1,b.push(...a(r,S,p)))}return b}function o({parentKey:r=null,node:d,push:p="push"}){const b=$e(u(e));if(!r){b[p](d),e.value=b;return}const{key:f,children:l}=u(n);!l||!f||(st(b,c=>{if(c[f]===r)return c[l]=c[l]||[],c[l][p](d),!0}),e.value=b)}function s({parentKey:r=null,list:d,push:p="push"}){const b=$e(u(e));if(!(!d||d.length<1))if(r){const{key:f,children:l}=u(n);if(!l||!f)return;st(b,c=>{if(c[f]===r){c[l]=c[l]||[];for(let C=0;C<d.length;C++)c[l][p](d[C]);return e.value=b,!0}})}else{for(let f=0;f<d.length;f++)b[p](d[f]);e.value=b;return}}function g(r,d){if(!r)return;const p=d||u(e),{key:b,children:f}=u(n);if(!(!f||!b))for(let l=0;l<p.length;l++){const c=p[l],C=c[f];if(c[b]===r){p.splice(l,1);break}else C&&C.length&&g(r,c[f])}}function i(r,d,p){if(!r&&r!==0)return null;const b=d||u(e),{key:f,children:l}=u(n);if(!(!l||!f))return b.forEach(c=>{if((p==null?void 0:p[f])||(p==null?void 0:p[f])===0)return p;if(c[f]===r){p=c;return}c[l]&&c[l].length&&(p=i(r,c[l],p))}),p||null}function B(r,d){let p=[];if(!r||!(r!=null&&r.length))return[];const b=d||u(e),{key:f,children:l}=u(n);return!l||!f?[]:(b.forEach(c=>{r.includes(c[f])&&p.push(c),c[l]&&c[l].length&&p.push(...B(r,c[l]))}),p)}function F(r,d=!1){const p=[],b=r||u(e),{key:f,children:l}=u(n);if(!l||!f)return p;for(let c=0;c<b.length;c++){const C=b[c],L=C[l];L&&L.length&&(d&&!C.disabled||!d)&&(p.push(C[f]),p.push(...F(L)))}return p}return{deleteNodeByKey:g,insertNodeByKey:o,insertNodesByKey:s,filterByLevel:a,updateNodeByKey:y,getAllKeys:t,getChildrenKeys:A,getEnabledKeys:h,getParentKeys:F,getSelectedNode:i,getEnabledNodes:B}}function iu(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!vt(e)}const Ke="context-menu",cu={width:{type:Number,default:120},customEvent:{type:Object,default:null},styles:{type:Object},showIcon:{type:Boolean,default:!0},axis:{type:Object,default(){return{x:0,y:0}}},items:{type:Array,default(){return[]}}},dt=e=>{const{item:n}=e;return D("span",{style:"display: inline-block; width: 100%; ",class:"px-4",onClick:e.handler.bind(null,n)},[e.showIcon&&n.icon&&D(ze,{class:"mr-2",icon:n.icon},null),D("span",null,[n.label])])};var du=z({name:"ContextMenu",props:cu,setup(e){const n=O(null),t=O(!1),h=R(()=>{const{axis:a,items:o,styles:s,width:g}=e,{x:i,y:B}=a||{x:0,y:0},F=(o||[]).length*40,r=g,d=document.body,p=d.clientWidth<i+r?i-r:i,b=d.clientHeight<B+F?B-F:B;return j(I({},s),{position:"absolute",width:`${g}px`,left:`${p+1}px`,top:`${b+1}px`,zIndex:9999})});Dt(()=>{Le(()=>t.value=!0)}),Ct(()=>{const a=u(n);a&&document.body.removeChild(a)});function A(a,o){const{handler:s,disabled:g}=a;g||(t.value=!1,o==null||o.stopPropagation(),o==null||o.preventDefault(),s==null||s())}function y(a){return a.filter(s=>!s.hidden).map(s=>{const{disabled:g,label:i,children:B,divider:F=!1}=s,r={item:s,handler:A,showIcon:e.showIcon};return!B||B.length===0?D(re,null,[D(Ae.Item,{disabled:g,class:`${Ke}__item`,key:i},{default:()=>[D(dt,r,null)]}),F?D(Sn,{key:`d-${i}`},null):null]):u(t)?D(Ae.SubMenu,{key:i,disabled:g,popupClassName:`${Ke}__popup`},{title:()=>D(dt,r,null),default:()=>y(B)}):null})}return()=>{let a;if(!u(t))return null;const{items:o}=e;return D("div",{class:Ke},[D(Ae,{inlineIndent:12,mode:"vertical",ref:n,style:u(h),class:"context-menu-main"},iu(a=y(o))?a:{default:()=>[a]})])}}});const se={domList:[],resolve:()=>{}},pu=function(e){const{event:n}=e||{};if(n&&(n==null||n.preventDefault()),!!fn)return new Promise(t=>{const h=document.body,A=document.createElement("div"),y={};e.styles&&(y.styles=e.styles),e.items&&(y.items=e.items),e.event&&(y.customEvent=n,y.axis={x:n.clientX,y:n.clientY});const a=D(du,y);hn(a,A);const o=function(){se.resolve("")};se.domList.push(A);const s=function(){se.domList.forEach(g=>{try{g&&h.removeChild(g)}catch(i){}}),h.removeEventListener("click",o),h.removeEventListener("scroll",o)};se.resolve=function(g){s(),t(g)},s(),h.appendChild(A),h.addEventListener("click",o),h.addEventListener("scroll",o)})},pt=function(){se&&(se.resolve(""),se.domList=[])};function fu(e=!0){return Be()&&e&&Ct(()=>{pt()}),[pu,pt]}function hu(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!vt(e)}var xt=z({name:"BasicTree",inheritAttrs:!1,props:au,emits:uu,setup(e,{attrs:n,slots:t,emit:h,expose:A}){const[y]=xe("tree"),a=ee({checkStrictly:e.checkStrictly,expandedKeys:e.expandedKeys||[],selectedKeys:e.selectedKeys||[],checkedKeys:e.checkedKeys||[],halfCheckedKeys:[],checkedNodes:[]}),o=ee({startSearch:!1,searchText:"",searchData:[]}),s=O([]),[g]=fu(),i=R(()=>{const{fieldNames:E}=e;return I({children:"children",title:"fullName",key:"id"},E)}),B=R(()=>{let E=j(I(I({blockNode:!0},n),e),{expandedKeys:a.expandedKeys,selectedKeys:a.selectedKeys,checkedKeys:a.checkedKeys,checkStrictly:a.checkStrictly,fieldNames:j(I({},u(i)),{title:u(i).title+"_title"}),"onUpdate:expandedKeys":k=>{a.expandedKeys=k,h("update:expandedKeys",k)},"onUpdate:selectedKeys":k=>{a.selectedKeys=k,h("update:selectedKeys",k)},onCheck:(k,w)=>{let x=ae(a.checkedKeys);if(gn(x)&&o.startSearch){const K=w.node.eventKey;x=In(x,C(K)),w.checked&&x.push(K),a.checkedKeys=x}else a.checkedKeys=k;a.halfCheckedKeys=w.halfCheckedKeys,a.checkedNodes=w.checkedNodes;const M=ae(a.checkedKeys);h("update:value",M),h("check",M,w)},onSelect:(k,w)=>{const{key:x}=w.node;e.checkable||(a.selectedKeys=[x]),h("select",[x],w)},onRightClick:te});return mn(E,"treeData","class")}),F=R(()=>o.startSearch?o.searchData:u(s)),r=R(()=>!F.value||F.value.length===0),{deleteNodeByKey:d,insertNodeByKey:p,insertNodesByKey:b,filterByLevel:f,updateNodeByKey:l,getAllKeys:c,getChildrenKeys:C,getEnabledKeys:L,getParentKeys:m,getSelectedNode:S,getEnabledNodes:U}=ru(s,i);function pe(E,k){return!k&&e.renderIcon&&Ee(e.renderIcon)?e.renderIcon(E):k}function te(w){return W(this,arguments,function*({event:E,node:k}){var ne;const{rightMenuList:x=[],beforeRightClick:M}=e;let K={event:E,items:[]};if(M&&Ee(M)){let V=yield M(k,E);Array.isArray(V)?K.items=V:Object.assign(K,V)}else K.items=x;!((ne=K.items)!=null&&ne.length)||(K.items=K.items.filter(V=>!V.hidden),g(K))})}function Q(E){a.expandedKeys=E}function Ce(){return a.expandedKeys}function ve(E){a.selectedKeys=E}function Me(){return a.selectedKeys}function v(E){a.checkedKeys=E}function H(){return a.checkedKeys}function oe(){return a.halfCheckedKeys}function ke(){return a.checkedNodes}function X(E){a.checkedKeys=E?L():[],a.checkedNodes=E?U(a.checkedKeys):[]}function fe(E){a.expandedKeys=E?c():[]}function Mt(E){a.checkStrictly=E}Z(()=>e.searchValue,E=>{E!==o.searchText&&(o.searchText=E)},{immediate:!0}),Z(()=>e.treeData,E=>{E&&Ie(o.searchText)});function Ie(E){if(E!==o.searchText&&(o.searchText=E),h("update:searchValue",E),!E){o.startSearch=!1;return}const{filterFn:k,checkable:w,expandOnSearch:x,checkOnSearch:M,selectedOnSearch:K}=u(e);o.startSearch=!0;const{title:ne,key:V}=u(i),ue=[];if(o.searchData=_n(u(s),J=>{var Se,Je;const he=k?k(E,J,u(i)):(Je=(Se=J[ne])==null?void 0:Se.includes(E))!=null?Je:!1;return he&&ue.push(J[V]),he},u(i)),x){const J=Pn(o.searchData).map(he=>he[V]);J&&J.length&&Q(J)}M&&w&&ue.length&&v(ue),K&&ue.length&&ve(ue)}function It(E,k){if(!(!e.clickRowToExpand||!n["load-data"]&&(!k||k.length===0)))if(!a.expandedKeys.includes(E))Q([...a.expandedKeys,E]);else{const w=[...a.expandedKeys],x=w.findIndex(M=>M===E);x!==-1&&w.splice(x,1),Q(w)}}ge(()=>{s.value=e.treeData,e.defaultExpandAll&&fe(!0)}),Dt(()=>{const E=parseInt(e.defaultExpandLevel);E>0?a.expandedKeys=f(E):e.defaultExpandAll&&fe(!0)}),ge(()=>{a.expandedKeys=e.expandedKeys}),ge(()=>{a.selectedKeys=e.selectedKeys}),ge(()=>{a.checkedKeys=e.checkedKeys}),Z(()=>e.value,()=>{a.checkedKeys=ae(e.value||[])},{immediate:!0}),Z(()=>a.checkedKeys,()=>{const E=ae(a.checkedKeys);h("update:value",E),h("change",E)}),ge(()=>{a.checkStrictly=e.checkStrictly});const Kt={setExpandedKeys:Q,getExpandedKeys:Ce,setSelectedKeys:ve,getSelectedKeys:Me,setCheckedKeys:v,getCheckedKeys:H,getHalfCheckedKeys:oe,getParentKeys:m,insertNodeByKey:p,insertNodesByKey:b,deleteNodeByKey:d,updateNodeByKey:l,getSelectedNode:S,getCheckedNodes:ke,checkAll:X,expandAll:fe,filterByLevel:E=>{a.expandedKeys=f(E)},setSearchValue:E=>{Ie(E)},getSearchValue:()=>o.searchText};function Nt(E){const{actionList:k}=e;if(!(!k||k.length===0))return k.map((w,x)=>{var K;let M=!0;return Ee(w.show)?M=(K=w.show)==null?void 0:K.call(w,E):ot(w.show)&&(M=w.show),M?D("span",{key:x,class:y("action")},[w.render(E)]):null})}const Rt=R(()=>{const E=$e(F.value);return Ln(E,u(i),(k,w)=>{const x=o.searchText,{highlight:M}=u(e),{title:K,key:ne,children:V}=u(i),ue=pe(k,k.icon),J=En(k,K),he=x?J.indexOf(x):-1;o.startSearch&&An(x),`${ot(M)?"#f50":M}`;const Se=J;return k[K+"_title"]=D("span",{title:J,class:`${y("title")}`,onClick:It.bind(null,k[ne],k[V])},[t!=null&&t.title?Bn(t,"title",k):D(re,null,[ue&&D(su,{icon:ue},null),D("span",{class:y("name")},[Se]),D("span",{class:y("actions")},[Nt(k)])])]),k}),E});return A(Kt),()=>{let E;const{title:k,helpMessage:w,toolbar:x,search:M,checkable:K}=e,ne=k||x||M||t.headerTitle,V={height:"100%"};return D("div",{class:[y(),"h-full",n.class]},[ne&&D(ou,{checkable:K,checkAll:X,expandAll:fe,title:k,search:M,toolbar:x,helpMessage:w,onStrictlyChange:Mt,onSearch:Ie,searchText:o.searchText},hu(E=yn(t))?E:{default:()=>[E]}),D(Fn,{wrapperClassName:u(e.treeWrapperClassName),spinning:u(e.loading),tip:"\u52A0\u8F7D\u4E2D..."},{default:()=>[Ne(D(ft,{style:V},{default:()=>[D(bn,le(u(B),{showIcon:!1,treeData:Rt.value}),null)]}),[[at,!u(r)]]),Ne(D(lt,{image:lt.PRESENTED_IMAGE_SIMPLE},null),[[at,u(r)]])]})])}}});const gu={key:0,class:"flex items-center flex-1 cursor-pointer justify-self-stretch"},mu=q("i",{class:"icon-ym icon-ym-mpMenu"},null,-1),yu=z({__name:"LeftTreeHeader",props:{helpMessage:{type:[String,Array],default:""},title:{type:String,default:""},showToolbar:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},search:{type:Boolean,default:!1},searchText:{type:String,default:""},checkAll:{type:Function,default:void 0},expandAll:{type:Function,default:void 0},dropDownActions:{type:Array,default:()=>[]},isAsync:{type:Boolean,default:!1}},emits:["strictly-change","reload","clearSearch"],setup(e,{emit:n}){const t=e,[h]=xe("basic-left-tree"),A=qe(),{t:y}=De(),a=R(()=>{const{checkable:s}=t,g=[{label:y("component.tree.reload"),value:T.RELOAD},{label:y("component.tree.expandAll"),value:T.EXPAND_ALL},{label:y("component.tree.unExpandAll"),value:T.UN_EXPAND_ALL,divider:s}];let i=s?[{label:y("component.tree.selectAll"),value:T.SELECT_ALL},{label:y("component.tree.unSelectAll"),value:T.UN_SELECT_ALL,divider:s},...g,{label:y("component.tree.checkStrictly"),value:T.CHECK_STRICTLY},{label:y("component.tree.checkUnStrictly"),value:T.CHECK_UN_STRICTLY}]:g;return t.isAsync&&(i=i.filter(B=>B.value!==T.EXPAND_ALL&&B.value!==T.RELOAD)),i});function o(s){var i,B,F,r,d;const{value:g}=s;switch(g){case T.RELOAD:n("reload");break;case T.SELECT_ALL:(i=t.checkAll)==null||i.call(t,!0);break;case T.UN_SELECT_ALL:(B=t.checkAll)==null||B.call(t,!1);break;case T.EXPAND_ALL:n("clearSearch"),(F=t.expandAll)==null||F.call(t,!0);break;case T.UN_EXPAND_ALL:n("clearSearch"),(r=t.expandAll)==null||r.call(t,!1);break;case T.CHECK_STRICTLY:n("strictly-change",!1);break;case T.CHECK_UN_STRICTLY:n("strictly-change",!0);break;default:(d=s.onClick)==null||d.call(s);break}}return(s,g)=>(_(),Y("div",{class:ie(u(h)("header"))},[D(u(Dn),{helpMessage:s.helpMessage,content:s.title,class:"px-10px"},Ue({action:P(()=>[s.showToolbar||s.dropDownActions.length?(_(),Y("div",gu,[D(u(Bt),{onClick:g[0]||(g[0]=At(()=>{},["prevent"]))},{overlay:P(()=>[D(u(Ae),null,{default:P(()=>[s.showToolbar?(_(!0),Y(re,{key:0},Pe(a.value,i=>(_(),Y(re,{key:i.value},[D(u(Re),le({key:i.value},{onClick:B=>o(i)}),{default:P(()=>[ce(de(i.label),1)]),_:2},1040,["onClick"]),i.divider?(_(),$(u(Et),{key:0})):N("",!0)],64))),128)):N("",!0),s.dropDownActions.length?(_(!0),Y(re,{key:1},Pe(s.dropDownActions,(i,B)=>(_(),$(u(Re),{key:B,onClick:F=>o(i)},{default:P(()=>[ce(de(i.label),1)]),_:2},1032,["onClick"]))),128)):N("",!0)]),_:1})]),default:P(()=>[mu]),_:1})])):N("",!0)]),_:2},[u(A).headerTitle?{name:"content",fn:P(()=>[Fe(s.$slots,"headerTitle")]),key:"0"}:void 0]),1032,["helpMessage","content"])],2))}});z({__name:"BasicLeftTree",props:{helpMessage:{type:[String,Array],default:""},title:{type:String,default:""},showToolbar:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},fieldNames:{type:Object,default:()=>({key:"id",title:"fullName"})},dropDownActions:{type:Array,default:()=>[]},treeData:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},defaultExpandAll:{type:Boolean,default:!0},loadData:{type:Function}},emits:["select","reload"],setup(e,{expose:n,emit:t}){const h=e,[A]=xe("basic-left-tree"),y=qe(),{t:a}=De(),o=O(""),s=O(!1),g=O(null),i=Ft(l,200);Z(()=>o.value,m=>{i(m)}),Z(()=>h.treeData,()=>{Le(()=>{h.defaultExpandAll&&p(!0)})}),n({setSelectedKeys:F,getSelectedNode:r,updateNodeByKey:d});function B(){const m=u(g);if(!m)throw new Error("tree is null!");return m}function F(m){B().setSelectedKeys(m)}function r(m){return B().getSelectedNode(m)}function d(m,S){return B().updateNodeByKey(m,S)}function p(m){B().expandAll(m)}function b(m){B().checkAll(m)}function f(m){s.value=m}function l(m){B().setSearchValue(m)}function c(){o.value="",t("reload")}function C(m,{node:S}){if(!m.length)return;const U=L(S);t("select",m[0],S,U)}function L(m){let S=[];const U=I({},m.dataRef);return S.push(U),m.parent&&(S=[...m.parent.nodes,...S]),S}return(m,S)=>(_(),Y("div",{class:ie([u(A)(),"h-full"])},[e.title||e.dropDownActions.length?(_(),$(yu,{key:0,title:e.title,helpMessage:e.helpMessage,showToolbar:e.showToolbar,dropDownActions:e.dropDownActions,expandAll:p,checkAll:b,onStrictlyChange:f,onReload:c,onClearSearch:S[0]||(S[0]=U=>o.value=""),isAsync:!!e.loadData},{default:P(()=>[u(y).headerTitle?Fe(m.$slots,"headerTitle",{key:0},void 0,!0):N("",!0)]),_:3},8,["title","helpMessage","showToolbar","dropDownActions","isAsync"])):N("",!0),e.showSearch?(_(),Y("div",{key:1,class:ie(u(A)("search"))},[D(u(bt),{placeholder:u(a)("common.leftTreeSearchText"),allowClear:"",value:o.value,"onUpdate:value":S[1]||(S[1]=U=>o.value=U)},null,8,["placeholder","value"])],2)):N("",!0),D(u(xt),{clickRowToExpand:!1,treeData:e.treeData,fieldNames:e.fieldNames,checkStrictly:s.value,"load-data":e.loadData,onSelect:C,class:"tree-main",ref_key:"treeRef",ref:g,defaultExpandAll:e.defaultExpandAll,loading:e.loading},Ue({_:2},[u(y).title?{name:"title",fn:P(U=>[Fe(m.$slots,"title",Ve(je(U)),void 0,!0)]),key:"0"}:void 0]),1032,["treeData","fieldNames","checkStrictly","load-data","defaultExpandAll","loading"])],2))}});const Fu={key:0,class:"urlAddress"},bu=z({__name:"MenuManagePopup",setup(e){const n=ee({treeData:[],id:"",menuIds:[],moduleAllIds:[]}),{treeData:t}=yt(n),{createMessage:h}=be(),A=O(null),[y,{changeLoading:a,closePopup:o,changeOkLoading:s}]=Lt(g);function g(r){n.id=r.id||"",n.treeData=[],n.menuIds=[],a(!0),qn(n.id).then(d=>{n.treeData=d.data.list||[],n.moduleAllIds=d.data.all||[];const p=i().getParentKeys(n.treeData,!0),b=[...new Set([...d.data.ids])];n.menuIds=b;const f=b.filter(l=>!p.includes(l));i().setCheckedKeys(f),a(!1)})}function i(){const r=u(A);if(!r)throw new Error("tree is null!");return r}function B(){const r=i().getCheckedKeys()||[],p=[...i().getHalfCheckedKeys()||[],...r];n.menuIds=p}function F(){return W(this,null,function*(){s(!0);const r={ids:n.menuIds,all:n.moduleAllIds};zn(n.id,r).then(d=>{h.success(d.msg),s(!1),o()}).catch(()=>{s(!1)})})}return(r,d)=>(_(),$(u(Tt),le(r.$attrs,{onRegister:u(y),title:"\u83DC\u5355\u7BA1\u7406",showOkBtn:"",onOk:F,destroyOnClose:""}),{default:P(()=>[D(u(xt),{treeData:u(t),ref_key:"treeRef",ref:A,checkable:"",blockNode:"",clickRowToExpand:"",defaultExpandAll:"",onCheck:B,class:"overflow-auto mx-50px"},{title:P(p=>[q("div",null,de(p.fullName),1),p.urlAddress?(_(),Y("div",Fu,"("+de(p.urlAddress)+")",1)):N("",!0)]),_:1},8,["treeData"])]),_:1},16,["onRegister"]))}}),Eu={class:"app-main"},Au={class:"jnpf-layout-content"},Bu={class:"jnpf-content-wrapper"},Du={class:"jnpf-content-wrapper-center"},Cu={class:"jnpf-content-wrapper-content"},Pu=z({__name:"index",setup(e){const{createMessage:n,createConfirm:t}=be(),{t:h}=De(),[A,{openPopup:y}]=rt(),[a,{openModal:o}]=Oe(),[s,{openModal:g}]=Oe(),[i,{openPopup:B}]=rt(),F=[{title:"\u79DF\u6237\u540D\u79F0",dataIndex:"fullName",width:180},{title:"\u79DF\u6237\u53F7",dataIndex:"enCode",width:180},{title:"\u57DF\u540D",dataIndex:"domainName",width:180},{title:"\u7C7B\u578B",dataIndex:"type",width:180,customRender:({record:m})=>m.type==1?"ID\u9694\u79BB":m.type==2?"\u8FDE\u63A5\u9694\u79BB":"\u5E93\u9694\u79BB"},{title:"\u8D77\u59CB\u65F6\u95F4",dataIndex:"startTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u8FC7\u671F\u65F6\u95F4",dataIndex:"endTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"creatorTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u6700\u540E\u4FEE\u6539\u65F6\u95F4",dataIndex:"lastModifyTime",width:150,format:"date|YYYY-MM-DD HH:mm:ss"},{title:"\u6392\u5E8F",dataIndex:"sortCode",width:70,align:"center"},{title:"\u72B6\u6001",dataIndex:"enabledMark",width:70,align:"center"}],[r,{reload:d}]=kt({api:$n,columns:F,useSearchForm:!0,formConfig:{schemas:[{field:"keyword",label:"\u5173\u952E\u8BCD",component:"Input",componentProps:{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u67E5\u8BE2",submitOnPressEnter:!0}},{field:"type",label:"\u7C7B\u578B",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u7C7B\u578B",options:[{fullName:"\u5E93\u9694\u79BB",id:0},{fullName:"ID\u9694\u79BB",id:1},{fullName:"\u8FDE\u63A5\u9694\u79BB",id:2}]}},{field:"enabledMark",label:"\u72B6\u6001",component:"Select",componentProps:{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",options:[{fullName:"\u542F\u7528",id:1},{fullName:"\u7981\u7528",id:0}]}},{field:"pickerVal",label:"\u8D77\u59CB\u65F6\u95F4",component:"DateRange",componentProps:{format:"YYYY-MM-DD HH:mm:ss",showTime:{defaultValue:[_e("00:00:00","HH:mm:ss"),_e("23:59:59","HH:mm:ss")]},placeholder:["\u5F00\u59CB\u65F6\u95F4","\u7ED3\u675F\u65F6\u95F4"]}},{field:"pickerVal1",label:"\u8FC7\u671F\u65F6\u95F4",component:"DateRange",componentProps:{format:"YYYY-MM-DD HH:mm:ss",showTime:{defaultValue:[_e("00:00:00","HH:mm:ss"),_e("23:59:59","HH:mm:ss")]},placeholder:["\u5F00\u59CB\u65F6\u95F4","\u7ED3\u675F\u65F6\u95F4"]}}],fieldMapToTime:[["pickerVal",["startTime","endTime"]],["pickerVal1",["expiresStartTime","expiresEndTime"]]]},actionColumn:{width:150,title:"\u64CD\u4F5C",dataIndex:"action"}});function p(m){return[{label:"\u7F16\u8F91",onClick:C.bind(null,m.id,m.webType)},{label:"\u5220\u9664",color:"error",onClick:L.bind(null,m.id)}]}function b(m){return[{label:"\u83DC\u5355\u7BA1\u7406",onClick:f.bind(null,m.id)},{label:"\u91CD\u7F6E\u5BC6\u7801",onClick:l.bind(null,m.id)},{label:"\u7BA1\u7406\u5458\u7EF4\u62A4",onClick:c.bind(null,m.id)}]}function f(m){B(!0,{id:m})}function l(m){g(!0,{id:m})}function c(m){o(!0,{id:m})}function C(m=""){y(!0,{id:m})}function L(m){t({iconType:"warning",title:h("common.tipTitle"),content:"\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u79DF\u6237\uFF0C \u662F\u5426\u7EE7\u7EED?",onOk:()=>{Yn(m,{isClear:1}).then(S=>{n.success(S.msg),d()})}})}return(m,S)=>{const U=ye("a-button"),pe=ye("a-tag");return _(),Y("div",Eu,[D(Tn),q("div",Au,[q("div",Bu,[q("div",Du,[q("div",Cu,[D(u(St),{onRegister:u(r)},{tableTitle:P(()=>[D(U,{type:"primary",onClick:S[0]||(S[0]=te=>C())},{default:P(()=>[D(u(Pt)),ce("\u65B0\u5EFA ")]),_:1})]),bodyCell:P(({column:te,record:Q})=>[te.key==="enabledMark"?(_(),$(pe,{key:0,color:Q.enabledMark==1?"success":"error"},{default:P(()=>[ce(de(Q.enabledMark==1?"\u542F\u7528":"\u7981\u7528"),1)]),_:2},1032,["color"])):N("",!0),te.key==="action"?(_(),$(u(_t),{key:1,actions:p(Q),dropDownActions:b(Q)},null,8,["actions","dropDownActions"])):N("",!0)]),_:1},8,["onRegister"])])]),D(Wn,{onRegister:u(A),onReload:u(d)},null,8,["onRegister","onReload"]),D(bu,{onRegister:u(i)},null,8,["onRegister"])]),D(Gn,{onRegister:u(a)},null,8,["onRegister"]),D(Zn,{onRegister:u(s)},null,8,["onRegister"])])])}}});export{Pu as default};