fanghuisheng 2 лет назад
Родитель
Сommit
e2be1b6637
2 измененных файлов с 52 добавлено и 13 удалено
  1. 13 0
      src/api/business/mhxf/fireReport/index.js
  2. 39 13
      src/pages/business/mhxf/fireReport/index.vue

+ 13 - 0
src/api/business/mhxf/fireReport/index.js

@@ -0,0 +1,13 @@
+import upload from "@/utils/upload";
+import request from "@/utils/request";
+
+/**
+ * @历史报告列表查询接口
+ */
+export function reportInfoList( param) {
+  return request({
+    url: "/service-fire/demReportInfo/reportInfoList",
+    method: "GET",
+    data: param,
+  });
+}

+ 39 - 13
src/pages/business/mhxf/fireReport/index.vue

@@ -7,7 +7,7 @@
           <u-image src="@/static/images/fireReport/icon1.png" width="13px" height="13px"></u-image>
         </view>
         <view style="margin: 0 auto 0 0" @click="handleSelect()">
-          <view>{{ li.title }}</view>
+          <view>{{ li.reportName }}</view>
         </view>
         <view>
           <view style="color: #3c9cff; cursor: pointer" @click="handleDownload">下载报告</view>
@@ -23,7 +23,7 @@ import { onReady, onLoad, onShow, onReachBottom, onNavigationBarButtonTap } from
 import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance } from "vue";
 import publicStore from "@/store/modules/public";
 
-import {} from "@/api/business/mhxf/informationSelect";
+import { reportInfoList } from "@/api/business/mhxf/fireReport";
 
 const { proxy } = getCurrentInstance();
 
@@ -97,8 +97,9 @@ const dataList = ref([
   },
 ]);
 const status = ref("loadmore");
-const list = ref(15);
-const page = ref(0);
+const pageSize = ref(20);
+const pageNum = ref(1);
+const total = ref(0);
 
 /**
  * @列表点击事件
@@ -111,6 +112,27 @@ function handleSelect() {
   // });
 }
 
+/**
+ * @历史报告列表查询接口
+ * @API接口查询
+ */
+function reportInfoListApi() {
+  reportInfoList({
+    pageSize: pageSize.value,
+    pageNum: pageNum.value,
+    companyId: "",
+    sourceType: 2,
+  }).then((res) => {
+    console.log(res);
+    dataList.value = res.data.records;
+    total.value = res.data.total;
+  });
+}
+
+/**
+ * @下载
+ * @按钮点击事件
+ */
 function handleDownload() {
   proxy.$modal.loading("报告下载中,请耐心等待...");
 
@@ -122,14 +144,16 @@ function handleDownload() {
 watchEffect(() => {});
 
 onReachBottom(() => {
-  if (page.value >= 3) return;
-  status.value = "loading";
-  page.value = ++page.value;
-  setTimeout(() => {
-    list.value += 10;
-    if (page.value >= 3) status.value = "nomore";
-    else status.value = "loading";
-  }, 2000);
+  if (total.value == dataList.value.length) {
+    status.value = "nomore";
+    return;
+  } else {
+    status.value = "loading";
+    pageSize.value += 10;
+    setTimeout(() => {
+      reportInfoListApi();
+    }, 1000);
+  }
 });
 
 // 自定义导航事件
@@ -142,7 +166,9 @@ onNavigationBarButtonTap((e) => {
   }
 });
 
-onLoad((options) => {});
+onLoad((options) => {
+  reportInfoListApi();
+});
 
 onReady(() => {});