Commit e79a3721 by liudx

联想bug修改

parent 6f62a753
......@@ -7,6 +7,7 @@
allowClear
@input="onInput"
@blur="onBlur"
@focus="onFocus"
>
<template #addonBefore>
<a-select v-model:value="type" class="type">
......@@ -261,7 +262,7 @@ export default {
return {
search_result_show: false,
zh_CN,
search_result:[],
search_result: [],
total: 0,
currentPage: 1,
keyword: "",
......@@ -580,9 +581,7 @@ export default {
this.search_result = [];
this.search_result_show = true;
this.company_cate = res.data.name_or_legal;
this.search_result = JSON.parse(JSON.stringify(res.data.list));
// this.search_result = res.data.list;
console.log(this.search_result)
this.search_result = res.data.list;
if (this.search_result.length == 0) {
this.search_result_show = false;
}
......@@ -591,8 +590,25 @@ export default {
}
});
},
onBlur(){
this.search_result_show = false
onFocus() {
if (this.keyword) {
enterpriseLenovo({ keyword: this.keyword }).then((res) => {
if (res.code == 0) {
this.search_result = [];
this.search_result_show = true;
this.company_cate = res.data.name_or_legal;
this.search_result = res.data.list;
if (this.search_result.length == 0) {
this.search_result_show = false;
}
} else {
this.search_result_show = false;
}
});
}
},
onBlur() {
this.search_result_show = false;
},
//从联想结果打开公司页面
lenovnoCompanyDetails(item) {
......
......@@ -25,6 +25,8 @@
placeholder="请输入关键词"
@search="onSearch"
@input="onInput(tab_id)"
@blur="onBlur"
@focus="onFocus(tab_id)"
>
<template #enterButton>
<img
......@@ -67,6 +69,9 @@
placeholder="请输入关键词"
@search="onSearch"
@input="onInput(tab_id)"
@blur="onBlur"
@focus="onFocus(tab_id)"
>
<template #enterButton>
<img
......@@ -76,7 +81,7 @@
/>搜索
</template>
</a-input-search>
<!-- 联想搜索 -->
<!-- 联想搜索结果 -->
<div class="search_result" v-show="search_result_show">
<div
class="search_result_item"
......@@ -378,8 +383,8 @@ export default {
// console.log(id)
this.tab_id = id;
this.search_result_show = false;
this.search_result = []
this.searchValue = ''
this.search_result = [];
this.searchValue = "";
},
onSearch() {
if (this.tab_id == "1") {
......@@ -401,7 +406,7 @@ export default {
//联想搜索
onInput(tab_id) {
//专利联想搜索
if (tab_id == 1) {
if (tab_id == 1 && this.searchValue) {
patentLenovo({ keyword: this.searchValue }).then((res) => {
if (res.code == 0) {
this.search_result_show = true;
......@@ -415,7 +420,38 @@ export default {
}
});
// }
} else if (tab_id == 2 && this.searchValue) {
this.search_result_show = true;
enterpriseLenovo({ keyword: this.searchValue }).then((res) => {
if (res.code == 0) {
this.search_result_show = true;
this.company_cate = res.data.name_or_legal;
this.search_result = res.data.list;
if (this.search_result.length == 0) {
this.search_result_show = false;
}
} else {
this.search_result_show = false;
}
});
}
},
onFocus(tab_id) {
if (tab_id == 1 && this.searchValue) {
patentLenovo({ keyword: this.searchValue }).then((res) => {
if (res.code == 0) {
this.search_result_show = true;
this.patent_cate = res.data.title_or_gkh;
this.search_result = res.data.list;
if (this.search_result.length == 0) {
this.search_result_show = false;
}
} else {
this.search_result_show = false;
}
});
// }
} else if (tab_id == 2 && this.searchValue) {
this.search_result_show = true;
enterpriseLenovo({ keyword: this.searchValue }).then((res) => {
if (res.code == 0) {
......@@ -431,6 +467,9 @@ export default {
});
}
},
onBlur() {
this.search_result_show = false;
},
},
mounted() {},
created() {
......
......@@ -6,6 +6,7 @@
:bordered="false"
allowClear
@input="onInput"
@focus="onFocus"
@blur="onBlur"
>
<template #addonBefore>
......@@ -150,11 +151,7 @@
<router-view></router-view>
</template>
<script>
import {
patents,
patentselect,
patentLenovo,
} from "../../utils/indexApi";
import { patents, patentselect, patentLenovo } from "../../utils/indexApi";
import dayjs from "dayjs";
import "dayjs/locale/zh-cn";
import zh_CN from "ant-design-vue/lib/locale-provider/zh_CN";
......@@ -386,9 +383,26 @@ export default {
}
});
},
//
onFocus() {
if (this.keyword) {
patentLenovo({ keyword: this.keyword }).then((res) => {
if (res.code == 0) {
this.search_result_show = true;
this.patent_cate = res.data.title_or_gkh;
this.search_result = res.data.list;
if (this.search_result.length == 0) {
this.search_result_show = false;
}
} else {
this.search_result_show = false;
}
});
}
},
//onBlur
onBlur(){
this.search_result_show = false
onBlur() {
this.search_result_show = false;
},
//从联想结果打开专利页面
lenovnoPatentDetails(item) {
......@@ -399,7 +413,6 @@ export default {
},
});
},
},
watch: {
type: function (newV, oldV) {
......
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