ali
2024-09-03 0ae83a895e80a4b9777a27f613d721a7e5e2ac18
energy_management_ui/src/views/alarm/collectionIndex.vue
@@ -1,6 +1,12 @@
<template>
  <div class="app-container" style="padding:0">
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" class="query-form">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      label-width="68px"
      class="query-form"
    >
      <el-form-item label="指标编码" prop="code">
        <el-input
          v-model="queryParams.code"
@@ -35,7 +41,13 @@
        ></el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
@@ -50,7 +62,13 @@
        </el-button>
      </el-col>
    </el-row>
    <el-table :data="tableData" v-loading="loading" border @selection-change=""  @cell-click="openDlg" >
    <el-table
      :data="tableData"
      v-loading="loading"
      border
      @selection-change=""
      @cell-click="openDlg"
    >
      <el-table-column label="指标编码" align="center" prop="name"/>
      <el-table-column label="指标名称" align="center" prop="number"/>
      <el-table-column label="实际值" align="center" prop="value"/>
@@ -58,13 +76,20 @@
      <el-table-column label="上限值" align="center" prop="code"/>
      <el-table-column label="报警次数" align="center" prop="what">
        <template slot-scope="scope">
          <div style="color:blue;text-decoration:underline ;cursor:pointer">{{scope.row.what}}</div>
          <div style="color:blue;text-decoration:underline ;cursor:pointer">
            {{ scope.row.what }}
          </div>
        </template>
      </el-table-column>
    </el-table>
    <!--弹框-->
    <el-dialog :title="title" :visible.sync="open" width="1000px" :close-on-click-modal="false"  >
      <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1000px"
      :close-on-click-modal="false"
    >
      <el-row style="padding:16px 16px 0;margin-bottom:32px;">
        <line-chart :chart-data="lineChartData" />
      </el-row>
      <el-table  :data="tableData"   :show-header="hiddenTableHeader"  border="1px" >
@@ -81,16 +106,13 @@
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  const lineChartData = {
    newVisitis: {
    }
  }
  newVisitis: {}
};
  import {
    addEnergyindex,
    delEnergyindex,
@@ -99,12 +121,10 @@
    listEnergyindex,
    updateEnergyindex
  } from "@/api/basicsetting/energyindex";
  import LineChart from './LiChart'
import LineChart from "./LiChart";
  export default {
    name: 'energyIndex',
  name: "energyIndex",
    components: {
      LineChart
    },
@@ -145,7 +165,7 @@
        unitIdOptions: [],
        // 查询参数
        lineChartData:{
          newVisitis:null,
        newVisitis: null
        },
        queryParams: {
          pageNum: 1,
@@ -157,53 +177,54 @@
        },
        tableData: [],
        datas: [{
          name: 'BUG',
          number: '98013',
          value: '500',
          values: '450',
          code: '480',
          what: '5',
          one: '报警时间',
          two: '0点',
          three: '1点',
          four : '2点',
          five :'3点',
          six : '4点',
          seven :'5点',
          eieght:'6点',
      datas: [
        {
          name: "BUG",
          number: "98013",
          value: "500",
          values: "450",
          code: "480",
          what: "5",
          one: "报警时间",
          two: "0点",
          three: "1点",
          four: "2点",
          five: "3点",
          six: "4点",
          seven: "5点",
          eieght: "6点"
        },
          {
            name: 'BUG',
            number: '98013',
            value : '500',
            values : '450',
            code : '480',
            what: '5',
            one :'报警限值',
            two :'210',
            three :'172',
            four : '181',
            five :'224',
            six : '280',
            seven :'310',
            eieght:'300',
          name: "BUG",
          number: "98013",
          value: "500",
          values: "450",
          code: "480",
          what: "5",
          one: "报警限值",
          two: "210",
          three: "172",
          four: "181",
          five: "224",
          six: "280",
          seven: "310",
          eieght: "300"
        },
       {
         name: 'BUG',
           number: '98013',
         value : '500',
         values : '450',
         code : '480' ,
         what: '5',
         one :'报警时值',
         two :'300',
         three :'182',
         four : '191',
         five :'234',
         six : '290',
         seven :'330',
         eieght:'310',
          name: "BUG",
          number: "98013",
          value: "500",
          values: "450",
          code: "480",
          what: "5",
          one: "报警时值",
          two: "300",
          three: "182",
          four: "191",
          five: "234",
          six: "290",
          seven: "330",
          eieght: "310"
       }
        ],
@@ -213,12 +234,22 @@
        rules: {
          name: [
            {required: true, message: "指标名称不能为空", trigger: "blur"},
            {min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur'}
          ], code: [
          { min: 2, max: 20, message: "长度在 2 到 20 个字符", trigger: "blur" }
        ],
        code: [
            {required: true, message: "指标编码不能为空", trigger: "blur"},
            {min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur'},
            {pattern: /^[a-zA-Z][A-Za-z0-9_-]+$/, message: '必须为数字、字母、- 或_ ,且首字符只能为字母'}
          ], indexCategory: [
          {
            min: 2,
            max: 20,
            message: "长度在 2 到 20 个字符",
            trigger: "blur"
          },
          {
            pattern: /^[a-zA-Z][A-Za-z0-9_-]+$/,
            message: "必须为数字、字母、- 或_ ,且首字符只能为字母"
          }
        ],
        indexCategory: [
            {required: true, message: "请选择指标分类", trigger: "blur"}
          ]
        },
@@ -232,16 +263,17 @@
      /*  this.getList();*/
      this.getDicts("sys_index_category").then(response => {
        this.indexCategoryOptions = response.data;
        this.indexCategoryDefaultVal = this.indexCategoryOptions.find(f => f.isDefault === 'Y');
      this.indexCategoryDefaultVal = this.indexCategoryOptions.find(
        f => f.isDefault === "Y"
      );
      });
      this.getDicts("sys_unit").then(response => {
        this.unitIdOptions = response.data;
        this.unitDefaultVal = this.unitIdOptions.find(f => f.isDefault === 'Y');
      this.unitDefaultVal = this.unitIdOptions.find(f => f.isDefault === "Y");
      });
      setInterval(this.getList(), 30000);
      this.bpy()
    this.bpy();
    },
    methods: {
      /** 查询指标信息列表 */
@@ -258,7 +290,6 @@
        } else {
          this.energyindexList = [];
        }
      },
      bpy() {
        this.tableData = this.datas;
@@ -310,6 +341,5 @@
        this.open=true;
      }
    }
  };
</script>