UNPKG

goldpankit

Version:

GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。

2 lines (1 loc) 7.18 kB
import{P as A,S as F}from"./PluginList-16db67e4.js";import{_ as k,r as l,o as n,c as o,F as j,g as D,b as a,a as i,t,M as q,m as E,A as U,B as h,j as p,J as m,K as f,h as V,w as y,e as g,p as z,l as O}from"./index-18d82337.js";import{B as w}from"./BeanAmount-bc9ba713.js";import{f as J,a as K}from"./service-69775e84.js";import{a as R}from"./service.space-8698ae92.js";import{S as T}from"./ServiceTitle-5bb20f45.js";import{S as G}from"./ServiceStatus-eaf9a3b8.js";import"./service.version-b37d6c0d.js";const H={name:"VerticalServiceList",components:{ServiceTitle:T,BeanAmount:w},props:{space:{require:!0},services:{type:Array,required:!0}}},Q={class:"service-list"},W={class:"price-wrap"},X={class:"text-info-1 text-mini"};function Y(s,r,v,N,e,S){const _=l("ServiceTitle"),d=l("BeanAmount");return n(),o("ul",Q,[(n(!0),o(j,null,D(v.services,u=>(n(),o("li",{key:u.name},[a(_,{space:v.space,service:u.name,"with-paths":!1},null,8,["space","service"]),i("p",null,t(u.introduce),1),i("div",W,[i("p",X,t(s.getDateOffsetText(u.lastPublish)),1),a(d,{price:u.price.price,type:u.price.leaseType},null,8,["price","type"])])]))),128))])}const Z=k(H,[["render",Y],["__scopeId","data-v-15862673"]]);const x={components:{ServiceStatus:G,ServiceTitle:T,VerticalServiceList:Z,BeanAmount:w,MarkdownEditor:q,PluginList:A,ServiceStructureView:F},data(){return{loading:!0,route:{space:null,service:null},currentTab:"readme",currentMajorVersion:"",currentVersion:null,majorVersions:[],space:null,service:null,majorVersionDetail:null,relationServices:[]}},computed:{...E(["userInfo"])},methods:{initData(){this.loading=!0,this.space=null,this.service=null,this.currentVersion=null,this.fetchSpace(),this.fetchServices(),this.fetchDetail()},changeMajorVersion(s){this.currentMajorVersion!==s&&(this.currentMajorVersion=s,this.fetchDetail(s))},fetchSpace(){R(this.route.space).then(s=>{this.space=s}).catch(s=>{this.$tip.apiFailed(s)})},fetchServices(){J({space:this.route.space,withSpaceInfo:!1,withPublisher:!1}).then(s=>{this.relationServices=s.filter(r=>this.route.service!==r.name)}).catch(s=>{this.$tip.apiFailed(s)})},fetchDetail(s){K({...this.route,majorVersion:s}).then(r=>{if(r==null){this.alert("该服务还未发布或已被删除").then(()=>{this.$router.push({name:"PublicServices"})});return}this.service=r,this.majorVersions=r.majorVersions,this.currentMajorVersion=s||this.majorVersions[0],this.majorVersionDetail=r.defaultMajorVersion,this.currentVersion=this.majorVersionDetail.version,this.majorVersionDetail.description==null&&this.majorVersionDetail.description.trim()===""&&(this.majorVersionDetail.description="No Descriptions")}).catch(r=>{if(r.code===5110||r.code===4002){this.alert(r.message).then(()=>{this.$router.push({name:"PublicServices"})});return}this.$tip.apiFailed(r)}).finally(()=>{this.loading=!1})}},beforeRouteUpdate(s,r,v){this.route.space=s.params.spaceName,this.route.service=s.params.serviceName,this.initData(),v()},created(){this.route.space=this.$route.params.spaceName,this.route.service=this.$route.params.serviceName,this.initData()}},$=s=>(z("data-v-f8b8bbdb"),s=s(),O(),s),ee={class:"page"},se={key:0,class:"wrap"},ie={class:"header"},re={class:"tech-stack-wrap"},te={key:0,class:"major-versions"},ne=["onClick"],oe={class:"content-wrap"},ce={class:"dimension-wrap"},le={class:"dimensions"},ae={key:0,class:"detail"},ue={class:"info"},pe={class:"user-profile"},ve={class:"user-info"},he={class:"introduce"},me={class:"install"},_e=$(()=>i("i",{class:"iconfont icon-code"},null,-1)),de={class:"info-list"},fe=["href"],Se={key:1},be={key:0},Ve={key:1},ye={key:0,class:"relation-services-wrap"};function ge(s,r,v,N,e,S){const _=l("ServiceTitle"),d=l("ServiceStatus"),u=l("BeanAmount"),P=l("MarkdownEditor"),M=l("PluginList"),B=l("ServiceStructureView"),C=l("Avatar"),b=l("el-button"),L=l("VerticalServiceList"),I=U("loading");return h((n(),o("div",ee,[e.space!=null&&e.service!=null?(n(),o("div",se,[i("div",ie,[a(_,{space:e.space.name,service:e.service.name,"service-label":e.service.label},null,8,["space","service","service-label"]),i("div",re,[a(d,{"with-private":e.service.withPrivate},null,8,["with-private"]),i("p",null,t(e.majorVersionDetail.subServices.length)+" "+t(s.$t("service.plugins")),1),a(u,{price:e.service.price.price,type:e.service.price.leaseType},null,8,["price","type"])]),e.majorVersions.length>1?(n(),o("ul",te,[(n(!0),o(j,null,D(e.majorVersions,c=>(n(),o("li",{key:c,class:m({selected:c===e.currentMajorVersion}),onClick:ke=>S.changeMajorVersion(c)},"v"+t(c),11,ne))),128))])):p("",!0)]),i("div",oe,[i("div",ce,[i("ul",le,[i("li",{class:m({selected:e.currentTab==="readme"}),onClick:r[0]||(r[0]=c=>e.currentTab="readme")},t(s.$t("common.readme")),3),i("li",{class:m({selected:e.currentTab==="extends"}),onClick:r[1]||(r[1]=c=>e.currentTab="extends")},t(s.$t("service.subServices")),3),i("li",{class:m({selected:e.currentTab==="structure"}),onClick:r[2]||(r[2]=c=>e.currentTab="structure")},t(s.$t("service.structure")),3)]),e.majorVersionDetail!=null?(n(),o("div",ae,[h(a(P,{modelValue:e.majorVersionDetail.description,"onUpdate:modelValue":r[3]||(r[3]=c=>e.majorVersionDetail.description=c),readonly:!0,"without-padding":!0},null,8,["modelValue"]),[[f,e.currentTab==="readme"]]),h(a(M,{plugins:e.majorVersionDetail.subServices},null,8,["plugins"]),[[f,e.currentTab==="extends"]]),e.currentVersion!=null?h((n(),V(B,{key:0,space:e.route.space,service:e.route.service,version:e.currentVersion},null,8,["space","service","version"])),[[f,e.currentTab==="structure"]]):p("",!0)])):p("",!0)]),i("div",ue,[i("div",pe,[i("div",ve,[a(C,{"file-key":e.service.user.avatar,size:"30px",margin:"0 10px 0 0"},null,8,["file-key"]),i("h4",null,t(s.getUserDisplayName(e.service.user)),1)]),i("p",he,t(e.service.user.introduce===""||e.service.user.introduce==null?"No introduce":e.service.user.introduce),1)]),i("div",me,[a(b,{type:"important",onClick:r[4]||(r[4]=c=>s.$router.push({name:"ServiceInstaller",params:{spaceName:e.space.name,serviceName:e.service.name},query:{major:e.currentMajorVersion}}))},{default:y(()=>[_e,g(t(s.$t("service.install")),1)]),_:1}),s.userInfo!=null&&s.userInfo.isDeveloper?(n(),V(b,{key:0,onClick:r[5]||(r[5]=c=>s.$router.push({name:"CreatePlugin",query:{space:e.space.name,service:e.service.name}}))},{default:y(()=>[g(t(s.$t("plugin.create2")),1)]),_:1})):p("",!0)]),i("ul",de,[i("li",null,[i("label",null,t(s.$t("service.subServices")),1),i("p",null,t(e.majorVersionDetail.subServices.length),1)]),i("li",null,[i("label",null,t(s.$t("service.repository")),1),e.service.repository!=null&&e.service.repository!==""?(n(),o("a",{key:0,href:e.service.repository,target:"_blank"},t(e.service.repository),9,fe)):(n(),o("p",Se,t(s.$t("common.none")),1))]),i("li",null,[i("label",null,t(s.$t("service.lastPublish")),1),e.service.lastPublish!=null?(n(),o("p",be,t(s.getDateOffsetText(e.service.lastPublish)),1)):(n(),o("p",Ve,"None"))])]),e.relationServices.length>0?(n(),o("div",ye,[i("h4",null,t(s.$t("service.relationList")),1),a(L,{services:e.relationServices},null,8,["services"])])):p("",!0)])])])):p("",!0)])),[[I,e.loading]])}const Ce=k(x,[["render",ge],["__scopeId","data-v-f8b8bbdb"]]);export{Ce as default};