| 1 |
- 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-CjSp6vmo.js";import{ap as K,u as X,_ as j}from"./entry/index-HR-LjmG7.js";import{g as q}from"./common-Dg2cpz7X.js";import{a as G,b as H,c as W}from"./attentionApi-BjM_bv1O.js";import{c as Y}from"./cateApi-BeBuAYHR.js";import{d as Z,c as A,f as w,a5 as ee,_ as te,a6 as B,$ as c,k as z,u as v,a0 as D,ad as se,aa as ae}from"./vue-4umLpMSY.js";import{ae as re,ah as oe}from"./antd-Cume0_44.js";import"./index-41VGryvF.js";import"./imageEnum-BRgYKvjO.js";import"./sysOrgApi-CcQXWgo1.js";const ne={class:"flex"},ie={class:"custom-tit"},le={class:"custom-item"},ce={class:"custom-item_name"},ue="1200px",de=Z({__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 G({}),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 H({});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 Y({})).map(u=>u.id),r=d.value.filter(u=>!a.includes(u));yield W(r),e.success("操作成功"),o("success"),N()}finally{C({confirmLoading:!1})}})}return(n,a)=>(te(),ee(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(q)(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=j(de,[["__scopeId","data-v-c8f4361d"]]);export{Ce as default};
|