Bladeren bron

电子督察单列表页优化+详情页对接

ming 1 jaar geleden
bovenliggende
commit
cf9c4292ed

+ 12 - 1
src/api/business/zhxf/fireInspect/index.js

@@ -1,7 +1,7 @@
 import { request } from "@/utils/request";
 
 /**
- * @
+ * @查询
  */
 export function eleInspectList(param) {
   return request({
@@ -11,3 +11,14 @@ export function eleInspectList(param) {
   });
 }
 
+/**
+ * @未处理-提交
+ */
+export function dealPut(param) {
+  return request({
+      url: "/service-fire/dataJinganAnalysis",
+      method: "PUT",
+      data: param,
+  });
+}
+

+ 51 - 23
src/pages/business/zhxf/fireInspect/inspectDetails/index.vue

@@ -5,7 +5,7 @@
         <image style="width: 40px; height: 40px; margin: auto 15px auto 0" :src="dataArray.typeImg ? dataArray.typeImg : '/static/images/404.png'" mode="aspectFill"></image>
 
         <view style="margin: auto auto auto 0">
-          <view style="font-size: 15px"> {{ dataArray.deviceName }} </view>
+          <view style="font-size: 15px">  {{ dataArray.timestamp ? dataArray.timestamp.replace("T", " ") : "" }} </view>
         </view>
 
         <view style="margin: auto 0 auto 0">
@@ -47,7 +47,7 @@
             ></u-radio>
           </u-radio-group>
 
-          <u--textarea v-model="handleContent" placeholder="备注信息,最多可输入50个字" :count="true" maxlength="50" style="margin: 0 0 15px 0" :disabled="dataArray.handleStatus == 1"></u--textarea>
+          <u--textarea v-model="dataArray.handleContent" placeholder="备注信息,最多可输入50个字" :count="true" maxlength="50" style="margin: 0 0 15px 0" :disabled="dataArray.handleStatus == 1"></u--textarea>
         </view>
 
         <view class="flex" v-if="dataArray.handleStatus != 1">
@@ -85,35 +85,27 @@ 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,dealPut } from "@/api/business/zhxf/fireInspect/index.js";
+
 
 const { proxy } = getCurrentInstance();
 
 const dataArray = ref({});
 const dataList = ref([
   {
-    title: "设备名称",
-    value: "",
-  },
-  {
-    title: "设备地址",
-    value: "",
-  },
-  {
-    title: "告警等级",
-    value: "",
-  },
-  {
-    title: "告警信息",
+    title: "督察单编号",
     value: "",
   },
   {
-    title: "告警时间",
+    title: "督察单内容",
     value: "",
   },
 ]);
 
 const deviceName = ref("");
 const alarmTime = ref("");
+const id = ref("");
+const productName=ref('');
 const pageSize = ref(20);
 const current = ref(1);
 const total = ref(0);
@@ -143,7 +135,29 @@ function init() {
  * @api接口查询
  */
 function selectListApi() {
-  baseAlarmList({
+  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;
+          // dataList.value[2].value = requset.data.records[0].alarmGrade + "级";
+          // dataList.value[3].value = requset.data.records[0].alarmContent;
+          // dataList.value[4].value = requset.data.records[0].alarmTime;
+          total.value = requset.data.total;
+        }
+      });
+
+  }else{
+
+    baseAlarmList({
     deviceName: deviceName.value,
     startTime: alarmTime.value,
     endTime: alarmTime.value,
@@ -160,19 +174,27 @@ function selectListApi() {
       total.value = requset.data.total;
     }
   });
+
+  }
+  
+
+
+ 
+
+
 }
 
 /**
  * @提交
  */
 function handleSubmit(alarmFalse) {
-  baseAlarm({
+  dealPut({
     id: dataArray.value.id,
-    deviceId: dataArray.value.deviceId,
-    alarmType: dataArray.value.alarmType,
-    handleContent: handleContent.value,
-    alarmFalse: alarmFalse,
-    handleRange: handleRange.value,
+    // deviceId: dataArray.value.deviceId,
+    // alarmType: dataArray.value.alarmType,
+    handleContent: dataArray.value.handleContent,
+    // alarmFalse: alarmFalse,
+    // handleRange: handleRange.value,
   }).then((requset) => {
     if (requset.status === "SUCCESS") {
       proxy.$tab.navigateTo(`/pages/common/success/index?codeName=提交成功`);
@@ -195,6 +217,12 @@ onLoad((options) => {
   if ("alarmTime" in options) {
     alarmTime.value = options.alarmTime;
   }
+  if ("id" in options) {
+    id.value = options.id;
+  }
+  if ("productName" in options) {
+    productName.value = options.productName;
+  }
 
   init();
 });

+ 11 - 3
src/pages/business/zhxf/fireInspect/inspectDetailsList/index.vue

@@ -49,7 +49,7 @@
               <view class="deviceHeader" v-else>
                 <view class="deviceName text-ellipsis">{{ base.superviseCode }}</view>
                 <view class="deviceName text-ellipsis"> {{ base.content }}</view>
-                <view class="deviceName text-ellipsis">{{ base.timestamp }}</view>
+                <view class="deviceName text-ellipsis">{{ base.timestamp?base.timestamp.replace("T", " "):'' }}</view>
               </view>
 
 
@@ -117,7 +117,6 @@ function init() {
  * @api接口查询
  */
 function selectListApi() {
-  // alert(productName.value)
   if(productName.value=='电子督察单'){
       eleInspectList({
         // productCode: productCode.value,
@@ -164,7 +163,15 @@ function selectListApi() {
  * @跳转详情事件
  */
 function handleToDetails(e) {
-  proxy.$tab.navigateTo(`/pages/business/zhxf/fireInspect/inspectDetails/index?deviceName=${e.deviceName}&alarmTime=${e.alarmTime}`);
+  console.log(e)
+  if(productName.value=='电子督察单'){
+    proxy.$tab.navigateTo(`/pages/business/zhxf/fireInspect/inspectDetails/index?id=${e.id}&productName=${productName.value}`);
+
+  }else{
+  // proxy.$tab.navigateTo(`/pages/business/zhxf/fireInspect/inspectDetails/index?deviceName=${e.deviceName}&alarmTime=${e.alarmTime}&productName=${productName.value}`);
+
+  }
+
 }
 
 /**
@@ -195,6 +202,7 @@ function tabsClick(e) {
 onReady(() => { });
 
 onShow(() => {
+  init();
   //调用系统主题颜色
   proxy.$settingStore.systemThemeColor([1]);
 });