comp-hub 0.1.19 → 0.1.21

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.
Files changed (45) hide show
  1. package/bin/cli.cjs +77 -0
  2. package/dist/index.js +1 -1
  3. package/dist/website/dist/assets/{atom-one-dark-k3s8nS4Q.js → atom-one-dark-B2H-r86L.js} +1 -1
  4. package/dist/website/dist/assets/{index-Gk0AmvhA.js → index-4kzrJosw.js} +1 -1
  5. package/dist/website/dist/assets/{index-BnJyLrXy.js → index-BfqhDZ1z.js} +1 -1
  6. package/dist/website/dist/assets/{index-eLdJqQqm.js → index-BrnVzb3E.js} +1 -1
  7. package/dist/website/dist/assets/{index-DCQCk6Lt.js → index-CPx4gS-Z.js} +1 -1
  8. package/dist/website/dist/assets/{index-BlL2Tdlj.js → index-CUKBRQJT.js} +1 -1
  9. package/dist/website/dist/assets/{index-B08_yIdo.js → index-Cfid4FBF.js} +1 -1
  10. package/dist/website/dist/assets/{index-D3Uaxo2f.js → index-D8NW2qZW.js} +1 -1
  11. package/dist/website/dist/assets/{index-Bg1sSD0h.js → index-DDURCXIZ.js} +1 -1
  12. package/dist/website/dist/assets/{index-BzYZrqYN.js → index-DNxTJC5Q.js} +1 -1
  13. package/dist/website/dist/assets/{index-BwfgYRqy.js → index-DS9olnsn.js} +1 -1
  14. package/dist/website/dist/assets/{index-B6bJejXz.js → index-DhTRF1Cu.js} +1 -1
  15. package/dist/website/dist/assets/{index-BPH0o3O-.js → index-DuJUC7Nj.js} +1 -1
  16. package/dist/website/dist/assets/{index-C5AGoQL2.js → index-J0Dg-l9h.js} +1 -1
  17. package/dist/website/dist/assets/{index-DxJFvPw9.css → index-XTZOLvZN.css} +1 -1
  18. package/dist/website/dist/assets/{index-BulG_yUH.js → index-YOgOWiS9.js} +1 -1
  19. package/dist/website/dist/assets/{index-BCju3w1f.js → index-cHbH7T5D.js} +12 -12
  20. package/dist/website/dist/assets/{index-BmdNO1MZ.js → index-nDiFvJw_.js} +1 -1
  21. package/dist/website/dist/assets/index-qsWrHMBc.js +1 -0
  22. package/dist/website/dist/assets/{index-CwOHeTUF.js → index-szn1X1M8.js} +1 -1
  23. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-Cdma1D5V.js → index.vue_vue_type_script_setup_true_lang-BMtIwDs3.js} +1 -1
  24. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-B6qjGW9b.js → index.vue_vue_type_script_setup_true_lang-C2jCrlom.js} +1 -1
  25. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-DZI9cQ6F.js → index.vue_vue_type_script_setup_true_lang-Cj1ig2OS.js} +1 -1
  26. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js → index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js} +1 -1
  27. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-mv_g4rJC.js → index.vue_vue_type_script_setup_true_lang-Deq2IwpY.js} +1 -1
  28. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-BcrKTT6J.js → index.vue_vue_type_script_setup_true_lang-RtjuxFdx.js} +1 -1
  29. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-KBVOs3Yx.js → index.vue_vue_type_script_setup_true_lang-mjupg3Z_.js} +3 -3
  30. package/dist/website/dist/assets/{index.vue_vue_type_script_setup_true_lang-DZ8ULnqr.js → index.vue_vue_type_script_setup_true_lang-s3TpsvnW.js} +1 -1
  31. package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-D5mLFRCT.js → index.vue_vue_type_style_index_0_lang-BVuL5ED4.js} +1 -1
  32. package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js → index.vue_vue_type_style_index_0_lang-CVT5yNeL.js} +1 -1
  33. package/dist/website/dist/assets/{index.vue_vue_type_style_index_0_lang-DZzA4x8F.js → index.vue_vue_type_style_index_0_lang-Dhu78hQ_.js} +1 -1
  34. package/dist/website/dist/assets/{md5-gsIWVbtJ.js → md5-CejJMKeR.js} +1 -1
  35. package/dist/website/dist/assets/{moment-Q0xdD-i8.js → moment-DYVhN5eu.js} +1 -1
  36. package/dist/website/dist/assets/useCompEditStore-C3L6eIoz.js +1 -0
  37. package/dist/website/dist/assets/{useCompEditStore-Z_9v-nSk.css → useCompEditStore-Dca_66Tn.css} +1 -1
  38. package/dist/website/dist/assets/{useTeamHeaders-3AldZ0JH.js → useTeamHeaders-22mJVwWy.js} +1 -1
  39. package/dist/website/dist/assets/{v1Keyword-CTrvQOnq.js → v1Keyword-JxL-DecN.js} +1 -1
  40. package/dist/website/dist/assets/{v1Module-BPYVWmkw.js → v1Module-Clll6gmK.js} +1 -1
  41. package/dist/website/dist/index.html +2 -2
  42. package/package.json +6 -4
  43. package/bin/cli.js +0 -15
  44. package/dist/website/dist/assets/index-gOrnUHC4.js +0 -1
  45. package/dist/website/dist/assets/useCompEditStore-DxIY6W80.js +0 -1
