<!--
|
* @Author: shuishen 1109946754@qq.com
|
* @Date: 2024-10-26 16:09:35
|
* @LastEditors: shuishen 1109946754@qq.com
|
* @LastEditTime: 2024-10-28 11:04:58
|
* @FilePath: \bigScreen\src\views\layout\components\mainSearch.vue
|
* @Description:
|
*
|
* Copyright (c) 2024 by shuishen, All Rights Reserved.
|
-->
|
<template>
|
<div class="page-search">
|
<el-input size="medium" placeholder="请输入内容" :suffix-icon="Search" @input="onSearch()" v-model="searchVal"
|
@focus="onFocus"></el-input>
|
<div class="page-search-value-box" v-show="isShowSearchSKValBox">
|
<ul>
|
<li v-for="(item, index) in searchSKValList" :key="index" @click="sKValItemClick(item)">{{ item.name }}
|
</li>
|
</ul>
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
// 搜索栏相关
|
let isShowSearchSKValBox = false
|
let searchVal = ''
|
let searchSKValList = []
|
|
const onSearch = () => {
|
if (searchVal == '') {
|
isShowSearchSKValBox = false
|
} else {
|
isShowSearchSKValBox = true
|
}
|
}
|
|
const onFocus = () => {
|
onSearch()
|
}
|
|
const sKValItemClick = (item) => {
|
isShowSearchSKValBox = false
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.page-search {
|
position: absolute;
|
left: 488px;
|
z-index: 99;
|
top: 110px;
|
pointer-events: auto;
|
|
::v-deep(.el-input) {
|
height: 38px;
|
width: 280px;
|
|
.el-input__wrapper {
|
font-size: 16px;
|
font-weight: 400;
|
border: 1px solid #4081CB;
|
border-radius: 4px;
|
background: rgba(135, 158, 199, 0.3);
|
box-shadow: inset 0px 3px 7px 0px rgba(42, 138, 236, 0.95);
|
|
.el-input__inner {
|
color: #BFD3E5;
|
}
|
}
|
}
|
|
.page-search-value-box {
|
position: absolute;
|
width: 100%;
|
height: 200px;
|
left: 0;
|
top: 40px;
|
background: rgba(135, 158, 199, 0.3);
|
border-radius: 2px;
|
overflow-y: scroll;
|
|
ul>li {
|
color: #ffffff;
|
cursor: pointer;
|
height: 20px;
|
line-height: 20px;
|
padding-left: 10px;
|
}
|
|
ul>li:hover {
|
background-color: #0e1a35;
|
}
|
}
|
|
.page-search-value-box::-webkit-scrollbar {
|
display: none
|
}
|
}
|
</style>
|