20.cf31213674db19a55d86.js 5.6 KB

1
  1. webpackJsonp([20],{"82K2":function(e,t){},WjcP:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("SQ4B"),l=a("ea32"),r=a("vGYV"),n=a("qI5z"),i=a("b9vf"),c=a("2uFj"),o={name:"ResourceList",components:{TopSearch:l.a},data:function(){return{logoTitle:c.a.logoTitle,logo_transparent:c.a.logo_transparent,user:{},isLogin:!1,loading:!1,searchVal:"",curResourceList:[],searchType:"2",searchTypeArr:[{name:"全部",value:"all"},{name:"项目",value:"0"},{name:"机构",value:"1"},{name:"资源",value:"2"},{name:"专家",value:"3"}],activePage:1,totalElements:0}},methods:{loadData:function(){null!=Object(r.K)("user")&&(this.isLogin=!0),this.searchVal=this.$route.params.searchVal,this.handleSearchData()},checkLogin:function(){this.checkCreateProjectAuth()},checkCreateProjectAuth:function(){var e=this;this.isLogin?this.isLogin&&s.a.get(i.a.USER.IS_PART.replace("{userId}",this.user.id)).then(function(t){e.$router.push("/project/create")}).catch(function(e){Object(n.a)("error",e.data)}):(console.log("请登录后访问"),Object(n.a)("warning","请登录后访问"))},handleSearchData:function(){var e=this;if(0==this.searchType)this.$router.push({name:"Square",params:{searchVal:this.searchVal,searchType:"project",currTab:"project"}});else if(1==this.searchType)this.$router.push({name:"AgencyList",params:{searchVal:this.searchVal}});else if(2==this.searchType){var t={keyword:this.searchVal,activePage:1,columnFilters:[{field:"type",type:"enums",enums:this.searchTypeArr,value:this.searchType}]};s.a.post("/api/common/index/page",t).then(function(t){e.curResourceList=t.data.resourcePage.content,e.totalElements=t.data.resourcePage.totalElements})}else 3==this.searchType&&this.$router.push({name:"ExpertList",params:{searchVal:this.searchVal}})},nextPage:function(){var e=this,t={keyword:this.searchVal,activePage:this.activePage,columnFilters:[{field:"type",type:"enums",enums:this.searchTypeArr,value:this.searchType}]};s.a.post("/api/common/index/page",t).then(function(t){e.curResourceList=t.data.resourcePage.content,e.totalElements=t.data.resourcePage.totalElements})},gotoHome:function(){this.$router.push("/home")},handleTypeClick:function(e){this.searchType=e.name},handlePageChange:function(e){this.activePage=e,this.nextPage()},goToDetail:function(e){this.$router.push({name:"ResourceDetail",path:"/resource/detail",query:{id:e}})},showLoading:function(){this.loading=!0},hideLoading:function(){this.loading=!1},setUserInfo:function(){this.user=Object(r.K)("user")&&Object(r.K)("user").userVO}},mounted:function(){this.setUserInfo(),this.loadData()}},u={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"home-wrapper"},[a("div",{staticClass:"nav",attrs:{stype:"height:500px"}},[a("el-row",{staticClass:"search-nav",staticStyle:{padding:"30px 0 20px 0"}},[a("el-col",{attrs:{span:6}},[a("div",{staticClass:"pull-left",staticStyle:{cursor:"pointer"},on:{click:e.gotoHome}},[a("img",{staticClass:"logo-img",attrs:{src:e.logo_transparent}}),e._v(" "),a("span",{staticClass:"logo-title"},[e._v(e._s(e.logoTitle))])])]),e._v(" "),a("el-col",{attrs:{span:12}},[a("div",{staticClass:"search-nav"},[a("div",{attrs:{id:"search-block "}},[a("el-tabs",{attrs:{type:"card"},on:{"tab-click":e.handleTypeClick},model:{value:e.searchType,callback:function(t){e.searchType=t},expression:"searchType"}},e._l(e.searchTypeArr,function(t){return"all"!==t.value?a("el-tab-pane",{key:t.value,attrs:{label:t.name,name:t.value}}):e._e()}),1),e._v(" "),a("div",{staticClass:"search-input"},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入内容"},model:{value:e.searchVal,callback:function(t){e.searchVal=t},expression:"searchVal"}},[a("el-button",{staticClass:"search-button",attrs:{slot:"append",type:"primary"},on:{click:e.handleSearchData},slot:"append"},[e._v("搜索")])],1)],1)],1)])]),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-button",{staticClass:"releaseBtn",attrs:{type:"primary pull-right"},on:{click:function(t){return e.checkLogin()}}},[e._v("免费发布众测需求")])],1)],1)],1),e._v(" "),a("div",{staticClass:"container",staticStyle:{margin:"20px auto"}},[a("div",{staticClass:"create-body"},[a("div",{staticClass:"title h2"},[e._v("众测资源")]),e._v(" "),[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"multipleTable",staticStyle:{width:"100%","font-size":"20px",color:"black"},attrs:{data:e.curResourceList,"tooltip-effect":"dark"}},[a("el-table-column",{attrs:{label:"图标",width:"100"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("img",{staticStyle:{width:"50px",height:"50px"},attrs:{src:e.row.photoUrl}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"left",width:"250"}}),e._v(" "),a("el-table-column",{attrs:{prop:"type",align:"left",label:"类型"}}),e._v(" "),a("el-table-column",{attrs:{prop:"state",align:"left",label:"状态"}}),e._v(" "),a("el-table-column",{attrs:{prop:"unitWork",align:"center",label:"单位"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"btn btn-small btn-info",on:{click:function(a){return e.goToDetail(t.row.code)}}},[e._v("查看详情")])]}}])})],1)],e._v(" "),a("el-collapse",{staticStyle:{margin:"0 30px"},attrs:{accordion:""}},[e.curResourceList&&e.curResourceList.length?a("el-pagination",{staticClass:"pull-right",attrs:{"page-size":10,layout:"prev, pager, next",total:e.totalElements,"current-page":e.activePage},on:{"current-change":e.handlePageChange}}):e._e()],1)],2)])])},staticRenderFns:[]};var h=a("VU/8")(o,u,!1,function(e){a("82K2")},null,null);t.default=h.exports}});