wuhongyu há 5 anos atrás
pai
commit
86852dce67

+ 2 - 1
src/components/enterprise/appointment.vue

@@ -12,7 +12,7 @@
             </el-col>
           </el-col>
           <el-col :span="19" class="right">
-            <appointment :total="total" v-on="$listeners" :resultTable="resultTable"></appointment>
+            <appointment :total="total" v-on="$listeners" :resultTable="resultTable" v-if="display === 'list'"></appointment>
           </el-col>
         </div>
         <el-col :span="24" class="foots">
@@ -37,6 +37,7 @@ export default {
     form: null,
     resultTable: null,
     total: null,
+    display: { type: String, default: 'list' },
   },
   components: {
     heads,

+ 5 - 2
src/components/enterprise/look.vue

@@ -12,7 +12,7 @@
             </el-col>
           </el-col>
           <el-col :span="19" class="right">
-            <look v-on="$listeners" :resultTable="resultTable"></look>
+            <look v-on="$listeners" :resultTable="resultTable" :pageSize="pageSize" :total="total" :limit="limit"></look>
           </el-col>
         </div>
         <el-col :span="24" class="foots">
@@ -36,6 +36,9 @@ export default {
     liebiaoList: null, //分类导航
     form: null,
     resultTable: null,
+    limit: null,
+    total: null,
+    pageSize: null,
   },
   components: {
     heads,
@@ -83,7 +86,7 @@ export default {
 }
 .right {
   width: 79%;
-  min-height: 520px;
+  min-height: 1520px;
   overflow: hidden;
   background-color: #fff;
 }

+ 28 - 1
src/layout/enterprise/look.vue

@@ -46,6 +46,18 @@
               </template>
             </el-table-column>
           </el-table>
+          <el-col :span="24" class="page">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              background
+              layout="total,  prev, pager, next, jumper"
+              :total="total"
+              :page-size="pageSize"
+            >
+            </el-pagination>
+          </el-col>
         </el-col>
       </el-col>
     </el-col>
@@ -54,17 +66,23 @@
 
 <script>
 import _ from 'lodash';
+
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: news } = createNamespacedHelpers('news');
+
 export default {
   name: 'technical',
   props: {
     resultTable: null,
+    limit: null,
+    total: null,
+    pageSize: null,
   },
   components: {},
   data: () => ({
     downLeftTopImage: require('@/assets/live/square_big.png'),
     jishuImage: require('@/assets/live/main3.png'),
+    currentPage: 1,
   }),
   created() {
     this.searchInfo();
@@ -94,6 +112,12 @@ export default {
     deleteRow(id) {
       this.$emit('deleteRow', id);
     },
+
+    handleSizeChange() {},
+    handleCurrentChange(currentPage) {
+      console.log(currentPage);
+      this.$emit('handleCurrentChange', { currentPage });
+    },
   },
 };
 </script>
@@ -103,6 +127,9 @@ export default {
   width: 100%;
   height: 100%;
 }
+.page {
+  margin: 20px 0 0 0;
+}
 .main {
   width: 100%;
   margin: 0 auto;
@@ -110,7 +137,7 @@ export default {
 }
 .left {
   float: left;
-  height: 500px;
+  height: 800px;
   overflow: hidden;
   margin: 0 auto;
   padding: 20px 20px 20px 20px;

+ 25 - 5
src/views/enterprise/look.vue

@@ -7,6 +7,10 @@
       @shibai="shibai"
       :resultTable="resultTable"
       @onsave="onsaveClick"
+      :limit="limit"
+      :total="total"
+      @handleCurrentChange="handleCurrentChange"
+      :pageSize="pageSize"
     ></look-detail>
   </div>
 </template>
@@ -23,6 +27,9 @@ export default {
     lookDetail,
   },
   data: () => ({
+    total: 0,
+    limit: 4,
+    pageSize: 4,
     info: {},
     liebiaoList: [
       { name: '基本信息' },
@@ -50,15 +57,28 @@ export default {
     ...apply(['query', 'delete', 'update']),
     ...login({ logout: 'logout', transactiondtetle: 'delete' }),
     //查询
-    async search() {
+    async search({ skip = 0, limit = 4, currentPage } = { skip: 0, limit: 10 }) {
       console.log(this.data);
-      // let id = this.data;
+      console.log(this.data.apply.length);
+      this.$set(this, `total`, this.data.apply.length);
 
-      // console.log(res.data);
-
-      this.$set(this, `resultTable`, this.data.apply);
       console.log();
+      const newProducts = [];
+      for (let index = skip; index < skip + limit; index++) {
+        if (this.data.apply[index]) {
+          newProducts.push(this.data.apply[index]);
+        }
+      }
+      console.log(newProducts);
+
+      this.$set(this, `resultTable`, newProducts);
     },
+
+    handleCurrentChange({ currentPage }) {
+      this.search({ skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
+      console.log(currentPage);
+    },
+
     async onsaveClick({ id }) {
       console.log(id);
       if (id === '基本信息') {