el-table 动态合并不定项多级表头

news2024/11/24 6:46:19

我们的需求是根据不同的厂配不同的多级表头,每个表头有需要合并的项,并且不确定

如图所示
在这里插入图片描述
在这里插入图片描述
对表格进行循环操作,此处不赘述,最下方有全部代码
在这里插入图片描述
表头是单独写在js方便后期更改,然后引入js文件,然后根据情况去调取

    // 获取表头
    getHeader(nv) {
      this.factoryCodes = nv;
      this.headerRow2 = [];
      // "xx污水处理厂"
      if (nv == "zgjn-H WS 0101") {
        //修改表头
        this.tableHeader = deviceRunReportHead[1];
        this.headerRow2 = ["紫外线杀菌装置"]; // 需要合并的表头名称数组
      } else if (nv == "zgjn-H WS 0106") {
        // xx污水处理厂
        this.tableHeader = deviceRunReportHead[2];
        this.headerRow2 = ["紫外线杀菌装置", "除臭系统"]; // 需要合并的表头名称数组
      } else if (nv == "zgjn-H WS 0105") {
        //xx污水处理厂
        this.tableHeader = deviceRunReportHead[3];
        this.headerRow2 = ["紫外线杀菌装置", "除臭系统"]; // 需要合并的表头名称数组
      } else {
        // 其他厂
        this.tableHeader = deviceRunReportHead[3];
      }
      // 刷新表格样式
      this.$nextTick(() => {
        this.$refs.slantTable.doLayout();
        this.getTableDom();
      });
      this.keyIndex++;   // 此处是重点,更新完表头之后必须强制刷新表格,否则上一次合并的信息会影响此次合并,keyIndex在el-table的key上,
    },

以下是合并方法

    //表头样式设置,将“紫外线杀菌装置”字段设置为行高2(默认是行高1),并将其所占行偏移的部分设置为none
    headerStyle({ row, column, rowIndex, columnIndex }) {
      if (this.headerRow2.includes(column.label)) {
        this.$nextTick(() => {
          if (document.getElementsByClassName(column.id).length !== 0) {
            document
              .getElementsByClassName(column.id)[0]
              .setAttribute("rowSpan", 2);  // 默认合并两行,因为我这都是最多只需要合并两行
            return false;
          }
        });
        return column;
      }
      if (column.label == undefined) { // 最后一层是没有name的即没有label,则取消合并
        return { display: "none" };
      }
    },

下方是全部vue代码

