<template>
  <div>
    <div class="node-wrap" v-if="nodeConfig.type != 4">
      <el-popover placement="right-start" trigger="hover" :disabled="auditHistory.length === 0">
        <el-table stripe :data="auditHistory">
          <el-table-column label="审批人" width="80px">
            <template #default="{ row: { auditUser } }">
              {{ employeesMap[auditUser] ? employeesMap[auditUser].name : auditUser }}
            </template>
          </el-table-column>

          <el-table-column label="结果" width="60px">
            <template slot-scope="scope">
              <span v-if="scope.row.status === 3" style="color: greenyellow !important">通过</span>
              <span v-if="scope.row.status === 4" style="color: red !important">驳回</span>
            </template>
          </el-table-column>
          <el-table-column label="意见" prop="remark" width="200px" />
          <el-table-column label="时间" prop="auditTime" width="160px" />
        </el-table>
        <div slot="reference" class="node-wrap-box" :class="(nodeConfig.type == 0 ? 'start-node ' : 'other-node') + (isTried && nodeConfig.error ? 'active error' : '')">
          <div style="border-radius: 8px;">
            <div style="border-radius: 8px 10px 0 0;height:40px;padding-top: 10px;padding-bottom: 10px; " :class="`title ${getColor(nodeConfig.type, nodeConfig.finalStatus, isDetail)}`">
              <span v-if="nodeConfig.type == 0">{{ nodeConfig.nodeName }}</span>
              <input type="text" class="ant-input editable-title-input" v-if="nodeConfig.type != 0 && isInput" @blur="blurEvent()" @focus="$event.currentTarget.select()" v-model="nodeConfig.nodeName" :placeholder="placeholderList[nodeConfig.type]" />
              <span class="editable-title" v-if="nodeConfig.type != 0 && !isInput">{{
                nodeConfig.nodeName
              }}</span>
              <i class="anticon anticon-close el-icon-close" style="position: absolute; right: 10px" v-if="nodeConfig.type != 0 && modifiable" @click="delNode()"></i>
            </div>
            <div style="background-color:#fff;margin-left: 9px;margin-right: 9px;margin-bottom: 9px;
            padding: 10px;
            border-radius: 8px;height: 90px;display: flex;align-items: center;">
              <div class="flow-content whiteDiv " @click="setPerson">
                <div class="text-cust" v-if="nodeConfig.type == 0">{{ '所有人' }}</div>
                <div class="text-cust placeholder" v-if="nodeConfig.type == 1">
                  <p v-if="nodeConfig.error">请选择{{ placeholderList[nodeConfig.type] }}</p>
                  <p v-else>
                    {{ nodeConfig.auditorType.label }}（{{ nodeConfig.signType.label }}）
                  </p>
                  <p v-if="nodeConfig.auditorType.value === '1'">{{
                    nodeConfig.users.map(item =>
                      item.userName).join('、')
                  }}</p>
                  <p v-if="nodeConfig.auditorType.value === '2'">{{
                    nodeConfig.roles.map(item =>
                      item.roleName).join('、')
                  }}</p>
                </div>
                <div class="text-cust" v-if="nodeConfig.type == 2">
                  <span class="placeholder">请选择{{ placeholderList[nodeConfig.type] }}</span>
                </div>
                <i class="anticon el-icon-arrow-right arrow"></i>
              </div>
              <div class="error_tip" v-if="isTried && nodeConfig.error">
                <i class="anticon anticon-exclamation-circle" style="color: rgb(242, 86, 67)"></i>
              </div>
            </div>
          </div>
        </div>
      </el-popover>
      <addNode :childNodeP.sync="nodeConfig.childNode" :modifiable="modifiable"></addNode>
    </div>
    <div class="branch-wrap" v-if="nodeConfig.type == 4">
      <div class="branch-box-wrap">
        <div class="branch-box">
          <button v-if="modifiable" class="add-branch" @click="addTerm">添加条件</button>
          <button v-else class="add-branch">条件分支</button>
          <div class="col-box" v-for="(item, index) in nodeConfig.conditionNodes" :key="index">
            <div class="condition-node">
              <div class="condition-node-box">
                <div class="auto-judge" :class="isTried && item.error ? 'error active' : ''">
                  <div class="sort-left" v-if="index != 0 && index != nodeConfig.conditionNodes.length - 1 && modifiable" @click="arrTransfer(index, -1)">&lt;
                  </div>
                  <div class="title-wrapper">
                    <!--                     <input type="text" class="ant-input editable-title-input" v-if="isInputList[index]" @blur="blurEvent(index)" @focus="$event.currentTarget.select()" v-model="item.nodeName" />-->
                    <span class="editable-title" @click="clickEvent(index)">{{ item.nodeName }}</span>
                    <span class="priority-title" @click="setPerson(item.priorityLevel)">优先级{{
                      item.priorityLevel
                    }}</span>
                    <i class="anticon el-icon-close" style="position:absolute;right: -10px" v-if="index != nodeConfig.conditionNodes.length - 1 && modifiable" @click="delTerm(index)"></i>
                  </div>
                  <div class="sort-right" v-if="index < nodeConfig.conditionNodes.length - 2 && modifiable" @click="arrTransfer(index)">&gt;
                  </div>
                  <div class="text-cust placeholder" style="min-height: 20px;font-size: 14px;line-height:16px" @click="setPerson(item.priorityLevel)">
                    <p v-if="!item.expression && item.priorityLevel != 999">请设置条件</p>
                    <p v-else>{{ item.expression }}</p>
                  </div>
                  <div class="error_tip" v-if="isTried && item.error">
                    <i class="anticon anticon-exclamation-circle" style="color: rgb(242, 86, 67)"></i>
                  </div>
                </div>
                <addNode :childNodeP.sync="item.childNode" :modifiable="modifiable"></addNode>
              </div>
            </div>
            <nodeWrap v-if="item.childNode && item.childNode" :nodeConfig.sync="item.childNode" :tableId="tableId" :isDetail="isDetail" :isTried.sync="isTried"></nodeWrap>
            <div class="top-left-cover-line" v-if="index == 0"></div>
            <div class="bottom-left-cover-line" v-if="index == 0"></div>
            <div class="top-right-cover-line" v-if="index == nodeConfig.conditionNodes.length - 1"></div>
            <div class="bottom-right-cover-line" v-if="index == nodeConfig.conditionNodes.length - 1"></div>
          </div>
        </div>
        <addNode :childNodeP.sync="nodeConfig.childNode" :modifiable="modifiable"></addNode>
      </div>
    </div>
    <nodeWrap v-if="nodeConfig.childNode && nodeConfig.childNode" :nodeConfig.sync="nodeConfig.childNode" :tableId="tableId" :isDetail="isDetail" :isTried.sync="isTried"></nodeWrap>
  </div>
