markerInfoWindowWarn.vue 7.96 KB
Newer Older
纪泽龙's avatar
纪泽龙 committed
1 2 3 4 5 6 7 8 9
<template>
  <div class="wrapper">
    <span class="dot-left"></span>
    <div class="top display-default">
      <div class="left text">{{ data.deviceName }}</div>
      <div class="right text">
        <img
          src="../../assets/images/closeBtn.png"
          alt=""
10
          @click="close"
纪泽龙's avatar
纪泽龙 committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24
        />
      </div>
    </div>
    <!-- 设备信息 -->
    <div class="content">
      <div class="eq-content display-default">
        <div class="text-wrapper">
          <div class="eq-text">
            设备类型:<span>{{ title }}</span>
          </div>
          <div class="eq-text">
            设备型号:<span>{{ data.deviceModel }}</span>
          </div>
          <div class="eq-text">
25
            所属管道:<span>{{ data.pipeName }}</span>
纪泽龙's avatar
纪泽龙 committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
          </div>
          <div class="eq-text">
            物联网编号:<span>{{ data.iotNo }}</span>
          </div>
        </div>
        <div class="pic">
          <img v-bind:src="data.iconUrl" alt="" />
        </div>
      </div>
      <!-- 维修人员 -->
      <div class="maintain-content">
        <el-col :span="11">
          <div>
            <span>安装日期:</span>
            <span>{{
              moment(data.installationTime).format("YYYY-MM-DD")
            }}</span>
          </div>
        </el-col>

        <el-col :span="13">
          <div>
            <span>最后巡检日期:</span>
            <span>{{ data.inspectionTime ? data.inspectionTime : "-" }}</span>
          </div>
        </el-col>

        <div>
          <span>管道所在地址:</span>
          <span>{{ data.pipeAddr }}</span>
        </div>
        <div>
          <span>备注信息:</span>
          <span>{{ data.remarks }} </span>
        </div>
      </div>
    </div>

    <!-- 报警状态 -->
    <div class="warn-wrapper" v-if="true">
纪泽龙's avatar
纪泽龙 committed
66
      <div class="warn-content">
纪泽龙's avatar
纪泽龙 committed
67 68 69 70 71 72
        <div>
          报警状态:<span>报警({{ data.alarmType }})</span>
        </div>
        <div>
          详细信息:<span>{{ data.alarmValue ? data.alarmValue : "-" }}</span>
        </div>
纪泽龙's avatar
纪泽龙 committed
73 74 75
        <div v-if="!orderId">
          工单编号:<span>{{ data.orderId }}</span>
        </div>
纪泽龙's avatar
纪泽龙 committed
76
      </div>
纪泽龙's avatar
纪泽龙 committed
77
      <div class="btn">
纪泽龙's avatar
纪泽龙 committed
78
        <span @mousedown.stop="deviceMore">
纪泽龙's avatar
纪泽龙 committed
79 80 81 82 83 84 85 86 87 88
          <el-button class="elbtn" type="primary">设备详情</el-button>
        </span>
        <span v-if="orderId" @mousedown.stop="createWork">
          <el-button
            v-if="title == '压力表' || title == '流量计'"
            class="elbtn"
            type="primary"
            >生成工单</el-button
          >
        </span>
纪泽龙's avatar
纪泽龙 committed
89 90 91
        <span v-else @mousedown.stop="checkWork">
          <el-button class="elbtn" type="primary">查看工单</el-button>
        </span>
纪泽龙's avatar
纪泽龙 committed
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
      </div>
    </div>
  </div>
</template>

