From e911c5fa1f968f5bb88d1ea3f893e285249c5933 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Tue, 22 Mar 2022 09:51:45 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/school-web

---
 src/components/map/components/mapPopup.vue |   75 ++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 34 deletions(-)

diff --git a/src/components/map/components/mapPopup.vue b/src/components/map/components/mapPopup.vue
index c3af8c7..e89003f 100644
--- a/src/components/map/components/mapPopup.vue
+++ b/src/components/map/components/mapPopup.vue
@@ -19,7 +19,7 @@
                                             v-show="introduceText != null && introduceText != ''"
                                             @click="audioPlay"
                                             class="audio-control"
-                                            src="/img/navicon/audio.png"
+                                            :src="audioImgUrl"
                                             alt
                                         />
                                         <img
@@ -473,6 +473,7 @@
             apiUrls: null,
             tabBtnFlag: '教学科研行政',
             QRCodeFlag: false,
+            audioImgUrl: '/img/icon/close-video.png',
             audioSource: '',
             audioFlag: false,
             audioCourse: false,
@@ -481,7 +482,6 @@
             fullscreen: false,
             fullScreenUrl: '/img/icon/bigScreen.png',
             addTagName: '',
-            addTagLayer: null,
             addIconFromcolumn: [
                 // 顺序不要随便换
                 {
@@ -736,15 +736,17 @@
         ])
     },
     created () {
+        var that = this
         this.apiUrls = window.$apiUrls
 
         this.audioSynth = window.speechSynthesis
         this.audioMsg = new window.SpeechSynthesisUtterance()
 
         this.audioMsg.onend = function () {
-            this.audioSynth.cancel()
-            this.audioFlag = false
-            this.audioCourse = false
+            that.audioSynth.cancel()
+            that.audioFlag = false
+            that.audioCourse = false
+            that.audioImgUrl = '/img/icon/close-video.png'
         }
     },
     mounted () {
@@ -787,6 +789,7 @@
                     this.audioSynth.cancel()
                     this.audioFlag = false
                     this.audioCourse = false
+                    this.audioImgUrl = '/img/icon/close-video.png'
                 }
             }
         },
@@ -818,6 +821,7 @@
                         this.audioSynth.cancel()
                         this.audioFlag = false
                         this.audioCourse = false
+                        this.audioImgUrl = '/img/icon/close-video.png'
                     }
                 }
             }
@@ -872,11 +876,20 @@
             // return;
             // this.$store.commit("set_closeMapClick", false); //开启其他操作
             add(d).then(
-                () => {
-                    this.$message({
-                        type: 'success',
-                        message: '操作成功!'
-                    })
+                (res) => {
+                    // console.log(res);
+                    if (res.data.code == 200) {
+                        this.$message({
+                            type: 'success',
+                            message: '操作成功!'
+                        })
+                    } else {
+                        this.$message({
+                            type: 'error',
+                            message: '新增失败!'
+                        })
+                    }
+
                     this.closeaddIconsLayerIconPopup()
                 },
                 (error) => {
@@ -931,6 +944,7 @@
                 this.audioSynth.cancel()
                 this.audioFlag = false
                 this.audioCourse = false
+                this.audioImgUrl = '/img/icon/close-video.png'
             }
 
             // eslint-disable-next-line new-cap
@@ -955,6 +969,7 @@
                 this.audioSynth.cancel()
                 this.audioFlag = false
                 this.audioCourse = false
+                this.audioImgUrl = '/img/icon/close-video.png'
             }
             // eslint-disable-next-line new-cap
             var positions = global.DC.Transform.transformWGS84ToCartesian(
@@ -998,6 +1013,7 @@
                 this.audioSynth.cancel()
                 this.audioFlag = false
                 this.audioCourse = false
+                this.audioImgUrl = '/img/icon/close-video.png'
             }
             this.$store.commit('SET_DETAILSPOPUP', false)
         },
@@ -1023,11 +1039,6 @@
 
             this.$store.commit('SET_ADDTAGPOPUP', false)
 
-            //   if (this.addTagLayer == null) {
-            //     this.addTagLayer = new global.DC.HtmlLayer("addTagLayer");
-            //     global.viewer.addLayer(this.addTagLayer);
-            //   }
-
             // 2022.3.2对接接口
             // 新增标签
             const data = {
@@ -1036,7 +1047,14 @@
                 wd: this.addTagPosition.lat
             }
             //   console.log(data);
+            const oks = setTimeout(() => {
+                that.$message({
+                    message: '新增标签失败',
+                    type: 'warning'
+                })
+            }, 5000)
             setlabel(data).then((res) => {
+                clearTimeout(oks)
                 if (res.data.code == 200) {
                     doit()
                     that.$message({
@@ -1056,24 +1074,6 @@
                     // list: [data],
                     add: true
                 })
-                // const divIcon = new global.DC.DivIcon(
-                //   new global.DC.Position(
-                //     Number(that.addTagPosition.lng),
-                //     Number(that.addTagPosition.lat),
-                //     0
-                //   ),
-                //   `
-                //                 <div class="tag-entitys-box">
-                //                     <div class="tag-content">
-                //                         ${that.addTagName}
-                //                     </div>
-                //                     <div class="tag-angle-content">
-                //                         <img src="https://map.hit.edu.cn/images/tarrow_xq.png">
-                //                     </div>
-                //                 </div>
-                //             `
-                // );
-                // this.addTagLayer.addOverlay(divIcon);
             }
         },
 
@@ -1093,13 +1093,16 @@
                 this.audioSynth.speak(this.audioMsg)
                 this.audioFlag = true
                 this.audioCourse = true
+                this.audioImgUrl = '/img/icon/start-video.png'
             } else {
                 if (this.audioCourse == true) {
                     this.audioSynth.pause()
                     this.audioCourse = false
+                    this.audioImgUrl = '/img/icon/close-video.png'
                 } else {
                     this.audioSynth.resume()
                     this.audioCourse = true
+                    this.audioImgUrl = '/img/icon/start-video.png'
                 }
             }
         },
@@ -1149,7 +1152,11 @@
 
         newPopup (item) {
             const position = global.DC.Transform.transformWGS84ToCartesian(
-                new global.DC.Position(Number(item.jd), Number(item.wd), Number(item.gd))
+                new global.DC.Position(
+                    Number(item.jd),
+                    Number(item.wd),
+                    Number(item.gd)
+                )
             )
             // eslint-disable-next-line no-unused-vars
             var popup = new global.DC.DivForms(global.viewer, {

--
Gitblit v1.9.3