无人机管理后台前端(已迁走)
张含笑
2025-08-05 c832bf2e80ac465e71b7a1c1f7a59d4252030989
src/views/device/components/DeviceSettingBox.vue
@@ -309,29 +309,18 @@
  </div>
</template>
<script setup lang="ts">
<script setup>
import { defineProps, ref, watch } from 'vue';
import { DeviceInfoType } from '@/types/device';
import { useMyStore } from '@/store';
import { cloneDeep } from 'lodash';
import {
  initDeviceSetting,
  initDeviceSettingFormModel,
  DeviceSettingKeyEnum,
} from '@/types/device-setting';
import { initDeviceSetting, initDeviceSettingFormModel } from '@/types/device-setting';
import {
  updateDeviceSettingInfoByOsd,
  updateDeviceSettingFormModelByOsd,
} from '@/utils/device-setting';
import { useDeviceSetting } from './use-device-setting';
import DeviceSettingPopover from './DeviceSettingPopover.vue';
const props = defineProps<{
  sn: string;
  deviceInfo: DeviceInfoType;
}>();
const props = defineProps();
const store = useMyStore();
const deviceSetting = ref(cloneDeep(initDeviceSetting));
const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
const deviceSettingFormModel = ref(cloneDeep(initDeviceSettingFormModel)); // 真实使用的formModel
@@ -350,16 +339,16 @@
  }
);
function onShowPopConfirm(settingKey: DeviceSettingKeyEnum) {
function onShowPopConfirm(settingKey) {
  deviceSetting.value[settingKey].popConfirm.visible = true;
  deviceSettingFormModel.value = cloneDeep(deviceSettingFormModelFromOsd.value);
}
function onCancel(settingKey: DeviceSettingKeyEnum) {
function onCancel(settingKey) {
  deviceSetting.value[settingKey].popConfirm.visible = false;
}
async function onConfirm(settingKey: DeviceSettingKeyEnum) {
async function onConfirm(settingKey) {
  deviceSetting.value[settingKey].popConfirm.loading = true;
  const body = genDevicePropsBySettingKey(settingKey, deviceSettingFormModel.value);
  await setDeviceProps(props.sn, body);