mapTable.vue
3.44 KB
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
131
132
133
134
135
136
137
138
<template>
<div class="table">
<el-table
:data="tableData"
border
highlight-current-row
:height="tableHeight"
@selection-change="handleSelectionChange"
@row-click="handleRowClick"
ref="multipleTable"
:header-cell-style="{ color: '#000000' }"
>
<!-- <el-table-column
type="selection"
align="center"
width="55"
></el-table-column> -->
<el-table-column
v-for="(item, index) in tableCol"
:key="index"
:prop="item.prop"
:label="item.label"
:width="item.width"
align="center"
>
</el-table-column>
<el-table-column v-if="isDelete" fixed="right" label="操作" width="60">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- <div class="pagination-container">
<el-pagination
style="margin-top: 15px"
align="center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryConfig.currentPage"
:page-sizes="[20, 50, 100]"
:page-size="queryConfig.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
/>
</div> -->
</div>
</template>
<script>
export default {
name: "mapControl",
props: {},
data() {
return {
tableCol: [],
tableData: [],
isDelete: false,
tableHeight: "300px",
multipleSelection: [],
total: 0,
//查询条件
queryConfig: {
currentPage: 1,
pageSize: 20,
code: "",
},
};
},
mounted() {},
methods: {
deleteRow(index, rows) {
rows.splice(index, 1);
},
handleRowClick(row) {
this.$refs.multipleTable.toggleRowSelection(row);
},
//获取表格行数据
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleCurrentChange(val) {
this.queryConfig.currentPage = val;
this.getTableList();
},
//分页
handleSizeChange(val) {
this.queryConfig.pageSize = val;
this.queryConfig.currentPage = 1;
this.getTableList();
},
//表格数据
getTableList() {
const params = {
pageNumber: this.queryConfig.currentPage,
perPageCount: this.queryConfig.pageSize,
queryConfig: {
code: this.queryConfig.code,
name: this.queryConfig.name,
typeId: this.queryConfig.typeId,
ip: this.queryConfig.ip,
destinationArea: this.queryConfig.destinationArea,
},
};
this.listLoading = true;
// GetEquipments(params).then((response) => {
// this.total = response.data.totalCount;
// response.data.data.forEach((x) => {
// if (x.disable == false) {
// x["isTree"] = this.$t("deviceManage.deny");
// } else {
// x["isTree"] = this.$t("deviceManage.disabled");
// }
// });
// this.tableData = response.data.data;
// this.listLoading = false;
// });
},
},
};
</script>
<style lang="scss" scoped>
/* 修改复选框大小 */
.el-table .el-checkbox {
transform: scale(1.8) !important; /* 调整大小 */
margin-top: 5px;
}
.table {
border: 1px solid #e5e9f2;
}
</style>