4 天以前 fb6e4a0041575dfacc4da9f8fc66d9a3d1f8a6b8
feat(multiple): 为构建过程添加环境变量管理功能

- 创建 createBuildEnv 函数来处理构建环境变量
- 在执行 vite build 时传入自定义环境变量
- 构建时设置当前工作目录为根路径
- 移除现有的 VITE_ 开头的环境变量避免冲突
- 添加 VITE_APP_ENV 环境变量并设置为 production
- 保持原有的构建流程不变但增强环境控制
已修改18个文件
5008 ■■■■■ 文件已修改
src/assets/styles/element-ui.scss 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/index.scss 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/sidebar.scss 419 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/variables.module.scss 162 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/AIChatSidebar/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/Breadcrumb/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/AppMain.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Navbar.vue 671 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/NotificationCenter/index.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/Logo.vue 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/SidebarItem.vue 91 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/Sidebar/index.vue 303 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/TagsView/ScrollPane.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/components/TagsView/index.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/index.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/settings.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/theme.js 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/index.vue 2853 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/styles/element-ui.scss
@@ -52,17 +52,17 @@
  left: 0;
  position: relative;
  margin: 0 auto;
  border-radius: 24px;
  border-radius: 16px;
  padding: 0 !important;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.95);
}
.el-dialog__header {
  background: linear-gradient(180deg, rgba(247, 250, 248, 0.98), rgba(242, 247, 244, 0.88));
  background: linear-gradient(180deg, rgba(248, 251, 255, 1), rgba(242, 247, 255, 0.98));
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--surface-border);
  border-radius: 24px 24px 0 0;
  border-radius: 14px 14px 0 0;
}
.el-dialog__title {
  font-weight: 600;
@@ -80,15 +80,16 @@
}
.el-message-box {
  padding: 0 !important;
  border-radius: 22px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.96);
}
.el-message-box__header {
  background: linear-gradient(180deg, rgba(247, 250, 248, 0.98), rgba(242, 247, 244, 0.88));
  background: linear-gradient(180deg, rgba(248, 251, 255, 1), rgba(242, 247, 255, 0.98));
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--surface-border);
  border-radius: 22px 22px 0 0;
  border-radius: 14px 14px 0 0;
}
.el-message-box__title {
  font-weight: 600;
@@ -161,7 +162,7 @@
}
.el-button {
  border-radius: 12px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none !important;
}
@@ -180,41 +181,44 @@
.el-select__wrapper,
.el-date-editor.el-input__wrapper,
.el-date-editor .el-input__wrapper {
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(216, 225, 219, 0.92) inset !important;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28) inset !important;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-primary);
}
.el-input__wrapper.is-focus,
.el-select__wrapper.is-focused,
.el-textarea__inner:focus {
  box-shadow: 0 0 0 1px rgba(0, 47, 167, 0.28) inset !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.56) inset !important;
}
.el-card {
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  background: rgba(255, 255, 255, 0.88);
  background: var(--panel-mask);
}
.el-table {
  --el-table-border-color: var(--surface-border);
  --el-table-header-bg-color: var(--surface-soft);
  --el-table-row-hover-bg-color: #f1f6f4;
  --el-table-current-row-bg-color: #e9f0ed;
  border-radius: 18px;
  --el-table-header-bg-color: #f2f7ff;
  --el-table-row-hover-bg-color: #f8fbff;
  --el-table-current-row-bg-color: #edf4ff;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94) !important;
}
.el-table th.el-table__cell {
  background: var(--surface-soft) !important;
  color: var(--text-secondary);
  background: #f2f7ff !important;
  color: #3b4f6c;
  font-weight: 600;
}
.el-table tr,
.el-table td.el-table__cell,
.el-table__body tr > td.el-table__cell {
  background: var(--surface-base) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--text-secondary);
}
.el-table .el-table__body tr:hover > td.el-table__cell {
@@ -239,3 +243,19 @@
.el-pagination {
  margin-top: 18px;
}
.el-empty__description p,
.el-form-item__label,
.el-radio-button__inner,
.el-checkbox__label,
.el-tabs__item,
.el-select-dropdown__item,
.el-dropdown-menu__item {
  color: var(--text-secondary);
}
.el-date-editor .el-range-input,
.el-input__inner,
.el-textarea__inner {
  color: var(--text-primary);
}
src/assets/styles/index.scss
@@ -6,18 +6,19 @@
@import './btn.scss';
@import './ruoyi.scss';
body {
  height: 100%;
  margin: 0;
body {
  height: 100%;
  margin: 0;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(214, 226, 219, 0.8), transparent 28%),
    linear-gradient(180deg, #f7faf8 0%, var(--app-bg) 100%);
  color: var(--text-primary);
}
  text-rendering: optimizeLegibility;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 9% -6%, rgba(59, 130, 246, 0.14), transparent 36%),
    radial-gradient(circle at 88% -8%, rgba(56, 189, 248, 0.12), transparent 30%),
    linear-gradient(165deg, #f3f7fc 0%, #eef5ff 54%, #f8fbff 100%);
  color: var(--text-primary);
}
label {
  font-weight: 600;
@@ -33,11 +34,11 @@
  height: 100%;
}
html,
body,
#app {
  background-color: var(--app-bg);
}
html,
body,
#app {
  background-color: var(--app-bg);
}
*,
*:before,
@@ -109,16 +110,17 @@
  }
}
aside {
  background: #eef1f6;
  padding: 8px 24px;
  margin-bottom: 20px;
  border-radius: 2px;
aside {
  background: rgba(255, 255, 255, 0.84);
  padding: 8px 24px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  display: block;
  line-height: 32px;
  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  color: #2c3e50;
  color: var(--text-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
@@ -136,24 +138,25 @@
.app-container {
  padding: 20px 24px 24px;
}
.search_form {
.search_form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  .search_title {
  .search_title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
  }
}
.table_list {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
    color: var(--text-secondary);
  }
}
.table_list {
  background: var(--panel-mask);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  padding: 18px;
}
.components-container {
  margin: 30px 50px;
  position: relative;
@@ -187,15 +190,15 @@
  }
}
.link-type,
.link-type:focus {
  color: var(--el-color-primary);
  cursor: pointer;
  &:hover {
    color: #165e57;
  }
}
.link-type,
.link-type:focus {
  color: var(--accent-light);
  cursor: pointer;
  &:hover {
    color: #2563eb;
  }
}
.filter-container {
  padding-bottom: 10px;
src/assets/styles/sidebar.scss
@@ -1,8 +1,8 @@
#app {
  .main-container {
    min-height: 100%;
    transition: margin-left 0.28s;
    margin-left: $base-sidebar-width;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    position: relative;
    background: transparent;
  }
@@ -12,32 +12,88 @@
  }
  .sidebar-container {
    transition: width 0.28s;
    width: $base-sidebar-width !important;
    height: 100%;
    transition: width 0.25s ease;
    width: var(--sidebar-width) !important;
    height: 100vh;
    position: fixed;
    font-size: 0px;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    overflow: hidden;
    padding: 12px 0 16px 16px;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 0;
    background: linear-gradient(180deg, #123b63 0%, #153f69 48%, #0f2d4f 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.08);
    isolation: isolate;
    // reset element-ui css
    &::before {
      content: "";
      position: absolute;
      inset: -24% -48% -14% -34%;
      z-index: 0;
      pointer-events: none;
      background:
        radial-gradient(circle at 10% 14%, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.5), transparent 42%),
        radial-gradient(circle at 88% 24%, rgba(56, 189, 248, 0.34), transparent 46%),
        radial-gradient(circle at 26% 88%, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.24), transparent 42%),
        radial-gradient(circle at 62% 58%, rgba(125, 211, 252, 0.18), transparent 48%);
      filter: blur(6px) saturate(1.18);
      opacity: 0.94;
      transform: translate3d(0, 0, 0);
      transform-origin: 44% 58%;
      animation:
        sidebarAuroraDrift 19.7s cubic-bezier(0.36, 0.02, 0.19, 0.98) infinite,
        sidebarAuroraBreath 11.3s ease-in-out infinite;
    }
    &::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background:
        linear-gradient(
          112deg,
          transparent 10%,
          rgba(255, 255, 255, 0.14) 36%,
          rgba(255, 255, 255, 0.03) 48%,
          transparent 72%
        ),
        linear-gradient(
          198deg,
          rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.18) 0%,
          transparent 34%,
          rgba(56, 189, 248, 0.14) 66%,
          transparent 100%
        ),
        radial-gradient(circle at 74% 12%, rgba(125, 211, 252, 0.2), transparent 48%);
      background-size: 210% 100%, 170% 170%, 150% 150%;
      background-position: 210% 0, 12% 18%, 80% 10%;
      opacity: 0.42;
      transform: translate3d(0, 0, 0);
      animation:
        sidebarSheenSweep 14.9s linear infinite,
        sidebarSheenJitter 5.3s steps(29, end) infinite;
    }
    > * {
      position: relative;
      z-index: 1;
    }
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out,
        0s padding-right ease-in-out;
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }
    .scrollbar-wrapper {
      overflow-x: hidden !important;
      overflow-y: auto !important;
    }
    .el-scrollbar__bar.is-vertical {
      right: 0px;
      right: 2px;
    }
    .el-scrollbar {
@@ -46,8 +102,7 @@
    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 72px);
        margin-top: 10px;
        height: calc(100% - 78px);
      }
    }
@@ -61,23 +116,19 @@
      overflow: hidden;
    }
    .svg-icon {
      margin-right: 16px;
    }
    .el-menu {
      border: 1px solid var(--surface-border) !important;
      border: none !important;
      height: 100%;
      width: 100% !important;
      padding: 12px 10px 20px;
      border-radius: var(--radius-lg);
      background: var(--menu-surface);
      backdrop-filter: blur(20px);
      box-shadow: var(--shadow-sm);
      transition: all 0.3s ease;
      padding: 10px 0 16px;
      border-radius: 0;
      background: transparent !important;
      box-shadow: none;
      backdrop-filter: none;
    }
    .el-menu-item,
    .el-sub-menu__title,
    .menu-title {
      overflow: hidden !important;
      text-overflow: ellipsis !important;
@@ -85,77 +136,112 @@
    }
    .el-menu-item .el-menu-tooltip__trigger {
      display: inline-block !important;
      display: inline-flex !important;
      width: 100%;
      align-items: center;
    }
    // menu hover - 优化后的悬停效果
    .submenu-title-noDropdown,
    .el-sub-menu__title {
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      border: none !important;
      &:hover {
        background-color: var(--menu-hover) !important;
        border-radius: var(--radius-sm);
        transform: translateX(2px);
      }
    .el-sub-menu__title,
    .el-menu-item {
      min-width: 0 !important;
      width: calc(100% - 24px) !important;
      margin: 0 12px 8px !important;
      height: 50px;
      line-height: 50px;
      border-radius: 14px;
      padding-left: 16px !important;
      padding-right: 36px !important;
      box-sizing: border-box;
      transition: all 0.28s ease;
      color: var(--sidebar-text);
      background: linear-gradient(128deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
      border: 1px solid rgba(255, 255, 255, 0.06) !important;
      position: relative;
      overflow: hidden;
    }
    .submenu-title-noDropdown::after,
    .el-sub-menu__title::after,
    .el-menu-item::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(115deg, transparent 12%, rgba(255, 255, 255, 0.16), transparent 78%);
      transform: translateX(-100%);
      opacity: 0;
      transition: transform 0.45s ease, opacity 0.26s ease;
      pointer-events: none;
    }
    .submenu-title-noDropdown:hover,
    .el-sub-menu__title:hover,
    .el-menu-item:hover {
      background: linear-gradient(128deg, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.28), rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.08)) !important;
      border-color: rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.32) !important;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 18px rgba(8, 36, 76, 0.24);
      transform: translateX(3px);
    }
    .submenu-title-noDropdown:hover::after,
    .el-sub-menu__title:hover::after,
    .el-menu-item:hover::after,
    .el-menu-item.is-active::after,
    .el-sub-menu.is-active > .el-sub-menu__title::after {
      transform: translateX(100%);
      opacity: 1;
    }
    & .theme-light .is-active > .el-sub-menu__title,
    & .theme-dark .is-active > .el-sub-menu__title {
      color: var(--menu-active-text) !important;
      background: var(--menu-active-bg) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      border: none !important;
    & .theme-dark .is-active > .el-sub-menu__title,
    & .el-menu-item.is-active {
      color: #fff !important;
      background: var(--menu-active-bg, linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-light-3))) !important;
      background-size: 180% 180%;
      box-shadow: var(--menu-active-glow, 0 10px 24px rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.34));
      border-color: rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.5) !important;
      animation: sidebarActiveFlow 4.6s ease infinite;
    }
    & .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .el-sub-menu .el-menu-item {
      min-width: 0 !important;
      margin: 0 10px 5px;
      width: calc(100% - 20px);
      padding-left: 10px !important;
      padding-right: 10px !important;
      box-sizing: border-box;
      border-radius: var(--radius-xs);
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      width: calc(100% - 24px) !important;
      margin: 0 12px 8px !important;
      height: 46px;
      line-height: 46px;
      padding-left: 14px !important;
      padding-right: 14px !important;
      border-radius: 12px;
      transition: all 0.24s ease;
      color: var(--sidebar-text);
      border: none !important;
      border: 1px solid rgba(255, 255, 255, 0.06) !important;
      background: linear-gradient(128deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
      &:hover {
        background-color: var(--menu-hover) !important;
        background: linear-gradient(128deg, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.24), rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.07)) !important;
        border-color: rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.3) !important;
        transform: translateX(2px);
      }
      &.is-active {
        background: var(--menu-active-bg) !important;
        border-radius: var(--radius-sm);
        color: var(--menu-active-text) !important;
        font-weight: 500;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      }
    }
    & .theme-light .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .theme-light .el-sub-menu .el-menu-item,
    & .theme-dark .nest-menu .el-sub-menu > .el-sub-menu__title,
    & .theme-dark .el-sub-menu .el-menu-item {
      &:hover {
        background-color: var(--menu-hover) !important;
        border-radius: var(--radius-xs);
      &.is-active {
        background: var(--menu-active-bg, linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-light-3))) !important;
        background-size: 180% 180%;
        color: #fff !important;
        font-weight: 500;
        box-shadow: var(--menu-active-glow, 0 10px 24px rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.34));
        animation: sidebarActiveFlow 4.6s ease infinite;
      }
    }
  }
  .hideSidebar {
    .sidebar-container {
      width: 68px !important;
      padding-left: 0;
      padding-right: 0;
      width: var(--sidebar-collapsed-width) !important;
    }
    .main-container {
      margin-left: 84px;
      margin-left: var(--sidebar-collapsed-width);
    }
    .submenu-title-noDropdown {
@@ -188,13 +274,14 @@
        justify-content: center;
        .svg-icon {
          width: 18px;
          height: 18px;
          width: 22px;
          height: 22px;
          margin-right: 0;
          flex-shrink: 0;
        }
      }
    }
    .el-sub-menu {
      overflow: hidden;
@@ -213,14 +300,14 @@
    .el-menu--collapse {
      width: 100% !important;
      padding: 10px 6px 18px;
      padding: 12px 0 16px;
      > .el-menu-item,
      .el-sub-menu {
        & > .el-sub-menu__title,
        &.el-menu-item {
          margin: 0 0 6px;
          width: 100%;
          width: calc(100% - 12px) !important;
          margin: 0 6px 8px !important;
          padding-left: 0 !important;
          padding-right: 0 !important;
          box-sizing: border-box;
@@ -229,14 +316,10 @@
          justify-content: center;
          .svg-icon {
            width: 18px;
            height: 18px;
            width: 22px;
            height: 22px;
            margin-right: 0;
            flex-shrink: 0;
          }
          &:hover {
            border-radius: 14px;
          }
          & > span {
@@ -252,25 +335,24 @@
  }
  .el-menu--collapse .el-menu .el-sub-menu {
    min-width: $base-sidebar-width !important;
    min-width: var(--sidebar-width) !important;
  }
  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
      margin-left: 0;
    }
    .sidebar-container {
      transition: transform 0.28s;
      width: $base-sidebar-width !important;
      transition: transform 0.25s;
      width: var(--sidebar-width) !important;
    }
    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$base-sidebar-width, 0, 0);
        transform: translate3d(calc(-1 * var(--sidebar-width)), 0, 0);
      }
    }
  }
