1
1
<template >
2
2
<div class =" search-component" >
3
- <div v-if =" show" class =" transition-box" style = " display : inline-block ; " >
3
+ <div v-if =" show" class =" transition-box" >
4
4
<el-select
5
5
ref =" searchInput"
6
- v-model =" value"
7
6
filterable
8
7
placeholder =" 请选择"
9
8
@blur =" hiddenSearch"
17
16
/>
18
17
</el-select >
19
18
</div >
20
- <div
21
- v-if =" btnShow"
22
- class =" user-box"
23
- >
24
- <div class =" gvaIcon gvaIcon-refresh" :class =" [reload ? 'reloading' : '']" @click =" handleReload" />
25
- </div >
26
- <div
27
- v-if =" btnShow"
28
- class =" user-box"
29
- >
30
- <div class =" gvaIcon gvaIcon-search" @click =" showSearch" />
31
- </div >
32
- <div
33
- v-if =" btnShow"
34
- class =" user-box"
35
- >
36
- <Screenfull class =" search-icon" :style =" {cursor:'pointer'}" />
37
- </div >
38
- <div
39
- v-if =" btnShow"
40
- class =" user-box"
41
- >
42
- <div class =" service gvaIcon-customer-service" @click =" toService" />
43
- </div >
19
+ <template v-else >
20
+ <div
21
+ class =" user-box"
22
+ >
23
+ <div class =" gvaIcon gvaIcon-refresh" :class =" [reload ? 'reloading' : '']" @click =" handleReload" />
24
+ </div >
25
+ <div
26
+ class =" user-box"
27
+ >
28
+ <div class =" gvaIcon gvaIcon-search" @click =" showSearch" />
29
+ </div >
30
+ <div
31
+ class =" user-box"
32
+ >
33
+ <Screenfull class =" search-icon" :style =" {cursor:'pointer'}" />
34
+ </div >
35
+ <div
36
+ class =" user-box"
37
+ >
38
+ <div class =" service gvaIcon-customer-service" @click =" toService" />
39
+ </div >
40
+ </template >
44
41
</div >
45
42
</template >
46
43
@@ -61,22 +58,23 @@ const router = useRouter()
61
58
62
59
const routerStore = useRouterStore ()
63
60
64
- const value = ref (' ' )
65
- const changeRouter = () => {
66
- router .push ({ name: value .value })
67
- value .value = ' '
61
+ const changeRouter = (e ) => {
62
+ if (e .indexOf (' http:' ) > - 1 || e .indexOf (' https:' ) > - 1 ) {
63
+ window .open (e)
64
+ return
65
+ }
66
+ router .push ({ name: e })
68
67
}
69
68
70
- const show = ref (false )
71
- const btnShow = ref ( true )
72
- const hiddenSearch = () => {
73
- show .value = false
74
- btnShow . value = true
69
+ const show = ref (true )
70
+ const hiddenSearch = async () => {
71
+ setTimeout ( () => {
72
+ show .value = false
73
+ }, 100 )
75
74
}
76
75
77
76
const searchInput = ref (null )
78
77
const showSearch = async () => {
79
- btnShow .value = false
80
78
show .value = true
81
79
await nextTick ()
82
80
searchInput .value .focus ()
@@ -100,6 +98,26 @@ const toService = () => {
100
98
font-size : 18px ;
101
99
}
102
100
101
+ .transition-box {
102
+ overflow : hidden ;
103
+ width : 160px ;
104
+ margin-right : 32px ;
105
+ text-align : center ;
106
+ ::v-deep (.el-input__wrapper ){
107
+ .el- input__inner{
108
+ border-bottom : 1px solid var (--el-color-info-light-7 );
109
+ }
110
+ box-shadow: none !important;
111
+ }
112
+ ::v-deep(.el-select .el-input .el-input__wrapper.is-focus ){
113
+ box-shadow : none !important ;
114
+ }
115
+ ::v-deep(.el-select .el-input.is-focus .el-input__wrapper ){
116
+ box-shadow : none !important ;
117
+ }
118
+ }
119
+
120
+
103
121
.reloading {
104
122
animation :turn 0.5s linear infinite ;
105
123
}
0 commit comments