Bladeren bron

人工督查单对接+代码简化

ming 1 jaar geleden
bovenliggende
commit
f1ac9a582a

+ 40 - 67
src/pages/business/zhxf/fireInspect/index.vue

@@ -1,99 +1,76 @@
 <template>
-  <oa-scroll customClass="bg-white scroll-height" :pageSize="pageSize" :total="total" :refresherLoad="true"
-    :refresherLoadTitle="false" :refresherEnabled="true" :refresherDefaultStyle="'none'" :refresherThreshold="44"
-    :refresherBackground="'#f5f6f7'" @load="load" @refresh="refresh"
-    :data-theme="'theme-' + proxy.$settingStore.themeColor.type">
+  <oa-scroll
+    customClass="bg-white scroll-height"
+    :pageSize="pageSize"
+    :total="total"
+    :refresherLoad="true"
+    :refresherLoadTitle="false"
+    :refresherEnabled="true"
+    :refresherDefaultStyle="'none'"
+    :refresherThreshold="44"
+    :refresherBackground="'#f5f6f7'"
+    @load="load"
+    @refresh="refresh"
+    :data-theme="'theme-' + proxy.$settingStore.themeColor.type"
+  >
     <template #default>
       <view class="menu-list m0">
-        <view class="list-cell list-cell-arrow" style=" line-height: 25px" v-for="(base, index) in dataList"
-          :key="index" @click="handleToDetails(base.productCode, base.productName)">
+        <view class="list-cell list-cell-arrow" style="line-height: 25px" v-for="(base, index) in dataList" :key="index" @click="handleToDetails(base.productCode, base.productName)">
           <view class="menu-item">
-            <image class="image-bg" style="width: 80rpx; height: 80rpx; margin: auto 10px auto 0" :src="base.typeImg">
-            </image>
+            <image class="image-bg" style="width: 80rpx; height: 80rpx; margin: auto 10px auto 0" :src="base.typeImg"> </image>
             <view style="width: calc(100% - 51px); display: flex; justify-content: space-between; padding-right: 10px">
               <view class="deviceHeader">
                 <view class="deviceName text-ellipsis">{{ base.productName }}</view>
               </view>
             </view>
-         
           </view>
         </view>
       </view>
     </template>
-
-
   </oa-scroll>
 </template>
 
 <script setup>
 import { onReady, onLoad, onShow, onNavigationBarButtonTap, onPullDownRefresh, onReachBottom } from "@dcloudio/uni-app";
 import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
-import { useStores, commonStores } from "@/store/modules/index";
-
 import { dmpProductInfo, baseAlarmTypeList } from "@/api/business/fireIot/alarmManage.js";
 
 const { proxy } = getCurrentInstance();
 
 const dataList = ref([
   {
-
-    "productName": "人工督察单",
-    "productCode": "501_JK",
-    "deviceType": 501,
-    "total": 819,
-    "untreated": 26,
-    "processed": 793,
-    "processRate": 96.82539,
-    "deviceCount": 661,
-    "offLineUntreated": 0,
-    "offLineProcessed": 0,
-    "offLineProcessRate": 0,
-    "typeImg": "/static/images/fireInspect/rg.png"
-
+    productName: "人工督察单",
+    productCode: "501_JK",
+    deviceType: 501,
+    total: 819,
+    untreated: 26,
+    processed: 793,
+    processRate: 96.82539,
+    deviceCount: 661,
+    offLineUntreated: 0,
+    offLineProcessed: 0,
+    offLineProcessRate: 0,
+    typeImg: "/static/images/fireInspect/rg.png",
   },
   {
-    "productName": "电子督察单",
-    "productCode": "509_HJ",
-    "deviceType": 509,
-    "total": 3,
-    "untreated": 0,
-    "processed": 3,
-    "processRate": 100,
-    "deviceCount": 1,
-    "offLineUntreated": 0,
-    "offLineProcessed": 0,
-    "offLineProcessRate": 0,
-    "typeImg": "/static/images/fireInspect/dz.png"
+    productName: "电子督察单",
+    productCode: "509_HJ",
+    deviceType: 509,
+    total: 3,
+    untreated: 0,
+    processed: 3,
+    processRate: 100,
+    deviceCount: 1,
+    offLineUntreated: 0,
+    offLineProcessed: 0,
+    offLineProcessRate: 0,
+    typeImg: "/static/images/fireInspect/dz.png",
   },
 ]);
 const pageSize = ref(20);