@@ -283,51 +365,55 @@
  }
}
// when menu collapsed
.el-menu--vertical {
  & > .el-menu {
    .svg-icon {
      margin-right: 14px;
      margin-right: 10px;
    }
  }
  .nest-menu .el-sub-menu > .el-sub-menu__title,
  .el-menu-item {
    min-width: 0 !important;
    margin: 0 10px 5px;
    margin: 0 10px 8px;
    width: calc(100% - 20px);
    padding-left: 10px !important;
    padding-right: 10px !important;
    height: 46px;
    line-height: 46px;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-sizing: border-box;
    border-radius: var(--radius-xs);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    color: var(--sidebar-text);
    border: none !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: linear-gradient(128deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    transition: all 0.24s ease;
    &:hover {
      background-color: var(--menu-hover) !important;
      background: linear-gradient(128deg, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.24), rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.07)) !important;
      border-color: rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.3) !important;
      transform: translateX(2px);
    }
    &.is-active {
      background: var(--menu-active-bg) !important;
      color: var(--menu-active-text) !important;
      border-radius: var(--radius-sm);
      font-weight: 500;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
      background: var(--menu-active-bg, linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-light-3))) !important;
      background-size: 180% 180%;
      color: #fff !important;
      border-radius: 12px;
      box-shadow: var(--menu-active-glow, 0 10px 24px rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.34));
      border-color: rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.5) !important;
      animation: sidebarActiveFlow 4.6s ease infinite;
    }
  }
  // the scroll bar appears when the sub-menu is too long
  > .el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    border: 1px solid rgba(163, 194, 236, 0.26);
    box-shadow: var(--shadow-md);
    background: var(--menu-surface);
    backdrop-filter: blur(20px);
    background: rgba(16, 49, 89, 0.96);
    backdrop-filter: blur(16px);
    &::-webkit-scrollbar-track-piece {
      background: var(--surface-muted);
@@ -343,3 +429,114 @@
    }
  }
}
@keyframes sidebarActiveFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
@keyframes sidebarAuroraDrift {
  0% {
    transform: translate3d(-4.8%, -1.2%, 0) scale(1.03) rotate(-1.2deg);
  }
  7% {
    transform: translate3d(2.6%, -3.9%, 0) scale(1.06) rotate(0.4deg);
  }
  19% {
    transform: translate3d(-2.9%, 3.7%, 0) scale(1.08) rotate(1.7deg);
  }
  28% {
    transform: translate3d(4.7%, 1.5%, 0) scale(1.02) rotate(-0.8deg);
  }
  41% {
    transform: translate3d(-3.8%, -2.4%, 0) scale(1.07) rotate(1.2deg);
  }
  53% {
    transform: translate3d(2.1%, 4.2%, 0) scale(1.03) rotate(-1.1deg);
  }
  67% {
    transform: translate3d(-5.2%, 0.7%, 0) scale(1.06) rotate(0.3deg);
  }
  79% {
    transform: translate3d(3.8%, -3.4%, 0) scale(1.04) rotate(1.1deg);
  }
  91% {
    transform: translate3d(-1.6%, 2.5%, 0) scale(1.08) rotate(-0.6deg);
  }
  100% {
    transform: translate3d(4.5%, -1.8%, 0) scale(1.03) rotate(-1.4deg);
  }
}
@keyframes sidebarAuroraBreath {
  0% {
    opacity: 0.7;
    filter: blur(4px) saturate(1.05);
  }
  23% {
    opacity: 0.96;
    filter: blur(6px) saturate(1.2);
  }
  54% {
    opacity: 0.76;
    filter: blur(7px) saturate(1.08);
  }
  79% {
    opacity: 0.98;
    filter: blur(5px) saturate(1.22);
  }
  100% {
    opacity: 0.82;
    filter: blur(6px) saturate(1.12);
  }
}
@keyframes sidebarSheenSweep {
  0% {
    background-position: 220% 0, 8% 20%, 80% 12%;
  }
  11% {
    background-position: 166% 0, 14% 28%, 76% 18%;
  }
  29% {
    background-position: 94% 0, 32% 8%, 60% 26%;
  }
  46% {
    background-position: 24% 0, 48% 24%, 42% 14%;
  }
  63% {
    background-position: -36% 0, 30% 52%, 20% 20%;
  }
  81% {
    background-position: -90% 0, 12% 36%, 34% 34%;
  }
  100% {
    background-position: -132% 0, 8% 20%, 80% 12%;
  }
}
@keyframes sidebarSheenJitter {
  0% {
    opacity: 0.2;
    transform: translate3d(0, 0, 0);
  }
  34% {
    opacity: 0.48;
    transform: translate3d(1.4%, -0.4%, 0);
  }
  68% {
    opacity: 0.26;
    transform: translate3d(-0.9%, 0.6%, 0);
  }
  100% {
    opacity: 0.44;
    transform: translate3d(1.9%, -0.2%, 0);
  }
}
src/assets/styles/variables.module.scss
@@ -22,6 +22,7 @@
// layout
$base-sidebar-width: 216px;
$base-sidebar-collapsed-width: 72px;
$sideBarWidth: 216px;
// sidebar - 优化后的侧边栏配色
@@ -64,93 +65,110 @@
}
:root {
  --sidebar-bg: #{$menuBg};
  --sidebar-text: #{$menuText};
  --sidebar-muted: #5a6478;
  --menu-hover: rgba(var(--el-color-primary-rgb, 13, 148, 136), 0.08);
  --menu-active-bg: var(--el-color-primary, #0d9488);
  --menu-active-text: #ffffff;
  --menu-surface: #f8fafb;
  --sidebar-width: 216px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;
  --tagsbar-height: 40px;
  --content-gap: 16px;
  --content-radius: 16px;
  --layout-header-z: 20;
  --app-bg: #f0f4f3;
  --app-bg-accent: #e0ebe9;
  --surface-base: #ffffff;
  --surface-soft: #f7faf9;
  --surface-muted: #eef3f2;
  --surface-border: #d5e0de;
  --surface-border-strong: #c5d5d2;
  --el-color-primary: #2563eb;
  --el-color-primary-rgb: 37, 99, 235;
  --el-color-success: #14b8a6;
  --el-color-warning: #f59e0b;
  --el-color-danger: #ef4444;
  --sidebar-bg: linear-gradient(180deg, #0e2a4f 0%, #123e69 55%, #0e2a4f 100%);
  --sidebar-text: rgba(234, 242, 255, 0.82);
  --sidebar-muted: rgba(234, 242, 255, 0.82);
  --menu-hover: rgba(147, 197, 253, 0.2);
  --menu-active-bg: linear-gradient(135deg, #2f80ff 0%, #38bdf8 100%);
  --menu-active-text: #f8fbff;
  --menu-surface: rgba(13, 43, 79, 0.94);
  --menu-active-glow: 0 8px 18px rgba(56, 139, 255, 0.28);
  --app-bg: #f3f7fc;
  --app-bg-accent: #eef5ff;
  --surface-base: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(255, 255, 255, 0.88);
  --surface-muted: #f5f9ff;
  --surface-border: rgba(148, 163, 184, 0.18);
  --surface-border-strong: rgba(96, 165, 250, 0.34);
  --text-primary: #1e293b;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.1);
  --shadow-menu: 0 2px 8px rgba(0, 0, 0, 0.05);
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --shadow-sm: 0 12px 32px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 20px 42px rgba(15, 23, 42, 0.1);
  --shadow-menu: 0 16px 36px rgba(8, 27, 58, 0.26);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --navbar-bg: rgba(255, 255, 255, 0.85);
  --navbar-text: #1e293b;
  --navbar-hover: rgba(13, 148, 136, 0.08);
  --navbar-bg: rgba(255, 255, 255, 0.86);
  --navbar-text: #1f3658;
  --navbar-hover: rgba(37, 99, 235, 0.08);
  --tags-bg: transparent;
  --tags-item-bg: rgba(255, 255, 255, 0.8);
  --tags-item-border: rgba(197, 213, 210, 0.9);
  --tags-item-text: #4a5568;
  --tags-item-hover: rgba(13, 148, 136, 0.1);
  --tags-close-hover: rgba(13, 148, 136, 0.2);
  --accent-primary: #0d9488;
  --accent-light: #14b8a6;
  --accent-lighter: #5eead4;
  --tags-item-bg: rgba(255, 255, 255, 0.9);
  --tags-item-border: rgba(148, 163, 184, 0.22);
  --tags-item-text: #334155;
  --tags-item-hover: #f4f8ff;
  --tags-close-hover: rgba(37, 99, 235, 0.16);
  --splitpanes-default-bg: #ffffff;
  --accent-primary: #2563eb;
  --accent-light: #3b82f6;
  --accent-lighter: #60a5fa;
  --panel-mask: rgba(255, 255, 255, 0.88);
  --panel-glow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
  --splitpanes-default-bg: #f3f7fc;
}
html.dark {
  --el-bg-color: #141414;
  --el-bg-color-overlay: #1d1e1f;
  --el-text-color-primary: #ffffff;
  --el-text-color-regular: #d0d0d0;
  --el-border-color: #434343;
  --el-border-color-light: #434343;
  --el-bg-color: #f8fbff;
  --el-bg-color-overlay: #f3f7fd;
  --el-text-color-primary: #1e293b;
  --el-text-color-regular: #475569;
  --el-border-color: rgba(148, 163, 184, 0.2);
  --el-border-color-light: rgba(148, 163, 184, 0.18);
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #d0d0d0;
  --sidebar-muted: #888888;
  --menu-hover: rgba(var(--el-color-primary-rgb, 13, 148, 136), 0.12);
  --menu-active-bg: var(--el-color-primary, #0d9488);
  --menu-active-text: #ffffff;
  --menu-surface: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #d0d0d0;
  --text-tertiary: #888888;
  --accent-primary: var(--el-color-primary, #0d9488);
  --accent-light: var(--el-color-primary-light-3, #14b8a6);
  --sidebar-bg: linear-gradient(180deg, #0e2a4f 0%, #123e69 55%, #0e2a4f 100%);
  --sidebar-text: rgba(234, 242, 255, 0.82);
  --sidebar-muted: rgba(234, 242, 255, 0.82);
  --menu-hover: rgba(147, 197, 253, 0.2);
  --menu-active-bg: linear-gradient(135deg, #2f80ff 0%, #38bdf8 100%);
  --menu-active-text: #f8fbff;
  --menu-surface: rgba(13, 43, 79, 0.94);
  --navbar-bg: #141414;
  --navbar-text: #ffffff;
  --navbar-hover: #141414;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --accent-primary: #2563eb;
  --accent-light: #3b82f6;
  --tags-bg: #141414;
  --tags-item-bg: #1d1e1f;
  --tags-item-border: #303030;
  --tags-item-text: #d0d0d0;
  --tags-item-hover: #2d2d2d;
  --tags-close-hover: #64666a;
  --navbar-bg: rgba(255, 255, 255, 0.86);
  --navbar-text: #1f3658;
  --navbar-hover: rgba(37, 99, 235, 0.08);
  --splitpanes-bg: #141414;
  --splitpanes-border: #303030;
  --splitpanes-splitter-bg: #1d1e1f;
  --splitpanes-splitter-hover-bg: #2d2d2d;
  --tags-bg: transparent;
  --tags-item-bg: rgba(255, 255, 255, 0.9);
  --tags-item-border: rgba(148, 163, 184, 0.22);
  --tags-item-text: #334155;
  --tags-item-hover: #f4f8ff;
  --tags-close-hover: rgba(37, 99, 235, 0.16);
  --blockquote-bg: #1d1e1f;
  --blockquote-border: #303030;
  --blockquote-text: #d0d0d0;
  --cron-border: #303030;
  --splitpanes-default-bg: #141414;
  --splitpanes-bg: #f3f7fc;
  --splitpanes-border: rgba(148, 163, 184, 0.22);
  --splitpanes-splitter-bg: #e7eef8;
  --splitpanes-splitter-hover-bg: #d9e6f7;
  --blockquote-bg: #f3f7ff;
  --blockquote-border: rgba(59, 130, 246, 0.36);
  --blockquote-text: #334155;
  --cron-border: rgba(148, 163, 184, 0.22);
  --splitpanes-default-bg: #f3f7fc;
  .sidebar-container {
    .el-menu-item,
src/components/AIChatSidebar/index.vue
@@ -4,7 +4,7 @@
    <div v-if="!hideTrigger" class="ai-chat-trigger" @click="toggleSidebar" v-show="!visible">
      <el-tooltip :content="currentAssistant.tooltip" placement="left">
        <div class="trigger-icon">
          <el-icon :size="30" color="#fff"><component :is="currentAssistant.icon" /></el-icon>
          <el-icon :size="22" color="#fff"><component :is="currentAssistant.icon" /></el-icon>
        </div>
      </el-tooltip>
    </div>
@@ -3850,30 +3850,30 @@
.ai-chat-trigger {
  pointer-events: auto;
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 56px;
  height: 56px;
  right: 10px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  background: $gradient-dark;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: $shadow-deep, 0 0 0 2px rgba(0, 85, 212, 0.3) inset, 0 0 30px rgba(0, 119, 232, 0.2);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2001;
  animation: triggerPulse 3s ease-in-out infinite;
  box-shadow: 0 8px 18px rgba(0, 68, 170, 0.32), 0 0 0 1px rgba(0, 136, 232, 0.32) inset;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
  z-index: 1020;
  opacity: 0.9;
  &::before {
    content: '';
    position: absolute;
    inset: -6px;
    inset: -4px;
    background: linear-gradient(135deg, rgba(0, 85, 212, 0.4), rgba(0, 136, 232, 0.3), rgba(90, 159, 224, 0.2));
    border-radius: 50%;
    z-index: -1;
    filter: blur(16px);
    animation: glowPulse 2s ease-in-out infinite alternate;
    filter: blur(10px);
    opacity: 0.35;
  }
  &::after {
@@ -3886,16 +3886,12 @@
  }
  &:hover {
    transform: scale(1.12) translateY(-4px);
    box-shadow: $shadow-deep, 0 0 0 3px rgba(0, 136, 232, 0.4) inset, 0 0 50px rgba(0, 136, 232, 0.3);
    &::before {
      animation: glowPulse 1s ease-in-out infinite alternate;
    }
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 68, 170, 0.38), 0 0 0 1px rgba(0, 136, 232, 0.42) inset;
    .trigger-icon {
      transform: rotate(-8deg) scale(1.05);
      filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
      transform: scale(1.03);
      filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.42));
    }
  }
src/components/Breadcrumb/index.vue
@@ -86,9 +86,10 @@
<style lang='scss' scoped>
.app-breadcrumb.el-breadcrumb {
  display: inline-block;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  line-height: 56px;
  line-height: 1;
  margin-left: 8px;
  :deep(.el-breadcrumb__inner) {
src/layout/components/AppMain.vue
@@ -37,30 +37,29 @@
</script>
<style lang="scss" scoped>
.app-main {
  /* 50= navbar  50  */
  min-height: calc(100vh - 50px);
  width: 100%;
  position: relative;
  overflow: hidden;
  background: transparent;
}
.route-view-wrapper {
  width: 100%;
  height: 100%;
  padding: 120px 16px 24px 0;
}
.fixed-header + .app-main {
  padding-top: 0;
}
.hasTagsView {
  .app-main {
    /* 84 = navbar + tags-view = 50 + 34 */
    min-height: calc(100vh - 84px);
  }
.app-main {
  min-height: calc(100vh - var(--topbar-height));
  width: 100%;
  position: relative;
  overflow: visible;
  background: transparent;
}
.route-view-wrapper {
  width: 100%;
  height: 100%;
  padding: var(--content-gap);
  padding-top: 0;
}
.fixed-header + .app-main {
  padding-top: 0;
}
.hasTagsView {
  .app-main {
    min-height: calc(100vh - var(--topbar-height) - var(--tagsbar-height));
  }
  .fixed-header + .app-main {
    padding-top: 0;
src/layout/components/Navbar.vue
@@ -1,316 +1,371 @@
<template>
  <div class="navbar">
    <div>
      <hamburger id="hamburger-container" :is-active="appStore.sidebar.opened" class="hamburger-container"
        @toggleClick="toggleSideBar" />
      <breadcrumb v-if="!settingsStore.topNav" id="breadcrumb-container" class="breadcrumb-container" />
    </div>
    <!--    <top-nav v-if="settingsStore.topNav" id="topmenu-container" class="topmenu-container" />-->
    <div class="right-menu">
      <!-- 消息通知 -->
      <el-popover
        v-model:visible="notificationVisible"
        :width="500"
        placement="bottom-end"
        trigger="click"
        :popper-options="{ modifiers: [{ name: 'offset', options: { offset: [0, 10] } }] }"
        popper-class="notification-popover"
      >
        <template #reference>
          <div class="notification-container right-menu-item hover-effect">
            <el-badge :value="unreadCount" :hidden="unreadCount === 0" class="notification-badge">
              <el-icon :size="20" style="cursor: pointer;">
                <Bell />
              </el-icon>
            </el-badge>
          </div>
        </template>
        <NotificationCenter
          @unreadCountChange="handleUnreadCountChange"
          ref="notificationCenterRef"
        />
      </el-popover>
      <div class="avatar-container">
        <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
          <div class="avatar-wrapper">
            <img :src="userStore.avatar" class="user-avatar" />
            <el-icon><caret-bottom /></el-icon>
          </div>
          <template #dropdown>
            <el-dropdown-menu>
              <router-link to="/user/profile">
                <el-dropdown-item>个人中心</el-dropdown-item>
              </router-link>
              <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings">
                <span>布局设置</span>
              </el-dropdown-item>
              <el-dropdown-item divided command="logout">
                <span>退出登录</span>
              </el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ElMessageBox } from 'element-plus'
import { Bell } from '@element-plus/icons-vue'
import Breadcrumb from '@/components/Breadcrumb'
import TopNav from '@/components/TopNav'
import Hamburger from '@/components/Hamburger'
import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import HeaderSearch from '@/components/HeaderSearch'
import RuoYiGit from '@/components/RuoYi/Git'
import RuoYiDoc from '@/components/RuoYi/Doc'
import NotificationCenter from './NotificationCenter/index.vue'
import useAppStore from '@/store/modules/app'
import useUserStore from '@/store/modules/user'
import useSettingsStore from '@/store/modules/settings'
const appStore = useAppStore()
const userStore = useUserStore()
const settingsStore = useSettingsStore()
const notificationVisible = ref(false)
const notificationCenterRef = ref(null)
const unreadCount = ref(0)
function toggleSideBar() {
  appStore.toggleSideBar()
}
// const redirect = ref(undefined)
// watch(route, (newRoute) => {
//   redirect.value = newRoute.query && newRoute.query.redirect
// }, { immediate: true })
function handleCommand(command) {
  switch (command) {
    case "setLayout":
      setLayout()
      break
    case "logout":
      logout()
      break
    default:
      break
  }
}
function logout() {
  ElMessageBox.confirm('确定注销并退出系统吗?', '提示', {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning'
  }).then(() => {
    userStore.logOut().then(() => {
      location.href = '/index'
    })
  }).catch(() => { })
}
const emits = defineEmits(['setLayout'])
function setLayout() {
  emits('setLayout')
}
function toggleTheme() {
  settingsStore.toggleTheme()
}
// 消息通知相关
function handleUnreadCountChange(count) {
  unreadCount.value = count
}
// 组件挂载时加载未读数量和定时刷新
let unreadCountTimer = null
onMounted(() => {
  // 延迟加载,确保组件已渲染
  nextTick(() => {
    if (notificationCenterRef.value) {
      notificationCenterRef.value.loadUnreadCount()
    }
  })
  // 定时刷新未读数量(每30秒)
  unreadCountTimer = setInterval(() => {
    if (notificationCenterRef.value) {
      notificationCenterRef.value.loadUnreadCount()
    }
  }, 30000)
})
// 监听 popover 显示状态,打开时加载消息列表
watch(notificationVisible, (val) => {
  if (val && notificationCenterRef.value) {
    nextTick(() => {
      notificationCenterRef.value.loadMessages()
    })
  }
})
onUnmounted(() => {
  if (unreadCountTimer) {
    clearInterval(unreadCountTimer)
  }
})
</script>
<style lang='scss' scoped>
<template>
  <div class="navbar">
    <div class="left-zone">
      <hamburger
        id="hamburger-container"
        :is-active="appStore.sidebar.opened"
        class="hamburger-container"
        @toggleClick="toggleSideBar"
      />
      <breadcrumb
        v-if="!settingsStore.topNav"
        id="breadcrumb-container"
        class="breadcrumb-container"
      />
    </div>
    <div class="center-zone">
      <el-icon class="search-icon"><Search /></el-icon>
      <el-input
        v-model="topSearchKeyword"
        placeholder="搜索菜单 / 功能 / 数据"
        clearable
      />
      <header-search class="search-popup-trigger" />
    </div>
    <div class="right-menu">
      <el-popover
        v-model:visible="notificationVisible"
        :width="500"
        placement="bottom-end"
        trigger="click"
        :popper-options="{ modifiers: [{ name: 'offset', options: { offset: [0, 10] } }] }"
        popper-class="notification-popover"
      >
        <template #reference>
          <div class="notification-container right-menu-item hover-effect">
            <el-badge :value="unreadCount" :hidden="unreadCount === 0" class="notification-badge">
              <el-icon :size="18">
                <Bell />
              </el-icon>
            </el-badge>
          </div>
        </template>
        <NotificationCenter @unreadCountChange="handleUnreadCountChange" ref="notificationCenterRef" />
      </el-popover>
      <div class="right-menu-item hover-effect screenfull-container">
        <screenfull />
      </div>
      <div class="avatar-container">
        <el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
          <div class="avatar-wrapper">
            <div class="user-summary">
              <div class="user-name">{{ userStore.nickName || userStore.name || "管理员" }}</div>
              <div class="user-role">{{ userStore.roleName || "系统用户" }}</div>
            </div>
            <img :src="userStore.avatar" class="user-avatar" />
            <el-icon><caret-bottom /></el-icon>
          </div>
          <template #dropdown>
            <el-dropdown-menu>
              <router-link to="/user/profile">
                <el-dropdown-item>个人中心</el-dropdown-item>
              </router-link>
              <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings">
                <span>布局设置</span>
              </el-dropdown-item>
              <el-dropdown-item divided command="logout">
                <span>退出登录</span>
              </el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ElMessageBox } from "element-plus";
import { Bell, Search } from "@element-plus/icons-vue";
import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from "@/components/Hamburger";
import Screenfull from "@/components/Screenfull";
import HeaderSearch from "@/components/HeaderSearch";
import NotificationCenter from "./NotificationCenter/index.vue";
import useAppStore from "@/store/modules/app";
import useUserStore from "@/store/modules/user";
import useSettingsStore from "@/store/modules/settings";
const appStore = useAppStore();
const userStore = useUserStore();
const settingsStore = useSettingsStore();
const topSearchKeyword = ref("");
const notificationVisible = ref(false);
const notificationCenterRef = ref(null);
const unreadCount = ref(0);
function toggleSideBar() {
  appStore.toggleSideBar();
}
function handleCommand(command) {
  switch (command) {
    case "setLayout":
      setLayout();
      break;
    case "logout":
      logout();
      break;
    default:
      break;
  }
}
function logout() {
  ElMessageBox.confirm("确定注销并退出系统吗?", "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      userStore.logOut().then(() => {
        location.href = "/index";
      });
    })
    .catch(() => {});
}
const emits = defineEmits(["setLayout"]);
function setLayout() {
  emits("setLayout");
}
function handleUnreadCountChange(count) {
  unreadCount.value = count;
}
let unreadCountTimer = null;
onMounted(() => {
  nextTick(() => {
    if (notificationCenterRef.value) {
      notificationCenterRef.value.loadUnreadCount();
    }
  });
  unreadCountTimer = setInterval(() => {
    if (notificationCenterRef.value) {
      notificationCenterRef.value.loadUnreadCount();
    }
  }, 30000);
});
watch(notificationVisible, (val) => {
  if (val && notificationCenterRef.value) {
    nextTick(() => {
      notificationCenterRef.value.loadMessages();
    });
  }
});
onUnmounted(() => {
  if (unreadCountTimer) {
    clearInterval(unreadCountTimer);
  }
});
</script>
<style lang="scss" scoped>
.navbar {
  height: 56px;
  overflow: hidden;
  position: relative;
  background: var(--navbar-bg);
  border: 1px solid rgba(216, 225, 219, 0.9);
  border-radius: 22px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--content-radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  padding: 0 18px;
  .hamburger-container {
    line-height: 52px;
    height: 100%;
    float: left;
    cursor: pointer;
    transition: background 0.3s;
    -webkit-tap-highlight-color: transparent;
    &:hover {
      background: var(--navbar-hover);
    }
  }
  .breadcrumb-container {
    float: left;
  }
  .topmenu-container {
    position: absolute;
    left: 50px;
  }
  .errLog-container {
    display: inline-block;
    vertical-align: top;
  }
  .right-menu {
    float: right;
    height: 100%;
    align-items: center;
    display: flex;
    &:focus {
      outline: none;
    }
    .right-menu-item {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 8px;
      height: 100%;
      font-size: 18px;
      color: var(--navbar-text);
      border-radius: 14px;
      &.hover-effect {
        cursor: pointer;
        transition: background 0.3s;
        &:hover {
          background: var(--navbar-hover);
        }
      }
      &.theme-switch-wrapper {
        display: flex;
        align-items: center;
        svg {
          transition: transform 0.3s;
          &:hover {
            transform: scale(1.15);
          }
        }
      }
    }
    .notification-container {
      margin-right: 12px;
      display: flex;
      align-items: center;
      cursor: pointer;
      .notification-badge {
        :deep(.el-badge__content) {
          border: none;
        }
      }
    }
    .avatar-container {
      margin-right: 4px;
      height: 100%;
      display: flex;
      align-items: center;
}
      :deep(.el-dropdown) {
        height: 100%;
        display: flex;
        align-items: center;
      }
.left-zone {
  flex: 0 1 420px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
      .avatar-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 6px 10px 6px 6px;
        height: 44px;
        border-radius: 999px;
        background: rgba(247, 250, 248, 0.92);
        border: 1px solid var(--surface-border);
.hamburger-container {
  line-height: 36px;
  height: 36px;
  width: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navbar-text);
        .user-avatar {
          cursor: pointer;
          width: 34px;
          height: 34px;
          border-radius: 50px;
        }
  &:hover {
    background: var(--navbar-hover);
  }
}
        i {
          cursor: pointer;
          position: static;
          font-size: 12px;
        }
      }
    }
  }
}
</style>
<style lang="scss">
.breadcrumb-container {
  min-width: 0;
}
.center-zone {
  width: clamp(360px, 34vw, 560px);
  min-width: 320px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(248, 251, 255, 0.92);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
}
.search-icon {
  color: #5b86c9;
}
.center-zone :deep(.el-input__wrapper) {
  border: 0;
  box-shadow: none !important;
  background: transparent;
  padding: 0;
}
.center-zone :deep(.el-input__inner) {
  color: #334155;
  font-size: 13px;
}
.search-popup-trigger :deep(.search-icon) {
  color: #5b86c9;
  font-size: 16px;
  cursor: pointer;
}
.right-menu {
  height: 100%;
  align-items: center;
  display: flex;
  gap: 14px;
}
.right-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navbar-text);
  border-radius: 8px;
}
.hover-effect {
  cursor: pointer;
  transition: background 0.2s;
  &:hover {
    background: var(--navbar-hover);
  }
}
.notification-container,
.screenfull-container {
  width: 36px;
  height: 36px;
}
.notification-badge :deep(.el-badge__content) {
  border: none;
}
.screenfull-container :deep(.svg-icon) {
  width: 16px;
  height: 16px;
  color: var(--navbar-text);
}
.avatar-container {
  height: 100%;
  display: flex;
  align-items: center;
}
.avatar-container :deep(.el-dropdown) {
  height: 100%;
  display: flex;
  align-items: center;
}
.avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 8px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.user-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.user-name {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1;
}
.user-role {
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1;
}
.user-avatar {
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.3);
}
@media (max-width: 1200px) {
  .center-zone {
    display: none;
  }
  .user-summary {
    display: none;
  }
}
</style>
<style lang="scss">
.notification-popover {
  padding: 0 !important;
  border-radius: 20px !important;
  border: 1px solid var(--surface-border) !important;
  box-shadow: var(--shadow-md) !important;
  .el-popover__title {
    display: none;
  }
  .el-popover__body {
    padding: 0 !important;
  }
}
.el-badge__content.is-fixed{
  top: 12px;
}
</style>
  border-radius: 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12) !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(16px);
  .el-popover__title {
    display: none;
  }
  .el-popover__body {
    padding: 0 !important;
  }
}
.el-badge__content.is-fixed {
  top: 8px;
}
</style>
src/layout/components/NotificationCenter/index.vue
@@ -255,6 +255,7 @@
    flex-direction: column;
    width: 500px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.92);
  }
  .popover-header {
@@ -264,12 +265,12 @@
    width: 100%;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    border-bottom: 1px solid var(--surface-border);
    .popover-title {
      font-size: 18px;
      font-weight: 500;
      color: #303133;
      color: var(--text-primary);
    }
  }
