唐耀东
2022-05-12 fd32a3a1f5e10249f037d32dc2097b46c1ec4f85
提交代码
1个文件已修改
4个文件已添加
800 ■■■■■ 已修改文件
src/api/oa/iot.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/peripheralUnit/index.vue 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/peripheralUnit/list.vue 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/constructionList/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/iot/index.vue 534 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/iot.js
New file
@@ -0,0 +1,52 @@
import request from '@/utils/request'
// 查询IoT设备列表
export function listIot(query) {
  return request({
    url: '/oa/iot/list',
    method: 'get',
    params: query
  })
}
// 查询IoT设备详细
export function getIot(id) {
  return request({
    url: '/oa/iot/' + id,
    method: 'get'
  })
}
// 新增IoT设备
export function addIot(data) {
  return request({
    url: '/oa/iot',
    method: 'post',
    data: data
  })
}
// 修改IoT设备
export function updateIot(data) {
  return request({
    url: '/oa/iot',
    method: 'put',
    data: data
  })
}
// 删除IoT设备
export function delIot(id) {
  return request({
    url: '/oa/iot/' + id,
    method: 'delete'
  })
}
// 查询IoT设备外设数量
export function numberList(query) {
  return request({
    url: '/oa/iot/number',
    method: 'get',
    params: query
  })
}
src/views/components/peripheralUnit/index.vue
New file
@@ -0,0 +1,83 @@
<template>
  <div>
    <el-input placeholder="请选择" :value="name" disabled>
      <el-button slot="append" icon="el-icon-thumb" @click="handleClick"></el-button>
    </el-input>
    <el-dialog title="外设单元" :visible.sync="open" width="800px" :append-to-body="true" :destroy-on-close="true">
      <peripheral-unit-list v-if="open" ref="peripheralRef"></peripheral-unit-list>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="open = false">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import peripheralUnitList from "./list";
import {getPeripheralUnit} from "@/api/oa/peripheralUnit";
/**
 * 外设单元
 */