<!-- 设备运行记录表 -->
<template>
  <div class="deviceRunReport-template">
    <pageIndexTemp @refresh="refreshTableDom">
      <!-- 查询框 -->
      <el-form ref="form" slot="searchBox" :model="form" inline size="small">
        <el-form-item label="日期" class="date_item">
          <el-date-picker
            v-model="form.queryTimeDay"
            type="date"
            placeholder="选择日期"
            value-format="yyyy-MM-dd"
            :clearable="false"
            style="width: 160px"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item label="城镇污水处理厂">
          <el-select
            v-model="form.assetCode"
            placeholder="请选择城镇污水处理厂"
          >
            <el-option
              v-for="item in townSwagePlantList"
              :key="item.id"
              :label="item.aname"
              :value="item.acode"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            icon="el-icon-search"
            @click="onSearch"
            size="mini"
            >筛选</el-button
          >
        </el-form-item>
      </el-form>
      <!-- 右边按钮 -->
      <div slot="btnsR">
        <el-button
          icon="el-icon-download"
          @click="onExport(1)"
          size="mini"
          type="primary"
          >按日导出</el-button
        >
        <el-button
          icon="el-icon-download"
          @click="onExport(2)"
          v-if="type == 1"
          size="mini"
          type="primary"
          >按月导出</el-button
        >
      </div>
      <!-- 表格 -->
      <div class="table" slot="tablePage" v-loading="Loading">
        <div
          class="slantTableStyle"
          :style="{
            '--slantOneColWidth': tableOneColWidth + 'px',
            '--tableWidth': tableWidth,
          }"
        >
          <el-table
            :data="tableData"
            ref="slantTable"
            :header-cell-style="headerStyle"
            height="100%"
            border
            :key="keyIndex"
          >
            <el-table-column
              v-for="(column1, index) in tableHeader"
              :key="index"
              :label="column1.name"
              :align="column1.align ? column1.align : tableAlignDef"
              :width="column1.width"
            >
              <el-table-column
                v-for="(column2, index2) in column1.columns"
                :key="index2"
                :prop="column2.prop"
                :label="column2.name"
                :align="column2.align ? column2.align : tableAlignDef"
                :width="column2.width ? column2.width : tableMinColumnWidth"
              >
                <el-table-column
                  v-for="(column3, index3) in column2.columns"
                  :key="index3"
                  :prop="column3.prop"
                  :label="column3.name"
                  :align="column3.align ? column3.align : tableAlignDef"
                  :width="tableMinColumnWidth"
                >
                  <template slot-scope="scope">
                    <!-- 编辑 -->
                    <div
                      v-if="
                        (type == 3 &&
                          scope.row.isEdit &&
                          !disabledProp.includes(column3.prop)) ||
                          (type == 2 &&
                            scope.row.isEdit &&
                            scope.row.editProp.includes(column3.prop))
                      "
                    >
                      <el-select
                        v-model="scope.row[column3.prop]"
                        placeholder="请选择"
                        size="mini"
                        clearable
                      >
                        <el-option
                          v-for="item in options"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        >
                        </el-option>
                      </el-select>
                    </div>
                    <div v-else>
                      {{
                        disabledProp.includes(column3.prop)
                          ? formatTime(scope.row[column3.prop])
                          : formatStatus(scope.row[column3.prop])
                      }}
                    </div>
                  </template>
                </el-table-column>
                <template slot-scope="scope">
                  <!-- 编辑 -->
                  <div
                    v-if="
                      (type == 3 &&
                        scope.row.isEdit &&
                        !disabledProp.includes(column2.prop)) ||
                        (type == 2 &&
                          scope.row.isEdit &&
                          scope.row.editProp.includes(column2.prop))
                    "
                  >
                    <el-select
                      v-model="scope.row[column2.prop]"
                      placeholder="请选择"
                      size="mini"
                      clearable
                    >
                      <el-option
                        v-for="item in options"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value"
                      >
                      </el-option>
                    </el-select>
                  </div>
                  <div v-else>
                    {{
                      disabledProp.includes(column2.prop)
                        ? formatTime(scope.row[column2.prop])
                        : formatStatus(scope.row[column2.prop])
                    }}
                  </div>
                </template>
              </el-table-column>
              <template slot-scope="scope">
                <!-- 编辑 -->
                <div
                  v-if="
                    (type == 3 &&
                      scope.row.isEdit &&
                      !disabledProp.includes(column1.prop)) ||
                      (type == 2 &&
                        scope.row.isEdit &&
                        scope.row.editProp.includes(column1.prop))
                  "
                >
                  <el-select
                    v-model="scope.row[column1.prop]"
                    placeholder="请选择"
                    size="mini"
                    clearable
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </div>
                <div v-else>
                  {{
                    disabledProp.includes(column1.prop)
                      ? formatTime(scope.row[column1.prop])
                      : formatStatus(scope.row[column1.prop])
                  }}
                </div>
              </template>
            </el-table-column>
            <el-table-column
              fixed="right"
              label="操作"
              align="center"
              width="100"
              v-if="type !== 1"
            >
              <template slot-scope="scope">
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  v-if="
                    type == 3 && !scope.row.isEdit && compareTime(scope.row)
                  "
                  @click="handleClickEdit(scope.$index, scope.row)"
                  >编辑</el-button
                >
                <el-button
                  type="primary"
                  plain
                  size="mini"
                  v-if="
                    type == 2 &&
                      ifShowEdit(scope.row) &&
                      !scope.row.isEdit &&
                      compareTime(scope.row)
                  "
                  @click="handleClickEdit(scope.$index, scope.row)"
                  >编辑</el-button
                >
                <el-button
                  type="primary"
                  size="mini"
                  v-if="scope.row.isEdit"
                  @click="handleClickSaveRow(scope.$index, scope.row)"
                  >保存</el-button
                >
              </template>
            </el-table-column>
            <div slot="append" class="appendTable">
              填表要求:1、正常运行:√;
              2、故障:×;3、备用停机:△;4、其他:开机时间或停机时间等情况请填写备注栏
            </div>
          </el-table>
        </div>
      </div>
    </pageIndexTemp>
  </div>
</template>

