ProcessViewer.vue 20 KB

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