Commit 0c05bf72568383b43a2f25defe748e5dcc6f9707
Merge branch 'fix/DEFECT-1834' into 'main_dev'
fix: 修复图片组件接受值为空时图片会覆盖图片 See merge request yunteng/thingskit-front!1132
Showing
1 changed file
with
2 additions
and
0 deletions
| @@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
| 5 | import { ComponentPropsConfigType } from '../../../index.type'; | 5 | import { ComponentPropsConfigType } from '../../../index.type'; |
| 6 | import { useDataFetch } from '../../../hook/socket/useSocket'; | 6 | import { useDataFetch } from '../../../hook/socket/useSocket'; |
| 7 | import { DataFetchUpdateFn } from '../../../hook/socket/useSocket.type'; | 7 | import { DataFetchUpdateFn } from '../../../hook/socket/useSocket.type'; |
| 8 | + import { isNullOrUnDef } from '/@/utils/is'; | ||
| 8 | 9 | ||
| 9 | const props = defineProps<{ | 10 | const props = defineProps<{ |
| 10 | config: ComponentPropsConfigType; | 11 | config: ComponentPropsConfigType; |
| @@ -42,6 +43,7 @@ | @@ -42,6 +43,7 @@ | ||
| 42 | const { data = {} } = message; | 43 | const { data = {} } = message; |
| 43 | const [latest] = data[attribute] || []; | 44 | const [latest] = data[attribute] || []; |
| 44 | const [timespan, value] = latest; | 45 | const [timespan, value] = latest; |
| 46 | + if (isNullOrUnDef(value)) return; | ||
| 45 | time.value = timespan; | 47 | time.value = timespan; |
| 46 | url.value = `${value}?timespan=${timespan}`; | 48 | url.value = `${value}?timespan=${timespan}`; |
| 47 | }; | 49 | }; |