大屏项目初始化

This commit is contained in:
2026-03-03 23:05:02 +08:00
parent 3df814d718
commit 424527c62f
32 changed files with 1382 additions and 1286 deletions

View File

@@ -0,0 +1,12 @@
import request from '@/utils/request'
/**
* 获取信息列表
*/
export function getWebsiteStorageList(params) {
return request({
url: '/biz/websiteStorage/list',
method: 'get',
params: params
})
}

View File

@@ -0,0 +1,135 @@
<template>
<el-dialog
v-model="dialogVisible"
:title="title"
width="60%"
destroy-on-close
@close="handleClose"
class="uni-custom-dialog"
>
<slot />
<template #footer>
<div class="dialog-footer">
<el-button
type="info"
icon="Refresh"
@click="handleReset"
v-if="showReset"
>
重置
</el-button>
<el-button
icon="Close"
@click="handleCancel"
>
取消
</el-button>
<el-button
type="primary"
icon="Check"
@click="handleConfirm"
class="save-btn"
>
{{ confirmText }}
</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup>
import { defineProps, defineEmits, ref, watch } from 'vue'
import { Refresh, Close, Check } from '@element-plus/icons-vue'
const props = defineProps({
modelValue: {
type: Boolean,
default: false
},
title: {
type: String,
default: '操作弹窗'
},
showReset: {
type: Boolean,
default: true
},
confirmText: {
type: String,
default: '保存'
}
})
const emit = defineEmits(['update:modelValue', 'close', 'reset', 'confirm'])
const dialogVisible = ref(props.modelValue)
watch(() => props.modelValue, (newVal) => {
dialogVisible.value = newVal
})
watch(dialogVisible, (newVal) => {
emit('update:modelValue', newVal)
})
const handleClose = () => {
emit('close')
dialogVisible.value = false
}
const handleCancel = () => {
dialogVisible.value = false
emit('close')
}
const handleReset = () => {
emit('reset')
}
const handleConfirm = () => {
emit('confirm')
}
</script>
<style>
.uni-custom-dialog .el-dialog__header {
border-bottom: 1px solid #1989fa !important;
padding-bottom: 15px !important;
margin-bottom: 10px !important;
}
.uni-custom-dialog .el-dialog__footer {
border-top: 1px solid #1989fa !important;
padding-top: 15px !important;
margin-top: 10px !important;
}
.uni-custom-dialog .dialog-footer {
display: flex;
gap: 12px;
justify-content: flex-end;
width: 100%;
}
.uni-custom-dialog .save-btn {
font-weight: 600;
padding: 8px 20px;
}
.uni-custom-dialog .el-button--info:hover {
background-color: #409eff !important;
border-color: #409eff !important;
color: #ffffff !important;
}
.uni-custom-dialog .dialog-footer .el-button--default:hover {
background-color: #f0f2f5 !important;
border-color: #c6cdd4 !important;
color: #303133 !important;
}
.uni-custom-dialog .dialog-footer .el-button--primary:hover {
background-color: #0d82e0 !important;
border-color: #0d82e0 !important;
color: #ffffff !important;
}
</style>

View File

@@ -0,0 +1,111 @@
<template>
<div class="search-section">
<div class="search-grid-container">
<slot />
<div
v-for="i in getPlaceHolderCount()"
:key="`placeholder-${i}`"
class="placeholder-item"
></div>
<div class="search-btn-group">
<el-button type="primary" icon="Search" @click="handleSearch">
查询
</el-button>
<el-button type="info" icon="Refresh" @click="handleReset">
重置
</el-button>
</div>
</div>
</div>
</template>
<script setup>
import { ref, defineEmits, onMounted, nextTick } from 'vue'
import { Search, Refresh } from '@element-plus/icons-vue'
const emit = defineEmits(['search', 'reset'])
const conditionCount = ref(0)
const handleSearch = () => {
emit('search')
}
const handleReset = () => {
emit('reset')
}
onMounted(async () => {
await nextTick()
calcConditionCount()
})
const calcConditionCount = () => {
const items = document.querySelectorAll('.search-grid-container .search-item')
conditionCount.value = items ? items.length : 0
}
const getPlaceHolderCount = () => {
const currentRowRemain = 4 - (conditionCount.value % 4)
return currentRowRemain === 0 ? 3 : currentRowRemain - 1
}
</script>
<style scoped>
.search-section {
width: 100%;
margin-bottom: 16px;
flex-shrink: 0;
padding-bottom: 12px;
border-bottom: 1px solid #e5e7eb;
box-sizing: border-box;
}
.search-grid-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 15px;
width: 100%;
box-sizing: border-box;
align-items: center;
}
.search-grid-container :deep(.search-item) {
margin-bottom: 0 !important;
width: 100%;
box-sizing: border-box;
}
.search-grid-container :deep(.search-input),
.search-grid-container :deep(.search-select) {
width: 100%;
box-sizing: border-box;
}
.placeholder-item {
width: 100%;
height: 1px;
visibility: hidden;
}
.search-btn-group {
display: flex;
gap: 8px;
align-items: center;
width: 100%;
box-sizing: border-box;
justify-content: flex-end;
}
@media (max-width: 768px) {
.search-grid-container {
grid-template-columns: 1fr !important;
gap: 10px;
}
.placeholder-item {
display: none;
}
.search-btn-group {
justify-content: flex-start;
}
}
</style>

View File

