Sfoglia il codice sorgente

事故事件详情

yanghao 2 mesi fa
parent
commit
6fd492694b
8 ha cambiato i file con 327 aggiunte e 42 eliminazioni
  1. 11 0
      api/qhse.js
  2. 2 1
      locale/en.json
  3. 2 1
      locale/ja.json
  4. 2 1
      locale/ru.json
  5. 10 9
      locale/zh-Hans.json
  6. 3 1
      locale/zh-Hant.json
  7. 36 29
      pages.json
  8. 261 0
      pages/qhse/detail.vue

+ 11 - 0
api/qhse.js

@@ -0,0 +1,11 @@
+import { request } from "@/utils/request";
+
+/**
+ * 获取设备实时数据列表
+ * @param params
+ */
+export const getDetail = (id) =>
+  request({
+    url: `/rq/iot-accident-report/get?id=` + id,
+    method: 'GET',
+  })

+ 2 - 1
locale/en.json

@@ -481,5 +481,6 @@
 	"overtime.type1": "Operation record",
 	"overtime.type2": "Maintenance work order",
 	"overtime.type3": "Upkeep work order",
-	"overtime.type4": "Inspection work order"
+	"overtime.type4": "Inspection work order",
+	"qhse.detail.title": "Incident Event Details"
 }

+ 2 - 1
locale/ja.json

@@ -481,5 +481,6 @@
 	"overtime.type1": "運行記録",
 	"overtime.type2": "修理作業指示書",
 	"overtime.type3": "保養作業指示書",
-	"overtime.type4": "検査作業指示書"
+	"overtime.type4": "検査作業指示書",
+	"qhse.detail.title": "事故イベント詳細"
 }

+ 2 - 1
locale/ru.json

@@ -481,5 +481,6 @@
 	"overtime.type1": "Операционная запись",
 	"overtime.type2": "Ремонтный рабочий заказ",
 	"overtime.type3": "Рабочий заказ на обслуживание",
-	"overtime.type4": "Рабочий заказ на инспекцию"
+	"overtime.type4": "Рабочий заказ на инспекцию",
+	"qhse.detail.title": "Детали QHSE"
 }

+ 10 - 9
locale/zh-Hans.json

@@ -406,14 +406,14 @@
   "inspection.pendingInspectionItems": "待填写巡检项",
   "inspection.normalInspectionItems": "正常巡检项",
   "inspection.abnormalInspectionItems": "异常巡检项",
-  // --------------------------------------- 瑞都日报 ----------------------------------------
-  "ruiDu.indexTitle": "日报",
-  "ruihen.taskTitle": "分配任务",
-  "ruihen.taskCreateTitle": "新增任务",
-  "ruihen.taskDetailTitle": "任务详情",
-  "ruihen.taskEditTitle": "编辑任务",
-  "ruiDu.detailTitle": "日报详情",
-  "ruiDu.editTitle": "日报填报",
+  // --------------------------------------- 瑞都日报 ----------------------------------------
+  "ruiDu.indexTitle": "日报",
+  "ruihen.taskTitle": "分配任务",
+  "ruihen.taskCreateTitle": "新增任务",
+  "ruihen.taskDetailTitle": "任务详情",
+  "ruihen.taskEditTitle": "编辑任务",
+  "ruiDu.detailTitle": "日报详情",
+  "ruiDu.editTitle": "日报填报",
   "ruiDu.approvalTitle": "日报填报",
   "ruiDu.createTitle": "新增日报",
   "ruiDu.shiftLeader": "带班干部",
@@ -706,5 +706,6 @@
   "overtime.type1": "运行记录",
   "overtime.type2": "维修工单",
   "overtime.type3": "保养工单",
-  "overtime.type4": "巡检工单"
+  "overtime.type4": "巡检工单",
+  "qhse.detail.title": "事故事件详情"
 }

+ 3 - 1
locale/zh-Hant.json

@@ -475,5 +475,7 @@
   "statistic.maintenance.orderType.title": "工单类型统计",
   "statistic.maintenance.orderType.status1": "临时新建",
   "statistic.maintenance.orderType.status2": "计划生成",
