| | |
| | | </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'; |
| | |
| | | // 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) |
| | | }, |
| | | { |