liuchengxin
2022-05-27 d138b7df8fa97dc7ed6b07acdfef804ebb186a74
src/views/construction/iot/index.vue
@@ -23,40 +23,45 @@
      <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>
     <template v-if="showMoreCondition">
       <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>
     </template>
      <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>
        <div class="show-more-search">
          <ShowMore :showMoreCondition.sync="showMoreCondition"></ShowMore>
          <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>
        </div>
      </el-form-item>
    </el-form>
@@ -68,7 +73,6 @@
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['oa:iot:add']"
        >新增
        </el-button>
      </el-col>
@@ -80,7 +84,6 @@
            size="mini"
            :disabled="single"
            @click="handleUpdate"
            v-hasPermi="['oa:iot:edit']"
        >修改
        </el-button>
      </el-col>
@@ -92,7 +95,6 @@
            size="mini"
            :disabled="multiple"
            @click="handleDelete"
            v-hasPermi="['oa:iot:remove']"
        >删除
        </el-button>
      </el-col>
@@ -105,25 +107,25 @@
          <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" min-width="300" 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" min-width="150" prop="lan"/>
      <el-table-column label="IP" align="center" min-width="120" prop="ip"/>
      <el-table-column label="通道1" align="center" min-width="180" prop="passagewayOne_dictText"/>
      <el-table-column label="通道2" align="center" min-width="180" prop="passagewayTwo_dictText"/>
      <el-table-column label="通道3" align="center" min-width="180" prop="passagewayThree_dictText"/>
      <el-table-column label="通道4" align="center" min-width="180" prop="passagewayFour_dictText"/>
      <el-table-column label="安装位置" min-width="180" align="center" prop="buildingId_dictText"/>
      <el-table-column label="所属单位" min-width="180" align="center" prop="organizationId_dictText"/>
      <el-table-column label="施工批次" min-width="150" 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="LAN" align="center" min-width="150" prop="lan"/>-->
      <el-table-column label="IP" align="center" min-width="130" prop="ip"/>
      <el-table-column label="监控对象" align="center" min-width="220" prop="monitorObject"/>
      <el-table-column label="序列号" align="center" min-width="220" prop="serialNumber"/>
      <el-table-column label="生产厂商" align="center" min-width="220" prop="manufacturerId_dictText"/>
      <el-table-column label="监控对象" align="center" min-width="180" prop="monitorObject"/>
      <el-table-column label="安装位置" min-width="240" align="center" prop="buildingId_dictText"/>
<!--      <el-table-column label="通道1" align="center" min-width="180" prop="passagewayOne_dictText"/>-->
<!--      <el-table-column label="通道2" align="center" min-width="180" prop="passagewayTwo_dictText"/>-->
<!--      <el-table-column label="通道3" align="center" min-width="180" prop="passagewayThree_dictText"/>-->
<!--      <el-table-column label="通道4" align="center" min-width="180" prop="passagewayFour_dictText"/>-->
<!--      <el-table-column label="所属单位" min-width="180" align="center" prop="organizationId_dictText"/>-->
<!--      <el-table-column label="施工批次" min-width="150" align="center" prop="constructionBatchId_dictText"/>-->
<!--      <el-table-column label="型号" align="center" prop="model"/>-->
      <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
@@ -138,7 +140,6 @@
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['oa:iot:edit']"
          >修改
          </el-button>
          <el-button
@@ -147,7 +148,6 @@
              class="del-btn"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['oa:iot:remove']"
          >删除
          </el-button>
        </template>
@@ -263,6 +263,7 @@
import constructionBatch from "../../components/constructionBatch";
import manufacturer from "../../components/manufacturer";
import peripheralUnit from '../../components/peripheralUnit'
import ShowMore from "@/views/components/showMore";
export default {
  name: "Iot",
@@ -278,7 +279,8 @@
    organization,
    constructionBatch,
    manufacturer,
    peripheralUnit
    peripheralUnit,
    ShowMore
  },
  data() {
    return {
@@ -331,7 +333,7 @@
        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}$/,
            pattern: /^[0-9a-fA-F:]*$/,
            message: "请输入正确的LAN",
            trigger: "blur"
          }
@@ -340,7 +342,7 @@
          {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地址",
            message: "请输入正确的ip地址,文本范围 0~9、.",
            trigger: "blur"
          }
        ],
@@ -355,7 +357,8 @@
        ],
      },
      disabled: false,
      sum: undefined
      sum: undefined,
      showMoreCondition: false
    };
  },
  computed: {
@@ -505,7 +508,7 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除IoT设备编号为"' + ids + '"的数据项?').then(() => {
      this.$modal.confirm('是否确认删除?').then(() => {
        this.loading = true;
        return delIot(ids);
      }).then(() => {