From 6937c5bfdd2101008e6646bd9f69b107b5a8f4c0 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Fri, 26 Jun 2026 17:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=AE=AF=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/platform.ts | 15 +- frontend/src/layout/components/header.vue | 80 +++- frontend/src/types/platform.ts | 8 +- .../src/views/communicationSetting/index.vue | 384 +++++++++++------- frontend/src/views/timeSetting/index.vue | 20 +- 5 files changed, 334 insertions(+), 173 deletions(-) diff --git a/frontend/src/api/platform.ts b/frontend/src/api/platform.ts index 306d682..0ac11de 100644 --- a/frontend/src/api/platform.ts +++ b/frontend/src/api/platform.ts @@ -9,6 +9,7 @@ import type { LineAlarmSettingPayload, RealtimeData, SystemConfigPayload, + FullDeviceConfig, } from '../types/platform' export async function fetchRealtimeData(): Promise { @@ -77,10 +78,20 @@ export async function saveDeviceNetConfig(payload: { nic: string; ip: string; ma const response = await http.post>('/config/device/net', payload) return response.data } -export async function saveDevicePortConfig(payload: { port: string; ip: string; mask: string; gateway: string; protocol: string }): Promise> { - const response = await http.post>('/config/device/uart', payload) +export async function saveDevicePortConfig( + payload: FullDeviceConfig +): Promise> { + const response = await http.post>( + '/config/device', + payload + ) return response.data } +export async function getDeviceNetConfig(): Promise { + const response = await http.get>(`/config/device`) + return response.data.data +} + export async function saveChannelConfig( payload: ChannelConfigPayload, ): Promise> { diff --git a/frontend/src/layout/components/header.vue b/frontend/src/layout/components/header.vue index ff0046e..e717f5d 100644 --- a/frontend/src/layout/components/header.vue +++ b/frontend/src/layout/components/header.vue @@ -1,25 +1,11 @@ diff --git a/frontend/src/types/platform.ts b/frontend/src/types/platform.ts index 57fd1fe..a912540 100644 --- a/frontend/src/types/platform.ts +++ b/frontend/src/types/platform.ts @@ -113,7 +113,13 @@ export interface ChannelConfigPayload { ai_channel: ChannelItem[] ao_channel: ChannelItem[] } - +export type FullDeviceConfig = { + password: string + hardware_version: HardwareVersion + software_version: SoftwareVersion + net: [NetConfigItem, NetConfigItem] + uart: [UartConfigItem, UartConfigItem] +} export interface AlarmRule { category: string limit: number diff --git a/frontend/src/views/communicationSetting/index.vue b/frontend/src/views/communicationSetting/index.vue index 9fb5f6e..def9593 100644 --- a/frontend/src/views/communicationSetting/index.vue +++ b/frontend/src/views/communicationSetting/index.vue @@ -1,26 +1,46 @@ @@ -275,14 +351,13 @@ onMounted(() => { .form-wrapper { background: #fff; - padding: 15px 50px; + padding: 15px 20px; border-radius: 4px; box-shadow: 0px 0px 10px rgba(219, 225, 236, 1); } .section { margin-bottom: 10px; - padding-bottom: 10px; border-bottom: 1px solid #ebeef5; &:last-child { @@ -294,7 +369,7 @@ onMounted(() => { .section-title { font-size: 16px; font-weight: 500; - margin: 0 0 10px 0; + margin: 0 0 12px 0; display: flex; align-items: center; font-weight: 700; @@ -311,9 +386,20 @@ onMounted(() => { } } - .form-row { + // 分栏小标题(网卡一/网卡二 COM1/COM2) + .sub-title { + font-size: 15px; + font-weight: 600; + color: #0099ff; + margin-bottom: 10px; + padding-left: 4px; + border-left: 3px solid #0099ff; + } + + // 每栏内部一行两个表单项 + .form-col-row { display: flex; - gap: 40px; + gap: 20px; margin-bottom: 10px; .el-form-item { @@ -325,14 +411,12 @@ onMounted(() => { .btn-wrapper { margin-top: 15px; } - } :deep(.el-form-item--label-right .el-form-item__label) { text-align: left; justify-content: flex-start; color: #787878; - } :deep(.el-select__placeholder) { @@ -341,15 +425,19 @@ onMounted(() => { :deep(.el-input__inner) { color: #363636; - min-height: 40px; + min-height: 28px; } :deep(.el-select__wrapper) { - min-height: 40px; + min-height: 28px; } :deep(.el-form-item__label) { - height: 40px; - line-height: 40px; + height: 28px; + line-height: 28px; +} + +:deep(.el-form-item) { + margin-bottom: 3px; } \ No newline at end of file diff --git a/frontend/src/views/timeSetting/index.vue b/frontend/src/views/timeSetting/index.vue index 8a77a1c..e86b28b 100644 --- a/frontend/src/views/timeSetting/index.vue +++ b/frontend/src/views/timeSetting/index.vue @@ -1,11 +1,12 @@ @@ -60,7 +73,8 @@ onMounted(() => { + @focus="isUserEdited = true" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" + style="width: 100%;" />