-const current = ref(1);
 const total = ref(2);
 
-/**
- * @页面初始化
- */
-function init() {
-  baseAlarmTypeList({ productName: "", current: current.value, size: pageSize.value }).then((requset) => {
-    if (requset.status === "SUCCESS") {
-      dmpProductInfo({ current: current.value, size: 2000 }).then((requset1) => {
-        if (requset1.status === "SUCCESS") {
-          requset.data.records.forEach((e) => {
-            requset1.data.records.forEach((el) => {
-              if (e.productCode === el.productCode) {
-                e.typeImg = el.typeImg ? el.typeImg : "/static/images/404.png";
-              }
-            });
-          });
 
-          // dataList.value = requset.data.records;
-          total.value = requset.data.total;
-          console.log(dataList.value)
-        }
-      });
-    }
-  });
-}
 
 function handleToDetails(productCode, productName) {
   proxy.$tab.navigateTo(`/pages/business/zhxf/fireInspect/inspectDetailsList/index?productCode=${productCode}&productName=${productName}`);
@@ -104,7 +81,6 @@ function handleToDetails(productCode, productName) {
  */
 function load() {
   pageSize.value += 10;
-  // init();
 }
 
 /**
@@ -112,14 +88,11 @@ function load() {
  */
 function refresh() {
   pageSize.value = 20;
-  // total.value = 0;
-  // init();
 }
 
 onShow(() => {
   //调用系统主题颜色
   proxy.$settingStore.systemThemeColor([1]);
 
-  // init();
 });
 </script>

+ 3 - 12
src/pages/business/zhxf/fireInspect/inspectDetails/index.vue

@@ -78,9 +78,6 @@
 <script setup>
 import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
-import { useStores, commonStores } from "@/store/modules/index";
-
-import { baseAlarmList, baseAlarm } from "@/api/business/fireIot/alarmManage.js";
 import { eleInspectList, dealPutEle, persInspectList, dealPutPer } from "@/api/business/zhxf/fireInspect/index.js";
 
 const { proxy } = getCurrentInstance();
@@ -104,8 +101,6 @@ const productName = ref("");
 const pageSize = ref(20);
 const current = ref(1);
 const total = ref(0);
-
-const handleContent = ref("");
 const handleRange = ref(1);
 const handleRangeList = ref([
   {
@@ -130,32 +125,27 @@ function init() {
  * @api接口查询
  */
 function selectListApi() {
+
   if (productName.value == "电子督察单") {
     eleInspectList({
       id: id.value,
-      startTime: alarmTime.value,
-      endTime: alarmTime.value,
       pageNum: current.value,
       pageSize: pageSize.value,
     }).then((requset) => {
       if (requset.status === "SUCCESS") {
-        console.log(requset.data);
         dataArray.value = requset.data.records[0];
         dataList.value[0].value = requset.data.records[0].superviseCode;
         dataList.value[1].value = requset.data.records[0].content;
         total.value = requset.data.total;
       }
     });
-  }else{
+  } else {
     persInspectList({
       id: id.value,
-      startTime: alarmTime.value,
-      endTime: alarmTime.value,
       pageNum: current.value,
       pageSize: pageSize.value,
     }).then((requset) => {
       if (requset.status === "SUCCESS") {
-        console.log(requset.data);
         dataArray.value = requset.data.records[0];
         dataList.value[0].value = requset.data.records[0].superviseCode;
         dataList.value[1].value = requset.data.records[0].content;
@@ -169,6 +159,7 @@ function selectListApi() {
  * @提交
  */
 function handleSubmit() {
+ 
   if (productName.value == "电子督察单") {
     dealPutEle({
       id: dataArray.value.id,

+ 0 - 4
src/pages/business/zhxf/fireInspect/inspectDetailsList/index.vue

@@ -46,13 +46,9 @@
 <script setup>
 import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
 import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
-import { useStores, commonStores } from "@/store/modules/index";
-
 import { eleInspectList, persInspectList } from "@/api/business/zhxf/fireInspect/index.js";
-import { baseAlarmList } from "@/api/business/fireIot/alarmManage.js";
 
 const { proxy } = getCurrentInstance();
-const commonStore = commonStores();
 
 const tabsList = ref([
   {