Pre Merge pull request !825 from zhb/feature/iot

pull/825/MERGE
zhb 2025-09-30 03:19:31 +00:00 committed by Gitee
commit ec5ddc0f39
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 15 additions and 2 deletions

View File

@ -406,7 +406,17 @@ const selectedIds = ref<number[]>([]) // 选中的设备编号数组
const viewMode = ref<'card' | 'list'>('card') // const viewMode = ref<'card' | 'list'>('card') //
const defaultPicUrl = ref('/src/assets/imgs/iot/device.png') // const defaultPicUrl = ref('/src/assets/imgs/iot/device.png') //
const defaultIconUrl = ref('/src/assets/svgs/iot/card-fill.svg') // const defaultIconUrl = ref('/src/assets/svgs/iot/card-fill.svg') //
const route = useRoute()
/** 监听传过来的参数 */
const stopWatch = watch(
() => route.query.productId,
(newId) => {
if (newId) {
queryParams.productId = Number(newId) as any
}
},
{ immediate: true }
)
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -520,4 +530,7 @@ onMounted(async () => {
// //
deviceGroups.value = await DeviceGroupApi.getSimpleDeviceGroupList() deviceGroups.value = await DeviceGroupApi.getSimpleDeviceGroupList()
}) })
onBeforeUnmount(() => {
stopWatch.stop()
})
</script> </script>

View File

@ -72,7 +72,7 @@ const copyToClipboard = async (text: string) => {
/** 路由跳转到设备管理 */ /** 路由跳转到设备管理 */
const { push } = useRouter() const { push } = useRouter()
const goToDeviceList = (productId: number) => { const goToDeviceList = (productId: number) => {
push({ name: 'IoTDevice', params: { productId } }) push({ name: 'IoTDevice', query: { productId } })
} }
/** 修改操作 */ /** 修改操作 */