geomagnetism.vue 2.31 KB
<template>
  <div class="">
    <ul class="dici-wrap" v-if="queryGeoFaultList != undefined && queryGeoFaultList.length > 0">
      <li v-for="(item, index) in queryGeoFaultList" :key="index" >
        <p class="parkName">{{item.plName}}</p>
        <ul class="diciList" v-for="(list, i) in item.eqpDTOs" :key="i">
          <li>
            编号 :{{list.eqpNo}}
          </li>
          <li>
            故障时间 :{{list.modifyTime | dataFilter}}
          </li>
        </ul>
      </li>
    </ul>
    <div v-else class="noData">暂无数据</div>
  </div>
</template>

<script>
import { diciAddress } from '../utils/api'
export default {
  name: 'geomagnetism',
  data() {
    return {
      modifyTimeBegin: new Date(decodeURIComponent(this.getUrlKey("modifyTimeBegin"))),
      modifyTimeEnd:  new Date(decodeURIComponent(this.getUrlKey("modifyTimeEnd"))),
      queryGeoFaultList: []
    }
  },
  created() {
    document.title = '地磁故障'
    console.log(this.modifyTimeBegin)
    console.log(this.modifyTimeEnd)
    diciAddress({
      modifyTimeBegin:this.modifyTimeBegin,
      modifyTimeEnd: this.modifyTimeEnd,
      orgId: 10003,
      sysCode:'1001',
      baseRequest: {
        "pageNum": 1,
        "pageSize": 500
      },
    })
    .then((res) => {
      console.log(res.data.data)
      if(res.data.code === '8888'){
        const queryGeoFaultList = res.data.data
        this.queryGeoFaultList = queryGeoFaultList
      }else{
        alert('服务器出错了')
      }

    })
    .catch((res) => {
      console.log(res)
    })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
  .dici-wrap > li {
    background-color: $whiteBg;
    margin-bottom: 12px;
    padding: 15px 15px;
  }

  .parkName {
    font-size: 1.8rem;
    font-weight: 700;
    padding-left: 2.5rem;
    background: url("../assets/images/parkName.png") no-repeat 0 center;
    background-size: 1.8rem 1.8rem;
  }
  .diciList{
    background-color: #fafafa;
    border-radius: 4px;
    padding: 0 15px;
    margin-top: 12px;
    >li{
      height: 3.8rem;
      line-height: 3.8rem;
      position: relative;
      &:first-child:after{
       @include border-1px(#D9D9D9, bottom)
        opacity: .5;
      }
    }
  }
  .noData{
    padding-top: 20px;
    text-align: center;
  }
</style>