</template>
<script>
import yid from "yid";
import { mapGetters } from "vuex";

const TaskStatus = {
  INACTIVE: 1,
  AUDITING: 2,
  PASS: 3,
  REJECT: 4,
};
const { INACTIVE, AUDITING, PASS, REJECT } = TaskStatus;
function getColor(type, status, isDetail) {
  let color = "logo-containe-background-";
  if (type === 0) {
    return color + "premoter";
  } else if (type === 2) {
    return color + "copyer";
  }

  switch (status) {
    case INACTIVE:
      color += "inactive";
      break;
    case AUDITING:
      color += "default";
      break;
    case PASS:
      color += "pass";
      break;
    case REJECT:
      color += "reject";
      break;
    default:
      color += isDetail ? "inactive" : "default";
      break;
  }
  return color;
}
export default {
  props: ["nodeConfig", "flowPermission", "isTried", "tableId", "isDetail"],
  data() {
    return {
      placeholderList: ["发起人", "审核人", "抄送人"],
      isInputList: [],
      isInput: false,
    };
  },
  computed: {
    ...mapGetters(["organsMap", "employeesMap", "postsMap", "rolesMap"]),
    flowPermission1() {
      return this.$store.state.auditSetting.flowPermission;
    },
    approverConfig1() {
      return this.$store.state.auditSetting.approverConfig;
    },
    copyerConfig1() {
      return this.$store.state.auditSetting.copyerConfig;
    },
    conditionsConfig1() {
      return this.$store.state.auditSetting.conditionsConfig;
    },
    modifiable() {
      return !this.isDetail;
    },
    auditHistory() {
      const { auditHistory } = this.nodeConfig;
      return auditHistory
        ? auditHistory.filter(({ status }) => [3, 4].includes(status))
        : [];
    },
  },
  watch: {
    flowPermission1(data) {
      if (data.flag && data.id === this._uid) {
        this.$emit("update:flowPermission", data.value);
      }
    },
    approverConfig1(data) {
      if (data.flag && data.id === this._uid) {
        this.$emit("update:nodeConfig", data.value);
      }
    },
    copyerConfig1(data) {
      if (data.flag && data.id === this._uid) {
        this.$emit("update:nodeConfig", data.value);
      }
    },
    conditionsConfig1(data) {
      if (data.flag && data.id === this._uid) {
        this.$emit("update:nodeConfig", data.value);
      }
    },
  },
  methods: {
    clickEvent(index) {
      if (index || index === 0 || !this.modifiable) {
        this.$set(this.isInputList, index, true);
      } else {
        this.isInput = true;
      }
    },
    parseName(map, keys = "", prop) {
      if (!keys || keys.length === 0) {
        return "";
      }
      return `${keys}`
        .split(",")
        .map((id) => (map[id] && prop ? map[id][prop] : map[id]))
        .join(",");
    },
    blurEvent(index) {
      if (index || index === 0) {
        this.$set(this.isInputList, index, false);
        this.nodeConfig.conditionNodes[index].nodeName = this.nodeConfig
          .conditionNodes[index].nodeName
          ? this.nodeConfig.conditionNodes[index].nodeName
          : "条件";
      } else {
        this.isInput = false;
        this.nodeConfig.nodeName = this.nodeConfig.nodeName
          ? this.nodeConfig.nodeName
          : this.placeholderList[this.nodeConfig.type];
      }
    },
    delNode() {
      this.$emit("update:nodeConfig", this.nodeConfig.childNode);
    },
    addTerm() {
      let length = this.nodeConfig.conditionNodes.length;
      this.nodeConfig.conditionNodes.splice(length - 1, 0, {
        nodeId: yid(),
        nodeName: "条件" + length,
        type: 3,
        priorityLevel: length,
        expression: "",
        childNode: null,
      });
      this.nodeConfig.conditionNodes.map((item, index) => {
        if (index < length) {
          item.priorityLevel = index + 1;
        } else {
          item.priorityLevel = 999;
        }
      });
      for (var i = 0; i < length; i++) {
        this.nodeConfig.conditionNodes[i].error =
          1 == "请设置条件" && i != this.nodeConfig.conditionNodes.length - 1;
      }
      this.$emit("update:nodeConfig", this.nodeConfig);
    },
    delTerm(index) {
      this.nodeConfig.conditionNodes.splice(index, 1);
      this.nodeConfig.conditionNodes.map((item, index) => {
        if (index < this.nodeConfig.conditionNodes.length - 1) {
          item.priorityLevel = index + 1;
        } else {
          item.priorityLevel = 999;
        }
      });
      for (var i = 0; i < this.nodeConfig.conditionNodes.length; i++) {
        this.nodeConfig.conditionNodes[i].error =
          1 == "请设置条件" && i != this.nodeConfig.conditionNodes.length - 1;
      }
      this.$emit("update:nodeConfig", this.nodeConfig);
      if (this.nodeConfig.conditionNodes.length == 1) {
        if (this.nodeConfig.childNode) {
          if (this.nodeConfig.conditionNodes[0].childNode) {
            this.reData(
              this.nodeConfig.conditionNodes[0].childNode,
              this.nodeConfig.childNode
            );
          } else {
            this.nodeConfig.conditionNodes[0].childNode =
              this.nodeConfig.childNode;
          }
        }
        this.$emit(
          "update:nodeConfig",
          this.nodeConfig.conditionNodes[0].childNode
        );
      }
    },
    reData(data, addData) {
      if (!data.childNode) {
        data.childNode = addData;
      } else {
        this.reData(data.childNode, addData);
      }
    },
    setPerson(priorityLevel) {
      var { type } = this.nodeConfig;
      if (type == 1) {
        this.$store.commit("updateApprover", true);
        this.$store.commit("updateApproverConfig", {
          value: { ...JSON.parse(JSON.stringify(this.nodeConfig)) },
          flag: false,
          id: this._uid,
        });
      } else if (type == 2) {
        this.$store.commit("updateCopyer", true);
        this.$store.commit("updateCopyerConfig", {
          value: JSON.parse(JSON.stringify(this.nodeConfig)),
          flag: false,
          id: this._uid,
        });
      } else if (type == 4) {
        if (priorityLevel === 999) {
          return;
        }
        this.$store.commit("updateCondition", true);
        this.$store.commit("updateConditionsConfig", {
          value: JSON.parse(JSON.stringify(this.nodeConfig)),
          priorityLevel,
          flag: false,
          id: this._uid,
        });
      }
    },
    arrTransfer(index, type = 1) {
      //向左-1,向右1
      this.nodeConfig.conditionNodes[index] =
        this.nodeConfig.conditionNodes.splice(
          index + type,
          1,
          this.nodeConfig.conditionNodes[index]
        )[0];
      this.nodeConfig.conditionNodes.map((item, index) => {
        if (index < this.nodeConfig.conditionNodes.length - 1) {
          item.priorityLevel = index + 1;
        } else {
          item.priorityLevel = 999;
        }
      });
      for (var i = 0; i < this.nodeConfig.conditionNodes.length; i++) {
        this.nodeConfig.conditionNodes[i].error =
          1 == "请设置条件" && i != this.nodeConfig.conditionNodes.length - 1;
      }
      this.$emit("update:nodeConfig", this.nodeConfig);
    },
    getColor,
  },
};
</script>
<style scoped>
.error_tip {
  position: absolute;
  top: 0px;
  right: 0px;
  transform: translate(150%, 0px);
  font-size: 24px;
}

