detect/detect.gui/Embedded/dist/assets/drawer-b8e52292.js

2 lines
19 KiB
JavaScript

var Je=Object.defineProperty,Ge=Object.defineProperties;var Qe=Object.getOwnPropertyDescriptors;var J=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable;var me=(e,t,s)=>t in e?Je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,B=(e,t)=>{for(var s in t||(t={}))ke.call(t,s)&&me(e,s,t[s]);if(J)for(var s of J(t))ve.call(t,s)&&me(e,s,t[s]);return e},G=(e,t)=>Ge(e,Qe(t));var xe=(e,t)=>{var s={};for(var h in e)ke.call(e,h)&&t.indexOf(h)<0&&(s[h]=e[h]);if(e!=null&&J)for(var h of J(e))t.indexOf(h)<0&&ve.call(e,h)&&(s[h]=e[h]);return s};var Q=(e,t,s)=>new Promise((h,m)=>{var v=g=>{try{i(s.next(g))}catch(S){m(S)}},a=g=>{try{i(s.throw(g))}catch(S){m(S)}},i=g=>g.done?h(g.value):Promise.resolve(g.value).then(v,a);i((s=s.apply(e,t)).next())});import{u as Ze,B as et}from"./useForm-4d0be6be.js";import{a as tt,B as nt}from"./index-bb9dfbf9.js";import{an as at,d as se,f as j,ae as lt,c as P,w as V,Z as N,_ as Y,u as r,ab as st,a8 as R,a4 as te,a5 as U,G as Se,a0 as _e,a1 as be,k as x,F as ae,a7 as rt,a9 as he,B as ct,l as it,o as Ne,y as ot,b as Pe,i as Me,x as ut,g as dt,r as Ce,J as Z,h as X,m as Ke,A as Le}from"./vue-72a104e4.js";import{aS as ht,t as ft,U as yt,az as pt,I as le,aT as we,aU as gt,at as mt,f as ie,aV as kt,au as vt,aW as xt,aQ as St,a3 as _t,aP as bt,O as Ae,e as Ct,aX as Ee,aY as Kt,aZ as Lt,_ as wt}from"./index.js";import{aN as At,aO as Et,aP as Tt,aQ as It,aR as Dt,q as ne,D as Bt,aS as Ft,e as ue,ao as Nt,aT as Pt,o as Mt,y as Ot,ax as $t,av as Te,J as jt,j as Ut}from"./antd-75591bdf.js";import{b as Ht}from"./authorityApi-323b0ce5.js";const Rt={xs:{span:24},sm:{span:24},lg:{span:8}},ee={span:24},mn=[{title:"姓名",dataIndex:"realName",width:200},{title:"用户名",dataIndex:"username",width:180},{title:"创建时间",dataIndex:"createTime",width:180},{title:"更新时间",dataIndex:"updateTime",width:180}],kn=[{field:"realName",label:"姓名",component:"Input",componentProps:{allowClear:!0,placeholder:"姓名"},colProps:Rt}],Vt=[{label:"姓名",field:"realName",componentProps:{allowClear:!1,placeholder:"姓名"},colProps:ee,component:"Input",rules:[{required:!0,message:"请输入姓名!"}]},{label:"用户名",field:"username",componentProps:{allowClear:!1,placeholder:"用户名"},colProps:ee,component:"Input",rules:[{required:!0,message:"请输入用户名!"}]},{label:"密码",field:"password",componentProps:{allowClear:!1,placeholder:"密码"},colProps:ee,component:"InputPassword",rules:[{required:!0,message:"请输入密码!"}]},{label:" ",field:"menu",slot:"menu",component:"Input",colProps:ee}];function de(e,t){return t?typeof t=="string"?` ${e}--${t}`:Array.isArray(t)?t.reduce((s,h)=>s+de(e,h),""):Object.keys(t).reduce((s,h)=>s+(t[h]?de(e,h):""),""):""}function Yt(e){return(t,s)=>(t&&typeof t!="string"&&(s=t,t=""),t=t?`${e}__${t}`:e,`${t}${de(t,s)}`)}function Oe(e){return[Yt(`${ht}-${e}`)]}const Ie=Symbol(),De=Symbol();function Xt(e,t){if(!Et(e)||e[De])return e;const{values:s,required:h,default:m,type:v,validator:a}=e,i=s||a?g=>{let S=!1,_=[];if(s&&(_=[...s,m],S||(S=_.includes(g))),a&&(S||(S=a(g))),!S&&_.length>0){const f=[...new Set(_)].map(d=>JSON.stringify(d)).join(", ");at(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${f}], got value ${JSON.stringify(g)}.`)}return S}:void 0;return{type:typeof v=="object"&&Object.getOwnPropertySymbols(v).includes(Ie)&&v?v[Ie]:v,required:!!h,default:m,validator:i,[De]:!0}}const qt=e=>At(Object.entries(e).map(([t,s])=>[t,Xt(s,t)]));var T=(e=>(e[e.SELECT_ALL=0]="SELECT_ALL",e[e.UN_SELECT_ALL=1]="UN_SELECT_ALL",e[e.EXPAND_ALL=2]="EXPAND_ALL",e[e.UN_EXPAND_ALL=3]="UN_EXPAND_ALL",e[e.CHECK_STRICTLY=4]="CHECK_STRICTLY",e[e.CHECK_UN_STRICTLY=5]="CHECK_UN_STRICTLY",e))(T||{});const Wt=["update:expandedKeys","update:selectedKeys","update:value","change","check","update:searchValue"],zt=qt({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},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:!1},expandOnSearch:Boolean,checkOnSearch:Boolean,selectedOnSearch:Boolean,loading:{type:Boolean,default:!1},treeWrapperClassName:String}),Jt={key:2,class:"flex items-center flex-1 cursor-pointer justify-self-stretch"},Gt=se({__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:t}){const s=j(""),[h]=Oe("tree-header"),m=e,v=t,a=lt(),{t:i}=ft(),g=P(()=>["mr-1","w-full",{"ml-5":a.headerTitle||m.title}]),S=P(()=>{const{checkable:n}=m,o=[{label:i("component.tree.expandAll"),value:T.EXPAND_ALL},{label:i("component.tree.unExpandAll"),value:T.UN_EXPAND_ALL,divider:n}];return n?[{label:i("component.tree.selectAll"),value:T.SELECT_ALL},{label:i("component.tree.unSelectAll"),value:T.UN_SELECT_ALL,divider:n},...o,{label:i("component.tree.checkStrictly"),value:T.CHECK_STRICTLY},{label:i("component.tree.checkUnStrictly"),value:T.CHECK_UN_STRICTLY}]:o});function _(n){var u,y,l,p;const{key:o}=n;switch(o){case T.SELECT_ALL:(u=m.checkAll)==null||u.call(m,!0);break;case T.UN_SELECT_ALL:(y=m.checkAll)==null||y.call(m,!1);break;case T.EXPAND_ALL:(l=m.expandAll)==null||l.call(m,!0);break;case T.UN_EXPAND_ALL:(p=m.expandAll)==null||p.call(m,!1);break;case T.CHECK_STRICTLY:v("strictly-change",!1);break;case T.CHECK_UN_STRICTLY:v("strictly-change",!0);break}}function f(n){v("search",n)}const d=yt(f,200);return V(()=>s.value,n=>{d(n)}),V(()=>m.searchText,n=>{n!==s.value&&(s.value=n)}),(n,o)=>(N(),Y("div",{class:be([r(h)(),"flex px-2 py-1.5 items-center"])},[r(a).headerTitle?st(n.$slots,"headerTitle",{key:0}):R("",!0),!r(a).headerTitle&&n.title?(N(),te(r(pt),{key:1,helpMessage:n.helpMessage},{default:U(()=>[Se(_e(n.title),1)]),_:1},8,["helpMessage"])):R("",!0),n.search||n.toolbar?(N(),Y("div",Jt,[n.search?(N(),Y("div",{key:0,class:be(g.value)},[x(r(Tt),{placeholder:r(i)("common.searchText"),size:"small",allowClear:"",value:s.value,"onUpdate:value":o[0]||(o[0]=u=>s.value=u)},null,8,["placeholder","value"])],2)):R("",!0),n.toolbar?(N(),te(r(Bt),{key:1,onClick:o[1]||(o[1]=ct(()=>{},["prevent"]))},{overlay:U(()=>[x(r(ne),{onClick:_},{default:U(()=>[(N(!0),Y(ae,null,rt(S.value,u=>(N(),Y(ae,{key:u.value},[x(r(It),he({ref_for:!0},{key:u.value}),{default:U(()=>[Se(_e(u.label),1)]),_:2},1040),u.divider?(N(),te(r(Dt),{key:0})):R("",!0)],64))),128))]),_:1})]),default:U(()=>[x(le,{icon:"ion:ellipsis-vertical"})]),_:1})):R("",!0)])):R("",!0)],2))}}),Qt=({icon:e})=>e?Ft(e)?it(le,{icon:e,class:"mr-1"}):le:null;function Zt(e,t){function s(f){const d=[],n=f||r(e),{key:o,children:u}=r(t);if(!u||!o)return d;for(let y=0;y<n.length;y++){const l=n[y];d.push(l[o]);const p=l[u];p&&p.length&&d.push(...s(p))}return d}function h(f){const d=[],n=f||r(e),{key:o,children:u}=r(t);if(!u||!o)return d;for(let y=0;y<n.length;y++){const l=n[y];l.disabled!==!0&&l.selectable!==!1&&d.push(l[o]);const p=l[u];p&&p.length&&d.push(...h(p))}return d}function m(f,d){const n=[],o=d||r(e),{key:u,children:y}=r(t);if(!y||!u)return n;for(let l=0;l<o.length;l++){const p=o[l],b=p[y];f===p[u]?(n.push(p[u]),b&&b.length&&n.push(...s(b))):b&&b.length&&n.push(...m(f,b))}return n}function v(f,d,n){if(!f)return;const o=n||r(e),{key:u,children:y}=r(t);if(!(!y||!u))for(let l=0;l<o.length;l++){const p=o[l],b=p[y];if(p[u]===f){o[l]=B(B({},o[l]),d);break}else b&&b.length&&v(f,d,p[y])}}function a(f=1,d,n=1){if(!f)return[];const o=[],u=d||r(e)||[];for(let y=0;y<u.length;y++){const l=u[y],{key:p,children:b}=r(t),A=p?l[p]:"",E=b?l[b]:[];o.push(A),E&&E.length&&n<f&&(n+=1,o.push(...a(f,E,n)))}return o}function i({parentKey:f=null,node:d,push:n="push"}){const o=ue(r(e));if(!f){o[n](d),e.value=o;return}const{key:u,children:y}=r(t);!y||!u||(we(o,l=>{if(l[u]===f)return l[y]=l[y]||[],l[y][n](d),!0}),e.value=o)}function g({parentKey:f=null,list:d,push:n="push"}){const o=ue(r(e));if(!(!d||d.length<1))if(f){const{key:u,children:y}=r(t);if(!y||!u)return;we(o,l=>{if(l[u]===f){l[y]=l[y]||[];for(let p=0;p<d.length;p++)l[y][n](d[p]);return e.value=o,!0}})}else{for(let u=0;u<d.length;u++)o[n](d[u]);e.value=o;return}}function S(f,d){if(!f)return;const n=d||r(e),{key:o,children:u}=r(t);if(!(!u||!o))for(let y=0;y<n.length;y++){const l=n[y],p=l[u];if(l[o]===f){n.splice(y,1);break}else p&&p.length&&S(f,l[u])}}function _(f,d,n){if(!f&&f!==0)return null;const o=d||r(e),{key:u,children:y}=r(t);if(u)return o.forEach(l=>{if(n!=null&&n.key||(n==null?void 0:n.key)===0)return n;if(l[u]===f){n=l;return}l[y]&&l[y].length&&(n=_(f,l[y],n))}),n||null}return{deleteNodeByKey:S,insertNodeByKey:i,insertNodesByKey:g,filterByLevel:a,updateNodeByKey:v,getAllKeys:s,getChildrenKeys:m,getEnabledKeys:h,getSelectedNode:_}}function en(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Me(e)}const oe="context-menu",tn={width:{type:Number,default:156},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[]}}},Be=e=>{const{item:t}=e;return x("span",{style:"display: inline-block; width: 100%; ",class:"px-4",onClick:e.handler.bind(null,t)},[e.showIcon&&t.icon&&x(le,{class:"mr-2",icon:t.icon},null),x("span",null,[t.label])])},nn=se({name:"ContextMenu",props:tn,setup(e){const t=j(null),s=j(!1),h=P(()=>{const{axis:a,items:i,styles:g,width:S}=e,{x:_,y:f}=a||{x:0,y:0},d=(i||[]).length*40,n=S,o=document.body,u=o.clientWidth<_+n?_-n:_,y=o.clientHeight<f+d?f-d:f;return B({position:"absolute",width:`${S}px`,left:`${u+1}px`,top:`${y+1}px`,zIndex:9999},g)});Ne(()=>{ot(()=>s.value=!0)}),Pe(()=>{const a=r(t);a&&document.body.removeChild(a)});function m(a,i){const{handler:g,disabled:S}=a;S||(s.value=!1,i==null||i.stopPropagation(),i==null||i.preventDefault(),g==null||g())}function v(a){return a.filter(g=>!g.hidden).map(g=>{const{disabled:S,label:_,children:f,divider:d=!1}=g,n={item:g,handler:m,showIcon:e.showIcon};return!f||f.length===0?x(ae,null,[x(ne.Item,{disabled:S,class:`${oe}__item`,key:_},{default:()=>[x(Be,n,null)]}),d?x(Nt,{key:`d-${_}`},null):null]):r(s)?x(ne.SubMenu,{key:_,disabled:S,popupClassName:`${oe}__popup`},{title:()=>x(Be,n,null),default:()=>v(f)}):null})}return()=>{let a;if(!r(s))return null;const{items:i}=e;return x(ne,{inlineIndent:12,mode:"vertical",class:oe,ref:t,style:r(h)},en(a=v(i))?a:{default:()=>[a]})}}});const H={domList:[],resolve:()=>{}},an=function(e){const{event:t}=e||{};if(t&&(t==null||t.preventDefault()),!!gt)return new Promise(s=>{const h=document.body,m=document.createElement("div"),v={};e.styles&&(v.styles=e.styles),e.items&&(v.items=e.items),e.event&&(v.customEvent=t,v.axis={x:t.clientX,y:t.clientY});const a=x(nn,v);ut(a,m);const i=function(){H.resolve("")};H.domList.push(m);const g=function(){H.domList.forEach(S=>{try{S&&h.removeChild(S)}catch(_){}}),h.removeEventListener("click",i),h.removeEventListener("scroll",i)};H.resolve=function(S){g(),s(S)},g(),h.appendChild(m),h.addEventListener("click",i),h.addEventListener("scroll",i)})},Fe=function(){H&&(H.resolve(""),H.domList=[])};function ln(e=!0){return dt()&&e&&Pe(()=>{Fe()}),[an,Fe]}function sn(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!Me(e)}const rn=se({name:"BasicTree",inheritAttrs:!1,props:zt,emits:Wt,setup(e,{attrs:t,slots:s,emit:h,expose:m}){const[v]=Oe("tree"),a=Ce({checkStrictly:e.checkStrictly,expandedKeys:e.expandedKeys||[],selectedKeys:e.selectedKeys||[],checkedKeys:e.checkedKeys||[]}),i=Ce({startSearch:!1,searchText:"",searchData:[]}),g=j([]),[S]=ln(),_=P(()=>{const{fieldNames:c}=e;return B({children:"children",title:"title",key:"key"},c)}),f=P(()=>{let c=G(B(B({blockNode:!0},t),e),{expandedKeys:a.expandedKeys,selectedKeys:a.selectedKeys,checkedKeys:a.checkedKeys,checkStrictly:a.checkStrictly,fieldNames:r(_),"onUpdate:expandedKeys":k=>{a.expandedKeys=k,h("update:expandedKeys",k)},"onUpdate:selectedKeys":k=>{a.selectedKeys=k,h("update:selectedKeys",k)},onCheck:(k,L)=>{let C=Z(a.checkedKeys);if(mt(C)&&i.startSearch){const w=L.node.eventKey;C=Pt(C,A(w)),L.checked&&C.push(w),a.checkedKeys=C}else a.checkedKeys=k;const K=Z(a.checkedKeys);h("update:value",K),h("check",K,L)},onRightClick:je});return Mt(c,"treeData","class")}),d=P(()=>i.startSearch?i.searchData:r(g)),n=P(()=>!d.value||d.value.length===0),{deleteNodeByKey:o,insertNodeByKey:u,insertNodesByKey:y,filterByLevel:l,updateNodeByKey:p,getAllKeys:b,getChildrenKeys:A,getEnabledKeys:E,getSelectedNode:F}=Zt(g,_);function $e(c,k){return!k&&e.renderIcon&&ie(e.renderIcon)?e.renderIcon(c):k}function je(L){return Q(this,arguments,function*({event:c,node:k}){var M;const{rightMenuList:C=[],beforeRightClick:K}=e;let w={event:c,items:[]};if(K&&ie(K)){let I=yield K(k,c);Array.isArray(I)?w.items=I:Object.assign(w,I)}else w.items=C;(M=w.items)!=null&&M.length&&(w.items=w.items.filter(I=>!I.hidden),S(w))})}function q(c){a.expandedKeys=c}function Ue(){return a.expandedKeys}function fe(c){a.selectedKeys=c}function He(){return a.selectedKeys}function ye(c){a.checkedKeys=c}function Re(){return a.checkedKeys}function pe(c){a.checkedKeys=c?E():[]}function re(c){a.expandedKeys=c?b():[]}function Ve(c){a.checkStrictly=c}V(()=>e.searchValue,c=>{c!==i.searchText&&(i.searchText=c)},{immediate:!0}),V(()=>e.treeData,c=>{c&&ce(i.searchText)});function ce(c){if(c!==i.searchText&&(i.searchText=c),h("update:searchValue",c),!c){i.startSearch=!1;return}const{filterFn:k,checkable:L,expandOnSearch:C,checkOnSearch:K,selectedOnSearch:w}=r(e);i.startSearch=!0;const{title:M,key:I}=r(_),O=[];if(i.searchData=kt(r(g),D=>{var W,z;const $=k?k(c,D,r(_)):(z=(W=D[M])==null?void 0:W.includes(c))!=null?z:!1;return $&&O.push(D[I]),$},r(_)),C){const D=vt(i.searchData).map($=>$[I]);D&&D.length&&q(D)}K&&L&&O.length&&ye(O),w&&O.length&&fe(O)}function Ye(c,k){if(!(!e.clickRowToExpand||!k||k.length===0))if(!a.expandedKeys.includes(c))q([...a.expandedKeys,c]);else{const L=[...a.expandedKeys],C=L.findIndex(K=>K===c);C!==-1&&L.splice(C,1),q(L)}}X(()=>{g.value=e.treeData}),Ne(()=>{const c=parseInt(e.defaultExpandLevel);c>0?a.expandedKeys=l(c):e.defaultExpandAll&&re(!0)}),X(()=>{a.expandedKeys=e.expandedKeys}),X(()=>{a.selectedKeys=e.selectedKeys}),X(()=>{a.checkedKeys=e.checkedKeys}),V(()=>e.value,()=>{a.checkedKeys=Z(e.value||[])},{immediate:!0}),V(()=>a.checkedKeys,()=>{const c=Z(a.checkedKeys);h("update:value",c),h("change",c)}),X(()=>{a.checkStrictly=e.checkStrictly});const Xe={setExpandedKeys:q,getExpandedKeys:Ue,setSelectedKeys:fe,getSelectedKeys:He,setCheckedKeys:ye,getCheckedKeys:Re,insertNodeByKey:u,insertNodesByKey:y,deleteNodeByKey:o,updateNodeByKey:p,getSelectedNode:F,checkAll:pe,expandAll:re,filterByLevel:c=>{a.expandedKeys=l(c)},setSearchValue:c=>{ce(c)},getSearchValue:()=>i.searchText};function qe(c){const{actionList:k}=e;if(!(!k||k.length===0))return k.map((L,C)=>{var w;let K=!0;return ie(L.show)?K=(w=L.show)==null?void 0:w.call(L,c):Ae(L.show)&&(K=L.show),K?x("span",{key:C,class:v("action")},[L.render(c)]):null})}const We=P(()=>{const c=ue(d.value);return xt(c,(k,L)=>{var ge;const C=i.searchText,{highlight:K}=r(e),{title:w,key:M,children:I}=r(_),O=$e(k,k.icon),D=jt(k,w),$=C?D.indexOf(C):-1,W=i.startSearch&&!bt(C)&&K&&$!==-1,z=`color: ${Ae(K)?"#f50":K}`,ze=W?x("span",{class:(ge=r(f))!=null&&ge.blockNode?`${v("content")}`:""},[x("span",null,[D.substr(0,$)]),x("span",{style:z},[C]),x("span",null,[D.substr($+C.length)])]):D;return k[w]=x("span",{class:`${v("title")} pl-2`,onClick:Ye.bind(null,k[M],k[I])},[s!=null&&s.title?Ct(s,"title",k):x(ae,null,[O&&x(Qt,{icon:O},null),ze,x("span",{class:v("actions")},[qe(k)])])]),k}),c});return m(Xe),()=>{let c;const{title:k,helpMessage:L,toolbar:C,search:K,checkable:w}=e,M=k||C||K||s.headerTitle,I={height:"calc(100% - 38px)"};return x("div",{class:[v(),"h-full",t.class]},[M&&x(Gt,{checkable:w,checkAll:pe,expandAll:re,title:k,search:K,toolbar:C,helpMessage:L,onStrictlyChange:Ve,onSearch:ce,searchText:i.searchText},sn(c=St(s))?c:{default:()=>[c]}),x(Ot,{wrapperClassName:r(e.treeWrapperClassName),spinning:r(e.loading),tip:"加载中..."},{default:()=>[Ke(x(_t,{style:I},{default:()=>[x($t,he(r(f),{showIcon:!1,treeData:We.value}),null)]}),[[Le,!r(n)]]),Ke(x(Te,{image:Te.PRESENTED_IMAGE_SIMPLE,class:"!mt-4"},null),[[Le,r(n)]])]})])}}});const cn=se({__name:"drawer",emits:["success","register"],setup(e,{emit:t}){const s=t,h=j(!0),m=j(),v=j([]),a=j([]),[i,{resetFields:g,setFieldsValue:S,validate:_}]=Ze({labelWidth:60,baseColProps:{span:24},schemas:Vt,showActionButtonGroup:!1}),[f,{setDrawerProps:d,closeDrawer:n}]=tt(l=>Q(this,null,function*(){if(yield g(),d({confirmLoading:!1}),r(v).length===0){let p=yield Ht({authorityId:0,orderByClause:"sort_order asc"});const b=A=>B({key:A.id,title:A.name},A);p=p.map(b),p=Ee(p,"parentId"),v.value=p}if(h.value=!!(l!=null&&l.isUpdate),h.value&&(m.value=l.record),l.record)if(l.record.authorityList.length){const p=[],b=[],A=Ee(l.record.authorityList,"parentId"),E=F=>{F.children&&F.children.length>0?(p.push(F.id),F.children.forEach(E)):b.push(F.id)};A.forEach(E),l.record.menu=b,a.value=p}else l.record.menu=[],a.value=[];r(h)&&(yield S(B({},l.record)))})),o=(l,{halfCheckedKeys:p})=>{a.value=p},u=P(()=>r(h)?"编辑用户":"新增用户");function y(){return Q(this,null,function*(){try{const p=yield _();d({confirmLoading:!0});const l=p,{menu:b=[]}=l,A=xe(l,["menu"]),E=G(B({},A),{authorityList:[...b,...a.value].map(F=>({id:F}))});r(h)?yield Kt(G(B(B({},r(m)),E),{updateTime:Ut().format("YYYY-MM-DD HH:mm:ss")})):yield Lt(E),n(),s("success")}finally{d({confirmLoading:!1})}})}return(l,p)=>(N(),te(r(nt),he(l.$attrs,{onRegister:r(f),destroyOnClose:"",showFooter:"",title:u.value,width:"500px",onOk:y}),{default:U(()=>[x(r(et),{onRegister:r(i),name:"EditForm"},{menu:U(({model:b,field:A})=>[x(r(rn),{value:b[A],"onUpdate:value":E=>b[A]=E,treeData:v.value,fieldNames:{title:"title",key:"key"},onCheck:o,checkable:"",toolbar:"",title:"权限分配"},null,8,["value","onUpdate:value","treeData"])]),_:1},8,["onRegister"])]),_:1},16,["onRegister","title"]))}});const on=wt(cn,[["__scopeId","data-v-30070aca"]]),vn=Object.freeze(Object.defineProperty({__proto__:null,default:on},Symbol.toStringTag,{value:"Module"}));export{on as R,mn as c,vn as d,kn as s};