From 5808f76456ca0d40de5074f132b73a5a488e3e13 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 09 Dec 2025 09:12:03 +0800
Subject: [PATCH] Merge branch 'refs/heads/feature/v9.0/9.0.1' into test

---
 src/views/device/components/DeviceSettingBox.vue |   30 +++++++++++++++++++-----------
 1 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/src/views/device/components/DeviceSettingBox.vue b/src/views/device/components/DeviceSettingBox.vue
index 66377f1..db76492 100644
--- a/src/views/device/components/DeviceSettingBox.vue
+++ b/src/views/device/components/DeviceSettingBox.vue
@@ -312,7 +312,8 @@
 </template>
 
 <script setup>
-import { defineProps, ref, watch } from 'vue';
+import { defineProps, inject, ref, watch } from 'vue';
+import { ELocalStorageKey } from '@/types'
 import { cloneDeep } from 'lodash';
 import { initDeviceSetting, initDeviceSettingFormModel, DeviceSettingKeyEnum } from '@/types/device-setting';
 import {
@@ -325,16 +326,19 @@
 // const props = defineProps();
 const props = defineProps(['sn', 'deviceInfo'])
 
-const deviceSetting = ref(cloneDeep(initDeviceSetting));
-const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
+// const deviceSetting = ref(cloneDeep(initDeviceSetting));
+// const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
 const deviceSettingFormModel = ref(cloneDeep(initDeviceSettingFormModel)); // 真实使用的formModel
 
+const deviceSetting = inject('deviceSetting')
+const deviceSettingFormModelFromOsd = inject('deviceSettingFormModelFromOsd')
 // 根据设备osd信息更新信息
 watch(
   () => props.deviceInfo,
   value => {
-    updateDeviceSettingInfoByOsd(deviceSetting.value, value);
-    updateDeviceSettingFormModelByOsd(deviceSettingFormModelFromOsd.value, value);
+    // console.log('9999',value)
+    // updateDeviceSettingInfoByOsd(deviceSetting, value);
+    // updateDeviceSettingFormModelByOsd(deviceSettingFormModelFromOsd, value);
     // console.log('deviceInfo', value)
   },
   {
@@ -352,11 +356,11 @@
   deviceSetting.value[settingKey].popConfirm.visible = false;
 }
 
-async function onConfirm(settingKey) {
+async function onConfirm(settingKey,) {
   deviceSetting.value[settingKey].popConfirm.loading = true;
   const body = genDevicePropsBySettingKey(settingKey, deviceSettingFormModel.value);
-  console.log(body, '顶顶顶顶顶')
-  await setDeviceProps(props.sn, body);
+  localStorage.setItem(ELocalStorageKey.WorkspaceId, props.deviceInfo.workspace_id)
+  await setDeviceProps(props.sn, props.deviceInfo.workspace_id, body);
   deviceSetting.value[settingKey].popConfirm.loading = false;
   deviceSetting.value[settingKey].popConfirm.visible = false;
 }
@@ -367,11 +371,11 @@
 
 <style lang="scss" scoped>
 .device-setting-wrapper {
-  border-bottom: 1px solid #515151;
+  //border-bottom: 1px solid #515151;
 
   .device-setting-header {
     font-size: 14px;
-    font-weight: 600;
+    //font-weight: 600;
     padding: 10px 10px 0px;
   }
 
@@ -394,6 +398,7 @@
     flex-wrap: wrap;
     justify-content: space-between;
     padding: 4px 10px;
+    font-size: 14px;
 
     .control-setting-item {
       width: 220px;
@@ -410,7 +415,10 @@
         flex-direction: column;
 
         .item-label {
-          font-weight: 700;
+          //font-weight: 700;
+        }
+        .item-status {
+          color: #8d8b8b;
         }
       }
       .control-setting-item-right {

--
Gitblit v1.9.3