@@ -0,0 +1,149 @@
<template>
<div class="custom-table-wrapper">
<div class="table-container">
<el-table
:data="tableData"
v-loading="loading"
class="data-table"
height="100%"
border="false"
>
<slot name="columns" />
</el-table>
<div v-if="tableData.length === 0 && !loading" class="empty-tip">
<el-empty description="暂无数据" />
</div>
</div>
<div class="pagination-footer">
<el-pagination
v-model:current-page="pagination.pageNum"
v-model:page-size="pagination.pageSize"
:page-sizes="[10, 20, 50, 100]"
:total="pagination.total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
background
/>
</div>
</div>
</template>
<script setup>
import { defineProps, defineEmits, reactive, watch } from 'vue'
// 定义接收的属性
const props = defineProps({
// 表格数据
tableData: {
type: Array,
default: () => []
},
// 加载状态
loading: {
type: Boolean,
default: false
},
// 分页参数(支持双向绑定)
pagination: {
type: Object,
default: () => ({
pageNum: 1,
pageSize: 20,
total: 0
})
}
})
// 定义触发的事件
const emit = defineEmits(['size-change', 'current-change'])
// 分页尺寸变化
const handleSizeChange = (val) => {
emit('size-change', val)
}
// 分页页码变化
const handleCurrentChange = (val) => {
emit('current-change', val)
}
</script>
<style scoped>
.custom-table-wrapper {
flex: 1;
width: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.table-container {
flex: 1;
width: 100%;
height: 100%;
overflow: hidden !important;
padding: 12px;
box-sizing: border-box;
}
.data-table {
width: 100%;
--el-table-header-text-color: #333;
--el-table-row-hover-bg-color: #f8f9fa;
}
.data-table :deep(.el-table__header-wrapper),
.data-table :deep(.el-table__body-wrapper) {
border: none !important;
}
.data-table :deep(.el-table__cell) {
border: none !important;
border-right: none !important;
border-bottom: 1px solid #f0f0f0 !important;
}
.data-table :deep(.el-table__header .el-table__cell) {
border-bottom: 1px solid #e5e7eb !important;
}
.empty-tip {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.pagination-footer {
width: 100%;
display: flex;
justify-content: center;
padding: 8px 0;
border: 1px solid #e5e7eb;
border-radius: 6px;
flex-shrink: 0;
background: #fff;
z-index: 10;
}
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-track {
background: #f1f5f9;
border-radius: 3px;
}
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 3px;
}
.table-container :deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
</style>

View File

@@ -3,8 +3,8 @@
<div class="search-section">
<div class="search-wrapper">
<el-input
v-model="searchForm.keyword"
placeholder="请输入搜索关键词"
v-model="searchForm.websiteName"
placeholder="请输入搜索网站名称"
class="search-input"
clearable
@keyup.enter="handleSearch"
@@ -16,63 +16,47 @@
</div>
</div>
<div class="tabs-section">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
<el-tab-pane
v-for="tab in tabList"
:key="tab.key"
:label="tab.name"
:name="tab.key"
>
</el-tab-pane>
</el-tabs>
</div>
<div class="list-wrapper">
<div class="list-section">
<div v-if="listData.length === 0" class="empty-tip">
<el-empty description="暂无数据" />
</div>
<div v-else class="card-list">
<el-card
v-for="item in listData"
:key="item.id"
:key="item.websiteId"
class="list-card"
shadow="hover"
>
<div class="card-top">
<div class="site-avatar">
<el-icon size="24"><Link /></el-icon>
</div>
<div class="site-main">
<div class="site-name">{{ item.siteName }}</div>
<el-tooltip :content="item.siteUrl" placement="top">
<div class="site-url">{{ item.siteUrl }}</div>
<el-tooltip :content="item.websiteName" placement="top">
<div class="site-name">{{ item.websiteName }}</div>
</el-tooltip>
<el-tooltip :content="item.websiteUrl" placement="top">
<div class="site-url">{{ item.websiteUrl }}</div>
</el-tooltip>
</div>
</div>
<div class="card-divider"></div>
<div class="card-bottom">
<span class="card-date">{{ item.date }}</span>
<span class="card-date">{{ item.createTime }}</span>
<div class="card-actions">
<el-button size="small" type="primary" link @click="handleVisit(item)">
<el-icon><Link /></el-icon>
访问
</el-button>
<el-button size="small" type="text" @click="handleDetail(item)">详情</el-button>
</div>
</div>
</el-card>
</div>
</div>
</div>
<div class="pagination-footer">
<el-pagination
v-model:current-page="pagination.pageNum"
v-model:page-size="pagination.pageSize"
:page-sizes="[ 20, 50, 99]"
:page-sizes="[20, 50, 99]"
:total="pagination.total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@@ -87,18 +71,12 @@
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { Link } from '@element-plus/icons-vue'
import { getWebsiteStorageList } from '@/api/bizWebsiteStorage'
const searchForm = reactive({
keyword: ''
websiteName: ''
})
const tabList = ref([
{ key: 'tab1', name: '标签一' },
{ key: 'tab2', name: '标签二' },
{ key: 'tab3', name: '标签三' }
])
const activeTab = ref('tab1')
const pagination = reactive({
pageNum: 1,
pageSize: 20,
@@ -106,45 +84,50 @@ const pagination = reactive({
})
const listData = ref([])
const fetchData = () => {
const getDataList = async () => {
try {
const reqParmas = {
...searchForm,
pageNum: pagination.pageNum,
pageSize: pagination.pageSize,
}
const res = await getWebsiteStorageList(reqParmas)
listData.value = res.list || []
pagination.total = res.total
} catch (error) {
console.log(error)
}
}
const handleVisit = (item) => {
window.open(item.siteUrl, '_blank')
}
const handleDetail = (item) => {
ElMessage.info(`查看 ${item.siteName} 详情`)
window.open(item.websiteUrl, '_blank')
}
const handleSearch = () => {
pagination.pageNum = 1
fetchData()
getDataList()
}
const handleReset = () => {
searchForm.keyword = ''
Object.assign(searchForm, {
websiteName: ''
})
pagination.pageNum = 1
fetchData()
}
const handleTabChange = (tabKey) => {
pagination.pageNum = 1
fetchData()
getDataList()
}
const handleSizeChange = (val) => {
pagination.pageSize = val
fetchData()
getDataList()
}
const handleCurrentChange = (val) => {
pagination.pageNum = val
fetchData()
getDataList()
}
onMounted(() => {
fetchData()
getDataList()
})
</script>
@@ -180,14 +163,7 @@ onMounted(() => {
.search-btn-group {
display: flex;
gap: 8px;
flex-shrink: 0;
}
.tabs-section {
width: 100%;
border-bottom: 1px solid #e5e7eb;
margin-bottom: 16px;
gap: 2px;
flex-shrink: 0;
}
@@ -241,21 +217,9 @@ onMounted(() => {
.card-top {
display: flex;
align-items: center;
align-items: flex-start;
gap: 12px;
padding: 16px;
}
.site-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: #f0f7ff;
display: flex;
align-items: center;
justify-content: center;
color: #409eff;
flex-shrink: 0;
padding: 6px 12px 4px;
}
.site-main {
@@ -267,7 +231,7 @@ onMounted(() => {
font-weight: 600;
font-size: 16px;
color: #1f2937;
margin-bottom: 4px;
margin-bottom: 2px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -290,14 +254,14 @@ onMounted(() => {
.card-divider {
height: 1px;
background: #f0f0f0;
margin: 0 16px;
margin: 0 12px;
}
.card-bottom {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
padding: 8px 12px 8px;
}
.card-date {

View File

@@ -1,751 +0,0 @@
<template>
<div class="data-container">
<div class="search-border-container">
<el-form :model="searchForm" class="search-form">
<div class="form-items-wrapper">
<el-form-item label="用户名称:" class="form-item">
<el-input
v-model="searchForm.uname"
placeholder="请输入用户名称"
clearable
/>
</el-form-item>
<el-form-item label="登录账户:" class="form-item">
<el-input
v-model="searchForm.userName"
placeholder="请输入登录账户"
clearable
/>
</el-form-item>
<el-form-item label="登录状态:" class="form-item">
<el-select
v-model="searchForm.ustatus"
placeholder="请选择登录状态"
clearable
class="custom-select"
popper-class="theme-select-popper"
>
<el-option label="停用" value="0" />
<el-option label="再用" value="1" />
<el-option label="锁定" value="2" />
</el-select>
</el-form-item>
</div>
<el-form-item class="form-btn-group">
<el-button type="primary" @click="handleSearch">
<el-icon><Search /></el-icon>
查询
</el-button>
<el-button type="default" @click="handleReset" class="reset-btn">
<el-icon><Refresh /></el-icon>
重置
</el-button>
</el-form-item>
</el-form>
</div>
<div class="main-content-container">
<div class="table-toolbar">
<el-button type="primary" @click="handleAdd">
<el-icon><Plus /></el-icon>
新增
</el-button>
</div>
<div class="table-wrapper">
<el-table
:data="tableData"
stripe
style="width: 100%; height: 100%"
empty-text="暂无相关数据"
class="data-table"
v-loading="loading"
loading-text="正在加载数据..."
:header-cell-style="{
background: 'rgba(10, 30, 60, 0.8)',
color: '#a0cfff',
border: 'none',
borderBottom: '1px solid rgba(64, 158, 255, 0.3)'
}"
:row-style="{
background: 'transparent',
color: '#a0cfff',
border: 'none'
}"
:cell-style="{
border: 'none',
borderBottom: '1px solid rgba(64, 158, 255, 0.2)'
}"
>
<el-table-column prop="createTime" label="记录日期" />
<el-table-column prop="userName" label="登录账户" />
<el-table-column prop="uname" label="用户名称" />
<el-table-column prop="sex" label="性别" />
<el-table-column prop="email" label="电子邮箱" />
<el-table-column prop="phone" label="联系电话" />
<el-table-column
label="操作"
fixed="right"
width="180"
:header-cell-style="{
padding: '0 10px',
textAlign: 'center'
}"
:cell-style="{
padding: '0 10px',
textAlign: 'center'
}"
>
<template #default="scope">
<el-button
type="primary"
size="small"
@click="handleEdit(scope.row)"
icon="Edit"
circle
/>
<el-button
type="danger"
size="small"
@click="handleDelete(scope.row)"
icon="Delete"
circle
/>
<el-button
type="warning"
size="small"
@click="handleStatusChange(scope.row)"
icon="Switch"
circle
/>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-wrapper">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[20, 50, 99]"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
class="custom-pagination"
popper-class="theme-pagination-popper"
:teleported="false"
/>
</div>
</div>
<el-dialog
v-model="dialogVisible"
:title="dialogTitle"
width="80%"
class="custom-dialog"
:close-on-click-modal="false"
:destroy-on-close="true"
>
<VForm
ref="formRef"
:form-data="formData"
:is-edit="isEdit"
/>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false" class="dialog-cancel-btn">取消</el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, onMounted, reactive } from 'vue'
import { ElMessage } from 'element-plus'
import { Plus, Search, Refresh, Edit, Delete, Switch } from '@element-plus/icons-vue'
import { getHomeUserList } from '@/api/bizUser'
import VForm from './form.vue';
const loading = ref(false)
const searchForm = reactive({
uname: '',
ustatus: '',
userName: ''
})
const tableData = ref([])
const currentPage = ref(1)
const pageSize = ref(20)
const total = ref(0)
const dialogVisible = ref(false)
const dialogTitle = ref('')
const isEdit = ref(false)
const formData = ref({})
const formRef = ref(null)
const handleAdd = () => {
dialogTitle.value = '新增用户'
isEdit.value = false
formData.value = {
uname: '',
userName: '',
sex: '',
email: '',
phone: '',
roleId: '',
groupModuleId: '',
ustatus: '1'
}
dialogVisible.value = true
}
const handleEdit = (row) => {
dialogTitle.value = '编辑用户'
isEdit.value = true
formData.value = { ...row }
dialogVisible.value = true
console.log('点击编辑按钮', row)
}
const handleSubmit = async () => {
try {
// 调用子组件的表单验证
const isValid = await formRef.value.validate()
if (!isValid) return
if (isEdit.value) {
console.log('编辑用户提交数据:', formData.value)
} else {
console.log('新增用户提交数据:', formData.value)
}
dialogVisible.value = false
await getList()
ElMessage.success(isEdit.value ? '编辑成功' : '新增成功')
} catch (error) {
console.error('提交失败:', error)
ElMessage.error(isEdit.value ? '编辑失败' : '新增失败')
}
}
const handleDelete = (row) => {
console.log('点击删除按钮', row)
}
const handleStatusChange = (row) => {
console.log('点击状态切换按钮', row)
}
const handleSearch = () => {
getList();
}
const handleReset = () => {
Object.assign(searchForm, {
uname: '',
ustatus: '',
userName: ''
})
currentPage.value = 1;
getList();
}
const handleSizeChange = (val) => {
pageSize.value = val
getList()
}
const handleCurrentChange = (val) => {
currentPage.value = val
getList()
}
async function getList() {
loading.value = true
try {
const reqParmas = {
... searchForm,
pageNum: currentPage.value,
pageSize: pageSize.value,
}
const res = await getHomeUserList(reqParmas);
total.value = res.total;
tableData.value = res.list || [];
} catch (error) {
console.error('获取数据失败:', error);
tableData.value = [];
} finally {
loading.value = false
}
}
onMounted(async () => {
await getList();
})
</script>
<style scoped>
.data-container {
width: 100%;
height: 100vh;
min-height: 500px;
border-radius: 8px;
padding: 16px;
background-color: rgba(10, 30, 60, 0.05);
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 16px;
overflow: hidden;
backdrop-filter: blur(2px);
}
.search-border-container {
border: 1px solid rgba(64, 158, 255, 0.15);
border-radius: 8px;
padding: 16px;
background-color: rgba(10, 30, 60, 0.08);
flex-shrink: 0;
backdrop-filter: blur(2px);
}
.search-form {
display: flex;
align-items: center;
width: 100%;
flex-wrap: wrap;
}
.form-items-wrapper {
display: flex;
flex: 1;
gap: 20px;
min-width: 0;
flex-wrap: wrap;
}
.form-item {
flex: 1;
margin-bottom: 0 !important;
min-width: 180px;
}
.form-btn-group {
margin-left: 20px;
margin-bottom: 0 !important;
flex-shrink: 0;
display: flex;
gap: 10px;
}
.main-content-container {
border: 1px solid rgba(64, 158, 255, 0.15);
border-radius: 8px;
padding: 16px;
background-color: rgba(10, 30, 60, 0.08);
display: flex;
flex-direction: column;
gap: 12px;
flex: 1;
overflow: hidden;
backdrop-filter: blur(2px);
}
.table-toolbar {
display: flex;
justify-content: flex-start;
padding: 0;
margin: 0;
flex-shrink: 0;
}
.table-wrapper {
flex: 1;
overflow: auto;
min-height: 200px;
background-color: rgba(10, 30, 60, 0.08);
}
.data-table {
width: 100%;
height: 100%;
}
.pagination-wrapper {
display: flex;
justify-content: flex-end;
align-items: center;
padding-top: 8px;
border-top: 1px solid rgba(64, 158, 255, 0.1);
background-color: transparent !important;
flex-shrink: 0;
margin: 0;
position: relative;
}
/* ========== 终极统一输入框/下拉框样式 ========== */
:deep(.el-input__wrapper),
:deep(.el-select__wrapper) {
background-color: rgba(10, 30, 60, 0.6) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
box-shadow: none !important;
border-radius: 4px !important;
background-image: none !important;
opacity: 1 !important;
transition: all 0s ease 0s !important; /* 彻底禁用过渡动画 */
--el-input-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-hover-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-focus-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-focus-box-shadow: none !important;
--el-input-bg-color: transparent !important;
--el-select-bg-color: transparent !important;
--el-input-text-color: #e0e6ff !important;
--el-input-placeholder-color: rgba(224, 230, 255, 0.6) !important;
}
/* 强制覆盖所有状态,包括伪类和内置类名 */
:deep(.el-input__wrapper:hover),
:deep(.el-select__wrapper:hover),
:deep(.el-input__wrapper.is-focus),
:deep(.el-select__wrapper.is-focus),
:deep(.el-input__wrapper:focus-within),
:deep(.el-select__wrapper:focus-within),
:deep(.el-input__wrapper.el-input__wrapper--focus),
:deep(.el-select__wrapper.el-select__wrapper--focus),
:deep(.el-input__wrapper:active),
:deep(.el-select__wrapper:active) {
background-color: rgba(10, 30, 60, 0.6) !important;
border-color: rgba(64, 158, 255, 0.3) !important;
box-shadow: none !important;
outline: none !important;
transition: all 0s ease 0s !important;
}
/* 内部输入框/选择器彻底透明化 */
:deep(.el-select),
:deep(.el-select .el-input),
:deep(.el-select .el-input__wrapper),
:deep(.el-input),
:deep(.el-input__inner),
:deep(.el-select__inner),
:deep(.el-select-v2__inner) {
background-color: transparent !important;
color: #e0e6ff !important;
box-shadow: none !important;
outline: none !important;
border: none !important;
transition: all 0s ease 0s !important;
}
/* 占位符样式 */
:deep(.el-input__placeholder),
:deep(.el-select__placeholder) {
color: rgba(224, 230, 255, 0.6) !important;
opacity: 1 !important;
}
/* 图标样式 */
:deep(.el-select__suffix-inner>.el-icon),
:deep(.el-input__suffix-inner>.el-icon),
:deep(.el-input__clear),
:deep(.el-select__clear) {
color: #e0e6ff !important;
background-color: transparent !important;
transition: all 0s ease 0s !important;
}
/* 禁用状态 */
:deep(.el-input.is-disabled .el-input__wrapper),
:deep(.el-select.is-disabled .el-select__wrapper) {
background-color: rgba(10, 30, 60, 0.4) !important;
border-color: rgba(64, 158, 255, 0.2) !important;
color: rgba(224, 230, 255, 0.5) !important;
--el-input-disabled-bg-color: rgba(10, 30, 60, 0.4) !important;
transition: all 0s ease 0s !important;
}
/* ========== 原有样式 ========== */
:deep(.el-table .el-button--small) {
margin: 0 2px;
width: 32px;
height: 32px;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
}
:deep(.el-table__fixed-right) {
background-color: transparent !important;
border-left: 1px solid rgba(64, 158, 255, 0.2) !important;
}
:deep(.el-table__fixed-right::before) {
display: none !important;
}
:deep(.el-form-item__label) {
color: #e0e6ff !important;
font-size: 14px;
}
:deep(.custom-pagination) {
--el-pagination-text-color: #e0e6ff;
--el-pagination-button-color: #e0e6ff;
--el-pagination-button-hover-color: #409EFF;
--el-pagination-button-active-color: #409EFF;
--el-pagination-border-color: #409EFF;
--el-pagination-bg-color: transparent !important;
background-color: transparent !important;
}
:deep(.el-pagination) {
--el-pagination-hover-border-color: #409EFF !important;
--el-pagination-active-border-color: #409EFF !important;
}
:deep(.el-pagination button) {
background-color: rgba(10, 30, 60, 0.6) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
color: #e0e6ff !important;
outline: none !important;
box-shadow: none !important;
}
:deep(.el-pagination .el-pager li) {
color: #e0e6ff !important;
}
:deep(.el-pagination .el-pager li.active) {
color: #409EFF !important;
font-weight: bold;
}
:deep(.theme-pagination-popper) {
background-color: rgba(10, 30, 60, 0.85) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
color: #e0e6ff !important;
z-index: 99999 !important;
position: absolute !important;
top: auto !important;
bottom: calc(100% + 8px) !important;
right: 0 !important;
left: auto !important;
margin: 0 !important;
transform: none !important;
width: auto !important;
min-width: 80px !important;
outline: none !important;
box-shadow: none !important;
border-radius: 4px !important;
box-sizing: border-box !important;
backdrop-filter: blur(4px);
}
:deep(.theme-pagination-popper * ) {
border: none !important;
outline: none !important;
box-shadow: none !important;
}
:deep(.theme-pagination-popper .el-pagination__sizes-option) {
color: #e0e6ff !important;
padding: 6px 12px !important;
background-color: transparent !important;
}
:deep(.theme-pagination-popper .el-pagination__sizes-option:hover) {
background-color: rgba(64, 158, 255, 0.2) !important;
color: #fff !important;
}
:deep(.el-table) {
--el-table-text-color: #a0cfff;
--el-table-header-text-color: #a0cfff;
--el-table-row-hover-bg-color: rgba(64, 158, 255, 0.2);
--el-table-border-color: transparent !important;
--el-table-stripe-row-bg-color: rgba(10, 30, 60, 0.3);
background-color: transparent !important;
border: none !important;
--el-loading-background-color: rgba(10, 30, 60, 0.8) !important;
--el-loading-text-color: #a0cfff !important;
}
:deep(.el-table th) {
border: none !important;
border-bottom: 1px solid rgba(64, 158, 255, 0.3) !important;
background-color: rgba(10, 30, 60, 0.8) !important;
color: #a0cfff !important;
}
:deep(.el-table td) {
border: none !important;
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
background-color: transparent !important;
color: #a0cfff !important;
}
:deep(.el-table--striped .el-table__row--striped td) {
background-color: rgba(10, 30, 60, 0.3) !important;
}
:deep(.el-table__row:hover > td) {
background-color: rgba(64, 158, 255, 0.2) !important;
}
:deep(.el-table tr:last-child td) {
border-bottom: none !important;
}
:deep(.el-table-empty-text) {
color: #a0cfff !important;
}
:deep(.el-button) {
--el-button-text-color: #e0e6ff !important;
--el-button-border-color: rgba(64, 158, 255, 0.3) !important;
--el-button-hover-text-color: #fff !important;
--el-button-hover-border-color: #409EFF !important;
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
height: 32px;
padding: 0 16px;
outline: none !important;
box-shadow: none !important;
border-radius: 4px !important;
transition: all 0.2s ease !important;
}
:deep(.el-button .el-icon) {
margin-right: 6px;
font-size: 14px;
}
:deep(.el-button--primary) {
--el-button-text-color: #fff !important;
--el-button-bg-color: rgba(64, 158, 255, 0.6) !important;
--el-button-border-color: rgba(64, 158, 255, 0.4) !important;
--el-button-hover-bg-color: #409EFF !important;
}
:deep(.reset-btn) {
background-color: rgba(10, 30, 60, 0.6) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
color: #e0e6ff !important;
--el-button-hover-bg-color: rgba(64, 158, 255, 0.2) !important;
--el-button-hover-border-color: #409EFF !important;
--el-button-hover-text-color: #fff !important;
}
:deep(.custom-dialog) {
--el-dialog-bg-color: rgba(10, 30, 60, 0.9) !important;
--el-dialog-border-color: rgba(64, 158, 255, 0.3) !important;
--el-dialog-title-color: #e0e6ff !important;
--el-dialog-text-color: #e0e6ff !important;
backdrop-filter: blur(4px);
border-radius: 8px !important;
}
:deep(.el-dialog__header) {
border-bottom: 1px solid rgba(64, 158, 255, 0.2) !important;
padding-bottom: 12px !important;
}
:deep(.el-dialog__body) {
padding: 20px !important;
color: #e0e6ff !important;
}
:deep(.el-dialog__footer) {
border-top: 1px solid rgba(64, 158, 255, 0.2) !important;
padding-top: 12px !important;
text-align: right !important;
}
:deep(.dialog-cancel-btn) {
background-color: rgba(10, 30, 60, 0.8) !important;
border: 1px solid rgba(100, 116, 139, 0.5) !important;
color: #94a3b8 !important;
--el-button-hover-bg-color: rgba(10, 30, 60, 0.9) !important;
--el-button-hover-border-color: rgba(148, 163, 184, 0.8) !important;
--el-button-hover-text-color: #cbd5e1 !important;
}
/* 修复Loading样式 - 核心修复 */
:deep(.el-loading-mask) {
background-color: rgba(10, 30, 60, 0.8) !important;
backdrop-filter: blur(2px);
}
:deep(.el-loading-spinner) {
--el-loading-color: #409EFF !important;
}
:deep(.el-loading-spinner .el-loading-text) {
color: #a0cfff !important;
font-size: 14px;
}
.data-container::-webkit-scrollbar,
:deep(.el-table__body-wrapper)::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.data-container::-webkit-scrollbar-track,
:deep(.el-table__body-wrapper)::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
background: rgba(10, 30, 60, 0.1);
border-radius: 6px;
}
.data-container::-webkit-scrollbar-thumb,
:deep(.el-table__body-wrapper)::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
background: rgba(64, 158, 255, 0.4);
border-radius: 6px;
}
</style>
<style>
/* 全局下拉菜单样式(父子组件共用) */
.theme-select-popper {
background-color: rgba(10, 30, 60, 0.85) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
color: #e0e6ff !important;
z-index: 99999 !important;
outline: none !important;
box-shadow: none !important;
border-radius: 4px !important;
backdrop-filter: blur(4px);
}
.theme-select-popper * {
border: none !important;
outline: none !important;
box-shadow: none !important;
}
.theme-select-popper .el-select-dropdown__item {
color: #e0e6ff !important;
background-color: transparent !important;
}
.theme-select-popper .el-select-dropdown__item:hover {
background-color: rgba(64, 158, 255, 0.2) !important;
color: #fff !important;
}
.theme-select-popper .el-select-dropdown__item.selected {
background-color: rgba(64, 158, 255, 0.3) !important;
color: #fff !important;
}
</style>

View File

@@ -1,340 +0,0 @@
<template>
<div class="layout-container">
<div class="left-panel">
<div class="panel-header">
<h3 class="panel-title">功能菜单</h3>
</div>
<div class="menu-wrap">
<div class="menu-container">
<div
class="menu-item"
v-for="menu in menuList"
:key="menu.id"
:class="{ active: activeMenuId === menu.id }"
@click="switchMenu(menu.id)"
>
<component :is="menu.icon" class="menu-icon" />
<span class="menu-text">{{ menu.name }}</span>
</div>
</div>
</div>
</div>
<div class="right-panel">
<div class="content-container">
<!-- 核心修改给content-item添加full-height类 -->
<div v-if="activeMenuId === 1" class="content-item full-height">
<UserIndex />
</div>
<div v-else-if="activeMenuId === 2" class="content-item default-content">
<h2>业务分析</h2>
<p>这里展示各业务线详细数据业务流程异常预警等内容支持按维度筛选和查看</p>
</div>
<div v-else-if="activeMenuId === 3" class="content-item default-content">
<h2>用户管理</h2>
<p>这里展示用户列表权限配置操作日志用户画像等用户相关管理内容</p>
</div>
<div v-else-if="activeMenuId === 4" class="content-item default-content">
<h2>系统设置</h2>
<p>这里展示参数配置模板管理备份恢复系统日志等系统级配置内容</p>
</div>
<div v-else-if="activeMenuId === 5" class="content-item default-content">
<h2>数据报表</h2>
<p>这里展示各类数据报表导出打印等功能支持自定义报表模板</p>
</div>
<div v-else class="content-item default-content">
<h2>欢迎使用数字化管理平台</h2>
<p>请点击左侧菜单查看对应的功能模块内容</p>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, watch } from 'vue';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import UserIndex from './components/user/index.vue';
const props = defineProps({
formParams: {
type: Object,
default: () => ({})
}
});
const menuList = ref([
{ id: 1, name: '用户管理', icon: ElementPlusIconsVue.User },
{ id: 2, name: '系统设置', icon: ElementPlusIconsVue.Setting },
{ id: 3, name: '数据报表', icon: ElementPlusIconsVue.Document },
{ id: 4, name: '日志管理', icon: ElementPlusIconsVue.Files },
{ id: 5, name: '权限配置', icon: ElementPlusIconsVue.Lock },
]);
const activeMenuId = ref(0);
const switchMenu = (id) => {
activeMenuId.value = id;
console.log(`切换到菜单:${menuList.value.find(item => item.id === id)?.name}`);
};
</script>
<style scoped>
.layout-container {
width: 100%;
height: 100%;
background-color: transparent;
display: flex;
flex-direction: row;
overflow: hidden;
box-sizing: border-box;
}
/* 左侧15%面板 */
.left-panel {
width: 15%;
height: 100%;
background-color: rgba(15, 52, 96, 0.9);
border-right: 1px solid #1a508b;
border-radius: 11px 0 0 11px;
padding: 16px;
box-sizing: border-box;
display: flex;
flex-direction: column;
gap: 12px;
}
.left-panel::-webkit-scrollbar {
display: none;
}
.panel-header {
padding: 12px;
border: 1px solid #1a508b;
border-radius: 8px;
background-color: rgba(21, 69, 128, 0.6);
position: sticky;
top: 0;
z-index: 10;
}
.panel-title {
font-size: 20px;
font-weight: 600;
color: #3c9cff;
text-align: center;
letter-spacing: 1px;
margin: 0;
text-shadow: 0 0 8px rgba(60, 156, 255, 0.3);
}
.menu-wrap {
flex: 1;
border: 1px solid #1a508b;
border-radius: 8px;
padding: 8px;
background-color: rgba(15, 52, 96, 0.5);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: #3c9cff rgba(15, 52, 96, 0.5);
}
.menu-wrap::-webkit-scrollbar {
width: 6px;
}
.menu-wrap::-webkit-scrollbar-track {
background: rgba(15, 52, 96, 0.5);
border-radius: 3px;
}
.menu-wrap::-webkit-scrollbar-thumb {
background-color: #3c9cff;
border-radius: 6px;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.menu-container {
display: flex;
flex-direction: column;
gap: 8px;
}
.menu-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s ease;
background-color: rgba(21, 69, 128, 0.5);
color: #e0e6ff;
font-size: 16px;
letter-spacing: 0.5px;
}
.menu-item:hover {
background-color: rgba(21, 69, 128, 0.8);
box-shadow: 0 2px 6px rgba(60, 156, 255, 0.2);
}
.menu-item.active {
background: linear-gradient(90deg, #1a508b, #3c9cff);
color: #fff;
font-weight: 500;
box-shadow: 0 2px 8px rgba(60, 156, 255, 0.4);
}
.menu-icon {
font-size: 18px;
width: 24px;
text-align: center;
color: inherit;
}
.menu-text {
flex: 1;
}
.right-panel {
width: 85%;
height: 100%;
background-color: rgba(15, 52, 96, 0.9);
border-left: 1px solid #1a508b;
border-radius: 0 11px 11px 0;
padding: 0;
box-sizing: border-box;
overflow: hidden;
}
.right-panel::-webkit-scrollbar {
display: none;
}
.content-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
color: #e0e6ff;
padding: 0;
margin: 0;
}
.full-height {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
.default-content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
max-width: 80%;
margin: 0 auto;
}
.default-content h2 {
font-size: 28px;
opacity: 0.95;
letter-spacing: 1px;
font-weight: 600;
margin: 0 0 20px 0;
background: linear-gradient(90deg, #3c9cff, #82b9ff);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.default-content p {
font-size: 18px;
opacity: 0.75;
color: #b4c7e7;
line-height: 1.8;
}
/* 响应式适配 */
@media (max-width: 1600px) {
.left-panel {
padding: 12px;
}
.panel-title {
font-size: 18px;
}
.menu-item {
padding: 10px 14px;
font-size: 14px;
}
.menu-icon {
font-size: 16px;
}
.default-content h2 {
font-size: 24px;
}
.default-content p {
font-size: 16px;
}
}
@media (max-width: 768px) {
.layout-container {
flex-direction: column;
}
.left-panel {
width: 100%;
height: 30%;
border-right: none;
border-bottom: 1px solid #1a508b;
border-radius: 11px 11px 0 0;
flex-direction: row;
align-items: stretch;
gap: 8px;
padding: 8px;
}
.panel-header {
width: 20%;
display: flex;
align-items: center;
justify-content: center;
padding: 8px;
}
.panel-title {
font-size: 16px;
white-space: nowrap;
}
.menu-wrap {
flex: 1;
padding: 4px;
}
.menu-container {
flex-direction: row;
flex-wrap: wrap;
gap: 4px;
}
.menu-item {
padding: 6px 10px;
font-size: 13px;
gap: 6px;
flex: 0 0 calc(33.33% - 4px);
justify-content: center;
}
.right-panel {
width: 100%;
height: 70%;
border-left: none;
border-top: 1px solid #1a508b;
border-radius: 0 0 11px 11px;
}
.default-content h2 {
font-size: 20px;
}
.default-content p {
font-size: 14px;
max-width: 90%;
}
}
</style>

View File

@@ -29,10 +29,7 @@
</header>
<main class="screen-content">
<div v-if="activeTab === 'home'" class="screen-page">
<HomeIndex :formParams="FormValues" />
</div>
<div v-else-if="activeTab === 'work'" class="screen-page">
<div v-if="activeTab === 'work'" class="screen-page">
<WorkIndex :formParams="FormValues" />
</div>
<div v-else-if="activeTab === 'werp'" class="screen-page">
@@ -44,10 +41,8 @@
<script setup>
import { ref, onMounted } from 'vue';
import HomeIndex from './Home/index.vue';
import ErpIndex from './Erp/index.vue';
import WorkIndex from './Work/index.vue';
import { getHomeModuleList } from '@/api/bizApi'
const screenTitle = ref('个人数字化可视化看板');
@@ -58,8 +53,7 @@ const FormValues = ref({
});
const allTabs = ref([])
const activeTab = ref('home')
const activeTab = ref('work')
const queryDate = ref();
const switchTab = (key) => {

View File

@@ -35,7 +35,6 @@
v-model="formData.sex"
placeholder="请选择性别"
clearable
popper-class="theme-select-popper"
>
<el-option label="男" value="男" />
<el-option label="女" value="女" />
@@ -72,7 +71,6 @@
v-model="formData.roleId"
placeholder="请选择用户角色"
clearable
popper-class="theme-select-popper"
>
<el-option label="管理员" value="0" />
<el-option label="普通用户" value="1" />
@@ -89,7 +87,6 @@
v-model="formData.groupModuleId"
placeholder="请选择系统模块"
clearable
popper-class="theme-select-popper"
>
<el-option label="模块A" value="0" />
<el-option label="模块B" value="1" />
@@ -103,7 +100,6 @@
v-model="formData.ustatus"
placeholder="请选择登录状态"
clearable
popper-class="theme-select-popper"
>
<el-option label="停用" value="0" />
<el-option label="在用" value="1" />
@@ -169,14 +165,12 @@ defineExpose({ validate, resetForm })
</script>
<style scoped>
/* 表单容器 - 带边框,不溢出 */
.dialog-form-container {
width: 100%;
padding: 16px;
margin: 0;
border: 1px solid rgba(64, 158, 255, 0.15);
border-radius: 8px;
background-color: rgba(10, 30, 60, 0.08);
box-sizing: border-box;
}
@@ -190,99 +184,4 @@ defineExpose({ validate, resetForm })
}
.form-row:last-child { margin-bottom: 0; }
.form-col { flex: 1; min-width: 180px; }
/* 表单标签 */
:deep(.el-form-item) { margin-bottom: 0 !important; }
:deep(.el-form-item__label) {
color: #e0e6ff !important;
font-size: 14px;
line-height: 40px;
}
:deep(.el-form-item__error) {
color: #f56c6c !important;
font-size: 12px;
margin-top: 4px;
}
/* ========== 终极统一输入框/下拉框样式 ========== */
:deep(.el-input__wrapper),
:deep(.el-select__wrapper) {
background-color: rgba(10, 30, 60, 0.6) !important;
border: 1px solid rgba(64, 158, 255, 0.3) !important;
box-shadow: none !important;
border-radius: 4px !important;
background-image: none !important;
opacity: 1 !important;
transition: all 0s ease 0s !important; /* 彻底禁用过渡动画 */
--el-input-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-hover-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-focus-border-color: rgba(64, 158, 255, 0.3) !important;
--el-input-focus-box-shadow: none !important;
--el-input-text-color: #e0e6ff !important;
--el-input-placeholder-color: rgba(224, 230, 255, 0.6) !important;
}
/* 强制覆盖所有状态,包括伪类和内置类名 */
:deep(.el-input__wrapper:hover),
:deep(.el-select__wrapper:hover),
:deep(.el-input__wrapper.is-focus),
:deep(.el-select__wrapper.is-focus),
:deep(.el-input__wrapper:focus-within),
:deep(.el-select__wrapper:focus-within),
:deep(.el-input__wrapper.el-input__wrapper--focus),
:deep(.el-select__wrapper.el-select__wrapper--focus),
:deep(.el-input__wrapper:active),
:deep(.el-select__wrapper:active) {
background-color: rgba(10, 30, 60, 0.6) !important;
border-color: rgba(64, 158, 255, 0.3) !important;
box-shadow: none !important;
outline: none !important;
transition: all 0s ease 0s !important;
}
/* 内部输入框/选择器彻底透明化 */
:deep(.el-select),
:deep(.el-select .el-input),
:deep(.el-input),
:deep(.el-input__inner),
:deep(.el-select__inner) {
background-color: transparent !important;
color: #e0e6ff !important;
box-shadow: none !important;
outline: none !important;
border: none !important;
transition: all 0s ease 0s !important;
}
/* 占位符样式 */
:deep(.el-input__placeholder),
:deep(.el-select__placeholder) {
color: rgba(224, 230, 255, 0.6) !important;
opacity: 1 !important;
}
/* 图标样式 */
:deep(.el-icon) {
color: #e0e6ff !important;
background-color: transparent !important;
transition: all 0s ease 0s !important;
}
/* 禁用状态 */
:deep(.el-input.is-disabled .el-input__wrapper),
:deep(.el-select.is-disabled .el-select__wrapper) {
background-color: rgba(10, 30, 60, 0.4) !important;
border-color: rgba(64, 158, 255, 0.2) !important;
color: rgba(224, 230, 255, 0.5) !important;
--el-input-disabled-bg-color: rgba(10, 30, 60, 0.4) !important;
transition: all 0s ease 0s !important;
}
/* 错误状态 */
:deep(.el-form-item.is-error .el-input__wrapper),
:deep(.el-form-item.is-error .el-select__wrapper) {
border-color: #f56c6c !important;
--el-input-border-color: #f56c6c !important;
transition: all 0s ease 0s !important;
}
</style>

View File

@@ -1,8 +1,276 @@
<template>
<div class="data-manage-page">
<CSearch
@search="handleSearch"
@reset="handleReset"
>
<el-form-item label="用户名称:" class="search-item">
<el-input
v-model="searchForm.uname"
placeholder="请输入用户名称"
clearable
class="search-input"
/>
</el-form-item>
<el-form-item label="登录账户:" class="search-item">
<el-input
v-model="searchForm.userName"
placeholder="请输入登录账户"
clearable
class="search-input"
/>
</el-form-item>
<el-form-item label="用户状态:" class="search-item">
<el-select
v-model="searchForm.ustatus"
placeholder="请选择用户状态"
clearable
class="search-select"
>
<el-option label="停用" value="0" />
<el-option label="在用" value="1" />
<el-option label="锁定" value="2" />
</el-select>
</el-form-item>
</CSearch>
<div class="main-wrapper">
<div class="main-section">
<div class="action-section">
<el-button type="primary" icon="Plus" @click="handleAdd">
新增
</el-button>
<el-button type="success" icon="Download" @click="handleExport">
导出
</el-button>
</div>
<STable
:table-data="tableData"
:loading="loading"
:pagination="pagination"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
<template #columns>
<el-table-column prop="createTime" label="记录日期" />
<el-table-column prop="userName" label="登录账户" />
<el-table-column prop="uname" label="用户名称" />
<el-table-column prop="sex" label="性别" />
<el-table-column prop="email" label="电子邮箱" />
<el-table-column prop="phone" label="联系电话" />
<el-table-column prop="ustatus" label="状态" min-width="100" align="center">
<template #default="scope">
<el-tag
:type="scope.row.ustatus === '1' ? 'success' : scope.row.ustatus === '2' ? 'warning' : 'danger'"
>
{{ getStatusText(scope.row.ustatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="180" align="center">
<template #default="scope">
<el-button size="small" type="primary" link @click="handleEdit(scope.row)">
编辑
</el-button>
<el-button size="small" type="danger" link @click="handleDelete(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</template>
</STable>
</div>
</div>
<PDialog
v-model="dialogVisible"
:title="isEdit ? '编辑数据' : '新增数据'"
@close="handleDialogClose"
@reset="handleDialogReset"
@confirm="handleSave"
>
<VForm ref="formComponentRef" :form-data="formData" :is-edit="isEdit" />
</PDialog>
</div>
</template>
<script>
<script setup>
import { ref, reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { Plus, Download } from '@element-plus/icons-vue'
import { getHomeUserList } from '@/api/bizUser'
import CSearch from '@/components/Search/proSearch.vue'
import STable from '@/components/Table/proTable.vue'
import PDialog from '@/components/Dialog/proDialog.vue'
import VForm from './form.vue'
const formComponentRef = ref(null)
const loading = ref(false)
const searchForm = reactive({
uname: '',
ustatus: '',
userName: ''
})
const pagination = reactive({
pageNum: 1,
pageSize: 20,
total: 0
})
const tableData = ref([])
const dialogVisible = ref(false)
const isEdit = ref(false)
const formData = ref({})
async function getDataList() {
loading.value = true
try {
const reqParmas = {
... searchForm,
pageNum: pagination.pageNum,
pageSize: pagination.pageSize,
}
const res = await getHomeUserList(reqParmas);
pagination.total = res.total;
tableData.value = res.list || [];
} catch (error) {
console.error('获取数据失败:', error);
tableData.value = []
} finally {
loading.value = false
}
}
const getStatusText = (status) => {
const statusMap = {
'0': '停用',
'1': '在用',
'2': '锁定'
}
return statusMap[status] || '未知'
}
const handleSearch = () => {
pagination.pageNum = 1
getDataList()
}
const handleReset = () => {
Object.assign(searchForm, {
uname: '',
ustatus: '',
userName: ''
})
pagination.pageNum = 1
getDataList()
}
const handleAdd = () => {
isEdit.value = false
formData.value = {}
dialogVisible.value = true
}
const handleEdit = (row) => {
isEdit.value = true
formData.value = { ...row }
dialogVisible.value = true
}
const handleExport = () => {
ElMessage.success('开始导出数据...')
}
const handleDelete = (row) => {
ElMessage.warning(`删除ID为 ${row.id} 的数据`)
}
const handleSizeChange = (val) => {
pagination.pageSize = val
getDataList()
}
const handleCurrentChange = (val) => {
pagination.pageNum = val
getDataList()
}
const handleDialogClose = () => {
formData.value = {}
isEdit.value = false
dialogVisible.value = false
}
const handleDialogReset = () => {
if (formComponentRef.value) {
formComponentRef.value.resetForm()
ElMessage.info('表单已重置')
}
}
const handleSave = async () => {
if (formComponentRef.value) {
const isValid = await formComponentRef.value.validate()
if (!isValid) {
ElMessage.warning('表单验证失败,请检查必填项')
return
}
}
setTimeout(() => {
ElMessage.success(isEdit.value ? '编辑成功' : '新增成功')
dialogVisible.value = false
getDataList()
}, 500)
}
onMounted(() => {
getDataList()
})
</script>
<style>
<style scoped>
.data-manage-page {
width: 100%;
height: 100%;
padding: 16px;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden !important;
}
.main-wrapper {
flex: 1;
width: 100%;
overflow: hidden;
min-height: 0;
border: 1px solid #e5e7eb;
border-radius: 6px;
margin-bottom: 12px;
}
.main-section {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
}
.action-section {
padding: 12px 16px;
border-bottom: 1px solid #e5e7eb;
display: flex;
gap: 8px;
flex-shrink: 0;
}
.search-input, .search-select {
width: 100%;
}
</style>