创作者前端-条件查询
原创
©著作权归作者所有:来自51CTO博客作者一个爱听音乐的程序员的原创作品,请联系作者获取转载授权,否则将追究法律责任
添加查询表单
<!-- 表单查询 -->
<el-form :inline="true" :model="authorQuery" class="demo-form-inline">
<!-- 姓名 -->
<el-form-item label="姓名">
<el-input v-model="authorQuery.name" placeholder="姓名"></el-input>
</el-form-item>
<!-- 下拉列表 -->
<el-form-item label="级别">
<el-select v-model="authorQuery.level" clearable placeholder="选择级别">
<el-option label="特约创作者" value="0"></el-option>
<el-option label="普通创作者" value="1"></el-option>
</el-select>
</el-form-item>
<!--日期选择-->
<el-form-item>
<el-date-picker
v-model="authorQuery.begin"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="00:00:00"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-date-picker
v-model="authorQuery.end"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="00:00:00"
placeholder="选择截止时间">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getAuthorList()">查询</el-button>
<el-button type="default" @click="resetData()">清空</el-button>
</el-form-item>
</el-form>
添加清空查询条件数据方法
resetData() {
this.authorQuery = {};
this.getAuthorList();
}