From 02409bfbe15f22fc3b5dccadabfd860a660a49d9 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Sat, 11 Oct 2025 10:37:14 +0800
Subject: [PATCH] feat: 名称修改

---
 src/views/device/components/DeviceSettingBox.vue |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/views/device/components/DeviceSettingBox.vue b/src/views/device/components/DeviceSettingBox.vue
index 66377f1..2621bc2 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,7 +371,7 @@
 
 <style lang="scss" scoped>
 .device-setting-wrapper {
-  border-bottom: 1px solid #515151;
+  //border-bottom: 1px solid #515151;
 
   .device-setting-header {
     font-size: 14px;

--
Gitblit v1.9.3