Guoxiaohuan vor 5 Jahren
Ursprung
Commit
31b8ac9a95
3 geänderte Dateien mit 50 neuen und 9 gelöschten Zeilen
  1. 1 0
      package.json
  2. 48 8
      src/views/appeal/index.vue
  3. 1 1
      src/views/evaluate/index.vue

+ 1 - 0
package.json

@@ -49,6 +49,7 @@
     "style-loader": "^1.1.3",
     "uglifyjs-webpack-plugin": "^1.1.1",
     "url-loader": "^0.5.8",
+    "vue-infinite-scroll": "^2.0.2",
     "vue-loader": "^13.3.0",
     "vue-style-loader": "^3.0.1",
     "vue-template-compiler": "^2.5.2",

+ 48 - 8
src/views/appeal/index.vue

@@ -66,7 +66,7 @@
             </div>
           </div>
         </div>
-        <div class="appealBoxRight">
+        <div class="appealBoxRight" ref="appealBoxRight">
           <div class="title Micbold">审核完成/超时未申诉</div>
           <div class="right">
             <div class="card" v-for="(item,index) in auditCompletedArr" :key="index">
@@ -88,6 +88,18 @@
                 <span>{{item.title||'--'}}</span>
               </div>
             </div>
+            <div v-infinite-scroll="loadMore" infinite-scroll-disabled="busy">
+              <div
+                class="loadingIcon"
+                style="width: 50px;
+            text-align: center;
+            margin: 0 auto;
+            margin-top: 20px;
+            margin-bottom: 30px;"
+              >
+                <i class="el-icon-loading"></i>
+              </div>
+            </div>
           </div>
         </div>
       </div>
@@ -126,7 +138,10 @@ export default {
       auditCompletedArr: [], //审核完成,超时未申诉
       appealsDate: "",
       viewSnapshots: false,
-      newArr: []
+      newArr: [],
+      busy: true,
+      page: 1,
+      pageSize: 15
     };
   },
   components: {
@@ -185,7 +200,7 @@ export default {
     },
     init() {
       this.appealsIng();
-      this.auditCompletedIng();
+      this.auditCompletedIng(true);
       this.InAuditIng();
     },
     // 可申诉的未执行策略
@@ -240,7 +255,7 @@ export default {
       });
     },
     // 审核完成、超时未申诉
-    auditCompletedIng() {
+    auditCompletedIng(flag) {
       let params = {
         postParams: {
           criteria: {
@@ -251,16 +266,34 @@ export default {
               $gte: "20200216000000" //三天以内
             }
           },
-          size:10,
-          page:1,
+          size: this.pageSize,
+          page: this.page,
           withColumns: ["customAttribute"]
         }
       };
       queryWorkflow(params).then(res => {
-        this.auditCompletedArr = res.content ? res.content : [];
+        // this.auditCompletedArr = res.content ? res.content : [];
+        if (flag) {
+          // 多次加载数据
+          this.auditCompletedArr = this.auditCompletedArr.concat(res.content);
+          if (res.content.length == 0) {
+            this.busy = true;
+          } else {
+            this.busy = false;
+          }
+        } else {
+          this.auditCompletedArr = res.content;
+          this.busy = false;
+        }
       });
     },
-
+    loadMore: function() {
+      this.busy = true;
+      setTimeout(() => {
+        this.page++;
+        this.auditCompletedIng(true);
+      }, 1000);
+    },
     // 审核中
     InAuditIng() {
       let params = {
@@ -556,6 +589,13 @@ export default {
           .card:hover .backout {
             display: block;
           }
+          .loadingIcon {
+            width: 50px;
+            text-align: center;
+            margin: 0 auto;
+            margin-top: 20px;
+            margin-bottom: 30px;
+          }
         }
       }
       .appealBoxRight {

+ 1 - 1
src/views/evaluate/index.vue

@@ -226,7 +226,7 @@ export default {
   display: flex;
   align-items: center;
   .count-top-right {
-    width: 254px;
+    width: 264px;
     height: 32px;
     background: rgba(255, 255, 255, 1);
     border-radius: 4px;