zhanghua
2023-10-02 10b92700323bccebb3e6902f2bb4c70e8166a2a4
src/views/smoke/realTime/index.vue
@@ -1,13 +1,83 @@
<template>
  <div>实时管理</div>
  <MyHeader @getList="getRealTimeList"></MyHeader>
</template>
<script>
import MyHeader from "./components/header";
import realTimeApi from "@/api/smoke/realTime";
export default {
  data() {
    return {
      tableData: [],
      totalNum: 0,
      pageSize: 10,
      currentPage: 1,
    };
  },
  components: { MyHeader },
  created() {
    this.getRealTimeList();
  },
  methods: {
    getRealTimeList(seachData) {
      let params;
      if (seachData) {
        params = {
          pageNum: this.currentPage,
          pageSize: this.pageSize,
          resource:
            seachData.seachData.resource == undefined
              ? null
              : seachData.seachData.resource,
          region:
            seachData.seachData.region == undefined
              ? null
              : seachData.seachData.region,
          type: this.statusArr[1] ?? null,
          code:
            seachData.seachData.code == undefined
              ? null
              : seachData.seachData.code,
          categoryBig:
            seachData.seachData.categoryBig == undefined
              ? null
              : seachData.seachData.categoryBig,
          categorySmall:
            seachData.seachData.categorySmall == undefined
              ? null
              : seachData.seachData.categorySmall,
          site:
            seachData.seachData.site == undefined
              ? null
              : seachData.seachData.site,
          street:
            seachData.seachData.street == undefined
              ? null
              : seachData.seachData.street,
          alarmTime:
            seachData.seachData.alarmTime == undefined
              ? null
              : seachData.seachData.alarmTime,
        };
      } else {
        params = {
          pageNum: this.currentPage,
          pageSize: this.pageSize,
        };
      }
}
      realTimeApi
        .findInTimeList(params)
        .then(({ records, total }) => {
          debugger;
          this.tableData = records;
          this.totalNum = total;
        })
        .catch((err) => this.$message.error(err));
    },
  },
};
</script>
<style>
</style>