export default {
  name: "manufacturerInput",
  components: {
    peripheralUnitList
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  watch: {
    'value': function (v) {
      if (v) {
        getPeripheralUnit(v).then(response => {
          this.name = response.data.name;
        });
      } else {
        this.name = '';
      }
    }
  },
  created() {
    if (this.value) {
      getPeripheralUnit(this.value).then(response => {
        this.name = response.data.name;
      });
    }
  },
  methods: {
    handleClick() {
      this.open = true;
    },
    submitForm() {
      const row = this.$refs.peripheralRef.currentRow;
      if (!row) {
        this.$message.warning("请选择一条数据")
        this.buttonLoading = false;
        return;
      }
      this.name = row.name;
      this.open = false;
      this.$emit("change", row.id);
    }
  }
}
</script>
<style scoped>
</style>
src/views/components/peripheralUnit/list.vue
New file
@@ -0,0 +1,123 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="外设代码" prop="code">
        <el-input
          v-model="queryParams.code"
          placeholder="请输入外设代码"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="外设名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入外设名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </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>
    <el-table v-loading="loading" :data="peripheralUnitList" highlight-current-row
              @current-change="handleCurrentChange">
      <el-table-column label="序号" align="center" width="50">
        <template slot-scope="scope">
          <span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span>
        </template>
      </el-table-column>
      <el-table-column label="外设代码" width="80" align="center" prop="code"/>
      <el-table-column label="外设名称" align="center" prop="name" show-overflow-tooltip/>
      <el-table-column label="规格型号" align="center" prop="model" min-width="60"/>
      <el-table-column label="生产厂商" align="center" prop="manufacturer_dictText"/>
      <el-table-column label="厂商代码" width="100" align="center" prop="vendorCode_dictText"/>
      <el-table-column label="波特率" width="100" align="center" prop="baudRate">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT103" :value="scope.row.baudRate"/>
        </template>
      </el-table-column>
      <el-table-column label="问询指令" align="center" width="220" prop="readInstruction"/>
      <el-table-column label="指令长度" width="80" align="center" prop="orderLength"/>
      <el-table-column label="返回长度" width="80" align="center" prop="loopLength"/>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { listPeripheralUnit} from "@/api/oa/peripheralUnit";
export default {
  name: "PeripheralUnit",
  dicts: ['DICT103'],
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 外设单元表格数据
      peripheralUnitList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        code: undefined,
        name: undefined
      },
      currentRow: undefined
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询外设单元列表 */
    getList() {
      this.loading = true;
      listPeripheralUnit(this.queryParams).then(response => {
        this.peripheralUnitList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleCurrentChange(v) {
      this.currentRow = v;
    }
  }
};
</script>
src/views/construction/constructionList/index.vue
@@ -13,7 +13,9 @@
          <el-tab-pane label="NVR设备" name="third">
            <nvr v-if="activeName === 'third'" :schoolId="schoolId"></nvr>
          </el-tab-pane>
          <el-tab-pane label="IoT设备" name="fourth">IoT设备</el-tab-pane>
          <el-tab-pane label="IoT设备" name="fourth">
            <iot v-if="activeName === 'fourth'" :schoolId="schoolId"></iot>
          </el-tab-pane>
          <el-tab-pane label="AI设备" name="five">AI设备</el-tab-pane>
          <el-tab-pane label="交换设备" name="six">交换设备</el-tab-pane>
          <el-tab-pane label="服务器" name="seven">服务器</el-tab-pane>
@@ -41,6 +43,7 @@
import reserveIp from '../reserveIp'
import nvr from '../nvr'
import ipc from '../ipc'
import iot from '../iot'
export default {
  name: "constructionList",
@@ -49,7 +52,8 @@
    constructionBatch,
    reserveIp,
    nvr,
    ipc
    ipc,
    iot
  },
  data() {
    return {
src/views/construction/iot/index.vue
New file
@@ -0,0 +1,534 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="部署名称" prop="deploymentName">
        <el-input
            v-model="queryParams.deploymentName"
            placeholder="请输入部署名称"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="版本" prop="edition">
        <el-select v-model="queryParams.edition" placeholder="请选择版本">
          <el-option
              v-for="dict in dict.type.DICT110"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="安装位置" prop="buildingId">
        <building v-model="queryParams.buildingId" :schoolId="schoolId"></building>
      </el-form-item>
      <el-form-item label="所属单位" prop="organizationId">
        <organization v-model="queryParams.organizationId" :schoolId="schoolId"></organization>
      </el-form-item>
      <el-form-item label="施工批次" prop="constructionBatchId">
        <construction-batch v-model="queryParams.constructionBatchId" :schoolId="schoolId"></construction-batch>
      </el-form-item>
      <el-form-item label="监控对象" prop="monitorObject">
        <el-input
            v-model="queryParams.monitorObject"
            placeholder="请输入监控对象"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="通道" prop="passageway">
        <el-select v-model="queryParams.passageway" placeholder="请选择通道" clearable size="small">
          <el-option
              v-for="dict in dict.type.DICT111"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="外设" prop="peripheralUnit">
        <peripheralUnit v-model="queryParams.peripheralUnit"></peripheralUnit>
      </el-form-item>
      <el-form-item label="外设数量">
        <el-input v-model="sum" disabled/>
      </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>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['oa:iot:add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="success"
            plain
            icon="el-icon-edit"
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['oa:iot:edit']"
        >修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="danger"
            plain
            icon="el-icon-delete"
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['oa:iot:remove']"
        >删除
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="iotList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="序号" align="center" width="50">
        <template slot-scope="scope">
          <span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span>
        </template>
      </el-table-column>
      <el-table-column label="部署名称" align="center" prop="deploymentName"/>
      <el-table-column label="版本" align="center" prop="edition">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT110" :value="scope.row.edition"/>
        </template>
      </el-table-column>
      <el-table-column label="LAN" align="center" prop="lan"/>
      <el-table-column label="IP" align="center" prop="ip"/>
      <el-table-column label="通道1" align="center" prop="passagewayOne_dictText"/>
      <el-table-column label="通道2" align="center" prop="passagewayTwo_dictText"/>
      <el-table-column label="通道3" align="center" prop="passagewayThree_dictText"/>
      <el-table-column label="通道4" align="center" prop="passagewayFour_dictText"/>
      <el-table-column label="安装位置" align="center" prop="buildingId_dictText"/>
      <el-table-column label="所属单位" align="center" prop="organizationId_dictText"/>
      <el-table-column label="施工批次" align="center" prop="constructionBatchId_dictText"/>
<!--      <el-table-column label="序列号" align="center" prop="serialNumber"/>-->
<!--      <el-table-column label="型号" align="center" prop="model"/>-->
      <el-table-column label="生产厂商" align="center" prop="manufacturerId_dictText"/>
      <el-table-column label="监控对象" align="center" prop="monitorObject"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click="handleInfo(scope.row)"
              v-hasPermi="['oa:iot:edit']"
          >查看
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['oa:iot:edit']"
          >修改
          </el-button>
          <el-button
              size="mini"
              type="text"
              class="del-btn"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['oa:iot:remove']"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
    />
    <!-- 添加或修改IoT设备对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="700px" :append-to-body="true" :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="disabled">
        <el-row>
          <el-col :span="12">
            <el-form-item label="部署名称" prop="deploymentName">
              <el-input v-model="form.deploymentName" maxlength="64" show-word-limit placeholder="请输入部署名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="版本" prop="edition">
              <el-select v-model="form.edition" placeholder="请选择版本">
                <el-option
                    v-for="dict in dict.type.DICT110"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="LAN" prop="lan">
              <el-input v-model="form.lan" placeholder="请输入LAN"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="IP" prop="ip">
              <el-input v-model="form.ip" placeholder="请输入IP"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="通道1" prop="passagewayOne">
              <peripheralUnit v-if="open" v-model="form.passagewayOne"></peripheralUnit>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="通道2" prop="passagewayTwo">
              <peripheralUnit v-if="open" v-model="form.passagewayTwo"></peripheralUnit>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="通道3" prop="passagewayThree">
              <peripheralUnit v-if="open" v-model="form.passagewayThree"></peripheralUnit>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="通道4" prop="passagewayFour">
              <peripheralUnit v-if="open" v-model="form.passagewayFour"></peripheralUnit>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="安装位置" prop="buildingId">
          <building v-if="open" v-model="form.buildingId" :schoolId="schoolId"></building>
        </el-form-item>
        <el-form-item label="所属单位" prop="organizationId">
          <organization v-if="open" v-model="form.organizationId" :schoolId="schoolId"></organization>
        </el-form-item>
        <el-form-item label="施工批次" prop="constructionBatchId">
          <constructionBatch v-if="open" v-model="form.constructionBatchId" :schoolId="schoolId"></constructionBatch>
        </el-form-item>
        <el-form-item label="序列号" prop="serialNumber">
          <el-input v-model="form.serialNumber" maxlength="64" show-word-limit placeholder="请输入序列号"/>
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="型号" prop="model">
              <el-input v-model="form.model" maxlength="64" show-word-limit placeholder="请输入型号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生产厂商" prop="manufacturerId">
              <manufacturer v-if="open" v-model="form.manufacturerId"></manufacturer>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="监控对象" prop="monitorObject">
          <el-input v-model="form.monitorObject" type="textarea" maxlength="512" show-word-limit :rows="8" placeholder="请输入内容"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm" :disabled="disabled">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {listIot, getIot, delIot, addIot, updateIot, numberList} from "@/api/oa/iot";
import building from "../../components/building";
import organization from "../../components/organization";
import constructionBatch from "../../components/constructionBatch";
import manufacturer from "../../components/manufacturer";
import peripheralUnit from '../../components/peripheralUnit'
export default {
  name: "Iot",
  dicts: ['DICT111', 'DICT110'],
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  components: {
    building,
    organization,
    constructionBatch,
    manufacturer,
    peripheralUnit
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // IoT设备表格数据
      iotList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        deploymentName: undefined,
        edition: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        monitorObject: undefined,
        passageway: undefined,
        peripheralUnit: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        deploymentName: [
          {required: true, message: "部署名称不能为空", trigger: "blur"}
        ],
        edition: [
          {required: true, message: "版本不能为空", trigger: "blur"}
        ],
        lan: [
          {required: true, message: "LAN不能为空", trigger: "blur"},
          {
            pattern: /^[A-F0-9]{2}(-[A-F0-9]{2}){5}$|^[A-F0-9]{2}(:[A-F0-9]{2}){5}$|^[A-F0-9]{12}$|^[A-F0-9]{4}(\.[A-F0-9]{4}){2}$/,
            message: "请输入正确的LAN",
            trigger: "blur"
          }
        ],
        ip: [
          {required: true, message: "IP不能为空", trigger: "blur"},
          {
            pattern: /^(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])\.(\d|[1-9]\d|1\d{2}|2[0-5][0-5])$/,
            message: "请输入正确的ip地址",
            trigger: "blur"
          }
        ],
        buildingId: [
          {required: true, message: "安装位置不能为空", trigger: "blur"}
        ],
        organizationId: [
          {required: true, message: "所属单位不能为空", trigger: "blur"}
        ],
        constructionBatchId: [
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
      },
      disabled: false,
      sum: undefined
    };
  },
  computed: {
    getPassageway() {
      return this.queryParams.passageway
    },
    getPeripheralUnit() {
      return this.queryParams.peripheralUnit
    }
  },
  watch: {
    'schoolId': function () {
      this.getList()
    },
    getPassageway: function (v) {
      if (v && this.queryParams.peripheralUnit) {
        this.getNum();
      }
    },
    getPeripheralUnit: function (v) {
      if (v && this.queryParams.passageway) {
        this.getNum();
      }
    }
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询IoT设备列表 */
    getList() {
      this.loading = true;
      listIot(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.iotList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
      if (this.queryParams.peripheralUnit && this.queryParams.passageway) {
        this.getNum();
      }
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        deploymentName: undefined,
        edition: undefined,
        lan: undefined,
        ip: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        serialNumber: undefined,
        model: undefined,
        manufacturerId: undefined,
        monitorObject: undefined,
        passagewayOne: undefined,
        passagewayTwo: undefined,
        passagewayThree: undefined,
        passagewayFour: undefined,
        createBy: undefined,
        createTime: undefined,
        updateBy: undefined,
        updateTime: undefined,
        delFlag: undefined
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.disabled = false;
      this.open = true;
      this.title = "添加IoT设备";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getIot(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改IoT设备";
      });
    },
    handleInfo(row) {
      this.loading = true;
      this.disabled = true;
      this.reset();
      getIot(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "IoT设备详情";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateIot(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addIot(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除IoT设备编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delIot(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/iot/export', {
        ...this.queryParams
      }, `iot_${new Date().getTime()}.xlsx`)
    },
    // 获取外设数量
    getNum() {
      numberList(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(res => {
        this.sum = res.data;
      })
    }
  }
};
</script>