<script>
import moment from "moment";
import cloneDeep from "lodash.clonedeep";
import { downloadXls, downloadZip } from "@/utils/download";
import pageIndexTemp from "../../../components/pageIndexTemp.vue";
import { deviceRunReportHead } from "@/utils/deviceRunReportHead.js";

export default {
  name: "deviceRunReport",
  components: { pageIndexTemp },
  props: {
    // 说明:
    // 1 - 不可编辑,仅展示,默认值是1;
    // 2 - 空白处可编辑,保存后已填入部分不可编辑,单行无空白不出现任何按钮;
    // 3 - 除部分固定字段外数据可编辑,出现按钮
    type: {
      type: Number,
      default: 1,
    },
  },
  filters: {},
  data() {
    return {
      //查询参数
      form: {
        queryTimeDay: moment().format("yyyy-MM-DD"),
        assetCode: "",
      },
      Loading: false,
      // 城镇污水厂列表
      townSwagePlantList: [],
      //表格数据
      tableData: [],
      tableOneColWidth: 100,
      tableMinColumnWidth: 80,
      tableWidth: "0px",
      tableAlignDef: "center",
      tableHeader: [],

      options: [
        { label: "√", value: "0" },
        { label: "△", value: "1" },
        { label: "×", value: "2" },
      ],
      disabledProp: ["time"],
      queryTime: "",
      assetCode: "",
      assetName: "",
      startForm: {},
      factoryCodes: "",
      headerRow2: [],
      keyIndex: 1,
    };
  },

  mounted() {
    this.getTableDom();
  },
  created() {
    this.getTownSwagePlantList();
  },
  methods: {
    //查询
    onSearch() {
      // this.getHeader(this.form.assetCode);
      this.getTableData();
    },

    // 查询城镇污水厂列表
    getTownSwagePlantList() {
      this.$api.reportManagement
        .getAssetList({ level: 1, cId: 42 })
        .then((res) => {
          this.townSwagePlantList = res.data || [];
          if (this.townSwagePlantList.length > 0) {
            this.form.assetCode = this.townSwagePlantList[0].acode;
            this.assetCode = this.form.assetCode;
            // this.getHeader(this.form.assetCode); // 获取表头
            this.assetName = this.townSwagePlantList[0].aname;
            this.getTableData();
          }
        });
    },
    // 获取表头
    getHeader(nv) {
      this.factoryCodes = nv;
      this.headerRow2 = [];
      // "xx污水处理厂"
      if (nv == "zgjn-H WS 0101") {
        //修改表头
        this.tableHeader = deviceRunReportHead[1];
        this.headerRow2 = ["紫外线杀菌装置"]; // 需要合并的表头
      } else if (nv == "zgjn-H WS 0106") {
        // xx污水处理厂
        this.tableHeader = deviceRunReportHead[2];
        this.headerRow2 = ["紫外线杀菌装置", "除臭系统"]; // 需要合并的表头
      } else if (nv == "zgjn-H WS 0105") {
        // xx污水处理厂
        this.tableHeader = deviceRunReportHead[3];
        this.headerRow2 = ["紫外线杀菌装置", "除臭系统"]; // 需要合并的表头
      } else {
        // 其他厂
        this.tableHeader = deviceRunReportHead[3];
      }
      // 刷新表格样式
      this.$nextTick(() => {
        this.$refs.slantTable.doLayout();
        this.getTableDom();
      });
      this.keyIndex++;
    },
    //查询表格数据
    getTableData() {
      this.Loading = true;
      this.queryTime = this.form.queryTimeDay;
      this.assetCode = this.form.assetCode;
      this.assetName =
        this.townSwagePlantList.find((item) => item.acode == this.assetCode)
          .aname || "";

      this.startForm = JSON.parse(JSON.stringify(this.form));

      this.$api.reportManagement
        .getDeviceState(this.form)
        .then((res) => {
          if (res.code == 200) {
            this.tableData = res.data || [];
            this.getHeader(this.form.assetCode); // 获取表头
          } else {
            this.$message.error(res.msg);
          }
          this.Loading = false;
        })
        .catch(() => {
          this.Loading = false;
        });
    },

    // 更新table dom
    refreshTableDom() {
      this.$nextTick(() => {
        this.$refs.slantTable.doLayout();
      });
    },

    // 时间转换
    formatTime(val) {
      return moment(val).format("HH:mm");
    },

    //获取table的DOM元素,筛查出el-table__header的DOM,并获取其宽度,用以控制append部分的宽度设置
    getTableDom() {
      let slantTable = this.$refs.slantTable;
      let tableDom = slantTable.$children.find(
        (el) => el.$el.className == "el-table__header"
      );
      this.tableWidth = tableDom.table.bodyWidth;
    },

    //表头样式设置,将“紫外线杀菌装置”字段设置为行高2(默认是行高1),并将其所占行偏移的部分设置为none
    headerStyle({ row, column, rowIndex, columnIndex }) {
      if (this.headerRow2.includes(column.label)) {
        this.$nextTick(() => {
          if (document.getElementsByClassName(column.id).length !== 0) {
            document
              .getElementsByClassName(column.id)[0]
              .setAttribute("rowSpan", 2);
            return false;
          }
        });
        return column;
      }
      if (column.label == undefined) {
        return { display: "none" };
      }
    },

    // 点击导出按钮
    onExport(val) {
      if (this.form.assetCode == "" || this.form.queryTimeDay == "") {
        this.$message.warning("请选择日期和污水厂后再进行导出");
        return;
      }

      let flag = JSON.stringify(this.form) == JSON.stringify(this.startForm);
      // 按日导出重新搜索列表
      if (val == 1 && !flag) {
        this.getTableData();
      }

      let obj = this.townSwagePlantList.find(
        (item) => item.acode == this.form.assetCode
      );
      let names =
        val == 1
          ? this.form.queryTimeDay
          : moment(this.form.queryTimeDay).format("yyyy-MM") + "月";
      if (obj) {
        this.handelDownload(obj, names, val);
      }
    },
    //  下载xls/zip文件
    handelDownload(obj, names, val) {
      let fileName = obj.aname + "设备运行记录表" + names + "导出数据";
      let newName = val == 1 ? ".xls" : ".zip";
      this.$confirm(
        `此操作将下载"${fileName}${newName}" 文件, 是否继续?`,
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(() => {
          const datas = {
            type: val,
            ...this.form,
          };
          this.$api.reportManagement.exportDeviceState(datas).then((res) => {
            val == 1 ? downloadXls(res, fileName) : downloadZip(res, fileName);
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: `已取消下载${names}数据`,
          });
        });
    },
    // 判断是否显示编辑按钮
    ifShowEdit(row) {
      let cloneRow = cloneDeep(row);
      let arr = [];
      let keys = Object.keys(cloneRow);
      for (let i = 0; i < keys.length; i++) {
        if (!cloneRow[keys[i]]) {
          arr.push(keys[i]);
        }
      }
      return arr.length > 0 ? true : false;
    },

    // 判断当前时间是否会显示编辑按钮
    compareTime(val) {
      let current = moment(new Date()).valueOf();
      let time = moment(val.time).valueOf();
      return time < current ? true : false;
    },

    // 点击编辑按钮
    handleClickEdit(index, row) {
      if (
        this.queryTime !== this.form.queryTimeDay ||
        this.assetCode !== this.form.assetCode
      ) {
        this.$message.warning("查询条件和列表数据不一致,不可编辑!");
        return false;
      }
      this.$set(row, "isEdit", true);
      // 当type=2时,部分可编辑
      if (this.type == 2) {
        this.$set(row, "editProp", []);
        let keys = Object.keys(row);
        for (let i = 0; i < keys.length; i++) {
          if (!row[keys[i]]) {
            row.editProp.push(keys[i]);
          }
        }
      }
    },

    // 点击保存按钮
    handleClickSaveRow(index, row) {
      console.log(index, row);
      let arr = this.multSaveIndexArr();
      if (arr.length > 1) {
        this.$confirm("当前页面存在多条数据需要保存, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            let times = 0;
            arr.map((i) => {
              this.$set(this.tableData[i], "isEdit", false);
              let editRow = cloneDeep(this.tableData[i]);
              if (this.type == 2) {
                delete editRow.editProp;
              }
              delete editRow.isEdit;
              this.$set(editRow, "acquisitionTime", editRow.time);
              delete editRow.time;
              this.$api.reportManagement[
                editRow.id ? "editDeviceData" : "addDeviceData"
              ](editRow.id ? editRow : this.getAddRow(editRow)).then(() => {
                times++;
                if (times == arr.length) {
                  this.$message.success("编辑成功");
                  this.getTableData();
                }
              });
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消",
            });
          });
      } else {
        this.$set(row, "isEdit", false);
        if (this.type == 2) {
          delete row.editProp;
        }
        let editRow = cloneDeep(row);
        delete editRow.isEdit;
        delete editRow.time;
        this.$set(editRow, "acquisitionTime", row.time);
        if (editRow.id) {
          this.editEvent(editRow);
        } else {
          let addRow = this.getAddRow(editRow);
          console.log("addRow", addRow);
          this.addEvent(addRow);
        }
      }
    },

    //获取新增数据
    getAddRow(row) {
      this.$set(row, "acode", this.assetCode);
      this.$set(row, "aname", this.assetName);
      return row;
    },

    // 单条数据-新增事件
    addEvent(form) {
      this.$api.reportManagement.addDeviceData(form).then((res) => {
        if (res.code == 200) {
          this.$message.success("编辑成功");
          this.getTableData();
        } else {
          this.$message.error(res.msg);
        }
      });
    },

    // 单条数据-编辑事件
    editEvent(form) {
      console.log("form", form);
      this.$api.reportManagement.editDeviceData(form).then((res) => {
        if (res.code == 200) {
          this.$message.success("编辑成功");
          this.getTableData();
        } else {
          this.$message.error(res.msg);
        }
      });
    },

    // 判断当前是否有多个保存的需求
    multSaveIndexArr() {
      let arr = [];
      this.tableData.map((item, index) => {
        if (item.isEdit) {
          arr.push(index);
        }
      });
      return arr;
    },

    // 转换状态
    formatStatus(val) {
      if (val) {
        let obj = this.options.find((item) => item.value == val);
        return obj ? obj.label : "";
      } else {
        return val;
      }
    },
  },
};
</script>
<style lang="less">
@import "../../../../assets/css/element-ui.less";
.deviceRunReport-template {
  width: 100%;
  height: 100%;
  .date_item {
    margin: 0 20px 0 24px;
  }
  .table {
    height: 100%;
    .slantTableStyle {
      width: 100%;
      height: 100%;
      .appendTable {
        box-sizing: border-box;
        padding: 12px;
      }
      .el-table {
        .el-table__header {
          position: relative;
        }
        .el-table__append-wrapper {
          width: var(--tableWidth);
        }
        .el-table__body-wrapper {
          overflow: auto;
        }
        thead {
          &::before {
            width: var(--slantOneColWidth);
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            display: block;
            content: "";
            z-index: 1;
            box-sizing: border-box;

            background-image: linear-gradient(
              to bottom left,
              transparent 49.5%,
              @tableBorder,
              transparent 50.5%
            );
          }
          &.is-group tr:first-of-type th:first-of-type {
            border-bottom: none;
          }
        }
      }
    }
  }
}
</style>

