index.vue 6.04 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 23 24 25 26 27 28
        </el-select>
      </el-form-item>
      <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>

29
    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
王晓倩's avatar
王晓倩 committed
30
<!--      <el-table-column type="selection" width="55" align="center" />-->
31 32 33 34 35 36 37 38
      <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>
39 40 41 42 43 44 45
      <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" />
      <el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
      <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" />
46
      <el-table-column label="上报时间" align="center" prop="reportTime" width="180px"/>
47
      <el-table-column label="设备状态" align="center" prop="deviceStatus" >
48 49 50
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
51 52 53 54 55
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="showDetail(scope.row)"
56
            v-hasPermi="['dataMonitoring:reportData:query']"
57
          >详情</el-button>
58 59 60 61 62 63 64
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
65 66
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
67 68 69 70 71 72 73
      @pagination="getList"
    />

  </div>
</template>

<script>
74
import { realtimeData } from "@/api/dataMonitoring/reportData";
75 76

export default {
77
  name: "RealtimeData",
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
  components: {
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 设备监控表格数据
      dataList: [],
98 99 100 101 102
      // 处理状态字典
      typeOptions: [
        {'label':'流量计','value':'3'},
        {'label':'压力表','value':'4'},
      ],
103 104 105 106 107 108
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
109 110
        pageNum: 1,
        pageSize: 10,
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
        deviceNum: null,
        standardConditionAccumulation: null,
        workingConditionAccumulation: null,
        residualQuantity: null,
        standardConditionFlow: null,
        workingConditionFlow: null,
        temperature: null,
        pressure: null,
        reportTime: null,
        communicationStatus: null,
        deviceStatus: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询设备监控列表 */
    getList() {
      this.loading = true;
137
      console.log();
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
      realtimeData(this.queryParams).then(response => {
        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() {
171
      this.queryParams.pageNum = 1;
172 173 174 175 176 177 178 179 180 181 182 183 184
      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
    },
185 186 187
    //详情按钮
    showDetail(row) {
      this.$router.push({
yaqizhang's avatar
yaqizhang committed
188
        path: '/dataMonitoring/realtimedetail',
189
        query:{
yaqizhang's avatar
yaqizhang committed
190 191
          deviceId : row.deviceId,
          deviceType: row.deviceType
192 193 194
        }
      }) //带参跳转
    },
195 196 197
  }
};
</script>