-  "statistic.inspection.workOrder.title": "巡检工单状态统计"
+  "statistic.inspection.workOrder.title": "巡检工单状态统计",
+
+  "qhse.detail.title": "事故事件详情"
 }

+ 36 - 29
pages.json

@@ -170,35 +170,35 @@
         "navigationStyle": "custom"
       }
     },
-    {
-      "path": "pages/ruihen-task/index",
-      "style": {
-        "navigationBarTitleText": "%ruihen.taskTitle%"
-      }
-    },
-    {
-      "path": "pages/ruihen-task/create",
-      "style": {
-        "navigationBarTitleText": "%ruihen.taskCreateTitle%"
-      }
-    },
-    {
-      "path": "pages/ruihen-task/detail",
-      "style": {
-        "navigationBarTitleText": "%ruihen.taskDetailTitle%"
-      }
-    },
-    {
-      "path": "pages/ruihen-task/edit",
-      "style": {
-        "navigationBarTitleText": "%ruihen.taskEditTitle%"
-      }
-    },
-    {
-      "path": "pages/ruihen/index",
-      "style": {
-        "navigationBarTitleText": "%ruiDu.indexTitle%"
-      }
+    {
+      "path": "pages/ruihen-task/index",
+      "style": {
+        "navigationBarTitleText": "%ruihen.taskTitle%"
+      }
+    },
+    {
+      "path": "pages/ruihen-task/create",
+      "style": {
+        "navigationBarTitleText": "%ruihen.taskCreateTitle%"
+      }
+    },
+    {
+      "path": "pages/ruihen-task/detail",
+      "style": {
+        "navigationBarTitleText": "%ruihen.taskDetailTitle%"
+      }
+    },
+    {
+      "path": "pages/ruihen-task/edit",
+      "style": {
+        "navigationBarTitleText": "%ruihen.taskEditTitle%"
+      }
+    },
+    {
+      "path": "pages/ruihen/index",
+      "style": {
+        "navigationBarTitleText": "%ruiDu.indexTitle%"
+      }
     },
     {
       "path": "pages/ruihen/detail",
@@ -450,6 +450,13 @@
       "style": {
         "navigationBarTitleText": "%overtime.title%"
       }
+    },
+    {
+      // qhse详情
+      "path": "pages/qhse/detail",
+      "style": {
+        "navigationBarTitleText": "%qhse.detail.title%"
+      }
     }
   ],
 

+ 261 - 0
pages/qhse/detail.vue

