globals.scss 7.42 KB
@use "./themes.scss";
@use "./element-plus/index.scss";
// 全局变量
:root {
  // 头部宽度(默认自适应宽度,可固定宽度,固定宽度后为居中显示)
  --g-header-width: 100%;
  // 头部高度
  --g-header-height: 48px;
  // 侧边栏宽度
  --g-main-sidebar-width: 70px;
  --g-sub-sidebar-width: 180px;
  // 侧边栏Logo高度
  --g-sidebar-logo-height: 40px;
  // 顶栏高度
  --g-topbar-height: 34px;
  // 顶部标签栏高度
  --g-tapbar-height: 34px;
  --g-sub-sidebar-menu-color: #666;
  // 菜单选项高度
  --el-menu-sub-item-height: 44px;
  // 默认padding
  --g-normal-padding: 8px;
  // margin
  --g-normal-margin: 8px;

  --van-base-font: simsun !important;
  --van-primary-color: #4fa1a4 !important;
}
/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background-color: #f5f5f5;
}
/*定义滚动条轨道 内阴影+圆角*/
::-webkit-scrollbar-track {
  background-color: #f5f5f5;
  border-radius: 5px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}
/*定义滑块 内阴影+圆角*/
::-webkit-scrollbar-thumb {
  background-color: #b2b2b2;
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}
/*滑块效果*/
::-webkit-scrollbar-thumb:hover {
  background: #999999;
  border-radius: 5px;
  -webkit-box-shadow: inset 0 0 5px #999999;
}
input:-webkit-autofill {
  background: transparent;
  transition: background-color 50000s ease-in-out 0s;
  -webkit-text-fill-color: unset;
}
:focus-visible {
  outline: none;
}
.costume_scroll {
  &.small {
    &::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

  }
  &.hide {
    &::-webkit-scrollbar {
      width: 0;
      height: 0;
    }
  }
}
html,
body {
  width: 100%;
  height: 100%;
  font-size: 14px;
  color: #666;
  overflow: hidden;
}
body {
  margin: 0;
  box-sizing: border-box;
  font-family: simsun;
  -webkit-tap-highlight-color: transparent;
  &.overflow-hidden {
    overflow: hidden;
  }
}
* {
  box-sizing: inherit;
}
// 右侧内容区针对fixed元素,有横向铺满的需求,可在fixed元素上设置 [data-fixed-calc-width]
[data-fixed-calc-width] {
  position: fixed;
  left: 50%;
  right: 0;
  width: calc(100% - var(--g-main-sidebar-actual-width) - var(--g-sub-sidebar-actual-width));
  transform: translateX(-50%) translateX(calc(var(--g-main-sidebar-actual-width) / 2)) translateX(calc(var(--g-sub-sidebar-actual-width) / 2));
}
[data-mode="mobile"] {
  [data-fixed-calc-width] {
    width: 100% !important;
    transform: translateX(-50%) !important;
  }

  ::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}
// textarea 字体跟随系统
textarea {
  font-family: inherit;
}
// 列表页全局样式
.el-table.list-table {
  margin: 20px 0;
  .el-button+.el-dropdown {
    margin-left: 10px;
  }
}

