UNPKG

goldpankit

Version:

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

2 lines (1 loc) 2.95 kB
import{s as z}from"./service.space-593cb0f1.js";import{P as V}from"./Pagination-78a0b3be.js";import{_ as E,E as N,r as t,A as x,o,c as l,a as i,b as r,w as m,y as B,h,j as c,B as D,F as P,g as L,e as b,t as p}from"./index-8656c7f4.js";import{S as A}from"./ServiceList-6dafff67.js";import"./BeanAmount-eaabd19e.js";import"./ServiceTitle-3e768913.js";const F={components:{ServiceList:A,Empty:N,Pagination:V},data(){return{loading:!1,keyword:"",pagination:{pageIndex:1,pageCount:0,capacity:15,total:0},spaces:[]}},methods:{search(){this.loading||(this.loading=!0,z({...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"},T={class:"input-wrap"},U={key:1,class:"space-list"},q=["onClick"],G={key:0,class:"user-profile"};function H(e,u,J,M,n,s){const _=t("Search"),C=t("el-icon"),y=t("el-input"),v=t("el-button"),d=t("Pagination"),f=t("ServiceList"),k=t("Avatar"),S=t("Empty"),w=x("loading");return o(),l("div",I,[i("div",K,[i("div",j,[i("div",T,[r(C,{size:"20"},{default:m(()=>[r(_)]),_:1}),r(y,{modelValue:n.keyword,"onUpdate:modelValue":u[0]||(u[0]=a=>n.keyword=a),placeholder:e.$t("space.searchPlaceholder"),onKeypress:B(s.search,["enter","native"])},null,8,["modelValue","placeholder","onKeypress"])]),r(v,{type:"primary",onClick:s.search},{default:m(()=>[b(p(e.$t("common.search")),1)]),_:1},8,["onClick"])]),n.pagination.pageCount>1?(o(),h(d,{key:0,pagination:n.pagination,position:"top",onCurrentChange:s.handleCurrentChange,onSizeChange:s.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):c("",!0),n.loading||n.spaces.length>0?D((o(),l("ul",U,[(o(!0),l(P,null,L(n.spaces,a=>(o(),l("li",{key:a.id},[i("a",{href:"javascript:;",onClick:g=>e.$router.push({name:"SpaceDetail",params:{name:a.name}})},[i("h3",null,p(a.name),1),i("p",null,p(a.introduce),1),r(f,{services:a.mainServices,onSelect:g=>e.$router.push({name:"ServiceDetail",params:{spaceName:a.name,serviceName:g.name}})},null,8,["services","onSelect"]),a.user!=null?(o(),l("div",G,[r(k,{"file-key":a.user.avatar,size:"30px",margin:"0 10px 0 0"},null,8,["file-key"]),i("span",null,p(a.user.username),1)])):c("",!0)],8,q)]))),128))])),[[w,n.loading]]):c("",!0),n.keyword.trim()!==""&&n.spaces.length===0?(o(),h(S,{key:2,description:e.$t("space.searchEmpty")},null,8,["description"])):c("",!0),n.pagination.pageCount>1?(o(),h(d,{key:3,pagination:n.pagination,onCurrentChange:s.handleCurrentChange,onSizeChange:s.handleSizeChange},null,8,["pagination","onCurrentChange","onSizeChange"])):c("",!0)])])}const Z=E(F,[["render",H],["__scopeId","data-v-a6dfd383"]]);export{Z as default};