longyvfengyun
2023-04-10 39fd1f3e9a026bc8c7cc90f463fc299e2205a338
内容提交
2个文件已修改
1个文件已添加
173 ■■■■■ 已修改文件
src/views/dataMager/components/powerRemarks.vue 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/js/power.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/powerMager.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/dataMager/components/powerRemarks.vue
New file
@@ -0,0 +1,149 @@
<template>
  <el-dialog
    title="站点电源监测异常原因"
    width="auto"
    :visible.sync="isShow"
    :close-on-click-modal="false"
    top="0"
    class="dialog-center"
    :show-close="false"
    :modal-append-to-body="false">
    <div class="alarm-details">
      <div class="details-header">
        <span class="label">站点电源监测异常原因</span>
        <span class="close" @click="close">
          <i class="el-icon-error"></i>
        </span>
      </div>
      <div class="details-body">
        <div class="tab-item-content">
          <div class="content-item">站点名称:{{ params.stationName }}</div>
          <div class="content-item">电源品牌:{{ params.powerProducer }}</div>
          <div class="content-item">监控异常原因:{{ params.exceptionCause }}</div>
          <div class="content-item">异常原因分析:<span v-if="params.exceptionCauseAnalysises.length===0">无</span></div>
          <div class="content-item"
               v-for="(item, key) in params.exceptionCauseAnalysises" :key="'key'+key">{{ item }}</div>
        </div>
      </div>
    </div>
  </el-dialog>
</template>
<script>
import {searchExceptionCause} from "@/views/dataMager/js/power";
export default {
  name: "powerRemarks",
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    num: {
      type: [Number, String],
      default: 1,
    },
  },
  data() {
    return {
      remarksDialog: false,
      params: {
        stationName: "未知",
        powerProducer: "未知",
        exceptionCause: "未知",
        exceptionCauseAnalysises: []
      },
    };
  },
  methods: {
    search() {
      searchExceptionCause(this.num).then(res=>{
        let rs = res.data;
        if(rs.code === 1) {
          let {stationName, powerProducer, exceptionCause, exceptionCauseAnalysis} = {...rs.data};
          let exceptionCauseAnalysises = exceptionCauseAnalysis?exceptionCauseAnalysis.split('\n'):[];
          this.params = {
            stationName,
            powerProducer,
            exceptionCause,
            exceptionCauseAnalysises
          };
        }else {
          this.params = {
            stationName: "未知",
            powerProducer: "未知",
            exceptionCause: "未知",
            exceptionCauseAnalysises: []
          };
        }
      }).catch(error=>{
        console.log(error);
        this.params = {
          stationName: "未知",
          powerProducer: "未知",
          exceptionCause: "未知",
          exceptionCauseAnalysises: []
        };
      });
    },
    close() {
      this.$emit('update:visible', false);
    }
  },
  computed: {
    isShow() {
      return this.visible;
    }
  },
  mounted() {
    this.search();
  }
}
</script>
<style scoped lang="less">
/deep/ .el-dialog__header {
  display: none;
}
.alarm-details {
  background-color: #00ffef;
}
.details-header {
  text-align: center;
  padding: 8px 0;
  position: relative;
  color: #0f2da5;
  .label {
    font-size: 22px;
    font-weight: bold;
  }
  .close {
    position: absolute;
    font-size: 30px;
    right: 16px;
    top: 2px;
    cursor: pointer;
  }
  .close:hover {
    color: #0a56f7;
  }
  .close:active {
    color: #ff0000;
  }
}
.details-body {
  width: 560px;
  padding-bottom: 8px;
}
.tab-item-content {
  background-color: #0B388B;
  min-height: 100px;
  margin-left: 8px;
  margin-right: 8px;
  padding: 12px;
  color: #FFFFFF;
  font-size: 16px;
  .content-item {
    padding: 6px 0;
  }
}
</style>
src/views/dataMager/js/power.js
@@ -308,6 +308,13 @@
  ];
}
/**
 * 更新电源备注
 * @param num
 * @param exceptionCause
 * @param exceptionCauseAnalysis
 * @return {AxiosPromise}
 */
export const updateExceptionCause = (num, exceptionCause, exceptionCauseAnalysis)=>{
  return axios({
    method: 'PUT',
@@ -319,3 +326,13 @@
    }
  });
}
export const searchExceptionCause = (num)=> {
  return axios({
    method: 'GET',
    url: 'powerInf/exceptionCause',
    params: {
      num
    }
  });
}
src/views/dataMager/powerMager.vue
@@ -178,7 +178,7 @@
        @success="editSuccess"
      ></edit-power-mager>
    </el-dialog>
    <!-- 编辑站点 -->
    <!-- 异常备注 -->
    <el-dialog
      title="异常备注"
      width="auto"
@@ -189,6 +189,7 @@
      :modal-append-to-body="false">
      <error-remarks v-if="remarksDialog" :info="batt" :visible.sync="remarksDialog" @success="searchData"></error-remarks>
    </el-dialog>
    <power-remarks :visible.sync="powerRemarksDialog" v-if="powerRemarksDialog" :num="batt.num"></power-remarks>
  </flex-layout>
</template>
@@ -207,10 +208,12 @@
  deletePower
} from "./js/power";
import ErrorRemarks from "@/views/dataMager/components/errorRemarks.vue";
import PowerRemarks from "@/views/dataMager/components/powerRemarks.vue";
export default {
  name: 'powerMager',
  components: {
    PowerRemarks,
    ErrorRemarks,
    AddPowerMager,
    EditPowerMager,
@@ -220,6 +223,7 @@
    let isCanEdit = isHasPermit("batttest_data_edit_permit", permits);
    return {
      remarksDialog: false,
      powerRemarksDialog: false,
      isCanEdit: isCanEdit,
      batt: {},
      loading: "",
@@ -588,6 +592,7 @@
    remarksShow(batt) {
      this.batt = batt;
      this.remarksDialog = true;
      //this.powerRemarksDialog = true;
    },
  },
  computed: {