.full_wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.container_wrap {
  width: 100%;
  height: 100%;
  padding: 0 var(--g-normal-padding);
  position: relative;
  .table_tool_wrap {
    width: 100%;
    height: auto;
    min-height: 44px;
    &.has_search {
      height: 88px;
    }
    .tools_btns {
      padding: 8px 0;
    }
  }
  .table_panel_wrap {
    width: 100%;
    height: calc(100% - 88px);
    &.full {
      height: calc(100% - 44px);
    }
    .antv-s2-pagination {
      justify-content: end;
      margin: 10px;
    }
  }
  &.full {
    padding: 0;
  }
  &.flex {
    display: flex;
    justify-content: space-between;
    >div {
      height: 100%;
      overflow: hidden;
    }
    .fold_btn {
      width: 24px;
      height: 42px;
      line-height: 42px;
      text-align: center;
      color: #fff;
      background: rgba(0, 0, 0, 0.3);
      border-radius: 4px 0 0 4px;
      position: absolute;
      top: 50%;
      left: -24px;
      transform: translateY(-50%);
      cursor: pointer;
      z-index: 5;
      transition: left 0.3s;
      &.turn {
        left: 0;
        border-radius: 0 4px 4px 0;
        svg {
          transform: rotateY(180deg);
        }
      }
    }
    .aside_wrap {
      width: 0;
      box-shadow: 1px 0 0 0 #d9d9d9;
      transition: width 0.3s;
      &.open {
        width: 200px;
      }
      .aside_title {
        padding: 0 8px;
        font-size: 14px;
        color: var(--el-color-regular);
        height: 36px;
        line-height: 36px;
        font-weight: 600;
      }
      .aside_search {
        padding: 0 8px 8px;
      }
      .aside_list {
        height: calc(100% - 76px);
        overflow: hidden auto;
        .list_item {
          line-height: 32px;
          padding: 0 8px;
          cursor: default;
          font-size: 14px;
          color: var(--el-color-regular);
          font-weight: 400;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
          &:hover {
            background-color: #f5f5f5;
          }
          &.active {
            color: var(--el-color-primary);
            background-color: var(--el-menu-hover-bg-color);
          }
        }
      }
      .el-collapse {
        border: none;
        .el-collapse-item__header {
          border: none;
          height: 32px;
          padding-left: 10px;
          &.is-active {
            background-color: var(--g-sub-sidebar-menu-active-bg);
            color: var(--g-sub-sidebar-menu-active-color);
            .el-icon {
              color: var(--el-color-regular);
            }
          }
        }
        .el-collapse-item__wrap {
          border: none;
          .el-collapse-item__content {
            padding: 0;
          }
        }
        .list_item {
          line-height: 32px;
          color: var(--el-color-regular);
          padding: 0 15px;
          &:hover,
          &.active {
            background-color: var(--g-sub-sidebar-menu-active-bg);
            color: var(--g-sub-sidebar-menu-active-color);
          }
        }
      }
    }
    .main_wrap {
      width: calc(100% - 200px);
      padding: 0 15px;
      transition: width 0.3s;
      position: relative;
      overflow: hidden auto;
      &.full {
        width: 100%;
      }
      .table_tool_wrap {
        position: relative;
        .table_search_input {
          width: 300px;
          position: absolute;
          top: 50%;
          right: 0;
          transform: translateY(-50%);
        }
      }
    }
  }
  .pane-trigger-con {
    width: 1px;
    background-color: #d9d9d9;
    position: absolute;
    left: 200px;
    cursor: col-resize;
  }
}
// 侧拉抽屉样式
.el-drawer {
  .el-drawer__header {
    .title {
      color: var(--el-color-regular);
      font-size: 18px;
      font-weight: 400;
    }
  }
}
.required_mark {
  position: relative;
  &::after {
    content: "*";
    color: #fb2323;
    position: absolute;
    margin-left: 2px;
  }
}
// 文字显示不全显示省略号时使用。
.w100f {
  width: 100%;
}
.pr8 {
  padding-right: 8px;
}

.mr8-i {
  margin-right: 8px !important; 
}
// 输入框是number类型时不显示上下箭头。
.el-input {
  .el-input__inner::-webkit-inner-spin-button,
  .el-input__inner::-webkit-outer-spin-button {
    -webkit-appearance: none;
  }
}

.foot-sty {
  font-size: 12px;
  color: #999999;
  height: 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center;
  margin-top: 8px;
}

a {
  color: var(--el-color-primary);
}

// 拖拽表格行样式
.drop-ghostClass {
  background: #f5f5f5;
  opacity: 0.7;
}

.mb16 {
  margin-bottom: 16px;
}

.mb10 {
  margin-bottom: 10px;
}