Bladeren bron

修改首页

“yueshang” 1 jaar geleden
bovenliggende
commit
a132129e9a
4 gewijzigde bestanden met toevoegingen van 24 en 19 verwijderingen
  1. 1 0
      src/api/system/index.js
  2. BIN
      src/assets/images/org-icon.png
  3. 21 17
      src/views/index.vue
  4. 2 2
      vue.config.js

+ 1 - 0
src/api/system/index.js

@@ -21,3 +21,4 @@ export function indexInfo(query) {
     params: query
   })
 }
+// sqxhrmvfnPaA2yS0gmceKfCrL8T3hhIV

BIN
src/assets/images/org-icon.png


+ 21 - 17
src/views/index.vue

@@ -69,7 +69,7 @@
         <!-- ../assets/images/org-icon.png -->
         <!-- mapStyle="mapStyle" 地图样式 anchor="BMAP ANCHOR TOP RIGHT" 比例尺-->
         <baidu-map
-          ak="sqxhrmvfnPaA2yS0gmceKfCrL8T3hhIV"
+          ak=""
           :center="center"
           :zoom="zoom"
           :scroll-wheel-zoom="true"
@@ -86,16 +86,17 @@
             @click="infoWindowOpen(marker)"
             v-for="(marker, index) of topData.info"
             :key="index"
-            :position="{ lng: marker.lng, lat: marker.lat }"
+            :position="{ lng: 104.069, lat:30.659}"
             :icon="{
               url: require('@/assets/images/org-icon.png'),
               size: { width: 150, height: 157 },
             }"
             @mouseout="infoWindowClose"
           >
-            <!-- 弹框 -->
+            <!-- 弹框 selectedMarker == marker || -->
             <bm-info-window
-              :show="selectedMarker == marker || show"
+              :style="{ top: '-180px', left: '0' }"
+              :show="show"
               @close="infoWindowClose"
               @open="infoWindowOpen(marker)"
               @mouseout="infoWindowClose"
@@ -169,7 +170,7 @@
           />
           <div class="real-signal">
             <div>
-              <div class="title">实时信号</div>
+              <div class="title">恶意动态</div>
               <div
                 class="cont"
                 @click="lookPosition(items)"
@@ -178,7 +179,7 @@
               >
                 <span class="positions"
                   ><img src="../assets/images/MapPin.png" alt="" /><span
-                    >查看位置</span
+                    >位置</span
                   ></span
                 >
                 <span class="realname">{{ items.type }}</span>
@@ -233,7 +234,6 @@ export default {
     };
   },
   created() {
-    // console.log('first', this.dict.getDictValue())
     this.$nextTick(() => {
       this.wheight = document.getElementById("contbody").clientHeight;
     });
@@ -247,6 +247,7 @@ export default {
     }, 5 * 60 * 1000);
     setInterval(() => {
       this.realTimeInfo();
+      this.show = true;
     }, 1 * 60 * 1000);
   },
   methods: {
@@ -254,13 +255,19 @@ export default {
     realTimeInfo() {
       realTimeInfo().then((res) => {
         this.realTimeData = res;
+        this.$forceUpdate();
       });
     },
     lookPosition(items) {
       //查看位置
-      this.center = { lng: items.lng, lat: items.lat };
-      console.log(items, "22222");
+      this.$nextTick(() => {
+        this.center = { lng: 104.064856, lat: 30.658876 };
+        this.$nextTick(() => {
+          this.center = { lng: items.lng, lat: items.lat };
+        });
+      });
       this.show = true;
+      console.log("this.center", this.center);
     },
     //选择周,天。。。
     choiceTime(selectedValue) {
@@ -273,23 +280,20 @@ export default {
     //自定义时间
     checkDrillDate() {
       console.log("drillDate", this.drillDate);
-      this.start = this.drillDate?this.drillDate[0]:"";
-      this.end = this.drillDate?this.drillDate[1]:"";
-      this.selectedValue=this.drillDate?"6":"1"
-      this.$forceUpdate()
+      this.start = this.drillDate ? this.drillDate[0] : "";
+      this.end = this.drillDate ? this.drillDate[1] : "";
+      this.selectedValue = this.drillDate ? "6" : "1";
       this.getInfo();
     },
     //关闭点位
     infoWindowClose() {
       this.selectedMarker = null;
       this.show = false;
-      this.$forceUpdate();
     },
     //点击得到点位信息
     infoWindowOpen(marker) {
       this.selectedMarker = marker;
-      // this.show = true;
-
+      this.show = true;
     },
     goDevice() {
       //去设备
@@ -317,7 +321,7 @@ export default {
         end: this.end,
       }).then((response) => {
         this.topData = response;
-        this.$modal.msgSuccess('加载成功')
+        this.$modal.msgSuccess("加载成功");
         console.log("response", response);
       });
     },

+ 2 - 2
vue.config.js

@@ -35,8 +35,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target:`http://8.142.173.95:19527`,
-        // target:`http://192.168.2.215:8080`,
+        // target:`http://8.142.173.95:19527`,
+        target:`http://192.168.1.21:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''