cnhis-design-vue 3.1.47-beta.2 → 3.1.47-beta.20

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.
Files changed (136) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/button-print/src/utils/print.d.ts +10 -8
  8. package/es/components/button-print/src/utils/print.js +1 -1
  9. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.d.ts +4 -0
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -0
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.d.ts +4 -0
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -0
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +1 -1
  20. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +4 -1
  24. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  25. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +12 -0
  26. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  27. package/es/components/fabric-chart/src/interface.d.ts +1 -0
  28. package/es/components/fabric-chart/src/utils/index.d.ts +7 -0
  29. package/es/components/fabric-chart/src/utils/index.js +1 -1
  30. package/es/components/form-config/index.d.ts +9 -9
  31. package/es/components/form-config/src/FormConfig.vue.d.ts +9 -9
  32. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +1 -1
  33. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +4 -4
  34. package/es/components/form-render/index.d.ts +1 -1
  35. package/es/components/form-render/src/FormRender.vue.d.ts +2 -1
  36. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  37. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +1 -1
  38. package/es/components/form-render/src/components/renderer/levelSearchCascader.d.ts +2 -2
  39. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  40. package/es/components/form-render/src/components/renderer/radio&checkbox.d.ts +4 -4
  41. package/es/components/form-render/src/components/renderer/select.d.ts +2 -2
  42. package/es/components/form-render/src/hooks/useFormEvent.d.ts +1 -1
  43. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  44. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -0
  45. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  46. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  47. package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
  48. package/es/components/form-render/src/types/index.d.ts +59 -2
  49. package/es/components/form-render/src/utils/index.js +1 -1
  50. package/es/components/iho-table/src/constants/index.d.ts +1 -0
  51. package/es/components/iho-table/src/constants/index.js +1 -1
  52. package/es/components/iho-table/src/hooks/useColumnConfigAdaptor.js +1 -1
  53. package/es/components/iho-table/src/plugins/index.js +1 -1
  54. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.d.ts +1 -0
  55. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/htmlRendererPlugin.js +1 -0
  56. package/es/components/iho-table/src/utils/index.js +1 -1
  57. package/es/components/iho-table/style/index.css +1 -1
  58. package/es/components/index.css +1 -1
  59. package/es/components/index.d.ts +2 -1
  60. package/es/components/index.js +1 -1
  61. package/es/components/info-header/index.d.ts +2 -2
  62. package/es/components/info-header/src/InfoHeader.vue.d.ts +2 -2
  63. package/es/components/info-header/src/InfoHeader.vue2.js +1 -1
  64. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +1 -1
  65. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +1 -1
  66. package/es/components/info-header/style/index.css +1 -1
  67. package/es/components/multi-chat/index.d.ts +1023 -0
  68. package/es/components/multi-chat/index.js +1 -0
  69. package/es/components/multi-chat/src/MultiChat.vue.d.ts +1005 -0
  70. package/es/components/multi-chat/src/MultiChat.vue.js +1 -0
  71. package/es/components/multi-chat/src/MultiChat.vue2.js +1 -0
  72. package/es/components/multi-chat/src/api/index.d.ts +8 -0
  73. package/es/components/multi-chat/src/api/index.js +1 -0
  74. package/es/components/multi-chat/src/components/ChatFooter.vue.d.ts +17 -0
  75. package/es/components/multi-chat/src/components/ChatFooter.vue.js +1 -0
  76. package/es/components/multi-chat/src/components/ChatFooter.vue2.js +1 -0
  77. package/es/components/multi-chat/src/components/ChatHeader.vue.d.ts +7 -0
  78. package/es/components/multi-chat/src/components/ChatHeader.vue.js +1 -0
  79. package/es/components/multi-chat/src/components/ChatHeader.vue2.js +1 -0
  80. package/es/components/multi-chat/src/components/ChatMain.vue.d.ts +13 -0
  81. package/es/components/multi-chat/src/components/ChatMain.vue.js +1 -0
  82. package/es/components/multi-chat/src/components/ChatMain.vue2.js +1 -0
  83. package/es/components/multi-chat/src/components/SiderList.vue.d.ts +41 -0
  84. package/es/components/multi-chat/src/components/SiderList.vue.js +1 -0
  85. package/es/components/multi-chat/src/components/SiderList.vue2.js +1 -0
  86. package/es/components/multi-chat/src/utils/chatSock.d.ts +28 -0
  87. package/es/components/multi-chat/src/utils/chatSock.js +1 -0
  88. package/es/components/multi-chat/style/index.css +1 -0
  89. package/es/components/scale-view/index.d.ts +28 -0
  90. package/es/components/scale-view/src/ScaleView.vue.d.ts +28 -0
  91. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  92. package/es/components/scale-view/src/components/AnswerParse.vue2.js +1 -1
  93. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  94. package/es/components/scale-view/style/index.css +1 -1
  95. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  96. package/es/components/select-person/index.d.ts +4 -0
  97. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  98. package/es/components/select-person/src/SelectPerson.vue.d.ts +1 -0
  99. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  100. package/es/components/select-person/src/utils/index.d.ts +1 -1
  101. package/es/components/select-person/src/utils/index.js +1 -1
  102. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  103. package/es/components/shortcut-provider/src/types/index.d.ts +1 -1
  104. package/es/components/shortcut-setter/index.d.ts +2 -2
  105. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +2 -2
  106. package/es/components/steps-wheel/index.d.ts +27 -0
  107. package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +27 -0
  108. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  109. package/es/components/steps-wheel/src/constants/index.js +1 -1
  110. package/es/components/steps-wheel/style/index.css +1 -1
  111. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +3 -0
  112. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue2.js +1 -1
  113. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue2.js +1 -1
  114. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +5 -2
  115. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  116. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -2
  117. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +5 -2
  118. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  119. package/es/env.d.ts +25 -25
  120. package/es/shared/assets/img/failure.png.js +1 -1
  121. package/es/shared/assets/img/no-permission.png.js +1 -1
  122. package/es/shared/assets/img/nodata.png.js +1 -1
  123. package/es/shared/assets/img/notfound.png.js +1 -1
  124. package/es/shared/assets/img/qr.png.js +1 -1
  125. package/es/shared/assets/img/success.png.js +1 -1
  126. package/es/shared/assets/img/video.png.js +1 -1
  127. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  128. package/es/shared/assets/img/xb_big.png.js +1 -1
  129. package/es/shared/assets/img/xb_small.png.js +1 -1
  130. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  131. package/es/shared/package.json.js +1 -1
  132. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  133. package/es/shared/utils/tapable/index.d.ts +139 -0
  134. package/es/shared/utils/tapableLess.d.ts +28 -0
  135. package/es/shared/utils/tapableLess.js +1 -0
  136. package/package.json +4 -2
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as w}from"../../constants/index.js";function j(j,L,k,Y,S,E,$,M,P,O){r(j,L);const{getEqualXTypes:T,handleAddPrevent:A}=y(j,k),{createShadowLines:I}=t(),{left:C,xScaleList:R,xCellWidth:X,yCellHeight:z,originX:D,endX:V,originY:F,endY:_,itemList:G,event:H,vitalSignsOriginY:q,painOriginY:W,hospitalizationDate:B,config:J,canvasHeight:K}=L,N=new Set,Q=["xinmai","mai"],U=new Map,Z=new Set,ee=new Set,te=new Set,ie=m(C.yScaleValue);function ne(t){var i;const o=ie.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(N.size&&j.value.remove(...N),N.clear(),U.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=U.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of U)t.push(e[1]),e[0]===Q[0]&&e[1].forEach((e=>{(U.get(Q[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var i,l,s,r,a,u;const c=t.map((e=>({x:e[0],y:e[1]}))),p=new e.Polygon(c,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){p.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=I(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),N.add(e)})),j.value.add(...e)}N.add(p),j.value.add(p)}))}}function oe(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,C.overlap||{}),l=[];Z.size&&[...Z].forEach((e=>{[...ee].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),te.add(e)}))}))}function le(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:w=[]}=r,Y=[],E=[],M=[];null==(u=e.list)||u.forEach(((u,O)=>{const T=a(c)?w.find((e=>e.key===u.key)):e,A=ae(u,r),I={};I.value=function(e,t,i){if(!(null==e?void 0:e.length)||!J.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return M.push(s),{obj:s,top:-z}}(A,u,T),function(e,t,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=a,{value:x}=u;let b,w,j,L,k,Y;if(t.noRise&&h.show)if(h.text)j=l([e[0],e[1]+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),M.push(j);else{const t=e[1]+2*z;L=s([e[0],e[1],t],h.style||{}),M.push(L)}t.rise&&f.show&&f.text&&(k=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),M.push(k));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),M.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=S(c,r.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===K?"bottom":"center"}),b&&M.push(b),w&&M.push(w)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5},arrowGroup:{obj:L,top:2*z},riseText:{obj:k,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(A,u,T,I),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),M.push(o)}if(p){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),M.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),M.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(A,u,T,I),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],S=ae(w,r),M=se(c,e.list[s].value),O=S&&se(c,w.value);!n||!S||l.breakpoint||M||O||n[0]===S[0]||(f=i([...n,...S],{...v}));const T=l.pacemakerShow&&"pulse"==c?y.value:M?0:x,A=E[s-1],I={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:A,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...L.event.hovered?L.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:L.event,...M?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");p=o(T,{left:A.get("x2"),top:M?e-5:e,...I})}else n&&(I.leftLine=null,p=o(T,{left:n[0],top:M?n[1]-5:n[1],...I}));E.push(f),p&&(g.includes("脉搏")?Z.add(p):ee.add(p),function(e){H.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?W:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):null==i||i.setCoords().set({left:e.left,top:e.top+o}))})),ne(e)}(e),H.hovered&&re(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=$(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),k("change",n),ce(n,"change")}}))}(p),Y.push(p),te.add(p))}(A,u,O,T,I)})),"pulse"===c&&Q.forEach((e=>{U.set(e,Y.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(Y).then((e=>{const t=E.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(M).then((i=>{j.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function re(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||E(e.left)).slice(-5)}`],P.show=!0}function ae(e,t){const i="pain"===t.type?W:q;if(f(e)&&function(e){const[t]=R,i=R.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=Y(e.time),o=S(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ue(e){const t=new Date,i=`00${t.getMonth()+1}`.slice(-2),n=`00${t.getDate()}`.slice(-2),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${E(e)}:00`);return B&&l<h(B)?(A("exceedMin"),!1):!(l>o)||(A("exceedMax"),!1)}function ce(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ie.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;pe()}function pe(){var e;te.size&&(null==(e=j.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...te]))),U.clear(),te.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe()}return U.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=S(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe(),L.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=F&&n<=_){O.point={x:i,y:n},O.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(O.list=[...x]),"pain"===o&&(O.list=[...b]),O.target=e.target;else{O.target=null,O.list=["新增节点"],G.forEach((t=>{if(!T(i,"_type",X).includes(t.bigType)){const i=["pain"].includes(t.bigType)?W:q;n>=i.originY&&n<=i.endY&&O.list.push({renderItem:M?M(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ue(i);t&&1!==O.list.length||(O.show=!1,1===O.list.length&&t&&A("repeat"))}}}})),{pointTipProps:P,pointMenuProps:O,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};k("change",r),ce(r,"change")}else{const t={data:{time:E(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};k("add",t),ce(t)}},setPopup:re,isAddPoint:ue,updateData:ce,redrawPoints:pe}}export{j as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as p,isValidValue as d,setOtherType as c,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as w}from"../../constants/index.js";function j(j,k,Y,S,E,$,M,P,O,T){r(j,k);const{getEqualXTypes:A,handleAddPrevent:I}=y(j,Y,k),{createShadowLines:C}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:q,vitalSignsOriginY:W,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ie=new Set,ne=m(R.yScaleValue);function oe(t){var i;const o=ne.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(Q.size&&j.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Z.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],p=n[i-1],d=n[i+1],c=o[r-1],f=o[r+1];if(p&&c){if(p[0]!==c[0]){const e=Math.max(p[0],c[0]);l.push([p,c].find((t=>t[0]===e)))}}else p?l.push(p):c&&s.push(c);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var i,l,s,r,a,u;const p=t.map((e=>({x:e[0],y:e[1]}))),d=new e.Polygon(p,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){d.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=C(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),Q.add(e)})),j.value.add(...e)}Q.add(d),j.value.add(d)}))}}function le(){var e;const t=ne.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(e,t,r){var u;const{type:p,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:w=[]}=r,S=[],$=[],P=[];null==(u=e.list)||u.forEach(((u,T)=>{const A=a(p)?w.find((e=>e.key===u.key)):e,I=ue(u,r),C={};C.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=W.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return P.push(s),{obj:s,top:-z}}(I,u,A),function(e,t,r,a,u){var c,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(p))return;const{lineAttr:m={}}=r,{value:x}=a;let b,w,j,k,Y,S;if(t.noRise&&h.show){const t=L(h)?E(u.type,u.list,35):e[1];if(h.text)j=l([e[0],L(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),P.push(j);else{const i=t+2*z;k=s([e[0],t,i],h.style||{}),P.push(k)}}t.rise&&f.show&&f.text&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),P.push(Y));t.verified&&(S=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),P.push(S));if(d(t.physicsReduce)||d(t.drugReduce)){const l=E(p,u.list,null!=(c=t.physicsReduce)?c:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===N?"bottom":"center"}),b&&P.push(b),w&&P.push(w)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5,isFixed:L(h)},arrowGroup:{obj:k,top:2*z,isFixed:L(h)},riseText:{obj:Y,top:(x?-z:0)-5},verifiedText:{obj:S,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(I,u,A,C,r),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(p))return;let o,a;const{upArrowShow:u=!1,limitValueShow:d=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<W.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),P.push(o)}if(d){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],i),P.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),P.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(I,u,A,C),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],L=ue(w,r),E=re(p,e.list[s].value),P=L&&re(p,w.value);!n||!L||l.breakpoint||E||P||n[0]===L[0]||(f=i([...n,...L],{...v}));const T=l.pacemakerShow&&"pulse"==p?y.value:E?0:x,A=$[s-1],I={origin:{data:l,title:g,key:m||"",unit:r.unit,type:p,_type:c(g,p),dataIndex:t,index:s},leftLine:A,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==p?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...E?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");d=o(T,{left:A.get("x2"),top:E?e-5:e,...I})}else n&&(I.leftLine=null,d=o(T,{left:n[0],top:E?n[1]-5:n[1],...I}));$.push(f),d&&(g.includes("脉搏")?ee.add(d):te.add(d),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{O.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:W;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==i||i.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),q.hovered&&ae(e)})),e.on("mouseup",(t=>{if(O.show=!1,1===t.button){const{type:t}=e.origin,i=M(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(d),S.push(d),ie.add(d))}(I,u,T,A,C)})),"pulse"===p&&U.forEach((e=>{Z.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(P).then((i=>{j.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function re(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;O.point={x:e.left,y:e.top},O.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:M(o,e.top);if(d(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(d(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],O.show=!0}function ue(e,t){const i="pain"===t.type?B:W;if(f(e)&&function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=S(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ne.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;ie.size&&(null==(e=j.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ie]))),Z.clear(),ie.clear(),ee.clear(),te.clear(),ne.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ne.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=_&&n<=G){T.point={x:i,y:n},T.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...x]),"pain"===o&&(T.list=[...b]),T.target=e.target;else{T.target=null,T.list=["新增节点"],H.forEach((t=>{if(!A(i,"_type",F).includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:W;n>=i.originY&&n<=i.endY&&T.list.push({renderItem:P?P(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=pe(i);t&&1!==T.list.length||(T.show=!1,1===T.list.length&&t&&I("repeat"))}}}})),{pointTipProps:O,pointMenuProps:T,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),de(r,"change")}else{const t={data:{time:$(e.pointer.x),value:M(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ae,isAddPoint:pe,updateData:de,redrawPoints:ce}}function L(e){return"fixed"===e.position}export{j as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as g}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function p(p,c,d,f,y,m,v,w,S,b,Y){var x,j;const{getEqualXTypes:C,handleAddPrevent:T}=g(p,d),{originY:X,endY:k,originX:N,endX:V,xCellWidth:M,yCellHeight:L,left:W,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:R,canvasWidth:_,canvasHeight:B,getRightInfo:J,borderStyle:$}=c;function q(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let g=G,c=N;"right"===s&&(g=V,c=V+(null!=(r=null==R?void 0:R.width)?r:0));const d=[],f=A&&"right"!==s?o.length-1:o.length,y=(c-g)/f,m=y+(c-g)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:g,showMaxMinNumber:c,style:d,title:f}=n,y=l({width:N-G,height:A,...$},{value:`${f}`,...i,...d||{}},{left:G,top:I.originY}),m=e([G,I.originY,N,I.originY],$),v=[];if(s||h){const{lineXMain:e,textLeft:i}=a(g,G,N-G),l=o.length;o.forEach(((o,a)=>{let g=I.endY-a*L*r;if(0===a&&(g=k-5),!h||(0===a||a===l-1)&&!c||v.push(u(o,n,i,g)),s&&0!==a){const[i,n]=e,o=new t.Line([i,g,n,g],{...$,...d});v.push(o)}}))}p.value.add(m,y,...v),y.sendToBack()}(o);const c=[],f=0===r?m:y,v=0===r?g:m+g+(r-1)*y,w="right"===s?0:E.originY,S="right"===s?B:E.endY,b=r>0?e([v,w,v,S],{objectCaching:!1,...$}):null;b&&c.push(b);const Y=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:T,position:X,showMaxMinNumber:V}=o;if(C||T){const{lineXMain:t,lineXSub:e,textLeft:i}=a(X,v,f),n=x.length;x.forEach(((l,r)=>{const s=E.endY-r*L*j;if(T&&(!(0===r||r===n-1)||V)){const t=0==r?s-5:s,e=u(l,o,i,t),n=E.originY+e.height/2;t<n&&e.set({top:n}),c.push(e)}c.push(...h(o,r,t,e,s,L,E.originY))}))}let M=o.title||"";o.unit&&(M+="\n"+o.unit),M&&c.push(new t.Text(String(M),{...i,left:Y,top:E.originY+L*j/2,textAlign:"center",...o.style}));const W=new t.Group(c,{...n,objectCaching:!1});d.push(W)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&p.value.add(v),v&&v.sendToBack()}function z(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=k}G&&function(){const e=JSON.parse(JSON.stringify(H));let i=k;const l=G-W.icons.marginRight;e.reverse().forEach((e=>{i-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...n,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:i,lineHeight:1,fontSize:12}),h=o(e.type,{left:l,top:i-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:r(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:i-(u.height||30)/2-1,...c.event});var g;i-=u.height||30,(g=h).on("moving",(()=>{g.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(g),z(g)?f(g):y.show=!1})),g.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&z(g)){const t=C(g.left,"_type",M).includes(g.origin._type),e=b(g.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:w(g.left),value:S(g.origin.type,g.top),...s(g.origin.type)?{key:g.origin.key}:{}},...g.origin};d("add",t),Y(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(g)})),p.value.add(u,h)}))}();const D=W.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==R?void 0:R.width)&&"left"===(null==(x=null==R?void 0:R.yScaleValue)?void 0:x.layout)&&(null==(j=null==R?void 0:R.yScaleValue)?void 0:j.show)&&D.push(J),O>0&&W.yScaleValue[O].show){const t=W.yScaleValue[O];0===O&&W.yScaleValue.length>1&&D.unshift(t),O==W.yScaleValue.length-1&&D.push(t)}const P=D.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=D[P];return P>-1&&D.splice(P,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),q(D),p.value.add(new t.Rect({left:G,top:0,width:_-G-$.strokeWidth,height:B-$.strokeWidth,fill:"transparent",...$})),{drawScaleValue:q}}export{p as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,d,f,m,y,v,w,S,Y,b){var x,j;const{getEqualXTypes:X,handleAddPrevent:C,isGridLimit:N}=c(g,d,p),{originY:T,endY:V,originX:k,endX:L,xCellWidth:M,yCellHeight:W,left:E,vitalSignsOriginY:G,painOriginY:O,painHeight:A,iconsWidth:H,itemList:I,painIndex:R,right:_,canvasWidth:B,canvasHeight:J,getRightInfo:$,borderStyle:q}=p;function D(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,p=k;"right"===r&&(c=L,p=L+(null!=(s=null==_?void 0:_.width)?s:0));const d=[],f=A&&"right"!==r?o.length-1:o.length,m=(p-c)/f,y=m+(p-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:p,style:d,title:f}=n,m=l({width:k-H,height:A,...q},{value:`${f}`,...i,...d||{}},{left:H,top:O.originY}),y=e([H,O.originY,k,O.originY],q),v=[];if(r||h){const{lineXMain:e,textLeft:i}=a(c,H,k-H),l=o.length;o.forEach(((o,a)=>{let c=O.endY-a*W*s;if(0===a&&(c=V-5),!h||(0===a||a===l-1)&&!p||v.push(u(o,n,i,c)),r&&0!==a){const[i,n]=e,o=new t.Line([i,c,n,c],{...q,...d});v.push(o)}}))}g.value.add(y,m,...v),m.sendToBack()}(o);const p=[],f=0===s?y:m,v=0===s?c:y+c+(s-1)*m,w="right"===r?0:G.originY,S="right"===r?J:G.endY,Y=s>0?e([v,w,v,S],{objectCaching:!1,...q}):null;Y&&p.push(Y);const b=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:X,showNumber:C,position:N,showMaxMinNumber:T}=o;if(X||C){const{lineXMain:t,lineXSub:e,textLeft:i}=a(N,v,f),n=x.length;x.forEach(((l,s)=>{const r=G.endY-s*W*j;if(C&&(!(0===s||s===n-1)||T)){const t=0==s?r-5:r,e=u(l,o,i,t),n=G.originY+e.height/2;t<n&&e.set({top:n}),p.push(e)}p.push(...h(o,s,t,e,r,W,G.originY))}))}let L=o.title||"";o.unit&&(L+="\n"+o.unit),L&&p.push(new t.Text(String(L),{...i,left:b,top:G.originY+W*j/2,textAlign:"center",...o.style}));const M=new t.Group(p,{...n,objectCaching:!1});d.push(M)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&g.value.add(v),v&&v.sendToBack()}H&&function(){const t=JSON.parse(JSON.stringify(I));let e=V;const i=H-E.icons.marginRight;t.reverse().forEach((t=>{e-=10;let n=t.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:a}=o(n,t,{text:{left:i-(t.pointAttr.width||10)-5,top:e,originX:"right"},icon:{originX:"right",left:i,topY:e,origin:{type:s(t.bigType),_type:t.bigType},...p.event}});var u;e-=l.height||30,(u=a).on("moving",(()=>{u.set("originX","center"),function(t){if(t.left>=k&&t.left<=L){t.setCoords();const e="pain"===t.origin.type?O:G;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(u),N(u)?f(u):m.show=!1})),u.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&N(u)){const t=X(u.left,"_type",M).includes(u.origin._type),e=Y(u.left);if(!e||t)t&&e&&C("repeat");else{const t={data:{time:w(u.left),value:S(u.origin.type,u.top),...r(u.origin.type)?{key:u.origin.key}:{}},...u.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(u)})),g.value.add(l,a)}))}();const P=E.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==_?void 0:_.width)&&"left"===(null==(x=null==_?void 0:_.yScaleValue)?void 0:x.layout)&&(null==(j=null==_?void 0:_.yScaleValue)?void 0:j.show)&&P.push($),R>0&&E.yScaleValue[R].show){const t=E.yScaleValue[R];0===R&&E.yScaleValue.length>1&&P.unshift(t),R==E.yScaleValue.length-1&&P.push(t)}const z=P.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=P[z];return z>-1&&P.splice(z,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),D(P),g.value.add(new t.Rect({left:H,top:0,width:B-H-q.strokeWidth,height:J-q.strokeWidth,fill:"transparent",...q})),{drawScaleValue:D}}export{g as useLeft};
@@ -1,6 +1,9 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function): {
3
+ import { IObject } from '../interface';
4
+ import { AnyObject } from '../../../../../es/shared/types';
5
+ export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function, propItems: AnyObject): {
4
6
  getEqualXTypes: (pointX: number, field: string, range?: number) => string[];
5
7
  handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
8
+ isGridLimit: (point: IObject) => boolean;
6
9
  };