@@ -0,0 +1,261 @@
+<template>
+  <view class="page">
+    <view class="content">
+      <!-- 遍历表单数据生成卡片列表 -->
+      <view class="card-list">
+        <!-- 事件时间 -->
+        <view class="card-item">
+          <view class="card-label">事件时间</view>
+          <view class="card-value">
+            <uni-datepicker
+              type="datetime"
+              placeholder="请选择事件时间"
+              :disabled="true"
+              v-model="form.actualTime"
+            />
+          </view>
+        </view>
+
+        <!-- 事件级别 -->
+        <view class="card-item">
+          <view class="card-label">事件级别</view>
+          <view class="card-value text-value">{{
+            form.accidentGrade || "-"
+          }}</view>
+        </view>
+
+        <!-- 事件类型 -->
+        <view class="card-item">
+          <view class="card-label">事件类型</view>
+          <view class="card-value">
+            <uni-easyinput
+              v-model="form.accidentType"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 事件地址 -->
+        <view class="card-item">
+          <view class="card-label">事件地址</view>
+          <view class="card-value">
+            <uni-easyinput
+              v-model="form.accidentAddress"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 现场负责人 -->
+        <view class="card-item">
+          <view class="card-label">现场负责人</view>
+          <view class="card-value">
+            <uni-easyinput
+              v-model.number="form.dutyPerson"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 事件损失情况 -->
+        <view class="card-item">
+          <view class="card-label">事件损失情况</view>
+          <view class="card-value">
+            <uni-easyinput
+              v-model="form.lossSituation"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 现场采取措施 -->
+        <view class="card-item">
+          <view class="card-label">现场采取措施</view>
+          <view class="card-value">
+            <uni-easyinput
+              type="textarea"
+              autoHeight
+              v-model="form.emergencyMeasure"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 事件简要经过 -->
+        <view class="card-item">
+          <view class="card-label">事件简要经过</view>
+          <view class="card-value">
+            <uni-easyinput
+              type="textarea"
+              autoHeight
+              v-model="form.description"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+
+        <!-- 附件/现场图片 -->
+        <view class="card-item">
+          <view class="card-label">附件/现场图片</view>
+          <view class="card-value image-container">
+            <view class="image-list">
+              <view class="image-item" v-if="form.pic">
+                <image
+                  :src="form.pic"
+                  mode="widthFix"
+                  @click="previewImage(form.pic)"
+                />
+              </view>
+              <text v-else class="no-data">暂无图片</text>
+            </view>
+          </view>
+        </view>
+
+        <!-- 备注 -->
+        <view class="card-item">
+          <view class="card-label">备注</view>
+          <view class="card-value">
+            <uni-easyinput
+              type="textarea"
+              autoHeight
+              v-model="form.remark"
+              :disabled="true"
+              border="none"
+            />
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script setup>
+import { ref, onMounted, computed } from "vue";
+import { onLoad } from "@dcloudio/uni-app";
+import { getDetail } from "@/api/qhse";
+
+// 当前查看的任务 id
+const id = ref(null);
+let form = ref({}); // 初始化为空对象,避免渲染报错
+
+// 从路由参数读取详情 id
+onLoad(async (options) => {
+  id.value = Number(options.id) || null;
+
+  if (id.value) {
+    try {
+      let data = await getDetail(id.value);
+      form.value = data.data || {};
+      console.log("data>>>>>>>>>>>>", form.value);
+    } catch (error) {
+      console.error("获取详情失败", error);
+    }
+  }
+});
+
+// 预览图片方法
+const previewImage = (url) => {
+  if (!url) return;
+  uni.previewImage({
+    urls: [url],
+    current: url,
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+.page {
+  min-height: 100vh;
+  background-color: #f5f7fa; // 浅灰色背景,突出卡片
+  padding: 20rpx;
+  box-sizing: border-box;
+}
+
+.content {
+  width: 100%;
+}
+
+.card-list {
+  display: flex;
+  flex-direction: column;
+  gap: 20rpx; // 卡片之间的间距
+}
+
+.card-item {
+  background-color: #ffffff;
+  border-radius: 16rpx;
+  padding: 30rpx;
+  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); // 轻微阴影
+  display: flex;
+  flex-direction: column;
+
+  .card-label {
+    font-size: 28rpx;
+    color: #909399; // 标签颜色稍浅
+    margin-bottom: 16rpx;
+    font-weight: 500;
+  }
+
+  .card-value {
+    font-size: 30rpx;
+    color: #303133; // 内容颜色深
+    width: 100%;
+
+    // 覆盖 uni-easyinput 的默认样式,使其融入卡片
+    ::v-deep .uni-easyinput__content {
+      background-color: transparent !important;
+      border: none !important;
+      padding: 0 !important;
+      min-height: auto !important;
+    }
+
+    ::v-deep .uni-easyinput__content-input {
+      font-size: 30rpx;
+      color: #303133;
+      padding: 0 !important;
+    }
+
+    ::v-deep .uni-textarea {
+      background-color: transparent !important;
+      border: none !important;
+      padding: 0 !important;
+    }
+  }
+
+  .text-value {
+    line-height: 1.5;
+  }
+
+  .image-container {
+    .image-list {
+      display: flex;
+      flex-wrap: wrap;
+      gap: 20rpx;
+    }
+
+    .image-item {
+      width: 200rpx;
+      height: 200rpx;
+      border-radius: 8rpx;
+      overflow: hidden;
+      border: 1rpx solid #ebeef5;
+
+      image {
+        width: 100%;
+        height: 100%;
+      }
+    }
+
+    .no-data {
+      font-size: 28rpx;
+      color: #c0c4cc;
+    }
+  }
+}
+</style>