comp-hub 0.27.18 → 0.27.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -147
- package/bin/cli.js +85 -84
- package/dist/index.js +1 -1
- package/dist/website/container/assets/index-BE50zrUP.css +1 -0
- package/dist/website/container/assets/{index-CdaB9oWd.js → index-Cmi2NYAU.js} +1 -1
- package/dist/website/container/index.html +34 -34
- package/dist/website/container/js/vue2-sfc-loader.js +260 -260
- package/dist/website/container/js/vue3-sfc-loader.js +289 -289
- package/dist/website/item/assets/{index-B0s1uwsa.js → index-D1z-Gulp.js} +3 -3
- package/dist/website/item/assets/index-DMrYn9mD.css +1 -0
- package/dist/website/item/index.html +32 -32
- package/dist/website/main/assets/{AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-CfufrKbA.js → AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-bvKbrkpk.js} +1 -1
- package/dist/website/main/assets/{BaseDialog.vue_vue_type_script_setup_true_lang-B6WkXWm7.js → BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js} +1 -1
- package/dist/website/main/assets/{BaseSegmented.vue_vue_type_script_setup_true_lang-D5yw_wF0.js → BaseSegmented.vue_vue_type_script_setup_true_lang-CIcujGT8.js} +1 -1
- package/dist/website/main/assets/{CanvasAnimation.vue_vue_type_script_setup_true_lang-BwtYEYU5.js → CanvasAnimation.vue_vue_type_script_setup_true_lang-Z_wBEKCl.js} +1 -1
- package/dist/website/main/assets/{EmptyStatusContainer.vue_vue_type_script_setup_true_lang-DIgE9MGd.js → EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js} +1 -1
- package/dist/website/main/assets/{core-DE5-zGKf.js → core-DCZ-eL8G.js} +1 -1
- package/dist/website/main/assets/{el-table-column-BiqynxkD.js → el-table-column-Cx9gMgrN.js} +1 -1
- package/dist/website/main/assets/{index-BIGvC1SM.js → index-4acODfuo.js} +1 -1
- package/dist/website/main/assets/index-B2BmYIO5.js +1 -0
- package/dist/website/main/assets/index-B37e-H6y.js +1 -0
- package/dist/website/main/assets/index-B63tZaB2.css +1 -0
- package/dist/website/main/assets/{index-gOTpUrNM.js → index-BGTVNDSV.js} +1 -1
- package/dist/website/main/assets/{index-DvyE3TrH.js → index-BaX-1N8K.js} +2 -2
- package/dist/website/main/assets/{index-BGLjC3BV.js → index-BngP265n.js} +1 -1
- package/dist/website/main/assets/index-BnpZ3Duk.js +25 -0
- package/dist/website/main/assets/{index-BQWeT5qu.js → index-Bw7t67yK.js} +1 -1
- package/dist/website/main/assets/{index-CGgS1tZ0.js → index-C7kV7E5j.js} +1 -1
- package/dist/website/main/assets/index-C9r8rR8o.js +1 -0
- package/dist/website/main/assets/index-CfMcBFhz.js +1 -0
- package/dist/website/main/assets/{index-Dl-mwEbG.js → index-CqcYb_O4.js} +1 -1
- package/dist/website/main/assets/{index-BfPdLll-.js → index-CvRT9IhX.js} +1 -1
- package/dist/website/main/assets/{index-D7eOWAPr.js → index-Cy6hrNNt.js} +1 -1
- package/dist/website/main/assets/index-Czj4Va_p.js +1 -0
- package/dist/website/main/assets/{index-DBM1x91X.js → index-D4mf-9oL.js} +1 -1
- package/dist/website/main/assets/index-DBDOcdx3.js +2 -0
- package/dist/website/main/assets/{index-D8WDrGkh.js → index-DGdf8eP2.js} +1 -1
- package/dist/website/main/assets/{index-ctwb4cB7.js → index-DMAX-M2Q.js} +1 -1
- package/dist/website/main/assets/{index-CFH_ugiT.js → index-DNszuV9Y.js} +1 -1
- package/dist/website/main/assets/index-DlO1wWqO.js +1 -0
- package/dist/website/main/assets/{index-q4Z3Q7p4.js → index-DsYCIdsq.js} +1 -1
- package/dist/website/main/assets/{index-Cu1YAWdz.js → index-DxYo8MHB.js} +1 -1
- package/dist/website/main/assets/{index-Cl0SK7oa.css → index-DxyEzkir.css} +1 -1
- package/dist/website/main/assets/{index-Oo11MKfd.js → index-Dz7Dj_1u.js} +1 -1
- package/dist/website/main/assets/index-FHO37hxp.css +1 -0
- package/dist/website/main/assets/{index-uu5oSUvx.js → index-GnkbPU1i.js} +1 -1
- package/dist/website/main/assets/{index-C9t3Yhe9.js → index-IUKgsvZv.js} +1 -1
- package/dist/website/main/assets/{index-DmO0JQ56.css → index-JFePecD_.css} +1 -1
- package/dist/website/main/assets/{index-CTLlcQoM.js → index-O6EResxn.js} +1 -1
- package/dist/website/main/assets/index-Pry-PAul.css +1 -0
- package/dist/website/main/assets/{index-vnzmxexj.js → index-WuHE7xfi.js} +1 -1
- package/dist/website/main/assets/index-ZwxrucVt.js +1 -0
- package/dist/website/main/assets/{index-cFhtMyBi.js → index-x3kqy62K.js} +2 -2
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-BDhf8t5D.js → index.vue_vue_type_script_setup_true_lang-C5L_ugEm.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-aO0L9Tak.js → index.vue_vue_type_script_setup_true_lang-CmisVeEC.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-D_7jZ1zo.js → index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js} +2 -2
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-B4echric.js → index.vue_vue_type_script_setup_true_lang-DRlqnxVM.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-COryHg9c.js → index.vue_vue_type_script_setup_true_lang-SLaqY8P4.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_script_setup_true_lang-Dtuk2wrA.js → index.vue_vue_type_script_setup_true_lang-Y8sQYcwy.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-C4fELX8m.js → index.vue_vue_type_style_index_0_lang-BygWE3Ob.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-D_eT-tA_.js → index.vue_vue_type_style_index_0_lang-TY8hdvSG.js} +1 -1
- package/dist/website/main/assets/{index.vue_vue_type_style_index_0_lang-C3U7f9Ma.js → index.vue_vue_type_style_index_0_lang-vmUTBf-P.js} +1 -1
- package/dist/website/main/assets/{md5-BZr8xhBN.js → md5-CDR0X4F9.js} +1 -1
- package/dist/website/main/assets/{useCompEditStore-B7KaUbOi.js → useCompEditStore-BaMFNGpl.js} +2 -2
- package/dist/website/main/assets/{useCompEditStore-Du_-rNtX.css → useCompEditStore-DdbvUh5w.css} +1 -1
- package/dist/website/main/assets/{useKeyword-D1qu8Tz-.js → useKeyword-BMG9y3e4.js} +1 -1
- package/dist/website/main/assets/{useMessage-D7WAp245.js → useMessage-CNq7TVBk.js} +1 -1
- package/dist/website/main/assets/{useVscodeOpen-DIYbcP1e.js → useVscodeOpen-B7qurnVy.js} +1 -1
- package/dist/website/main/assets/{vendor-ui-D6wVBlls.js → vendor-ui-CmoKJ_4A.js} +3 -3
- package/dist/website/main/index.html +3 -3
- package/package.json +39 -39
- package/dist/website/container/assets/index-BnbvpvZL.css +0 -1
- package/dist/website/item/assets/index-BIcNxYiU.css +0 -1
- package/dist/website/main/assets/index-B6f_06zP.js +0 -1
- package/dist/website/main/assets/index-BkUBwon5.css +0 -1
- package/dist/website/main/assets/index-CCFHORqg.js +0 -1
- package/dist/website/main/assets/index-CWW1M_cy.js +0 -1
- package/dist/website/main/assets/index-Cf69_nzt.js +0 -23
- package/dist/website/main/assets/index-CuHNNhtE.js +0 -1
- package/dist/website/main/assets/index-D6Fz5rH9.css +0 -1
- package/dist/website/main/assets/index-DC94GyXj.js +0 -1
- package/dist/website/main/assets/index-DrUAgWBX.js +0 -1
- package/dist/website/main/assets/index-YUZjR2Eq.js +0 -2
- package/dist/website/main/assets/index-tEU6GnSH.js +0 -1
- package/dist/website/main/assets/index-y8GEzH-z.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as F,aA as R,x as D,y as H,A as Y,e as J,H as L}from"./vendor-ui-CmoKJ_4A.js";import{x as K,M as Q,L as W,e as X,_ as Z,I as $,O as ee,v as te,m as A}from"./index-BnpZ3Duk.js";/* empty css */import{_ as se}from"./index.vue_vue_type_script_setup_true_lang-qhJpeu7a.js";import{S as ae}from"./index-IUKgsvZv.js";import{v as b,aA as N,ab as v,l as h,i as n,r as s,ap as f,ax as l,aO as i,q as C,aD as oe,aF as le,ad as w,aN as ne,F as k,k as T,af as re,g as U}from"./vendor-core-B-Si3WEf.js";import{m as ue}from"./md5-CDR0X4F9.js";import{_ as ie}from"./AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-bvKbrkpk.js";import{_ as ce}from"./CanvasAnimation.vue_vue_type_script_setup_true_lang-Z_wBEKCl.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js";const de={class:"flex bg-gray-600 items-center justify-center overflow-hidden"},me={class:"w-full rounded-2xl p-8 md:p-12"},pe={class:"flex mb-[10px]"},fe={class:"text-2sm text-gray-300 mb-[50px] ml-2"},_e={class:"relative pl-6 border-l-4 border-indigo-400 mb-8"},ge={class:"leading-relaxed text-gray-300"},ve={class:"flex items-center gap-2 mb-6"},he=b({__name:"index",setup(E){const{t:e}=N(),_=K();return(I,d)=>{const g=F;return v(),h("div",de,[n("section",me,[n("header",pe,[s(se)]),n("h2",fe,f(l(e)("common.siteSubtitle")),1),n("blockquote",_e,[n("p",ge,f(l(e)("common.siteSlogan")),1),d[0]||(d[0]=n("footer",{class:"mt-4 text-sm text-gray-500"},null,-1))]),n("div",ve,[s(ae),s(g,{href:l(_),type:"primary",underline:"always",target:"_blank"},{default:i(()=>[C(f(l(e)("common.docsTutorial")),1)]),_:1},8,["href"])])])])}}}),xe={class:"flex items-center justify-center bg-[#0d0d0d] size-full overflow-hidden"},ye={class:"h-full"},Ce={class:"flex items-center gap-1 w-full"},we={class:"flex justify-between"},be=b({__name:"index",setup(E){const{t:e}=N(),_=oe(),I=Q(),d=le("form"),g=R(W,"account"),x=re(!1),p=w([{name:e("user.accountLogin"),type:"account",select:g.value==="account"},{name:e("user.emailLogin"),type:"email",select:g.value==="email"}]),o=w({account:"",password:"",email:"",authCode:""}),P=w({account:[{required:!0,message:e("user.pleaseInputAccount"),trigger:"blur"}],password:[{required:!0,message:e("user.pleaseInputPassword"),trigger:"blur"}],email:[{required:!0,message:e("common.pleaseInput")+e("user.email"),trigger:"blur"}],authCode:[{required:!0,message:e("user.pleaseInputAuthCode"),trigger:"blur"}]}),S=U(()=>p.find(a=>!a.select)??p[1]),y=U(()=>p.find(a=>a.select)??p[0]);function q(a){p.forEach(t=>{t.select=!1}),a.select=!0}function j(){X(Z.IS_GUEST_LOGIN),_.replace("/").catch(()=>{$()})}function z({end:a,startCountdown:t}){if(y.value?.type==="email"){if(d.value?.validateField("email"),!o.email){a();return}if(!ee.isEmail(o.email)){a();return}te.v1Email.emailcontrollerSendcode({email:o.email}).then(()=>{L.success(e("message.success.sendAuthCode")),t()}).finally(()=>{a()})}}function G(){d.value&&d.value.validate(a=>{if(!a)return;const t={account:{fields:["account","password"],getParams:r=>({account:r.account,password:ue(r.password)})},email:{fields:["email","authCode"],getParams:r=>({email:r.email,authCode:r.authCode})}},m=y.value?.type,c=m&&t[m];if(!c)return;c.fields.every(r=>!!o[r])&&O(c.getParams(o))})}function O(a){d.value&&d.value.validate(t=>{t&&(x.value=!0,I.login(a).then(()=>{_.replace("/").finally(()=>{x.value=!1,$(),L.success(e("user.loginSuccess"))})}).finally(()=>{x.value=!1}))})}return ne(()=>{p.forEach(a=>{a.select&&(g.value=a.type)})}),(a,t)=>{const m=Y,c=H,V=J,r=F,B=D;return v(),h("div",xe,[s(B,{ref:"form",class:"w-[70%]",model:o,rules:P,"status-icon":""},{default:i(()=>[n("div",ye,[y.value.type==="account"?(v(),h(k,{key:0},[s(c,{prop:"account"},{default:i(()=>[s(m,{modelValue:o.account,"onUpdate:modelValue":t[0]||(t[0]=u=>o.account=u),placeholder:l(e)("user.pleaseInputUsername")},null,8,["modelValue","placeholder"])]),_:1}),s(c,{prop:"password"},{default:i(()=>[s(m,{modelValue:o.password,"onUpdate:modelValue":t[1]||(t[1]=u=>o.password=u),placeholder:l(e)("user.pleaseInputPassword"),type:"password"},null,8,["modelValue","placeholder"])]),_:1}),t[6]||(t[6]=n("div",{class:"toolbar"},null,-1))],64)):T("",!0),y.value.type==="email"?(v(),h(k,{key:1},[s(c,{prop:"email"},{default:i(()=>[s(m,{modelValue:o.email,"onUpdate:modelValue":t[2]||(t[2]=u=>o.email=u),placeholder:l(e)("common.pleaseInput")+l(e)("user.email")},null,8,["modelValue","placeholder"])]),_:1}),s(c,{prop:"authCode"},{default:i(()=>[n("div",Ce,[s(m,{modelValue:o.authCode,"onUpdate:modelValue":t[3]||(t[3]=u=>o.authCode=u),placeholder:l(e)("user.pleaseInputAuthCode")},null,8,["modelValue","placeholder"]),s(l(ie),{text:l(e)("user.sendAuthCode"),"countdown-text":"user.resendAfterSeconds",duration:60,onSend:t[4]||(t[4]=({end:u,startCountdown:M})=>z({end:u,startCountdown:M}))},null,8,["text"])])]),_:1})],64)):T("",!0),s(c,null,{default:i(()=>[s(V,{class:"w-full",loading:x.value,type:"primary",onClick:G},{default:i(()=>[C(f(l(e)("user.login")),1)]),_:1},8,["loading"])]),_:1})]),n("div",we,[s(r,{href:"javascript:void(0)",onClick:j},{default:i(()=>[C(f(l(e)("user.guestLogin")),1)]),_:1}),s(r,{type:"primary",onClick:t[5]||(t[5]=u=>q(S.value))},{default:i(()=>[C(f(S.value.name),1)]),_:1})])]),_:1},8,["model","rules"])])}}}),Ee=A(be,[["__scopeId","data-v-93f7761d"]]),Ie={class:"size-full relative"},Se={class:"absolute inset-0 flex items-center justify-center"},Ve={class:"login-content-container"},Le={class:"flex size-full"},$e=b({__name:"index",setup(E){return(e,_)=>(v(),h("div",Ie,[s(l(ce)),n("div",Se,[n("div",Ve,[n("div",Le,[s(he,{class:"size-full flex-1"}),s(Ee,{class:"flex-1"})])])])]))}}),Ge=A($e,[["__scopeId","data-v-4366242f"]]);export{Ge as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.match-dot-green[data-v-01610d58]{background-color:#67c23a}.match-dot-blue[data-v-01610d58]{background-color:#409eff}.match-dot-orange[data-v-01610d58]{background-color:#e6a23c}.match-dot-red[data-v-01610d58]{background-color:#f56c6c}[data-v-01610d58] .not-matched{text-decoration:line-through;opacity:.6}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a0 as $,e as B,a1 as A,H as S,A as j}from"./vendor-ui-CmoKJ_4A.js";import{B as z,v as k}from"./index-BnpZ3Duk.js";import"./el-table-column-Cx9gMgrN.js";import{b as D}from"./index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js";import{_ as N}from"./index.vue_vue_type_script_setup_true_lang-CmisVeEC.js";import{u as P}from"./useTeamHeaders-DELMIzHt.js";import{v as R,aA as V,ab as u,l as d,r as t,p as q,ax as s,aO as o,_ as h,A as C,q as _,ap as f,af as w,g as c,ao as M}from"./vendor-core-B-Si3WEf.js";import{_ as O}from"./LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js";import"./index-DGdf8eP2.js";import"./useCompMetaLocalStore-pb1Ikkq3.js";/* empty css */import"./useVscodeOpen-B7qurnVy.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js";import"./useCacheOssStore-CU4a8b24.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js";import"./useMessage-CNq7TVBk.js";const Q={class:"size-full"},F={key:0},G={key:1},pa=R({__name:"index",setup(J){const{t:a}=V(),{headers:v,teamId:I}=P(),T=D(I)(),i=w({data:[],column:[{slot:"avatar",prop:"userId.avatar",label:c(()=>a("user.avatar")),align:"center"},{prop:"userId.account",label:c(()=>a("user.account")),align:"center"},{prop:"userId.nickname",label:c(()=>a("user.nickname")),align:"center",formatter(r){return r.userId.nickname||"--"}},{slot:"operation",prop:"operation",label:c(()=>a("common.operation")),align:"center"}],pagination:{total:0},search:{column:[{prop:"keyword",component:M(j),value:"",autoQuery:!1,attributes:{placeholder:c(()=>`${a("user.account")}/${a("user.nickname")}`)}}]},fixedHeight:!1,fetchData:x});async function x(r){const p=await k.v1Team.teamcontrollerApplylist({...r},{headers:v}),{rows:n,total:e}=p.data||{};i.value.data=n||[],i.value.pagination.total=e||0}function g(r,p,n){n.start(),k.v1Team.teamcontrollerHandleapply({applyId:r._id,isAgree:p},{headers:v}).then(()=>{i.value.data=i.value.data?.map(e=>(e._id===r._id&&(e.status=p?"approved":"rejected"),e)),S.success(a("message.success.operation"))}).finally(()=>{n.end()})}return(r,p)=>{const n=$,e=B,E=A;return u(),d("div",Q,[t(s(z),{tableConfig:i.value,border:""},q({avatar:o(({col:m})=>[t(n,h(C(m)),{default:o(({row:l})=>[t(N,{src:l.userId.avatar,size:40},null,8,["src"])]),_:1},16)]),_:2},[s(T).isCreator?{name:"operation",fn:o(({col:m})=>[t(n,h(C(m)),{default:o(({row:l})=>[l.status==="pending"?(u(),d("div",F,[t(s(O),null,{default:o(({instance:y,loading:b})=>[t(e,{type:"danger",loading:b,onClick:H=>g(l,!1,y)},{default:o(()=>[_(f(s(a)("team.reject")),1)]),_:1},8,["loading","onClick"]),t(e,{type:"primary",loading:b,onClick:H=>g(l,!0,y)},{default:o(()=>[_(f(s(a)("team.agree")),1)]),_:1},8,["loading","onClick"])]),_:2},1024)])):(u(),d("div",G,[t(E,{type:"info"},{default:o(()=>[_(f(l.status==="approved"?s(a)("team.approved"):s(a)("team.rejected")),1)]),_:2},1024)]))]),_:1},16)]),key:"0"}:void 0]),1032,["tableConfig"])])}}});export{pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aC as U,D as x,I as B,b as M,g as $}from"./vendor-ui-CmoKJ_4A.js";import{_ as n,B as K,v as m}from"./index-BnpZ3Duk.js";import{v as N,y as G,aA as V,aC as Y,aD as F,ac as f,aF as E,a9 as H,aP as z,ax as p,ab as Q,l as W,r as _,aO as j,af as J,g as c,ao as v}from"./vendor-core-B-Si3WEf.js";import{c as X,b as Z,a as q}from"./index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js";import{c as ee}from"./useCompEditStore-BaMFNGpl.js";import{_ as oe}from"./index.vue_vue_type_style_index_0_lang-BygWE3Ob.js";import{u as te}from"./useTeamHeaders-DELMIzHt.js";import{u as ae}from"./useKeyword-BMG9y3e4.js";import"./index-DGdf8eP2.js";import"./useCompMetaLocalStore-pb1Ikkq3.js";/* empty css */import"./useVscodeOpen-B7qurnVy.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js";import"./useCacheOssStore-CU4a8b24.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js";import"./useMessage-CNq7TVBk.js";/* empty css */import"./v4-EwEgHOG0.js";import"./index.vue_vue_type_style_index_0_lang-vmUTBf-P.js";import"./core-DCZ-eL8G.js";import"./PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js";import"./BaseSegmented.vue_vue_type_script_setup_true_lang-CIcujGT8.js";import"./LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js";const re={class:"size-full overflow-hidden"},Oe=N({__name:"index",setup(ne){const T=G()?.uid,{t:a}=V(),g=Y(),y=F(),{headers:l,teamId:h}=te(),r=X(`${g.path}_${n.SCOPE_ID_TEAM_COMP_LIST}`)();f(n.PROVIDE_KEY_COMP_LIST_STORE,r);const I=new Map;f(n.PROVIDE_KEY_CALLBACKS,I);const w=ee(g.path,n.DIALOG_TYPE_EDIT)();f(n.PROVIDE_KEY_COMP_EDIT_STORE,w);const C=Z(h)(),S=E("compUpdateDialog"),L=E("compIframeContainer"),u=J({data:[],search:{column:[{prop:"keyword",component:v(M),label:c(()=>a("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:c(()=>a("comp.keywordPlaceholder")),fetchSuggestions:D,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}},{prop:"group",component:v($),label:c(()=>a("team.group")),value:"",attributes:{options:c(()=>C.menuGroup),clearable:!0,props:{value:"id",checkStrictly:!0}}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:O}),b=c(()=>u.value?.search?.column[0]?.value??"");ae(b,L);function D(e,o){if(e.length<=1)return o([]);m.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compTeam"},{headers:l}).then(t=>{const{keywords:s=[]}=t.data||{};o(s)})}async function O(e){r.setLoading(!0);const{group:o=[]}=e||{};delete e.group;const t=o?.[o.length-1];if(t){let i=C.getSelectedGroupLeafNodes(t);i=i.length===0?[t]:i,e.leafNodeIds=i}const s=await m.v1Team.teamcontrollerTeamcomps({...e,scene:"library"},{headers:l}),{rows:d,total:A}=s.data??{};r.renderList(d??[]),u.value.pagination.total=A??0,r.setLoading(!1)}function R(e){y.push({path:`/previewTeam/${h}/${e}`})}async function P(e){const o=x.service({fullscreen:!0});try{const t=e,s=await m.v1Team.teamcontrollerCheckcompupdatepermission({compId:t},{headers:l}),{result:d}=s.data||{};if(d==="cannot_update"){B.confirm(a("message.noUpdatePermission"),a("common.info"),{confirmButtonText:a("common.confirm"),cancelButtonText:a("common.cancel"),type:"warning"}).finally(()=>{});return}S.value?.open(t)}finally{o.close()}}function k(e){m.v1Comp.compcontrollerCompdetail({compId:e}).then(o=>{r.updateCompListItemById(e,o.data)})}return H(()=>{r.$reset()}),(e,o)=>{const t=U;return z((Q(),W("div",re,[_(p(K),{tableConfig:u.value},{table:j(()=>[_(q,{ref:"compIframeContainer",iuid:p(T),compType:p(n).IFRAME_ROUTES.CONTAINER.TEAM_ALL,onPreview:R,onUpdate:P},null,8,["iuid","compType"])]),_:1},8,["tableConfig"]),_(oe,{ref:"compUpdateDialog",onUpdateSuccess:k},null,512)])),[[t,p(r).loading]])}}});export{Oe as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{m as re,B as q,_ as P,k as X,v as B,f as L,E as ce,i as de,l as M}from"./index-Cf69_nzt.js";import{X as me,z as pe,a2 as ue,e as J,U as W,ab as _e,s as fe,J as ve,b as he,W as ge,f as Z,c as be,a3 as ye,aE as Ce,d as we,K as xe}from"./vendor-ui-D6wVBlls.js";import{_ as Te}from"./el-table-column-BiqynxkD.js";/* empty css */import{_ as Ae}from"./index.vue_vue_type_script_setup_true_lang-aO0L9Tak.js";import{v as S,ab as v,l as N,i as r,ap as _,ai as G,g as i,ay as Ee,j as E,ax as e,X as ee,aO as s,aB as ke,r as a,al as K,aA as z,_ as Ie,A as Le,q as D,aC as te,ac as j,aF as ae,aM as De,a9 as oe,y as $e,K as se,af as F,ao as Y,aD as Se,a3 as Me,a2 as Oe,a7 as Ve,Q as Re,u as O}from"./vendor-core-B-Si3WEf.js";import{c as Pe,a as Be,b as H}from"./index.vue_vue_type_script_setup_true_lang-D_7jZ1zo.js";import{_ as Ne}from"./LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js";import{u as ze}from"./useKeyword-D1qu8Tz-.js";import{u as Ue,I as Q,e as Fe}from"./useMessage-D7WAp245.js";import{u as ne}from"./useTeamHeaders-DELMIzHt.js";import{I as le}from"./index-CMvx8gm3.js";import{_ as Ge}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-DIgE9MGd.js";import{_ as Ke}from"./BaseSegmented.vue_vue_type_script_setup_true_lang-D5yw_wF0.js";import"./useCacheOssStore-CU4a8b24.js";import"./index-D8WDrGkh.js";import"./useCompMetaLocalStore-pb1Ikkq3.js";/* empty css */import"./useVscodeOpen-DIYbcP1e.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-B6WkXWm7.js";const He={class:"flex items-center justify-center gap-[6px] leading-[15px]"},je={class:"text-xs leading-3 align-middle"},Ye={class:"inline-block align-middle shrink-0"},Qe=S({__name:"UserAvatar",props:{nickname:{type:String,default:""},teamUserNickname:{type:String,default:""}},setup(d){const t=d,o=i(()=>t.teamUserNickname||t.nickname||"--");return(c,b)=>(v(),N("div",He,[r("span",je,_(o.value),1),r("div",Ye,[G(c.$slots,"avatar",{},void 0,!0)])]))}}),qe=re(Qe,[["__scopeId","data-v-99cd7413"]]),Xe=S({__name:"SkeletonContainer",setup(d){const t=Ee();return(o,c)=>(v(),E(e(me),ee({rows:3,animated:""},e(t)),{default:s(()=>[G(o.$slots,"default")]),template:s(()=>[G(o.$slots,"template")]),_:3},16))}}),Je='<path class="cdj_y1r7t"/>',We={__name:"grid-view-rounded",props:["width","height"],setup(d){const t={width:24,height:24};return(o,c)=>(v(),E(e(le),{width:d.width,height:d.height,viewBox:t,content:Je,fallback:"material-symbols:grid-view-rounded"},null,8,["width","height"]))}},Ze='<path class="u2_fvl-wz"/>',et={__name:"view-list",props:["width","height"],setup(d){const t={width:24,height:24};return(o,c)=>(v(),E(e(le),{width:d.width,height:d.height,viewBox:t,content:Ze,fallback:"material-symbols:view-list"},null,8,["width","height"]))}},tt=S({__name:"ViewToggle",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(d){const t=ke(d,"modelValue"),o=i(()=>t.value==="grid"?et:We);function c(){t.value=t.value==="grid"?"list":"grid"}return(b,l)=>(v(),N("div",{class:"flex items-center rounded-sm cursor-pointer",onClick:c},[a(e(pe),{style:{"font-size":"25px"}},{default:s(()=>[(v(),E(K(o.value)))]),_:1})]))}}),at={class:"size-full overflow-hidden"},ot=S({__name:"ViewCompList",props:{data:{type:Array,default:()=>[]},selectedRows:{type:Array,default:()=>[]}},emits:["add-one-comp"],setup(d,{emit:t}){const{t:o}=z(),c=d,b=t,l=i(()=>({data:c.data,column:[{prop:"name",label:o("comp.name"),align:"center"},{prop:"version",label:o("comp.version"),align:"center"},{prop:"isAdd",label:o("team.added"),align:"center",formatter:m=>m.isAdd?o("common.yes"):o("common.no")},{prop:"desc",label:o("common.description"),align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:o("common.operation"),align:"center"}],isPagination:!1,autoLoading:!1})),y=(m,p)=>{p.start(),b("add-one-comp",m._id,()=>{p.end()})};return(m,p)=>{const I=J,C=ue;return v(),N("div",at,[a(e(q),{ref:"baseTable",tableConfig:l.value,border:"",stripe:""},{operation:s(({col:T})=>[a(C,Ie(Le(T)),{default:s(({row:u})=>[r("div",null,[a(e(Ne),null,{default:s(({instance:n,loading:f})=>[a(I,{type:"primary",disabled:u.isAdd,loading:f,onClick:$=>y(u,n)},{default:s(()=>[D(_(u.isAdd?e(o)("team.added"):e(o)("common.add")),1)]),_:2},1032,["disabled","loading","onClick"])]),_:2},1024)])]),_:1},16)]),_:1},8,["tableConfig"])])}}}),st={class:"size-full overflow-hidden"},nt=S({__name:"ViewCompGrid",props:{data:{type:Array,default:()=>[]},keyword:{type:String,default:""}},emits:["add-one-comp"],setup(d,{emit:t}){const o=d,c=t,b=$e(),l=te(),{sendMessageToTargetIframe:y,messageListener:m}=Fe(),p=Ue(!1,window.__GLOBAL_CONFIG__.subPort),{addListener:I}=m(),C=Pe(`${l.path}_${P.SCOPE_ID_TEAM_ADD_MY_COMP}`)();j(P.PROVIDE_KEY_COMP_LIST_STORE,C);const T=new Map;j(P.PROVIDE_KEY_CALLBACKS,T);const u=ae("compIframeContainer");ze(i(()=>o.keyword),u);const n=async()=>{C.setLoading(!0);const f=_e(o.data);C.renderList(f??[]),C.setLoading(!1)};return I(Q.ACTION_ADD_COMP_START_LOADING,f=>{c("add-one-comp",f,()=>{u.value?.sendMessageToTargetIframeByCompId($=>{$&&y($,Q.ACTION_ADD_COMP_FINISH_LOADING,"",p)})})}),De(()=>o.data,()=>n(),{immediate:!0,deep:!0}),oe(()=>{C.$reset()}),(f,$)=>{const h=W;return v(),N("div",st,[a(h,null,{default:s(()=>[a(Be,{ref:"compIframeContainer",iuid:e(b)?.uid,compType:e(P).IFRAME_ROUTES.CONTAINER.TEAM_ADD},null,8,["iuid","compType"])]),_:1})])}}}),lt={class:"size-full flex flex-col overflow-auto overflow-x-hidden"},it={class:"flex gap-2 pb-2"},rt=S({__name:"index",setup(d,{expose:t}){const{t:o}=z(),{headers:c,teamId:b}=ne(),l=H(b)(),y=F(!1),m=F(""),p=F({data:[],search:{column:[{prop:"keyword",component:Y(he),label:i(()=>o("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:i(()=>o("comp.keywordPlaceholder")),fetchSuggestions:C,triggerOnFocus:!1,style:"width: 350px",fitInputWidth:!0}},{prop:"status",label:i(()=>o("common.status")),component:Y(ge),value:"NotAdded",attributes:{style:{width:"120px"},clearable:!0,options:[{label:i(()=>o("team.added")),value:"Added"},{label:i(()=>o("team.notAdded")),value:"NotAdded"}]}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},fetchData:T}),I=i(()=>p.value?.search?.column[0]?.value??"");function C(h,g){if(h.length<=1)return g([]);B.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:h,type:"compMy"},{headers:c}).then(k=>{const{keywords:w=[]}=k.data||{};g(w)})}async function T(h){const g=await B.v1Team.teamcontrollerAddtoteammycomps({...h},{headers:c}),{rows:k,total:w}=g.data||{};p.value.data=k||[],p.value.pagination.total=w||0}function u(){y.value=!0}function n(){y.value=!1}function f(){m.value=m.value??"list"}function $(h,g){B.v1Team.teamcontrollerCopycomp({compIds:[h]},{headers:c}).then(()=>{p.value.data?.forEach(w=>{h===w._id&&(w.isAdd=!0)});const k=l.teamDetail.compCount+1;l.setTeamDetail({...l.teamDetail,compCount:k}),ve.success(o("team.addSuccess"))}).finally(g)}return t({open:u,close:n}),(h,g)=>{const k=fe;return v(),E(k,{modelValue:y.value,"onUpdate:modelValue":g[1]||(g[1]=w=>y.value=w),title:e(o)("team.addComp"),resizable:"","with-header":!1,size:"50%","append-to-body":"",onOpened:f},{default:s(()=>[r("div",lt,[a(e(q),{tableConfig:p.value},{tableBefore:s(()=>[r("div",it,[a(e(tt),{modelValue:m.value,"onUpdate:modelValue":g[0]||(g[0]=w=>m.value=w),class:"ml-auto"},null,8,["modelValue"])])]),table:s(()=>[a(e(X),null,{default:s(()=>[(v(),E(se,null,[(v(),E(K(m.value==="grid"?nt:ot),{data:p.value.data,keyword:I.value,onAddOneComp:$},null,40,["data","keyword"]))],1024))]),_:1})]),_:1},8,["tableConfig"])])]),_:1},8,["modelValue","title"])}}}),ct={class:"size-full overflow-hidden flex items-center gap-6"},dt={class:"flex-shrink-0"},mt={class:"flex flex-1 flex-col gap-3 overflow-hidden"},pt={class:"flex items-center gap-3"},ut={class:"text-xl font-bold"},_t={class:"flex items-center gap-1 rounded-full px-3 py-0.5 text-xs"},ft={class:"flex flex-wrap items-center gap-3"},vt={class:"!flex items-center gap-1"},ht={class:"!flex items-center gap-1"},gt={class:"!flex items-center gap-1"},bt={class:"!flex items-center gap-1"},yt={class:"!flex items-center gap-1"},Ct={class:"flex items-center gap-3 flex-shrink-0"},wt=S({__name:"index",setup(d){const{t}=z(),o=te(),c=Se(),{teamId:b}=o.params,l=H(b)(),y=ae("teamAddCompDrawer");function m(){y.value?.open()}function p(){c.push({name:"uploadTeam",params:{teamId:b}})}return(I,C)=>{const T=be,u=ye,n=J,f=Z;return v(),E(f,{"body-class":"!p-0",class:"size-full rounded-sm p-4"},{default:s(()=>[a(e(Xe),{rows:4,loading:e(l).loading},{default:s(()=>[r("div",ct,[r("div",dt,[a(T,{size:64,class:"bg-indigo-100"},{default:s(()=>[a(e(L),{icon:"material-symbols:layers-rounded",class:"text-3xl"})]),_:1})]),r("div",mt,[r("div",pt,[r("h2",ut,_(e(l).teamName),1),r("span",_t,[a(e(L),{icon:"material-symbols:check-circle-rounded",class:"text-green-500"}),D(" "+_(e(l).description),1)])]),r("div",ft,[a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",vt,[a(e(L),{icon:"material-symbols:person-rounded"}),D(" "+_(e(t)("team.creator"))+" ",1),a(e(qe),ee(e(l).creator,{teamUserNickname:e(l).creatorNickname}),{avatar:s(()=>[a(Ae,{size:15,src:e(l).creator?.avatar},null,8,["src"])]),_:1},16,["teamUserNickname"])])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",ht,[a(e(L),{icon:"material-symbols:tag-rounded"}),D(" "+_(e(t)("team.code"))+" ",1),a(e(Te),{class:"text-xs",text:e(l).code},null,8,["text"])])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",gt,[a(e(L),{icon:"material-symbols:group-rounded"}),D(" "+_(e(t)("team.member"))+" "+_(e(l).memberCount)+" "+_(e(t)("common.person")),1)])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",bt,[a(e(L),{icon:"material-symbols:widgets-rounded"}),D(" "+_(e(t)("team.compCount"))+" "+_(e(l).compCount)+" "+_(e(t)("common.unit")),1)])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",yt,[a(e(L),{icon:"material-symbols:download-rounded"}),D(" "+_(e(t)("team.downloadCount"))+" "+_(e(l).totalDownloadCount),1)])]),_:1})]),r("div",Ct,[a(n,{class:"!rounded-full !px-5 !py-2 !h-auto",onClick:m},{default:s(()=>[a(e(L),{icon:"material-symbols:format-list-bulleted-rounded",class:"mr-1"}),D(" "+_(e(t)("team.addFromMine")),1)]),_:1}),a(n,{type:"primary",class:"!rounded-full !px-5 !py-2 !h-auto",onClick:p},{default:s(()=>[a(e(L),{icon:"material-symbols:upload-rounded",class:"mr-1"}),D(" "+_(e(t)("comp.upload")),1)]),_:1})])])])]),_:1},8,["loading"]),a(rt,{ref:"teamAddCompDrawer"},null,512)]),_:1})}}}),xt={class:"mt-2"},Kt=S({__name:"index",setup(d){const{t}=z(),o=O(()=>M(()=>import("./index-CWW1M_cy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),c=O(()=>M(()=>import("./index-gOTpUrNM.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,27,29,24]))),b=O(()=>M(()=>import("./index-CGgS1tZ0.js"),__vite__mapDeps([30,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,33,22]))),l=O(()=>M(()=>import("./index-BfPdLll-.js"),__vite__mapDeps([34,1,2,3,4,11,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),y=O(()=>M(()=>import("./index-BGLjC3BV.js"),__vite__mapDeps([35,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,36,37]))),m=O(()=>M(()=>import("./index-vnzmxexj.js"),__vite__mapDeps([38,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,36,37,22]))),p=O(()=>M(()=>import("./index-CCFHORqg.js"),__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,10,11,12,13,14,40,22,24]))),I=[{label:i(()=>t("team.compLib")),value:"TeamCompList",component:o,visible:()=>!0},{label:i(()=>t("team.groupConfig")),value:"TeamCompGroup",component:c,visible:()=>n.isCreator},{label:i(()=>t("team.compManage")),value:"TeamCompManage",component:b,visible:()=>n.isCreator},{label:i(()=>t("team.myCompList")),value:"TeamMyCompList",component:l,visible:()=>!0},{label:i(()=>t("team.member")),value:"TeamMemberList",component:y,visible:()=>!0},{label:i(()=>t("team.applyList")),value:"TeamApplyList",component:m,visible:()=>n.isCreator},{label:i(()=>t("common.setting")),value:"TeamSet",component:p,visible:()=>!0}],{headers:C,teamId:T}=ne(),u=ce(),n=H(T)(),f=Ce(`${de}-${T}`,I[0]?.value),$=i(()=>Object.keys(n.teamDetail).length===0),h=i(()=>I.filter(x=>x.visible())),g=i(()=>h.value.find(A=>A.value===f.value)?.component||{render:()=>null}),k=async(x,A)=>{if(!n.canSaveCopy)return;const V=x.matched[x.matched.length-1],R=A.matched[A.matched.length-1];if(!(!V||!R)&&(!x.redirectedFrom||V.path===R.path)){const U={confirmButtonText:t("team.leave"),cancelButtonText:t("common.cancel"),type:"warning"};return await xe.confirm(t("team.unsavedDataLeave"),t("common.info"),U).then(()=>!0).catch(()=>!1)}};function w(x,A){u.addPayLoad(`/team/${x}`,{name:A??""})}return Me(k),Oe(k),Ve(()=>{n.setLoading(!0),B.v1Team.teamcontrollerDetail({headers:C}).then(x=>{const{compIdInLeafNodeMap:A}=x.data;n.setTeamDetail(x.data),n.setSelectedRowsToLeafNodeMap(A||{}),w(T??"",n.teamDetail?.name??"")}).catch(()=>{n.$reset()}).finally(()=>{n.setLoading(!1)})}),oe(()=>{n.$reset()}),(x,A)=>{const V=Z,R=we,U=W;return v(),E(U,{"wrap-class":"team-container",class:"size-full overflow-x-hidden p-[10px]",always:""},{default:s(()=>[a(e(Ge),{isEmpty:$.value,loading:e(n).loading,emptyDescription:e(t)("team.noTeamInfo")},{default:s(()=>[a(wt),a(V,{"body-class":"!p-0",class:"sticky top-0 w-full z-100 mt-1"},{default:s(()=>[a(e(Ke),{modelValue:e(f),"onUpdate:modelValue":A[0]||(A[0]=ie=>Re(f)?f.value=ie:null),options:h.value},null,8,["modelValue","options"])]),_:1}),r("div",xt,[a(e(X),null,{default:s(()=>[(v(),E(se,null,[(v(),E(K(g.value)))],1024))]),_:1})]),a(R,{right:100,bottom:100,target:".team-container"})]),_:1},8,["isEmpty","loading","emptyDescription"])]),_:1})}}});export{Kt as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ZwxrucVt.js","assets/vendor-ui-CmoKJ_4A.js","assets/vendor-core-B-Si3WEf.js","assets/index-BnpZ3Duk.js","assets/index-JFePecD_.css","assets/index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js","assets/index-DGdf8eP2.js","assets/useCompMetaLocalStore-pb1Ikkq3.js","assets/useVscodeOpen-B7qurnVy.js","assets/BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js","assets/useCacheOssStore-CU4a8b24.js","assets/useTeamHeaders-DELMIzHt.js","assets/EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js","assets/useMessage-CNq7TVBk.js","assets/el-link-CPQZ-olG.css","assets/useCompEditStore-BaMFNGpl.js","assets/v4-EwEgHOG0.js","assets/index.vue_vue_type_style_index_0_lang-vmUTBf-P.js","assets/core-DCZ-eL8G.js","assets/index-Dj51p5I8.css","assets/PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js","assets/BaseSegmented.vue_vue_type_script_setup_true_lang-CIcujGT8.js","assets/LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js","assets/useCompEditStore-DdbvUh5w.css","assets/el-card-BAyktVMS.css","assets/index.vue_vue_type_style_index_0_lang-BygWE3Ob.js","assets/index-CdWXO9ks.css","assets/useKeyword-BMG9y3e4.js","assets/index-BGTVNDSV.js","assets/index-Dd9Tvz1_.css","assets/index-C7kV7E5j.js","assets/el-table-column-Cx9gMgrN.js","assets/el-table-column-B3ZEEuPD.css","assets/moment-B-YVwB4U.js","assets/index-CvRT9IhX.js","assets/index-BngP265n.js","assets/index.vue_vue_type_script_setup_true_lang-CmisVeEC.js","assets/index-DOlF0Z_P.css","assets/index-WuHE7xfi.js","assets/index-B2BmYIO5.js","assets/AuthCodeSendBtn.vue_vue_type_script_setup_true_lang-bvKbrkpk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{m as re,B as q,_ as P,k as X,v as B,f as L,E as ce,i as de,l as M}from"./index-BnpZ3Duk.js";import{V as me,z as pe,a0 as ue,e as J,S as W,a7 as _e,s as fe,H as ve,b as he,U as ge,f as Z,c as be,a1 as ye,aA as Ce,d as we,I as xe}from"./vendor-ui-CmoKJ_4A.js";import{_ as Te}from"./el-table-column-Cx9gMgrN.js";/* empty css */import{_ as Ae}from"./index.vue_vue_type_script_setup_true_lang-CmisVeEC.js";import{v as $,ab as v,l as N,i as r,ap as _,ai as G,g as i,ay as Ee,j as E,ax as e,X as ee,aO as s,aB as ke,r as a,al as H,aA as z,_ as Ie,A as Le,q as D,aC as te,ac as j,aF as ae,aM as De,a9 as oe,y as Se,K as se,af as F,ao as Y,aD as $e,a3 as Me,a2 as Oe,a7 as Ve,Q as Re,u as O}from"./vendor-core-B-Si3WEf.js";import{c as Pe,a as Be,b as K}from"./index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js";import{_ as Ne}from"./LoadingWrapper.vue_vue_type_script_setup_true_lang-5GxduB08.js";import{u as ze}from"./useKeyword-BMG9y3e4.js";import{u as Ue,I as Q,e as Fe}from"./useMessage-CNq7TVBk.js";import{u as ne}from"./useTeamHeaders-DELMIzHt.js";import{I as le}from"./index-CMvx8gm3.js";import{_ as Ge}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js";import{_ as He}from"./BaseSegmented.vue_vue_type_script_setup_true_lang-CIcujGT8.js";import"./useCacheOssStore-CU4a8b24.js";import"./index-DGdf8eP2.js";import"./useCompMetaLocalStore-pb1Ikkq3.js";/* empty css */import"./useVscodeOpen-B7qurnVy.js";import"./BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js";const Ke={class:"flex items-center justify-center gap-[6px] leading-[15px]"},je={class:"text-xs leading-3 align-middle"},Ye={class:"inline-block align-middle shrink-0"},Qe=$({__name:"UserAvatar",props:{nickname:{type:String,default:""},teamUserNickname:{type:String,default:""}},setup(d){const t=d,o=i(()=>t.teamUserNickname||t.nickname||"--");return(c,b)=>(v(),N("div",Ke,[r("span",je,_(o.value),1),r("div",Ye,[G(c.$slots,"avatar",{},void 0,!0)])]))}}),qe=re(Qe,[["__scopeId","data-v-f90b87fa"]]),Xe=$({__name:"SkeletonContainer",setup(d){const t=Ee();return(o,c)=>(v(),E(e(me),ee({rows:3,animated:""},e(t)),{default:s(()=>[G(o.$slots,"default")]),template:s(()=>[G(o.$slots,"template")]),_:3},16))}}),Je='<path class="cdj_y1r7t"/>',We={__name:"grid-view-rounded",props:["width","height"],setup(d){const t={width:24,height:24};return(o,c)=>(v(),E(e(le),{width:d.width,height:d.height,viewBox:t,content:Je,fallback:"material-symbols:grid-view-rounded"},null,8,["width","height"]))}},Ze='<path class="u2_fvl-wz"/>',et={__name:"view-list",props:["width","height"],setup(d){const t={width:24,height:24};return(o,c)=>(v(),E(e(le),{width:d.width,height:d.height,viewBox:t,content:Ze,fallback:"material-symbols:view-list"},null,8,["width","height"]))}},tt=$({__name:"ViewToggle",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(d){const t=ke(d,"modelValue"),o=i(()=>t.value==="grid"?et:We);function c(){t.value=t.value==="grid"?"list":"grid"}return(b,l)=>(v(),N("div",{class:"flex items-center rounded-sm cursor-pointer",onClick:c},[a(e(pe),{style:{"font-size":"25px"}},{default:s(()=>[(v(),E(H(o.value)))]),_:1})]))}}),at={class:"size-full overflow-hidden"},ot=$({__name:"ViewCompList",props:{data:{type:Array,default:()=>[]},selectedRows:{type:Array,default:()=>[]}},emits:["add-one-comp"],setup(d,{emit:t}){const{t:o}=z(),c=d,b=t,l=i(()=>({data:c.data,column:[{prop:"name",label:o("comp.name"),align:"center"},{prop:"version",label:o("comp.version"),align:"center"},{prop:"isAdd",label:o("team.added"),align:"center",formatter:m=>m.isAdd?o("common.yes"):o("common.no")},{prop:"desc",label:o("common.description"),align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:o("common.operation"),align:"center"}],isPagination:!1,autoLoading:!1})),y=(m,p)=>{p.start(),b("add-one-comp",m._id,()=>{p.end()})};return(m,p)=>{const I=J,C=ue;return v(),N("div",at,[a(e(q),{ref:"baseTable",tableConfig:l.value,border:"",stripe:""},{operation:s(({col:T})=>[a(C,Ie(Le(T)),{default:s(({row:u})=>[r("div",null,[a(e(Ne),null,{default:s(({instance:n,loading:f})=>[a(I,{type:"primary",disabled:u.isAdd,loading:f,onClick:S=>y(u,n)},{default:s(()=>[D(_(u.isAdd?e(o)("team.added"):e(o)("common.add")),1)]),_:2},1032,["disabled","loading","onClick"])]),_:2},1024)])]),_:1},16)]),_:1},8,["tableConfig"])])}}}),st={class:"size-full overflow-hidden"},nt=$({__name:"ViewCompGrid",props:{data:{type:Array,default:()=>[]},keyword:{type:String,default:""}},emits:["add-one-comp"],setup(d,{emit:t}){const o=d,c=t,b=Se(),l=te(),{sendMessageToTargetIframe:y,messageListener:m}=Fe(),p=Ue(!1,window.__GLOBAL_CONFIG__.subPort),{addListener:I}=m(),C=Pe(`${l.path}_${P.SCOPE_ID_TEAM_ADD_MY_COMP}`)();j(P.PROVIDE_KEY_COMP_LIST_STORE,C);const T=new Map;j(P.PROVIDE_KEY_CALLBACKS,T);const u=ae("compIframeContainer");ze(i(()=>o.keyword),u);const n=async()=>{C.setLoading(!0);const f=_e(o.data);C.renderList(f??[]),C.setLoading(!1)};return I(Q.ACTION_ADD_COMP_START_LOADING,f=>{c("add-one-comp",f,()=>{u.value?.sendMessageToTargetIframeByCompId(S=>{S&&y(S,Q.ACTION_ADD_COMP_FINISH_LOADING,"",p)})})}),De(()=>o.data,()=>n(),{immediate:!0,deep:!0}),oe(()=>{C.$reset()}),(f,S)=>{const h=W;return v(),N("div",st,[a(h,null,{default:s(()=>[a(Be,{ref:"compIframeContainer",iuid:e(b)?.uid,compType:e(P).IFRAME_ROUTES.CONTAINER.TEAM_ADD},null,8,["iuid","compType"])]),_:1})])}}}),lt={class:"size-full flex flex-col overflow-auto overflow-x-hidden"},it={class:"flex gap-2 pb-2"},rt=$({__name:"index",setup(d,{expose:t}){const{t:o}=z(),{headers:c,teamId:b}=ne(),l=K(b)(),y=F(!1),m=F(""),p=F({data:[],search:{column:[{prop:"keyword",component:Y(he),label:i(()=>o("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:i(()=>o("comp.keywordPlaceholder")),fetchSuggestions:C,triggerOnFocus:!1,style:"width: 350px",fitInputWidth:!0}},{prop:"status",label:i(()=>o("common.status")),component:Y(ge),value:"NotAdded",attributes:{style:{width:"120px"},clearable:!0,options:[{label:i(()=>o("team.added")),value:"Added"},{label:i(()=>o("team.notAdded")),value:"NotAdded"}]}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},fetchData:T}),I=i(()=>p.value?.search?.column[0]?.value??"");function C(h,g){if(h.length<=1)return g([]);B.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:h,type:"compMy"},{headers:c}).then(k=>{const{keywords:w=[]}=k.data||{};g(w)})}async function T(h){const g=await B.v1Team.teamcontrollerAddtoteammycomps({...h},{headers:c}),{rows:k,total:w}=g.data||{};p.value.data=k||[],p.value.pagination.total=w||0}function u(){y.value=!0}function n(){y.value=!1}function f(){m.value=m.value??"list"}function S(h,g){B.v1Team.teamcontrollerCopycomp({compIds:[h]},{headers:c}).then(()=>{p.value.data?.forEach(w=>{h===w._id&&(w.isAdd=!0)});const k=l.teamDetail.compCount+1;l.setTeamDetail({...l.teamDetail,compCount:k}),ve.success(o("team.addSuccess"))}).finally(g)}return t({open:u,close:n}),(h,g)=>{const k=fe;return v(),E(k,{modelValue:y.value,"onUpdate:modelValue":g[1]||(g[1]=w=>y.value=w),title:e(o)("team.addComp"),resizable:"","with-header":!1,size:"50%","append-to-body":"",onOpened:f},{default:s(()=>[r("div",lt,[a(e(q),{tableConfig:p.value},{tableBefore:s(()=>[r("div",it,[a(e(tt),{modelValue:m.value,"onUpdate:modelValue":g[0]||(g[0]=w=>m.value=w),class:"ml-auto"},null,8,["modelValue"])])]),table:s(()=>[a(e(X),null,{default:s(()=>[(v(),E(se,null,[(v(),E(H(m.value==="grid"?nt:ot),{data:p.value.data,keyword:I.value,onAddOneComp:S},null,40,["data","keyword"]))],1024))]),_:1})]),_:1},8,["tableConfig"])])]),_:1},8,["modelValue","title"])}}}),ct={class:"size-full overflow-hidden flex items-center gap-6"},dt={class:"flex-shrink-0"},mt={class:"flex flex-1 flex-col gap-3 overflow-hidden"},pt={class:"flex items-center gap-3"},ut={class:"text-xl font-bold"},_t={class:"flex items-center gap-1 rounded-full px-3 py-0.5 text-xs"},ft={class:"flex flex-wrap items-center gap-3"},vt={class:"!flex items-center gap-1"},ht={class:"!flex items-center gap-1"},gt={class:"!flex items-center gap-1"},bt={class:"!flex items-center gap-1"},yt={class:"!flex items-center gap-1"},Ct={class:"flex items-center gap-3 flex-shrink-0"},wt=$({__name:"index",setup(d){const{t}=z(),o=te(),c=$e(),{teamId:b}=o.params,l=K(b)(),y=ae("teamAddCompDrawer");function m(){y.value?.open()}function p(){c.push({name:"uploadTeam",params:{teamId:b}})}return(I,C)=>{const T=be,u=ye,n=J,f=Z;return v(),E(f,{"body-class":"!p-0",class:"size-full rounded-sm p-4"},{default:s(()=>[a(e(Xe),{rows:4,loading:e(l).loading},{default:s(()=>[r("div",ct,[r("div",dt,[a(T,{size:64,class:"bg-indigo-100"},{default:s(()=>[a(e(L),{icon:"material-symbols:layers-rounded",class:"text-3xl"})]),_:1})]),r("div",mt,[r("div",pt,[r("h2",ut,_(e(l).teamName),1),r("span",_t,[a(e(L),{icon:"material-symbols:check-circle-rounded",class:"text-green-500"}),D(" "+_(e(l).description),1)])]),r("div",ft,[a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",vt,[a(e(L),{icon:"material-symbols:person-rounded"}),D(" "+_(e(t)("team.creator"))+" ",1),a(e(qe),ee(e(l).creator,{teamUserNickname:e(l).creatorNickname}),{avatar:s(()=>[a(Ae,{size:15,src:e(l).creator?.avatar},null,8,["src"])]),_:1},16,["teamUserNickname"])])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",ht,[a(e(L),{icon:"material-symbols:tag-rounded"}),D(" "+_(e(t)("team.code"))+" ",1),a(e(Te),{class:"text-xs",text:e(l).code},null,8,["text"])])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",gt,[a(e(L),{icon:"material-symbols:group-rounded"}),D(" "+_(e(t)("team.member"))+" "+_(e(l).memberCount)+" "+_(e(t)("common.person")),1)])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",bt,[a(e(L),{icon:"material-symbols:widgets-rounded"}),D(" "+_(e(t)("team.compCount"))+" "+_(e(l).compCount)+" "+_(e(t)("common.unit")),1)])]),_:1}),a(u,{round:"",type:"info","disable-transitions":""},{default:s(()=>[r("div",yt,[a(e(L),{icon:"material-symbols:download-rounded"}),D(" "+_(e(t)("team.downloadCount"))+" "+_(e(l).totalDownloadCount),1)])]),_:1})]),r("div",Ct,[a(n,{class:"!rounded-full !px-5 !py-2 !h-auto",onClick:m},{default:s(()=>[a(e(L),{icon:"material-symbols:format-list-bulleted-rounded",class:"mr-1"}),D(" "+_(e(t)("team.addFromMine")),1)]),_:1}),a(n,{type:"primary",class:"!rounded-full !px-5 !py-2 !h-auto",onClick:p},{default:s(()=>[a(e(L),{icon:"material-symbols:upload-rounded",class:"mr-1"}),D(" "+_(e(t)("comp.upload")),1)]),_:1})])])])]),_:1},8,["loading"]),a(rt,{ref:"teamAddCompDrawer"},null,512)]),_:1})}}}),xt={class:"mt-2"},Ht=$({__name:"index",setup(d){const{t}=z(),o=O(()=>M(()=>import("./index-ZwxrucVt.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),c=O(()=>M(()=>import("./index-BGTVNDSV.js"),__vite__mapDeps([28,1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,27,29,24]))),b=O(()=>M(()=>import("./index-C7kV7E5j.js"),__vite__mapDeps([30,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,33,22]))),l=O(()=>M(()=>import("./index-CvRT9IhX.js"),__vite__mapDeps([34,1,2,3,4,11,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),y=O(()=>M(()=>import("./index-BngP265n.js"),__vite__mapDeps([35,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,36,37]))),m=O(()=>M(()=>import("./index-WuHE7xfi.js"),__vite__mapDeps([38,1,2,3,4,31,32,5,6,7,8,9,10,11,12,13,14,36,37,22]))),p=O(()=>M(()=>import("./index-B2BmYIO5.js"),__vite__mapDeps([39,1,2,3,4,5,6,7,8,9,10,11,12,13,14,40,22,24]))),I=[{label:i(()=>t("team.compLib")),value:"TeamCompList",component:o,visible:()=>!0},{label:i(()=>t("team.groupConfig")),value:"TeamCompGroup",component:c,visible:()=>n.isCreator},{label:i(()=>t("team.compManage")),value:"TeamCompManage",component:b,visible:()=>n.isCreator},{label:i(()=>t("team.myCompList")),value:"TeamMyCompList",component:l,visible:()=>!0},{label:i(()=>t("team.member")),value:"TeamMemberList",component:y,visible:()=>!0},{label:i(()=>t("team.applyList")),value:"TeamApplyList",component:m,visible:()=>n.isCreator},{label:i(()=>t("common.setting")),value:"TeamSet",component:p,visible:()=>!0}],{headers:C,teamId:T}=ne(),u=ce(),n=K(T)(),f=Ce(`${de}-${T}`,I[0]?.value),S=i(()=>Object.keys(n.teamDetail).length===0),h=i(()=>I.filter(x=>x.visible())),g=i(()=>h.value.find(A=>A.value===f.value)?.component||{render:()=>null}),k=async(x,A)=>{if(!n.canSaveCopy)return;const V=x.matched[x.matched.length-1],R=A.matched[A.matched.length-1];if(!(!V||!R)&&(!x.redirectedFrom||V.path===R.path)){const U={confirmButtonText:t("team.leave"),cancelButtonText:t("common.cancel"),type:"warning"};return await xe.confirm(t("team.unsavedDataLeave"),t("common.info"),U).then(()=>!0).catch(()=>!1)}};function w(x,A){u.addPayLoad(`/team/${x}`,{name:A??""})}return Me(k),Oe(k),Ve(()=>{n.setLoading(!0),B.v1Team.teamcontrollerDetail({headers:C}).then(x=>{const{compIdInLeafNodeMap:A}=x.data;n.setTeamDetail(x.data),n.setSelectedRowsToLeafNodeMap(A||{}),w(T??"",n.teamDetail?.name??"")}).catch(()=>{n.$reset()}).finally(()=>{n.setLoading(!1)})}),oe(()=>{n.$reset()}),(x,A)=>{const V=Z,R=we,U=W;return v(),E(U,{"wrap-class":"team-container",class:"size-full overflow-x-hidden p-[10px]",always:""},{default:s(()=>[a(e(Ge),{isEmpty:S.value,loading:e(n).loading,emptyDescription:e(t)("team.noTeamInfo")},{default:s(()=>[a(wt),a(V,{"body-class":"!p-0",class:"sticky top-0 w-full z-100 mt-1"},{default:s(()=>[a(e(He),{modelValue:e(f),"onUpdate:modelValue":A[0]||(A[0]=ie=>Re(f)?f.value=ie:null),options:h.value},null,8,["modelValue","options"])]),_:1}),r("div",xt,[a(e(X),null,{default:s(()=>[(v(),E(se,null,[(v(),E(H(g.value)))],1024))]),_:1})]),a(R,{right:100,bottom:100,target:".team-container"})]),_:1},8,["isEmpty","loading","emptyDescription"])]),_:1})}}});export{Ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{M as s}from"./index-
|
|
1
|
+
import{M as s}from"./index-BnpZ3Duk.js";import{v as t,ai as n}from"./vendor-core-B-Si3WEf.js";const c=t({__name:"index",setup(i){const o=s();function r(){const e=o.isRealUserLogin();return e||o.logoutDialog(),e}return(e,a)=>n(e.$slots,"default",{isLogin:r})}});export{c as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i}from"./vendor-ui-
|
|
1
|
+
import{c as i}from"./vendor-ui-CmoKJ_4A.js";import{s as l}from"./index-BnpZ3Duk.js";import{u}from"./useCacheOssStore-CU4a8b24.js";import{v as f,ay as m,aM as d,aN as h,ab as p,j as x,X as g,ax as v,af as _}from"./vendor-core-B-Si3WEf.js";function B(n){const t=document.createElement("canvas"),e=t.getContext("2d");if(!e)return"";t.width=100,t.height=100,e.fillStyle="#fff",e.font="60px serif";const r=e.measureText(n),a=r.width,s=r.actualBoundingBoxAscent+r.actualBoundingBoxDescent,o=(t.width-a)/2,c=(t.height+s)/2-r.actualBoundingBoxDescent;return e.fillText(n,o,c),t.toDataURL()}const S=f({__name:"index",props:{src:{type:String,default:""},text:{type:String,default:""}},setup(n){const t=n,e=u(),r=m(),a=_("");return d(()=>t.text,s=>{!s||t.src||(a.value=B(s))},{immediate:!0}),h(async()=>{if(!t.src)return;const s=e.getCacheUrl(t.src);if(s){a.value=s;return}const o=await l.v1Oss.osscontrollerFilesignurl({objectId:t.src}),{signUrl:c}=o.data;a.value=c,e.setCacheUrl(t.src,c)}),(s,o)=>{const c=i;return p(),x(c,g({class:"border border-gray-400"},v(r),{src:a.value}),null,16,["src"])}}});export{S as _};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{v as se,aA as b,ab as ce,j as ye,aO as W,i as B,r as Y,ax as y,ap as te,q as Me,u as Oe,af as A,w as ie,H as N,aF as oe,aM as Ae,l as Ne,$ as Pe,g as O}from"./vendor-core-B-Si3WEf.js";import{p as z,c as M}from"./index-D8WDrGkh.js";import{l as Re,A as K,s as v,_ as S,M as re,v as V,V as Fe,N as Be}from"./index-Cf69_nzt.js";import{c as G}from"./useCompMetaLocalStore-pb1Ikkq3.js";import{D as Ge,K as x,F as q,J as X,aA as Ve}from"./vendor-ui-D6wVBlls.js";/* empty css */import{u as le}from"./useVscodeOpen-DIYbcP1e.js";import{_ as xe}from"./BaseDialog.vue_vue_type_script_setup_true_lang-B6WkXWm7.js";import{u as be}from"./useCacheOssStore-CU4a8b24.js";import{u as ke}from"./useTeamHeaders-DELMIzHt.js";import{_ as $e}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-DIgE9MGd.js";import{u as He,c as Ue,b as We,I as l,a as ae,e as Ye}from"./useMessage-D7WAp245.js";const Ke={class:"flex justify-between items-center"},je={class:"h-[65vh]"},ze=se({__name:"index",setup(C,{expose:e}){const{t}=b(),n=Oe(()=>Re(()=>import("./index-DBM1x91X.js"),__vite__mapDeps([0,1,2,3,4]))),{openCompPathInVscode:p}=le(),{cwd:_}=window.__GLOBAL_CONFIG__,r=A(!1),s=A(null),d=A(_);function i(){p(d.value,"./package.json")}const m=h=>{r.value=!0,s.value=h},f=()=>{r.value=!1,s.value=null},E=h=>{s.value&&s.value(h)};return e({open:m,close:f}),(h,D)=>{const P=Ge;return ce(),ye(y(xe),{modelValue:r.value,"onUpdate:modelValue":D[0]||(D[0]=g=>r.value=g),width:"50%","show-close":""},{header:W(()=>[B("div",Ke,[B("span",null,[B("span",null,te(y(t)("file.projectPath"))+":",1),Y(P,{href:"javascript:void(0)",type:"primary",underline:"always",title:d.value,class:"truncate",onClick:i},{default:W(()=>[Me(te(d.value),1)]),_:1},8,["title"])])])]),default:W(()=>[B("div",je,[Y(y(n),{onSelect:E})])]),_:1},8,["modelValue"])}}}),_t=(C,e)=>ie(`compListStore_${C}`,{state:()=>({scopeId:C,list:[],localList:[],loading:!1,listType:e??S.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:t=>t.list.length===0,isRemote:t=>t.listType===S.COMP_LIST_TYPE_REMOTE,isLocal:t=>t.listType===S.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(t){this.$patch(n=>{n.localList=t})},setLoading(t){this.$patch(n=>{n.loading=t})},setList(t){this.$patch(n=>{n.list=t})},delCompListById(t){this.$patch(n=>{n.list=n.list.filter(p=>p._id!==t)})},updateCompListItemById(t,n){this.$patch(p=>{p.list=p.list.map(_=>{if(_._id===t){const r={..._,...n};return M(t)().setDetail(r.version,r),r}return _})})},async getListDeps(t){const n=K(),r=t.map(i=>i.dep).map(i=>z(i,n.deps)).reduce((i,m)=>[...i,...m],[]).map(i=>i.name),s=await v.v1Module.modulecontrollerPrebuild({deps:[...new Set(r)]}),{entryNameToFile:d={}}=s.data;return d},async initCompMetas(t){const n=K(),p=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:t.map(s=>s._id)}),{compInfos:_=[]}=p.data,r=await this.getListDeps(t);t.forEach(s=>{const i=z(s.dep,n.deps).reduce((E,h)=>(r[h.name]&&(E[h.name]=r[h.name]),E),{}),m=M(s._id)();m.setLatestVersion(s.version),m.setDetail(s.version,s);const f=_.filter(E=>E.id===s._id);m.setLocalCompInfo(f),m.setDepEntryNameToFile(s.version,i)})},async initCompMetasLocal(t){t.forEach(n=>{G(n._id)().setDetail(n)})},async renderList(t){t.length&&(this.isRemote?await this.initCompMetas(t):await this.initCompMetasLocal(t)),this.setList(t)}}});async function ne(C){const e=K();async function t(i){const{objectId:m,version:f,files:E}=i,h={objectId:m,version:f,files:E.map(g=>g.path)},D=await v.v1Comp.compcontrollerCompfilesosssignedurl(h),{signedUrls:P}=D.data;return P}async function n(i){const{dep:m}=i,f=z(m,e.deps).map(D=>D.name),E=await v.v1Module.modulecontrollerPrebuild({deps:f}),{entryNameToFile:h={}}=E.data;return h}const{version:p,_id:_}=C,r=M(_)();let s=null,d=null;r.versionToFileAccessPath[p]||(s=await t(C),r.setVersionToFileAccessPath(p,s)),r.depEntryNameToFile[p]||(d=await n(C),r.setDepEntryNameToFile(p,d))}const me=()=>{const C=re();function e(){const t=C.isRealUserLogin();return t||C.logoutDialog(),t}return{isLogin:e}};function qe(){const{isLogin:C}=me(),e=N(S.PROVIDE_KEY_CALLBACKS),t=N(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function p(_){if(!C()||!t.isRemote)return;const{id:r,isCollect:s}=_,d=t.list.find(m=>m._id===r);if(!d||!s&&await x.confirm(n("comp.uncollectConfirm",{name:d.name}),n("comp.uncollect"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=q.service({fullscreen:!0});V.v1Comp.compcontrollerCollect({compId:d._id,isCollect:s}).then(()=>{X.success(d.isCollect?n("message.success.uncollect"):n("message.success.collect"));const m={...d,isCollect:s};s?t.updateCompListItemById(d._id,{...m,collectCount:d.collectCount+1}):(t.updateCompListItemById(d._id,{...m,collectCount:d.collectCount-1}),e.get(S.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(d._id))}).finally(()=>{i.close()})}return{onCollect:p}}const Xe=(C="")=>{if(!C)throw new Error("createTeamHomeStore scopeId is required");return ie(`teamHome_${C}`,{state:()=>({teamDetail:{},loading:!1,selectedRows:[],selectedRowsToLeafNodeMap:{},dataSourceCopy:[],canSaveCopy:!1}),getters:{teamName:e=>e.teamDetail.name,creator:e=>({nickname:e.teamDetail?.creatorId?.nickname||e.teamDetail?.creatorId?.account||"",avatar:e.teamDetail?.creatorId?.avatar||""}),creatorNickname:e=>e.teamDetail?.creatorNickname||"",memberCount:e=>e.teamDetail?.memberCount||0,compCount:e=>e.teamDetail?.compCount||0,totalDownloadCount:e=>e.teamDetail?.totalDownloadCount||0,isCreator:e=>e.teamDetail.isCreator,isMember:e=>e.teamDetail.isMember,isOutMember:e=>!e.teamDetail.isCreator&&!e.teamDetail.isMember,description:e=>e.teamDetail.description||"",isPublic:e=>e.teamDetail.isPublic,isApplyNeedAudit:e=>e.teamDetail.isApplyNeedAudit,isAllowCompAuthorDelete:e=>e.teamDetail.isAllowCompAuthorDelete,isShowRepeatComp:e=>e.teamDetail.isShowRepeatComp,code:e=>e.teamDetail.code||"",menuGroup:e=>e.teamDetail.menuGroup||[]},actions:{setCanSaveCopy(e){this.$patch(t=>{t.canSaveCopy=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setTeamDetail(e){this.$patch(t=>{t.teamDetail=e})},setSelectedRows(e){this.$patch(t=>{t.selectedRows=e})},setDataSourceCopy(e){this.$patch(t=>{t.dataSourceCopy=e})},setSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap=e})},addSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap={...t.selectedRowsToLeafNodeMap,...e}})},delSelectedRowsToLeafNodeMap(e){this.$patch(t=>{const n={...t.selectedRowsToLeafNodeMap};e.forEach(p=>{delete n[p]}),t.selectedRowsToLeafNodeMap=n})},getSelectedGroupLeafNodes(e=""){return e?Fe.getTreeAllChildren(this.menuGroup,e).filter(n=>n.children?.length===0).map(n=>n.id):[]}}})};function Je(){const{isLogin:C}=me(),e=N(S.PROVIDE_KEY_CALLBACKS),t=N(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b(),{headers:p,teamId:_}=ke();async function r(s){const d=q.service({fullscreen:!0});try{if(!C())return;const i=t.list.find(f=>f._id===s);if(!i){console.error("组件不存在");return}if(!i.name){console.error("组件名称不能为空");return}if(await x.confirm(n("comp.deleteConfirm",{name:i.name}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(_){const f=Xe(_)();await V.v1Team.teamcontrollerRemovemyteamcomp({compIds:[s]},{headers:p}).then(()=>{t.delCompListById(s),f.setTeamDetail({...f.teamDetail,compCount:f.teamDetail.compCount-1}),e.get(S.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)})}else await V.v1Comp.compcontrollerDeletemycomp({compId:s}).then(()=>{t.delCompListById(s),e.get(S.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)});X.success(n("message.success.delete"))}finally{d.close()}}return{onDelete:r}}function Qe(C){const e=A(),t=N(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function p(r){if(!t.isRemote)return;const s=q.service({lock:!0,text:n("comp.downloading")});try{if(await x.confirm(n("comp.downloadPathConfirm",{path:r.path}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=t.list.find(E=>E._id===e.value?.id);if(!i)return;const m=await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",version:e.value?.version??""}),{isRepeat:f=!1}=m.data;if(f){if(await x.confirm(n("comp.downloadCoverConfirm",{name:i.name??""}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){s.close();return}await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",isCover:!0,version:e.value?.version??""})}X.success(n("message.success.download")),t.updateCompListItemById(i._id,{totalDownloadCount:i.totalDownloadCount+1}),await _(i._id),C?.()}finally{s.close()}}async function _(r){const s=M(r)(),d=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:[r]}),{compInfos:i=[]}=d.data,m=i.filter(f=>f.id===r);s.setLocalCompInfo(m)}return{currDownloadCompItem:e,affirmDownload:p}}const Ze=["src"],Ct=se({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(C,{expose:e,emit:t}){const n=C,p=t,{t:_,locale:r}=b(),s=N(S.PROVIDE_KEY_COMP_LIST_STORE),d=K(),i=re(),m=He(!1,window.__GLOBAL_CONFIG__.subPort),f=Ue(!1,window.__GLOBAL_CONFIG__.subPort),E=Ve(),h=E.value,{instanceUid:D,messageListener:P,sendMessageToTargetIframe:g}=Ye(),{createIframeParams:pe}=We(),{addListener:I}=P(),{openCompPathInVscode:de,handlePath:ue}=le(),J=be(),k=oe("iframe"),Q=oe("dialogVueFinder"),{onCollect:fe}=qe(),{onDelete:_e}=Je(),{currDownloadCompItem:Ce,affirmDownload:Z}=Qe(()=>Q.value?.close()),j=A(0),ee=A({}),Te=(()=>{const o={topOrigin:window.location.origin,compType:n.compType,userId:i.userId??"",instanceUid:[D.value,n.iuid].filter(Boolean).join(",")??""},a=new URLSearchParams({params:pe(o),isDark:h.toString()}).toString();return`${m}/${S.WEBSITE_PATH_CONTAINER}/${n.compType}/?${a}`})(),Ee=O(()=>j.value?{height:`${j.value}px`}:{});function $(o){try{const a=k.value?.contentWindow;if(a)return a[o]}catch(a){console.log("findIframeByCompId error",a.message)}return null}async function Ie(o){if(!s.isLocal)return;const a=s.list.find(U=>U._id===o);if(!a)return;const c=G(o)(),{data:u}=await v.v1Comp.compcontrollerDep({compPath:a.path}),{thirdParty:T}=u;c.setDep(T);const L=T.map(U=>U.name),w=await v.v1Module.modulecontrollerPrebuild({deps:L}),{entryNameToFile:F={}}=w.data;c.setDepToFile(F)}async function Le(o){const a=s.list.find(c=>c._id===o);if(a){const c=$(o);if(c&&s.isRemote){await ne(a);const u=M(a._id)(),T=u.depEntryNameToFile[a.version],L=u.versionToFileAccessPath[a.version],w={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};g(c,l.ITEM_INIT_SET,w,f)}}}function he(o){o.forEach(a=>{const c=$(a._id);c&&s.isRemote&&ne(a).then(()=>{const u=M(a._id)(),T=u.depEntryNameToFile[a.version],L=u.versionToFileAccessPath[a.version],w={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};g(c,l.ITEM_INIT_SET,w,f)})})}async function Se(o){const a=s.list.find(c=>c._id===o);if(a){const c=$(o);if(c){await Ie(o);const u=G(o)(),{dep:T,depToFile:L}=u,w={item:a,dep:T,depToFile:L};g(c,l.ITEM_INIT_SET_LOCAL,w,f)}}}function H(o,a,c){const u=k.value?.contentWindow;return u?(g(u,o,a,c),!0):!1}function we(o,a,c){const u=k.value?.contentWindow;if(!u)return;const T=u.length??0;for(let L=0;L<T;L++){const w=u[L];w&&g(w,o,a,c)}}function R(o,a,c,u){const T=u?.origin??m;I(o,()=>{const{stopWatch:L,triggerCallback:w}=ae(c,()=>{const F=u?.transform?u.transform(c.value):c.value;if(H(a,F,T)){u?.onAfterSend?.(F);return}L()});w()})}function ve(o,a){if(a){const c=$(a);c&&o(c)}else o(k.value?.contentWindow)}return R(l.LIST_INIT_GET,l.LIST_INIT,O(()=>s.list)),R(l.SETTING_DATA_GET,l.SETTING_DATA_SET,O(()=>d.deps)),R(l.ITEM_SITE_PATH_GET,l.ITEM_SITE_PATH_SET,O(()=>s.list),{transform:o=>o.map(a=>{const c=G(a._id)();return{compId:a._id,fullPath:ue(c.detail.fullPath,1)}})}),R(l.LOCALE_GET,l.LOCALE_SET,O(()=>r.value),{origin:f}),R(l.THEME_CHANGE_GET,l.THEME_CHANGE_SET,O(()=>E.value),{transform:o=>({isDark:o}),origin:m,onAfterSend:o=>we(l.THEME_CHANGE_SET,o,f)}),I(l.ACTION_COLLECT,fe),I(l.ACTION_DOWNLOAD,async o=>{const{version:a}=o;Ce.value=o,await x.confirm(_("comp.downloadVersionConfirm",{version:a}),_("common.info"),{confirmButtonText:_("common.confirm"),cancelButtonText:_("common.cancel"),type:"warning"}).catch(()=>{})==="confirm"&&Q.value?.open(Z)}),I(l.ACTION_PREVIEW,o=>{p("preview",o)}),I(l.ACTION_PREVIEW_LOCAL,o=>{p("previewLocal",o)}),I(l.ACTION_UPDATE,o=>{p("update",o)}),I(l.UPDATE_IFRAME_HEIGHT,o=>{j.value=o}),I(l.ITEM_INIT_GET,o=>{Le(o)}),I(l.ITEM_INIT_GET_LOCAL,o=>{Se(o)}),I(l.ACTION_DELETE,_e),I(l.ITEM_VERSION_CHANGE,async o=>{const{compId:a,version:c}=o,T=M(a)().detail[c];if(T){const{totalDownloadCount:et,collectCount:tt,isCollect:ot,...De}=T;s.updateCompListItemById(a,{...De,_id:a});return}const{data:L}=await V.v1Comp.compcontrollerCompdetail({compId:a,version:c}),{totalDownloadCount:w,collectCount:F,isCollect:U,...ge}=L;s.updateCompListItemById(a,{...ge,_id:a})}),I(l.ITEM_VERSION_LIST_GET,async o=>{let a=ee.value[o];a||(a=(await V.v1Comp.compcontrollerVersions({compId:o})).data.rows??[],ee.value[o]=a),H(l.ITEM_VERSION_LIST_SET,{compId:o,versionList:a},m)}),I(l.LOCAL_EXIST_GET,o=>{const a=M(o)(),{stopWatch:c,triggerCallback:u}=ae(O(()=>a.isLocalExist),T=>{H(l.LOCAL_EXIST_SET,{compId:T,exist:a.isLocalExist},m)||c()});u(o)}),I(l.ACTION_OPEN_VSCODE_LOCAL,o=>{const c=G(o)().detail.fullPath;de(c,`./${S.COMP_CONFIG_FILENAME}`)}),I(l.OSS_FILE_SIGN_URL_GET,async({objectId:o})=>{let a=J.getCacheUrl(o);a||(a=(await v.v1Oss.osscontrollerFilesignurl({objectId:o})).data.signUrl,J.setCacheUrl(o,a)),H(l.OSS_FILE_SIGN_URL_SET,{objectId:o,signUrl:a},m)}),Ae(()=>s.list,(o,a)=>{const{modifiedItems:c}=Be.findChangedArrayItems(o,a);he(c)},{deep:!0}),e({sendMessageToTargetIframeByCompId:ve}),(o,a)=>(ce(),Ne("div",{style:Pe(Ee.value),class:"min-h-[390px]"},[Y(y($e),{isEmpty:y(s).isEmpty,loading:y(s).loading,class:"size-full"},{default:W(()=>[B("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:y(Te),frameborder:"0"},null,8,Ze)]),_:1},8,["isEmpty","loading"]),Y(ze,{ref:"dialogVueFinder",onDownload:y(Z)},null,8,["onDownload"])],4))}});export{ze as _,Ct as a,Xe as b,_t as c};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D4mf-9oL.js","assets/vendor-ui-CmoKJ_4A.js","assets/vendor-core-B-Si3WEf.js","assets/index-BnpZ3Duk.js","assets/index-JFePecD_.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{v as se,aA as b,ab as ce,j as ye,aO as W,i as B,r as Y,ax as y,ap as te,q as Me,u as Oe,af as N,w as ie,H as A,aF as oe,aM as Ne,l as Ae,$ as Pe,g as O}from"./vendor-core-B-Si3WEf.js";import{p as z,c as M}from"./index-DGdf8eP2.js";import{l as Re,A as K,s as v,_ as S,M as re,v as V,V as Fe,N as Be}from"./index-BnpZ3Duk.js";import{c as G}from"./useCompMetaLocalStore-pb1Ikkq3.js";import{C as Ge,I as x,D as q,H as X,aw as Ve}from"./vendor-ui-CmoKJ_4A.js";/* empty css */import{u as le}from"./useVscodeOpen-B7qurnVy.js";import{_ as xe}from"./BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js";import{u as be}from"./useCacheOssStore-CU4a8b24.js";import{u as ke}from"./useTeamHeaders-DELMIzHt.js";import{_ as $e}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-C8xBMnWg.js";import{u as He,c as Ue,b as We,I as l,a as ae,e as Ye}from"./useMessage-CNq7TVBk.js";const Ke={class:"flex justify-between items-center"},je={class:"h-[65vh]"},ze=se({__name:"index",setup(C,{expose:e}){const{t}=b(),n=Oe(()=>Re(()=>import("./index-D4mf-9oL.js"),__vite__mapDeps([0,1,2,3,4]))),{openCompPathInVscode:p}=le(),{cwd:_}=window.__GLOBAL_CONFIG__,r=N(!1),s=N(null),d=N(_);function i(){p(d.value,"./package.json")}const m=h=>{r.value=!0,s.value=h},f=()=>{r.value=!1,s.value=null},E=h=>{s.value&&s.value(h)};return e({open:m,close:f}),(h,D)=>{const P=Ge;return ce(),ye(y(xe),{modelValue:r.value,"onUpdate:modelValue":D[0]||(D[0]=g=>r.value=g),width:"50%","show-close":""},{header:W(()=>[B("div",Ke,[B("span",null,[B("span",null,te(y(t)("file.projectPath"))+":",1),Y(P,{href:"javascript:void(0)",type:"primary",underline:"always",title:d.value,class:"truncate",onClick:i},{default:W(()=>[Me(te(d.value),1)]),_:1},8,["title"])])])]),default:W(()=>[B("div",je,[Y(y(n),{onSelect:E})])]),_:1},8,["modelValue"])}}}),_t=(C,e)=>ie(`compListStore_${C}`,{state:()=>({scopeId:C,list:[],localList:[],loading:!1,listType:e??S.COMP_LIST_TYPE_REMOTE}),getters:{isEmpty:t=>t.list.length===0,isRemote:t=>t.listType===S.COMP_LIST_TYPE_REMOTE,isLocal:t=>t.listType===S.COMP_LIST_TYPE_LOCAL},actions:{setLocalList(t){this.$patch(n=>{n.localList=t})},setLoading(t){this.$patch(n=>{n.loading=t})},setList(t){this.$patch(n=>{n.list=t})},delCompListById(t){this.$patch(n=>{n.list=n.list.filter(p=>p._id!==t)})},updateCompListItemById(t,n){this.$patch(p=>{p.list=p.list.map(_=>{if(_._id===t){const r={..._,...n};return M(t)().setDetail(r.version,r),r}return _})})},async getListDeps(t){const n=K(),r=t.map(i=>i.dep).map(i=>z(i,n.deps)).reduce((i,m)=>[...i,...m],[]).map(i=>i.name),s=await v.v1Module.modulecontrollerPrebuild({deps:[...new Set(r)]}),{entryNameToFile:d={}}=s.data;return d},async initCompMetas(t){const n=K(),p=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:t.map(s=>s._id)}),{compInfos:_=[]}=p.data,r=await this.getListDeps(t);t.forEach(s=>{const i=z(s.dep,n.deps).reduce((E,h)=>(r[h.name]&&(E[h.name]=r[h.name]),E),{}),m=M(s._id)();m.setLatestVersion(s.version),m.setDetail(s.version,s);const f=_.filter(E=>E.id===s._id);m.setLocalCompInfo(f),m.setDepEntryNameToFile(s.version,i)})},async initCompMetasLocal(t){t.forEach(n=>{G(n._id)().setDetail(n)})},async renderList(t){t.length&&(this.isRemote?await this.initCompMetas(t):await this.initCompMetasLocal(t)),this.setList(t)}}});async function ne(C){const e=K();async function t(i){const{objectId:m,version:f,files:E}=i,h={objectId:m,version:f,files:E.map(g=>g.path)},D=await v.v1Comp.compcontrollerCompfilesosssignedurl(h),{signedUrls:P}=D.data;return P}async function n(i){const{dep:m}=i,f=z(m,e.deps).map(D=>D.name),E=await v.v1Module.modulecontrollerPrebuild({deps:f}),{entryNameToFile:h={}}=E.data;return h}const{version:p,_id:_}=C,r=M(_)();let s=null,d=null;r.versionToFileAccessPath[p]||(s=await t(C),r.setVersionToFileAccessPath(p,s)),r.depEntryNameToFile[p]||(d=await n(C),r.setDepEntryNameToFile(p,d))}const me=()=>{const C=re();function e(){const t=C.isRealUserLogin();return t||C.logoutDialog(),t}return{isLogin:e}};function qe(){const{isLogin:C}=me(),e=A(S.PROVIDE_KEY_CALLBACKS),t=A(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function p(_){if(!C()||!t.isRemote)return;const{id:r,isCollect:s}=_,d=t.list.find(m=>m._id===r);if(!d||!s&&await x.confirm(n("comp.uncollectConfirm",{name:d.name}),n("comp.uncollect"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=q.service({fullscreen:!0});V.v1Comp.compcontrollerCollect({compId:d._id,isCollect:s}).then(()=>{X.success(d.isCollect?n("message.success.uncollect"):n("message.success.collect"));const m={...d,isCollect:s};s?t.updateCompListItemById(d._id,{...m,collectCount:d.collectCount+1}):(t.updateCompListItemById(d._id,{...m,collectCount:d.collectCount-1}),e.get(S.COMP_METHOD_KEY_AFTER_COMP_CANCEL_COLLECT)?.(d._id))}).finally(()=>{i.close()})}return{onCollect:p}}const Xe=(C="")=>{if(!C)throw new Error("createTeamHomeStore scopeId is required");return ie(`teamHome_${C}`,{state:()=>({teamDetail:{},loading:!1,selectedRows:[],selectedRowsToLeafNodeMap:{},dataSourceCopy:[],canSaveCopy:!1}),getters:{teamName:e=>e.teamDetail.name,creator:e=>({nickname:e.teamDetail?.creatorId?.nickname||e.teamDetail?.creatorId?.account||"",avatar:e.teamDetail?.creatorId?.avatar||""}),creatorNickname:e=>e.teamDetail?.creatorNickname||"",memberCount:e=>e.teamDetail?.memberCount||0,compCount:e=>e.teamDetail?.compCount||0,totalDownloadCount:e=>e.teamDetail?.totalDownloadCount||0,isCreator:e=>e.teamDetail.isCreator,isMember:e=>e.teamDetail.isMember,isOutMember:e=>!e.teamDetail.isCreator&&!e.teamDetail.isMember,description:e=>e.teamDetail.description||"",isPublic:e=>e.teamDetail.isPublic,isApplyNeedAudit:e=>e.teamDetail.isApplyNeedAudit,isAllowCompAuthorDelete:e=>e.teamDetail.isAllowCompAuthorDelete,isShowRepeatComp:e=>e.teamDetail.isShowRepeatComp,code:e=>e.teamDetail.code||"",menuGroup:e=>e.teamDetail.menuGroup||[]},actions:{setCanSaveCopy(e){this.$patch(t=>{t.canSaveCopy=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setTeamDetail(e){this.$patch(t=>{t.teamDetail=e})},setSelectedRows(e){this.$patch(t=>{t.selectedRows=e})},setDataSourceCopy(e){this.$patch(t=>{t.dataSourceCopy=e})},setSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap=e})},addSelectedRowsToLeafNodeMap(e){this.$patch(t=>{t.selectedRowsToLeafNodeMap={...t.selectedRowsToLeafNodeMap,...e}})},delSelectedRowsToLeafNodeMap(e){this.$patch(t=>{const n={...t.selectedRowsToLeafNodeMap};e.forEach(p=>{delete n[p]}),t.selectedRowsToLeafNodeMap=n})},getSelectedGroupLeafNodes(e=""){return e?Fe.getTreeAllChildren(this.menuGroup,e).filter(n=>n.children?.length===0).map(n=>n.id):[]}}})};function Je(){const{isLogin:C}=me(),e=A(S.PROVIDE_KEY_CALLBACKS),t=A(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b(),{headers:p,teamId:_}=ke();async function r(s){const d=q.service({fullscreen:!0});try{if(!C())return;const i=t.list.find(f=>f._id===s);if(!i){console.error("组件不存在");return}if(!i.name){console.error("组件名称不能为空");return}if(await x.confirm(n("comp.deleteConfirm",{name:i.name}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;if(_){const f=Xe(_)();await V.v1Team.teamcontrollerRemovemyteamcomp({compIds:[s]},{headers:p}).then(()=>{t.delCompListById(s),f.setTeamDetail({...f.teamDetail,compCount:f.teamDetail.compCount-1}),e.get(S.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)})}else await V.v1Comp.compcontrollerDeletemycomp({compId:s}).then(()=>{t.delCompListById(s),e.get(S.COMP_METHOD_KEY_AFTER_COMP_DEL)?.(s)});X.success(n("message.success.delete"))}finally{d.close()}}return{onDelete:r}}function Qe(C){const e=N(),t=A(S.PROVIDE_KEY_COMP_LIST_STORE),{t:n}=b();async function p(r){if(!t.isRemote)return;const s=q.service({lock:!0,text:n("comp.downloading")});try{if(await x.confirm(n("comp.downloadPathConfirm",{path:r.path}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm")return;const i=t.list.find(E=>E._id===e.value?.id);if(!i)return;const m=await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",version:e.value?.version??""}),{isRepeat:f=!1}=m.data;if(f){if(await x.confirm(n("comp.downloadCoverConfirm",{name:i.name??""}),n("common.info"),{confirmButtonText:n("common.confirm"),cancelButtonText:n("common.cancel"),type:"warning"}).catch(()=>{})!=="confirm"){s.close();return}await v.v1Comp.compcontrollerDownload({compId:e.value?.id??"",savePath:r.path,compName:i.name??"",isCover:!0,version:e.value?.version??""})}X.success(n("message.success.download")),t.updateCompListItemById(i._id,{totalDownloadCount:i.totalDownloadCount+1}),await _(i._id),C?.()}finally{s.close()}}async function _(r){const s=M(r)(),d=await v.v1Comp.compcontrollerLocalcompsbyids({compIds:[r]}),{compInfos:i=[]}=d.data,m=i.filter(f=>f.id===r);s.setLocalCompInfo(m)}return{currDownloadCompItem:e,affirmDownload:p}}const Ze=["src"],Ct=se({__name:"index",props:{compType:{},iuid:{default:-1}},emits:["preview","previewLocal","update"],setup(C,{expose:e,emit:t}){const n=C,p=t,{t:_,locale:r}=b(),s=A(S.PROVIDE_KEY_COMP_LIST_STORE),d=K(),i=re(),m=He(!1,window.__GLOBAL_CONFIG__.subPort),f=Ue(!1,window.__GLOBAL_CONFIG__.subPort),E=Ve(),h=E.value,{instanceUid:D,messageListener:P,sendMessageToTargetIframe:g}=Ye(),{createIframeParams:pe}=We(),{addListener:I}=P(),{openCompPathInVscode:de,handlePath:ue}=le(),J=be(),k=oe("iframe"),Q=oe("dialogVueFinder"),{onCollect:fe}=qe(),{onDelete:_e}=Je(),{currDownloadCompItem:Ce,affirmDownload:Z}=Qe(()=>Q.value?.close()),j=N(0),ee=N({}),Te=(()=>{const o={topOrigin:window.location.origin,compType:n.compType,userId:i.userId??"",instanceUid:[D.value,n.iuid].filter(Boolean).join(",")??""},a=new URLSearchParams({params:pe(o),isDark:h.toString()}).toString();return`${m}/${S.WEBSITE_PATH_CONTAINER}/${n.compType}/?${a}`})(),Ee=O(()=>j.value?{height:`${j.value}px`}:{});function $(o){try{const a=k.value?.contentWindow;if(a)return a[o]}catch(a){console.log("findIframeByCompId error",a.message)}return null}async function Ie(o){if(!s.isLocal)return;const a=s.list.find(U=>U._id===o);if(!a)return;const c=G(o)(),{data:u}=await v.v1Comp.compcontrollerDep({compPath:a.path}),{thirdParty:T}=u;c.setDep(T);const L=T.map(U=>U.name),w=await v.v1Module.modulecontrollerPrebuild({deps:L}),{entryNameToFile:F={}}=w.data;c.setDepToFile(F)}async function Le(o){const a=s.list.find(c=>c._id===o);if(a){const c=$(o);if(c&&s.isRemote){await ne(a);const u=M(a._id)(),T=u.depEntryNameToFile[a.version],L=u.versionToFileAccessPath[a.version],w={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};g(c,l.ITEM_INIT_SET,w,f)}}}function he(o){o.forEach(a=>{const c=$(a._id);c&&s.isRemote&&ne(a).then(()=>{const u=M(a._id)(),T=u.depEntryNameToFile[a.version],L=u.versionToFileAccessPath[a.version],w={item:a,depEntryNameToFile:T,versionToFileAccessPath:L};g(c,l.ITEM_INIT_SET,w,f)})})}async function Se(o){const a=s.list.find(c=>c._id===o);if(a){const c=$(o);if(c){await Ie(o);const u=G(o)(),{dep:T,depToFile:L}=u,w={item:a,dep:T,depToFile:L};g(c,l.ITEM_INIT_SET_LOCAL,w,f)}}}function H(o,a,c){const u=k.value?.contentWindow;return u?(g(u,o,a,c),!0):!1}function we(o,a,c){const u=k.value?.contentWindow;if(!u)return;const T=u.length??0;for(let L=0;L<T;L++){const w=u[L];w&&g(w,o,a,c)}}function R(o,a,c,u){const T=u?.origin??m;I(o,()=>{const{stopWatch:L,triggerCallback:w}=ae(c,()=>{const F=u?.transform?u.transform(c.value):c.value;if(H(a,F,T)){u?.onAfterSend?.(F);return}L()});w()})}function ve(o,a){if(a){const c=$(a);c&&o(c)}else o(k.value?.contentWindow)}return R(l.LIST_INIT_GET,l.LIST_INIT,O(()=>s.list)),R(l.SETTING_DATA_GET,l.SETTING_DATA_SET,O(()=>d.deps)),R(l.ITEM_SITE_PATH_GET,l.ITEM_SITE_PATH_SET,O(()=>s.list),{transform:o=>o.map(a=>{const c=G(a._id)();return{compId:a._id,fullPath:ue(c.detail.fullPath,1)}})}),R(l.LOCALE_GET,l.LOCALE_SET,O(()=>r.value),{origin:f}),R(l.THEME_CHANGE_GET,l.THEME_CHANGE_SET,O(()=>E.value),{transform:o=>({isDark:o}),origin:m,onAfterSend:o=>we(l.THEME_CHANGE_SET,o,f)}),I(l.ACTION_COLLECT,fe),I(l.ACTION_DOWNLOAD,async o=>{const{version:a}=o;Ce.value=o,await x.confirm(_("comp.downloadVersionConfirm",{version:a}),_("common.info"),{confirmButtonText:_("common.confirm"),cancelButtonText:_("common.cancel"),type:"warning"}).catch(()=>{})==="confirm"&&Q.value?.open(Z)}),I(l.ACTION_PREVIEW,o=>{p("preview",o)}),I(l.ACTION_PREVIEW_LOCAL,o=>{p("previewLocal",o)}),I(l.ACTION_UPDATE,o=>{p("update",o)}),I(l.UPDATE_IFRAME_HEIGHT,o=>{j.value=o}),I(l.ITEM_INIT_GET,o=>{Le(o)}),I(l.ITEM_INIT_GET_LOCAL,o=>{Se(o)}),I(l.ACTION_DELETE,_e),I(l.ITEM_VERSION_CHANGE,async o=>{const{compId:a,version:c}=o,T=M(a)().detail[c];if(T){const{totalDownloadCount:et,collectCount:tt,isCollect:ot,...De}=T;s.updateCompListItemById(a,{...De,_id:a});return}const{data:L}=await V.v1Comp.compcontrollerCompdetail({compId:a,version:c}),{totalDownloadCount:w,collectCount:F,isCollect:U,...ge}=L;s.updateCompListItemById(a,{...ge,_id:a})}),I(l.ITEM_VERSION_LIST_GET,async o=>{let a=ee.value[o];a||(a=(await V.v1Comp.compcontrollerVersions({compId:o})).data.rows??[],ee.value[o]=a),H(l.ITEM_VERSION_LIST_SET,{compId:o,versionList:a},m)}),I(l.LOCAL_EXIST_GET,o=>{const a=M(o)(),{stopWatch:c,triggerCallback:u}=ae(O(()=>a.isLocalExist),T=>{H(l.LOCAL_EXIST_SET,{compId:T,exist:a.isLocalExist},m)||c()});u(o)}),I(l.ACTION_OPEN_VSCODE_LOCAL,o=>{const c=G(o)().detail.fullPath;de(c,`./${S.COMP_CONFIG_FILENAME}`)}),I(l.OSS_FILE_SIGN_URL_GET,async({objectId:o})=>{let a=J.getCacheUrl(o);a||(a=(await v.v1Oss.osscontrollerFilesignurl({objectId:o})).data.signUrl,J.setCacheUrl(o,a)),H(l.OSS_FILE_SIGN_URL_SET,{objectId:o,signUrl:a},m)}),Ne(()=>s.list,(o,a)=>{const{modifiedItems:c}=Be.findChangedArrayItems(o,a);he(c)},{deep:!0}),e({sendMessageToTargetIframeByCompId:ve}),(o,a)=>(ce(),Ae("div",{style:Pe(Ee.value),class:"min-h-[390px]"},[Y(y($e),{isEmpty:y(s).isEmpty,loading:y(s).loading,class:"size-full"},{default:W(()=>[B("iframe",{ref:"iframe",class:"size-full min-h-[390px]",src:y(Te),frameborder:"0"},null,8,Ze)]),_:1},8,["isEmpty","loading"]),Y(ze,{ref:"dialogVueFinder",onDownload:y(Z)},null,8,["onDownload"])],4))}});export{ze as _,Ct as a,Xe as b,_t as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as x,m as D,_ as C,v as B}from"./index-
|
|
1
|
+
import{f as x,m as D,_ as C,v as B}from"./index-BnpZ3Duk.js";import{e as w,f as z,az as $,r as L}from"./vendor-ui-CmoKJ_4A.js";import{v as k,aA as g,ab as o,j as l,aO as c,l as E,ai as I,k as _,i as y,ap as h,ax as a,r as v,Z as M,af as S,aC as A,aD as O,ac as T,a7 as N,a9 as V,aF as P,p as K,q as b,g as j}from"./vendor-core-B-Si3WEf.js";/* empty css */import{_ as F}from"./index.vue_vue_type_style_index_0_lang-vmUTBf-P.js";import{u as R}from"./useTeamHeaders-DELMIzHt.js";import{c as H,a as U}from"./index.vue_vue_type_script_setup_true_lang-CwhJTB8k.js";const Y={class:"flex items-center justify-between px-3 py-2 select-none"},q={class:"text-sm font-medium"},Z={class:"flex gap-[6px]"},G={key:0,class:"flex-1 p-2 overflow-auto"},J=k({__name:"BasePane",props:{title:{type:String,default:""},actions:{type:Array,default:()=>["close","maximize","minimize"]}},emits:["close","maximize","minimize"],setup(t,{emit:i}){const{t:p}=g(),m=t,n=i,e=S(!1),d=S(!1);function f(){n("close")}function u(){e.value=!e.value,n("maximize",e.value)}function s(r){return m.actions.includes(r)}return(r,ee)=>(o(),l(a(z),{"body-class":"pane-body","header-class":"pane-header",class:M(["pane-card w-full h-full",{"pane-maximized":e.value}])},{header:c(()=>[y("div",Y,[y("div",q,h(t.title),1),y("div",Z,[I(r.$slots,"beforeActions",{},void 0,!0),s("close")?(o(),l(a(w),{key:0,type:"primary",circle:"",onClick:f},{default:c(()=>[v(a(x),{icon:"material-symbols:close"})]),_:1})):_("",!0),s("maximize")?(o(),l(a(w),{key:1,type:"primary",circle:"",title:a(p)("common.maximizeRestore"),onClick:u},{default:c(()=>[e.value?(o(),l(a(x),{key:1,icon:"material-symbols:fullscreen-exit"})):(o(),l(a(x),{key:0,icon:"material-symbols:fullscreen"}))]),_:1},8,["title"])):_("",!0)])])]),default:c(()=>[d.value?_("",!0):(o(),E("div",G,[I(r.$slots,"default",{isMaximized:e.value},void 0,!0)]))]),_:3},8,["class"]))}}),re=D(J,[["__scopeId","data-v-d200bc08"]]),Q={class:"min-h-[400px]"},W=k({__name:"index",setup(t){const i=A(),p=O(),{compId:m}=i.params,{headers:n}=R(),e=H(i.path)();T(C.PROVIDE_KEY_COMP_LIST_STORE,e);const d=new Map;T(C.PROVIDE_KEY_CALLBACKS,d);const f=async()=>{if(e.setLoading(!0),!m)return;const s=await B.v1Comp.compcontrollerSimilarcomps({compId:m},{headers:n}),{rows:r}=s.data||{};await e.renderList(r),e.setLoading(!1)};function u(s){p.push({path:`/preview/${s}`})}return N(()=>{f()}),V(()=>{e.$reset()}),(s,r)=>(o(),E("div",Q,[v(U,{compType:a(C).IFRAME_ROUTES.CONTAINER.SIMILAR,onPreview:u},null,8,["compType"])]))}}),X={ref:"similarComp",class:"mt-[10px] overflow-hidden"},le=k({__name:"index",props:{mdSrc:{type:String,default:""},compDesc:{type:String,default:""},scrollContainer:{type:String,default:""},stickyTopDistance:{type:Number,default:45},showSimilarComp:{type:Boolean,default:!0}},setup(t){const{t:i}=g(),{teamId:p}=R(),m=j(()=>i(p?"team.similarCompInTeam":"team.similarComp")),n=S(!1),e=P("similarComp");return $(e,([d])=>{n.value||(n.value=d?.isIntersecting||!1)}),(d,f)=>{const u=L,s=z;return o(),l(F,{showToc:!0,src:t.mdSrc,scrollContainer:t.scrollContainer,stickyTopDistance:t.stickyTopDistance},K({empty:c(()=>[b(h(t.compDesc||a(i)("common.noReadme")),1)]),_:2},[t.showSimilarComp?{name:"footer",fn:c(()=>[y("div",X,[v(u,{"content-position":"center"},{default:c(()=>[b(h(m.value),1)]),_:1}),v(s,{"body-class":"!p-1",class:"mt-[10px]"},{default:c(()=>[n.value?(o(),l(W,{key:0})):_("",!0)]),_:1})],512)]),key:"0"}:void 0]),1032,["src","scrollContainer","stickyTopDistance"])}}});export{re as B,le as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aw as y,f as $,l as F,C as V}from"./vendor-ui-CmoKJ_4A.js";import{M as D,_ as f}from"./index-BnpZ3Duk.js";/* empty css *//* empty css */import{v as O,aF as G,aM as R,ab as x,l as k,i as a,ax as m,g as z,aA as B,r as i,aO as g,ap as d,q as M}from"./vendor-core-B-Si3WEf.js";import{c as v}from"./useCompMetaLocalStore-pb1Ikkq3.js";import{u as w}from"./useVscodeOpen-B7qurnVy.js";import{c as U,b as W,I as l,a as H,e as j}from"./useMessage-CNq7TVBk.js";import{_ as q}from"./PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js";const Y={class:"size-full"},J=["src"],K=O({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{}},setup(t){const s=t,u=D(),c=U(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:I,messageListener:S,sendMessageToTargetIframe:E}=j(),{addListener:r}=S(),{createIframeParams:h}=W(),{openCompPathInVscode:A,handlePath:T}=w(),b=y().value,L=G("iframe"),N=(()=>{const e={topOrigin:window.location.origin,userId:u.userId??"",instanceUid:[I.value,s.iuid].join(",")??"",compId:s.compAttrs?._id??"",isSfc:!0},o={params:h(e),isDark:b.toString()},n=new URLSearchParams(o).toString();return`${c}/${f.WEBSITE_PATH_ITEM}/${s.compType}?${n}`})();async function P(){const e=L.value?.contentWindow;if(e){const o=v(s.compAttrs?._id)(),{dep:n,depToFile:p}=o,_={item:s.compAttrs,dep:n,depToFile:p};E(e,l.ITEM_INIT_SET_LOCAL,_,c)}}return r(l.ITEM_INIT_GET_LOCAL,()=>{P()}),r(l.ITEM_SITE_PATH_GET,e=>{const o=v(e)(),{stopWatch:n,triggerCallback:p}=H(z(()=>o.detail.fullPath),()=>{const _=L.value?.contentWindow;_?E(_,l.ITEM_SITE_PATH_SET,T(o.detail.fullPath,1),c):n()});p(e)}),r(l.ACTION_OPEN_VSCODE_LOCAL,e=>{const n=v(e)().detail.fullPath;A(n,`./${f.COMP_CONFIG_FILENAME}`)}),R(()=>s.compAttrs,e=>{e&&P()}),(e,o)=>(x(),k("div",Y,[a("iframe",{ref:"iframe",class:"size-full",src:m(N),frameborder:"0"},null,8,J)]))}}),Q={class:"size-full overflow-hidden flex flex-col"},X={class:"size-full"},Z={class:"flex items-center"},ee={class:"flex-1"},te={class:"text-xs ml-auto"},pe=O({__name:"index",props:{version:{},compAttrs:{}},setup(t){const{openCompPathInVscode:s}=w(),u=t,{t:c}=B();function I(){s(u.compAttrs.fullPath,`./${f.COMP_CONFIG_FILENAME}`)}return(S,E)=>{const r=$,h=F,A=V;return x(),k("div",Q,[i(m(q),{class:"size-full flex-1 shrink-0 flex flex-col gap-1",bg:t.compAttrs?.bgColor},{default:g(({bg:T,updateColor:C})=>[i(r,{"body-class":"!p-0 !overflow-visible",class:"flex-1 relative z-10"},{default:g(()=>[a("div",X,[i(K,{compAttrs:t.compAttrs,version:t.version,compType:m(f).IFRAME_ROUTES.ITEM.CAROUSEL_LOCAL},null,8,["compAttrs","version","compType"])])]),_:1}),a("div",Z,[a("div",ee,[a("span",null,d(t.compAttrs?.version),1)]),a("span",te,[a("span",null,d(m(c)("comp.bgPanel"))+":",1),i(h,{teleported:!0,modelValue:T,clearable:"",onChange:C,onActiveChange:C},null,8,["modelValue","onChange","onActiveChange"])])])]),_:1},8,["bg"]),a("div",null,[M(d(m(c)("comp.compLocation"))+": ",1),i(A,{href:"javascript:void(0)",type:"primary",underline:"always",onClick:I},{default:g(()=>[M(d(t.compAttrs.fullPath),1)]),_:1})])])}}});export{pe as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a1 as y,aw as G,f as W,l as F}from"./vendor-ui-CmoKJ_4A.js";import{n as j,_ as i,p as P,m as z,A as V,M as B,g as U}from"./index-BnpZ3Duk.js";/* empty css */import{v as R,aA as x,ab as u,j as I,ax as c,aO as C,r as S,Z as v,l as b,k as N,q as k,ap as f,F as J,ah as K,g as h,aF as X,aM as q,i as A}from"./vendor-core-B-Si3WEf.js";import{c as Z}from"./index-DGdf8eP2.js";import{c as Q,b as ee,I as p,a as w,e as se}from"./useMessage-CNq7TVBk.js";import{_ as te}from"./PanelBackground.vue_vue_type_script_setup_true_lang-CM6wkI5V.js";const ae=R({__name:"CompDepsTags",props:{compDeps:{},depsSetting:{}},setup(l){const{t:n}=x(),E=l,d=h(()=>{const t=new Map;return E.depsSetting?.forEach(e=>{t.set(e.name,e)}),t});function g(t,e){const s=e.match;try{switch(s){case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return!0;case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:{const a=P.parseVersion(t),o=P.parseVersion(e.version);return a.major===o.major}case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:{const a=P.parseVersion(t),o=P.parseVersion(e.version);return a.major===o.major&&a.minor===o.minor}case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:{const a=P.parseVersion(t),o=P.parseVersion(e.version);return a.major===o.major&&a.minor===o.minor&&a.patch===o.patch}default:return!1}}catch(a){return console.warn(`Version parse failed: ${t} or ${e.version}`,a),!1}}function _(t){const e=d.value.get(t.name);return e?g(t.version,e):!1}function T(t){const e=d.value.get(t.name);if(!e||!g(t.version,e))return"";switch(e.match){case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_ONLY_INSTALL:return"match-dot-green";case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MAJOR_VERSION:return"match-dot-blue";case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_MINOR_VERSION:return"match-dot-orange";case i.COMP_MATCH_TYPES.COMP_MATCH_TYPE_EXACT_VERSION:return"match-dot-red";default:return""}}return(t,e)=>(u(),I(c(j),{list:l.compDeps,getKey:s=>s.name,class:"flex items-center gap-1"},{display:C(({visibleList:s,overflow:a})=>[(u(!0),b(J,null,K(s,o=>(u(),I(c(y),{key:o.name,type:"info","disable-transitions":"",size:"small",class:v({"not-matched":!_(o)})},{default:C(()=>[T(o)?(u(),b("span",{key:0,class:v(["inline-block w-2 h-2 rounded-full mr-1",T(o)])},null,2)):N("",!0),k(" "+f(o.name)+" "+f(o.version),1)]),_:2},1032,["class"]))),128)),a>0?(u(),I(c(y),{key:0,type:"info",size:"small","disable-transitions":""},{default:C(()=>[k("+"+f(a)+" "+f(c(n)("common.more")),1)]),_:2},1024)):N("",!0)]),measure:C(({item:s})=>[S(c(y),{type:"info",size:"small","disable-transitions":"",class:v({"not-matched":!_(s)})},{default:C(()=>[T(s)?(u(),b("span",{key:0,class:v(["inline-block w-2 h-2 rounded-full mr-1",T(s)])},null,2)):N("",!0),k(" "+f(s.name)+" "+f(s.version),1)]),_:2},1032,["class"])]),_:1},8,["list","getKey"]))}}),oe=z(ae,[["__scopeId","data-v-01610d58"]]),ne={class:"size-full"},re=["src"],ce=R({__name:"index",props:{compType:{},version:{},compAttrs:{},iuid:{},bgColor:{}},setup(l){const n=l,{locale:E}=x(),d=V(),g=B(),_=Q(!1,window.__GLOBAL_CONFIG__.subPort),{instanceUid:T,messageListener:t,sendMessageToTargetIframe:e}=se(),{addListener:s}=t(),{createIframeParams:a}=ee(),H=G().value,O=X("iframe"),D=(()=>{const r={topOrigin:window.location.origin,userId:g.userId??"",instanceUid:[T.value,n.iuid].join(",")??"",compId:n.compAttrs?._id??"",isSfc:!0},m={params:a(r),isDark:H.toString()},M=new URLSearchParams(m).toString();return`${_}/${i.WEBSITE_PATH_ITEM}/${n.compType}?${M}`})();async function L(){const r=O.value?.contentWindow;if(r){const m=Z(n.compAttrs?._id)(),M=m.depEntryNameToFile[n.version],Y=m.versionToFileAccessPath[n.version],$={item:n.compAttrs,depEntryNameToFile:M,versionToFileAccessPath:Y};e(r,p.ITEM_INIT_SET,$,_)}}return s(p.ITEM_INIT_GET,()=>{L()}),s(p.SETTING_DATA_GET,w(h(()=>d.deps),()=>{const r=O.value?.contentWindow;r&&e(r,p.SETTING_DATA_SET,d.deps,_)}).triggerCallback),s(p.LOCALE_GET,()=>{const{stopWatch:r,triggerCallback:m}=w(h(()=>E.value),()=>{const M=O.value?.contentWindow;M?e(M,p.LOCALE_SET,E.value,_):r()});m()}),s(p.BG_COLOR_GET,w(h(()=>n.bgColor??""),()=>{const r=O.value?.contentWindow;r&&e(r,p.BG_COLOR_SET,n.bgColor??"",_)}).triggerCallback),q([()=>n.version,()=>n.compAttrs],async([r,m])=>{r&&m&&L()}),(r,m)=>(u(),b("div",ne,[A("iframe",{ref:"iframe",class:"size-full",src:c(D),frameborder:"0"},null,8,re)]))}}),ie={class:"size-full"},le={class:"flex items-center"},_e={class:"flex-1"},me={class:"text-xs ml-auto"},ge=R({__name:"index",props:{version:{type:String,default:""},compAttrs:{type:Object,default:()=>({})}},setup(l){const n=l,{t:E}=x(),d=V(),g=h(()=>U.handleDepData(n.compAttrs.dep??[]));return(_,T)=>{const t=W,e=F;return u(),I(c(te),{class:"size-full flex-1 shrink-0 flex flex-col gap-1",bg:l.compAttrs?.bgColor},{default:C(({bg:s,updateColor:a})=>[S(t,{"body-class":"!p-0 !overflow-visible",class:"flex-1 relative z-10"},{default:C(()=>[A("div",ie,[S(ce,{compAttrs:l.compAttrs,version:l.version,bgColor:s,compType:c(i).IFRAME_ROUTES.ITEM.PREVIEW_REMOTE},null,8,["compAttrs","version","bgColor","compType"])])]),_:2},1024),A("div",le,[A("div",_e,[S(c(oe),{compDeps:g.value,depsSetting:c(d).deps},null,8,["compDeps","depsSetting"])]),A("span",me,[A("span",null,f(c(E)("comp.bgPanel"))+":",1),S(e,{teleported:!0,modelValue:s,clearable:"",onChange:a,onActiveChange:a},null,8,["modelValue","onChange","onActiveChange"])])])]),_:1},8,["bg"])}}});export{ge as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{J as ee,C as te,U as oe,aA as ae,aC as se,e as le,I as B,H as y}from"./vendor-ui-CmoKJ_4A.js";import{_ as m,b as ne,s as I,v as F,O as N,g as ce}from"./index-BnpZ3Duk.js";import{C as re}from"./useCompEditStore-BaMFNGpl.js";import{c as ie}from"./index-DGdf8eP2.js";import{u as pe}from"./useTeamHeaders-DELMIzHt.js";/* empty css */import{v as A,aB as me,ab as v,j as x,aO as f,l as H,F as de,ah as ue,ax as d,i as $,ap as D,r as L,aR as fe,q as Y,W as he,aA as Ce,H as ve,aP as _e,Z as ge,X as Pe,af as b,g as k,B as Ee,Y as Ue}from"./vendor-core-B-Si3WEf.js";import{u as ye}from"./useVscodeOpen-B7qurnVy.js";import{_ as Ie}from"./BaseDialog.vue_vue_type_script_setup_true_lang-CPKWysZj.js";import{v as Te}from"./v4-EwEgHOG0.js";const we={class:"flex items-center justify-between"},Oe=["title"],Se=A({__name:"index",props:he({options:{type:Array,default:()=>[]},placeholderText:{type:String,default:""},openInVscodeText:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const{openCompPathInVscode:T,handlePath:_}=ye(),c=me(u,"modelValue"),g=u;function w(r){const e=g.options.find(i=>i.fullPath===r);e&&T(e.fullPath,`./${m.COMP_CONFIG_FILENAME}`)}function P(r){c.value=r}return(r,e)=>{const i=te,h=ee,O=oe;return v(),x(O,{"model-value":c.value,placeholder:u.placeholderText,onChange:P},{default:f(()=>[(v(!0),H(de,null,ue(u.options,p=>(v(),x(h,{key:p.value,label:d(_)(p.fullPath),value:p.value},{default:f(()=>[$("div",we,[$("span",{title:p.fullPath},D(d(_)(p.fullPath)),9,Oe),L(i,{type:"primary",href:"javascript:void(0)",onClick:[e[0]||(e[0]=fe(()=>{},["stop"])),V=>w(p.fullPath)]},{default:f(()=>[Y(D(u.openInVscodeText),1)]),_:1},8,["onClick"])])]),_:2},1032,["label","value"]))),128))]),_:1},8,["model-value","placeholder"])}}}),$e=A({__name:"index",emits:["updateSuccess"],setup(u,{expose:T,emit:_}){const{t:c}=Ce(),g=_,{headers:w,teamId:P}=pe(),r=ae(ne,!1),e=ve(m.PROVIDE_KEY_COMP_EDIT_STORE),i=b(!1),h=b(!0),O=k(()=>{const o=e.selectedFolder?.basename,t=e.compDetail?.name??"";return o?`${c("comp.compOnlineUpdate")}:${t}`:`${c("comp.compOfflineUpdate")}:${t}`}),p=k(()=>({title:O.value,fullscreen:r.value,top:"5vh",width:"70%"}));async function V(o){h.value=!0;try{const t=await I.v1Comp.compcontrollerLocalcompsbyids({compIds:[o]}),{compInfos:a}=t.data;if(a?.length){let s=a[0];if(a.length>1&&(s=await j(a),!s))return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_ONLINE),i.value=!0,e.setSelectedFolder(s),await M(o,s.path)}else{if(await B.confirm(c("comp.compNotInLocal"),c("common.info"),{type:"warning"}).catch(()=>{})!=="confirm")return;e.setCompUpdateType(m.COMP_UPDATE_TYPE_OFFLINE),i.value=!0,await M(o)}}catch(t){console.error(t),y.error(t.message)}finally{h.value=!1}}async function j(o){const t=o.map(n=>({value:n.fullPathHash,label:n.fullPath,fullPath:n.fullPath})),a=b("");return await B({title:c("comp.selectUpdateFolder"),customClass:"select-message",message:()=>Ee(Se,{modelValue:a.value,"onUpdate:modelValue":n=>a.value=n,options:t,placeholderText:c("comp.selectUpdateFolder"),openInVscodeText:c("comp.openInVscode")}),beforeClose:(n,C,E)=>{if(n==="confirm"){if(!a.value){y.error(c("comp.selectUpdateFolder"));return}E()}else E()}}).catch(()=>{})!=="confirm"?void 0:o.find(n=>n.fullPathHash===a.value)}function S(){i.value=!1}function W(){e.$reset()}function z(o,t){const a=l=>{if(!l?.length||!o)return"";const n=Te(),C=ce.getPreviewUrl(o,l);return`${m.COMP_PREVIEW_PREFIX_LOCAL}/${C}?v=${n}`};return t.map(l=>({...l,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a(l.miniPath),fullEntryUrl:a(l.fullPath)}))}function X(o,t){const a=new Map(o.map(({path:s,signedUrl:l})=>[s,l]));return t.map(s=>{const l=N.replaceBackslashWithSlash(s.miniPath.at(-1)??""),n=N.replaceBackslashWithSlash(s.fullPath?.at(-1)??"");return{...s,activeTab:m.COMP_EDIT_TAB_TYPE_MINI,miniEntryUrl:a.get(l)??"",fullEntryUrl:a.get(n)??""}})}async function M(o,t){e.setLoading(!0);const a=await F.v1Comp.compcontrollerCompdetail({compId:o}),{desc:s,previewConfigs:l,bgColor:n,dep:C,name:E,version:K}=a.data||{};if(e.setCompDetail(a.data),e.setOnlineCompDep(C),e.setCompBgColor(n??"#fff"),e.setExtraInfo({description:s,name:E}),e.setEditCompId(o),e.isOnlineUpdate&&t){const R=await F.v1Comp.compcontrollerComphash({compId:o}),U=await I.v1Comp.compcontrollerCompfilehash({compPath:t}),Z=await I.v1Comp.compcontrollerDep({compPath:t}),{thirdParty:Q}=Z.data;e.setCompDep(Q),e.setLocalCompHash(U.data.compHash),e.setRemoteCompHash(R.data.compHash),e.setPreviewCompList(z(t,l))}else{const U=ie(o)().versionToFileAccessPath[K]??[];e.setSignedUrls(U),e.setPreviewCompList(X(U,l)),e.setCompDep(C)}e.setLoading(!1)}function q({end:o}){const t=e.getCompSubmitParams();if(e.isOnlineUpdate)I.v1Comp.compcontrollerUpdate({compId:e.editCompId,...t,...P?{teamId:P}:{}}).then(()=>{y.success(c("message.success.update")),g("updateSuccess",e.editCompId),S()}).finally(()=>{o()});else if(e.isOfflineUpdate){const{name:a,desc:s,bgColor:l,previewConfigs:n}=t;F.v1Comp.compcontrollerUpdatebasicinfo({compId:e.editCompId,name:a,desc:s,bgColor:l,previewConfigs:n},{headers:w}).then(()=>{y.success(c("message.success.update")),g("updateSuccess",e.editCompId),S()}).finally(()=>{o()})}}async function G(){r.value=!r.value}async function J(){const o=e.editCompId,t=e.selectedFolder,a=e.compUpdateType;e.$reset(),await Ue(),e.setCompUpdateType(a),e.setSelectedFolder(t),M(o,t.path)}return T({open:V,close:S}),(o,t)=>{const a=le,s=se;return v(),x(d(Ie),Pe({modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),class:"comp-update-dialog"},p.value,{"destroy-on-close":"","show-close":"",onClose:W}),{footer:f(()=>[L(a,{onClick:G},{default:f(()=>[Y(D(d(r)?d(c)("common.exitFullscreen"):d(c)("common.fullscreen")),1)]),_:1})]),default:f(()=>[_e((v(),H("div",{class:ge(d(r)?"size-full":"h-[70vh]")},[L(re,{class:"h-full",onConfirmUpload:q,onReload:J})],2)),[[s,h.value]])]),_:1},16,["modelValue"])}}});export{$e as _};
|