|
@@ -12,12 +12,12 @@
|
|
|
<el-col :span="12">
|
|
|
<div class="search-nav">
|
|
|
<div id="search-block " class="">
|
|
|
- <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
|
|
|
- <el-tab-pane v-for="item in searchTypeArr" :label="item.label" :name="item.value" :key="item.value"></el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
- <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
|
|
|
- <el-button class="search-button" slot="append" type="primary" @click="loadTechnologyArticles(1)">搜索</el-button>
|
|
|
- </el-input>
|
|
|
+ <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
|
|
|
+ <el-tab-pane v-for="item in searchTypeArr" :label="item.label" :name="item.value" :key="item.value"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
|
|
|
+ <el-button class="search-button" slot="append" type="primary" @click="loadTechnologyArticles(1)">搜索</el-button>
|
|
|
+ </el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -37,6 +37,12 @@
|
|
|
<div class="container" style="margin: 15px auto">
|
|
|
<el-row>
|
|
|
<el-col :span="18" class="project-task">
|
|
|
+ <CrowdTool
|
|
|
+ :toolList = techArticleList.content v-if="searchType=='2'">
|
|
|
+ </CrowdTool>
|
|
|
+ <CrowdCase
|
|
|
+ :caseList = techArticleList.content v-if="searchType=='3'" @refreshList="loadTechnologyArticles(activePage)">
|
|
|
+ </CrowdCase>
|
|
|
<TechnologyCard
|
|
|
:techArticleList = techArticleList.content v-if="searchType=='0'" @refreshList="loadTechnologyArticles(activePage)">
|
|
|
</TechnologyCard>
|
|
@@ -66,6 +72,8 @@
|
|
|
import SearchBar from '../../components/commons/SearchBar'
|
|
|
import TechnologyCard from './TechnologyCard'
|
|
|
import TechnologyMG from './TechnologyMG'
|
|
|
+ import CrowdCase from './CrowdCase'
|
|
|
+ import CrowdTool from './CrowdTool'
|
|
|
import HotActicle from './HotActicle'
|
|
|
import PopularProject from '../Square/PopularProject'
|
|
|
import {storageGet} from '@/js/index.js'
|
|
@@ -78,16 +86,28 @@
|
|
|
TechnologyCard,
|
|
|
TechnologyMG,
|
|
|
PopularProject,
|
|
|
- HotActicle
|
|
|
+ HotActicle,
|
|
|
+ CrowdCase,
|
|
|
+ CrowdTool
|
|
|
},
|
|
|
data(){
|
|
|
return {
|
|
|
loading: false,
|
|
|
isLogin: false,
|
|
|
searchVal: '',
|
|
|
- searchType:'',
|
|
|
+ searchType:'2',
|
|
|
searchTypeArr:[
|
|
|
{
|
|
|
+ "name": "众测工具",
|
|
|
+ "value": "2",
|
|
|
+ "label":'工具'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "name": "众测案例",
|
|
|
+ "value": "3",
|
|
|
+ "label":'案例'
|
|
|
+ },
|
|
|
+ {
|
|
|
"name": "技术文章",
|
|
|
"value": "0",
|
|
|
"label":'文章'
|
|
@@ -115,7 +135,6 @@
|
|
|
},
|
|
|
checkCreateProjectAuth() {
|
|
|
if (!this.isLogin) {
|
|
|
- console.log("请登录后访问");
|
|
|
notify('warning', '请登录后访问');
|
|
|
} else if (this.isLogin) {
|
|
|
Http.get(Apis.USER.IS_PART.replace('{userId}', this.user.id)).then((res) => {
|
|
@@ -143,8 +162,6 @@
|
|
|
})
|
|
|
},
|
|
|
loadTechnologyArticles(index){
|
|
|
- // let url=`/api/technical/articles?searchCondition={"keyword":"${this.keyword}","activePage":${this.activePage}}`;
|
|
|
- // Http.get(encodeURI(url))
|
|
|
let url = '/api/technical/articles';
|
|
|
this.activePage = index;
|
|
|
let params = {
|
|
@@ -157,18 +174,23 @@
|
|
|
"enums": this.searchTypeArr,
|
|
|
"value": this.searchType//展示技术文章value为0
|
|
|
}
|
|
|
- ]
|
|
|
- }
|
|
|
+ ],
|
|
|
+ "sortType":(this.searchType === '2' || this.searchType === '3' ) ? 'id' : 'publicTime'
|
|
|
+ };
|
|
|
Http.post(url,params)
|
|
|
.then(res=>{
|
|
|
- if(res.data.technicalArticlesPage){
|
|
|
- this.techArticleList = res.data.technicalArticlesPage;
|
|
|
- this.searchType = '0';
|
|
|
- }
|
|
|
- else if(res.data.publicationsPage){
|
|
|
- this.techArticleList = res.data.publicationsPage;
|
|
|
- this.searchType = '1';
|
|
|
- }
|
|
|
+ let { technicalArticlesPage , publicationsPage ,toolVOPage,taskVOS} = res.data;
|
|
|
+ this.techArticleList = technicalArticlesPage || publicationsPage || toolVOPage || taskVOS;
|
|
|
+ console.log(res.data)
|
|
|
+ // if(res.data.technicalArticlesPage){
|
|
|
+ // this.techArticleList = res.data.technicalArticlesPage;
|
|
|
+ // }else if(res.data.publicationsPage){
|
|
|
+ // this.techArticleList = res.data.publicationsPage;
|
|
|
+ // }else if(res.data.toolVOPage){
|
|
|
+ // this.techArticleList = res.data.toolVOPage;
|
|
|
+ // } else if(res.data.taskVOS){
|
|
|
+ // this.techArticleList = res.data.taskVOS
|
|
|
+ // }
|
|
|
})
|
|
|
},
|
|
|
handlePageChange(index){
|