@import '@/styles/variables.scss';

$headerHeight: 64px; // header高度
$btnAreaHeight: 50px; // 按钮区域高度
$menuAreaHeight: 380px; // 右键菜单高度
$menuAreaWidth: 180px; // 右键菜单宽度
$nodeMinWidth: 100px; // 节点最小宽度
$nodeMaxWidth: 180px; // 节点最大宽度

.fmeaTree {
  position: relative;
  height: calc(100vh - #{$headerHeight}) !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;

  .btnContent {
    width: 100% !important;
    height: $btnAreaHeight;
    border-bottom: 1px solid rgb(204, 204, 204);
  }

  .treeContent {
    width: calc(100%);
    height: calc(100vh - #{$headerHeight +$btnAreaHeight});

    .beauty-Scroll.el-scrollbar {
      height: 100%;
      /*此处一定要设置高度，不然内层的计算属性不生效*/

      .el-scrollbar__wrap {
        width: calc(100% + 17px);
        /*将垂直滚动条挤到可视区域之外*/
        height: calc(100% + 17px) !important;
        /*将水平滚动条挤到可视区域之外*/
      }
    }

    .splitter-pane-resizer.vertical {
      width: 13px !important;
    }

    .abc .splitter-pane-resizer.vertical {
      width: 130px !important;
    }

    /* 打开并排查看时，仅最大的pane中间的分割线需要加粗 */
    .totalPane > .splitter-pane-resizer.vertical {
      width: 17px !important;
    }

    .el-scrollbar__bar {
      bottom: 1px !important;
      z-index: 1000 !important;
    }

    .el-scrollbar__bar.is-horizontal {
      height: 12px !important;
    }

    .el-scrollbar__bar.is-vertical {
      width: 10px !important;
    }

    .showDetailBtn {
      position: fixed;
      left: 20px;
      bottom: 30px;
      z-index: 200;
    }

    .chartFlag {
      border: 1px dashed #ddd;
      border-radius: 2px;
      color: #ddd;
    }

    .org-tree-container .node.hc {
      border: 2px solid #000;
    }

    .copy-cut {
      border: 1px dashed red !important;
      border-radius: 2px;
    }

    .left-container {
      height: 100%;
      width: 100%;

      .org-tree-node-label-inner .node {
        min-width: $nodeMinWidth;
        max-width: $nodeMaxWidth;
        text-align: left;

        .nodeLabel {
          word-wrap: break-word;
        }
      }
    }

    .right-container {
      height: 100%;
      width: 100%;

      .iconfont {
        padding-right: 4px;
        font-size: 15px;
      }

      .funcNetDialog {
        $netTitleHeight: 50px;
        width: 100%;
        height: 100%;
        overflow: hidden;

        .el-dialog.is-fullscreen {
          width: 100%;
          height: 100%;
          overflow: hidden;
        }

        .el-dialog__header {
          padding: 0;

          .funcNetTitle {
            height: $netTitleHeight;
            background-color: $gkBlue;
            line-height: $netTitleHeight;
            padding-left: 10px;
            color: white;
          }

          .el-dialog__headerbtn {
            top: calc(#{$netTitleHeight/2 - 12px}) !important;

            .el-dialog__close {
              color: white;
              font-size: 24px;
            }
          }
        }

        .el-dialog__body {
          height: calc(100vh - #{$netTitleHeight + 2px});

          .funcNetContent {
            height: 100%;

            .el-scrollbar {
              overflow: hidden;
            }

            .el-scrollbar__wrap {
              width: calc(100% + 17px);
              /*将垂直滚动条挤到可视区域之外*/
              height: calc(100% + 22px) !important;
              /*将水平滚动条挤到可视区域之外*/
              padding: 0;
              overflow: scroll !important;
            }

            .el-scrollbar__view {
              min-width: 105%;
              min-height: 105%;
            }

            .el-scrollbar__bar {
              bottom: 2px !important;
              z-index: 1000 !important;
            }

            .el-scrollbar__bar.is-horizontal {
              height: 12px !important;
            }

            .net-left {
              width: calc(100%);
              height: 100%;
              background-color: white;
            }

            .net-center {
              min-width: 100%;
              height: calc(100vh - #{$netTitleHeight + 2px});
              background-color: white;
            }

            .net-right {
              width: calc(100%);
              height: 100%;
              background-color: white;
            }
          }
        }
      }
    }

    .closeMenu {
      height: 100%;
      width: 100%;

      .org-tree-container {
        padding-right: $menuAreaWidth;
        padding-bottom: $menuAreaHeight;
      }
    }

    .faliTree {
      .closeMenu {
        .elFailTree.el-tree {
          padding-bottom: $menuAreaHeight;
        }
      }
    }
  }
}

.function-color {
  color: rgb(66, 167, 94);
}

.productFeature-color {
  color: #5b9bd5;
}

.require-color {
  color: #5b9bd5;
}

.fault-color {
  color: rgb(200, 77, 60);
}

.func-color {
  color: rgb(66, 167, 94);
}

.procSpec-color {
  color: #4972b2;
}

.prod {
  color: #4972b2 !important;
}

.fail-color {
  color: rgb(200, 77, 60);
}

.prod-color {
  color: rgb(73, 114, 178);
}

$labelBackgroundColor: rgb(217, 236, 255);

$xLine: 15px; // xline的宽度
$lineBorder: 2px solid #999; // line的样式

$iconSize: 24px; // 按钮图标默认大小

$fontSize: 16px; // 文字大小

$labelBorder: 1px solid #999; // 节点的边框样式
$labelPadding: 4px 0; // 节点上下边距

$cNodeBorderLeft: 5px solid #999; // 中心节点的左边框
$cNodeBorderColor: #409eff; // 中心节点的边框颜色
$sNodeBorderLeft: 5px solid #e6a23c; // 第二级节点的左边框
$oNodeBorderLeft: 5px solid #909399; // 其他节点的左边框

$cNodeBorderTB: 1px dashed #409eff; // 中心节点的上下边框
$sNodeBorderTB: 1px dashed #e6a23c; // 第二级节点的上下边框
$oNodeBorderTB: 1px dashed #909399; // 其他节点的上下边框

$level2LeftNodeBorderLeft: 5px solid #999; // 网左侧第二层边框
$level2LeftNodeBorderColor: #e6a23c; // 网左侧第二层边框颜色
$level2RightNodeBorderLeft: 5px solid #999; // 网右侧第二层边框
$level2RightNodeBorderColor: rgb(200, 77, 60); // 网右侧第二层边框颜色

$labelMaxWidth: 400px;

.net {
  min-width: 100%;
  height: 100%;

  table {
    margin: -1px 0 0 -1px;
    //min-width: 1024px;
    min-width: 10000px; //网的宽度给大一点防止网叠起来 bug5389
    width: 100%;
    max-width: 4096px;
    height: 100%;

    td {
      min-width: 100%;
      height: 100%;
      padding: 40px 180px 40px 20px;
      margin: 0;
      white-space: nowrap;
      vertical-align: middle;
      text-align: left;
      margin-left: 20px;

      .hideLeaf {
        visibility: hidden !important;
      }

      ul {
        list-style-type: disc;
        position: relative;
        border: 0;
        margin: 0;
        display: inline-block;

        li {
          line-height: 20px;
        }
      }

      .leaf {
        display: inline-block;
        border: 0;
        padding: 0 !important;
        margin: 0 !important;
        vertical-align: middle;
      }
    }
  }

  .node {
    display: inline-block;
    cursor: pointer;
    vertical-align: middle;

    .nodeLabel .label:hover {
      background-color: $labelBackgroundColor;
    }

    .line {
      position: absolute;
    }

    i {
      font-size: $iconSize;
      display: inline-block;
      width: $iconSize;
      height: $iconSize;
      cursor: pointer;
      z-index: 100;
      vertical-align: middle;
    }

    .nodeLabel {
      position: relative;
      display: inline-block;
      padding: $labelPadding;
      vertical-align: middle;

      .label {
        display: inline-block;
        border: $labelBorder;
        border-radius: 4px;
        padding: 5px;
        text-align: left;
        margin-left: $xLine;
        font-size: $fontSize;
        max-width: $labelMaxWidth;
        word-break: break-all;
        white-space: normal;

      }
    }
  }

  .node.sNode {
    .label {
      border-left: $sNodeBorderLeft;
    }
  }

  .node.oNode {
    .label {
      border-left: $oNodeBorderLeft;
    }
  }

  .node.level2-left-node {
    .label {
      border-left: $level2LeftNodeBorderLeft;
      border-color: $level2LeftNodeBorderColor;
    }
  }

  .node.levelGte2-left-node {
    .label {
      border-left: $level2LeftNodeBorderLeft;
    }
  }

  .node.level2-right-node {
    .label {
      border-left: $level2RightNodeBorderLeft;
      border-color: $level2RightNodeBorderColor;
    }
  }

  .node.levelGte2-right-node {
    .label {
      border-left: $level2RightNodeBorderLeft;
    }
  }

  .cNode {
    display: inline-block;
    position: relative;

    .nodeLabel {
      .label {
        left: 0;
        margin-left: 0;
        border-left: $cNodeBorderLeft;
        border-color: $cNodeBorderColor;
        background-color: $labelBackgroundColor;
        max-width: $labelMaxWidth;
        word-break: break-all;
        white-space: normal;
      }
    }

    .line-c-x {
      position: absolute;
      top: 50%;
      height: 1px;
      border-bottom: $lineBorder;
      width: 20px;
    }

    .line-c-x.l {
      left: 0;
    }

    .line-c-x.r {
      right: 0;
    }
  }

  .addNode.r {
    text-align: left;
    padding-left: $xLine;
  }

  .addNode.l {
    text-align: right;
    padding-right: $xLine;
  }

  .leafNode {
    display: block;
    border: 0;
    margin: 0;
    position: relative;
    // vertical-align: middle;
    .line-r-x {
      top: 50%;
      left: 0px;
      height: 1px;
      width: $xLine;
      border-bottom: $lineBorder;
    }

    .line-l-x {
      top: 50%;
      right: 0;
      height: 1px;
      width: $xLine;
      border-bottom: $lineBorder;
    }

    .line-rt-y {
      top: calc(50% + 1px);
      left: 0;
      bottom: 0;
      width: 1px;
      border-right: $lineBorder;
    }

    .line-lt-y {
      top: 50%;
      right: 0;
      bottom: 0;
      width: 1px;
      border-right: $lineBorder;
    }

    .line-rc-y {
      top: 0;
      left: 0;
      width: 1px;
      height: 100%;
      border-right: $lineBorder;
    }

    .line-lc-y {
      top: 0;
      right: 0;
      width: 1px;
      height: 100%;
      border-right: $lineBorder;
    }

    .line-rb-y {
      top: 0;
      left: 0;
      width: 1px;
      height: 50%;
      position: absolute;
      border-right: $lineBorder;
    }

    .line-lb-y {
      top: 0;
      right: 0;
      width: 1px;
      height: 50%;
      position: absolute;
      border-right: $lineBorder;
    }
  }

  .leafNode.r {
    text-align: left;
  }

  .leafNode.l {
    text-align: right;

    .node {
      text-align: right;

      .nodeLabel {
        padding-right: $xLine;

        .label {
          margin-left: 0;
        }
      }
    }
  }
}

// 实心圆圈：黑色
.solid-circle-black {
  width: 20px;
  height: 20px;
  background-color: #000000;
  border-radius: 10px; /* 图形的半径 */
  display: inline-block;
}

.ant-modal-title {
  max-width: 95%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  display: inline-block;
}

// jquery-contextmenu 右键菜单
.context-menu-list {
  min-width: 5em;
  border-radius: 0.5em;
}

.context-menu-separator {
  margin: 0.35em 0.5em;
}

.context-menu-list .context-menu-item {
  border-radius: 0.5em;
}

.context-menu-icon.context-menu-icon--fa5 i, .context-menu-icon.context-menu-icon--fa5 svg {
  top: 0px;
  color: inherit;
}

.context-menu-item.context-menu-hover {
  color: #fff;
  cursor: pointer;
  background-color: #1890FF;
}

/** FMEA网 */
.net-container {
  overflow: auto;
  box-shadow: 0 0 10px 1px #e9e9e9;;
  border-radius: 8px;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuXzAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCI+PHJlY3Qgd2lkdGg9IjEiIGhlaWdodD0iMSIgcng9IjEiIHJ5PSIxIiBmaWxsPSIjYWFhYWFhIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI3BhdHRlcm5fMCkiLz48L3N2Zz4=');

  table.htree td {
    vertical-align: middle;
  }

  .leaf-hide {
    display: none !important;
  }

  .leaf {
    display: inline-block;
    _display: inline;
    vertical-align: middle;
    border: 1px solid #ddd;
    border-left: 5px solid #ddd;
    text-align: left;
    margin: 5px 0;
    padding: 3px 10px;
    width: 200px;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
  }

  .leafopt {
    display: inline-block;
    _display: inline;
    vertical-align: middle;
    background-color: #fff;
    border: 1px solid #ddd;
    border-left: 5px solid #ddd;
    text-align: left;
    margin: 5px 0;
    padding: 3px 10px;
  }

  .leaf p {
    margin: 0;
    font-size: 14px;
    line-height: 1;
    color: #000000;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .leaf small {
    display: block;
    font-size: 12px;
    line-height: 12px;
    color: #999999;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .leaf small:before {
    content: '\2014 \00A0';
  }

  .selectOpt {
    background-color: #e6fffc;
  }

  a.leaf:hover, .leaf:hover {
    text-decoration: none;
    cursor: pointer;
    background-color: #e6fffc;
  }

  i {
    font-size: 14px;
    cursor: pointer;
  }

  ul.htree {
    display: inline-block;
    _display: inline;
    position: relative;
    vertical-align: middle;
    border: 0;
    margin: 0;
  }

  ul.htree > li {
    display: block;
    border: 0;
    margin: 0;
    position: relative;
  }

  /* 左向右展开树 */
  ul.htree li {
    text-align: left;
    padding-left: 15px;
  }

  /* 连线 */
  .line-x,
  .line-y {
    left: 0;
    right: auto;
    background-color: #ddd;
    position: absolute;
    margin: 0;
    padding: 0;
  }

  .line-x {
    top: 50%;
    height: 1px;
    width: 15px;
  }

  .line-y {
    width: 1px;
    bottom: 0;
    top: 0;
  }

  /* 反向（左向右）展开树 */
  ul.htree.reverse > li {
    text-align: right;
    padding-right: 15px;
    padding-left: 0px;
  }

  /* 连线 */
  ul.htree.reverse .line-x,
  ul.htree.reverse .line-y {
    right: 0;
    left: auto;
  }

  /* 展开合并 */
  .line-combine-right {
    color: #ddd;
  }

  .line-combine-left {
    color: #ddd;
  }

  .leaf.center {
    border-color: #409eff;
  }

  .leaf.success {
    border-color: #356635;
  }

  .leaf.left {
    border-color: #e6a23c;
  }

  .leaf.right {
    border-color: #c84d3c;
  }

  .leaf.target {
    color: #fff;
  }

  .fmea-success {
    background-color: #468847;
  }

  .fmea-warning {
    background-color: #f89406;
  }

  .fmea-important {
    background-color: #b94a48;
  }

  .tooltitile {
    display: inline-block;
    _display: inline;
  }

  .tooltitile p {
    margin: 0;
    font-size: 14px;
    font-weight: 300;
    line-height: 1;
  }

  .tooltitile small {
    display: block;
    font-size: 12px;
    line-height: 12px;
    color: #999999;
  }

  .tooltitile small:before {
    content: '\2014 \00A0';
  }

  .rightClickMenu {
    display: none;
    margin: 0;
    background-color: #eee;
    z-index: 100;
  }

  .rightClickMenu > li > a {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .text-center {
    text-align: left;
  }
}