.promoter_person .el-dialog__body {
  padding: 10px 20px 14px 20px;
}

.selected_list {
  margin-bottom: 20px;
  line-height: 30px;
}

.selected_list span {
  margin-right: 10px;
  padding: 3px 6px 3px 9px;
  line-height: 12px;
  white-space: nowrap;
  border-radius: 2px;
  border: 1px solid rgba(220, 220, 220, 1);
}

.selected_list img {
  margin-left: 5px;
  width: 7px;
  height: 7px;
  cursor: pointer;
}

.auto-judge:hover .editable-title,
.node-wrap-box:hover .editable-title {
  border-bottom: 1px dashed #fff;
}

.auto-judge:hover .editable-title.editing,
.node-wrap-box:hover .editable-title.editing {
  text-decoration: none;
  border: 1px solid #d9d9d9;
}

.auto-judge:hover .editable-title {
  border-color: #15bc83;
}

.editable-title {
  line-height: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-bottom: 1px dashed transparent;
}

.editable-title:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 40px;
}

.editable-title:hover {
  border-bottom: 1px dashed #fff;
}

.editable-title-input {
  flex: none;
  height: 18px;
  padding-left: 4px;
  text-indent: 0;
  font-size: 12px;
  line-height: 18px;
  z-index: 1;
}

