唐耀东
2022-05-13 3bb3488abec439ea977329505633b50ff56bce43
提交代码
8个文件已修改
8个文件已添加
1946 ■■■■■ 已修改文件
src/api/oa/exchange.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/server.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/system.js 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/FileUpload/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/school/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/server/index.vue 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/components/server/list.vue 157 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/ai/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/constructionList/index.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/exchange/index.vue 538 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/iot/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/ipc/index.vue 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/nvr/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/server/index.vue 504 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/construction/system/index.vue 449 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/oa/exchange.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询交换设备列表
export function listExchange(query) {
  return request({
    url: '/oa/exchange/list',
    method: 'get',
    params: query
  })
}
// 查询交换设备详细
export function getExchange(id) {
  return request({
    url: '/oa/exchange/' + id,
    method: 'get'
  })
}
// 新增交换设备
export function addExchange(data) {
  return request({
    url: '/oa/exchange',
    method: 'post',
    data: data
  })
}
// 修改交换设备
export function updateExchange(data) {
  return request({
    url: '/oa/exchange',
    method: 'put',
    data: data
  })
}
// 删除交换设备
export function delExchange(id) {
  return request({
    url: '/oa/exchange/' + id,
    method: 'delete'
  })
}
src/api/oa/server.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询服务器列表
export function listServer(query) {
  return request({
    url: '/oa/server/list',
    method: 'get',
    params: query
  })
}
// 查询服务器详细
export function getServer(id) {
  return request({
    url: '/oa/server/' + id,
    method: 'get'
  })
}
// 新增服务器
export function addServer(data) {
  return request({
    url: '/oa/server',
    method: 'post',
    data: data
  })
}
// 修改服务器
export function updateServer(data) {
  return request({
    url: '/oa/server',
    method: 'put',
    data: data
  })
}
// 删除服务器
export function delServer(id) {
  return request({
    url: '/oa/server/' + id,
    method: 'delete'
  })
}
src/api/oa/system.js
New file
@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询软件系统列表
export function listSystem(query) {
  return request({
    url: '/oa/system/list',
    method: 'get',
    params: query
  })
}
// 查询软件系统详细
export function getSystem(id) {
  return request({
    url: '/oa/system/' + id,
    method: 'get'
  })
}
// 新增软件系统
export function addSystem(data) {
  return request({
    url: '/oa/system',
    method: 'post',
    data: data
  })
}
// 修改软件系统
export function updateSystem(data) {
  return request({
    url: '/oa/system',
    method: 'put',
    data: data
  })
}
// 删除软件系统
export function delSystem(id) {
  return request({
    url: '/oa/system/' + id,
    method: 'delete'
  })
}
src/components/FileUpload/index.vue
@@ -60,7 +60,7 @@
    // 文件类型, 例如['png', 'jpg', 'jpeg']
    fileType: {
      type: Array,
      default: () => ["doc", "xls", "ppt", "txt", "pdf"],
      default: () => ["doc", "xls", "ppt", "txt", "pdf", "zip"],
    },
    // 是否显示提示
    isShowTip: {
src/views/components/school/index.vue
@@ -41,7 +41,6 @@
  },
  methods: {
    getList() {
      this.loading = true;
      listSchool(this.queryParams).then(r => {
        this.list = r.data;
        if (this.list.length > 0) {
src/views/components/server/index.vue
New file
@@ -0,0 +1,87 @@
<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="1000px" :append-to-body="true" :destroy-on-close="true">
      <server-list v-if="open" ref="serverRef" :schoolId="schoolId"></server-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 serverList from "./list";
import {getServer} from "@/api/oa/server";
/**
 * 高校NVR
 */
export default {
  name: "ServerInput",
  components: {
    serverList
  },
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: {
      type: [Number],
      default: undefined
    },
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      open: false,
      name: ''
    }
  },
  watch: {
    'value': function (v) {
      if (v) {
        getServer(v).then(response => {
          this.name = response.data.deploymentName;
        });
      }else {
        this.name = '';
      }
    }
  },
  created() {
    if (this.value) {
      getServer(this.value).then(response => {
        this.name = response.data.deploymentName;
      });
    }
  },
  methods: {
    handleClick() {
      this.open = true;
    },
    submitForm() {
      const row = this.$refs.serverRef.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/server/list.vue
New file
@@ -0,0 +1,157 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="部署位置" prop="buildingId">
        <building v-model="queryParams.buildingId" :schoolId="schoolId"></building>
      </el-form-item>
      <el-form-item label="部署名称" prop="name">
        <el-input v-model="queryParams.deploymentName" placeholder="请输入部署名称" />
      </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 label="生产厂商" prop="manufacturerId">-->
<!--        <manufacturer v-model="queryParams.manufacturerId"></manufacturer>-->
<!--      </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="serverList" 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="deploymentName"/>
      <el-table-column label="LAN" align="center" prop="lan"/>
      <el-table-column label="IP" align="center" prop="ip"/>
      <el-table-column label="操作系统" align="center" prop="operatingSystem">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT115" :value="scope.row.operatingSystem"/>
        </template>
      </el-table-column>
      <!--      <el-table-column label="账户" align="center" prop="account" />-->
      <el-table-column label="部署位置" align="center" prop="buildingId_dictText"/>
      <el-table-column label="机柜号" align="center" prop="cabinetNumber"/>
      <el-table-column label="机架号" align="center" prop="rackNumber"/>
      <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="performanceIndex" />-->
      <!--      <el-table-column label="备注" align="center" prop="remarks" />-->
      <!--      <el-table-column label="附件" align="center" prop="filePath" />-->
    </el-table>
    <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
    />
  </div>
</template>
<script>
import {listServer, getServer, delServer, addServer, updateServer} from "@/api/oa/server";
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: "Server",
  dicts: ['DICT115'],
  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,
      // 服务器表格数据
      serverList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        model: undefined,
        manufacturerId: undefined,
        deploymentName: undefined
      },
      currentRow: undefined
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询服务器列表 */
    getList() {
      this.loading = true;
      listServer(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.serverList = 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/ai/index.vue
@@ -68,7 +68,11 @@
    <el-table v-loading="loading" :data="aiList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="" align="center" prop="id" v-if="true"/>
      <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="deploymentName"/>
      <el-table-column label="支持通道" align="center" prop="passageway">
        <template slot-scope="scope">
src/views/construction/constructionList/index.vue
@@ -4,7 +4,7 @@
      <div class="tree-list">
        <school ref="schoolRef" @schoolChange="schoolChange"></school>
      </div>
      <div class="right-view">
      <div class="right-view" v-loading="loading">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="施工概况" name="first">施工概况</el-tab-pane>
          <el-tab-pane label="IPC设备" name="second">
@@ -19,9 +19,15 @@
          <el-tab-pane label="AI设备" name="five">
            <ai v-if="activeName === 'five'" :schoolId="schoolId"></ai>
          </el-tab-pane>
          <el-tab-pane label="交换设备" name="six">交换设备</el-tab-pane>
          <el-tab-pane label="服务器" name="seven">服务器</el-tab-pane>
          <el-tab-pane label="软件系统" name="eight">软件系统</el-tab-pane>
          <el-tab-pane label="交换设备" name="six">
            <exchange v-if="activeName === 'six'" :schoolId="schoolId"></exchange>
          </el-tab-pane>
          <el-tab-pane label="服务器" name="seven">
            <server v-if="activeName === 'seven'" :schoolId="schoolId"></server>
          </el-tab-pane>
          <el-tab-pane label="软件系统" name="eight">
            <system v-if="activeName === 'eight'" :schoolId="schoolId"></system>
          </el-tab-pane>
        </el-tabs>
        <div class="right-view-title-icon">
          <i class="el-icon-search" @click="batchOpen = true"></i>
@@ -47,6 +53,9 @@
import ipc from '../ipc'
import iot from '../iot'
import ai from '../ai'
import exchange from '../exchange'
import server from '../server'
import system from '../system'
export default {
  name: "constructionList",
@@ -57,10 +66,14 @@
    nvr,
    ipc,
    iot,
    ai
    ai,
    exchange,
    server,
    system
  },
  data() {
    return {
      loading: true,
      activeName: 'first',
      batchOpen: false,
      ipOpen: false,
@@ -72,6 +85,7 @@
    schoolChange(v) {
      this.schoolId = v;
      this.activeName = 'first';
      this.loading = false;
    },
    handleClick(tab, event) {
      console.log(tab, event);
src/views/construction/exchange/index.vue
New file
@@ -0,0 +1,538 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <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 label="生产厂商" prop="manufacturerId">
        <manufacturer v-model="queryParams.manufacturerId"></manufacturer>
      </el-form-item>
      <el-form-item label="网络端口" prop="networkPort">
        <el-select v-model="queryParams.networkPort" placeholder="请选择网络端口" clearable size="small">
          <el-option
              v-for="dict in dict.type.DICT113"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="指标A" prop="idnexA">
        <el-select v-model="queryParams.idnexA" placeholder="请选择指标A" clearable size="small">
          <el-option
              v-for="dict in dict.type.DICT114"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="级联端口" prop="cascadePort">
        <el-select v-model="queryParams.cascadePort" placeholder="请选择级联端口" clearable size="small">
          <el-option
              v-for="dict in dict.type.DICT113"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="指标B" prop="indexB">
        <el-select v-model="queryParams.indexB" placeholder="请选择指标B" clearable size="small">
          <el-option
              v-for="dict in dict.type.DICT114"
              :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-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:exchange: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:exchange: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:exchange:remove']"
        >删除
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="exchangeList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <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="networkPort">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT113" :value="scope.row.networkPort"/>
        </template>
      </el-table-column>
      <el-table-column label="指标A" align="center" prop="idnexA">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT114" :value="scope.row.idnexA"/>
        </template>
      </el-table-column>
      <el-table-column label="级联端口" align="center" prop="cascadePort">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT113" :value="scope.row.cascadePort"/>
        </template>
      </el-table-column>
      <el-table-column label="指标B" align="center" prop="indexB">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT114" :value="scope.row.indexB"/>
        </template>
      </el-table-column>
      <el-table-column label="安装位置" align="center" prop="buildingId_dictText"/>
      <el-table-column label="具体位置" align="center" prop="address"/>
      <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="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-view"
              @click="handleInfo(scope.row)"
          >查看
          </el-button>
          <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['oa:exchange: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:exchange: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"
    />
    <!-- 添加或修改交换设备对话框 -->
    <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="networkPort">
              <el-select v-model="form.networkPort" placeholder="请选择网络端口">
                <el-option
                    v-for="dict in dict.type.DICT113"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标A" prop="idnexA">
              <el-select v-model="form.idnexA" placeholder="请选择指标A">
                <el-option
                    v-for="dict in dict.type.DICT114"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="级联端口" prop="cascadePort">
              <el-select v-model="form.cascadePort" placeholder="请选择级联端口">
                <el-option
                    v-for="dict in dict.type.DICT113"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="指标B" prop="indexB">
              <el-select v-model="form.indexB" placeholder="请选择指标B">
                <el-option
                    v-for="dict in dict.type.DICT114"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </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="address">
          <el-input v-model="form.address" maxlength="512" show-word-limit type="textarea" :rows="8" placeholder="请输入具体位置""/>
        </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-model="form.manufacturerId"></manufacturer>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="submitForm">确 定</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 {listExchange, getExchange, delExchange, addExchange, updateExchange} from "@/api/oa/exchange";
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: "Exchange",
  dicts: ['DICT113', 'DICT114', 'DICT113', 'DICT114'],
  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,
      // 交换设备表格数据
      exchangeList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        schoolId: undefined,
        networkPort: undefined,
        idnexA: undefined,
        cascadePort: undefined,
        indexB: undefined,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        manufacturerId: undefined,
        model: undefined
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        schoolId: [
          {required: true, message: "高校不能为空", trigger: "blur"}
        ],
        networkPort: [
          {required: true, message: "网络端口不能为空", trigger: "change"}
        ],
        idnexA: [
          {required: true, message: "指标A不能为空", trigger: "change"}
        ],
        cascadePort: [
          {required: true, message: "级联端口不能为空", trigger: "change"}
        ],
        indexB: [
          {required: true, message: "指标B不能为空", trigger: "change"}
        ],
        buildingId: [
          {required: true, message: "安装位置不能为空", trigger: "blur"}
        ],
        organizationId: [
          {required: true, message: "所属单位不能为空", trigger: "blur"}
        ],
        constructionBatchId: [
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
      },
      disabled: false,
      fileOpen: false
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询交换设备列表 */
    getList() {
      this.loading = true;
      listExchange(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.exchangeList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.fileOpen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        schoolId: undefined,
        networkPort: undefined,
        idnexA: undefined,
        cascadePort: undefined,
        indexB: undefined,
        buildingId: undefined,
        address: 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 = "添加交换设备";
    },
    handleInfo(row) {
      this.loading = true;
      this.reset();
      this.disabled = true;
      getExchange(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "交换设备详情";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false
      this.reset();
      const id = row.id || this.ids
      getExchange(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改交换设备";
      });
    },
    handleUpload(row) {
      this.loading = true;
      this.disabled = false
      this.reset();
      getExchange(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.fileOpen = true;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateExchange(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.fileOpen = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addExchange(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('是否确认删除交换设备编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delExchange(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/exchange/export', {
        ...this.queryParams
      }, `exchange_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
src/views/construction/iot/index.vue
@@ -131,7 +131,6 @@
              type="text"
              icon="el-icon-view"
              @click="handleInfo(scope.row)"
              v-hasPermi="['oa:iot:edit']"
          >查看
          </el-button>
          <el-button
src/views/construction/ipc/index.vue
@@ -88,6 +88,13 @@
          <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:ipc:edit']"
@@ -117,7 +124,7 @@
    <!-- 添加或修改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-form ref="form" :model="form" :rules="rules" label-width="80px" :disabled="disabled">
        <el-row>
          <el-col :span="9">
            <el-form-item label="MAC" prop="mac">
@@ -183,8 +190,8 @@
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" type="primary" @click="copy">复制上一条信息</el-button>
        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
        <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="copy">复制上一条信息</el-button>
        <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
@@ -286,7 +293,8 @@
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
        passageway: []
      }
      },
      disabled: false
    };
  },
  computed: {
@@ -367,19 +375,33 @@
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.disabled = false;
      this.open = true;
      this.title = "添加ipc设备";
      this.title = "添加IPC设备";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
    handleInfo(row) {
      this.loading = true;
      this.disabled = 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设备";
        this.title = "IPC设备详情";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false;
      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设备";
      });
    },
    /** 提交按钮 */
src/views/construction/nvr/index.vue
@@ -446,7 +446,7 @@
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改NVR设备";
        this.title = "NVR设备详情";
      });
    },
    /** 修改按钮操作 */
@@ -515,8 +515,7 @@
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getNvr(id).then(response => {
      getNvr(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.fileOpen = true;
src/views/construction/server/index.vue
New file
@@ -0,0 +1,504 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <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 label="生产厂商" prop="manufacturerId">
        <manufacturer v-model="queryParams.manufacturerId"></manufacturer>
      </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:server: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:server: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:server:remove']"
        >删除
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="serverList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <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="deploymentName"/>
      <el-table-column label="LAN" align="center" prop="lan"/>
      <el-table-column label="IP" align="center" prop="ip"/>
      <el-table-column label="操作系统" align="center" prop="operatingSystem">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.DICT115" :value="scope.row.operatingSystem"/>
        </template>
      </el-table-column>
      <!--      <el-table-column label="账户" align="center" prop="account" />-->
      <el-table-column label="部署位置" align="center" prop="buildingId_dictText"/>
      <el-table-column label="机柜号" align="center" prop="cabinetNumber"/>
      <el-table-column label="机架号" align="center" prop="rackNumber"/>
      <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="performanceIndex" />-->
      <!--      <el-table-column label="备注" align="center" prop="remarks" />-->
      <!--      <el-table-column label="附件" align="center" prop="filePath" />-->
      <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:server: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:server: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"
    />
    <!-- 添加或修改服务器对话框 -->
    <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-form-item label="部署名称" prop="deploymentName">
          <el-input v-model="form.deploymentName" maxlength="64" show-word-limit placeholder="请输入部署名称"/>
        </el-form-item>
        <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="操作系统" prop="operatingSystem">
              <el-select v-model="form.operatingSystem" placeholder="请选择操作系统">
                <el-option
                    v-for="dict in dict.type.DICT115"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="账户" prop="account">
              <el-input v-model="form.account" 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-row>
          <el-col :span="12">
            <el-form-item label="机柜号" prop="cabinetNumber">
              <el-input v-model="form.cabinetNumber" maxlength="64" show-word-limit placeholder="请输入机柜号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="机架号" maxlength="64" show-word-limit prop="rackNumber">
              <el-input v-model="form.rackNumber" maxlength="64" show-word-limit placeholder="请输入机架号"/>
            </el-form-item>
          </el-col>
        </el-row>
        <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-model="form.manufacturerId"></manufacturer>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="性能指标" prop="performanceIndex">
          <el-input v-model="form.performanceIndex" type="textarea" :rows="8" maxlength="64" show-word-limit
                    placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" :rows="8" maxlength="64" show-word-limit
                    placeholder="请输入内容"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="submitForm">确 定</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 {listServer, getServer, delServer, addServer, updateServer} from "@/api/oa/server";
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: "Server",
  dicts: ['DICT115'],
  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,
      // 服务器表格数据
      serverList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        buildingId: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        model: undefined,
        manufacturerId: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        schoolId: [
          {required: true, message: "高校不能为空", trigger: "blur"}
        ],
        deploymentName: [
          {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"
          }
        ],
        operatingSystem: [
          {required: true, message: "操作系统不能为空", trigger: "change"}
        ],
        account: [
          {required: true, message: "账户不能为空", trigger: "blur"}
        ],
        buildingId: [
          {required: true, message: "部署位置不能为空", trigger: "blur"}
        ],
        organizationId: [
          {required: true, message: "所属单位不能为空", trigger: "blur"}
        ],
        constructionBatchId: [
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
      },
      disabled: false,
      fileOpen: false
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询服务器列表 */
    getList() {
      this.loading = true;
      listServer(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.serverList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.fileOpen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        schoolId: undefined,
        deploymentName: undefined,
        lan: undefined,
        ip: undefined,
        operatingSystem: undefined,
        account: undefined,
        buildingId: undefined,
        cabinetNumber: undefined,
        rackNumber: undefined,
        organizationId: undefined,
        constructionBatchId: undefined,
        serialNumber: undefined,
        model: undefined,
        manufacturerId: undefined,
        performanceIndex: undefined,
        remarks: undefined,
        filePath: 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 = "添加服务器";
    },
    handleInfo(row) {
      this.loading = true;
      this.disabled = true;
      this.reset();
      getServer(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "服务器详情";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getServer(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改服务器";
      });
    },
    handleUpload(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      getServer(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.fileOpen = true;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateServer(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.fileOpen = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addServer(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('是否确认删除服务器编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delServer(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/server/export', {
        ...this.queryParams
      }, `server_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
src/views/construction/system/index.vue
New file
@@ -0,0 +1,449 @@
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
      <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="serverId">
        <server v-model="queryParams.serverId" :schoolId="schoolId"></server>
      </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="manufacturerId">
        <manufacturer v-model="queryParams.manufacturerId"></manufacturer>
      </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:system: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:system: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:system:remove']"
        >删除
        </el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="systemList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <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="name"/>
      <el-table-column label="版本" align="center" prop="edition"/>
      <el-table-column label="功能描述" align="center" prop="functionDescription"/>
      <el-table-column label="授权方式" align="center" prop="authorizationMethod_dictText"/>
      <el-table-column label="授权数量" align="center" prop="authorizedQuantity"/>
      <el-table-column label="载体服务器" align="center" prop="serverId_dictText"/>
      <el-table-column label="施工批次" align="center" prop="constructionBatchId_dictText"/>
      <el-table-column label="生产厂商" align="center" prop="manufacturerId_dictText"/>
      <el-table-column label="备注" align="center" prop="remarks"/>
      <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:system: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:system: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"
    />
    <!-- 添加或修改软件系统对话框 -->
    <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="100px" :disabled="disabled">
        <el-row>
          <el-col :span="12">
            <el-form-item label="软件名称" prop="name">
              <el-input v-model="form.name" maxlength="64" show-word-limit placeholder="请输入软件名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="版本" prop="edition">
              <el-input v-model="form.edition" maxlength="64" show-word-limit placeholder="请输入版本"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="功能描述" prop="functionDescription">
          <el-input v-model="form.functionDescription" :rows="8" maxlength="64" show-word-limit type="textarea"
                    placeholder="请输入内容"/>
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="授权方式" prop="authorizationMethod">
              <el-select v-model="form.authorizationMethod" placeholder="请选择授权方式">
                <el-option
                    v-for="dict in dict.type.DICT116"
                    :key="dict.value"
                    :label="dict.label"
                    :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="授权数量" prop="authorizedQuantity">
              <el-input v-model="form.authorizedQuantity" maxlength="64" show-word-limit placeholder="请输入授权数量"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="载体服务器" prop="serverId">
          <server v-if="open" v-model="form.serverId" :schoolId="schoolId"/>
        </el-form-item>
        <el-row>
          <el-col :span="12">
            <el-form-item label="施工批次" prop="constructionBatchId">
              <constructionBatch v-if="open" v-model="form.constructionBatchId"
                                 :schoolId="schoolId"></constructionBatch>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="生产厂商" prop="manufacturerId">
              <manufacturer v-model="form.manufacturerId"></manufacturer>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="备注" prop="remarks">
          <el-input v-model="form.remarks" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button :loading="buttonLoading" :disabled="disabled" type="primary" @click="submitForm">确 定</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 {listSystem, getSystem, delSystem, addSystem, updateSystem} from "@/api/oa/system";
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";
import server from '../../components/server'
export default {
  name: "System",
  dicts: ['DICT116'],
  components: {
    building,
    organization,
    constructionBatch,
    manufacturer,
    nvr,
    server
  },
  props: {
    schoolId: {
      type: Number,
      default: undefined
    }
  },
  data() {
    return {
      // 按钮loading
      buttonLoading: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 软件系统表格数据
      systemList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        schoolId: undefined,
        name: undefined,
        serverId: undefined,
        constructionBatchId: undefined,
        manufacturerId: undefined,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "不能为空", trigger: "blur"}
        ],
        schoolId: [
          {required: true, message: "高校不能为空", trigger: "blur"}
        ],
        name: [
          {required: true, message: "软件名称不能为空", trigger: "blur"}
        ],
        edition: [
          {required: true, message: "版本不能为空", trigger: "blur"}
        ],
        functionDescription: [
          {required: true, message: "功能描述不能为空", trigger: "blur"}
        ],
        authorizationMethod: [
          {required: true, message: "授权方式不能为空", trigger: "blur"}
        ],
        authorizedQuantity: [
          {required: true, message: "授权数量不能为空", trigger: "blur"}
        ],
        serverId: [
          {required: true, message: "载体服务器不能为空", trigger: "blur"}
        ],
        constructionBatchId: [
          {required: true, message: "施工批次不能为空", trigger: "blur"}
        ],
      },
      disabled: false,
      fileOpen: false
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询软件系统列表 */
    getList() {
      this.loading = true;
      listSystem(Object.assign({}, this.queryParams, {schoolId: this.schoolId})).then(response => {
        this.systemList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.fileOpen = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        schoolId: undefined,
        name: undefined,
        edition: undefined,
        functionDescription: undefined,
        authorizationMethod: undefined,
        authorizedQuantity: undefined,
        serverId: undefined,
        constructionBatchId: undefined,
        manufacturerId: undefined,
        remarks: undefined,
        filePath: 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 = "添加软件系统";
    },
    handleInfo(row) {
      this.loading = true;
      this.disabled = true;
      this.reset();
      getSystem(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "软件系统详情";
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      const id = row.id || this.ids
      getSystem(id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.open = true;
        this.title = "修改软件系统";
      });
    },
    handleUpload(row) {
      this.loading = true;
      this.disabled = false;
      this.reset();
      getSystem(row.id).then(response => {
        this.loading = false;
        this.form = response.data;
        this.fileOpen = true;
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.buttonLoading = true;
          this.form.schoolId = this.schoolId;
          if (this.form.id != null) {
            updateSystem(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.fileOpen = false;
              this.getList();
            }).finally(() => {
              this.buttonLoading = false;
            });
          } else {
            addSystem(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('是否确认删除软件系统编号为"' + ids + '"的数据项?').then(() => {
        this.loading = true;
        return delSystem(ids);
      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).finally(() => {
        this.loading = false;
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('oa/system/export', {
        ...this.queryParams
      }, `system_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
vue.config.js
@@ -34,7 +34,7 @@
      // detail: https://cli.vuejs.org/config/#devserver-proxy
      [process.env.VUE_APP_BASE_API]: {
        // target: `http://101.35.174.42:8082`,
        target: `http://localhost:8080`,
        target: `http://localhost:8081`,
        changeOrigin: true,
        pathRewrite: {
          ['^' + process.env.VUE_APP_BASE_API]: ''