唐耀东
2022-05-12 35668474b65be39a277d7cb53693022b482e17ca
提交代码
8个文件已修改
15个文件已添加
2358 ■■■■■ 已修改文件
src/api/oa/ipc.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/nvr.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/organization.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basics/building/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basics/organization/index.vue 292 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basics/school/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/building/buildList.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/building/form.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/building/index.vue 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/constructionBatch/index.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/constructionBatch/list.vue 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/manufacturer/index.vue 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/manufacturer/list.vue 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/nvr/index.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/nvr/list.vue 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/organization/form.vue 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/organization/index.vue 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/organization/organizationList.vue 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/constructionBatch/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/constructionList/index.vue 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/ipc/index.vue 413 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/nvr/index.vue 527 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/reserveIp/index.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/ipc.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询ipc设备列表
export function listIpc(query) {
  return request({
    url: '/oa/ipc/list',
    method: 'get',
    params: query
  })
}
// 查询ipc设备详细
export function getIpc(id) {
  return request({
    url: '/oa/ipc/' + id,
    method: 'get'
  })
}
// 新增ipc设备
export function addIpc(data) {
  return request({
    url: '/oa/ipc',
    method: 'post',
    data: data
  })
}
// 修改ipc设备
export function updateIpc(data) {
  return request({
    url: '/oa/ipc',
    method: 'put',
    data: data
  })
}
// 删除ipc设备
export function delIpc(id) {
  return request({
    url: '/oa/ipc/' + id,
    method: 'delete'
  })
}
src/api/oa/nvr.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询NVR设备列表
export function listNvr(query) {
  return request({
    url: '/oa/nvr/list',
    method: 'get',
    params: query
  })
}
// 查询NVR设备详细
export function getNvr(id) {
  return request({
    url: '/oa/nvr/' + id,
    method: 'get'
  })
}
// 新增NVR设备
export function addNvr(data) {
  return request({
    url: '/oa/nvr',
    method: 'post',
    data: data
  })
}
// 修改NVR设备
export function updateNvr(data) {
  return request({
    url: '/oa/nvr',
    method: 'put',
    data: data
  })
}
// 删除NVR设备
export function delNvr(id) {
  return request({
    url: '/oa/nvr/' + id,
    method: 'delete'
  })
}
src/api/oa/organization.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询高校组织机构列表
export function listOrganization(query) {
  return request({
    url: '/oa/organization/list',
    method: 'get',
    params: query
  })
}
// 查询高校组织机构详细
export function getOrganization(id) {
  return request({
    url: '/oa/organization/' + id,
    method: 'get'
  })
}
// 新增高校组织机构
export function addOrganization(data) {
  return request({
    url: '/oa/organization',
    method: 'post',
    data: data
  })
}
// 修改高校组织机构
export function updateOrganization(data) {
  return request({
    url: '/oa/organization',
    method: 'put',
    data: data
  })
}
// 删除高校组织机构
export function delOrganization(id) {
  return request({
    url: '/oa/organization/' + id,
    method: 'delete'
  })
}
src/views/basics/building/index.vue
@@ -33,7 +33,6 @@
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
            v-hasPermi="['oa:building:add']"
        >新增
        </el-button>
      </el-col>
@@ -56,7 +55,6 @@
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['oa:building:edit']"
          >修改
          </el-button>
          <el-button
@@ -64,7 +62,6 @@
              type="text"
              icon="el-icon-plus"
              @click="handleAdd(scope.row)"
              v-hasPermi="['oa:building:add']"
          >新增
          </el-button>
          <el-button
@@ -73,7 +70,6 @@
              class="del-btn"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['oa:building:remove']"
          >删除
          </el-button>
        </template>
@@ -81,7 +77,7 @@
    </el-table>
    <!-- 添加或修改建筑单元对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
    <el-dialog :title="title" :visible.sync="open" width="500px" :append-to-body="true" :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="上级单元" prop="parentId">
          <treeselect v-model="form.parentId" :options="buildingOptions" :normalizer="normalizer"