@@ -1 +1 @@
1
- const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t){return{getEqualXTypes:function(e,t,r=6){const i=[],o=r/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&i.push(n.origin[t])})),[...new Set(i)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})}}}export{n as useCommon};
1
+ const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t,i){return{getEqualXTypes:function(e,t,i=6){const r=[],o=i/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&r.push(n.origin[t])})),[...new Set(r)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})},isGridLimit:function(e){const{left:n,top:t}=e,{originX:r,endX:o,originY:c,endY:u}=i;return n>=r&&n<=o&&t>=c&&t<=u}}}export{n as useCommon};
@@ -1,5 +1,6 @@
1
1
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
2
2
  import { ILineOptions, ITextOptions } from '../interface';
3
+ import { AnyObject } from '../../../../../es/shared/types';
3
4
  export declare const defaultStyle: {
4
5
  evented: boolean;
5
6
  selectable: boolean;
@@ -9,6 +10,7 @@ export declare const defaultBorderStyle: {
9
10
  selectable: boolean;
10
11
  stroke: string;
11
12
  strokeWidth: number;
13
+ strokeUniform: boolean;
12
14
  };
13
15
  export declare const defaultLineStyle: {
14
16
  evented: boolean;
@@ -16,6 +18,7 @@ export declare const defaultLineStyle: {
16
18
  stroke: string;
17
19
  strokeWidth: number;
18
20
  strokeDashArray: number[];
21
+ strokeUniform: boolean;
19
22
  };
20
23
  export declare const defaultRectStyle: {
21
24
  evented: boolean;
@@ -26,6 +29,7 @@ export declare const defaultRectStyle: {
26
29
  originX: string;
27
30
  originY: string;
28
31
  objectCaching: boolean;
32
+ strokeUniform: boolean;
29
33
  };
30
34
  export declare const defaultTextStyle: {
31
35
  evented: boolean;
@@ -38,9 +42,17 @@ export declare const defaultTextStyle: {
38
42
  originY: string;
39
43
  lineHeight: number;
40
44
  objectCaching: boolean;
45
+ strokeUniform: boolean;
41
46
  };
42
47
  export declare function drawLine(points: number[], style: Partial<ILineOptions>): fabric.Line;
43
48
  export declare function drawText([x, y]: [x: number, y: number], style: ITextOptions): fabric.Text;
44
49
  export declare function drawArrow([x, y1, y2]: [x: number, y1: number, y2: number], style: ITextOptions | any, type?: string): fabric.Group;
45
50
  export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>, showRect?: boolean): fabric.Group;
46
51
  export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
52
+ export declare function drawTextAndIconGroup(title: string, item: AnyObject, option: {
53
+ text: AnyObject;
54
+ icon: AnyObject;
55
+ }, direction?: string): {
56
+ text: fabric.Text;
57
+ icon: fabric.Object;
58
+ };
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],...t},i={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,...t};function c(t,r){return new e.Line(t,{...n,...r})}function s([t,r],n){return new e.Text(String(n.value),{...o,left:t,top:r,...n})}function l([r,n,i],o,l="down"){const a=c([r,n,r,i],{strokeWidth:1,stroke:o.fill}),u=s([r+.5,"up"===l?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===l?180:0,...o});return new e.Group([a,u],{...t,originX:"center",originY:"top"})}function a(r,n,c,s=!1){const l=new e.Rect({...i,...r,...s?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:u="center",verticalAlign:g="center"}=n,h=r.width/2,d=r.height/2,f=new e.Text(String(a),{...o,...n,..."left"==u||"right"==u?{originX:u,left:"left"==u?-h:h}:{},..."top"==g||"bottom"==g?{originY:g,top:"top"==g?-d:d}:{}});return new e.Group([l,f],{objectCaching:!1,...t,...c})}function u(t="circle",r){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},i=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(r.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([i,o])};return new e.Group([i(),t()],{scale:1,...n})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([i(),o],{scale:1,...n})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}export{r as defaultBorderStyle,n as defaultLineStyle,i as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,l as drawArrow,c as drawLine,u as drawPoint,s as drawText,a as drawTextGroup};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},i={stroke:"#000",strokeWidth:1,strokeUniform:!0,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],strokeUniform:!0,...t},r={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,strokeUniform:!0,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,strokeUniform:!0,...t};function c(t,i){return new e.Line(t,{...n,...i})}function l([t,i],n){return new e.Text(String(n.value),{...o,left:t,top:i,...n})}function s([i,n,r],o,s="down"){const a=c([i,n,i,r],{strokeWidth:1,stroke:o.fill}),g=l([i+.5,"up"===s?r-3:r+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===s?180:0,objectCaching:!1,...o});return new e.Group([a,g],{...t,originX:"center",originY:"top",objectCaching:!1})}function a(i,n,c,l=!1){const s=new e.Rect({...r,...i,...l?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:g="center",verticalAlign:u="center"}=n,h=i.width/2,f=i.height/2,d=new e.Text(String(a),{...o,...n,..."left"==g||"right"==g?{originX:g,left:"left"==g?-h:h}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-f:f}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function g(t="circle",i){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...i},r=()=>new e.Circle({objectCaching:!1,strokeWidth:i.strokeWidth||1,stroke:i.stroke||"red",radius:i.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(i.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((i.radius||5)+(i.strokeWidth||1)),n={stroke:i.strokeX||"blue",strokeWidth:i.strokeWidthX||1,originX:"center",originY:"center"},r=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([r,o])};return new e.Group([r(),t()],{scale:1,...n})}case"koumai":{const t=(i.radius||5)+(i.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:i.radiusCircle||2,fill:i.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([r(),o],{scale:1,...n})}default:return i&&Reflect.deleteProperty(i,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}function u(i,n,r,o="horizontal"){const c=new e.Text(String(i),{...t,objectCaching:!1,...n.titleStyle||{},originX:"left",originY:"bottom",lineHeight:1,fontSize:12,...r.text}),{top:l,topY:s,left:a,leftX:u}=r.icon,h=null!=l?l:"horizontal"===o?s-(c.height||30)/2-1:s+c.height+3,f=null!=a?a:u+c.width+5;return{text:c,icon:g(n.type,{...n.pointAttr,originY:"center",originX:"left",originLeft:f,originTop:h,...r.icon,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,isMenu:!0,...r.icon.origin},left:f,top:h})}}export{i as defaultBorderStyle,n as defaultLineStyle,r as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,s as drawArrow,c as drawLine,g as drawPoint,l as drawText,u as drawTextAndIconGroup,a as drawTextGroup};
@@ -13,6 +13,7 @@ export declare type ITreeItem = Partial<{
13
13
  data: Array<{
14
14
  time: string[];
15
15
  value: AnyObject;
16
+ [key: string]: any;
16
17
  }>;
17
18
  children: ITreeItem[];
18
19
  top: number;
@@ -16,3 +16,10 @@ export declare function isOverlapPoint(pointObj1: any, pointObj2: any): boolean;
16
16
  export declare function getFloorNumber(value: number, n?: number): number;
17
17
  export declare function getChildrenSize(treeData: ITreeItem[]): number;
18
18
  export declare function getTime(value: number | string): number;
19
+ /**
20
+ * @description: 获取y轴刻度数值列表
21
+ * @param {[number, number]} range
22
+ * @param {number} spaceValue
23
+ * @return {number[]}
24
+ */
25
+ export declare function getScaleNumberList(range: [number, number], spaceValue: number): number[];
@@ -1 +1 @@
1
- import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>d(t.time)>d(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function d(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,d as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
1
+ import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>d(t.time)>d(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return s(n.left,1)===s(t.left,1)&&Math.abs(s(n.top,1)-s(t.top,1))<=2}function s(n,t=100){return Math.floor(n*t)/t}function a(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=a(n.children):t++})),t}function d(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function p(n,t){const e=[],[r,u]=n;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}export{r as deleteProperty,a as getChildrenSize,s as getFloorNumber,u as getIndex,p as getScaleNumberList,d as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
@@ -141,7 +141,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
141
141
  level_key?: string | undefined;
142
142
  link_key?: string | undefined;
143
143
  link_key_split?: string | undefined;
144
- show_key?: string[] | undefined;
144
+ show_key?: string | string[] | undefined;
145
145
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
146
146
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
147
147
  setting?: {
@@ -1861,7 +1861,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
1861
1861
  level_key?: string | undefined;
1862
1862
  link_key?: string | undefined;
1863
1863
  link_key_split?: string | undefined;
1864
- show_key?: string[] | undefined;
1864
+ show_key?: string | string[] | undefined;
1865
1865
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
1866
1866
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
1867
1867
  setting?: {
@@ -3590,7 +3590,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
3590
3590
  level_key?: string | undefined;
3591
3591
  link_key?: string | undefined;
3592
3592
  link_key_split?: string | undefined;
3593
- show_key?: string[] | undefined;
3593
+ show_key?: string | string[] | undefined;
3594
3594
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
3595
3595
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
3596
3596
  setting?: {
@@ -5310,7 +5310,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
5310
5310
  level_key?: string | undefined;
5311
5311
  link_key?: string | undefined;
5312
5312
  link_key_split?: string | undefined;
5313
- show_key?: string[] | undefined;
5313
+ show_key?: string | string[] | undefined;
5314
5314
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
5315
5315
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
5316
5316
  setting?: {
@@ -7483,7 +7483,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7483
7483
  validate(path?: string): Promise<void>;
7484
7484
  getFormValues(needCombineExtendKey?: boolean): any;
7485
7485
  setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
7486
- setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
7486
+ setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
7487
7487
  match: (pattern: import("@formily/path").Pattern) => boolean;
7488
7488
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
7489
7489
  data: any;
@@ -8006,7 +8006,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8006
8006
  level_key?: string | undefined;
8007
8007
  link_key?: string | undefined;
8008
8008
  link_key_split?: string | undefined;
8009
- show_key?: string[] | undefined;
8009
+ show_key?: string | string[] | undefined;
8010
8010
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
8011
8011
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
8012
8012
  setting?: {
@@ -9737,7 +9737,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
9737
9737
  level_key?: string | undefined;
9738
9738
  link_key?: string | undefined;
9739
9739
  link_key_split?: string | undefined;
9740
- show_key?: string[] | undefined;
9740
+ show_key?: string | string[] | undefined;
9741
9741
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
9742
9742
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
9743
9743
  setting?: {
@@ -11441,7 +11441,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
11441
11441
  level_key?: string | undefined;
11442
11442
  link_key?: string | undefined;
11443
11443
  link_key_split?: string | undefined;
11444
- show_key?: string[] | undefined;
11444
+ show_key?: string | string[] | undefined;
11445
11445
  conObj?: import("../../../es/shared/types").AnyObject[] | undefined;
11446
11446
  conObjFirstLevel?: import("../../../es/shared/types").AnyObject[] | undefined;
11447
11447
  setting?: {
@@ -13532,7 +13532,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
13532
13532
  validate(path?: string): Promise<void>;
13533
13533
  getFormValues(needCombineExtendKey?: boolean): any;
13534
13534
  setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
13535
- setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
13535
+ setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
13536
13536
  match: (pattern: import("@formily/path").Pattern) => boolean;
13537
13537
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
13538
13538
  data: any;
@@ -143,7 +143,7 @@ declare const _default: import("vue").DefineComponent<{
143
143
  level_key?: string | undefined;
144
144
  link_key?: string | undefined;
145
145
  link_key_split?: string | undefined;
146
- show_key?: string[] | undefined;
146
+ show_key?: string | string[] | undefined;
147
147
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
148
148
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
149
149
  setting?: {
@@ -1863,7 +1863,7 @@ declare const _default: import("vue").DefineComponent<{
1863
1863
  level_key?: string | undefined;
1864
1864
  link_key?: string | undefined;
1865
1865
  link_key_split?: string | undefined;
1866
- show_key?: string[] | undefined;
1866
+ show_key?: string | string[] | undefined;
1867
1867
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
1868
1868
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
1869
1869
  setting?: {
@@ -3592,7 +3592,7 @@ declare const _default: import("vue").DefineComponent<{
3592
3592
  level_key?: string | undefined;
3593
3593
  link_key?: string | undefined;
3594
3594
  link_key_split?: string | undefined;
3595
- show_key?: string[] | undefined;
3595
+ show_key?: string | string[] | undefined;
3596
3596
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
3597
3597
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
3598
3598
  setting?: {
@@ -5312,7 +5312,7 @@ declare const _default: import("vue").DefineComponent<{
5312
5312
  level_key?: string | undefined;
5313
5313
  link_key?: string | undefined;
5314
5314
  link_key_split?: string | undefined;
5315
- show_key?: string[] | undefined;
5315
+ show_key?: string | string[] | undefined;
5316
5316
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
5317
5317
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
5318
5318
  setting?: {
@@ -7485,7 +7485,7 @@ declare const _default: import("vue").DefineComponent<{
7485
7485
  validate(path?: string): Promise<void>;
7486
7486
  getFormValues(needCombineExtendKey?: boolean): any;
7487
7487
  setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
7488
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
7488
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
7489
7489
  match: (pattern: import("@formily/path").Pattern) => boolean;
7490
7490
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
7491
7491
  data: any;
@@ -8008,7 +8008,7 @@ declare const _default: import("vue").DefineComponent<{
8008
8008
  level_key?: string | undefined;
8009
8009
  link_key?: string | undefined;
8010
8010
  link_key_split?: string | undefined;
8011
- show_key?: string[] | undefined;
8011
+ show_key?: string | string[] | undefined;
8012
8012
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
8013
8013
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
8014
8014
  setting?: {
@@ -9739,7 +9739,7 @@ declare const _default: import("vue").DefineComponent<{
9739
9739
  level_key?: string | undefined;
9740
9740
  link_key?: string | undefined;
9741
9741
  link_key_split?: string | undefined;
9742
- show_key?: string[] | undefined;
9742
+ show_key?: string | string[] | undefined;
9743
9743
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
9744
9744
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
9745
9745
  setting?: {
@@ -11443,7 +11443,7 @@ declare const _default: import("vue").DefineComponent<{
11443
11443
  level_key?: string | undefined;
11444
11444
  link_key?: string | undefined;
11445
11445
  link_key_split?: string | undefined;
11446
- show_key?: string[] | undefined;
11446
+ show_key?: string | string[] | undefined;
11447
11447
  conObj?: import("../../../../es/shared/types").AnyObject[] | undefined;
11448
11448
  conObjFirstLevel?: import("../../../../es/shared/types").AnyObject[] | undefined;
11449
11449
  setting?: {
@@ -13534,7 +13534,7 @@ declare const _default: import("vue").DefineComponent<{
13534
13534
  validate(path?: string): Promise<void>;
13535
13535
  getFormValues(needCombineExtendKey?: boolean): any;
13536
13536
  setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
13537
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
13537
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
13538
13538
  match: (pattern: import("@formily/path").Pattern) => boolean;
13539
13539
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
13540
13540
  data: any;
@@ -470,7 +470,7 @@ declare const _default: import("vue").DefineComponent<{}, {
470
470
  validate(path?: string): Promise<void>;
471
471
  getFormValues(needCombineExtendKey?: boolean): any;
472
472
  setFormValues(values: import("../../..").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
473
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
473
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
474
474
  match: (pattern: import("@formily/path").Pattern) => boolean;
475
475
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
476
476
  data: any;
@@ -96,7 +96,7 @@ declare const _default: import("vue").DefineComponent<{
96
96
  level_key?: string | undefined;
97
97
  link_key?: string | undefined;
98
98
  link_key_split?: string | undefined;
99
- show_key?: string[] | undefined;
99
+ show_key?: string | string[] | undefined;
100
100
  conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
101
101
  conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
102
102
  setting?: {
@@ -1827,7 +1827,7 @@ declare const _default: import("vue").DefineComponent<{
1827
1827
  level_key?: string | undefined;
1828
1828
  link_key?: string | undefined;
1829
1829
  link_key_split?: string | undefined;
1830
- show_key?: string[] | undefined;
1830
+ show_key?: string | string[] | undefined;
1831
1831
  conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
1832
1832
  conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
1833
1833
  setting?: {
@@ -3531,7 +3531,7 @@ declare const _default: import("vue").DefineComponent<{
3531
3531
  level_key?: string | undefined;
3532
3532
  link_key?: string | undefined;
3533
3533
  link_key_split?: string | undefined;
3534
- show_key?: string[] | undefined;
3534
+ show_key?: string | string[] | undefined;
3535
3535
  conObj?: import("../../../../../es/shared/types").AnyObject[] | undefined;
3536
3536
  conObjFirstLevel?: import("../../../../../es/shared/types").AnyObject[] | undefined;
3537
3537
  setting?: {
@@ -5622,7 +5622,7 @@ declare const _default: import("vue").DefineComponent<{
5622
5622
  validate(path?: string): Promise<void>;
5623
5623
  getFormValues(needCombineExtendKey?: boolean): any;
5624
5624
  setFormValues(values: import("../../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
5625
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
5625
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../../es/components/form-render").NonFunctionPropertyNames<{
5626
5626
  match: (pattern: import("@formily/path").Pattern) => boolean;
5627
5627
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
5628
5628
  data: any;
@@ -457,7 +457,7 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{}, {
457
457
  validate(path?: string): Promise<void>;
458
458
  getFormValues(needCombineExtendKey?: boolean): any;
459
459
  setFormValues(values: import("../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
460
- setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core/esm/models/Field").Field<any, any, any, any>, import("@formily/core/esm/types").NonFunctionPropertyNames<{
460
+ setFieldState(path: string, setter: (field: Partial<Pick<import("@formily/core/esm/models/Field").Field<any, any, any, any>, import("@formily/core/esm/types").NonFunctionPropertyNames<{
461
461
  match: (pattern: import("@formily/path").Pattern) => boolean;
462
462
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
463
463
  data: any;
@@ -1,4 +1,5 @@
1
1
  import { AnyObject, FormOperationalConfig } from '../../../../es/shared/types';
2
+ import { Field } from '@formily/core';
2
3
  import { Component, FunctionalComponent, PropType } from 'vue';
3
4
  import { RequestInstance } from './hooks';
4
5
  import { FieldItem, FieldVisitor, FormBusinessFormatter, FormLowCodeReactions } from './types';
@@ -451,7 +452,7 @@ declare const _default: import("vue").DefineComponent<{
451
452
  validate(path?: string): Promise<void>;
452
453
  getFormValues(needCombineExtendKey?: boolean): any;
453
454
  setFormValues(values: AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
454
- setFieldState(path: string, handler: (field: Partial<Pick<import("@formily/core").Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
455
+ setFieldState(path: string, setter: (field: Partial<Pick<Field<any, any, any, any>, import("@formily/core").NonFunctionPropertyNames<{
455
456
  match: (pattern: import("@formily/path").Pattern) => boolean;
456
457
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
457
458
  data: any;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as H,cloneDeep as S}from"lodash-es";import{createForm as x,onFieldValueChange as A,onFieldMount as L,onFieldUnmount as O,onFieldReact as R,onFormMount as w}from"@formily/core";import{FormProvider as B,FormConsumer as _}from"@formily/vue";import{NForm as V,NTabs as D,NTabPane as I,NConfigProvider as N}from"naive-ui";import{InjectionFormLifeCycleCaller as q,InjectionFormGraph as W}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as E,useFormExposeEvent as G}from"./hooks/useFormEvent.js";import{useFormGraph as K}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as M}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as P}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as J}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as $}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as z}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Q}from"./hooks/useWordbookSetting.js";import"./utils/index.js";import{useFieldListAdaptor as X}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as Y}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as Z}from"./hooks/useFormValidator.js";import{useAnchor as ee}from"./hooks/useAnchor.js";import{useFormContext as oe}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as te}from"./utils/schema.js";const re={key:0,style:{height:"54px"}},se={style:{"white-space":"pre"}};var ae=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:ae,emit:ie}){const le=e,ne=C(),{nuiThemeOverrides:me}=$();Z();const de=o(),pe=t((()=>H(le.maxHeight)?le.maxHeight+"px":le.maxHeight)),{SchemaField:ue,businessCollector:ce,formItemDepsCollector:fe,changeContextCollector:he,formUUID:ye}=oe(le,ie),{anchorBarRef:ge,currentAnchor:je,updateAnchorList:be,anchorIdList:ke,onScroll:ve}=ee(le,ie,de,fe),{callLifeCycle:Fe}=M(le);r(q,Fe),Fe("onSetup");const{trigger:Ce}=T(),{observeFormGraph:He,setGraph:Se,removeGraph:xe}=K();r(W,He);const{lowCodeEventTrigger:Ae}=P(),Le=x({initialValues:le.initialData,effects(e){A("*",(o=>{const t=o.props.name.toString();ce.trigger(e,t),fe.trigger(t),ie("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:he.getContext(t,o.value)}),Ae(o),Oe(t,o.value),we(t),_e(t,o.value)})),L("*",Se),O("*",xe),le.linebarAutoHidden&&(R("*",Ce),w((e=>e.query("*").forEach(Ce)))),le.anchor&&R("*",be)}}),{lowCodeReactionsHandler:Oe,triggerAllReactionsHandler:Re}=J(t((()=>le.lowCodeReactions)),Le),{operationalFormHandler:we,triggerAllOperationalFormHandler:Be}=z(t((()=>le.operationalForm)),Le),{wordbookSettingHandler:_e}=Q(Le,he);s(Re),s(Be);const{schemaAdaptor:Ve}=X(ce);let De=le.fieldList||[];const Ie=t((()=>le.schema?le.schema:le.fieldList?(De=Y().traverse(S(le.fieldList),le.fieldVisitor),te(Ve(De))):te({}))),{onKeydown:Ne}=E({formModel:Le,formRenderRef:de,props:le}),{clearSpan:qe}=U();a((()=>qe(ye)));const We=G({formModel:Le,formRenderRef:de,formItemDepsCollector:fe,getFieldList:()=>De,formUUID:ye});return ae({formModel:Le,validate:(e="*")=>We.validate(e),getFormValues:(e=!0)=>We.getFormValues(e),async setFormValues(e,o=!0,t=!1,r=!0){t&&(ce.triggerLock=!0),We.setFormValues(e,o,r),await i(),ce.triggerLock=!1},setFieldState(e,o){We.setFieldState(e,o)},resetFields(e="*"){We.resetFields(e)},queryWidget:async e=>We.queryWidget(e),getFieldList:()=>De,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(V),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(ne))},{default:u((()=>[e.anchor?(l(),c("section",re,[f(m(D),{value:m(je),"onUpdate:value":t[0]||(t[0]=e=>h(je)?je.value=e:null),type:"line",ref_key:"anchorBarRef",ref:ge},{default:u((()=>[(l(!0),c(y,null,g(m(ke),(e=>(l(),n(m(I),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(N),{"theme-overrides":m(me)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(pe)}),ref_key:"formRenderRef",ref:de,onScroll:t[1]||(t[1]=(...e)=>m(ve)&&m(ve)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(Ne)&&m(Ne)(...e)),["enter"]))},[f(m(B),{form:m(Le)},{default:u((()=>[f(m(ue),{schema:m(Ie)},null,8,["schema"]),e.consumer?(l(),n(m(_),{key:0},{default:u((({form:e})=>[b("div",se,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{ae as default};
1
+ import{defineComponent as e,ref as o,computed as t,provide as r,onMounted as s,onUnmounted as a,nextTick as i,openBlock as l,createBlock as n,unref as m,normalizeClass as d,normalizeStyle as p,withCtx as u,createElementBlock as c,createVNode as f,isRef as h,Fragment as y,renderList as g,createCommentVNode as j,createElementVNode as b,withKeys as k,toDisplayString as v,renderSlot as F}from"vue";import{useTheme as C}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isNumber as S,cloneDeep as H,isObject as x,isBoolean as A}from"lodash-es";import{createForm as L,onFieldValueChange as O,onFieldMount as R,onFieldUnmount as w,onFieldReact as B,onFormMount as _}from"@formily/core";import{FormProvider as D,FormConsumer as V}from"@formily/vue";import{NForm as I,NTabs as N,NTabPane as q,NConfigProvider as W}from"naive-ui";import{InjectionFormLifeCycleCaller as E,InjectionFormGraph as K}from"./constants/index.js";import{useAutoHidden as T}from"./hooks/useAutoHidden.js";import{useComplexOptionsSpan as U}from"./hooks/useComplexOptions.js";import{useFormDomEvent as G,useFormExposeEvent as M}from"./hooks/useFormEvent.js";import{useFormGraph as P}from"./hooks/useFormGraph.js";import{useFormRenderLifeCycle as J}from"./hooks/useFormRenderLifeCycle.js";import{useLowCodeEvent as $}from"./hooks/useLowCodeEvent.js";import{useLowCodeReactions as z}from"./hooks/useLowCodeReactions.js";import{useNuiThemeOverrides as Q}from"./hooks/useNuiThemeOverrides.js";import{useOperationalForm as X}from"./hooks/useOperationalForm.js";import{useWordbookSetting as Y}from"./hooks/useWordbookSetting.js";import"./utils/index.js";import{useFieldListAdaptor as Z}from"./hooks/useFieldListAdaptor.js";import"../../../shared/utils/index.js";import"../index.js";import{useFieldVisitor as ee}from"./hooks/useFieldVisitor.js";import"../../../shared/utils/tapable/SyncHook.js";import"../../../shared/utils/tapable/SyncBailHook.js";import"../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../shared/utils/tapable/SyncLoopHook.js";import"../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{validateMessageLocale as oe}from"./hooks/useFormValidator.js";import{useAnchor as te}from"./hooks/useAnchor.js";import{useFormContext as re}from"./hooks/useFormContext.js";import"./hooks/useFormRenderOptions.js";import{createObjSchema as se}from"./utils/schema.js";const ae={key:0,style:{height:"54px"}},ie={style:{"white-space":"pre"}};var le=e({__name:"FormRender",props:{fieldList:{type:Array},initialData:{type:Object,default:()=>({})},fieldVisitor:{type:Object},column:{type:Number,default:24},maxHeight:{type:[Number,String],default:""},anchor:{type:Boolean,default:!1},parallelism:{type:Number,default:3},businessFormatter:{type:Function},schema:{type:Object},components:{type:Object,default:()=>({})},scope:{type:Object,default:()=>({})},annotation:{type:Object},consumer:{type:Boolean,default:!1},uuid:{type:String},lifeCycle:{type:Object},requestInstance:{type:Object},enterToNextWidget:{type:[Boolean,Function],default:!0},lowCodeReactions:{type:Array},operationalForm:{type:Object},linebarAutoHidden:{type:Boolean},bordered:{type:[Boolean,String],default:!0},uniqueCacheData:{type:Boolean,default:!1}},emits:["formChange","annotationChange","scroll"],setup(e,{expose:le,emit:ne}){const me=e,de=C(),{nuiThemeOverrides:pe}=Q();oe();const ue=o(),ce=t((()=>S(me.maxHeight)?me.maxHeight+"px":me.maxHeight)),{SchemaField:fe,businessCollector:he,formItemDepsCollector:ye,changeContextCollector:ge,formUUID:je}=re(me,ne),{anchorBarRef:be,currentAnchor:ke,updateAnchorList:ve,anchorIdList:Fe,onScroll:Ce}=te(me,ne,ue,ye),{callLifeCycle:Se}=J(me);r(E,Se),Se("onSetup");const{trigger:He}=T(),{observeFormGraph:xe,setGraph:Ae,removeGraph:Le}=P();r(K,xe);const{lowCodeEventTrigger:Oe}=$(),Re=L({initialValues:me.initialData,effects(e){O("*",(o=>{const t=o.props.name.toString();he.trigger(e,t),ye.trigger(t),ne("formChange",{fieldInstance:o,fieldKey:t,fieldName:o.title,value:o.value,context:ge.getContext(t,o.value)}),Oe(o),we(t,o.value),_e(t),Ve(t,o.value)})),R("*",Ae),w("*",Le),me.linebarAutoHidden&&(B("*",He),_((e=>e.query("*").forEach(He)))),me.anchor&&B("*",ve)}}),{lowCodeReactionsHandler:we,triggerAllReactionsHandler:Be}=z(t((()=>me.lowCodeReactions)),Re),{operationalFormHandler:_e,triggerAllOperationalFormHandler:De}=X(t((()=>me.operationalForm)),Re),{wordbookSettingHandler:Ve}=Y(Re,ge);s(Be),s(De);const{schemaAdaptor:Ie}=Z(he);let Ne=me.fieldList||[];const qe=t((()=>me.schema?me.schema:me.fieldList?(Ne=ee().traverse(H(me.fieldList),me.fieldVisitor),se(Ie(Ne))):se({}))),{onKeydown:We}=G({formModel:Re,formRenderRef:ue,props:me}),{clearSpan:Ee}=U();a((()=>Ee(je)));const Ke=M({formModel:Re,formRenderRef:ue,formItemDepsCollector:ye,getFieldList:()=>Ne,formUUID:je});return le({formModel:Re,validate:(e="*")=>Ke.validate(e),getFormValues:(e=!0)=>Ke.getFormValues(e),async setFormValues(e,o={},t=!1,r=!0){var s,a,l,n;let m=!0,d=!0;x(o)?(d=null==(s=o.needSplitExtendKey)||s,m=null==(a=o.avoidDependKeyConnection)||a,t=null!=(l=o.avoidBusinessConnection)&&l,r=null==(n=o.overwrite)||n):A(o)&&(d=o),t&&(he.triggerLock=!0),m&&(ye.triggerDisabled=!0),Ke.setFormValues(e,d,r),await i(),he.triggerLock=!1,ye.triggerDisabled=!1},setFieldState(e,o){Ke.setFieldState(e,o)},resetFields(e="*"){Ke.resetFields(e)},queryWidget:async e=>Ke.queryWidget(e),getFieldList:()=>Ne,async reload(){console.error("reload function is abstract,it should be overwrite!")}}),(o,t)=>(l(),n(m(I),{class:d(["form-render",{"form-render--no-border":!e.bordered,"form-render--underline":"underline"===e.bordered}]),"require-mark-placement":"left",style:p(m(de))},{default:u((()=>[e.anchor?(l(),c("section",ae,[f(m(N),{value:m(ke),"onUpdate:value":t[0]||(t[0]=e=>h(ke)?ke.value=e:null),type:"line",ref_key:"anchorBarRef",ref:be},{default:u((()=>[(l(!0),c(y,null,g(m(Fe),(e=>(l(),n(m(q),{name:e.name,tab:e.title,key:e.name},null,8,["name","tab"])))),128))])),_:1},8,["value"])])):j("v-if",!0),f(m(W),{"theme-overrides":m(pe)},{default:u((()=>[b("section",{class:"form-render__wrapper",style:p({"--column":e.column,"--form-height":m(ce)}),ref_key:"formRenderRef",ref:ue,onScroll:t[1]||(t[1]=(...e)=>m(Ce)&&m(Ce)(...e)),onKeydownCapture:t[2]||(t[2]=k(((...e)=>m(We)&&m(We)(...e)),["enter"]))},[f(m(D),{form:m(Re)},{default:u((()=>[f(m(fe),{schema:m(qe)},null,8,["schema"]),e.consumer?(l(),n(m(V),{key:0},{default:u((({form:e})=>[b("div",ie,v(JSON.stringify(e.values,null,2)),1)])),_:1})):j("v-if",!0),F(o.$slots,"default")])),_:3},8,["form"])],36)])),_:3},8,["theme-overrides"])])),_:3},8,["class","style"]))}});export{le as default};
@@ -455,7 +455,7 @@ declare const _default: import("vue").DefineComponent<{}, {
455
455
  validate(path?: string): Promise<void>;
456
456
  getFormValues(needCombineExtendKey?: boolean): any;
457
457
  setFormValues(values: import("../../../../es/shared/types").AnyObject, needSplitExtendKey?: boolean, overwrite?: boolean): void;
458
- setFieldState(path: string, handler: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
458
+ setFieldState(path: string, setter: (field: Partial<Pick<import("../../../../es/components/form-render").Field<any, any, any, any>, import("../../../../es/components/form-render").NonFunctionPropertyNames<{
459
459
  match: (pattern: import("@formily/path").Pattern) => boolean;
460
460
  validate: (triggerType?: import("@formily/validator").ValidatorTriggerType | undefined) => any;
461
461
  data: any;
@@ -40,7 +40,7 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
40
40
  level_key: string;
41
41
  link_key: string;
42
42
  link_key_split: string;
43
- show_key: string[];
43
+ show_key: string | string[];
44
44
  conObj: AnyObject[];
45
45
  conObjFirstLevel: AnyObject[];
46
46
  setting: Partial<{
@@ -95,7 +95,7 @@ export declare const LEVEL_SEARCH_CASCADER: import("vue").DefineComponent<{
95
95
  level_key: string;
96
96
  link_key: string;
97
97
  link_key_split: string;
98
- show_key: string[];
98
+ show_key: string | string[];
99
99
  conObj: AnyObject[];
100
100
  conObjFirstLevel: AnyObject[];
101
101
  setting: Partial<{
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as t,inject as a,watch as o,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isArray as i,isString as s,isNumber as c,isEmpty as d,isFunction as v,omit as p,cloneDeep as f}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as m}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as h}from"../../utils/index.js";import{connect as k,mapProps as j}from"@formily/vue";import g from"../../../../search-cascader/index.js";import w from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as F}from"../../hooks/useFormRequest.js";const K=k(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:k}){const j=u(e,"value",k),_=r(!1),K=r([]),{field:O,fieldKey:q}=b(),S=t((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),C=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),L=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),V=a(m),{getSearchRequestInfo:A}=F(),I=r(150),P=r();async function R(r,t){var a,o,n;if(I.value=t&&(null==(a=P.value)?void 0:a.getWidth())||150,i(e.value)&&e.value.length&&!r&&!t){const[r,t]=function(e){if(!e.length)return[];const r=[(e=f(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value);K.value=t;const a=r[Math.max(0,r.length-2)];return await R(a),a}try{if(r&&!r.__keyword&&r.isLeaf)return u(r);if(null==r?void 0:r.__keyword){if(!s(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));c(L.value)&&L.value!==1/0&&t.splice(L.value);const a=await async function(r){if(!A().primaryKeyUrl)return[];try{return await V.addAsync(t(e.wordbook,e.autograph,r,q.value))}catch(e){s(e)&&h(e)}function t(r,t,a,o){const n=A();return{key:o,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!a)return Promise.reject();const{lastOption:o,options:u}=function(e,r){let t=e[0];return{options:r.reduce(((r,o,n)=>{const u=a(e,o);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=L.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[C.value]===r))}}(a,t);return u.length<L.value&&(await R(o),d(o.children))?(j.value=function(e,r){return r.map((r=>e.find((e=>e[C.value]===r))))}(a,t),_.value=!1,Promise.reject()):(K.value=u,null==(n=P.value)||n.setCursor(o),o)}{const a=await V.addAsync(function(r,a,o,n,u){const l={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[C.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(l).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:v(a)?a():void 0,e)),{});return{...A(),params:i,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,O.value,r,q.value));if(r){if(!a.length)return u(r);r.children=a.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:l(r)+1>=t}}(e,r,L.value)))}else K.value=a.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[S.value]=e[x.value||S.value]||e[S.value]);return e}(e,t))),t&&(null==(o=P.value)||o.setCursor(K.value[0]))}}catch(e){s(e)&&h(e)}function u(e){return j.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function l(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){I.value=150}o((()=>e.wordbook),((r,t)=>{l(r,t)||(K.value=[],r&&(j.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:B,injectValueWatchFromEmpty:N,injectValueBindKey:W}=y();N(j,R),B(j);const z=W(j);return()=>n(g,{ref:P,value:j.value,"onUpdate:value":e=>j.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:K.value,key:z.value,labelKey:S.value,valueKey:C.value,search:R,onFocus:U,menuWidth:I.value},{empty:()=>n(w,null,null)})}}),j({dataSource:"options"},_));export{K as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as r,computed as t,inject as a,watch as o,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isArray as i,isString as s,isNumber as c,isEmpty as v,isFunction as d,omit as p,cloneDeep as f}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as m}from"../../constants/index.js";import{useCommonInjection as y}from"../../hooks/useCommonInjection.js";import{formRenderLog as h}from"../../utils/index.js";import{connect as k,mapProps as j}from"@formily/vue";import g from"../../../../search-cascader/index.js";import w from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as F}from"../../hooks/useFormRequest.js";const K=k(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:k}){const j=u(e,"value",k),_=r(!1),K=r([]),{field:O,fieldKey:q}=b(),S=t((()=>{var r,t,a;return null!=(a=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?a:e.labelField})),C=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),L=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),V=a(m),{getSearchRequestInfo:A}=F(),I=r(150),P=r();async function R(r,t){var a,o,n;if(I.value=t&&(null==(a=P.value)?void 0:a.getWidth())||150,i(e.value)&&e.value.length&&e.value.every((e=>e[C.value]))&&!r&&!t){const[r,t]=function(e){if(!e.length)return[];const r=[(e=f(e))[0]];let t=e[0];for(let r=1;r<e.length;r++){const a=e[r];a&&(t.children=[a],a.parent=t,t=a)}return[e,r]}(e.value);K.value=t;const a=r[Math.max(0,r.length-2)];return await R(a),a}try{if(r&&!r.__keyword&&r.isLeaf)return u(r);if(null==r?void 0:r.__keyword){if(!s(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));c(L.value)&&L.value!==1/0&&t.splice(L.value);const a=await async function(r){if(!A().primaryKeyUrl)return[];try{return await V.addAsync(t(e.wordbook,e.autograph,r,q.value))}catch(e){s(e)&&h(e)}function t(r,t,a,o){const n=A();return{key:o,params:{autograph:t,tableId:r.id,primaryKeyValue:a.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!a)return Promise.reject();const{lastOption:o,options:u}=function(e,r){let t=e[0];return{options:r.reduce(((r,o,n)=>{const u=a(e,o);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=L.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function a(e,r){return e.find((e=>e[C.value]===r))}}(a,t);return u.length<L.value&&(await R(o),v(o.children))?(j.value=function(e,r){return r.map((r=>e.find((e=>e[C.value]===r))))}(a,t),_.value=!1,Promise.reject()):(K.value=u,null==(n=P.value)||n.setCursor(o),o)}{const a=await V.addAsync(function(r,a,o,n,u){const l={autograph:()=>a,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[C.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},i=Object.entries(l).reduce(((e,[t,a])=>(e[t]=s(a)?r[a]:d(a)?a():void 0,e)),{});return{...A(),params:i,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,O.value,r,q.value));if(r){if(!a.length)return u(r);r.children=a.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:l(r)+1>=t}}(e,r,L.value)))}else K.value=a.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[S.value]=e[x.value||S.value]||e[S.value]);return e}(e,t))),t&&(null==(o=P.value)||o.setCursor(K.value[0]))}}catch(e){s(e)&&h(e)}function u(e){return j.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function l(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}function U(){I.value=150}o((()=>e.wordbook),((r,t)=>{l(r,t)||(K.value=[],r&&(j.value||!e.lazyRequest)&&R())}),{immediate:!0});const{injectValueValidate:B,injectValueWatchFromEmpty:N,injectValueBindKey:W}=y();N(j,R),B(j);const z=W(j);return()=>n(g,{ref:P,value:j.value,"onUpdate:value":e=>j.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:K.value,key:z.value,labelKey:S.value,valueKey:C.value,search:R,onFocus:U,menuWidth:I.value},{empty:()=>n(w,null,null)})}}),j({dataSource:"options"},_));export{K as LEVEL_SEARCH_CASCADER};
@@ -41,7 +41,7 @@ export declare const RADIO: import("vue").DefineComponent<{
41
41
  level_key: string;
42
42
  link_key: string;
43
43
  link_key_split: string;
44
- show_key: string[];
44
+ show_key: string | string[];
45
45
  conObj: AnyObject[];
46
46
  conObjFirstLevel: AnyObject[];
47
47
  setting: Partial<{
@@ -103,7 +103,7 @@ export declare const RADIO: import("vue").DefineComponent<{
103
103
  level_key: string;
104
104
  link_key: string;
105
105
  link_key_split: string;
106
- show_key: string[];
106
+ show_key: string | string[];
107
107
  conObj: AnyObject[];
108
108
  conObjFirstLevel: AnyObject[];
109
109
  setting: Partial<{
@@ -177,7 +177,7 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
177
177
  level_key: string;
178
178
  link_key: string;
179
179
  link_key_split: string;
180
- show_key: string[];
180
+ show_key: string | string[];
181
181
  conObj: AnyObject[];
182
182
  conObjFirstLevel: AnyObject[];
183
183
  setting: Partial<{
@@ -239,7 +239,7 @@ export declare const CHECKBOX: import("vue").DefineComponent<{
239
239
  level_key: string;
240
240
  link_key: string;
241
241
  link_key_split: string;
242
- show_key: string[];
242
+ show_key: string | string[];
243
243
  conObj: AnyObject[];
244
244
  conObjFirstLevel: AnyObject[];
245
245
  setting: Partial<{