UNPKG

goldpankit

Version:

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

2 lines (1 loc) 2.94 kB
import{s as w}from"./service.space-0bf0a46b.js";import{P as z}from"./Pagination-cb04f6c8.js";import{_ as V,E,r as o,z as N,o as t,c as r,a as i,b as c,w as m,x as D,g as h,i as l,A as P,F as B,f as L,e as b,t as p}from"./index-ea6b6181.js";import{S as x}from"./ServiceList-47a990c5.js";import"./BeanAmount-e1365bbf.js";import"./ServiceTitle-1a8672e5.js";const F={components:{ServiceList:x,Empty:E,Pagination:z},data(){return{loading:!1,keyword:"",pagination:{pageIndex:1,pageCount:0,capacity:15,total:0},spaces:[]}},methods:{search(){this.loading||(this.loading=!0,w({...this.pagination,model:{keyword:this.keyword.trim()}}).then(e=>{this.pagination.total=e.total,this.pagination.pageCount=e.pageCount,this.spaces=e.records}).catch(e=>{this.$tip.apiFailed(e)}).finally(()=>{this.loading=!1}))},handleSizeChange(e){this.pagination.capacity=e,this.search()},handleCurrentChange(e){this.pagination.pageIndex=e,this.search()}},created(){this.search()}},I={class:"page"},K={class:"warp"},A={class:"search-wrap"},U={class:"input-wrap"},j={key:1,class:"space-list"},T=["onClick"],q={key:0,class:"user-profile"},G=["src"];function H(e,u,J,M,n,s){const _=o("Search"),C=o("el-icon"),y=o("el-input"),v=o("el-button"),g=o("Pagination"),k=o("ServiceList"),S=o("Empty"),f=N("loading");return t(),r("div",I,[i("div",K,[i("div",A,[i("div",U,[c(C,{size:"20"},{default:m(()=>[c(_)]),_:1}),c(y,{modelValue:n.keyword,"onUpdate:modelValue":u[0]||(u[0]=a=>n.keyword=a),size:"large",placeholder:e.$t("space.searchPlaceholder"),onKeypress:D(s.search,["enter","native"])},null,8,["modelValue","placeholder","onKeypress"])]),c(v,{size:"large",type:"primary",onClick:s.search},{default:m(()=>[b(p(e.$t("common.search")),1)]),_:1},8,["onClick"])]),n.pagination.pageCount>1?(t(),h(g,{key:0,pagination:n.pagination,position:"top",onCurrentChange:s.handleCurrentChange,onSizeChange:s.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):l("",!0),n.loading||n.spaces.length>0?P((t(),r("ul",j,[(t(!0),r(B,null,L(n.spaces,a=>(t(),r("li",{key:a.id},[i("a",{href:"javascript:;",onClick:d=>e.$router.push({name:"SpaceDetail",params:{name:a.name}})},[i("h3",null,p(a.name),1),i("p",null,p(a.introduce),1),c(k,{services:a.mainServices,onSelect:d=>e.$router.push({name:"ServiceDetail",params:{spaceName:a.name,serviceName:d.name}})},null,8,["services","onSelect"]),a.user!=null?(t(),r("div",q,[i("img",{src:e.getAvatarUri(a.user.avatar)},null,8,G),i("span",null,p(a.user.username),1)])):l("",!0)],8,T)]))),128))])),[[f,n.loading]]):l("",!0),n.keyword.trim()!==""&&n.spaces.length===0?(t(),h(S,{key:2,description:e.$t("space.searchEmpty")},null,8,["description"])):l("",!0),n.pagination.pageCount>1?(t(),h(g,{key:3,pagination:n.pagination,onCurrentChange:s.handleCurrentChange,onSizeChange:s.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):l("",!0)])])}const Z=V(F,[["render",H],["__scopeId","data-v-d2c3ee54"]]);export{Z as default};