bihuisong 10 månader sedan
förälder
incheckning
1bda92c3bb
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. 7 1
      zhsq_qk-ui/src/views/fusion/aqyj.vue

+ 7 - 1
zhsq_qk-ui/src/views/fusion/aqyj.vue

@@ -88,7 +88,7 @@
           <div class="qkq_tit">监测预警</div>
           <div class="qkq_tit">监测预警</div>
           <ul class="qkq_csnl scrollbar">
           <ul class="qkq_csnl scrollbar">
             <li  v-for="(item, index) in eventData" :key="index">
             <li  v-for="(item, index) in eventData" :key="index">
-              <h4><span class="blue">【{{ item.warnTypeName }}】</span>{{ item.warnAddress}}</h4>
+              <h4><span class="blue">【{{ item.warnTypeName }}】</span>{{ truncateText(item.warnAddress, 10)}}</h4>
               <p>预警事件:{{ item.warnEvent}}</p>
               <p>预警事件:{{ item.warnEvent}}</p>
               <p>预警时间:{{ item.warnTime}}</p>
               <p>预警时间:{{ item.warnTime}}</p>
             </li>
             </li>
@@ -214,6 +214,12 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+    truncateText(text, maxLength) {
+      if (text.length > maxLength) {
+        return text.substring(0, maxLength) + '...';
+      }
+      return text;
+    },
     handleClick() {
     handleClick() {
       this.$refs.supermap.clearM()
       this.$refs.supermap.clearM()
       let that = this;
       let that = this;