wxy 4 лет назад
Родитель
Сommit
a0f3850612

+ 11 - 2
src/views/caseapply/caseapplyIndex.vue

@@ -4,8 +4,15 @@
       <el-col :span="24">
         <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
         <el-col :span="24" class="container">
-          <el-col :span="24" style="margin:15px 0;text-align:right">
-            <el-button type="primary" size="mini" @click="increase()">添加</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>
@@ -59,6 +66,7 @@ export default {
       currentPage: 0,
       pageSize: 10,
       skip: 0,
+      name: '',
     };
   },
   created() {
@@ -68,6 +76,7 @@ export default {
     ...caseapply(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询列表
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.name) info.name = this.name;
       skip = this.skip;
       let res = await this.query({ skip, limit, ...info });
       // console.log(res);

+ 11 - 2
src/views/company/index.vue

@@ -4,8 +4,15 @@
       <el-col :span="24">
         <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
         <el-col :span="24" class="container">
-          <el-col :span="24" style="margin:15px 0;text-align:right">
-            <el-button type="primary" size="mini" @click="increase()">添加</el-button>
+          <el-col :span="24" style="margin:15px 0;">
+            <el-col :span="12">
+              <el-input placeholder="请输入内容" v-model="company" 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>
@@ -63,6 +70,7 @@ export default {
       currentPage: 0,
       pageSize: 10,
       skip: 0,
+      company: '',
     };
   },
   created() {
@@ -72,6 +80,7 @@ export default {
     ...company(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询列表
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.company) info.company = this.company;
       skip = this.skip;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {

+ 11 - 2
src/views/links/linksIndex.vue

@@ -4,8 +4,15 @@
       <el-col :span="24">
         <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
         <el-col :span="24" class="container">
-          <el-col :span="24" style="margin:15px 0;text-align:right;">
-            <el-button type="primary" size="mini" @click="add()">添加</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>
@@ -57,6 +64,7 @@ export default {
       currentPage: 0,
       pageSize: 10,
       skip: 0,
+      name: '',
     };
   },
   created() {
@@ -66,6 +74,7 @@ export default {
     ...links(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询列表
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.name) info.name = this.name;
       skip = this.skip;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {

+ 12 - 2
src/views/lunbo/index.vue

@@ -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)) {

+ 11 - 2
src/views/product/productIndex.vue

@@ -6,8 +6,15 @@
           <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
         </el-col>
         <el-col :span="24" class="container">
-          <el-col :span="24" style="margin:15px 0;text-align:right">
-            <el-button type="primary" size="mini" @click="add()">添加</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>
@@ -62,6 +69,7 @@ export default {
       currentPage: 0,
       pageSize: 10,
       skip: 0,
+      name: '',
     };
   },
   created() {
@@ -71,6 +79,7 @@ export default {
     ...product(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询列表
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.name) info.name = this.name;
       skip = this.skip;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {

+ 11 - 2
src/views/video/videoIndex.vue

@@ -4,8 +4,15 @@
       <el-col :span="24">
         <breadcrumb :breadcrumbTitle="this.$route.meta.title"></breadcrumb>
         <el-col :span="24" class="container">
-          <el-col :span="24" style="margin:15px 0;text-align:right;">
-            <el-button type="primary" size="mini" @click="add()">添加</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>
@@ -56,6 +63,7 @@ export default {
       currentPage: 0,
       pageSize: 10,
       skip: 0,
+      name: '',
     };
   },
   created() {
@@ -65,6 +73,7 @@ export default {
     ...video(['query', 'fetch', 'create', 'update', 'delete']),
     // 查询列表
     async search({ skip = 0, limit = 10, ...info } = {}) {
+      if (this.name) info.name = this.name;
       skip = this.skip;
       let res = await this.query({ skip, limit, ...info });
       if (this.$checkRes(res)) {