1
This commit is contained in:
@@ -4,11 +4,8 @@ VUE_APP_TITLE = Jarvis
|
|||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# Jarvis/开发环境
|
|
||||||
VUE_APP_BASE_API = ''
|
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
# VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
# 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
|
port = 8888
|
||||||
|
|||||||
@@ -4,8 +4,5 @@ VUE_APP_TITLE = Jarvis
|
|||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# Jarvis/生产环境
|
|
||||||
VUE_APP_BASE_API = ''
|
|
||||||
|
|
||||||
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||||
port = 8888
|
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 './transition.scss';
|
||||||
@import './element-ui.scss';
|
@import './element-ui.scss';
|
||||||
@import './sidebar.scss';
|
@import './sidebar.scss';
|
||||||
@import './custom-sidebar.scss';
|
|
||||||
@import './btn.scss';
|
@import './btn.scss';
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
|||||||
@@ -12,10 +12,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
-webkit-transition: width .28s;
|
-webkit-transition: width .28s ease-in-out;
|
||||||
transition: width 0.28s;
|
transition: width 0.28s ease-in-out, box-shadow 0.3s ease;
|
||||||
width: $base-sidebar-width !important;
|
width: $base-sidebar-width !important;
|
||||||
background: $base-menu-background;
|
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
font-size: 0px;
|
font-size: 0px;
|
||||||
@@ -24,9 +24,31 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 0 24px 0 0;
|
border-radius: 0 20px 20px 0;
|
||||||
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
-webkit-box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
|
||||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
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
|
// reset element-ui css
|
||||||
.horizontal-collapse-transition {
|
.horizontal-collapse-transition {
|
||||||
@@ -65,47 +87,114 @@
|
|||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {
|
.el-menu {
|
||||||
border: none;
|
border: none;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
font-size: 15px; // 增加菜单字体大小
|
font-size: 14px;
|
||||||
}
|
background: transparent !important;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
.el-menu-item, .el-submenu__title {
|
.el-menu-item, .el-submenu__title {
|
||||||
overflow: hidden !important;
|
overflow: hidden !important;
|
||||||
text-overflow: ellipsis !important;
|
text-overflow: ellipsis !important;
|
||||||
white-space: nowrap !important;
|
white-space: nowrap !important;
|
||||||
font-size: 15px; // 确保菜单项字体大小一致
|
font-size: 14px;
|
||||||
}
|
font-weight: 500;
|
||||||
|
color: rgba(255, 255, 255, 0.95) !important;
|
||||||
// menu hover
|
background: transparent !important;
|
||||||
.submenu-title-noDropdown,
|
border-radius: 12px;
|
||||||
.el-submenu__title {
|
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 {
|
&:hover {
|
||||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .theme-dark .is-active > .el-submenu__title {
|
// 子菜单样式优化
|
||||||
color: $base-menu-color-active !important;
|
.el-submenu {
|
||||||
}
|
.el-submenu__title {
|
||||||
|
border-radius: 12px;
|
||||||
& .nest-menu .el-submenu>.el-submenu__title,
|
margin: 4px 12px;
|
||||||
& .el-submenu .el-menu-item {
|
padding: 0 16px !important;
|
||||||
min-width: $base-sidebar-width !important;
|
height: 48px;
|
||||||
|
line-height: 48px;
|
||||||
&:hover {
|
|
||||||
background-color: rgba(255, 255, 255, 0.1) !important;
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.15) !important;
|
||||||
|
color: #ffffff !important;
|
||||||
|
transform: translateX(4px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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: 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& .theme-dark .nest-menu .el-submenu>.el-submenu__title,
|
// 图标样式优化
|
||||||
& .theme-dark .el-submenu .el-menu-item {
|
.svg-icon {
|
||||||
background-color: $base-sub-menu-background !important;
|
color: rgba(255, 255, 255, 0.8) !important;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
margin-right: 12px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: $base-sub-menu-hover !important;
|
color: #ffffff !important;
|
||||||
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,8 +260,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-container {
|
.sidebar-container {
|
||||||
transition: transform .28s;
|
transition: transform .28s ease-in-out;
|
||||||
width: $base-sidebar-width !important;
|
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 {
|
&.hideSidebar {
|
||||||
@@ -180,6 +285,38 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
transition-duration: 0.3s;
|
transition-duration: 0.3s;
|
||||||
transform: translate3d(-$base-sidebar-width, 0, 0);
|
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;
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// when menu collapsed
|
// 收起状态下的样式
|
||||||
.el-menu--vertical {
|
.el-menu--vertical {
|
||||||
&>.el-menu {
|
&>.el-menu {
|
||||||
.svg-icon {
|
.svg-icon {
|
||||||
@@ -204,27 +387,7 @@
|
|||||||
.nest-menu .el-submenu>.el-submenu__title,
|
.nest-menu .el-submenu>.el-submenu__title,
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
&:hover {
|
&:hover {
|
||||||
// you can use $subMenuHover
|
background: rgba(255, 255, 255, 0.15) !important;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ $tiffany: #4AB7BD;
|
|||||||
$yellow:#FEC171;
|
$yellow:#FEC171;
|
||||||
$panGreen: #30B08F;
|
$panGreen: #30B08F;
|
||||||
|
|
||||||
// 默认菜单主题风格 - 蓝色渐变主题
|
// 默认菜单主题风格 - 现代化渐变主题
|
||||||
$base-menu-color:#ffffff;
|
$base-menu-color:rgba(255, 255, 255, 0.95);
|
||||||
$base-menu-color-active:#ffffff;
|
$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-logo-title-color: #ffffff;
|
||||||
|
|
||||||
$base-menu-light-color:rgba(0,0,0,.70);
|
$base-menu-light-color:rgba(0,0,0,.70);
|
||||||
$base-menu-light-background:#ffffff;
|
$base-menu-light-background:#ffffff;
|
||||||
$base-logo-light-title-color: #001529;
|
$base-logo-light-title-color: #001529;
|
||||||
|
|
||||||
$base-sub-menu-background:rgba(255,255,255,0.1);
|
$base-sub-menu-background:rgba(255,255,255,0.08);
|
||||||
$base-sub-menu-hover:rgba(255,255,255,0.2);
|
$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: {
|
limit: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 15
|
default: 10
|
||||||
},
|
},
|
||||||
pageSizes: {
|
pageSizes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return [15, 50, 100, 200,1]
|
return [10, 50, 100, 200,1000]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 移动端页码按钮的数量端默认值5
|
// 移动端页码按钮的数量端默认值5
|
||||||
|
|||||||
@@ -60,10 +60,11 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 60px;
|
line-height: 60px;
|
||||||
background: linear-gradient(90deg, #3aa4ef 0%, #0067e2 100%);
|
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
|
||||||
& .sidebar-logo-link {
|
& .sidebar-logo-link {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
@@ -200,8 +200,68 @@ export default {
|
|||||||
fillSheng() {
|
fillSheng() {
|
||||||
this.form.command = '生'
|
this.form.command = '生'
|
||||||
},
|
},
|
||||||
fillMan() {
|
async fillMan() {
|
||||||
|
// 先尝试查询今天的数据
|
||||||
this.form.command = '慢单'
|
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() {
|
clearAll() {
|
||||||
this.form.command = ''
|
this.form.command = ''
|
||||||
|
|||||||
@@ -1,122 +1,134 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>
|
||||||
<el-form :inline="true" :model="queryParams" label-width="80px">
|
<list-layout>
|
||||||
<el-form-item label="备注">
|
<!-- 搜索区域 -->
|
||||||
<el-input v-model="queryParams.remark" placeholder="单据备注" clearable size="small" @keyup.enter.native="handleQuery" />
|
<template #search>
|
||||||
</el-form-item>
|
<el-form :inline="true" :model="queryParams" label-width="80px">
|
||||||
<el-form-item label="分销标记">
|
<el-form-item label="备注">
|
||||||
<el-input v-model="queryParams.distributionMark" placeholder="分销标记" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.remark" placeholder="单据备注" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="型号">
|
<el-form-item label="分销标记">
|
||||||
<el-input v-model="queryParams.modelNumber" placeholder="型号" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.distributionMark" placeholder="分销标记" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="订单号">
|
<el-form-item label="型号">
|
||||||
<el-input v-model="queryParams.orderId" placeholder="订单号" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.modelNumber" placeholder="型号" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下单人">
|
<el-form-item label="订单号">
|
||||||
<el-input v-model="queryParams.buyer" placeholder="下单人" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.orderId" placeholder="订单号" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="地址">
|
<el-form-item label="下单人">
|
||||||
<el-input v-model="queryParams.address" placeholder="收货地址" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.buyer" placeholder="下单人" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="状态">
|
<el-form-item label="地址">
|
||||||
<el-input v-model="queryParams.status" placeholder="备注/状态" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.address" placeholder="收货地址" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下单时间">
|
<el-form-item label="状态">
|
||||||
<el-date-picker
|
<el-input v-model="queryParams.status" placeholder="备注/状态" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
v-model="dateRange"
|
</el-form-item>
|
||||||
type="daterange"
|
<el-form-item label="下单时间">
|
||||||
start-placeholder="开始日期"
|
<el-date-picker
|
||||||
end-placeholder="结束日期"
|
v-model="dateRange"
|
||||||
value-format="yyyy-MM-dd"
|
type="daterange"
|
||||||
size="small"
|
start-placeholder="开始日期"
|
||||||
range-separator="至"
|
end-placeholder="结束日期"
|
||||||
@change="handleDateRangeChange"
|
value-format="yyyy-MM-dd"
|
||||||
|
size="small"
|
||||||
|
range-separator="至"
|
||||||
|
@change="handleDateRangeChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||||
|
<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/>
|
||||||
|
|
||||||
|
<el-table-column label="订单号" prop="orderId" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<span style="margin-right: 8px;">{{ scope.row.orderId }}</span>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-copy-document"
|
||||||
|
@click="copyToClipboard(scope.row.orderId)"
|
||||||
|
title="复制订单号"
|
||||||
|
>
|
||||||
|
复制
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="标记" prop="distributionMark" width="80"/>
|
||||||
|
<el-table-column label="型号" prop="modelNumber" width="180"/>
|
||||||
|
<el-table-column label="地址" prop="address" min-width="280" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="付款金额" prop="paymentAmount" width="120">
|
||||||
|
<template slot-scope="scope">{{ toYuan(scope.row.paymentAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="后返金额" prop="rebateAmount" width="120">
|
||||||
|
<template slot-scope="scope">{{ toYuan(scope.row.rebateAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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">
|
||||||
|
<a :href="scope.row.logisticsLink" target="_blank" style="margin-right: 8px;">查看物流</a>
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="mini"
|
||||||
|
icon="el-icon-copy-document"
|
||||||
|
@click="copyToClipboard(scope.row.logisticsLink)"
|
||||||
|
title="复制链接"
|
||||||
|
>
|
||||||
|
复制
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="赔付金额" prop="proPriceAmount" width="140"/>
|
||||||
|
|
||||||
|
<el-table-column label="创建时间" prop="createTime" width="160">
|
||||||
|
<template slot-scope="scope">{{ parseTime(scope.row.createTime) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</template>
|
||||||
<el-form-item>
|
</list-layout>
|
||||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
||||||
<el-button type="warning" size="small" icon="el-icon-download" @click="handleExport" v-hasPermi="['system:jdorder:export']">导出</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<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/>
|
|
||||||
|
|
||||||
<el-table-column label="订单号" prop="orderId" width="200">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<div>
|
|
||||||
<span style="margin-right: 8px;">{{ scope.row.orderId }}</span>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
icon="el-icon-copy-document"
|
|
||||||
@click="copyToClipboard(scope.row.orderId)"
|
|
||||||
title="复制订单号"
|
|
||||||
>
|
|
||||||
复制
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="标记" prop="distributionMark" width="80"/>
|
|
||||||
<el-table-column label="型号" prop="modelNumber" width="180"/>
|
|
||||||
<el-table-column label="地址" prop="address" min-width="280" show-overflow-tooltip/>
|
|
||||||
<el-table-column label="付款金额" prop="paymentAmount" width="120">
|
|
||||||
<template slot-scope="scope">{{ toYuan(scope.row.paymentAmount) }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="后返金额" prop="rebateAmount" width="120">
|
|
||||||
<template slot-scope="scope">{{ toYuan(scope.row.rebateAmount) }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<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">
|
|
||||||
<a :href="scope.row.logisticsLink" target="_blank" style="margin-right: 8px;">查看物流</a>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="mini"
|
|
||||||
icon="el-icon-copy-document"
|
|
||||||
@click="copyToClipboard(scope.row.logisticsLink)"
|
|
||||||
title="复制链接"
|
|
||||||
>
|
|
||||||
复制
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
proPriceAmount
|
|
||||||
<el-table-column label="赔付金额" prop="proPriceAmount" width="140"/>
|
|
||||||
|
|
||||||
<el-table-column label="创建时间" prop="createTime" width="160">
|
|
||||||
<template slot-scope="scope">{{ parseTime(scope.row.createTime) }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="完成时间" prop="finishTime" width="160">
|
|
||||||
<template slot-scope="scope">{{ parseTime(scope.row.finishTime) }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listJDOrders } from '@/api/system/jdorder'
|
import { listJDOrders } from '@/api/system/jdorder'
|
||||||
|
import ListLayout from '@/components/ListLayout'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JDOrderList',
|
name: 'JDOrderList',
|
||||||
|
components: {
|
||||||
|
ListLayout
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -142,7 +154,7 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
// 设置默认日期为今天
|
// 设置默认日期为今天
|
||||||
this.setDefaultDateRange()
|
this.setDefaultDateRange()
|
||||||
this.getList()
|
this.getListWithFallback()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/** 设置默认日期范围为今天 */
|
/** 设置默认日期范围为今天 */
|
||||||
@@ -168,6 +180,53 @@ export default {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
}).catch(() => { 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() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
this.getList()
|
this.getList()
|
||||||
@@ -189,7 +248,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// 重置后重新设置默认日期为今天
|
// 重置后重新设置默认日期为今天
|
||||||
this.setDefaultDateRange()
|
this.setDefaultDateRange()
|
||||||
this.getList()
|
this.getListWithFallback()
|
||||||
},
|
},
|
||||||
/** 日期范围变化处理 */
|
/** 日期范围变化处理 */
|
||||||
handleDateRangeChange(dates) {
|
handleDateRangeChange(dates) {
|
||||||
|
|||||||
@@ -1,109 +1,185 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<!-- 顶部搜索区域 -->
|
||||||
<el-form-item label="京粉账号" prop="unionId">
|
<div class="search-section">
|
||||||
<el-select v-model="queryParams.unionId" placeholder="请选择京粉账号" clearable style="width: 240px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-option
|
<el-form-item label="京粉账号" prop="unionId">
|
||||||
v-for="admin in adminList"
|
<el-select v-model="queryParams.unionId" placeholder="请选择京粉账号" clearable style="width: 240px">
|
||||||
:key="admin.value || admin.id"
|
<el-option
|
||||||
:label="admin.label || (admin.name + ' (' + admin.wxid + ')')"
|
v-for="admin in adminList"
|
||||||
:value="admin.value || admin.id"
|
:key="admin.value || admin.id"
|
||||||
/>
|
:label="admin.label || (admin.name + ' (' + admin.wxid + ')')"
|
||||||
</el-select>
|
:value="admin.value || admin.id"
|
||||||
</el-form-item>
|
/>
|
||||||
<el-form-item label="订单号" prop="orderId">
|
</el-select>
|
||||||
<el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="订单号" prop="orderId">
|
||||||
<el-form-item label="商品名称" prop="skuName">
|
<el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
<el-input v-model="queryParams.skuName" placeholder="请输入商品名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="商品名称" prop="skuName">
|
||||||
<el-form-item label="订单状态" prop="statusGroup">
|
<el-input v-model="queryParams.skuName" placeholder="请输入商品名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
<el-select v-model="queryParams.statusGroup" placeholder="订单状态" clearable style="width: 240px">
|
</el-form-item>
|
||||||
<el-option v-for="status in mergedStatusList" :key="status.value" :label="status.label" :value="status.value" />
|
<el-form-item label="订单状态" prop="statusGroup">
|
||||||
</el-select>
|
<el-select v-model="queryParams.statusGroup" placeholder="订单状态" clearable style="width: 240px">
|
||||||
</el-form-item>
|
<el-option v-for="status in mergedStatusList" :key="status.value" :label="status.label" :value="status.value" />
|
||||||
<el-form-item label="订单时间">
|
</el-select>
|
||||||
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="订单时间">
|
||||||
<el-form-item>
|
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
</el-form-item>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-form-item>
|
||||||
</el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
</el-form>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<!-- 统计悬浮模块 -->
|
||||||
<el-col :span="1.5">
|
<el-card class="statistics-card" shadow="hover" v-if="orderrowsList.length > 0">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:orderrows:add']">新增</el-button>
|
<div slot="header" class="clearfix">
|
||||||
</el-col>
|
<span><i class="el-icon-data-analysis"></i> 佣金统计</span>
|
||||||
<el-col :span="1.5">
|
<el-button style="float: right; padding: 3px 0" type="text" @click="toggleStatistics">
|
||||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
{{ showStatistics ? '收起' : '展开' }}
|
||||||
</el-col>
|
</el-button>
|
||||||
<el-col :span="1.5">
|
</div>
|
||||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
<div v-show="showStatistics" class="statistics-content">
|
||||||
</el-col>
|
<el-row :gutter="20">
|
||||||
<el-col :span="1.5">
|
<el-col :span="6">
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:orderrows:export']">导出</el-button>
|
<div class="stat-item">
|
||||||
</el-col>
|
<div class="stat-label">总订单数</div>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<div class="stat-value">{{ statistics.totalOrders }}</div>
|
||||||
</el-row>
|
</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-table v-loading="loading" :data="orderrowsList" @selection-change="handleSelectionChange">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-col :span="1.5">
|
||||||
<el-table-column label="账号" align="center" prop="unionId" width="50">
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:orderrows:add']">新增</el-button>
|
||||||
<template slot-scope="scope">
|
</el-col>
|
||||||
<span>{{ getAdminName(scope.row.unionId) }}</span>
|
<el-col :span="1.5">
|
||||||
</template>
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
||||||
</el-table-column>
|
</el-col>
|
||||||
<el-table-column label="订单号" align="center" prop="orderId" width="120" />
|
<el-col :span="1.5">
|
||||||
<el-table-column label="商品名称" align="center" prop="skuName" :show-overflow-tooltip="true" min-width="200" />
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
||||||
<el-table-column label="计佣金额" align="center" prop="estimateCosPrice" width="100">
|
</el-col>
|
||||||
<template slot-scope="scope">
|
<el-col :span="1.5">
|
||||||
<span>¥{{ scope.row.estimateCosPrice }}</span>
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:orderrows:export']">导出</el-button>
|
||||||
</template>
|
</el-col>
|
||||||
</el-table-column>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
<el-table-column label="商品数量" align="center" prop="skuNum" width="80" />
|
</el-row>
|
||||||
<el-table-column label="订单状态" align="center" prop="validCode" width="240">
|
</div>
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-tag :type="getStatusType(scope.row.validCode)">
|
|
||||||
{{ getStatusText(scope.row.validCode) }}
|
|
||||||
</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="佣金比例" align="center" prop="commissionRate" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.commissionRate }}%</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="预估佣金" align="center" prop="estimateFee" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>¥{{ scope.row.estimateFee }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="实际佣金" align="center" prop="actualFee" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>¥{{ scope.row.actualFee }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="订单时间" align="center" prop="orderTime" width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="完成时间" align="center" prop="finishTime" width="160">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ scope.row.finishTime ? parseTime(scope.row.finishTime) : '-' }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
<!-- 表格区域 - 可滚动 -->
|
||||||
|
<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">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ getAdminName(scope.row.unionId) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单号" align="center" prop="orderId" width="120" />
|
||||||
|
<el-table-column label="商品名称" align="center" prop="skuName" :show-overflow-tooltip="true" min-width="200" />
|
||||||
|
<el-table-column label="计佣金额" align="center" prop="estimateCosPrice" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.estimateCosPrice }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品数量" align="center" prop="skuNum" width="80" />
|
||||||
|
<el-table-column label="订单状态" align="center" prop="validCode" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getStatusType(scope.row.validCode)">
|
||||||
|
{{ getStatusText(scope.row.validCode) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="佣金比例" align="center" prop="commissionRate" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.commissionRate }}%</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="预估佣金" align="center" prop="estimateFee" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.estimateFee }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际佣金" align="center" prop="actualFee" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.actualFee }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单时间" align="center" prop="orderTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="完成时间" align="center" prop="finishTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.finishTime ? parseTime(scope.row.finishTime) : '-' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
||||||
|
</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>
|
<el-dialog :title="'订单详情 - ' + currentOrder.orderId" :visible.sync="viewDialogVisible" width="900px" append-to-body>
|
||||||
@@ -263,7 +339,17 @@ export default {
|
|||||||
// 查看详情对话框
|
// 查看详情对话框
|
||||||
viewDialogVisible: false,
|
viewDialogVisible: false,
|
||||||
// 当前查看的订单
|
// 当前查看的订单
|
||||||
currentOrder: {}
|
currentOrder: {},
|
||||||
|
// 统计相关
|
||||||
|
showStatistics: true,
|
||||||
|
statistics: {
|
||||||
|
totalOrders: 0,
|
||||||
|
totalCosPrice: 0,
|
||||||
|
totalEstimateFee: 0,
|
||||||
|
totalActualFee: 0,
|
||||||
|
statusStats: {},
|
||||||
|
accountStats: {}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -271,6 +357,23 @@ export default {
|
|||||||
this.getAdminList();
|
this.getAdminList();
|
||||||
this.getStatusList();
|
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: {
|
methods: {
|
||||||
/** 查询京粉订单列表 */
|
/** 查询京粉订单列表 */
|
||||||
getList() {
|
getList() {
|
||||||
@@ -279,6 +382,8 @@ export default {
|
|||||||
this.orderrowsList = response.rows;
|
this.orderrowsList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
// 计算统计数据
|
||||||
|
this.calculateStatistics();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error('获取订单列表失败:', error);
|
console.error('获取订单列表失败:', error);
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@@ -446,6 +551,7 @@ export default {
|
|||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
console.log(this.queryParams.validCode);
|
console.log(this.queryParams.validCode);
|
||||||
|
|
||||||
// 合并项转为原始code数组
|
// 合并项转为原始code数组
|
||||||
if (this.queryParams.statusGroup) {
|
if (this.queryParams.statusGroup) {
|
||||||
this.queryParams.validCodes = this.statusValueMap[this.queryParams.statusGroup].map(code => Number(code));
|
this.queryParams.validCodes = this.statusValueMap[this.queryParams.statusGroup].map(code => Number(code));
|
||||||
@@ -467,7 +573,10 @@ export default {
|
|||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.queryParams.validCodes = [];
|
this.queryParams.validCodes = [];
|
||||||
this.handleQuery();
|
// 重置时恢复默认分页条数
|
||||||
|
this.queryParams.pageSize = 10;
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
@@ -531,7 +640,336 @@ export default {
|
|||||||
this.download('/jarvis/orderrows/export', {
|
this.download('/jarvis/orderrows/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `京粉订单数据_${new Date().getTime()}.xlsx`)
|
}, `京粉订单数据_${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>
|
</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,159 +1,170 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
<list-layout>
|
||||||
<el-form-item label="角色名称" prop="roleName">
|
<!-- 搜索区域 -->
|
||||||
<el-input
|
<template #search>
|
||||||
v-model="queryParams.roleName"
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
|
||||||
placeholder="请输入角色名称"
|
<el-form-item label="角色名称" prop="roleName">
|
||||||
clearable
|
<el-input
|
||||||
style="width: 240px"
|
v-model="queryParams.roleName"
|
||||||
@keyup.enter.native="handleQuery"
|
placeholder="请输入角色名称"
|
||||||
/>
|
clearable
|
||||||
</el-form-item>
|
style="width: 240px"
|
||||||
<el-form-item label="权限字符" prop="roleKey">
|
@keyup.enter.native="handleQuery"
|
||||||
<el-input
|
|
||||||
v-model="queryParams.roleKey"
|
|
||||||
placeholder="请输入权限字符"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="状态" prop="status">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.status"
|
|
||||||
placeholder="角色状态"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_normal_disable"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="权限字符" prop="roleKey">
|
||||||
<el-form-item label="创建时间">
|
<el-input
|
||||||
<el-date-picker
|
v-model="queryParams.roleKey"
|
||||||
v-model="dateRange"
|
placeholder="请输入权限字符"
|
||||||
style="width: 240px"
|
clearable
|
||||||
value-format="yyyy-MM-dd"
|
style="width: 240px"
|
||||||
type="daterange"
|
@keyup.enter.native="handleQuery"
|
||||||
range-separator="-"
|
/>
|
||||||
start-placeholder="开始日期"
|
</el-form-item>
|
||||||
end-placeholder="结束日期"
|
<el-form-item label="状态" prop="status">
|
||||||
></el-date-picker>
|
<el-select
|
||||||
</el-form-item>
|
v-model="queryParams.status"
|
||||||
<el-form-item>
|
placeholder="角色状态"
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
clearable
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
style="width: 240px"
|
||||||
</el-form-item>
|
>
|
||||||
</el-form>
|
<el-option
|
||||||
|
v-for="dict in dict.type.sys_normal_disable"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dateRange"
|
||||||
|
style="width: 240px"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['system:role:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['system:role:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['system:role:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['system:role:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<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" />
|
|
||||||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
|
||||||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
|
||||||
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
|
||||||
<el-table-column label="状态" align="center" width="100">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-switch
|
|
||||||
v-model="scope.row.status"
|
|
||||||
active-value="0"
|
|
||||||
inactive-value="1"
|
|
||||||
@change="handleStatusChange(scope.row)"
|
|
||||||
></el-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
|
||||||
<el-button
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:role:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
v-hasPermi="['system:role:edit']"
|
v-hasPermi="['system:role:edit']"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
type="danger"
|
||||||
type="text"
|
plain
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
@click="handleDelete(scope.row)"
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:role:remove']"
|
v-hasPermi="['system:role:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
|
</el-col>
|
||||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
<el-col :span="1.5">
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-button
|
||||||
<el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"
|
type="warning"
|
||||||
v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>
|
plain
|
||||||
<el-dropdown-item command="handleAuthUser" icon="el-icon-user"
|
icon="el-icon-download"
|
||||||
v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>
|
size="mini"
|
||||||
</el-dropdown-menu>
|
@click="handleExport"
|
||||||
</el-dropdown>
|
v-hasPermi="['system:role:export']"
|
||||||
</template>
|
>导出</el-button>
|
||||||
</el-table-column>
|
</el-col>
|
||||||
</el-table>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
<pagination
|
<!-- 表格区域 -->
|
||||||
v-show="total>0"
|
<template #table>
|
||||||
:total="total"
|
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
||||||
:page.sync="queryParams.pageNum"
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
:limit.sync="queryParams.pageSize"
|
<el-table-column label="角色编号" prop="roleId" width="120" />
|
||||||
@pagination="getList"
|
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
||||||
/>
|
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
||||||
|
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
||||||
|
<el-table-column label="状态" align="center" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.status"
|
||||||
|
active-value="0"
|
||||||
|
inactive-value="1"
|
||||||
|
@change="handleStatusChange(scope.row)"
|
||||||
|
></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope" v-if="scope.row.roleId !== 1">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:role:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:role:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
<el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['system:role:edit']">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="handleDataScope" icon="el-icon-circle-check"
|
||||||
|
v-hasPermi="['system:role:edit']">数据权限</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="handleAuthUser" icon="el-icon-user"
|
||||||
|
v-hasPermi="['system:role:edit']">分配用户</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
</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>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
@@ -254,9 +265,13 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
|
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"
|
||||||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
|
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"
|
||||||
|
import ListLayout from "@/components/ListLayout"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Role",
|
name: "Role",
|
||||||
|
components: {
|
||||||
|
ListLayout
|
||||||
|
},
|
||||||
dicts: ['sys_normal_disable'],
|
dicts: ['sys_normal_disable'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,94 +1,105 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div>
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<list-layout>
|
||||||
<el-form-item label="微信ID" prop="wxid">
|
<!-- 搜索区域 -->
|
||||||
<el-input v-model="queryParams.wxid" placeholder="请输入微信ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
<template #search>
|
||||||
</el-form-item>
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="姓名" prop="name">
|
<el-form-item label="微信ID" prop="wxid">
|
||||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.wxid" placeholder="请输入微信ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联盟ID" prop="unionId">
|
<el-form-item label="姓名" prop="name">
|
||||||
<el-input v-model="queryParams.unionId" placeholder="请输入联盟ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="激活状态" prop="isActive">
|
<el-form-item label="联盟ID" prop="unionId">
|
||||||
<el-select v-model="queryParams.isActive" placeholder="激活状态" clearable style="width: 240px">
|
<el-input v-model="queryParams.unionId" placeholder="请输入联盟ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
<el-option label="已激活" value="1" />
|
</el-form-item>
|
||||||
<el-option label="未激活" value="0" />
|
<el-form-item label="激活状态" prop="isActive">
|
||||||
</el-select>
|
<el-select v-model="queryParams.isActive" placeholder="激活状态" clearable style="width: 240px">
|
||||||
</el-form-item>
|
<el-option label="已激活" value="1" />
|
||||||
<el-form-item label="参与统计" prop="isCount">
|
<el-option label="未激活" value="0" />
|
||||||
<el-select v-model="queryParams.isCount" placeholder="参与统计" clearable style="width: 240px">
|
</el-select>
|
||||||
<el-option label="参与统计" value="1" />
|
</el-form-item>
|
||||||
<el-option label="不参与统计" value="0" />
|
<el-form-item label="参与统计" prop="isCount">
|
||||||
</el-select>
|
<el-select v-model="queryParams.isCount" placeholder="参与统计" clearable style="width: 240px">
|
||||||
</el-form-item>
|
<el-option label="参与统计" value="1" />
|
||||||
<el-form-item>
|
<el-option label="不参与统计" value="0" />
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
</el-select>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item>
|
||||||
</el-form>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:superadmin:add']">新增</el-button>
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:superadmin:add']">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:superadmin:export']">导出</el-button>
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:superadmin:export']">导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="superadminList" @selection-change="handleSelectionChange">
|
<!-- 表格区域 -->
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<template #table>
|
||||||
<el-table-column label="微信ID" align="center" prop="wxid" min-width="120" />
|
<el-table v-loading="loading" :data="superadminList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column label="姓名" align="center" prop="name" min-width="100" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="联盟ID" align="center" prop="unionId" min-width="120" />
|
<el-table-column label="微信ID" align="center" prop="wxid" min-width="120" />
|
||||||
<el-table-column label="应用密钥" align="center" prop="appKey" min-width="200" :show-overflow-tooltip="true" />
|
<el-table-column label="姓名" align="center" prop="name" min-width="100" />
|
||||||
<el-table-column label="秘密密钥" align="center" prop="secretKey" min-width="200" :show-overflow-tooltip="true">
|
<el-table-column label="联盟ID" align="center" prop="unionId" min-width="120" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="应用密钥" align="center" prop="appKey" min-width="200" :show-overflow-tooltip="true" />
|
||||||
<span>{{ scope.row.secretKey ? '***' + scope.row.secretKey.substring(scope.row.secretKey.length - 4) : '-' }}</span>
|
<el-table-column label="秘密密钥" align="center" prop="secretKey" min-width="200" :show-overflow-tooltip="true">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<span>{{ scope.row.secretKey ? '***' + scope.row.secretKey.substring(scope.row.secretKey.length - 4) : '-' }}</span>
|
||||||
<el-table-column label="激活状态" align="center" prop="isActive" min-width="100">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-tag :type="scope.row.isActive === 1 ? 'success' : 'info'">
|
<el-table-column label="激活状态" align="center" prop="isActive" min-width="100">
|
||||||
{{ scope.row.isActive === 1 ? '已激活' : '未激活' }}
|
<template slot-scope="scope">
|
||||||
</el-tag>
|
<el-tag :type="scope.row.isActive === 1 ? 'success' : 'info'">
|
||||||
</template>
|
{{ scope.row.isActive === 1 ? '已激活' : '未激活' }}
|
||||||
</el-table-column>
|
</el-tag>
|
||||||
<el-table-column label="参与统计" align="center" prop="isCount" min-width="100">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-tag :type="scope.row.isCount === 1 ? 'success' : 'info'">
|
<el-table-column label="参与统计" align="center" prop="isCount" min-width="100">
|
||||||
{{ scope.row.isCount === 1 ? '参与统计' : '不参与统计' }}
|
<template slot-scope="scope">
|
||||||
</el-tag>
|
<el-tag :type="scope.row.isCount === 1 ? 'success' : 'info'">
|
||||||
</template>
|
{{ scope.row.isCount === 1 ? '参与统计' : '不参与统计' }}
|
||||||
</el-table-column>
|
</el-tag>
|
||||||
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="160">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="160">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||||
<el-table-column label="更新时间" align="center" prop="updatedAt" min-width="160">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<span>{{ parseTime(scope.row.updatedAt) }}</span>
|
<el-table-column label="更新时间" align="center" prop="updatedAt" min-width="160">
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<span>{{ parseTime(scope.row.updatedAt) }}</span>
|
||||||
<el-table-column label="操作" align="center" min-width="180" class-name="small-padding fixed-width">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
<el-table-column label="操作" align="center" min-width="180" class-name="small-padding fixed-width">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||||
</template>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
||||||
</el-table-column>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
||||||
</el-table>
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
<!-- 分页区域 -->
|
||||||
|
<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>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
@@ -158,9 +169,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listSuperadmin, getSuperadmin, delSuperadmin, addSuperadmin, updateSuperadmin } from "@/api/system/superadmin";
|
import { listSuperadmin, getSuperadmin, delSuperadmin, addSuperadmin, updateSuperadmin } from "@/api/system/superadmin";
|
||||||
|
import ListLayout from "@/components/ListLayout";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Superadmin",
|
name: "Superadmin",
|
||||||
|
components: {
|
||||||
|
ListLayout
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
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