<template>
<!-- 组件功能：普通搜索（列表中的快速搜索） -->
<div class="normalSearchComponentsContain">
    <div class="leftInputBox">
        <i class="el-icon-search searchIcon"></i>
        <el-input
            v-model="searchValue"
            :placeholder="searchNormalOption && searchNormalOption.placeholder ? searchNormalOption.placeholder : '这里是快速搜索'"
            clearable
            @keyup.enter.native="searchNormalClick"
            @clear="searchNormalClear"
        ></el-input>
    </div>
    <el-button
        class="searchButton"
        size="mini"
        @click="searchNormalClick"
    >搜索</el-button>
</div>
</template>
<script>
export default {
    props: {
        // 格式：{
    //     prop:'asnNumber',//查询的接口过滤数据
    //     placeholder:'请输入发货单号',//placeholder
    //   },
        searchNormalOption: {
            type: Object,
            default: null
        },
    },
    data () {
        return {
            searchValue:null,//搜索内容数据
        }
    },
    methods:{
        // 搜索
        searchNormalClick(){
            this.$emit('searchNormalClick', this.searchValue, this.searchNormalOption)
        },
        // 清除搜索
        searchNormalClear(noflesh){
            this.searchValue = ""
            if(!noflesh){
                this.$emit('searchNormalClear',this.searchValue, this.searchNormalOption)
            }
        },
        // 设置值
        setSearchNormalValue(val,noflesh){
            this.searchValue = val
            if(!noflesh){
                this.searchNormalClick()
            }
        },
        // 获取值
        getSearchNormalValue(){
            return this.searchValue
        },
    }
}
</script>
<style lang="scss">
@import "./style/index.scss";
</style>