Explorar el Código

部门名称较长时,责任制部门显示串行

JX.LI hace 1 año
padre
commit
7cb7a94513
Se han modificado 2 ficheros con 29 adiciones y 10 borrados
  1. 15 7
      src/views/eventdetailsdialog.vue
  2. 14 3
      src/views/firespread.vue

+ 15 - 7
src/views/eventdetailsdialog.vue

@@ -961,13 +961,14 @@
               v-for="(item, index) in depteventList"
             >
               <div class="bgt-info">
-                <div
-                  class="bgt-info-name"
-                  :class="{ on: iconCurrentIndex == item.deptId }"
-                  @click="dutysystemSelect(item.deptId, item.deptName, item.id)"
-                >
-                  {{ item.deptName }}
-                </div>
+                
+                  <el-tooltip :content="item.deptName" placement="bottom">
+                    <div style="line-height: normal" class="bgt-info-name"
+                      :class="{ on: iconCurrentIndex === item.deptId }"
+                      @click="dutysystemSelect(item.deptId, item.deptName, item.id)">
+                      {{ truncateText(item.deptName, 12) }}
+                    </div>
+                  </el-tooltip>
               </div>
             </div>
           </div>
@@ -3829,6 +3830,13 @@ export default {
       this.regionalFlagObj.array = latlng;
       this.$modal.msgSuccess("获取坐标成功!");
     },
+    truncateText(text, length) {
+      if (text.length <= length) {
+        return text;
+      } else {
+        return text.substr(0, length) + "...";
+      }
+    },
     /** ----------------------------------摄像头预览开始------------------------------------- */
     alertLogin: function () {
       this.$modal.msg("登录中....");

+ 14 - 3
src/views/firespread.vue

@@ -361,9 +361,13 @@
           <div class="bottomLeft">
             <div class="leftItem d-l-con padding-box nowrap" v-for="(item,index) in depteventList">
               <div class="bgt-info">
-                <div class="bgt-info-name" :class="{on:iconCurrentIndex==item.deptId}"
-                     @click="dutysystemSelect(item.deptId,item.deptName,item.id)">{{ item.deptName }}
-                </div>
+                  <el-tooltip :content="item.deptName" placement="bottom">
+                    <div style="line-height: normal" class="bgt-info-name"
+                      :class="{ on: iconCurrentIndex === item.deptId }"
+                      @click="dutysystemSelect(item.deptId, item.deptName, item.id)">
+                      {{ truncateText(item.deptName, 12) }}
+                    </div>
+                  </el-tooltip>
               </div>
             </div>
           </div>
@@ -1444,6 +1448,13 @@ export default {
   //   this.fireControlViewList();
   // },
   methods: {
+    truncateText(text, length) {
+      if (text.length <= length) {
+        return text;
+      } else {
+        return text.substr(0, length) + "...";
+      }
+    },
     showTVWallDiaLog() {
       this.initByCameras();
       // this.$refs.TVWall.showTVWall();