UNPKG

goldpankit

Version:

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

2 lines (1 loc) 2.94 kB
import{s as w}from"./service.space-0c0837b2.js";import{P as z}from"./Pagination-f952c6cf.js";import{_ as V,E,r as o,A as N,o as t,c as r,a as i,b as c,w as m,y as B,g as h,i as l,B as D,F as P,f as L,e as b,t as p}from"./index-dd2ed0b0.js";import{S as F}from"./ServiceList-b68d54a0.js";import"./BeanAmount-c38dc9ba.js";import"./ServiceTitle-b12c98d9.js";const I={components:{ServiceList:F,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()}},K={class:"page"},x={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",K,[i("div",x,[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:B(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?D((t(),r("ul",j,[(t(!0),r(P,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(I,[["render",H],["__scopeId","data-v-d2c3ee54"]]);export{Z as default};