下面是js代码

/**
 * 工艺运行记录表表头
 */
export const craftRunReportHead = {

  1: [
    {
      name: "巡视时间",
      prop: "time",
    },
    {
      name: "污水处理量",
      columns: [
        {
          name: "进水瞬时 流量m³/h",
          prop: "inInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "出水瞬时 流量m³/h",
          prop: "outInstantFlow",
          rule: "isFloat",
        },
        {
          name: "内回流瞬时 流量m³/h",
          prop: "inGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "外回流瞬时 流量m³/h",
          prop: "exGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "exGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "exGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "PH值",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inPh",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outPh",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "COD mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inCod",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outCod",
              rule: "isFloat",
            },
          ],
        },
      ],
    },

    {
      name: "氨氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inNh3n",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outNh3n",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总磷mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTp",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTp",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTn",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTn",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "DO仪表mg/L",
      columns: [
        {
          name: "厌氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anaerobicTank1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anaerobicTank2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "缺氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anoxicPool1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anoxicPool2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "1#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank1Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank1After",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "2#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank2Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank2After",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "ORP仪表",
      columns: [
        {
          name: "mv",
          columns: [
            {
              name: "厌氧池",
              prop: "orpAnaerobicPool",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "mv",
          columns: [
            {
              name: "1#好氧池",
              prop: "orpAerobicPool1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "mv",
          columns: [
            {
              name: "2#好氧池",
              prop: "orpAerobicPool2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "MLSS (污泥浓度)",
      columns: [
        {
          name: "mg/L",
          columns: [
            {
              name: "1#好氧池",
              prop: "mlss1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "mg/L",
          columns: [
            {
              name: "2#好氧池",
              prop: "mlss2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "SV30(2-4次/天)",
      columns: [
        {
          name: "%",
          columns: [
            {
              name: "1#好氧池",
              prop: "sv30One",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "%",
          columns: [
            {
              name: "2#好氧池",
              prop: "sv30Two",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "进水温度/盐度",
      prop: "inTemOrSal",
      rule: "isFloat",
    },
  ],

  2: [
    {
      name: "巡视时间",
      prop: "time",
    },
    {
      name: "污水处理量",
      columns: [
        {
          name: "进水瞬时 流量m³/h",
          prop: "inInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "出水瞬时 流量m³/h",
          prop: "outInstantFlow",
          rule: "isFloat",
        },
        {
          name: "内回流瞬时 流量m³/h",
          prop: "inGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "外回流瞬时 流量m³/h",
          prop: "exGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "exGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "exGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "PH值",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inPh",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outPh",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "COD mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inCod",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outCod",
              rule: "isFloat",
            },
          ],
        },
      ],
    },

    {
      name: "氨氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inNh3n",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outNh3n",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总磷mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTp",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTp",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTn",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTn",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "DO仪表mg/L",
      columns: [
        {
          name: "厌氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anaerobicTank1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anaerobicTank2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "缺氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anoxicPool1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anoxicPool2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "1#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank1Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank1After",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "2#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank2Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank2After",
              rule: "isFloat",
            },
          ],
        },
      ],
    },

    {
      name: "MLSS (污泥浓度)",
      columns: [
        {
          name: "mg/L",
          columns: [
            {
              name: "1#好氧池",
              prop: "mlss1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "mg/L",
          columns: [
            {
              name: "2#好氧池",
              prop: "mlss2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "SV30(2-4次/天)",
      columns: [
        {
          name: "%",
          columns: [
            {
              name: "1#好氧池",
              prop: "sv30One",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "%",
          columns: [
            {
              name: "2#好氧池",
              prop: "sv30Two",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "二沉池泥水界面仪",
      columns: [
        {
          name: "m",
          columns: [
            {
              name: "1#二沉池",
              prop: "sedimentationTank1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "m",
          columns: [
            {
              name: "2#二沉池",
              prop: "sedimentationTank2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "进水温度/盐度",
      prop: "inTemOrSal",
      rule: "isFloat",
    },
  ],
  // 其他水厂
  3: [
    {
      name: "巡视时间",
      prop: "time",
    },
    {
      name: "污水处理量",
      columns: [
        {
          name: "进水瞬时 流量m³/h",
          prop: "inInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "出水瞬时 流量m³/h",
          prop: "outInstantFlow",
          rule: "isFloat",
        },
        {
          name: "内回流瞬时 流量m³/h",
          prop: "inGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "inGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "inGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "外回流瞬时 流量m³/h",
          prop: "exGyrusInstantFlow",
          rule: "isFloat",
          columns: [
            {
              name: "1#系列",
              prop: "exGyrusInstantFlow1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "exGyrusInstantFlow2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "PH值",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inPh",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outPh",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "COD mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inCod",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outCod",
              rule: "isFloat",
            },
          ],
        },
      ],
    },

    {
      name: "氨氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inNh3n",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outNh3n",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总磷mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTp",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTp",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "总氮mg/L",
      columns: [
        {
          columns: [
            {
              name: "进水",
              prop: "inTn",
              rule: "isFloat",
            },
            {
              name: "出水",
              prop: "outTn",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "DO仪表mg/L",
      columns: [
        {
          name: "厌氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anaerobicTank1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anaerobicTank2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "缺氧池",
          columns: [
            {
              name: "1#系列",
              prop: "anoxicPool1",
              rule: "isFloat",
            },
            {
              name: "2#系列",
              prop: "anoxicPool2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "1#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank1Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank1After",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "2#好氧池",
          columns: [
            {
              name: "前端",
              prop: "aerobicTank2Before",
              rule: "isFloat",
            },
            {
              name: "后端",
              prop: "aerobicTank2After",
              rule: "isFloat",
            },
          ],
        },
      ],
    },

    {
      name: "MLSS (污泥浓度)",
      columns: [
        {
          name: "mg/L",
          columns: [
            {
              name: "1#好氧池",
              prop: "mlss1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "mg/L",
          columns: [
            {
              name: "2#好氧池",
              prop: "mlss2",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "SV30(2-4次/天)",
      columns: [
        {
          name: "%",
          columns: [
            {
              name: "1#好氧池",
              prop: "sv30One",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "%",
          columns: [
            {
              name: "2#好氧池",
              prop: "sv30Two",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "二沉池泥水界面仪",
      columns: [
        {
          name: "m",
          columns: [
            {
              name: "1#二沉池",
              prop: "sedimentationTank1",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "m",
          columns: [
            {
              name: "2#二沉池",
              prop: "sedimentationTank2",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "m",
          columns: [
            {
              name: "3#二沉池",
              prop: "sedimentationTank3",
              rule: "isFloat",
            },
          ],
        },
        {
          name: "m",
          columns: [
            {
              name: "4#二沉池",
              prop: "sedimentationTank4",
              rule: "isFloat",
            },
          ],
        },
      ],
    },
    {
      name: "进水温度/盐度",
      prop: "inTemOrSal",
      rule: "isFloat",
    },
  ],
};

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/748120.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

KingFusion通过动态库的方式连接KingIOServer数据

哈喽&#xff0c;大家好&#xff0c;我是雷工&#xff01; 本节主要测试KingFusion通过动态库接入KingIOServer数据&#xff0c;实现快速订阅、回写实时数据及客户端展示的操作。 说明&#xff1a; 1、Windows版本:KingFunsion与KingIOServer数据交互时&#xff0c;使用动态库…

python中应用requests库模拟postman请求携带token,使用get和post方法请求头携带token

背景&#xff1a; 实际开发中&#xff0c;Python程序中需要调用后台接口&#xff0c;充当前端&#xff0c;后端规定请求头需要携带token 封装的get和post类: class RequestMethodCarryJson:"""定义请求类型以json方式传递参数"""def __init__…

欧姆龙NJ1P2 Fins Udp通讯

NJ1P2 Tcp连接不成功&#xff0c;咨询客服说不支持Fins Tcp&#xff0c;所以改成Udp方式。 Udp连接&#xff1a; locateIp IPAddress.Parse(txtLocateIP.Text); locatePoint new IPEndPoint(locateIp, Convert.ToInt32(txtLocatePort.Text)); udpCl…

刷题记录02

题目1 解析: 遍历字符串&#xff0c;使用cur去记录连续的数字串&#xff0c; 如果遇到不是数字字符&#xff0c;则表示一个连续的数字串结束了&#xff0c; 则将数字串跟之前的数字串比较&#xff0c;如果更长&#xff0c;则更新更长的数字串更新到ret。 具体代码: import jav…

线上阿里云短信盗刷问题实录

背景 营销系统中有定时任务处理将待支付订单变更为已取消,执行时间五分钟一次.业务执行处理异常会发送短信给相关开发人员进行短信提醒.从下午一点二十五开始,开发人员间隔五分钟就会收到业务执行异常的短信提醒.最初因为测试或是正式环境中确实有异常的业务,才会出现这个情况,…

C++结合EasyX写扫雷(new)

【游戏】C结合EasyX写扫雷&#xff08;时隔半年后重写&#xff09; 上一次写扫雷这一次实现思路设置全局变量Grid类Grid类的成员函数启动画面死循环监听鼠标事件 全部代码其他 上一次写扫雷 大约半年之前的寒假期间&#xff0c;我接触了EasyX这个图形库&#xff0c;于是试着写…

antd design 4 版本,表格操作列文字间隔小竖线

组件库可以直接使用 <Divider typevertical /> 时小记&#xff0c;终有成。

23 MFC 富文本

文章目录 ui 设置 使用AfxInitRichEdit2(); 初始化否则不显示 //初始化 BOOL CnotePadDlg::OnInitDialog() {CDialogEx::OnInitDialog();// 设置此对话框的图标。 当应用程序主窗口不是对话框时&#xff0c;框架将自动// 执行此操作SetIcon(m_hIcon, TRUE); // 设置大图标…

数学建模——TOPSIS法

TOPSIS法&#xff08;Technique for Order Preference by Similarity to ldeal Solution&#xff09; 可翻译为逼近理想解排序法&#xff0c;国内常简称为优劣解距离法 TOPSIS法是一种常用的综合评价方法&#xff0c;其能充分利用原始数据的信息&#xff0c;其结果能精确的反应…

一款基于JAVA开发的Echarts后台生成框架

目录 前言 一、Echarts后台生成框架 1、简介 2、开源地址 3、支持类型 二、图表生成实战 1、项目使用 2、后台折线图生成 3、Echarts改造 4、最终效果 总结 前言 之前的博文主要分享了一些关于Echarts的基本开发知识&#xff0c;在之前的博客中主要介绍的是在前端页面进…

魏副业而战:她又办了2套图书证

我是魏哥&#xff0c;与其躺平&#xff0c;不如魏副业而战&#xff01; 社群成员董姐又办了2套图书证&#xff0c;加上之前的1套&#xff0c;她已经有3套图书证了。 3套图书证意味着可以开9个闲鱼图书店铺。是不是感觉很NB。 董姐说&#xff0c;2套图书证等了快一个多月&…

Flink基本原理剖析讲解

1.Flink简介 Flink是一个批处理和流处理结合的统一计算框架&#xff0c;其核心是一个提供了数据分发以及并行化计算的流数据处理引擎。它的最大亮点是流处理&#xff0c;是业界最顶级的开源流处理引擎。 Flink最适合的应用场景是低时延的数据处理&#xff08;Data Processing…

面试题更新之-伪元素和伪类

文章目录 伪元素和伪类是什么&#xff1f;伪元素&#xff08;Pseudo-elements&#xff09;:伪类&#xff08;Pseudo-classes&#xff09;: css伪元素和伪类的区别使用css伪元素的好处使用css伪类的好处 伪元素和伪类是什么&#xff1f; 在CSS中&#xff0c;伪元素&#xff08;…

星云零售信贷基于 Apache Doris 的 OLAP 演进之路

本文导读&#xff1a; 腾梭科技是国内领先的零售金融数字化及安全服务提供商&#xff0c;是腾讯投资且在金融领域的战略合作伙伴&#xff0c;并与腾讯联合研发了“星云智慧信贷解决方案。在其信贷业务转型过程中&#xff0c;随着系统规模不断扩大&#xff0c;早期架构无法再满…

centos7根分区、文件系统扩容

1、 输入lsblk&#xff0c;查看到新硬盘sde&#xff0c;根目录现71G. 2、 创建分区fidisk /dev/sde 3、 刷新分区 partprobe /dev/sde&#xff0c;并创建物理卷 pvcreate /dev/sde1 4、 查看卷组名 vgdisplay 5、 将物理卷扩展到卷组 vgextend centos /dev/sde1 6、 查看逻辑巻…

linux系统安装步骤教程详解

linux是现在常用的一类操作系统&#xff0c;我们可以通过U盘、光驱、或者虚拟机进行安装。 具体步骤如下&#xff1a; 1.去https://www.centos.org/download/下载centos系统&#xff0c;其中CentOS-7.0-x86_64-DVD-1503-01.iso 是标准安装版&#xff0c;推荐下载这个; 2.使用U盘…

OCR技术的昨天今天和明天!2023年最全OCR技术指南!

OCR是一项科技革新&#xff0c;通过自动化大幅减少人工录入的过程&#xff0c;帮助用户从图像或扫描文档中提取文字&#xff0c;并将这些文字转换为计算机可读格式。这一功能在许多需要进一步处理数据的场景中&#xff0c;如身份验证、费用管理、自动报销、业务办理等都显得尤为…

MySQL常见笔试题

前言 数据库的考察在面试时可是十分常见的&#xff0c;MySQL作为一种常用的关系型数据库管理系统&#xff0c;对于它的介绍在面试时可是必不可少的&#xff0c;下面就是一些常见笔试题的模拟&#xff0c;希望可以帮助到你&#x1f642;&#x1f642; 所用到的表如下&#xff…

国产MCU-CW32F030开发学习-BH1750模块

国产MCU-CW32F030开发学习-BH1750模块 硬件平台 CW32_48F大学计划板CW32_IOT_EVA物联网开发评估套件BH1750数字型光照强度传感器 BH1750 BH1750是一款数字型光照强度传感器&#xff0c;能够获取周围环境的光照强度。其测量范围在0~65535 lx。lx勒克斯&#xff0c;是光照强…

界面设计利器!10款Sketch插件合集,助你事半功倍!

在界面设计领域&#xff0c;Sketch以其高效、小巧的优势获得了不少设计团队的喜爱&#xff0c;帮助全球设计师创造了许多不可思议的作品。在使用Sketch的过程中&#xff0c;辅助使用一些Sketch插件&#xff0c;可以让我们更加高效地完成设计任务。本篇文章&#xff0c;我们将揭…