Pre Merge pull request !825 from zhb/feature/iot
commit
ec5ddc0f39
|
|
@ -406,7 +406,17 @@ const selectedIds = ref<number[]>([]) // 选中的设备编号数组
|
|||
const viewMode = ref<'card' | 'list'>('card') // 视图模式状态
|
||||
const defaultPicUrl = ref('/src/assets/imgs/iot/device.png') // 默认设备图片
|
||||
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 () => {
|
||||
loading.value = true
|
||||
|
|
@ -520,4 +530,7 @@ onMounted(async () => {
|
|||
// 获取分组列表
|
||||
deviceGroups.value = await DeviceGroupApi.getSimpleDeviceGroupList()
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
stopWatch.stop()
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ const copyToClipboard = async (text: string) => {
|
|||
/** 路由跳转到设备管理 */
|
||||
const { push } = useRouter()
|
||||
const goToDeviceList = (productId: number) => {
|
||||
push({ name: 'IoTDevice', params: { productId } })
|
||||
push({ name: 'IoTDevice', query: { productId } })
|
||||
}
|
||||
|
||||
/** 修改操作 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue