From 8a7bc685c7ba3a2d9cd69cfefc37fa9be4dead25 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 29 Aug 2025 17:27:04 +0800
Subject: [PATCH] feat:更新设备管理和注册管理
---
src/views/device/components/DeviceSettingBox.vue | 88 ++++++++++++++++++++++----------------------
1 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/src/views/device/components/DeviceSettingBox.vue b/src/views/device/components/DeviceSettingBox.vue
index 90f3dec..66377f1 100644
--- a/src/views/device/components/DeviceSettingBox.vue
+++ b/src/views/device/components/DeviceSettingBox.vue
@@ -57,15 +57,15 @@
<span class="form-label"
>{{ deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].label }}:</span
>
- <a-switch
- checked-children="开"
- un-checked-children="关"
- v-model:checked="deviceSettingFormModel.nightLightsState"
+ <el-switch
+ active-text="开"
+ inactive-text="关"
+ v-model="deviceSettingFormModel.nightLightsState"
/>
</div>
</template>
<a
- @click="
+ @click.stop="
onShowPopConfirm(
deviceSetting[DeviceSettingKeyEnum.NIGHT_LIGHTS_MODE_SET].settingKey
)
@@ -95,14 +95,15 @@
<template #formContent>
<div class="form-content">
<span class="form-label"
- >{{ deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].label }}:</span
+ >{{ deviceSetting[DeviceSettingKeyEnum.HEIGHT_LIMIT_SET].label }}:(m)</span
>
- <a-input-number
- v-model:value="deviceSettingFormModel.heightLimit"
+ <el-input-number
+ size="small"
+ v-model="deviceSettingFormModel.heightLimit"
:min="20"
:max="1500"
/>
- m
+
</div>
</template>
<a
@@ -136,14 +137,15 @@
<span class="form-label"
>{{ deviceSetting[DeviceSettingKeyEnum.DISTANCE_LIMIT_SET].label }}:</span
>
- <a-switch
+ <el-switch
style="margin-right: 10px"
- checked-children="开"
- un-checked-children="关"
- v-model:checked="deviceSettingFormModel.distanceLimitStatus.state"
+ active-text="开"
+ inactive-text="关"
+ v-model="deviceSettingFormModel.distanceLimitStatus.state"
/>
- <a-input-number
- v-model:value="deviceSettingFormModel.distanceLimitStatus.distanceLimit"
+ <el-input-number
+ size="small"
+ v-model="deviceSettingFormModel.distanceLimitStatus.distanceLimit"
:min="15"
:max="8000"
/>
@@ -189,10 +191,10 @@
<span class="form-label"
>{{ deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_HORIZON].label }}:</span
>
- <a-switch
- checked-children="开"
- un-checked-children="关"
- v-model:checked="deviceSettingFormModel.obstacleAvoidanceHorizon"
+ <el-switch
+ active-text="开"
+ inactive-text="关"
+ v-model="deviceSettingFormModel.obstacleAvoidanceHorizon"
/>
</div>
</template>
@@ -237,10 +239,10 @@
<span class="form-label"
>{{ deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_UPSIDE].label }}:</span
>
- <a-switch
- checked-children="开"
- un-checked-children="关"
- v-model:checked="deviceSettingFormModel.obstacleAvoidanceUpside"
+ <el-switch
+ active-text="开"
+ inactive-text="关"
+ v-model="deviceSettingFormModel.obstacleAvoidanceUpside"
/>
</div>
</template>
@@ -287,10 +289,10 @@
deviceSetting[DeviceSettingKeyEnum.OBSTACLE_AVOIDANCE_DOWNSIDE].label
}}:</span
>
- <a-switch
- checked-children="开"
- un-checked-children="关"
- v-model:checked="deviceSettingFormModel.obstacleAvoidanceDownside"
+ <el-switch
+ active-text="开"
+ inactive-text="关"
+ v-model="deviceSettingFormModel.obstacleAvoidanceDownside"
/>
</div>
</template>
@@ -309,29 +311,20 @@
</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, DeviceSettingKeyEnum } from '@/types/device-setting';
import {
updateDeviceSettingInfoByOsd,
updateDeviceSettingFormModelByOsd,
} from '@/utils/device-setting';
import { useDeviceSetting } from './use-device-setting';
-import DeviceSettingPopover from './DeviceSettingPopover.vue';
+import DeviceSettingPopover from './DeviceSettingPopover.vue'
-const props = defineProps<{
- sn: string;
- deviceInfo: DeviceInfoType;
-}>();
+// const props = defineProps();
+const props = defineProps(['sn', 'deviceInfo'])
-const store = useMyStore();
const deviceSetting = ref(cloneDeep(initDeviceSetting));
const deviceSettingFormModelFromOsd = ref(cloneDeep(initDeviceSettingFormModel));
const deviceSettingFormModel = ref(cloneDeep(initDeviceSettingFormModel)); // 真实使用的formModel
@@ -350,18 +343,19 @@
}
);
-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);
+ console.log(body, '顶顶顶顶顶')
await setDeviceProps(props.sn, body);
deviceSetting.value[settingKey].popConfirm.loading = false;
deviceSetting.value[settingKey].popConfirm.visible = false;
@@ -419,6 +413,12 @@
font-weight: 700;
}
}
+ .control-setting-item-right {
+ .el-tooltip__trigger {
+ color: #1C5CFF;
+ cursor: pointer;
+ }
+ }
}
}
}
--
Gitblit v1.9.3