var P=Object.defineProperty,Q=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var _=Object.getOwnPropertySymbols;var x=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var k=(t,s,e)=>s in t?P(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,O=(t,s)=>{for(var e in s||(s={}))x.call(s,e)&&k(t,e,s[e]);if(_)for(var e of _(s))T.call(s,e)&&k(t,e,s[e]);return t},S=(t,s)=>Q(t,V(s));var L=(t,s)=>{var e={};for(var o in t)x.call(t,o)&&s.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&_)for(var o of _(t))s.indexOf(o)<0&&T.call(t,o)&&(e[o]=t[o]);return e};var h=(t,s,e)=>new Promise((o,y)=>{var f=l=>{try{p(e.next(l))}catch(m){y(m)}},d=l=>{try{p(e.throw(l))}catch(m){y(m)}},p=l=>l.done?o(l.value):Promise.resolve(l.value).then(f,d);p((e=e.apply(t,s)).next())});import{a as $,B as F}from"./index-DYp2Qjp4.js";import{ap as K,u as X,_ as Z}from"./entry/index-CRWhxBeP.js";import{g as j}from"./common-DpkSdXuu.js";import{a as q,b as G,c as H}from"./attentionApi-BlenvL9Y.js";import{c as W}from"./cateApi-BE6kfD5q.js";import{d as Y,c as A,f as w,Z as ee,a4 as te,a5 as B,$ as c,k as z,u as v,a0 as D,ad as se,a9 as ae}from"./vue-DM5HGU8Z.js";import{ae as re,ah as oe}from"./antd-BfqWtMX3.js";import"./index-lE2idd8k.js";import"./imageEnum-BRgYKvjO.js";import"./sysOrgApi-tY_yXKfV.js";const ne={class:"flex"},ie={class:"custom-tit"},le={class:"custom-item"},ce={class:"custom-item_name"},ue="1200px",de=Y({__name:"CollectionDrawer",emits:["success","register"],setup(t,{emit:s}){const{createMessage:e}=X(),o=s,y=A(()=>"更多关注(关注的平台更新或下架资源时,将会推送通)"),f=w(0),d=w(["0-1-0","1856241578759774210"]),p=w([]),l=w([]),[m,{setDrawerProps:C,closeDrawer:N}]=$(n=>h(this,null,function*(){C({confirmLoading:!1}),d.value=[],yield U()}));function U(){return h(this,null,function*(){const n=yield q({}),a=K.mapTree(n,i=>({id:i.id,key:i.id,title:i.name,parentId:i.parentId,children:i.children}));p.value=a;const r=[];function u(i=[],M){i.forEach(g=>{g.parentId!="0"&&(g.parentTitle=M,r.push(g)),u(g.children,g.title)})}u(JSON.parse(JSON.stringify(p.value)),""),l.value=r;const b=yield G({});f.value=b.length,d.value=b.map(i=>i.repositoryId)})}function I(n,a=[]){return n.map(b=>{var i=b,{children:r}=i,u=L(i,["children"]);return S(O({},u),{disabled:a.includes(u.key),children:I(r!=null?r:[],a)})})}A(()=>I(p.value,d.value));const R=(n,a)=>a.title.indexOf(n)>-1;function E(n){f.value=n.length}function J(){return h(this,null,function*(){try{const a=(yield W({})).map(u=>u.id),r=d.value.filter(u=>!a.includes(u));yield H(r),e.success("操作成功"),o("success"),N()}finally{C({confirmLoading:!1})}})}return(n,a)=>(ee(),te(v(F),ae(n.$attrs,{destroyOnClose:"",onRegister:v(m),parentId:y.value,width:ue,onOk:J,showFooter:!0}),{default:B(()=>[c("div",null,[z(v(re),{message:"仅可选择二级菜单,父级添加关注无效果!!",type:"info"})]),c("div",ne,[a[1]||(a[1]=c("div",{class:"custom-tit"},"全部",-1)),c("div",ie,"我的关注("+D(f.value)+")",1)]),c("div",null,[c("div",null,[z(v(oe),{"target-keys":d.value,"onUpdate:targetKeys":a[0]||(a[0]=r=>d.value=r),class:"tree-transfer","data-source":l.value,"show-select-all":!1,operations:["关注","取消关注"],"show-search":"","list-style":{width:"500px",height:"600px"},onChange:E,filterOption:R},{render:B(r=>[c("div",le,[c("span",{class:"custom-item_title",style:se({color:v(j)(r.parentTitle)})},D(r.parentTitle),5),a[2]||(a[2]=c("span",{class:"custom-item_symbol"}," / ",-1)),c("span",ce,D(r.title),1)])]),_:1},8,["target-keys","data-source"])])])]),_:1},16,["onRegister","parentId"]))}}),Ce=Z(de,[["__scopeId","data-v-c8f4361d"]]);export{Ce as default};