china
2023-05-11 c7bc3eb18e1fda4254ca0195e2133d2ed978de11
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
<template>
  <div class="app-main">
    <div class="app-container">
      <my-table-v3 ref="myTable" :filter="filterForm" :table="table" />
    </div>
  </div>
</template>
 
<script>
  import myTableV3 from '@/views/components/myTableV3';
  // import {addEquip} from '@/api/tcp/equip'
  // import myButtonV2 from "@/views/components/myButtonV2";
  // import edit from "@/views/system/config/edit";
 
  export default {
    name: "Connection",
    components: {myTableV3},
    data(){
      return {
 
        /** 搜索条件*/
        filterForm: {
          name: null
        },
 
        table: {
          showIndex: false, // 是否显示序号
          expand: false, // 是否显示详情数据
          checkBox: false, // 是否显示复选框
          url: globalConf.baseUrl + '/tcp/equip/list', // 请求地址
          // 工具条
          tools: {
            columnsCtrl: {// 列控制按钮
              show: false
            },
            generalExport: {// 通用导出按钮
              show: false
            }
          },
          columns: [
            { title: '设备编号', field: 'num', align: 'left', width: 220 },
            { title: '创建时间', field: 'createTime', align: 'left', width: 170 },
            { title: '名称', field: 'name', align: 'left', width: 220 },
            { title: '数据协议', field: 'parameter.protocolResolverName', align: 'left', width: 120},
            { title: '所属机构', field: 'parameter.deptName', align: 'left', width: 170},
            { title: '备注', field: 'summary', align: 'left', width: 120},
            { title: '状态', field: 'status', align: 'left', width: 120, formatter: row => {
                let title = '';
                switch (row.status) {
                  case 1:
                    title = '在用'
                    break
                  case 0:
                    title = '禁用'
                    break
                  default:
                    title = '已删除'
                }
                return { value: title, type: 'primary' }
              }
            }
          ],
          // 操作信息
          operation: {
            show: true, // 显示操作列
            width: '120', // 列宽
            attr: [
              {
                title: '绑定用户',
                checkPermission: 'tcp:connection:broken',
                events: row => {
                  this.broken(row)
                }
              },
              {
                title: '删除设备',
                checkPermission: 'tcp:connection:broken',
                events: row => {
                  this.broken(row)
                }
              }
            ]
          },
          paging: {
            show: true, // 显示分页
            // 分页信息
            page: {
              small: false,
              pageNum: 1,
              pageSize: platformPageSize,
              total: 0
            }
          }
        }
 
      }
    },
 
    methods: {
      // 查询table列表
      search(pageNum) {
        if (pageNum != undefined) {
          this.$refs.myTable.search({ pageNum: pageNum })
        } else {
          this.$refs.myTable.search()
        }
      },
      // 表单重置
      reset() {
        this.filterForm = {
          name: null
        }
        this.search(1)
      },
 
      broken(row) {
 
      },
 
    }
  }
</script>
 
<style scoped>
 
</style>