cnhis-design-vue 3.1.57-release.1 → 3.1.57-release.3

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 (174) hide show
  1. package/es/components/button-print/index.d.ts +8 -8
  2. package/es/components/button-print/src/ButtonPrint.vue.d.ts +8 -8
  3. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  4. package/es/components/button-print/src/components/EditFormat.vue.d.ts +3 -3
  5. package/es/components/button-print/src/components/IdentityVerification.vue.d.ts +7 -7
  6. package/es/components/button-print/style/index.css +1 -1
  7. package/es/components/calendar/index.d.ts +276 -0
  8. package/es/components/calendar/index.js +1 -0
  9. package/es/components/calendar/src/Calendar.vue.d.ts +265 -0
  10. package/es/components/calendar/src/Calendar.vue.js +1 -0
  11. package/es/components/calendar/src/Calendar.vue2.js +1 -0
  12. package/es/components/calendar/src/types/index.d.ts +6 -0
  13. package/es/components/calendar/src/types/index.js +1 -0
  14. package/es/components/calendar/style/index.css +1 -0
  15. package/es/components/callback/src/components/render/popupMaps.d.ts +233 -224
  16. package/es/components/classification/index.d.ts +3 -3
  17. package/es/components/classification/src/components/search-filter/index.vue.d.ts +3 -3
  18. package/es/components/classification/src/components/set-classification/index.vue.d.ts +3 -3
  19. package/es/components/classification/src/index.vue.d.ts +3 -3
  20. package/es/components/date-picker/index.d.ts +1 -1
  21. package/es/components/date-picker/src/DatePicker.vue.d.ts +1 -1
  22. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  23. package/es/components/expand-field/index.d.ts +98 -26
  24. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +95 -23
  25. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +95 -23
  26. package/es/components/expand-field/src/components/form.vue.d.ts +98 -26
  27. package/es/components/expand-field/src/index.vue.d.ts +98 -26
  28. package/es/components/fabric-chart/index.d.ts +4 -2
  29. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  30. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  31. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +1 -1
  36. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  38. package/es/components/fabric-chart/src/interface.d.ts +4 -3
  39. package/es/components/field-set/index.d.ts +107 -616
  40. package/es/components/field-set/index.js +1 -1
  41. package/es/components/field-set/src/FieldColor.vue.d.ts +1680 -0
  42. package/es/components/field-set/src/FieldColor.vue.js +1 -0
  43. package/es/components/field-set/src/FieldColor.vue2.js +1 -0
  44. package/es/components/field-set/src/FieldSet.vue.d.ts +58 -16
  45. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  46. package/es/components/field-set/src/Index.vue.d.ts +141 -0
  47. package/es/components/field-set/src/Index.vue.js +1 -0
  48. package/es/components/field-set/src/Index.vue2.js +1 -0
  49. package/es/components/field-set/src/components/Row.vue.d.ts +50 -9
  50. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  51. package/es/components/field-set/src/components/condition.vue.d.ts +172 -0
  52. package/es/components/field-set/src/components/condition.vue.js +1 -0
  53. package/es/components/field-set/src/components/condition.vue2.js +1 -0
  54. package/es/components/field-set/src/components/edit-dialog.vue.d.ts +1194 -0
  55. package/es/components/field-set/src/components/edit-dialog.vue.js +1 -0
  56. package/es/components/field-set/src/components/edit-dialog.vue2.js +1 -0
  57. package/es/components/field-set/src/components/edit-filter.vue.d.ts +286 -0
  58. package/es/components/field-set/src/components/edit-filter.vue.js +1 -0
  59. package/es/components/field-set/src/components/edit-filter.vue2.js +1 -0
  60. package/es/components/field-set/src/constants/index.d.ts +55 -0
  61. package/es/components/field-set/src/constants/index.js +1 -0
  62. package/es/components/field-set/src/types/index.d.ts +31 -1
  63. package/es/components/field-set/src/utils/index.d.ts +2 -1
  64. package/es/components/field-set/src/utils/index.js +1 -1
  65. package/es/components/field-set/style/index.css +1 -1
  66. package/es/components/form-config/index.d.ts +79 -42
  67. package/es/components/form-config/src/FormConfig.vue.d.ts +79 -42
  68. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  69. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +17 -8
  70. package/es/components/form-config/src/components/FormConfigDragDisplay.vue.d.ts +5 -2
  71. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
  72. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +23 -11
  73. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +8 -8
  74. package/es/components/form-config/src/components/renderer/ComplexNode.vue.d.ts +5 -2
  75. package/es/components/form-config/src/components/renderer/ComplexNode.vue2.js +1 -1
  76. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  77. package/es/components/form-config/src/constants/index.d.ts +3 -2
  78. package/es/components/form-config/src/constants/index.js +1 -1
  79. package/es/components/form-config/src/hooks/useSortalbeConfig.d.ts +16 -12
  80. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  81. package/es/components/form-config/src/types/index.d.ts +14 -2
  82. package/es/components/form-render/index.d.ts +17 -8
  83. package/es/components/form-render/index.js +1 -1
  84. package/es/components/form-render/src/FormRender.vue.d.ts +17 -8
  85. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  86. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +17 -8
  87. package/es/components/form-render/src/components/renderer/combination/combination.d.ts +12 -0
  88. package/es/components/form-render/src/components/renderer/combination/combination.js +1 -1
  89. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.d.ts +1 -1
  90. package/es/components/form-render/src/components/renderer/combination/hooks/useCombination.js +1 -1
  91. package/es/components/form-render/src/components/renderer/combination/jsonCombination.d.ts +12 -0
  92. package/es/components/form-render/src/components/renderer/combination/jsonCombination.js +1 -1
  93. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  94. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  95. package/es/components/form-render/src/hooks/index.js +1 -1
  96. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  97. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +2 -2
  98. package/es/components/form-render/src/hooks/useLowCodeReactions.d.ts +1 -1
  99. package/es/components/form-render/src/hooks/useNewLowCodeReactions.d.ts +6 -0
  100. package/es/components/form-render/src/hooks/useNewLowCodeReactions.js +1 -0
  101. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  102. package/es/components/form-render/src/types/index.d.ts +1 -1
  103. package/es/components/guide/src/renderer.d.ts +2 -2
  104. package/es/components/iho-table/index.d.ts +216 -216
  105. package/es/components/iho-table/src/IhoTable.vue.d.ts +216 -216
  106. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +1 -1
  107. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +3 -1
  108. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  109. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +1 -1
  110. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  111. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +1 -1
  112. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  113. package/es/components/iho-table/src/types/index.d.ts +1 -0
  114. package/es/components/index.css +1 -1
  115. package/es/components/index.d.ts +2 -1
  116. package/es/components/index.js +1 -1
  117. package/es/components/info-header/index.d.ts +41 -23
  118. package/es/components/info-header/src/InfoHeader.vue.d.ts +41 -23
  119. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -1
  120. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -1
  121. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +18 -9
  122. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +17 -8
  123. package/es/components/keyboard/index.d.ts +1 -1
  124. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  125. package/es/components/quick-search/index.d.ts +3 -3
  126. package/es/components/quick-search/src/index.vue.d.ts +3 -3
  127. package/es/components/recommend-search/index.d.ts +6 -6
  128. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +6 -6
  129. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  130. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  131. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
  132. package/es/components/scale-view/index.d.ts +3 -3
  133. package/es/components/scale-view/src/ScaleView.vue.d.ts +3 -3
  134. package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
  135. package/es/components/scale-view/src/hooks/use-component.d.ts +1 -1
  136. package/es/components/select-label/index.d.ts +2 -2
  137. package/es/components/select-label/src/LabelFormContent.vue.d.ts +1 -1
  138. package/es/components/select-label/src/SelectLabel.vue.d.ts +1 -1
  139. package/es/components/select-label/src/index.vue.d.ts +1 -1
  140. package/es/components/select-person/index.d.ts +95 -23
  141. package/es/components/select-person/src/SelectPerson.vue.d.ts +84 -17
  142. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  143. package/es/components/select-person/src/types/enums.d.ts +9 -0
  144. package/es/components/select-person/src/types/enums.js +1 -1
  145. package/es/components/select-person/style/index.css +1 -1
  146. package/es/components/shortcut-provider/src/hooks/useShortcuts.js +1 -1
  147. package/es/components/shortcut-setter/index.d.ts +18 -8
  148. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -8
  149. package/es/components/table-export-field/index.d.ts +3 -3
  150. package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +3 -3
  151. package/es/components/table-export-field/src/index.vue.d.ts +3 -3
  152. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +1 -1
  153. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +1 -1
  154. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +1 -1
  155. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +1 -1
  156. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +2 -2
  157. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +1 -1
  158. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +1 -1
  159. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +2 -2
  160. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +2 -2
  161. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +1 -1
  162. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +1 -1
  163. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +1 -1
  164. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +1 -1
  165. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +4 -4
  166. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +4 -4
  167. package/es/components/time-line/index.d.ts +7 -7
  168. package/es/components/time-line/src/TimeLine.vue.d.ts +3 -3
  169. package/es/shared/package.json.js +1 -1
  170. package/es/shared/types/business.d.ts +23 -3
  171. package/es/shared/utils/business.d.ts +2 -1
  172. package/es/shared/utils/business.js +1 -1
  173. package/es/shared/utils/index.js +1 -1
  174. package/package.json +8 -2
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,d({propItems:n(S)},M),null,16,["propItems"]),h(n(g),d({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
1
+ import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as d,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent","click:grid","eventClick"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,d({propItems:n(S)},M),null,16,["propItems"]),h(n(g),d({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):m("v-if",!0)],4))}});export{j as default};
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as l,withDirectives as a,createVNode as o,vShow as r}from"vue";import{NSpace as n,NInputNumber as u}from"naive-ui";import s from"./useStyle.js";import{useEventListener as i,onClickOutside as p}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const v=t(null);i(v,"contextmenu",(e=>(e.preventDefault(),!1))),p(v,(e=>{m("update:show",!1)}));const{left:d}=e.propItems,h=s(e);function y(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function g(t){var l;if("string"==typeof t)return t;if("boolean"==typeof t.value)return t.label;if(t.renderItem)return t.renderItem();const a=+((null==(l=d.yScaleValue.find((t=>t.type===e.target.origin.type)))?void 0:l.list[0])||0);return o(n,{inline:!0,align:"center"},{default:()=>[o("span",null,[t.label]),o(u,{style:"width: 110px",size:"small",value:t.value,"onUpdate:value":e=>t.value=e,clearable:!0,placeholder:"请输入数值",max:e.target.origin.data.value,min:a,showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>a(o("ul",{ref:v,class:"c-fabric-chart-popup-menu",style:h.value},[e.list.map((t=>e.show?o("li",{class:{"no-click":y(t)},onClick:l=>function(t,l){y(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[g(t)]):null))]),[[r,e.show]])}});export{c as default};
1
+ import{defineComponent as e,ref as t,watch as l,withDirectives as o,createVNode as a,vShow as s}from"vue";import{NSpace as r,NInputNumber as u}from"naive-ui";import n from"./useStyle.js";import{useEventListener as p,onClickOutside as i}from"@vueuse/core";var c=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:c,slots:f,emit:m}){const h=t(null);p(h,"contextmenu",(e=>(e.preventDefault(),!1))),i(h,(e=>{m("update:show",!1)})),e.propItems;const v=n(e);function d(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function y(e){return"string"==typeof e?e:"boolean"==typeof e.value?e.label:e.renderItem?e.renderItem():a(r,{inline:!0,align:"center"},{default:()=>[a("span",null,[e.label]),a(u,{style:"width: 110px",size:"small",value:e.value,"onUpdate:value":t=>e.value=t,clearable:!0,placeholder:"请输入数值",showButton:!1,onFocus:()=>m("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>o(a("ul",{ref:h,class:"c-fabric-chart-popup-menu",style:v.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":d(t)},onClick:l=>function(t,l){d(l)||""===(null==t?void 0:t.target.className)&&(m("update:show",!1),m("clickMenu",{item:l,target:e.target}))}(l,t)},[y(t)]):null))]),[[s,e.show]])}});export{c as default};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:c,computedY:m}=s(d),{borderStyle:f,originX:h,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:x,rowNumber:S,lineStyle:b,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,offsetY:s,rowIdx:l}=r.origin,f=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const n=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+f||o===a.MAXLINENUMBER-1?[{x:c(e.length+1),y:m(-+r)+s}]:[];return e.concat(n)}),[]),g=new e.Polyline(h,{...b,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(g,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),g.startIdx=t,o<v.length-1?j.add(g):R.add(g),arguments.length)return;const p=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"top"});R.add(p)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:x*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:E-t,height:M-t,left:h,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:m,computedY:c}=s(d),{borderStyle:h,originX:f,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,rowIdx:s}=r.origin,l=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const s=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+l||o===a.MAXLINENUMBER-1?[{x:m(e.length+1),y:c(-+r)+n}]:[];return e.concat(s)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):R.add(f),arguments.length)return;const g=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"bottom"});R.add(g)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:b*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,watch as l}from"vue";import{defaultBorderStyle as u,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as s}from"./useElectrocardiogram.js";import{useMeasureInstrument as d}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const f=e(),N=e(),b=e(),y=e(),M=t((()=>v.data.width)),L=t((()=>v.data.height)),S=t((()=>(M.value-0)/C.value)),w=t((()=>(L.value-0)/x.value)),C=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data.length/t.hz;return Math.ceil(a/t.mainXCellValue)})),x=t((()=>{const{config:e}=v.data;return Math.ceil(26*j.value/e.mainYCellValue)})),j=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),E=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=v.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{dataList:e,width:t,config:a}=v.data,{columnNumber:r,rowNumber:l}=R.value,u=t/r,i=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===i&&t===i-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===i&&t===i-1?0:Math.floor(t/l))*u,y:a*(2*w.value)+w.value,offsetY:(a+1)*(2*w.value),rowIdx:a}}}))})),X=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:M.value,originY:0,endY:L.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:x.value,event:E.value,dataList:I.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return l((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=d(m,X),{updatePolyline:l}=s(m,X,t);N.value=e,b.value=a,y.value=r,f.value=l}()}),{immediate:!0}),{propItems:X,updatePolyline:f,useMeasureRuler:N,useCaliper:b,useCaliperRuler:y,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as d}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const N=e(),f=e(),b=e(),M=e(),L=t((()=>v.data.width)),y=t((()=>v.data.height)),S=t((()=>(L.value-0)/C.value)),w=t((()=>(y.value-0)/E.value)),C=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data.length/t.hz;return Math.ceil(a/t.mainXCellValue)})),E=t((()=>{const{config:e,grid:t,dataList:a}=v.data;if(t.gridYNumber)return t.gridYNumber;const r=a.length;return Math.ceil(x.value*r*2/e.mainYCellValue)})),x=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),j=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=v.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{rowNumber:e}=R.value,{dataList:t}=v.data,a=t.length;return Math.round(E.value/(e+(a===o.MAXLINENUMBER?1:0)))})),X=t((()=>{const{dataList:e,width:t,config:a,grid:r}=v.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+w.value*Math.ceil(I.value/2),rowIdx:a}}}))})),U=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...l,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:L.value,originY:0,endY:y.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:X.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return u((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(m,U),{updatePolyline:u}=d(m,U,t);f.value=e,b.value=a,M.value=r,N.value=u}()}),{immediate:!0}),{propItems:U,updatePolyline:N,useMeasureRuler:f,useCaliper:b,useCaliperRuler:M,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
@@ -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"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as x}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as b,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,P,A,C){r(L,S);const{getEqualXTypes:I,handleAddPrevent:T}=y(L,Y,S),{createShadowLines:R}=t(),{left:X,xScaleList:V,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(X.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[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}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...R(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.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,X.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].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((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:P,showConnectLine:C=!1}=b,I=[],T=[],R=[];null==(u=e.list)||u.forEach(((u,b)=>{const X=a(c)?w.find((e=>e.key===u.key)):e,V=ce(u,r),z={};z.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return R.push(s),{obj:s,top:-D}}(V,u,X),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}R.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),R.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),R.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce);x=i([...e,e[0],l],{...y,...g.line,...n}),b=o((null==(d=null==g?void 0:g.point)?void 0:d.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),x&&R.push(x),b&&R.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:b,type:"reduce"}})}(V,u,X,z),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),R.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),R.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),R.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)p=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;p=s([e[0],t,i],{...j.style})}R.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:p,top:j.text?5:2*D,moveHide:!0}})}(V,u,X,z),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ce(b,r),w=ae(c,e.list[s].value),k=j&&ae(c,b.value);n&&j&&!l.breakpoint&&(!w&&!k||C)&&n[0]!==j[0]&&(f=i([...n,...j],{...v}));const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:x,M=T[s-1],R={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?P:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:w?e-5:e,...R})}else n&&(R.leftLine=null,p=o(E,{left:n[0],top:w?n[1]-5:n[1],...R}));T.push(f),p&&(g.includes("脉搏")?te.add(p):ie.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;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,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),de(n,"change")}}))}(p),I.push(p),ne.add(p))}(V,u,b,X,z)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=T.filter((e=>e));Promise.all(R).then((i=>{L.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&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top},A.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(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.left)).slice(-5)}`],A.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(f(e)&&function(e){const[t]=V,i=V.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=E(e.time),o=M(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 K&&l<h(K)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function de(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.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;fe()}function fe(){var e;ne.size&&(null==(e=L.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}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{var t;if(3===e.button){if(!S.event.evented)return;const{x:i=0,y:n=0}=e.pointer||{};if(i>=F&&i<=H&&n>=_&&n<=W){C.point={x:i,y:n},C.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(C.list=[...b]),"pain"===o&&(C.list=[...j]),C.target=e.target;else{C.target=null,C.list=["新增节点"],q.forEach((t=>{if(!I([...ne],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?J:B;n>=i.originY&&n<=i.endY&&C.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!==C.list.length||(C.show=!1,1===C.list.length&&t&&T("repeat"))}}}if(1===e.button){const{x:t=0,y:i=0}=e.pointer||{};t>=F&&t<=H&&i>0&&i<Q&&Y("click:grid",{x:t,y:i,time:$(t)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...b,...j]);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:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),de(t)}},setPopup:ue,isAddPoint:pe,updateData:de,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L 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 c,isValidValue as d,setOtherType as p,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as x}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as b,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,C,P,A){r(L,S);const{getEqualXTypes:I,handleAddPrevent:R}=y(L,Y,S),{createShadowLines:T}=t(),{left:V,xScaleList:X,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(V.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[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],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);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}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.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,V.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].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((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=b,I=[],R=[],T=[];null==(u=e.list)||u.forEach(((u,b)=>{const V=a(c)?w.find((e=>e.key===u.key)):e,X=ce(u,r),F={};F.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-D}}(X,u,V),function(e,t,r,a){var u,p;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}T.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(L));if(d(t.physicsReduce)||d(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==N?void 0:N.hypothermyViewCustom)?e[0]+z/2:e[0];x=i([...e,s,l],{...y,...g.line,...n}),b=o((null==(p=null==g?void 0:g.point)?void 0:p.type)||"circle",{left:s,top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),x&&T.push(x),b&&T.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:b,type:"reduce"}})}(X,u,V,F),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),T.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),T.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),T.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)d=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;d=s([e[0],t,i],{...j.style})}T.push(d)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:d,top:j.text?5:2*D,moveHide:!0}})}(X,u,V,F),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ce(b,r),w=ae(c,e.list[s].value),k=j&&ae(c,b.value);if(n&&j&&!l.breakpoint&&(!w&&!k||A)&&n[0]!==j[0]){f=i([...n,...j],{...v});const{obj:e}=(null==u?void 0:u.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==N?void 0:N.hypothermyViewCustom)){const t=i([e.left,e.top,...j],{...v});T.unshift(t),Object.assign(u,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:x,M=R[s-1],V={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:p(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};if(M){const e=M.get("y2");d=o(E,{left:M.get("x2"),top:w?e-5:e,...V})}else n&&(V.leftLine=null,d=o(E,{left:n[0],top:w?n[1]-5:n[1],...V}));R.push(f),d&&(g.includes("脉搏")?te.add(d):ie.add(d),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(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?J:B;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,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),pe(n,"change")}}))}(d),I.push(d),ne.add(d))}(X,u,b,V,F)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{L.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&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(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(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)}`],P.show=!0}function ce(e,t){const i="pain"===t.type?J:B;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))return;const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function de(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 K&&l<h(K)?(R("exceedMin"),!1):!(l>o)||(R("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.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;fe()}function fe(){var e;ne.size&&(null==(e=L.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}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!S.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=F&&e<=H&&t>=_&&t<=W){A.point={x:e,y:t},A.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...b]),"pain"===o&&(A.list=[...j]),A.target=i;else{A.target=null,A.list=["新增节点"],q.forEach((i=>{if(!I([...ne],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?J:B;t>=e.originY&&t<=e.endY&&A.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:u(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=de(e);i&&1!==A.list.length||(A.show=!1,1===A.list.length&&i&&R("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=F&&e<=H&&t>0&&t<Q&&Y("click:grid",{x:e,y:t,time:$(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...b,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),pe(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),pe(t)}},setPopup:ue,isAddPoint:de,updateData:pe,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
@@ -1,4 +1,4 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { IPropItems } from '../../../../../components/fabric-chart/src/interface';
4
- export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: IPropItems, computedX: Function): void;
4
+ export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, computedX: Function): void;
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function i(i,n,o){const{other:r,vitalSignsOriginY:l,xCellWidth:s,yCellHeight:a,endX:u}=n;let c=0;function h(i,n,o){const r=[];String(i.value).split("").forEach(((n,o)=>{const l=new t.Text(n,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...i.style||{}});c=(a-(l.height||0))/2,r.push(l)}));const l={originX:"center",left:n,top:o+c,baseTop:(i.baseTop||0)*a,trueLeft:n,trueHeight:r.length*a,objectCaching:!1};return new t.Group(r,l)}!function(){if(!(null==r?void 0:r.list))return!1;const n=[],c=[];r.list.forEach(((t,e)=>{const i=0===e?"vertical":t.align||"vertical",n=o(t.time,!0);if(n>u)return;const r=c.find((t=>t.left==n));if(r)r[i].push(t);else{const e={left:n,vertical:[],horizontal:[]};e[i].push(t),c.push(e)}})),c.forEach((t=>{let e=l.originY,i=t.left;t.vertical.forEach(((o,r)=>{var u,c;const f=(o.baseTop||0)*a,g=(null==(u=n.at(-1))?void 0:u.left)||0;0===r&&t.left<=g&&(i=g+s);if(n.filter((t=>t.trueLeft===i)).length){const t=String(o.value).length*a,r=(null==(c=n.at(-1))?void 0:c.trueHeight)||0;e+=r,e+t+f>l.endY&&(e=l.originY,i+=s)}e+=f,String(o.value).length&&n.push(h(o,i,e))})),t.horizontal.forEach(((e,o)=>{var r;const u=l.originY+(e.baseTop||0)*a,c=(null==(r=n.at(-1))?void 0:r.left)||0;t.left<=c&&(i=c+s),String(e.value).length&&n.push(h(e,i,u))}))}));const f=n.length>0?new t.Group([...n],{...e,objectCaching:!1}):null;f&&i.value.add(f)}()}export{i as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function i(i,n,o,l){const{other:r,vitalSignsOriginY:s,xCellWidth:h,yCellHeight:a,endX:u}=n;let c=0;function f(n,l,s){const u=[];String(n.value).split("").forEach(((i,o)=>{const l=new t.Text(i,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...n.style||{}});c=(a-(l.height||0))/2,u.push(l)}));const f=new t.Rect({left:0,top:0,width:h,height:a*u.length,fill:"transparent",originX:"center",...e}),{eventHighlight:g=!1}=r||{},p={originX:"center",left:l,top:s+c,baseTop:(n.baseTop||0)*a,trueLeft:l,trueHeight:u.length*a,objectCaching:!1,hoverCursor:"pointer",highlightObject:f,originData:n,selectable:!1,evented:g},v=new t.Group([f,...u],p);return function(t){const{highlightColor:e="#ffff00"}=r||{};t.on("mouseover",(()=>{t.highlightObject.set("fill",e),i.value.requestRenderAll()})),t.on("mouseout",(()=>{t.highlightObject.set("fill","transparent"),i.value.requestRenderAll()})),t.on("mousedown",(function(){o("eventClick",t.originData)}))}(v),i.value.add(v),v}!function(){if(!(null==r?void 0:r.list))return!1;const t=[],e=[];r.list.forEach(((t,i)=>{const n=0===i?"vertical":t.align||"vertical",o=l(t.time,!0);if(o>u)return;const r=e.find((t=>t.left==o));if(r)r[n].push(t);else{const i={left:o,vertical:[],horizontal:[]};i[n].push(t),e.push(i)}})),e.forEach((e=>{let i=s.originY,n=e.left;e.vertical.forEach(((o,l)=>{var r,u;const c=(o.baseTop||0)*a,g=(null==(r=t.at(-1))?void 0:r.left)||0;0===l&&e.left<=g&&(n=g+h);if(t.filter((t=>t.trueLeft===n)).length){const e=String(o.value).length*a,l=(null==(u=t.at(-1))?void 0:u.trueHeight)||0;i+=l,i+e+c>s.endY&&(i=s.originY,n+=h)}i+=c,String(o.value).length&&t.push(f(o,n,i))})),e.horizontal.forEach(((i,o)=>{var l;const r=s.originY+(i.baseTop||0)*a,u=(null==(l=t.at(-1))?void 0:l.left)||0;e.left<=u&&(n=u+h),String(i.value).length&&t.push(f(i,n,r))}))}))}()}export{i as useOther};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as d,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),X=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+H.value[0]+H.value[2]})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>W.value-H.value[2]*T.value)),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+B.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>G.value-H.value[2]*A.value)),q=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+L.value+I.value})),z=t((()=>q.value+H.value[0]*A.value)),T=t((()=>(W.value-k.value)/N.value)),A=t((()=>(G.value-q.value)/O.value)),B=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),E=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-T.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=T.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+T.value/2,scaleCell:(l-a)/T.value}}))));return s(o)})),F=t((()=>re("breathe"))),J=t((()=>re("pulse"))),K=t((()=>re("temperature"))),Q=t((()=>re("pain"))),U=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=t((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))))})),_=t((()=>{var e,t;const{left:a}=S.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),ee=t((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),te=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.endY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.originY=R.value-ee.value),t})),ae=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.originY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.endY=R.value-ee.value),t})),le=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ue=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:le.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:te.value,vitalSignsOriginY:ae.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:B.value,originX:k.value,originY:q.value,originYLimit:z.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:H.value});function re(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?A.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:oe,getXValue:se,getYValue:de}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,ie,b,ne,oe,se,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=h(y,ie,b,e,Y,ne,oe,se,de,t,a,i);p(y,ie,n),m(y,ie),f(y,ie,ne);const{select:o}=r(y,ie,b);D.value=o}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
1
+ import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as r}from"../useEvent.js";import{setOtherType as n,getFloorNumber as o}from"../../utils/index.js";import{flatten as s}from"lodash-es";import{format as d,addDays as v}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,b,w,Y,C){const x=15,D=e(),j=e(),V=e(),H=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),X=t((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||x)||0})),I=t((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||x)||0})),M=t((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=t((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=t((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+H.value[1]+H.value[3]})),O=t((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+H.value[0]+H.value[2]})),W=t((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=t((()=>W.value-H.value[2]*T.value)),k=t((()=>{const{top:e,left:t}=S.data;return e.titleWidth+B.value})),G=t((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=t((()=>G.value-H.value[2]*A.value)),q=t((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||x)||0;return X.value+a+l+L.value+I.value})),z=t((()=>q.value+H.value[0]*A.value)),T=t((()=>(W.value-k.value)/N.value)),A=t((()=>(G.value-q.value)/O.value)),B=t((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),E=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-T.value;const n=a.date.startDate||d(new Date,"yyyy-MM-dd"),o=u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(d(v(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=T.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+T.value/2,scaleCell:(l-a)/T.value}}))));return s(o)})),F=t((()=>re("breathe"))),J=t((()=>re("pulse"))),K=t((()=>re("temperature"))),Q=t((()=>re("pain"))),U=t((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=t((()=>{const{left:e}=S.data;return s(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:n(t.title,e.type),unit:e.unit,dataIndex:a}))))))})),_=t((()=>{var e,t;const{left:a}=S.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),ee=t((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),te=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.endY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.originY=R.value-ee.value),t})),ae=t((()=>{const{left:e}=S.data,t={originY:z.value,endY:R.value};return 0===_.value&&e.yScaleValue.length>1?t.originY=z.value+ee.value:_.value===e.yScaleValue.length-1&&(t.endY=R.value-ee.value),t})),le=t((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),ue=t((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=a({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:I.value,xScalevalueHeight:M.value,topList:le.value,breathingHeight:P.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:te.value,vitalSignsOriginY:ae.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:B.value,originX:k.value,originY:q.value,originYLimit:z.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:H.value});function re(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?A.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:oe,getXValue:se,getYValue:de}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=g(y,ie,b,ne,oe,se,de,S.addRenderItem,Y,C);j.value=l,V.value=u;const{drawScaleValue:n}=h(y,ie,b,e,Y,ne,oe,se,de,t,a,i);p(y,ie,n),m(y,ie),f(y,ie,b,ne);const{select:o}=r(y,ie,b);D.value=o}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
@@ -88,6 +88,8 @@ export interface IPoint {
88
88
  }
89
89
  interface IOther {
90
90
  style?: fabric.ITextOptions;
91
+ highlightColor?: string;
92
+ eventHighlight?: boolean;
91
93
  list: Array<IPoint>;
92
94
  }
93
95
  export interface IDate {
@@ -168,11 +170,10 @@ export declare type IPointTipProps = {
168
170
  point: ICoordinateValue;
169
171
  list: Array<string>;
170
172
  };
171
- export declare type IPointMenuProps = {
172
- show: boolean;
173
- point: ICoordinateValue;
173
+ export declare type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
174
174
  list: Array<any>;
175
175
  target: any;
176
176
  };
177
177
  export declare type IFabricChartMainParam = [Ref<fabric.Canvas>, any, any, Ref<any>, IPointTipProps, IPointMenuProps];
178
+ export declare type IPonter = [number, number];
178
179
  export {};