1
This commit is contained in:
@@ -4,11 +4,8 @@ VUE_APP_TITLE = Jarvis
|
||||
# 开发环境配置
|
||||
ENV = 'development'
|
||||
|
||||
# Jarvis/开发环境
|
||||
VUE_APP_BASE_API = ''
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
# VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||
# VUE_APP_BASE_API = 'http://127.0.0.1:30313'
|
||||
VUE_APP_BASE_API = 'http://192.168.8.88:30313'
|
||||
port = 8888
|
||||
|
||||
@@ -4,8 +4,5 @@ VUE_APP_TITLE = Jarvis
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# Jarvis/生产环境
|
||||
VUE_APP_BASE_API = ''
|
||||
|
||||
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||
port = 8888
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
// 自定义侧边栏样式 - 适配蓝色渐变背景
|
||||
.sidebar-container {
|
||||
// 覆盖Element UI菜单的默认样式
|
||||
.el-menu {
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
|
||||
.el-menu-item, .el-submenu__title {
|
||||
color: #ffffff !important;
|
||||
background: transparent !important;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background-color: rgba(255, 255, 255, 0.2) !important;
|
||||
color: #ffffff !important;
|
||||
border-right: 3px solid #ffffff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.el-submenu {
|
||||
.el-menu {
|
||||
background-color: rgba(255, 255, 255, 0.05) !important;
|
||||
|
||||
.el-menu-item {
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background-color: rgba(255, 255, 255, 0.15) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 图标颜色
|
||||
.svg-icon {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
// 文字颜色
|
||||
span {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
// 激活状态的子菜单标题
|
||||
.is-active > .el-submenu__title {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
// 子菜单展开时的样式
|
||||
.el-submenu.is-opened > .el-submenu__title {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 弹出菜单样式
|
||||
.el-menu--popup {
|
||||
background: linear-gradient(135deg, #3aa4ef 0%, #0067e2 100%) !important;
|
||||
border-radius: 8px !important;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
|
||||
|
||||
.el-menu-item {
|
||||
color: #ffffff !important;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background-color: rgba(255, 255, 255, 0.2) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 响应式设计
|
||||
@media (max-width: 768px) {
|
||||
.sidebar-container {
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@
|
||||
@import './transition.scss';
|
||||
@import './element-ui.scss';
|
||||
@import './sidebar.scss';
|
||||
@import './custom-sidebar.scss';
|
||||
@import './btn.scss';
|
||||
|
||||
body {
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
-webkit-transition: width .28s;
|
||||
transition: width 0.28s;
|
||||
-webkit-transition: width .28s ease-in-out;
|
||||
transition: width 0.28s ease-in-out, box-shadow 0.3s ease;
|
||||
width: $base-sidebar-width !important;
|
||||
background: $base-menu-background;
|
||||
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
font-size: 0px;
|
||||
@@ -24,9 +24,31 @@
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
overflow: hidden;
|
||||
border-radius: 0 24px 0 0;
|
||||
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0 20px 20px 0;
|
||||
-webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
|
||||
// 添加悬停效果
|
||||
&:hover {
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
// 添加进入动画
|
||||
animation: slideInLeft 0.5s ease-out;
|
||||
}
|
||||
|
||||
@keyframes slideInLeft {
|
||||
from {
|
||||
transform: translateX(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
transform: translateX(0);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
// reset element-ui css
|
||||
.horizontal-collapse-transition {
|
||||
@@ -69,43 +91,110 @@
|
||||
border: none;
|
||||
height: 100%;
|
||||
width: 100% !important;
|
||||
font-size: 15px; // 增加菜单字体大小
|
||||
font-size: 14px;
|
||||
background: transparent !important;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.el-menu-item, .el-submenu__title {
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
font-size: 15px; // 确保菜单项字体大小一致
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.95) !important;
|
||||
background: transparent !important;
|
||||
border-radius: 12px;
|
||||
margin: 4px 12px;
|
||||
padding: 0 16px !important;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.15) !important;
|
||||
color: #ffffff !important;
|
||||
transform: translateX(4px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
// menu hover
|
||||
.submenu-title-noDropdown,
|
||||
&.is-active {
|
||||
background: rgba(255, 255, 255, 0.25) !important;
|
||||
color: #ffffff !important;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 4px;
|
||||
height: 20px;
|
||||
background: #ffffff;
|
||||
border-radius: 0 2px 2px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 子菜单样式优化
|
||||
.el-submenu {
|
||||
.el-submenu__title {
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
}
|
||||
}
|
||||
|
||||
& .theme-dark .is-active > .el-submenu__title {
|
||||
color: $base-menu-color-active !important;
|
||||
}
|
||||
|
||||
& .nest-menu .el-submenu>.el-submenu__title,
|
||||
& .el-submenu .el-menu-item {
|
||||
min-width: $base-sidebar-width !important;
|
||||
border-radius: 12px;
|
||||
margin: 4px 12px;
|
||||
padding: 0 16px !important;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
||||
background: rgba(255, 255, 255, 0.15) !important;
|
||||
color: #ffffff !important;
|
||||
transform: translateX(4px);
|
||||
}
|
||||
}
|
||||
|
||||
& .theme-dark .nest-menu .el-submenu>.el-submenu__title,
|
||||
& .theme-dark .el-submenu .el-menu-item {
|
||||
background-color: $base-sub-menu-background !important;
|
||||
.el-menu {
|
||||
background: rgba(255, 255, 255, 0.08) !important;
|
||||
border-radius: 12px;
|
||||
margin: 8px 12px;
|
||||
padding: 8px 0;
|
||||
box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.el-menu-item {
|
||||
margin: 2px 8px;
|
||||
padding: 0 24px !important;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 13px;
|
||||
|
||||
&:hover {
|
||||
background-color: $base-sub-menu-hover !important;
|
||||
background: rgba(255, 255, 255, 0.12) !important;
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
background: rgba(255, 255, 255, 0.2) !important;
|
||||
|
||||
&::before {
|
||||
width: 3px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 图标样式优化
|
||||
.svg-icon {
|
||||
color: rgba(255, 255, 255, 0.8) !important;
|
||||
transition: all 0.3s ease;
|
||||
margin-right: 12px;
|
||||
|
||||
&:hover {
|
||||
color: #ffffff !important;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,8 +260,24 @@
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
transition: transform .28s;
|
||||
transition: transform .28s ease-in-out;
|
||||
width: $base-sidebar-width !important;
|
||||
border-radius: 0;
|
||||
|
||||
// 移动端优化
|
||||
.el-menu-item, .el-submenu__title {
|
||||
margin: 2px 8px;
|
||||
padding: 0 12px !important;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.el-submenu .el-menu-item {
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
&.hideSidebar {
|
||||
@@ -180,6 +285,38 @@
|
||||
pointer-events: none;
|
||||
transition-duration: 0.3s;
|
||||
transform: translate3d(-$base-sidebar-width, 0, 0);
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 平板设备优化
|
||||
@media (max-width: 1024px) {
|
||||
.sidebar-container {
|
||||
.el-menu-item, .el-submenu__title {
|
||||
font-size: 13px;
|
||||
height: 44px;
|
||||
line-height: 44px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 小屏幕优化
|
||||
@media (max-width: 768px) {
|
||||
.sidebar-container {
|
||||
border-radius: 0;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.el-menu {
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.el-menu-item, .el-submenu__title {
|
||||
margin: 2px 6px;
|
||||
padding: 0 10px !important;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,9 +328,55 @@
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
// 弹出菜单样式优化
|
||||
.el-menu--popup {
|
||||
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
|
||||
border-radius: 12px !important;
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2) !important;
|
||||
backdrop-filter: blur(10px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding: 8px 0;
|
||||
|
||||
.el-menu-item {
|
||||
color: rgba(255, 255, 255, 0.95) !important;
|
||||
margin: 2px 8px;
|
||||
border-radius: 8px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.15) !important;
|
||||
color: #ffffff !important;
|
||||
transform: translateX(4px);
|
||||
}
|
||||
|
||||
// when menu collapsed
|
||||
&.is-active {
|
||||
background: rgba(255, 255, 255, 0.25) !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 自定义滚动条
|
||||
&::-webkit-scrollbar-track-piece {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
border-radius: 4px;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 收起状态下的样式
|
||||
.el-menu--vertical {
|
||||
&>.el-menu {
|
||||
.svg-icon {
|
||||
@@ -204,27 +387,7 @@
|
||||
.nest-menu .el-submenu>.el-submenu__title,
|
||||
.el-menu-item {
|
||||
&:hover {
|
||||
// you can use $subMenuHover
|
||||
background-color: rgba(58, 164, 239, 0.1) !important;
|
||||
}
|
||||
}
|
||||
|
||||
// the scroll bar appears when the subMenu is too long
|
||||
>.el-menu--popup {
|
||||
max-height: 100vh;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar-track-piece {
|
||||
background: #d3dce6;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #99a9bf;
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.15) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,18 +8,18 @@ $tiffany: #4AB7BD;
|
||||
$yellow:#FEC171;
|
||||
$panGreen: #30B08F;
|
||||
|
||||
// 默认菜单主题风格 - 蓝色渐变主题
|
||||
$base-menu-color:#ffffff;
|
||||
// 默认菜单主题风格 - 现代化渐变主题
|
||||
$base-menu-color:rgba(255, 255, 255, 0.95);
|
||||
$base-menu-color-active:#ffffff;
|
||||
$base-menu-background:linear-gradient(0deg, #3aa4ef 0%, #0067e2 100%);
|
||||
$base-menu-background:linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||
$base-logo-title-color: #ffffff;
|
||||
|
||||
$base-menu-light-color:rgba(0,0,0,.70);
|
||||
$base-menu-light-background:#ffffff;
|
||||
$base-logo-light-title-color: #001529;
|
||||
|
||||
$base-sub-menu-background:rgba(255,255,255,0.1);
|
||||
$base-sub-menu-hover:rgba(255,255,255,0.2);
|
||||
$base-sub-menu-background:rgba(255,255,255,0.08);
|
||||
$base-sub-menu-hover:rgba(255,255,255,0.15);
|
||||
|
||||
// 自定义暗色菜单风格
|
||||
/**
|
||||
|
||||
124
src/components/ListLayout/index.vue
Normal file
124
src/components/ListLayout/index.vue
Normal file
@@ -0,0 +1,124 @@
|
||||
<template>
|
||||
<div class="list-layout">
|
||||
<!-- 顶部搜索区域 -->
|
||||
<div class="search-section">
|
||||
<slot name="search"></slot>
|
||||
</div>
|
||||
|
||||
<!-- 表格区域 - 可滚动 -->
|
||||
<div class="table-section">
|
||||
<slot name="table"></slot>
|
||||
</div>
|
||||
|
||||
<!-- 固定分页区域 -->
|
||||
<div class="pagination-section">
|
||||
<slot name="pagination"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ListLayout',
|
||||
props: {
|
||||
// 可以添加一些配置属性
|
||||
height: {
|
||||
type: String,
|
||||
default: 'calc(100vh - 84px)'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 主容器布局 */
|
||||
.list-layout {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 84px); /* 减去头部导航高度 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 搜索区域 - 固定在顶部 */
|
||||
.search-section {
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 表格区域 - 可滚动 */
|
||||
.table-section {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 0 20px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* 固定分页区域 */
|
||||
.pagination-section {
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 表格区域滚动条样式 */
|
||||
.table-section::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-thumb {
|
||||
background: #c0c0c0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
|
||||
/* 确保表格在容器内正确显示 */
|
||||
.table-section .el-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 分页组件样式优化 */
|
||||
.pagination-section .pagination-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.list-layout {
|
||||
height: calc(100vh - 50px); /* 移动端调整高度 */
|
||||
}
|
||||
|
||||
.search-section {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.table-section {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.pagination-section {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -31,12 +31,12 @@ export default {
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 15
|
||||
default: 10
|
||||
},
|
||||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [15, 50, 100, 200,1]
|
||||
return [10, 50, 100, 200,1000]
|
||||
}
|
||||
},
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
|
||||
@@ -60,10 +60,11 @@ export default {
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
background: linear-gradient(90deg, #3aa4ef 0%, #0067e2 100%);
|
||||
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
|
||||
& .sidebar-logo-link {
|
||||
height: 100%;
|
||||
|
||||
@@ -200,8 +200,68 @@ export default {
|
||||
fillSheng() {
|
||||
this.form.command = '生'
|
||||
},
|
||||
fillMan() {
|
||||
async fillMan() {
|
||||
// 先尝试查询今天的数据
|
||||
this.form.command = '慢单'
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
const res = await executeInstruction({ command: '慢单' })
|
||||
this.loading = false
|
||||
|
||||
if (res && (res.code === 200 || res.msg === '操作成功')) {
|
||||
const data = res.data
|
||||
let resultData = []
|
||||
if (Array.isArray(data)) resultData = data
|
||||
else if (typeof data === 'string') resultData = data ? [data] : []
|
||||
else resultData = []
|
||||
|
||||
// 如果今天的数据为空,尝试查询昨天的数据
|
||||
if (resultData.length === 0 || (resultData.length === 1 && resultData[0].includes('无数据'))) {
|
||||
this.$message.info('今天暂无慢单数据,正在查询昨天的数据...')
|
||||
|
||||
// 获取昨天的日期
|
||||
const yesterday = new Date()
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
const yesterdayStr = yesterday.toISOString().split('T')[0].replace(/-/g, '')
|
||||
|
||||
this.loading = true
|
||||
const yesterdayRes = await executeInstruction({ command: `慢单${yesterdayStr}` })
|
||||
this.loading = false
|
||||
|
||||
if (yesterdayRes && (yesterdayRes.code === 200 || yesterdayRes.msg === '操作成功')) {
|
||||
const yesterdayData = yesterdayRes.data
|
||||
if (Array.isArray(yesterdayData)) this.resultList = yesterdayData
|
||||
else if (typeof yesterdayData === 'string') this.resultList = yesterdayData ? [yesterdayData] : []
|
||||
else this.resultList = []
|
||||
|
||||
if (this.resultList.length > 0) {
|
||||
this.$message.success(`已查询到昨天(${yesterdayStr})的慢单数据`)
|
||||
} else {
|
||||
this.$message.warning('昨天也没有慢单数据')
|
||||
this.resultList = []
|
||||
}
|
||||
} else {
|
||||
this.$message.error('查询昨天数据失败')
|
||||
this.resultList = []
|
||||
}
|
||||
} else {
|
||||
// 今天有数据,直接显示
|
||||
this.resultList = resultData
|
||||
this.$message.success('已查询到今天的慢单数据')
|
||||
}
|
||||
|
||||
// 执行成功后刷新历史记录
|
||||
this.loadHistory()
|
||||
} else {
|
||||
this.$message.error(res && res.msg ? res.msg : '查询失败')
|
||||
this.resultList = []
|
||||
}
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
this.$message.error('查询失败,请稍后重试')
|
||||
this.resultList = []
|
||||
}
|
||||
},
|
||||
clearAll() {
|
||||
this.form.command = ''
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<list-layout>
|
||||
<!-- 搜索区域 -->
|
||||
<template #search>
|
||||
<el-form :inline="true" :model="queryParams" label-width="80px">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remark" placeholder="单据备注" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
@@ -40,7 +43,10 @@
|
||||
<el-button type="warning" size="small" icon="el-icon-download" @click="handleExport" v-hasPermi="['system:jdorder:export']">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<template #table>
|
||||
<el-table :data="list" v-loading="loading" border stripe :default-sort="{prop: 'createTime', order: 'descending'}">
|
||||
<el-table-column label="ID" prop="id" width="80" />
|
||||
<el-table-column label="内部单号" prop="remark" width="160" sortable/>
|
||||
@@ -73,7 +79,6 @@
|
||||
<el-table-column label="下单人" prop="buyer" width="140"/>
|
||||
<el-table-column label="备注/状态" prop="status" min-width="160"/>
|
||||
|
||||
|
||||
<el-table-column label="物流链接" prop="logisticsLink" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.logisticsLink">
|
||||
@@ -90,7 +95,6 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
proPriceAmount
|
||||
<el-table-column label="赔付金额" prop="proPriceAmount" width="140"/>
|
||||
|
||||
<el-table-column label="创建时间" prop="createTime" width="160">
|
||||
@@ -99,9 +103,11 @@
|
||||
<el-table-column label="完成时间" prop="finishTime" width="160">
|
||||
<template slot-scope="scope">{{ parseTime(scope.row.finishTime) }}</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<!-- 分页区域 -->
|
||||
<template #pagination>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
@@ -109,14 +115,20 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</template>
|
||||
</list-layout>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listJDOrders } from '@/api/system/jdorder'
|
||||
import ListLayout from '@/components/ListLayout'
|
||||
|
||||
export default {
|
||||
name: 'JDOrderList',
|
||||
components: {
|
||||
ListLayout
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@@ -142,7 +154,7 @@ export default {
|
||||
created() {
|
||||
// 设置默认日期为今天
|
||||
this.setDefaultDateRange()
|
||||
this.getList()
|
||||
this.getListWithFallback()
|
||||
},
|
||||
methods: {
|
||||
/** 设置默认日期范围为今天 */
|
||||
@@ -168,6 +180,53 @@ export default {
|
||||
this.loading = false
|
||||
}).catch(() => { this.loading = false })
|
||||
},
|
||||
/** 智能查询列表,如果今天数据为空则查询昨天 */
|
||||
async getListWithFallback() {
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
const res = await listJDOrders(this.queryParams)
|
||||
this.list = (res.rows || res.data || [])
|
||||
this.total = res.total || 0
|
||||
|
||||
// 如果今天的数据为空,且是默认查询(没有手动选择日期),则尝试查询昨天
|
||||
if (this.list.length === 0 && this.isDefaultQuery()) {
|
||||
this.$message.info('今天暂无慢单数据,正在查询昨天的数据...')
|
||||
|
||||
// 获取昨天的日期
|
||||
const yesterday = new Date()
|
||||
yesterday.setDate(yesterday.getDate() - 1)
|
||||
const yesterdayStr = this.formatDate(yesterday)
|
||||
|
||||
// 更新查询参数为昨天
|
||||
this.queryParams.beginTime = yesterdayStr
|
||||
this.queryParams.endTime = yesterdayStr
|
||||
this.dateRange = [yesterdayStr, yesterdayStr]
|
||||
|
||||
// 查询昨天的数据
|
||||
const yesterdayRes = await listJDOrders(this.queryParams)
|
||||
this.list = (yesterdayRes.rows || yesterdayRes.data || [])
|
||||
this.total = yesterdayRes.total || 0
|
||||
|
||||
if (this.list.length > 0) {
|
||||
this.$message.success(`已查询到昨天(${yesterdayStr})的慢单数据`)
|
||||
} else {
|
||||
this.$message.warning('昨天也没有慢单数据')
|
||||
}
|
||||
}
|
||||
|
||||
this.loading = false
|
||||
} catch (error) {
|
||||
this.loading = false
|
||||
this.$message.error('查询失败,请稍后重试')
|
||||
}
|
||||
},
|
||||
/** 判断是否为默认查询(今天的数据) */
|
||||
isDefaultQuery() {
|
||||
const today = new Date()
|
||||
const todayStr = this.formatDate(today)
|
||||
return this.queryParams.beginTime === todayStr && this.queryParams.endTime === todayStr
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
@@ -189,7 +248,7 @@ export default {
|
||||
}
|
||||
// 重置后重新设置默认日期为今天
|
||||
this.setDefaultDateRange()
|
||||
this.getList()
|
||||
this.getListWithFallback()
|
||||
},
|
||||
/** 日期范围变化处理 */
|
||||
handleDateRangeChange(dates) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 顶部搜索区域 -->
|
||||
<div class="search-section">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="京粉账号" prop="unionId">
|
||||
<el-select v-model="queryParams.unionId" placeholder="请选择京粉账号" clearable style="width: 240px">
|
||||
@@ -31,6 +33,73 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- 统计悬浮模块 -->
|
||||
<el-card class="statistics-card" shadow="hover" v-if="orderrowsList.length > 0">
|
||||
<div slot="header" class="clearfix">
|
||||
<span><i class="el-icon-data-analysis"></i> 佣金统计</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="toggleStatistics">
|
||||
{{ showStatistics ? '收起' : '展开' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-show="showStatistics" class="statistics-content">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">总订单数</div>
|
||||
<div class="stat-value">{{ statistics.totalOrders }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">总计佣金额</div>
|
||||
<div class="stat-value">¥{{ statistics.totalCosPrice.toFixed(2) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">预估佣金</div>
|
||||
<div class="stat-value">¥{{ statistics.totalEstimateFee.toFixed(2) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="stat-item">
|
||||
<div class="stat-label">实际佣金</div>
|
||||
<div class="stat-value">¥{{ statistics.totalActualFee.toFixed(2) }}</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<div class="status-stats">
|
||||
<h4>按状态统计</h4>
|
||||
<div class="status-list">
|
||||
<div v-for="(stat, key) in statistics.statusStats" :key="key" class="status-item">
|
||||
<el-tag :type="getStatusTypeByKey(key)" size="small">{{ stat.label }}</el-tag>
|
||||
<span class="status-count">{{ stat.count }}单</span>
|
||||
<span class="status-amount">¥{{ stat.amount.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="account-stats">
|
||||
<h4>按账号统计</h4>
|
||||
<div class="account-list">
|
||||
<div v-for="(stat, unionId) in statistics.accountStats" :key="unionId" class="account-item">
|
||||
<span class="account-name">{{ getAdminName(unionId) }}</span>
|
||||
<span class="account-count">{{ stat.count }}单</span>
|
||||
<span class="account-amount">¥{{ stat.amount.toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:orderrows:add']">新增</el-button>
|
||||
@@ -46,7 +115,10 @@
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 表格区域 - 可滚动 -->
|
||||
<div class="table-section">
|
||||
<el-table v-loading="loading" :data="orderrowsList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="账号" align="center" prop="unionId" width="50">
|
||||
@@ -102,8 +174,12 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 固定分页区域 -->
|
||||
<div class="pagination-section">
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
|
||||
<!-- 查看订单详情对话框 -->
|
||||
<el-dialog :title="'订单详情 - ' + currentOrder.orderId" :visible.sync="viewDialogVisible" width="900px" append-to-body>
|
||||
@@ -263,7 +339,17 @@ export default {
|
||||
// 查看详情对话框
|
||||
viewDialogVisible: false,
|
||||
// 当前查看的订单
|
||||
currentOrder: {}
|
||||
currentOrder: {},
|
||||
// 统计相关
|
||||
showStatistics: true,
|
||||
statistics: {
|
||||
totalOrders: 0,
|
||||
totalCosPrice: 0,
|
||||
totalEstimateFee: 0,
|
||||
totalActualFee: 0,
|
||||
statusStats: {},
|
||||
accountStats: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -271,6 +357,23 @@ export default {
|
||||
this.getAdminList();
|
||||
this.getStatusList();
|
||||
},
|
||||
watch: {
|
||||
// 监听日期范围变化,自动调整分页条数
|
||||
dateRange: {
|
||||
handler(newVal) {
|
||||
if (newVal && newVal.length === 2) {
|
||||
// 选择了日期范围,设置分页条数为1000
|
||||
this.queryParams.pageSize = 1000;
|
||||
this.queryParams.pageNum = 1;
|
||||
} else {
|
||||
// 清空日期范围,恢复默认分页条数
|
||||
this.queryParams.pageSize = 10;
|
||||
this.queryParams.pageNum = 1;
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询京粉订单列表 */
|
||||
getList() {
|
||||
@@ -279,6 +382,8 @@ export default {
|
||||
this.orderrowsList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
// 计算统计数据
|
||||
this.calculateStatistics();
|
||||
}).catch(error => {
|
||||
console.error('获取订单列表失败:', error);
|
||||
this.loading = false;
|
||||
@@ -446,6 +551,7 @@ export default {
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
console.log(this.queryParams.validCode);
|
||||
|
||||
// 合并项转为原始code数组
|
||||
if (this.queryParams.statusGroup) {
|
||||
this.queryParams.validCodes = this.statusValueMap[this.queryParams.statusGroup].map(code => Number(code));
|
||||
@@ -467,7 +573,10 @@ export default {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.validCodes = [];
|
||||
this.handleQuery();
|
||||
// 重置时恢复默认分页条数
|
||||
this.queryParams.pageSize = 10;
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
@@ -531,7 +640,336 @@ export default {
|
||||
this.download('/jarvis/orderrows/export', {
|
||||
...this.queryParams
|
||||
}, `京粉订单数据_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 切换统计显示 */
|
||||
toggleStatistics() {
|
||||
this.showStatistics = !this.showStatistics;
|
||||
},
|
||||
/** 计算统计数据 */
|
||||
calculateStatistics() {
|
||||
const stats = {
|
||||
totalOrders: this.orderrowsList.length,
|
||||
totalCosPrice: 0,
|
||||
totalEstimateFee: 0,
|
||||
totalActualFee: 0,
|
||||
statusStats: {},
|
||||
accountStats: {}
|
||||
};
|
||||
|
||||
// 状态分组映射
|
||||
const statusGroups = {
|
||||
'cancel': { label: '取消', codes: ['3'] },
|
||||
'invalid': { label: '无效', codes: ['2','4','5','6','7','8','9','10','11','14','19','20','21','22','23','29','30','31','32','33','34'] },
|
||||
'pending': { label: '待付款', codes: ['15'] },
|
||||
'paid': { label: '已付款', codes: ['16'] },
|
||||
'finished': { label: '已完成', codes: ['17'] },
|
||||
'deposit': { label: '已付定金', codes: ['24'] },
|
||||
'illegal': { label: '违规', codes: ['25','26','27','28'] }
|
||||
};
|
||||
|
||||
// 初始化状态统计
|
||||
Object.keys(statusGroups).forEach(key => {
|
||||
stats.statusStats[key] = {
|
||||
label: statusGroups[key].label,
|
||||
count: 0,
|
||||
amount: 0
|
||||
};
|
||||
});
|
||||
|
||||
// 遍历订单数据计算统计
|
||||
this.orderrowsList.forEach(order => {
|
||||
// 总计佣金额
|
||||
if (order.estimateCosPrice) {
|
||||
stats.totalCosPrice += parseFloat(order.estimateCosPrice) || 0;
|
||||
}
|
||||
// 预估佣金
|
||||
if (order.estimateFee) {
|
||||
stats.totalEstimateFee += parseFloat(order.estimateFee) || 0;
|
||||
}
|
||||
// 实际佣金
|
||||
if (order.actualFee) {
|
||||
stats.totalActualFee += parseFloat(order.actualFee) || 0;
|
||||
}
|
||||
|
||||
// 按状态统计
|
||||
const validCode = String(order.validCode);
|
||||
let statusKey = 'invalid'; // 默认无效
|
||||
for (const [key, group] of Object.entries(statusGroups)) {
|
||||
if (group.codes.includes(validCode)) {
|
||||
statusKey = key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
stats.statusStats[statusKey].count++;
|
||||
stats.statusStats[statusKey].amount += parseFloat(order.actualFee) || 0;
|
||||
|
||||
// 按账号统计
|
||||
const unionId = order.unionId;
|
||||
if (!stats.accountStats[unionId]) {
|
||||
stats.accountStats[unionId] = {
|
||||
count: 0,
|
||||
amount: 0
|
||||
};
|
||||
}
|
||||
stats.accountStats[unionId].count++;
|
||||
stats.accountStats[unionId].amount += parseFloat(order.actualFee) || 0;
|
||||
});
|
||||
|
||||
this.statistics = stats;
|
||||
},
|
||||
/** 根据状态键获取标签类型 */
|
||||
getStatusTypeByKey(key) {
|
||||
const typeMap = {
|
||||
'cancel': 'danger',
|
||||
'invalid': 'info',
|
||||
'pending': 'warning',
|
||||
'paid': 'primary',
|
||||
'finished': 'success',
|
||||
'deposit': 'warning',
|
||||
'illegal': 'danger'
|
||||
};
|
||||
return typeMap[key] || 'info';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 主容器布局 */
|
||||
.app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100vh - 84px); /* 减去头部导航高度 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 搜索区域 - 固定在顶部 */
|
||||
.search-section {
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 表格区域 - 可滚动 */
|
||||
.table-section {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding: 0 20px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* 固定分页区域 */
|
||||
.pagination-section {
|
||||
flex-shrink: 0;
|
||||
background: #fff;
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* 统计卡片样式 */
|
||||
.statistics-card {
|
||||
margin-bottom: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.statistics-card .el-card__header {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
border-radius: 8px 8px 0 0;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.statistics-card .el-card__header span {
|
||||
font-weight: 600;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.statistics-card .el-card__header .el-button {
|
||||
color: white;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.statistics-card .el-card__header .el-button:hover {
|
||||
color: #f0f0f0;
|
||||
}
|
||||
|
||||
.statistics-content {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
text-align: center;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 10px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.stat-item:hover {
|
||||
background: #e9ecef;
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
.status-stats, .account-stats {
|
||||
background: #f8f9fa;
|
||||
padding: 15px;
|
||||
border-radius: 6px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.status-stats h4, .account-stats h4 {
|
||||
margin: 0 0 15px 0;
|
||||
color: #2c3e50;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
border-bottom: 2px solid #e9ecef;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.status-list, .account-list {
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.status-item, .account-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
}
|
||||
|
||||
.status-item:last-child, .account-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.status-count, .account-count {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
background: #e9ecef;
|
||||
padding: 2px 8px;
|
||||
border-radius: 12px;
|
||||
min-width: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.status-amount, .account-amount {
|
||||
font-weight: 600;
|
||||
color: #27ae60;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.account-name {
|
||||
font-weight: 500;
|
||||
color: #2c3e50;
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* 滚动条样式 */
|
||||
.status-list::-webkit-scrollbar, .account-list::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
|
||||
.status-list::-webkit-scrollbar-track, .account-list::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.status-list::-webkit-scrollbar-thumb, .account-list::-webkit-scrollbar-thumb {
|
||||
background: #c1c1c1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.status-list::-webkit-scrollbar-thumb:hover, .account-list::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
|
||||
/* 表格区域滚动条样式 */
|
||||
.table-section::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-track {
|
||||
background: #f1f1f1;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-thumb {
|
||||
background: #c0c0c0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.table-section::-webkit-scrollbar-thumb:hover {
|
||||
background: #a8a8a8;
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
.app-container {
|
||||
height: calc(100vh - 50px); /* 移动端调整高度 */
|
||||
}
|
||||
|
||||
.search-section {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.table-section {
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
.pagination-section {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.statistics-content .el-col {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 确保表格在容器内正确显示 */
|
||||
.table-section .el-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 分页组件样式优化 */
|
||||
.pagination-section .pagination-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<list-layout>
|
||||
<!-- 搜索区域 -->
|
||||
<template #search>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||
<el-form-item label="角色名称" prop="roleName">
|
||||
<el-input
|
||||
@@ -96,7 +99,10 @@
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<template #table>
|
||||
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="角色编号" prop="roleId" width="120" />
|
||||
@@ -146,7 +152,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<!-- 分页区域 -->
|
||||
<template #pagination>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
@@ -154,6 +163,8 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</template>
|
||||
</list-layout>
|
||||
|
||||
<!-- 添加或修改角色配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@@ -254,9 +265,13 @@
|
||||
<script>
|
||||
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
|
||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
|
||||
import ListLayout from "@/components/ListLayout"
|
||||
|
||||
export default {
|
||||
name: "Role",
|
||||
components: {
|
||||
ListLayout
|
||||
},
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<list-layout>
|
||||
<!-- 搜索区域 -->
|
||||
<template #search>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="微信ID" prop="wxid">
|
||||
<el-input v-model="queryParams.wxid" placeholder="请输入微信ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
@@ -43,7 +46,10 @@
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<template #table>
|
||||
<el-table v-loading="loading" :data="superadminList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="微信ID" align="center" prop="wxid" min-width="120" />
|
||||
@@ -87,8 +93,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<!-- 分页区域 -->
|
||||
<template #pagination>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</template>
|
||||
</list-layout>
|
||||
|
||||
<!-- 添加或修改超级管理员对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
@@ -158,9 +169,13 @@
|
||||
|
||||
<script>
|
||||
import { listSuperadmin, getSuperadmin, delSuperadmin, addSuperadmin, updateSuperadmin } from "@/api/system/superadmin";
|
||||
import ListLayout from "@/components/ListLayout";
|
||||
|
||||
export default {
|
||||
name: "Superadmin",
|
||||
components: {
|
||||
ListLayout
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
86
update-list-pages.md
Normal file
86
update-list-pages.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# 全局列表页面固定分页布局更新指南
|
||||
|
||||
## 已完成的页面
|
||||
- ✅ 京粉订单列表 (`src/views/system/orderrows/index.vue`) - 已使用自定义布局
|
||||
- ✅ 角色管理 (`src/views/system/role/index.vue`) - 已使用ListLayout组件
|
||||
- ✅ 超级管理员 (`src/views/system/superadmin/index.vue`) - 已使用ListLayout组件
|
||||
|
||||
## 待更新的页面列表
|
||||
以下是项目中其他需要更新为固定分页布局的列表页面:
|
||||
|
||||
### 系统管理模块
|
||||
- `src/views/system/user/index.vue` - 用户管理(特殊布局,需要单独处理)
|
||||
- `src/views/system/post/index.vue` - 岗位管理
|
||||
- `src/views/system/notice/index.vue` - 通知公告
|
||||
- `src/views/system/dict/index.vue` - 字典管理
|
||||
- `src/views/system/dict/data.vue` - 字典数据
|
||||
- `src/views/system/config/index.vue` - 参数设置
|
||||
|
||||
### 监控模块
|
||||
- `src/views/monitor/operlog/index.vue` - 操作日志
|
||||
- `src/views/monitor/job/log.vue` - 调度日志
|
||||
- `src/views/monitor/logininfor/index.vue` - 登录日志
|
||||
- `src/views/monitor/job/index.vue` - 定时任务
|
||||
- `src/views/monitor/online/index.vue` - 在线用户
|
||||
|
||||
### 工具模块
|
||||
- `src/views/tool/gen/index.vue` - 代码生成
|
||||
|
||||
### 业务模块
|
||||
- `src/views/system/jdorder/orderList.vue` - 京东订单列表
|
||||
- `src/views/system/xbmessage/index.vue` - 消息管理
|
||||
- `src/views/system/favoriteProduct/index.vue` - 收藏商品
|
||||
- `src/views/system/xbgroup/index.vue` - 群组管理
|
||||
|
||||
## 更新步骤
|
||||
|
||||
### 方法一:使用ListLayout组件(推荐)
|
||||
1. 在页面中导入ListLayout组件:
|
||||
```javascript
|
||||
import ListLayout from "@/components/ListLayout";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ListLayout
|
||||
},
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
2. 将页面结构改为:
|
||||
```vue
|
||||
<template>
|
||||
<list-layout>
|
||||
<!-- 搜索区域 -->
|
||||
<template #search>
|
||||
<!-- 原来的搜索表单和操作按钮 -->
|
||||
</template>
|
||||
|
||||
<!-- 表格区域 -->
|
||||
<template #table>
|
||||
<!-- 原来的el-table -->
|
||||
</template>
|
||||
|
||||
<!-- 分页区域 -->
|
||||
<template #pagination>
|
||||
<!-- 原来的pagination组件 -->
|
||||
</template>
|
||||
</list-layout>
|
||||
</template>
|
||||
```
|
||||
|
||||
### 方法二:直接修改CSS(适用于特殊布局)
|
||||
参考 `src/views/system/orderrows/index.vue` 的实现方式,直接修改页面样式。
|
||||
|
||||
## 注意事项
|
||||
1. 用户管理页面使用了splitpanes布局,需要特殊处理
|
||||
2. 确保所有页面都保持原有的功能不变
|
||||
3. 测试分页导航在不同数据量下的表现
|
||||
4. 保持响应式设计在移动端的良好表现
|
||||
|
||||
## 测试要点
|
||||
- [ ] 分页导航固定在页面底部
|
||||
- [ ] 表格内容可以独立滚动
|
||||
- [ ] 搜索区域固定在顶部
|
||||
- [ ] 移动端显示正常
|
||||
- [ ] 所有原有功能正常工作
|
||||
Reference in New Issue
Block a user