lineInfoWindow.vue 6.66 KB
Newer Older
纪泽龙's avatar
纪泽龙 committed
1 2 3 4 5 6 7 8 9
<template>
  <div class="wrapper">
    <div class="top display-default">
      <div class="left text">{{ obj.pipeName }}</div>
      <div class="right text">
        <img @click="close" src="../../assets/images/closeBtn.png" alt="" />
      </div>
    </div>

纪泽龙's avatar
纪泽龙 committed
10
    <!-- 报警设备信息 -->
纪泽龙's avatar
纪泽龙 committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
    <div class="content">
      <div class="eq-content display-default">
        <div class="text-wrapper">
          <!-- <div :title="obj.pipeName" class="eq-text">
          <span>管道名称:</span>
          <span>{{ obj.pipeName }}</span>
        </div> -->
          <div class="eq-text">
            <span>管道编号:</span>
            <span>{{ obj.pipeCode }} </span>
          </div>
          <div class="eq-text">
            <span>管道长度:</span>
            <span>{{ `${obj.pipeLength ? obj.pipeLength + "米" : ""}` }}</span>
          </div>
          <div class="eq-text">
            <span>管道类型:</span>
            <span>{{ ["地埋管线", "地表管线"][obj.pipeType - 1] }}</span>
          </div>
          <div class="eq-text">
            <span>管道压力:</span>
            <span>{{
              ["低压", "中压", "次高压", "高压"][obj.pipePressure - 1]
            }}</span>
          </div>
        </div>

        <div class="pic">
39
          <img @mousedown.stop="mousedown" :src="obj.iconUrl" alt="" />
纪泽龙's avatar
纪泽龙 committed
40
          <el-image
41
            v-show="false"
纪泽龙's avatar
纪泽龙 committed
42 43 44 45 46 47 48 49 50 51
            id="img"
            ref="previewImg"
            :src="obj.iconUrl"
            :preview-src-list="bigImageArr"
            :z-index="9999999"
          ></el-image>
        </div>
      </div>

      <div class="maintain-content">
52 53 54 55 56 57 58 59 60 61
        <el-col :span="11">
          <div>
            <span>安装日期:</span>
            <span>{{ moment(obj.installationTime).format("YYYY-MM-DD") }}</span>
          </div>
        </el-col>

        <el-col :span="13">
          <div>
            <span>最后巡检日期:</span>
纪泽龙's avatar
纪泽龙 committed
62
            <span>{{ obj.inspectionTime ? obj.inspectionTime : "-" }}</span>
63 64 65
          </div>
        </el-col>

纪泽龙's avatar
纪泽龙 committed
66 67 68 69
        <div>
          <span>管道所在地址:</span>
          <span>{{ obj.pipeAddr }}</span>
        </div>
纪泽龙's avatar
纪泽龙 committed
70
        <div style="padding: 0">
纪泽龙's avatar
纪泽龙 committed
71 72 73 74 75 76 77
          <span>备注信息:</span>
          <span>{{ obj.remarks }} </span>
        </div>
      </div>
    </div>

    <!-- 报警状态 -->
纪泽龙's avatar
纪泽龙 committed
78 79 80 81 82 83
    <div class="warn-wrapper" v-if="true">
      <!-- <div class="warn-content">
        <div>报警状态:<span>报警</span></div>
        <div>详细信息:<span>管线两端设备压差较大,管线可能泄漏</span></div>
      </div> -->
      <div class="btn">
纪泽龙's avatar
纪泽龙 committed
84 85 86 87
        <span @mousedown.stop="deviceMore">
          <el-button class="elbtn" type="primary">设备详情</el-button>
        </span>

纪泽龙's avatar
纪泽龙 committed
88 89 90
        <!-- <el-button class="elbtn" type="primary">生成工单</el-button> -->
      </div>
    </div>
纪泽龙's avatar
纪泽龙 committed
91 92 93 94 95 96 97 98 99 100 101
  </div>
</template>

