<template>
  <div class="app-editTaskDrawer">
    <el-drawer
      v-if="onOpen"
      :visible.sync="onOpen"
      ref="drawer"
      direction="rtl"
      size="70%"
      @close="closeCallBack"
    >
      <template slot="title">
        <div>
          临时工程申请 【{{ title }}】<span v-if="showjd">
            - 当前节点【{{ options.taskName }}】</span
          >
        </div>
      </template>
      <div class="drawer">
        <div class="drawerLeft">
          <el-timeline style="padding-left: 0px !important">
            <el-timeline-item
              v-for="(item, index) in flowRecordList"
              :key="index"
              :icon="setIcon(item)"
              :color="setColor(item)"
            >
              <p style="font-weight: 700">
                {{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
              </p>
              <el-card :body-style="{ padding: '6px' }">
                <el-descriptions class="margin-top" :column="1" size="small" border>
                  <el-descriptions-item
                    v-if="item.assigneeName"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-user"></i>办理人</template>
                    {{ item.assigneeName }}
                    <el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
                  </el-descriptions-item>
                  <el-descriptions-item
                    v-if="item.candidate"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-user"></i>候选办理</template>
                    {{ item.candidate }}
                  </el-descriptions-item>
                  <el-descriptions-item
                    v-if="item.deleteReason"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-user"></i>驳回节点</template>
                    {{ getDeleteReason(item.deleteReason) }}
                  </el-descriptions-item>
                  <el-descriptions-item
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-date"></i>接收时间</template>
                    {{ item.startTime }}
                  </el-descriptions-item>
                  <el-descriptions-item
                    v-if="item.endTime"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-date"></i>处理时间</template>
                    {{ item.endTime }}
                  </el-descriptions-item>
                  <el-descriptions-item
                    v-if="item.duration"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"><i class="el-icon-time"></i>处理耗时</template>
                    {{ getDurationDateStr(item.duration) }}
                  </el-descriptions-item>
                  <el-descriptions-item
                    v-if="item.message"
                    label-class-name="my-label"
                    :labelStyle="labelStyle"
                  >
                    <template slot="label"
                      ><i class="el-icon-tickets"></i>处理意见</template
                    >
                    {{ item.message }}
                  </el-descriptions-item>
                </el-descriptions>
              </el-card>
            </el-timeline-item>
          </el-timeline>
        </div>
        <div class="drawerRight">
          <el-form
            ref="form"
            :model="form"
            :rules="rules"
            v-loading="loading"
            label-width="100px"
            style="padding-left: 25px; padding-right: 25px"
          >
            <div class="block containers">
              <div class="canvas" ref="flowCanvas"></div>
              <div class="maskLayer"></div>
            </div>
            <el-form-item label="项目单位">
              {{ form.parProjName }}
            </el-form-item>
            <el-form-item label="项目名称" prop="projId">
              <el-select
                v-model="form.projId"
                placeholder="请选择项目名称"
                style="width: 100%"
                filterable
                @change="projectChage"
              >
                <el-option
                  v-for="(item, index) in projectOptions"
                  :key="index"
                  :label="item.name"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="申请类型">
              {{ title }}
            </el-form-item>
            <el-form-item label="申请人">
              <label
                >{{ nickName }}
                <el-tag type="info" size="mini">{{ deptName }}</el-tag></label
              >
            </el-form-item>
            <el-form-item label="申请原因" prop="applyReason">
              <el-input
                type="textarea"
                v-model="form.applyReason"
                placeholder="请输入申请原因"
                rows="3"
              />
            </el-form-item>
            <el-form-item label="附件说明" prop="applyFiles">
              <FileUpload
                :limit="9"
                v-model="form.applyFiles"
                :fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
              />
            </el-form-item>
            <el-divider content-position="left" style="margin-left"
              >申请明细信息</el-divider
            >
            <el-row :gutter="10" class="mb8">
              <el-col :span="1.5">
                <el-button
                  type="primary"
                  icon="el-icon-plus"
                  size="mini"
                  @click="handleAddProProjectApplyDetail"
                  >添加</el-button
                >
              </el-col>
              <el-col :span="1.5">
                <el-button
                  type="danger"
                  icon="el-icon-delete"
                  size="mini"
                  @click="handleDeleteProProjectApplyDetail"
                  >删除</el-button
                >
              </el-col>
            </el-row>
            <el-table
              :data="proProjectApplyDetailList"
              :row-class-name="rowProProjectApplyDetailIndex"
              @selection-change="handleProProjectApplyDetailSelectionChange"
              ref="proProjectApplyDetail"
            >
              <el-table-column type="selection" width="50" align="center" />
              <el-table-column label="序号" align="center" prop="index" width="50" />
              <el-table-column align="center" prop="assetsId">
                <template slot="header" slot-scope="scope">
                  <span class="required">申请明细</span>
                </template>
                <template slot-scope="scope">
                  <el-select
                    v-model="scope.row.assetsId"
                    placeholder="请选择申请明细"
                    filterable
                    style="width: 100%"
                    @change="selectAssetsId"
                  >
                    <el-option-group
                      v-for="group in AssetsTypeOptions"
                      :key="group.id"
                      :label="group.name"
                    >
                      <el-option
                        v-for="item in group.childrenAssetsTypeList"
                        :key="item.id"
                        :label="item.name"
                        :value="item.id"
                      >
                      </el-option>
                    </el-option-group>
                  </el-select>
                </template>
              </el-table-column>
              <el-table-column prop="number" align="center" width="180">
                <template slot="header" slot-scope="scope">
                  <span class="required">申请数量</span>
                </template>
                <template slot-scope="scope">
                  <el-row>
                    <el-col :span="12"
                      ><el-input v-model="scope.row.number" placeholder="数量"
                    /></el-col>
                    <el-col :span="12"
                      ><el-select
                        v-model="scope.row.assetsUnit"
                        placeholder="单位"
                        filterable
                      >
                        <el-option
                          v-for="(item, index) in getUnitOptions(scope.row.assetsId)"
                          :key="index"
                          :label="item"
                          :value="item"
                        >
                        </el-option> </el-select
                    ></el-col>
                  </el-row>
                </template>
              </el-table-column>
              <el-table-column
                v-if="showAssetsVersion"
                label="申请规格"
                align="center"
                prop="assetsVersion"
                width="180"
              >
                <template slot-scope="scope">
                  <el-input
                    type="textarea"
                    v-model="scope.row.assetsVersion"
                    placeholder="请输入申请规格"
                    rows="2"
                    maxlength="200"
                  />
                </template>
              </el-table-column>
              <el-table-column prop="useReason" align="center">
                <template slot="header" slot-scope="scope">
                  <span class="required">使用说明</span>
                </template>
                <template slot-scope="scope">
                  <el-input
                    type="textarea"
                    v-model="scope.row.useReason"
                    placeholder="请输入申请规格"
                    rows="2"
                    maxlength="500"
                  />
                </template>
              </el-table-column>
            </el-table>
            <div style="text-align: center; padding: 20px 0px">
              <el-button type="primary" @click="submitForm">提交申请</el-button>
              <el-button @click="doCanel">取 消</el-button>
            </div>
          </el-form>
        </div>
      </div>
    </el-drawer>
  </div>
</template>

<script>
import store from "@/store";
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import { getProjectApply } from "@/api/project/projectApply";
import { completeAndModify, getNextFlowNodeByStart } from "@/api/flowable/todo";
import { findCommentByProcInsId } from "@/api/flowable/businessKey";
import { findMyDeptProject } from "@/api/project/projectInfo";
import { findAllByCategory } from "@/api/base/assetsType";

export default {
  components: {},
  props: {
    closeCallBack: {
      type: Function,
    },
  },
  data() {
    return {
      // 抽屉层
      onOpen: false,
      // 遮罩层
      loading: false,
      // 标题
      title: "",
      // 表单参数
      form: {
        id: null,
        deptId: null,
        projId: 0,
        projName: null,
        parProjName: null,
        applyType: null,
        applyStatus: null,
        applyReason: null,
        applyFiles: null,
        applyUser: null,
        useTime: null,
        isDel: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
      },
      // 表单校验
      rules: {
        projId: [{ required: true, message: "请选择项目名称", trigger: "blur" }],
        applyReason: [{ required: true, message: "请输入申请原因", trigger: "blur" }],
      },
      projectOptions: [],
      deptName: null,
      nickName: null,
      disPro: false,
      bpmnViewer: null,
      options: {},
      taskTitle: null,
      taskOpen: false,
      daterangeMarksTime: [],
      flowRecordList: [],
      showjd: true,
      labelStyle: { width: "160px" },
      initData: {},
      showAssetsVersion: false,
      proProjectApplyDetailList: [],
      // 子表选中数据
      checkedProProjectApplyDetail: [],
      AssetsTypeOptions: [],
      unitOptions: [],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  beforeDestroy() {},
  methods: {
    // 查询和我相关的项目信息
    initMyProject() {
      // 获取项目列表的接口
      findMyDeptProject().then((response) => {
        if (response.code == 200) {
          this.projectOptions = response.data;
        }
      });
    },
    initCategoryAssetsType(val) {
      // 获取项目列表的接口
      findAllByCategory(val).then((response) => {
        if (response.code == 200 && response.data) {
          this.AssetsTypeOptions = response.data;
        }
      });
    },
    // 项目选择
    projectChage(val) {
      this.$forceUpdate();
      for (let i = 0; i < this.projectOptions.length; i++) {
        if (this.projectOptions[i].id == val) {
          this.form.projName = this.projectOptions[i].name;
          return false;
        }
      }
    },
    doCanel() {
      this.onOpen = false;
    },
    show(options) {
      this.options = options;
      this.initMyProject();
      //物资设备类需要输入规格
      if (options.category == 1) {
        this.showAssetsVersion = true;
      } else {
        this.showAssetsVersion = false;
      }
      this.initCategoryAssetsType(options.category);
      this.title = options.procDefName;
      this.form.applyType = options.category;
      this.form.parProjName = options.businessKeyParName;
      this.nickName = options.startUserName;
      this.deptName = options.startDeptName;
      this.onOpen = true;
      this.getFlowRecordList(options.procInsId, options.deployId);
      this.initFormDate(options.businessKey);
      flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
        (res) => {
          this.initFlowImage(res.data);
        }
      );
    },
    async initFlowImage(data) {
      const self = this;
      try {
        self.bpmnViewer = new BpmnViewer({
          container: this.$refs.flowCanvas,
          height: "100px",
        });
        await self.bpmnViewer.importXML(data.xmlData);
        // 自适应
        self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
        if (data.nodeData !== undefined && data.nodeData.length > 0) {
          self.fillColor(data.nodeData);
        }
      } catch (err) {
        console.error(err.message, err.warnings);
      }
    },
    /** 流程表单数据 */
    initFormDate(businessKey) {
      getProjectApply(businessKey)
        .then((res) => {
          if (res.code == 200) {
            this.initData = res.data;
            this.form.id = res.data.id;
            this.form.projId = res.data.projId;
            this.form.applyReason = res.data.applyReason;
            this.form.applyFiles = res.data.applyFiles;
            let applyDetailList = [];
            if (
              res.data.proProjectApplyDetailList &&
              res.data.proProjectApplyDetailList.length > 0
            ) {
              for (let i = 0; i < res.data.proProjectApplyDetailList.length; i++) {
                this.selectAssetsId(res.data.proProjectApplyDetailList[i].assetsId);
                applyDetailList.push({
                  index: i + 1,
                  assetsId: res.data.proProjectApplyDetailList[i].assetsId,
                  number: res.data.proProjectApplyDetailList[i].number,
                  assetsUnit: res.data.proProjectApplyDetailList[i].assetsUnit,
                  assetsVersion: res.data.proProjectApplyDetailList[i].assetsVersion,
                  useReason: res.data.proProjectApplyDetailList[i].useReason,
                });
              }
              this.proProjectApplyDetailList = applyDetailList;
            }
          } else {
            this.$message.error("数据异常，请联系管理员...");
          }
        })
        .catch((res) => {
          this.$message.error("数据异常，请联系管理员...");
        });
    },
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.proProjectApplyDetailList.length == 0) {
            this.$modal.msgWarning("请添加申请明细信息...");
            return false;
          }
          for (let i = 0; i < this.proProjectApplyDetailList.length; i++) {
            if (!this.proProjectApplyDetailList[i].assetsId) {
              this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行未选择...");
              return false;
            }
            if (!this.proProjectApplyDetailList[i].number) {
              this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行数量未输入...");
              return false;
            }
            if (!this.proProjectApplyDetailList[i].assetsUnit) {
              this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行单位未选择...");
              return false;
            }
            if (!this.proProjectApplyDetailList[i].useReason) {
              this.$modal.msgWarning("申请明细第 ”" + (i + 1) + "“行申请说明未输入...");
              return false;
            }
          }
          this.form.proProjectApplyDetailList = this.proProjectApplyDetailList;
          let flowTaskVo = {
              taskId:this.options.taskId,
              instanceId:this.options.procInsId,
              instanceId:this.options.procInsId,
              comment:store.getters.name+" 重新修改并重新提交申请。",
              proProjectApply:this.form
            }
          this.loading = true;
          completeAndModify(flowTaskVo).then((res) => {
            this.$store.dispatch("initMyTaskNum");
            this.$modal.msgSuccess("任务提交成功");
            this.loading = false;
            //关闭并刷新列表
            this.$refs.drawer.closeDrawer();
          });
        }
      });
    },
    // 设置高亮颜色的
    fillColor(nodeData) {
      const canvas = this.bpmnViewer.get("canvas");
      this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
        const completeTask = nodeData.find((m) => m.key === n.id);
        const todoTask = nodeData.find((m) => !m.completed);
        const endTask = nodeData[nodeData.length - 1];
        if (n.$type === "bpmn:UserTask") {
          if (completeTask) {
            canvas.addMarker(
              n.id,
              completeTask.completed ? "highlight" : "highlight-todo"
            );
            n.outgoing?.forEach((nn) => {
              const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
              if (targetTask) {
                if (
                  todoTask &&
                  completeTask.key === todoTask.key &&
                  !todoTask.completed
                ) {
                  canvas.addMarker(
                    nn.id,
                    todoTask.completed ? "highlight" : "highlight-todo"
                  );
                  canvas.addMarker(
                    nn.targetRef.id,
                    todoTask.completed ? "highlight" : "highlight-todo"
                  );
                } else {
                  canvas.addMarker(
                    nn.id,
                    targetTask.completed ? "highlight" : "highlight-todo"
                  );
                  canvas.addMarker(
                    nn.targetRef.id,
                    targetTask.completed ? "highlight" : "highlight-todo"
                  );
                }
              }
            });
          }
        }
        // 排他网关
        else if (n.$type === "bpmn:ExclusiveGateway") {
          if (completeTask) {
            canvas.addMarker(
              n.id,
              completeTask.completed ? "highlight" : "highlight-todo"
            );
            n.outgoing?.forEach((nn) => {
              const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
              if (targetTask) {
                canvas.addMarker(
                  nn.id,
                  targetTask.completed ? "highlight" : "highlight-todo"
                );
                canvas.addMarker(
                  nn.targetRef.id,
                  targetTask.completed ? "highlight" : "highlight-todo"
                );
              }
            });
          }
        }
        // 并行网关
        else if (n.$type === "bpmn:ParallelGateway") {
          if (completeTask) {
            canvas.addMarker(
              n.id,
              completeTask.completed ? "highlight" : "highlight-todo"
            );
            n.outgoing?.forEach((nn) => {
              const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
              if (targetTask) {
                canvas.addMarker(
                  nn.id,
                  targetTask.completed ? "highlight" : "highlight-todo"
                );
                canvas.addMarker(
                  nn.targetRef.id,
                  targetTask.completed ? "highlight" : "highlight-todo"
                );
              }
            });
          }
        } else if (n.$type === "bpmn:StartEvent") {
          n.outgoing.forEach((nn) => {
            const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
            if (completeTask) {
              canvas.addMarker(nn.id, "highlight");
              canvas.addMarker(n.id, "highlight");
              return;
            }
          });
        } else if (n.$type === "bpmn:EndEvent") {
          if (endTask.key === n.id && endTask.completed) {
            canvas.addMarker(n.id, "highlight");
            return;
          }
        }
      });
    },
    /** 项目申请明细序号 */
    rowProProjectApplyDetailIndex({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
    /** 项目申请明细添加按钮操作 */
    handleAddProProjectApplyDetail() {
      let obj = {};
      obj.superTypeId = "";
      obj.superTypeName = "";
      obj.typeId = "";
      obj.typeName = "";
      obj.assetsId = "";
      obj.assetsName = "";
      obj.assetsUnit = "";
      obj.number = "";
      obj.useTime = "";
      obj.useReason = "";
      obj.price = "";
      obj.totalPrice = "";
      obj.isDel = "";
      obj.remark = "";
      this.proProjectApplyDetailList.push(obj);
    },
    /** 项目申请明细删除按钮操作 */
    handleDeleteProProjectApplyDetail() {
      if (this.checkedProProjectApplyDetail.length == 0) {
        this.$modal.msgError("请先选择要删除的项目申请明细数据");
      } else {
        const proProjectApplyDetailList = this.proProjectApplyDetailList;
        const checkedProProjectApplyDetail = this.checkedProProjectApplyDetail;
        this.proProjectApplyDetailList = proProjectApplyDetailList.filter(function (
          item
        ) {
          return checkedProProjectApplyDetail.indexOf(item.index) == -1;
        });
      }
    },
    /** 复选框选中数据 */
    handleProProjectApplyDetailSelectionChange(selection) {
      this.checkedProProjectApplyDetail = selection.map((item) => item.index);
    },
    selectAssetsId(val) {
      for (let i = 0; i < this.AssetsTypeOptions.length; i++) {
        for (
          let x = 0;
          x < this.AssetsTypeOptions[i].childrenAssetsTypeList.length;
          x++
        ) {
          if (this.AssetsTypeOptions[i].childrenAssetsTypeList[x].id == val) {
            if (this.getUnitOptions(val) == null) {
              this.unitOptions.push({
                id: val,
                data: this.AssetsTypeOptions[i].childrenAssetsTypeList[x].unit.split(","),
              });
            }
          }
        }
      }
    },
    getUnitOptions(val) {
      for (let i = 0; i < this.unitOptions.length; i++) {
        if (this.unitOptions[i].id == val) {
          return this.unitOptions[i].data;
        }
      }
      return null;
    },
    setIcon(row) {
      if (row.endTime) {
        if (row.commentResult == "驳回") {
          return "el-icon-close";
        } else {
          return "el-icon-check";
        }
      } else {
        return "el-icon-time";
      }
    },
    setColor(row) {
      if (row.endTime) {
        if (row.commentResult == "驳回") {
          return "#f56c6c";
        } else {
          return "#2bc418";
        }
      } else {
        return "#b3bdbb";
      }
    },
    getSort(i) {
      let num = this.flowRecordList.length - i;
      if (num < 10) {
        num = "0" + num;
      }
      return num + ". ";
    },
    /** 流程流转记录 */
    getFlowRecordList(procInsId, deployId) {
      const that = this;
      const params = { procInsId: procInsId };
      findCommentByProcInsId(params)
        .then((res) => {
          that.flowRecordList = res.data;
        })
        .catch((res) => {
          this.$message.error("数据异常，请联系管理员...");
        });
    },
    getDeleteReason(val) {
      val = val.replace("Change activity to ", "");
      let flowRecordList = this.flowRecordList;
      for (let i = 0; i < flowRecordList.length; i++) {
        if (flowRecordList[i].taskDefKey == val) {
          return "驳回至" + flowRecordList[i].taskName;
        }
      }
    },
    getDurationDateStr(val) {
      // 计算出相差天数
      let days = Math.floor(val / (24 * 3600 * 1000));
      // 计算出小时数
      let leave1 = val % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
      let hours = Math.floor(leave1 / (3600 * 1000));
      // 计算相差分钟数
      let leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
      let minutes = Math.floor(leave2 / (60 * 1000));
      // 计算相差秒数
      let leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
      let seconds = Math.round(leave3 / 1000);
      if (days > 0) {
        if (days < 10) days = "0" + days;
        if (hours < 10) hours = "0" + hours;
        if (minutes < 10) minutes = "0" + minutes;
        if (seconds < 10) seconds = "0" + seconds;
        return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
      }
      if (hours > 0) {
        if (hours < 10) hours = "0" + hours;
        if (minutes < 10) minutes = "0" + minutes;
        if (seconds < 10) seconds = "0" + seconds;
        return hours + "小时" + minutes + "分钟" + seconds + "秒";
      }
      if (minutes > 0) {
        if (minutes < 10) minutes = "0" + minutes;
        if (seconds < 10) seconds = "0" + seconds;
        return minutes + "分钟" + seconds + "秒";
      }
      if (seconds > 0) {
        if (seconds < 10) seconds = "0" + seconds;
        return seconds + "秒";
      }
    },
  },
};
</script>
<style lang="scss">
.app-editTaskDrawer {
  .drawer {
    width: 100%;
    height: 100%;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    .drawerLeft {
      width: 40%;
      min-width: 280px;
      height: 100%;
      float: left;
      border-right: 1px solid #dcdfe6;
      overflow-y: scroll;
      padding-right: 20px;
    }
    .drawerRight {
      width: 60%;
      min-width: 400px;
      height: 100%;
      float: left;
      padding-left: 20px;
      .bjs-powered-by {
        display: none !important;
      }
      .maskLayer {
        width: 100%;
        height: 100px;
        position: absolute;
        z-index: 9999;
        top: 77px;
      }
    }
  }
  .containers {
    width: 100%;
    height: 100px;
    .canvas {
      width: 100%;
      height: 100px;
    }
    .panel {
      position: absolute;
      right: 0;
      top: 50px;
      width: 300px;
    }
    .load {
      margin-right: 10px;
    }
    .el-form-item__label {
      font-size: 13px;
    }
    .djs-palette {
      left: 0px !important;
      top: 0px;
      border-top: none;
    }
    .djs-container svg {
      min-height: 100px;
    }
    .highlight.djs-shape .djs-visual > :nth-child(1) {
      fill: green !important;
      stroke: green !important;
      fill-opacity: 0.2 !important;
    }
    .highlight.djs-shape .djs-visual > :nth-child(2) {
      fill: green !important;
    }
    .highlight.djs-shape .djs-visual > path {
      fill: green !important;
      fill-opacity: 0.2 !important;
      stroke: green !important;
    }
    .highlight.djs-connection > .djs-visual > path {
      stroke: green !important;
    }
    .highlight-todo.djs-connection > .djs-visual > path {
      stroke: orange !important;
      stroke-dasharray: 4px !important;
      fill-opacity: 0.2 !important;
    }
    .highlight-todo.djs-shape .djs-visual > :nth-child(1) {
      fill: orange !important;
      stroke: orange !important;
      stroke-dasharray: 4px !important;
      fill-opacity: 0.2 !important;
    }
    .overlays-div {
      font-size: 10px;
      color: red;
      width: 100px;
      top: -20px !important;
    }
  }
}
</style>
