goldpankit
Version:
GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。
2 lines (1 loc) • 2.97 kB
JavaScript
import{s as w}from"./service.space-2b983a85.js";import{P as z}from"./Pagination-131b4728.js";import{_ as V,E,r as s,z as N,o as t,c as r,a as i,b as l,w as m,x as D,g as h,i as c,A as P,F as B,f as I,e as L,t as p}from"./index-4d897c91.js";import{S as b}from"./ServiceList-982253d1.js";import"./BeanAmount-40bf4e8b.js";import"./ServiceTitle-2a0b6c6e.js";const x={components:{ServiceList:b,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()}},F={class:"page"},K={class:"warp"},U={class:"search-wrap"},j={class:"input-wrap"},A={key:1,class:"space-list"},T=["onClick"],q={key:0,class:"user-profile"},G=["src"];function H(e,u,J,M,n,o){const _=s("Search"),C=s("el-icon"),y=s("el-input"),v=s("el-button"),g=s("Pagination"),f=s("ServiceList"),k=s("Empty"),S=N("loading");return t(),r("div",F,[i("div",K,[i("div",U,[i("div",j,[l(C,{size:"20"},{default:m(()=>[l(_)]),_:1}),l(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"])]),l(v,{size:"large",type:"primary",onClick:o.search},{default:m(()=>[L(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"])):c("",!0),n.loading||n.spaces.length>0?P((t(),r("ul",A,[(t(!0),r(B,null,I(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),l(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,[i("img",{src:e.getImageUri(a.user.avatar,"/images/avatar/default.png")},null,8,G),i("span",null,p(a.user.username),1)])):c("",!0)],8,T)]))),128))])),[[S,n.loading]]):c("",!0),n.keyword.trim()!==""&&n.spaces.length===0?(t(),h(k,{key:2,description:e.$t("space.searchEmpty")},null,8,["description"])):c("",!0),n.pagination.pageCount>1?(t(),h(g,{key:3,pagination:n.pagination,onCurrentChange:o.handleCurrentChange,onSizeChange:o.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):c("",!0)])])}const Z=V(x,[["render",H],["__scopeId","data-v-9f3354a5"]]);export{Z as default};