Sfoglia il codice sorgente

编码测报灯业务界面

niujiuru 2 giorni fa
parent
commit
98da0365fe

+ 28 - 2
web-ui.service/web/pages/page9.html

@@ -7,6 +7,10 @@
 </head>
 </head>
 
 
 <body>
 <body>
+  <svg xmlns="http://www.w3.org/2000/svg" style="display:none" aria-hidden="true">
+    <symbol id="i-firmware-monitor" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></symbol>
+    <symbol id="i-firmware-mcu" viewBox="0 0 24 24"><rect x="5" y="5" width="14" height="14" rx="2"/><rect x="9.5" y="9.5" width="5" height="5"/><path d="M9 2v3m6-3v3m-6 14v3m6-3v3M2 9h3m-3 6h3m14-6h3m-3 6h3"/></symbol>
+  </svg>
   <div class="app">
   <div class="app">
     <main class="view page-cbd">
     <main class="view page-cbd">
       <div class="panes">
       <div class="panes">
@@ -45,7 +49,7 @@
           <div class="card command-card">
           <div class="card command-card">
             <div class="card-header">
             <div class="card-header">
               <h2>设备控制</h2>
               <h2>设备控制</h2>
-              <button class="btn" id="p9AuthBtn" title="点击授权解锁操作" onclick="enableP9CtrlCmdButtons()">
+              <button class="btn" id="p9CtrlCmdAuthBtn" title="点击授权解锁操作" onclick="enableP9CtrlCmdButtons()">
                 <svg class="icon">
                 <svg class="icon">
                   <use href="#i-unlock" xlink:href="#i-unlock"/>
                   <use href="#i-unlock" xlink:href="#i-unlock"/>
                 </svg>
                 </svg>
@@ -106,13 +110,35 @@
           <div class="card firmware-card">
           <div class="card firmware-card">
             <div class="card-header">
             <div class="card-header">
               <h2>固件升级</h2>
               <h2>固件升级</h2>
-              <button class="btn" id="p9AuthBtn" title="点击授权解锁操作" onclick="enablePUpgradeButtons()">
+              <button class="btn" id="p9UpgradeAuthBtn" title="点击授权解锁操作" onclick="enablePUpgradeButtons()">
                 <svg class="icon">
                 <svg class="icon">
                   <use href="#i-unlock" xlink:href="#i-unlock"/>
                   <use href="#i-unlock" xlink:href="#i-unlock"/>
                 </svg>
                 </svg>
               </button>
               </button>
             </div>
             </div>
+
             <div class="firmware-content">
             <div class="firmware-content">
+              <!-- HMI屏幕固件 -->
+              <div class="firmware-item">
+                <strong class="firmware-name">
+                  <svg class="icon"><use href="#i-firmware-monitor" xlink:href="#i-firmware-monitor"/></svg>
+                  串口屏
+                </strong>
+                <input type="file" id="hmiFile" accept=".zip" disabled>
+                <div class="firmware-status" id="hmiStatus">等待选择文件</div>
+                <button class="btn" id="hmiUploadBtn" onclick="uploadFirmware('hmi')" disabled>升级</button>
+              </div>
+
+              <!-- MCU控制板固件 -->
+              <div class="firmware-item">
+                <strong class="firmware-name">
+                  <svg class="icon"><use href="#i-firmware-mcu" xlink:href="#i-firmware-mcu"/></svg>
+                  控制板
+                </strong>
+                <input type="file" id="mcuFile" accept=".rbl" disabled>
+                <div class="firmware-status" id="mcuStatus">等待选择文件</div>
+                <button class="btn" id="mcuUploadBtn" onclick="uploadFirmware('mcu')" disabled>升级</button>
+              </div>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>

+ 172 - 16
web-ui.service/web/static/css/page9.css

@@ -40,14 +40,16 @@
     white-space: normal;
     white-space: normal;
 }
 }
 
 
-/* 设备控制:占剩余空间的3/4 */
+/* 设备控制:占剩余空间 */
 .page-cbd .command-card {
 .page-cbd .command-card {
-    flex: 3;
+    flex: 1;
+    min-height: 0;
 }
 }
 
 
-/* 固件升级:占剩余空间的1/4 */
+/* 固件升级:保持合适的最小高度 */
 .page-cbd .firmware-card {
 .page-cbd .firmware-card {
-    flex: 1;
+    flex: none;
+    min-height: 150px;
 }
 }
 
 
 /* 左侧内容区域 */
 /* 左侧内容区域 */