@@ -256,9 +252,9 @@
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        this.form.schoolId = this.schoolId;
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateBuilding(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
src/views/basics/organization/index.vue
New file
@@ -0,0 +1,292 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <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-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="mini"
            @click="handleAdd"
        >新增
        </el-button>
      </el-col>
    </el-row>
    <el-table
        v-loading="loading"
        :data="organizationList"
        row-key="id"
        default-expand-all
        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    >
      <el-table-column label="机构名称" align="center" prop="name"/>
      <el-table-column label="机构编号" prop="code"/>
      <el-table-column label="显示顺序" align="center" prop="orderNum"/>
      <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-edit"
              @click="handleUpdate(scope.row)"
          >修改
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-plus"
              @click="handleAdd(scope.row)"
          >新增
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
          >删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 添加或修改高校组织机构对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" :append-to-body="true" :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="上级机构" prop="parentId">
          <treeselect v-model="form.parentId" :options="organizationOptions" :normalizer="normalizer"
                      placeholder="请选择父级id"/>
        </el-form-item>
        <el-form-item label="机构名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入机构名称"/>
        </el-form-item>
        <el-form-item label="机构编号" prop="code">
          <el-input v-model="form.code" placeholder="请输入机构编号"/>
        </el-form-item>
        <el-form-item label="显示顺序" prop="orderNum">
          <el-input-number v-model="form.orderNum" controls-position="right" :min="0"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import {
  listOrganization,
  getOrganization,
  delOrganization,
  addOrganization,
  updateOrganization
} from "@/api/oa/organization";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  name: "Organization",
  components: {
    Treeselect
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 高校组织机构表格数据
      organizationList: [],
      // 高校组织机构树选项
      organizationOptions: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        name: null,
        schoolId: this.schoolId
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        code: [
          {required: true, message: "机构编号不能为空", trigger: "blur"}
        ],
        name: [
          {required: true, message: "机构名称不能为空", trigger: "blur"}
        ],
        schoolId: [
          {required: true, message: "高校不能为空", trigger: "blur"}
        ],
        parentId: [
          {required: true, message: "父级id不能为空", trigger: "blur"}
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询高校组织机构列表 */
    getList() {
      this.loading = true;
      listOrganization(this.queryParams).then(response => {
        this.organizationList = this.handleTree(response.data, "id", "parentId");
        this.loading = false;
      });
    },
    /** 转换高校组织机构数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.name,
        children: node.children
      };
    },
    /** 查询高校组织机构下拉树结构 */
    getTreeselect() {
      listOrganization().then(response => {
        this.organizationOptions = [];
        const data = {id: 0, name: '顶级节点', children: []};
        data.children = this.handleTree(response.data, "id", "parentId");
        this.organizationOptions.push(data);
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        code: null,
        name: null,
        detailedName: null,
        schoolId: null,
        parentId: null,
        ancestors: null,
        orderNum: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        delFlag: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd(row) {
      this.reset();
      this.getTreeselect();
      if (row != null && row.id) {
        this.form.parentId = row.id;
      } else {
        this.form.parentId = 0;
      }
      this.open = true;
      this.title = "添加高校组织机构";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      this.getTreeselect();
      if (row != null) {
        this.form.parentId = row.id;
      }
      getOrganization(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改高校组织机构";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateOrganization(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addOrganization(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      this.$modal.confirm('是否确认删除高校组织机构编号为"' + row.id + '"的数据项?').then(() => {
        this.loading = true;
        return delOrganization(row.id);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    }
  }
};
</script>
src/views/basics/school/index.vue
@@ -143,6 +143,13 @@
          <el-button
              size="mini"
              type="text"
              icon="el-icon-wind-power"
              @click="handleOrganization(scope.row)"
          >机构
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-office-building"
              @click="handleBuild(scope.row)"
          >建筑
@@ -235,9 +242,15 @@
        <el-button @click="cancel">取 消</el-button>
      </div>
    </Dialog>
    <!-- 建筑 -->
    <el-drawer title="建筑单元" :visible.sync="buildOpen" size="50%" :append-to-body="true" :destroy-on-close="true">
      <building :schoolId="id"></building>
    </el-drawer>
    <!-- 组织机构 -->
    <el-drawer title="组织机构" :visible.sync="organizationOpen" size="50%" :append-to-body="true" :destroy-on-close="true">
      <organization :schoolId="id"></organization>
    </el-drawer>
  </div>
</template>
@@ -246,12 +259,14 @@
import {listSchool, getSchool, delSchool, addSchool, updateSchool} from "@/api/oa/school";
import {listProvince, listCity} from "@/api/common/common";
import building from '../building'
import organization from '../organization'
export default {
  name: "School",
  dicts: ['DICT105', 'DICT106'],
  components: {
    building
    building,
    organization
  },
  data() {
    return {
@@ -324,6 +339,7 @@
      // 城市
      cityFormList: [],
      buildOpen: false,
      organizationOpen: false,
      id: undefined
    };
  },
@@ -489,6 +505,11 @@
    handleBuild(r) {
      this.id = r.id;
      this.buildOpen = true;
    },
    // 组织机构
    handleOrganization(r) {
      this.id = r.id;
      this.organizationOpen = true;
    }
  }
};
src/views/components/building/buildList.vue
@@ -73,10 +73,8 @@
      currentRow: undefined
    };
  },
  watch: {
    'schoolId': function (v) {
  mounted() {
      this.getList()
    }
  },
  methods: {
    /** 查询建筑单元列表 */
src/views/components/building/form.vue
@@ -19,6 +19,7 @@
<script>
/**
 * !!!暂时弃用
 * 选择建筑单元
 */
import school from '../../components/school'
src/views/components/building/index.vue
@@ -1,21 +1,28 @@
<template>
  <div>
    <el-input placeholder="请选择适用地点" :value="buildingName" disabled>
    <el-input placeholder="请选择" :value="name" disabled>
      <el-button slot="append" icon="el-icon-thumb" @click="handleBuilding"></el-button>
    </el-input>
    <el-dialog title="建筑单元" :visible.sync="open" width="800px" :append-to-body="true" :destroy-on-close="true">
      <building-form @choice="choice"></building-form>
      <buildList v-if="open" ref="buildRef" :schoolId="schoolId"></buildList>
      <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 buildingForm from './form'
import buildList from "./buildList";
import { getBuilding } from "@/api/oa/building";
/**
 * 高校建筑单元
 */
export default {
  name: "BuildInput",
  components: {
    buildingForm
    buildList
  },
  model: {
    prop: 'value',
@@ -26,12 +33,22 @@
      type: [Number],
      default: undefined
    },
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      message: undefined,
      open: false,
      buildingName: ''
      name: ''
    }
  },
  created() {
    if (this.value) {
      getBuilding(this.value).then(response => {
        this.name = response.data.name;
      });
    }
  },
  methods: {
@@ -39,11 +56,16 @@
    handleBuilding() {
      this.open = true;
    },
    // 选中建筑单元
    choice(r) {
      this.buildingName = r.name;
    submitForm() {
      if (!this.$refs.buildRef.currentRow) {
        this.$message.warning("请选择一条数据")
        this.buttonLoading = false;
        return;
      }
      const row = this.$refs.buildRef.currentRow;
      this.name = row.name;
      this.open = false;
      this.$emit("change", r.id);
      this.$emit("change", row.id);
    }
  }
}
src/views/components/constructionBatch/index.vue
New file
@@ -0,0 +1,74 @@
<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">
      <construction-batch-form v-if="open" ref="batchRef" :schoolId="schoolId"></construction-batch-form>
      <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 constructionBatchForm from './list'
import { getConstructionBatch } from "@/api/oa/constructionBatch";
export default {
  name: "BuildInput",
  components: {
    constructionBatchForm
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    },
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  created() {
    if (this.value) {
      getConstructionBatch(this.value).then(response => {
        this.name = response.data.batch;
      });
    }
  },
  methods: {
    // 选择
    handleClick() {
      this.open = true;
    },
    // 确定
    submitForm() {
      const row = this.$refs.batchRef.currentRow;
      if (!row) {
        this.$message.warning("请选择一条数据")
        return;
      }
      this.name = row.batch;
      this.open = false;
      this.$emit("change", row.id);
    }
  }
}
</script>
<style scoped>
</style>
src/views/components/constructionBatch/list.vue
New file
@@ -0,0 +1,116 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="施工批次" prop="batch">
        <el-input
          v-model="queryParams.batch"
          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="constructionBatchList" highlight-current-row
              @current-change="handleCurrentChange">
      <el-table-column label="序号" type="index" align="center">
        <template slot-scope="scope">
          <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="施工批次" align="center" prop="batch" />
      <el-table-column label="施工周期" align="center" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') + ' - ' + parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="负责人" align="center" prop="userId_dictText" />
      <el-table-column label="团队成员" align="center" prop="teamMembers" />
      <el-table-column label="备注" align="center" prop="remarks" />
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { listConstructionBatch } from "@/api/oa/constructionBatch";
/**
 * 高校施工批次
 */
export default {
  name: "ConstructionBatchForm",
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 施工批次表格数据
      constructionBatchList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        batch: undefined
      },
      currentRow: undefined
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询施工批次列表 */
    getList() {
      this.loading = true;
      listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.constructionBatchList = 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/components/manufacturer/index.vue
New file
@@ -0,0 +1,71 @@
<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">
      <manufacturer-list v-if="open" ref="manufacturerRef"></manufacturer-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 manufacturerList from "./list";
import { getManufacturer } from "@/api/oa/manufacturer";
/**
 * 生产厂商
 */
export default {
  name: "manufacturerInput",
  components: {
    manufacturerList
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  created() {
    if (this.value) {
      getManufacturer(this.value).then(response => {
        this.name = response.data.name;
      });
    }
  },
  methods: {
    handleClick() {
      this.open = true;
    },
    submitForm() {
      const row = this.$refs.manufacturerRef.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/manufacturer/list.vue
New file
@@ -0,0 +1,102 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
      <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 label="厂商代码" prop="code">
        <el-input
          v-model="queryParams.code"
          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="manufacturerList"  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="厂商名称" align="center" prop="name" />
      <el-table-column label="厂商代码" align="center" prop="code" />
      <el-table-column label="联系方式" align="center" prop="phone" />
      <el-table-column label="邮箱" align="center" prop="mailbox" />
      <el-table-column label="联系地址" align="center" prop="contactAddress" show-overflow-tooltip />
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>
<script>
import { listManufacturer } from "@/api/oa/manufacturer";
export default {
  name: "Manufacturer",
  data() {
    return {
      loading: false,
      // 总条数
      total: 0,
      // 厂商表格数据
      manufacturerList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        name: undefined,
        code: undefined
      },
      currentRow: undefined
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询厂商列表 */
    getList() {
      this.loading = true;
      listManufacturer(this.queryParams).then(response => {
        this.manufacturerList = 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/components/nvr/index.vue
New file
@@ -0,0 +1,76 @@
<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="NVR" :visible.sync="open" width="800px" :append-to-body="true" :destroy-on-close="true">
      <nvr-list v-if="open" ref="nvrRef" :schoolId="schoolId"></nvr-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 nvrList from "./list";
import {getNvr} from "@/api/oa/nvr";
/**
 * 高校NVR
 */
export default {
  name: "manufacturerInput",
  components: {
    nvrList
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    },
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  created() {
    if (this.value) {
      getNvr(this.value).then(response => {
        this.name = response.data.deploymentName;
      });
    }
  },
  methods: {
    handleClick() {
      this.open = true;
    },
    submitForm() {
      const row = this.$refs.nvrRef.currentRow;
      if (!row) {
        this.$message.warning("请选择一条数据")
        this.buttonLoading = false;
        return;
      }
      this.name = row.deploymentName;
      this.open = false;
      this.$emit("change", row.id);
    }
  }
}
</script>
<style scoped>
</style>
src/views/components/nvr/list.vue
New file
@@ -0,0 +1,130 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
      <el-form-item label="通道(路)" prop="passageway">
        <el-select v-model="queryParams.passageway" placeholder="请选择通道(路)">
          <el-option
              v-for="dict in dict.type.DICT109"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </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>
    <el-table v-loading="loading" :data="nvrList" 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="部署名称" align="center" prop="deploymentName"/>
      <el-table-column label="通道(路)" align="center" prop="passageway"/>
      <el-table-column label="LAN1" align="center" prop="lanOne"/>
      <el-table-column label="IP" align="center" prop="ipOne"/>
      <el-table-column label="LAN2" align="center" prop="lanTwo"/>
      <el-table-column label="IP" align="center" prop="ipTwo"/>
      <el-table-column label="登录账户" align="center" prop="loginAccount"/>
      <el-table-column label="硬盘" align="center" prop="hardDisk"/>
      <el-table-column label="安装位置" align="center" prop="buildingId"/>
      <el-table-column label="所属单位" align="center" prop="organizationId"/>
      <!--      <el-table-column label="施工批次" align="center" prop="constructionBatchId" />-->
      <!--      <el-table-column label="序列号" align="center" prop="serialNumber" />-->
      <!--      <el-table-column label="型号" align="center" prop="model" />-->
      <!--      <el-table-column label="生产厂商" align="center" prop="manufacturerId" />-->
    </el-table>
    <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
    />
  </div>
</template>
<script>
import {listNvr, getNvr, delNvr, addNvr, updateNvr} from "@/api/oa/nvr";
import building from '../../components/building'
import organization from '../../components/organization'
import constructionBatch from '../../components/constructionBatch'
import manufacturer from '../../components/manufacturer'
export default {
  name: "Nvr",
  dicts: ['DICT109'],
  components: {
    building,
    organization,
    constructionBatch,
    manufacturer
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // NVR设备表格数据
      nvrList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        passageway: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        model: undefined
      },
      currentRow: undefined
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询NVR设备列表 */
    getList() {
      this.loading = true;
      listNvr(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.nvrList = 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/components/organization/form.vue
New file
@@ -0,0 +1,81 @@
<template>
  <div>
    <div class="app-container">
      <div class="tree-view">
        <div class="tree-list">
          <school ref="schoolRef" @schoolChange="schoolChange"></school>
        </div>
        <div class="right-view">
          <organization-list ref="organizationRef" :schoolId="schoolId"></organization-list>
        </div>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<!--      <el-button @click="cancel">取 消</el-button>-->
    </div>
  </div>
</template>
<script>
/**
 * 选择组织机构
 */
import school from '../../components/school'
import organizationList from "./organizationList";
export default {
  name: "organizationForm",
  components: {
    school,
    organizationList
  },
  data() {
    return {
      buttonLoading: false,
      activeName: 'second',
      batchOpen: false,
      ipOpen: false,
      schoolId: undefined
    }
  },
  methods: {
    // 选择高校
    schoolChange(v) {
      this.schoolId = v;
    },
    submitForm() {
      this.buttonLoading = true;
      if (!this.$refs.organizationRef.currentRow) {
        this.$message.warning("请选择一条数据")
        this.buttonLoading = false;
        return;
      }
      this.$emit('choice', this.$refs.organizationRef.currentRow);
    }
  }
}
</script>
<style scoped>
.tree-view {
  display: flex;
  flex-direction: row;
  flex: 1;
}
.tree-list {
  margin-right: 10px;
}
.right-view {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex: 1;
}
.right-view-title-icon {
  display: flex;
  flex-direction: row;
  height: 40px;
  align-items: center;
}
</style>
src/views/components/organization/index.vue
New file
@@ -0,0 +1,76 @@
<template>
  <div>
    <el-input placeholder="请选择" :value="name" disabled>
      <el-button slot="append" icon="el-icon-thumb" @click="handleBuilding"></el-button>
    </el-input>
    <el-dialog title="所属单位" :visible.sync="open" width="800px" :append-to-body="true" :destroy-on-close="true">
      <organization-list v-if="open" ref="organizationRef" :schoolId="schoolId"></organization-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 organizationList from "./organizationList";
import {getOrganization} from "@/api/oa/organization";
/**
 * 高校组织机构
 */
export default {
  name: "OrganizationInput",
  components: {
    organizationList
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    },
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  created() {
    if (this.value) {
      getOrganization(this.value).then(response => {
        this.name = response.data.name;
      });
    }
  },
  methods: {
    // 选择建筑单元
    handleBuilding() {
      this.open = true;
    },
    submitForm() {
      const row = this.$refs.organizationRef.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/organization/organizationList.vue
New file
@@ -0,0 +1,127 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <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
        ref="singleTable"
        v-loading="loading"
        :data="organizationList"
        row-key="id"
        default-expand-all
        :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
        highlight-current-row
        @current-change="handleCurrentChange"
    >
      <el-table-column label="机构名称" align="center" prop="name"/>
      <el-table-column label="机构编号" prop="code"/>
      <el-table-column label="显示顺序" align="center" prop="orderNum"/>
    </el-table>
  </div>
</template>
<script>
import { listOrganization } from "@/api/oa/organization";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
  name: "OrganizationList",
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  components: {
    Treeselect
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 高校组织机构表格数据
      organizationList: [],
      // 高校组织机构树选项
      organizationOptions: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        name: undefined,
        schoolId: this.schoolId
      },
      currentRow: undefined
    };
  },
  mounted() {
    this.getList()
  },
  methods: {
    /** 查询建筑单元列表 */
    getList() {
      this.loading = true;
      // 清空选中状态和数据
      if (this.currentRow) {
        this.$refs.singleTable.setCurrentRow();
        this.currentRow = undefined;
      }
      listOrganization(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.organizationList = this.handleTree(response.data, "id", "parentId");
        this.loading = false;
      });
    },
    /** 转换建筑单元数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.name,
        children: node.children
      };
    },
    /** 查询建筑单元下拉树结构 */
    getTreeselect() {
      listOrganization({schoolId: this.schoolId}).then(response => {
        this.organizationOptions = [];
        const data = {id: 0, name: '顶级节点', children: []};
        data.children = this.handleTree(response.data, "id", "parentId");
        this.organizationOptions.push(data);
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleCurrentChange(v) {
      this.currentRow = v;
    }
  }
};
</script>
src/views/construction/constructionBatch/index.vue
@@ -142,6 +142,12 @@
export default {
  name: "ConstructionBatch",
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
@@ -193,6 +199,11 @@
      userList: []
    };
  },
  watch: {
    'schoolId': function () {
      this.getList()
    }
  },
  created() {
    this.getList();
  },
@@ -200,7 +211,7 @@
    /** 查询施工批次列表 */
    getList() {
      this.loading = true;
      listConstructionBatch(this.queryParams).then(response => {
      listConstructionBatch(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.constructionBatchList = response.rows;
        this.total = response.total;
        this.loading = false;
@@ -278,6 +289,7 @@
        this.form.endDate = this.form.date[1];
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateConstructionBatch(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
src/views/construction/constructionList/index.vue
@@ -7,8 +7,12 @@
      <div class="right-view">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="施工概况" name="first">施工概况</el-tab-pane>
          <el-tab-pane label="IPC设备" name="second">IPC设备</el-tab-pane>
          <el-tab-pane label="NVR设备" name="third">NVR设备</el-tab-pane>
          <el-tab-pane label="IPC设备" name="second">
            <ipc v-if="activeName === 'second'" :schoolId="schoolId"></ipc>
          </el-tab-pane>
          <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="AI设备" name="five">AI设备</el-tab-pane>
          <el-tab-pane label="交换设备" name="six">交换设备</el-tab-pane>
@@ -22,11 +26,11 @@
      </div>
    </div>
    <el-drawer title="施工批次" :visible.sync="batchOpen" size="70%" :append-to-body="true" :destroy-on-close="true">
      <construction-batch></construction-batch>
      <construction-batch :schoolId="schoolId"></construction-batch>
    </el-drawer>
    <el-drawer title="预留IP" :visible.sync="ipOpen" size="70%" :append-to-body="true" :destroy-on-close="true">
      <reserve-ip></reserve-ip>
      <reserve-ip :schoolId="schoolId"></reserve-ip>
    </el-drawer>
  </div>
</template>
@@ -35,25 +39,31 @@
import school from '../../components/school'
import constructionBatch from '../constructionBatch'
import reserveIp from '../reserveIp'
import nvr from '../nvr'
import ipc from '../ipc'
export default {
  name: "constructionList",
  components: {
    school,
    constructionBatch,
    reserveIp
    reserveIp,
    nvr,
    ipc
  },
  data() {
    return {
      activeName: 'second',
      activeName: 'first',
      batchOpen: false,
      ipOpen: false
      ipOpen: false,
      schoolId: undefined
    }
  },
  methods: {
    // 选择高校
    schoolChange(v) {
      this.schoolId = v;
      this.activeName = 'first';
    },
    handleClick(tab, event) {
      console.log(tab, event);
@@ -68,15 +78,18 @@
  flex-direction: row;
  flex: 1;
}
.tree-list {
  margin-right: 10px;
}
.right-view {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex: 1;
}
.right-view-title-icon {
  display: flex;
  flex-direction: row;
src/views/construction/ipc/index.vue
New file
@@ -0,0 +1,413 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="NVR" prop="nvrId">
        <nvr v-model="queryParams.nvrId" :schoolId="schoolId"></nvr>
      </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="model">
        <el-input
          v-model="queryParams.model"
          placeholder="请输入型号"
          @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-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:ipc: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:ipc: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:ipc:remove']"
        >删除</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="ipcList" @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="MAC" align="center" prop="mac" />
      <el-table-column label="IP" align="center" prop="ip" />
      <el-table-column label="端口" align="center" prop="port" />
      <el-table-column label="登录账户" align="center" prop="loginAccount" />
      <el-table-column label="NVR" align="center" prop="nvrId_dictText" />
      <el-table-column label="通道" align="center" prop="passageway_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" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['oa:ipc:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            class="del-btn"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['oa:ipc: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"
    />
    <!-- 添加或修改ipc设备对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="700px" :append-to-body="true" :close-on-click-modal="false" :destroy-on-close="true">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-row>
          <el-col :span="9">
            <el-form-item label="MAC" prop="mac">
              <el-input v-model="form.mac" placeholder="请输入MAC" />
            </el-form-item>
          </el-col>
          <el-col :span="9">
            <el-form-item label="IP" prop="ip">
              <el-input v-model="form.ip" placeholder="请输入IP" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="端口" prop="port">
              <el-input-number v-model="form.port" controls-position="right" :min="0" :max="65535"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="登录账户" prop="loginAccount">
          <el-input v-model="form.loginAccount" maxlength="64" show-word-limit placeholder="请输入登录账号"/>
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="nvr" prop="nvrId">
              <nvr v-if="open" v-model="form.nvrId"  :schoolId="schoolId"></nvr>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="通道" prop="passageway">
              <el-select v-model="form.passageway" placeholder="请选择通道(路)">
                <el-option
                    v-for="dict in dict.type.DICT109"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                />
              </el-select>
            </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>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { listIpc, getIpc, delIpc, addIpc, updateIpc } from "@/api/oa/ipc";
import building from "../../components/building";
import organization from "../../components/organization";
import constructionBatch from "../../components/constructionBatch";
import manufacturer from "../../components/manufacturer";
import nvr from '../../components/nvr'
export default {
  name: "Ipc",
  dicts: ['DICT109'],
  components: {
    building,
    organization,
    constructionBatch,
    manufacturer,
    nvr
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // ipc设备表格数据
      ipcList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        nvrId: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        model: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          { required: true, message: "不能为空", trigger: "blur" }
        ],
        mac: [
          { required: true, message: "mac不能为空", 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: "请输入正确的MAC",
            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"
          }
        ],
        port: [
          { required: true, message: "端口不能为空", trigger: "blur" }
        ],
        loginAccount: [
          { required: true, message: "登录账户不能为空", trigger: "blur" }
        ],
        buildingId: [
          { required: true, message: "安装位置不能为空", trigger: "blur" }
        ],
        organizationId: [
          { required: true, message: "所属单位不能为空", trigger: "blur" }
        ],
        constructionBatchId: [
          { required: true, message: "施工批次不能为空", trigger: "blur" }
        ],
      }
    };
  },
  watch: {
    'schoolId': function () {
      this.getList()
    }
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询ipc设备列表 */
    getList() {
      this.loading = true;
      listIpc(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.ipcList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        mac: undefined,
        ip: undefined,
        port: undefined,
        loginAccount: undefined,
        nvrId: undefined,
        passageway: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        serialNumber: undefined,
        model: undefined,
        manufacturerId: undefined,
        createTime: undefined,
        createBy: 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.open = true;
      this.title = "添加ipc设备";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.reset();
      const id = row.id || this.ids
      getIpc(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改ipc设备";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateIpc(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addIpc(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('是否确认删除ipc设备编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delIpc(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/ipc/export', {
        ...this.queryParams
      }, `ipc_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
src/views/construction/nvr/index.vue
New file
@@ -0,0 +1,527 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
      <el-form-item label="通道(路)" prop="passageway">
        <el-select v-model="queryParams.passageway" placeholder="请选择通道(路)">
          <el-option
              v-for="dict in dict.type.DICT109"
              :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="model">
        <el-input
            v-model="queryParams.model"
            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-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:nvr: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:nvr: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:nvr:remove']"
        >删除
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="nvrList" @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="passageway"/>
      <el-table-column label="LAN1" align="center" prop="lanOne"/>
      <el-table-column label="IP" align="center" prop="ipOne"/>
      <el-table-column label="LAN2" align="center" prop="lanTwo"/>
      <el-table-column label="IP" align="center" prop="ipTwo"/>
      <el-table-column label="登录账户" align="center" prop="loginAccount"/>
      <el-table-column label="硬盘" align="center" prop="hardDisk"/>
      <el-table-column label="安装位置" align="center" prop="buildingId"/>
      <el-table-column label="所属单位" align="center" prop="organizationId"/>
      <!--      <el-table-column label="施工批次" align="center" prop="constructionBatchId" />-->
      <!--      <el-table-column label="序列号" align="center" prop="serialNumber" />-->
      <!--      <el-table-column label="型号" align="center" prop="model" />-->
      <!--      <el-table-column label="生产厂商" align="center" prop="manufacturerId" />-->
      <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)"
          >查看
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['oa:nvr:edit']"
          >修改
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-folder"
              @click="handleUpload(scope.row)"
          >附件
          </el-button>
          <el-button
              size="mini"
              type="text"
              class="del-btn"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['oa:nvr: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"
    />
    <!-- 添加或修改NVR设备对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="600px" :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="passageway">
              <el-select v-model="form.passageway" placeholder="请选择通道(路)">
                <el-option
                    v-for="dict in dict.type.DICT109"
                    :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="LAN1" prop="lanOne">
              <el-input v-model="form.lanOne" placeholder="请输入LAN1"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="IP" prop="ipOne">
              <el-input v-model="form.ipOne" placeholder="请输入IP"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="LAN2" prop="lanTwo">
              <el-input v-model="form.lanTwo" placeholder="请输入LAN2"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="IP" prop="ipTwo">
              <el-input v-model="form.ipTwo" placeholder="请输入IP"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="登录账号" prop="loginAccount">
              <el-input v-model="form.loginAccount" maxlength="64" show-word-limit placeholder="请输入登录账号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="硬盘" prop="hardDisk">
              <el-input v-model="form.hardDisk" maxlength="64" show-word-limit placeholder="请输入硬盘"/>
            </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>
      <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>
    <!-- 附件 -->
    <Dialog title="附件" :visible.sync="fileOpen" width="500px" :append-to-body="true" :destroy-on-close="true">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="附件" prop="filePath">
          <fileUpload v-model="form.filePath" :limit="1"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </Dialog>
  </div>
</template>
<script>
import {listNvr, getNvr, delNvr, addNvr, updateNvr} from "@/api/oa/nvr";
import building from '../../components/building'
import organization from '../../components/organization'
import constructionBatch from '../../components/constructionBatch'
import manufacturer from '../../components/manufacturer'
export default {
  name: "Nvr",
  dicts: ['DICT109'],
  components: {
    building,
    organization,
    constructionBatch,
    manufacturer
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // NVR设备表格数据
      nvrList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        passageway: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        model: undefined
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        deploymentName: [
          {required: true, message: "部署名称不能为空", trigger: "blur"}
        ],
        passageway: [
          {required: true, message: "通道不能为空", trigger: "blur"}
        ],
        lanOne: [
          {required: true, message: "LAN1不能为空", 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"
          }
        ],
        ipOne: [
          {required: true, message: "ip1不能为空", 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"
          }
        ],
        lanTwo: [
          {required: true, message: "LAN2不能为空", 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"
          }
        ],
        ipTwo: [
          {required: true, message: "ip2不能为空", 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"
          }
        ],
        loginAccount: [
          {required: true, message: "登录账号不能为空", trigger: "blur"}
        ],
        hardDisk: [
          {required: true, message: "硬盘不能为空", trigger: "blur"}
        ],
        buildingId: [
          {required: true, message: "建筑单元不能为空", trigger: "blur"}
        ],
        organizationId: [
          {required: true, message: "所属机构不能为空", trigger: "blur"}
        ],
        constructionBatchId: [
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
        filePath: [
          {required: true, message: "附件不能为空", trigger: "blur"}
        ]
      },
      disabled: false,
      fileOpen: false
    };
  },
  watch: {
    'schoolId': function () {
      this.getList()
    }
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询NVR设备列表 */
    getList() {
      this.loading = true;
      listNvr(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.nvrList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.fileOpen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        deploymentName: undefined,
        passageway: undefined,
        lanOne: undefined,
        ipOne: undefined,
        lanTwo: undefined,
        ipTwo: undefined,
        loginAccount: undefined,
        hardDisk: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        serialNumber: undefined,
        model: undefined,
        manufacturerId: undefined,
        createTime: undefined,
        createBy: 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 = "添加NVR设备";
    },
    handleInfo(row) {
      this.loading = true;
      this.disabled = true;
      this.reset();
      getNvr(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改NVR设备";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getNvr(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改NVR设备";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateNvr(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.fileOpen = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addNvr(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.fileOpen = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除NVR设备编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delNvr(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/nvr/export', {
        ...this.queryParams
      }, `nvr_${new Date().getTime()}.xlsx`)
    },
    // 附件
    handleUpload(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getNvr(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.fileOpen = true;
      });
    }
  }
};
</script>
src/views/construction/reserveIp/index.vue
@@ -106,7 +106,7 @@
          <el-input v-model="form.mac" placeholder="请输入MAC地址" />
        </el-form-item>
        <el-form-item label="适用地点" prop="buildingId">
          <building v-model="form.buildingId"></building>
          <building v-if="open" v-model="form.buildingId" :schoolId="schoolId"></building>
        </el-form-item>
        <el-form-item label="申请日期" prop="applicationDate">
          <el-date-picker clearable size="small"
@@ -116,7 +116,7 @@
          </el-date-picker>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" :rows="8" placeholder="请输入内容" />
          <el-input v-model="form.remarks" type="textarea" :rows="8" maxlength="512" show-word-limit placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -137,6 +137,12 @@
  name: "ReserveIp",
  components: {
    building
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
@@ -186,6 +192,11 @@
      buildOpen: false
    };
  },
  watch: {
    'schoolId': function () {
      this.getList()
    }
  },
  created() {
    this.getList();
  },
@@ -193,7 +204,7 @@
    /** 查询预留IP列表 */
    getList() {
      this.loading = true;
      listReserveIp(this.queryParams).then(response => {
      listReserveIp(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.reserveIpList = response.rows;
        this.total = response.total;
        this.loading = false;
@@ -260,6 +271,7 @@
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateReserveIp(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");