mirror of
http://git.xinwangdao.com/cnnc-embedded-parts-detect/detect.git
synced 2025-06-24 13:34:13 +08:00
2 lines
19 KiB
JavaScript
2 lines
19 KiB
JavaScript
var Je=Object.defineProperty,Ge=Object.defineProperties;var Ze=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,Ze(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 Z=(e,t,s)=>new Promise((h,m)=>{var v=g=>{try{i(s.next(g))}catch(S){m(S)}},l=g=>{try{i(s.throw(g))}catch(S){m(S)}},i=g=>g.done?h(g.value):Promise.resolve(g.value).then(v,l);i((s=s.apply(e,t)).next())});import{u as Qe,B as et}from"./useForm-baba730a.js";import{a as tt,B as nt}from"./index-679d8a0a.js";import{an as lt,d as se,f as j,ae as at,c as P,w as Y,Z as N,_ as R,u as r,ab as st,a8 as H,a4 as te,a5 as U,G as Se,a0 as _e,a1 as be,k as x,F as le,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 Q,h as X,m as Ke,A as Le}from"./vue-72a104e4.js";import{aV as ht,v as ft,V as yt,aC as pt,I as ae,aW as we,aX as gt,aw as mt,f as ie,aY as kt,ax as vt,aZ as xt,aT as St,a4 as _t,aS as bt,U as Ae,e as Ct,a_ as Ee,a$ as Kt,b0 as Lt,_ as wt}from"./index.js";import{aS as At,aT as Et,aU as Tt,aV as It,aW as Dt,q as ne,D as Bt,aX as Ft,e as ue,at as Nt,aY as Pt,o as Mt,y as Ot,aC as $t,aA as Te,J as jt,j as Ut}from"./antd-0679333d.js";import{b as Vt}from"./authorityApi-b12c1221.js";const Ht={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:Ht}],Yt=[{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 Rt(e){return(t,s)=>(t&&typeof t!="string"&&(s=t,t=""),t=t?`${e}__${t}`:e,`${t}${de(t,s)}`)}function Oe(e){return[Rt(`${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:l}=e,i=s||l?g=>{let S=!1,_=[];if(s&&(_=[...s,m],S||(S=_.includes(g))),l&&(S||(S=l(g))),!S&&_.length>0){const f=[...new Set(_)].map(d=>JSON.stringify(d)).join(", ");lt(`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 Wt=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 qt=["update:expandedKeys","update:selectedKeys","update:value","change","check","update:searchValue"],zt=Wt({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,l=at(),{t:i}=ft(),g=P(()=>["mr-1","w-full",{"ml-5":l.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,a,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:(a=m.expandAll)==null||a.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 Y(()=>s.value,n=>{d(n)}),Y(()=>m.searchText,n=>{n!==s.value&&(s.value=n)}),(n,o)=>(N(),R("div",{class:be([r(h)(),"flex px-2 py-1.5 items-center"])},[r(l).headerTitle?st(n.$slots,"headerTitle",{key:0}):H("",!0),!r(l).headerTitle&&n.title?(N(),te(r(pt),{key:1,helpMessage:n.helpMessage},{default:U(()=>[Se(_e(n.title),1)]),_:1},8,["helpMessage"])):H("",!0),n.search||n.toolbar?(N(),R("div",Jt,[n.search?(N(),R("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)):H("",!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),R(le,null,rt(S.value,u=>(N(),R(le,{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})):H("",!0)],64))),128))]),_:1})]),default:U(()=>[x(ae,{icon:"ion:ellipsis-vertical"})]),_:1})):H("",!0)])):H("",!0)],2))}}),Zt=({icon:e})=>e?Ft(e)?it(ae,{icon:e,class:"mr-1"}):ae:null;function Qt(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 a=n[y];d.push(a[o]);const p=a[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 a=n[y];a.disabled!==!0&&a.selectable!==!1&&d.push(a[o]);const p=a[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 a=0;a<o.length;a++){const p=o[a],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 a=0;a<o.length;a++){const p=o[a],b=p[y];if(p[u]===f){o[a]=B(B({},o[a]),d);break}else b&&b.length&&v(f,d,p[y])}}function l(f=1,d,n=1){if(!f)return[];const o=[],u=d||r(e)||[];for(let y=0;y<u.length;y++){const a=u[y],{key:p,children:b}=r(t),A=p?a[p]:"",E=b?a[b]:[];o.push(A),E&&E.length&&n<f&&(n+=1,o.push(...l(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,a=>{if(a[u]===f)return a[y]=a[y]||[],a[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,a=>{if(a[u]===f){a[y]=a[y]||[];for(let p=0;p<d.length;p++)a[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 a=n[y],p=a[u];if(a[o]===f){n.splice(y,1);break}else p&&p.length&&S(f,a[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(a=>{if(n!=null&&n.key||(n==null?void 0:n.key)===0)return n;if(a[u]===f){n=a;return}a[y]&&a[y].length&&(n=_(f,a[y],n))}),n||null}return{deleteNodeByKey:S,insertNodeByKey:i,insertNodesByKey:g,filterByLevel:l,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(ae,{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:l,items:i,styles:g,width:S}=e,{x:_,y:f}=l||{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 l=r(t);l&&document.body.removeChild(l)});function m(l,i){const{handler:g,disabled:S}=l;S||(s.value=!1,i==null||i.stopPropagation(),i==null||i.preventDefault(),g==null||g())}function v(l){return l.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(le,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 l;if(!r(s))return null;const{items:i}=e;return x(ne,{inlineIndent:12,mode:"vertical",class:oe,ref:t,style:r(h)},en(l=v(i))?l:{default:()=>[l]})}}});const V={domList:[],resolve:()=>{}},ln=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 l=x(nn,v);ut(l,m);const i=function(){V.resolve("")};V.domList.push(m);const g=function(){V.domList.forEach(S=>{try{S&&h.removeChild(S)}catch(_){}}),h.removeEventListener("click",i),h.removeEventListener("scroll",i)};V.resolve=function(S){g(),s(S)},g(),h.appendChild(m),h.addEventListener("click",i),h.addEventListener("scroll",i)})},Fe=function(){V&&(V.resolve(""),V.domList=[])};function an(e=!0){return dt()&&e&&Pe(()=>{Fe()}),[ln,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:qt,setup(e,{attrs:t,slots:s,emit:h,expose:m}){const[v]=Oe("tree"),l=Ce({checkStrictly:e.checkStrictly,expandedKeys:e.expandedKeys||[],selectedKeys:e.selectedKeys||[],checkedKeys:e.checkedKeys||[]}),i=Ce({startSearch:!1,searchText:"",searchData:[]}),g=j([]),[S]=an(),_=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:l.expandedKeys,selectedKeys:l.selectedKeys,checkedKeys:l.checkedKeys,checkStrictly:l.checkStrictly,fieldNames:r(_),"onUpdate:expandedKeys":k=>{l.expandedKeys=k,h("update:expandedKeys",k)},"onUpdate:selectedKeys":k=>{l.selectedKeys=k,h("update:selectedKeys",k)},onCheck:(k,L)=>{let C=Q(l.checkedKeys);if(mt(C)&&i.startSearch){const w=L.node.eventKey;C=Pt(C,A(w)),L.checked&&C.push(w),l.checkedKeys=C}else l.checkedKeys=k;const K=Q(l.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:a,updateNodeByKey:p,getAllKeys:b,getChildrenKeys:A,getEnabledKeys:E,getSelectedNode:F}=Qt(g,_);function $e(c,k){return!k&&e.renderIcon&&ie(e.renderIcon)?e.renderIcon(c):k}function je(L){return Z(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 W(c){l.expandedKeys=c}function Ue(){return l.expandedKeys}function fe(c){l.selectedKeys=c}function Ve(){return l.selectedKeys}function ye(c){l.checkedKeys=c}function He(){return l.checkedKeys}function pe(c){l.checkedKeys=c?E():[]}function re(c){l.expandedKeys=c?b():[]}function Ye(c){l.checkStrictly=c}Y(()=>e.searchValue,c=>{c!==i.searchText&&(i.searchText=c)},{immediate:!0}),Y(()=>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 q,z;const $=k?k(c,D,r(_)):(z=(q=D[M])==null?void 0:q.includes(c))!=null?z:!1;return $&&O.push(D[I]),$},r(_)),C){const D=vt(i.searchData).map($=>$[I]);D&&D.length&&W(D)}K&&L&&O.length&&ye(O),w&&O.length&&fe(O)}function Re(c,k){if(!(!e.clickRowToExpand||!k||k.length===0))if(!l.expandedKeys.includes(c))W([...l.expandedKeys,c]);else{const L=[...l.expandedKeys],C=L.findIndex(K=>K===c);C!==-1&&L.splice(C,1),W(L)}}X(()=>{g.value=e.treeData}),Ne(()=>{const c=parseInt(e.defaultExpandLevel);c>0?l.expandedKeys=a(c):e.defaultExpandAll&&re(!0)}),X(()=>{l.expandedKeys=e.expandedKeys}),X(()=>{l.selectedKeys=e.selectedKeys}),X(()=>{l.checkedKeys=e.checkedKeys}),Y(()=>e.value,()=>{l.checkedKeys=Q(e.value||[])},{immediate:!0}),Y(()=>l.checkedKeys,()=>{const c=Q(l.checkedKeys);h("update:value",c),h("change",c)}),X(()=>{l.checkStrictly=e.checkStrictly});const Xe={setExpandedKeys:W,getExpandedKeys:Ue,setSelectedKeys:fe,getSelectedKeys:Ve,setCheckedKeys:ye,getCheckedKeys:He,insertNodeByKey:u,insertNodesByKey:y,deleteNodeByKey:o,updateNodeByKey:p,getSelectedNode:F,checkAll:pe,expandAll:re,filterByLevel:c=>{l.expandedKeys=a(c)},setSearchValue:c=>{ce(c)},getSearchValue:()=>i.searchText};function We(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 qe=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,q=i.startSearch&&!bt(C)&&K&&$!==-1,z=`color: ${Ae(K)?"#f50":K}`,ze=q?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:Re.bind(null,k[M],k[I])},[s!=null&&s.title?Ct(s,"title",k):x(le,null,[O&&x(Zt,{icon:O},null),ze,x("span",{class:v("actions")},[We(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:Ye,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:qe.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([]),l=j([]),[i,{resetFields:g,setFieldsValue:S,validate:_}]=Qe({labelWidth:60,baseColProps:{span:24},schemas:Yt,showActionButtonGroup:!1}),[f,{setDrawerProps:d,closeDrawer:n}]=tt(a=>Z(this,null,function*(){if(yield g(),d({confirmLoading:!1}),r(v).length===0){let p=yield Vt({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=!!(a!=null&&a.isUpdate),h.value&&(m.value=a.record),a.record)if(a.record.authorityList.length){const p=[],b=[],A=Ee(a.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),a.record.menu=b,l.value=p}else a.record.menu=[],l.value=[];r(h)&&(yield S(B({},a.record)))})),o=(a,{halfCheckedKeys:p})=>{l.value=p},u=P(()=>r(h)?"编辑用户":"新增用户");function y(){return Z(this,null,function*(){try{const p=yield _();d({confirmLoading:!0});const a=p,{menu:b=[]}=a,A=xe(a,["menu"]),E=G(B({},A),{authorityList:[...b,...l.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")}catch(p){}finally{d({confirmLoading:!1})}})}return(a,p)=>(N(),te(r(nt),he(a.$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-c26f9374"]]),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};
|