@@ -76,16 +78,23 @@
 }
 }
 
 
 .page-cbd .status-item {
 .page-cbd .status-item {
+    position: relative;
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     justify-content: center;
     justify-content: center;
     gap: 8px;
     gap: 8px;
     min-width: 0;
     min-width: 0;
     padding: 12px 14px;
     padding: 12px 14px;
-    border: 1px solid #263650;
+    border: 1px solid #2d405e;
     border-left: 3px solid #3b82f6;
     border-left: 3px solid #3b82f6;
     border-radius: 6px;
     border-radius: 6px;
-    background: #151f33;
+    background: linear-gradient(135deg, #192941, #151f33);
+    transition: border-color 0.2s, background 0.2s;
+}
+
+.page-cbd .status-item:hover {
+    border-color: #45658d;
+    background: #1c2d48;
 }
 }
 
 
 /* 设备状态及控制分组标题 */
 /* 设备状态及控制分组标题 */
@@ -96,6 +105,24 @@
     font-weight: 500;
     font-weight: 500;
 }
 }
 
 
+.page-cbd .status-item span {
+    position: relative;
+    padding-left: 11px;
+}
+
+.page-cbd .status-item span::before {
+    content: "";
+    position: absolute;
+    left: 0;
+    top: 50%;
+    width: 5px;
+    height: 5px;
+    border-radius: 50%;
+    background: #3b82f6;
+    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
+    transform: translateY(-50%);
+}
+
 .page-cbd .status-item strong {
 .page-cbd .status-item strong {
     color: #60a5fa;
     color: #60a5fa;
     font-size: 16px;
     font-size: 16px;
@@ -113,9 +140,14 @@
 .page-cbd .command-group {
 .page-cbd .command-group {
     padding: 14px;
     padding: 14px;
     margin-bottom: 12px;
     margin-bottom: 12px;
-    border: 1px solid #263650;
+    border: 1px solid #2d405e;
     border-radius: 6px;
     border-radius: 6px;
-    background: #151f33;
+    background: linear-gradient(135deg, #192941, #151f33);
+    transition: border-color 0.2s;
+}
+
+.page-cbd .command-group:hover {
+    border-color: #45658d;
 }
 }
 
 
 .page-cbd .command-group:last-child {
 .page-cbd .command-group:last-child {
@@ -124,9 +156,22 @@
 
 
 /* 分组标题 */
 /* 分组标题 */
 .page-cbd .command-group h3 {
 .page-cbd .command-group h3 {
+    display: flex;
+    align-items: center;
+    gap: 9px;
     margin: 0 0 12px;
     margin: 0 0 12px;
-    padding-left: 9px;
-    border-left: 3px solid #3b82f6;
+    padding: 0 0 10px;
+    border-bottom: 1px solid #2b3d58;
+}
+
+.page-cbd .command-group h3::before {
+    content: "";
+    flex: none;
+    width: 7px;
+    height: 7px;
+    border-radius: 50%;
+    background: #3b82f6;
+    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
 }
 }
 
 
 /* 指令按钮布局 */
 /* 指令按钮布局 */
@@ -142,8 +187,8 @@
     width: 100%;
     width: 100%;
     min-width: 0;
     min-width: 0;
     min-height: 38px;
     min-height: 38px;
-    padding: 6px 8px 6px 18px;
-    border: 1px solid #34445f;
+    padding: 6px 8px 6px 23px;
+    border: 1px solid #344965;
     border-radius: 5px;
     border-radius: 5px;
     background: #1c2940;
     background: #1c2940;
     color: #cbd5e1;
     color: #cbd5e1;
@@ -156,20 +201,22 @@
 .page-cbd .cmd-btn::before {
 .page-cbd .cmd-btn::before {
     content: "";
     content: "";
     position: absolute;
     position: absolute;
-    left: 8px;
+    left: 9px;
     top: 50%;
     top: 50%;
-    width: 5px;
-    height: 5px;
+    width: 6px;
+    height: 6px;
     border-radius: 50%;
     border-radius: 50%;
     transform: translateY(-50%);
     transform: translateY(-50%);
 }
 }
 
 
 .page-cbd .cmd-btn-1::before {
 .page-cbd .cmd-btn-1::before {
     background: #36b99a;
     background: #36b99a;
+    box-shadow: 0 0 6px rgba(54, 185, 154, 0.5);
 }
 }
 
 
 .page-cbd .cmd-btn-0::before {
 .page-cbd .cmd-btn-0::before {
     background: #df826e;
     background: #df826e;
+    box-shadow: 0 0 6px rgba(223, 130, 110, 0.4);
 }
 }
 
 
 .page-cbd .cmd-btn:hover {
 .page-cbd .cmd-btn:hover {
@@ -188,9 +235,96 @@
     cursor: not-allowed;
     cursor: not-allowed;
 }
 }
 
 
+.page-cbd .cmd-btn:disabled::before {
+    box-shadow: none;
+}
+
 /* 固件升级内容 */
 /* 固件升级内容 */
 .page-cbd .firmware-content {
 .page-cbd .firmware-content {
-    padding: 12px;
+    display: flex;
+    flex-direction: column;
+    gap: 0;
+    padding: 0;
+}
+
+/* 固件升级项目 */
+.page-cbd .firmware-item {
+    position: relative;
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    min-height: 38px;
+    padding: 14px;
+    margin-bottom: 12px;
+    border: 1px solid #2d405e;
+    border-radius: 6px;
+    background: linear-gradient(135deg, #192941, #151f33);
+    min-width: 0;
+    overflow: hidden;
+    transition: border-color 0.2s, background 0.2s;
+}
+
+.page-cbd .firmware-item:last-child {
+    margin-bottom: 0;
+}
+
+.page-cbd .firmware-item:hover {
+    border-color: #45658d;
+    background: #1c2d48;
+}
+
+.page-cbd .firmware-item::before {
+    content: "";
+    position: absolute;
+    left: 0;
+    top: 0;
+    bottom: 0;
+    width: 3px;
+    background: linear-gradient(to bottom, #60a5fa, #2563eb);
+}
+
+/* 固件升级名称 */
+.page-cbd .firmware-name {
+    display: flex;
+    align-items: center;
+    gap: 7px;
+    flex: none;
+    width: 90px;
+    color: #e2e8f0;
+    font-size: 13px;
+    font-weight: 500;
+}
+
+.page-cbd .firmware-name .icon {
+    width: 17px;
+    height: 17px;
+    flex: none;
+    fill: none;
+    stroke: #60a5fa;
+    stroke-width: 1.8;
+    stroke-linecap: round;
+    stroke-linejoin: round;
+}
+
+/* 固件文件选择 */
+.page-cbd .firmware-item input[type="file"] {
+    flex: 1;
+    min-width: 0;
+    color: #cbd5e1;
+    font-size: 12px;
+}
+
+/* 固件升级状态 */
+.page-cbd .firmware-status {
+    min-width: 90px;
+    color: #94a3b8;
+    font-size: 12px;
+    overflow-wrap: anywhere;
+}
+
+/* 固件升级按钮 */
+.page-cbd .firmware-item .btn {
+    flex: none;
 }
 }
 
 
 /* 右栏:应用日志 */
 /* 右栏:应用日志 */
@@ -258,6 +392,11 @@
         min-height: 180px;
         min-height: 180px;
     }
     }
 
 
+    .page-cbd .firmware-content {
+        flex: none;
+        overflow: visible;
+    }
+
     .page-cbd .right-pane .log-card {
     .page-cbd .right-pane .log-card {
         min-height: 400px;
         min-height: 400px;
     }
     }
@@ -272,4 +411,21 @@
     .page-cbd .log-actions {
     .page-cbd .log-actions {
         gap: 4px;
         gap: 4px;
     }
     }
+
+    .page-cbd .firmware-item {
+        flex-wrap: wrap;
+    }
+
+    .page-cbd .firmware-name {
+        width: 100%;
+    }
+
+    .page-cbd .firmware-item input[type="file"] {
+        flex-basis: 100%;
+    }
+
+    .page-cbd .firmware-status {
+        flex: 1;
+        min-width: 0;
+    }
 }
 }

+ 1 - 1
web-ui.service/web/static/js/page9.js

@@ -126,7 +126,7 @@ function enableP9CtrlCmdButtons() {
             for (var i = 1; i <= 12; i++) {
             for (var i = 1; i <= 12; i++) {
                 setBtnStatus("p9btn" + (i < 10 ? "0" : "") + i, true, "page9");
                 setBtnStatus("p9btn" + (i < 10 ? "0" : "") + i, true, "page9");
             }
             }
-            setBtnStatus("p9AuthBtn", false, "page9");
+            setBtnStatus("p9CtrlCmdAuthBtn", false, "page9");
         })
         })
         .catch(function (e) {
         .catch(function (e) {
             alert(e.message);
             alert(e.message);