Commit 6084b83d by liudx

解决onblur和onclick冲突

parent e79a3721
...@@ -260,6 +260,7 @@ export default { ...@@ -260,6 +260,7 @@ export default {
name: "company", name: "company",
data() { data() {
return { return {
timer:null,
search_result_show: false, search_result_show: false,
zh_CN, zh_CN,
search_result: [], search_result: [],
...@@ -608,7 +609,9 @@ export default { ...@@ -608,7 +609,9 @@ export default {
} }
}, },
onBlur() { onBlur() {
timer = setTimeout(() => {
this.search_result_show = false; this.search_result_show = false;
}, 150);
}, },
//从联想结果打开公司页面 //从联想结果打开公司页面
lenovnoCompanyDetails(item) { lenovnoCompanyDetails(item) {
...@@ -708,7 +711,7 @@ export default { ...@@ -708,7 +711,7 @@ export default {
.search_result { .search_result {
position: absolute; position: absolute;
width: calc(100% - 120px); width: calc(100% - 120px);
height: 300px; // height: 300px;
top: 54px; top: 54px;
left: 0; left: 0;
background-color: #fff; background-color: #fff;
...@@ -716,7 +719,7 @@ export default { ...@@ -716,7 +719,7 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05); box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item { .search_result_item {
// height: 45px; // height: 45px;
padding: 15px 15px 15px 25px; padding: 15px 5px 15px 25px;
font-family: "SF Pro Text"; font-family: "SF Pro Text";
font-size: 16px; font-size: 16px;
} }
......
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
<div style="position: relative"> <div style="position: relative">
<div <div
v-if="patent_cate == 'title'" v-if="patent_cate == 'title'"
style="cursor: pointer" style="cursor: pointer; width: 80%"
v-html="item.title" v-html="item.title"
@click="lenovnoPatentDetails(item)" @click="lenovnoPatentDetails(item)"
></div> ></div>
<div <div
v-else v-else
style="cursor: pointer" style="cursor: pointer; width: 80%"
v-html="item.gkh" v-html="item.gkh"
@click="lenovnoPatentDetails(item)" @click="lenovnoPatentDetails(item)"
></div> ></div>
...@@ -71,7 +71,6 @@ ...@@ -71,7 +71,6 @@
@input="onInput(tab_id)" @input="onInput(tab_id)"
@blur="onBlur" @blur="onBlur"
@focus="onFocus(tab_id)" @focus="onFocus(tab_id)"
> >
<template #enterButton> <template #enterButton>
<img <img
...@@ -91,13 +90,13 @@ ...@@ -91,13 +90,13 @@
<div style="position: relative"> <div style="position: relative">
<div <div
v-if="company_cate == 'company_name'" v-if="company_cate == 'company_name'"
style="cursor: pointer" style="cursor: pointer; width: 80%"
v-html="item.company_name" v-html="item.company_name"
@click="lenovnoCompanyDetails(item)" @click="lenovnoCompanyDetails(item)"
></div> ></div>
<div <div
v-else v-else
style="cursor: pointer" style="cursor: pointer; width: 80%"
v-html="item.company_name" v-html="item.company_name"
@click="lenovnoCompanyDetails(item)" @click="lenovnoCompanyDetails(item)"
></div> ></div>
...@@ -240,6 +239,7 @@ export default { ...@@ -240,6 +239,7 @@ export default {
data() { data() {
return { return {
tab_id: "1", tab_id: "1",
timer: null,
patent_cate: "", patent_cate: "",
company_cate: "", company_cate: "",
search_result_show: false, search_result_show: false,
...@@ -335,6 +335,7 @@ export default { ...@@ -335,6 +335,7 @@ export default {
}, },
//从联想结果打开专利页面 //从联想结果打开专利页面
lenovnoPatentDetails(item) { lenovnoPatentDetails(item) {
clearTimeout(this.timer);
this.$router.push({ this.$router.push({
path: "/patentDetails", path: "/patentDetails",
query: { query: {
...@@ -344,6 +345,7 @@ export default { ...@@ -344,6 +345,7 @@ export default {
}, },
//从联想结果打开公司页面 //从联想结果打开公司页面
lenovnoCompanyDetails(item) { lenovnoCompanyDetails(item) {
clearTimeout(this.timer);
this.$router.push({ this.$router.push({
path: "/companyDetails", path: "/companyDetails",
query: { query: {
...@@ -468,7 +470,9 @@ export default { ...@@ -468,7 +470,9 @@ export default {
} }
}, },
onBlur() { onBlur() {
timer = setTimeout(() => {
this.search_result_show = false; this.search_result_show = false;
}, 150);
}, },
}, },
mounted() {}, mounted() {},
...@@ -570,7 +574,7 @@ export default { ...@@ -570,7 +574,7 @@ export default {
.search_result { .search_result {
position: absolute; position: absolute;
width: calc(100% - 120px); width: calc(100% - 120px);
height: 300px; // height: 300px;
top: 54px; top: 54px;
left: 0; left: 0;
background-color: #fff; background-color: #fff;
...@@ -578,7 +582,7 @@ export default { ...@@ -578,7 +582,7 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05); box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item { .search_result_item {
// height: 45px; // height: 45px;
padding: 15px 15px 15px 25px; padding: 15px 5px 15px 25px;
font-family: "SF Pro Text"; font-family: "SF Pro Text";
font-size: 16px; font-size: 16px;
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div style="position: relative"> <div style="position: relative">
<div <div
v-if="patent_cate == 'title'" v-if="patent_cate == 'title'"
style="cursor: pointer" style="cursor: pointer;width: 80%;"
v-html="item.title" v-html="item.title"
@click="lenovnoPatentDetails(item)" @click="lenovnoPatentDetails(item)"
></div> ></div>
...@@ -162,6 +162,7 @@ export default { ...@@ -162,6 +162,7 @@ export default {
name: "patent", name: "patent",
data() { data() {
return { return {
timer:null,
zh_CN, zh_CN,
search_result_show: false, search_result_show: false,
search_result: [], search_result: [],
...@@ -402,16 +403,20 @@ export default { ...@@ -402,16 +403,20 @@ export default {
}, },
//onBlur //onBlur
onBlur() { onBlur() {
timer = setTimeout(() => {
this.search_result_show = false; this.search_result_show = false;
}, 150);
}, },
//从联想结果打开专利页面 //从联想结果打开专利页面
lenovnoPatentDetails(item) { lenovnoPatentDetails(item) {
this.$router.push({ this.$router.push({
path: "/patentDetails", path: "/patentDetails",
query: { query: {
id: item.mysql_id, id: item.mysql_id,
}, },
}); });
// this.search_result_show = false;
}, },
}, },
watch: { watch: {
...@@ -495,7 +500,7 @@ export default { ...@@ -495,7 +500,7 @@ export default {
.search_result { .search_result {
position: absolute; position: absolute;
width: calc(100% - 120px); width: calc(100% - 120px);
height: 300px; // height: 300px;
top: 54px; top: 54px;
left: 0; left: 0;
background-color: #fff; background-color: #fff;
...@@ -503,9 +508,10 @@ export default { ...@@ -503,9 +508,10 @@ export default {
box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05); box-shadow: 0px 5px 5px 2px rgba(0, 0, 0, 0.05);
.search_result_item { .search_result_item {
// height: 45px; // height: 45px;
padding: 15px 15px 15px 25px; padding: 15px 5px 15px 25px;
font-family: "SF Pro Text"; font-family: "SF Pro Text";
font-size: 16px; font-size: 16px;
} }
.search_result_item:hover { .search_result_item:hover {
background-color: #f5fbff; background-color: #f5fbff;
......
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