<script>
//line移入时的的infowindow
import moment from "moment";
export default {
  props: {
    obj: { typs: Object },
  },
  created() {
纪泽龙's avatar
纪泽龙 committed
102
    // console.log("created", this.obj);
纪泽龙's avatar
纪泽龙 committed
103
  },
104
  mounted() {},
纪泽龙's avatar
纪泽龙 committed
105 106
  computed: {
    bigImageArr() {
107
      return [this.obj.iconUrl];
纪泽龙's avatar
纪泽龙 committed
108 109 110 111
    },
  },
  methods: {
    moment,
112
    mousedown(e) {
纪泽龙's avatar
纪泽龙 committed
113
      // console.log("?");
114 115 116 117 118 119 120 121 122 123 124 125 126 127
      return;
      // console.log(this.$refs.previewImg)
      this.$refs.previewImg.showViewer = true;
      console.log(this.$refs.previewImg.showViewer);
      // 加载出来的dom给个事件阻止冒泡
      setTimeout(() => {
        const dom = document.getElementsByClassName(
          "el-image-viewer__wrapper"
        )[0];
        dom.addEventListener("mousedown", (e) => {
          e.stopPropagation();
          console.log("?");
        });
      });
纪泽龙's avatar
纪泽龙 committed
128 129 130 131
    },
    close() {
      this.obj.polyline.infoWindow.close();
    },
纪泽龙's avatar
纪泽龙 committed
132 133 134
    deviceMore() {
      console.log(this.obj.polyline.getExtData().lineData)
      this.obj.polyline.getExtData().class.view.$router.push({
135
        path: "/dataMonitoring/realtimedetail",
纪泽龙's avatar
纪泽龙 committed
136
        query: {
纪泽龙's avatar
纪泽龙 committed
137
          deviceId: this.obj.polyline.getExtData().lineData.pipeId,
138 139
          //这里是传数字
          deviceType:"0",
纪泽龙's avatar
纪泽龙 committed
140 141 142
        },
      });
    },
纪泽龙's avatar
纪泽龙 committed
143 144 145 146 147 148 149
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  width: 406px;
纪泽龙's avatar
纪泽龙 committed
150
  max-height: 430px;
纪泽龙's avatar
纪泽龙 committed
151 152 153
  background: #fff;
  border-radius: 4px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
纪泽龙's avatar
纪泽龙 committed
154
  overflow: hidden;
纪泽龙's avatar
纪泽龙 committed
155 156 157
  .top {
    width: 100%;
    height: 51px;
纪泽龙's avatar
纪泽龙 committed
158
    background-color: #053b6a;
纪泽龙's avatar
纪泽龙 committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    .text {
      font-weight: 600;
      font-size: 16px;
      color: #ffffff;
      line-height: 51px;
    }
    .left {
      padding-left: 22px;
    }
    .right {
      padding-right: 22px;
      img {
        cursor: pointer;
      }
    }
  }
  .content {
    position: relative;
纪泽龙's avatar
纪泽龙 committed
177
    max-height: 300px;
纪泽龙's avatar
纪泽龙 committed
178 179
    overflow: hidden;
    overflow-y: auto;
纪泽龙's avatar
纪泽龙 committed
180 181
    padding-bottom: 2px;
    border-bottom: 1px solid #eeeeee;
纪泽龙's avatar
纪泽龙 committed
182
    .eq-content {
183
      // min-height: 156px;
纪泽龙's avatar
纪泽龙 committed
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
      box-sizing: border-box;
      padding: 13px 22px 0px 22px;
      // border-bottom: 1px solid #e2e2e2;
      .text-wrapper {
        padding-top: 1px;
        & > div {
          margin-bottom: 6px;
        }
        .eq-text {
          font-size: 14px;
          font-weight: 400;
          color: #1d1d1d;
          opacity: 1;
          & > span {
            vertical-align: top;
            display: inline-block;
            // white-space: nowrap;
            // text-overflow: ellipsis;
            // overflow: hidden;
            word-break: break-all;
            max-width: 100px;
          }
        }
      }
      .pic {
209 210
        width: 180px;
        height: 103px;
纪泽龙's avatar
纪泽龙 committed
211
        // background-color: black;
212
        img {
纪泽龙's avatar
纪泽龙 committed
213 214
          width: 100%;
          height: 100%;
215
          // cursor: pointer;
纪泽龙's avatar
纪泽龙 committed
216 217 218 219 220 221 222
        }
      }
    }
  }

  .maintain-content {
    width: 100%;
223
    max-height: 119px;
纪泽龙's avatar
纪泽龙 committed
224
    padding-left: 22px;
225
    // padding-right: 22px;
纪泽龙's avatar
纪泽龙 committed
226
    // padding-bottom: 10px;
纪泽龙's avatar
纪泽龙 committed
227 228 229 230 231 232 233 234 235 236 237
    // padding-top: 16px;
    box-sizing: border-box;
    // border-bottom: 1px solid #e2e2e2;
    & > div {
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 400;
      span {
        vertical-align: top;
        display: inline-block;
        word-break: break-all;
238
        max-width: 280px;
纪泽龙's avatar
纪泽龙 committed
239 240 241
      }
    }
  }
纪泽龙's avatar
纪泽龙 committed
242 243 244 245 246
  .warn-wrapper {
    .warn-content {
      box-sizing: border-box;
      padding: 10px 0 2px 22px;
      border-bottom: 1px solid #e2e2e2;
纪泽龙's avatar
纪泽龙 committed
247
      color: #fe5966;
纪泽龙's avatar
纪泽龙 committed
248 249 250 251 252
      & > div {
        font-size: 14px;
        font-weight: 400;
        margin-bottom: 8px;
      }
纪泽龙's avatar
纪泽龙 committed
253
    }
纪泽龙's avatar
纪泽龙 committed
254 255 256 257 258 259 260 261 262
    .btn {
      padding: 16px 0;
      text-align: center;
      .elbtn {
        background-color: #053b6a;
        box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
        width: 95px;
        height: 33px;
      }
纪泽龙's avatar
纪泽龙 committed
263 264 265 266 267 268 269 270 271 272 273
    }
  }
}

.wrapperEditorPage {
}
.display-default {
  display: flex;
  justify-content: space-between;
}
</style>