ProcessViewer.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  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.status))
  115. //标记是否高亮了进行中任务
  116. if (task.status === 1) {
  117. findProcessTask = true
  118. }
  119. // 如果非通过,就不走后面的线条了
  120. if (task.status !== 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.status === 1) {
  199. return
  200. }
  201. canvas.addMarker(n.id, getResultCss(processInstance.value.status))
  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. // TODO 芋艿:后面 .definitionKey 再看
  220. taskList.value = taskList.value.filter(
  221. (item) => !removeTaskDefinitionKeyList.includes(item.definitionKey)
  222. )
  223. }
  224. }
  225. const getActivityHighlightCss = (activity) => {
  226. return activity.endTime ? 'highlight' : 'highlight-todo'
  227. }
  228. const getResultCss = (result) => {
  229. if (result === 1) {
  230. // 审批中
  231. return 'highlight-todo'
  232. } else if (result === 2) {
  233. // 已通过
  234. return 'highlight'
  235. } else if (result === 3) {
  236. // 不通过
  237. return 'highlight-reject'
  238. } else if (result === 4) {
  239. // 已取消
  240. return 'highlight-cancel'
  241. } else if (result === 5) {
  242. // 退回
  243. return 'highlight-return'
  244. } else if (result === 6) {
  245. // 委派
  246. return 'highlight-return'
  247. } else if (result === 7 || result === 8 || result === 9) {
  248. // 待后加签任务完成/待前加签任务完成/待前置任务完成
  249. return 'highlight-return'
  250. }
  251. return ''
  252. }
  253. const getActivityOutgoing = (activity) => {
  254. // 如果有 outgoing,则直接使用它
  255. if (activity.outgoing && activity.outgoing.length > 0) {
  256. return activity.outgoing
  257. }
  258. // 如果没有,则遍历获得起点为它的【bpmn:SequenceFlow】节点们。原因是:bpmn-js 的 UserTask 拿不到 outgoing
  259. const flowElements = bpmnModeler.getDefinitions().rootElements[0].flowElements
  260. const outgoing: any[] = []
  261. flowElements.forEach((item: any) => {
  262. if (item.$type !== 'bpmn:SequenceFlow') {
  263. return
  264. }
  265. if (item.sourceRef.id === activity.key) {
  266. outgoing.push(item)
  267. }
  268. })
  269. return outgoing
  270. }
  271. const initModelListeners = () => {
  272. const EventBus = bpmnModeler.get('eventBus')
  273. // 注册需要的监听事件
  274. EventBus.on('element.hover', function (eventObj) {
  275. let element = eventObj ? eventObj.element : null
  276. elementHover(element)
  277. })
  278. EventBus.on('element.out', function (eventObj) {
  279. let element = eventObj ? eventObj.element : null
  280. elementOut(element)
  281. })
  282. }
  283. // 流程图的元素被 hover
  284. const elementHover = (element) => {
  285. element.value = element
  286. !elementOverlayIds.value && (elementOverlayIds.value = {})
  287. !overlays.value && (overlays.value = bpmnModeler.get('overlays'))
  288. // 展示信息
  289. console.log(activityLists.value, 'activityLists.value')
  290. console.log(element.value, 'element.value')
  291. const activity = activityLists.value.find((m) => m.key === element.value.id)
  292. console.log(activity, 'activityactivityactivityactivity')
  293. if (!activity) {
  294. return
  295. }
  296. if (!elementOverlayIds.value[element.value.id] && element.value.type !== 'bpmn:Process') {
  297. let html = `<div class="element-overlays">
  298. <p>Elemet id: ${element.value.id}</p>
  299. <p>Elemet type: ${element.value.type}</p>
  300. </div>` // 默认值
  301. if (element.value.type === 'bpmn:StartEvent' && processInstance.value) {
  302. html = `<p>发起人:${processInstance.value.startUser.nickname}</p>
  303. <p>部门:${processInstance.value.startUser.deptName}</p>
  304. <p>创建时间:${formatDate(processInstance.value.createTime)}`
  305. } else if (element.value.type === 'bpmn:UserTask') {
  306. // debugger
  307. let task = taskList.value.find((m) => m.id === activity.taskId) // 找到活动对应的 taskId
  308. if (!task) {
  309. return
  310. }
  311. let optionData = getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
  312. let dataResult = ''
  313. optionData.forEach((element) => {
  314. if (element.value == task.status) {
  315. dataResult = element.label
  316. }
  317. })
  318. html = `<p>审批人:${task.assigneeUser.nickname}</p>
  319. <p>部门:${task.assigneeUser.deptName}</p>
  320. <p>结果:${dataResult}</p>
  321. <p>创建时间:${formatDate(task.createTime)}</p>`
  322. // html = `<p>审批人:${task.assigneeUser.nickname}</p>
  323. // <p>部门:${task.assigneeUser.deptName}</p>
  324. // <p>结果:${getIntDictOptions(
  325. // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  326. // task.status
  327. // )}</p>
  328. // <p>创建时间:${formatDate(task.createTime)}</p>`
  329. if (task.endTime) {
  330. html += `<p>结束时间:${formatDate(task.endTime)}</p>`
  331. }
  332. if (task.reason) {
  333. html += `<p>审批建议:${task.reason}</p>`
  334. }
  335. } else if (element.value.type === 'bpmn:ServiceTask' && processInstance.value) {
  336. if (activity.startTime > 0) {
  337. html = `<p>创建时间:${formatDate(activity.startTime)}</p>`
  338. }
  339. if (activity.endTime > 0) {
  340. html += `<p>结束时间:${formatDate(activity.endTime)}</p>`
  341. }
  342. console.log(html)
  343. } else if (element.value.type === 'bpmn:EndEvent' && processInstance.value) {
  344. let optionData = getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)
  345. let dataResult = ''
  346. optionData.forEach((element) => {
  347. if (element.value == processInstance.value.status) {
  348. dataResult = element.label
  349. }
  350. })
  351. html = `<p>结果:${dataResult}</p>`
  352. // html = `<p>结果:${getIntDictOptions(
  353. // DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT,
  354. // processInstance.value.status
  355. // )}</p>`
  356. if (processInstance.value.endTime) {
  357. html += `<p>结束时间:${formatDate(processInstance.value.endTime)}</p>`
  358. }
  359. }
  360. // console.log(html, 'html111111111111111')
  361. elementOverlayIds.value[element.value.id] = toRaw(overlays.value)?.add(element.value, {
  362. position: { left: 0, bottom: 0 },
  363. html: `<div class="element-overlays">${html}</div>`
  364. })
  365. }
  366. }
  367. // 流程图的元素被 out
  368. const elementOut = (element) => {
  369. toRaw(overlays.value).remove({ element })
  370. elementOverlayIds.value[element.id] = null
  371. }
  372. onMounted(() => {
  373. xml.value = props.value
  374. activityLists.value = props.activityData
  375. // 初始化
  376. initBpmnModeler()
  377. createNewDiagram(xml.value)
  378. // 初始模型的监听器
  379. initModelListeners()
  380. })
  381. onBeforeUnmount(() => {
  382. // this.$once('hook:beforeDestroy', () => {
  383. // })
  384. if (bpmnModeler) bpmnModeler.destroy()
  385. emit('destroy', bpmnModeler)
  386. bpmnModeler = null
  387. })
  388. watch(
  389. () => props.value,
  390. (newValue) => {
  391. xml.value = newValue
  392. createNewDiagram(xml.value)
  393. }
  394. )
  395. watch(
  396. () => props.activityData,
  397. (newActivityData) => {
  398. activityLists.value = newActivityData
  399. createNewDiagram(xml.value)
  400. }
  401. )
  402. watch(
  403. () => props.processInstanceData,
  404. (newProcessInstanceData) => {
  405. processInstance.value = newProcessInstanceData
  406. createNewDiagram(xml.value)
  407. }
  408. )
  409. watch(
  410. () => props.taskData,
  411. (newTaskListData) => {
  412. taskList.value = newTaskListData
  413. createNewDiagram(xml.value)
  414. }
  415. )
  416. </script>
  417. <style>
  418. /** 处理中 */
  419. .highlight-todo.djs-connection > .djs-visual > path {
  420. stroke: #1890ff !important;
  421. stroke-dasharray: 4px !important;
  422. fill-opacity: 0.2 !important;
  423. }
  424. .highlight-todo.djs-shape .djs-visual > :nth-child(1) {
  425. fill: #1890ff !important;
  426. stroke: #1890ff !important;
  427. stroke-dasharray: 4px !important;
  428. fill-opacity: 0.2 !important;
  429. }
  430. :deep(.highlight-todo.djs-connection > .djs-visual > path) {
  431. stroke: #1890ff !important;
  432. stroke-dasharray: 4px !important;
  433. fill-opacity: 0.2 !important;
  434. marker-end: url('#sequenceflow-end-_E7DFDF-_E7DFDF-803g1kf6zwzmcig1y2ulm5egr');
  435. }
  436. :deep(.highlight-todo.djs-shape .djs-visual > :nth-child(1)) {
  437. fill: #1890ff !important;
  438. stroke: #1890ff !important;
  439. stroke-dasharray: 4px !important;
  440. fill-opacity: 0.2 !important;
  441. }
  442. /** 通过 */
  443. .highlight.djs-shape .djs-visual > :nth-child(1) {
  444. fill: green !important;
  445. stroke: green !important;
  446. fill-opacity: 0.2 !important;
  447. }
  448. .highlight.djs-shape .djs-visual > :nth-child(2) {
  449. fill: green !important;
  450. }
  451. .highlight.djs-shape .djs-visual > path {
  452. fill: green !important;
  453. fill-opacity: 0.2 !important;
  454. stroke: green !important;
  455. }
  456. .highlight.djs-connection > .djs-visual > path {
  457. stroke: green !important;
  458. }
  459. .highlight:not(.djs-connection) .djs-visual > :nth-child(1) {
  460. fill: green !important; /* color elements as green */
  461. }
  462. :deep(.highlight.djs-shape .djs-visual > :nth-child(1)) {
  463. fill: green !important;
  464. stroke: green !important;
  465. fill-opacity: 0.2 !important;
  466. }
  467. :deep(.highlight.djs-shape .djs-visual > :nth-child(2)) {
  468. fill: green !important;
  469. }
  470. :deep(.highlight.djs-shape .djs-visual > path) {
  471. fill: green !important;
  472. fill-opacity: 0.2 !important;
  473. stroke: green !important;
  474. }
  475. :deep(.highlight.djs-connection > .djs-visual > path) {
  476. stroke: green !important;
  477. }
  478. /** 不通过 */
  479. .highlight-reject.djs-shape .djs-visual > :nth-child(1) {
  480. fill: red !important;
  481. stroke: red !important;
  482. fill-opacity: 0.2 !important;
  483. }
  484. .highlight-reject.djs-shape .djs-visual > :nth-child(2) {
  485. fill: red !important;
  486. }
  487. .highlight-reject.djs-shape .djs-visual > path {
  488. fill: red !important;
  489. fill-opacity: 0.2 !important;
  490. stroke: red !important;
  491. }
  492. .highlight-reject.djs-connection > .djs-visual > path {
  493. stroke: red !important;
  494. }
  495. .highlight-reject:not(.djs-connection) .djs-visual > :nth-child(1) {
  496. fill: red !important; /* color elements as green */
  497. }
  498. :deep(.highlight-reject.djs-shape .djs-visual > :nth-child(1)) {
  499. fill: red !important;
  500. stroke: red !important;
  501. fill-opacity: 0.2 !important;
  502. }
  503. :deep(.highlight-reject.djs-shape .djs-visual > :nth-child(2)) {
  504. fill: red !important;
  505. }
  506. :deep(.highlight-reject.djs-shape .djs-visual > path) {
  507. fill: red !important;
  508. fill-opacity: 0.2 !important;
  509. stroke: red !important;
  510. }
  511. :deep(.highlight-reject.djs-connection > .djs-visual > path) {
  512. stroke: red !important;
  513. }
  514. /** 已取消 */
  515. .highlight-cancel.djs-shape .djs-visual > :nth-child(1) {
  516. fill: grey !important;
  517. stroke: grey !important;
  518. fill-opacity: 0.2 !important;
  519. }
  520. .highlight-cancel.djs-shape .djs-visual > :nth-child(2) {
  521. fill: grey !important;
  522. }
  523. .highlight-cancel.djs-shape .djs-visual > path {
  524. fill: grey !important;
  525. fill-opacity: 0.2 !important;
  526. stroke: grey !important;
  527. }
  528. .highlight-cancel.djs-connection > .djs-visual > path {
  529. stroke: grey !important;
  530. }
  531. .highlight-cancel:not(.djs-connection) .djs-visual > :nth-child(1) {
  532. fill: grey !important; /* color elements as green */
  533. }
  534. :deep(.highlight-cancel.djs-shape .djs-visual > :nth-child(1)) {
  535. fill: grey !important;
  536. stroke: grey !important;
  537. fill-opacity: 0.2 !important;
  538. }
  539. :deep(.highlight-cancel.djs-shape .djs-visual > :nth-child(2)) {
  540. fill: grey !important;
  541. }
  542. :deep(.highlight-cancel.djs-shape .djs-visual > path) {
  543. fill: grey !important;
  544. fill-opacity: 0.2 !important;
  545. stroke: grey !important;
  546. }
  547. :deep(.highlight-cancel.djs-connection > .djs-visual > path) {
  548. stroke: grey !important;
  549. }
  550. /** 回退 */
  551. .highlight-return.djs-shape .djs-visual > :nth-child(1) {
  552. fill: #e6a23c !important;
  553. stroke: #e6a23c !important;
  554. fill-opacity: 0.2 !important;
  555. }
  556. .highlight-return.djs-shape .djs-visual > :nth-child(2) {
  557. fill: #e6a23c !important;
  558. }
  559. .highlight-return.djs-shape .djs-visual > path {
  560. fill: #e6a23c !important;
  561. fill-opacity: 0.2 !important;
  562. stroke: #e6a23c !important;
  563. }
  564. .highlight-return.djs-connection > .djs-visual > path {
  565. stroke: #e6a23c !important;
  566. }
  567. .highlight-return:not(.djs-connection) .djs-visual > :nth-child(1) {
  568. fill: #e6a23c !important; /* color elements as green */
  569. }
  570. :deep(.highlight-return.djs-shape .djs-visual > :nth-child(1)) {
  571. fill: #e6a23c !important;
  572. stroke: #e6a23c !important;
  573. fill-opacity: 0.2 !important;
  574. }
  575. :deep(.highlight-return.djs-shape .djs-visual > :nth-child(2)) {
  576. fill: #e6a23c !important;
  577. }
  578. :deep(.highlight-return.djs-shape .djs-visual > path) {
  579. fill: #e6a23c !important;
  580. fill-opacity: 0.2 !important;
  581. stroke: #e6a23c !important;
  582. }
  583. :deep(.highlight-return.djs-connection > .djs-visual > path) {
  584. stroke: #e6a23c !important;
  585. }
  586. .element-overlays {
  587. width: 200px;
  588. padding: 8px;
  589. color: #fafafa;
  590. background: rgb(0 0 0 / 60%);
  591. border-radius: 4px;
  592. box-sizing: border-box;
  593. }
  594. </style>