.editable-title-input:hover {
  text-decoration: none;
}

.ant-btn {
  position: relative;
}

.node-wrap-box {
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  position: relative;
  width: 220px;
  min-height: 72px;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.node-wrap-box:after {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
}

.node-wrap-box.active:after,
.node-wrap-box:active:after,
.node-wrap-box:hover:after {
  border: 1px solid #3296fa;
  box-shadow: 0 0 6px 0 rgba(50, 150, 250, 0.3);
}

.node-wrap-box.active .close,
.node-wrap-box:active .close,
.node-wrap-box:hover .close {
  display: block;
}

.node-wrap-box.error:after {
  border: 1px solid #f25643;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
}

.node-wrap-box .title {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 16px;
  padding-right: 30px;
  width: 100%;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  color: #fff;
  text-align: left;
  background: #abb4cb;
  /*border-radius: 4px 4px 0 0;*/
  margin: 0 !important;
}

.node-wrap-box .title .iconfont {
  font-size: 12px;
  margin-right: 5px;
}

.node-wrap-box .placeholder {
  color: #bfbfbf;
  margin: 0;
}

.node-wrap-box .close {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  font-size: 14px;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
}

.node-wrap-box .flow-content {
  position: relative;
  font-size: 14px;
  /*padding: 16px 20px 16px 20px;*/
}

.node-wrap-box .flow-content .text {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.node-wrap-box .flow-content .arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 14px;
  font-size: 14px;
  color: #979797;
}

.start-node {
  background-color: #abb4cb;
}

.other-node {
  background-color: #e0525a;
}

::v-deep .whiteDiv {
  width: 100%;
}

.start-node.node-wrap-box .flow-content .text {
  display: block;
  white-space: nowrap;
}

.node-wrap-box:before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  border-style: solid;
  border-width: 8px 6px 4px;
  border-color: #cacaca transparent transparent;
  background: #f5f5f7;
}

