index.vue 6.32 KB
Newer Older
1 2
<template>
  <div class="app-container">
3 4
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="设备编号" prop="deviceCode">
5
        <el-input
6 7
          v-model="queryParams.deviceCode"
          placeholder="请输入设备编号"
8 9 10 11 12
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
13
      <el-form-item label="设备类型" prop="deviceType">
王晓倩's avatar
王晓倩 committed
14
        <el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" filterable clearable size="small">
15 16 17 18 19 20
          <el-option
            v-for="temp in typeOptions"
            :key="temp.value"
            :label="temp.label"
            :value="temp.value"
          ></el-option>
21 22
        </el-select>
      </el-form-item>
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
      <el-form-item label="上报时间" prop="startReportTime">
        <el-date-picker
          clearable size="small"
          v-model="queryParams.startReportTime"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetime"
          placeholder="请选择起始时间"
          align="right">
        </el-date-picker>
        <font color="#C0C4CC"></font>
      </el-form-item>
      <el-form-item label="" prop="endReportTime">
        <el-date-picker
          clearable size="small"
          v-model="queryParams.endReportTime"
          value-format="yyyy-MM-dd HH:mm:ss"
          type="datetime"
          placeholder="请选择截止时间"
          align="right">
        </el-date-picker>
      </el-form-item>
44 45 46 47 48 49
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

50
    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
51 52 53 54 55 56 57 58
      <el-table-column label="设备名称" align="center" prop="deviceName" />
      <el-table-column label="设备编号" align="center" prop="deviceCode" />
      <el-table-column label="设备类型" align="center" prop="deviceType" >
        <template slot-scope="scope">
          <span v-if="scope.row.deviceType == '3'">流量计</span>
          <span v-if="scope.row.deviceType == '4'">压力表</span>
        </template>
      </el-table-column>
59 60 61
      <el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation" />
      <el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
      <el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
62
      <el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" width="150px"/>
63 64 65
      <el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
      <el-table-column label="温度(℃)" align="center" prop="temperature" />
      <el-table-column label="压力(KPa)" align="center" prop="pressure" />
66
      <el-table-column label="上报时间" align="center" prop="reportTime" width="180px"/>
67
      <el-table-column label="设备状态" align="center" prop="deviceStatus" >
68 69 70 71 72 73
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
74 75
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
76 77 78 79 80 81 82
      @pagination="getList"
    />

  </div>
</template>

<script>
83
import { listData } from "@/api/dataMonitoring/reportData";
84 85

export default {
86
  name: "ReportData",
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 设备监控表格数据
      dataList: [],
107 108 109 110 111
      // 处理状态字典
      typeOptions: [
        {'label':'流量计','value':'3'},
        {'label':'压力表','value':'4'},
      ],
112 113 114 115 116 117
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
118 119
        pageNum: 1,
        pageSize: 10,
120 121 122 123 124 125 126 127 128 129 130
        deviceNum: null,
        standardConditionAccumulation: null,
        workingConditionAccumulation: null,
        residualQuantity: null,
        standardConditionFlow: null,
        workingConditionFlow: null,
        temperature: null,
        pressure: null,
        reportTime: null,
        communicationStatus: null,
        deviceStatus: null,
131 132
        startReportTime: null,
        endReportTime: null,
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询设备监控列表 */
    getList() {
      this.loading = true;
      listData(this.queryParams).then(response => {
149 150 151 152 153
        for(var i =0;i<response.rows.length;i++){
          if("江苏远睿气体腰轮流量计" == response.rows[i].reportDeviceName){
            response.rows[i].standardConditionFlow += " (Nm³ /h)";
          }
        }
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
        this.dataList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        deviceReportDataId: null,
        deviceNum: null,
        standardConditionAccumulation: null,
        workingConditionAccumulation: null,
        residualQuantity: null,
        standardConditionFlow: null,
        workingConditionFlow: null,
        temperature: null,
        pressure: null,
        reportTime: null,
        communicationStatus: "0",
        deviceStatus: "0",
        createTime: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
186
      this.queryParams.pageNum = 1;
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.deviceReportDataId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
  }
};
</script>