修改首页5个搜索

This commit is contained in:
熊丽君
2022-02-24 11:35:19 +08:00
parent 4b3984e06a
commit 66f401a07a
8 changed files with 605 additions and 543 deletions

View File

@ -1,111 +1,108 @@
<template>
<div class="collectAndVisit">
<div>{{ visit_count }}</div>
<div class="heart_w">
<div class="heart" @click="change()" :class="{ in: state.isCollect }"></div>
<span>{{ state.collect }}</span>
</div>
<div class="collectAndVisit">
<div>{{ visit_count }}</div>
<div class="heart_w">
<div
class="heart"
@click="change()"
:class="{ in: state.isCollect }"
></div>
<span>{{ state.collect }}</span>
</div>
</div>
</template>
<script setup>
import request from '@/utils/request'
import { reactive } from 'vue';
function launch (id) {
return request({
url: '/v1/user/collect/launch',
method: 'post',
data: { kind: props.kind, object_id: props.object_id, }
})
import request from "@/utils/request";
import { reactive } from "vue";
function launch(id) {
return request({
url: "/v1/user/collect/launch",
method: "post",
data: { kind: props.kind, object_id: props.object_id },
});
}
let flag = true;
const props = defineProps({
is_collect: {
type: Boolean,
required: true,
},
collect_count: {
type: Number,
required: true,
},
visit_count: {
type: Number,
required: true,
},
kind: {
type: Number,
required: true,
},
object_id: {
type: String,
required: true,
},
is_collect: {
type: Boolean,
required: true,
},
collect_count: {
type: Number,
required: true,
},
visit_count: {
type: Number,
required: true,
},
kind: {
type: Number,
required: true,
},
object_id: {
type: String,
required: true,
},
});
const state = reactive({
collect: props.collect_count,
isCollect: props.is_collect,
})
collect: props.collect_count,
isCollect: props.is_collect,
});
async function postData () {
if (flag) {
async function postData() {
if (flag) {
flag = false;
await launch()
.then((res) => {
if (200 == res.code) {
state.isCollect = res.data;
if (res.data) {
state.collect++;
} else {
state.collect--;
}
}
flag = true;
})
.catch(() => {
flag = false;
await launch().then(res => {
if (200 == res.code) {
state.isCollect = res.data;
if (res.data) {
state.collect++;
} else {
state.collect--;
}
}
flag = true;
}).catch(() => {
flag = false;
});
}
});
}
}
function change () {
postData();
function change() {
postData();
}
</script>
<style lang="scss" scoped>
.collectAndVisit {
display: flex;
justify-content: space-around;
.heart_w {
vertical-align: text-bottom;
span {
vertical-align: text-bottom;
position: relative;
top: 1px;
}
}
.heart {
cursor: pointer;
user-select: none;
vertical-align: text-bottom;
display: inline-block;
width: 18.3px;
height: 16.4px;
margin-right: 5px;
background-size: cover;
background-image: url(./img/heart0.png);
}
.in {
background-image: url(./img/heart1.png);
display: flex;
justify-content: space-around;
.heart_w {
vertical-align: text-bottom;
span {
vertical-align: text-bottom;
position: relative;
top: 1px;
}
}
.heart {
cursor: pointer;
user-select: none;
vertical-align: text-bottom;
display: inline-block;
width: 18.3px;
height: 16.4px;
margin-right: 5px;
background-size: cover;
background-image: url(./img/heart0.png);
}
.in {
background-image: url(./img/heart1.png);
}
}
</style>

View File

@ -22,9 +22,23 @@
<!-- <div class="labelList">
<div v-for="item in data.industrys">{{ item }}</div>
</div>-->
<div v-if="data.industrys" class="line">
所属领域
<span>{{ data.industrys[data.industrys.length - 1] }}</span>
<div v-if="data.industrys" class="line" style="overflow: hidden">
<el-col>所属领域</el-col>
<el-col
:title="data.industrys[data.industrys.length - 1]"
style="display: inline-block; width: calc(100% - 86px)"
>
<span
style="
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>{{ data.industrys[data.industrys.length - 1] }}</span
>
</el-col>
</div>
<div class="line">
所在机构

View File

@ -1,136 +1,144 @@
<template>
<div class="box">
<div class="wrap">
<div class="img">
<!-- <img :src="data.image" alt /> -->
<img src="https://t7.baidu.com/it/u=1951548898,3927145&fm=193&f=GIF" />
</div>
<div class="content">
<div class="tit" @click="handleDetail(data.id)">{{ data.title }}</div>
<slot name="des" />
<div class="box">
<div class="wrap">
<div class="img">
<!-- <img :src="data.image" alt /> -->
<img src="./img/achieve.png" />
</div>
<div class="content">
<div class="tit" @click="handleDetail(data.id)">{{ data.title }}</div>
<slot name="des" />
<div v-if="data.industrys" class="line">
所属领域
<span>{{ data.industrys[data.industrys.length - 1] }}</span>
</div>
<div class="line">
合作模式
<span>{{ data.mode_title }}</span>
</div>
<div class="line">
技术成熟度
<span>{{ data.maturity_title }}</span>
</div>
</div>
<div>
<div class="keywords">
<wordcloud v-if="data.keywords" :data="createdData(data.customers)"></wordcloud>
</div>
<collectAndVisit :is_collect="data.is_collect" :collect_count="data.collect_count" :visit_count="data.visit_count" :object_id="data.id" :kind="1005"/>
</div>
<div v-if="data.industrys" class="line">
所属领域
<span>{{ data.industrys[data.industrys.length - 1] }}</span>
</div>
<div class="line">
合作模式
<span>{{ data.mode_title }}</span>
</div>
<div class="line">
技术成熟度
<span>{{ data.maturity_title }}</span>
</div>
</div>
<div>
<div class="keywords">
<wordcloud
v-if="data.keywords"
:data="createdData(data.customers)"
></wordcloud>
</div>
<collectAndVisit
:is_collect="data.is_collect"
:collect_count="data.collect_count"
:visit_count="data.visit_count"
:object_id="data.id"
:kind="1005"
/>
</div>
</div>
</div>
</template>
<script setup>
import wordcloud from './wordcloud.vue'
import collectAndVisit from './collectAndVisit.vue'
import wordcloud from "./wordcloud.vue";
import collectAndVisit from "./collectAndVisit.vue";
const router = useRouter();
const props = defineProps({
data: {
type: Object,
required: true,
},
data: {
type: Object,
required: true,
},
});
function handleDetail (id) {
let routeData = router.resolve({ path: `/searchList/1/detail/${id}` });
window.open(routeData.href, '_blank');
function handleDetail(id) {
let routeData = router.resolve({ path: `/searchList/1/detail/${id}` });
window.open(routeData.href, "_blank");
}
function createdData (arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr))
snap.map(e => {
l.push({ name: e, value: 30 })
return { name: e, value: 30 }
})
return l;
function createdData(arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr));
snap.map((e) => {
l.push({ name: e, value: 30 });
return { name: e, value: 30 };
});
return l;
}
</script>
<style lang="scss" scoped>
.box {
width: 100%;
height: 190px;
background: #ffffff;
padding: 20px;
box-sizing: border-box;
.wrap {
display: flex;
flex-direction: row;
.img {
width: 200px;
height: 150px;
margin-right: 10px;
img {
display: block;
margin: 0;
width: 100%;
height: 100%;
}
}
.keywords {
width: 129px;
height: 129px;
}
.content {
flex: 1;
overflow: hidden;
.labelList {
overflow: hidden;
div {
padding: 2px 4px;
float: left;
background: #0054ff;
border-radius: 4px;
margin-right: 5px;
margin-bottom: 5px;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
.line {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin: 10px 0;
span {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333;
}
}
.tit {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
overflow: hidden;
cursor: pointer;
}
}
width: 100%;
height: 190px;
background: #ffffff;
padding: 20px;
box-sizing: border-box;
.wrap {
display: flex;
flex-direction: row;
.img {
width: 200px;
height: 150px;
margin-right: 10px;
img {
display: block;
margin: 0;
width: 100%;
height: 100%;
}
}
.keywords {
width: 129px;
height: 129px;
}
.content {
flex: 1;
overflow: hidden;
.labelList {
overflow: hidden;
div {
padding: 2px 4px;
float: left;
background: #0054ff;
border-radius: 4px;
margin-right: 5px;
margin-bottom: 5px;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #ffffff;
}
}
.line {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin: 10px 0;
span {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333;
}
}
.tit {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%;
font-size: 20px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
overflow: hidden;
cursor: pointer;
}
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -6,9 +6,9 @@
@handleQuery="handleQuery"
>
<template v-slot>
<el-row type="flex" style="padding: 20px 0;">
<el-row type="flex" style="padding: 20px 0">
<div style="flex: 1">
<div style="position: relative;">
<div style="position: relative">
<industrySelect @industryChange="industryChange"></industrySelect>
<div class="total">
共找到
@ -16,7 +16,7 @@
</div>
<div v-loading="loading">
<section v-for="item in state.list" :key="item.id">
<div style="border: 1px solid #DCDCDC;margin-bottom: 10px;">
<div style="border: 1px solid #dcdcdc; margin-bottom: 10px">
<gainItem :data="item"></gainItem>
</div>
</section>
@ -44,17 +44,20 @@
<script setup>
import webContact from "@/components/webContact/index.vue";
import request from '@/utils/request'
import request from "@/utils/request";
const router = useRouter();
import { onMounted } from 'vue';
import searchContainer from './components/searchContainer.vue'
import industrySelect from './components/industrySelect.vue'
import gainItem from './components/gainItem.vue'
import wordcloud from './components/wordcloud.vue'
import { onMounted } from "vue";
import searchContainer from "./components/searchContainer.vue";
import industrySelect from "./components/industrySelect.vue";
import gainItem from "./components/gainItem.vue";
import wordcloud from "./components/wordcloud.vue";
function handleDetail (id) {
let routeData = router.resolve({ path: `/searchList/0/detail/${id}`, query: { keyword: state.keyword } });
window.open(routeData.href, '_blank');
function handleDetail(id) {
let routeData = router.resolve({
path: `/searchList/0/detail/${id}`,
query: { keyword: state.keyword },
});
window.open(routeData.href, "_blank");
}
const loading = ref(true);
@ -63,33 +66,35 @@ const state = reactive({
total: 1,
pageSize: 10,
pageSizes: [10, 10 << 1, 10 << 2, 10 << 3],
keyword: '',
keyword: "",
industryList: [],
id1: '',
id2: '',
id3: '',
id1: "",
id2: "",
id3: "",
val: 3,
arr: [{
"name": "Cat",
"value": 26
},
{
"name": "fish",
"value": 19
}]
arr: [
{
name: "Cat",
value: 26,
},
{
name: "fish",
value: 19,
},
],
});
function createdData (arr) {
function createdData(arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr))
snap.map(e => {
l.push({ name: e, value: 30 })
return { name: e, value: 30 }
})
let snap = JSON.parse(JSON.stringify(arr));
snap.map((e) => {
l.push({ name: e, value: 30 });
return { name: e, value: 30 };
});
return l;
}
function search () {
let industry = '';
function search() {
let industry = "";
if (state.id1) {
industry += state.id1;
}
@ -100,19 +105,23 @@ function search () {
industry += `-${state.id3}`;
}
return request({
url: '/v1/search',
method: 'post',
data: { industry, mode: 2, page_num: state.pageNum, page_size: state.pageSize, keyword: state.keyword }
})
url: "/v1/search",
method: "post",
data: {
industry,
mode: 2,
page_num: state.pageNum,
page_size: state.pageSize,
keyword: state.keyword,
},
});
}
function handleQuery (keyword) {
function handleQuery(keyword) {
state.keyword = keyword;
getDataList()
getDataList();
}
function industryChange (industry) {
function industryChange(industry) {
if (industry.id1) {
state.id1 = industry.id1;
}
@ -122,23 +131,25 @@ function industryChange (industry) {
if (industry.id3) {
state.id3 = industry.id3;
}
getDataList()
getDataList();
}
function getDataList () {
function getDataList() {
loading.value = true;
search().then(res => {
if (200 == res.code) {
// 总条数
state.total = res.data.count;
state.list = res.data.data;
search()
.then((res) => {
if (200 == res.code) {
console.log(res);
// 总条数
state.total = res.data.count;
state.list = res.data.data;
loading.value = false;
}
})
.catch(() => {
loading.value = false;
}
}).catch(() => {
loading.value = false;
})
});
}
</script>
<style lang="scss" scoped>

View File

@ -1,295 +1,310 @@
<template>
<div v-loading="loading">
<searchContainer bannerKey="首页>成果列表" title="成果库" @handleQuery="handleQuery">
<template v-slot>
<div class="head">
<el-breadcrumb separator="/">
<el-breadcrumb-item>
<span class="one">找成果</span>
</el-breadcrumb-item>
<el-breadcrumb-item>
<span>成果详情</span>
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<el-row type="flex" style="padding-bottom: 20px;">
<div style="flex: 1">
<gainItem :data="state.expertDetail">
<template v-slot:des>
<div>{{state.expertDetail.introduce}}</div>
</template>
</gainItem>
<div class="btns">
<div class="order">预约对接</div>
<div class="share">一键分享</div>
</div>
<div v-loading="loading">
<searchContainer
bannerKey="首页>成果库>成果详情"
title="成果库"
@handleQuery="handleQuery"
>
<template v-slot>
<div class="head">
<el-breadcrumb separator="/">
<el-breadcrumb-item>
<span class="one">找成果</span>
</el-breadcrumb-item>
<el-breadcrumb-item>
<span>成果详情</span>
</el-breadcrumb-item>
</el-breadcrumb>
</div>
<el-row type="flex" style="padding-bottom: 20px">
<div style="flex: 1">
<gainItem :data="state.expertDetail">
<template v-slot:des>
<div>{{ state.expertDetail.introduce }}</div>
</template>
</gainItem>
<div class="btns">
<div class="order">预约对接</div>
<div class="share">一键分享</div>
</div>
<div class="detail">
<div style="padding: 20px 0;">
<div class="pointTit">技术视频</div>
</div>
<div style="padding: 20px 0;">
<div class="pointTit">产品详情</div>
</div>
<div class="html" v-html="state.expertDetail.introduce"></div>
</div>
</div>
<div class="r">
<webContact />
</div>
</el-row>
</template>
</searchContainer>
</div>
<div class="detail">
<div style="padding: 20px 0">
<div class="pointTit">技术视频</div>
</div>
<div style="padding: 20px 0">
<div class="pointTit">产品详情</div>
</div>
<div class="html" v-html="state.expertDetail.introduce"></div>
</div>
</div>
<div class="r">
<webContact />
</div>
</el-row>
</template>
</searchContainer>
</div>
</template>
<script setup>
import webContact from "@/components/webContact/index.vue";
import gainItem from './components/gainItem.vue'
import loadMore from './components/loadMore.vue'
import request from '@/utils/request'
import gainItem from "./components/gainItem.vue";
import loadMore from "./components/loadMore.vue";
import request from "@/utils/request";
const router = useRouter();
const route = useRoute();
import { onMounted } from 'vue';
import searchContainer from './components/searchContainer.vue'
import wordcloud from './components/wordcloud.vue'
import productItem from './components/productItem.vue'
import { onMounted } from "vue";
import searchContainer from "./components/searchContainer.vue";
import wordcloud from "./components/wordcloud.vue";
import productItem from "./components/productItem.vue";
const loading = ref(true);
const state = reactive({
pageNum: 1,
pageSize: 4,
keyword: '',
val: 3,
expertDetail: {},
arr: [{
"name": "Cat",
"value": 26
pageNum: 1,
pageSize: 4,
keyword: "",
val: 3,
expertDetail: {},
arr: [
{
name: "Cat",
value: 26,
},
{
"name": "fish",
"value": 19
}],
activeName: 'first'
name: "fish",
value: 19,
},
],
activeName: "first",
});
// 建议 列表前4条
function recommend () {
return request({
url: '/v1/search',
method: 'post',
data: { mode: 5, page_num: state.pageNum, page_size: state.pageSize, keyword: state.keyword }
})
function recommend() {
return request({
url: "/v1/search",
method: "post",
data: {
mode: 5,
page_num: state.pageNum,
page_size: state.pageSize,
keyword: state.keyword,
},
});
}
// 成果详情
function achievementDetail (id) {
return request({
url: '/v1/technology/achievement/detail',
method: 'post',
data: { id: id }
})
function achievementDetail(id) {
return request({
url: "/v1/technology/achievement/detail",
method: "post",
data: { id: id },
});
}
function createdData (arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr))
snap.map(e => {
l.push({ name: e, value: 30 })
return { name: e, value: 30 }
})
return l;
function createdData(arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr));
snap.map((e) => {
l.push({ name: e, value: 30 });
return { name: e, value: 30 };
});
return l;
}
function handleDetail (id) {
let routeData = router.resolve({ path: `/searchList/0/detail/${id}`, query: { keyword: state.keyword } });
window.open(routeData.href, '_blank');
function handleDetail(id) {
let routeData = router.resolve({
path: `/searchList/0/detail/${id}`,
query: { keyword: state.keyword },
});
window.open(routeData.href, "_blank");
}
function handleList (mode, keyword) {
router.push({ path: `/searchList/${mode}`, query: { keyword } });
function handleList(mode, keyword) {
router.push({ path: `/searchList/${mode}`, query: { keyword } });
}
// 首次加载数据,其后跳转页面
let flag = true;
function handleQuery (keyword) {
state.keyword = keyword;
if (flag) {
getDataList();
flag = false;
} else {
handleList(0, keyword);
}
function handleQuery(keyword) {
state.keyword = keyword;
if (flag) {
getDataList();
flag = false;
} else {
handleList(0, keyword);
}
}
function getDataList () {
loading.value = true;
let id = route.params.id;
if (!id) return
achievementDetail(id).then(res => {
if (200 == res.code) {
state.expertDetail = res.data;
loading.value = false;
}
}).catch(() => {
function getDataList() {
loading.value = true;
let id = route.params.id;
if (!id) return;
achievementDetail(id)
.then((res) => {
if (200 == res.code) {
console.log(res.data);
state.expertDetail = res.data;
loading.value = false;
}
})
.catch(() => {
loading.value = false;
});
}
</script>
<style lang="scss" scoped>
:deep(.el-tabs) {
.el-tabs__item {
color: #666666;
font-size: 14px;
}
.el-tabs__item:hover {
opacity: 0.8;
}
.el-tabs__item {
color: #666666;
font-size: 14px;
}
.el-tabs__item:hover {
opacity: 0.8;
}
.el-tabs__item.is-active {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.el-tabs__active-bar {
background-color: #333333;
height: 4px;
}
.el-tabs__item.is-active {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.el-tabs__active-bar {
background-color: #333333;
height: 4px;
}
.el-tabs__nav-wrap::after {
background-color: transparent;
}
.el-tabs__nav-wrap::after {
background-color: transparent;
}
}
.head {
padding: 15px 0px;
span {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
.one {
color: #333333;
}
padding: 15px 0px;
span {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
.one {
color: #333333;
}
}
.r {
display: inline-block;
width: 325px;
margin-left: 14px;
min-height: 200px;
display: inline-block;
width: 325px;
margin-left: 14px;
min-height: 200px;
}
.detail {
width: 661px;
box-sizing: border-box;
padding: 20px;
background: #fff;
.describe {
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-bottom: 5px;
}
width: 661px;
box-sizing: border-box;
padding: 20px;
background: #fff;
.describe {
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
margin-bottom: 5px;
}
}
.pointTit {
position: relative;
padding-left: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
&:before {
content: "";
top: 8px;
left: 0px;
position: absolute;
display: block;
width: 5px;
height: 5px;
background: #0054ff;
}
position: relative;
padding-left: 10px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
&:before {
content: "";
top: 8px;
left: 0px;
position: absolute;
display: block;
width: 5px;
height: 5px;
background: #0054ff;
}
}
.btns {
overflow: hidden;
padding: 0 20px 20px 20px;
width: 100%;
background-color: #fff;
margin-top: -20px;
div {
margin-top: 20px;
text-align: center;
float: right;
cursor: pointer;
user-select: none;
width: 101px;
height: 36px;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
line-height: 36px;
box-sizing: border-box;
&:hover {
opacity: 0.7;
}
}
.share {
color: #333333;
background: #f2f6ff;
border: 1px solid #dcdcdc;
margin-right: 10px;
}
.order {
background: #0054ff;
color: #ffffff;
border: none;
overflow: hidden;
padding: 0 20px 20px 20px;
width: 100%;
background-color: #fff;
margin-top: -20px;
div {
margin-top: 20px;
text-align: center;
float: right;
cursor: pointer;
user-select: none;
width: 101px;
height: 36px;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
line-height: 36px;
box-sizing: border-box;
&:hover {
opacity: 0.7;
}
}
.share {
color: #333333;
background: #f2f6ff;
border: 1px solid #dcdcdc;
margin-right: 10px;
}
.order {
background: #0054ff;
color: #ffffff;
border: none;
}
}
.achievementItem,
.loadMoreItem {
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
margin-left: -8px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
margin-left: -8px;
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
}
.patentItem {
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
padding-left: 8px;
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
padding: 20px;
background-color: #fff;
margin-bottom: 10px;
.tit {
font-size: 16px;
font-family: Source Han Sans CN;
font-weight: bold;
color: #333333;
}
.line {
padding-left: 8px;
margin: 10px 0;
font-size: 14px;
font-family: Source Han Sans CN;
font-weight: 400;
color: #666666;
}
}
</style>

View File

@ -6,9 +6,9 @@
@handleQuery="handleQuery"
>
<template v-slot>
<el-row type="flex" style="padding: 20px 0;">
<el-row type="flex" style="padding: 20px 0">
<div style="flex: 1">
<div style="position: relative;">
<div style="position: relative">
<industrySelect @industryChange="industryChange"></industrySelect>
<div class="total">
共找到
@ -16,7 +16,7 @@
</div>
<div v-loading="loading">
<section v-for="item in state.list" :key="item.id">
<div style="border: 1px solid #DCDCDC;margin-bottom: 10px;">
<div style="border: 1px solid #dcdcdc; margin-bottom: 10px">
<gainItem :data="item"></gainItem>
</div>
</section>
@ -44,17 +44,20 @@
<script setup>
import webContact from "@/components/webContact/index.vue";
import request from '@/utils/request'
import request from "@/utils/request";
const router = useRouter();
import { onMounted } from 'vue';
import searchContainer from './components/searchContainer.vue'
import industrySelect from './components/industrySelect.vue'
import gainItem from './components/gainItem.vue'
import wordcloud from './components/wordcloud.vue'
import { onMounted } from "vue";
import searchContainer from "./components/searchContainer.vue";
import industrySelect from "./components/industrySelect.vue";
import gainItem from "./components/gainItem.vue";
import wordcloud from "./components/wordcloud.vue";
function handleDetail (id) {
let routeData = router.resolve({ path: `/searchList/0/detail/${id}`, query: { keyword: state.keyword } });
window.open(routeData.href, '_blank');
function handleDetail(id) {
let routeData = router.resolve({
path: `/searchList/0/detail/${id}`,
query: { keyword: state.keyword },
});
window.open(routeData.href, "_blank");
}
const loading = ref(true);
@ -63,33 +66,35 @@ const state = reactive({
total: 1,
pageSize: 10,
pageSizes: [10, 10 << 1, 10 << 2, 10 << 3],
keyword: '',
keyword: "",
industryList: [],
id1: '',
id2: '',
id3: '',
id1: "",
id2: "",
id3: "",
val: 3,
arr: [{
"name": "Cat",
"value": 26
},
{
"name": "fish",
"value": 19
}]
arr: [
{
name: "Cat",
value: 26,
},
{
name: "fish",
value: 19,
},
],
});
function createdData (arr) {
function createdData(arr) {
let l = [];
let snap = JSON.parse(JSON.stringify(arr))
snap.map(e => {
l.push({ name: e, value: 30 })
return { name: e, value: 30 }
})
let snap = JSON.parse(JSON.stringify(arr));
snap.map((e) => {
l.push({ name: e, value: 30 });
return { name: e, value: 30 };
});
return l;
}
function search () {
let industry = '';
function search() {
let industry = "";
if (state.id1) {
industry += state.id1;
}
@ -100,19 +105,23 @@ function search () {
industry += `-${state.id3}`;
}
return request({
url: '/v1/search',
method: 'post',
data: { industry, mode: 3, page_num: state.pageNum, page_size: state.pageSize, keyword: state.keyword }
})
url: "/v1/search",
method: "post",
data: {
industry,
mode: 4,
page_num: state.pageNum,
page_size: state.pageSize,
keyword: state.keyword,
},
});
}
function handleQuery (keyword) {
function handleQuery(keyword) {
state.keyword = keyword;
getDataList()
getDataList();
}
function industryChange (industry) {
function industryChange(industry) {
if (industry.id1) {
state.id1 = industry.id1;
}
@ -122,23 +131,24 @@ function industryChange (industry) {
if (industry.id3) {
state.id3 = industry.id3;
}
getDataList()
getDataList();
}
function getDataList () {
function getDataList() {
loading.value = true;
search().then(res => {
if (200 == res.code) {
// 总条数
state.total = res.data.count;
state.list = res.data.data;
search()
.then((res) => {
if (200 == res.code) {
// 总条数
state.total = res.data.count;
state.list = res.data.data;
loading.value = false;
}
})
.catch(() => {
loading.value = false;
}
}).catch(() => {
loading.value = false;
})
});
}
</script>
<style lang="scss" scoped>

View File

@ -483,6 +483,13 @@ function getDataList() {
expert(id)
.then((res) => {
if (200 == res.code) {
let str = " ".repeat(8);
let nbsp = "\u00A0".repeat(8);
res.data.introduce = res.data.introduce.replace(/\n/g, "<br>");
res.data.introduce = res.data.introduce.replace(
new RegExp(str, "g"),
nbsp
);
state.expertDetail = res.data;
loading.value = false;
}