SettingDrawer-Dt7UHk1w.js 2.8 KB

1
  1. var w=(I,m,l)=>new Promise((g,i)=>{var k=o=>{try{r(l.next(o))}catch(d){i(d)}},b=o=>{try{r(l.throw(o))}catch(d){i(d)}},r=o=>o.done?g(o.value):Promise.resolve(o.value).then(k,b);r((l=l.apply(I,m)).next())});import{a as O,B as P}from"./index-Mu5dydaG.js";import{a as Q,c as R}from"./homeApi-D_Ga5UF9.js";import{a3 as _,u as $,_ as G}from"./entry/index-BaQQ7BQ_.js";import{c as X}from"./platformApi-CkNy4PSH.js";import{d as Z,f as n,c as j,u as c,w as K,Z as p,a6 as C,a7 as U,$ as S,k as q,_ as z,a0 as F,G as J,F as W,ab as Y}from"./vue-CF9JqwIh.js";import{am as L,an as ee}from"./antd-ILpsl5AZ.js";const se={class:"mb-4"},ae={key:0,style:{color:"#1890ff"}},te="424px",re=Z({__name:"SettingDrawer",emits:["success","register"],setup(I,{emit:m}){const l=m,{createMessage:g}=$(),i=n(""),k=n(!1),b=j(()=>c(k)?"":"首页配置-"+i.value),r=n(""),o=n([]),d=n(!0),f=n([]),y=n([]),v=n([]),h=n([]),[V,{setDrawerProps:x,closeDrawer:A}]=O(a=>w(this,null,function*(){var D,B,N;x({confirmLoading:!1});const e=(a==null?void 0:a.record)||[];i.value=a.record.title,r.value=((D=a.record)==null?void 0:D.type)!="pingtai"?(B=a.record)==null?void 0:B.id:(N=a.record)==null?void 0:N.type;let t=[],u=[];r.value==="pingtai"?(t=yield X({status:"cbb_platform_1"}),u=_.flatten(e.info.map(s=>s.platformId))):(t=yield Q({categoryId:r.value}),u=_.flatten(e.info.map(s=>{var T;return(T=s.routing)==null?void 0:T.map(M=>M.repositoryId)}))),o.value=_.mapTree(t,s=>({id:s.id,key:s.id,title:s.name,level:s.level,parentId:s==null?void 0:s.parentId,children:s==null?void 0:s.children})),f.value=[],y.value=[],v.value=u,h.value=[]}));K(f,()=>{}),K(y,()=>{}),K(v,()=>{});function E(a,e){h.value=e.checkedNodes||[]}function H(){return w(this,null,function*(){try{let a=[];a=h.value.filter(e=>e.level!=1).map(e=>({repositoryIds:e.id,categoryId:r.value=="pingtai"?"1848982925285048321":r.value})),yield R(a),l("success"),g.success("配置成功"),A()}finally{x({confirmLoading:!1})}})}return(a,e)=>(p(),C(c(P),Y(a.$attrs,{destroyOnClose:"",onRegister:c(V),title:b.value,width:te,onOk:H,showFooter:!0}),{default:U(()=>[S("div",null,[S("div",se,[r.value=="pingtai"?(p(),C(c(L),{key:0,message:"平台首页仅显示3个,多选无法显示",type:"info","show-icon":""})):(p(),C(c(L),{key:1,message:"CBB库每个仅显示4个,多选无法显示",type:"info","show-icon":""}))]),q(c(ee),{expandedKeys:f.value,"onUpdate:expandedKeys":e[0]||(e[0]=t=>f.value=t),selectedKeys:y.value,"onUpdate:selectedKeys":e[1]||(e[1]=t=>y.value=t),checkedKeys:v.value,"onUpdate:checkedKeys":e[2]||(e[2]=t=>v.value=t),checkable:"",selectable:d.value,"tree-data":o.value,onCheck:E},{title:U(({title:t,key:u})=>[u==="0-0-1-0"?(p(),z("span",ae,F(t),1)):(p(),z(W,{key:1},[J(F(t),1)],64))]),_:1},8,["expandedKeys","selectedKeys","checkedKeys","selectable","tree-data"])])]),_:1},16,["onRegister","title"]))}}),pe=G(re,[["__scopeId","data-v-a0f0450e"]]);export{pe as default};