hn-workflow-components 1.1.6 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31993,7 +31993,13 @@ function xc() {
31993
31993
  const [e, t] = Qe(), n = ln(), r = Ee((o) => {
31994
31994
  t(o);
31995
31995
  }, []);
31996
- return at(() => n == null ? void 0 : n.subscribeStartNodeChange(r), [r, n]), at(() => {
31996
+ return at(() => {
31997
+ console.log("subscribe startNode");
31998
+ const o = n == null ? void 0 : n.subscribeStartNodeChange(r);
31999
+ return () => {
32000
+ console.log("unsubscribe startNode"), o == null || o();
32001
+ };
32002
+ }, [r, n]), at(() => {
31997
32003
  t(n == null ? void 0 : n.store.getState().startNode);
31998
32004
  }, [n == null ? void 0 : n.store]), e;
31999
32005
  }
@@ -35402,6 +35408,7 @@ const bL = Ze((e) => {
35402
35408
  f.data.data.jsonBpmn && c.setStartNode(f.data.data.jsonBpmn);
35403
35409
  })());
35404
35410
  }, []), at(() => {
35411
+ console.log("set materials effect");
35405
35412
  const d = c.materials, f = c.materialUis;
35406
35413
  return c.materials = [...d, ...tS, ...o || []], c.materialUis = { ...f, ...a }, () => {
35407
35414
  c.materials = d, c.materialUis = f;
@@ -36065,7 +36072,10 @@ function tD({
36065
36072
  )) }) }) })
36066
36073
  ] });
36067
36074
  }
