Commit 04400b24358517f0bdbe85b5fd110e5513a1f32c
1 parent
d8f77d93
perf: display location empty placeholder if device detail not has location
Showing
2 changed files
with
16 additions
and
3 deletions
src/assets/icons/location.svg
0 → 100644
1 | +<svg t="1671693733059" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25398" width="200" height="200"><path d="M585.290213 343.524914c0-37.136805-33.106002-67.357084-73.789587-67.357084-40.684608 0-73.78754 30.220279-73.78754 67.357084 0 37.120432 33.102932 67.329455 73.78754 67.329455C552.184211 410.854369 585.290213 380.645346 585.290213 343.524914zM467.227284 343.524914c0-22.289656 19.860327-40.417525 44.273343-40.417525 24.415063 0 44.273343 18.127869 44.273343 40.417525 0 22.271236-19.85828 40.389896-44.273343 40.389896C487.087611 383.91481 467.227284 365.79615 467.227284 343.524914zM511.141446 741.92667l11.455913-12.768815c8.013511-8.92937 204.344015-220.213447 203.697285-358.458021-0.506537-111.529119-101.375875-208.420867-214.795041-208.420867-113.923656 0-215.816301 96.907097-215.816301 208.483288 0 138.182153 196.101283 349.432461 204.055442 358.356714L511.141446 741.92667zM511.500627 189.219549c97.206926 0 184.830589 84.850503 185.278797 181.601034 0.517793 109.87034-144.55121 279.638885-185.553043 328.016709-40.799218-48.428989-186.026834-218.179115-186.026834-328.072991C325.199547 274.042423 413.845493 189.219549 511.500627 189.219549zM946.101839 789.395798 832.104505 600.221274c-10.316973-17.114796-30.019711-27.752064-51.421136-27.752064L673.835875 572.46921c-8.156774 0-14.759145 6.03239-14.759145 13.472849 0 7.436366 6.601348 13.46671 14.759145 13.46671l106.848517 0c10.636245 0 20.437471 5.287423 25.566282 13.795191L920.250054 802.37746c5.013177 8.337899 4.856611 18.201547-0.448208 26.380834-5.303796 8.190543-14.699794 13.077853-25.120121 13.077853L128.318504 841.836147c-10.41828 0-19.814278-4.88731-25.119097-13.077853-5.302773-8.179286-5.462408-18.042935-0.446162-26.380834l113.997334-189.174524c5.130857-8.507768 14.930037-13.795191 25.566282-13.795191L349.166401 599.407746c8.15575 0 14.757099-6.030343 14.757099-13.46671 0-7.440459-6.601348-13.472849-14.757099-13.472849L242.317884 572.468187c-21.401426 0-41.10314 10.638291-51.42216 27.752064L76.898391 789.395798c-10.102079 16.758686-9.769504 36.600593 0.89437 53.073776 10.665921 16.476253 29.5582 26.307156 50.526767 26.307156L894.680702 868.776729c20.968567 0 39.862893-9.830903 50.528813-26.307156C955.87339 825.99639 956.204941 806.154483 946.101839 789.395798z" fill="#bfbfbf" p-id="25399"></path></svg> | ... | ... |
... | ... | @@ -55,15 +55,23 @@ |
55 | 55 | <a-button type="primary" class="mr-4" @click="manageDeviceToken">管理设备凭证</a-button> |
56 | 56 | <ManageDeviceTokenModal @register="registerModal" /> |
57 | 57 | </div> |
58 | - <div v-if="deviceDetail?.deviceInfo?.address" class="mt-4"> | |
58 | + <div class="mt-4"> | |
59 | 59 | <p>设备位置</p> |
60 | - <div ref="mapWrapRef" style="height: 550px; width: 100%"></div> | |
60 | + <div v-if="deviceDetail?.deviceInfo?.address"> | |
61 | + <div ref="mapWrapRef" style="height: 550px; width: 100%"></div> | |
62 | + </div> | |
63 | + <Empty | |
64 | + v-if="!deviceDetail?.deviceInfo?.address" | |
65 | + :image="locationImage" | |
66 | + imageStyle="display: flex; justify-content: center; height: 150px;" | |
67 | + description="请添加设备地理位置" | |
68 | + /> | |
61 | 69 | </div> |
62 | 70 | </div> |
63 | 71 | </template> |
64 | 72 | <script lang="ts"> |
65 | 73 | import { defineComponent, ref, unref, nextTick } from 'vue'; |
66 | - import { Image, Tooltip } from 'ant-design-vue'; | |
74 | + import { Empty, Image, Tooltip } from 'ant-design-vue'; | |
67 | 75 | import { descSchema } from '../../config/detail.config'; |
68 | 76 | import { useAsyncScript } from '/@/hooks/web/useAsyncScript'; |
69 | 77 | import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard'; |
... | ... | @@ -78,6 +86,8 @@ |
78 | 86 | |
79 | 87 | import wz from '/@/assets/images/wz.png'; |
80 | 88 | import { useAsyncQueue } from '../../../localtion/useAsyncQueue'; |
89 | + import locationImage from '/@/assets/icons/location.svg'; | |
90 | + | |
81 | 91 | export default defineComponent({ |
82 | 92 | components: { |
83 | 93 | Image, |
... | ... | @@ -86,6 +96,7 @@ |
86 | 96 | QuestionCircleOutlined, |
87 | 97 | BasicModal, |
88 | 98 | Tooltip, |
99 | + Empty, | |
89 | 100 | }, |
90 | 101 | props: { |
91 | 102 | deviceDetail: { |
... | ... | @@ -197,6 +208,7 @@ |
197 | 208 | DeviceTypeEnum, |
198 | 209 | copyTopic, |
199 | 210 | remoteConnectiondGateway, |
211 | + locationImage, | |
200 | 212 | }; |
201 | 213 | }, |
202 | 214 | }); | ... | ... |