大屏项目初始化

This commit is contained in:
2026-03-03 23:47:22 +08:00
parent 424527c62f
commit 9d4d641fa8
3 changed files with 39 additions and 28 deletions

View File

@@ -66,13 +66,15 @@ const getPlaceHolderCount = () => {
gap: 15px; gap: 15px;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: stretch;
} }
.search-grid-container :deep(.search-item) { .search-grid-container :deep(.search-item) {
margin-bottom: 0 !important; margin-bottom: 0 !important;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
display: flex;
align-items: center;
} }
.search-grid-container :deep(.search-input), .search-grid-container :deep(.search-input),
@@ -91,9 +93,10 @@ const getPlaceHolderCount = () => {
display: flex; display: flex;
gap: 8px; gap: 8px;
align-items: center; align-items: center;
justify-content: center;
width: 100%; width: 100%;
height: 100%;
box-sizing: border-box; box-sizing: border-box;
justify-content: flex-end;
} }
@media (max-width: 768px) { @media (max-width: 768px) {
@@ -105,7 +108,8 @@ const getPlaceHolderCount = () => {
display: none; display: none;
} }
.search-btn-group { .search-btn-group {
justify-content: flex-start; justify-content: center;
padding: 8px 0;
} }
} }
</style> </style>

View File

@@ -30,21 +30,17 @@
</template> </template>
<script setup> <script setup>
import { defineProps, defineEmits, reactive, watch } from 'vue' import { defineProps, defineEmits } from 'vue'
// 定义接收的属性
const props = defineProps({ const props = defineProps({
// 表格数据
tableData: { tableData: {
type: Array, type: Array,
default: () => [] default: () => []
}, },
// 加载状态
loading: { loading: {
type: Boolean, type: Boolean,
default: false default: false
}, },
// 分页参数(支持双向绑定)
pagination: { pagination: {
type: Object, type: Object,
default: () => ({ default: () => ({
@@ -55,15 +51,12 @@ const props = defineProps({
} }
}) })
// 定义触发的事件
const emit = defineEmits(['size-change', 'current-change']) const emit = defineEmits(['size-change', 'current-change'])
// 分页尺寸变化
const handleSizeChange = (val) => { const handleSizeChange = (val) => {
emit('size-change', val) emit('size-change', val)
} }
// 分页页码变化
const handleCurrentChange = (val) => { const handleCurrentChange = (val) => {
emit('current-change', val) emit('current-change', val)
} }
@@ -76,6 +69,8 @@ const handleCurrentChange = (val) => {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
gap: 4px;
box-sizing: border-box;
} }
.table-container { .table-container {
@@ -83,7 +78,7 @@ const handleCurrentChange = (val) => {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow: hidden !important; overflow: hidden !important;
padding: 12px; padding: 4px;
box-sizing: border-box; box-sizing: border-box;
} }
@@ -91,10 +86,13 @@ const handleCurrentChange = (val) => {
width: 100%; width: 100%;
--el-table-header-text-color: #333; --el-table-header-text-color: #333;
--el-table-row-hover-bg-color: #f8f9fa; --el-table-row-hover-bg-color: #f8f9fa;
--el-table-border-color: transparent !important;
} }
.data-table :deep(.el-table),
.data-table :deep(.el-table__header-wrapper), .data-table :deep(.el-table__header-wrapper),
.data-table :deep(.el-table__body-wrapper) { .data-table :deep(.el-table__body-wrapper),
.data-table :deep(.el-table__footer-wrapper) {
border: none !important; border: none !important;
} }
@@ -119,28 +117,31 @@ const handleCurrentChange = (val) => {
.pagination-footer { .pagination-footer {
width: 100%; width: 100%;
display: flex; display: flex;
justify-content: center; justify-content: flex-end;
padding: 8px 0; padding: 4px;
border: 1px solid #e5e7eb; margin: 0;
border-radius: 6px; border: none !important;
border-radius: 0;
border-top: 1px solid #e5e7eb !important;
flex-shrink: 0; flex-shrink: 0;
background: #fff; background: transparent;
z-index: 10; z-index: 10;
box-sizing: border-box;
} }
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar { .table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar {
width: 6px; width: 4px;
height: 6px; height: 4px;
} }
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-track { .table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
background: #f1f5f9; background: #f1f5f9;
border-radius: 3px; border-radius: 4px;
} }
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb { .table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
background: #cbd5e1; background: #cbd5e1;
border-radius: 3px; border-radius: 4px;
} }
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover { .table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {

View File

@@ -67,12 +67,16 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180" align="center"> <el-table-column label="操作" width="180" align="center" fixed="right">
<template #default="scope"> <template #default="scope">
<!-- 编辑按钮添加 Edit 图标 -->
<el-button size="small" type="primary" link @click="handleEdit(scope.row)"> <el-button size="small" type="primary" link @click="handleEdit(scope.row)">
<el-icon><Edit /></el-icon>
编辑 编辑
</el-button> </el-button>
<!-- 删除按钮添加 Delete 图标 -->
<el-button size="small" type="danger" link @click="handleDelete(scope.row)"> <el-button size="small" type="danger" link @click="handleDelete(scope.row)">
<el-icon><Delete /></el-icon>
删除 删除
</el-button> </el-button>
</template> </template>
@@ -97,7 +101,7 @@
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Plus, Download } from '@element-plus/icons-vue' import { Plus, Download, Edit, Delete } from '@element-plus/icons-vue'
import { getHomeUserList } from '@/api/bizUser' import { getHomeUserList } from '@/api/bizUser'
import CSearch from '@/components/Search/proSearch.vue' import CSearch from '@/components/Search/proSearch.vue'
@@ -237,7 +241,7 @@ onMounted(() => {
.data-manage-page { .data-manage-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 16px; padding: 4px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -251,7 +255,9 @@ onMounted(() => {
min-height: 0; min-height: 0;
border: 1px solid #e5e7eb; border: 1px solid #e5e7eb;
border-radius: 6px; border-radius: 6px;
margin-bottom: 12px; margin: 0 !important;
padding: 0;
box-sizing: border-box;
} }
.main-section { .main-section {
@@ -270,7 +276,7 @@ onMounted(() => {
flex-shrink: 0; flex-shrink: 0;
} }
.search-input, .search-select { :deep(.el-button .el-icon) {
width: 100%; margin-right: 4px;
} }
</style> </style>