From 6f1e2acc812b2f40359aabdb5d04648acfcdcef5 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期四, 24 四月 2025 08:40:11 +0800
Subject: [PATCH] 修改

---
 .env.development                      |    2 
 src/views/firework/alarm/index.vue    |   64 ++++++++++++++++++++++++++++----
 src/views/firework/humiture/index.vue |   37 +++++++++++++++++-
 .env.production                       |    2 
 4 files changed, 92 insertions(+), 13 deletions(-)

diff --git a/.env.development b/.env.development
index 737903e..28ac41e 100644
--- a/.env.development
+++ b/.env.development
@@ -10,4 +10,4 @@
 VITE_APP_BASE_API = 'http://192.168.2.58:8100'
 
 #线上
-#VITE_APP_BASE_API = 'http://47.108.222.15:8185/signature'
+#VITE_APP_BASE_API = 'http://39.104.85.193:4105'
diff --git a/.env.production b/.env.production
index a6b82e2..44535b2 100644
--- a/.env.production
+++ b/.env.production
@@ -5,7 +5,7 @@
 VITE_APP_ENV = 'production'
 
 # 烟花爆竹批发企业仓库安全监测预警/生产环境
-VITE_APP_BASE_API = 'http://47.108.222.15:8185/signature'
+VITE_APP_BASE_API = 'http://39.104.85.193:4105'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
 VITE_BUILD_COMPRESS = gzip
diff --git a/src/views/firework/alarm/index.vue b/src/views/firework/alarm/index.vue
index 3e6b437..980f82b 100644
--- a/src/views/firework/alarm/index.vue
+++ b/src/views/firework/alarm/index.vue
@@ -13,8 +13,24 @@
               style="width: 300px"
           ></el-date-picker>
         </el-form-item>
+        <el-form-item label="报警类型:" >
+          <el-select
+              clearable
+              v-model="data.queryParams.filter.alarmType"
+              placeholder="请选择"
+              style="width: 100%"
+          >
+            <el-option
+                v-for="item in data.typeList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="状态:" >
           <el-select
+              clearable
               v-model="data.queryParams.filter.alarmStatus"
               placeholder="请选择"
               style="width: 100%"
@@ -56,7 +72,7 @@
           <span>{{scope.row.alarmStatus == 1 ? '已消警' : '未消警'}}</span>
         </template>
       </el-table-column>
-      <el-table-column label="报警图片" prop="alarmFile" align="center" >
+      <el-table-column label="报警图片" prop="alarmFile" align="center" width="120" >
         <template #default="scope">
           <div class="demo-image__preview" v-if="scope.row.alarmFile">
             <el-image
@@ -116,6 +132,7 @@
       alarmEndTime: '',
       alarmStatus: null,
       companyCode: '',
+      alarmType: null
     }
   },
   total: 0,
@@ -130,7 +147,37 @@
       name: '未消警'
     },
   ],
-  dateRange:[]
+  dateRange:[],
+  typeList: [
+    {
+      id: 1,
+      name: '超员作业'
+    },
+    {
+      id: 2,
+      name: '堵塞通道'
+    },
+    {
+      id: 3,
+      name: '超高超量'
+    },
+    {
+      id: 4,
+      name: '非法入侵'
+    },
+    {
+      id: 5,
+      name: '摄像头遮挡偏移'
+    },
+    {
+      id: 6,
+      name: '温度'
+    },
+    {
+      id: 7,
+      name: '湿度'
+    },
+  ]
 });
 
 const { queryParams, total, dataList } = toRefs(data);
@@ -156,12 +203,12 @@
   const res = await getAlarm(data.queryParams)
   if(res.code == 200){
     data.dataList = res.result.records
-    //     .map(item => {
-    //   return {
-    //     ...item,
-    //     alarmFile: ''
-    //   }
-    // })
+        .map(item => {
+      return {
+        ...item,
+        alarmFile:item.alarmFile ? import.meta.env.VITE_APP_BASE_API+ '/upload/'+  item.alarmFile: ''
+      }
+    })
     data.total = res.result.total
   }else{
     ElMessage.warning(res.message)
@@ -181,6 +228,7 @@
       alarmEndTime: '',
       alarmStatus: null,
       companyCode: '',
+      alarmType: null
     }
   }
   data.dateRange = []
diff --git a/src/views/firework/humiture/index.vue b/src/views/firework/humiture/index.vue
index 42ee258..c7b2088 100644
--- a/src/views/firework/humiture/index.vue
+++ b/src/views/firework/humiture/index.vue
@@ -20,10 +20,13 @@
 <!--      <span style="font-size: 18px;font-weight: 600;margin-left: 15px;margin-top: 10px"> 设备信息</span>-->
       <el-scrollbar max-height="420px" style="padding-right: 10px;overflow-x: hidden;" v-if="state.dataList && state.dataList.length >0">
         <div class="grid-container">
-          <div v-for="(item,index) in state.dataList" :key="index" style="width: 365px;margin: 20px 30px">
+          <div v-for="(item,index) in state.dataList" :key="index" style="width: 370px;margin: 20px 30px">
             <el-card class="card-item " shadow="always">
               <div style="display: flex;flex-direction: column">
-                <div style="font-size: 18px;font-weight: 700;margin-bottom: 25px">{{item.storeName}}—{{item.storeroomName}}—{{item.deviceName}}</div>
+<!--                <div style="font-size: 18px;font-weight: 700;margin-bottom: 25px">{{item.storeName}}—{{item.storeroomName}}—{{item.deviceName}}</div>-->
+                <div class="truncate-text" :title="item.storeName+'—'+item.storeroomName+'—'+item.deviceName">
+                  {{item.storeName}}—{{item.storeroomName}}—{{item.deviceName}}
+                </div>
                 <div style="display: flex;align-items: center;margin-bottom: 15px">
                   <img src="@/assets/images/device.png" />
                   <div style="display: flex;flex-direction: column">
@@ -71,7 +74,8 @@
     pageIndex: 1,
     pageSize: 5,
     filter: {
-      companyCode : ''
+      companyCode : '',
+      deviceType: 1
     }
   },
   total: 0,
@@ -151,5 +155,32 @@
   :deep(.el-scrollbar__wrap) {
     overflow-x: hidden;
   }
+  .truncate-text {
+    width: 350px;
+    font-size: 18px;
+    font-weight: 700;
+    margin-bottom: 25px;
+    white-space: nowrap;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    /* 悬浮显示原生标题 */
+    cursor: pointer;
+    position: relative;
+  }
+  /* 高级悬浮样式优化 */
+  .truncate-text:hover::after {
+    content: attr(title);
+    position: absolute;
+    left: 0;
+    top: 100%;
+    background: rgba(0,0,0,0.8);
+    color: white;
+    padding: 6px 12px;
+    border-radius: 4px;
+    z-index: 999;
+    white-space: normal;
+    width: max-content;
+    max-width: 300px;
+  }
 }
 </style>

--
Gitblit v1.9.2