<script>
import moment from "moment";
//line移入时的的infowindow
export default {
  props: {
    obj: { typs: Object },
    title: "",
    data: {},
    map: null,
  },
107 108 109 110 111 112 113 114 115 116
  data() {
    return {
      deviceType: {
        1: "调压箱",
        2: "阀门井",
        3: "流量计",
        4: "智能燃气表",
      },
    };
  },
纪泽龙's avatar
纪泽龙 committed
117 118 119 120
  computed: {
    orderId() {
      // 如果已经生成过工单,就不能再次生成了

121
      // return this.data.orderId ? false : true;
纪泽龙's avatar
纪泽龙 committed
122 123 124
      return this.data.orderId ? false : true;
    },
  },
纪泽龙's avatar
纪泽龙 committed
125 126
  methods: {
    moment,
纪泽龙's avatar
纪泽龙 committed
127 128
    createWork() {
      // 控制外层弹框
129
      // console.log(this.data.view.$refs.CreateWork);
纪泽龙's avatar
纪泽龙 committed
130 131
      this.data.view.$refs.CreateWork.alarmId = this.data.alarmId;
      this.data.view.$refs.CreateWork.open = true;
132 133
      this.data.view.$refs.CreateWork.gaoMap = this.data.view.gaoMap;
      // 改变外层回调
纪泽龙's avatar
纪泽龙 committed
134 135 136 137 138
      // this.data.view.CreateWorkCallBack = this.CreateWorkCallBack;
      this.data.view.alarmObjChange({
        alarmId: this.data.alarmId,
        type: "device",
      });
纪泽龙's avatar
纪泽龙 committed
139
    },
140 141 142 143
    close(){
      this.map.clearInfoWindow();
      this.data.class.view.bottomDataShow = true;
    },
纪泽龙's avatar
纪泽龙 committed
144 145 146 147 148 149 150 151 152 153 154 155
    // CreateWorkCallBack(e) {
    //   // console.log("生成工单后传过来的参数", e);
    //   // console.log("markerCallBack");
    //   const marker = this.data.view.gaoMap.markers.filter((item) => {
    //     return item.getExtData().alarmId == this.data.alarmId;
    //   })[0];
    //   console.log("marer.getExtData()", marker.getExtData());
    //   let options = marker.getExtData();
    //   // 暂时传值,到时候回重新刷新
    //   options.orderId = e;
    //   marker.setExtData(options);
    // },
纪泽龙's avatar
纪泽龙 committed
156 157
    deviceMore() {
      this.data.view.$router.push({
158
        path: "/dataMonitoring/alarmdetail",
纪泽龙's avatar
纪泽龙 committed
159 160
        query: {
          alarmId: this.data.alarmId,
161
          dcviceType: this.deviceType[this.data.deviceType],
纪泽龙's avatar
纪泽龙 committed
162 163 164
        },
      });
    },
纪泽龙's avatar
纪泽龙 committed
165 166 167
    // 查看工单
    checkWork() {
      this.data.view.$router.push({
168
        path: "/workOrder/detail",
纪泽龙's avatar
纪泽龙 committed
169 170 171 172 173
        query: {
          orderId: this.data.orderId,
        },
      });
    },
纪泽龙's avatar
纪泽龙 committed
174 175 176
  },
  beforeDestroy() {
    // this.data.view.createWorkOpen = false;
纪泽龙's avatar
纪泽龙 committed
177 178 179 180 181 182 183 184 185 186 187
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  width: 406px;
  max-height: 430px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
188
  // overflow: hidden;
纪泽龙's avatar
纪泽龙 committed
189 190 191
  .top {
    width: 100%;
    height: 51px;
纪泽龙's avatar
纪泽龙 committed
192
    background-color: #ff5a67;
193 194 195 196 197 198 199 200 201 202 203 204 205
     &:before {
      content: "";
      position: absolute;
      left: -20px;
      top: 5px;
      width: 0px;
      height: 0px;
      /* border: 20px solid red; */
      border-top: 15px solid transparent;
      border-bottom: 15px solid transparent;
      /* border-left: 50px solid greenyellow; */
      border-right: 30px solid #ff5a67;
    }
纪泽龙's avatar
纪泽龙 committed
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
    .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;
    max-height: 300px;
    overflow: hidden;
    overflow-y: auto;
    padding-bottom: 2px;
    border-bottom: 1px solid #eeeeee;
    .eq-content {
      // min-height: 156px;
      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 {
        width: 180px;
        height: 103px;
        // background-color: black;
        img {
          width: 100%;
          height: 100%;
          // cursor: pointer;
        }
      }
    }
  }

  .maintain-content {
    width: 100%;
    max-height: 119px;
    padding-left: 22px;
    // padding-right: 22px;
    // padding-bottom: 10px;
    // 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;
        max-width: 280px;
      }
    }
  }
  .warn-wrapper {
    .warn-content {
      box-sizing: border-box;
      padding: 10px 0 2px 22px;
      border-bottom: 1px solid #e2e2e2;
      color: #fe5966;
      & > div {
        font-size: 14px;
        font-weight: 400;
        margin-bottom: 8px;
      }
    }
    .btn {
      padding: 16px 0;
      text-align: center;
纪泽龙's avatar
纪泽龙 committed
304 305 306 307 308 309 310 311 312 313
      span {
        display: inline-block;
        padding: 0 10px;
        .elbtn {
          background-color: #053b6a;
          box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
          width: 95px;
          height: 33px;
          border: none;
        }
纪泽龙's avatar
纪泽龙 committed
314 315 316 317 318 319 320 321 322 323 324 325
      }
    }
  }
}

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