@@ -315,11 +316,11 @@
    .notification-item {
      display: flex;
      padding: 12px 0;
      border-bottom: 1px solid #f0f0f0;
      border-bottom: 1px solid rgba(148, 163, 184, 0.18);
      transition: background-color 0.3s;
      &:hover {
        background-color: #f5f7fa;
        background-color: #f8fbff;
      }
      &.read {
@@ -333,7 +334,7 @@
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #f0f9ff;
        background-color: rgba(59, 130, 246, 0.12);
        border-radius: 50%;
        margin-right: 12px;
      }
@@ -345,13 +346,13 @@
        .notification-title {
          font-size: 14px;
          font-weight: 500;
          color: #303133;
          color: var(--text-primary);
          margin-bottom: 8px;
        }
        .notification-detail {
          font-size: 13px;
          color: #606266;
          color: var(--text-secondary);
          line-height: 1.5;
          margin-bottom: 8px;
          word-break: break-all;
@@ -359,7 +360,7 @@
        .notification-time {
          font-size: 12px;
          color: #909399;
          color: var(--text-tertiary);
        }
      }
@@ -375,7 +376,7 @@
  .pagination-wrapper {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    border-top: 1px solid var(--surface-border);
    display: flex;
    justify-content: center;
    padding-left: 0;
src/layout/components/Sidebar/Logo.vue
@@ -4,7 +4,7 @@
      <router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
        <img :src="faviconUrl" class="sidebar-logo sidebar-favicon" alt="站点图标" />
      </router-link>
      <router-link v-else key="expand" class="sidebar-logo-link" to="/">
      <router-link v-else key="expand" class="sidebar-logo-link" :style="expandLogoLinkStyle" to="/">
        <img v-if="logoUrl" :src="logoUrl" class="sidebar-logo" @error="handleImageError" alt="公司Logo" />
        <h1 v-if="!logoUrl" class="sidebar-title">{{ title }}</h1>
      </router-link>
@@ -35,6 +35,14 @@
})
const logoUrl = ref('')
const expandLogoLinkStyle = computed(() => {
  if (!logoUrl.value) {
    return { '--logo-bg-image': 'none' }
  }
  const escaped = String(logoUrl.value).replace(/"/g, '\\"')
  return { '--logo-bg-image': `url("${escaped}")` }
})
const updateLogoUrl = () => {
  if (!cleanFactoryName.value) {
@@ -82,34 +90,63 @@
.sidebar-logo-container {
  position: relative;
  width: 100% !important;
  height: 56px !important;
  line-height: 56px;
  background: var(--menu-surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  text-align: center;
  height: 78px !important;
  line-height: 78px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  box-shadow: none;
  backdrop-filter: none;
  transition: all 0.3s ease;
  .sidebar-logo-link {
    position: relative;
    isolation: isolate;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px 0 14px;
    padding: 0;
    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image: var(--logo-bg-image);
      background-size: cover;
      background-position: center;
      opacity: 0.26;
      filter: blur(8px) saturate(0.9);
      transform: scale(1.06);
      pointer-events: none;
      z-index: 0;
    }
    &::after {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(16, 49, 89, 0.18), rgba(16, 49, 89, 0.08));
      pointer-events: none;
      z-index: 0;
    }
  }
  .sidebar-logo {
    width: auto;
    max-width: 250px;
    max-height: 50px;
    height: auto;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 6px 10px;
    vertical-align: middle;
    object-fit: contain;
    object-position: center;
    filter: none;
    display: block;
    position: relative;
    z-index: 1;
  }
  .sidebar-title {
@@ -121,23 +158,35 @@
    font-size: 14px;
    font-family: "Segoe UI", "PingFang SC", sans-serif;
    vertical-align: middle;
    position: relative;
    z-index: 1;
  }
  &.collapse {
    .sidebar-logo-link {
      justify-content: center;
      padding: 0;
      &::before,
      &::after {
        display: none;
      }
    }
    .sidebar-logo {
      width: 100%;
      height: 100%;
      max-width: 30px;
      max-height: 30px;
      padding: 0;
      filter: none;
    }
    .sidebar-favicon {
      width: 24px;
      height: 24px;
      max-width: 24px;
      max-height: 24px;
      width: 28px;
      height: 28px;
      max-width: 28px;
      max-height: 28px;
    }
  }
}
src/layout/components/Sidebar/SidebarItem.vue
@@ -102,54 +102,57 @@
</script>
<style lang="scss" scoped>
.sidebar-item-wrapper {
  :deep(.menu-icon) {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.25s ease;
    color: var(--sidebar-text);
    opacity: 0.8;
  }
  :deep(.el-menu-item:hover .menu-icon),
  :deep(.el-sub-menu__title:hover .menu-icon) {
    color: var(--el-color-primary, var(--accent-primary));
    opacity: 1;
    transform: scale(1.1);
  }
.sidebar-item-wrapper {
  :deep(.menu-icon) {
    width: 26px;
    height: 26px;
    margin-right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s ease;
    color: var(--sidebar-text);
    opacity: 0.88;
  }
  :deep(.el-menu-item:hover .menu-icon),
  :deep(.el-sub-menu__title:hover .menu-icon) {
    color: #ffffff;
    opacity: 1;
  }
  
  :deep(.el-menu-item.is-active .menu-icon) {
    color: var(--menu-active-text) !important;
    opacity: 1;
  }
  
  :deep(.menu-title) {
    font-weight: 450;
    transition: all 0.25s ease;
    color: var(--sidebar-text);
  }
  :deep(.el-menu-item:hover .menu-title),
  :deep(.el-sub-menu__title:hover .menu-title) {
    color: var(--el-color-primary, var(--accent-primary));
  }
  :deep(.el-menu-item.is-active .menu-title) {
    color: var(--menu-active-text) !important;
  }
  :deep(.nest-menu) {
    .menu-icon {
      width: 16px;
      height: 16px;
      margin-right: 10px;
    }
    .menu-title {
      font-size: 13px;
    }
  }
}
  :deep(.menu-title) {
    font-weight: 500;
    transition: color 0.2s ease;
    color: var(--sidebar-text);
    opacity: 0.82;
  }
  :deep(.el-menu-item:hover .menu-title),
  :deep(.el-sub-menu__title:hover .menu-title) {
    color: #ffffff;
    opacity: 1;
  }
  :deep(.el-menu-item.is-active .menu-title) {
    color: var(--menu-active-text) !important;
    opacity: 1;
  }
  :deep(.nest-menu) {
    .menu-icon {
      width: 22px;
      height: 22px;
      margin-right: 10px;
    }
    .menu-title { font-size: 13px; }
  }
}
</style>
src/layout/components/Sidebar/index.vue
@@ -1,207 +1,164 @@
<template>
  <div :class="{ 'has-logo': showLogo }"
       class="sidebar-container">
    <logo v-if="showLogo"
          :collapse="isCollapse" />
  <div :class="{ 'has-logo': showLogo }" class="sidebar-container">
    <logo v-if="showLogo" :collapse="isCollapse" />
    <el-scrollbar wrap-class="scrollbar-wrapper">
      <el-menu :default-active="activeMenu"
               :collapse="isCollapse"
               :background-color="getMenuBackground"
               :text-color="getMenuTextColor"
               :unique-opened="true"
               :active-text-color="theme"
               :collapse-transition="false"
               mode="vertical"
               :class="sideTheme">
        <sidebar-item v-for="(route, index) in sidebarRouters"
                      :key="route.path + index"
                      :item="route"
                      :base-path="route.path" />
      <el-menu
        :default-active="activeMenu"
        :collapse="isCollapse"
        :background-color="getMenuBackground"
        :text-color="getMenuTextColor"
        :unique-opened="true"
        :active-text-color="theme"
        :collapse-transition="false"
        mode="vertical"
        :class="sideTheme"
      >
        <sidebar-item
          v-for="(route, index) in sidebarRouters"
          :key="route.path + index"
          :item="route"
          :base-path="route.path"
        />
      </el-menu>
    </el-scrollbar>
  </div>
</template>
<script setup>
  import Logo from "./Logo";
  import SidebarItem from "./SidebarItem";
  import variables from "@/assets/styles/variables.module.scss";
  import useAppStore from "@/store/modules/app";
  import useSettingsStore from "@/store/modules/settings";
  import usePermissionStore from "@/store/modules/permission";
import Logo from "./Logo";
import SidebarItem from "./SidebarItem";
import useAppStore from "@/store/modules/app";
import useSettingsStore from "@/store/modules/settings";
import usePermissionStore from "@/store/modules/permission";
  const route = useRoute();
  const appStore = useAppStore();
  const settingsStore = useSettingsStore();
  const permissionStore = usePermissionStore();
const route = useRoute();
const appStore = useAppStore();
const settingsStore = useSettingsStore();
const permissionStore = usePermissionStore();
  const sidebarRouters = computed(() => permissionStore.sidebarRouters);
  const showLogo = computed(() => settingsStore.sidebarLogo);
  const sideTheme = computed(() => settingsStore.sideTheme);
  const theme = computed(() => settingsStore.theme);
  const isCollapse = computed(() => !appStore.sidebar.opened);
const sidebarRouters = computed(() => permissionStore.sidebarRouters);
const showLogo = computed(() => settingsStore.sidebarLogo);
const sideTheme = computed(() => settingsStore.sideTheme);
const theme = computed(() => settingsStore.theme);
const isCollapse = computed(() => !appStore.sidebar.opened);
  const getMenuBackground = computed(() => "var(--sidebar-bg)");
const getMenuBackground = computed(() => "var(--sidebar-bg)");
  const getMenuTextColor = computed(() => {
    if (settingsStore.isDark) {
      return "var(--sidebar-text)";
    }
    return sideTheme.value === "theme-dark"
      ? variables.menuText
      : variables.menuLightText;
  });
const getMenuTextColor = computed(() => "var(--sidebar-text)");
  const activeMenu = computed(() => {
    const { meta, path } = route;
    if (meta.activeMenu) {
      return meta.activeMenu;
    }
    return path;
  });
const activeMenu = computed(() => {
  const { meta, path } = route;
  if (meta.activeMenu) return meta.activeMenu;
  return path;
});
</script>
<style lang="scss" scoped>
  .sidebar-container {
    background-color: v-bind(getMenuBackground);
    border-radius: var(--radius-lg);
    overflow: hidden;
.sidebar-container {
  background: transparent;
  border-radius: 0;
  overflow: hidden;
    .scrollbar-wrapper {
      background-color: v-bind(getMenuBackground);
  .scrollbar-wrapper {
    background: transparent;
  }
  .el-menu {
    border: none !important;
    height: 100%;
    width: 100% !important;
    border-radius: 0;
    background: transparent !important;
    .el-menu-item,
    .el-sub-menu__title {
      margin-bottom: 8px;
      border-radius: 14px;
      color: v-bind(getMenuTextColor);
      font-size: 14px;
      letter-spacing: 0;
      transition: all 0.28s ease;
      border: none !important;
      display: flex;
      align-items: center;
      &:hover {
        background: linear-gradient(128deg, rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.28), rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.08)) !important;
        transform: translateX(3px);
      }
    }
    .el-menu {
      border: 1px solid var(--surface-border) !important;
      height: 100%;
      width: 100% !important;
      border-radius: var(--radius-lg);
    .el-menu-item {
      color: var(--sidebar-text);
      .el-menu-item,
      .el-sub-menu__title {
        margin-bottom: 5px;
        border-radius: var(--radius-xs);
        color: v-bind(getMenuTextColor);
        font-size: 13.5px;
        letter-spacing: 0.2px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border: none !important;
      &.is-active {
        background: var(--menu-active-bg, linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-light-3))) !important;
        background-size: 180% 180%;
        color: var(--menu-active-text) !important;
        font-weight: 500;
        border-radius: 14px;
        box-shadow: var(--menu-active-glow, 0 10px 24px rgba(var(--el-color-primary-rgb, 37, 99, 235), 0.34));
        animation: sidebarActiveFlow 4.6s ease infinite;
        &:hover {
          background-color: var(--menu-hover) !important;
          border-radius: var(--radius-sm);
          transform: translateX(2px);
        }
        .svg-icon {
          transition: all 0.25s ease;
        }
        &:hover .svg-icon {
          transform: scale(1.1);
          color: var(--el-color-primary, var(--accent-primary));
        }
      }
      .el-menu-item {
        color: var(--sidebar-text);
        &.is-active {
          background: var(--menu-active-bg) !important;
          color: var(--menu-active-text) !important;
          font-weight: 500;
          border-radius: var(--radius-sm);
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
          .svg-icon {
            color: var(--menu-active-text) !important;
          }
        }
      }
    }
      .el-sub-menu__title {
        color: v-bind(getMenuTextColor);
      }
    .el-sub-menu__title {
      color: v-bind(getMenuTextColor);
    }
      :deep(.el-sub-menu__icon-arrow) {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        margin-top: -7px;
        right: 12px;
        font-size: 14px !important;
        color: currentColor !important;
        opacity: 0.7;
        transition: all 0.25s ease;
      }
      :deep(.el-sub-menu.is-opened .el-sub-menu__icon-arrow) {
        transform: rotate(180deg);
      }
    :deep(.el-sub-menu__icon-arrow) {
      display: inline-flex !important;
      align-items: center;
      justify-content: center;
      width: 14px;
      height: 14px;
      margin-top: -7px;
      right: 14px;
      font-size: 14px !important;
      color: currentColor !important;
      opacity: 0.7;
      transition: all 0.25s ease;
    }
      :deep(.el-sub-menu.is-active > .el-sub-menu__title) {
        color: var(--menu-active-text) !important;
        font-weight: 600;
        border-radius: var(--radius-sm);
        margin: 0 10px 5px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box;
        overflow: hidden;
        background-clip: padding-box;
        background: var(--menu-active-bg) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        border: none !important;
      }
    :deep(.el-sub-menu.is-opened .el-sub-menu__icon-arrow) {
      transform: rotate(180deg);
    }
      :deep(.el-menu-item.is-active) {
        margin: 0 10px 5px !important;
        width: calc(100% - 20px) !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box;
        overflow: hidden;
        background-clip: padding-box;
        border-radius: var(--radius-sm);
      }
    :deep(.el-sub-menu.is-active > .el-sub-menu__title) {
      color: var(--menu-active-text) !important;
      font-weight: 500;
      border-radius: 12px;
      margin: 0 12px 6px !important;
      padding-left: 14px !important;
      padding-right: 34px !important;
      box-sizing: border-box;
      overflow: hidden;
      background-clip: padding-box;
      background: var(--menu-active-bg) !important;
      box-shadow: var(--menu-active-glow);
      border: none !important;
    }
      :deep(.el-sub-menu.is-active > .el-sub-menu__title .menu-title),
      :deep(.el-sub-menu.is-active > .el-sub-menu__title .svg-icon) {
        color: var(--menu-active-text) !important;
      }
      :deep(.el-menu-item.is-active .menu-title) {
        color: var(--menu-active-text) !important;
      }
    :deep(.el-menu-item.is-active) {
      margin: 0 12px 6px !important;
      width: calc(100% - 24px) !important;
      padding-left: 14px !important;
      padding-right: 34px !important;
      box-sizing: border-box;
      overflow: hidden;
      background-clip: padding-box;
      border-radius: 12px;
    }
      :deep(.el-sub-menu__title:hover),
      :deep(.el-menu-item:hover) {
        border-radius: var(--radius-sm);
      }
      // 子菜单展开动画优化
      :deep(.el-sub-menu .el-menu) {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      }
      // 菜单项进入动画
      :deep(.el-menu-item),
      :deep(.el-sub-menu__title) {
        animation: menuItemFadeIn 0.3s ease forwards;
      }
      @keyframes menuItemFadeIn {
        from {
          opacity: 0;
          transform: translateX(-8px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }
    :deep(.el-sub-menu.is-active > .el-sub-menu__title .menu-title),
    :deep(.el-sub-menu.is-active > .el-sub-menu__title .svg-icon),
    :deep(.el-menu-item.is-active .menu-title) {
      color: var(--menu-active-text) !important;
    }
  }
}
</style>
src/layout/components/TagsView/ScrollPane.vue
@@ -100,8 +100,8 @@
  :deep(.el-scrollbar__bar) {
    bottom: 0px;
  }
  :deep(.el-scrollbar__wrap) {
    height: 42px;
  }
}
</style>
  :deep(.el-scrollbar__wrap) {
    height: var(--tagsbar-height);
  }
}
</style>
src/layout/components/TagsView/index.vue
@@ -259,20 +259,20 @@
<style lang="scss" scoped>
.tags-view-container {
  height: 42px;
  height: var(--tagsbar-height);
  width: 100%;
  margin-top: 10px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(216, 225, 219, 0.92);
  border-radius: 20px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
  margin-top: 0;
  padding: 0 2px;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  box-shadow: none;
  .tags-view-wrapper {
    display: flex;
    align-items: center;
    min-height: 42px;
    min-height: var(--tagsbar-height);
    .tags-view-item {
      display: inline-flex;
@@ -280,29 +280,29 @@
      justify-content: center;
      position: relative;
      cursor: pointer;
      height: 34px;
      height: 30px;
      line-height: 1;
      color: var(--tags-item-text, #4E5463);
      background: var(--tags-item-bg, #E5E7EA);
      border: 1px solid var(--tags-item-border, #d8dce5);
      border-radius: 999px;
      padding: 0 16px;
      padding: 0 14px;
      font-size: 12px;
      margin-right: 8px;
      margin-right: 6px;
      flex-shrink: 0;
      gap: 6px;
      transition: all 0.24s ease;
      &:hover {
        background: var(--tags-item-hover, #eee);
        border-color: rgba(31, 122, 114, 0.18);
        border-color: rgba(96, 165, 250, 0.36);
      }
      &.active {
        background-color: #FFFFFF !important;
        color: var(--el-color-primary);
        box-shadow: 0 10px 24px rgba(31, 122, 114, 0.12);
        border-color: rgba(31, 122, 114, 0.2) !important;
        background-image: linear-gradient(132deg, rgba(47, 128, 255, 0.95), rgba(56, 189, 248, 0.9));
        color: #fff;
        box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
        border-color: rgba(147, 197, 253, 0.72) !important;
      }
    }
  }
src/layout/index.vue
@@ -7,11 +7,11 @@
         @click="handleClickOutside" />
    <sidebar v-if="!sidebar.hide"
             class="sidebar-container" />
    <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }"
         class="main-container">
      <div :class="{ 'fixed-header': fixedHeader }">
    <div :class="{ hasTagsView: showTagsView, sidebarHide: sidebar.hide }"
         class="main-container main-layout">
      <div :class="{ 'fixed-header': fixedHeader, 'with-tags': showTagsView }">
        <navbar @setLayout="setLayout" />
        <tags-view v-if="needTagsView" />
        <tags-view v-if="showTagsView" />
      </div>
      <app-main />
      <settings ref="settingRef" />
@@ -31,8 +31,10 @@
  import useAppStore from "@/store/modules/app";
  import useUserStore from "@/store/modules/user";
  import useSettingsStore from "@/store/modules/settings";
  import useTagsViewStore from "@/store/modules/tagsView";
  const settingsStore = useSettingsStore();
  const tagsViewStore = useTagsViewStore();
  const userStore = useUserStore();
  const route = useRoute();
  const theme = computed(() => settingsStore.theme);
@@ -40,6 +42,7 @@
  const sidebar = computed(() => useAppStore().sidebar);
  const device = computed(() => useAppStore().device);
  const needTagsView = computed(() => settingsStore.tagsView);
  const showTagsView = computed(() => needTagsView.value && tagsViewStore.visitedViews.length > 1);
  const fixedHeader = computed(() => settingsStore.fixedHeader);
  const aiEnabled = computed(() => Number(userStore.aiEnabled) === 1);
  const showGlobalAiChat = computed(() => {
@@ -87,19 +90,16 @@
<style lang="scss" scoped>
  @import "@/assets/styles/mixin.scss";
  @import "@/assets/styles/variables.module.scss";
  .app-wrapper {
    @include clearfix;
    position: relative;
    height: 100%;
    min-height: 100%;
    width: 100%;
    background: radial-gradient(
        circle at top,
        rgba(223, 232, 226, 0.95),
        transparent 32%
      ),
      linear-gradient(180deg, #f7faf8 0%, var(--app-bg) 100%);
    background:
      radial-gradient(circle at 14% -8%, rgba(59, 130, 246, 0.14), transparent 36%),
      radial-gradient(circle at 88% -12%, rgba(56, 189, 248, 0.1), transparent 30%),
      linear-gradient(165deg, #f3f7fc 0%, #eef5ff 56%, #f8fbff 100%);
    &.mobile.openSidebar {
      position: fixed;
@@ -108,8 +108,7 @@
  }
  .drawer-bg {
    background: #000;
    opacity: 0.3;
    background: rgba(15, 23, 42, 0.22);
    width: 100%;
    top: 0;
    height: 100%;
@@ -117,26 +116,46 @@
    z-index: 999;
  }
  .fixed-header {
    position: fixed;
    top: 0px;
    padding-top: 12px;
    right: 16px;
    z-index: 9;
    width: calc(100% - #{$base-sidebar-width} - 32px);
    transition: width 0.28s, right 0.28s;
    padding-bottom: 8px;
    background-color: #f3f6f4;
  }
  .hideSidebar .fixed-header {
    width: calc(100% - 100px);
  .main-layout {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    display: flex;
    flex-direction: column;
  }
  .sidebarHide .fixed-header {
    width: calc(100% - 32px);
  .fixed-header {
    position: sticky;
    top: 0;
    z-index: var(--layout-header-z);
    width: 100%;
    padding: 8px var(--content-gap) 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    backdrop-filter: none;
  }
  .fixed-header.with-tags {
    padding-bottom: 6px;
  }
  .hideSidebar .fixed-header {
    width: 100%;
  }
  .hideSidebar .main-layout {
    margin-left: var(--sidebar-collapsed-width);
  }
  .mobile .fixed-header {
    width: 100%;
    padding: 8px 10px 0;
  }
  .mobile .main-layout,
  .sidebarHide.main-layout {
    margin-left: 0;
  }
</style>
src/settings.js
@@ -6,7 +6,7 @@
  /**
   * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
   */
  sideTheme: 'theme-light',
  sideTheme: 'theme-dark',
  /**
   * 是否系统布局配置
   */
@@ -39,7 +39,7 @@
  /**
   * 主题模式 auto跟随系统,light浅色,dark深色
   */
  darkMode: "auto",
  darkMode: "light",
  /**
   * @type {string | array} 'production' | ['production', 'development']
src/utils/theme.js
@@ -1,29 +1,44 @@
// 处理主题样式
export function handleThemeStyle(theme) {
    document.documentElement.style.setProperty('--el-color-primary', theme)
    const primary = normalizeHex(theme)
    const [r, g, b] = hexToRgb(primary)
    const light2 = getLightColor(primary, 0.2)
    const light3 = getLightColor(primary, 0.3)
    const light5 = getLightColor(primary, 0.5)
    document.documentElement.style.setProperty('--el-color-primary', primary)
    document.documentElement.style.setProperty('--el-color-primary-rgb', `${r}, ${g}, ${b}`)
    for (let i = 1; i <= 9; i++) {
        document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, `${getLightColor(theme, i / 10)}`)
        document.documentElement.style.setProperty(`--el-color-primary-light-${i}`, `${getLightColor(primary, i / 10)}`)
    }
    for (let i = 1; i <= 9; i++) {
        document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, `${getDarkColor(theme, i / 10)}`)
        document.documentElement.style.setProperty(`--el-color-primary-dark-${i}`, `${getDarkColor(primary, i / 10)}`)
    }
    // 系统主题联动到侧边栏选中态与高亮
    document.documentElement.style.setProperty('--menu-active-bg', `linear-gradient(135deg, ${primary} 0%, ${light3} 100%)`)
    document.documentElement.style.setProperty('--menu-active-glow', `0 10px 24px rgba(${r}, ${g}, ${b}, 0.32)`)
    document.documentElement.style.setProperty('--menu-hover', `rgba(${r}, ${g}, ${b}, 0.2)`)
    document.documentElement.style.setProperty('--accent-primary', primary)
    document.documentElement.style.setProperty('--accent-light', light2)
    document.documentElement.style.setProperty('--accent-lighter', light5)
}
// hex颜色转rgb颜色
export function hexToRgb(str) {
    str = str.replace('#', '')
    let hexs = str.match(/../g)
    str = normalizeHex(str).replace('#', '')
    const hexs = str.match(/../g) || ['40', '9e', 'ff']
    for (let i = 0; i < 3; i++) {
        hexs[i] = parseInt(hexs[i], 16)
    }
    return hexs
}
// rgb颜色转Hex颜色
// rgb颜色转hex颜色
export function rgbToHex(r, g, b) {
    let hexs = [r.toString(16), g.toString(16), b.toString(16)]
    const hexs = [r.toString(16), g.toString(16), b.toString(16)]
    for (let i = 0; i < 3; i++) {
        if (hexs[i].length == 1) {
        if (hexs[i].length === 1) {
            hexs[i] = `0${hexs[i]}`
        }
    }
@@ -32,7 +47,7 @@
// 变浅颜色值
export function getLightColor(color, level) {
    let rgb = hexToRgb(color)
    const rgb = hexToRgb(color)
    for (let i = 0; i < 3; i++) {
        rgb[i] = Math.floor((255 - rgb[i]) * level + rgb[i])
    }
@@ -41,9 +56,19 @@
// 变深颜色值
export function getDarkColor(color, level) {
    let rgb = hexToRgb(color)
    const rgb = hexToRgb(color)
    for (let i = 0; i < 3; i++) {
        rgb[i] = Math.floor(rgb[i] * (1 - level))
    }
    return rgbToHex(rgb[0], rgb[1], rgb[2])
}
function normalizeHex(color) {
    if (!color || typeof color !== 'string') return '#409eff'
    let value = color.trim().replace('#', '')
    if (value.length === 3) {
        value = value.split('').map((s) => s + s).join('')
    }
    if (!/^[0-9a-fA-F]{6}$/.test(value)) return '#409eff'
    return `#${value.toLowerCase()}`
}
src/views/index.vue
@@ -1,156 +1,320 @@
<template>
  <div class="dashboard">
    <!-- 顶部横向两栏 -->
    <div class="dashboard-top">
      <!-- 左:企业信息+三大数据卡片(上下排列) -->
      <div class="top-left">
        <div class="company-info">
          <!-- 顶部问候条 -->
          <div class="welcome-banner">
            <div class="welcome-title">
              <span class="welcome-user">{{ userStore.nickName || '系统管理员' }}</span>
              <span> 您好!祝您开心每一天</span>
            </div>
            <div class="welcome-time">登录于: {{ userStore.currentLoginTime }}</div>
  <div class="dashboard-cockpit">
    <section class="cockpit-panel welcome-panel">
      <div class="welcome-user">
        <el-avatar :src="welcomeAvatar" class="avatar" @error="handleWelcomeAvatarError">
          <el-icon><UserFilled /></el-icon>
        </el-avatar>
        <div class="welcome-text">
          <div class="welcome-title">
            晚上好,{{ userStore.nickName || userStore.name || "超级管理员" }} 👋
          </div>
          <div class="welcome-subtitle">专注工业数字化,助力智造升级</div>
        </div>
      </div>
      <div class="welcome-meta">
        <div class="meta-time digital-number">{{ nowTime }}</div>
        <div class="meta-extra">
          <span class="meta-date">{{ nowDate }}</span>
          <span class="meta-weather">{{ weatherText }}</span>
        </div>
        <div class="meta-tip">MES / MOM 生产运营驾驶舱</div>
      </div>
    </section>
          <!-- 用户信息卡片 -->
          <div class="user-card">
            <img :src="userStore.avatar" class="avatar" alt="" />
            <div class="user-card-main">
              <div class="user-name">{{ userStore.name }}</div>
              <div class="user-role">{{ userStore.roleName }}</div>
              <div class="user-meta">
                <span>{{ userStore.phoneNumber || '123456789' }}</span>
                <span class="sep">|</span>
                <span>{{ userStore.deptName || '组织架构' }}</span>
                <span class="sep">|</span>
                <span>{{ userStore.postName || '岗位名' }}</span>
    <section class="top-row">
      <div class="stats-grid">
        <article
          v-for="card in dashboardCards"
          :key="card.key"
          class="stat-card"
          :class="card.key"
        >
          <div class="stat-header">
            <div class="stat-title-wrap">
              <div class="stat-title">{{ card.title }}</div>
              <div class="stat-desc">{{ card.desc }}</div>
            </div>
            <div class="stat-icon-orb">
              <el-icon>
                <component :is="card.icon" />
              </el-icon>
            </div>
          </div>
          <div class="stat-value digital-number">{{ card.value }}</div>
          <div class="stat-footer">
            <span>{{ card.subLabel }}</span>
            <strong class="digital-number">{{ card.subValue }}</strong>
          </div>
          <div class="stat-trend">{{ card.trend }}</div>
          <div class="stat-wave" aria-hidden="true"></div>
        </article>
      </div>
    </section>
    <section class="main-grid">
      <div class="left-column">
        <div class="cockpit-panel process-panel">
          <div class="panel-title-row">
            <div class="panel-title">工序数据生产统计明细</div>
            <div class="panel-actions">
              <el-button type="primary" size="small" plain @click="openProcessDialog">选择工序</el-button>
              <el-button size="small" plain @click="resetProcessFilter">重置</el-button>
              <el-radio-group v-model="processRange" size="small" @change="refreshProcessStats">
                <el-radio-button :value="1">日</el-radio-button>
                <el-radio-button :value="2">周</el-radio-button>
                <el-radio-button :value="3">月</el-radio-button>
              </el-radio-group>
            </div>
          </div>
          <div class="process-body">
            <div class="process-chart" :class="{ empty: !hasProcessData }">
              <Echarts
                :options="chartBaseOptions"
                :chartStyle="{ width: '100%', height: '100%' }"
                :grid="processGrid"
                :series="processSeries"
                :tooltip="processTooltip"
                :xAxis="processXAxis"
                :yAxis="processYAxis"
                :style="{ height: hasProcessData ? '340px' : '280px' }"
                @click="handleChartClick"
              />
              <div v-if="!hasProcessData" class="chart-empty">
                <el-icon><DataAnalysis /></el-icon>
                <div class="chart-empty-title">暂无工序数据</div>
                <div class="chart-empty-desc">等待生产报工数据接入后自动生成统计图表</div>
                <div class="chart-empty-actions">
                  <el-button size="small" @click="refreshProcessStats">刷新数据</el-button>
                  <el-button size="small" type="primary" plain @click="openProcessDialog">选择工序</el-button>
                </div>
              </div>
            </div>
            <div class="process-aside">
              <div class="process-legend">
                <div class="process-name">{{ processAside.processName }}</div>
                <div class="process-legend-item"><span class="dot dot-blue"></span>投入量</div>
                <div class="process-legend-item"><span class="dot dot-orange"></span>报废量</div>
                <div class="process-legend-item"><span class="dot dot-cyan"></span>产出量</div>
              </div>
              <div class="process-card">
                <div class="process-label">累计总投入</div>
                <div class="process-value digital-number">{{ formatAmount(processAside.totalInput) }}</div>
              </div>
              <div class="process-card">
                <div class="process-label">累计总报废</div>
                <div class="process-value digital-number">{{ formatAmount(processAside.totalScrap) }}</div>
              </div>
              <div class="process-card">
                <div class="process-label">累计总产出</div>
                <div class="process-value digital-number">{{ formatAmount(processAside.totalOutput) }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="data-cards">
        <div class="data-card sales">
          <div class="data-title">销售数据</div>
          <div class="data-num">
            <div>
              <div class="data-desc">本月销售额/元</div>
              <div class="data-value">{{ businessInfo.monthSaleMoney }}</div>
            </div>
            <div>
              <div class="data-desc">未开票金额/元</div>
              <div class="data-value">{{ businessInfo.monthSaleHaveMoney }}</div>
            </div>
          </div>
        </div>
        <div class="data-card purchase">
          <div class="data-title">采购数据</div>
          <div class="data-num">
            <div>
              <div class="data-desc">本月采购额/元</div>
              <div class="data-value">{{ businessInfo.monthPurchaseMoney }}</div>
            </div>
            <div>
              <div class="data-desc">待付款金额/元</div>
              <div class="data-value">{{ businessInfo.monthPurchaseHaveMoney }}</div>
            </div>
          </div>
        </div>
        <div class="data-card inventory">
          <div class="data-title">库存数据</div>
          <div class="data-num">
            <div>
              <div class="data-desc">当前库存总量/件</div>
              <div class="data-value">{{ businessInfo.inventoryNum }}</div>
            </div>
            <div>
              <div class="data-desc">今日入库/件</div>
              <div class="data-value">{{ businessInfo.todayInventoryNum }}</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 右:待办事项 -->
      <div class="todo-panel">
        <div class="section-title">待办事项</div>
        <ul class="todo-list" v-if="todoList.length > 0">
          <li v-for="item in todoList" :key="item.id">
            <div style="display: flex;flex-direction: column;justify-content: space-between;width: 100%;gap: 20px">
              <div style="display: flex;justify-content: space-between;align-items: center;">
                <div class="todo-title">待办编号:{{ item.approveId }}</div>
                <div class="todo-division">部门:{{ item.approveDeptName }}</div>
                <div class="todo-time">{{ item.approveTime }}</div>
              </div>
              <div class="todo-division">待办事由:{{ item.approveReason }}</div>
            </div>
          </li>
        </ul>
        <div v-else style="text-align: center">
          暂无数据
        </div>
      </div>
    </div>
    <div class="dashboard-row">
      <div class="main-panel process-panel">
        <div class="process-panel__header">
          <div class="section-title">工序数据生产统计明细</div>
          <div style="display: flex; gap: 10px; align-items: center;">
            <el-button type="primary" size="small" plain icon="Filter" @click="openProcessDialog">选择工序</el-button>
            <el-button type="info" size="small" plain icon="Refresh" @click="resetProcessFilter">重置</el-button>
            <el-radio-group v-model="processRange" size="small" @change="refreshProcessStats">
              <el-radio-button :value="1">日</el-radio-button>
              <el-radio-button :value="2">周</el-radio-button>
              <el-radio-button :value="3">月</el-radio-button>
        <div class="cockpit-panel order-panel">
          <div class="panel-title-row">
            <div class="panel-title">生产订单进度</div>
            <el-radio-group v-model="orderFilter" size="small">
              <el-radio-button label="all">全部</el-radio-button>
              <el-radio-button label="in_progress">进行中</el-radio-button>
              <el-radio-button label="completed">已完成</el-radio-button>
              <el-radio-button label="paused">已暂停</el-radio-button>
            </el-radio-group>
          </div>
          <el-table :data="filteredOrders" stripe>
            <el-table-column prop="orderNo" label="订单编号" min-width="150" />
            <el-table-column prop="productName" label="产品名称" min-width="120" />
            <el-table-column prop="planQty" label="计划数量" min-width="90" />
            <el-table-column prop="completedQty" label="已完成" min-width="90" />
            <el-table-column label="完成率" min-width="180">
              <template #default="{ row }">
                <div class="table-progress">
                  <el-progress
                    :stroke-width="8"
                    :percentage="row.completionRate"
                    :show-text="false"
                    status="success"
                  />
                  <span>{{ row.completionRate }}%</span>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="deliveryDate" label="交期" min-width="110" />
            <el-table-column label="状态" min-width="90">
              <template #default="{ row }">
                <el-tag :type="getOrderStatusType(row.status)" effect="light">
                  {{ getOrderStatusText(row.status) }}
                </el-tag>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="process-panel__body">
          <div class="process-panel__chart">
            <Echarts :chartStyle="{ width: '100%', height: '100%' }" :grid="processGrid" :series="processSeries"
              :tooltip="processTooltip" :xAxis="processXAxis" :yAxis="processYAxis" style="height: 100%"
              @click="handleChartClick" />
        <div class="cockpit-panel contract-panel">
            <div class="panel-title">客户合同金额分析</div>
            <div class="contract-summary">
              <div class="contract-card">
                <div class="contract-name">总合同金额(元)</div>
                <div class="contract-main digital-number">{{ formatNumber(sum) }}</div>
                <div class="contract-compare">
                  同比
                  <span class="rise">{{ trendText(yny) }}</span>
                  环比
                  <span class="rise">{{ trendText(chain) }}</span>
                </div>
              </div>
              <div class="contract-chart-wrap">
                <Echarts
                  :options="chartBaseOptions"
                  :legend="pieLegend"
                  :chartStyle="chartStylePie"
                  :series="materialPieSeries"
                  :tooltip="pieTooltip"
                />
              </div>
            </div>
            <ul class="contract-list">
              <li v-for="item in materialPieSeries[0].data" :key="item.name">
                <span class="legend-dot" :style="{ backgroundColor: item.itemStyle?.color }"></span>
                <span class="contract-item-name">{{ item.name }}</span>
                <span class="contract-item-rate">{{ item.rate }}%</span>
                <span class="contract-item-value digital-number">¥{{ formatNumber(item.value) }}</span>
              </li>
            </ul>
          </div>
          <div class="process-panel__aside">
            <div class="process-legend">
              <div class="process-legend__item">
                <span class="dot dot-blue"></span><span>投入量</span>
              </div>
              <div class="process-legend__item">
                <span class="dot dot-yellow"></span><span>报废量</span>
              </div>
              <div class="process-legend__item">
                <span class="dot dot-teal"></span><span>产出量</span>
              </div>
        <div class="cockpit-panel quality-panel">
            <div class="panel-title-row">
              <div class="panel-title">质量统计</div>
              <el-radio-group v-model="qualityRange" size="small" @change="qualityStatisticsInfo">
                <el-radio-button :value="1">周</el-radio-button>
                <el-radio-button :value="2">月</el-radio-button>
                <el-radio-button :value="3">季度</el-radio-button>
              </el-radio-group>
            </div>
            <div class="process-card process-card--name">{{ processAside.processName }}</div>
            <div class="process-card">
              <div class="process-card__label">累计总投入</div>
              <div class="process-card__value">{{ formatAmount(processAside.totalInput) }}
              </div>
            <div class="quality-cards">
              <div class="quality-card one">原材料已检数量 <span>{{ qualityStatisticsObject.supplierNum }}件</span></div>
              <div class="quality-card two">过程检验数量 <span>{{ qualityStatisticsObject.processNum }}件</span></div>
              <div class="quality-card three">出厂已检数量 <span>{{ qualityStatisticsObject.factoryNum }}件</span></div>
            </div>
            <div class="process-card">
              <div class="process-card__label">累计总报废</div>
              <div class="process-card__value">{{ formatAmount(processAside.totalScrap) }}
              </div>
            </div>
            <div class="process-card">
              <div class="process-card__label">累计总产出</div>
              <div class="process-card__value">{{ formatAmount(processAside.totalOutput) }}
              </div>
            </div>
            <Echarts
              :options="chartBaseOptions"
              :chartStyle="chartStyle"
              :grid="grid"
              :legend="barLegend"
              :series="barSeries1"
              :tooltip="tooltip"
              :xAxis="xAxis1"
              :yAxis="yAxis1"
              style="height: 270px"
            />
          </div>
        </div>
      </div>
    </div>
    <!-- 工序选择弹窗 -->
      <div class="right-column">
        <div class="cockpit-panel todo-panel">
          <div class="panel-title-row">
            <div class="panel-title">待办事项</div>
            <span class="panel-more">更多</span>
          </div>
          <ul class="todo-list" v-if="todoList.length > 0">
            <li v-for="item in todoList" :key="item.id" class="todo-item">
              <div class="todo-head">
                <span class="todo-no">待办编号:{{ item.approveId }}</span>
                <span class="todo-time">{{ item.approveTime }}</span>
              </div>
              <div class="todo-desc">部门:{{ item.approveDeptName }}</div>
              <div class="todo-desc">事由:{{ item.approveReason }}</div>
            </li>
          </ul>
          <div v-else class="panel-empty">暂无数据</div>
        </div>
        <div class="cockpit-panel realtime-panel">
          <div class="panel-title-row">
            <div class="panel-title">生产实时看板</div>
            <span class="panel-more">更多</span>
          </div>
          <div class="realtime-grid">
            <div class="realtime-item" v-for="item in realtimeBoard" :key="item.key">
              <el-progress
                type="circle"
                :percentage="item.percent"
                :stroke-width="10"
                :width="94"
                :color="item.color"
              >
                <template #default>
                  <div class="realtime-value digital-number">{{ item.display }}</div>
                </template>
              </el-progress>
              <div class="realtime-label">{{ item.label }}</div>
              <div class="realtime-delta" :class="item.trend">{{ item.delta }}</div>
            </div>
          </div>
        </div>
        <div class="cockpit-panel quick-panel">
          <div class="panel-title-row">
            <div class="panel-title">快捷功能</div>
          </div>
          <div class="quick-grid">
            <button
              v-for="item in quickEntries"
              :key="item.label"
              class="quick-item"
              type="button"
              @click="goToQuick(item.path)"
            >
              <span class="quick-icon">
                <el-icon>
                  <component :is="item.icon" />
                </el-icon>
              </span>
              <span>{{ item.label }}</span>
            </button>
          </div>
        </div>
        <div class="cockpit-panel plan-panel">
          <div class="panel-title-row">
            <div class="panel-title">今日生产计划</div>
            <span class="panel-more">{{ todayPlanList.length }}项</span>
          </div>
          <ul class="plan-list">
            <li v-for="item in todayPlanList" :key="item.orderNo" class="plan-item">
              <div class="plan-main">
                <span class="plan-order">{{ item.orderNo }}</span>
                <span class="plan-name">{{ item.productName }}</span>
              </div>
              <div class="plan-meta">
                <span>计划 {{ item.planQty }}</span>
                <span>交期 {{ item.deliveryDate }}</span>
              </div>
            </li>
          </ul>
        </div>
        <div class="cockpit-panel receipt-panel">
          <div class="panel-title">回款与开票分析</div>
          <Echarts
            :options="chartBaseOptions"
            :chartStyle="chartStyle"
            :grid="grid"
            :legend="lineLegend"
            :series="lineSeries"
            :tooltip="tooltipLine"
            :xAxis="xAxis2"
            :yAxis="yAxis2"
            style="height: 300px"
          />
        </div>
      </div>
    </section>
    <el-dialog v-model="processDialogVisible" title="选择工序" width="500px" append-to-body>
      <div class="process-selection-wrapper">
        <el-checkbox-group v-model="tempProcessIds">
@@ -168,105 +332,83 @@
        </span>
      </template>
    </el-dialog>
    <!-- 中部横向两栏 -->
    <div class="dashboard-row">
      <div class="main-panel">
        <div class="section-title">客户合同金额分析</div>
        <div class="contract-summary">
          <div class="contract-info">
            <img src="../assets/images/khtitle.png" alt="" style="width: 42px" />
            <div class="contract-card">
              <div class="contract-name">总合同金额(元)</div>
              <div class="contract-meta">
                <div class="main-amount">{{ sum }}</div>
                <div>周同比: <span class="up">{{ yny }}% </span> 日环比: <span class="up">{{ chain }}% </span></div>
              </div>
            </div>
          </div>
        </div>
        <div
          style="display: flex;align-items: center;gap: 20px;justify-content: space-evenly;height: 180px;margin-top: 20px">
          <div>
            <Echarts ref="chart" :legend="pieLegend" :chartStyle="chartStylePie" :series="materialPieSeries"
              :tooltip="pieTooltip"></Echarts>
          </div>
          <ul class="contract-list">
            <li v-for="item in materialPieSeries[0].data" :key="item.name">
              <div style="display: flex;align-items: center;justify-content: space-between;width: 100%">
                <div class="line" :style="{ color: item.itemStyle.color }">●{{ item.name }}</div>
                <div style="width: 70px">{{ item.rate }}%</div>
                <div>¥{{ item.value }}</div>
              </div>
            </li>
          </ul>
        </div>
      </div>
      <div class="main-panel">
        <div style="display: flex;justify-content: space-between;">
          <div class="section-title">应收应付统计</div>
          <!--                    <el-radio-group v-model="radio1" size="large" @change="statisticsReceivable">-->
          <!--                        <el-radio-button label="按周" :value="1" />-->
          <!--                        <el-radio-button label="按月" :value="2" />-->
          <!--                        <el-radio-button label="按季度" :value="3" />-->
          <!--                    </el-radio-group>-->
        </div>
        <Echarts ref="chart" :color="barColors2" :chartStyle="chartStyle" :grid="grid" :series="barSeries"
          :tooltip="tooltip" :xAxis="xAxis" :yAxis="yAxis" style="height: 260px"></Echarts>
      </div>
    </div>
    <!-- 底部横向两栏 -->
    <div class="dashboard-row">
      <div class="main-panel">
        <div style="display: flex;justify-content: space-between;align-items: center;margin-bottom: 10px;">
          <div class="section-title" style="margin-bottom: 0;">质量统计</div>
          <el-radio-group v-model="qualityRange" size="small" @change="qualityStatisticsInfo">
            <el-radio-button :value="1">周</el-radio-button>
            <el-radio-button :value="2">月</el-radio-button>
            <el-radio-button :value="3">季度</el-radio-button>
          </el-radio-group>
        </div>
        <div class="quality-cards">
          <div class="quality-card one">原材料已检测数 <span>{{ qualityStatisticsObject.supplierNum }}件</span></div>
          <div class="quality-card two">过程检验数量 <span>{{ qualityStatisticsObject.processNum }}件</span></div>
          <div class="quality-card three">出厂已检数量 <span>{{ qualityStatisticsObject.factoryNum }}件</span></div>
        </div>
        <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="barLegend" :series="barSeries1"
          :tooltip="tooltip" :xAxis="xAxis1" :yAxis="yAxis1" style="height: 260px"></Echarts>
      </div>
      <div class="main-panel">
        <div class="section-title">回款与开票分析</div>
        <Echarts ref="invoiceChart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="lineSeries"
          :tooltip="tooltipLine" :xAxis="xAxis2" :yAxis="yAxis2" style="height: 270px;" />
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted, computed, reactive } from 'vue'
import { ref, onMounted, onUnmounted, computed, reactive, watch } from "vue";
import { useRouter } from "vue-router";
import dayjs from "dayjs";
import * as echarts from "echarts";
import {
  Box,
  Calendar,
  Checked,
  DataAnalysis,
  DataLine,
  EditPen,
  Operation,
  Search,
  ShoppingCartFull,
  Tickets,
  Tools,
  UserFilled,
} from "@element-plus/icons-vue";
import Echarts from "@/components/Echarts/echarts.vue";
import * as echarts from 'echarts';
import useUserStore from "@/store/modules/user.js";
import {
  analysisCustomerContractAmounts, getAmountHalfYear,
  analysisCustomerContractAmounts,
  getAmountHalfYear,
  getBusiness,
  homeTodos,
  processDataProductionStatistics,
  qualityInspectionStatistics,
  statisticsReceivablePayable,
  qualityInspectionStatistics
} from "@/api/viewIndex.js";
import { list } from '@/api/productionManagement/productionProcess';
import { list } from "@/api/productionManagement/productionProcess";
const router = useRouter();
const userStore = useUserStore();
const defaultWelcomeAvatar = new URL("../assets/images/profile.jpg", import.meta.url).href;
const userStore = useUserStore()
const nowTime = ref("");
const welcomeAvatarLoadFailed = ref(false);
let clockTimer = null;
const weatherText = "多云 28°C";
const processOptions = ref([])
const selectedProcessIds = ref([])
const tempProcessIds = ref([])
const processDialogVisible = ref(false)
const activeProcessIndex = ref(0)
const nowDate = computed(() => (nowTime.value ? nowTime.value.slice(0, 10) : dayjs().format("YYYY-MM-DD")));
const welcomeAvatar = computed(() =>
  welcomeAvatarLoadFailed.value || !userStore.avatar ? defaultWelcomeAvatar : userStore.avatar
);
const handleWelcomeAvatarError = () => {
  if (welcomeAvatar.value !== defaultWelcomeAvatar) {
    welcomeAvatarLoadFailed.value = true;
  }
};
watch(
  () => userStore.avatar,
  () => {
    welcomeAvatarLoadFailed.value = false;
  }
);
const axisTextColor = "#5f6f86";
const axisLineColor = "rgba(148, 163, 184, 0.45)";
const splitLineColor = "rgba(148, 163, 184, 0.18)";
const chartBaseOptions = reactive({
  backgroundColor: "transparent",
  textStyle: { color: axisTextColor },
});
const processOptions = ref([]);
const selectedProcessIds = ref([]);
const tempProcessIds = ref([]);
const processDialogVisible = ref(false);
const activeProcessIndex = ref(0);
const businessInfo = ref({
  inventoryNum: 0,
@@ -275,988 +417,1689 @@
  monthSaleHaveMoney: 0,
  monthSaleMoney: 0,
  todayInventoryNum: 0,
})
});
const qualityStatisticsObject = ref({
  supplierNum: 0,
  processNum: 0,
  factoryNum: 0,
})
const sum = ref(0)
const yny = ref(0)
const chain = ref(0)
});
const pieLegend = reactive({
  show: false,
})
const sum = ref(0);
const yny = ref(0);
const chain = ref(0);
const pieLegend = reactive({ show: false });
const piePalette = ["#2563eb", "#14b8a6", "#7c3aed", "#f97316", "#38bdf8", "#f43f5e"];
const chartStyle = {
  width: "100%",
  height: "100%",
};
const chartStylePie = {
  width: "100%",
  height: "200px",
};
const grid = {
  left: "3%",
  right: "4%",
  bottom: "2%",
  top: "12%",
  containLabel: true,
};
const tooltip = {
  trigger: "axis",
  axisPointer: { type: "shadow" },
  backgroundColor: "rgba(255, 255, 255, 0.97)",
  borderColor: "rgba(148, 163, 184, 0.26)",
  textStyle: { color: "#334155" },
};
const barColors2 = ["#2563eb", "#14b8a6"];
const xAxis = [
  {
    type: "value",
    axisLine: { lineStyle: { color: axisLineColor } },
    splitLine: { lineStyle: { color: splitLineColor } },
    axisLabel: { color: axisTextColor },
  },
];
const yAxis = [
  {
    type: "category",
    data: ["应付账款", "应收账款"],
    axisTick: { show: false },
    axisLine: { lineStyle: { color: axisLineColor } },
    axisLabel: { color: axisTextColor },
  },
];
const barSeries = ref([
  {
    type: 'bar',
    type: "bar",
    barWidth: 22,
    itemStyle: { borderRadius: [0, 8, 8, 0] },
    label: { show: true, position: "right", color: "#334155" },
    data: [],
    label: {
      show: true,
    }
  },
])
]);
const barLegend = {
  show: true,
  textStyle: { color: axisTextColor },
  data: ["原材料不合格数", "过程不合格数", "出厂不合格数"],
};
const xAxis1 = ref([
  {
    type: "category",
    axisTick: { show: false },
    axisLine: { lineStyle: { color: axisLineColor } },
    axisLabel: { color: axisTextColor },
    data: [],
  },
]);
const yAxis1 = [
  {
    type: "value",
    splitLine: { lineStyle: { color: splitLineColor } },
    axisLine: { lineStyle: { color: axisLineColor } },
    axisLabel: { color: axisTextColor },
  },
];
const barSeries1 = ref([
  {
    name: '原材料不合格数',
    type: 'bar',
    name: "原材料不合格数",
    type: "bar",
    barGap: 0,
    emphasis: {
      focus: 'series'
    },
    data: []
    itemStyle: { color: "#2563eb", borderRadius: [6, 6, 0, 0] },
    emphasis: { focus: "series" },
    data: [],
  },
  {
    name: '过程不合格数',
    type: 'bar',
    emphasis: {
      focus: 'series'
    },
    data: []
    name: "过程不合格数",
    type: "bar",
    itemStyle: { color: "#14b8a6", borderRadius: [6, 6, 0, 0] },
    emphasis: { focus: "series" },
    data: [],
  },
  {
    name: '出厂不合格数',
    type: 'bar',
    emphasis: {
      focus: 'series'
    },
    data: []
    name: "出厂不合格数",
    type: "bar",
    itemStyle: { color: "#f59e0b", borderRadius: [6, 6, 0, 0] },
    emphasis: { focus: "series" },
    data: [],
  },
])
const chartStyle = {
  width: '100%',
  height: '100%' // 设置图表容器的高度
}
const chartStylePie = {
  width: '140%',
  height: '140%' // 设置图表容器的高度
}
const grid = {
  left: '3%',
  right: '4%',
  bottom: '3%',
  containLabel: true
}
const barLegend = {
  show: true,
  data: ['原材料不合格数', '过程不合格数', '出厂不合格数']
}
const barLegend1 = {
  show: true,
  data: ['预付账款', '应付账款', '预收账款', '应收账款']
}
]);
const lineLegend = {
  show: true,
  data: ['开票', '回款']
}
const tooltip = {
  trigger: 'axis',
  axisPointer: {
    type: 'shadow'
  }
}
const xAxis = [{
  type: 'value',
}]
const xAxis1 = ref([{
  type: 'category',
  axisTick: { show: false },
  data: []
}])
const yAxis = [{
  type: 'category',
  data: ['应付账款', '应收账款',]
}]
const yAxis1 = [{
  type: 'value'
}]
const pieTooltip = reactive({
  trigger: 'item',
  formatter: function (params) {
    // 动态生成提示信息,基于数据项的 name 属性
    const description = params.name === '本月回款金额' ? '本月回款金额' : '应收款金额';
    return `${description} ${formatNumber(params.value)}元 ${params.percent}%`;
  },
  position: 'right'
})
const materialPieSeries = ref([
  {
    type: 'pie',
    radius: ['66%', '90%'],
    avoidLabelOverlap: false,
    itemStyle: {
      borderColor: '#fff',
      borderWidth: 2
    },
    label: {
      show: false
    },
    data: []
  }
])
const lineSeries = ref([
  {
    type: 'line',
    data: [],
    label: {
      show: true
    },
    showSymbol: true, // 显示圆点
  },
])
const tooltipLine = {
  trigger: 'axis',
}
const yAxis2 = ref([
  {
    type: 'value',
  }
])
  textStyle: { color: axisTextColor },
  data: ["开票", "回款"],
};
const xAxis2 = ref([
  {
    type: 'category',
    type: "category",
    data: [],
    axisLine: { lineStyle: { color: axisLineColor } },
    axisLabel: {
      color: axisTextColor,
      interval: 0,
      formatter: function (value) {
        return value.replace(/~/g, '\n');
      },
    }
  }
])
// 待办事项
const todoList = ref([])
const radio1 = ref(1)
const qualityRange = ref(1)
// 图表引用
const barChart = ref(null)
const lineChart = ref(null)
const barColors2 = ['#5181DB', '#D369E0', '#F2CA6D', '#60CCA8']
// 随机颜色生成函数
const getRandomColor = () => {
  return '#' + Math.floor(Math.random() * 0xffffff).toString(16).padStart(6, '0');
}
onMounted(() => {
  getBusinessData()
  analysisCustomer()
  todoInfoS()
  statisticsReceivable()
  qualityStatisticsInfo()
  getAmountHalfYearNum()
  getProcessList()
})
// 数据统计
const getBusinessData = () => {
  getBusiness().then((res) => {
    businessInfo.value = { ...res.data }
  })
}
// 合同金额
const analysisCustomer = () => {
  analysisCustomerContractAmounts().then((res) => {
    sum.value = res.data.sum
    yny.value = res.data.yny
    chain.value = res.data.chain
    // 为每个数据项分配随机颜色
    materialPieSeries.value[0].data = res.data.item.map(item => ({
      ...item,
      itemStyle: { color: getRandomColor() }
    }))
  })
}
// 待办事项
const todoInfoS = () => {
  homeTodos().then((res) => {
    todoList.value = res.data
  })
}
// 获取工序列表
const getProcessList = () => {
  list().then(res => {
    processOptions.value = res.data.records
  })
}
const openProcessDialog = () => {
  tempProcessIds.value = [...selectedProcessIds.value]
  processDialogVisible.value = true
}
const handleProcessDialogConfirm = () => {
  selectedProcessIds.value = [...tempProcessIds.value]
  processDialogVisible.value = false
  refreshProcessStats()
}
const resetProcessFilter = () => {
  selectedProcessIds.value = []
  tempProcessIds.value = []
  refreshProcessStats()
}
const handleChartClick = (params) => {
  if (params && params.dataIndex !== undefined) {
    activeProcessIndex.value = params.dataIndex
  }
}
// 应付应收统计
const statisticsReceivable = () => {
  statisticsReceivablePayable({ type: radio1.value }).then((res) => {
    barSeries.value[0].data = [
      // { value: res.data.prepayMoney, itemStyle: { color: barColors2[0] } },
      { value: res.data.payableMoney, itemStyle: { color: barColors2[0] } },
      // { value: res.data.advanceMoney, itemStyle: { color: barColors2[2] } },
      { value: res.data.receivableMoney, itemStyle: { color: barColors2[1] } }
    ]
  })
}
// 质检统计
const qualityStatisticsInfo = () => {
  qualityInspectionStatistics({ type: qualityRange.value }).then((res) => {
    xAxis1.value[0].data = []
    barSeries1.value[0].data = []
    barSeries1.value[1].data = []
    barSeries1.value[2].data = []
    res.data.item.forEach(item => {
      xAxis1.value[0].data.push(item.date)
      barSeries1.value[0].data.push(item.supplierNum)
      barSeries1.value[1].data.push(item.processNum)
      barSeries1.value[2].data.push(item.factoryNum)
    })
    qualityStatisticsObject.value.supplierNum = res.data.supplierNum
    qualityStatisticsObject.value.processNum = res.data.processNum
    qualityStatisticsObject.value.factoryNum = res.data.factoryNum
  })
}
const getAmountHalfYearNum = async () => {
  const res = await getAmountHalfYear()
  console.log(res)
  const monthName = []
  const receiptAmount = []
  const invoiceAmount = []
  res.data.forEach(item => {
    monthName.push(item.month)
    receiptAmount.push(item.receiptAmount)
    invoiceAmount.push(item.invoiceAmount)
  })
  // 正确响应式赋值:创建新的 xAxis 和 series 对象
  xAxis2.value[0].data = monthName
  xAxis2.value[0].data = monthName.map(item => item.replace(/~/g, '\n~'));
  lineSeries.value = [
    {
      name: '开票',
      type: 'line',
      data: invoiceAmount,
      stack: 'Total',
      areaStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'rgba(131, 207, 255, 1)'
          },
          {
            offset: 1,
            color: 'rgba(186, 228, 255, 1)'
          }
        ])
      },
      itemStyle: {
        color: '#2D99FF',
        borderColor: '#2D99FF'
      },
      emphasis: {
        focus: 'series'
      },
      lineStyle: {
        width: 0
      },
      showSymbol: true,
      formatter: (value) => value.replace(/~/g, "\n"),
    },
    {
      name: '回款',
      type: 'line',
      data: receiptAmount,
      stack: 'Total',
      lineStyle: {
        width: 0
      },
      itemStyle: {
        color: '#83CFFF',
        borderColor: '#83CFFF'
      },
      showSymbol: true,
      areaStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          {
            offset: 0,
            color: 'rgba(54, 153, 255, 1)'
          },
          {
            offset: 1,
            color: 'rgba(89, 169, 254, 1)'
          }
        ])
      },
      emphasis: {
        focus: 'series'
      },
    }
  ]
}
  },
]);
// 工序数据生产统计明细(假数据 + 图表)
const processRange = ref(1)
const processChartData = ref([])
const yAxis2 = ref([
  {
    type: "value",
    splitLine: { lineStyle: { color: splitLineColor } },
    axisLine: { lineStyle: { color: axisLineColor } },
    axisLabel: { color: axisTextColor },
  },
]);
const tooltipLine = {
  trigger: "axis",
  backgroundColor: "rgba(255, 255, 255, 0.97)",
  borderColor: "rgba(148, 163, 184, 0.26)",
  textStyle: { color: "#334155" },
};
const lineSeries = ref([
  {
    name: "开票",
    type: "line",
    data: [],
    smooth: true,
    itemStyle: { color: "#2563eb" },
    lineStyle: { width: 2, color: "#2563eb" },
    showSymbol: true,
    areaStyle: {
      color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        { offset: 0, color: "rgba(37, 99, 235, 0.24)" },
        { offset: 1, color: "rgba(37, 99, 235, 0.02)" },
      ]),
    },
  },
  {
    name: "回款",
    type: "line",
    data: [],
    smooth: true,
    itemStyle: { color: "#14b8a6" },
    lineStyle: { width: 2, color: "#14b8a6" },
    showSymbol: true,
    areaStyle: {
      color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
        { offset: 0, color: "rgba(20, 184, 166, 0.2)" },
        { offset: 1, color: "rgba(20, 184, 166, 0.02)" },
      ]),
    },
  },
]);
const pieTooltip = reactive({
  trigger: "item",
  backgroundColor: "rgba(255, 255, 255, 0.97)",
  borderColor: "rgba(148, 163, 184, 0.26)",
  textStyle: { color: "#334155" },
  formatter: (params) => `${params.name} ${formatNumber(params.value)}元 ${params.percent}%`,
});
const materialPieSeries = ref([
  {
    type: "pie",
    radius: ["62%", "88%"],
    avoidLabelOverlap: false,
    itemStyle: {
      borderColor: "rgba(255, 255, 255, 0.95)",
      borderWidth: 2,
    },
    label: { show: false },
    data: [],
  },
]);
const todoList = ref([]);
const qualityRange = ref(1);
const processRange = ref(1);
const processChartData = ref([]);
const processXAxis = ref([
  {
    nameTextStyle: { color: 'rgba(0,0,0,0.35)', fontSize: 12 },
    axisLabel: { color: 'rgba(0,0,0,0.35)' },
    splitLine: { lineStyle: { color: 'rgba(0,0,0,0.06)', type: 'dashed' } },
    type: "value",
    axisLine: { lineStyle: { color: axisLineColor } },
    splitLine: { lineStyle: { color: splitLineColor, type: "dashed" } },
    axisLabel: { color: axisTextColor },
  },
])
]);
const processYAxis = ref([
  {
    type: 'category',
    type: "category",
    axisTick: { show: false },
    axisLine: { show: false },
    axisLabel: { color: 'rgba(0,0,0,0.45)' },
    axisLabel: { color: axisTextColor },
    data: [],
  },
])
]);
const processGrid = reactive({ left: 0, right: 100, top: 30, bottom: 20, containLabel: true })
const processGrid = reactive({ left: "4%", right: "4%", top: 20, bottom: 18, containLabel: true });
const processTooltip = reactive({
  trigger: 'axis',
  axisPointer: { type: 'shadow' },
  trigger: "axis",
  axisPointer: { type: "shadow" },
  backgroundColor: "rgba(255, 255, 255, 0.97)",
  borderColor: "rgba(148, 163, 184, 0.26)",
  textStyle: { color: "#334155" },
  formatter: (params) => {
    const name = params?.[0]?.name ?? ''
    const list = Array.isArray(params) ? params : []
    const name = params?.[0]?.name ?? "";
    const list = Array.isArray(params) ? params : [];
    const lines = list
      .map((p) => {
        const colorBox = `<span style="display:inline-block;margin-right:6px;border-radius:2px;width:10px;height:10px;background:${p.color}"></span>`
        return `${colorBox}${p.seriesName} <b style="float:right;">${Number(p.value || 0).toFixed(2)}</b>`
        const colorBox = `<span style="display:inline-block;margin-right:6px;border-radius:2px;width:10px;height:10px;background:${p.color}"></span>`;
        return `${colorBox}${p.seriesName}<b style="float:right;">${Number(p.value || 0).toFixed(2)}</b>`;
      })
      .join('<br/>')
    return `<div style="min-width:140px;"><div style="font-weight:700;margin-bottom:6px;">${name}</div>${lines}</div>`
      .join("<br/>");
    return `<div style="min-width:140px;"><div style="font-weight:700;margin-bottom:6px;">${name}</div>${lines}</div>`;
  },
})
});
const processSeries = computed(() => {
  const input = processChartData.value.map((i) => i.input)
  const scrap = processChartData.value.map((i) => i.scrap)
  const output = processChartData.value.map((i) => i.output)
  const input = processChartData.value.map((item) => item.input);
  const scrap = processChartData.value.map((item) => item.scrap);
  const output = processChartData.value.map((item) => item.output);
  return [
    {
      name: '投入量',
      type: 'bar',
      stack: 'total',
      barWidth: 22,
      itemStyle: { color: '#1E5BFF', borderRadius: [6, 0, 0, 6] },
      name: "投入量",
      type: "bar",
      stack: "total",
      barWidth: 18,
      itemStyle: { color: "#2563eb", borderRadius: [8, 0, 0, 8] },
      data: input,
    },
    {
      name: '报废量',
      type: 'bar',
      stack: 'total',
      barWidth: 22,
      itemStyle: { color: '#F7B500' },
      name: "报废量",
      type: "bar",
      stack: "total",
      barWidth: 18,
      itemStyle: { color: "#f59e0b" },
      data: scrap,
    },
    {
      name: '产出量',
      type: 'bar',
      stack: 'total',
      barWidth: 22,
      itemStyle: { color: '#19C6C6', borderRadius: [0, 6, 6, 0] },
      name: "产出量",
      type: "bar",
      stack: "total",
      barWidth: 18,
      itemStyle: { color: "#14b8a6", borderRadius: [0, 8, 8, 0] },
      data: output,
    },
  ]
})
  ];
});
const processAside = computed(() => {
  const list = processChartData.value
  const item = list[activeProcessIndex.value] || {}
  const listData = processChartData.value;
  const item = listData[activeProcessIndex.value] || {};
  return {
    processName: item.name || '暂无数据',
    processName: item.name || "暂无数据",
    totalInput: item.input || 0,
    totalScrap: item.scrap || 0,
    totalOutput: item.output || 0,
  }
})
  };
});
const formatAmount = (n) => {
  const num = Number(n || 0)
  return num.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
}
const processTotals = computed(() =>
  processChartData.value.reduce(
    (acc, cur) => {
      acc.input += Number(cur.input || 0);
      acc.scrap += Number(cur.scrap || 0);
      acc.output += Number(cur.output || 0);
      return acc;
    },
    { input: 0, scrap: 0, output: 0 }
  )
);
const refreshProcessStats = () => {
  processDataProductionStatistics({
const hasProcessData = computed(() => {
  if (!processChartData.value.length) return false;
  return processChartData.value.some((item) => {
    const input = Number(item.input || 0);
    const scrap = Number(item.scrap || 0);
    const output = Number(item.output || 0);
    return input > 0 || scrap > 0 || output > 0;
  });
});
const dashboardCards = computed(() => [
  {
    key: "sales",
    title: "销售数据",
    desc: "本月销售额(元)",
    value: formatNumber(businessInfo.value.monthSaleMoney),
    subLabel: "未开票金额",
    subValue: formatNumber(businessInfo.value.monthSaleHaveMoney),
    trend: `占比 ${ratioText(businessInfo.value.monthSaleHaveMoney, businessInfo.value.monthSaleMoney)}`,
    icon: DataLine,
  },
  {
    key: "purchase",
    title: "采购数据",
    desc: "本月采购额(元)",
    value: formatNumber(businessInfo.value.monthPurchaseMoney),
    subLabel: "待付款金额",
    subValue: formatNumber(businessInfo.value.monthPurchaseHaveMoney),
    trend: `占比 ${ratioText(
      businessInfo.value.monthPurchaseHaveMoney,
      businessInfo.value.monthPurchaseMoney
    )}`,
    icon: ShoppingCartFull,
  },
  {
    key: "inventory",
    title: "库存数据",
    desc: "当前库存总量(件)",
    value: formatNumber(businessInfo.value.inventoryNum),
    subLabel: "今日入库",
    subValue: formatNumber(businessInfo.value.todayInventoryNum),
    trend: "库存结构持续优化",
    icon: Box,
  },
  {
    key: "production",
    title: "生产总览",
    desc: "累计产出(件)",
    value: formatNumber(processTotals.value.output),
    subLabel: "累计报废",
    subValue: formatNumber(processTotals.value.scrap),
    trend: `良率 ${ratioText(processTotals.value.output, processTotals.value.input)}`,
    icon: Operation,
  },
]);
const productionOrders = ref([
  {
    orderNo: "MO-20260518-001",
    productName: "智能控制器",
    planQty: 1000,
    completedQty: 860,
    completionRate: 86,
    deliveryDate: "2026-05-20",
    status: "in_progress",
  },
  {
    orderNo: "MO-20260518-002",
    productName: "电源模块",
    planQty: 800,
    completedQty: 640,
    completionRate: 80,
    deliveryDate: "2026-05-22",
    status: "in_progress",
  },
  {
    orderNo: "MO-20260518-003",
    productName: "传感器组件",
    planQty: 500,
    completedQty: 150,
    completionRate: 30,
    deliveryDate: "2026-05-25",
    status: "paused",
  },
  {
    orderNo: "MO-20260518-004",
    productName: "结构件A",
    planQty: 1200,
    completedQty: 1200,
    completionRate: 100,
    deliveryDate: "2026-05-15",
    status: "completed",
  },
]);
const orderFilter = ref("all");
const filteredOrders = computed(() => {
  if (orderFilter.value === "all") return productionOrders.value;
  return productionOrders.value.filter((item) => item.status === orderFilter.value);
});
const todayPlanList = computed(() =>
  productionOrders.value
    .slice()
    .sort((a, b) => dayjs(a.deliveryDate).valueOf() - dayjs(b.deliveryDate).valueOf())
    .slice(0, 5)
);
const avgCompletionRate = computed(() => {
  if (!productionOrders.value.length) return 0;
  const total = productionOrders.value.reduce((acc, cur) => acc + Number(cur.completionRate || 0), 0);
  return Number((total / productionOrders.value.length).toFixed(1));
});
const realtimeBoard = computed(() => {
  const oee = ratioNumber(processTotals.value.output, processTotals.value.input);
  const defectRate = ratioNumber(processTotals.value.scrap, processTotals.value.input);
  return [
    {
      key: "oee",
      label: "设备 OEE",
      percent: clampPercent(oee),
      display: `${oee.toFixed(1)}%`,
      delta: "较昨日 ↑ 4.0%",
      trend: "up",
      color: "#2d8cff",
    },
    {
      key: "order",
      label: "订单达成率",
      percent: clampPercent(avgCompletionRate.value),
      display: `${avgCompletionRate.value.toFixed(1)}%`,
      delta: "较昨日 ↑ 2.6%",
      trend: "up",
      color: "#31d2ff",
    },
    {
      key: "defect",
      label: "不良率",
      percent: clampPercent(defectRate),
      display: `${defectRate.toFixed(1)}%`,
      delta: "较昨日 ↓ 0.5%",
      trend: "down",
      color: "#f6a23f",
    },
  ];
});
const warningList = ref([
  {
    id: 1,
    level: "device",
    title: "设备预警",
    desc: "CNC-001 设备振动异常",
    time: "10:24:32",
  },
  {
    id: 2,
    level: "quality",
    title: "质量预警",
    desc: "订单 SO-20260517 不良率超标",
    time: "09:15:47",
  },
  {
    id: 3,
    level: "material",
    title: "物料预警",
    desc: "物料 1002001 库存不足",
    time: "08:47:21",
  },
]);
const quickEntries = [
  { label: "生产排产", icon: Calendar, path: "/productionManagement/productionDispatching" },
  { label: "工序报工", icon: EditPen, path: "/productionManagement/productionReporting" },
  { label: "生产订单", icon: Tickets, path: "/productionManagement/productionOrder" },
  { label: "物料齐套", icon: Box, path: "/productionManagement/workOrderManagement" },
  { label: "质量检验", icon: Checked, path: "/qualityManagement/processInspection" },
  { label: "设备管理", icon: Tools, path: "/equipmentManagement/deviceInfo" },
  { label: "库存查询", icon: Search, path: "/inventoryManagement/stockManage" },
  { label: "数据报表", icon: DataAnalysis, path: "/reportAnalysis/reportManagement" },
];
const updateNowTime = () => {
  nowTime.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
};
const formatNumber = (value) => {
  const num = Number(value || 0);
  return num.toLocaleString(undefined, {
    minimumFractionDigits: 2,
    maximumFractionDigits: 2,
  });
};
const formatAmount = (value) => {
  const num = Number(value || 0);
  return num.toLocaleString(undefined, {
    minimumFractionDigits: 2,
    maximumFractionDigits: 2,
  });
};
const trendText = (value) => {
  const num = Number(value || 0);
  const flag = num >= 0 ? "↑" : "↓";
  return `${flag} ${Math.abs(num).toFixed(1)}%`;
};
const ratioNumber = (numerator, denominator) => {
  const n = Number(numerator || 0);
  const d = Number(denominator || 0);
  if (!d) return 0;
  return (n / d) * 100;
};
const ratioText = (numerator, denominator) => `${ratioNumber(numerator, denominator).toFixed(1)}%`;
const clampPercent = (val) => Math.max(0, Math.min(100, Number(val || 0)));
const getOrderStatusText = (status) => {
  const mapping = {
    in_progress: "进行中",
    completed: "已完成",
    paused: "暂停",
  };
  return mapping[status] || "未知";
};
const getOrderStatusType = (status) => {
  const mapping = {
    in_progress: "success",
    completed: "primary",
    paused: "warning",
  };
  return mapping[status] || "info";
};
const getBusinessData = async () => {
  const res = await getBusiness();
  businessInfo.value = { ...res.data };
};
const analysisCustomer = async () => {
  const res = await analysisCustomerContractAmounts();
  sum.value = res.data.sum;
  yny.value = res.data.yny;
  chain.value = res.data.chain;
  materialPieSeries.value[0].data = (res.data.item || []).map((item, index) => ({
    ...item,
    rate: Number(item.rate || 0),
    itemStyle: { color: piePalette[index % piePalette.length] },
  }));
};
const todoInfoS = async () => {
  const res = await homeTodos();
  todoList.value = res.data || [];
};
const statisticsReceivable = async () => {
  const res = await statisticsReceivablePayable({ type: 1 });
  barSeries.value[0].data = [
    { value: res.data.payableMoney, itemStyle: { color: barColors2[0] } },
    { value: res.data.receivableMoney, itemStyle: { color: barColors2[1] } },
  ];
};
const qualityStatisticsInfo = async () => {
  const res = await qualityInspectionStatistics({ type: qualityRange.value });
  xAxis1.value[0].data = [];
  barSeries1.value[0].data = [];
  barSeries1.value[1].data = [];
  barSeries1.value[2].data = [];
  (res.data.item || []).forEach((item) => {
    xAxis1.value[0].data.push(item.date);
    barSeries1.value[0].data.push(item.supplierNum);
    barSeries1.value[1].data.push(item.processNum);
    barSeries1.value[2].data.push(item.factoryNum);
  });
  qualityStatisticsObject.value.supplierNum = res.data.supplierNum;
  qualityStatisticsObject.value.processNum = res.data.processNum;
  qualityStatisticsObject.value.factoryNum = res.data.factoryNum;
};
const getAmountHalfYearNum = async () => {
  const res = await getAmountHalfYear();
  const monthName = [];
  const receiptAmount = [];
  const invoiceAmount = [];
  (res.data || []).forEach((item) => {
    monthName.push(item.month);
    receiptAmount.push(item.receiptAmount);
    invoiceAmount.push(item.invoiceAmount);
  });
  xAxis2.value[0].data = monthName.map((item) => item.replace(/~/g, "\n~"));
  lineSeries.value[0].data = invoiceAmount;
  lineSeries.value[1].data = receiptAmount;
};
const getProcessList = async () => {
  const res = await list();
  processOptions.value = res.data.records || [];
};
const refreshProcessStats = async () => {
  const res = await processDataProductionStatistics({
    type: processRange.value,
    processIds: selectedProcessIds.value.length > 0 ? selectedProcessIds.value.join(',') : null
  }).then(res => {
    processChartData.value = res.data.map(item => ({
      name: item.processName,
      input: item.totalInput,
      scrap: item.totalScrap,
      output: item.totalOutput
    }))
    processYAxis.value[0].data = processChartData.value.map((i) => i.name)
    activeProcessIndex.value = 0
  })
}
    processIds: selectedProcessIds.value.length > 0 ? selectedProcessIds.value.join(",") : null,
  });
  processChartData.value = (res.data || []).map((item) => ({
    name: item.processName,
    input: item.totalInput,
    scrap: item.totalScrap,
    output: item.totalOutput,
  }));
  processYAxis.value[0].data = processChartData.value.map((item) => item.name);
  activeProcessIndex.value = 0;
};
const openProcessDialog = () => {
  tempProcessIds.value = [...selectedProcessIds.value];
  processDialogVisible.value = true;
};
const handleProcessDialogConfirm = () => {
  selectedProcessIds.value = [...tempProcessIds.value];
  processDialogVisible.value = false;
  refreshProcessStats();
};
const resetProcessFilter = () => {
  selectedProcessIds.value = [];
  tempProcessIds.value = [];
  refreshProcessStats();
};
const handleChartClick = (params) => {
  if (params && params.dataIndex !== undefined) {
    activeProcessIndex.value = params.dataIndex;
  }
};
const goToQuick = (path) => {
  router.push(path).catch(() => {});
};
onMounted(() => {
  getBusinessData()
  analysisCustomer()
  todoInfoS()
  statisticsReceivable()
  qualityStatisticsInfo()
  getAmountHalfYearNum()
  refreshProcessStats()
})
  updateNowTime();
  clockTimer = setInterval(updateNowTime, 1000);
  getBusinessData();
  analysisCustomer();
  todoInfoS();
  statisticsReceivable();
  qualityStatisticsInfo();
  getAmountHalfYearNum();
  getProcessList();
  refreshProcessStats();
});
onUnmounted(() => {
  if (clockTimer) {
    clearInterval(clockTimer);
  }
});
</script>
<style scoped>
.dashboard {
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}
.dashboard-top {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
  justify-content: space-evenly;
}
.company-info {
.dashboard-cockpit {
  min-height: calc(100vh - var(--topbar-height) - var(--tagsbar-height));
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-x: clip;
}
.welcome-banner {
  padding: 10px 10px;
  background: linear-gradient(135deg, rgba(229, 240, 255, 0.9), rgba(214, 232, 255, 0.7), rgba(207, 236, 255, 0.9));
.digital-number {
  font-family: "DIN Alternate Bold", "Segoe UI", "PingFang SC", sans-serif;
  letter-spacing: 0;
}
.welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  line-height: 1.3;
.cockpit-panel {
  position: relative;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(12px);
  padding: 16px;
}
.welcome-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  padding: 18px 22px;
  background:
    radial-gradient(circle at 8% 20%, rgba(59, 130, 246, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88));
}
.welcome-user {
  margin-right: 6px;
}
.welcome-time {
  margin-top: 10px;
  font-size: 16px;
  color: rgba(0, 0, 0, 0.55);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
}
.user-card-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.user-name {
  font-size: 16px;
  font-weight: bold;
  color: #111;
  letter-spacing: 1px;
}
.user-role {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 5px 10px;
  background: rgba(245, 246, 248, 1);
  color: #333;
  width: fit-content;
  font-weight: 600;
}
.user-meta {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-meta .sep {
  margin: 0 10px;
  color: rgba(0, 0, 0, 0.25);
  gap: 12px;
}
.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(147, 197, 253, 0.42);
  background: linear-gradient(145deg, #ffffff, #eef5ff);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.14);
}
.avatar :deep(img) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex: 0 0 auto;
}
.data-cards {
  width: 50%;
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
.avatar :deep(.el-icon) {
  font-size: 24px;
  color: #3b82f6;
}
.data-title {
.welcome-title {
  font-size: 28px;
  font-weight: 700;
  font-size: 26px;
  color: #FFFFFF;
  color: #1e3a5f;
  line-height: 1.08;
}
.data-num {
.welcome-subtitle {
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
}
.welcome-meta {
  text-align: right;
}
.meta-time {
  font-size: 28px;
  color: #1f3658;
  font-weight: 700;
}
.meta-extra {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  color: #64748b;
  font-size: 13px;
}
.meta-tip {
  margin-top: 4px;
  color: #7a8ca6;
  font-size: 13px;
}
.top-row {
  display: block;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat-card {
  position: relative;
  border-radius: 18px;
  padding: 18px 20px 22px;
  min-height: 182px;
  height: auto;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.1);
}
.stat-card.sales {
  background: linear-gradient(135deg, #ffffff 0%, #eaf3ff 100%);
}
.stat-card.purchase {
  background: linear-gradient(135deg, #ffffff 0%, #e8fffb 100%);
}
.stat-card.inventory {
  background: linear-gradient(135deg, #ffffff 0%, #f2edff 100%);
}
.stat-card.production {
  background: linear-gradient(135deg, #ffffff 0%, #fff4e6 100%);
}
.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}
.stat-title {
  font-size: 16px;
  font-weight: 700;
}
.stat-card.sales .stat-title {
  color: #1d4ed8;
}
.stat-card.purchase .stat-title {
  color: #0f766e;
}
.stat-card.inventory .stat-title {
  color: #6d28d9;
}
.stat-card.production .stat-title {
  color: #c2410c;
}
.stat-desc {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}
.stat-icon-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}
.data-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 10px 10px 10px;
  min-width: 160px;
  box-shadow: 0 2px 8px #eee;
  display: flex;
  flex-direction: column;
  width: 32%;
  height: 140px;
.stat-card.sales .stat-icon-orb {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.32);
}
.data-card.sales {
  background-image: url("../assets/images/xioashoushuju.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
.stat-card.purchase .stat-icon-orb {
  background: linear-gradient(135deg, #14b8a6, #5eead4);
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.3);
}
.data-card.purchase {
  background-image: url("../assets/images/caigou.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
.stat-card.inventory .stat-icon-orb {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
}
.data-card.inventory {
  background-image: url("../assets/images/kucun.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
.stat-card.production .stat-icon-orb {
  background: linear-gradient(135deg, #f97316, #fdba74);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.3);
}
.data-desc {
  font-weight: 500;
.stat-value {
  margin-top: 14px;
  font-size: 30px;
  line-height: 1.08;
  font-weight: 700;
  color: #0f172a;
  position: relative;
  z-index: 2;
}
.stat-footer {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  color: #FFFFFF;
}
.data-value {
  font-size: 18px;
  font-weight: 500;
  margin: 10px 0;
  color: #FFFFFF;
}
.top-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 180px;
  width: 20%;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}
.stat-trend {
  margin-top: 6px;
  color: #0ea5a4;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 600;
  position: relative;
  z-index: 2;
}
.stat-wave {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: 30px;
  opacity: 0.62;
  z-index: 1;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 340 40' preserveAspectRatio='none'%3E%3Cpath d='M0 31C20 16 44 36 66 24C87 12 107 31 129 18C148 8 169 28 193 16C214 5 237 25 259 14C280 3 306 19 340 8' fill='none' stroke='%236ea4ee' stroke-width='1.5'/%3E%3C/svg%3E")
      center / 100% 100% no-repeat;
}
.todo-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  height: 180px;
  width: 30%;
  padding: 12px;
}
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f3658;
  position: relative;
  padding-left: 12px;
}
.panel-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2563eb, #38bdf8);
}
.panel-more {
  font-size: 14px;
  color: #2563eb;
  cursor: pointer;
}
.todo-list {
  height: 100px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  margin: 0;
  font-size: 15px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
}
.todo-list li {
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 8px 20px;
  height: 74px;
.todo-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f7fbff;
  padding: 10px 12px;
}
.todo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(225, 227, 250, 0.62);
}
.todo-title {
  font-weight: 400;
  font-size: 12px;
  color: #000000;
  position: relative;
}
.todo-title::before {
  content: '';
  /* 必需,表示这里有一个内容 */
  position: absolute;
  left: -10px;
  /* 定位到左侧 */
  top: 50%;
  /* 垂直居中 */
  transform: translateY(-50%);
  /* 微调垂直居中 */
  width: 6px;
  /* 圆的直径 */
  height: 6px;
  /* 圆的直径 */
  background: #498CEB;
  border-radius: 50%;
  /* 让其变成圆形 */
}
.todo-division {
  font-weight: 400;
  font-size: 12px;
  color: #000000;
}
.todo-time {
  font-weight: 400;
  font-size: 12px;
  color: #000000;
}
.todo-meta {
  color: #888;
  gap: 10px;
  color: #334155;
  font-size: 13px;
}
.dashboard-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
.main-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.section-title {
  position: relative;
  font-size: 18px;
  color: #333;
  padding-left: 10px;
  margin-bottom: 10px;
  font-weight: 700;
}
.section-title::before {
  position: absolute;
  left: 0;
  top: 4px;
  content: '';
  width: 4px;
  height: 18px;
  background-color: #002FA7;
  border-radius: 2px;
}
.contract-info {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 90px;
  background: rgba(245, 245, 245, 0.59);
  width: 100%;
  border-radius: 10px;
  padding: 10px 30px;
}
.contract-summary {
  display: flex;
  align-items: center;
  gap: 30px;
}
.contract-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contract-name {
  font-weight: 400;
  font-size: 14px;
  color: #050505;
}
.contract-meta {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 80px;
}
.main-amount {
  font-size: 24px;
  color: rgba(51, 50, 50, 0.85);
}
.up {
  color: #e57373;
}
.contract-list {
  margin-top: 16px;
  font-size: 14px;
  color: #666;
  list-style: none;
  padding: 0;
  height: 190px;
  overflow-y: auto;
  width: 460px;
}
.line {
  position: relative;
  width: 230px;
}
.line::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #C9C5C5;
  border-radius: 2px;
}
.contract-list li {
  margin-top: 10px;
}
.quality-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.quality-card {
  border-radius: 8px;
  padding: 15px 10px 10px 50px;
  font-weight: 400;
.todo-desc {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.67);
  width: 236px;
  height: 49px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  line-height: 1.45;
}
.quality-card.one {
  background-image: url("../assets/images/yuancailiao.png");
.todo-no {
  color: #1f3658;
  font-weight: 600;
}
.quality-card.two {
  background-image: url("../assets/images/guocheng.png");
.panel-empty {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.quality-card.three {
  background-image: url("../assets/images/chuchang.png");
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
}
.quality-card span {
  color: #4fc3f7;
  font-weight: bold;
  margin-left: 6px;
}
.chart {
  width: 100%;
  height: 220px;
  margin-top: 10px;
.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.process-panel {
  padding-bottom: 10px;
  padding-bottom: 12px;
}
.process-panel__header {
.panel-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.process-panel__body {
  display: flex;
  gap: 24px;
  align-items: stretch;
.process-body {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
}
.process-panel__chart {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
.process-chart {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 249, 255, 0.9)),
    repeating-linear-gradient(
      to right,
      rgba(148, 163, 184, 0.07) 0,
      rgba(148, 163, 184, 0.07) 1px,
      transparent 1px,
      transparent 48px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(148, 163, 184, 0.06) 0,
      rgba(148, 163, 184, 0.06) 1px,
      transparent 1px,
      transparent 34px
    );
  overflow: hidden;
  padding: 10px;
}
.process-panel__aside {
  width: 260px;
.process-chart.empty :deep(canvas) {
  opacity: 0.2;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
  text-align: center;
  pointer-events: auto;
  padding: 12px;
}
.chart-empty .el-icon {
  color: #2563eb;
  font-size: 28px;
}
.chart-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
}
.chart-empty-desc {
  font-size: 13px;
  color: #64748b;
}
.chart-empty-actions {
  margin-top: 4px;
  display: flex;
  gap: 8px;
}
.process-aside {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.process-legend,
.process-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  padding: 10px 12px;
}
.process-card {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.process-legend {
  min-height: 74px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 6px;
  gap: 6px;
  justify-content: center;
}
.process-legend__item {
.process-legend-item {
  color: #475569;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border-radius: 3px;
  display: inline-block;
}
.dot-blue {
  background: #1E5BFF;
  background: #2563eb;
}
.dot-yellow {
  background: #F7B500;
.dot-orange {
  background: #f59e0b;
}
.dot-teal {
  background: #19C6C6;
.dot-cyan {
  background: #14b8a6;
}
.process-card {
  background: rgba(245, 247, 250, 0.9);
  border-radius: 10px;
  padding: 16px 16px;
}
.process-card--name {
  background: rgba(235, 242, 255, 1);
  color: #1E5BFF;
  font-weight: 800;
.process-name {
  color: #2563eb;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-bottom: 2px;
}
.process-card__label {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 10px;
}
.process-card__value {
  font-size: 24px;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.8);
}
.process-card__value .unit {
.process-label {
  font-size: 12px;
  color: #64748b;
}
.process-value {
  margin-top: 4px;
  font-size: 24px;
  color: #0f172a;
  font-weight: 700;
}
.chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.contract-summary {
  display: grid;
  grid-template-columns: 1fr 190px;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.contract-card {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #f8fbff;
  padding: 12px;
}
.contract-name {
  color: #64748b;
  font-size: 13px;
}
.contract-main {
  margin-top: 8px;
  font-size: 34px;
  font-weight: 700;
  color: #0f172a;
}
.contract-compare {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
  display: flex;
  gap: 10px;
}
.rise {
  color: #0ea5a4;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.45);
}
.contract-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contract-list li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) 56px auto;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 13px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.contract-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contract-item-rate {
  text-align: right;
  color: #64748b;
}
.contract-item-value {
  color: #1f3658;
  text-align: right;
}
.quality-cards {
  margin: 8px 0 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.quality-card {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 10px 12px;
  color: #475569;
  font-size: 13px;
}
.quality-card.one {
  background: linear-gradient(135deg, #ffffff, #edf4ff);
}
.quality-card.two {
  background: linear-gradient(135deg, #ffffff, #ebfffc);
}
.quality-card.three {
  background: linear-gradient(135deg, #ffffff, #fff3e6);
}
.quality-card span {
  color: #0f172a;
  font-weight: 700;
  margin-left: 6px;
}
@media (max-width: 1200px) {
  .process-panel__body {
    flex-direction: column;
  }
.realtime-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
  .process-panel__aside {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
.realtime-item {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 8px;
  text-align: center;
}
  .process-card {
    flex: 1;
    min-width: 220px;
  }
.realtime-value {
  font-size: 26px;
  color: #0f172a;
  font-weight: 700;
}
.realtime-label {
  margin-top: 8px;
  font-size: 12px;
  color: #475569;
}
.realtime-delta {
  margin-top: 4px;
  font-size: 12px;
}
.realtime-delta.up {
  color: #0ea5a4;
}
.realtime-delta.down {
  color: #f59e0b;
}
.warning-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.warning-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px;
}
.warning-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}
.warning-dot.device {
  background: #ef4444;
}
.warning-dot.quality {
  background: #f59e0b;
}
.warning-dot.material {
  background: #3b82f6;
}
.warning-title {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}
.warning-desc {
  color: #64748b;
  font-size: 12px;
  margin-top: 4px;
}
.warning-time {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}
.order-panel {
  min-height: 0;
}
.quick-panel {
  min-height: 0;
}
.table-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-progress span {
  font-size: 12px;
  color: #475569;
}
.quick-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 58px;
  gap: 10px;
}
.quick-item {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.plan-panel {
  min-height: 236px;
}
.quality-panel {
  min-height: 0;
}
.receipt-panel {
  min-height: 340px;
}
.plan-list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-item {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: #f8fbff;
  padding: 10px 12px;
}
.plan-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.plan-order {
  font-size: 13px;
  color: #1f3658;
  font-weight: 600;
}
.plan-name {
  font-size: 13px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}
.quick-item:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.1);
}
.quick-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}
.quick-item:nth-child(2) .quick-icon,
.quick-item:nth-child(6) .quick-icon {
  background: linear-gradient(135deg, #14b8a6, #5eead4);
}
.quick-item:nth-child(3) .quick-icon,
.quick-item:nth-child(5) .quick-icon {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.quick-item:nth-child(4) .quick-icon,
.quick-item:nth-child(7) .quick-icon {
  background: linear-gradient(135deg, #f97316, #fdba74);
}
.process-selection-wrapper {
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  padding: 8px;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  gap: 10px;
}
:deep(.el-checkbox.is-bordered) {
  margin-left: 0 !important;
  width: 100%;
}
</style>
:deep(.el-radio-button__inner) {
  border-radius: 10px !important;
  background: #f8fbff;
  border-color: rgba(148, 163, 184, 0.22) !important;
  color: #475569 !important;
}
:deep(.el-radio-button__original-radio:checked + .el-radio-button__inner) {
  background: linear-gradient(135deg, #2f80ff, #38bdf8) !important;
  border-color: transparent !important;
  color: #fff !important;
}
:deep(.el-progress-circle__track) {
  stroke: rgba(148, 163, 184, 0.3);
}
:deep(.el-progress-bar__outer) {
  background-color: rgba(148, 163, 184, 0.2);
}
:deep(.order-panel .el-progress-bar__inner) {
  background: linear-gradient(90deg, #2563eb, #38bdf8) !important;
}
:deep(.order-panel .el-table) {
  border-radius: 14px;
}
:deep(.order-panel .el-table th.el-table__cell) {
  background: #f2f7ff !important;
}
:deep(.order-panel .el-table__body tr:hover > td.el-table__cell) {
  background: #f8fbff !important;
}
:deep(.order-panel .el-tag--success) {
  color: #0f766e;
  background: #e9fdf7;
  border-color: #b7f2e0;
}
:deep(.order-panel .el-tag--warning) {
  color: #b45309;
  background: #fff6e8;
  border-color: #fde0b8;
}
:deep(.order-panel .el-tag--primary) {
  color: #2563eb;
  background: #eaf2ff;
  border-color: #b8d2ff;
}
@media (max-width: 1600px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}
@media (max-width: 1366px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .right-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .chart-row {
    grid-template-columns: 1fr;
  }
  .process-body {
    grid-template-columns: 1fr;
  }
  .realtime-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .quality-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .welcome-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .welcome-meta {
    text-align: left;
  }
  .meta-extra {
    justify-content: flex-start;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .right-column {
    grid-template-columns: 1fr;
  }
  .realtime-grid {
    grid-template-columns: 1fr;
  }
}
</style>