fix: 【IoT 物联网】修复产品详情前往管理跳转后,设备无法筛选分类的
parent
ed84afe06d
commit
7c198ea84c
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -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 } })
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改操作 */
|
/** 修改操作 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue