diff --git a/main/manager-web/src/views/DeviceManagement.vue b/main/manager-web/src/views/DeviceManagement.vue index f398dfc2..a419ad89 100644 --- a/main/manager-web/src/views/DeviceManagement.vue +++ b/main/manager-web/src/views/DeviceManagement.vue @@ -18,14 +18,17 @@ - + + + @@ -60,7 +63,7 @@
- + {{ isAllSelected ? '取消全选' : '全选' }} @@ -124,7 +127,6 @@ export default { deviceList: [], loading: false, userApi: null, - }; }, computed: { @@ -140,7 +142,10 @@ export default { paginatedDeviceList() { const start = (this.currentPage - 1) * this.pageSize; const end = start + this.pageSize; - return this.filteredDeviceList.slice(start, end); + return this.filteredDeviceList.slice(start, end).map(item => ({ + ...item, + selected: false + })); }, pageCount() { return Math.ceil(this.filteredDeviceList.length / this.pageSize); @@ -177,15 +182,16 @@ export default { this.currentPage = 1; }, - handleSelectionChange(val) { - this.selectedDevices = val; - this.isAllSelected = val.length === this.paginatedDeviceList.length; - }, - toggleAllSelection() { - this.$refs.deviceTable.toggleAllSelection(); + handleSelectAll() { + this.isAllSelected = !this.isAllSelected; + this.paginatedDeviceList.forEach(row => { + row.selected = this.isAllSelected; + }); + this.selectedDevices = this.paginatedDeviceList.filter(device => device.selected); }, deleteSelected() { + this.selectedDevices = this.paginatedDeviceList.filter(device => device.selected); if (this.selectedDevices.length === 0) { this.$message.warning({ message: '请至少选择一条记录', @@ -617,13 +623,7 @@ export default { display: none !important; } -:deep(.custom-selection-header::after) { - content: "选择"; - display: inline-block; - color: black; - font-weight: bold; - padding-bottom: 18px; -} + :deep(.el-table .el-button--text) { color: #7079aa; @@ -660,4 +660,18 @@ export default { padding-bottom: 16px; } } + +:deep(.el-checkbox__inner) { + background-color: #eeeeee !important; + border-color: #cccccc !important; +} + +:deep(.el-checkbox__inner:hover) { + border-color: #cccccc !important; +} + +:deep(.el-checkbox__input.is-checked .el-checkbox__inner) { + background-color: #5f70f3 !important; + border-color: #5f70f3 !important; +}