<template>
|
<header>
|
<div class="headerContent">
|
<div class="find">
|
<div class="search">
|
<span>输入查询:</span>
|
<el-input placeholder="店铺(门店)名称" v-model="search"></el-input>
|
</div>
|
<!-- <div class="status">
|
<span>店铺状态:</span>
|
<el-input placeholder="选择店铺状态" v-model="shopStatus"></el-input>
|
</div> -->
|
<div class="findBtn">
|
<el-button type="primary" @click="setSearch" icon="el-icon-search">查询</el-button>
|
<el-button icon="el-icon-delete-solid" @click="clearSearch">重置</el-button>
|
</div>
|
</div>
|
<div class="add">
|
<el-button class="addBtn" type="primary" @click="dialogCreate = true" icon="el-icon-plus">添加</el-button>
|
</div>
|
|
</div>
|
<div class="footer">
|
<el-dialog :visible.sync="dialogCreate" title="添加店铺" width="45%" v-if="dialogCreate" :before-close="handleClose">
|
<createUser @sendDialog="sendDialog" />
|
</el-dialog>
|
</div>
|
</header>
|
</template>
|
<script>
|
import createUser from "../createUser";
|
export default {
|
components: {
|
createUser,
|
},
|
data() {
|
return {
|
dialogCreate: false,
|
search: '',
|
shopStatus:'',
|
}
|
},
|
methods: {
|
// 返回给父级搜索内容
|
setSearch() {
|
this.$emit('getSearch', { text: this.search })
|
},
|
// 父级关闭dialog
|
sendDialog(flag) {
|
console.log(flag);
|
this.dialogCreate = flag.flag;
|
this.$emit('setDialog', { flag: true })
|
},
|
//关闭dialog
|
handleClose(done){
|
console.log(done);
|
this.$confirm('确定关闭?')
|
.then(_=>{
|
done();
|
})
|
.catch(err=>{
|
})
|
},
|
// 清空search
|
clearSearch(){
|
this.search = '';
|
this.$emit('getSearch',{text:this.search});
|
},
|
},
|
props: ['setDialog', 'getSearch', 'flag'],
|
}
|
</script>
|
<style lang="scss" scoped>
|
header {
|
background-color: #09152f;
|
border: 1pox solid #fff;
|
|
.headerContent {
|
padding: 0 40px;
|
display: flex;
|
line-height: 100px;
|
justify-content: space-between;
|
align-items: center;
|
.find{
|
display: flex;
|
}
|
.search,
|
.status {
|
display: flex;
|
justify-content: flex-start;
|
|
span {
|
flex: 1;
|
}
|
|
.el-input {
|
flex: 2;
|
color: #1d3f57;
|
|
&::v-deep .el-input__inner {
|
background-color: #09152f;
|
border: 1px solid #17324c;
|
}
|
}
|
|
}
|
|
.status {
|
margin-left: 20px;
|
}
|
|
.findBtn {
|
line-height: 100px;
|
margin-left: 15px;
|
display: flex;
|
align-items: center;
|
|
.el-button {
|
padding: 12px 25px;
|
}
|
}
|
|
.addBtn {
|
padding: 12px 30px;
|
margin-left: 20%;
|
}
|
|
|
}
|
}
|
</style>
|