index.vue 6.09 KB
Newer Older
1 2 3
<template>
  <div class="app-container detail" style="background-color: rgb(238, 241, 245);">
    <div style="padding-top: 10px;background: #fff;height: 100%;">
4 5 6 7 8 9 10 11 12
      <el-row>
        <el-col :span="24" style="padding-left: 15px;">
          <div style="height: 45px;" @click="$router.go(-1)">
            <el-button size="medium" type="text" style="font-size: 18px; color: rgb(7, 63, 112);float: left;">返回
            </el-button>
            <div style="float: left;margin-top: 8px;margin-left: 5px;"><img src="../../../assets/logo/fanhui.png" style="width: 25px;" alt=""></div>
          </div>
        </el-col>
      </el-row>
13

14 15 16 17 18 19 20 21 22 23 24 25
      <el-divider></el-divider>
      <el-row style="width: 100%;">
        <el-col :span="24">
          <div style="color: #31EAEA;height: 25px;">
            <ul><li>详细信息</li></ul>
          </div>
        </el-col> 
      </el-row>

      <el-row style="width: 100%;padding: 10px;padding-left: 40px;">
        <el-col :span="5">
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="width: 100%;">
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
            <el-form-item label="设备名称:" prop="deviceName">
              <font>{{form.deviceName}}</font>
            </el-form-item>
            <el-form-item label="设备编号:" prop="deviceCode">
              <font>{{form.deviceCode}}</font>
            </el-form-item>
            <el-form-item label="设备类型:" prop="deviceType">
              <font v-if="form.deviceType == 1">调压阀</font>
              <font v-if="form.deviceType == 2">阀门井</font>
              <font v-if="form.deviceType == 3">流量计</font>
              <font v-if="form.deviceType == 4">压力表</font>
            </el-form-item>
            <el-form-item label="设备型号:" prop="deviceModel">
              <font>{{form.deviceModel}}</font>
            </el-form-item>
41
            <el-form-item label="物联网编号:" prop="iotNo">
42 43 44 45 46 47 48 49 50 51 52 53
              <font>{{form.iotNo}}</font>
            </el-form-item>
            <el-form-item label="联系人:" prop="linkman">
              <font>{{form.linkman}}</font>
            </el-form-item>
            <el-form-item label="联系电话:" prop="phone">
              <font>{{form.phone}}</font>
            </el-form-item>
            <el-form-item label="备注信息:" prop="remarks">
              <font>{{form.remarks}}</font>
            </el-form-item>
          </el-form>
54 55 56
        </el-col>
        <el-col :span="6">
          <el-form ref="form" v-model="form" :rules="rules" label-width="100px" style="width: 100%;">
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
            <el-form-item label="所属管道:" prop="pipeName">
              <font>{{form.pipeName}}</font>
            </el-form-item>
            <el-form-item label="所在地址:" prop="deviceAddr">
              <font>{{form.deviceAddr}}</font>
            </el-form-item>
            <el-form-item label="经度:" prop="longitude">
              <font>{{form.longitude}}</font>
            </el-form-item>
            <el-form-item label="经度:" prop="latitude">
              <font>{{form.latitude}}</font>
            </el-form-item>
            <el-form-item label="安装时间:" prop="installationTime">
              <font>{{form.installationTime}}</font>
            </el-form-item>
            <el-form-item label="最后巡检时间:" prop="inspectionTime">
              <font>{{form.inspectionTime}}</font>
            </el-form-item>
            <el-form-item label="设备图片:" prop="inspectionTime">
              <el-image :src="form.iconUrl" :preview-src-list="[form.iconUrl]" style="width: 90px;"></el-image>
            </el-form-item>
          </el-form>
79 80 81 82 83 84 85 86 87 88 89 90
        </el-col>
        <el-col :span="11">
          <div id="marbox" style="width: 100%;height: 390px;margin-top: -35px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
            <div style="width: 100%;height: 100%" id="container"></div>
          </div>
        </el-col>
        
      </el-row>
      <!-- <div style="width: 100%;height: 440px;">
        <div style="float: left;width: 50%;">
          
          
91 92
        </div>

93 94
        
      </div> -->
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
    </div>
  </div>
</template>

<script>

  import { getDeviceInfo } from "@/api/device/deviceInfo";
  import gaodeMap from "utils/gaodeMap.js";
  import { DEVICE_TYPE } from "utils/gaodeMap.js";

  export default {
    name: "DeviceInfoDetail",
    components: {
    },
    data() {
      return {
        // 表单参数
        form: { },
        // 表单校验
        rules: { }
      };
    },
    created() {
      // 如果是跳转来的,则接受初始化参数
      this.deviceId = this.$route.query.deviceId;
      this.getDetail();
    },
    mounted(){
      let gaoMap =  new gaodeMap("石家庄");
      this.gaoMap = gaoMap;
    },
    methods: {
      getDetail (){
        getDeviceInfo(this.deviceId).then(response =>{
          this.form = response.data;
          this.gaoMap.resetMapCenter([this.form.longitude, this.form.latitude]);
          this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
        });
      },
    }
  }
</script>
<style>
  .el-divider--horizontal {
    display: block;
    height: 1px;
    width: 100%;
    margin: 20px 0;
  }
  .feedbackTime-div{
    float: left;margin-left: 150px;margin-top: 10px;
  }
  .feedbackTime{
    height: 120px;
    width: 120px;
    float: left;
    margin-left: 15px;
    margin-top: 5px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .el-card__body {
    padding: 5px 20px 20px 20px;
  }
  .detail .el-form{
    width: 20%;
  }
  .detail .el-form-item{
    margin-bottom: 0px;
  }
  .avatar-uploader{
    width: 25%;
    float: left;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  li{
    font-size: 15px;
    font-weight: 900;
  }
</style>