@@ -1,2 +1,2 @@
1
- import{d as v,i as b,x as y,y as k,c as l,a as n,f as s,o as d,v as C,z as S,A as w,r as m,b as o,p,w as i,_ as V,t as f,u as a,F as h,B}from"./index-BCju3w1f.js";import{H as $}from"./atom-one-dark-k3s8nS4Q.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-BcrKTT6J.js";import"./index-BnJyLrXy.js";const D={class:"code-container"},H={ref:"code",class:"language-json"},N=v({__name:"index",props:{code:{}},setup(g){const c=g,e=b("code"),u=()=>{e.value&&(e.value.textContent=c.code,$.highlightElement(e.value))};return y(u),k(()=>c.code,()=>{u()}),(t,r)=>(d(),l("div",D,[n("pre",null,[r[0]||(r[0]=s(" ",-1)),n("code",H,null,512),r[1]||(r[1]=s(`
1
+ import{d as v,i as b,x as y,y as k,c as l,a as n,f as s,o as d,v as C,z as S,A as w,r as m,b as o,p,w as i,_ as V,t as f,u as a,F as h,B}from"./index-cHbH7T5D.js";import{H as $}from"./atom-one-dark-B2H-r86L.js";import{_ as z}from"./index.vue_vue_type_script_setup_true_lang-RtjuxFdx.js";import"./index-BfqhDZ1z.js";const D={class:"code-container"},H={ref:"code",class:"language-json"},N=v({__name:"index",props:{code:{}},setup(g){const c=g,e=b("code"),u=()=>{e.value&&(e.value.textContent=c.code,$.highlightElement(e.value))};return y(u),k(()=>c.code,()=>{u()}),(t,r)=>(d(),l("div",D,[n("pre",null,[r[0]||(r[0]=s(" ",-1)),n("code",H,null,512),r[1]||(r[1]=s(`
2
2
  `,-1))])]))}}),U=C(N,[["__scopeId","data-v-71136191"]]),F={class:"relative"},j={class:"absolute inset-0 bg-[#fff] border border-[#ccc] rounded-sm max-w-[1000px] mx-auto p-[10px] min-h-[100vh] overflow-auto"},E={class:"flex items-center gap-[5px]"},R={key:0,class:"h-[100px] flex items-center justify-center text-[#ccc]"},T={class:"flex items-center gap-[5px]"},A={class:"text-[14px] whitespace-pre-line leading-5"},G=v({__name:"index",setup(g){const c=S(),e=w();return(u,t)=>{const r=m("router-link"),_=m("el-tag"),x=m("el-divider");return d(),l("div",F,[o(z),n("div",j,[n("div",E,[o(r,{to:"/"},{default:i(()=>[o(V,{logoClass:"h-[30px] mt-[40px] mb-[40px]"})]),_:1}),o(_,{type:"info",round:"",size:"small"},{default:i(()=>[s(f(a(c).compHubVersion),1)]),_:1})]),a(e).hasUpgrade?p("",!0):(d(),l("div",R,"暂无更新")),a(e).upgradeDesc?(d(),l(h,{key:1},[o(x,{"content-position":"center"},{default:i(()=>[n("div",T,[t[0]||(t[0]=s(" 新版功能 ",-1)),o(_,{type:"info",round:"",size:"small"},{default:i(()=>[s(f(a(e).latestVersion),1)]),_:1})])]),_:1}),n("p",A,f(a(e).upgradeDesc),1)],64)):p("",!0),a(e).isUpgrade?(d(),l(h,{key:2},[o(x,{"content-position":"center"},{default:i(()=>[...t[1]||(t[1]=[s(" 更新方式 ",-1)])]),_:1}),t[3]||(t[3]=n("div",{class:"mb-[10px]"},[s(" 更新 "),n("span",{class:"font-bold"},"comp-hub"),s(" 请回到项目根目录,打开终端,执行以下命令: ")],-1)),a(e).isForceUpgrade?(d(),B(_,{key:0,type:"danger",round:"",size:"small"},{default:i(()=>[...t[2]||(t[2]=[s(" 不可忽略此次更新 ",-1)])]),_:1})):p("",!0),o(U,{code:"npm install comp-hub@latest -D",language:"bash"})],64)):p("",!0)])])}}});export{G as default};
@@ -1,4 +1,4 @@
1
- import{c0 as fn,c1 as Zt,c2 as mn,aU as Ze,H as zo,c3 as Ao,c4 as Lo,bK as zt,c5 as Oo,c6 as _o,c7 as Eo}from"./index-BCju3w1f.js";var $o="[object String]";function Mo(e){return typeof e=="string"||!Zt(e)&&fn(e)&&mn(e)==$o}var Io="[object Boolean]";function Po(e){return e===!0||e===!1||fn(e)&&mn(e)==Io}var No="[object Number]";function jo(e){return typeof e=="number"||fn(e)&&mn(e)==No}const ke=0,b=1,S=2,j=3,I=4,le=5,vt=6,W=7,K=8,z=9,v=10,P=11,C=12,N=13,Qe=14,Q=15,G=16,H=17,Y=18,ne=19,ae=20,_=21,x=22,q=23,te=24,B=25,Ro=0;function F(e){return e>=48&&e<=57}function xe(e){return F(e)||e>=65&&e<=70||e>=97&&e<=102}function gn(e){return e>=65&&e<=90}function Do(e){return e>=97&&e<=122}function Fo(e){return gn(e)||Do(e)}function Bo(e){return e>=128}function ft(e){return Fo(e)||Bo(e)||e===95}function Wr(e){return ft(e)||F(e)||e===45}function qo(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function mt(e){return e===10||e===13||e===12}function Ce(e){return mt(e)||e===32||e===9}function de(e,t){return!(e!==92||mt(t)||t===Ro)}function ct(e,t,n){return e===45?ft(t)||t===45||de(t,n):ft(e)?!0:e===92?de(e,t):!1}function At(e,t,n){return e===43||e===45?F(t)?2:t===46&&F(n)?3:0:e===46?F(t)?2:0:F(e)?1:0}function Gr(e){return e===65279||e===65534?1:0}const Jt=new Array(128),Uo=128,ut=130,Hr=131,bn=132,Vr=133;for(let e=0;e<Jt.length;e++)Jt[e]=Ce(e)&&ut||F(e)&&Hr||ft(e)&&bn||qo(e)&&Vr||e||Uo;function Lt(e){return e<128?Jt[e]:bn}function $e(e,t){return t<e.length?e.charCodeAt(t):0}function en(e,t,n){return n===13&&$e(e,t+1)===10?2:1}function Me(e,t,n){let r=e.charCodeAt(t);return gn(r)&&(r=r|32),r===n}function Ge(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){const o=r.charCodeAt(i-t);let a=e.charCodeAt(i);if(gn(a)&&(a=a|32),a!==o)return!1}return!0}function Wo(e,t){for(;t>=0&&Ce(e.charCodeAt(t));t--);return t+1}function Je(e,t){for(;t<e.length&&Ce(e.charCodeAt(t));t++);return t}function Ot(e,t){for(;t<e.length&&F(e.charCodeAt(t));t++);return t}function Ie(e,t){if(t+=2,xe($e(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&xe($e(e,t));t++);const n=$e(e,t);Ce(n)&&(t+=en(e,t,n))}return t}function et(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Wr(n)){if(de(n,$e(e,t+1))){t=Ie(e,t)-1;continue}break}}return t}function wt(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),F(n)&&(t=Ot(e,t+1),n=e.charCodeAt(t)),n===46&&F(e.charCodeAt(t+1))&&(t+=2,t=Ot(e,t)),Me(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),F(n)&&(t=Ot(e,t+1+r+1))}return t}function _t(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}de(n,$e(e,t+1))&&(t=Ie(e,t))}return t}function Kr(e){if(e.length===1&&!xe(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const Qr=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"],Go=16*1024;function gt(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,Go)):e}const En=10,Ho=12,$n=13;function Mn(e){const t=e.source,n=t.length,r=t.length>0?Gr(t.charCodeAt(0)):0,i=gt(e.lines,n),o=gt(e.columns,n);let a=e.startLine,u=e.startColumn;for(let c=r;c<n;c++){const s=t.charCodeAt(c);i[c]=a,o[c]=u++,(s===En||s===$n||s===Ho)&&(s===$n&&c+1<n&&t.charCodeAt(c+1)===En&&(c++,i[c]=a,o[c]=u),a++,u=1)}i[n]=a,o[n]=u,e.lines=i,e.columns=o,e.computed=!0}class Vo{constructor(t,n,r,i){this.setSource(t,n,r,i),this.lines=null,this.columns=null}setSource(t="",n=0,r=1,i=1){this.source=t,this.startOffset=n,this.startLine=r,this.startColumn=i,this.computed=!1}getLocation(t,n){return this.computed||Mn(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,r){return this.computed||Mn(this),{source:r,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const ce=16777215,ue=24,Te=new Uint8Array(32);Te[S]=x;Te[_]=x;Te[ne]=ae;Te[q]=te;function In(e){return Te[e]!==0}class Ko{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const r=t.length,i=gt(this.offsetAndType,t.length+1),o=gt(this.balance,t.length+1);let a=0,u=-1,c=0,s=t.length;this.offsetAndType=null,this.balance=null,o.fill(0),n(t,(l,h,f)=>{const m=a++;if(i[m]=l<<ue|f,u===-1&&(u=h),o[m]=s,l===c){const y=o[s];o[s]=m,s=y,c=Te[i[y]>>ue]}else In(l)&&(s=m,c=Te[l])}),i[a]=ke<<ue|r,o[a]=a;for(let l=0;l<a;l++){const h=o[l];if(h<=l){const f=o[h];f!==l&&(o[l]=f)}else h>a&&(o[l]=a)}this.source=t,this.firstCharOffset=u===-1?0:u,this.tokenCount=a,this.offsetAndType=i,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>ue:ke}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const r=this.offsetAndType[n]>>ue;if(r!==N&&r!==B&&t--===0)return r}return ke}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ce:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const r=this.offsetAndType[n]>>ue;if(r!==N&&r!==B&&t--===0)return n-this.tokenIndex}return ke}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Ge(this.source,this.offsetAndType[t-1]&ce,this.offsetAndType[t]&ce,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ce:this.offsetAndType[this.tokenCount]&ce:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===z&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===z&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&ce,n=this.offsetAndType[n],this.tokenType=n>>ue,this.tokenEnd=n&ce):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>ue,this.tokenEnd=t&ce):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=ke,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===N||this.tokenType===B;)this.next()}skipUntilBalanced(t,n){let r=t,i=0,o=0;e:for(;r<this.tokenCount;r++){if(i=this.balance[r],i<t)break e;switch(o=r>0?this.offsetAndType[r-1]&ce:this.firstCharOffset,n(this.source.charCodeAt(o))){case 1:break e;case 2:r++;break e;default:In(this.offsetAndType[r]>>ue)&&(r=i)}}this.skip(r-this.tokenIndex)}forEachToken(t){for(let n=0,r=this.firstCharOffset;n<this.tokenCount;n++){const i=r,o=this.offsetAndType[n],a=o&ce,u=o>>ue;r=a,t(u,i,a,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,r,i,o)=>{t[o]={idx:o,type:Qr[n],chunk:this.source.substring(r,i),balance:this.balance[o]}}),t}}function St(e,t){function n(h){return h<u?e.charCodeAt(h):0}function r(){if(s=wt(e,s),ct(n(s),n(s+1),n(s+2))){l=C,s=et(e,s);return}if(n(s)===37){l=P,s++;return}l=v}function i(){const h=s;if(s=et(e,s),Ge(e,h,s,"url")&&n(s)===40){if(s=Je(e,s+1),n(s)===34||n(s)===39){l=S,s=h+4;return}a();return}if(n(s)===40){l=S,s++;return}l=b}function o(h){for(h||(h=n(s++)),l=le;s<e.length;s++){const f=e.charCodeAt(s);switch(Lt(f)){case h:s++;return;case ut:if(mt(f)){s+=en(e,s,f),l=vt;return}break;case 92:if(s===e.length-1)break;const m=n(s+1);mt(m)?s+=en(e,s+1,m):de(f,m)&&(s=Ie(e,s)-1);break}}}function a(){for(l=W,s=Je(e,s);s<e.length;s++){const h=e.charCodeAt(s);switch(Lt(h)){case 41:s++;return;case ut:if(s=Je(e,s),n(s)===41||s>=e.length){s<e.length&&s++;return}s=_t(e,s),l=K;return;case 34:case 39:case 40:case Vr:s=_t(e,s),l=K;return;case 92:if(de(h,n(s+1))){s=Ie(e,s)-1;break}s=_t(e,s),l=K;return}}}e=String(e||"");const u=e.length;let c=Gr(n(0)),s=c,l;for(;s<u;){const h=e.charCodeAt(s);switch(Lt(h)){case ut:l=N,s=Je(e,s+1);break;case 34:o();break;case 35:Wr(n(s+1))||de(n(s+1),n(s+2))?(l=I,s=et(e,s+1)):(l=z,s++);break;case 39:o();break;case 40:l=_,s++;break;case 41:l=x,s++;break;case 43:At(h,n(s+1),n(s+2))?r():(l=z,s++);break;case 44:l=Y,s++;break;case 45:At(h,n(s+1),n(s+2))?r():n(s+1)===45&&n(s+2)===62?(l=Q,s=s+3):ct(h,n(s+1),n(s+2))?i():(l=z,s++);break;case 46:At(h,n(s+1),n(s+2))?r():(l=z,s++);break;case 47:n(s+1)===42?(l=B,s=e.indexOf("*/",s+2),s=s===-1?e.length:s+2):(l=z,s++);break;case 58:l=G,s++;break;case 59:l=H,s++;break;case 60:n(s+1)===33&&n(s+2)===45&&n(s+3)===45?(l=Qe,s=s+4):(l=z,s++);break;case 64:ct(n(s+1),n(s+2),n(s+3))?(l=j,s=et(e,s+1)):(l=z,s++);break;case 91:l=ne,s++;break;case 92:de(h,n(s+1))?i():(l=z,s++);break;case 93:l=ae,s++;break;case 123:l=q,s++;break;case 125:l=te,s++;break;case Hr:r();break;case bn:i();break;default:l=z,s++}t(l,c,c=s)}}let ze=null;class D{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return D.createItem(t)}allocateCursor(t,n){let r;return ze!==null?(r=ze,ze=ze.cursor,r.prev=t,r.next=n,r.cursor=this.cursor):r={prev:t,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=ze,ze=t}updateCursors(t,n,r,i){let{cursor:o}=this;for(;o!==null;)o.prev===t&&(o.prev=n),o.next===r&&(o.next=i),o=o.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){const i=D.createItem(r);n!==null?n.next=i:this.head=i,i.prev=n,n=i}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const i=r.next;r.next=i.next,t.call(n,i.data,i,this)}this.releaseCursor()}forEachRight(t,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const i=r.prev;r.prev=i.prev,t.call(n,i.data,i,this)}this.releaseCursor()}reduce(t,n,r=this){let i=this.allocateCursor(null,this.head),o=n,a;for(;i.next!==null;)a=i.next,i.next=a.next,o=t.call(r,o,a.data,a,this);return this.releaseCursor(),o}reduceRight(t,n,r=this){let i=this.allocateCursor(this.tail,null),o=n,a;for(;i.prev!==null;)a=i.prev,i.prev=a.prev,o=t.call(r,o,a.data,a,this);return this.releaseCursor(),o}some(t,n=this){for(let r=this.head;r!==null;r=r.next)if(t.call(n,r.data,r,this))return!0;return!1}map(t,n=this){const r=new D;for(let i=this.head;i!==null;i=i.next)r.appendData(t.call(n,i.data,i,this));return r}filter(t,n=this){const r=new D;for(let i=this.head;i!==null;i=i.next)t.call(n,i.data,i,this)&&r.appendData(i.data);return r}nextUntil(t,n,r=this){if(t===null)return;const i=this.allocateCursor(null,t);for(;i.next!==null;){const o=i.next;if(i.next=o.next,n.call(r,o.data,o,this))break}this.releaseCursor()}prevUntil(t,n,r=this){if(t===null)return;const i=this.allocateCursor(t,null);for(;i.prev!==null;){const o=i.prev;if(i.prev=o.prev,n.call(r,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new D;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(D.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(D.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(D.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(D.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(D.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}}function Ct(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
1
+ import{b_ as fn,b$ as Zt,c0 as mn,aT as Ze,H as zo,c1 as Ao,c2 as Lo,bI as zt,c3 as Oo,c4 as _o,c5 as Eo}from"./index-cHbH7T5D.js";var $o="[object String]";function Mo(e){return typeof e=="string"||!Zt(e)&&fn(e)&&mn(e)==$o}var Io="[object Boolean]";function Po(e){return e===!0||e===!1||fn(e)&&mn(e)==Io}var No="[object Number]";function jo(e){return typeof e=="number"||fn(e)&&mn(e)==No}const ke=0,b=1,S=2,j=3,I=4,le=5,vt=6,W=7,K=8,z=9,v=10,P=11,C=12,N=13,Qe=14,Q=15,G=16,H=17,Y=18,ne=19,ae=20,_=21,x=22,q=23,te=24,B=25,Ro=0;function F(e){return e>=48&&e<=57}function xe(e){return F(e)||e>=65&&e<=70||e>=97&&e<=102}function gn(e){return e>=65&&e<=90}function Do(e){return e>=97&&e<=122}function Fo(e){return gn(e)||Do(e)}function Bo(e){return e>=128}function ft(e){return Fo(e)||Bo(e)||e===95}function Wr(e){return ft(e)||F(e)||e===45}function qo(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function mt(e){return e===10||e===13||e===12}function Ce(e){return mt(e)||e===32||e===9}function de(e,t){return!(e!==92||mt(t)||t===Ro)}function ct(e,t,n){return e===45?ft(t)||t===45||de(t,n):ft(e)?!0:e===92?de(e,t):!1}function At(e,t,n){return e===43||e===45?F(t)?2:t===46&&F(n)?3:0:e===46?F(t)?2:0:F(e)?1:0}function Gr(e){return e===65279||e===65534?1:0}const Jt=new Array(128),Uo=128,ut=130,Hr=131,bn=132,Vr=133;for(let e=0;e<Jt.length;e++)Jt[e]=Ce(e)&&ut||F(e)&&Hr||ft(e)&&bn||qo(e)&&Vr||e||Uo;function Lt(e){return e<128?Jt[e]:bn}function $e(e,t){return t<e.length?e.charCodeAt(t):0}function en(e,t,n){return n===13&&$e(e,t+1)===10?2:1}function Me(e,t,n){let r=e.charCodeAt(t);return gn(r)&&(r=r|32),r===n}function Ge(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){const o=r.charCodeAt(i-t);let a=e.charCodeAt(i);if(gn(a)&&(a=a|32),a!==o)return!1}return!0}function Wo(e,t){for(;t>=0&&Ce(e.charCodeAt(t));t--);return t+1}function Je(e,t){for(;t<e.length&&Ce(e.charCodeAt(t));t++);return t}function Ot(e,t){for(;t<e.length&&F(e.charCodeAt(t));t++);return t}function Ie(e,t){if(t+=2,xe($e(e,t-1))){for(const r=Math.min(e.length,t+5);t<r&&xe($e(e,t));t++);const n=$e(e,t);Ce(n)&&(t+=en(e,t,n))}return t}function et(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(!Wr(n)){if(de(n,$e(e,t+1))){t=Ie(e,t)-1;continue}break}}return t}function wt(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),F(n)&&(t=Ot(e,t+1),n=e.charCodeAt(t)),n===46&&F(e.charCodeAt(t+1))&&(t+=2,t=Ot(e,t)),Me(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),F(n)&&(t=Ot(e,t+1+r+1))}return t}function _t(e,t){for(;t<e.length;t++){const n=e.charCodeAt(t);if(n===41){t++;break}de(n,$e(e,t+1))&&(t=Ie(e,t))}return t}function Kr(e){if(e.length===1&&!xe(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const Qr=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"],Go=16*1024;function gt(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,Go)):e}const En=10,Ho=12,$n=13;function Mn(e){const t=e.source,n=t.length,r=t.length>0?Gr(t.charCodeAt(0)):0,i=gt(e.lines,n),o=gt(e.columns,n);let a=e.startLine,u=e.startColumn;for(let c=r;c<n;c++){const s=t.charCodeAt(c);i[c]=a,o[c]=u++,(s===En||s===$n||s===Ho)&&(s===$n&&c+1<n&&t.charCodeAt(c+1)===En&&(c++,i[c]=a,o[c]=u),a++,u=1)}i[n]=a,o[n]=u,e.lines=i,e.columns=o,e.computed=!0}class Vo{constructor(t,n,r,i){this.setSource(t,n,r,i),this.lines=null,this.columns=null}setSource(t="",n=0,r=1,i=1){this.source=t,this.startOffset=n,this.startLine=r,this.startColumn=i,this.computed=!1}getLocation(t,n){return this.computed||Mn(this),{source:n,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,n,r){return this.computed||Mn(this),{source:r,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const ce=16777215,ue=24,Te=new Uint8Array(32);Te[S]=x;Te[_]=x;Te[ne]=ae;Te[q]=te;function In(e){return Te[e]!==0}class Ko{constructor(t,n){this.setSource(t,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",n=()=>{}){t=String(t||"");const r=t.length,i=gt(this.offsetAndType,t.length+1),o=gt(this.balance,t.length+1);let a=0,u=-1,c=0,s=t.length;this.offsetAndType=null,this.balance=null,o.fill(0),n(t,(l,h,f)=>{const m=a++;if(i[m]=l<<ue|f,u===-1&&(u=h),o[m]=s,l===c){const y=o[s];o[s]=m,s=y,c=Te[i[y]>>ue]}else In(l)&&(s=m,c=Te[l])}),i[a]=ke<<ue|r,o[a]=a;for(let l=0;l<a;l++){const h=o[l];if(h<=l){const f=o[h];f!==l&&(o[l]=f)}else h>a&&(o[l]=a)}this.source=t,this.firstCharOffset=u===-1?0:u,this.tokenCount=a,this.offsetAndType=i,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>ue:ke}lookupTypeNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const r=this.offsetAndType[n]>>ue;if(r!==N&&r!==B&&t--===0)return r}return ke}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ce:this.source.length}lookupOffsetNonSC(t){for(let n=this.tokenIndex;n<this.tokenCount;n++){const r=this.offsetAndType[n]>>ue;if(r!==N&&r!==B&&t--===0)return n-this.tokenIndex}return ke}lookupValue(t,n){return t+=this.tokenIndex,t<this.tokenCount?Ge(this.source,this.offsetAndType[t-1]&ce,this.offsetAndType[t]&ce,n):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ce:this.offsetAndType[this.tokenCount]&ce:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,n){return n?this.lookupType(n)===z&&this.source.charCodeAt(this.lookupOffset(n))===t:this.tokenType===z&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let n=this.tokenIndex+t;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&ce,n=this.offsetAndType[n],this.tokenType=n>>ue,this.tokenEnd=n&ce):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>ue,this.tokenEnd=t&ce):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=ke,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===N||this.tokenType===B;)this.next()}skipUntilBalanced(t,n){let r=t,i=0,o=0;e:for(;r<this.tokenCount;r++){if(i=this.balance[r],i<t)break e;switch(o=r>0?this.offsetAndType[r-1]&ce:this.firstCharOffset,n(this.source.charCodeAt(o))){case 1:break e;case 2:r++;break e;default:In(this.offsetAndType[r]>>ue)&&(r=i)}}this.skip(r-this.tokenIndex)}forEachToken(t){for(let n=0,r=this.firstCharOffset;n<this.tokenCount;n++){const i=r,o=this.offsetAndType[n],a=o&ce,u=o>>ue;r=a,t(u,i,a,n)}}dump(){const t=new Array(this.tokenCount);return this.forEachToken((n,r,i,o)=>{t[o]={idx:o,type:Qr[n],chunk:this.source.substring(r,i),balance:this.balance[o]}}),t}}function St(e,t){function n(h){return h<u?e.charCodeAt(h):0}function r(){if(s=wt(e,s),ct(n(s),n(s+1),n(s+2))){l=C,s=et(e,s);return}if(n(s)===37){l=P,s++;return}l=v}function i(){const h=s;if(s=et(e,s),Ge(e,h,s,"url")&&n(s)===40){if(s=Je(e,s+1),n(s)===34||n(s)===39){l=S,s=h+4;return}a();return}if(n(s)===40){l=S,s++;return}l=b}function o(h){for(h||(h=n(s++)),l=le;s<e.length;s++){const f=e.charCodeAt(s);switch(Lt(f)){case h:s++;return;case ut:if(mt(f)){s+=en(e,s,f),l=vt;return}break;case 92:if(s===e.length-1)break;const m=n(s+1);mt(m)?s+=en(e,s+1,m):de(f,m)&&(s=Ie(e,s)-1);break}}}function a(){for(l=W,s=Je(e,s);s<e.length;s++){const h=e.charCodeAt(s);switch(Lt(h)){case 41:s++;return;case ut:if(s=Je(e,s),n(s)===41||s>=e.length){s<e.length&&s++;return}s=_t(e,s),l=K;return;case 34:case 39:case 40:case Vr:s=_t(e,s),l=K;return;case 92:if(de(h,n(s+1))){s=Ie(e,s)-1;break}s=_t(e,s),l=K;return}}}e=String(e||"");const u=e.length;let c=Gr(n(0)),s=c,l;for(;s<u;){const h=e.charCodeAt(s);switch(Lt(h)){case ut:l=N,s=Je(e,s+1);break;case 34:o();break;case 35:Wr(n(s+1))||de(n(s+1),n(s+2))?(l=I,s=et(e,s+1)):(l=z,s++);break;case 39:o();break;case 40:l=_,s++;break;case 41:l=x,s++;break;case 43:At(h,n(s+1),n(s+2))?r():(l=z,s++);break;case 44:l=Y,s++;break;case 45:At(h,n(s+1),n(s+2))?r():n(s+1)===45&&n(s+2)===62?(l=Q,s=s+3):ct(h,n(s+1),n(s+2))?i():(l=z,s++);break;case 46:At(h,n(s+1),n(s+2))?r():(l=z,s++);break;case 47:n(s+1)===42?(l=B,s=e.indexOf("*/",s+2),s=s===-1?e.length:s+2):(l=z,s++);break;case 58:l=G,s++;break;case 59:l=H,s++;break;case 60:n(s+1)===33&&n(s+2)===45&&n(s+3)===45?(l=Qe,s=s+4):(l=z,s++);break;case 64:ct(n(s+1),n(s+2),n(s+3))?(l=j,s=et(e,s+1)):(l=z,s++);break;case 91:l=ne,s++;break;case 92:de(h,n(s+1))?i():(l=z,s++);break;case 93:l=ae,s++;break;case 123:l=q,s++;break;case 125:l=te,s++;break;case Hr:r();break;case bn:i();break;default:l=z,s++}t(l,c,c=s)}}let ze=null;class D{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return D.createItem(t)}allocateCursor(t,n){let r;return ze!==null?(r=ze,ze=ze.cursor,r.prev=t,r.next=n,r.cursor=this.cursor):r={prev:t,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=ze,ze=t}updateCursors(t,n,r,i){let{cursor:o}=this;for(;o!==null;)o.prev===t&&(o.prev=n),o.next===r&&(o.next=i),o=o.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let n=this.head;n!==null;n=n.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){const i=D.createItem(r);n!==null?n.next=i:this.head=i,i.prev=n,n=i}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const i=r.next;r.next=i.next,t.call(n,i.data,i,this)}this.releaseCursor()}forEachRight(t,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const i=r.prev;r.prev=i.prev,t.call(n,i.data,i,this)}this.releaseCursor()}reduce(t,n,r=this){let i=this.allocateCursor(null,this.head),o=n,a;for(;i.next!==null;)a=i.next,i.next=a.next,o=t.call(r,o,a.data,a,this);return this.releaseCursor(),o}reduceRight(t,n,r=this){let i=this.allocateCursor(this.tail,null),o=n,a;for(;i.prev!==null;)a=i.prev,i.prev=a.prev,o=t.call(r,o,a.data,a,this);return this.releaseCursor(),o}some(t,n=this){for(let r=this.head;r!==null;r=r.next)if(t.call(n,r.data,r,this))return!0;return!1}map(t,n=this){const r=new D;for(let i=this.head;i!==null;i=i.next)r.appendData(t.call(n,i.data,i,this));return r}filter(t,n=this){const r=new D;for(let i=this.head;i!==null;i=i.next)t.call(n,i.data,i,this)&&r.appendData(i.data);return r}nextUntil(t,n,r=this){if(t===null)return;const i=this.allocateCursor(null,t);for(;i.next!==null;){const o=i.next;if(i.next=o.next,n.call(r,o.data,o,this))break}this.releaseCursor()}prevUntil(t,n,r=this){if(t===null)return;const i=this.allocateCursor(t,null);for(;i.prev!==null;){const o=i.prev;if(i.prev=o.prev,n.call(r,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const t=new D;for(let n of this)t.appendData(n);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(D.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(D.createItem(t))}insert(t,n=null){if(n!==null)if(this.updateCursors(n.prev,t,n,t),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=t,n.prev=t,t.next=n,this.updateCursors(null,t)}else n.prev.next=t,t.prev=n.prev,n.prev=t,t.next=n;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,n){return this.insert(D.createItem(t),n)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(D.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(D.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,n){return t.head===null?this:(n!=null?(this.updateCursors(n.prev,t.tail,n,t.head),n.prev!==null?(n.prev.next=t.head,t.head.prev=n.prev):this.head=t.head,n.prev=t.tail,t.tail.next=n):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,n){"head"in n?this.insertList(n,t):this.insert(n,t),this.remove(t)}}function Ct(e,t){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
2
2
  `)}})}const Et=100,Pn=60,Nn=" ";function jn({source:e,line:t,column:n,baseLine:r,baseColumn:i},o){function a(y,L){return s.slice(y,L).map((E,w)=>String(y+w+1).padStart(f)+" |"+E).join(`
3
3
  `)}const u=`
4
4
  `.repeat(Math.max(r-1,0)),c=" ".repeat(Math.max(i-1,0)),s=(u+c+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-o)-1,h=Math.min(t+o,s.length+1),f=Math.max(4,String(h).length)+1;let m=0;n+=(Nn.length-1)*(s[t-1].substr(0,n-1).match(/\t/g)||[]).length,n>Et&&(m=n-Pn+3,n=Pn-2);for(let y=l;y<=h;y++)y>=0&&y<s.length&&(s[y]=s[y].replace(/\t/g,Nn),s[y]=(m>0&&s[y].length>m?"…":"")+s[y].substr(m,Et-2)+(s[y].length>m+Et-1?"…":""));return[a(l,t),new Array(n+f+2).join("-")+"^",a(t,h)].filter(Boolean).join(`
@@ -1 +1 @@
1
- import{a as I,_ as P,b as N}from"./index.vue_vue_type_script_setup_true_lang-B6qjGW9b.js";import{c as z}from"./index-DCQCk6Lt.js";import{d as w,a6 as E,r as b,c as v,F as V,N as F,u as k,B as T,w as c,f as x,t as j,o as u,a5 as g,G as A,g as J,z as M,i as Q,m as G,k as K,y as W,D as X,W as q,X as U,b as l,a as d,Z as y,O as C,P as Y,p as Z,a4 as S}from"./index-BCju3w1f.js";import{d as H}from"./index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js";import{B as ee}from"./index-BzYZrqYN.js";import{k as te}from"./v1Keyword-CTrvQOnq.js";import{_ as oe}from"./index.vue_vue_type_script_setup_true_lang-mv_g4rJC.js";import"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import"./index-BnJyLrXy.js";import"./v1Module-BPYVWmkw.js";const ae={class:"flex justify-start mb-3 gap-5"},se=w({__name:"index",setup(D){const i=E(g.COMP_LIST_STORE);function p(e){return e.value===i.selectTag}const _=e=>{i.setSelectTag(e.value)};return(e,h)=>{const f=b("el-link");return u(),v("div",ae,[(u(!0),v(V,null,F(k(i).tagGroup,s=>(u(),T(f,{type:p(s)?"primary":"default",key:s.label,value:s.value,onClick:m=>_(s)},{default:c(()=>[x(j(s.label),1)]),_:2},1032,["type","value","onClick"]))),128))])}}}),ne={class:"size-full"},le={class:"size-full flex flex-col overflow-hidden"},ie={class:"flex-1 overflow-hidden"},re={class:"flex-1"},ce={class:"flex-1 flex justify-end items-center gap-2"},Ce=w({__name:"index",setup(D){const i=A(),p=J(),_=M(),e=z(i.path)();S(g.COMP_LIST_STORE,e);const h=new Map;S(g.CALLBACKS,h);const f=Q("baseTable"),s=G(()=>{let o="[]";return e.selectTag==="XTTJ"&&(o=JSON.stringify(_?.deps||[])),{tag:e.selectTag,deps:o}}),m=K({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:L,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:$});function L(o,a){if(o.length<=1)return a([]);te({keyword:o,type:"compShare"}).then(n=>{const{keywords:r=[]}=n.data||{};a(r)})}async function $(o){e.setLoading(!0);const a=await H({...s.value,...o}),{rows:n,total:r}=a.data||{};await e.renderList(n||[]),m.value.pagination.total=r||0}function B(o){p.push({path:`/preview/${o._id}`})}function O(o){const{_id:a,totalDownloadCount:n=0}=o;e.updateCompListItemById(a,{totalDownloadCount:n+1})}return W(()=>JSON.stringify(s.value),()=>f.value?.forceRefreshData()),X(()=>{e.$reset()}),(o,a)=>{const n=b("el-link"),r=q("loading");return U((u(),v("div",ne,[l(ee,{tableConfig:m.value,ref:"baseTable"},{table:c(()=>[d("div",le,[l(se),d("div",ie,[l(I,{class:"overflow-y-scroll"},{compItemToolBar:c(({attrs:t})=>[d("div",re,[t._id?(u(),T(N,C(y({key:0},{id:t._id,version:t.version})),null,16)):Z("",!0)])]),compItemFooterOperate:c(({attrs:t})=>[d("div",ce,[l(P,y({id:t._id,name:t.name,version:t.version},{onDownloadSuccess:R=>O(t)}),null,16,["onDownloadSuccess"]),l(n,{type:"primary",onClick:R=>B(t)},{default:c(()=>[...a[0]||(a[0]=[x("预览",-1)])]),_:1},8,["onClick"]),l(oe,C(Y({id:t._id,name:t.name,isCollect:t.isCollect,collectCount:t.collectCount})),null,16)])]),_:1})])])]),_:1},8,["tableConfig"])])),[[r,k(e).loading]])}}});export{Ce as default};
1
+ import{a as I,_ as P,b as N}from"./index.vue_vue_type_script_setup_true_lang-C2jCrlom.js";import{c as z}from"./index-CPx4gS-Z.js";import{d as w,a6 as E,r as b,c as v,F as V,N as F,u as k,B as T,w as c,f as x,t as j,o as u,a5 as g,G as A,g as J,z as M,i as Q,m as G,k as K,y as W,D as X,W as q,X as U,b as l,a as d,Z as y,O as C,P as Y,p as Z,a4 as S}from"./index-cHbH7T5D.js";import{d as H}from"./index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js";import{B as ee}from"./index-DNxTJC5Q.js";import{k as te}from"./v1Keyword-JxL-DecN.js";import{_ as oe}from"./index.vue_vue_type_script_setup_true_lang-Deq2IwpY.js";import"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import"./index-BfqhDZ1z.js";import"./v1Module-Clll6gmK.js";const ae={class:"flex justify-start mb-3 gap-5"},se=w({__name:"index",setup(D){const i=E(g.COMP_LIST_STORE);function p(e){return e.value===i.selectTag}const _=e=>{i.setSelectTag(e.value)};return(e,h)=>{const f=b("el-link");return u(),v("div",ae,[(u(!0),v(V,null,F(k(i).tagGroup,s=>(u(),T(f,{type:p(s)?"primary":"default",key:s.label,value:s.value,onClick:m=>_(s)},{default:c(()=>[x(j(s.label),1)]),_:2},1032,["type","value","onClick"]))),128))])}}}),ne={class:"size-full"},le={class:"size-full flex flex-col overflow-hidden"},ie={class:"flex-1 overflow-hidden"},re={class:"flex-1"},ce={class:"flex-1 flex justify-end items-center gap-2"},Ce=w({__name:"index",setup(D){const i=A(),p=J(),_=M(),e=z(i.path)();S(g.COMP_LIST_STORE,e);const h=new Map;S(g.CALLBACKS,h);const f=Q("baseTable"),s=G(()=>{let o="[]";return e.selectTag==="XTTJ"&&(o=JSON.stringify(_?.deps||[])),{tag:e.selectTag,deps:o}}),m=K({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:L,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:$});function L(o,a){if(o.length<=1)return a([]);te({keyword:o,type:"compShare"}).then(n=>{const{keywords:r=[]}=n.data||{};a(r)})}async function $(o){e.setLoading(!0);const a=await H({...s.value,...o}),{rows:n,total:r}=a.data||{};await e.renderList(n||[]),m.value.pagination.total=r||0}function B(o){p.push({path:`/preview/${o._id}`})}function O(o){const{_id:a,totalDownloadCount:n=0}=o;e.updateCompListItemById(a,{totalDownloadCount:n+1})}return W(()=>JSON.stringify(s.value),()=>f.value?.forceRefreshData()),X(()=>{e.$reset()}),(o,a)=>{const n=b("el-link"),r=q("loading");return U((u(),v("div",ne,[l(ee,{tableConfig:m.value,ref:"baseTable"},{table:c(()=>[d("div",le,[l(se),d("div",ie,[l(I,{class:"overflow-y-scroll"},{compItemToolBar:c(({attrs:t})=>[d("div",re,[t._id?(u(),T(N,C(y({key:0},{id:t._id,version:t.version})),null,16)):Z("",!0)])]),compItemFooterOperate:c(({attrs:t})=>[d("div",ce,[l(P,y({id:t._id,name:t.name,version:t.version},{onDownloadSuccess:R=>O(t)}),null,16,["onDownloadSuccess"]),l(n,{type:"primary",onClick:R=>B(t)},{default:c(()=>[...a[0]||(a[0]=[x("预览",-1)])]),_:1},8,["onClick"]),l(oe,C(Y({id:t._id,name:t.name,isCollect:t.isCollect,collectCount:t.collectCount})),null,16)])]),_:1})])])]),_:1},8,["tableConfig"])])),[[r,k(e).loading]])}}});export{Ce as default};
@@ -1 +1 @@
1
- import{k as I,bQ as k,bR as F,aO as A,u as M,Q as w,z as B,bv as R,j as U,bS as P,bT as N,d as q,ac as z,m as G,aH as O,r as T,B as E,w as S,c as V,F as Q,N as Y,a as j,p as H,Z as y,o as u,v as J}from"./index-BCju3w1f.js";import{m as X}from"./v1Module-BPYVWmkw.js";import{p as $}from"./index-BnJyLrXy.js";import{c as Z,b as K}from"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";function ne(o){const e=I(0),t=typeof o=="string"?I(document.querySelector(o)):o,{y:i}=k(t,{behavior:"auto"});return F(()=>{e.value=M(i)??0}),A(async()=>{setTimeout(()=>{i.value=e.value},0)}),{memoryY:e}}const W=(o="")=>{if(!o)throw new Error("createCompMetaLocalStore scopeId is required");return w(`compMetaLocal_${o}`,{state:()=>({detail:{},dep:{},depToFile:{}}),getters:{},actions:{setDetail(e){this.$patch(t=>{t.detail=e})},setDep(e){this.$patch(t=>{t.dep=e})},setDepToFile(e){this.$patch(t=>{t.depToFile=e})}}})};let p=null;const g="IS_REPLACE",D="IS_ADD",C="IS_DELETE";function v(){p&&(cancelIdleCallback(p),p=null)}function b({list:o,oldList:e=[],render:t}){if(p&&(cancelIdleCallback(p),p=null),o.length===0)return console.warn("列表为空"),()=>{v()};const i=e.filter(c=>!o.some(d=>d._id===c._id));i.length>0&&t(C,i);let s=0;const n=o.length;let l=Date.now();const r=c=>{const d=Date.now()-l>100;if(s<n&&c.timeRemaining()>8||d){l=Date.now();const a=o[s];if(!a)throw new Error("组件列表项无效");e.findIndex(_=>_._id===a._id)>-1?t(g,[a]):t(D,[a]),s++}s<n&&(p=requestIdleCallback(r,{timeout:16.6*2}))};return n>0&&(p=requestIdleCallback(r,{timeout:16.6*2})),()=>{v()}}const le=o=>w(`compListStore_${o}`,{state:()=>({scopeId:o,list:[],localList:[],loading:!1,tagGroup:[...P],selectTag:U(`${N}_${o}`,"XTTJ"),isEmpty:!1}),actions:{setLocalList(e){this.$patch(t=>{t.localList=e})},setSelectTag(e){this.$patch(t=>{t.selectTag=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setIsEmpty(e){this.$patch(t=>{t.isEmpty=e})},setList(e){this.$patch(t=>{t.list=e})},delCompListById(e){this.$patch(t=>{t.list=t.list.filter(i=>i._id!==e)})},updateCompListItemById(e,t){this.$patch(i=>{i.list=i.list.map(s=>s._id===e?{...s,...t}:s)})},idleList(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):b({list:e,oldList:this.list,render:(t,i)=>{this.setLoading(!1),t===D?this.$patch(s=>{i[0]&&s.list.push(i[0])}):t===g?this.$patch(s=>{const n=i[0];if(n){const l=s.list.findIndex(r=>r._id===n._id);l>-1&&(s.list[l]=n)}}):t===C&&this.$patch(s=>{s.list=s.list.filter(n=>!i.find(l=>l._id===n._id))})}})},idleListLocal(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):b({list:e,oldList:this.localList,render:(t,i)=>{this.setLoading(!1),t===D?this.$patch(s=>{i[0]&&s.localList.push(i[0])}):t===g?this.$patch(s=>{const n=i[0];if(n){const l=s.localList.findIndex(r=>r._id===n._id);l>-1&&(s.localList[l]=n)}}):t===C&&this.$patch(s=>{s.localList=s.localList.filter(n=>!i.find(l=>l._id===n._id))})}})},async initCompMetas(e){const t=B(),i=await R({compIds:e.map(a=>a._id)}),{compInfos:s=[]}=i.data||{},r=e.map(a=>a.dep).map(a=>$(a,t.deps)).reduce((a,h)=>[...a,...h],[]).map(a=>a.name),c=await X({deps:[...new Set(r)]}),{entryNameToFile:d={}}=c.data;e.forEach(a=>{const _=$(a.dep,t.deps).reduce((m,L)=>(d[L.name]&&(m[L.name]=d[L.name]),m),{}),f=Z(a._id)();f.setLatestVersion(a.version),f.setDetail(a.version,a);const x=s.filter(m=>m.id===a._id);f.setLocalCompInfo(x),f.setDepEntryNameToFile(a.version,_)})},async initCompMetasLocal(e){e.forEach(t=>{W(t._id)().setDetail(t)})},async renderList(e){return e.length&&await this.initCompMetas(e),this.idleList(e)},renderLocalList(e){return e.length&&this.initCompMetasLocal(e),this.idleListLocal(e)}}}),ee={class:"size-full"},te=q({__name:"index",props:{previews:{},dep:{},signedUrls:{},depToFile:{}},setup(o){const e=o,t=z(),i=G(()=>({dep:e.dep,signedUrls:e.signedUrls,depToFile:e.depToFile,panelType:O.MINI}));return(s,n)=>{const l=T("el-carousel-item"),r=T("el-carousel");return u(),E(r,y({class:"size-full"},M(t),{trigger:"click",loop:!1}),{default:S(()=>[(u(!0),V(Q,null,Y(o.previews,(c,d)=>(u(),E(l,{key:d,class:"size-full"},{default:S(()=>[j("div",ee,[c.finalEntryUrl?(u(),E(K,y({key:0,finalEntryUrl:c.finalEntryUrl},{ref_for:!0},i.value),null,16,["finalEntryUrl"])):H("",!0)])]),_:2},1024))),128))]),_:1},16)}}}),re=J(te,[["__scopeId","data-v-325964d0"]]);export{re as C,W as a,le as c,ne as u};
1
+ import{k as I,bO as k,bP as F,aO as A,u as M,Q as w,z as B,bu as R,j as U,bQ as P,bR as N,d as q,ac as z,m as G,aH as O,r as T,B as E,w as y,c as V,F as Q,N as Y,a as j,p as H,Z as S,o as m,v as J}from"./index-cHbH7T5D.js";import{m as X}from"./v1Module-Clll6gmK.js";import{p as $}from"./index-BfqhDZ1z.js";import{c as Z,b as K}from"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";function ne(o){const e=I(0),t=typeof o=="string"?I(document.querySelector(o)):o,{y:i}=k(t,{behavior:"auto"});return F(()=>{e.value=M(i)??0}),A(async()=>{setTimeout(()=>{i.value=e.value},0)}),{memoryY:e}}const W=(o="")=>{if(!o)throw new Error("createCompMetaLocalStore scopeId is required");return w(`compMetaLocal_${o}`,{state:()=>({detail:{},dep:{},depToFile:{}}),getters:{},actions:{setDetail(e){this.$patch(t=>{t.detail=e})},setDep(e){this.$patch(t=>{t.dep=e})},setDepToFile(e){this.$patch(t=>{t.depToFile=e})}}})};let p=null;const g="IS_REPLACE",D="IS_ADD",C="IS_DELETE";function v(){p&&(cancelIdleCallback(p),p=null)}function b({list:o,oldList:e=[],render:t}){if(p&&(cancelIdleCallback(p),p=null),o.length===0)return console.warn("列表为空"),()=>{v()};const i=e.filter(c=>!o.some(d=>d._id===c._id));i.length>0&&t(C,i);let s=0;const n=o.length;let l=Date.now();const r=c=>{const d=Date.now()-l>100;if(s<n&&c.timeRemaining()>8||d){l=Date.now();const a=o[s];if(!a)throw new Error("组件列表项无效");e.findIndex(_=>_._id===a._id)>-1?t(g,[a]):t(D,[a]),s++}s<n&&(p=requestIdleCallback(r,{timeout:16.6*2}))};return n>0&&(p=requestIdleCallback(r,{timeout:16.6*2})),()=>{v()}}const le=o=>w(`compListStore_${o}`,{state:()=>({scopeId:o,list:[],localList:[],loading:!1,tagGroup:[...P],selectTag:U(`${N}_${o}`,"XTTJ"),isEmpty:!1}),actions:{setLocalList(e){this.$patch(t=>{t.localList=e})},setSelectTag(e){this.$patch(t=>{t.selectTag=e})},setLoading(e){this.$patch(t=>{t.loading=e})},setIsEmpty(e){this.$patch(t=>{t.isEmpty=e})},setList(e){this.$patch(t=>{t.list=e})},delCompListById(e){this.$patch(t=>{t.list=t.list.filter(i=>i._id!==e)})},updateCompListItemById(e,t){this.$patch(i=>{i.list=i.list.map(s=>s._id===e?{...s,...t}:s)})},idleList(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):b({list:e,oldList:this.list,render:(t,i)=>{this.setLoading(!1),t===D?this.$patch(s=>{i[0]&&s.list.push(i[0])}):t===g?this.$patch(s=>{const n=i[0];if(n){const l=s.list.findIndex(r=>r._id===n._id);l>-1&&(s.list[l]=n)}}):t===C&&this.$patch(s=>{s.list=s.list.filter(n=>!i.find(l=>l._id===n._id))})}})},idleListLocal(e){return this.setIsEmpty(e.length===0),e.length===0?(this.setList([]),this.setLoading(!1),()=>{}):b({list:e,oldList:this.localList,render:(t,i)=>{this.setLoading(!1),t===D?this.$patch(s=>{i[0]&&s.localList.push(i[0])}):t===g?this.$patch(s=>{const n=i[0];if(n){const l=s.localList.findIndex(r=>r._id===n._id);l>-1&&(s.localList[l]=n)}}):t===C&&this.$patch(s=>{s.localList=s.localList.filter(n=>!i.find(l=>l._id===n._id))})}})},async initCompMetas(e){const t=B(),i=await R({compIds:e.map(a=>a._id)}),{compInfos:s=[]}=i.data||{},r=e.map(a=>a.dep).map(a=>$(a,t.deps)).reduce((a,h)=>[...a,...h],[]).map(a=>a.name),c=await X({deps:[...new Set(r)]}),{entryNameToFile:d={}}=c.data;e.forEach(a=>{const _=$(a.dep,t.deps).reduce((u,L)=>(d[L.name]&&(u[L.name]=d[L.name]),u),{}),f=Z(a._id)();f.setLatestVersion(a.version),f.setDetail(a.version,a);const x=s.filter(u=>u.id===a._id);f.setLocalCompInfo(x),f.setDepEntryNameToFile(a.version,_)})},async initCompMetasLocal(e){e.forEach(t=>{W(t._id)().setDetail(t)})},async renderList(e){return e.length&&await this.initCompMetas(e),this.idleList(e)},renderLocalList(e){return e.length&&this.initCompMetasLocal(e),this.idleListLocal(e)}}}),ee={class:"size-full"},te=q({__name:"index",props:{previews:{},dep:{},signedUrls:{},depToFile:{}},setup(o){const e=o,t=z(),i=G(()=>({dep:e.dep,signedUrls:e.signedUrls,depToFile:e.depToFile,panelType:O.MINI}));return(s,n)=>{const l=T("el-carousel-item"),r=T("el-carousel");return m(),E(r,S({class:"size-full"},M(t),{trigger:"click",loop:!1}),{default:y(()=>[(m(!0),V(Q,null,Y(o.previews,(c,d)=>(m(),E(l,{key:d,class:"size-full"},{default:y(()=>[j("div",ee,[c.finalEntryUrl?(m(),E(K,S({key:0,finalEntryUrl:c.finalEntryUrl},{ref_for:!0},i.value),null,16,["finalEntryUrl"])):H("",!0)])]),_:2},1024))),128))]),_:1},16)}}}),re=J(te,[["__scopeId","data-v-325964d0"]]);export{re as C,W as a,le as c,ne as u};
@@ -1 +1 @@
1
- import{d as E,aU as v,M as N,r as m,B as p,w as t,b as c,u as g,f as b,o as i,z as B,j as y,aV as T,k as C,x as R,aW as w,n as A,c as V,a,F as S,N as D,t as h,aO as I,a8 as O,E as $,aX as z,m as k,$ as L,a1 as U,a2 as P,a0 as F,v as Y}from"./index-BCju3w1f.js";import{u as H,a as J,b as X}from"./v1Module-BPYVWmkw.js";const M=E({__name:"RadioMatch",props:{modelValue:{type:String,default:v.MAJOR_VERSION},modelModifiers:{}},emits:["update:modelValue"],setup(x){const s=N(x,"modelValue");function u(d){s.value=String(d??"")}return(d,e)=>{const r=m("el-radio"),o=m("el-radio-group");return i(),p(o,{"model-value":s.value,onChange:u},{default:t(()=>[c(r,{value:g(v).ONLY_INSTALL},{default:t(()=>[...e[0]||(e[0]=[b("仅安装",-1)])]),_:1},8,["value"]),c(r,{value:g(v).MAJOR_VERSION},{default:t(()=>[...e[1]||(e[1]=[b("主版本",-1)])]),_:1},8,["value"]),c(r,{value:g(v).MINOR_VERSION},{default:t(()=>[...e[2]||(e[2]=[b("主次版本",-1)])]),_:1},8,["value"]),c(r,{value:g(v).EXACT_VERSION},{default:t(()=>[...e[3]||(e[3]=[b("完全一致",-1)])]),_:1},8,["value"])]),_:1},8,["model-value"])}}}),j={class:"size-full overflow-auto"},q={class:"bg-[#f5f7fa] p-[10px] rounded-sm border border-[#ccc]"},G={class:"border-b border-solid border-gray-300"},K={class:"flex"},W={class:"w-[100px]"},Q={class:"flex-1"},Z={class:"bg-[#f5f7fa] p-[10px] rounded-sm border border-[#ccc]"},ee={class:"border-b border-solid border-gray-300"},ae={class:"flex"},te={class:"w-[100px]"},oe={class:"flex-1"},ne=E({__name:"index",setup(x){const s=B(),u=y(T,{dependencies:[],devDependencies:[]}),d=C([]),e=C([]);return R(async()=>{d.value=w(s.dependencies),e.value=w(s.devDependencies)}),A(()=>{d.value.length&&s.setDependencies(w(d.value)),e.value.length&&s.setDevDependencies(w(e.value)),u.value={dependencies:d.value.length?d.value:u.value.dependencies,devDependencies:e.value.length?e.value:u.value.devDependencies}}),(r,o)=>{const l=m("el-form-item"),_=m("el-form");return i(),V("div",j,[c(_,{"label-position":"left","label-width":"auto"},{default:t(()=>[c(l,{label:"dependencies:"},{default:t(()=>[a("div",q,[(i(!0),V(S,null,D(d.value,n=>(i(),p(l,{key:n.name},{label:t(()=>[a("div",G,[a("span",null,h(n.name),1)])]),default:t(()=>[a("div",K,[a("span",W,h(n.version),1),a("div",Q,[c(M,{modelValue:n.match,"onUpdate:modelValue":f=>n.match=f},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))])]),_:1}),c(l,{label:"devDependencies:"},{default:t(()=>[a("div",Z,[(i(!0),V(S,null,D(e.value,n=>(i(),p(l,{key:n.name},{label:t(()=>[a("div",ee,[a("span",null,h(n.name),1)])]),default:t(()=>[a("div",ae,[a("span",te,h(n.version),1),a("div",oe,[c(M,{modelValue:n.match,"onUpdate:modelValue":f=>n.match=f},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))])]),_:1})]),_:1})])}}}),se={class:"flex items-center"},le={class:"ml-2"},de=E({__name:"index",setup(x){const s=H(),u=C("");async function d(){try{if(!navigator.storage||!navigator.storage.estimate)throw new Error("浏览器不支持 storage.estimate API");const o=await navigator.storage.estimate();if(!o.usage||!o.quota)throw new Error("获取存储统计失败:返回数据不完整");return o}catch(o){return console.error("获取存储统计失败:",o.message),null}}function e(){O.confirm("将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",beforeClose:async(o,l,_)=>{o==="confirm"&&(l.confirmButtonLoading=!0,await J(),await s.deleteDatabase(),l.confirmButtonLoading=!1,await r(),$.success("缓存已清空")),_()}}).catch(()=>{})}async function r(){const o=await d(),l=await X(),{size:_=0}=l.data??{},{usage:n=0}=o??{},f=(n+_)/(1024*1024);u.value=`${f.toFixed(2)} MB`}return I(async()=>{await r()}),(o,l)=>{const _=m("el-button"),n=m("el-form-item"),f=m("el-form");return i(),p(f,null,{default:t(()=>[c(n,{label:"缓存:"},{default:t(()=>[a("div",se,[c(_,{onClick:e},{default:t(()=>[...l[0]||(l[0]=[b("清空缓存",-1)])]),_:1}),a("span",le,"已使用:"+h(u.value),1)])]),_:1})]),_:1})}}}),re={class:"size-full overflow-hidden flex flex-col bg-white rounded-sm"},ce={class:"bg-color bg-[#ccc] sticky top-0 w-full bg-[#f5f7fa] z-[100]"},ue={class:"flex-1 overflow-auto overflow-x-hidden p-[10px]"},ie=E({__name:"index",setup(x){const s=y(z,"previewRule"),u=[{label:"依赖设置",value:"previewRule",component:ne},{label:"其他设置",value:"otherSetting",component:de}],d=k(()=>u.find(r=>r.value===s.value)?.component||{render:()=>null});return(e,r)=>{const o=m("el-segmented");return i(),V("div",re,[a("div",ce,[c(o,{modelValue:g(s),"onUpdate:modelValue":r[0]||(r[0]=l=>L(s)?s.value=l:null),options:u,size:"default"},null,8,["modelValue"])]),a("div",ue,[c(F,null,{default:t(()=>[(i(),p(U,null,[(i(),p(P(d.value)))],1024))]),_:1})])])}}}),fe=Y(ie,[["__scopeId","data-v-3882106b"]]);export{fe as default};
1
+ import{d as E,aT as v,M as N,r as m,B as p,w as t,b as c,u as g,f as b,o as i,z as B,j as y,aU as T,k as C,x as R,aV as w,n as A,c as V,a,F as S,N as D,t as h,aO as I,a8 as O,E as $,aW as z,m as k,$ as L,a1 as U,a2 as P,a0 as F,v as Y}from"./index-cHbH7T5D.js";import{u as H,a as J,b as j}from"./v1Module-Clll6gmK.js";const M=E({__name:"RadioMatch",props:{modelValue:{type:String,default:v.MAJOR_VERSION},modelModifiers:{}},emits:["update:modelValue"],setup(x){const s=N(x,"modelValue");function u(d){s.value=String(d??"")}return(d,e)=>{const r=m("el-radio"),o=m("el-radio-group");return i(),p(o,{"model-value":s.value,onChange:u},{default:t(()=>[c(r,{value:g(v).ONLY_INSTALL},{default:t(()=>[...e[0]||(e[0]=[b("仅安装",-1)])]),_:1},8,["value"]),c(r,{value:g(v).MAJOR_VERSION},{default:t(()=>[...e[1]||(e[1]=[b("主版本",-1)])]),_:1},8,["value"]),c(r,{value:g(v).MINOR_VERSION},{default:t(()=>[...e[2]||(e[2]=[b("主次版本",-1)])]),_:1},8,["value"]),c(r,{value:g(v).EXACT_VERSION},{default:t(()=>[...e[3]||(e[3]=[b("完全一致",-1)])]),_:1},8,["value"])]),_:1},8,["model-value"])}}}),q={class:"size-full overflow-auto"},G={class:"bg-[#f5f7fa] p-[10px] rounded-sm border border-[#ccc]"},K={class:"border-b border-solid border-gray-300"},W={class:"flex"},X={class:"w-[100px]"},Q={class:"flex-1"},Z={class:"bg-[#f5f7fa] p-[10px] rounded-sm border border-[#ccc]"},ee={class:"border-b border-solid border-gray-300"},ae={class:"flex"},te={class:"w-[100px]"},oe={class:"flex-1"},ne=E({__name:"index",setup(x){const s=B(),u=y(T,{dependencies:[],devDependencies:[]}),d=C([]),e=C([]);return R(async()=>{d.value=w(s.dependencies),e.value=w(s.devDependencies)}),A(()=>{d.value.length&&s.setDependencies(w(d.value)),e.value.length&&s.setDevDependencies(w(e.value)),u.value={dependencies:d.value.length?d.value:u.value.dependencies,devDependencies:e.value.length?e.value:u.value.devDependencies}}),(r,o)=>{const l=m("el-form-item"),_=m("el-form");return i(),V("div",q,[c(_,{"label-position":"left","label-width":"auto"},{default:t(()=>[c(l,{label:"dependencies:"},{default:t(()=>[a("div",G,[(i(!0),V(S,null,D(d.value,n=>(i(),p(l,{key:n.name},{label:t(()=>[a("div",K,[a("span",null,h(n.name),1)])]),default:t(()=>[a("div",W,[a("span",X,h(n.version),1),a("div",Q,[c(M,{modelValue:n.match,"onUpdate:modelValue":f=>n.match=f},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))])]),_:1}),c(l,{label:"devDependencies:"},{default:t(()=>[a("div",Z,[(i(!0),V(S,null,D(e.value,n=>(i(),p(l,{key:n.name},{label:t(()=>[a("div",ee,[a("span",null,h(n.name),1)])]),default:t(()=>[a("div",ae,[a("span",te,h(n.version),1),a("div",oe,[c(M,{modelValue:n.match,"onUpdate:modelValue":f=>n.match=f},null,8,["modelValue","onUpdate:modelValue"])])])]),_:2},1024))),128))])]),_:1})]),_:1})])}}}),se={class:"flex items-center"},le={class:"ml-2"},de=E({__name:"index",setup(x){const s=H(),u=C("");async function d(){try{if(!navigator.storage||!navigator.storage.estimate)throw new Error("浏览器不支持 storage.estimate API");const o=await navigator.storage.estimate();if(!o.usage||!o.quota)throw new Error("获取存储统计失败:返回数据不完整");return o}catch(o){return console.error("获取存储统计失败:",o.message),null}}function e(){O.confirm("将清空浏览器单文件编译结果以及模块预编译文件,确认清空缓存吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",beforeClose:async(o,l,_)=>{o==="confirm"&&(l.confirmButtonLoading=!0,await J(),await s.deleteDatabase(),l.confirmButtonLoading=!1,await r(),$.success("缓存已清空")),_()}}).catch(()=>{})}async function r(){const o=await d(),l=await j(),{size:_=0}=l.data??{},{usage:n=0}=o??{},f=(n+_)/(1024*1024);u.value=`${f.toFixed(2)} MB`}return I(async()=>{await r()}),(o,l)=>{const _=m("el-button"),n=m("el-form-item"),f=m("el-form");return i(),p(f,null,{default:t(()=>[c(n,{label:"缓存:"},{default:t(()=>[a("div",se,[c(_,{onClick:e},{default:t(()=>[...l[0]||(l[0]=[b("清空缓存",-1)])]),_:1}),a("span",le,"已使用:"+h(u.value),1)])]),_:1})]),_:1})}}}),re={class:"size-full overflow-hidden flex flex-col bg-white rounded-sm"},ce={class:"bg-color bg-[#ccc] sticky top-0 w-full bg-[#f5f7fa] z-[100]"},ue={class:"flex-1 overflow-auto overflow-x-hidden p-[10px]"},ie=E({__name:"index",setup(x){const s=y(z,"previewRule"),u=[{label:"依赖设置",value:"previewRule",component:ne},{label:"其他设置",value:"otherSetting",component:de}],d=k(()=>u.find(r=>r.value===s.value)?.component||{render:()=>null});return(e,r)=>{const o=m("el-segmented");return i(),V("div",re,[a("div",ce,[c(o,{modelValue:g(s),"onUpdate:modelValue":r[0]||(r[0]=l=>L(s)?s.value=l:null),options:u,size:"default"},null,8,["modelValue"])]),a("div",ue,[c(F,null,{default:t(()=>[(i(),p(U,null,[(i(),p(P(d.value)))],1024))]),_:1})])])}}}),fe=Y(ie,[["__scopeId","data-v-3882106b"]]);export{fe as default};
@@ -1 +1 @@
1
- import{d as b,ac as N,g as j,k as L,m as h,ad as z,J as A,y as U,x as W,r as P,c as y,F as T,b as l,a as n,u as r,w as i,B as $,p as K,Z as M,ae as X,t as x,f as g,af as Y,o as p,a6 as G,i as J,Y as Z,N as q,a5 as w,G as H,D as Q,W as ee,X as te,ag as ae,a4 as E}from"./index-BCju3w1f.js";import{B as oe}from"./index-BzYZrqYN.js";import{_ as se,a as ne}from"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import{c as le}from"./index-BnJyLrXy.js";import{a as re,C as ie,u as ce,c as pe}from"./index-DCQCk6Lt.js";import{m as ue}from"./v1Module-BPYVWmkw.js";const de={class:"flex justify-end items-center"},me={class:"flex-1"},_e={class:"text-xs"},fe={class:"text-xs mt-1 flex justify-between items-center"},ve=b({__name:"Item",setup(k){const e=N(),s=j(),u=re(e._id)(),{openCompPathInVscode:d,handlePath:m}=z(),o=L([]),c=L({}),_=h(()=>Object.keys(c.value??{}).length>0),C=h(()=>m(e.fullPath,1)),S=h(()=>e.previewConfigs.filter(a=>a.miniPath?.length).slice(0,3).map(a=>{const t=le(e.path,a.miniPath);return{finalEntryUrl:`${A}/${t}`}})),V=h(()=>{const a=S.value.length===1?"none":"";return{previews:S.value,dep:o.value,depToFile:c.value,indicatorPosition:a}});async function B(){const a=await Y({compPath:e.path}),{thirdParty:t}=a.data;o.value=t,u.setDep(t)}async function R(){const a=o.value.map(v=>v.name),t=await ue({deps:a}),{entryNameToFile:f={}}=t.data;c.value=f,u.setDepToFile(f)}function O(){d(e.fullPath,"./comp.json")}function F(){s.push({path:`/previewLocal/${e._id}`})}return U(o,async a=>{a.length&&await R()}),W(()=>{B()}),(a,t)=>{const f=P("el-color-picker"),v=P("el-link");return p(),y(T,null,[l(se,{class:"flex flex-col gap-1 h-[280px] overflow-hidden",bg:r(e).bgColor},{default:i(({bg:D,updateColor:I})=>[n("div",{class:"border border-[#e4e7ed] rounded-sm flex-1",style:X({backgroundColor:D})},[_.value?(p(),$(ie,M({key:0},V.value,{autoplay:""}),null,16)):K("",!0)],4),n("div",de,[n("div",me,[n("span",null,x(r(e).version),1)]),n("span",_e,[t[0]||(t[0]=g("背景板:",-1)),l(f,{modelValue:D,onChange:I,clearable:""},null,8,["modelValue","onChange"])])])]),_:1},8,["bg"]),n("div",null,[n("div",null,x(r(e).name),1),n("div",fe,[n("div",null,[t[1]||(t[1]=g(" 组件位置: ",-1)),l(v,{href:"javascript:void(0)",type:"primary",underline:"always",title:r(e).fullPath,onClick:O},{default:i(()=>[g(x(C.value),1)]),_:1},8,["title"])]),l(v,{type:"primary",onClick:F},{default:i(()=>[...t[2]||(t[2]=[g("预览",-1)])]),_:1})])])],64)}}}),he={class:"size-full overflow-x-hidden",ref:"compList"},ge=b({__name:"index",setup(k){const e=G(w.COMP_LIST_STORE),s=J("compList");return ce(s),(u,d)=>{const m=P("el-card");return p(),y("div",he,[l(Z,{isEmpty:r(e).isEmpty,class:"size-full"},{default:i(()=>[l(ne,{itemMinWidth:310},{default:i(()=>[(p(!0),y(T,null,q(r(e).localList,o=>(p(),$(m,{key:o._id,"body-style":"padding: 5px"},{default:i(()=>[l(ve,M({ref_for:!0},o),null,16)]),_:2},1024))),128))]),_:1})]),_:1},8,["isEmpty"])],512)}}}),ye={class:"size-full"},ke=b({__name:"index",setup(k){const e=H(),s=pe(e.path)();E(w.COMP_LIST_STORE,s);const u=new Map;E(w.CALLBACKS,u);const d=L({data:[],pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:m});async function m(o){s.setLoading(!0);const c=await ae(o),{rows:_,total:C}=c.data||{};s.renderLocalList(_),d.value.pagination.total=C||0}return Q(()=>{s.$reset()}),(o,c)=>{const _=ee("loading");return te((p(),y("div",ye,[l(oe,{tableConfig:d.value},{table:i(()=>[l(ge,{class:"overflow-y-scroll"})]),_:1},8,["tableConfig"])])),[[_,r(s).loading]])}}});export{ke as default};
1
+ import{d as b,ac as N,g as j,k as L,m as h,ad as z,J as A,y as U,x as W,r as P,c as y,F as T,b as l,a as n,u as r,w as i,B as $,p as K,Z as M,ae as X,t as x,f as g,af as Y,o as p,a6 as G,i as J,Y as Z,N as q,a5 as w,G as H,D as Q,W as ee,X as te,ag as ae,a4 as E}from"./index-cHbH7T5D.js";import{B as oe}from"./index-DNxTJC5Q.js";import{_ as se,a as ne}from"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import{c as le}from"./index-BfqhDZ1z.js";import{a as re,C as ie,u as ce,c as pe}from"./index-CPx4gS-Z.js";import{m as ue}from"./v1Module-Clll6gmK.js";const de={class:"flex justify-end items-center"},me={class:"flex-1"},_e={class:"text-xs"},fe={class:"text-xs mt-1 flex justify-between items-center"},ve=b({__name:"Item",setup(k){const e=N(),s=j(),u=re(e._id)(),{openCompPathInVscode:d,handlePath:m}=z(),o=L([]),c=L({}),_=h(()=>Object.keys(c.value??{}).length>0),C=h(()=>m(e.fullPath,1)),S=h(()=>e.previewConfigs.filter(a=>a.miniPath?.length).slice(0,3).map(a=>{const t=le(e.path,a.miniPath);return{finalEntryUrl:`${A}/${t}`}})),V=h(()=>{const a=S.value.length===1?"none":"";return{previews:S.value,dep:o.value,depToFile:c.value,indicatorPosition:a}});async function B(){const a=await Y({compPath:e.path}),{thirdParty:t}=a.data;o.value=t,u.setDep(t)}async function R(){const a=o.value.map(v=>v.name),t=await ue({deps:a}),{entryNameToFile:f={}}=t.data;c.value=f,u.setDepToFile(f)}function O(){d(e.fullPath,"./comp.json")}function F(){s.push({path:`/previewLocal/${e._id}`})}return U(o,async a=>{a.length&&await R()}),W(()=>{B()}),(a,t)=>{const f=P("el-color-picker"),v=P("el-link");return p(),y(T,null,[l(se,{class:"flex flex-col gap-1 h-[280px] overflow-hidden",bg:r(e).bgColor},{default:i(({bg:D,updateColor:I})=>[n("div",{class:"border border-[#e4e7ed] rounded-sm flex-1",style:X({backgroundColor:D})},[_.value?(p(),$(ie,M({key:0},V.value,{autoplay:""}),null,16)):K("",!0)],4),n("div",de,[n("div",me,[n("span",null,x(r(e).version),1)]),n("span",_e,[t[0]||(t[0]=g("背景板:",-1)),l(f,{modelValue:D,onChange:I,clearable:""},null,8,["modelValue","onChange"])])])]),_:1},8,["bg"]),n("div",null,[n("div",null,x(r(e).name),1),n("div",fe,[n("div",null,[t[1]||(t[1]=g(" 组件位置: ",-1)),l(v,{href:"javascript:void(0)",type:"primary",underline:"always",title:r(e).fullPath,onClick:O},{default:i(()=>[g(x(C.value),1)]),_:1},8,["title"])]),l(v,{type:"primary",onClick:F},{default:i(()=>[...t[2]||(t[2]=[g("预览",-1)])]),_:1})])])],64)}}}),he={class:"size-full overflow-x-hidden",ref:"compList"},ge=b({__name:"index",setup(k){const e=G(w.COMP_LIST_STORE),s=J("compList");return ce(s),(u,d)=>{const m=P("el-card");return p(),y("div",he,[l(Z,{isEmpty:r(e).isEmpty,class:"size-full"},{default:i(()=>[l(ne,{itemMinWidth:310},{default:i(()=>[(p(!0),y(T,null,q(r(e).localList,o=>(p(),$(m,{key:o._id,"body-style":"padding: 5px"},{default:i(()=>[l(ve,M({ref_for:!0},o),null,16)]),_:2},1024))),128))]),_:1})]),_:1},8,["isEmpty"])],512)}}}),ye={class:"size-full"},ke=b({__name:"index",setup(k){const e=H(),s=pe(e.path)();E(w.COMP_LIST_STORE,s);const u=new Map;E(w.CALLBACKS,u);const d=L({data:[],pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:m});async function m(o){s.setLoading(!0);const c=await ae(o),{rows:_,total:C}=c.data||{};s.renderLocalList(_),d.value.pagination.total=C||0}return Q(()=>{s.$reset()}),(o,c)=>{const _=ee("loading");return te((p(),y("div",ye,[l(oe,{tableConfig:d.value},{table:i(()=>[l(ge,{class:"overflow-y-scroll"})]),_:1},8,["tableConfig"])])),[[_,r(s).loading]])}}});export{ke as default};
@@ -1 +1 @@
1
- import{_ as q,i as G,j as H}from"./index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js";import{c as K,C as J}from"./useCompEditStore-DxIY6W80.js";import{d as U,k as E,r as _,B as b,w as a,a as r,b as s,ah as A,o as T,c as I,F as Q,N as W,t as Z,f as O,ai as ee,g as te,G as oe,j as se,aj as ae,i as N,m as ne,D as le,u as ie,ak as re,a7 as ce,af as de,al as ue,a8 as pe,am as me,an as V,E as j,R as z,ao as fe,ap as _e,aq as ve,a4 as xe,a5 as ye,v as Ee}from"./index-BCju3w1f.js";import{_ as B}from"./index.vue_vue_type_style_index_0_lang-D5mLFRCT.js";import{u as Te}from"./useTeamHeaders-3AldZ0JH.js";import"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import"./index-BnJyLrXy.js";import"./v1Module-BPYVWmkw.js";import"./atom-one-dark-k3s8nS4Q.js";const ge={class:"h-[70vh] overflow-hidden flex flex-col"},he={class:"flex-1 flex justify-center overflow-auto"},Ce={class:"flex justify-end"},ke=U({__name:"index",setup(F,{expose:g}){const p="/dist/",n=E(!1),v=E(`${p}/md/PUT_TREATY.md`);let t;function k(f){n.value=!0,t=f}function x(){n.value=!1}function m(f){t?.(f),x()}return g({open:k,close:x}),(f,o)=>{const i=_("el-button");return T(),b(A,{modelValue:n.value,"onUpdate:modelValue":o[2]||(o[2]=y=>n.value=y),title:"",width:"55%","show-close":"",top:"10vh"},{default:a(()=>[r("div",ge,[r("div",he,[s(B,{src:v.value},null,8,["src"])]),r("div",Ce,[s(i,{onClick:o[0]||(o[0]=y=>m(!1))},{default:a(()=>[...o[3]||(o[3]=[r("span",{class:"text-lg"},"拒绝",-1)])]),_:1}),s(i,{onClick:o[1]||(o[1]=y=>m(!0)),type:"primary"},{default:a(()=>[...o[4]||(o[4]=[r("span",{class:"text-[#fff] text-lg"},"同意",-1)])]),_:1})])])]),_:1},8,["modelValue"])}}}),we={class:"flex flex-col items-center"},$e={class:"flex-1"},be={class:"text-center"},Re={class:"text-blue-600 hover:text-blue-800 hover:underline cursor-pointer transition-colors"},Se={class:"flex justify-end gap-[10px]"},Pe=U({__name:"index",setup(F,{expose:g}){const p=E(!1),n=E([]);let v;const k=E("/dist//md/COMP_REPEAT.md");function x(o,i){n.value=o,p.value=!0,v=i}function m(){p.value=!1}function f(o){o.start(),v?.({end:o.end})}return g({open:x,close:m}),(o,i)=>{const y=_("router-link"),h=_("el-button");return T(),b(A,{title:"",modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=d=>p.value=d),width:"660px"},{footer:a(()=>[r("div",Se,[s(h,{onClick:m},{default:a(()=>[...i[2]||(i[2]=[O("取消",-1)])]),_:1}),s(ee,null,{default:a(({instance:d,loading:R})=>[s(h,{loading:R,type:"primary",onClick:S=>f(d)},{default:a(()=>[...i[3]||(i[3]=[O("仍然上传",-1)])]),_:1},8,["loading","onClick"])]),_:1})])]),default:a(()=>[r("div",we,[r("div",$e,[s(B,{src:k.value},null,8,["src"])]),r("div",be,[i[1]||(i[1]=r("span",null,"相似组件:",-1)),(T(!0),I(Q,null,W(n.value,d=>(T(),b(y,{class:"inline-block ml-[5px] mr-[5px]",key:d._id,to:`/similarPreview/${d._id}`,target:"_blank"},{default:a(()=>[r("span",Re,Z(d.name),1)]),_:2},1032,["to"]))),128))])])]),_:1},8,["modelValue"])}}}),De={class:"size-full"},Ie={class:"overflow-hidden size-full"},Oe={key:0,class:"unclickable absolute inset-0 flex items-center justify-center"},Ue={class:"px-2 flex flex-1 items-center"},Fe=U({__name:"index",setup(F){const g=te(),p=oe(),{teamId:n}=Te(),v=se(ae,!1),t=K(p.path)();xe(ye.COMP_EDIT_STORE,t);const k=N("dialogPutTreaty"),x=N("dialogCompRepeat"),m=E(330),f=E(""),o=ne(()=>t.selectedFolder?.path);async function i(l){const e=await _e({compPath:l});t.setOriginalDirectory(e.data);const u=e.data?.children||[];if(u?.length){const C=u.find(Y=>Y.name==="comp.json");if(!C)return"NOT_EXIST";const P=await ve({filePath:C.path}),{content:D}=P.data,w=JSON.parse(D).__id__;if(!w)return"NOT_EXIST";const M=await H({compId:w}),{exist:X}=M.data;if(X)return f.value=w,"EXIST"}return"NOT_EXIST"}const y=async(l,e)=>{if(e()){if(t.$reset(),!v.value){k.value?.open(c=>{c&&(v.value=!0,h(l))});return}h(l)}};async function h(l){const e=ce.service({fullscreen:!0}),c=await i(l.path);if(c==="NOT_EXIST"){const u=await de({compPath:l.path}),{thirdParty:C}=u.data;t.setSelectedFolder(l),t.setCompDialogType(ue.ADD),t.initPreviewCompList(),t.setCompDep(C),e.close()}else c==="EXIST"&&pe.confirm("组件已经上传,更新操作请前往我的组件或团队组件","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).finally(()=>{e.close()})}async function d({end:l}){try{const e=t.getCompSubmitParams(),c=await me({compPath:o.value,...n?{teamId:n}:{}}),{similarList:u=[]}=c.data;if(u.length){x.value?.open(u,R),l();return}await V({...e,...n?{teamId:n}:{}}),j.success("上传成功"),await S(),t.$reset()}catch(e){console.error("上传失败:",e)}finally{l()}}function R({end:l}){const e=t.getCompSubmitParams();V({...e,...n?{teamId:n}:{}}).then(async()=>{x.value?.close(),await S(),t.$reset(),j.success("上传成功")}).finally(()=>{l()})}async function S(){n?await g.push({name:"team",params:{teamId:n},query:{[z.VERSION]:Date.now()}}):await g.push({name:"mine",query:{[z.VERSION]:Date.now()}})}async function L(){const l=t.selectedFolder;t.$reset(),await fe(),h(l)}return le(()=>{t.$reset()}),(l,e)=>{const c=_("el-splitter-panel"),u=_("el-icon"),C=_("el-empty"),P=_("el-link"),D=_("el-splitter");return T(),I("div",De,[s(D,null,{default:a(()=>[s(c,{collapsible:"",size:m.value,"onUpdate:size":e[0]||(e[0]=$=>m.value=$),max:330},{default:a(()=>[r("div",Ie,[s(q,null,{default:a(({isLogin:$})=>[s(G,{onSelect:w=>y(w,$)},null,8,["onSelect"])]),_:1})])]),_:1},8,["size"]),s(c,{class:"size-full rounded-sm relative"},{default:a(()=>[o.value?(T(),b(J,{key:1,onConfirmUpload:d},{toolbar:a(()=>[r("div",Ue,[s(P,{type:"primary",onClick:L},{default:a(()=>[...e[2]||(e[2]=[O("重新加载",-1)])]),_:1})])]),_:1})):(T(),I("div",Oe,[s(C,null,{image:a(()=>[r("div",null,[s(u,{style:{"font-size":"40px"}},{default:a(()=>[s(ie(re))]),_:1})])]),description:a(()=>[...e[1]||(e[1]=[r("span",{class:"text-[#ccc]"},"请先选择文件夹",-1)])]),_:1})]))]),_:1})]),_:1}),s(ke,{ref:"dialogPutTreaty"},null,512),s(Pe,{ref:"dialogCompRepeat"},null,512)])}}}),Ye=Ee(Fe,[["__scopeId","data-v-5512a6b7"]]);export{Ye as default};
1
+ import{_ as q,i as G,j as H}from"./index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js";import{c as K,C as J}from"./useCompEditStore-C3L6eIoz.js";import{d as U,k as E,r as _,B as b,w as a,a as r,b as s,ah as A,o as T,c as I,F as Q,N as W,t as Z,f as O,ai as ee,g as te,G as oe,j as se,aj as ae,i as N,m as ne,D as le,u as ie,ak as re,a7 as ce,af as de,al as ue,a8 as pe,am as me,an as V,E as j,R as z,ao as fe,ap as _e,aq as ve,a4 as xe,a5 as ye,v as Ee}from"./index-cHbH7T5D.js";import{_ as B}from"./index.vue_vue_type_style_index_0_lang-BVuL5ED4.js";import{u as Te}from"./useTeamHeaders-22mJVwWy.js";import"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import"./index-BfqhDZ1z.js";import"./v1Module-Clll6gmK.js";import"./atom-one-dark-B2H-r86L.js";const ge={class:"h-[70vh] overflow-hidden flex flex-col"},he={class:"flex-1 flex justify-center overflow-auto"},Ce={class:"flex justify-end"},ke=U({__name:"index",setup(F,{expose:g}){const p="/dist/",n=E(!1),v=E(`${p}/md/PUT_TREATY.md`);let t;function k(f){n.value=!0,t=f}function x(){n.value=!1}function m(f){t?.(f),x()}return g({open:k,close:x}),(f,o)=>{const i=_("el-button");return T(),b(A,{modelValue:n.value,"onUpdate:modelValue":o[2]||(o[2]=y=>n.value=y),title:"",width:"55%","show-close":"",top:"10vh"},{default:a(()=>[r("div",ge,[r("div",he,[s(B,{src:v.value},null,8,["src"])]),r("div",Ce,[s(i,{onClick:o[0]||(o[0]=y=>m(!1))},{default:a(()=>[...o[3]||(o[3]=[r("span",{class:"text-lg"},"拒绝",-1)])]),_:1}),s(i,{onClick:o[1]||(o[1]=y=>m(!0)),type:"primary"},{default:a(()=>[...o[4]||(o[4]=[r("span",{class:"text-[#fff] text-lg"},"同意",-1)])]),_:1})])])]),_:1},8,["modelValue"])}}}),we={class:"flex flex-col items-center"},$e={class:"flex-1"},be={class:"text-center"},Re={class:"text-blue-600 hover:text-blue-800 hover:underline cursor-pointer transition-colors"},Se={class:"flex justify-end gap-[10px]"},Pe=U({__name:"index",setup(F,{expose:g}){const p=E(!1),n=E([]);let v;const k=E("/dist//md/COMP_REPEAT.md");function x(o,i){n.value=o,p.value=!0,v=i}function m(){p.value=!1}function f(o){o.start(),v?.({end:o.end})}return g({open:x,close:m}),(o,i)=>{const y=_("router-link"),h=_("el-button");return T(),b(A,{title:"",modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=d=>p.value=d),width:"660px"},{footer:a(()=>[r("div",Se,[s(h,{onClick:m},{default:a(()=>[...i[2]||(i[2]=[O("取消",-1)])]),_:1}),s(ee,null,{default:a(({instance:d,loading:R})=>[s(h,{loading:R,type:"primary",onClick:S=>f(d)},{default:a(()=>[...i[3]||(i[3]=[O("仍然上传",-1)])]),_:1},8,["loading","onClick"])]),_:1})])]),default:a(()=>[r("div",we,[r("div",$e,[s(B,{src:k.value},null,8,["src"])]),r("div",be,[i[1]||(i[1]=r("span",null,"相似组件:",-1)),(T(!0),I(Q,null,W(n.value,d=>(T(),b(y,{class:"inline-block ml-[5px] mr-[5px]",key:d._id,to:`/similarPreview/${d._id}`,target:"_blank"},{default:a(()=>[r("span",Re,Z(d.name),1)]),_:2},1032,["to"]))),128))])])]),_:1},8,["modelValue"])}}}),De={class:"size-full"},Ie={class:"overflow-hidden size-full"},Oe={key:0,class:"unclickable absolute inset-0 flex items-center justify-center"},Ue={class:"px-2 flex flex-1 items-center"},Fe=U({__name:"index",setup(F){const g=te(),p=oe(),{teamId:n}=Te(),v=se(ae,!1),t=K(p.path)();xe(ye.COMP_EDIT_STORE,t);const k=N("dialogPutTreaty"),x=N("dialogCompRepeat"),m=E(330),f=E(""),o=ne(()=>t.selectedFolder?.path);async function i(l){const e=await _e({compPath:l});t.setOriginalDirectory(e.data);const u=e.data?.children||[];if(u?.length){const C=u.find(Y=>Y.name==="comp.json");if(!C)return"NOT_EXIST";const P=await ve({filePath:C.path}),{content:D}=P.data,w=JSON.parse(D).__id__;if(!w)return"NOT_EXIST";const M=await H({compId:w}),{exist:X}=M.data;if(X)return f.value=w,"EXIST"}return"NOT_EXIST"}const y=async(l,e)=>{if(e()){if(t.$reset(),!v.value){k.value?.open(c=>{c&&(v.value=!0,h(l))});return}h(l)}};async function h(l){const e=ce.service({fullscreen:!0}),c=await i(l.path);if(c==="NOT_EXIST"){const u=await de({compPath:l.path}),{thirdParty:C}=u.data;t.setSelectedFolder(l),t.setCompDialogType(ue.ADD),t.initPreviewCompList(),t.setCompDep(C),e.close()}else c==="EXIST"&&pe.confirm("组件已经上传,更新操作请前往我的组件或团队组件","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).finally(()=>{e.close()})}async function d({end:l}){try{const e=t.getCompSubmitParams(),c=await me({compPath:o.value,...n?{teamId:n}:{}}),{similarList:u=[]}=c.data;if(u.length){x.value?.open(u,R),l();return}await V({...e,...n?{teamId:n}:{}}),j.success("上传成功"),await S(),t.$reset()}catch(e){console.error("上传失败:",e)}finally{l()}}function R({end:l}){const e=t.getCompSubmitParams();V({...e,...n?{teamId:n}:{}}).then(async()=>{x.value?.close(),await S(),t.$reset(),j.success("上传成功")}).finally(()=>{l()})}async function S(){n?await g.push({name:"team",params:{teamId:n},query:{[z.VERSION]:Date.now()}}):await g.push({name:"mine",query:{[z.VERSION]:Date.now()}})}async function L(){const l=t.selectedFolder;t.$reset(),await fe(),h(l)}return le(()=>{t.$reset()}),(l,e)=>{const c=_("el-splitter-panel"),u=_("el-icon"),C=_("el-empty"),P=_("el-link"),D=_("el-splitter");return T(),I("div",De,[s(D,null,{default:a(()=>[s(c,{collapsible:"",size:m.value,"onUpdate:size":e[0]||(e[0]=$=>m.value=$),max:330},{default:a(()=>[r("div",Ie,[s(q,null,{default:a(({isLogin:$})=>[s(G,{onSelect:w=>y(w,$)},null,8,["onSelect"])]),_:1})])]),_:1},8,["size"]),s(c,{class:"size-full rounded-sm relative"},{default:a(()=>[o.value?(T(),b(J,{key:1,onConfirmUpload:d},{toolbar:a(()=>[r("div",Ue,[s(P,{type:"primary",onClick:L},{default:a(()=>[...e[2]||(e[2]=[O("重新加载",-1)])]),_:1})])]),_:1})):(T(),I("div",Oe,[s(C,null,{image:a(()=>[r("div",null,[s(u,{style:{"font-size":"40px"}},{default:a(()=>[s(ie(re))]),_:1})])]),description:a(()=>[...e[1]||(e[1]=[r("span",{class:"text-[#ccc]"},"请先选择文件夹",-1)])]),_:1})]))]),_:1})]),_:1}),s(ke,{ref:"dialogPutTreaty"},null,512),s(Pe,{ref:"dialogCompRepeat"},null,512)])}}}),Ye=Ee(Fe,[["__scopeId","data-v-5512a6b7"]]);export{Ye as default};
@@ -1 +1 @@
1
- import{d as U,ar as N,k as w,m as $,r as b,B as P,w as f,a as d,b as n,ah as T,E as h,o as S,as as te,i as I,at as oe,h as H,au as le,ac as se,av as ne,aw as re,a2 as ie,ax as ue,u as B,ay as de,az as ce,aA as X,Z as pe,c as F,aB as me,aC as fe,v as Z,F as ve,N as _e,p as ge,t as R,f as q,x as he,aD as xe,aE as we,ai as ye}from"./index-BCju3w1f.js";import{_ as W,e as M}from"./index.vue_vue_type_script_setup_true_lang-Cdma1D5V.js";import{a as j,d as be,e as ke}from"./index-BnJyLrXy.js";import{m as Y}from"./md5-gsIWVbtJ.js";import{B as Ce,h as Se}from"./moment-Q0xdD-i8.js";const De={class:"p-2"},$e={class:"flex gap-2"},Ee={class:"flex gap-2"},Ve=U({__name:"EmailDialog",setup(r,{expose:l}){const i=N(),t={OLD:"old",NEW:"new"},a=w(!1),m=w({}),o=w({}),v=w({onSubmit:()=>{D()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),c=$(()=>[{type:"input",field:"email",title:"旧邮箱",value:i?.userInfo?.email,validate:[{required:!0,message:"请输入旧邮箱",trigger:"blur"},{validator:(_,e,s)=>{j(e)?s():s(new Error("请输入正确的旧邮箱"))},trigger:"blur"}],props:{disabled:!0}},{type:"slotAuthCodeOld",field:"authCode",title:"旧验证码",validate:[{required:!0,message:"请输入旧验证码",trigger:"blur"}]},{type:"input",field:"newEmail",title:"新邮箱",value:"",validate:[{required:!0,message:"请输入新邮箱",trigger:"blur"},{validator:(_,e,s)=>{j(e)?s():s(new Error("请输入正确的新邮箱"))},trigger:"blur"}],props:{placeholder:"请输入新邮箱"}},{type:"slotAuthCodeNew",field:"newAuthCode",title:"新验证码",validate:[{required:!0,message:"请输入新验证码",trigger:"blur"}]}]);async function D(){v.value.submitBtn.loading=!0,te(o.value).then(()=>{h.success("邮箱修改成功"),i.setEmail(o.value.newEmail),x()}).finally(()=>{v.value.submitBtn.loading=!1})}function g(_,{end:e,startCountdown:s}){_===t.OLD?m.value.validateField("email").then(async()=>{await M({email:o.value.email}).then(()=>{h.success("验证码已发送"),s()})}).finally(()=>{e()}):_===t.NEW&&m.value.validateField("newEmail").then(async()=>{await M({email:o.value.newEmail}).then(()=>{h.success("新验证码已发送"),s()})}).finally(()=>{e()})}function p(){a.value=!0}function x(){a.value=!1}return l({open:p,close:x}),(_,e)=>{const s=b("el-input"),C=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":e[4]||(e[4]=u=>a.value=u),"show-close":!0,width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",De,[n(C,{rule:c.value,modelValue:o.value,"onUpdate:modelValue":e[2]||(e[2]=u=>o.value=u),api:m.value,"onUpdate:api":e[3]||(e[3]=u=>m.value=u),option:v.value},{"type-slotAuthCodeOld":f(u=>[d("div",$e,[n(s,{"model-value":String(u.model.value??""),class:"flex-1",onInput:k=>u.model.callback(k),placeholder:"请输入验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:e[0]||(e[0]=k=>g(t.OLD,k))})])]),"type-slotAuthCodeNew":f(u=>[d("div",Ee,[n(s,{"model-value":String(u.model.value??""),class:"flex-1",onInput:k=>u.model.callback(k),placeholder:"请输入新验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:e[1]||(e[1]=k=>g(t.NEW,k))})])]),_:1},8,["rule","modelValue","api","option"])])]),_:1},8,["modelValue"])}}}),Ae={class:"p-2"},Pe={class:"flex gap-2"},Ue=U({__name:"PasswordDialog",setup(r,{expose:l}){const i=N(),t=I("baseForm"),a=w(!1),m=w({}),o=w({}),v=w({onSubmit:()=>{D()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),c=$(()=>[{type:"input",field:"newPassword",title:i.isPasswordSet?"新密码":"设置密码",value:"",props:{placeholder:"请输入新密码",type:"password",showPassword:!0,autocomplete:"new-password"},validate:[{required:!0,message:"请输入新密码",trigger:"blur"}]},{type:"input",field:"confirmNewPassword",title:i.isPasswordSet?"确认新密码":"确认密码",value:"",props:{placeholder:"请确认新密码",type:"password",showPassword:!0,autocomplete:"new-password"},validate:[{required:!0,message:"请确认新密码",trigger:"blur"}]},{type:"input",field:"email",title:"邮箱",value:i?.userInfo?.email,props:{disabled:!0},validate:[{required:!0,message:"请输入邮箱",trigger:"blur"}]},{type:"slotAuthCode",field:"emailAuthCode",title:"验证码",value:""}]);async function D(){v.value.submitBtn.loading=!0;const _={newPassword:Y(o.value.newPassword),confirmNewPassword:Y(o.value.confirmNewPassword),email:o.value.email,emailAuthCode:o.value.emailAuthCode};oe(_).then(()=>{h.success("密码修改成功"),t.value?.resetFields(),i.setIsPasswordSet(!0),x()}).finally(()=>{v.value.submitBtn.loading=!1})}function g({end:_,startCountdown:e}){m.value.validateField("email").then(async()=>{await M({email:o.value.email}).then(()=>{h.success("验证码已发送"),e()})}).finally(()=>{_()})}function p(){a.value=!0}function x(){a.value=!1}return l({open:p,close:x}),(_,e)=>{const s=b("el-input"),C=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":e[2]||(e[2]=u=>a.value=u),"show-close":!0,width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",Ae,[n(C,{rule:c.value,modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=u=>o.value=u),api:m.value,"onUpdate:api":e[1]||(e[1]=u=>m.value=u),option:v.value},{"type-slotAuthCode":f(u=>[d("div",Pe,[n(s,{"model-value":String(u.model.value),onInput:k=>u.model.callback(k),class:"flex-1",placeholder:"请输入验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:g})])]),_:1},8,["rule","modelValue","api","option"])])]),_:1},8,["modelValue"])}}}),Le={class:"p-2"},Ie=U({__name:"NicknameDialog",setup(r,{expose:l}){const i=N(),t=H(),a=w(!1),m=w({onSubmit:()=>{c()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),o=w({}),v=$(()=>[{type:"input",field:"nickname",title:"昵称",value:i.userInfo.nickname,props:{placeholder:"请输入昵称"},validate:[{required:!0,message:"请输入昵称",trigger:"blur"},{min:3,max:10,message:"长度在 2 到 10 个字符",trigger:"blur"}]}]);async function c(){if(m.value.submitBtn.loading=!0,o.value.nickname===i.userInfo.nickname){h.success("修改成功"),m.value.submitBtn.loading=!1,g();return}le({nickname:o.value.nickname}).then(()=>{i.setNickname(o.value.nickname),t.updateNickname(o.value.nickname),h.success("修改成功"),g()}).finally(()=>{m.value.submitBtn.loading=!1})}function D(){a.value=!0}function g(){a.value=!1}return l({open:D,close:g}),(p,x)=>{const _=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":x[1]||(x[1]=e=>a.value=e),width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",Le,[n(_,{rule:v.value,modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=e=>o.value=e),option:m.value},null,8,["rule","modelValue","option"])])]),_:1},8,["modelValue"])}}}),Be=U({__name:"index",props:{cover:{type:Boolean}},setup(r){const l=r,i=ce(),t=se(),a=ne(),m={autoUpload:!1,cover:!1,onChange:p,onExceed:_,beforeUpload:G(),onError:x},o=w(null),v=w(),c=$(()=>({...m,...be(t),...l})),D=$(()=>({...a,default:a.default?e=>a.default({...e,fileUrl:o.value}):void 0}));function g(e){v.value=e,i&&(i.exposed=e||{},i.exposeProxy=e||{})}function p(...e){const[s,C]=e;c.value.fileList&&(c.value.fileList=C),s?.raw&&(o.value=URL.createObjectURL(s.raw))}function x(...e){const[s]=e;h.error(s.message)}function _(...e){const[s,C]=e;if(c.value.cover&&c?.value?.limit===1){v.value?.clearFiles();const u=s[0];u.uid=re(),v.value.handleStart(u);return}h.warning(`最多只能选择 ${c?.value?.limit} 个文件,本次已选择 ${s.length} 个,共将上传 ${s.length+C.length} 个文件`)}return(e,s)=>(S(),P(ie(ue(B(de),{...c.value,ref:g},D.value))))}}),K=r=>r.size/1024/1024>20?(h.error("上传文件大小不能超过 20MB!"),!1):!0;function G(r={}){const{mode:l="extend",custom:i}=r;return t=>l==="override"&&i?i(t):l==="extend"?K(t)?i?i(t):!0:!1:K(t)}function Re(r,l){const i=l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase(),t=r.dir+r.key+"."+i,a=new FormData;return a.append("success_action_status","200"),a.append("policy",r.policy),a.append("x-oss-signature",r.signature),a.append("x-oss-signature-version",r.x_oss_signature_version),a.append("x-oss-credential",r.x_oss_credential),a.append("x-oss-date",r.x_oss_date),a.append("key",t),a.append("x-oss-security-token",r.security_token),a.append("Cache-Control","public, max-age=31536000"),a.append("file",l),{host:r.host,filePath:t,formData:a}}async function Fe(r,l){return fetch(r,{method:"POST",body:l})}async function Ne(r){return X("/__remote__/api/v1/oss/compOssDir",{method:"POST"})}async function Te(r,l){return X("/__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:r})}const Oe=["src","onLoad"],qe=U({__name:"AvatarDialog",setup(r,{expose:l}){const i=N(),t=H(),a=w([]),m=$(()=>({avatar:i.userInfo.avatar})),o=w(!1),v=I("avatarUpload"),c=w(),D=$(()=>({limit:1,cover:!0,onError:x,beforeUpload:p,showFileList:!1,httpRequest:u})),g=$(()=>({showReset:!1,rows:[{type:"slot",label:"头像",prop:"avatar"}],rules:{avatar:[{required:!0,message:"请上传头像",trigger:"change"}]}})),p=G({custom(y){return y.type.startsWith("image/")?!0:(h.error("上传图片只能是图片格式!"),c.value?.(),!1)}});function x(y){c.value?.(),h.error(y.message)}async function _({end:y}){if(c.value=y,!a.value||a.value.length===0){h.warning("请先选择文件"),c.value();return}v.value?.submit()}function e(y){fe({avatar:y}).then(()=>{t.updateAvatar(y),L(),h.success("修改成功")}).finally(()=>{c.value?.()})}function s(){v.value?.clearFiles()}function C(){v.value?.clearFiles()}async function u(y){const V=await Ne(),{imageDir:O}=V.data,E=await Te({type:O});if(E.code!==0||!E.data)return h.error(E.message);const{host:A,filePath:J,formData:Q}=Re(E.data,y.file),z=await Fe(A,Q);if(z.ok)e(J);else{const ee=await z.text(),ae=ke(ee);h.error(ae.message),c.value?.()}}function k(){o.value=!0}function L(){o.value=!1,C()}return l({open:k,close:L}),(y,V)=>{const O=b("el-icon");return S(),P(T,{modelValue:o.value,"onUpdate:modelValue":V[1]||(V[1]=E=>o.value=E),width:"400px",onClose:C,"destroy-on-close":!0},{default:f(()=>[n(Ce,{onSubmit:_,onReset:s,initialData:m.value,config:g.value},{avatar:f(({updateModelValue:E})=>[n(B(Be),pe({ref:"avatarUpload",class:"avatar-uploader","file-list":a.value,"onUpdate:fileList":V[0]||(V[0]=A=>a.value=A)},D.value),{default:f(({fileUrl:A})=>[A?(S(),F("img",{key:0,src:A,class:"avatar",onLoad:()=>E(A)},null,40,Oe)):(S(),P(O,{key:1,class:"avatar-uploader-icon"},{default:f(()=>[n(B(me))]),_:1}))]),_:2},1040,["file-list"])]),_:1},8,["initialData","config"])]),_:1},8,["modelValue"])}}}),We=Z(qe,[["__scopeId","data-v-36bba531"]]),Me={class:"info-list"},He={class:"label"},ze={class:"value"},je=U({__name:"index",props:{infoList:{}},setup(r){return(l,i)=>{const t=b("el-button");return S(),F("div",Me,[(S(!0),F(ve,null,_e(r.infoList,a=>(S(),F("div",{key:a.key,class:"info-item"},[d("span",He,R(a.label),1),d("span",ze,R(a.value||a.defaultValue),1),a.handlerText?(S(),P(t,{key:0,link:"",type:"primary",onClick:m=>a.onHandler?.()},{default:f(()=>[q(R(a.handlerText),1)]),_:2},1032,["onClick"])):ge("",!0)]))),128))])}}}),Ye=Z(je,[["__scopeId","data-v-b89568e4"]]),Ke={class:"h-full"},Xe={class:"grid grid-cols-[8fr_13fr] gap-[24px] max-w-[1400px] mx-auto my-0"},Ze={class:"text-center"},Ge={class:"flex flex-col gap-10"},Je={class:"flex items-center"},Qe={class:"size-[48px] flex items-center justify-center"},ea={class:"flex items-center"},aa={class:"size-[48px] flex items-center justify-center"},ra=U({__name:"index",setup(r){const l=N(),i=H(),t=$(()=>l.userInfo);he(async()=>{l.initUserInfo(),xe().then(g=>{l.setIsPasswordSet(g.data.isSetPassword)})});const a=I("emailDialog"),m=I("passwordDialog"),o=I("nicknameDialog"),v=I("avatarDialog"),c=g=>{if(!l.isPasswordSet){h.error("请先设置登录密码");return}g.start(),l.setAllowEmailLogin(!l.isAllowEmailLogin).then(()=>{h.success(`邮箱登录${l.isAllowEmailLogin?"已开启":"已关闭"}`)}).finally(()=>{g.end()})},D=$(()=>[{key:"account",label:"账号",value:t.value?.account},{key:"nickname",label:"昵称",value:t.value?.nickname,defaultValue:"--",editable:!0,handlerText:"编辑",onHandler:()=>o.value?.open()},{key:"email",label:"邮箱",value:t.value?.email,defaultValue:"未绑定",editable:!0,handlerText:t.value?.email?"更换":"绑定",onHandler:()=>a.value?.open()},{key:"createTime",label:"注册时间",value:t.value?.createdAt?Se(t.value.createdAt).format("YYYY-MM-DD HH:mm:ss"):"--"}]);return(g,p)=>{const x=b("el-divider"),_=b("el-card"),e=b("Lock"),s=b("el-icon"),C=b("el-button"),u=b("Message"),k=b("el-switch");return S(),F("div",Ke,[d("div",Xe,[n(_,{class:"col-start-1 row-span-2 row-start-1"},{header:f(()=>[...p[2]||(p[2]=[d("span",null,"基本信息",-1)])]),default:f(()=>[d("div",Ze,[n(we,{size:80,shape:"square",src:B(i).avatar,class:"cursor-pointer border-[2px] border-[#ccc]",onClick:p[0]||(p[0]=L=>v.value?.open())},{default:f(()=>[q(R(t.value?.nickname?.charAt(0)||"U"),1)]),_:1},8,["src"]),d("h3",null,R(t.value?.account),1)]),n(x),n(Ye,{"info-list":D.value},null,8,["info-list"])]),_:1}),n(_,{class:"col-start-2"},{header:f(()=>[...p[3]||(p[3]=[d("span",null,"安全设置",-1)])]),default:f(()=>[d("div",Ge,[d("div",Je,[d("div",Qe,[n(s,null,{default:f(()=>[n(e)]),_:1})]),p[4]||(p[4]=d("div",{class:"flex-1"},[d("h4",null,"登录密码"),d("p",{class:"text-sm text-[#909399]"},"建议定期更换密码,确保账号安全")],-1)),n(C,{type:"primary",onClick:p[1]||(p[1]=L=>m.value?.open())},{default:f(()=>[q(R(B(l)?.isPasswordSet?"修改密码":"设置密码"),1)]),_:1})]),d("div",ea,[d("div",aa,[n(s,null,{default:f(()=>[n(u)]),_:1})]),p[5]||(p[5]=d("div",{class:"flex-1"},[d("h4",null,"邮箱登录"),d("p",{class:"text-sm text-[#909399]"},"允许使用邮箱作为登录账号")],-1)),n(ye,null,{default:f(({instance:L,loading:y})=>[n(k,{loading:y,"model-value":B(l).isAllowEmailLogin,onChange:V=>c(L)},null,8,["loading","model-value","onChange"])]),_:1})])])]),_:1})]),n(Ve,{ref:"emailDialog"},null,512),n(Ue,{ref:"passwordDialog"},null,512),n(Ie,{ref:"nicknameDialog"},null,512),n(We,{ref:"avatarDialog"},null,512)])}}});export{ra as default};
1
+ import{d as U,ar as N,k as w,m as $,r as b,B as P,w as f,a as d,b as n,ah as T,E as h,o as S,as as te,i as I,at as oe,h as H,au as le,ac as se,av as ne,aw as re,a2 as ie,ax as ue,u as B,ay as de,az as ce,aA as X,Z as pe,c as F,aB as me,aC as fe,v as Z,F as ve,N as _e,p as ge,t as R,f as q,x as he,aD as xe,aE as we,ai as ye}from"./index-cHbH7T5D.js";import{_ as W,e as M}from"./index.vue_vue_type_script_setup_true_lang-BMtIwDs3.js";import{a as j,d as be,e as ke}from"./index-BfqhDZ1z.js";import{m as Y}from"./md5-CejJMKeR.js";import{B as Ce,h as Se}from"./moment-DYVhN5eu.js";const De={class:"p-2"},$e={class:"flex gap-2"},Ee={class:"flex gap-2"},Ve=U({__name:"EmailDialog",setup(r,{expose:l}){const i=N(),t={OLD:"old",NEW:"new"},a=w(!1),m=w({}),o=w({}),v=w({onSubmit:()=>{D()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),c=$(()=>[{type:"input",field:"email",title:"旧邮箱",value:i?.userInfo?.email,validate:[{required:!0,message:"请输入旧邮箱",trigger:"blur"},{validator:(_,e,s)=>{j(e)?s():s(new Error("请输入正确的旧邮箱"))},trigger:"blur"}],props:{disabled:!0}},{type:"slotAuthCodeOld",field:"authCode",title:"旧验证码",validate:[{required:!0,message:"请输入旧验证码",trigger:"blur"}]},{type:"input",field:"newEmail",title:"新邮箱",value:"",validate:[{required:!0,message:"请输入新邮箱",trigger:"blur"},{validator:(_,e,s)=>{j(e)?s():s(new Error("请输入正确的新邮箱"))},trigger:"blur"}],props:{placeholder:"请输入新邮箱"}},{type:"slotAuthCodeNew",field:"newAuthCode",title:"新验证码",validate:[{required:!0,message:"请输入新验证码",trigger:"blur"}]}]);async function D(){v.value.submitBtn.loading=!0,te(o.value).then(()=>{h.success("邮箱修改成功"),i.setEmail(o.value.newEmail),x()}).finally(()=>{v.value.submitBtn.loading=!1})}function g(_,{end:e,startCountdown:s}){_===t.OLD?m.value.validateField("email").then(async()=>{await M({email:o.value.email}).then(()=>{h.success("验证码已发送"),s()})}).finally(()=>{e()}):_===t.NEW&&m.value.validateField("newEmail").then(async()=>{await M({email:o.value.newEmail}).then(()=>{h.success("新验证码已发送"),s()})}).finally(()=>{e()})}function p(){a.value=!0}function x(){a.value=!1}return l({open:p,close:x}),(_,e)=>{const s=b("el-input"),C=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":e[4]||(e[4]=u=>a.value=u),"show-close":!0,width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",De,[n(C,{rule:c.value,modelValue:o.value,"onUpdate:modelValue":e[2]||(e[2]=u=>o.value=u),api:m.value,"onUpdate:api":e[3]||(e[3]=u=>m.value=u),option:v.value},{"type-slotAuthCodeOld":f(u=>[d("div",$e,[n(s,{"model-value":String(u.model.value??""),class:"flex-1",onInput:k=>u.model.callback(k),placeholder:"请输入验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:e[0]||(e[0]=k=>g(t.OLD,k))})])]),"type-slotAuthCodeNew":f(u=>[d("div",Ee,[n(s,{"model-value":String(u.model.value??""),class:"flex-1",onInput:k=>u.model.callback(k),placeholder:"请输入新验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:e[1]||(e[1]=k=>g(t.NEW,k))})])]),_:1},8,["rule","modelValue","api","option"])])]),_:1},8,["modelValue"])}}}),Ae={class:"p-2"},Pe={class:"flex gap-2"},Ue=U({__name:"PasswordDialog",setup(r,{expose:l}){const i=N(),t=I("baseForm"),a=w(!1),m=w({}),o=w({}),v=w({onSubmit:()=>{D()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),c=$(()=>[{type:"input",field:"newPassword",title:i.isPasswordSet?"新密码":"设置密码",value:"",props:{placeholder:"请输入新密码",type:"password",showPassword:!0,autocomplete:"new-password"},validate:[{required:!0,message:"请输入新密码",trigger:"blur"}]},{type:"input",field:"confirmNewPassword",title:i.isPasswordSet?"确认新密码":"确认密码",value:"",props:{placeholder:"请确认新密码",type:"password",showPassword:!0,autocomplete:"new-password"},validate:[{required:!0,message:"请确认新密码",trigger:"blur"}]},{type:"input",field:"email",title:"邮箱",value:i?.userInfo?.email,props:{disabled:!0},validate:[{required:!0,message:"请输入邮箱",trigger:"blur"}]},{type:"slotAuthCode",field:"emailAuthCode",title:"验证码",value:""}]);async function D(){v.value.submitBtn.loading=!0;const _={newPassword:Y(o.value.newPassword),confirmNewPassword:Y(o.value.confirmNewPassword),email:o.value.email,emailAuthCode:o.value.emailAuthCode};oe(_).then(()=>{h.success("密码修改成功"),t.value?.resetFields(),i.setIsPasswordSet(!0),x()}).finally(()=>{v.value.submitBtn.loading=!1})}function g({end:_,startCountdown:e}){m.value.validateField("email").then(async()=>{await M({email:o.value.email}).then(()=>{h.success("验证码已发送"),e()})}).finally(()=>{_()})}function p(){a.value=!0}function x(){a.value=!1}return l({open:p,close:x}),(_,e)=>{const s=b("el-input"),C=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":e[2]||(e[2]=u=>a.value=u),"show-close":!0,width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",Ae,[n(C,{rule:c.value,modelValue:o.value,"onUpdate:modelValue":e[0]||(e[0]=u=>o.value=u),api:m.value,"onUpdate:api":e[1]||(e[1]=u=>m.value=u),option:v.value},{"type-slotAuthCode":f(u=>[d("div",Pe,[n(s,{"model-value":String(u.model.value),onInput:k=>u.model.callback(k),class:"flex-1",placeholder:"请输入验证码"},null,8,["model-value","onInput"]),n(W,{text:"获取验证码","countdown-text":"{n}秒后重新获取",duration:60,onSend:g})])]),_:1},8,["rule","modelValue","api","option"])])]),_:1},8,["modelValue"])}}}),Le={class:"p-2"},Ie=U({__name:"NicknameDialog",setup(r,{expose:l}){const i=N(),t=H(),a=w(!1),m=w({onSubmit:()=>{c()},form:{labelWidth:"auto"},submitBtn:{loading:!1}}),o=w({}),v=$(()=>[{type:"input",field:"nickname",title:"昵称",value:i.userInfo.nickname,props:{placeholder:"请输入昵称"},validate:[{required:!0,message:"请输入昵称",trigger:"blur"},{min:3,max:10,message:"长度在 2 到 10 个字符",trigger:"blur"}]}]);async function c(){if(m.value.submitBtn.loading=!0,o.value.nickname===i.userInfo.nickname){h.success("修改成功"),m.value.submitBtn.loading=!1,g();return}le({nickname:o.value.nickname}).then(()=>{i.setNickname(o.value.nickname),t.updateNickname(o.value.nickname),h.success("修改成功"),g()}).finally(()=>{m.value.submitBtn.loading=!1})}function D(){a.value=!0}function g(){a.value=!1}return l({open:D,close:g}),(p,x)=>{const _=b("form-create");return S(),P(T,{modelValue:a.value,"onUpdate:modelValue":x[1]||(x[1]=e=>a.value=e),width:"400px","destroy-on-close":!0},{default:f(()=>[d("div",Le,[n(_,{rule:v.value,modelValue:o.value,"onUpdate:modelValue":x[0]||(x[0]=e=>o.value=e),option:m.value},null,8,["rule","modelValue","option"])])]),_:1},8,["modelValue"])}}}),Be=U({__name:"index",props:{cover:{type:Boolean}},setup(r){const l=r,i=ce(),t=se(),a=ne(),m={autoUpload:!1,cover:!1,onChange:p,onExceed:_,beforeUpload:G(),onError:x},o=w(null),v=w(),c=$(()=>({...m,...be(t),...l})),D=$(()=>({...a,default:a.default?e=>a.default({...e,fileUrl:o.value}):void 0}));function g(e){v.value=e,i&&(i.exposed=e||{},i.exposeProxy=e||{})}function p(...e){const[s,C]=e;c.value.fileList&&(c.value.fileList=C),s?.raw&&(o.value=URL.createObjectURL(s.raw))}function x(...e){const[s]=e;h.error(s.message)}function _(...e){const[s,C]=e;if(c.value.cover&&c?.value?.limit===1){v.value?.clearFiles();const u=s[0];u.uid=re(),v.value.handleStart(u);return}h.warning(`最多只能选择 ${c?.value?.limit} 个文件,本次已选择 ${s.length} 个,共将上传 ${s.length+C.length} 个文件`)}return(e,s)=>(S(),P(ie(ue(B(de),{...c.value,ref:g},D.value))))}}),K=r=>r.size/1024/1024>20?(h.error("上传文件大小不能超过 20MB!"),!1):!0;function G(r={}){const{mode:l="extend",custom:i}=r;return t=>l==="override"&&i?i(t):l==="extend"?K(t)?i?i(t):!0:!1:K(t)}function Re(r,l){const i=l.name.slice(l.name.lastIndexOf(".")+1).toLowerCase(),t=r.dir+r.key+"."+i,a=new FormData;return a.append("success_action_status","200"),a.append("policy",r.policy),a.append("x-oss-signature",r.signature),a.append("x-oss-signature-version",r.x_oss_signature_version),a.append("x-oss-credential",r.x_oss_credential),a.append("x-oss-date",r.x_oss_date),a.append("key",t),a.append("x-oss-security-token",r.security_token),a.append("Cache-Control","public, max-age=31536000"),a.append("file",l),{host:r.host,filePath:t,formData:a}}async function Fe(r,l){return fetch(r,{method:"POST",body:l})}async function Ne(r){return X("/__remote__/api/v1/oss/compOssDir",{method:"POST"})}async function Te(r,l){return X("/__remote__/api/v1/oss/putPolicy",{method:"POST",headers:{"Content-Type":"application/json"},data:r})}const Oe=["src","onLoad"],qe=U({__name:"AvatarDialog",setup(r,{expose:l}){const i=N(),t=H(),a=w([]),m=$(()=>({avatar:i.userInfo.avatar})),o=w(!1),v=I("avatarUpload"),c=w(),D=$(()=>({limit:1,cover:!0,onError:x,beforeUpload:p,showFileList:!1,httpRequest:u})),g=$(()=>({showReset:!1,rows:[{type:"slot",label:"头像",prop:"avatar"}],rules:{avatar:[{required:!0,message:"请上传头像",trigger:"change"}]}})),p=G({custom(y){return y.type.startsWith("image/")?!0:(h.error("上传图片只能是图片格式!"),c.value?.(),!1)}});function x(y){c.value?.(),h.error(y.message)}async function _({end:y}){if(c.value=y,!a.value||a.value.length===0){h.warning("请先选择文件"),c.value();return}v.value?.submit()}function e(y){fe({avatar:y}).then(()=>{t.updateAvatar(y),L(),h.success("修改成功")}).finally(()=>{c.value?.()})}function s(){v.value?.clearFiles()}function C(){v.value?.clearFiles()}async function u(y){const V=await Ne(),{imageDir:O}=V.data,E=await Te({type:O});if(E.code!==0||!E.data)return h.error(E.message);const{host:A,filePath:J,formData:Q}=Re(E.data,y.file),z=await Fe(A,Q);if(z.ok)e(J);else{const ee=await z.text(),ae=ke(ee);h.error(ae.message),c.value?.()}}function k(){o.value=!0}function L(){o.value=!1,C()}return l({open:k,close:L}),(y,V)=>{const O=b("el-icon");return S(),P(T,{modelValue:o.value,"onUpdate:modelValue":V[1]||(V[1]=E=>o.value=E),width:"400px",onClose:C,"destroy-on-close":!0},{default:f(()=>[n(Ce,{onSubmit:_,onReset:s,initialData:m.value,config:g.value},{avatar:f(({updateModelValue:E})=>[n(B(Be),pe({ref:"avatarUpload",class:"avatar-uploader","file-list":a.value,"onUpdate:fileList":V[0]||(V[0]=A=>a.value=A)},D.value),{default:f(({fileUrl:A})=>[A?(S(),F("img",{key:0,src:A,class:"avatar",onLoad:()=>E(A)},null,40,Oe)):(S(),P(O,{key:1,class:"avatar-uploader-icon"},{default:f(()=>[n(B(me))]),_:1}))]),_:2},1040,["file-list"])]),_:1},8,["initialData","config"])]),_:1},8,["modelValue"])}}}),We=Z(qe,[["__scopeId","data-v-36bba531"]]),Me={class:"info-list"},He={class:"label"},ze={class:"value"},je=U({__name:"index",props:{infoList:{}},setup(r){return(l,i)=>{const t=b("el-button");return S(),F("div",Me,[(S(!0),F(ve,null,_e(r.infoList,a=>(S(),F("div",{key:a.key,class:"info-item"},[d("span",He,R(a.label),1),d("span",ze,R(a.value||a.defaultValue),1),a.handlerText?(S(),P(t,{key:0,link:"",type:"primary",onClick:m=>a.onHandler?.()},{default:f(()=>[q(R(a.handlerText),1)]),_:2},1032,["onClick"])):ge("",!0)]))),128))])}}}),Ye=Z(je,[["__scopeId","data-v-b89568e4"]]),Ke={class:"h-full"},Xe={class:"grid grid-cols-[8fr_13fr] gap-[24px] max-w-[1400px] mx-auto my-0"},Ze={class:"text-center"},Ge={class:"flex flex-col gap-10"},Je={class:"flex items-center"},Qe={class:"size-[48px] flex items-center justify-center"},ea={class:"flex items-center"},aa={class:"size-[48px] flex items-center justify-center"},ra=U({__name:"index",setup(r){const l=N(),i=H(),t=$(()=>l.userInfo);he(async()=>{l.initUserInfo(),xe().then(g=>{l.setIsPasswordSet(g.data.isSetPassword)})});const a=I("emailDialog"),m=I("passwordDialog"),o=I("nicknameDialog"),v=I("avatarDialog"),c=g=>{if(!l.isPasswordSet){h.error("请先设置登录密码");return}g.start(),l.setAllowEmailLogin(!l.isAllowEmailLogin).then(()=>{h.success(`邮箱登录${l.isAllowEmailLogin?"已开启":"已关闭"}`)}).finally(()=>{g.end()})},D=$(()=>[{key:"account",label:"账号",value:t.value?.account},{key:"nickname",label:"昵称",value:t.value?.nickname,defaultValue:"--",editable:!0,handlerText:"编辑",onHandler:()=>o.value?.open()},{key:"email",label:"邮箱",value:t.value?.email,defaultValue:"未绑定",editable:!0,handlerText:t.value?.email?"更换":"绑定",onHandler:()=>a.value?.open()},{key:"createTime",label:"注册时间",value:t.value?.createdAt?Se(t.value.createdAt).format("YYYY-MM-DD HH:mm:ss"):"--"}]);return(g,p)=>{const x=b("el-divider"),_=b("el-card"),e=b("Lock"),s=b("el-icon"),C=b("el-button"),u=b("Message"),k=b("el-switch");return S(),F("div",Ke,[d("div",Xe,[n(_,{class:"col-start-1 row-span-2 row-start-1"},{header:f(()=>[...p[2]||(p[2]=[d("span",null,"基本信息",-1)])]),default:f(()=>[d("div",Ze,[n(we,{size:80,shape:"square",src:B(i).avatar,class:"cursor-pointer border-[2px] border-[#ccc]",onClick:p[0]||(p[0]=L=>v.value?.open())},{default:f(()=>[q(R(t.value?.nickname?.charAt(0)||"U"),1)]),_:1},8,["src"]),d("h3",null,R(t.value?.account),1)]),n(x),n(Ye,{"info-list":D.value},null,8,["info-list"])]),_:1}),n(_,{class:"col-start-2"},{header:f(()=>[...p[3]||(p[3]=[d("span",null,"安全设置",-1)])]),default:f(()=>[d("div",Ge,[d("div",Je,[d("div",Qe,[n(s,null,{default:f(()=>[n(e)]),_:1})]),p[4]||(p[4]=d("div",{class:"flex-1"},[d("h4",null,"登录密码"),d("p",{class:"text-sm text-[#909399]"},"建议定期更换密码,确保账号安全")],-1)),n(C,{type:"primary",onClick:p[1]||(p[1]=L=>m.value?.open())},{default:f(()=>[q(R(B(l)?.isPasswordSet?"修改密码":"设置密码"),1)]),_:1})]),d("div",ea,[d("div",aa,[n(s,null,{default:f(()=>[n(u)]),_:1})]),p[5]||(p[5]=d("div",{class:"flex-1"},[d("h4",null,"邮箱登录"),d("p",{class:"text-sm text-[#909399]"},"允许使用邮箱作为登录账号")],-1)),n(ye,null,{default:f(({instance:L,loading:y})=>[n(k,{loading:y,"model-value":B(l).isAllowEmailLogin,onChange:V=>c(L)},null,8,["loading","model-value","onChange"])]),_:1})])])]),_:1})]),n(Ve,{ref:"emailDialog"},null,512),n(Ue,{ref:"passwordDialog"},null,512),n(Ie,{ref:"nicknameDialog"},null,512),n(We,{ref:"avatarDialog"},null,512)])}}});export{ra as default};
@@ -1 +1 @@
1
- import{d as Q,K as ue,m as l,M as ie,ac as J,n as L,r as C,B as y,w as v,c as h,p as M,o as s,F as P,N as x,a2 as G,Z as O,bz as I,b as N,f as q,u as Z,bA as re,b1 as fe,bt as ce,ao as de,i as H,aS as ge,k as z,bB as ve,y as W,bC as me,x as pe,W as be,X as ye,aI as b,a as he,ae as Ce,aN as Ne,v as Se}from"./index-BCju3w1f.js";import{j as _e,k as ze}from"./index-BnJyLrXy.js";const Oe=Q({__name:"index",props:ue({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const k=u,R=l(()=>{const o={};return k.config?.column?.forEach(e=>{o[e.prop]=e.value}),o}),n=ie(u,"modelValue"),S=J();async function T(){S?.onRefresh?.()}async function A(){k.config?.column?.forEach(o=>{o.value=""}),await de(),S?.onReset?.()}function m(o){return o??!0}function p(){S?.onSearch?.()}return L(()=>{n.value=R.value}),(o,e)=>{const i=C("el-form-item"),c=C("el-button"),U=C("el-form");return s(),y(U,{onSubmit:e[3]||(e[3]=ce(()=>{},["prevent"])),onKeyup:e[4]||(e[4]=fe(a=>p(),["enter"])),inline:!0},{default:v(()=>[(s(!0),h(P,null,x(u.config?.column||[],(a,$)=>(s(),y(i,{key:$,label:a.label},{default:v(()=>[m(a.useVModel)?(s(),y(G(a.type),O({key:1,modelValue:a.value,"onUpdate:modelValue":K=>a.value=K},{ref_for:!0},a?.attributes||{},I(a?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(s(),y(G(a.type),O({key:0,"model-value":a.value},{ref_for:!0},a?.attributes||{},I(a?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),u.config?.column?.length?(s(),y(i,{key:0},{default:v(()=>[N(c,{type:"success",onClick:e[0]||(e[0]=a=>p())},{default:v(()=>[...e[5]||(e[5]=[q("查询",-1)])]),_:1}),N(c,{type:"primary",onClick:e[1]||(e[1]=a=>A())},{default:v(()=>[...e[6]||(e[6]=[q("重置",-1)])]),_:1}),N(c,{onClick:e[2]||(e[2]=a=>T()),icon:Z(re)},null,8,["icon"])]),_:1})):M("",!0)]),_:1})}}}),ke={key:0},Ve={ref:"tableContainer",class:"flex-1 overflow-hidden"},Ee={key:1,class:"mt-2"},we=Q({__name:"index",props:{tableConfig:{}},setup(u,{expose:k}){const R=J(),n=u,S=H("tableContainer"),T=H("table"),{height:A}=ge(S),m=z(Number(ve()||10)),p=z(!1),o=z(1),e=z(ee()),i=z("UNKNOWN"),c=l(()=>n.tableConfig.size||""),U=l(()=>n.tableConfig?.fixedHeight??!0),a=l(()=>U.value?Math.max(A.value,100):"auto"),$=l(()=>n.tableConfig?.autoLoading??!0),K=l(()=>({"--pagination-location":n.tableConfig?.pagination?.location||"center"})),F=l(()=>n.tableConfig?.isPagination??!0),B=l(()=>n.tableConfig?.paginationMap?n.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),j=l(()=>({[B.value.page]:o.value,[B.value.pageSize]:m.value})),Y=l(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...n.tableConfig?.pagination?.attributes||{},total:n.tableConfig?.pagination?.total||0,pageSize:m.value,currentPage:o.value})),X=l(()=>({...j.value,...e.value})),D=l(()=>n.tableConfig?.search?.column.filter(t=>t.autoQuery??!0).map(t=>t.prop));function ee(){const t={};return n.tableConfig?.search?.column?.forEach(g=>{t[g.prop]=g.value}),t}async function d(){i.value!=="NOT_CHANGE"&&($.value&&(p.value=!0),n.tableConfig?.fetchData?.(X.value)?.finally(()=>{i.value="NOT_CHANGE",p.value=!1}))}async function te(){await d()}async function ae(){i.value="UNKNOWN",await d()}async function ne(){o.value=1,i.value!=="AUTO_QUERY"&&await d()}async function oe(t){o.value=1,m.value=t}async function le(t){o.value=t}function se(){i.value="UNKNOWN",d()}return W(()=>JSON.stringify(e.value),(t,g)=>{i.value="UNKNOWN";const _=JSON.parse(t??"{}"),V=JSON.parse(g??"{}"),E=Object.keys(_),w=Object.keys(V);let r=[];E.length===w.length?r=Object.keys(_).filter(f=>_[f]!==V[f]):r=_e(E,w),D.value?.length&&ze(r,[...D.value])&&(i.value="AUTO_QUERY",d())}),W(()=>JSON.stringify(j.value),()=>{i.value="UNKNOWN",d()}),L(()=>{me(m.value.toString())}),pe(()=>{d()}),k({getTableRef:()=>T.value,forceRefreshData:se}),(t,g)=>{const _=C("el-table-column"),V=C("el-table"),E=C("el-pagination"),w=be("loading");return ye((s(),h("div",{class:"size-full flex flex-col overflow-hidden",style:Ce(K.value)},[u.tableConfig.search?(s(),h("div",ke,[b(t.$slots,"search",{},()=>[N(Oe,{modelValue:e.value,"onUpdate:modelValue":g[0]||(g[0]=r=>e.value=r),config:u.tableConfig.search,size:c.value,onSearch:te,onRefresh:ae,onReset:ne},null,8,["modelValue","config","size"])],!0)])):M("",!0),b(t.$slots,"tableBefore",{},void 0,!0),he("div",Ve,[b(t.$slots,"table",{},()=>[N(V,O({ref:"table",data:u.tableConfig.data,height:a.value,size:c.value},Z(R)),Ne({default:v(()=>[(s(!0),h(P,null,x(u.tableConfig.column,(r,f)=>(s(),h(P,null,[r.slot?b(t.$slots,r.slot,{key:0,col:r,index:f},void 0,!0):(s(),y(_,O({key:`default-${f}`},{ref_for:!0},r),null,16))],64))),256))]),_:2},[x(t.$slots,(r,f)=>({name:f,fn:v(()=>[b(t.$slots,f,{},void 0,!0)])}))]),1040,["data","height","size"])],!0)],512),F.value?(s(),h("div",Ee,[b(t.$slots,"pagination",{},()=>[N(E,O({size:c.value},Y.value,{onSizeChange:oe,onCurrentChange:le},I(u.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):M("",!0)],4)),[[w,p.value]])}}}),Ae=Se(we,[["__scopeId","data-v-e6922157"]]);export{Ae as B};
1
+ import{d as Q,K as ue,m as l,M as ie,ac as J,n as L,r as C,B as y,w as v,c as h,p as M,o as s,F as P,N as x,a2 as G,Z as O,by as I,b as N,f as q,u as Z,bz as re,b0 as fe,bs as ce,ao as de,i as H,aR as ge,k as z,bA as ve,y as W,bB as me,x as pe,W as be,X as ye,aI as b,a as he,ae as Ce,aN as Ne,v as Se}from"./index-cHbH7T5D.js";import{j as _e,k as ze}from"./index-BfqhDZ1z.js";const Oe=Q({__name:"index",props:ue({config:{}},{modelValue:{type:Object,default:()=>({})},modelModifiers:{}}),emits:["update:modelValue"],setup(u){const k=u,w=l(()=>{const o={};return k.config?.column?.forEach(e=>{o[e.prop]=e.value}),o}),n=ie(u,"modelValue"),S=J();async function T(){S?.onRefresh?.()}async function A(){k.config?.column?.forEach(o=>{o.value=""}),await de(),S?.onReset?.()}function m(o){return o??!0}function p(){S?.onSearch?.()}return L(()=>{n.value=w.value}),(o,e)=>{const i=C("el-form-item"),c=C("el-button"),U=C("el-form");return s(),y(U,{onSubmit:e[3]||(e[3]=ce(()=>{},["prevent"])),onKeyup:e[4]||(e[4]=fe(a=>p(),["enter"])),inline:!0},{default:v(()=>[(s(!0),h(P,null,x(u.config?.column||[],(a,$)=>(s(),y(i,{key:$,label:a.label},{default:v(()=>[m(a.useVModel)?(s(),y(G(a.type),O({key:1,modelValue:a.value,"onUpdate:modelValue":K=>a.value=K},{ref_for:!0},a?.attributes||{},I(a?.events||{})),null,16,["modelValue","onUpdate:modelValue"])):(s(),y(G(a.type),O({key:0,"model-value":a.value},{ref_for:!0},a?.attributes||{},I(a?.events||{})),null,16,["model-value"]))]),_:2},1032,["label"]))),128)),u.config?.column?.length?(s(),y(i,{key:0},{default:v(()=>[N(c,{type:"success",onClick:e[0]||(e[0]=a=>p())},{default:v(()=>[...e[5]||(e[5]=[q("查询",-1)])]),_:1}),N(c,{type:"primary",onClick:e[1]||(e[1]=a=>A())},{default:v(()=>[...e[6]||(e[6]=[q("重置",-1)])]),_:1}),N(c,{onClick:e[2]||(e[2]=a=>T()),icon:Z(re)},null,8,["icon"])]),_:1})):M("",!0)]),_:1})}}}),ke={key:0},Ve={ref:"tableContainer",class:"flex-1 overflow-hidden"},Ee={key:1,class:"mt-2"},Re=Q({__name:"index",props:{tableConfig:{}},setup(u,{expose:k}){const w=J(),n=u,S=H("tableContainer"),T=H("table"),{height:A}=ge(S),m=z(Number(ve()||10)),p=z(!1),o=z(1),e=z(ee()),i=z("UNKNOWN"),c=l(()=>n.tableConfig.size||""),U=l(()=>n.tableConfig?.fixedHeight??!0),a=l(()=>U.value?Math.max(A.value,100):"auto"),$=l(()=>n.tableConfig?.autoLoading??!0),K=l(()=>({"--pagination-location":n.tableConfig?.pagination?.location||"center"})),F=l(()=>n.tableConfig?.isPagination??!0),B=l(()=>n.tableConfig?.paginationMap?n.tableConfig.paginationMap:{page:"page",pageSize:"pageSize"}),j=l(()=>({[B.value.page]:o.value,[B.value.pageSize]:m.value})),Y=l(()=>({background:!0,pageSizes:[10,20,30,50],layout:"total, sizes, prev, pager, next, jumper",...n.tableConfig?.pagination?.attributes||{},total:n.tableConfig?.pagination?.total||0,pageSize:m.value,currentPage:o.value})),X=l(()=>({...j.value,...e.value})),D=l(()=>n.tableConfig?.search?.column.filter(t=>t.autoQuery??!0).map(t=>t.prop));function ee(){const t={};return n.tableConfig?.search?.column?.forEach(g=>{t[g.prop]=g.value}),t}async function d(){i.value!=="NOT_CHANGE"&&($.value&&(p.value=!0),n.tableConfig?.fetchData?.(X.value)?.finally(()=>{i.value="NOT_CHANGE",p.value=!1}))}async function te(){await d()}async function ae(){i.value="UNKNOWN",await d()}async function ne(){o.value=1,i.value!=="AUTO_QUERY"&&await d()}async function oe(t){o.value=1,m.value=t}async function le(t){o.value=t}function se(){i.value="UNKNOWN",d()}return W(()=>JSON.stringify(e.value),(t,g)=>{i.value="UNKNOWN";const _=JSON.parse(t??"{}"),V=JSON.parse(g??"{}"),E=Object.keys(_),R=Object.keys(V);let r=[];E.length===R.length?r=Object.keys(_).filter(f=>_[f]!==V[f]):r=_e(E,R),D.value?.length&&ze(r,[...D.value])&&(i.value="AUTO_QUERY",d())}),W(()=>JSON.stringify(j.value),()=>{i.value="UNKNOWN",d()}),L(()=>{me(m.value.toString())}),pe(()=>{d()}),k({getTableRef:()=>T.value,forceRefreshData:se}),(t,g)=>{const _=C("el-table-column"),V=C("el-table"),E=C("el-pagination"),R=be("loading");return ye((s(),h("div",{class:"size-full flex flex-col overflow-hidden",style:Ce(K.value)},[u.tableConfig.search?(s(),h("div",ke,[b(t.$slots,"search",{},()=>[N(Oe,{modelValue:e.value,"onUpdate:modelValue":g[0]||(g[0]=r=>e.value=r),config:u.tableConfig.search,size:c.value,onSearch:te,onRefresh:ae,onReset:ne},null,8,["modelValue","config","size"])],!0)])):M("",!0),b(t.$slots,"tableBefore",{},void 0,!0),he("div",Ve,[b(t.$slots,"table",{},()=>[N(V,O({ref:"table",data:u.tableConfig.data,height:a.value,size:c.value},Z(w)),Ne({default:v(()=>[(s(!0),h(P,null,x(u.tableConfig.column,(r,f)=>(s(),h(P,null,[r.slot?b(t.$slots,r.slot,{key:0,col:r,index:f},void 0,!0):(s(),y(_,O({key:`default-${f}`},{ref_for:!0},r),null,16))],64))),256))]),_:2},[x(t.$slots,(r,f)=>({name:f,fn:v(()=>[b(t.$slots,f,{},void 0,!0)])}))]),1040,["data","height","size"])],!0)],512),F.value?(s(),h("div",Ee,[b(t.$slots,"pagination",{},()=>[N(E,O({size:c.value},Y.value,{onSizeChange:oe,onCurrentChange:le},I(u.tableConfig?.pagination?.events||{})),null,16,["size"])],!0)])):M("",!0)],4)),[[R,p.value]])}}}),Ae=Se(Re,[["__scopeId","data-v-e6922157"]]);export{Ae as B};
@@ -1 +1 @@
1
- import{_ as s}from"./index.vue_vue_type_style_index_0_lang-D5mLFRCT.js";import{d as a,G as c,m as n,H as i,J as m,c as l,b as u,o as _}from"./index-BCju3w1f.js";import"./atom-one-dark-k3s8nS4Q.js";const p={class:"md-container size-full w-[1300px] mx-auto overflow-auto"},w=a({__name:"index",setup(d){const r=c(),t=n(()=>{const{compPath:e,mdPath:o}=r.query;return!e||!o?"":`${e.replace(i.dirname,`${m}/`)}/${o.slice(1)}`});return(e,o)=>(_(),l("div",p,[u(s,{src:t.value,"show-toc":!0,scrollContainer:".md-container"},null,8,["src"])]))}});export{w as default};
1
+ import{_ as s}from"./index.vue_vue_type_style_index_0_lang-BVuL5ED4.js";import{d as a,G as c,m as n,H as i,J as m,c as l,b as u,o as _}from"./index-cHbH7T5D.js";import"./atom-one-dark-B2H-r86L.js";const p={class:"md-container size-full w-[1300px] mx-auto overflow-auto"},w=a({__name:"index",setup(d){const r=c(),t=n(()=>{const{compPath:e,mdPath:o}=r.query;return!e||!o?"":`${e.replace(i.dirname,`${m}/`)}/${o.slice(1)}`});return(e,o)=>(_(),l("div",p,[u(s,{src:t.value,"show-toc":!0,scrollContainer:".md-container"},null,8,["src"])]))}});export{w as default};
@@ -1 +1 @@
1
- import{d as B,G as L,V as b,m as n,ad as F,J as h,x as M,r as N,c as R,b as r,w as c,a as p,O as I,P as O,B as A,p as j,o as v,f as z,t as U,Y as G,aG as K,af as Y,a4 as H,a5 as J}from"./index-BCju3w1f.js";import{a as W,C as X,_ as q}from"./index.vue_vue_type_script_setup_true_lang-DZI9cQ6F.js";import{a as Q}from"./index-DCQCk6Lt.js";import{h as Z,c as _}from"./index-BnJyLrXy.js";import{m as ee}from"./v1Module-BPYVWmkw.js";import{C as ae}from"./index.vue_vue_type_script_setup_true_lang-B6qjGW9b.js";import"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import"./index.vue_vue_type_style_index_0_lang-D5mLFRCT.js";import"./atom-one-dark-k3s8nS4Q.js";import"./useTeamHeaders-3AldZ0JH.js";import"./index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js";const te={class:"preview-container size-full overflow-x-hidden overflow-y-scroll"},oe={class:"h-[50vh]"},se={class:"w-full flex flex-col gap-1"},le={class:"text-xs flex items-center"},Pe=B({__name:"index",setup(ne){const P=new Map;H(J.CALLBACKS,P);const w=L(),C=b(),{openCompPathInVscode:g,handlePath:y}=F(),{compId:i}=w.params,o=Q(i)(),u=n(()=>Z(o.dep??[])),D=n(()=>y(t.value.fullPath,1)),t=n(()=>o.detail),d=n(()=>Object.keys(t.value??{}).length>0),f=n(()=>{const e=t.value?.previewConfigs??[];if(!e.length)return[];const s=a=>{const m=_(t.value.path,a);return`${h}/${m}`},l=e.filter(a=>a.fullPath?.length);return l.length?l.map(a=>({finalEntryUrl:s(a.fullPath??[])})):e.filter(a=>a.miniPath?.length).map(a=>({finalEntryUrl:s(a.miniPath??[])}))}),x=n(()=>{const e=f.value.length===1?"none":"";return{previews:f.value,dep:o.dep,depToFile:o.depToFile,indicatorPosition:e,bgColor:t.value.bgColor??"#fff"}}),E=n(()=>{const e=_(t.value.path,["\\README.md"]);return`${h}/${e}`});function V(){g(t.value.fullPath,"./comp.json")}async function k(){if(!i)return;const e=await K({fullPathHash:i}),s=await Y({compPath:e.data.path}),{thirdParty:l=[]}=s.data,a=l.map($=>$.name),m=await ee({deps:a}),{entryNameToFile:T={}}=m.data;o.setDetail(e.data),o.setDep(l),o.setDepToFile(T)}function S(){C.addPayLoad(`/previewLocal/${i}`,{name:`本地组件:${t.value?.name??""}`})}return M(async()=>{d.value||await k(),S()}),(e,s)=>{const l=N("el-link");return v(),R("div",te,[r(G,{isEmpty:!d.value},{default:c(()=>[p("div",oe,[r(W,{title:t.value?.name,actions:["maximize"]},{default:c(()=>[r(X,I(O(x.value)),{compToolBar:c(()=>[p("div",se,[u.value.length>0?(v(),A(ae,{key:0,compDeps:u.value},null,8,["compDeps"])):j("",!0),p("div",le,[s[0]||(s[0]=p("span",null,"组件位置:",-1)),r(l,{href:"javascript:void(0)",type:"primary",underline:"always",title:t.value.fullPath,onClick:V},{default:c(()=>[z(U(D.value),1)]),_:1},8,["title"])])])]),_:1},16)]),_:1},8,["title"])]),r(q,{mdSrc:E.value,scrollContainer:".preview-container",stickyTopDistance:0,showSimilarComp:!1},null,8,["mdSrc"])]),_:1},8,["isEmpty"])])}}});export{Pe as default};
1
+ import{d as B,G as L,V as b,m as n,ad as F,J as h,x as M,r as N,c as R,b as r,w as c,a as p,O as I,P as O,B as A,p as j,o as v,f as z,t as U,Y as G,aG as K,af as Y,a4 as H,a5 as J}from"./index-cHbH7T5D.js";import{a as W,C as X,_ as q}from"./index.vue_vue_type_script_setup_true_lang-Cj1ig2OS.js";import{a as Q}from"./index-CPx4gS-Z.js";import{h as Z,c as _}from"./index-BfqhDZ1z.js";import{m as ee}from"./v1Module-Clll6gmK.js";import{C as ae}from"./index.vue_vue_type_script_setup_true_lang-C2jCrlom.js";import"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import"./index.vue_vue_type_style_index_0_lang-BVuL5ED4.js";import"./atom-one-dark-B2H-r86L.js";import"./useTeamHeaders-22mJVwWy.js";import"./index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js";const te={class:"preview-container size-full overflow-x-hidden overflow-y-scroll"},oe={class:"h-[50vh]"},se={class:"w-full flex flex-col gap-1"},le={class:"text-xs flex items-center"},Pe=B({__name:"index",setup(ne){const P=new Map;H(J.CALLBACKS,P);const w=L(),C=b(),{openCompPathInVscode:g,handlePath:y}=F(),{compId:i}=w.params,o=Q(i)(),u=n(()=>Z(o.dep??[])),D=n(()=>y(t.value.fullPath,1)),t=n(()=>o.detail),d=n(()=>Object.keys(t.value??{}).length>0),f=n(()=>{const e=t.value?.previewConfigs??[];if(!e.length)return[];const s=a=>{const m=_(t.value.path,a);return`${h}/${m}`},l=e.filter(a=>a.fullPath?.length);return l.length?l.map(a=>({finalEntryUrl:s(a.fullPath??[])})):e.filter(a=>a.miniPath?.length).map(a=>({finalEntryUrl:s(a.miniPath??[])}))}),x=n(()=>{const e=f.value.length===1?"none":"";return{previews:f.value,dep:o.dep,depToFile:o.depToFile,indicatorPosition:e,bgColor:t.value.bgColor??"#fff"}}),E=n(()=>{const e=_(t.value.path,["\\README.md"]);return`${h}/${e}`});function V(){g(t.value.fullPath,"./comp.json")}async function k(){if(!i)return;const e=await K({fullPathHash:i}),s=await Y({compPath:e.data.path}),{thirdParty:l=[]}=s.data,a=l.map($=>$.name),m=await ee({deps:a}),{entryNameToFile:T={}}=m.data;o.setDetail(e.data),o.setDep(l),o.setDepToFile(T)}function S(){C.addPayLoad(`/previewLocal/${i}`,{name:`本地组件:${t.value?.name??""}`})}return M(async()=>{d.value||await k(),S()}),(e,s)=>{const l=N("el-link");return v(),R("div",te,[r(G,{isEmpty:!d.value},{default:c(()=>[p("div",oe,[r(W,{title:t.value?.name,actions:["maximize"]},{default:c(()=>[r(X,I(O(x.value)),{compToolBar:c(()=>[p("div",se,[u.value.length>0?(v(),A(ae,{key:0,compDeps:u.value},null,8,["compDeps"])):j("",!0),p("div",le,[s[0]||(s[0]=p("span",null,"组件位置:",-1)),r(l,{href:"javascript:void(0)",type:"primary",underline:"always",title:t.value.fullPath,onClick:V},{default:c(()=>[z(U(D.value),1)]),_:1},8,["title"])])])]),_:1},16)]),_:1},8,["title"])]),r(q,{mdSrc:E.value,scrollContainer:".preview-container",stickyTopDistance:0,showSimilarComp:!1},null,8,["mdSrc"])]),_:1},8,["isEmpty"])])}}});export{Pe as default};
@@ -1 +1 @@
1
- import{_ as me,a as Y,C as de}from"./index.vue_vue_type_script_setup_true_lang-DZI9cQ6F.js";import{d as R,K as ve,M as fe,k as $,x as Q,r as w,c as E,b as e,w as l,F as X,N as J,o as c,B as y,m as f,n as _e,a as _,t as ge,G as ee,O as L,P as O,Q as he,R as we,j as q,T as be,U as ye,i as Ce,z as xe,V as De,y as Pe,D as Ve,W as Se,X as Te,p as M,u as N,Y as Ee,Z as $e,f as G,$ as Z,a0 as Ue,a1 as ke,a2 as Ie,a3 as Me,a4 as ze,a5 as Be,v as Ne}from"./index-BCju3w1f.js";import{c as Re,a as Ae,b as Fe}from"./index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js";import{_ as Le}from"./index.vue_vue_type_script_setup_true_lang-KBVOs3Yx.js";import{C as te,_ as ae}from"./index.vue_vue_type_script_setup_true_lang-B6qjGW9b.js";import{_ as Oe}from"./index.vue_vue_type_script_setup_true_lang-DZ8ULnqr.js";import{h as oe,r as Ke,p as je}from"./index-BnJyLrXy.js";import{u as He}from"./index-DCQCk6Lt.js";import{u as We}from"./useTeamHeaders-3AldZ0JH.js";import{B as Ye}from"./index-BzYZrqYN.js";import{c as qe}from"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import{m as Ge}from"./v1Module-BPYVWmkw.js";import"./index.vue_vue_type_style_index_0_lang-D5mLFRCT.js";import"./atom-one-dark-k3s8nS4Q.js";const Ze={class:"w-[100px]"},Qe=R({__name:"index",props:ve({id:{type:String,default:""},version:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(g){const m=g,i=fe(g,"modelValue"),u=$([]),h=$(!1);function n(o){i.value=o}async function C(){if(h.value)return;const o=await Re({compId:m.id});h.value=!0,u.value=o.data.map(t=>({value:t.version,label:t.version}))}function b(){u.value=[{value:m.version,label:m.version}],i.value=m.version}return Q(()=>{b()}),(o,t)=>{const x=w("el-option"),S=w("el-select");return c(),E("div",Ze,[e(S,{"model-value":i.value,onChange:n,onVisibleChange:C},{default:l(()=>[(c(!0),E(X,null,J(u.value,d=>(c(),y(x,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])}}}),Xe={class:"size-full"},Je={class:"size-full p-[10px] min-h-[80px] overflow-auto"},et={class:"mb-[10px]"},tt={class:"comp-name"},at={class:"mt-2"},ot=R({__name:"index",props:{compId:{},getCompDetail:{type:Function}},setup(g){const m=g,i=$(),u=f(()=>oe(i.value?.dep??[])),h=(n,C)=>`npm install ${n}@${C}`;return _e(async()=>{const n=await m.getCompDetail(m.compId);n&&(i.value=n)}),(n,C)=>{const b=w("el-splitter-panel"),o=w("el-splitter");return c(),E("div",Xe,[e(o,{layout:"vertical"},{default:l(()=>[e(b,{size:"30%",min:200},{default:l(()=>[_("div",Je,[_("h4",et,[_("span",tt,ge(i.value?.name),1)]),_("div",null,[e(te,{compDeps:u.value},null,8,["compDeps"])]),_("div",at,[(c(!0),E(X,null,J(u.value,t=>(c(),E("div",{key:t.name,class:"flex items-center mb-[5px] gap-[10px]"},[e(Oe,{class:"text-sm text-[#666]",text:h(t.name,t.version)},null,8,["text"])]))),128))])])]),_:1}),e(b,{min:200,class:"size-full"},{default:l(()=>[e(Le)]),_:1})]),_:1})])}}}),lt=R({__name:"index",props:{compName:{type:String,default:""}},setup(g){const m=g,i=ee(),{compId:u}=i.params,h=$({data:[],column:[{prop:"prevVersion",label:"升级前版本",align:"center"},{prop:"newVersion",label:"升级后版本",align:"center"},{prop:"upgradeDesc",label:"升级描述",align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:"操作",align:"center"}],pagination:{total:0},fixedHeight:!1,fetchData:C}),n=f(()=>({id:u,name:m.compName}));async function C(b){if(!u)return;const o=await Ae({compId:u},{...b}),{rows:t,total:x}=o.data||{};h.value.data=t||[],h.value.pagination.total=x||0}return(b,o)=>{const t=w("el-table-column");return c(),y(Ye,{tableConfig:h.value,border:"",stripe:""},{operation:l(({col:x})=>[e(t,L(O(x)),{default:l(({row:S})=>[e(ae,L(O({version:S.newVersion,...n.value})),null,16)]),_:1},16)]),_:1},8,["tableConfig"])}}}),nt=g=>he(`compPreview_${g}`,{state:()=>({isUnmounted:!1}),actions:{setIsUnmounted(m){this.$patch(i=>{i.isUnmounted=m})}}}),st={class:"size-full"},it={class:"preview-container overflow-x-hidden size-full overflow-y-scroll",ref:"previewScroll"},rt={class:"h-[50vh]"},ct={class:"w-full flex flex-col gap-1"},ut={class:"flex-1 flex justify-start gap-[5px] items-center"},pt={class:"bg-color sticky top-0 w-full bg-[#f5f7fa]"},mt={class:"mt-2"},dt=R({__name:"index",props:{isTeamPreview:{type:Boolean,default:!1}},setup(g){const m=g,i=ee(),u=[{label:"文档",value:"doc",component:me,visible:()=>!0},{label:"升级记录",value:"upgradeRecord",component:lt,visible:()=>!0}],h=i.query[we.VERSION]!==void 0,{compId:n}=i.params,C=new Map;ze(Be.CALLBACKS,C);const{teamId:b}=We(),o=q(be,0),t=q(ye,u[0]?.value);He(Ce("previewScroll"));const x=xe(),S=De(),d=qe(n)(),A=nt(i.path)(),z=$(!1),D=$(d.latestVersion),a=f(()=>d.detail[D.value]),K=f(()=>Object.keys(a.value??{}).length>0),U=f(()=>d.versionToFileAccessPath[D.value]??[]),j=f(()=>oe(a.value?.dep??[])),H=f(()=>{const p=a.value?.previewConfigs||[];if(!p.length||!U.value?.length)return[];const s=new Map(U.value.map(({path:r,signedUrl:P})=>[r,P])),v=r=>{const P=Ke(r.at(-1)??"");return s.get(P)??""},T=p.filter(r=>r.fullPath?.length);return T.length?T.map(r=>({finalEntryUrl:v(r.fullPath??[])})):p.filter(r=>r.miniPath?.length).map(r=>({finalEntryUrl:v(r.miniPath??[])}))}),le=f(()=>t.value==="doc"?{mdSrc:ne.value,scrollContainer:".preview-container"}:t.value==="upgradeRecord"?{compName:a.value?.name||""}:{}),ne=f(()=>U.value.find(p=>p.path.endsWith("/README.md"))?.signedUrl??""),se=f(()=>U.value.length?u.find(s=>s.value===t.value)?.component:void 0),ie=f(()=>{const p=H.value.length===1?"none":"";return{previews:H.value,dep:a.value?.dep??[],bgColor:a.value?.bgColor??"#fff",signedUrls:U.value,indicatorPosition:p,depToFile:d.depEntryNameToFile[D.value]??{}}});async function W(){z.value=!0;try{if(!n)throw new Error("compId is required");const p=await Fe({compId:n,version:D.value}),{objectId:s,version:v,files:T,dep:r}=p.data,P={objectId:s,version:v,files:T.map(I=>I.path)},B=await Me(P),F=je(r,x.deps).map(I=>I.name),V=await Ge({deps:F}),{entryNameToFile:k={}}=V.data;D.value=v,d.setDetail(v,{...p.data,_id:n}),d.setDepEntryNameToFile(v,k),d.setVersionToFileAccessPath(v,B.data.signedUrls)}finally{z.value=!1}}function re(){o.value=Math.max(o.value,500)}function ce(){o.value=0}function ue(){return Promise.resolve(a.value)}function pe(){m.isTeamPreview?S.addPayLoad(`/previewTeam/${b}/${n}`,{name:a.value?.name??""}):S.addPayLoad(`/preview/${n}`,{name:a.value?.name??""})}return Pe(D,async p=>{p!==a.value?.version&&(await x.initSetting(),await W())}),Q(async()=>{(!K.value||h)&&(await W(),A.setIsUnmounted(!1)),pe()}),Ve(()=>{A.setIsUnmounted(!0)}),(p,s)=>{const v=w("el-button"),T=w("el-segmented"),r=w("el-backtop"),P=w("el-splitter-panel"),B=w("el-splitter"),F=Se("loading");return Te((c(),E("div",st,[e(B,null,{default:l(()=>[e(P,{min:510},{default:l(()=>[_("div",it,[_("div",rt,[e(Y,{title:a.value?.name,actions:["maximize"]},{default:l(({isMaximized:V})=>[N(A).isUnmounted?M("",!0):(c(),y(Ee,{key:0,isEmpty:!K.value,loading:z.value,class:"size-full"},{default:l(()=>[e(de,$e(ie.value,{arrow:"always"}),{compToolBar:l(()=>[_("div",ct,[j.value.length>0?(c(),y(te,{key:0,compDeps:j.value},null,8,["compDeps"])):M("",!0),_("div",ut,[V?M("",!0):(c(),y(v,{key:0,color:"#414141",onClick:re},{default:l(()=>[...s[3]||(s[3]=[G("终端",-1)])]),_:1})),e(Qe,{modelValue:D.value,"onUpdate:modelValue":s[0]||(s[0]=k=>D.value=k),id:a.value?._id,version:a.value?.version},null,8,["modelValue","id","version"]),e(ae,{id:a.value?._id,name:a.value?.name,version:a.value?.version},{default:l(({downloadHandler:k,isLogin:I})=>[e(v,{type:"primary",onClick:vt=>k(I)},{default:l(()=>[...s[4]||(s[4]=[G("下载",-1)])]),_:1},8,["onClick"])]),_:1},8,["id","name","version"])])])]),_:2},1040)]),_:2},1032,["isEmpty","loading"]))]),_:1},8,["title"])]),_("div",pt,[e(T,{modelValue:N(t),"onUpdate:modelValue":s[1]||(s[1]=V=>Z(t)?t.value=V:null),options:u,size:"default"},null,8,["modelValue"])]),_("div",mt,[e(Ue,null,{default:l(()=>[(c(),y(ke,null,[(c(),y(Ie(se.value),L(O(le.value)),null,16))],1024))]),_:1})]),e(r,{right:100,bottom:100,target:".preview-container"})],512)]),_:1}),N(o)?(c(),y(P,{key:0,size:N(o),"onUpdate:size":s[2]||(s[2]=V=>Z(o)?o.value=V:null),collapsible:""},{default:l(()=>[e(Y,{title:"依赖安装",onClose:ce},{default:l(()=>[a.value?._id?(c(),y(ot,{key:0,compId:a.value?._id,getCompDetail:ue},null,8,["compId"])):M("",!0)]),_:1})]),_:1},8,["size"])):M("",!0)]),_:1})])),[[F,z.value]])}}}),Et=Ne(dt,[["__scopeId","data-v-458a5e8b"]]);export{Et as default};
1
+ import{_ as me,a as Y,C as de}from"./index.vue_vue_type_script_setup_true_lang-Cj1ig2OS.js";import{d as R,K as ve,M as fe,k as $,x as Q,r as w,c as E,b as e,w as l,F as X,N as J,o as c,B as y,m as f,n as _e,a as _,t as ge,G as ee,O as L,P as O,Q as he,R as we,j as q,T as be,U as ye,i as Ce,z as xe,V as De,y as Pe,D as Ve,W as Se,X as Te,p as M,u as N,Y as Ee,Z as $e,f as G,$ as Z,a0 as Ue,a1 as ke,a2 as Ie,a3 as Me,a4 as ze,a5 as Be,v as Ne}from"./index-cHbH7T5D.js";import{c as Re,a as Ae,b as Fe}from"./index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js";import{_ as Le}from"./index.vue_vue_type_script_setup_true_lang-mjupg3Z_.js";import{C as te,_ as ae}from"./index.vue_vue_type_script_setup_true_lang-C2jCrlom.js";import{_ as Oe}from"./index.vue_vue_type_script_setup_true_lang-s3TpsvnW.js";import{h as oe,r as Ke,p as je}from"./index-BfqhDZ1z.js";import{u as He}from"./index-CPx4gS-Z.js";import{u as We}from"./useTeamHeaders-22mJVwWy.js";import{B as Ye}from"./index-DNxTJC5Q.js";import{c as qe}from"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import{m as Ge}from"./v1Module-Clll6gmK.js";import"./index.vue_vue_type_style_index_0_lang-BVuL5ED4.js";import"./atom-one-dark-B2H-r86L.js";const Ze={class:"w-[100px]"},Qe=R({__name:"index",props:ve({id:{type:String,default:""},version:{type:String,default:""}},{modelValue:{type:String,default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(g){const m=g,i=fe(g,"modelValue"),u=$([]),h=$(!1);function n(o){i.value=o}async function C(){if(h.value)return;const o=await Re({compId:m.id});h.value=!0,u.value=o.data.map(t=>({value:t.version,label:t.version}))}function b(){u.value=[{value:m.version,label:m.version}],i.value=m.version}return Q(()=>{b()}),(o,t)=>{const x=w("el-option"),S=w("el-select");return c(),E("div",Ze,[e(S,{"model-value":i.value,onChange:n,onVisibleChange:C},{default:l(()=>[(c(!0),E(X,null,J(u.value,d=>(c(),y(x,{key:d.value,label:d.label,value:d.value},null,8,["label","value"]))),128))]),_:1},8,["model-value"])])}}}),Xe={class:"size-full"},Je={class:"size-full p-[10px] min-h-[80px] overflow-auto"},et={class:"mb-[10px]"},tt={class:"comp-name"},at={class:"mt-2"},ot=R({__name:"index",props:{compId:{},getCompDetail:{type:Function}},setup(g){const m=g,i=$(),u=f(()=>oe(i.value?.dep??[])),h=(n,C)=>`npm install ${n}@${C}`;return _e(async()=>{const n=await m.getCompDetail(m.compId);n&&(i.value=n)}),(n,C)=>{const b=w("el-splitter-panel"),o=w("el-splitter");return c(),E("div",Xe,[e(o,{layout:"vertical"},{default:l(()=>[e(b,{size:"30%",min:200},{default:l(()=>[_("div",Je,[_("h4",et,[_("span",tt,ge(i.value?.name),1)]),_("div",null,[e(te,{compDeps:u.value},null,8,["compDeps"])]),_("div",at,[(c(!0),E(X,null,J(u.value,t=>(c(),E("div",{key:t.name,class:"flex items-center mb-[5px] gap-[10px]"},[e(Oe,{class:"text-sm text-[#666]",text:h(t.name,t.version)},null,8,["text"])]))),128))])])]),_:1}),e(b,{min:200,class:"size-full"},{default:l(()=>[e(Le)]),_:1})]),_:1})])}}}),lt=R({__name:"index",props:{compName:{type:String,default:""}},setup(g){const m=g,i=ee(),{compId:u}=i.params,h=$({data:[],column:[{prop:"prevVersion",label:"升级前版本",align:"center"},{prop:"newVersion",label:"升级后版本",align:"center"},{prop:"upgradeDesc",label:"升级描述",align:"center",showOverflowTooltip:{popperClass:"table-text-tooltip"}},{slot:"operation",prop:"operation",label:"操作",align:"center"}],pagination:{total:0},fixedHeight:!1,fetchData:C}),n=f(()=>({id:u,name:m.compName}));async function C(b){if(!u)return;const o=await Ae({compId:u},{...b}),{rows:t,total:x}=o.data||{};h.value.data=t||[],h.value.pagination.total=x||0}return(b,o)=>{const t=w("el-table-column");return c(),y(Ye,{tableConfig:h.value,border:"",stripe:""},{operation:l(({col:x})=>[e(t,L(O(x)),{default:l(({row:S})=>[e(ae,L(O({version:S.newVersion,...n.value})),null,16)]),_:1},16)]),_:1},8,["tableConfig"])}}}),nt=g=>he(`compPreview_${g}`,{state:()=>({isUnmounted:!1}),actions:{setIsUnmounted(m){this.$patch(i=>{i.isUnmounted=m})}}}),st={class:"size-full"},it={class:"preview-container overflow-x-hidden size-full overflow-y-scroll",ref:"previewScroll"},rt={class:"h-[50vh]"},ct={class:"w-full flex flex-col gap-1"},ut={class:"flex-1 flex justify-start gap-[5px] items-center"},pt={class:"bg-color sticky top-0 w-full bg-[#f5f7fa]"},mt={class:"mt-2"},dt=R({__name:"index",props:{isTeamPreview:{type:Boolean,default:!1}},setup(g){const m=g,i=ee(),u=[{label:"文档",value:"doc",component:me,visible:()=>!0},{label:"升级记录",value:"upgradeRecord",component:lt,visible:()=>!0}],h=i.query[we.VERSION]!==void 0,{compId:n}=i.params,C=new Map;ze(Be.CALLBACKS,C);const{teamId:b}=We(),o=q(be,0),t=q(ye,u[0]?.value);He(Ce("previewScroll"));const x=xe(),S=De(),d=qe(n)(),A=nt(i.path)(),z=$(!1),D=$(d.latestVersion),a=f(()=>d.detail[D.value]),K=f(()=>Object.keys(a.value??{}).length>0),U=f(()=>d.versionToFileAccessPath[D.value]??[]),j=f(()=>oe(a.value?.dep??[])),H=f(()=>{const p=a.value?.previewConfigs||[];if(!p.length||!U.value?.length)return[];const s=new Map(U.value.map(({path:r,signedUrl:P})=>[r,P])),v=r=>{const P=Ke(r.at(-1)??"");return s.get(P)??""},T=p.filter(r=>r.fullPath?.length);return T.length?T.map(r=>({finalEntryUrl:v(r.fullPath??[])})):p.filter(r=>r.miniPath?.length).map(r=>({finalEntryUrl:v(r.miniPath??[])}))}),le=f(()=>t.value==="doc"?{mdSrc:ne.value,scrollContainer:".preview-container"}:t.value==="upgradeRecord"?{compName:a.value?.name||""}:{}),ne=f(()=>U.value.find(p=>p.path.endsWith("/README.md"))?.signedUrl??""),se=f(()=>U.value.length?u.find(s=>s.value===t.value)?.component:void 0),ie=f(()=>{const p=H.value.length===1?"none":"";return{previews:H.value,dep:a.value?.dep??[],bgColor:a.value?.bgColor??"#fff",signedUrls:U.value,indicatorPosition:p,depToFile:d.depEntryNameToFile[D.value]??{}}});async function W(){z.value=!0;try{if(!n)throw new Error("compId is required");const p=await Fe({compId:n,version:D.value}),{objectId:s,version:v,files:T,dep:r}=p.data,P={objectId:s,version:v,files:T.map(I=>I.path)},B=await Me(P),F=je(r,x.deps).map(I=>I.name),V=await Ge({deps:F}),{entryNameToFile:k={}}=V.data;D.value=v,d.setDetail(v,{...p.data,_id:n}),d.setDepEntryNameToFile(v,k),d.setVersionToFileAccessPath(v,B.data.signedUrls)}finally{z.value=!1}}function re(){o.value=Math.max(o.value,500)}function ce(){o.value=0}function ue(){return Promise.resolve(a.value)}function pe(){m.isTeamPreview?S.addPayLoad(`/previewTeam/${b}/${n}`,{name:a.value?.name??""}):S.addPayLoad(`/preview/${n}`,{name:a.value?.name??""})}return Pe(D,async p=>{p!==a.value?.version&&(await x.initSetting(),await W())}),Q(async()=>{(!K.value||h)&&(await W(),A.setIsUnmounted(!1)),pe()}),Ve(()=>{A.setIsUnmounted(!0)}),(p,s)=>{const v=w("el-button"),T=w("el-segmented"),r=w("el-backtop"),P=w("el-splitter-panel"),B=w("el-splitter"),F=Se("loading");return Te((c(),E("div",st,[e(B,null,{default:l(()=>[e(P,{min:510},{default:l(()=>[_("div",it,[_("div",rt,[e(Y,{title:a.value?.name,actions:["maximize"]},{default:l(({isMaximized:V})=>[N(A).isUnmounted?M("",!0):(c(),y(Ee,{key:0,isEmpty:!K.value,loading:z.value,class:"size-full"},{default:l(()=>[e(de,$e(ie.value,{arrow:"always"}),{compToolBar:l(()=>[_("div",ct,[j.value.length>0?(c(),y(te,{key:0,compDeps:j.value},null,8,["compDeps"])):M("",!0),_("div",ut,[V?M("",!0):(c(),y(v,{key:0,color:"#414141",onClick:re},{default:l(()=>[...s[3]||(s[3]=[G("终端",-1)])]),_:1})),e(Qe,{modelValue:D.value,"onUpdate:modelValue":s[0]||(s[0]=k=>D.value=k),id:a.value?._id,version:a.value?.version},null,8,["modelValue","id","version"]),e(ae,{id:a.value?._id,name:a.value?.name,version:a.value?.version},{default:l(({downloadHandler:k,isLogin:I})=>[e(v,{type:"primary",onClick:vt=>k(I)},{default:l(()=>[...s[4]||(s[4]=[G("下载",-1)])]),_:1},8,["onClick"])]),_:1},8,["id","name","version"])])])]),_:2},1040)]),_:2},1032,["isEmpty","loading"]))]),_:1},8,["title"])]),_("div",pt,[e(T,{modelValue:N(t),"onUpdate:modelValue":s[1]||(s[1]=V=>Z(t)?t.value=V:null),options:u,size:"default"},null,8,["modelValue"])]),_("div",mt,[e(Ue,null,{default:l(()=>[(c(),y(ke,null,[(c(),y(Ie(se.value),L(O(le.value)),null,16))],1024))]),_:1})]),e(r,{right:100,bottom:100,target:".preview-container"})],512)]),_:1}),N(o)?(c(),y(P,{key:0,size:N(o),"onUpdate:size":s[2]||(s[2]=V=>Z(o)?o.value=V:null),collapsible:""},{default:l(()=>[e(Y,{title:"依赖安装",onClose:ce},{default:l(()=>[a.value?._id?(c(),y(ot,{key:0,compId:a.value?._id,getCompDetail:ue},null,8,["compId"])):M("",!0)]),_:1})]),_:1},8,["size"])):M("",!0)]),_:1})])),[[F,z.value]])}}}),Et=Ne(dt,[["__scopeId","data-v-458a5e8b"]]);export{Et as default};
@@ -1 +1 @@
1
- import{a as I,_ as $,b as P}from"./index.vue_vue_type_script_setup_true_lang-B6qjGW9b.js";import{c as R}from"./index-DCQCk6Lt.js";import{_ as A}from"./index.vue_vue_type_style_index_0_lang-DZzA4x8F.js";import{_ as U,e as F,f as N,b as V}from"./index.vue_vue_type_script_setup_true_lang-CpnHQFlL.js";import{c as K}from"./useCompEditStore-DxIY6W80.js";import{d as k,a6 as z,r as w,B as D,w as c,b as s,f as C,a7 as j,a8 as G,a9 as v,aa as L,E as Q,o as y,a5 as u,G as W,g as Y,i as q,k as H,D as X,W as Z,X as J,u as ee,c as oe,a as h,p as te,O as ae,Z as ne,a4 as _}from"./index-BCju3w1f.js";import{B as se}from"./index-BzYZrqYN.js";import{k as ie}from"./v1Keyword-CTrvQOnq.js";import{c as re}from"./index.vue_vue_type_style_index_0_lang-C9MO6ZTW.js";import"./index-BnJyLrXy.js";import"./v1Module-BPYVWmkw.js";import"./useTeamHeaders-3AldZ0JH.js";const ce=k({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""}},setup(g){const i=g,f=z(u.CALLBACKS);async function a(p){const r=j.service({fullscreen:!0});try{if(!p())return;if(!i.name){console.error("组件名称不能为空");return}if(await G.confirm(v.CONFIRM.DELETE(i.name),"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm")return;await F({compId:i.id}).then(()=>f.get(L.AFTER_COMP_DEL)?.(i.id)),Q.success(v.SUCCESS.DELETE)}finally{r.close()}}return(p,r)=>{const d=w("el-link");return y(),D(U,null,{default:c(({isLogin:m})=>[s(d,{type:"danger",link:"",onClick:E=>a(m)},{default:c(()=>[...r[0]||(r[0]=[C(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})}}}),le={class:"size-full"},pe={class:"flex-1"},de={class:"flex-1 flex justify-end items-center gap-2"},we=k({__name:"index",setup(g){const i=W(),f=Y(),a=R(i.path)();_(u.COMP_LIST_STORE,a);const p=K(i.path)();_(u.COMP_EDIT_STORE,p);const r=new Map;_(u.CALLBACKS,r);const d=q("compUpdateDialog"),m=H({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:E,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:M});function E(e,o){if(e.length<=1)return o([]);ie({keyword:e,type:"compMy"}).then(n=>{const{keywords:l=[]}=n.data||{};o(l)})}async function M(e){a.setLoading(!0);const o=await N(e),{rows:n,total:l}=o.data||{};await a.renderList(n||[]),m.value.pagination.total=l||0}function T(e){f.push({path:`/preview/${e._id}`})}async function B(e){d.value?.open(e._id)}function x(e){return re(e._id)().isLocalExist?"primary":"info"}function O(e){const{_id:o,totalDownloadCount:n=0}=e;a.updateCompListItemById(o,{totalDownloadCount:n+1})}function b(e){V({compId:e}).then(o=>{a.updateCompListItemById(e,o.data)})}return r.set(L.AFTER_COMP_DEL,e=>{console.log("删除的组件id",e),a.delCompListById(e)}),X(()=>{a.$reset()}),(e,o)=>{const n=w("el-link"),l=Z("loading");return J((y(),oe("div",le,[s(se,{tableConfig:m.value},{table:c(()=>[s(I,{class:"overflow-y-scroll"},{compItemToolBar:c(({attrs:t})=>[h("div",pe,[t._id?(y(),D(P,ae(ne({key:0},{id:t._id,version:t.version})),null,16)):te("",!0)])]),compItemFooterOperate:c(({attrs:t})=>[h("div",de,[s($,{id:t._id,name:t.name,version:t.version,onDownloadSuccess:S=>O(t)},null,8,["id","name","version","onDownloadSuccess"]),s(n,{type:"primary",onClick:S=>T(t)},{default:c(()=>[...o[0]||(o[0]=[C("预览",-1)])]),_:1},8,["onClick"]),s(n,{type:x(t),onClick:S=>B(t)},{default:c(()=>[...o[1]||(o[1]=[C("更新",-1)])]),_:1},8,["type","onClick"]),s(ce,{id:t._id,name:t.name},null,8,["id","name"])])]),_:1})]),_:1},8,["tableConfig"]),s(A,{ref:"compUpdateDialog",onUpdateSuccess:b},null,512)])),[[l,ee(a).loading]])}}});export{we as default};
1
+ import{a as I,_ as $,b as P}from"./index.vue_vue_type_script_setup_true_lang-C2jCrlom.js";import{c as R}from"./index-CPx4gS-Z.js";import{_ as A}from"./index.vue_vue_type_style_index_0_lang-Dhu78hQ_.js";import{_ as U,e as F,f as N,b as V}from"./index.vue_vue_type_script_setup_true_lang-DaO9_LHy.js";import{c as K}from"./useCompEditStore-C3L6eIoz.js";import{d as k,a6 as z,r as w,B as D,w as c,b as s,f as C,a7 as j,a8 as G,a9 as v,aa as L,E as Q,o as y,a5 as u,G as W,g as Y,i as q,k as H,D as X,W as Z,X as J,u as ee,c as oe,a as h,p as te,O as ae,Z as ne,a4 as _}from"./index-cHbH7T5D.js";import{B as se}from"./index-DNxTJC5Q.js";import{k as ie}from"./v1Keyword-JxL-DecN.js";import{c as re}from"./index.vue_vue_type_style_index_0_lang-CVT5yNeL.js";import"./index-BfqhDZ1z.js";import"./v1Module-Clll6gmK.js";import"./useTeamHeaders-22mJVwWy.js";const ce=k({__name:"index",props:{id:{type:String,default:""},name:{type:String,default:""}},setup(g){const i=g,f=z(u.CALLBACKS);async function a(p){const r=j.service({fullscreen:!0});try{if(!p())return;if(!i.name){console.error("组件名称不能为空");return}if(await G.confirm(v.CONFIRM.DELETE(i.name),"提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).catch(()=>{})!=="confirm")return;await F({compId:i.id}).then(()=>f.get(L.AFTER_COMP_DEL)?.(i.id)),Q.success(v.SUCCESS.DELETE)}finally{r.close()}}return(p,r)=>{const d=w("el-link");return y(),D(U,null,{default:c(({isLogin:m})=>[s(d,{type:"danger",link:"",onClick:E=>a(m)},{default:c(()=>[...r[0]||(r[0]=[C(" 删除 ",-1)])]),_:1},8,["onClick"])]),_:1})}}}),le={class:"size-full"},pe={class:"flex-1"},de={class:"flex-1 flex justify-end items-center gap-2"},we=k({__name:"index",setup(g){const i=W(),f=Y(),a=R(i.path)();_(u.COMP_LIST_STORE,a);const p=K(i.path)();_(u.COMP_EDIT_STORE,p);const r=new Map;_(u.CALLBACKS,r);const d=q("compUpdateDialog"),m=H({data:[],search:{column:[{prop:"keyword",type:"el-autocomplete",label:"关键词",value:"",autoQuery:!1,attributes:{placeholder:"请输入组件名称/描述",fetchSuggestions:E,triggerOnFocus:!1,style:"width: 200px",fitInputWidth:!0}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:M});function E(e,o){if(e.length<=1)return o([]);ie({keyword:e,type:"compMy"}).then(n=>{const{keywords:l=[]}=n.data||{};o(l)})}async function M(e){a.setLoading(!0);const o=await N(e),{rows:n,total:l}=o.data||{};await a.renderList(n||[]),m.value.pagination.total=l||0}function T(e){f.push({path:`/preview/${e._id}`})}async function B(e){d.value?.open(e._id)}function x(e){return re(e._id)().isLocalExist?"primary":"info"}function O(e){const{_id:o,totalDownloadCount:n=0}=e;a.updateCompListItemById(o,{totalDownloadCount:n+1})}function b(e){V({compId:e}).then(o=>{a.updateCompListItemById(e,o.data)})}return r.set(L.AFTER_COMP_DEL,e=>{console.log("删除的组件id",e),a.delCompListById(e)}),X(()=>{a.$reset()}),(e,o)=>{const n=w("el-link"),l=Z("loading");return J((y(),oe("div",le,[s(se,{tableConfig:m.value},{table:c(()=>[s(I,{class:"overflow-y-scroll"},{compItemToolBar:c(({attrs:t})=>[h("div",pe,[t._id?(y(),D(P,ae(ne({key:0},{id:t._id,version:t.version})),null,16)):te("",!0)])]),compItemFooterOperate:c(({attrs:t})=>[h("div",de,[s($,{id:t._id,name:t.name,version:t.version,onDownloadSuccess:S=>O(t)},null,8,["id","name","version","onDownloadSuccess"]),s(n,{type:"primary",onClick:S=>T(t)},{default:c(()=>[...o[0]||(o[0]=[C("预览",-1)])]),_:1},8,["onClick"]),s(n,{type:x(t),onClick:S=>B(t)},{default:c(()=>[...o[1]||(o[1]=[C("更新",-1)])]),_:1},8,["type","onClick"]),s(ce,{id:t._id,name:t.name},null,8,["id","name"])])]),_:1})]),_:1},8,["tableConfig"]),s(A,{ref:"compUpdateDialog",onUpdateSuccess:b},null,512)])),[[l,ee(a).loading]])}}});export{we as default};