Merge pull request #927 from xinnan-tech/web-vue-height-fixed

Web vue height fixed
This commit is contained in:
Sakura-RanChen
2025-04-22 10:18:19 +08:00
committed by GitHub
3 changed files with 54 additions and 24 deletions
+32 -18
View File
@@ -18,14 +18,17 @@
<el-table
ref="deviceTable"
:data="paginatedDeviceList"
@selection-change="handleSelectionChange"
class="transparent-table"
:header-cell-class-name="headerCellClassName"
v-loading="loading"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.7)">
<el-table-column type="selection" align="center" width="120"></el-table-column>
<el-table-column label="选择" align="center" width="120">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.selected"></el-checkbox>
</template>
</el-table-column>
<el-table-column label="设备型号" prop="model" align="center"></el-table-column>
<el-table-column label="固件版本" prop="firmwareVersion" align="center" ></el-table-column>
<el-table-column label="Mac地址" prop="macAddress" align="center"></el-table-column>
@@ -60,7 +63,7 @@
<div class="table_bottom">
<div class="ctrl_btn">
<el-button size="mini" type="primary" class="select-all-btn" @click="toggleAllSelection">
<el-button size="mini" type="primary" class="select-all-btn" @click="handleSelectAll">
{{ isAllSelected ? '取消全选' : '全选' }}
</el-button>
<el-button type="success" size="mini" class="add-device-btn" @click="handleAddDevice">
@@ -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;
}
</style>
@@ -402,13 +402,21 @@ export default {
}
.params-card {
background: white;
border: none;
box-shadow: none;
background: white;
flex: 1;
display: flex;
flex-direction: column;
border: none;
box-shadow: none;
overflow: hidden;
::v-deep .el-card__body {
padding: 15px;
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}
}
.table_bottom {
+11 -3
View File
@@ -425,12 +425,20 @@ export default {
.user-card {
background: white;
border: none;
box-shadow: none;
flex: 1;
display: flex;
flex-direction: column;
flex: 1;
border: none;
box-shadow: none;
overflow: hidden;
::v-deep .el-card__body {
padding: 15px;
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}
}
.table_bottom {