ProcessViewer.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <template>
  2. <div class="my-process-designer">
  3. <div class="my-process-designer__container">
  4. <div class="my-process-designer__canvas" style="height: 760px" ref="bpmnCanvas"></div>
  5. </div>
  6. </div>
  7. </template>
  8. <script lang="ts" setup>
  9. import BpmnViewer from 'bpmn-js/lib/Viewer'
  10. import DefaultEmptyXML from './plugins/defaultEmpty'
  11. import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
  12. import { formatDate } from '@/utils/formatTime'
  13. import { isEmpty } from '@/utils/is'
  14. defineOptions({ name: 'MyProcessViewer' })
  15. const props = defineProps({
  16. value: {
  17. // BPMN XML 字符串
  18. type: String,
  19. default: ''
  20. },
  21. prefix: {
  22. // 使用哪个引擎
  23. type: String,
  24. default: 'camunda'
  25. },
  26. activityData: {
  27. // 活动的数据。传递时,可高亮流程
  28. type: Array,
  29. default: () => []
  30. },
  31. processInstanceData: {
  32. // 流程实例的数据。传递时,可展示流程发起人等信息
  33. type: Object,
  34. default: () => {}
  35. },
  36. taskData: {
  37. // 任务实例的数据。传递时,可展示 UserTask 审核相关的信息
  38. type: Array,
  39. default: () => []
  40. }
  41. })
  42. provide('configGlobal', props)
  43. const emit = defineEmits(['destroy'])
  44. let bpmnModeler
  45. const xml = ref('')
  46. const activityLists = ref<any[]>([])
  47. const processInstance = ref<any>(undefined)
  48. const taskList = ref<any[]>([])
  49. const bpmnCanvas = ref()
  50. // const element = ref()
  51. const elementOverlayIds = ref<any>(null)
  52. const overlays = ref<any>(null)
  53. const initBpmnModeler = () => {
  54. if (bpmnModeler) return
  55. bpmnModeler = new BpmnViewer({
  56. container: bpmnCanvas.value,
  57. bpmnRenderer: {}
  58. })
  59. }
  60. /* 创建新的流程图 */
  61. const createNewDiagram = async (xml) => {
  62. // 将字符串转换成图显示出来
  63. let newId = `Process_${new Date().getTime()}`
  64. let newName = `业务流程_${new Date().getTime()}`
  65. let xmlString = xml || DefaultEmptyXML(newId, newName, props.prefix)
  66. try {
  67. let { warnings } = await bpmnModeler.importXML(xmlString)
  68. if (warnings && warnings.length) {
  69. warnings.forEach((warn) => console.warn(warn))
  70. }
  71. // 高亮流程图
  72. await highlightDiagram()
  73. const canvas = bpmnModeler.get('canvas')
  74. canvas.zoom('fit-viewport', 'auto')
  75. } catch (e) {
  76. console.error(e)
  77. // console.error(`[Process Designer Warn]: ${e?.message || e}`);
  78. }
  79. }
  80. /* 高亮流程图 */
  81. // TODO 芋艿:如果多个 endActivity 的话,目前的逻辑可能有一定的问题。https://www.jdon.com/workflow/multi-events.html
  82. const highlightDiagram = async () => {
  83. const activityList = activityLists.value
  84. if (activityList.length === 0) {
  85. return
  86. }
  87. // 参考自 https://gitee.com/tony2y/RuoYi-flowable/blob/master/ruoyi-ui/src/components/Process/index.vue#L222 实现
  88. // 再次基础上,增加不同审批结果的颜色等等
  89. let canvas = bpmnModeler.get('canvas')
  90. let todoActivity: any = activityList.find((m: any) => !m.endTime) // 找到待办的任务
  91. let endActivity: any = activityList[activityList.length - 1] // 获得最后一个任务
  92. let findProcessTask = false //是否已经高亮了进行中的任务
  93. //进行中高亮之后的任务 key 集合,用于过滤掉 taskList 进行中后面的任务,避免进行中后面的数据 Hover 还有数据
  94. let removeTaskDefinitionKeyList = []
  95. // debugger
  96. bpmnModeler.getDefinitions().rootElements[0].flowElements?.forEach((n: any) => {
  97. let activity: any = activityList.find((m: any) => m.key === n.id) // 找到对应的活动
  98. if (!activity) {
  99. return
  100. }
  101. if (n.$type === 'bpmn:UserTask') {
  102. // 用户任务
  103. // 处理用户任务的高亮
  104. const task: any = taskList.value.find((m: any) => m.id === activity.taskId) // 找到活动对应的 taskId
  105. if (!task) {
  106. return
  107. }
  108. //进行中的任务已经高亮过了,则不高亮后面的任务了
  109. if (findProcessTask) {
  110. removeTaskDefinitionKeyList.push(n.id)
  111. return
  112. }
  113. // 高亮任务
  114. canvas.addMarker(n.id, getResultCss(task.result))
  115. //标记是否高亮了进行中任务
  116. if (task.result === 1) {
  117. findProcessTask = true
  118. }
  119. // 如果非通过,就不走后面的线条了
  120. if (task.result !== 2) {
  121. return
  122. }
  123. // 处理 outgoing 出线
  124. const outgoing = getActivityOutgoing(activity)
  125. outgoing?.forEach((nn: any) => {
  126. // debugger
  127. let targetActivity: any = activityList.find((m: any) => m.key === nn.targetRef.id)
  128. // 如果目标活动存在,则根据该活动是否结束,进行【bpmn:SequenceFlow】连线的高亮设置
  129. if (targetActivity) {
  130. canvas.addMarker(nn.id, targetActivity.endTime ? 'highlight' : 'highlight-todo')
  131. } else if (nn.targetRef.$type === 'bpmn:ExclusiveGateway') {
  132. // TODO 芋艿:这个流程,暂时没走到过
  133. canvas.addMarker(nn.id, activity.endTime ? 'highlight' : 'highlight-todo')
  134. canvas.addMarker(nn.targetRef.id, activity.endTime ? 'highlight' : 'highlight-todo')
  135. } else if (nn.targetRef.$type === 'bpmn:EndEvent') {
  136. // TODO 芋艿:这个流程,暂时没走到过
  137. if (!todoActivity && endActivity.key === n.id) {
  138. canvas.addMarker(nn.id, 'highlight')
  139. canvas.addMarker(nn.targetRef.id, 'highlight')
  140. }
  141. if (!activity.endTime) {
  142. canvas.addMarker(nn.id, 'highlight-todo')
  143. canvas.addMarker(nn.targetRef.id, 'highlight-todo')
  144. }
  145. }
  146. })
  147. } else if (n.$type === 'bpmn:ExclusiveGateway') {
  148. // 排它网关
  149. // 设置【bpmn:ExclusiveGateway】排它网关的高亮
  150. canvas.addMarker(n.id, getActivityHighlightCss(activity))
  151. // 查找需要高亮的连线
  152. let matchNN: any = undefined
  153. let matchActivity: any = undefined
  154. n.outgoing?.forEach((nn: any) => {
  155. let targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
  156. if (!targetActivity) {
  157. return
  158. }
  159. // 特殊判断 endEvent 类型的原因,ExclusiveGateway 可能后续连有 2 个路径:
  160. // 1. 一个是 UserTask => EndEvent
  161. // 2. 一个是 EndEvent
  162. // 在选择路径 1 时,其实 EndEvent 可能也存在,导致 1 和 2 都高亮,显然是不正确的。
  163. // 所以,在 matchActivity 为 EndEvent 时,需要进行覆盖~~
  164. if (!matchActivity || matchActivity.type === 'endEvent') {
  165. matchNN = nn
  166. matchActivity = targetActivity
  167. }
  168. })
  169. if (matchNN && matchActivity) {
  170. canvas.addMarker(matchNN.id, getActivityHighlightCss(matchActivity))
  171. }
  172. } else if (n.$type === 'bpmn:ParallelGateway') {
  173. // 并行网关
  174. // 设置【bpmn:ParallelGateway】并行网关的高亮
  175. canvas.addMarker(n.id, getActivityHighlightCss(activity))
  176. n.outgoing?.forEach((nn: any) => {
  177. // 获得连线是否有指向目标。如果有,则进行高亮
  178. const targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
  179. if (targetActivity) {
  180. canvas.addMarker(nn.id, getActivityHighlightCss(targetActivity)) // 高亮【bpmn:SequenceFlow】连线
  181. // 高亮【...】目标。其中 ... 可以是 bpm:UserTask、也可以是其它的。当然,如果是 bpm:UserTask 的话,其实不做高亮也没问题,因为上面有逻辑做了这块。
  182. canvas.addMarker(nn.targetRef.id, getActivityHighlightCss(targetActivity))
  183. }
  184. })
  185. } else if (n.$type === 'bpmn:StartEvent') {
  186. // 开始节点
  187. n.outgoing?.forEach((nn) => {
  188. // outgoing 例如说【bpmn:SequenceFlow】连线
  189. // 获得连线是否有指向目标。如果有,则进行高亮
  190. let targetActivity = activityList.find((m: any) => m.key === nn.targetRef.id)
  191. if (targetActivity) {
  192. canvas.addMarker(nn.id, 'highlight') // 高亮【bpmn:SequenceFlow】连线
  193. canvas.addMarker(n.id, 'highlight') // 高亮【bpmn:StartEvent】开始节点(自己)
  194. }
  195. })
  196. } else if (n.$type === 'bpmn:EndEvent') {
  197. // 结束节点
  198. if (!processInstance.value || processInstance.value.result === 1) {
  199. return
  200. }
  201. canvas.addMarker(n.id, getResultCss(processInstance.value.result))
  202. } else if (n.$type === 'bpmn:ServiceTask') {
  203. //服务任务
  204. if (activity.startTime > 0 && activity.endTime === 0) {
  205. //进入执行,标识进行色
  206. canvas.addMarker(n.id, getResultCss(1))
  207. }
  208. if (activity.endTime > 0) {
  209. // 执行完成,节点标识完成色, 所有outgoing标识完成色。
  210. canvas.addMarker(n.id, getResultCss(2))
  211. const outgoing = getActivityOutgoing(activity)
  212. outgoing?.forEach((out) => {
  213. canvas.addMarker(out.id, getResultCss(2))
  214. })
  215. }
  216. }
  217. })
  218. if (!isEmpty(removeTaskDefinitionKeyList)) {
  219. taskList.value = taskList.value.filter(
  220. (item) => !removeTaskDefinitionKeyList.includes(item.definitionKey)
  221. )
  222. }
  223. }
  224. const getActivityHighlightCss = (activity) => {
  225. return activity.endTime ? 'highlight' : 'highlight-todo'
  226. }
  227. const getResultCss = (result) => {
  228. if (result === 1) {
  229. // 审批中
  230. return 'highlight-todo'
  231. } else if (result === 2) {
  232. // 已通过
  233. return 'highlight'
  234. } else if (result === 3) {
  235. // 不通过
  236. return 'highlight-reject'
  237. } else if (result === 4) {
  238. // 已取消
  239. return 'highlight-cancel'
  240. } else if (result === 5) {
  241. // 退回
  242. return 'highlight-return'
  243. }
  244. return ''
  245. }
  246. const getActivityOutgoing = (activity) => {
  247. // 如果有 outgoing,则直接使用它
  248. if (activity.outgoing && activity.outgoing.length > 0) {
  249. return activity.outgoing
  250. }
  251. // 如果没有,则遍历获得起点为它的【bpmn:SequenceFlow】节点们。原因是:bpmn-js 的 UserTask 拿不到 outgoing
  252. const flowElements = bpmnModeler.getDefinitions().rootElements[0].flowElements
  253. const outgoing: any[] = []
  254. flowElements.forEach((item: any) => {
  255. if (item.$type !== 'bpmn:SequenceFlow') {
  256. return
  257. }
  258. if (item.sourceRef.id === activity.key) {
  259. outgoing.push(item)
  260. }
  261. })
  262. return outgoing
  263. }
  264. const initModelListeners = () => {
  265. const EventBus = bpmnModeler.get('eventBus')
  266. // 注册需要的监听事件
  267. EventBus.on('element.hover', function (eventObj) {
  268. let element = eventObj ? eventObj.element : null
  269. elementHover(element)
  270. })
  271. EventBus.on('element.out', function (eventObj) {
  272. let element = eventObj ? eventObj.element : null
  273. elementOut(element)
  274. })
  275. }
  276. // 流程图的元素被 hover
  277. const elementHover = (element) => {
  278. element.value = element
  279. !elementOverlayIds.value && (elementOverlayIds.value = {})
  280. !overlays.value && (overlays.value = bpmnModeler.get('overlays'))
  281. // 展示信息
  282. console.log(activityLists.value, 'activityLists.value')
  283. console.log(element.value, 'element.value')
  284. const activity = activityLists.value.find((m) => m.key === element.value.id)
  285. console.log(activity, 'activityactivityactivityactivity')
  286. if (!activity) {
  287. return
  288. }
  289. if (!elementOverlayIds.value[element.value.id] && element.value.type !== 'bpmn:Process') {
  290. let html = `<div class="element-overlays">
  291. <p>Elemet id: ${element.value.id}</p>
  292. <p>Elemet type: ${element.value.type}</p>
  293. </div>` // 默认值
  294. if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
  295. html = `<p>发起人:${processInstance.value.startUser.nickname}</p>
  296. <p>部门:${processInstance.value.startUser.deptName}</p>
  297. <p>创建时间:${formatDate(processInstance.value.createTime)}`
  298. } else if (element.value.type === 'bpmn:UserTask') {
  299. // debugger
  300. let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
  301. if (!task) {
  302. return
  303. }
  304. let optionData = getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
  305. let dataResult = ''
  306. optionData.forEach((element) => {
  307. if (element.value == task.result) {
  308. dataResult = element.label
  309. }
  310. })
  311. html = `<p>审批人:${task.assigneeUser.nickname}</p>
  312. <p>部门:${task.assigneeUser.deptName}</p>
  313. <p>结果:${dataResult}</p>
  314. <p>创建时间:${formatDate(task.createTime)}</p>`
  315. // html = `<p>审批人:${task.assigneeUser.nickname}</p>
  316. // <p>部门:${task.assigneeUser.deptName}</p>
  317. // <p>结果:${getIntDictOptions(
  318. // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  319. // task.result
  320. // )}</p>
  321. // <p>创建时间:${formatDate(task.createTime)}</p>`
  322. if (task.endTime) {
  323. html += `<p>结束时间:${formatDate(task.endTime)}</p>`
  324. }
  325. if (task.reason) {
  326. html += `<p>审批建议:${task.reason}</p>`
  327. }
  328. } else if (element.value.type === 'bpmn:ServiceTask' && processInstance.value) {
  329. if (activity.startTime > 0) {
  330. html = `<p>创建时间:${formatDate(activity.startTime)}</p>`
  331. }
  332. if (activity.endTime > 0) {
  333. html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
  334. }
  335. console.log(html)
  336. } else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
  337. let optionData = getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
  338. let dataResult = ''
  339. optionData.forEach((element) => {
  340. if (element.value == processInstance.value.result) {
  341. dataResult = element.label
  342. }
  343. })
  344. html = `<p>结果:${dataResult}</p>`
  345. // html = `<p>结果:${getIntDictOptions(
  346. // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  347. // processInstance.value.result
  348. // )}</p>`
  349. if (processInstance.value.endTime) {
  350. html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
  351. }
  352. }
  353. console.log(html, 'html111111111111111')
  354. elementOverlayIds.value[element.value.id] = toRaw(overlays.value).add(element.value, {
  355. position: { left: 0, bottom: 0 },
  356. html: `<div class="element-overlays">${html}</div>`
  357. })
  358. }
  359. }
  360. // 流程图的元素被 out
  361. const elementOut = (element) => {
  362. toRaw(overlays.value).remove({ element })
  363. elementOverlayIds.value[element.id] = null
  364. }
  365. onMounted(() => {
  366. xml.value = props.value
  367. activityLists.value = props.activityData
  368. // 初始化
  369. initBpmnModeler()
  370. createNewDiagram(xml.value)
  371. // 初始模型的监听器
  372. initModelListeners()
  373. })
  374. onBeforeUnmount(() => {
  375. // this.$once('hook:beforeDestroy', () => {
  376. // })
  377. if (bpmnModeler) bpmnModeler.destroy()
  378. emit('destroy', bpmnModeler)
  379. bpmnModeler = null
  380. })
  381. watch(
  382. () => props.value,
  383. (newValue) => {
  384. xml.value = newValue
  385. createNewDiagram(xml.value)
  386. }
  387. )
  388. watch(
  389. () => props.activityData,
  390. (newActivityData) => {
  391. activityLists.value = newActivityData
  392. createNewDiagram(xml.value)
  393. }
  394. )
  395. watch(
  396. () => props.processInstanceData,
  397. (newProcessInstanceData) => {
  398. processInstance.value = newProcessInstanceData
  399. createNewDiagram(xml.value)
  400. }
  401. )
  402. watch(
  403. () => props.taskData,
  404. (newTaskListData) => {
  405. taskList.value = newTaskListData
  406. createNewDiagram(xml.value)
  407. }
  408. )
  409. </script>
  410. <style>
  411. /** 处理中 */
  412. .highlight-todo.djs-connection > .djs-visual > path {
  413. stroke: #1890ff !important;
  414. stroke-dasharray: 4px !important;
  415. fill-opacity: 0.2 !important;
  416. }
  417. .highlight-todo.djs-shape .djs-visual > :nth-child(1) {
  418. fill: #1890ff !important;
  419. stroke: #1890ff !important;
  420. stroke-dasharray: 4px !important;
  421. fill-opacity: 0.2 !important;
  422. }
  423. :deep(.highlight-todo.djs-connection > .djs-visual > path) {
  424. stroke: #1890ff !important;
  425. stroke-dasharray: 4px !important;
  426. fill-opacity: 0.2 !important;
  427. marker-end: url('#sequenceflow-end-_E7DFDF-_E7DFDF-803g1kf6zwzmcig1y2ulm5egr');
  428. }
  429. :deep(.highlight-todo.djs-shape .djs-visual > :nth-child(1)) {
  430. fill: #1890ff !important;
  431. stroke: #1890ff !important;
  432. stroke-dasharray: 4px !important;
  433. fill-opacity: 0.2 !important;
  434. }
  435. /** 通过 */
  436. .highlight.djs-shape .djs-visual > :nth-child(1) {
  437. fill: green !important;
  438. stroke: green !important;
  439. fill-opacity: 0.2 !important;
  440. }
  441. .highlight.djs-shape .djs-visual > :nth-child(2) {
  442. fill: green !important;
  443. }
  444. .highlight.djs-shape .djs-visual > path {
  445. fill: green !important;
  446. fill-opacity: 0.2 !important;
  447. stroke: green !important;
  448. }
  449. .highlight.djs-connection > .djs-visual > path {
  450. stroke: green !important;
  451. }
  452. .highlight:not(.djs-connection) .djs-visual > :nth-child(1) {
  453. fill: green !important; /* color elements as green */
  454. }
  455. :deep(.highlight.djs-shape .djs-visual > :nth-child(1)) {
  456. fill: green !important;
  457. stroke: green !important;
  458. fill-opacity: 0.2 !important;
  459. }
  460. :deep(.highlight.djs-shape .djs-visual > :nth-child(2)) {
  461. fill: green !important;
  462. }
  463. :deep(.highlight.djs-shape .djs-visual > path) {
  464. fill: green !important;
  465. fill-opacity: 0.2 !important;
  466. stroke: green !important;
  467. }
  468. :deep(.highlight.djs-connection > .djs-visual > path) {
  469. stroke: green !important;
  470. }
  471. /** 不通过 */
  472. .highlight-reject.djs-shape .djs-visual > :nth-child(1) {
  473. fill: red !important;
  474. stroke: red !important;
  475. fill-opacity: 0.2 !important;
  476. }
  477. .highlight-reject.djs-shape .djs-visual > :nth-child(2) {
  478. fill: red !important;
  479. }
  480. .highlight-reject.djs-shape .djs-visual > path {
  481. fill: red !important;
  482. fill-opacity: 0.2 !important;
  483. stroke: red !important;
  484. }
  485. .highlight-reject.djs-connection > .djs-visual > path {
  486. stroke: red !important;
  487. }
  488. .highlight-reject:not(.djs-connection) .djs-visual > :nth-child(1) {
  489. fill: red !important; /* color elements as green */
  490. }
  491. :deep(.highlight-reject.djs-shape .djs-visual > :nth-child(1)) {
  492. fill: red !important;
  493. stroke: red !important;
  494. fill-opacity: 0.2 !important;
  495. }
  496. :deep(.highlight-reject.djs-shape .djs-visual > :nth-child(2)) {
  497. fill: red !important;
  498. }
  499. :deep(.highlight-reject.djs-shape .djs-visual > path) {
  500. fill: red !important;
  501. fill-opacity: 0.2 !important;
  502. stroke: red !important;
  503. }
  504. :deep(.highlight-reject.djs-connection > .djs-visual > path) {
  505. stroke: red !important;
  506. }
  507. /** 已取消 */
  508. .highlight-cancel.djs-shape .djs-visual > :nth-child(1) {
  509. fill: grey !important;
  510. stroke: grey !important;
  511. fill-opacity: 0.2 !important;
  512. }
  513. .highlight-cancel.djs-shape .djs-visual > :nth-child(2) {
  514. fill: grey !important;
  515. }
  516. .highlight-cancel.djs-shape .djs-visual > path {
  517. fill: grey !important;
  518. fill-opacity: 0.2 !important;
  519. stroke: grey !important;
  520. }
  521. .highlight-cancel.djs-connection > .djs-visual > path {
  522. stroke: grey !important;
  523. }
  524. .highlight-cancel:not(.djs-connection) .djs-visual > :nth-child(1) {
  525. fill: grey !important; /* color elements as green */
  526. }
  527. :deep(.highlight-cancel.djs-shape .djs-visual > :nth-child(1)) {
  528. fill: grey !important;
  529. stroke: grey !important;
  530. fill-opacity: 0.2 !important;
  531. }
  532. :deep(.highlight-cancel.djs-shape .djs-visual > :nth-child(2)) {
  533. fill: grey !important;
  534. }
  535. :deep(.highlight-cancel.djs-shape .djs-visual > path) {
  536. fill: grey !important;
  537. fill-opacity: 0.2 !important;
  538. stroke: grey !important;
  539. }
  540. :deep(.highlight-cancel.djs-connection > .djs-visual > path) {
  541. stroke: grey !important;
  542. }
  543. /** 回退 */
  544. .highlight-return.djs-shape .djs-visual > :nth-child(1) {
  545. fill: #e6a23c !important;
  546. stroke: #e6a23c !important;
  547. fill-opacity: 0.2 !important;
  548. }
  549. .highlight-return.djs-shape .djs-visual > :nth-child(2) {
  550. fill: #e6a23c !important;
  551. }
  552. .highlight-return.djs-shape .djs-visual > path {
  553. fill: #e6a23c !important;
  554. fill-opacity: 0.2 !important;
  555. stroke: #e6a23c !important;
  556. }
  557. .highlight-return.djs-connection > .djs-visual > path {
  558. stroke: #e6a23c !important;
  559. }
  560. .highlight-return:not(.djs-connection) .djs-visual > :nth-child(1) {
  561. fill: #e6a23c !important; /* color elements as green */
  562. }
  563. :deep(.highlight-return.djs-shape .djs-visual > :nth-child(1)) {
  564. fill: #e6a23c !important;
  565. stroke: #e6a23c !important;
  566. fill-opacity: 0.2 !important;
  567. }
  568. :deep(.highlight-return.djs-shape .djs-visual > :nth-child(2)) {
  569. fill: #e6a23c !important;
  570. }
  571. :deep(.highlight-return.djs-shape .djs-visual > path) {
  572. fill: #e6a23c !important;
  573. fill-opacity: 0.2 !important;
  574. stroke: #e6a23c !important;
  575. }
  576. :deep(.highlight-return.djs-connection > .djs-visual > path) {
  577. stroke: #e6a23c !important;
  578. }
  579. .element-overlays {
  580. width: 200px;
  581. padding: 8px;
  582. color: #fafafa;
  583. background: rgb(0 0 0 / 60%);
  584. border-radius: 4px;
  585. box-sizing: border-box;
  586. }
  587. </style>