goldpankit
Version:
GoldPanKit是一款极速研发套件,可在套件中快速构建各类技术框架和项目。开源作者可发布自己的项目,并为其设定金额,实现开源项目的盈利。
2 lines (1 loc) • 2.98 kB
JavaScript
import{s as z}from"./service.space-77a2f5ff.js";import{P as V}from"./Pagination-8282e6ee.js";import{_ as E,E as N,r as t,A as b,o as i,c as l,a as o,b as r,w as m,y as x,g as h,i as c,B,F as D,f as P,e as L,t as p}from"./index-10e8cffd.js";import{S as A}from"./ServiceList-89a5e03b.js";import"./BeanAmount-b7d4fa2a.js";import"./ServiceTitle-c589949d.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"),g=t("Pagination"),f=t("ServiceList"),k=t("Avatar"),S=t("Empty"),w=b("loading");return i(),l("div",I,[o("div",K,[o("div",j,[o("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),size:"large",placeholder:e.$t("space.searchPlaceholder"),onKeypress:x(s.search,["enter","native"])},null,8,["modelValue","placeholder","onKeypress"])]),r(v,{size:"large",type:"primary",onClick:s.search},{default:m(()=>[L(p(e.$t("common.search")),1)]),_:1},8,["onClick"])]),n.pagination.pageCount>1?(i(),h(g,{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?B((i(),l("ul",U,[(i(!0),l(D,null,P(n.spaces,a=>(i(),l("li",{key:a.id},[o("a",{href:"javascript:;",onClick:d=>e.$router.push({name:"SpaceDetail",params:{name:a.name}})},[o("h3",null,p(a.name),1),o("p",null,p(a.introduce),1),r(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?(i(),l("div",G,[r(k,{"file-key":a.user.avatar,size:"30px",margin:"0 10px 0 0"},null,8,["file-key"]),o("span",null,p(a.user.username),1)])):c("",!0)],8,q)]))),128))])),[[w,n.loading]]):c("",!0),n.keyword.trim()!==""&&n.spaces.length===0?(i(),h(S,{key:2,description:e.$t("space.searchEmpty")},null,8,["description"])):c("",!0),n.pagination.pageCount>1?(i(),h(g,{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-ab9649f7"]]);export{Z as default};