36068
- const FS = Co({}), Dc = () => Wt(FS);
36075
+ const FS = Co({});
36076
+ function Dc() {
36077
+ return Wt(FS);
36078
+ }
36069
36079
  function nD({ id: e, value: t, onChange: n }) {
36070
36080
  const { onSelectRoles: r } = Dc(), [o, a] = Qe([]), [i, l] = Qe();
36071
36081
  return at(() => {
@@ -417,7 +417,7 @@ html body {
417
417
  display: flex;
418
418
  `,s_=be.div`
419
419
  display: flex;
420
- `,l_=C.memo(e=>{const{title:t,actions:n,children:r}=e;return w.jsxs(a_,{children:[w.jsx(i_,{children:t}),r,w.jsx(s_,{children:n})]})}),c_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M0 576a510.848 510.848 0 0 0 173.376 384l84.672-96a384 384 0 1 1 525.568-559.552L640.064 448h384V64l-149.952 149.952A512 512 0 0 0 0.064 576z","p-id":"2271"})})}),u_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M512 64a510.656 510.656 0 0 0-362.048 149.952L0 64v384h384L240.448 304.448a384 384 0 1 1 525.504 559.552l84.672 96A512 512 0 0 0 512 64z","p-id":"1866"})})}),d_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{width:"0.9em",height:"0.9em",fill:"currentColor",viewBox:"0 0 1024 1024",children:[w.jsx("path",{d:"M720 192h-544A80.096 80.096 0 0 0 96 272v608C96 924.128 131.904 960 176 960h544c44.128 0 80-35.872 80-80v-608C800 227.904 764.128 192 720 192z m16 688c0 8.8-7.2 16-16 16h-544a16 16 0 0 1-16-16v-608a16 16 0 0 1 16-16h544a16 16 0 0 1 16 16v608z","p-id":"2356"}),w.jsx("path",{d:"M848 64h-544a32 32 0 0 0 0 64h544a16 16 0 0 1 16 16v608a32 32 0 1 0 64 0v-608C928 99.904 892.128 64 848 64z","p-id":"2357"}),w.jsx("path",{d:"M608 360H288a32 32 0 0 0 0 64h320a32 32 0 1 0 0-64zM608 520H288a32 32 0 1 0 0 64h320a32 32 0 1 0 0-64zM480 678.656H288a32 32 0 1 0 0 64h192a32 32 0 1 0 0-64z","p-id":"2358"})]})}),f_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M422.399 601.6V493.323c-79.111-34.622-134.4-113.655-134.4-205.323 0-123.711 100.54-224 224-224 123.711 0 224 100.545 224 224 0 91.814-55.379 170.725-134.4 205.313V601.6h201.472c61.925 0 112.128 49.716 112.128 112.003V825.6H108.801V713.598c0-61.855 50.444-111.998 112.126-111.998h201.472zM153.601 870.4h716.793V960H153.6v-89.6z"})})}),m_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M915.82 142.44L97.84 458.18c-46.13 17.76-44.89 43.66 2.47 57.72l197.59 58.71 80.42 239.03c10.61 31.33 37.99 37.99 61.42 14.55l103.6-102.62 204.74 149.98c26.64 19.49 54.02 9.13 61.18-23.19L958.5 179.43c7.15-32.31-11.85-48.83-42.68-36.99zM791.49 294.63l-348.8 310.81c-6.17 5.67-11.84 16.78-12.83 24.91l-15.29 144.8c-1.73 16.28-7.4 17.02-12.58 1.23L334.4 572.89c-2.71-7.89 0.99-17.76 8.14-21.95l442.54-265.42c27.87-16.78 30.83-12.84 6.41 9.11z","p-id":"10639"})})}),g_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M525.96 69.895l256.652 124.437c15.903 7.71 22.544 26.852 14.834 42.755a32 32 0 0 1-14.834 14.833L544 367.61V472c0 1.006-0.023 2.006-0.07 3H720c34.993 0 63.426 28.084 63.991 62.942L784 539v123h96c17.673 0 32 14.327 32 32v186c0 17.673-14.327 32-32 32H624c-17.673 0-32-14.327-32-32V694c0-17.673 14.327-32 32-32h96V539H304v123h96c17.673 0 32 14.327 32 32v186c0 17.673-14.327 32-32 32H144c-17.673 0-32-14.327-32-32V694c0-17.673 14.327-32 32-32h96V539c0-34.993 28.084-63.426 62.942-63.991L304 475h176V367.61L241.388 251.92c-15.903-7.71-22.544-26.852-14.834-42.755a32 32 0 0 1 14.834-14.833L498.039 69.895a32 32 0 0 1 27.922 0z","p-id":"41560"})})}),p_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:w.jsx("path",{d:"M1015.15 491.1L533.69 9.63c-11.76-11.76-30.83-11.76-42.59 0L9.63 491.1C3.98 496.75 0.81 504.41 0.81 512.39s3.17 15.65 8.82 21.29l481.47 481.47a30.11 30.11 0 0 0 21.29 8.82c7.99 0 15.65-3.17 21.29-8.82l481.47-481.47c11.76-11.76 11.76-30.82 0-42.58zM512.39 951.27L73.51 512.39 512.39 73.51l438.88 438.88-438.88 438.88zM289.23 511.55c0 123.71 100.29 224 224 224s224-100.29 224-224-100.29-224-224-224-224 100.29-224 224z m224-160c42.74 0 82.92 16.64 113.14 46.86s46.86 70.4 46.86 113.14-16.64 82.92-46.86 113.14-70.4 46.86-113.14 46.86-82.92-16.64-113.14-46.86-46.86-70.4-46.86-113.14 16.64-82.92 46.86-113.14c30.23-30.22 70.41-46.86 113.14-46.86z"})})}),v_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:[w.jsx("path",{d:"M512 1012.622222c-41.718519 0-79.644444-15.17037-106.192593-45.511111l-348.918518-348.918518C26.548148 587.851852 11.377778 549.925926 11.377778 512s15.17037-79.644444 45.511111-106.192593l348.918518-348.918518c56.888889-56.888889 155.496296-56.888889 216.177778 0l348.918519 348.918518c30.340741 30.340741 45.511111 68.266667 45.511111 106.192593s-15.17037 79.644444-45.511111 106.192593l-348.918519 348.918518c-30.340741 30.340741-68.266667 45.511111-109.985185 45.511111z m0-925.392592c-18.962963 0-37.925926 7.585185-53.096296 22.755555l-348.918519 348.918519c-15.17037 15.17037-22.755556 34.133333-22.755555 53.096296s7.585185 37.925926 22.755555 53.096296l348.918519 348.918519c30.340741 30.340741 79.644444 30.340741 106.192592 0l348.918519-348.918519c15.17037-15.17037 22.755556-34.133333 22.755555-53.096296s-7.585185-37.925926-22.755555-53.096296l-348.918519-348.918519c-15.17037-15.17037-34.133333-22.755556-53.096296-22.755555z"}),w.jsx("path",{d:"M303.407407 455.111111h417.185186c22.755556 0 37.925926 15.17037 37.925926 37.925926s-15.17037 37.925926-37.925926 37.925926H303.407407c-22.755556 0-37.925926-15.17037-37.925926-37.925926s15.17037-37.925926 37.925926-37.925926z"}),w.jsx("path",{d:"M549.925926 284.444444v417.185186c0 22.755556-15.17037 37.925926-37.925926 37.925926s-37.925926-15.17037-37.925926-37.925926v-417.185186c0-22.755556 15.17037-37.925926 37.925926-37.925925s37.925926 15.17037 37.925926 37.925925z"})]})}),h_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",children:w.jsx("path",{d:"M928 672H832V448a320 320 0 0 0-257.28-313.664C574.912 132.096 576 130.24 576 128a64 64 0 1 0-128 0c0 2.24 1.088 4.096 1.28 6.336A319.936 319.936 0 0 0 192 448v224H96a32 32 0 0 0 0 64h832a32 32 0 0 0 0-64zM256 672V445.184C256 305.344 370.624 192 512 192s256 113.344 256 253.184V672H256zM512 896a96 96 0 0 1-96-96h-64a160 160 0 1 0 320 0h-64A96 96 0 0 1 512 896z"})})}),b_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:[w.jsx("path",{d:"M545.784454 962.539206l-65.943898 0c-29.341259 0-54.624085-25.281803-54.624085-54.615898L425.216471 868.462574c0-9.623171-7.826246-20.911262-16.690124-23.680329l-1.566682-0.611937-55.725162-23.104207-0.880043-0.494257c-8.153704-4.41045-22.017456-2.376117-28.55229 4.187369l-28.17469 28.123524c-9.930163 9.977235-23.239284 15.494902-37.432541 15.494902-14.195304 0-27.507494-5.517667-37.487799-15.541975l-46.682205-46.630017c-20.60427-20.603247-20.6319-54.233182-0.069585-74.974575l28.15013-28.106128c6.637164-6.574742 8.676613-20.599154 4.253884-28.909423l-0.831948-1.768273-23.164582-56.128345-0.26913-0.682545c-2.803859-9.03477-14.279215-17.394159-23.611767-17.394159l-39.631626 0c-29.391401 0-52.861952-24.065092-52.861952-53.193503l0-65.943898c0-28.770254 22.998807-51.754734 52.919257-51.754734l39.575344 0c9.081843 0 20.803815-8.830109 23.666002-18.057261l0.567935-1.476631 23.163559-57.088206 0.505513-0.913812c4.40431-8.220219 2.319835-22.224164-4.2897-28.830629l-28.04166-28.087709c-9.964956-9.921977-15.486716-23.216771-15.502066-37.396725-0.01535-14.201443 5.492084-27.53717 15.507182-37.552268l46.6556-46.614667c9.94142-9.985422 23.248494-15.503089 37.432541-15.503089 0.001023 0 0 0 0.001023 0 14.184047 0 27.490098 5.51869 37.46938 15.540951l28.039613 28.05087c6.557346 6.525624 20.500916 8.596795 28.655643 4.231371l0.893346-0.478907 57.375755-23.64963c8.836249-2.731204 16.634866-14.037714 16.634866-23.719214l0-39.632649c0-28.967752 24.777313-52.095495 54.624085-52.095495L545.784454 64.076364c29.161157 0 52.370765 22.636556 52.370765 52.095495l0 39.632649c0 9.127891 8.709359 20.85498 17.767666 23.674189l1.51654 0.577145 56.639998 23.113417 0.923022 0.509606c8.202822 4.424776 22.184255 2.353604 28.788673-4.254907l28.163433-27.912723c9.895371-9.94142 23.179932-15.33936 37.352723-15.33936 0.019443 0 0.040932 0 0.060375 0 14.18814 0 27.508517 5.375427 37.516452 15.384385l46.709835 46.554292c10.004865 9.960863 15.524578 23.254633 15.524578 37.47552 0 14.18814-5.498224 27.506471-15.479553 37.532825l-28.16855 28.152177c-6.580882 6.610558-8.640798 20.771069-4.204765 29.107945l0.478907 0.896416 23.654746 57.956993c2.902096 9.255805 14.635325 18.114566 23.686469 18.114566l39.132252 0 0-0.573051c27.629267 0 52.188616 22.984481 52.188616 52.327786l0 65.998133c0 29.590945-22.985504 53.138244-51.746548 53.138244l-39.630602 0c-9.337669 0-20.84884 8.372691-23.686469 17.423835l-0.580215 1.51654-23.086811 56.240909-0.468674 0.860601c-4.419659 8.30413-2.393513 22.320355 4.169973 28.855188l28.135804 28.02017c10.031471 10.029424 15.539928 23.350824 15.537881 37.541011-0.004093 14.186094-5.514597 27.505447-15.518438 37.505195l-46.747697 46.682205c-9.920954 9.964956-23.219841 15.506159-37.406958 15.506159-0.019443 0-0.040932 0-0.060375 0-14.192234 0-27.514657-5.514597-37.518498-15.517415l-28.039613-28.095895c-6.490831-6.490831-20.807908-8.575306-28.887934-4.206812l-0.951675 0.514723-57.93755 23.680329c-9.087982 2.859118-17.823947 14.594393-17.823947 23.691585l0 39.460734C598.155219 937.76394 574.45954 962.539206 545.784454 962.539206zM421.86719 806.892287c25.192775 8.370645 44.282552 34.650171 44.282552 61.570287l0 39.460734c0 7.114025 6.569626 13.68365 13.691837 13.68365L545.784454 921.606958c6.496971 0 12.461823-6.043646 12.461823-13.68365L558.246277 868.462574c0-26.273387 19.516496-53.131081 44.901653-61.58052l53.859675-22.062482c23.62814-12.116969 56.342216-7.098675 75.118861 11.6749l28.009937 28.1532c2.432399 2.430352 5.678326 3.837398 9.179057 3.837398 0.00614 0 0.011256 0 0.01535 0 3.482311 0 6.726192-1.39886 9.135054-3.820002l46.780443-46.738487c2.436492-2.436492 3.783163-5.724375 3.78521-9.224082 0-3.495614-1.344624-6.774287-3.787256-9.216919l-28.106128-27.998681c-18.693758-18.609847-23.762193-51.349505-11.773138-75.036997l22.083971-53.603849c8.374738-25.167193 35.224246-44.51382 61.578474-44.51382l39.630602 0c7.745405 0 10.8143-7.086395 10.8143-13.229303l0-65.998133c0-6.862291-5.116531-12.07399-11.256368-12.302187l0 1.479701-39.132252 0c-26.236548 0-53.099359-20.149922-61.585637-45.735647l-22.083971-54.261834c-11.960403-23.654746-6.913457-56.502875 11.728112-75.228355l28.16855-28.192086c2.430352-2.441609 3.78828-5.764284 3.78828-9.295714 0-3.498684-1.334391-6.762007-3.759627-9.17394l-46.741557-46.577828c-2.462075-2.462075-5.736655-3.734044-9.234315-3.734044-0.004093 0-0.010233 0-0.013303 0-3.465938 0-6.700609 1.255597-9.105379 3.671623l-28.198226 28.037567c-18.703991 18.710131-51.417043 23.734564-75.000158 11.69025l-53.865815-22.072715c-25.403576-8.388041-44.934398-35.255968-44.934398-61.60508l0-39.632649c0-7.253194-5.517667-12.186554-12.461823-12.186554l-65.943898 0c-7.517207 0-13.691837 5.51869-13.691837 12.186554l0 39.632649c0 27.027563-19.107173 53.336766-44.325531 61.643965l-53.501518 21.99699c-23.834848 12.168134-55.857169 7.234775-74.878384-11.69639l-28.130687-28.115338c-2.441609-2.451842-5.690606-3.787256-9.152451-3.787256-3.462868-0.001023-6.704702 1.334391-9.117658 3.758604l-46.690392 46.64639c-2.438539 2.438539-3.784186 5.710049-3.781116 9.207709 0.004093 3.474125 1.339508 6.716982 3.762697 9.128915l28.068266 28.121478c18.698874 18.690688 23.782659 51.389414 11.808954 74.973552l-22.124903 54.813397c-8.413624 25.616424-35.281551 45.783743-61.603033 45.783743l-39.575344 0c-6.630001 0-13.010315 3.411703-13.010315 10.822486l0 65.943898c0 6.942109 5.753027 13.284561 12.95301 13.284561l39.631626 0c26.380834 0 53.195549 19.35072 61.524239 44.537356l22.182208 53.629431c12.027941 23.731494 6.918573 56.449663-11.863189 75.05644l-28.022217 27.949562c-5.021364 5.066389-5.048993 13.348006 0.010233 18.409279l46.713928 46.653553c2.452865 2.464121 5.695722 3.794419 9.168824 3.794419 3.472078 0 6.711865-1.336438 9.124821-3.759627l28.181853-28.122501c18.641569-18.730597 51.440579-23.752983 75.011414-11.642155L421.86719 806.892287z"}),w.jsx("path",{d:"M513.734504 731.880873c-120.639614 0-218.786958-98.147344-218.786958-218.786958s98.147344-218.786958 218.786958-218.786958 218.786958 98.147344 218.786958 218.786958S634.375142 731.880873 513.734504 731.880873zM513.734504 334.324368c-98.573039 0-178.769546 80.195483-178.769546 178.769546s80.195483 178.769546 178.769546 178.769546 178.769546-80.195483 178.769546-178.769546S612.308567 334.324368 513.734504 334.324368z"})]})}),y_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:w.jsx("path",{d:"M813.909333 192.512H362.325333V111.445333c0-16.725333-13.653333-30.378667-30.378666-30.378666H109.056c-16.725333 0-30.378667 13.653333-30.378667 30.378666v222.890667c0 16.725333 13.653333 30.378667 30.378667 30.378667h222.890667c16.725333 0 30.378667-13.653333 30.378666-30.378667v-81.066667h421.205334v251.733334c0 16.725333 13.653333 30.378667 30.378666 30.378666s30.378667-13.653333 30.378667-30.378666V222.890667c0-16.725333-13.653333-30.378667-30.378667-30.378667z m-512.341333 111.445333h-162.133333v-162.133333h162.133333v162.133333zM908.117333 691.541333H685.226667c-16.725333 0-30.378667 13.653333-30.378667 30.378667v81.066667H233.813333V551.253333c0-16.725333-13.653333-30.378667-30.378666-30.378666s-30.378667 13.653333-30.378667 30.378666v282.112c0 16.725333 13.653333 30.378667 30.378667 30.378667h451.584v81.066667c0 16.725333 13.653333 30.378667 30.378666 30.378666h222.890667c16.725333 0 30.378667-13.653333 30.378667-30.378666V721.92c-0.170667-16.725333-13.653333-30.378667-30.549334-30.378667z m-30.378666 222.890667h-162.133334v-162.133333h162.133334v162.133333z"})})}),C_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:w.jsx("path",{d:"M160 528a48 48 0 0 1 48 48v176H320V640a64 64 0 0 1 64-64h576a64 64 0 0 1 64 64v320a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-112H160a48 48 0 0 1-48-48V576a48 48 0 0 1 48-48z m768 144h-512v256h512v-256zM560 400A48 48 0 0 1 512 448h-32a48 48 0 0 1 0-96H512a48 48 0 0 1 48 48z m-192 0A48 48 0 0 1 320 448h-32a48 48 0 0 1 0-96H320a48 48 0 0 1 48 48zM48 320a48 48 0 0 1 45.248 32h18.752a48 48 0 0 1 0 96h-64A48 48 0 0 1 0 400v-32A48 48 0 0 1 48 320z m608 128a48 48 0 0 1 0-96h18.752A48 48 0 0 1 768 368v32a48 48 0 0 1-41.472 47.552L720 448h-64z m64-448a48 48 0 0 1 48 48v32a48 48 0 0 1-93.248 16.064L656 96a48 48 0 0 1 0-96h64zM96 208v32a48 48 0 0 1-96 0v-32a48 48 0 0 1 96 0z m672 0v32a48 48 0 1 1-96 0v-32a48 48 0 1 1 96 0zM112 0a48 48 0 0 1 0 96l-18.752 0.064A48 48 0 0 1 0 80v-32A48 48 0 0 1 48 0h64z m256 48A48 48 0 0 1 320 96h-32a48 48 0 0 1 0-96H320a48 48 0 0 1 48 48z m192 0A48 48 0 0 1 512 96h-32a48 48 0 0 1 0-96H512a48 48 0 0 1 48 48z","p-id":"31178"})})}),S_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:[w.jsx("path",{d:"M669.603674 428.199569l-134.106283-134.106283c-3.359055-3.359055-11.324815-9.949202-23.769315-9.949202s-20.634197 7.00603-23.545377 9.949202l-134.106283 134.106283c-12.924365 12.924365-13.308257 33.558562-0.799775 46.067044s33.110688 12.12459 46.067044-0.799776L479.865038 392.945484l0.095973 313.447843c0 18.330844 14.331969 33.17467 31.991002 33.142678 17.659033-0.031991 31.959012-14.907807 31.927021-33.238651l-0.095973-313.415852 80.585335 80.585335c12.924365 12.924365 33.558562 13.308257 46.067044 0.799776 12.476491-12.508482 12.092599-33.142679-0.831766-46.067044zM654.727858 801.854478l17.691024 0.031991a21.306008 21.306008 0 0 0 19.13062-14.108032l10.173139-24.793027a21.114062 21.114062 0 0 0-3.48702-23.481396l-12.540473-12.540472a14.939798 14.939798 0 0 1 0-20.954107l20.890125-20.890125a14.843825 14.843825 0 0 1 20.890125 0l12.572464 12.540473a21.114062 21.114062 0 0 0 23.449404 3.51901l24.697054-10.173138a21.274017 21.274017 0 0 0 14.108032-19.162611v-17.755006c0-8.125715 6.590147-14.811834 14.779844-14.811834h29.527695c8.093724 0 14.779843 6.68612 14.779843 14.811834v17.755006a21.433972 21.433972 0 0 0 14.108032 19.162611l24.665063 10.173138a21.114062 21.114062 0 0 0 23.449405-3.487019l12.572464-12.572464a14.843825 14.843825 0 0 1 20.890125 0l20.890124 20.922116a14.811834 14.811834 0 0 1 0 20.954107l-12.540473 12.540472a21.242026 21.242026 0 0 0-3.487019 23.481396l10.173139 24.761036a21.337999 21.337999 0 0 0 19.130619 14.108032h17.755007c8.093724 0 14.715861 6.68612 14.715861 14.843826v29.559686a14.779843 14.779843 0 0 1-14.715861 14.779843h-17.755007a21.433972 21.433972 0 0 0-19.130619 14.108032l-10.173139 24.761036a21.337999 21.337999 0 0 0 3.487019 23.513387l12.540473 12.540473a14.811834 14.811834 0 0 1 0 20.954107l-20.922115 20.954106a14.811834 14.811834 0 0 1-20.858134 0l-12.508482-12.604455a21.114062 21.114062 0 0 0-23.481396-3.423037l-24.729045 10.173139a21.433972 21.433972 0 0 0-14.108032 19.16261v17.691025a14.843825 14.843825 0 0 1-14.779843 14.811834h-29.495704a14.811834 14.811834 0 0 1-14.779844-14.811834v-17.691025a21.433972 21.433972 0 0 0-14.108032-19.16261l-24.793027-10.173139a20.922116 20.922116 0 0 0-23.353431 3.423037l-12.572464 12.604455a14.811834 14.811834 0 0 1-20.858134 0l-20.922116-20.954106a14.971789 14.971789 0 0 1 0-20.954107l12.572464-12.540473a21.274017 21.274017 0 0 0 3.48702-23.513387l-10.20513-24.761036a21.242026 21.242026 0 0 0-19.13062-14.108032h-17.691024a14.875816 14.875816 0 0 1-14.779843-14.843825v-29.559686c0-8.157706 6.654129-14.811834 14.779843-14.811835zM831.766066 927.739073a95.973008 95.973008 0 1 0 0-191.946015 95.973008 95.973008 0 0 0 0 191.946015z","p-id":"34849"}),w.jsx("path",{d:"M962.545284 543.847043V95.973008c0-18.714736-18.330844-31.991003-37.461464-31.991003H98.628261C79.497641 63.982005 63.982005 84.008373 63.982005 103.043019v822.232747c0 19.034647 19.354557 34.646256 37.909338 34.646256h444.962854c48.978225 0 48.978225 63.790059-0.767784 63.790059H102.531163A102.691118 102.691118 0 0 1 0 920.861008V102.819082A102.691118 102.691118 0 0 1 102.531163 0h815.802556C974.989784 0 1023.712081 46.035053 1023.712081 102.819082v440.516105c0 38.005311-61.166797 38.485176-61.166797 0.511856z","p-id":"34850"})]})}),x_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11164",fill:"currentColor",children:w.jsx("path",{d:"M896 0a128 128 0 0 1 128 128v576a128 128 0 0 1-128 128h-64v64a128 128 0 0 1-128 128H128a128 128 0 0 1-128-128V320a128 128 0 0 1 128-128h64V128a128 128 0 0 1 128-128h576z m-250.112 320H184.96C153.6 320 128 345.6 128 377.152v461.696c0 31.552 25.536 57.152 56.96 57.152h462.08c31.424 0 56.96-25.6 56.96-57.152l-1.152-113.152V377.152a57.088 57.088 0 0 0-56.96-57.152zM510.4 461.056L620.16 570.88l2.496 2.24c3.84 3.84 7.04 7.68 9.6 11.52 11.968 17.28 10.752 34.56-3.648 51.84l-5.12 5.632a74.88 74.88 0 0 1-11.328 9.408l-102.656 102.656c-20.736 20.736-41.472 22.4-62.208 5.12l-5.696-5.12c-22.592-22.656-22.592-45.312 0-67.904l30.208-30.272H237.44c-29.312 0-45.248-13.44-47.68-40.32L189.44 608c0-32 16-48 48-48h236.096l-31.04-31.04c-20.736-20.736-22.464-41.472-5.184-62.208l5.12-5.696c22.656-22.592 45.312-22.592 67.968 0zM832 128l-448 2.56A64 64 0 0 0 320 192h384a128 128 0 0 1 128 128v384a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64z","p-id":"11165"})})}),w_=[{code:"agree",name:"同意",button:"同意"},{code:"refuse",name:"拒绝",button:"拒绝"}],$_=[{code:"agree",name:"同意",edit:!1,button:"同意"},{code:"refuse",name:"拒绝",edit:!1,button:"拒绝"},{code:"forward",name:"转交",edit:!1,button:"转交"},{code:"addSigner",name:"加签",edit:!1,button:"加签"},{code:"back",name:"退回",edit:!1,button:"退回"},{code:"back_last_level",name:"退回上一级",edit:!1,button:"退回上一级"},{code:"back_reevaluation",name:"退回重新审批",edit:!1,button:"退回重新审批"},{code:"back_material",name:"退回补充材料",edit:!1,button:"退回补充材料"}],tC=[{label:"发起人",color:"rgb(87, 106, 149)",defaultConfig:{nodeType:it.start,config:{initiator:"applyUserId"}},hidden:!0},{color:"#ff943e",label:"审批人",icon:f_,defaultConfig:{nodeType:it.approver,config:{actions:w_,approverType:"countersign",signConfig:{useRatio:!0,ratio:100,num:100},initiator_is_included:{type:"require_process"},comment_setting:{type:"everyone"},approver_is_empty:{type:"auto_pass"},groupType:"userId",extended:[],approval_is_refused:{type:"end_process"},listeners:{task_create:{open:!1,api_request_headers:"{}",api_request_body:"{}"},task_finish:{open:!1,api_request_headers:"{}",api_request_body:"{}"}}}}},{color:"#4ca3fb",label:"抄送人",icon:m_,defaultConfig:{nodeType:it.notifier,config:{groupType:"userId"}}},{color:"#95d475",label:"消息通知",icon:h_,defaultConfig:{nodeType:it.message,config:{groupType:"userId",executingType:"class"}},hidden:!0},{color:"#ffc107",label:"服务节点",icon:b_,defaultConfig:{nodeType:it.service,config:{executingType:"class",executingValue:""}},hidden:!0},{color:"#15bc83",label:"条件分支",icon:g_,createDefault:()=>({id:an(),nodeType:it.exclusive,conditionNodeList:[{id:an(),nodeType:it.condition,name:"条件1"},{id:an(),nodeType:it.condition,name:"条件2",config:{passValidate:!0}}]})},{color:"#604FED",label:"并行分支",icon:v_,createDefault:()=>({id:an(),nodeType:it.parallel,conditionNodeList:[{id:an(),nodeType:it.condition,name:"并行分支1",config:{passValidate:!0}},{id:an(),nodeType:it.condition,name:"并行分支2",config:{passValidate:!0}}]})},{color:"#da70ff",label:"包容分支",icon:p_,createDefault:()=>({id:an(),nodeType:it.inclusive,conditionNodeList:[{id:an(),nodeType:it.condition,name:"条件1"},{id:an(),nodeType:it.condition,name:"条件2"}]}),hidden:!0},{label:"condition",color:"",defaultConfig:{nodeType:it.condition},hidden:!0},{color:"#996633",label:"子流程",icon:y_,defaultConfig:{nodeType:it.subProcess,config:{}}},{color:"#57b82a",label:"分发",icon:x_,defaultConfig:{nodeType:it.dispatcher,config:{}}},{color:"#006666",label:"异步子流程",icon:C_,defaultConfig:{nodeType:it.asyncSubProcess,config:{}},hidden:!0},{color:"#0074d9",label:"触发器",icon:S_,defaultConfig:{nodeType:it.trigger,config:{api_request_headers:"{}",api_request_body:"{}"}},hidden:!0}],nC=C.createContext(void 0);function Xt(){return C.useContext(nC)}const E_=[{accept:{"text/json":[".json"]}}];async function O_(e,t){try{const n=await window.showSaveFilePicker({suggestedName:`${e}.json`,types:E_}),r=await n.createWritable();return await r.write(t),await r.close(),n.name}catch(n){return console.error(n),!1}}function tc(){const[e,t]=C.useState(),n=Xt(),r=C.useCallback(o=>{t(o)},[]);return C.useEffect(()=>n==null?void 0:n.subscribeStartNodeChange(r),[r,n]),C.useEffect(()=>{t(n==null?void 0:n.store.getState().startNode)},[n==null?void 0:n.store]),e}function I_(){const e=tc();return C.useCallback(()=>{O_("approvalflow",JSON.stringify({startNode:e},null,2)).then(n=>{n&&jr.success("导出成功")}).catch(n=>{console.error(n)})},[e])}async function N_(e,t){return await window.showOpenFilePicker({types:[{accept:{"file/*":e==null?void 0:e.split(",")}}],excludeAcceptAllOption:!1,multiple:t})}function P_(){const e=Xt();return C.useCallback(()=>{N_(".json").then(n=>{var r;(r=n==null?void 0:n[0])==null||r.getFile().then(o=>{o.text().then(a=>{try{const i=JSON.parse(a);i.startNode?e==null||e.setStartNode(i.startNode):jr.error("文件不合法")}catch(i){console.error(i),jr.error("文件不合法")}})})}).catch(n=>{console.error(n)})},[e])}function T_(){const[e,t]=C.useState(),n=Xt(),r=C.useCallback(o=>{t(o)},[]);return C.useEffect(()=>n==null?void 0:n.subscribeSelectedChange(r),[r,n]),C.useEffect(()=>{t(n==null?void 0:n.store.getState().selectedId)},[n==null?void 0:n.store]),e}function M_(){const e=T_(),t=Xt();return e?t==null?void 0:t.getNode(e):void 0}function nc(e){var n;const t=Xt();return(n=t==null?void 0:t.materialUis)==null?void 0:n[(e==null?void 0:e.nodeType)||""]}function rC(e){const t=Xt();return t==null?void 0:t.materials.find(n=>{var r;return((r=n.defaultConfig)==null?void 0:r.nodeType)===(e==null?void 0:e.nodeType)})}const __=be.div`
420
+ `,l_=C.memo(e=>{const{title:t,actions:n,children:r}=e;return w.jsxs(a_,{children:[w.jsx(i_,{children:t}),r,w.jsx(s_,{children:n})]})}),c_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M0 576a510.848 510.848 0 0 0 173.376 384l84.672-96a384 384 0 1 1 525.568-559.552L640.064 448h384V64l-149.952 149.952A512 512 0 0 0 0.064 576z","p-id":"2271"})})}),u_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M512 64a510.656 510.656 0 0 0-362.048 149.952L0 64v384h384L240.448 304.448a384 384 0 1 1 525.504 559.552l84.672 96A512 512 0 0 0 512 64z","p-id":"1866"})})}),d_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{width:"0.9em",height:"0.9em",fill:"currentColor",viewBox:"0 0 1024 1024",children:[w.jsx("path",{d:"M720 192h-544A80.096 80.096 0 0 0 96 272v608C96 924.128 131.904 960 176 960h544c44.128 0 80-35.872 80-80v-608C800 227.904 764.128 192 720 192z m16 688c0 8.8-7.2 16-16 16h-544a16 16 0 0 1-16-16v-608a16 16 0 0 1 16-16h544a16 16 0 0 1 16 16v608z","p-id":"2356"}),w.jsx("path",{d:"M848 64h-544a32 32 0 0 0 0 64h544a16 16 0 0 1 16 16v608a32 32 0 1 0 64 0v-608C928 99.904 892.128 64 848 64z","p-id":"2357"}),w.jsx("path",{d:"M608 360H288a32 32 0 0 0 0 64h320a32 32 0 1 0 0-64zM608 520H288a32 32 0 1 0 0 64h320a32 32 0 1 0 0-64zM480 678.656H288a32 32 0 1 0 0 64h192a32 32 0 1 0 0-64z","p-id":"2358"})]})}),f_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M422.399 601.6V493.323c-79.111-34.622-134.4-113.655-134.4-205.323 0-123.711 100.54-224 224-224 123.711 0 224 100.545 224 224 0 91.814-55.379 170.725-134.4 205.313V601.6h201.472c61.925 0 112.128 49.716 112.128 112.003V825.6H108.801V713.598c0-61.855 50.444-111.998 112.126-111.998h201.472zM153.601 870.4h716.793V960H153.6v-89.6z"})})}),m_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M915.82 142.44L97.84 458.18c-46.13 17.76-44.89 43.66 2.47 57.72l197.59 58.71 80.42 239.03c10.61 31.33 37.99 37.99 61.42 14.55l103.6-102.62 204.74 149.98c26.64 19.49 54.02 9.13 61.18-23.19L958.5 179.43c7.15-32.31-11.85-48.83-42.68-36.99zM791.49 294.63l-348.8 310.81c-6.17 5.67-11.84 16.78-12.83 24.91l-15.29 144.8c-1.73 16.28-7.4 17.02-12.58 1.23L334.4 572.89c-2.71-7.89 0.99-17.76 8.14-21.95l442.54-265.42c27.87-16.78 30.83-12.84 6.41 9.11z","p-id":"10639"})})}),g_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",fill:"currentColor",viewBox:"0 0 1024 1024",children:w.jsx("path",{d:"M525.96 69.895l256.652 124.437c15.903 7.71 22.544 26.852 14.834 42.755a32 32 0 0 1-14.834 14.833L544 367.61V472c0 1.006-0.023 2.006-0.07 3H720c34.993 0 63.426 28.084 63.991 62.942L784 539v123h96c17.673 0 32 14.327 32 32v186c0 17.673-14.327 32-32 32H624c-17.673 0-32-14.327-32-32V694c0-17.673 14.327-32 32-32h96V539H304v123h96c17.673 0 32 14.327 32 32v186c0 17.673-14.327 32-32 32H144c-17.673 0-32-14.327-32-32V694c0-17.673 14.327-32 32-32h96V539c0-34.993 28.084-63.426 62.942-63.991L304 475h176V367.61L241.388 251.92c-15.903-7.71-22.544-26.852-14.834-42.755a32 32 0 0 1 14.834-14.833L498.039 69.895a32 32 0 0 1 27.922 0z","p-id":"41560"})})}),p_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:w.jsx("path",{d:"M1015.15 491.1L533.69 9.63c-11.76-11.76-30.83-11.76-42.59 0L9.63 491.1C3.98 496.75 0.81 504.41 0.81 512.39s3.17 15.65 8.82 21.29l481.47 481.47a30.11 30.11 0 0 0 21.29 8.82c7.99 0 15.65-3.17 21.29-8.82l481.47-481.47c11.76-11.76 11.76-30.82 0-42.58zM512.39 951.27L73.51 512.39 512.39 73.51l438.88 438.88-438.88 438.88zM289.23 511.55c0 123.71 100.29 224 224 224s224-100.29 224-224-100.29-224-224-224-224 100.29-224 224z m224-160c42.74 0 82.92 16.64 113.14 46.86s46.86 70.4 46.86 113.14-16.64 82.92-46.86 113.14-70.4 46.86-113.14 46.86-82.92-16.64-113.14-46.86-46.86-70.4-46.86-113.14 16.64-82.92 46.86-113.14c30.23-30.22 70.41-46.86 113.14-46.86z"})})}),v_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:[w.jsx("path",{d:"M512 1012.622222c-41.718519 0-79.644444-15.17037-106.192593-45.511111l-348.918518-348.918518C26.548148 587.851852 11.377778 549.925926 11.377778 512s15.17037-79.644444 45.511111-106.192593l348.918518-348.918518c56.888889-56.888889 155.496296-56.888889 216.177778 0l348.918519 348.918518c30.340741 30.340741 45.511111 68.266667 45.511111 106.192593s-15.17037 79.644444-45.511111 106.192593l-348.918519 348.918518c-30.340741 30.340741-68.266667 45.511111-109.985185 45.511111z m0-925.392592c-18.962963 0-37.925926 7.585185-53.096296 22.755555l-348.918519 348.918519c-15.17037 15.17037-22.755556 34.133333-22.755555 53.096296s7.585185 37.925926 22.755555 53.096296l348.918519 348.918519c30.340741 30.340741 79.644444 30.340741 106.192592 0l348.918519-348.918519c15.17037-15.17037 22.755556-34.133333 22.755555-53.096296s-7.585185-37.925926-22.755555-53.096296l-348.918519-348.918519c-15.17037-15.17037-34.133333-22.755556-53.096296-22.755555z"}),w.jsx("path",{d:"M303.407407 455.111111h417.185186c22.755556 0 37.925926 15.17037 37.925926 37.925926s-15.17037 37.925926-37.925926 37.925926H303.407407c-22.755556 0-37.925926-15.17037-37.925926-37.925926s15.17037-37.925926 37.925926-37.925926z"}),w.jsx("path",{d:"M549.925926 284.444444v417.185186c0 22.755556-15.17037 37.925926-37.925926 37.925926s-37.925926-15.17037-37.925926-37.925926v-417.185186c0-22.755556 15.17037-37.925926 37.925926-37.925925s37.925926 15.17037 37.925926 37.925925z"})]})}),h_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"currentColor",children:w.jsx("path",{d:"M928 672H832V448a320 320 0 0 0-257.28-313.664C574.912 132.096 576 130.24 576 128a64 64 0 1 0-128 0c0 2.24 1.088 4.096 1.28 6.336A319.936 319.936 0 0 0 192 448v224H96a32 32 0 0 0 0 64h832a32 32 0 0 0 0-64zM256 672V445.184C256 305.344 370.624 192 512 192s256 113.344 256 253.184V672H256zM512 896a96 96 0 0 1-96-96h-64a160 160 0 1 0 320 0h-64A96 96 0 0 1 512 896z"})})}),b_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor",children:[w.jsx("path",{d:"M545.784454 962.539206l-65.943898 0c-29.341259 0-54.624085-25.281803-54.624085-54.615898L425.216471 868.462574c0-9.623171-7.826246-20.911262-16.690124-23.680329l-1.566682-0.611937-55.725162-23.104207-0.880043-0.494257c-8.153704-4.41045-22.017456-2.376117-28.55229 4.187369l-28.17469 28.123524c-9.930163 9.977235-23.239284 15.494902-37.432541 15.494902-14.195304 0-27.507494-5.517667-37.487799-15.541975l-46.682205-46.630017c-20.60427-20.603247-20.6319-54.233182-0.069585-74.974575l28.15013-28.106128c6.637164-6.574742 8.676613-20.599154 4.253884-28.909423l-0.831948-1.768273-23.164582-56.128345-0.26913-0.682545c-2.803859-9.03477-14.279215-17.394159-23.611767-17.394159l-39.631626 0c-29.391401 0-52.861952-24.065092-52.861952-53.193503l0-65.943898c0-28.770254 22.998807-51.754734 52.919257-51.754734l39.575344 0c9.081843 0 20.803815-8.830109 23.666002-18.057261l0.567935-1.476631 23.163559-57.088206 0.505513-0.913812c4.40431-8.220219 2.319835-22.224164-4.2897-28.830629l-28.04166-28.087709c-9.964956-9.921977-15.486716-23.216771-15.502066-37.396725-0.01535-14.201443 5.492084-27.53717 15.507182-37.552268l46.6556-46.614667c9.94142-9.985422 23.248494-15.503089 37.432541-15.503089 0.001023 0 0 0 0.001023 0 14.184047 0 27.490098 5.51869 37.46938 15.540951l28.039613 28.05087c6.557346 6.525624 20.500916 8.596795 28.655643 4.231371l0.893346-0.478907 57.375755-23.64963c8.836249-2.731204 16.634866-14.037714 16.634866-23.719214l0-39.632649c0-28.967752 24.777313-52.095495 54.624085-52.095495L545.784454 64.076364c29.161157 0 52.370765 22.636556 52.370765 52.095495l0 39.632649c0 9.127891 8.709359 20.85498 17.767666 23.674189l1.51654 0.577145 56.639998 23.113417 0.923022 0.509606c8.202822 4.424776 22.184255 2.353604 28.788673-4.254907l28.163433-27.912723c9.895371-9.94142 23.179932-15.33936 37.352723-15.33936 0.019443 0 0.040932 0 0.060375 0 14.18814 0 27.508517 5.375427 37.516452 15.384385l46.709835 46.554292c10.004865 9.960863 15.524578 23.254633 15.524578 37.47552 0 14.18814-5.498224 27.506471-15.479553 37.532825l-28.16855 28.152177c-6.580882 6.610558-8.640798 20.771069-4.204765 29.107945l0.478907 0.896416 23.654746 57.956993c2.902096 9.255805 14.635325 18.114566 23.686469 18.114566l39.132252 0 0-0.573051c27.629267 0 52.188616 22.984481 52.188616 52.327786l0 65.998133c0 29.590945-22.985504 53.138244-51.746548 53.138244l-39.630602 0c-9.337669 0-20.84884 8.372691-23.686469 17.423835l-0.580215 1.51654-23.086811 56.240909-0.468674 0.860601c-4.419659 8.30413-2.393513 22.320355 4.169973 28.855188l28.135804 28.02017c10.031471 10.029424 15.539928 23.350824 15.537881 37.541011-0.004093 14.186094-5.514597 27.505447-15.518438 37.505195l-46.747697 46.682205c-9.920954 9.964956-23.219841 15.506159-37.406958 15.506159-0.019443 0-0.040932 0-0.060375 0-14.192234 0-27.514657-5.514597-37.518498-15.517415l-28.039613-28.095895c-6.490831-6.490831-20.807908-8.575306-28.887934-4.206812l-0.951675 0.514723-57.93755 23.680329c-9.087982 2.859118-17.823947 14.594393-17.823947 23.691585l0 39.460734C598.155219 937.76394 574.45954 962.539206 545.784454 962.539206zM421.86719 806.892287c25.192775 8.370645 44.282552 34.650171 44.282552 61.570287l0 39.460734c0 7.114025 6.569626 13.68365 13.691837 13.68365L545.784454 921.606958c6.496971 0 12.461823-6.043646 12.461823-13.68365L558.246277 868.462574c0-26.273387 19.516496-53.131081 44.901653-61.58052l53.859675-22.062482c23.62814-12.116969 56.342216-7.098675 75.118861 11.6749l28.009937 28.1532c2.432399 2.430352 5.678326 3.837398 9.179057 3.837398 0.00614 0 0.011256 0 0.01535 0 3.482311 0 6.726192-1.39886 9.135054-3.820002l46.780443-46.738487c2.436492-2.436492 3.783163-5.724375 3.78521-9.224082 0-3.495614-1.344624-6.774287-3.787256-9.216919l-28.106128-27.998681c-18.693758-18.609847-23.762193-51.349505-11.773138-75.036997l22.083971-53.603849c8.374738-25.167193 35.224246-44.51382 61.578474-44.51382l39.630602 0c7.745405 0 10.8143-7.086395 10.8143-13.229303l0-65.998133c0-6.862291-5.116531-12.07399-11.256368-12.302187l0 1.479701-39.132252 0c-26.236548 0-53.099359-20.149922-61.585637-45.735647l-22.083971-54.261834c-11.960403-23.654746-6.913457-56.502875 11.728112-75.228355l28.16855-28.192086c2.430352-2.441609 3.78828-5.764284 3.78828-9.295714 0-3.498684-1.334391-6.762007-3.759627-9.17394l-46.741557-46.577828c-2.462075-2.462075-5.736655-3.734044-9.234315-3.734044-0.004093 0-0.010233 0-0.013303 0-3.465938 0-6.700609 1.255597-9.105379 3.671623l-28.198226 28.037567c-18.703991 18.710131-51.417043 23.734564-75.000158 11.69025l-53.865815-22.072715c-25.403576-8.388041-44.934398-35.255968-44.934398-61.60508l0-39.632649c0-7.253194-5.517667-12.186554-12.461823-12.186554l-65.943898 0c-7.517207 0-13.691837 5.51869-13.691837 12.186554l0 39.632649c0 27.027563-19.107173 53.336766-44.325531 61.643965l-53.501518 21.99699c-23.834848 12.168134-55.857169 7.234775-74.878384-11.69639l-28.130687-28.115338c-2.441609-2.451842-5.690606-3.787256-9.152451-3.787256-3.462868-0.001023-6.704702 1.334391-9.117658 3.758604l-46.690392 46.64639c-2.438539 2.438539-3.784186 5.710049-3.781116 9.207709 0.004093 3.474125 1.339508 6.716982 3.762697 9.128915l28.068266 28.121478c18.698874 18.690688 23.782659 51.389414 11.808954 74.973552l-22.124903 54.813397c-8.413624 25.616424-35.281551 45.783743-61.603033 45.783743l-39.575344 0c-6.630001 0-13.010315 3.411703-13.010315 10.822486l0 65.943898c0 6.942109 5.753027 13.284561 12.95301 13.284561l39.631626 0c26.380834 0 53.195549 19.35072 61.524239 44.537356l22.182208 53.629431c12.027941 23.731494 6.918573 56.449663-11.863189 75.05644l-28.022217 27.949562c-5.021364 5.066389-5.048993 13.348006 0.010233 18.409279l46.713928 46.653553c2.452865 2.464121 5.695722 3.794419 9.168824 3.794419 3.472078 0 6.711865-1.336438 9.124821-3.759627l28.181853-28.122501c18.641569-18.730597 51.440579-23.752983 75.011414-11.642155L421.86719 806.892287z"}),w.jsx("path",{d:"M513.734504 731.880873c-120.639614 0-218.786958-98.147344-218.786958-218.786958s98.147344-218.786958 218.786958-218.786958 218.786958 98.147344 218.786958 218.786958S634.375142 731.880873 513.734504 731.880873zM513.734504 334.324368c-98.573039 0-178.769546 80.195483-178.769546 178.769546s80.195483 178.769546 178.769546 178.769546 178.769546-80.195483 178.769546-178.769546S612.308567 334.324368 513.734504 334.324368z"})]})}),y_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:w.jsx("path",{d:"M813.909333 192.512H362.325333V111.445333c0-16.725333-13.653333-30.378667-30.378666-30.378666H109.056c-16.725333 0-30.378667 13.653333-30.378667 30.378666v222.890667c0 16.725333 13.653333 30.378667 30.378667 30.378667h222.890667c16.725333 0 30.378667-13.653333 30.378666-30.378667v-81.066667h421.205334v251.733334c0 16.725333 13.653333 30.378667 30.378666 30.378666s30.378667-13.653333 30.378667-30.378666V222.890667c0-16.725333-13.653333-30.378667-30.378667-30.378667z m-512.341333 111.445333h-162.133333v-162.133333h162.133333v162.133333zM908.117333 691.541333H685.226667c-16.725333 0-30.378667 13.653333-30.378667 30.378667v81.066667H233.813333V551.253333c0-16.725333-13.653333-30.378667-30.378666-30.378666s-30.378667 13.653333-30.378667 30.378666v282.112c0 16.725333 13.653333 30.378667 30.378667 30.378667h451.584v81.066667c0 16.725333 13.653333 30.378667 30.378666 30.378666h222.890667c16.725333 0 30.378667-13.653333 30.378667-30.378666V721.92c-0.170667-16.725333-13.653333-30.378667-30.549334-30.378667z m-30.378666 222.890667h-162.133334v-162.133333h162.133334v162.133333z"})})}),C_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:w.jsx("path",{d:"M160 528a48 48 0 0 1 48 48v176H320V640a64 64 0 0 1 64-64h576a64 64 0 0 1 64 64v320a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-112H160a48 48 0 0 1-48-48V576a48 48 0 0 1 48-48z m768 144h-512v256h512v-256zM560 400A48 48 0 0 1 512 448h-32a48 48 0 0 1 0-96H512a48 48 0 0 1 48 48z m-192 0A48 48 0 0 1 320 448h-32a48 48 0 0 1 0-96H320a48 48 0 0 1 48 48zM48 320a48 48 0 0 1 45.248 32h18.752a48 48 0 0 1 0 96h-64A48 48 0 0 1 0 400v-32A48 48 0 0 1 48 320z m608 128a48 48 0 0 1 0-96h18.752A48 48 0 0 1 768 368v32a48 48 0 0 1-41.472 47.552L720 448h-64z m64-448a48 48 0 0 1 48 48v32a48 48 0 0 1-93.248 16.064L656 96a48 48 0 0 1 0-96h64zM96 208v32a48 48 0 0 1-96 0v-32a48 48 0 0 1 96 0z m672 0v32a48 48 0 1 1-96 0v-32a48 48 0 1 1 96 0zM112 0a48 48 0 0 1 0 96l-18.752 0.064A48 48 0 0 1 0 80v-32A48 48 0 0 1 48 0h64z m256 48A48 48 0 0 1 320 96h-32a48 48 0 0 1 0-96H320a48 48 0 0 1 48 48z m192 0A48 48 0 0 1 512 96h-32a48 48 0 0 1 0-96H512a48 48 0 0 1 48 48z","p-id":"31178"})})}),S_=w.jsx("span",{role:"img",className:"anticon",children:w.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",fill:"currentColor",children:[w.jsx("path",{d:"M669.603674 428.199569l-134.106283-134.106283c-3.359055-3.359055-11.324815-9.949202-23.769315-9.949202s-20.634197 7.00603-23.545377 9.949202l-134.106283 134.106283c-12.924365 12.924365-13.308257 33.558562-0.799775 46.067044s33.110688 12.12459 46.067044-0.799776L479.865038 392.945484l0.095973 313.447843c0 18.330844 14.331969 33.17467 31.991002 33.142678 17.659033-0.031991 31.959012-14.907807 31.927021-33.238651l-0.095973-313.415852 80.585335 80.585335c12.924365 12.924365 33.558562 13.308257 46.067044 0.799776 12.476491-12.508482 12.092599-33.142679-0.831766-46.067044zM654.727858 801.854478l17.691024 0.031991a21.306008 21.306008 0 0 0 19.13062-14.108032l10.173139-24.793027a21.114062 21.114062 0 0 0-3.48702-23.481396l-12.540473-12.540472a14.939798 14.939798 0 0 1 0-20.954107l20.890125-20.890125a14.843825 14.843825 0 0 1 20.890125 0l12.572464 12.540473a21.114062 21.114062 0 0 0 23.449404 3.51901l24.697054-10.173138a21.274017 21.274017 0 0 0 14.108032-19.162611v-17.755006c0-8.125715 6.590147-14.811834 14.779844-14.811834h29.527695c8.093724 0 14.779843 6.68612 14.779843 14.811834v17.755006a21.433972 21.433972 0 0 0 14.108032 19.162611l24.665063 10.173138a21.114062 21.114062 0 0 0 23.449405-3.487019l12.572464-12.572464a14.843825 14.843825 0 0 1 20.890125 0l20.890124 20.922116a14.811834 14.811834 0 0 1 0 20.954107l-12.540473 12.540472a21.242026 21.242026 0 0 0-3.487019 23.481396l10.173139 24.761036a21.337999 21.337999 0 0 0 19.130619 14.108032h17.755007c8.093724 0 14.715861 6.68612 14.715861 14.843826v29.559686a14.779843 14.779843 0 0 1-14.715861 14.779843h-17.755007a21.433972 21.433972 0 0 0-19.130619 14.108032l-10.173139 24.761036a21.337999 21.337999 0 0 0 3.487019 23.513387l12.540473 12.540473a14.811834 14.811834 0 0 1 0 20.954107l-20.922115 20.954106a14.811834 14.811834 0 0 1-20.858134 0l-12.508482-12.604455a21.114062 21.114062 0 0 0-23.481396-3.423037l-24.729045 10.173139a21.433972 21.433972 0 0 0-14.108032 19.16261v17.691025a14.843825 14.843825 0 0 1-14.779843 14.811834h-29.495704a14.811834 14.811834 0 0 1-14.779844-14.811834v-17.691025a21.433972 21.433972 0 0 0-14.108032-19.16261l-24.793027-10.173139a20.922116 20.922116 0 0 0-23.353431 3.423037l-12.572464 12.604455a14.811834 14.811834 0 0 1-20.858134 0l-20.922116-20.954106a14.971789 14.971789 0 0 1 0-20.954107l12.572464-12.540473a21.274017 21.274017 0 0 0 3.48702-23.513387l-10.20513-24.761036a21.242026 21.242026 0 0 0-19.13062-14.108032h-17.691024a14.875816 14.875816 0 0 1-14.779843-14.843825v-29.559686c0-8.157706 6.654129-14.811834 14.779843-14.811835zM831.766066 927.739073a95.973008 95.973008 0 1 0 0-191.946015 95.973008 95.973008 0 0 0 0 191.946015z","p-id":"34849"}),w.jsx("path",{d:"M962.545284 543.847043V95.973008c0-18.714736-18.330844-31.991003-37.461464-31.991003H98.628261C79.497641 63.982005 63.982005 84.008373 63.982005 103.043019v822.232747c0 19.034647 19.354557 34.646256 37.909338 34.646256h444.962854c48.978225 0 48.978225 63.790059-0.767784 63.790059H102.531163A102.691118 102.691118 0 0 1 0 920.861008V102.819082A102.691118 102.691118 0 0 1 102.531163 0h815.802556C974.989784 0 1023.712081 46.035053 1023.712081 102.819082v440.516105c0 38.005311-61.166797 38.485176-61.166797 0.511856z","p-id":"34850"})]})}),x_=w.jsx("span",{role:"img",className:"anticon",children:w.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11164",fill:"currentColor",children:w.jsx("path",{d:"M896 0a128 128 0 0 1 128 128v576a128 128 0 0 1-128 128h-64v64a128 128 0 0 1-128 128H128a128 128 0 0 1-128-128V320a128 128 0 0 1 128-128h64V128a128 128 0 0 1 128-128h576z m-250.112 320H184.96C153.6 320 128 345.6 128 377.152v461.696c0 31.552 25.536 57.152 56.96 57.152h462.08c31.424 0 56.96-25.6 56.96-57.152l-1.152-113.152V377.152a57.088 57.088 0 0 0-56.96-57.152zM510.4 461.056L620.16 570.88l2.496 2.24c3.84 3.84 7.04 7.68 9.6 11.52 11.968 17.28 10.752 34.56-3.648 51.84l-5.12 5.632a74.88 74.88 0 0 1-11.328 9.408l-102.656 102.656c-20.736 20.736-41.472 22.4-62.208 5.12l-5.696-5.12c-22.592-22.656-22.592-45.312 0-67.904l30.208-30.272H237.44c-29.312 0-45.248-13.44-47.68-40.32L189.44 608c0-32 16-48 48-48h236.096l-31.04-31.04c-20.736-20.736-22.464-41.472-5.184-62.208l5.12-5.696c22.656-22.592 45.312-22.592 67.968 0zM832 128l-448 2.56A64 64 0 0 0 320 192h384a128 128 0 0 1 128 128v384a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64z","p-id":"11165"})})}),w_=[{code:"agree",name:"同意",button:"同意"},{code:"refuse",name:"拒绝",button:"拒绝"}],$_=[{code:"agree",name:"同意",edit:!1,button:"同意"},{code:"refuse",name:"拒绝",edit:!1,button:"拒绝"},{code:"forward",name:"转交",edit:!1,button:"转交"},{code:"addSigner",name:"加签",edit:!1,button:"加签"},{code:"back",name:"退回",edit:!1,button:"退回"},{code:"back_last_level",name:"退回上一级",edit:!1,button:"退回上一级"},{code:"back_reevaluation",name:"退回重新审批",edit:!1,button:"退回重新审批"},{code:"back_material",name:"退回补充材料",edit:!1,button:"退回补充材料"}],tC=[{label:"发起人",color:"rgb(87, 106, 149)",defaultConfig:{nodeType:it.start,config:{initiator:"applyUserId"}},hidden:!0},{color:"#ff943e",label:"审批人",icon:f_,defaultConfig:{nodeType:it.approver,config:{actions:w_,approverType:"countersign",signConfig:{useRatio:!0,ratio:100,num:100},initiator_is_included:{type:"require_process"},comment_setting:{type:"everyone"},approver_is_empty:{type:"auto_pass"},groupType:"userId",extended:[],approval_is_refused:{type:"end_process"},listeners:{task_create:{open:!1,api_request_headers:"{}",api_request_body:"{}"},task_finish:{open:!1,api_request_headers:"{}",api_request_body:"{}"}}}}},{color:"#4ca3fb",label:"抄送人",icon:m_,defaultConfig:{nodeType:it.notifier,config:{groupType:"userId"}}},{color:"#95d475",label:"消息通知",icon:h_,defaultConfig:{nodeType:it.message,config:{groupType:"userId",executingType:"class"}},hidden:!0},{color:"#ffc107",label:"服务节点",icon:b_,defaultConfig:{nodeType:it.service,config:{executingType:"class",executingValue:""}},hidden:!0},{color:"#15bc83",label:"条件分支",icon:g_,createDefault:()=>({id:an(),nodeType:it.exclusive,conditionNodeList:[{id:an(),nodeType:it.condition,name:"条件1"},{id:an(),nodeType:it.condition,name:"条件2",config:{passValidate:!0}}]})},{color:"#604FED",label:"并行分支",icon:v_,createDefault:()=>({id:an(),nodeType:it.parallel,conditionNodeList:[{id:an(),nodeType:it.condition,name:"并行分支1",config:{passValidate:!0}},{id:an(),nodeType:it.condition,name:"并行分支2",config:{passValidate:!0}}]})},{color:"#da70ff",label:"包容分支",icon:p_,createDefault:()=>({id:an(),nodeType:it.inclusive,conditionNodeList:[{id:an(),nodeType:it.condition,name:"条件1"},{id:an(),nodeType:it.condition,name:"条件2"}]}),hidden:!0},{label:"condition",color:"",defaultConfig:{nodeType:it.condition},hidden:!0},{color:"#996633",label:"子流程",icon:y_,defaultConfig:{nodeType:it.subProcess,config:{}}},{color:"#57b82a",label:"分发",icon:x_,defaultConfig:{nodeType:it.dispatcher,config:{}}},{color:"#006666",label:"异步子流程",icon:C_,defaultConfig:{nodeType:it.asyncSubProcess,config:{}},hidden:!0},{color:"#0074d9",label:"触发器",icon:S_,defaultConfig:{nodeType:it.trigger,config:{api_request_headers:"{}",api_request_body:"{}"}},hidden:!0}],nC=C.createContext(void 0);function Xt(){return C.useContext(nC)}const E_=[{accept:{"text/json":[".json"]}}];async function O_(e,t){try{const n=await window.showSaveFilePicker({suggestedName:`${e}.json`,types:E_}),r=await n.createWritable();return await r.write(t),await r.close(),n.name}catch(n){return console.error(n),!1}}function tc(){const[e,t]=C.useState(),n=Xt(),r=C.useCallback(o=>{t(o)},[]);return C.useEffect(()=>{console.log("subscribe startNode");const o=n==null?void 0:n.subscribeStartNodeChange(r);return()=>{console.log("unsubscribe startNode"),o==null||o()}},[r,n]),C.useEffect(()=>{t(n==null?void 0:n.store.getState().startNode)},[n==null?void 0:n.store]),e}function I_(){const e=tc();return C.useCallback(()=>{O_("approvalflow",JSON.stringify({startNode:e},null,2)).then(n=>{n&&jr.success("导出成功")}).catch(n=>{console.error(n)})},[e])}async function N_(e,t){return await window.showOpenFilePicker({types:[{accept:{"file/*":e==null?void 0:e.split(",")}}],excludeAcceptAllOption:!1,multiple:t})}function P_(){const e=Xt();return C.useCallback(()=>{N_(".json").then(n=>{var r;(r=n==null?void 0:n[0])==null||r.getFile().then(o=>{o.text().then(a=>{try{const i=JSON.parse(a);i.startNode?e==null||e.setStartNode(i.startNode):jr.error("文件不合法")}catch(i){console.error(i),jr.error("文件不合法")}})})}).catch(n=>{console.error(n)})},[e])}function T_(){const[e,t]=C.useState(),n=Xt(),r=C.useCallback(o=>{t(o)},[]);return C.useEffect(()=>n==null?void 0:n.subscribeSelectedChange(r),[r,n]),C.useEffect(()=>{t(n==null?void 0:n.store.getState().selectedId)},[n==null?void 0:n.store]),e}function M_(){const e=T_(),t=Xt();return e?t==null?void 0:t.getNode(e):void 0}function nc(e){var n;const t=Xt();return(n=t==null?void 0:t.materialUis)==null?void 0:n[(e==null?void 0:e.nodeType)||""]}function rC(e){const t=Xt();return t==null?void 0:t.materials.find(n=>{var r;return((r=n.defaultConfig)==null?void 0:r.nodeType)===(e==null?void 0:e.nodeType)})}const __=be.div`
421
421
  box-sizing: border-box;
422
422
  width: 50%;
423
423
  padding: 4px 8px;
@@ -977,7 +977,7 @@ html body {
977
977
  `);return i===-1?"":o.stack.slice(i+1)})();try{if(!r.stack)r.stack=a;else if(a){const i=a.indexOf(`
978
978
  `),s=i===-1?-1:a.indexOf(`
979
979
  `,i+1),l=s===-1?"":a.slice(s+1);String(r.stack).endsWith(l)||(r.stack+=`
980
- `+a)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&yc.assertOptions(r,{silentJSONParsing:ir.transitional(ir.boolean),forcedJSONParsing:ir.transitional(ir.boolean),clarifyTimeoutError:ir.transitional(ir.boolean),legacyInterceptorReqResOrdering:ir.transitional(ir.boolean)},!1),o!=null&&(ee.isFunction(o)?n.paramsSerializer={serialize:o}:yc.assertOptions(o,{encode:ir.function,serialize:ir.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),yc.assertOptions(n,{baseUrl:ir.spelling("baseURL"),withXsrfToken:ir.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&ee.merge(a.common,a[n.method]);a&&ee.forEach(["delete","get","head","post","put","patch","query","common"],h=>{delete a[h]}),n.headers=Mn.concat(i,a);const s=[];let l=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;l=l&&v.synchronous;const m=n.transitional||gm;m&&m.legacyInterceptorReqResOrdering?s.unshift(v.fulfilled,v.rejected):s.push(v.fulfilled,v.rejected)});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let d,f=0,g;if(!l){const h=[VC.bind(this),void 0];for(h.unshift(...s),h.push(...c),g=h.length,d=Promise.resolve(n);f<g;)d=d.then(h[f++],h[f++]);return d}g=s.length;let p=n;for(;f<g;){const h=s[f++],v=s[f++];try{p=h(p)}catch(m){v.call(this,m);break}}try{d=VC.call(this,p)}catch(h){return Promise.reject(h)}for(f=0,g=c.length;f<g;)d=d.then(c[f++],c[f++]);return d}getUri(t){t=Vo(this.defaults,t);const n=jC(t.baseURL,t.url,t.allowAbsoluteUrls);return IC(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Wo.prototype[t]=function(n,r){return this.request(Vo(r||{},{method:t,url:n,data:(r||{}).data}))}}),ee.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,i,s){return this.request(Vo(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Wo.prototype[t]=n(),t!=="query"&&(Wo.prototype[t+"Form"]=n(!0))});let gL=class MS{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{r.subscribe(s),a=s}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,s){r.reason||(r.reason=new ts(a,i,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new MS(function(o){t=o}),cancel:t}}};function pL(e){return function(n){return e.apply(null,n)}}function vL(e){return ee.isObject(e)&&e.isAxiosError===!0}const Sm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Sm).forEach(([e,t])=>{Sm[t]=e});function qC(e){const t=new Wo(e),n=fC(Wo.prototype.request,t);return ee.extend(n,Wo.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return qC(Vo(e,o))},n}const Qt=qC(es);Qt.Axios=Wo,Qt.CanceledError=ts,Qt.CancelToken=gL,Qt.isCancel=TC,Qt.VERSION=bm,Qt.toFormData=pc,Qt.AxiosError=Re,Qt.Cancel=Qt.CanceledError,Qt.all=function(t){return Promise.all(t)},Qt.spread=pL,Qt.isAxiosError=vL,Qt.mergeConfig=Vo,Qt.AxiosHeaders=Mn,Qt.formToJSON=e=>PC(ee.isHTMLForm(e)?new FormData(e):e),Qt.getAdapter=HC.getAdapter,Qt.HttpStatusCode=Sm,Qt.default=Qt;const{Axios:HF,AxiosError:VF,CanceledError:WF,isCancel:qF,CancelToken:UF,VERSION:GF,all:KF,Cancel:XF,isAxiosError:YF,spread:JF,toFormData:ZF,AxiosHeaders:QF,HttpStatusCode:eD,formToJSON:tD,getAdapter:nD,mergeConfig:rD,create:oD}=Qt;let xm={},wm={};function UC(e){xm={...xm,...e}}function hL(){return xm}function GC(e){wm={...wm,...e}}function bL(){return wm}const qo=Qt.create();qo.interceptors.request.use(e=>{const t=hL();return t.baseURL&&(e.baseURL=t.baseURL),e.headers={...e.headers,"Content-Type":"application/json",...t.headers},e});async function KC(){return qo({url:"/bpmn/approval/action/queryUserAndRoleData",method:"post"})}async function yL(e){return qo({url:"/bpmn/json/getBpmnJson",method:"post",data:e})}async function CL(e){return qo({url:"/bpmn/process/queryBpmnJsonAndNodeStatus",method:"post",data:e})}async function SL(e){return qo({url:"/bpmn/json/bizForm",method:"post",data:{processKey:e}})}async function xL(e){return qo({url:"/bpmn/json/saveBpmnJson",method:"post",data:e})}async function wL(e){return qo({url:"/bpmn/json/bpmnJsonToXml",method:"post",data:e})}const $L=C.memo(e=>{const{mode:t,children:n,themeToken:r,materials:o,materialUis:a,processKey:i}=e,[,s]=wn(),l=C.useMemo(()=>({token:r||s,mode:t}),[t,r,s]),c=C.useMemo(()=>new Nx,[]);return C.useEffect(()=>{const d=localStorage.getItem("startNode");c&&d&&c.setStartNode(JSON.parse(d))},[c]),C.useEffect(()=>{i&&(localStorage.removeItem("startNode"),(async()=>{const f=await yL({processKey:i});f.data.data.jsonBpmn&&c.setStartNode(f.data.data.jsonBpmn)})())},[]),C.useEffect(()=>{const d=c.materials,f=c.materialUis;return c.materials=[...d,...tC,...o||[]],c.materialUis={...f,...a},()=>{c.materials=d,c.materialUis=f}},[a,o,c]),w.jsx(nC.Provider,{value:c,children:w.jsx(U1,{theme:l,children:c&&n})})}),EL=C.memo(e=>{const{children:t,lang:n,locales:r,...o}=e;return w.jsx(AA,{themeMode:o.mode,children:w.jsx($L,{...o,children:t})})}),XC={completed:"#52c41a",processing:"#faad14",pending:"#d9d9d9"},YC=C.createContext({getMaterial:()=>{},getMaterialUI:()=>{},getNodeStatus:()=>{},getStatusColor:()=>XC.pending});function ns(){return C.useContext(YC)}function JC(e){const{getMaterial:t}=ns();return t((e==null?void 0:e.nodeType)||"")}function $m(e){const{getMaterialUI:t}=ns();return t((e==null?void 0:e.nodeType)||"")}function Em(e){const{getNodeStatus:t}=ns();if(e)return t(e)}function Om(e){const{getStatusColor:t}=ns();if(e)return t(e)}function OL(e,t,n,r){const o=[...tC,...e||[]],a={...t},i={...XC,...r};return{getMaterial:s=>o.find(l=>{var c;return((c=l.defaultConfig)==null?void 0:c.nodeType)===s}),getMaterialUI:s=>a[s],getNodeStatus:s=>n==null?void 0:n[s],getStatusColor:s=>i[s]}}const IL=be.div`
980
+ `+a)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Vo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&yc.assertOptions(r,{silentJSONParsing:ir.transitional(ir.boolean),forcedJSONParsing:ir.transitional(ir.boolean),clarifyTimeoutError:ir.transitional(ir.boolean),legacyInterceptorReqResOrdering:ir.transitional(ir.boolean)},!1),o!=null&&(ee.isFunction(o)?n.paramsSerializer={serialize:o}:yc.assertOptions(o,{encode:ir.function,serialize:ir.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),yc.assertOptions(n,{baseUrl:ir.spelling("baseURL"),withXsrfToken:ir.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&ee.merge(a.common,a[n.method]);a&&ee.forEach(["delete","get","head","post","put","patch","query","common"],h=>{delete a[h]}),n.headers=Mn.concat(i,a);const s=[];let l=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;l=l&&v.synchronous;const m=n.transitional||gm;m&&m.legacyInterceptorReqResOrdering?s.unshift(v.fulfilled,v.rejected):s.push(v.fulfilled,v.rejected)});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let d,f=0,g;if(!l){const h=[VC.bind(this),void 0];for(h.unshift(...s),h.push(...c),g=h.length,d=Promise.resolve(n);f<g;)d=d.then(h[f++],h[f++]);return d}g=s.length;let p=n;for(;f<g;){const h=s[f++],v=s[f++];try{p=h(p)}catch(m){v.call(this,m);break}}try{d=VC.call(this,p)}catch(h){return Promise.reject(h)}for(f=0,g=c.length;f<g;)d=d.then(c[f++],c[f++]);return d}getUri(t){t=Vo(this.defaults,t);const n=jC(t.baseURL,t.url,t.allowAbsoluteUrls);return IC(n,t.params,t.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(t){Wo.prototype[t]=function(n,r){return this.request(Vo(r||{},{method:t,url:n,data:(r||{}).data}))}}),ee.forEach(["post","put","patch","query"],function(t){function n(r){return function(a,i,s){return this.request(Vo(s||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}Wo.prototype[t]=n(),t!=="query"&&(Wo.prototype[t+"Form"]=n(!0))});let gL=class MS{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(s=>{r.subscribe(s),a=s}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,s){r.reason||(r.reason=new ts(a,i,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new MS(function(o){t=o}),cancel:t}}};function pL(e){return function(n){return e.apply(null,n)}}function vL(e){return ee.isObject(e)&&e.isAxiosError===!0}const Sm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Sm).forEach(([e,t])=>{Sm[t]=e});function qC(e){const t=new Wo(e),n=fC(Wo.prototype.request,t);return ee.extend(n,Wo.prototype,t,{allOwnKeys:!0}),ee.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return qC(Vo(e,o))},n}const Qt=qC(es);Qt.Axios=Wo,Qt.CanceledError=ts,Qt.CancelToken=gL,Qt.isCancel=TC,Qt.VERSION=bm,Qt.toFormData=pc,Qt.AxiosError=Re,Qt.Cancel=Qt.CanceledError,Qt.all=function(t){return Promise.all(t)},Qt.spread=pL,Qt.isAxiosError=vL,Qt.mergeConfig=Vo,Qt.AxiosHeaders=Mn,Qt.formToJSON=e=>PC(ee.isHTMLForm(e)?new FormData(e):e),Qt.getAdapter=HC.getAdapter,Qt.HttpStatusCode=Sm,Qt.default=Qt;const{Axios:HF,AxiosError:VF,CanceledError:WF,isCancel:qF,CancelToken:UF,VERSION:GF,all:KF,Cancel:XF,isAxiosError:YF,spread:JF,toFormData:ZF,AxiosHeaders:QF,HttpStatusCode:eD,formToJSON:tD,getAdapter:nD,mergeConfig:rD,create:oD}=Qt;let xm={},wm={};function UC(e){xm={...xm,...e}}function hL(){return xm}function GC(e){wm={...wm,...e}}function bL(){return wm}const qo=Qt.create();qo.interceptors.request.use(e=>{const t=hL();return t.baseURL&&(e.baseURL=t.baseURL),e.headers={...e.headers,"Content-Type":"application/json",...t.headers},e});async function KC(){return qo({url:"/bpmn/approval/action/queryUserAndRoleData",method:"post"})}async function yL(e){return qo({url:"/bpmn/json/getBpmnJson",method:"post",data:e})}async function CL(e){return qo({url:"/bpmn/process/queryBpmnJsonAndNodeStatus",method:"post",data:e})}async function SL(e){return qo({url:"/bpmn/json/bizForm",method:"post",data:{processKey:e}})}async function xL(e){return qo({url:"/bpmn/json/saveBpmnJson",method:"post",data:e})}async function wL(e){return qo({url:"/bpmn/json/bpmnJsonToXml",method:"post",data:e})}const $L=C.memo(e=>{const{mode:t,children:n,themeToken:r,materials:o,materialUis:a,processKey:i}=e,[,s]=wn(),l=C.useMemo(()=>({token:r||s,mode:t}),[t,r,s]),c=C.useMemo(()=>new Nx,[]);return C.useEffect(()=>{const d=localStorage.getItem("startNode");c&&d&&c.setStartNode(JSON.parse(d))},[c]),C.useEffect(()=>{i&&(localStorage.removeItem("startNode"),(async()=>{const f=await yL({processKey:i});f.data.data.jsonBpmn&&c.setStartNode(f.data.data.jsonBpmn)})())},[]),C.useEffect(()=>{console.log("set materials effect");const d=c.materials,f=c.materialUis;return c.materials=[...d,...tC,...o||[]],c.materialUis={...f,...a},()=>{c.materials=d,c.materialUis=f}},[a,o,c]),w.jsx(nC.Provider,{value:c,children:w.jsx(U1,{theme:l,children:c&&n})})}),EL=C.memo(e=>{const{children:t,lang:n,locales:r,...o}=e;return w.jsx(AA,{themeMode:o.mode,children:w.jsx($L,{...o,children:t})})}),XC={completed:"#52c41a",processing:"#faad14",pending:"#d9d9d9"},YC=C.createContext({getMaterial:()=>{},getMaterialUI:()=>{},getNodeStatus:()=>{},getStatusColor:()=>XC.pending});function ns(){return C.useContext(YC)}function JC(e){const{getMaterial:t}=ns();return t((e==null?void 0:e.nodeType)||"")}function $m(e){const{getMaterialUI:t}=ns();return t((e==null?void 0:e.nodeType)||"")}function Em(e){const{getNodeStatus:t}=ns();if(e)return t(e)}function Om(e){const{getStatusColor:t}=ns();if(e)return t(e)}function OL(e,t,n,r){const o=[...tC,...e||[]],a={...t},i={...XC,...r};return{getMaterial:s=>o.find(l=>{var c;return((c=l.defaultConfig)==null?void 0:c.nodeType)===s}),getMaterialUI:s=>a[s],getNodeStatus:s=>n==null?void 0:n[s],getStatusColor:s=>i[s]}}const IL=be.div`
981
981
  position: absolute;
982
982
  top: -6px;
983
983
  right: -6px;
@@ -1249,7 +1249,7 @@ html body {
1249
1249
  bottom: 0;
1250
1250
  background: ${e=>{var t;return(t=e.theme.token)==null?void 0:t.colorPrimary}};
1251
1251
  height: 2px;
1252
- `,az=C.memo(e=>{var s,l;const{value:t,options:n,onChange:r}=e,[o,a]=C.useState(t||((l=(s=e.options)==null?void 0:s[0])==null?void 0:l.key));C.useEffect(()=>{a(t)},[t]);const i=C.useCallback(c=>{a(c),r==null||r(c)},[r]);return w.jsx(nz,{children:n.map(c=>w.jsx(C.Fragment,{children:w.jsxs(rz,{className:o===c.key?"active":void 0,onClick:()=>i(c.key),children:[c.label,o===c.key&&w.jsx(oz,{})]})},c.key))})}),iz={display:"grid",marginTop:"10px"};function sz({form:e}){const t=e.getFieldValue("actions"),n=(t==null?void 0:t.map(p=>p.code))||[],[r,o]=C.useState(n),[a,i]=C.useState($_),s={wrapperCol:{span:24}},l=()=>{a.forEach(p=>{t.length&&t.forEach(h=>{h.code===p.code&&(p.button=h.button)})}),i(a)};C.useEffect(()=>{l()},[t]);const c=p=>{o(p);const h=[];a.forEach(v=>{v.code&&p.includes(v.code)&&h.push(v)}),e.setFieldValue("actions",h)},d=p=>{const h=JSON.parse(JSON.stringify(a));h.forEach(v=>{v.code===p.code&&(v.edit=!v.edit)}),i(h)},f=(p,h)=>{const v=JSON.parse(JSON.stringify(a));v.forEach(m=>{m.code===h.code&&(m.button=p.target.value)}),i(v)},g=p=>{const h=JSON.parse(JSON.stringify(a)),v=[];h.forEach(m=>{m.code===p.code&&(m.edit=!m.edit),r.includes(m.code)&&v.push(m)}),i(h),e.setFieldValue("actions",v)};return w.jsxs(w.Fragment,{children:[w.jsxs(Ao,{children:[w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"权限名字"}),w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"按钮名字"})]}),w.jsx(Nl.Group,{style:iz,value:r,onChange:c,children:w.jsx(w.Fragment,{children:a.map(p=>w.jsxs(Ao,{children:[w.jsx(Gt,{span:12,children:w.jsx(Nl,{value:p.code,style:{lineHeight:"32px"},children:p.name})}),!p.edit&&w.jsxs(Gt,{span:12,children:[p.button," ",w.jsx(c1,{onClick:()=>d(p)})]}),p.edit&&w.jsx(Gt,{span:12,children:w.jsx(Kt,{placeholder:"按钮名字",value:p.button,onChange:h=>f(h,p),onBlur:()=>g(p)})})]},p.code))})}),w.jsx("div",{style:{display:"none"},children:w.jsx(ze.List,{name:"actions",children:p=>w.jsx(w.Fragment,{children:p.map((h,v)=>C.createElement(ze.Item,{...s,required:!1,key:v},w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[w.jsx(ze.Item,{name:[h.name,"code"],noStyle:!0,children:w.jsx(Kt,{placeholder:"权限"})}),w.jsx(ze.Item,{name:[h.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"权限名字"})}),w.jsx(ze.Item,{name:[h.name,"button"],noStyle:!0,children:w.jsx(Kt,{placeholder:"按钮名字"})})]})))})})})]})}const nS=C.createContext({}),wc=()=>C.useContext(nS);function lz({id:e,value:t,onChange:n}){const{onSelectRoles:r}=wc(),[o,a]=C.useState([]),[i,s]=C.useState();C.useEffect(()=>{(async()=>{var f,g;if(r){const p=await r();a(p);return}const d=await KC();a(((g=(f=d.data)==null?void 0:f.data)==null?void 0:g.roleList)||[])})()},[]),C.useEffect(()=>{const c=t!=null&&t.ids?t.ids.split(","):[];s(c==null?void 0:c[0])},[t]);const l=c=>{const d=o.find(f=>f.value===c);d?(n==null||n({ids:d.value,names:d.label}),s(d.value)):(n==null||n(void 0),s(void 0))};return w.jsx("div",{id:e,children:w.jsx(Rn,{value:i,options:o,placeholder:"请选择角色",allowClear:!0,showSearch:!0,filterOption:(c,d)=>((d==null?void 0:d.label)??"").toLowerCase().includes(c.toLowerCase()),onChange:l})})}var Nm,rS;function oS(){if(rS)return Nm;rS=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Nm=e,Nm}var Pm,aS;function cz(){if(aS)return Pm;aS=1;var e=typeof ds=="object"&&ds&&ds.Object===Object&&ds;return Pm=e,Pm}var Tm,iS;function sS(){if(iS)return Tm;iS=1;var e=cz(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Tm=n,Tm}var Mm,lS;function uz(){if(lS)return Mm;lS=1;var e=sS(),t=function(){return e.Date.now()};return Mm=t,Mm}var _m,cS;function dz(){if(cS)return _m;cS=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return _m=t,_m}var Am,uS;function fz(){if(uS)return Am;uS=1;var e=dz(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Am=n,Am}var jm,dS;function fS(){if(dS)return jm;dS=1;var e=sS(),t=e.Symbol;return jm=t,jm}var Lm,mS;function mz(){if(mS)return Lm;mS=1;var e=fS(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function a(i){var s=n.call(i,o),l=i[o];try{i[o]=void 0;var c=!0}catch{}var d=r.call(i);return c&&(s?i[o]=l:delete i[o]),d}return Lm=a,Lm}var zm,gS;function gz(){if(gS)return zm;gS=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return zm=n,zm}var Fm,pS;function pz(){if(pS)return Fm;pS=1;var e=fS(),t=mz(),n=gz(),r="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function i(s){return s==null?s===void 0?o:r:a&&a in Object(s)?t(s):n(s)}return Fm=i,Fm}var Dm,vS;function vz(){if(vS)return Dm;vS=1;function e(t){return t!=null&&typeof t=="object"}return Dm=e,Dm}var Bm,hS;function hz(){if(hS)return Bm;hS=1;var e=pz(),t=vz(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Bm=r,Bm}var Rm,bS;function bz(){if(bS)return Rm;bS=1;var e=fz(),t=oS(),n=hz(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=a.test(c);return f||i.test(c)?s(c.slice(2),f?2:8):o.test(c)?r:+c}return Rm=l,Rm}var km,yS;function yz(){if(yS)return km;yS=1;var e=oS(),t=uz(),n=bz(),r="Expected a function",o=Math.max,a=Math.min;function i(s,l,c){var d,f,g,p,h,v,m=0,b=!1,y=!1,S=!0;if(typeof s!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(b=!!c.leading,y="maxWait"in c,g=y?o(n(c.maxWait)||0,l):g,S="trailing"in c?!!c.trailing:S);function x(_){var T=d,j=f;return d=f=void 0,m=_,p=s.apply(j,T),p}function $(_){return m=_,h=setTimeout(O,l),b?x(_):p}function E(_){var T=_-v,j=_-m,z=l-T;return y?a(z,g-j):z}function I(_){var T=_-v,j=_-m;return v===void 0||T>=l||T<0||y&&j>=g}function O(){var _=t();if(I(_))return N(_);h=setTimeout(O,E(_))}function N(_){return h=void 0,S&&d?x(_):(d=f=void 0,p)}function P(){h!==void 0&&clearTimeout(h),m=0,d=v=f=h=void 0}function M(){return h===void 0?p:N(t())}function A(){var _=t(),T=I(_);if(d=arguments,f=this,v=_,T){if(h===void 0)return $(v);if(y)return clearTimeout(h),h=setTimeout(O,l),x(v)}return h===void 0&&(h=setTimeout(O,l)),p}return A.cancel=P,A.flush=M,A}return km=i,km}var Cz=yz();const Sz=wg(Cz),xz=100;function wz(e,t,n){const r=e.filter(i=>t.includes(i.value)),a=e.filter(i=>!t.includes(i.value)).slice(0,Math.max(0,n-r.length));return[...r,...a]}function Hm({id:e,value:t,onChange:n}){const{onSelectMembers:r}=wc(),[o,a]=C.useState([]),[i,s]=C.useState(""),[l,c]=C.useState([]);C.useEffect(()=>{(async()=>{var y,S;if(r){const x=await r();a(x);return}const b=await KC();a(((S=(y=b.data)==null?void 0:y.data)==null?void 0:S.userList)||[])})()},[]),C.useEffect(()=>{const m=t!=null&&t.ids?t.ids.split(","):[];c(m)},[t]);const d=C.useMemo(()=>{const m=i.trim().toLowerCase();return m?o.filter(b=>b.label.toLowerCase().includes(m)||b.value.toLowerCase().includes(m)):o},[o,i]),f=C.useMemo(()=>wz(d,l,xz),[d,l]),g=m=>{const b=o.filter(y=>m==null?void 0:m.includes(y.value));if(b&&b.length){const y=b.map(x=>x.value),S=b.map(x=>x.label);n==null||n({ids:y.join(","),names:S.join(",")||""}),c(y)}else n==null||n(void 0),c([])},p=C.useCallback(m=>{s(m)},[]),h=C.useMemo(()=>Sz(m=>p(m),300),[p]),v=m=>{h(m)};return w.jsx("div",{id:e,children:w.jsx(Rn,{mode:"multiple",value:l,options:f,placeholder:"请选择成员",showSearch:!0,filterOption:!1,onSearch:v,onChange:g})})}const Vm="userId",CS="initiator",$z="initiatorDirectManager",Ez="initiatorDepartmentManager",Wm="role",SS=[{value:Vm,label:"指定成员"},{value:CS,label:"发起人自己"},{value:$z,label:"发起⼈的直属主管"},{value:Ez,label:"发起⼈的部⻔主管"},{value:Wm,label:"指定角色"}],Oz={display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8};function qm({form:e,applyType:t="approver"}){const[n,r]=C.useState(e.getFieldValue("groupType")||"userId"),o=C.useMemo(()=>t==="message"?"通知人员":"成员选择",[t]),a=C.useMemo(()=>t==="message"?"通知角色":"角色选择",[t]),i=C.useCallback(()=>{e.setFieldsValue({assignee:void 0,role:void 0})},[e]);return C.useEffect(()=>{e.getFieldValue("groupType")||e.setFieldsValue({groupType:n})},[]),w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"用户类型",name:"groupType",required:!0,children:w.jsx(zt.Group,{style:Oz,onChange:s=>{const l=s.target.value;r(l),i()},children:SS.map(s=>w.jsx(zt,{value:s.value,children:s.label},s.value))})}),n==="userId"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:o,name:"assignee",required:!0,rules:[{required:!0,message:`请选择${o}`}],children:w.jsx(Hm,{})})}),n==="role"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:a,name:"role",required:!0,rules:[{required:!0,message:`请选择${a}`}],children:w.jsx(lz,{})})})]})}const xS=[{label:"会签",description:"默认需要所有审批人同意",value:"countersign",needConfig:!0,text:{configTitle:"会签配置",ratioTitle:"会签审核通过比例(%)",numTitle:"会签审核通过数量"}},{label:"或签",description:"一名审批人同意即可通过",value:"orSign",needConfig:!0,text:{configTitle:"或签配置",ratioTitle:"或签审核拒绝比例(%)",numTitle:"或签审核拒绝数量"}},{label:"并签",description:"同时审批通过",value:"andSign",needConfig:!0,text:{configTitle:"并签配置",ratioTitle:"并签审核通过比例(%)",numTitle:"并签审核通过数量"}},{label:"依次审批",description:"按审批顺序依次审批",value:"serialSign",needConfig:!1}],Iz={display:"flex",flexDirection:"column",gap:8},wS={display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8};function Nz({form:e}){var c,d,f;const[t,n]=C.useState(),[r,o]=C.useState(e.getFieldValue("signConfig.useRatio")||!0),a=ze.useWatch("groupType",e),i=ze.useWatch(["approver_is_empty","type"],e),s=ze.useWatch(["comment_setting","type"],e),l=g=>{const p=xS.find(h=>h.value===g);n(p)};return C.useEffect(()=>{l(e.getFieldValue("approverType")||"countersign")},[e]),w.jsxs(w.Fragment,{children:[w.jsx(qm,{form:e}),a!==CS&&w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"多人审批时采用的审批方式",name:"approverType",required:!0,children:w.jsx(zt.Group,{style:Iz,onChange:g=>{l(g.target.value)},children:xS.map(g=>w.jsxs(zt,{value:g.value,children:[g.label,"(",g.description,")"]},g.value))})}),(t==null?void 0:t.needConfig)&&w.jsxs(w.Fragment,{children:[w.jsx("p",{children:(c=t==null?void 0:t.text)==null?void 0:c.configTitle}),w.jsx(ze.Item,{layout:"horizontal",label:"类型",name:["signConfig","useRatio"],rules:[{required:!0}],children:w.jsx(Bl,{checkedChildren:"按比例",unCheckedChildren:"按数量",onChange:o})}),r&&w.jsx(ze.Item,{layout:"horizontal",label:(d=t==null?void 0:t.text)==null?void 0:d.ratioTitle,name:["signConfig","ratio"],rules:[{required:!0,message:"请输入比例"}],children:w.jsx(Al,{min:1,max:100,step:1,precision:2})}),!r&&w.jsx(ze.Item,{layout:"horizontal",label:(f=t==null?void 0:t.text)==null?void 0:f.numTitle,name:["signConfig","num"],rules:[{required:!0,message:"请输入数量"}],children:w.jsx(Al,{min:1,step:1,precision:0})})]})]}),w.jsx(ze.Item,{label:"审批人包含发起人时",name:["initiator_is_included","type"],required:!0,children:w.jsxs(zt.Group,{style:wS,children:[w.jsx(zt,{value:"require_process",children:"发起人继续处理"}),w.jsx(zt,{value:"auto_pass",children:"发起人不用处理"}),w.jsx(zt,{value:"forward_initiatorDirectManager",children:"转交给发起人直属主管处理"}),w.jsx(zt,{value:"forward_initiatorDepartmentManager",children:"转交给发起人部门主管处理"})]})}),w.jsx(ze.Item,{label:"审批人为空时",name:["approver_is_empty","type"],required:!0,children:w.jsxs(zt.Group,{style:wS,children:[w.jsx(zt,{value:"auto_pass",children:"自动通过"}),w.jsx(zt,{value:"auto_refuse",children:"自动拒绝"}),w.jsx(zt,{value:"assign_approver",children:"指定人员"}),w.jsx(zt,{value:"prompt_error",children:"报错提醒"})]})}),i==="assign_approver"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:"指定人员",name:["approver_is_empty","user"],required:!0,rules:[{required:!0,message:"请选择指定人员"}],children:w.jsx(Hm,{})})}),w.jsx(ze.Item,{label:"审批被拒绝时",name:["approval_is_refused","type"],required:!0,rules:[{required:!0,message:"请选择审批被拒绝时的操作"}],children:w.jsxs(zt.Group,{children:[w.jsx(zt,{value:"end_process",children:"直接结束流程"}),w.jsx(zt,{value:"back_to_initiator",children:"退回到发起人"})]})}),w.jsx(ze.Item,{label:"审批意⻅设置",name:["comment_setting","type"],required:!0,rules:[{required:!0,message:"请选择审批被拒绝时的操作"}],children:w.jsxs(zt.Group,{children:[w.jsx(zt,{value:"everyone",children:"所有人可见"}),w.jsx(zt,{value:"assign_approver",children:"指定人员可见"})]})}),s==="assign_approver"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:"指定人员",name:["comment_setting","user"],required:!0,rules:[{required:!0,message:"请选择指定人员"}],children:w.jsx(Hm,{})})})]})}function Pz(){const e={labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:24}}};return w.jsx(ze.List,{name:"extended",children:(t,{add:n,remove:r},{errors:o})=>w.jsxs(w.Fragment,{children:[t.map((a,i)=>C.createElement(ze.Item,{...e,required:!1,key:i},w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[w.jsx(ze.Item,{name:[a.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"扩展名"})}),w.jsx(ze.Item,{name:[a.name,"code"],noStyle:!0,children:w.jsx(Kt,{placeholder:"扩展值"})}),w.jsx(om,{onClick:()=>{r(a.name)}})]}))),w.jsxs(ze.Item,{children:[w.jsx(Et,{type:"dashed",onClick:()=>n(),style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加扩展"}),w.jsx(ze.ErrorList,{errors:o})]})]})})}function Tz(){const e={labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:24}}};return w.jsxs("div",{children:[w.jsxs(Ao,{gutter:10,style:{marginBottom:"20px",background:"#fafafa",lineHeight:"40px"},children:[w.jsx(Gt,{span:12,style:{paddingLeft:"10px",fontWeight:"bold"},children:"表单字段"}),w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"操作"})]}),w.jsx(ze.List,{name:"formConfig",children:(t,{add:n,remove:r},{errors:o})=>w.jsxs(w.Fragment,{children:[t.map((a,i)=>C.createElement(ze.Item,{...e,required:!1,key:i},w.jsxs(Ao,{gutter:10,children:[w.jsx(Gt,{span:12,children:w.jsx(ze.Item,{name:[a.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"字段名"})})}),w.jsx(Gt,{span:10,children:w.jsx(ze.Item,{name:[a.name,"operate"],noStyle:!0,children:w.jsxs(zt.Group,{defaultValue:"1",children:[w.jsx(zt,{value:"1",children:"只读"}),w.jsx(zt,{value:"2",children:"编辑"}),w.jsx(zt,{value:"3",children:"隐藏"})]})})}),w.jsx(Gt,{span:2,children:w.jsx(om,{onClick:()=>{r(a.name)}})})]}))),w.jsxs(ze.Item,{children:[w.jsx(Et,{type:"dashed",onClick:()=>n(),style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加字段"}),w.jsx(ze.ErrorList,{errors:o})]})]})})]})}function $S({name:e}){return w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"请求地址",required:!0,name:[...e,"api_request_url"],rules:[{required:!0,message:"请输入请求地址"},{type:"url",message:"请输入正确的URL地址"}],children:w.jsx(Kt,{placeholder:"请输入请求地址"})}),w.jsx(ze.Item,{label:"请求头",tooltip:"请求头格式为JSON字符串",name:[...e,"api_request_headers"],children:w.jsx(Kt.TextArea,{autoSize:{minRows:4,maxRows:6},placeholder:"请输入请求头"})}),w.jsx(ze.Item,{label:"请求体",tooltip:"请求体格式为JSON字符串",name:[...e,"api_request_body"],children:w.jsx(Kt.TextArea,{autoSize:{minRows:4,maxRows:6},placeholder:"请输入请求体"})})]})}function Mz({form:e}){const t=ze.useWatch(["listeners","task_create","open"],e),n=ze.useWatch(["listeners","task_finish","open"],e);return w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"创建任务",name:["listeners","task_create","open"],children:w.jsx(Bl,{checkedChildren:"开启",unCheckedChildren:"关闭"})}),t&&w.jsx($S,{name:["listeners","task_create"]}),w.jsx(ze.Item,{label:"任务完成",name:["listeners","task_finish","open"],children:w.jsx(Bl,{checkedChildren:"开启",unCheckedChildren:"关闭"})}),n&&w.jsx($S,{name:["listeners","task_finish"]})]})}const _z=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm(),[r,o]=C.useState("assignee");return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(az,{options:[{key:"assignee",label:"审批人"},{key:"actions",label:"操作权限"},{key:"listeners",label:"监听器"}],value:r,onChange:o}),w.jsx("div",{style:{display:r==="assignee"?"block":"none"},children:w.jsx(Nz,{form:n})}),w.jsx("div",{style:{display:r==="actions"?"block":"none"},children:w.jsx(sz,{form:n})}),w.jsx("div",{style:{display:r==="formConfig"?"block":"none"},children:w.jsx(Tz,{})}),w.jsx("div",{style:{display:r==="extended"?"block":"none"},children:w.jsx(Pz,{})}),w.jsx("div",{style:{display:r==="listeners"?"block":"none"},children:w.jsx(Mz,{form:n})})]})}));function Az(){return w.jsxs(Ao,{gutter:10,style:{marginBottom:20,background:"#fafafa",lineHeight:"40px"},children:[w.jsx(Gt,{span:3,style:{paddingLeft:10,fontWeight:"bold"},children:"关系"}),w.jsx(Gt,{span:9,style:{fontWeight:"bold"},children:"字段"}),w.jsx(Gt,{span:6,style:{fontWeight:"bold"},children:"条件"}),w.jsx(Gt,{span:4,style:{fontWeight:"bold"},children:"条件值"}),w.jsx(Gt,{span:2,style:{fontWeight:"bold"},children:"操作"})]})}const jz=[{label:"且",value:"and"},{label:"或",value:"or"}],Lz={and:"&&",or:"||"},ES={eq:"等于",ne:"不等于",gt:"大于",ge:"大于等于",lt:"小于",le:"小于等于",like:"包含",like_start:"开头包含",like_end:"结尾包含",empty:"为空",not_empty:"不为空"},zz={eq:"=",ne:"!=",gt:">",ge:">=",lt:"<",le:"<=",like:"contains",like_start:"startsWith",like_end:"endsWith",empty:"is empty",not_empty:"is not empty"},Fz=["eq","ne"],Dz=["eq","ne","gt","ge","lt","le"],Bz={text:Fz.map(e=>({label:ES[e],value:e})),number:Dz.map(e=>({label:ES[e],value:e}))},Rz={relation:"and",field:"",fieldType:"text",operator:"eq",value:""};function kz(e){const{item:t,fields:n,operatorOptionsByType:r,valueControls:o,onChange:a,onRemove:i}=e,s=C.useMemo(()=>n.map(v=>({label:v.label,value:v.value})),[n]),l=C.useMemo(()=>r[t.fieldType]||[],[r,t.fieldType]),c=t.operator!=="empty"&&t.operator!=="not_empty",d=o[t.fieldType],f=C.useCallback(v=>a({...t,relation:v}),[t,a]),g=C.useCallback(v=>{const m=n.find($=>$.value===v),b=m?m.type:t.fieldType,y=r[b].map($=>$.value),S=y.includes(t.operator)?t.operator:y[0];a({...t,field:v,fieldType:b,operator:S,value:S==="empty"||S==="not_empty"?void 0:b==="number"?0:""})},[n,t,a,r]),p=C.useCallback(v=>{const m=v==="empty"||v==="not_empty"?void 0:t.fieldType==="number"?typeof t.value=="number"?t.value:0:typeof t.value=="string"?t.value:"";a({...t,operator:v,value:m})},[t,a]),h=C.useCallback(v=>a({...t,value:v}),[t,a]);return w.jsxs(Ao,{gutter:10,style:{marginBottom:8},children:[w.jsx(Gt,{span:3,children:w.jsx(Rn,{placeholder:"关系",options:jz,value:t.relation,onChange:f,style:{width:"100%"}})}),w.jsx(Gt,{span:9,children:w.jsx(Rn,{placeholder:"字段",options:s,value:t.field,onChange:g,style:{width:"100%"}})}),w.jsx(Gt,{span:6,children:w.jsx(Rn,{placeholder:"条件",options:l,value:t.operator,onChange:p,style:{width:"100%"}})}),w.jsx(Gt,{span:4,children:c&&d?w.jsx(d,{value:t.value,onChange:h}):null}),w.jsx(Gt,{span:2,style:{display:"flex",alignItems:"center"},children:w.jsx(om,{onClick:i})})]})}function Hz(e){const{value:t,onChange:n,fields:r,defaultCondition:o,operatorOptionsByType:a,valueControls:i}=e,s=C.useCallback(()=>n([...t||[],o]),[n,t,o]),l=C.useCallback(d=>{const f=[...t];f.splice(d,1),n(f)},[n,t]),c=C.useCallback((d,f)=>{const g=[...t];g[d]=f,n(g)},[n,t]);return w.jsxs(w.Fragment,{children:[(t||[]).map((d,f)=>w.jsx(kz,{item:d,fields:r,operatorOptionsByType:a,valueControls:i,onChange:g=>c(f,g),onRemove:()=>l(f)},f)),w.jsx(Et,{type:"dashed",onClick:s,style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加条件"})]})}const Vz={text:({value:e,onChange:t})=>{const n=typeof e=="string"?e:"";return w.jsx(Kt,{value:n,onChange:r=>t(r.target.value),placeholder:"条件值"})},number:({value:e,onChange:t})=>{const n=typeof e=="number"?e:void 0;return w.jsx(Al,{style:{width:"100%"},value:n,onChange:r=>t(typeof r=="number"?r:void 0)})}};function Wz(e){const t=["empty","not_empty"];function n(i,s){return i===0||!s?"":` ${Lz[s]||""} `}function r(i){let s="";return t.includes(i.operator)||!i.value?"":(i.fieldType==="text"?s=`'${i.value}'`:s=i.value.toString(),` ${s}`)}function o(i){if(!i.field||!i.operator)return"";const s=r(i);if(!t.includes(i.operator)&&!s)return"";const l=zz[i.operator]||"";return`${i.field} ${l}${s}`}if(!e)return"";let a="";return e.forEach((i,s)=>{a+=n(s,i.relation),a+=o(i)}),a?`\${${a}}`:""}function qz(e){const[t,n]=C.useState([]),[r,o]=C.useState([]),a="value"in e,i=C.useMemo(()=>a?e.value||[]:t,[a,e.value,t]),s=C.useCallback(d=>{a||n(d),e.onChange&&e.onChange(d)},[a,e]),l=C.useCallback(d=>s(d),[s]),c=C.useCallback(async d=>{var f,g;try{const p=await SL(d);o(((g=(f=p.data)==null?void 0:f.data)==null?void 0:g.bizFormJson)||[])}catch(p){console.error("[海牛工作流SDK}] 获取条件单字段失败",p)}},[]);return C.useEffect(()=>{const d=bL();c(d.key||"")},[c]),w.jsxs("div",{children:[w.jsx(Az,{}),w.jsx(Hz,{value:i,onChange:l,fields:r,defaultCondition:Rz,operatorOptionsByType:Bz,valueControls:Vz})]})}const Uz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(ze.Item,{name:"conditions",noStyle:!0,children:w.jsx(qz,{onChange:r=>n.setFieldValue("condition",Wz(r))})}),w.jsx(ze.Item,{hidden:!0,name:"condition"})]})})),OS={approverType:"orSign",actions:[{code:"addSigner",name:"加签",button:"加签"}]},Gz=C.forwardRef((e,t)=>{const{value:n}=e,[r]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>r.getFieldsValue(),validateFields:()=>(console.log("validate dispatcher panel",r.getFieldsValue()),r.validateFields())}),[r]),C.useEffect(()=>{r.setFieldsValue({...OS,...n})},[n,r]),w.jsxs(ze,{form:r,layout:"vertical",colon:!1,initialValues:{...OS,...n},children:[w.jsx(qm,{form:r}),w.jsx(ze.Item,{label:"多人审批时采用的审批方式",name:"approverType",required:!0,hidden:!0,children:w.jsx(Kt,{})}),w.jsx(ze.Item,{label:"默认操作权限",name:"actions",required:!0,hidden:!0,children:w.jsx(Kt,{})})]})}),Kz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsx(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:w.jsx(qm,{form:n})})})),Xz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsx(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:w.jsx(ze.Item,{label:"发起人",name:"initiator",children:w.jsx(Kt,{})})})})),Yz=[{value:"scrap_apply",label:"报废申请"},{value:"dept_approve",label:"部门审批"},{value:"tech_eval",label:"技术评估"},{value:"asset_approve",label:"资产管理审批"},{value:"finance_approve",label:"财务审批"}],Jz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm(),r=(o,a)=>{n.setFieldValue("subProcessName",a.label)};return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(zl,{label:"子流程",name:"subProcessId",children:w.jsx(Rn,{placeholder:"请选择子流程",options:Yz,onChange:r})}),w.jsx(zl,{hidden:!0,name:"subProcessName",children:w.jsx(Kt,{})})]})}));function Um(e){var n,r,o,a,i;const t=(n=e.config)==null?void 0:n.groupType;return t?t===Vm?!!(((o=(r=e.config)==null?void 0:r.assignee)==null?void 0:o.ids)||""):t===Wm?!!(((i=(a=e.config)==null?void 0:a.role)==null?void 0:i.ids)||""):!0:!1}function Gm(e){var r,o;if(!e)return"";const t=e==null?void 0:e.groupType;let n;if(t){const a=SS.find(i=>i.value===t);if(a)switch(a.value){case Vm:n=((r=e==null?void 0:e.assignee)==null?void 0:r.names)||"";break;case Wm:n=((o=e==null?void 0:e.role)==null?void 0:o.names)||"";break;default:n=a.label;break}}return n}const IS={[it.approver]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择审批人"})},settersPanel:_z,validate:e=>Um(e)?!0:"未选择审批人"},[it.condition]:{viewContent:e=>{var n;const t=((n=e.config)==null?void 0:n.conditions)||[];return w.jsx(Fa,{secondary:!t.length,text:t.length?"已配置":"请配置条件"})},settersPanel:Uz,validate:e=>e.config?!0:`${e.name}未设置条件`},[it.notifier]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择抄送人"})},settersPanel:Kz,validate:e=>Um(e)?!0:"未选择抄送人"},[it.start]:{viewContent:e=>{var t;return w.jsx(Fa,{text:`${(t=e.config)==null?void 0:t.initiator}`})},settersPanel:Xz},[it.subProcess]:{viewContent:e=>{var t;return w.jsx(Fa,{text:`${((t=e.config)==null?void 0:t.subProcessName)||"选择子流程"}`})},validate:e=>{var t;return(t=e.config)!=null&&t.subProcessId?!0:"未选择子流程"},settersPanel:Jz},[it.dispatcher]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择分发人"})},settersPanel:Gz,validate:e=>(console.log("validate dispatcher",e),Um(e)?!0:"未选择分发人")}},Zz=be.div`
1252
+ `,az=C.memo(e=>{var s,l;const{value:t,options:n,onChange:r}=e,[o,a]=C.useState(t||((l=(s=e.options)==null?void 0:s[0])==null?void 0:l.key));C.useEffect(()=>{a(t)},[t]);const i=C.useCallback(c=>{a(c),r==null||r(c)},[r]);return w.jsx(nz,{children:n.map(c=>w.jsx(C.Fragment,{children:w.jsxs(rz,{className:o===c.key?"active":void 0,onClick:()=>i(c.key),children:[c.label,o===c.key&&w.jsx(oz,{})]})},c.key))})}),iz={display:"grid",marginTop:"10px"};function sz({form:e}){const t=e.getFieldValue("actions"),n=(t==null?void 0:t.map(p=>p.code))||[],[r,o]=C.useState(n),[a,i]=C.useState($_),s={wrapperCol:{span:24}},l=()=>{a.forEach(p=>{t.length&&t.forEach(h=>{h.code===p.code&&(p.button=h.button)})}),i(a)};C.useEffect(()=>{l()},[t]);const c=p=>{o(p);const h=[];a.forEach(v=>{v.code&&p.includes(v.code)&&h.push(v)}),e.setFieldValue("actions",h)},d=p=>{const h=JSON.parse(JSON.stringify(a));h.forEach(v=>{v.code===p.code&&(v.edit=!v.edit)}),i(h)},f=(p,h)=>{const v=JSON.parse(JSON.stringify(a));v.forEach(m=>{m.code===h.code&&(m.button=p.target.value)}),i(v)},g=p=>{const h=JSON.parse(JSON.stringify(a)),v=[];h.forEach(m=>{m.code===p.code&&(m.edit=!m.edit),r.includes(m.code)&&v.push(m)}),i(h),e.setFieldValue("actions",v)};return w.jsxs(w.Fragment,{children:[w.jsxs(Ao,{children:[w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"权限名字"}),w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"按钮名字"})]}),w.jsx(Nl.Group,{style:iz,value:r,onChange:c,children:w.jsx(w.Fragment,{children:a.map(p=>w.jsxs(Ao,{children:[w.jsx(Gt,{span:12,children:w.jsx(Nl,{value:p.code,style:{lineHeight:"32px"},children:p.name})}),!p.edit&&w.jsxs(Gt,{span:12,children:[p.button," ",w.jsx(c1,{onClick:()=>d(p)})]}),p.edit&&w.jsx(Gt,{span:12,children:w.jsx(Kt,{placeholder:"按钮名字",value:p.button,onChange:h=>f(h,p),onBlur:()=>g(p)})})]},p.code))})}),w.jsx("div",{style:{display:"none"},children:w.jsx(ze.List,{name:"actions",children:p=>w.jsx(w.Fragment,{children:p.map((h,v)=>C.createElement(ze.Item,{...s,required:!1,key:v},w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[w.jsx(ze.Item,{name:[h.name,"code"],noStyle:!0,children:w.jsx(Kt,{placeholder:"权限"})}),w.jsx(ze.Item,{name:[h.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"权限名字"})}),w.jsx(ze.Item,{name:[h.name,"button"],noStyle:!0,children:w.jsx(Kt,{placeholder:"按钮名字"})})]})))})})})]})}const nS=C.createContext({});function wc(){return C.useContext(nS)}function lz({id:e,value:t,onChange:n}){const{onSelectRoles:r}=wc(),[o,a]=C.useState([]),[i,s]=C.useState();C.useEffect(()=>{(async()=>{var f,g;if(r){const p=await r();a(p);return}const d=await KC();a(((g=(f=d.data)==null?void 0:f.data)==null?void 0:g.roleList)||[])})()},[]),C.useEffect(()=>{const c=t!=null&&t.ids?t.ids.split(","):[];s(c==null?void 0:c[0])},[t]);const l=c=>{const d=o.find(f=>f.value===c);d?(n==null||n({ids:d.value,names:d.label}),s(d.value)):(n==null||n(void 0),s(void 0))};return w.jsx("div",{id:e,children:w.jsx(Rn,{value:i,options:o,placeholder:"请选择角色",allowClear:!0,showSearch:!0,filterOption:(c,d)=>((d==null?void 0:d.label)??"").toLowerCase().includes(c.toLowerCase()),onChange:l})})}var Nm,rS;function oS(){if(rS)return Nm;rS=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Nm=e,Nm}var Pm,aS;function cz(){if(aS)return Pm;aS=1;var e=typeof ds=="object"&&ds&&ds.Object===Object&&ds;return Pm=e,Pm}var Tm,iS;function sS(){if(iS)return Tm;iS=1;var e=cz(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Tm=n,Tm}var Mm,lS;function uz(){if(lS)return Mm;lS=1;var e=sS(),t=function(){return e.Date.now()};return Mm=t,Mm}var _m,cS;function dz(){if(cS)return _m;cS=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return _m=t,_m}var Am,uS;function fz(){if(uS)return Am;uS=1;var e=dz(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return Am=n,Am}var jm,dS;function fS(){if(dS)return jm;dS=1;var e=sS(),t=e.Symbol;return jm=t,jm}var Lm,mS;function mz(){if(mS)return Lm;mS=1;var e=fS(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;function a(i){var s=n.call(i,o),l=i[o];try{i[o]=void 0;var c=!0}catch{}var d=r.call(i);return c&&(s?i[o]=l:delete i[o]),d}return Lm=a,Lm}var zm,gS;function gz(){if(gS)return zm;gS=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return zm=n,zm}var Fm,pS;function pz(){if(pS)return Fm;pS=1;var e=fS(),t=mz(),n=gz(),r="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function i(s){return s==null?s===void 0?o:r:a&&a in Object(s)?t(s):n(s)}return Fm=i,Fm}var Dm,vS;function vz(){if(vS)return Dm;vS=1;function e(t){return t!=null&&typeof t=="object"}return Dm=e,Dm}var Bm,hS;function hz(){if(hS)return Bm;hS=1;var e=pz(),t=vz(),n="[object Symbol]";function r(o){return typeof o=="symbol"||t(o)&&e(o)==n}return Bm=r,Bm}var Rm,bS;function bz(){if(bS)return Rm;bS=1;var e=fz(),t=oS(),n=hz(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,i=/^0o[0-7]+$/i,s=parseInt;function l(c){if(typeof c=="number")return c;if(n(c))return r;if(t(c)){var d=typeof c.valueOf=="function"?c.valueOf():c;c=t(d)?d+"":d}if(typeof c!="string")return c===0?c:+c;c=e(c);var f=a.test(c);return f||i.test(c)?s(c.slice(2),f?2:8):o.test(c)?r:+c}return Rm=l,Rm}var km,yS;function yz(){if(yS)return km;yS=1;var e=oS(),t=uz(),n=bz(),r="Expected a function",o=Math.max,a=Math.min;function i(s,l,c){var d,f,g,p,h,v,m=0,b=!1,y=!1,S=!0;if(typeof s!="function")throw new TypeError(r);l=n(l)||0,e(c)&&(b=!!c.leading,y="maxWait"in c,g=y?o(n(c.maxWait)||0,l):g,S="trailing"in c?!!c.trailing:S);function x(_){var T=d,j=f;return d=f=void 0,m=_,p=s.apply(j,T),p}function $(_){return m=_,h=setTimeout(O,l),b?x(_):p}function E(_){var T=_-v,j=_-m,z=l-T;return y?a(z,g-j):z}function I(_){var T=_-v,j=_-m;return v===void 0||T>=l||T<0||y&&j>=g}function O(){var _=t();if(I(_))return N(_);h=setTimeout(O,E(_))}function N(_){return h=void 0,S&&d?x(_):(d=f=void 0,p)}function P(){h!==void 0&&clearTimeout(h),m=0,d=v=f=h=void 0}function M(){return h===void 0?p:N(t())}function A(){var _=t(),T=I(_);if(d=arguments,f=this,v=_,T){if(h===void 0)return $(v);if(y)return clearTimeout(h),h=setTimeout(O,l),x(v)}return h===void 0&&(h=setTimeout(O,l)),p}return A.cancel=P,A.flush=M,A}return km=i,km}var Cz=yz();const Sz=wg(Cz),xz=100;function wz(e,t,n){const r=e.filter(i=>t.includes(i.value)),a=e.filter(i=>!t.includes(i.value)).slice(0,Math.max(0,n-r.length));return[...r,...a]}function Hm({id:e,value:t,onChange:n}){const{onSelectMembers:r}=wc(),[o,a]=C.useState([]),[i,s]=C.useState(""),[l,c]=C.useState([]);C.useEffect(()=>{(async()=>{var y,S;if(r){const x=await r();a(x);return}const b=await KC();a(((S=(y=b.data)==null?void 0:y.data)==null?void 0:S.userList)||[])})()},[]),C.useEffect(()=>{const m=t!=null&&t.ids?t.ids.split(","):[];c(m)},[t]);const d=C.useMemo(()=>{const m=i.trim().toLowerCase();return m?o.filter(b=>b.label.toLowerCase().includes(m)||b.value.toLowerCase().includes(m)):o},[o,i]),f=C.useMemo(()=>wz(d,l,xz),[d,l]),g=m=>{const b=o.filter(y=>m==null?void 0:m.includes(y.value));if(b&&b.length){const y=b.map(x=>x.value),S=b.map(x=>x.label);n==null||n({ids:y.join(","),names:S.join(",")||""}),c(y)}else n==null||n(void 0),c([])},p=C.useCallback(m=>{s(m)},[]),h=C.useMemo(()=>Sz(m=>p(m),300),[p]),v=m=>{h(m)};return w.jsx("div",{id:e,children:w.jsx(Rn,{mode:"multiple",value:l,options:f,placeholder:"请选择成员",showSearch:!0,filterOption:!1,onSearch:v,onChange:g})})}const Vm="userId",CS="initiator",$z="initiatorDirectManager",Ez="initiatorDepartmentManager",Wm="role",SS=[{value:Vm,label:"指定成员"},{value:CS,label:"发起人自己"},{value:$z,label:"发起⼈的直属主管"},{value:Ez,label:"发起⼈的部⻔主管"},{value:Wm,label:"指定角色"}],Oz={display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8};function qm({form:e,applyType:t="approver"}){const[n,r]=C.useState(e.getFieldValue("groupType")||"userId"),o=C.useMemo(()=>t==="message"?"通知人员":"成员选择",[t]),a=C.useMemo(()=>t==="message"?"通知角色":"角色选择",[t]),i=C.useCallback(()=>{e.setFieldsValue({assignee:void 0,role:void 0})},[e]);return C.useEffect(()=>{e.getFieldValue("groupType")||e.setFieldsValue({groupType:n})},[]),w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"用户类型",name:"groupType",required:!0,children:w.jsx(zt.Group,{style:Oz,onChange:s=>{const l=s.target.value;r(l),i()},children:SS.map(s=>w.jsx(zt,{value:s.value,children:s.label},s.value))})}),n==="userId"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:o,name:"assignee",required:!0,rules:[{required:!0,message:`请选择${o}`}],children:w.jsx(Hm,{})})}),n==="role"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:a,name:"role",required:!0,rules:[{required:!0,message:`请选择${a}`}],children:w.jsx(lz,{})})})]})}const xS=[{label:"会签",description:"默认需要所有审批人同意",value:"countersign",needConfig:!0,text:{configTitle:"会签配置",ratioTitle:"会签审核通过比例(%)",numTitle:"会签审核通过数量"}},{label:"或签",description:"一名审批人同意即可通过",value:"orSign",needConfig:!0,text:{configTitle:"或签配置",ratioTitle:"或签审核拒绝比例(%)",numTitle:"或签审核拒绝数量"}},{label:"并签",description:"同时审批通过",value:"andSign",needConfig:!0,text:{configTitle:"并签配置",ratioTitle:"并签审核通过比例(%)",numTitle:"并签审核通过数量"}},{label:"依次审批",description:"按审批顺序依次审批",value:"serialSign",needConfig:!1}],Iz={display:"flex",flexDirection:"column",gap:8},wS={display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:8};function Nz({form:e}){var c,d,f;const[t,n]=C.useState(),[r,o]=C.useState(e.getFieldValue("signConfig.useRatio")||!0),a=ze.useWatch("groupType",e),i=ze.useWatch(["approver_is_empty","type"],e),s=ze.useWatch(["comment_setting","type"],e),l=g=>{const p=xS.find(h=>h.value===g);n(p)};return C.useEffect(()=>{l(e.getFieldValue("approverType")||"countersign")},[e]),w.jsxs(w.Fragment,{children:[w.jsx(qm,{form:e}),a!==CS&&w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"多人审批时采用的审批方式",name:"approverType",required:!0,children:w.jsx(zt.Group,{style:Iz,onChange:g=>{l(g.target.value)},children:xS.map(g=>w.jsxs(zt,{value:g.value,children:[g.label,"(",g.description,")"]},g.value))})}),(t==null?void 0:t.needConfig)&&w.jsxs(w.Fragment,{children:[w.jsx("p",{children:(c=t==null?void 0:t.text)==null?void 0:c.configTitle}),w.jsx(ze.Item,{layout:"horizontal",label:"类型",name:["signConfig","useRatio"],rules:[{required:!0}],children:w.jsx(Bl,{checkedChildren:"按比例",unCheckedChildren:"按数量",onChange:o})}),r&&w.jsx(ze.Item,{layout:"horizontal",label:(d=t==null?void 0:t.text)==null?void 0:d.ratioTitle,name:["signConfig","ratio"],rules:[{required:!0,message:"请输入比例"}],children:w.jsx(Al,{min:1,max:100,step:1,precision:2})}),!r&&w.jsx(ze.Item,{layout:"horizontal",label:(f=t==null?void 0:t.text)==null?void 0:f.numTitle,name:["signConfig","num"],rules:[{required:!0,message:"请输入数量"}],children:w.jsx(Al,{min:1,step:1,precision:0})})]})]}),w.jsx(ze.Item,{label:"审批人包含发起人时",name:["initiator_is_included","type"],required:!0,children:w.jsxs(zt.Group,{style:wS,children:[w.jsx(zt,{value:"require_process",children:"发起人继续处理"}),w.jsx(zt,{value:"auto_pass",children:"发起人不用处理"}),w.jsx(zt,{value:"forward_initiatorDirectManager",children:"转交给发起人直属主管处理"}),w.jsx(zt,{value:"forward_initiatorDepartmentManager",children:"转交给发起人部门主管处理"})]})}),w.jsx(ze.Item,{label:"审批人为空时",name:["approver_is_empty","type"],required:!0,children:w.jsxs(zt.Group,{style:wS,children:[w.jsx(zt,{value:"auto_pass",children:"自动通过"}),w.jsx(zt,{value:"auto_refuse",children:"自动拒绝"}),w.jsx(zt,{value:"assign_approver",children:"指定人员"}),w.jsx(zt,{value:"prompt_error",children:"报错提醒"})]})}),i==="assign_approver"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:"指定人员",name:["approver_is_empty","user"],required:!0,rules:[{required:!0,message:"请选择指定人员"}],children:w.jsx(Hm,{})})}),w.jsx(ze.Item,{label:"审批被拒绝时",name:["approval_is_refused","type"],required:!0,rules:[{required:!0,message:"请选择审批被拒绝时的操作"}],children:w.jsxs(zt.Group,{children:[w.jsx(zt,{value:"end_process",children:"直接结束流程"}),w.jsx(zt,{value:"back_to_initiator",children:"退回到发起人"})]})}),w.jsx(ze.Item,{label:"审批意⻅设置",name:["comment_setting","type"],required:!0,rules:[{required:!0,message:"请选择审批被拒绝时的操作"}],children:w.jsxs(zt.Group,{children:[w.jsx(zt,{value:"everyone",children:"所有人可见"}),w.jsx(zt,{value:"assign_approver",children:"指定人员可见"})]})}),s==="assign_approver"&&w.jsx(w.Fragment,{children:w.jsx(ze.Item,{label:"指定人员",name:["comment_setting","user"],required:!0,rules:[{required:!0,message:"请选择指定人员"}],children:w.jsx(Hm,{})})})]})}function Pz(){const e={labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:24}}};return w.jsx(ze.List,{name:"extended",children:(t,{add:n,remove:r},{errors:o})=>w.jsxs(w.Fragment,{children:[t.map((a,i)=>C.createElement(ze.Item,{...e,required:!1,key:i},w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[w.jsx(ze.Item,{name:[a.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"扩展名"})}),w.jsx(ze.Item,{name:[a.name,"code"],noStyle:!0,children:w.jsx(Kt,{placeholder:"扩展值"})}),w.jsx(om,{onClick:()=>{r(a.name)}})]}))),w.jsxs(ze.Item,{children:[w.jsx(Et,{type:"dashed",onClick:()=>n(),style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加扩展"}),w.jsx(ze.ErrorList,{errors:o})]})]})})}function Tz(){const e={labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:24}}};return w.jsxs("div",{children:[w.jsxs(Ao,{gutter:10,style:{marginBottom:"20px",background:"#fafafa",lineHeight:"40px"},children:[w.jsx(Gt,{span:12,style:{paddingLeft:"10px",fontWeight:"bold"},children:"表单字段"}),w.jsx(Gt,{span:12,style:{fontWeight:"bold"},children:"操作"})]}),w.jsx(ze.List,{name:"formConfig",children:(t,{add:n,remove:r},{errors:o})=>w.jsxs(w.Fragment,{children:[t.map((a,i)=>C.createElement(ze.Item,{...e,required:!1,key:i},w.jsxs(Ao,{gutter:10,children:[w.jsx(Gt,{span:12,children:w.jsx(ze.Item,{name:[a.name,"name"],noStyle:!0,children:w.jsx(Kt,{placeholder:"字段名"})})}),w.jsx(Gt,{span:10,children:w.jsx(ze.Item,{name:[a.name,"operate"],noStyle:!0,children:w.jsxs(zt.Group,{defaultValue:"1",children:[w.jsx(zt,{value:"1",children:"只读"}),w.jsx(zt,{value:"2",children:"编辑"}),w.jsx(zt,{value:"3",children:"隐藏"})]})})}),w.jsx(Gt,{span:2,children:w.jsx(om,{onClick:()=>{r(a.name)}})})]}))),w.jsxs(ze.Item,{children:[w.jsx(Et,{type:"dashed",onClick:()=>n(),style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加字段"}),w.jsx(ze.ErrorList,{errors:o})]})]})})]})}function $S({name:e}){return w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"请求地址",required:!0,name:[...e,"api_request_url"],rules:[{required:!0,message:"请输入请求地址"},{type:"url",message:"请输入正确的URL地址"}],children:w.jsx(Kt,{placeholder:"请输入请求地址"})}),w.jsx(ze.Item,{label:"请求头",tooltip:"请求头格式为JSON字符串",name:[...e,"api_request_headers"],children:w.jsx(Kt.TextArea,{autoSize:{minRows:4,maxRows:6},placeholder:"请输入请求头"})}),w.jsx(ze.Item,{label:"请求体",tooltip:"请求体格式为JSON字符串",name:[...e,"api_request_body"],children:w.jsx(Kt.TextArea,{autoSize:{minRows:4,maxRows:6},placeholder:"请输入请求体"})})]})}function Mz({form:e}){const t=ze.useWatch(["listeners","task_create","open"],e),n=ze.useWatch(["listeners","task_finish","open"],e);return w.jsxs(w.Fragment,{children:[w.jsx(ze.Item,{label:"创建任务",name:["listeners","task_create","open"],children:w.jsx(Bl,{checkedChildren:"开启",unCheckedChildren:"关闭"})}),t&&w.jsx($S,{name:["listeners","task_create"]}),w.jsx(ze.Item,{label:"任务完成",name:["listeners","task_finish","open"],children:w.jsx(Bl,{checkedChildren:"开启",unCheckedChildren:"关闭"})}),n&&w.jsx($S,{name:["listeners","task_finish"]})]})}const _z=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm(),[r,o]=C.useState("assignee");return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(az,{options:[{key:"assignee",label:"审批人"},{key:"actions",label:"操作权限"},{key:"listeners",label:"监听器"}],value:r,onChange:o}),w.jsx("div",{style:{display:r==="assignee"?"block":"none"},children:w.jsx(Nz,{form:n})}),w.jsx("div",{style:{display:r==="actions"?"block":"none"},children:w.jsx(sz,{form:n})}),w.jsx("div",{style:{display:r==="formConfig"?"block":"none"},children:w.jsx(Tz,{})}),w.jsx("div",{style:{display:r==="extended"?"block":"none"},children:w.jsx(Pz,{})}),w.jsx("div",{style:{display:r==="listeners"?"block":"none"},children:w.jsx(Mz,{form:n})})]})}));function Az(){return w.jsxs(Ao,{gutter:10,style:{marginBottom:20,background:"#fafafa",lineHeight:"40px"},children:[w.jsx(Gt,{span:3,style:{paddingLeft:10,fontWeight:"bold"},children:"关系"}),w.jsx(Gt,{span:9,style:{fontWeight:"bold"},children:"字段"}),w.jsx(Gt,{span:6,style:{fontWeight:"bold"},children:"条件"}),w.jsx(Gt,{span:4,style:{fontWeight:"bold"},children:"条件值"}),w.jsx(Gt,{span:2,style:{fontWeight:"bold"},children:"操作"})]})}const jz=[{label:"且",value:"and"},{label:"或",value:"or"}],Lz={and:"&&",or:"||"},ES={eq:"等于",ne:"不等于",gt:"大于",ge:"大于等于",lt:"小于",le:"小于等于",like:"包含",like_start:"开头包含",like_end:"结尾包含",empty:"为空",not_empty:"不为空"},zz={eq:"=",ne:"!=",gt:">",ge:">=",lt:"<",le:"<=",like:"contains",like_start:"startsWith",like_end:"endsWith",empty:"is empty",not_empty:"is not empty"},Fz=["eq","ne"],Dz=["eq","ne","gt","ge","lt","le"],Bz={text:Fz.map(e=>({label:ES[e],value:e})),number:Dz.map(e=>({label:ES[e],value:e}))},Rz={relation:"and",field:"",fieldType:"text",operator:"eq",value:""};function kz(e){const{item:t,fields:n,operatorOptionsByType:r,valueControls:o,onChange:a,onRemove:i}=e,s=C.useMemo(()=>n.map(v=>({label:v.label,value:v.value})),[n]),l=C.useMemo(()=>r[t.fieldType]||[],[r,t.fieldType]),c=t.operator!=="empty"&&t.operator!=="not_empty",d=o[t.fieldType],f=C.useCallback(v=>a({...t,relation:v}),[t,a]),g=C.useCallback(v=>{const m=n.find($=>$.value===v),b=m?m.type:t.fieldType,y=r[b].map($=>$.value),S=y.includes(t.operator)?t.operator:y[0];a({...t,field:v,fieldType:b,operator:S,value:S==="empty"||S==="not_empty"?void 0:b==="number"?0:""})},[n,t,a,r]),p=C.useCallback(v=>{const m=v==="empty"||v==="not_empty"?void 0:t.fieldType==="number"?typeof t.value=="number"?t.value:0:typeof t.value=="string"?t.value:"";a({...t,operator:v,value:m})},[t,a]),h=C.useCallback(v=>a({...t,value:v}),[t,a]);return w.jsxs(Ao,{gutter:10,style:{marginBottom:8},children:[w.jsx(Gt,{span:3,children:w.jsx(Rn,{placeholder:"关系",options:jz,value:t.relation,onChange:f,style:{width:"100%"}})}),w.jsx(Gt,{span:9,children:w.jsx(Rn,{placeholder:"字段",options:s,value:t.field,onChange:g,style:{width:"100%"}})}),w.jsx(Gt,{span:6,children:w.jsx(Rn,{placeholder:"条件",options:l,value:t.operator,onChange:p,style:{width:"100%"}})}),w.jsx(Gt,{span:4,children:c&&d?w.jsx(d,{value:t.value,onChange:h}):null}),w.jsx(Gt,{span:2,style:{display:"flex",alignItems:"center"},children:w.jsx(om,{onClick:i})})]})}function Hz(e){const{value:t,onChange:n,fields:r,defaultCondition:o,operatorOptionsByType:a,valueControls:i}=e,s=C.useCallback(()=>n([...t||[],o]),[n,t,o]),l=C.useCallback(d=>{const f=[...t];f.splice(d,1),n(f)},[n,t]),c=C.useCallback((d,f)=>{const g=[...t];g[d]=f,n(g)},[n,t]);return w.jsxs(w.Fragment,{children:[(t||[]).map((d,f)=>w.jsx(kz,{item:d,fields:r,operatorOptionsByType:a,valueControls:i,onChange:g=>c(f,g),onRemove:()=>l(f)},f)),w.jsx(Et,{type:"dashed",onClick:s,style:{width:"100%"},icon:w.jsx(mo,{}),children:"添加条件"})]})}const Vz={text:({value:e,onChange:t})=>{const n=typeof e=="string"?e:"";return w.jsx(Kt,{value:n,onChange:r=>t(r.target.value),placeholder:"条件值"})},number:({value:e,onChange:t})=>{const n=typeof e=="number"?e:void 0;return w.jsx(Al,{style:{width:"100%"},value:n,onChange:r=>t(typeof r=="number"?r:void 0)})}};function Wz(e){const t=["empty","not_empty"];function n(i,s){return i===0||!s?"":` ${Lz[s]||""} `}function r(i){let s="";return t.includes(i.operator)||!i.value?"":(i.fieldType==="text"?s=`'${i.value}'`:s=i.value.toString(),` ${s}`)}function o(i){if(!i.field||!i.operator)return"";const s=r(i);if(!t.includes(i.operator)&&!s)return"";const l=zz[i.operator]||"";return`${i.field} ${l}${s}`}if(!e)return"";let a="";return e.forEach((i,s)=>{a+=n(s,i.relation),a+=o(i)}),a?`\${${a}}`:""}function qz(e){const[t,n]=C.useState([]),[r,o]=C.useState([]),a="value"in e,i=C.useMemo(()=>a?e.value||[]:t,[a,e.value,t]),s=C.useCallback(d=>{a||n(d),e.onChange&&e.onChange(d)},[a,e]),l=C.useCallback(d=>s(d),[s]),c=C.useCallback(async d=>{var f,g;try{const p=await SL(d);o(((g=(f=p.data)==null?void 0:f.data)==null?void 0:g.bizFormJson)||[])}catch(p){console.error("[海牛工作流SDK}] 获取条件单字段失败",p)}},[]);return C.useEffect(()=>{const d=bL();c(d.key||"")},[c]),w.jsxs("div",{children:[w.jsx(Az,{}),w.jsx(Hz,{value:i,onChange:l,fields:r,defaultCondition:Rz,operatorOptionsByType:Bz,valueControls:Vz})]})}const Uz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(ze.Item,{name:"conditions",noStyle:!0,children:w.jsx(qz,{onChange:r=>n.setFieldValue("condition",Wz(r))})}),w.jsx(ze.Item,{hidden:!0,name:"condition"})]})})),OS={approverType:"orSign",actions:[{code:"addSigner",name:"加签",button:"加签"}]},Gz=C.forwardRef((e,t)=>{const{value:n}=e,[r]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>r.getFieldsValue(),validateFields:()=>(console.log("validate dispatcher panel",r.getFieldsValue()),r.validateFields())}),[r]),C.useEffect(()=>{r.setFieldsValue({...OS,...n})},[n,r]),w.jsxs(ze,{form:r,layout:"vertical",colon:!1,initialValues:{...OS,...n},children:[w.jsx(qm,{form:r}),w.jsx(ze.Item,{label:"多人审批时采用的审批方式",name:"approverType",required:!0,hidden:!0,children:w.jsx(Kt,{})}),w.jsx(ze.Item,{label:"默认操作权限",name:"actions",required:!0,hidden:!0,children:w.jsx(Kt,{})})]})}),Kz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsx(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:w.jsx(qm,{form:n})})})),Xz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm();return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsx(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:w.jsx(ze.Item,{label:"发起人",name:"initiator",children:w.jsx(Kt,{})})})})),Yz=[{value:"scrap_apply",label:"报废申请"},{value:"dept_approve",label:"部门审批"},{value:"tech_eval",label:"技术评估"},{value:"asset_approve",label:"资产管理审批"},{value:"finance_approve",label:"财务审批"}],Jz=C.memo(C.forwardRef((e,t)=>{const[n]=ze.useForm(),r=(o,a)=>{n.setFieldValue("subProcessName",a.label)};return C.useImperativeHandle(t,()=>({getValue:()=>n.getFieldsValue(),validateFields:()=>n.validateFields()}),[n]),w.jsxs(ze,{form:n,layout:"vertical",colon:!1,initialValues:e.value,children:[w.jsx(zl,{label:"子流程",name:"subProcessId",children:w.jsx(Rn,{placeholder:"请选择子流程",options:Yz,onChange:r})}),w.jsx(zl,{hidden:!0,name:"subProcessName",children:w.jsx(Kt,{})})]})}));function Um(e){var n,r,o,a,i;const t=(n=e.config)==null?void 0:n.groupType;return t?t===Vm?!!(((o=(r=e.config)==null?void 0:r.assignee)==null?void 0:o.ids)||""):t===Wm?!!(((i=(a=e.config)==null?void 0:a.role)==null?void 0:i.ids)||""):!0:!1}function Gm(e){var r,o;if(!e)return"";const t=e==null?void 0:e.groupType;let n;if(t){const a=SS.find(i=>i.value===t);if(a)switch(a.value){case Vm:n=((r=e==null?void 0:e.assignee)==null?void 0:r.names)||"";break;case Wm:n=((o=e==null?void 0:e.role)==null?void 0:o.names)||"";break;default:n=a.label;break}}return n}const IS={[it.approver]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择审批人"})},settersPanel:_z,validate:e=>Um(e)?!0:"未选择审批人"},[it.condition]:{viewContent:e=>{var n;const t=((n=e.config)==null?void 0:n.conditions)||[];return w.jsx(Fa,{secondary:!t.length,text:t.length?"已配置":"请配置条件"})},settersPanel:Uz,validate:e=>e.config?!0:`${e.name}未设置条件`},[it.notifier]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择抄送人"})},settersPanel:Kz,validate:e=>Um(e)?!0:"未选择抄送人"},[it.start]:{viewContent:e=>{var t;return w.jsx(Fa,{text:`${(t=e.config)==null?void 0:t.initiator}`})},settersPanel:Xz},[it.subProcess]:{viewContent:e=>{var t;return w.jsx(Fa,{text:`${((t=e.config)==null?void 0:t.subProcessName)||"选择子流程"}`})},validate:e=>{var t;return(t=e.config)!=null&&t.subProcessId?!0:"未选择子流程"},settersPanel:Jz},[it.dispatcher]:{viewContent:e=>{const t=Gm(e.config);return w.jsx(Fa,{secondary:!t,text:t||"选择分发人"})},settersPanel:Gz,validate:e=>(console.log("validate dispatcher",e),Um(e)?!0:"未选择分发人")}},Zz=be.div`
1253
1253
  width: 100%;
1254
1254
  height: 100vh;
1255
1255
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "hn-workflow-components",
3
- "version": "1.1.6",
3
+ "version": "1.1.9",
4
+ "exports": {
5
+ ".": {
6
+ "import": {
7
+ "types": "./dist/index.d.ts",
8
+ "default": "./dist/workflow-components.es.js"
9
+ },
10
+ "require": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/workflow-components.umd.js"
13
+ },
14
+ "default": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/workflow-components.umd.js"
17
+ }
18
+ }
19
+ },
4
20
  "main": "dist/workflow-components.umd.js",
5
21
  "module": "dist/workflow-components.es.js",
6
22
  "types": "dist/index.d.ts",
@@ -16,8 +32,8 @@
16
32
  "pub": "npm config set registry https://registry.npmjs.org/ && npm publish && npm config set registry https://registry.npmmirror.com/"
17
33
  },
18
34
  "peerDependencies": {
19
- "react": ">=17 <19",
20
- "react-dom": ">=17 <19"
35
+ "react": "^17.0.0 || ^18.0.0",
36
+ "react-dom": "^17.0.0 || ^18.0.0"
21
37
  },
22
38
  "dependencies": {
23
39
  "@ant-design/icons": "^5.1.4",