simple-process-designer.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. .simple-flow-canvas {
  2. position: absolute;
  3. inset: 0;
  4. z-index: 1;
  5. overflow: auto;
  6. background-color: #fafafa;
  7. user-select: none;
  8. .simple-flow-container {
  9. position: relative;
  10. display: flex;
  11. flex-direction: column;
  12. justify-content: center;
  13. align-items: center;
  14. .top-area-container {
  15. position: sticky;
  16. inset: 0;
  17. display: flex;
  18. width: 100%;
  19. height: 42px;
  20. z-index: 1;
  21. // padding: 4px 0;
  22. background-color: #fff;
  23. justify-content: flex-end;
  24. align-items: center;
  25. .top-actions {
  26. display: flex;
  27. margin: 4px;
  28. margin-right: 8px;
  29. align-items: center;
  30. .canvas-control {
  31. font-size: 16px;
  32. .control-scale-group {
  33. display: inline-flex;
  34. align-items: center;
  35. margin-right: 8px;
  36. .control-scale-button {
  37. display: inline-flex;
  38. width: 28px;
  39. height: 28px;
  40. padding: 2px;
  41. text-align: center;
  42. cursor: pointer;
  43. justify-content: center;
  44. align-items: center;
  45. }
  46. .control-scale-label {
  47. margin: 0 4px;
  48. font-size: 14px;
  49. }
  50. }
  51. }
  52. }
  53. }
  54. .scale-container {
  55. display: flex;
  56. flex-direction: column;
  57. justify-content: center;
  58. align-items: center;
  59. margin-top: 16px;
  60. background-color: #fafafa;
  61. transform-origin: 50% 0 0;
  62. transform: scale(1);
  63. transition: transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  64. // 节点容器 定义节点宽度
  65. .node-container {
  66. width: 200px;
  67. }
  68. // 节点
  69. .node-box {
  70. position: relative;
  71. display: flex;
  72. min-height: 70px;
  73. padding: 5px 10px 8px;
  74. cursor: pointer;
  75. background-color: #fff;
  76. flex-direction: column;
  77. border: 2px solid transparent;
  78. // border-color: #0089ff;
  79. border-radius: 8px;
  80. // border-color: #0089ff;
  81. box-shadow: 0 1px 4px 0 rgba(10, 30, 65, 0.16);
  82. transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1);
  83. &:hover {
  84. // border-color: #0089ff;
  85. .node-toolbar {
  86. opacity: 1;
  87. }
  88. }
  89. // 普通节点标题
  90. .node-title-container {
  91. display: flex;
  92. padding: 4px;
  93. cursor: pointer;
  94. border-radius: 4px 4px 0 0;
  95. align-items: center;
  96. .node-title-icon {
  97. display: flex;
  98. align-items: center;
  99. &.user-task {
  100. color: #ff943e;
  101. }
  102. &.copy-task {
  103. color: #3296fa;
  104. }
  105. }
  106. .node-title {
  107. margin-left: 4px;
  108. font-size: 14px;
  109. font-weight: 600;
  110. white-space: nowrap;
  111. overflow: hidden;
  112. text-overflow: ellipsis;
  113. color: #1f1f1f;
  114. line-height: 18px;
  115. }
  116. }
  117. // 条件节点标题
  118. .branch-node-title-container {
  119. display: flex;
  120. padding: 4px;
  121. cursor: pointer;
  122. border-radius: 4px 4px 0 0;
  123. align-items: center;
  124. justify-content: space-between;
  125. .branch-title {
  126. max-width: 120px;
  127. font-size: 13px;
  128. font-weight: 600;
  129. color: #f60;
  130. }
  131. .branch-priority {
  132. min-width: 50px;
  133. font-size: 13px;
  134. }
  135. }
  136. .node-content {
  137. display: flex;
  138. min-height: 32px;
  139. padding: 4px 8px;
  140. margin-top: 4px;
  141. line-height: 32px;
  142. justify-content: space-between;
  143. align-items: center;
  144. color: #111f2c;
  145. background: rgba(0, 0, 0, 0.03);
  146. border-radius: 4px;
  147. .node-text {
  148. display: -webkit-box;
  149. overflow: hidden;
  150. font-size: 14px;
  151. line-height: 24px;
  152. text-overflow: ellipsis;
  153. word-break: break-all;
  154. -webkit-line-clamp: 2; /* 这将限制文本显示为两行 */
  155. -webkit-box-orient: vertical;
  156. }
  157. }
  158. .node-toolbar {
  159. opacity: 0;
  160. position: absolute;
  161. top: -26px;
  162. right: 10px;
  163. display: flex;
  164. .toolbar-icon {
  165. text-align: center;
  166. vertical-align: middle;
  167. color: #000;
  168. border-radius: 4px;
  169. }
  170. }
  171. }
  172. .node-config-error {
  173. border-color: #ff5219;
  174. }
  175. // 普通节点包装
  176. .node-wrapper {
  177. display: flex;
  178. flex-direction: column;
  179. justify-content: center;
  180. align-items: center;
  181. }
  182. // 节点连线处理
  183. .node-handler-wrapper {
  184. position: relative;
  185. display: flex;
  186. height: 70px;
  187. align-items: center;
  188. user-select: none;
  189. justify-content: center;
  190. flex-direction: column;
  191. &::before {
  192. position: absolute;
  193. top: 0;
  194. right: 0;
  195. left: 0;
  196. // bottom: 5px;
  197. bottom: 0px;
  198. z-index: 0;
  199. width: 2px;
  200. height: 100%;
  201. // height: calc(100% - 5px);
  202. margin: auto;
  203. background-color: #dedede;
  204. content: '';
  205. }
  206. .node-handler {
  207. .add-icon {
  208. position: relative;
  209. top: -5px;
  210. display: flex;
  211. align-items: center;
  212. justify-content: center;
  213. cursor: pointer;
  214. width: 25px;
  215. height: 25px;
  216. color: #fff;
  217. background-color: #0089ff;
  218. border-radius: 50%;
  219. &:hover{
  220. transform: scale(1.1);
  221. }
  222. }
  223. }
  224. .node-handler-arrow {
  225. position: absolute;
  226. bottom: 0;
  227. left: 50%;
  228. display: flex;
  229. transform: translateX(-50%);
  230. }
  231. }
  232. // 条件节点包装
  233. .branch-node-wrapper {
  234. position: relative;
  235. display: flex;
  236. flex-direction: column;
  237. justify-content: center;
  238. align-items: center;
  239. margin-top: 16px;
  240. .branch-node-container {
  241. position: relative;
  242. display: flex;
  243. &::before {
  244. position: absolute;
  245. height: 100%;
  246. width: 4px;
  247. background-color: #fafafa;
  248. content: "";
  249. left: 50%;
  250. transform: translate(-50%);
  251. }
  252. .branch-node-add {
  253. position: absolute;
  254. top: -18px;
  255. left: 50%;
  256. z-index: 1;
  257. height: 36px;
  258. padding: 0 10px;
  259. font-size: 12px;
  260. line-height: 36px;
  261. color: #222;
  262. cursor: pointer;
  263. background: #fff;
  264. border: 2px solid #dedede;
  265. border-radius: 18px;
  266. transform: translateX(-50%);
  267. transform-origin: center center;
  268. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  269. }
  270. .branch-node-item {
  271. position: relative;
  272. display: flex;
  273. flex-direction: column;
  274. align-items: center;
  275. min-width: 280px;
  276. padding: 40px 40px 0;
  277. background: transparent;
  278. border-top: 2px solid #dedede;
  279. border-bottom: 2px solid #dedede;
  280. &::before {
  281. position: absolute;
  282. width: 2px;
  283. height: 100%;
  284. margin: auto;
  285. inset: 0;
  286. background-color: #dedede;
  287. content: '';
  288. }
  289. }
  290. // 覆盖条件节点第一个节点左上角的线
  291. .branch-line-first-top {
  292. position: absolute;
  293. top: -5px;
  294. left: -1px;
  295. width: 50%;
  296. height: 7px;
  297. background-color: #fafafa;
  298. content: '';
  299. }
  300. // 覆盖条件节点第一个节点左下角的线
  301. .branch-line-first-bottom {
  302. position: absolute;
  303. bottom: -5px;
  304. left: -1px;
  305. width: 50%;
  306. height: 7px;
  307. background-color: #fafafa;
  308. content: '';
  309. }
  310. // 覆盖条件节点最后一个节点右上角的线
  311. .branch-line-last-top {
  312. position: absolute;
  313. top: -5px;
  314. right: -1px;
  315. width: 50%;
  316. height: 7px;
  317. background-color: #fafafa;
  318. content: '';
  319. }
  320. // 覆盖条件节点最后一个节点右下角的线
  321. .branch-line-last-bottom {
  322. position: absolute;
  323. right: -1px;
  324. bottom: -5px;
  325. width: 50%;
  326. height: 7px;
  327. background-color: #fafafa;
  328. content: '';
  329. }
  330. }
  331. }
  332. .node-fixed-name {
  333. display: inline-block;
  334. width: auto;
  335. padding: 0 4px;
  336. overflow: hidden;
  337. text-align: center;
  338. text-overflow: ellipsis;
  339. white-space: nowrap;
  340. }
  341. // 开始节点包装
  342. .start-node-wrapper {
  343. position: relative;
  344. margin-top: 16px;
  345. .start-node-container {
  346. display: flex;
  347. flex-direction: column;
  348. justify-content: center;
  349. align-items: center;
  350. .start-node-box {
  351. display: flex;
  352. justify-content: center;
  353. align-items: center;
  354. width: 90px;
  355. height: 36px;
  356. padding: 3px 4px;
  357. color: #212121;
  358. cursor: pointer;
  359. // background: #2c2c2c;
  360. background: #fafafa;
  361. border-radius: 30px;
  362. box-shadow: 0 1px 5px 0 rgba(10, 30, 65, 0.08);
  363. box-sizing: border-box;
  364. }
  365. }
  366. }
  367. // 结束节点包装
  368. .end-node-wrapper {
  369. margin-bottom: 16px;
  370. .end-node-box {
  371. display: flex;
  372. justify-content: center;
  373. align-items: center;
  374. width: 80px;
  375. height: 36px;
  376. color: #212121;
  377. // background: #6e6e6e;
  378. background: #fafafa;
  379. border-radius: 30px;
  380. box-shadow: 0 1px 5px 0 rgba(10, 30, 65, 0.08);
  381. box-sizing: border-box;
  382. }
  383. }
  384. // 可编辑的 title 输入框
  385. .editable-title-input {
  386. height: 20px;
  387. line-height: 20px;
  388. font-size: 12px;
  389. margin-left: 4px;
  390. border: 1px solid #d9d9d9;
  391. border-radius: 4px;
  392. transition: all 0.3s;
  393. &:focus {
  394. border-color: #40a9ff;
  395. outline: 0;
  396. box-shadow: 0 0 0 2px rgba(24, 144, 255, .2)
  397. }
  398. }
  399. }
  400. }
  401. }
  402. // 节点连线气泡卡片样式
  403. .handler-item-wrapper {
  404. display: flex;
  405. cursor: pointer;
  406. .handler-item {
  407. margin-right: 8px;
  408. }
  409. .handler-item-icon {
  410. width: 80px;
  411. height: 80px;
  412. background: #fff;
  413. border: 1px solid #e2e2e2;
  414. border-radius: 50%;
  415. transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  416. user-select: none;
  417. text-align: center;
  418. &:hover {
  419. background: #e2e2e2;
  420. box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  421. }
  422. .icon-size {
  423. font-size: 35px;
  424. line-height: 80px;
  425. }
  426. }
  427. .approve {
  428. color: #ff943e;
  429. }
  430. .copy {
  431. color: #3296fa;
  432. }
  433. .handler-item-text {
  434. margin-top: 4px;
  435. width: 80px;
  436. text-align: center;
  437. }
  438. }
  439. // iconfont 样式
  440. @font-face {
  441. font-family: "iconfont"; /* Project id 4495938 */
  442. src: url('iconfont.woff2?t=1712392083512') format('woff2'),
  443. url('iconfont.woff?t=1712392083512') format('woff'),
  444. url('iconfont.ttf?t=1712392083512') format('truetype');
  445. }
  446. .iconfont {
  447. font-family: "iconfont" !important;
  448. font-size: 16px;
  449. font-style: normal;
  450. -webkit-font-smoothing: antialiased;
  451. -moz-osx-font-smoothing: grayscale;
  452. }
  453. .icon-Inclusive:before {
  454. content: "\e602";
  455. }
  456. .icon-copy:before {
  457. content: "\e7eb";
  458. }
  459. .icon-handle:before {
  460. content: "\e61c";
  461. }
  462. .icon-exclusive:before {
  463. content: "\e717";
  464. }
  465. .icon-approve:before {
  466. content: "\e715";
  467. }
  468. .icon-parallel:before {
  469. content: "\e688";
  470. }