.node-wrap-box.start-node:before {
  content: none;
}

.top-left-cover-line {
  left: -1px;
}

.top-left-cover-line,
.top-right-cover-line {
  position: absolute;
  height: 3px;
  width: 50%;
  background-color: #f5f5f7;
  top: -2px;
}

.top-right-cover-line {
  right: -1px;
}

.bottom-left-cover-line {
  left: -1px;
}

.bottom-left-cover-line,
.bottom-right-cover-line {
  position: absolute;
  height: 3px;
  width: 50%;
  background-color: #f5f5f7;
  bottom: -2px;
}

.bottom-right-cover-line {
  right: -1px;
}

.approval-setting {
  border-radius: 2px;
  margin: 20px 0;
  position: relative;
  background: #fff;
}

.ant-btn {
  position: relative;
}

.node-wrap-box .logo-containe-background-default {
  background: #e0525a;
}

.node-wrap-box .logo-containe-background-inactive {
  background: grey;
}

.node-wrap-box .logo-containe-background-reject {
  background: red;
}

.node-wrap-box .logo-containe-background-pass {
  background: greenyellow;
}

.node-wrap-box .logo-containe-background-promoter {
  background: rgb(87, 106, 149);
}

.node-wrap-box .logo-containe-background-copyer {
  background: rgb(50, 150, 250);
}

.dingflow-design .branch-wrap,
.dingflow-design .node-wrap {
  display: inline-flex;
  width: 100%;
}

.dingflow-design .branch-box-wrap {
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  min-height: 270px;
  width: 100%;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.dingflow-design .branch-box {
  display: flex;
  overflow: visible;
  min-height: 180px;
  height: auto;
  border-bottom: 2px solid #ccc;
  border-top: 2px solid #ccc;
  position: relative;
  margin-top: 15px;
}

.dingflow-design .branch-box .col-box {
  background: #f5f5f7;
}

.dingflow-design .branch-box .col-box:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  margin: auto;
  width: 2px;
  height: 100%;
  background-color: #cacaca;
}

