|
@@ -6,8 +6,15 @@
|
|
|
<breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
|
|
|
<el-col :span="24" class="container">
|
|
|
<!-- text-align: right 按钮移到右侧 -->
|
|
|
- <el-col :span="24" style="margin:15px 0;text-align:right;">
|
|
|
- <el-button type="primary" size="mini" @click="dialogFormVisible = true">添加</el-button>
|
|
|
+ <el-col :span="24" style="margin:15px 0;">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-input placeholder="请输入内容" v-model="name" class="input-with-select">
|
|
|
+ <el-button slot="append" icon="el-icon-search" @click="search()"></el-button>
|
|
|
+ </el-input>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="text-align:right">
|
|
|
+ <el-button type="primary" size="mini" @click="add()" class="btn">添加</el-button>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-table :data="list" style="width: 100%" border>
|
|
@@ -86,6 +93,7 @@ export default {
|
|
|
pageSize: 10,
|
|
|
// skip是第一页的第一条数据
|
|
|
skip: 0,
|
|
|
+ name: '',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -94,6 +102,8 @@ export default {
|
|
|
methods: {
|
|
|
...lunbo(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ // 如果输入框有name值,把这个值赋值给info中的name属性,后台接收name把这个name和表中lsit数组中的name去对比,如果有相同的name就把把数据返回来
|
|
|
+ if (this.name) info.name = this.name;
|
|
|
skip = this.skip;
|
|
|
let res = await this.query({ skip, limit, ...info });
|
|
|
if (this.$checkRes(res)) {
|