Prechádzať zdrojové kódy

refactor: 优化多页面UI、图表及数据展示逻辑

1. 更新气象站页面设备图片资源与尺寸
2. 注释掉虫害页面的时期展示模块
3. 修复设备控制页面div标签不兼容问题,调整样式
4. 为SIM详情页添加空值兜底显示
5. 优化设备列表页面的时间范围默认值与图标样式
6. 重构历史表格组件,拆分固定与滚动列
7. 删除无用的本地SVG图标文件
allen 1 deň pred
rodič
commit
7f7cb2cce6

+ 8 - 6
pages/deviceDetails/SoilMoisturelist/index.vue

@@ -286,7 +286,7 @@ export default {
       page: 1,
       photoIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/photoIcon.png',
       editIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/editIcon.png',
-      serviceIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/serviceIcon.png',
+      serviceIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/settingNewIcon.png',
       simIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/simIcon.png',
       settingIcon:'https://s3.hnyfwlw.com/webstaticimg/bigdata_app/newImg/home/settingIcon.png',
       isShowPhoto:false,
@@ -367,14 +367,14 @@ export default {
         const today = new Date();
         this.endDate = this.formatDate(today);
         const startDate = new Date(today);
-        startDate.setDate(startDate.getDate() - 7);
+        startDate.setDate(startDate.getDate() - 1);
         this.startDate = this.formatDate(startDate);
         return;
       }
       const date = new Date(Number(timestamp) * 1000);
       this.endDate = this.formatDate(date);
       const startDate = new Date(date);
-      startDate.setDate(startDate.getDate() - 7);
+      startDate.setDate(startDate.getDate() - 1);
       this.startDate = this.formatDate(startDate);
     },
     switchTab(tab) {
@@ -801,6 +801,8 @@ export default {
         type: 'area',
         legend: {
           position: 'top',
+          float: 'left', // 圆点左对齐
+          lineHeight: 19, // 行间距 8px(字号 11 + 8)
         },
         fontSize: 11,
         background: '#FFFFFF',
@@ -1167,7 +1169,7 @@ export default {
         }
         .temp-icon{
           width: 48rpx;
-          height: 48rpx;
+          height: 40rpx;
           margin-right: 16rpx;
         }
         .temp-content{
@@ -1206,7 +1208,7 @@ export default {
         }
         .swc-icon{
           width: 48rpx;
-          height: 48rpx;
+          height: 40rpx;
           margin-right: 16rpx;
         }
         .swc-content{
@@ -1245,7 +1247,7 @@ export default {
         }
         .dept-icon{
           width: 48rpx;
-          height: 48rpx;
+          height: 40rpx;
           margin-right: 16rpx;
         }
         .dept-content{

+ 4 - 4
pages/deviceDetails/weatherStation/simDetail.vue

@@ -26,19 +26,19 @@
         </view>
         <view class="sim-item">
           <text class="label">总流量:</text>
-          <span class="val">{{ simData.total }}M</span>
+          <span class="val">{{ simData.total || '-'}}M</span>
         </view>
         <view class="sim-item">
           <text class="label">状态:</text>
-          <text class="val">{{ simData.status }}</text>
+          <text class="val">{{ simData.status || '-'}}</text>
         </view>
         <view class="sim-item">
           <text class="label">到期时间:</text>
-          <text class="val">{{ simData.expire }}</text>
+          <text class="val">{{ simData.expire || '-'}}</text>
         </view>
         <view class="sim-item">
           <text class="label">厂商名称:</text>
-          <text class="val">{{ simData.company }}</text>
+          <text class="val">{{ simData.company || '-' }}</text>
         </view>
         <view class="sim-info-count">
           <view class="sim-item">

+ 5 - 6
pages/deviceDetails/weatherStation2/devControl.vue

@@ -7,10 +7,12 @@
     </cu-custom>
     <view class="control-board">
       <view class="title">操作</view>
-      <div style="margin-bottom: 48rpx;">
+      <view style="margin-bottom: 48rpx;">
         <u-button type="success" class="reload-btn" @click="handleControl('reboot')">重启</u-button>
-      </div>
-      <u-button type="success" class="reload-btn" @click="handleControl('update')">升级</u-button>
+      </view>
+      <view style="margin-bottom: 48rpx;">
+        <u-button type="success" class="reload-btn" @click="handleControl('update')">升级</u-button>
+      </view>
       <u-button type="success" class="reload-btn" @click="handleControl('read')">查询上传时间间隔</u-button>
       <view class="title date-title">上传时间间隔(min)</view>
       <view class="date-slider">
@@ -158,9 +160,6 @@ export default {
     margin-bottom: 48rpx;
     border-radius: 16rpx;
   }
-  .date-slider {
-    
-  }
 }
 
 .footer-board {

+ 2 - 2
pages/deviceDetails/weatherStation2/index.vue

@@ -151,8 +151,8 @@
             <view class="params-right">
               <image
                 class="device-img"
-                style="width: 150rpx; height: 300rpx;"
-                src="/static/images/device/qxz_low.png"
+                style="width: 150rpx; height: 260rpx;"
+                src="https://s3.hnyfwlw.com/webstaticimg/bigdata_app/image/qxsq.png"
                 mode="aspectFit"
               ></image>
             </view>

+ 24 - 10
pages/sy/components/deviceData2.vue

@@ -7,10 +7,25 @@
       </view>
       <view class="history-table">
         <view class="table-container">
+          <!-- 固定列:上报时间 -->
+          <view class="fixed-column">
+            <view class="fixed-header">
+              <text class="header-cell fixed">{{ fixedColumn.label }}</text>
+            </view>
+            <view class="fixed-body">
+              <view
+                v-for="(item, index) in historyData"
+                :key="index"
+                class="fixed-row"
+              >
+                <text class="body-cell fixed">{{ formatDate(item[fixedColumn.prop] * 1000) }}</text>
+              </view>
+            </view>
+          </view>
           <!-- 可滑动列 -->
           <view class="scrollable-column">
             <view class="scrollable-header">
-              <text class="header-cell" v-for="(item, index) in columns" :key="index">{{ item.label }}</text>
+              <text class="header-cell" v-for="(col, index) in scrollableColumns" :key="index">{{ col.label }}</text>
             </view>
             <view class="scrollable-body">
               <view
@@ -18,8 +33,7 @@
                 :key="index"
                 class="scrollable-row"
               >
-                <view class="body-cell" v-for="(col, index) in columns" :key="index">
-                  <text v-if="col.customRender === 'addtime'">{{ formatDate(item[col.prop] * 1000)  }}</text>
+                <view class="body-cell" v-for="(col, index) in scrollableColumns" :key="index">
                   <text v-if="col.customRender === 'ds'">{{ item[col.prop] == 1 ? '开机' : '关机' }}</text>
                   <text v-if="col.customRender === 'at'">{{ formatAt(item[col.prop],item) }}</text>
                   <text v-if="col.customRender === 'ah'">{{ formatAh(item[col.prop],item) }}</text>
@@ -252,6 +266,12 @@ export default {
     totalPages(){
       return Math.ceil(this.totalPage / this.page_size) || 1
     },
+    fixedColumn() {
+      return this.columns[0] || {};
+    },
+    scrollableColumns() {
+      return this.columns.slice(1);
+    },
     formatDevImg() {
       if(this.devImg == 'lowcbd'){
         return 'https://s3.hnyfwlw.com/webstaticimg/bigdata_pc/menu/cbd.png';
@@ -1014,7 +1034,7 @@ export default {
 
         .fixed-header {
           border-bottom: 2rpx solid #F0F0F0;
-          padding: 16rpx 0;
+          padding: 20rpx 0;
 
           .header-cell.fixed {
             font-size: 24rpx;
@@ -1079,9 +1099,6 @@ export default {
             text-overflow: ellipsis;
             white-space: nowrap;
             margin-right: 10rpx;
-            &:first-child {
-              min-width: 220rpx;
-            }
           }
         }
 
@@ -1104,9 +1121,6 @@ export default {
               display: flex;
               align-items: center;
               justify-content: center;
-              &:first-child {
-                min-width: 220rpx;
-              }
             }
           }
         }

+ 2 - 2
pages/sy/components/pestEchart.vue

@@ -16,7 +16,7 @@
 
     <view class="pest-echart__content" v-show="dayData.length">
       <!-- 三个关键时期 -->
-      <view class="period-section">
+      <!-- <view class="period-section">
         <view class="period-item">
           <view class="period-label">始见期</view>
           <view class="period-value">{{ periodData.firstDate }}</view>
@@ -29,7 +29,7 @@
           <view class="period-label">终见期</view>
           <view class="period-value">{{ periodData.lastDate }}</view>
         </view>
-      </view>
+      </view> -->
 
       <!-- 图表区域 -->
       <view class="chart-container">

+ 26 - 5
pages/sy/deviceControl2.vue

@@ -25,7 +25,7 @@
         <view class="device-detail-item">
           <text class="device-detail-label">识别种类</text>
           <view class="device-detail-btn-container">
-            <u-button @click="show2 = true" size="mini">{{getSelectPest(selectPest)}}</u-button>
+            <view class="device-detail-btns" @click="show2 = true" size="mini">{{getSelectPest(selectPest)}}</view>
             <view class="device-detail-btn" @click="setBindPest">{{selectPest.pest_id == '' ? '恢复默认' : '绑定设备'}}</view>
           </view>
         </view>
@@ -173,9 +173,10 @@ export default {
     formatCtrlMode(ctrlMode){
       if(ctrlMode == 1){
         return '时控模式'
-      }else{
+      }else if(ctrlMode == 0){
         return '光控模式'
       }
+      return '请选择控制模式'
     },
     getProgressWidth(value, min, max) {
       if (max === min) return 0
@@ -364,6 +365,13 @@ export default {
           id: this.d_id,
         },
       });
+      console.log(res,'resresres')
+      if(!res?.startHour){
+        res.startHour = '0'
+      }
+      if(!res?.endHour){
+        res.endHour = '0'
+      }
       this.equipContrlForm = res
     },
   }
@@ -462,9 +470,22 @@ export default {
         gap: 24rpx;
         margin-top: 12rpx;
       }
+      .device-detail-btns{
+        display: flex;
+        padding: 16rpx 24rpx;
+        justify-content: center;
+        align-items: center;
+        gap: 16rpx;
+        border: 1rpx solid #0BBC58;
+        border-radius: 16rpx;
+        color: #0BBC58;
+        font-family: "Source Han Sans CN VF";
+        font-size: 24rpx;
+        font-weight: 400;
+      }
       .device-detail-btn{
         display: flex;
-        padding: 10rpx 16rpx;
+        padding: 16rpx 24rpx;
         justify-content: center;
         align-items: center;
         gap: 16rpx;
@@ -553,10 +574,10 @@ export default {
     align-items: center;
     .device-detail-btn{
       display: flex;
-      height: 80rpx;
+      height: 100rpx;
       width: 90%;
       margin: 0 auto;
-      padding: 0rpx 20rpx;
+      padding: 10rpx 20rpx;
       justify-content: center;
       align-items: center;
       gap: 8rpx;

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 18
static/images/device/冻土.svg