Files
xiaozhi-esp32-server/main/manager-web/src/views/DeviceManagement.vue
T

826 lines
24 KiB
Vue
Raw Normal View History

2025-03-18 21:49:57 +08:00
<template>
<div class="welcome">
2025-09-16 00:06:57 +08:00
<HeaderBar />
<div class="operation-bar">
<h2 class="page-title">{{ $t('device.management') }}</h2>
<div class="right-operations">
<el-input :placeholder="$t('device.searchPlaceholder')" v-model="searchKeyword" class="search-input"
2025-09-16 00:06:57 +08:00
@keyup.enter.native="handleSearch" clearable />
<el-button class="btn-search" @click="handleSearch">{{ $t('device.search') }}</el-button>
</div>
</div>
2025-04-14 07:52:00 +08:00
<div class="main-wrapper">
<div class="content-panel">
<div class="content-area">
2025-04-15 17:59:29 +08:00
<el-card class="device-card" shadow="never">
<el-table ref="deviceTable" :data="paginatedDeviceList" class="transparent-table"
2025-09-16 00:06:57 +08:00
:header-cell-class-name="headerCellClassName" v-loading="loading"
:element-loading-text="$t('deviceManagement.loading')" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(255, 255, 255, 0.7)">
<el-table-column :label="$t('modelConfig.select')" 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="$t('device.model')" prop="model" align="center">
<template slot-scope="scope">
{{ getFirmwareTypeName(scope.row.model) }}
</template>
</el-table-column>
2025-09-16 00:06:57 +08:00
<el-table-column :label="$t('device.firmwareVersion')" prop="firmwareVersion"
align="center"></el-table-column>
<el-table-column :label="$t('device.macAddress')" prop="macAddress" align="center"></el-table-column>
<el-table-column :label="$t('device.bindTime')" prop="bindTime" align="center"></el-table-column>
2025-09-16 00:06:57 +08:00
<el-table-column :label="$t('device.lastConversation')" prop="lastConversation"
align="center"></el-table-column>
<el-table-column :label="$t('device.deviceStatus')" prop="deviceStatus" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.deviceStatus === 'online'" type="success">{{ $t('device.online') }}</el-tag>
<el-tag v-else type="danger">{{ $t('device.offline') }}</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('device.remark')" align="center">
<template #default="{ row }">
2025-09-16 00:06:57 +08:00
<el-input v-show="row.isEdit" v-model="row.remark" size="mini" maxlength="64" show-word-limit
@blur="onRemarkBlur(row)" @keyup.enter.native="onRemarkEnter(row)" />
<span v-show="!row.isEdit" class="remark-view">
2025-09-16 00:06:57 +08:00
<i class="el-icon-edit" @click="row.isEdit = true" style="cursor: pointer;"></i>
<span @click="row.isEdit = true">
{{ row.remark || '-' }}
</span>
2025-04-14 07:52:00 +08:00
</span>
</template>
</el-table-column>
<el-table-column :label="$t('device.autoUpdate')" align="center">
2025-04-14 07:52:00 +08:00
<template slot-scope="scope">
<el-switch v-model="scope.row.otaSwitch" size="mini" active-color="#13ce66" inactive-color="#ff4949"
2025-09-16 00:06:57 +08:00
@change="handleOtaSwitchChange(scope.row)"></el-switch>
2025-04-14 07:52:00 +08:00
</template>
</el-table-column>
<el-table-column :label="$t('device.operation')" align="center">
2025-04-14 07:52:00 +08:00
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleUnbind(scope.row.device_id)">
2025-09-16 00:06:57 +08:00
{{ $t('device.unbind') }}
</el-button>
2025-04-14 07:52:00 +08:00
</template>
</el-table-column>
</el-table>
<div class="table_bottom">
<div class="ctrl_btn">
2025-09-16 00:06:57 +08:00
<el-button size="mini" type="primary" class="select-all-btn" @click="handleSelectAll">
{{ isCurrentPageAllSelected ? $t('common.deselectAll') : $t('common.selectAll') }}
</el-button>
<el-button type="success" size="mini" class="add-device-btn" @click="handleAddDevice">
{{ $t('device.bindWithCode') }}
</el-button>
<el-button type="success" size="mini" class="add-device-btn" @click="handleManualAddDevice">
{{ $t('device.manualAdd') }}
</el-button>
<el-button size="mini" type="danger" icon="el-icon-delete" @click="deleteSelected">
{{ $t('device.unbind') }}
</el-button>
2025-09-16 00:06:57 +08:00
</div>
2025-04-14 07:52:00 +08:00
<div class="custom-pagination">
2025-04-15 17:59:29 +08:00
<el-select v-model="pageSize" @change="handlePageSizeChange" class="page-size-select">
2025-09-16 00:06:57 +08:00
<el-option v-for="item in pageSizeOptions" :key="item"
:label="$t('dictManagement.itemsPerPage').replace('{items}', item)" :value="item">
</el-option>
</el-select>
<button class="pagination-btn" :disabled="currentPage === 1" @click="goFirst">
{{ $t('dictManagement.firstPage') }}
</button>
<button class="pagination-btn" :disabled="currentPage === 1" @click="goPrev">
{{ $t('dictManagement.prevPage') }}
</button>
<button v-for="page in visiblePages" :key="page" class="pagination-btn"
2025-09-16 00:06:57 +08:00
:class="{ active: page === currentPage }" @click="goToPage(page)">
2025-04-14 07:52:00 +08:00
{{ page }}
</button>
<button class="pagination-btn" :disabled="currentPage === pageCount" @click="goNext">
{{ $t('dictManagement.nextPage') }}
</button>
<span class="total-text">
{{ $t('dictManagement.totalRecords').replace('{total}', deviceList.length) }}
</span>
2025-04-14 07:52:00 +08:00
</div>
</div>
</el-card>
2025-04-12 08:27:03 +08:00
</div>
2025-03-18 21:49:57 +08:00
</div>
2025-04-14 07:52:00 +08:00
</div>
<AddDeviceDialog :visible.sync="addDeviceDialogVisible" :agent-id="currentAgentId"
2025-09-16 00:06:57 +08:00
@refresh="fetchBindDevices(currentAgentId)" />
2025-06-26 11:09:17 +08:00
<ManualAddDeviceDialog :visible.sync="manualAddDeviceDialogVisible" :agent-id="currentAgentId"
2025-09-16 00:06:57 +08:00
@refresh="fetchBindDevices(currentAgentId)" />
2025-03-18 21:49:57 +08:00
</div>
</template>
<script>
2025-04-05 21:03:46 +08:00
import Api from '@/apis/api';
2025-03-18 21:49:57 +08:00
import AddDeviceDialog from "@/components/AddDeviceDialog.vue";
2025-04-05 20:16:02 +08:00
import HeaderBar from "@/components/HeaderBar.vue";
2025-09-16 00:06:57 +08:00
import ManualAddDeviceDialog from "@/components/ManualAddDeviceDialog.vue";
2025-03-18 21:49:57 +08:00
export default {
2025-06-26 11:09:17 +08:00
components: {
2025-09-16 00:06:57 +08:00
HeaderBar,
2025-06-26 11:09:17 +08:00
AddDeviceDialog,
ManualAddDeviceDialog
2025-06-26 11:09:17 +08:00
},
2025-03-18 21:49:57 +08:00
data() {
return {
addDeviceDialogVisible: false,
2025-06-26 11:09:17 +08:00
manualAddDeviceDialogVisible: false,
2025-09-16 00:06:57 +08:00
selectedDeviceId: '',
searchKeyword: "",
activeSearchKeyword: "",
2025-03-27 17:54:05 +08:00
currentAgentId: this.$route.query.agentId || '',
2025-03-25 16:23:28 +08:00
currentPage: 1,
pageSize: 10,
pageSizeOptions: [10, 20, 50, 100],
2025-03-25 16:23:28 +08:00
deviceList: [],
loading: false,
2025-03-27 11:24:49 +08:00
userApi: null,
2025-05-01 16:57:58 +08:00
firmwareTypes: [],
2025-03-18 21:49:57 +08:00
};
},
2025-03-25 16:23:28 +08:00
computed: {
filteredDeviceList() {
const keyword = this.activeSearchKeyword.toLowerCase();
if (!keyword) return this.deviceList;
return this.deviceList.filter(device =>
2025-09-16 00:06:57 +08:00
(device.model && device.model.toLowerCase().includes(keyword)) ||
(device.macAddress && device.macAddress.toLowerCase().includes(keyword))
);
},
2025-03-25 16:23:28 +08:00
paginatedDeviceList() {
const start = (this.currentPage - 1) * this.pageSize;
const end = start + this.pageSize;
return this.filteredDeviceList.slice(start, end);
2025-04-12 08:27:03 +08:00
},
pageCount() {
return Math.ceil(this.filteredDeviceList.length / this.pageSize);
2025-04-12 08:27:03 +08:00
},
// 计算当前页是否全选
isCurrentPageAllSelected() {
2025-09-16 00:06:57 +08:00
return this.paginatedDeviceList.length > 0 &&
this.paginatedDeviceList.every(device => device.selected);
},
2025-04-12 08:27:03 +08:00
visiblePages() {
const pages = [];
const maxVisible = 3;
let start = Math.max(1, this.currentPage - 1);
let end = Math.min(this.pageCount, start + maxVisible - 1);
if (end - start + 1 < maxVisible) {
start = Math.max(1, end - maxVisible + 1);
}
for (let i = start; i <= end; i++) {
pages.push(i);
}
return pages;
2025-04-15 17:59:29 +08:00
},
2025-03-25 16:23:28 +08:00
},
mounted() {
const agentId = this.$route.query.agentId;
2025-04-05 21:03:46 +08:00
if (agentId) {
this.fetchBindDevices(agentId);
}
2025-03-25 16:23:28 +08:00
},
2025-05-01 16:57:58 +08:00
created() {
this.getFirmwareTypes()
},
2025-03-18 21:49:57 +08:00
methods: {
2025-05-01 16:57:58 +08:00
async getFirmwareTypes() {
try {
const res = await Api.dict.getDictDataByType('FIRMWARE_TYPE')
this.firmwareTypes = res.data
} catch (error) {
console.error(this.$t('device.getFirmwareTypeFailed') + ':', error)
this.$message.error(error.message || this.$t('device.getFirmwareTypeFailed'))
2025-05-01 16:57:58 +08:00
}
},
2025-04-15 17:59:29 +08:00
handlePageSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;
},
handleSearch() {
this.activeSearchKeyword = this.searchKeyword;
this.currentPage = 1;
},
2025-04-12 09:28:19 +08:00
handleSelectAll() {
const shouldSelectAll = !this.isCurrentPageAllSelected;
this.paginatedDeviceList.forEach(row => {
row.selected = shouldSelectAll;
});
2025-04-12 09:28:19 +08:00
},
2025-04-14 07:52:00 +08:00
deleteSelected() {
const selectedDevices = this.paginatedDeviceList.filter(device => device.selected);
if (selectedDevices.length === 0) {
this.$message.warning({
message: this.$t('device.selectAtLeastOne'),
showClose: true
});
return;
}
this.$confirm(this.$t('device.confirmBatchUnbind').replace('{count}', selectedDevices.length), this.$t('message.warning'), {
confirmButtonText: this.$t('button.ok'),
cancelButtonText: this.$t('button.cancel'),
type: 'warning'
}).then(() => {
const deviceIds = selectedDevices.map(device => device.device_id);
this.batchUnbindDevices(deviceIds);
});
},
batchUnbindDevices(deviceIds) {
const promises = deviceIds.map(id => {
return new Promise((resolve, reject) => {
2025-09-16 00:06:57 +08:00
Api.device.unbindDevice(id, ({ data }) => {
if (data.code === 0) {
resolve();
} else {
reject(data.msg || this.$t('device.bindFailed'));
}
});
});
});
Promise.all(promises)
2025-09-16 00:06:57 +08:00
.then(() => {
this.$message.success({
message: this.$t('device.batchUnbindSuccess').replace('{count}', deviceIds.length),
showClose: true
});
2025-09-16 00:06:57 +08:00
this.fetchBindDevices(this.currentAgentId);
})
.catch(error => {
this.$message.error({
message: error || this.$t('device.batchUnbindError'),
showClose: true
});
});
2025-04-14 07:52:00 +08:00
},
2025-03-18 21:49:57 +08:00
handleAddDevice() {
this.addDeviceDialogVisible = true;
},
2025-06-26 11:09:17 +08:00
handleManualAddDevice() {
this.manualAddDeviceDialogVisible = true;
},
submitRemark(row) {
if (row._submitting) return;
const text = (row.remark || '').trim();
if (text.length > 64) {
this.$message.warning(this.$t('device.remarkTooLong'));
return;
}
if (text === row._originalRemark) {
return;
}
row._submitting = true;
this.updateDeviceInfo(row.device_id, { alias: text }, (ok, resp) => {
if (ok) {
row._originalRemark = text;
this.$message.success(this.$t('device.remarkSaved'));
} else {
row.remark = row._originalRemark;
this.$message.error(resp.msg || this.$t('device.remarkSaveFailed'));
}
row._submitting = false;
});
2025-03-18 21:49:57 +08:00
},
// 备注输入框:失焦时提交
onRemarkBlur(row) {
row.isEdit = false;
setTimeout(() => {
this.submitRemark(row);
}, 100); // 延迟 100ms,避开 enter+blur 同时触发的窗口
},
// 备注输入框:按回车时提交
onRemarkEnter(row) {
row.isEdit = false;
this.submitRemark(row);
2025-03-18 21:49:57 +08:00
},
2025-03-27 11:24:49 +08:00
handleUnbind(device_id) {
this.$confirm(this.$t('device.confirmUnbind'), this.$t('message.warning'), {
confirmButtonText: this.$t('button.ok'),
cancelButtonText: this.$t('button.cancel'),
2025-03-27 11:24:49 +08:00
type: 'warning'
}).then(() => {
2025-09-16 00:06:57 +08:00
Api.device.unbindDevice(device_id, ({ data }) => {
2025-03-27 11:24:49 +08:00
if (data.code === 0) {
2025-09-16 00:06:57 +08:00
this.$message.success({
message: this.$t('device.unbindSuccess'),
showClose: true
});
2025-03-27 11:24:49 +08:00
this.fetchBindDevices(this.$route.query.agentId);
} else {
2025-09-16 00:06:57 +08:00
this.$message.error({
message: data.msg || this.$t('device.unbindFailed'),
showClose: true
});
2025-03-27 11:24:49 +08:00
}
});
});
2025-03-18 21:49:57 +08:00
},
2025-04-12 08:27:03 +08:00
goFirst() {
this.currentPage = 1;
2025-03-25 16:23:28 +08:00
},
2025-04-12 08:27:03 +08:00
goPrev() {
if (this.currentPage > 1) this.currentPage--;
2025-03-25 16:23:28 +08:00
},
2025-04-12 08:27:03 +08:00
goNext() {
if (this.currentPage < this.pageCount) this.currentPage++;
},
goToPage(page) {
this.currentPage = page;
},
fetchBindDevices(agentId) {
this.loading = true;
2025-09-16 00:06:57 +08:00
Api.device.getAgentBindDevices(agentId, ({ data }) => {
2025-04-05 21:03:46 +08:00
this.loading = false;
if (data.code === 0) {
this.deviceList = data.data.map(device => {
return {
device_id: device.id,
model: device.board,
firmwareVersion: device.appVersion,
macAddress: device.macAddress,
2025-05-03 23:30:39 +08:00
bindTime: device.createDate,
lastConversation: device.lastConnectedAt,
2025-04-05 21:03:46 +08:00
remark: device.alias,
_originalRemark: device.alias,
2025-04-05 21:03:46 +08:00
isEdit: false,
_submitting: false,
2025-04-05 21:03:46 +08:00
otaSwitch: device.autoUpdate === 1,
rawBindTime: new Date(device.createDate).getTime(),
selected: false,
// 初始设置为离线状态
deviceStatus: 'offline'
2025-04-05 21:03:46 +08:00
};
})
2025-09-16 00:06:57 +08:00
.sort((a, b) => a.rawBindTime - b.rawBindTime);
this.activeSearchKeyword = "";
this.searchKeyword = "";
// 获取设备列表后,立即获取设备状态
this.fetchDeviceStatus(agentId);
2025-04-05 21:03:46 +08:00
} else {
this.$message.error(data.msg || this.$t('device.getListFailed'));
2025-04-05 21:03:46 +08:00
}
});
},
// 获取设备状态
fetchDeviceStatus(agentId) {
Api.device.getDeviceStatus(agentId, ({ data }) => {
if (data.code === 0) {
try {
// 解析后端返回的设备状态JSON
const statusData = JSON.parse(data.data);
// 直接使用解析后的数据作为设备状态映射(不需要devices字段包装)
if (statusData && typeof statusData === 'object') {
// 更新设备状态
this.updateDeviceStatusFromResponse(statusData);
}
} catch (error) {
// JSON解析失败,忽略状态更新
}
}
});
},
// 根据API响应更新设备状态
updateDeviceStatusFromResponse(deviceStatusMap) {
this.deviceList.forEach(device => {
// 构建设备的MQTT客户端ID
const macAddress = device.macAddress ? device.macAddress.replace(/:/g, '_') : 'unknown';
const groupId = device.model ? device.model.replace(/:/g, '_') : 'GID_default';
const mqttClientId = `${groupId}@@@${macAddress}@@@${macAddress}`;
// 从状态映射中获取设备状态
if (deviceStatusMap[mqttClientId]) {
const statusInfo = deviceStatusMap[mqttClientId];
let isOnline = false;
if (statusInfo.isAlive === true) {
isOnline = true;
} else if (statusInfo.isAlive === false) {
isOnline = false;
} else if (statusInfo.isAlive === null && statusInfo.exists === true) {
isOnline = true;
} else {
isOnline = false;
}
device.deviceStatus = isOnline ? 'online' : 'offline';
} else {
// 如果没有找到对应的状态信息,默认为离线
device.deviceStatus = 'offline';
}
});
},
2025-09-16 00:06:57 +08:00
headerCellClassName({ columnIndex }) {
2025-04-14 07:52:00 +08:00
if (columnIndex === 0) {
return "custom-selection-header";
}
return "";
},
getFirmwareTypeName(type) {
2025-05-01 16:57:58 +08:00
const firmwareType = this.firmwareTypes.find(item => item.key === type)
return firmwareType ? firmwareType.name : type
},
updateDeviceInfo(device_id, payload, callback) {
2025-09-16 00:06:57 +08:00
return Api.device.updateDeviceInfo(device_id, payload, ({ data }) => {
callback(data.code === 0, data);
})
},
handleOtaSwitchChange(row) {
2025-09-16 00:06:57 +08:00
this.updateDeviceInfo(row.device_id, { autoUpdate: row.otaSwitch ? 1 : 0 }, (result, { msg }) => {
if (result) {
this.$message.success(row.otaSwitch ? this.$t('device.autoUpdateEnabled') : this.$t('device.autoUpdateDisabled'));
return;
}
row.otaSwitch = !row.otaSwitch
this.$message.error(msg || this.$t('message.error'))
})
},
2025-03-18 21:49:57 +08:00
}
};
</script>
<style scoped>
.welcome {
min-width: 900px;
min-height: 506px;
height: 100vh;
display: flex;
2025-04-14 07:52:00 +08:00
position: relative;
2025-03-18 21:49:57 +08:00
flex-direction: column;
background: linear-gradient(to bottom right, #dce8ff, #e4eeff, #e6cbfd);
2025-03-18 21:49:57 +08:00
background-size: cover;
-webkit-background-size: cover;
-o-background-size: cover;
}
2025-04-14 07:52:00 +08:00
.main-wrapper {
margin: 5px 22px;
border-radius: 15px;
min-height: calc(100vh - 24vh);
2025-04-15 17:59:29 +08:00
height: auto;
max-height: 80vh;
2025-03-18 21:49:57 +08:00
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
2025-04-14 07:52:00 +08:00
position: relative;
background: rgba(237, 242, 255, 0.5);
2025-04-15 17:59:29 +08:00
display: flex;
flex-direction: column;
2025-03-18 21:49:57 +08:00
}
2025-04-14 07:52:00 +08:00
.operation-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 16px 24px;
}
.page-title {
font-size: 24px;
margin: 0;
color: #2c3e50;
}
.right-operations {
display: flex;
gap: 10px;
margin-left: auto;
}
.search-input {
width: 280px;
border-radius: 4px;
}
.btn-search {
background: linear-gradient(135deg, #6b8cff, #a966ff);
border: none;
color: white;
}
2025-04-15 17:59:29 +08:00
::v-deep .search-input .el-input__inner {
border-radius: 4px;
border: 1px solid #DCDFE6;
background-color: white;
transition: border-color 0.2s;
}
::v-deep .page-size-select {
2025-04-15 17:59:29 +08:00
width: 100px;
margin-right: 8px;
}
::v-deep .page-size-select .el-input__inner {
2025-04-15 17:59:29 +08:00
height: 32px;
line-height: 32px;
border-radius: 4px;
border: 1px solid #e4e7ed;
background: #dee7ff;
color: #606266;
font-size: 14px;
}
::v-deep .page-size-select .el-input__suffix {
2025-04-15 17:59:29 +08:00
right: 6px;
width: 15px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
top: 6px;
border-radius: 4px;
}
::v-deep .page-size-select .el-input__suffix-inner {
2025-04-15 17:59:29 +08:00
display: flex;
align-items: center;
justify-content: center;
width: 100%;
}
::v-deep .page-size-select .el-icon-arrow-up:before {
2025-04-15 17:59:29 +08:00
content: "";
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 9px solid #606266;
position: relative;
transform: rotate(0deg);
transition: transform 0.3s;
}
::v-deep .search-input .el-input__inner:focus {
border-color: #6b8cff;
outline: none;
}
2025-04-14 07:52:00 +08:00
.content-panel {
flex: 1;
display: flex;
overflow: hidden;
height: 100%;
border-radius: 15px;
background: transparent;
border: 1px solid #fff;
}
.content-area {
flex: 1;
height: 100%;
min-width: 600px;
2025-04-15 17:59:29 +08:00
overflow: auto;
2025-04-14 07:52:00 +08:00
background-color: white;
2025-04-15 17:59:29 +08:00
display: flex;
flex-direction: column;
2025-04-14 07:52:00 +08:00
}
2025-04-15 17:59:29 +08:00
.device-card {
2025-04-14 07:52:00 +08:00
background: white;
border: none;
box-shadow: none;
2025-04-15 17:59:29 +08:00
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
2025-04-14 07:52:00 +08:00
}
::v-deep .el-card__body {
padding: 15px;
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
2025-04-22 11:33:17 +08:00
}
2025-04-14 07:52:00 +08:00
.table_bottom {
display: flex;
justify-content: space-between;
align-items: center;
2025-04-15 17:59:29 +08:00
margin-top: 10px;
padding-bottom: 10px;
2025-04-14 07:52:00 +08:00
}
2025-04-22 11:33:17 +08:00
2025-04-14 07:52:00 +08:00
.ctrl_btn {
display: flex;
gap: 8px;
2025-04-15 17:59:29 +08:00
padding-left: 26px;
2025-04-14 07:52:00 +08:00
}
.ctrl_btn .el-button {
min-width: 72px;
2025-03-18 21:49:57 +08:00
height: 32px;
2025-04-14 09:34:51 +08:00
padding: 7px 12px 7px 10px;
font-size: 12px;
2025-04-14 07:52:00 +08:00
border-radius: 4px;
2025-04-14 09:34:51 +08:00
line-height: 1;
font-weight: 500;
2025-04-14 07:52:00 +08:00
border: none;
2025-04-14 09:34:51 +08:00
transition: all 0.3s ease;
2025-04-12 09:28:19 +08:00
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
2025-03-18 21:49:57 +08:00
}
2025-04-14 07:52:00 +08:00
.ctrl_btn .el-button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.ctrl_btn .el-button--primary {
background: #5f70f3;
color: white;
}
.ctrl_btn .el-button--success {
background: #5bc98c;
color: white;
}
.ctrl_btn .el-button--danger {
background: #fd5b63;
color: white;
2025-03-18 21:49:57 +08:00
}
2025-04-12 08:27:03 +08:00
.custom-pagination {
display: flex;
align-items: center;
2025-04-15 17:59:29 +08:00
gap: 10px;
2025-04-12 08:27:03 +08:00
}
2025-04-15 17:59:29 +08:00
.custom-pagination .el-select {
margin-right: 8px;
}
.custom-pagination .pagination-btn:first-child,
.custom-pagination .pagination-btn:nth-child(2),
.custom-pagination .pagination-btn:nth-last-child(2),
.custom-pagination .pagination-btn:nth-child(3) {
min-width: 60px;
2025-04-12 08:27:03 +08:00
height: 32px;
padding: 0 12px;
border-radius: 4px;
border: 1px solid #e4e7ed;
background: #dee7ff;
color: #606266;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
}
2025-04-15 17:59:29 +08:00
.custom-pagination .pagination-btn:first-child:hover,
.custom-pagination .pagination-btn:nth-child(2):hover,
.custom-pagination .pagination-btn:nth-last-child(2):hover,
.custom-pagination .pagination-btn:nth-child(3):hover {
2025-04-12 08:27:03 +08:00
background: #d7dce6;
}
2025-04-15 17:59:29 +08:00
.custom-pagination .pagination-btn:disabled {
2025-04-12 08:27:03 +08:00
opacity: 0.6;
cursor: not-allowed;
}
2025-04-15 17:59:29 +08:00
.custom-pagination .pagination-btn:not(:first-child):not(:nth-child(3)):not(:nth-child(2)):not(:nth-last-child(2)) {
min-width: 28px;
height: 32px;
padding: 0;
border-radius: 4px;
border: 1px solid transparent;
background: transparent;
color: #606266;
font-size: 14px;
cursor: pointer;
transition: all 0.3s ease;
}
.custom-pagination .pagination-btn:not(:first-child):not(:nth-child(3)):not(:nth-child(2)):not(:nth-last-child(2)):hover {
background: rgba(245, 247, 250, 0.3);
}
.custom-pagination .pagination-btn.active {
2025-04-12 08:27:03 +08:00
background: #5f70f3 !important;
color: #ffffff !important;
border-color: #5f70f3 !important;
}
2025-04-15 17:59:29 +08:00
.custom-pagination .pagination-btn.active:hover {
background: #6d7cf5 !important;
}
.custom-pagination .total-text {
2025-04-12 08:27:03 +08:00
color: #909399;
font-size: 14px;
margin-left: 10px;
2025-03-25 16:23:28 +08:00
}
2025-04-12 09:28:19 +08:00
2025-04-14 07:52:00 +08:00
:deep(.transparent-table) {
background: white;
2025-04-14 09:34:51 +08:00
border: none;
2025-04-12 09:28:19 +08:00
}
2025-04-14 07:52:00 +08:00
:deep(.transparent-table .el-table__header th) {
background: white !important;
color: black;
2025-04-14 09:34:51 +08:00
border-right: none !important;
}
2025-04-14 07:52:00 +08:00
:deep(.transparent-table .el-table__body tr td) {
border-top: 1px solid rgba(0, 0, 0, 0.04);
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
2025-04-14 09:34:51 +08:00
border-right: none !important;
}
:deep(.transparent-table .el-table__header tr th:first-child .cell),
:deep(.transparent-table .el-table__body tr td:first-child .cell) {
padding-left: 10px;
}
2025-04-14 07:52:00 +08:00
:deep(.el-icon-edit) {
color: #7079aa;
cursor: pointer;
}
2025-04-14 07:52:00 +08:00
:deep(.el-icon-edit:hover) {
color: #5a64b5;
}
2025-04-14 07:52:00 +08:00
:deep(.custom-selection-header .el-checkbox) {
display: none !important;
}
:deep(.el-table .el-button--text) {
color: #7079aa;
}
:deep(.el-table .el-button--text:hover) {
color: #5a64b5;
}
2025-04-15 17:59:29 +08:00
:deep(.transparent-table) {
flex: 1;
display: flex;
flex-direction: column;
max-height: calc(100vh - 40vh);
2025-04-15 17:59:29 +08:00
}
2025-04-15 17:59:29 +08:00
:deep(.el-table__body-wrapper) {
flex: 1;
overflow-y: auto;
2025-04-15 17:59:29 +08:00
max-height: none !important;
}
:deep(.el-table__header-wrapper) {
flex-shrink: 0;
}
@media (min-width: 1144px) {
.table_bottom {
margin-top: 40px;
}
:deep(.transparent-table) .el-table__body tr td {
padding-top: 16px;
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;
}
2025-04-22 11:33:17 +08:00
::v-deep .el-table--border::after,
::v-deep .el-table--group::after,
::v-deep .el-table::before {
display: none !important;
}
2025-03-25 16:23:28 +08:00
</style>