Commit f574b783 by liudx

添加提示信息

parent fbbb74de
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</a-select> </a-select>
</template> </template>
<template #addonAfter> <template #addonAfter>
<div @click="onsearch"> <div @click="onsearch">
<img <img
style="padding-right: 5px" style="padding-right: 5px"
src="@/static/home/index/icon-search.png" src="@/static/home/index/icon-search.png"
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<!-- 公司列表结果 --> <!-- 公司列表结果 -->
<div class="company_con_right"> <div class="company_con_right">
<h2> <h2>
推荐<span class="result_count">{{ total }}</span 推荐<span class="result_count">{{ total ? total : 0 }}</span
>条相关结果 >条相关结果
<!-- 筛选的标签展示 --> <!-- 筛选的标签展示 -->
<div class="filter"> <div class="filter">
...@@ -230,8 +230,22 @@ ...@@ -230,8 +230,22 @@
</div> </div>
</div> </div>
</div> </div>
<div style="height: 50%" v-if="search_word">
<a-empty
style="margin-top: 15%"
:description="'您的搜索词太宽泛,建议更换一下搜索词'"
/>
</div>
<div style="height: 50%" v-if="total==0">
<a-empty
style="margin-top: 15%"
:description="'暂无数据'"
/>
</div>
<br /> <br />
<a-pagination <a-pagination
v-if="(!search_word)"
v-model:current="currentPage" v-model:current="currentPage"
@change="onChange" @change="onChange"
:total="total" :total="total"
...@@ -261,7 +275,7 @@ export default { ...@@ -261,7 +275,7 @@ export default {
name: "company", name: "company",
data() { data() {
return { return {
timer:null, timer: null,
search_result_show: false, search_result_show: false,
zh_CN, zh_CN,
search_result: [], search_result: [],
...@@ -292,6 +306,7 @@ export default { ...@@ -292,6 +306,7 @@ export default {
}, },
filter: [], filter: [],
companylist: [], companylist: [],
search_word: false,
}; };
}, },
components: {}, components: {},
...@@ -338,6 +353,7 @@ export default { ...@@ -338,6 +353,7 @@ export default {
enterpriseList({ ...params }).then((res) => { enterpriseList({ ...params }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.companylist = res.data.list; this.companylist = res.data.list;
this.search_word = res.data.search_word;
this.total = res.data.total; this.total = res.data.total;
} else { } else {
} }
...@@ -429,6 +445,7 @@ export default { ...@@ -429,6 +445,7 @@ export default {
enterpriseSelect({ ...params }).then((res) => { enterpriseSelect({ ...params }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.companylist = res.data.list; this.companylist = res.data.list;
this.search_word = res.data.search_word;
this.total = res.data.total; this.total = res.data.total;
} }
}); });
...@@ -573,9 +590,10 @@ export default { ...@@ -573,9 +590,10 @@ export default {
}); });
}, },
onsearch() { onsearch() {
this.currentPage = 1;
this.search_result_show = false;
this.keyword ? (this.filter = [this.keyword]) : (this.filter = []); this.keyword ? (this.filter = [this.keyword]) : (this.filter = []);
this.getCompanyList(this.keyword); this.getCompanyList(this.keyword);
this.search_result_show = false;
}, },
//联想搜索 //联想搜索
onInput() { onInput() {
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<!-- 专利表格结果 --> <!-- 专利表格结果 -->
<div class="patent_con_right"> <div class="patent_con_right">
<h2> <h2>
推荐<span>{{ total }}</span 推荐<span>{{ total?total:0 }}</span
>条相关结果 >条相关结果
<!-- 筛选的标签展示 --> <!-- 筛选的标签展示 -->
<div class="filter"> <div class="filter">
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
:data-source="patentdata" :data-source="patentdata"
:pagination="false" :pagination="false"
:customRow="rowClick" :customRow="rowClick"
v-if="!search_word"
> >
<template #bodyCell="{ column, text }"> <template #bodyCell="{ column, text }">
<template v-if="column.dataIndex === 'name'"> <template v-if="column.dataIndex === 'name'">
...@@ -137,10 +138,14 @@ ...@@ -137,10 +138,14 @@
</template> </template>
</template> </template>
</a-table> </a-table>
<div style="height: 50%;" v-else>
<a-empty style="margin-top: 15%;" :description="'您的搜索词太宽泛,建议更换一下搜索词'" />
</div>
<br /> <br />
<a-pagination <a-pagination
v-model:current="currentPage" v-model:current="currentPage"
@change="onChange" @change="onChange"
v-if="!search_word"
:total="total" :total="total"
:showSizeChanger="false" :showSizeChanger="false"
/> />
...@@ -225,6 +230,7 @@ export default { ...@@ -225,6 +230,7 @@ export default {
patentdata: [], patentdata: [],
filter: [], filter: [],
total: 0, total: 0,
search_word:false
}; };
}, },
components: {}, components: {},
...@@ -242,6 +248,7 @@ export default { ...@@ -242,6 +248,7 @@ export default {
patents({ ...params }).then((res) => { patents({ ...params }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.patentdata = res.data.list; this.patentdata = res.data.list;
this.search_word = res.data.search_word
this.total = res.data.total; this.total = res.data.total;
} else { } else {
message.error(res.data.msg); message.error(res.data.msg);
...@@ -249,9 +256,11 @@ export default { ...@@ -249,9 +256,11 @@ export default {
}); });
}, },
onsearch() { onsearch() {
this.currentPage = 1;
this.search_result_show = false;
this.keyword ? (this.filter = [this.keyword]) : (this.filter = []); this.keyword ? (this.filter = [this.keyword]) : (this.filter = []);
this.getList(this.keyword); this.getList(this.keyword);
this.search_result_show = false;
}, },
//改变页码 //改变页码
onChange() { onChange() {
...@@ -277,7 +286,8 @@ export default { ...@@ -277,7 +286,8 @@ export default {
}; };
patentselect({ ...params }).then((res) => { patentselect({ ...params }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.patentdata = res.data.list; this.patentdata = res.data.list
this.search_word = res.data.search_word
this.total = res.data.total; this.total = res.data.total;
} }
}); });
...@@ -374,7 +384,6 @@ export default { ...@@ -374,7 +384,6 @@ export default {
}, },
//联想搜索 //联想搜索
onInput() { onInput() {
console.log(11111111111111);
patentLenovo({ keyword: this.keyword }).then((res) => { patentLenovo({ keyword: this.keyword }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.search_result_show = true; this.search_result_show = true;
...@@ -390,8 +399,6 @@ export default { ...@@ -390,8 +399,6 @@ export default {
}, },
// //
onFocus() { onFocus() {
console.log(2222222222222);
if (this.keyword) { if (this.keyword) {
patentLenovo({ keyword: this.keyword }).then((res) => { patentLenovo({ keyword: this.keyword }).then((res) => {
if (res.code == 0) { if (res.code == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment