liuchengxin
2022-05-27 d138b7df8fa97dc7ed6b07acdfef804ebb186a74
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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 height="50vh"
              @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="通道(路)" min-width="120" align="center" prop="passageway_dictText"/>
      <el-table-column label="LAN1" min-width="150" align="center" prop="lanOne"/>
      <el-table-column label="IP" min-width="130" align="center" prop="ipOne"/>
      <el-table-column label="LAN2" min-width="150" align="center" prop="lanTwo"/>
      <el-table-column label="IP" min-width="130" align="center" prop="ipTwo"/>
      <el-table-column label="登录账户" min-width="120" align="center" prop="loginAccount"/>
      <el-table-column label="硬盘" align="center" prop="hardDisk"/>
      <el-table-column label="安装位置" min-width="220" align="center" prop="buildingId_dictText"/>
      <el-table-column label="所属单位" min-width="220" align="center" prop="organizationId_dictText"/>
      <!--      <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>