Showing
3 changed files
with
70 additions
and
45 deletions
| 1 | /* | 1 | /* |
| 2 | * @Date: 2023-06-30 16:48:58 | 2 | * @Date: 2023-06-30 16:48:58 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-06-30 17:09:30 | 4 | + * @LastEditTime: 2023-07-04 17:26:20 |
| 5 | * @FilePath: /map-demo/src/common/max.js | 5 | * @FilePath: /map-demo/src/common/max.js |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | */ | 7 | */ |
| ... | @@ -477,12 +477,18 @@ const testInfo = [ | ... | @@ -477,12 +477,18 @@ const testInfo = [ |
| 477 | icon: 'https://cdn.ipadbiz.cn/xys/map/%E5%BC%82%E5%B8%B802@2x.png', | 477 | icon: 'https://cdn.ipadbiz.cn/xys/map/%E5%BC%82%E5%B8%B802@2x.png', |
| 478 | details: [ | 478 | details: [ |
| 479 | { | 479 | { |
| 480 | - name: '', | 480 | + name: '预警演示', |
| 481 | - note: '', | 481 | + code: 'Y0218', |
| 482 | - url: '', | 482 | + note: '烟感异常', |
| 483 | + status: '异常', | ||
| 484 | + datetime: '2021-12-22 16:39:42', | ||
| 485 | + cctv_url: '', // 监控链接 | ||
| 486 | + case_url: '1', // 预案链接 | ||
| 487 | + notice_url: '1', // 通知链接 | ||
| 488 | + handle_url: '1', // 处理链接 | ||
| 483 | }, | 489 | }, |
| 484 | ], | 490 | ], |
| 485 | - window_type: 'lite', | 491 | + window_type: 'warn', |
| 486 | }, | 492 | }, |
| 487 | ], | 493 | ], |
| 488 | }, | 494 | }, | ... | ... |
| ... | @@ -4,7 +4,7 @@ | ... | @@ -4,7 +4,7 @@ |
| 4 | <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }"> | 4 | <div :style="{ width: (widow_info.width * 0.8) + 'px', overflow: 'auto' }"> |
| 5 | <div class="hideScrollBar info-window-title"> | 5 | <div class="hideScrollBar info-window-title"> |
| 6 | <div class="checked item"> | 6 | <div class="checked item"> |
| 7 | - <span>{{ info.name }}</span> | 7 | + <span>{{ warn_info.name }}</span> |
| 8 | </div> | 8 | </div> |
| 9 | <div style="width: 66.66%; text-align: right; margin-bottom: 0.75rem; display: inline-block; color: #888; font-size: 0.9rem;"> | 9 | <div style="width: 66.66%; text-align: right; margin-bottom: 0.75rem; display: inline-block; color: #888; font-size: 0.9rem;"> |
| 10 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%BC%82%E5%B8%B8@2x.png" size="1.25rem" | 10 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%BC%82%E5%B8%B8@2x.png" size="1.25rem" |
| ... | @@ -13,12 +13,12 @@ | ... | @@ -13,12 +13,12 @@ |
| 13 | </div> | 13 | </div> |
| 14 | <div> | 14 | <div> |
| 15 | <div style="width: 80%; float: left; color: #888; line-height: 1.75;"> | 15 | <div style="width: 80%; float: left; color: #888; line-height: 1.75;"> |
| 16 | - <div>编号: Y0218</div> | 16 | + <div>编号: {{ warn_info.code }}</div> |
| 17 | - <div>状态: 异常</div> | 17 | + <div>状态: {{ warn_info.status }}</div> |
| 18 | <div> | 18 | <div> |
| 19 | - <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E6%97%B6%E9%97%B4@2x.png" size="1.5rem" | 19 | + <!-- <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E6%97%B6%E9%97%B4@2x.png" size="1.5rem" |
| 20 | - color="#FFF" style="vertical-align: sub;" /> | 20 | + color="#FFF" style="vertical-align: sub;" /> --> |
| 21 | - 2021-12-22 16:39:42 | 21 | + {{ warn_info.datetime }} |
| 22 | </div> | 22 | </div> |
| 23 | </div> | 23 | </div> |
| 24 | <div class="info-control"> | 24 | <div class="info-control"> |
| ... | @@ -26,26 +26,27 @@ | ... | @@ -26,26 +26,27 @@ |
| 26 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E6%92%AD%E6%94%BE%E6%9A%82%E5%81%9C@2x.png" size="3rem" | 26 | <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E6%92%AD%E6%94%BE%E6%9A%82%E5%81%9C@2x.png" size="3rem" |
| 27 | color="#FFF" style="margin-top: 0.5rem;" /> | 27 | color="#FFF" style="margin-top: 0.5rem;" /> |
| 28 | </div> | 28 | </div> |
| 29 | - <div>监控</div> | 29 | + <div @click="goTo(warn_info.cctv_url)">监控</div> |
| 30 | </div> | 30 | </div> |
| 31 | </div> | 31 | </div> |
| 32 | </div> | 32 | </div> |
| 33 | - <div class="van-hairline--top" style="margin: 1rem 0;"> | 33 | + <div class="van-hairline--top" style="margin-top: 1rem; display: flex; justify-content: space-around;"> |
| 34 | - <div @click="goTo()" style="width: 33.33%; float: left; text-align: center; margin-top: 1rem;" | 34 | + <div v-if="warn_info.case_url" @click="goTo(warn_info.case_url)" style="text-align: center; margin-top: 1rem;"> |
| 35 | - class="van-hairline--right"> | 35 | + <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E9%A2%84%E6%A1%88@2x.png" size="1.25rem" color="#FFF" |
| 36 | - <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E9%A2%84%E6%A1%88@2x.png" size="1.5rem" color="#FFF" | ||
| 37 | style="vertical-align: bottom;" /> | 36 | style="vertical-align: bottom;" /> |
| 38 | - <span style="color: #AB8F57; font-size: 1.1rem;">预案</span> | 37 | + <span style="color: #AB8F57; font-size: 1rem;">预案</span> |
| 39 | </div> | 38 | </div> |
| 40 | - <div style="width: 33.33%; float: left; text-align: center; margin-top: 1rem;" class="van-hairline--right"> | 39 | + <div v-if="warn_span1" style="text-align: center; margin-top: 1rem;" class="van-hairline--right"></div> |
| 41 | - <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E9%80%9A%E7%9F%A5@2x.png" size="1.5rem" color="#FFF" | 40 | + <div v-if="warn_info.notice_url" @click="goTo(warn_info.notice_url)" style="text-align: center; margin-top: 1rem;"> |
| 41 | + <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E9%80%9A%E7%9F%A5@2x.png" size="1.25rem" color="#FFF" | ||
| 42 | style="vertical-align: bottom;" /> | 42 | style="vertical-align: bottom;" /> |
| 43 | - <span style="color: #AB8F57; font-size: 1.1rem;">通知</span> | 43 | + <span style="color: #AB8F57; font-size: 1rem;">通知</span> |
| 44 | </div> | 44 | </div> |
| 45 | - <div style="width: 33.33%; float: left; text-align: center; margin-top: 1rem;"> | 45 | + <div v-if="warn_span2" style="text-align: center; margin-top: 1rem;" class="van-hairline--right"></div> |
| 46 | - <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%A4%84%E7%90%86@2x.png" size="1.5rem" color="#FFF" | 46 | + <div v-if="warn_info.handle_url" @click="goTo(warn_info.handle_url)" style="text-align: center; margin-top: 1rem;"> |
| 47 | + <van-icon name="https://cdn.ipadbiz.cn/xys/map/%E5%A4%84%E7%90%86@2x.png" size="1.25rem" color="#FFF" | ||
| 47 | style="vertical-align: bottom;" /> | 48 | style="vertical-align: bottom;" /> |
| 48 | - <span style="color: #AB8F57; font-size: 1.1rem;">处理</span> | 49 | + <span style="color: #AB8F57; font-size: 1rem;">处理</span> |
| 49 | </div> | 50 | </div> |
| 50 | </div> | 51 | </div> |
| 51 | </div> | 52 | </div> |
| ... | @@ -90,25 +91,38 @@ export default { | ... | @@ -90,25 +91,38 @@ export default { |
| 90 | }, | 91 | }, |
| 91 | mounted() { | 92 | mounted() { |
| 92 | }, | 93 | }, |
| 94 | + computed: { | ||
| 95 | + warn_span1 () { | ||
| 96 | + const raw = [this.warn_info.case_url, this.warn_info.notice_url, this.warn_info.handle_url] | ||
| 97 | + const count = raw.filter(item => item) | ||
| 98 | + return count.length > 1 ; | ||
| 99 | + }, | ||
| 100 | + warn_span2 () { | ||
| 101 | + const raw = [this.warn_info.case_url, this.warn_info.notice_url, this.warn_info.handle_url] | ||
| 102 | + const count = raw.filter(item => item) | ||
| 103 | + return count.length > 2; | ||
| 104 | + }, | ||
| 105 | + }, | ||
| 93 | watch: { | 106 | watch: { |
| 94 | rect(val) { | 107 | rect(val) { |
| 95 | this.widow_info = val; | 108 | this.widow_info = val; |
| 96 | }, | 109 | }, |
| 97 | infoWindow(val) { | 110 | infoWindow(val) { |
| 98 | if (val) { | 111 | if (val) { |
| 99 | - // 加载录音 | 112 | + this.warn_info = this.info.details[0] |
| 100 | - this.audio.src = this.info?.details[this.isActive]['audio']; | 113 | + // // 加载录音 |
| 101 | - let play_status = this.audio.play() // 播放 | 114 | + // this.audio.src = this.info?.details[this.isActive]['audio']; |
| 102 | - if (play_status) { | 115 | + // let play_status = this.audio.play() // 播放 |
| 103 | - play_status.then(() => { | 116 | + // if (play_status) { |
| 104 | - // 音频的播放需要耗时 | 117 | + // play_status.then(() => { |
| 105 | - this.audio.pause(); | 118 | + // // 音频的播放需要耗时 |
| 106 | - this.play_time = this.getAudioTime(this.audio.duration) | 119 | + // this.audio.pause(); |
| 107 | - }).catch((e) => { | 120 | + // this.play_time = this.getAudioTime(this.audio.duration) |
| 108 | - // 失败 | 121 | + // }).catch((e) => { |
| 109 | - console.log('Operation is too fast, audio play fails') | 122 | + // // 失败 |
| 110 | - }) | 123 | + // console.log('Operation is too fast, audio play fails') |
| 111 | - } | 124 | + // }) |
| 125 | + // } | ||
| 112 | } | 126 | } |
| 113 | } | 127 | } |
| 114 | }, | 128 | }, |
| ... | @@ -125,6 +139,7 @@ export default { | ... | @@ -125,6 +139,7 @@ export default { |
| 125 | play_time: '00:00', | 139 | play_time: '00:00', |
| 126 | isActive: 0, | 140 | isActive: 0, |
| 127 | nav_scroll: false, | 141 | nav_scroll: false, |
| 142 | + warn_info: {} | ||
| 128 | } | 143 | } |
| 129 | }, | 144 | }, |
| 130 | methods: { | 145 | methods: { |
| ... | @@ -164,12 +179,12 @@ export default { | ... | @@ -164,12 +179,12 @@ export default { |
| 164 | // 滚动状态 | 179 | // 滚动状态 |
| 165 | this.nav_scroll = false; | 180 | this.nav_scroll = false; |
| 166 | }, | 181 | }, |
| 167 | - showDetail() { | 182 | + // showDetail() { |
| 168 | - this.show_popup = true; | 183 | + // this.show_popup = true; |
| 169 | - this.popup_title = '三宝楼'; | 184 | + // this.popup_title = '三宝楼'; |
| 170 | - this.popup_content = '尊敬的游客朋友们您好,欢迎来到西园寺,您现在所到的地方是“三宝楼......'; | 185 | + // this.popup_content = '尊敬的游客朋友们您好,欢迎来到西园寺,您现在所到的地方是“三宝楼......'; |
| 171 | - this.video_src = 'https://video.pearvideo.com/mp4/short/20200209/cont-1650197-14888002-hd.mp4' | 186 | + // this.video_src = 'https://video.pearvideo.com/mp4/short/20200209/cont-1650197-14888002-hd.mp4' |
| 172 | - }, | 187 | + // }, |
| 173 | play() { | 188 | play() { |
| 174 | this.voice_play(this.info.details[this.isActive]['audio'], 0) | 189 | this.voice_play(this.info.details[this.isActive]['audio'], 0) |
| 175 | }, | 190 | }, |
| ... | @@ -209,7 +224,7 @@ export default { | ... | @@ -209,7 +224,7 @@ export default { |
| 209 | this.is_play = false; | 224 | this.is_play = false; |
| 210 | }, | 225 | }, |
| 211 | goTo(url) { | 226 | goTo(url) { |
| 212 | - location.href = this.info.details[this.isActive].url; | 227 | + location.href = url; |
| 213 | }, | 228 | }, |
| 214 | handleTitle(index) { | 229 | handleTitle(index) { |
| 215 | this.isActive = index; | 230 | this.isActive = index; | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2023-05-19 14:54:27 | 2 | * @Date: 2023-05-19 14:54:27 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2023-07-04 15:09:26 | 4 | + * @LastEditTime: 2023-07-04 16:47:51 |
| 5 | * @FilePath: /map-demo/src/views/index.vue | 5 | * @FilePath: /map-demo/src/views/index.vue |
| 6 | * @Description: 地图主体页面 | 6 | * @Description: 地图主体页面 |
| 7 | --> | 7 | --> |
| ... | @@ -226,6 +226,7 @@ export default { | ... | @@ -226,6 +226,7 @@ export default { |
| 226 | } | 226 | } |
| 227 | }, | 227 | }, |
| 228 | mounted() { | 228 | mounted() { |
| 229 | + // console.log(this.$route.query); | ||
| 229 | this.navBarList = map_max; // 底部导航条 | 230 | this.navBarList = map_max; // 底部导航条 |
| 230 | this.navKey = map_max[0]['key']; // 默认选中 第一个 key | 231 | this.navKey = map_max[0]['key']; // 默认选中 第一个 key |
| 231 | this.navList = map_max.filter(item => item.key === this.navKey)[0]['entity_info']; // 返回默认选中项的实体信息 | 232 | this.navList = map_max.filter(item => item.key === this.navKey)[0]['entity_info']; // 返回默认选中项的实体信息 |
| ... | @@ -350,8 +351,10 @@ export default { | ... | @@ -350,8 +351,10 @@ export default { |
| 350 | // 不同弹框类型 | 351 | // 不同弹框类型 |
| 351 | if (entity_info[i].window_type === 'normal') { | 352 | if (entity_info[i].window_type === 'normal') { |
| 352 | this.positionMarker(entity_info[i]) | 353 | this.positionMarker(entity_info[i]) |
| 353 | - } else { | 354 | + } else if(entity_info[i].window_type === 'lite') { |
| 354 | this.positionLiteMarker(entity_info[i]) | 355 | this.positionLiteMarker(entity_info[i]) |
| 356 | + } else if (entity_info[i].window_type === 'warn') { | ||
| 357 | + this.positionWarnMarker(entity_info[i]) | ||
| 355 | } | 358 | } |
| 356 | }) | 359 | }) |
| 357 | // marker合集 | 360 | // marker合集 |
| ... | @@ -750,6 +753,7 @@ export default { | ... | @@ -750,6 +753,7 @@ export default { |
| 750 | }); | 753 | }); |
| 751 | }, | 754 | }, |
| 752 | positionWarnMarker(item) { | 755 | positionWarnMarker(item) { |
| 756 | + console.log(item); | ||
| 753 | // 点击后创建自定义信息窗口 | 757 | // 点击后创建自定义信息窗口 |
| 754 | this.setInfoWindowsWarn(item) | 758 | this.setInfoWindowsWarn(item) |
| 755 | // 把地图中心点设置为当前点击的标记点 | 759 | // 把地图中心点设置为当前点击的标记点 | ... | ... |
-
Please register or login to post a comment