goldpankit
Version:
GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。
2 lines (1 loc) • 2.97 kB
JavaScript
import{s as w}from"./service.space-c2470b82.js";import{P as z}from"./Pagination-803083dc.js";import{_ as V,E,r as i,z as N,o as t,c as r,a as s,b as c,w as m,x as D,g as h,j as l,A as P,F as B,f as L,e as b,t as p}from"./index-aa9a4821.js";import{S as x}from"./ServiceList-1d0cd5be.js";import"./BeanAmount-b97a3229.js";import"./ServiceTitle-62d26790.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"},j={class:"search-wrap"},A={class:"input-wrap"},U={key:1,class:"space-list"},T=["onClick"],q={key:0,class:"user-profile"},G=["src"];function H(e,u,J,M,n,o){const _=i("Search"),C=i("el-icon"),y=i("el-input"),v=i("el-button"),g=i("Pagination"),f=i("ServiceList"),k=i("Empty"),S=N("loading");return t(),r("div",I,[s("div",K,[s("div",j,[s("div",A,[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(o.search,["enter","native"])},null,8,["modelValue","placeholder","onKeypress"])]),c(v,{size:"large",type:"primary",onClick:o.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:o.handleCurrentChange,onSizeChange:o.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):l("",!0),n.loading||n.spaces.length>0?P((t(),r("ul",U,[(t(!0),r(B,null,L(n.spaces,a=>(t(),r("li",{key:a.id},[s("a",{href:"javascript:;",onClick:d=>e.$router.push({name:"SpaceDetail",params:{name:a.name}})},[s("h3",null,p(a.name),1),s("p",null,p(a.introduce),1),c(f,{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,[s("img",{src:e.getAccessUri(a.user.avatar,"/images/avatar/default.png")},null,8,G),s("span",null,p(a.user.username),1)])):l("",!0)],8,T)]))),128))])),[[S,n.loading]]):l("",!0),n.keyword.trim()!==""&&n.spaces.length===0?(t(),h(k,{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:o.handleCurrentChange,onSizeChange:o.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):l("",!0)])])}const Z=V(F,[["render",H],["__scopeId","data-v-ad99c486"]]);export{Z as default};