<template>
<el-drawer title="高级搜索" v-model="visible" :size="600" destroy-on-close :close-on-click-modal="false" @closed="$emit('closed')">
	<el-main>
		<el-form ref="dialogForm" :model="form" :rules="rules" label-width="120px">
			<el-form-item label="类型" prop="mobile">
				<el-select v-model="form.type" placeholder="请选择" clearable>
					<el-option :label="item.label" :value="item.value" v-for="(item, index) in typeList"></el-option>
				</el-select>
			</el-form-item>
			<el-form-item label="店铺名称" prop="shop_name">
				<el-input v-model="form.shop_name" placeholder="请输入店铺名称" clearable />
			</el-form-item>
			<el-form-item label="用户名" prop="username">
				<el-input v-model="form.username" placeholder="请输入用户名" clearable />
			</el-form-item>
		</el-form>
	</el-main>
	<template #footer>
		<el-button type="primary" @click="onSubmit">确认提交</el-button>
	</template>
</el-drawer>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	data() {
		return {
			form: {},
			visible: false,
			typeList: [{label: '分享', value: 'share'}, {label: '排队', value: 'queue'},{label: '合伙人', value: 'partner'},{label: '货款', value: 'sale'}],
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		//表单提交方法
		onSubmit(){
			this.visible = false;
			this.$emit('closed')
			this.$emit('success', this.form)
		},
		//表单注入数据
		setData(data){
			this.loading = true
			Object.assign(this.form, data)
		}
	}
}
</script>

<style>
</style>