From 6a79f474d393b43d5293d3653c1d1a8818cb4a14 Mon Sep 17 00:00:00 2001 From: TianMaiCheng <746290578@qq.com> Date: Fri, 9 Jan 2026 13:45:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=B7=A5=E5=85=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2html=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebSite/touchuantest.htm | 951 +++++++++++++++++++++++++++++++++------ 1 file changed, 823 insertions(+), 128 deletions(-) diff --git a/WebSite/touchuantest.htm b/WebSite/touchuantest.htm index d3e4614..925be1d 100644 --- a/WebSite/touchuantest.htm +++ b/WebSite/touchuantest.htm @@ -12,157 +12,343 @@ padding: 0; } + :root + { + --primary-color: #4361ee; + --primary-hover: #3a56d4; + --success-color: #2ecc71; + --success-hover: #27ae60; + --warning-color: #f39c12; + --danger-color: #e74c3c; + --light-bg: #f8f9fa; + --card-bg: #ffffff; + --border-color: #e9ecef; + --text-primary: #2c3e50; + --text-secondary: #7f8c8d; + --shadow: 0 4px 12px rgba(0, 0, 0, 0.08); + --radius: 10px; + --transition: all 0.3s ease; + } + body { - font-family: 'Segoe UI' , Tahoma, Geneva, Verdana, sans-serif; - line-height: 1.4; - color: #333; - background-color: #f5f7fa; - padding: 16px; + font-family: 'Segoe UI' , 'PingFang SC' , 'Microsoft YaHei' , sans-serif; + line-height: 1.6; + color: var(--text-primary); + background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%); + padding: 20px; + min-height: 100vh; + } + + .container + { max-width: 1000px; margin: 0 auto; } + header + { + text-align: center; + margin-bottom: 30px; + padding: 20px 0; + } + h1 { - font-size: 1.5rem; - margin-bottom: 20px; - color: #2c3e50; - border-bottom: 1px solid #e1e4e8; - padding-bottom: 10px; + font-size: 2rem; + font-weight: 700; + color: var(--text-primary); + margin-bottom: 10px; + position: relative; + display: inline-block; + } + + h1:after + { + content: ''; + position: absolute; + width: 60px; + height: 4px; + background: linear-gradient(to right, var(--primary-color), var(--success-color)); + bottom: -10px; + left: 50%; + transform: translateX(-50%); + border-radius: 2px; + } + + .subtitle + { + color: var(--text-secondary); + font-size: 1rem; + margin-top: 15px; } .card { - background: white; - border-radius: 6px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); - margin-bottom: 20px; + background: var(--card-bg); + border-radius: var(--radius); + box-shadow: var(--shadow); + margin-bottom: 25px; + border: 1px solid var(--border-color); + transition: var(--transition); overflow: hidden; } + .card:hover + { + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); + } + .card-header { - background-color: #f8f9fa; - padding: 12px 16px; - border-bottom: 1px solid #e9ecef; + background: linear-gradient(135deg, var(--primary-color), #5a6ff0); + color: white; + padding: 18px 24px; font-weight: 600; + font-size: 1.1rem; + display: flex; + align-items: center; + } + + .card-header i + { + margin-right: 10px; + font-size: 1.2rem; } .card-content { - padding: 16px; + padding: 24px; } .form-row { display: flex; flex-wrap: wrap; - gap: 15px; - margin-bottom: 15px; - align-items: flex-end; + gap: 20px; + margin-bottom: 20px; } .form-group { display: flex; flex-direction: column; + flex: 1; + min-width: 200px; } .form-row-inline { display: flex; align-items: center; - gap: 10px; - margin-bottom: 15px; + flex-wrap: wrap; + gap: 20px; + margin-bottom: 20px; + padding: 15px; + background-color: #f8fafc; + border-radius: 8px; } label { - font-size: 0.85rem; + font-size: 0.9rem; font-weight: 600; - margin-bottom: 5px; - color: #495057; + margin-bottom: 8px; + color: var(--text-primary); + display: flex; + align-items: center; } - input, textarea, button + .label-icon + { + margin-right: 6px; + color: var(--primary-color); + } + + input, textarea, select, button { font-family: inherit; - font-size: 0.9rem; + font-size: 0.95rem; + transition: var(--transition); } - input[type="text"], textarea + input[type="text"], input[type="number"], textarea, select { - padding: 8px 12px; - border: 1px solid #ced4da; - border-radius: 4px; - transition: border-color 0.15s; + padding: 12px 15px; + border: 2px solid #e0e6ef; + border-radius: 8px; + background-color: #fff; + transition: var(--transition); } - input[type="text"]:focus, textarea:focus + input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus { outline: none; - border-color: #4285f4; - box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2); + border-color: var(--primary-color); + box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15); } textarea { - min-height: 80px; + min-height: 100px; resize: vertical; width: 100%; + line-height: 1.5; } button { - background-color: #4285f4; + background-color: var(--primary-color); color: white; border: none; - border-radius: 4px; - padding: 8px 16px; + border-radius: 8px; + padding: 12px 24px; cursor: pointer; - font-weight: 500; - transition: background-color 0.15s; + font-weight: 600; + display: inline-flex; + align-items: center; + justify-content: center; + transition: var(--transition); } button:hover { - background-color: #3367d6; + background-color: var(--primary-hover); + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(67, 97, 238, 0.25); + } + + button:active + { + transform: translateY(0); } #send { - background-color: #34a853; + background-color: var(--success-color); } #send:hover { - background-color: #2e9449; + background-color: var(--success-hover); } - .checkbox-group + .checkbox-group, .radio-group { display: flex; align-items: center; gap: 8px; } + .radio-options + { + display: flex; + flex-wrap: wrap; + gap: 20px; + margin-bottom: 20px; + } + + .radio-option + { + display: flex; + align-items: center; + gap: 8px; + padding: 10px 15px; + background-color: #f8fafc; + border-radius: 8px; + border: 2px solid #e0e6ef; + cursor: pointer; + transition: var(--transition); + } + + .radio-option:hover + { + border-color: var(--primary-color); + background-color: #f0f4ff; + } + + .radio-option input[type="radio"] + { + margin-right: 5px; + } + + .port-group + { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 20px; + margin-bottom: 20px; + } + + .port-item + { + display: flex; + flex-direction: column; + gap: 8px; + padding: 15px; + background-color: #f8fafc; + border-radius: 8px; + display: none; /* 默认隐藏 */ + } + + .port-item.visible + { + display: flex; /* 显示时使用 flex 布局 */ + } + + .port-item-header + { + display: flex; + align-items: center; + justify-content: space-between; + } + + .port-item-content + { + display: flex; + flex-wrap: wrap; + gap: 15px; + align-items: center; + } + + .inline-group + { + display: flex; + align-items: center; + gap: 10px; + } + + .input-with-label + { + display: flex; + align-items: center; + gap: 8px; + } + + .input-with-label label + { + margin-bottom: 0; + white-space: nowrap; + } + .message-container { - max-height: 300px; + max-height: 400px; overflow-y: auto; - border: 1px solid #e9ecef; - border-radius: 4px; - padding: 12px; + border: 1px solid var(--border-color); + border-radius: 8px; + padding: 15px; background-color: #f8f9fa; font-family: 'Courier New' , monospace; - font-size: 0.85rem; + font-size: 0.9rem; } .message-item { - padding: 6px 0; + padding: 10px 12px; border-bottom: 1px solid #e9ecef; + display: flex; + align-items: center; } .message-item:last-child @@ -170,91 +356,462 @@ border-bottom: none; } + .message-time + { + font-size: 0.8rem; + color: var(--text-secondary); + margin-right: 15px; + min-width: 120px; + display: flex; + flex-direction: column; + line-height: 1.2; + } + + .message-delta + { + font-size: 0.75rem; + color: var(--text-secondary); + margin-top: 2px; + } + + .message-content + { + flex: 1; + word-break: break-all; + } + + .message-sent + { + background-color: #e8f5e9; + border-left: 4px solid var(--success-color); + } + + .message-received + { + background-color: #e3f2fd; + border-left: 4px solid var(--primary-color); + } + #result { - margin-top: 10px; + margin-top: 15px; + padding: 12px 15px; + border-radius: 8px; + font-size: 0.9rem; + display: none; + } + + .success + { + background-color: #d4edda; + color: #155724; + border-left: 4px solid var(--success-color); + display: block !important; + } + + .error + { + background-color: #f8d7da; + color: #721c24; + border-left: 4px solid var(--danger-color); + display: block !important; + } + + .info-box + { + background-color: #e7f3ff; + border-left: 4px solid var(--primary-color); + padding: 15px; + border-radius: 8px; + margin-bottom: 20px; + font-size: 0.9rem; + } + + .status-indicator + { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 6px 12px; + border-radius: 20px; font-size: 0.85rem; - color: #28a745; - min-height: 20px; + font-weight: 600; + } + + .status-connected + { + background-color: #d4edda; + color: #155724; + } + + .status-disconnected + { + background-color: #f8d7da; + color: #721c24; + } + + .status-dot + { + width: 8px; + height: 8px; + border-radius: 50%; + } + + .status-connected .status-dot + { + background-color: var(--success-color); + } + + .status-disconnected .status-dot + { + background-color: var(--danger-color); } @media (max-width: 768px) { - .form-row + .container + { + padding: 10px; + } + + .card-content + { + padding: 15px; + } + + .form-row, .port-group { flex-direction: column; - gap: 10px; + gap: 15px; } .form-group { width: 100%; + min-width: auto; } + + .radio-options + { + flex-direction: column; + gap: 10px; + } + + .port-item-content + { + flex-direction: column; + align-items: flex-start; + } + } + + /* 自定义复选框和单选框样式 */ + input[type="checkbox"], input[type="radio"] + { + width: 18px; + height: 18px; + cursor: pointer; + } + + /* 滚动条样式 */ + ::-webkit-scrollbar + { + width: 8px; + } + + ::-webkit-scrollbar-track + { + background: #f1f1f1; + border-radius: 4px; + } + + ::-webkit-scrollbar-thumb + { + background: #c1c1c1; + border-radius: 4px; + } + + ::-webkit-scrollbar-thumb:hover + { + background: #a8a8a8; } -

- 透传设置界面

- -
-
- 设置透传
-
-
-
- - -
-
- -
+
+
+

透传设置界面

+

配置和管理设备透传参数,实现数据透明传输

+
+ +
+
+ 设置透传
-
+
+
+ 请输入主机编号以建立透传连接。连接成功后,您可以发送和接收数据。 +
+
+
+ + +
+
+ +
+
+
+
+
+ +
-
- -
-
- 发送内容
-
-
-
- - + +
+
+ 发送内容 +
+
+
+
+ + +
+
+ + +
-
- - +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ +
+ Port 1 +
+
+
+ + +
+
+
+
+ +
+ Port 2 +
+
+
+ + +
+
+ + +
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+ Port 4 +
+
+
+ + +
+
+ + +
+
+
+
+
+
+ + +
+
+
+
-
- - -
-
-
- -
-
- 下位机透传来的数据
-
-
- + +
+
+ 下位机透传来的数据 +
+
+
+
+
+ 12:30:45
+
+ 等待连接设备...
+
+
+
+ +
-