.dingflow-design .add-branch {
  border: none;
  outline: none;
  user-select: none;
  justify-content: center;
  font-size: 12px;
  padding: 0 10px;
  height: 30px;
  line-height: 30px;
  border-radius: 8px;
  color: #3296fa;
  background: #fff;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center center;
  cursor: pointer;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  -webkit-transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.dingflow-design .add-branch:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.1);
}

.dingflow-design .add-branch:active {
  transform: translateX(-50%);
  box-shadow: none;
}

.dingflow-design .col-box {
  display: inline-flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  -webkit-box-align: center;
  align-items: center;
  position: relative;
}

.dingflow-design .condition-node {
  min-height: 220px;
}

.dingflow-design .condition-node,
.dingflow-design .condition-node-box {
  display: inline-flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  flex-direction: column;
  -webkit-box-flex: 1;
}

.dingflow-design .condition-node-box {
  padding-top: 30px;
  padding-right: 50px;
  padding-left: 50px;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  flex-grow: 1;
  position: relative;
}

.dingflow-design .condition-node-box:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 2px;
  height: 100%;
  background-color: #cacaca;
}

.dingflow-design .auto-judge {
  position: relative;
  width: 220px;
  min-height: 72px;
  background: #fff;
  border-radius: 4px;
  padding: 14px 19px;
  cursor: pointer;
}

.dingflow-design .auto-judge:after {
  pointer-events: none;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
}

.dingflow-design .auto-judge.active:after,
.dingflow-design .auto-judge:active:after,
.dingflow-design .auto-judge:hover:after {
  border: 1px solid #3296fa;
  box-shadow: 0 0 6px 0 rgba(50, 150, 250, 0.3);
}

.dingflow-design .auto-judge.active .close,
.dingflow-design .auto-judge:active .close,
.dingflow-design .auto-judge:hover .close {
  display: block;
}

.dingflow-design .auto-judge.error:after {
  border: 1px solid #f25643;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
}

.dingflow-design .auto-judge .title-wrapper {
  position: relative;
  font-size: 12px;
  color: #15bc83;
  text-align: left;
  line-height: 16px;
}

.dingflow-design .auto-judge .title-wrapper .editable-title {
  display: inline-block;
  max-width: 120px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dingflow-design .auto-judge .title-wrapper .priority-title {
  display: inline-block;
  float: right;
  margin-right: 10px;
  color: rgba(25, 31, 37, 0.56);
}

.dingflow-design .auto-judge .placeholder {
  color: #bfbfbf;
}

.dingflow-design .auto-judge .close {
  display: none;
  position: absolute;
  right: -10px;
  top: -10px;
  width: 20px;
  height: 20px;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  z-index: 2;
}

.dingflow-design .auto-judge .flow-content {
  font-size: 14px;
  color: #191f25;
  text-align: left;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.dingflow-design .auto-judge .sort-left,
.dingflow-design .auto-judge .sort-right {
  position: absolute;
  top: 0;
  bottom: 0;
  display: none;
  z-index: 1;
}

.dingflow-design .auto-judge .sort-left {
  left: 0;
  border-right: 1px solid #f6f6f6;
}

.dingflow-design .auto-judge .sort-right {
  right: 0;
  border-left: 1px solid #f6f6f6;
}

.dingflow-design .auto-judge:hover .sort-left,
.dingflow-design .auto-judge:hover .sort-right {
  display: flex;
  align-items: center;
}

.dingflow-design .auto-judge .sort-left:hover,
.dingflow-design .auto-judge .sort-right:hover {
  background: #efefef;
}

.dingflow-design .add-node-btn-box {
  width: 240px;
  display: -webkit-inline-box;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  position: relative;
}

.dingflow-design .add-node-btn-box:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  margin: auto;
  width: 2px;
  height: 100%;
  background-color: #cacaca;
}

.dingflow-design .node-wrap {
  flex-direction: column;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  padding: 0 50px;
  position: relative;
}

::v-deep .el-popover__reference {
  border-radius: 8px;
}
</style>
