cnhis-design-vue 3.1.55-release.2 → 3.1.56-beta.7

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 (113) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/index.d.ts +18 -0
  3. package/es/components/annotation-edit/src/AnnotationEdit.d.ts +18 -0
  4. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  5. package/es/components/annotation-edit/src/type.d.ts +4 -0
  6. package/es/components/audio-sdk/src/audioSDK.d.ts +20 -6
  7. package/es/components/audio-sdk/src/audioSDK.js +1 -1
  8. package/es/components/audio-sdk/src/components/recordingDialog.vue.d.ts +14 -0
  9. package/es/components/audio-sdk/src/components/recordingDialog.vue2.js +1 -1
  10. package/es/components/audio-sdk/src/utils/recordingDialog.d.ts +5 -2
  11. package/es/components/audio-sdk/src/utils/recordingDialog.js +1 -1
  12. package/es/components/audio-sdk/style/index.css +1 -1
  13. package/es/components/base-search/index.d.ts +14 -0
  14. package/es/components/base-search/src/index.vue.d.ts +14 -0
  15. package/es/components/base-search/src/index.vue2.js +1 -1
  16. package/es/components/base-search/style/index.css +1 -1
  17. package/es/components/button-print/src/utils/print.d.ts +3 -0
  18. package/es/components/button-print/src/utils/print.js +1 -1
  19. package/es/components/callback/src/components/render/popupMaps.d.ts +26 -4
  20. package/es/components/classification/index.d.ts +20 -22
  21. package/es/components/classification/src/components/search-filter/index.vue.d.ts +14 -0
  22. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  23. package/es/components/classification/src/components/set-classification/index.vue.d.ts +20 -22
  24. package/es/components/classification/src/components/set-classification/index.vue2.js +1 -1
  25. package/es/components/classification/src/components/table-modal/index.vue.d.ts +9 -20
  26. package/es/components/classification/src/components/table-modal/index.vue2.js +1 -1
  27. package/es/components/classification/src/index.vue.d.ts +20 -22
  28. package/es/components/classification/src/index.vue2.js +1 -1
  29. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  30. package/es/components/fabric-chart/index.d.ts +4 -2
  31. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  32. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  35. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/electrocardiogram/useMeasureInstrument.js +1 -1
  38. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  39. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  41. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  43. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  44. package/es/components/form-config/index.d.ts +82 -14
  45. package/es/components/form-config/src/FormConfig.vue.d.ts +82 -14
  46. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +26 -4
  47. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +41 -7
  48. package/es/components/form-render/index.d.ts +26 -4
  49. package/es/components/form-render/src/FormRender.vue.d.ts +27 -4
  50. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  51. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +26 -4
  52. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  53. package/es/components/form-render/src/constants/index.d.ts +1 -0
  54. package/es/components/form-render/src/constants/index.js +1 -1
  55. package/es/components/form-render/src/hooks/useComplexOptions.d.ts +1 -1
  56. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  57. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +10 -2
  58. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  59. package/es/components/form-render/src/types/index.d.ts +3 -1
  60. package/es/components/iho-table/src/plugins/defaultValuePlugin.js +1 -1
  61. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  62. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  63. package/es/components/index.css +1 -1
  64. package/es/components/info-header/index.d.ts +77 -13
  65. package/es/components/info-header/src/InfoHeader.vue.d.ts +77 -13
  66. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +5 -1
  67. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +5 -1
  68. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -5
  69. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +26 -4
  70. package/es/components/recommend-search/index.d.ts +8 -8
  71. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +8 -8
  72. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  73. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +3 -3
  74. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +3 -3
  75. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  76. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  77. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  78. package/es/components/shortcut-setter/index.d.ts +26 -4
  79. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +26 -4
  80. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  81. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +14 -0
  82. package/es/components/table-filter/src/components/classify-filter/components/SelectDynamic.vue.d.ts +14 -0
  83. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +14 -0
  84. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +14 -0
  85. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue.d.ts +15 -0
  86. package/es/components/table-filter/src/components/render-widget/components/SelectDynamic.vue2.js +1 -1
  87. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue.d.ts +14 -0
  88. package/es/components/table-filter/src/components/render-widget/components/SelectDynamicOption/index.vue2.js +1 -1
  89. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +15 -0
  90. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +15 -0
  91. package/es/env.d.ts +25 -25
  92. package/es/shared/assets/img/failure.png.js +1 -1
  93. package/es/shared/assets/img/no-permission.png.js +1 -1
  94. package/es/shared/assets/img/nodata.png.js +1 -1
  95. package/es/shared/assets/img/notfound.png.js +1 -1
  96. package/es/shared/assets/img/qr.png.js +1 -1
  97. package/es/shared/assets/img/success.png.js +1 -1
  98. package/es/shared/assets/img/video.png.js +1 -1
  99. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  100. package/es/shared/assets/img/xb_big.png.js +1 -1
  101. package/es/shared/assets/img/xb_small.png.js +1 -1
  102. package/es/shared/hooks/selectHooks/useSelectRenders.d.ts +1 -1
  103. package/es/shared/hooks/selectHooks/useSelectRenders.js +1 -1
  104. package/es/shared/package.json.js +1 -1
  105. package/es/shared/utils/business.js +1 -1
  106. package/package.json +2 -2
  107. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  108. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  109. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  110. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  111. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  112. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  113. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,unref as r,watch as u}from"vue";import{defaultBorderStyle as l}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 i}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as n}from"./useElectrocardiogram.js";import{useMeasureInstrument as o}from"./useMeasureInstrument.js";function d(d,s,m,v,c,g){const h=e(),p=e(),f=e(),N=e(),b=a((()=>s.data.width)),M=a((()=>s.data.height)),C=a((()=>(b.value-0)/L.value)),w=a((()=>(M.value-0)/j.value)),L=a((()=>{const{dataList:e,config:a}=s.data,t=e[e.length-1].data.length/a.hz;return Math.ceil(t/a.mainXCellValue)})),j=a((()=>{const{config:e}=s.data;return Math.ceil(26*E.value/e.mainYCellValue)})),E=a((()=>{const{dataList:e,config:a}=s.data,t=e[e.length-1].data,r=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*r:"v"===a.valueUnit?1e3*r:r})),x=a((()=>{var e;return(null==(e=s.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=a((()=>{const{mode:e="2-6"}=s.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),y=a((()=>{const{dataList:e,width:a,config:t}=s.data,{columnNumber:r,rowNumber:u}=R.value,l=a/r,n=E.value/t.mainYCellValue*w.value+w.value,o=w.value,d=e.length;return e.map(((e,a)=>{const t=i.MAXLINENUMBER===d&&a===d-1?u:a%u;return{...e,origin:{x:(i.MAXLINENUMBER===d&&a===d-1?0:Math.floor(a/u))*l,y:t*n+o,rowIdx:t}}}))})),I=t({canvasWidth:s.data.width,canvasHeight:s.data.height,borderStyle:{...l,...s.data.borderStyle||{}},grid:s.data.grid,originX:0,endX:b.value,originY:0,endY:M.value,xCellWidth:C.value,yCellHeight:w.value,gridXNumber:L.value,gridYNumber:j.value,event:x.value,dataList:y.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:s.data.config});return u((()=>d.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:r}=o(d,I),{updatePolyline:u}=n(d,I,a);p.value=e,f.value=t,N.value=r,h.value=u}()}),{immediate:!0}),{propItems:I,updatePolyline:h,useMeasureRuler:p,useCaliper:f,useCaliperRuler:N,getGridInfo:function(){return{cellWidth:C.value,cellHeight:w.value,smallCellNumber:i.SMALLCELLNUMBER}}}}export{d as useElectrocardiogramChart};
1
+ import{ref as e,computed as a,reactive as t,unref as l,watch as r}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 d}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const f=e(),N=e(),b=e(),y=e(),M=a((()=>v.data.width)),L=a((()=>v.data.height)),S=a((()=>(M.value-0)/w.value)),C=a((()=>(L.value-0)/x.value)),w=a((()=>{const{dataList:e,config:a}=v.data,t=e[e.length-1].data.length/a.hz;return Math.ceil(t/a.mainXCellValue)})),x=a((()=>{const{config:e}=v.data;return Math.ceil(26*j.value/e.mainYCellValue)})),j=a((()=>{const{dataList:e,config:a}=v.data,t=e[e.length-1].data,l=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*l:"v"===a.valueUnit?1e3*l:l})),E=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=a((()=>{const{mode:e="2-6"}=v.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),I=a((()=>{const{dataList:e,width:a,config:t}=v.data,{columnNumber:l,rowNumber:r}=R.value,u=a/l,i=j.value/t.mainYCellValue*C.value+C.value,n=C.value,d=e.length;return e.map(((e,a)=>{const t=o.MAXLINENUMBER===d&&a===d-1?r:a%r;return{...e,origin:{x:(o.MAXLINENUMBER===d&&a===d-1?0:Math.floor(a/r))*u,y:t*i+n,rowIdx:t}}}))})),X=t({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:C.value,gridXNumber:w.value,gridYNumber:x.value,event:E.value,dataList:I.value,columnNumber:l(R).columnNumber,rowNumber:l(R).rowNumber,config:v.data.config});return r((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:l}=s(m,X),{updatePolyline:r}=d(m,X,a);N.value=e,b.value=t,y.value=l,f.value=r}()}),{immediate:!0}),{propItems:X,updatePolyline:f,useMeasureRuler:N,useCaliper:b,useCaliperRuler:y,getGridInfo:function(){return{cellWidth:S.value,cellHeight:C.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function l(l,n){const{getXValue:s,getYValue:u}=i(n),{yCellHeight:a,xCellWidth:f}=n,c=e(!1),h={origin:{x:0,y:0},line:null,rendering:!1},d={origin:{x:300,y:0},caliper:{width:4*f,height:60,rect:null},caliperRuler:{width:6*f,height:120,rect:null}};function v(e){m();const{width:o,height:i,rect:n}=d[e];if(n)return;const{x:s,y:u}=d.origin,a=d.caliper.height;d[e].rect=new t.Rect({left:s+2,top:u,width:o-4,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const f={hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",stroke:"blue",strokeWidth:2,__type:e},c=new t.Line([s,u,s,i],{...f,lockMovementY:!0}),h=new t.Line([s+o,u,s+o,i],{...f,lockMovementY:!0}),v=new t.Line([s,a,s+o+2,a],{...f,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default"}),g=r([s,v.top+10],{value:p(v.x1,v.x2),fill:"blue",originX:"left",originY:"top"});c.rect=d[e].rect,h.rect=d[e].rect,v.rect=d[e].rect,Object.assign(d[e].rect,{leftLine:c,rightLine:h,horizontalLine:v,text:g}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:l}=e;null==o||o.setCoords().set({x1:e.left-2,y1:e.top,x2:e.left-2,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const n="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left-2,y1:n,x2:e.left+e.width+2,y2:n}),l.setCoords().set({left:e.left,top:n+10})})),e.on("mouseup",(t=>{1===t.button&&(l.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(d[e].rect,e),x(c,"left"),x(h,"right"),"caliper"===e&&x(v,"horizontal"),l.value.add(d[e].rect,c,h,v,g)}function p(e,t){return`${1e3*s(t-e)}ms`}function x(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:l,text:n}=o;if("horizontal"===t)return e.top<=o.top+1?e.setCoords().set({y1:o.top+1,y2:o.top+1}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void n.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left-1?e.setCoords().set({x1:i.left-1,x2:i.left-1}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left+2,width:i.left-e.left-4}),l.setCoords().set({x1:e.left}),n.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left+1?e.setCoords().set({x1:r.left+1,x2:r.left+1}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left-4}),l.setCoords().set({x2:e.left+2})),n.set("text",p(l.x1,l.x2))}))}function m(){Object.values(d).forEach((e=>{const{rect:t}=e;t&&(l.value.remove(t),l.value.remove(t.leftLine),l.value.remove(t.rightLine),l.value.remove(t.horizontalLine),l.value.remove(t.text),e.rect=null)})),h.line&&(l.value.remove(h.line),h.line.text&&l.value.remove(h.line.text),h.line=null)}return l.value.on("mouse:down",(e=>{if(1===e.button&&c.value){const{x:t=0,y:o=0}=e.pointer||{};h.origin={x:t,y:o},h.rendering=!0}})),l.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&c.value&&setTimeout((()=>{c.value=!1,h.rendering=!1})),3===t&&m()})),l.value.on("mouse:move",(e=>{var t;if(1===e.button&&c.value&&h.rendering){const{x:i=0,y:n=0}=e.pointer||{};h.line&&l.value.remove(h.line),(null==(t=h.line)?void 0:t.text)&&l.value.remove(h.line.text);const{x:f,y:c}=h.origin;h.line=o([f,c,i,n],{stroke:"blue"});const d=-u(n-c).toFixed(2),v=1e3*s(i-f),p=r([i,n+2*a],{value:`${d}mv\n${v}ms`,fill:"blue"});h.line.text=p,l.value.add(h.line,p)}})),{flag:c,useMeasureRuler:function(){c.value||(c.value=!0)},useCaliper:function(){v("caliper")},useCaliperRuler:function(){v("caliperRuler")}}}export{l as useMeasureInstrument};
1
+ import{ref as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as o,drawText as r}from"../useDraw.js";import{useElectrocardiogramCumputedPoint as i}from"../useCumputedPoint.js";import"../useEvent.js";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function n(n,l){const{getXValue:s,getYValue:u}=i(l),{yCellHeight:a,xCellWidth:f,measureLineStyle:c,measureTextStyle:h}=l,d=e(!1),v={origin:{x:0,y:0},line:null,rendering:!1},p={origin:{x:300,y:0},caliper:{width:4*f,height:60,rect:null},caliperRuler:{width:6*f,height:120,rect:null}};function m(e){C();const{width:o,height:i,rect:l}=p[e];if(l)return;const{x:s,y:u}=p.origin,a=p.caliper.height;p[e].rect=new t.Rect({left:s+2,top:u,width:o-4,height:i,strokeWidth:0,fill:"transparent",hasControls:!1,hasBorders:!1,hoverCursor:"move"});const f={...c,hasControls:!1,hasBorders:!1,hoverCursor:"e-resize",strokeWidth:2,__type:e,evented:!0,selectable:!0},d=new t.Line([s,u,s,i],{...f,lockMovementY:!0}),v=new t.Line([s+o,u,s+o,i],{...f,lockMovementY:!0}),m=new t.Line([s,a,s+o+2,a],{...f,lockMovementX:!0,evented:"caliper"===e,hoverCursor:"caliper"===e?"n-resize":"default"}),y=r([s,m.top+10],{value:x(m.x1,m.x2),...h,originX:"left",originY:"top"});d.rect=p[e].rect,v.rect=p[e].rect,m.rect=p[e].rect,Object.assign(p[e].rect,{leftLine:d,rightLine:v,horizontalLine:m,text:y}),function(e,t){e.on("moving",(()=>{const{leftLine:o,rightLine:r,horizontalLine:i,text:n}=e;null==o||o.setCoords().set({x1:e.left-2,y1:e.top,x2:e.left-2,y2:e.top+e.height}),null==r||r.setCoords().set({x1:e.left+e.width,y1:e.top,x2:e.left+e.width,y2:e.top+e.height});const l="caliper"===t?e.top+e.height:e.top+e.height/2;null==i||i.setCoords().set({x1:e.left-2,y1:l,x2:e.left+e.width+2,y2:l}),n.setCoords().set({left:e.left,top:l+10})})),e.on("mouseup",(t=>{1===t.button&&(n.value.discardActiveObject(),e.leftLine.bringToFront(),e.rightLine.bringToFront(),e.horizontalLine.bringToFront())}))}(p[e].rect,e),g(d,"left"),g(v,"right"),"caliper"===e&&g(m,"horizontal"),n.value.add(p[e].rect,d,v,m,y)}function x(e,t){return`${1e3*s(t-e)}ms`}function g(e,t){e.on("moving",(()=>{const{rect:o}=e;if(!o)return;const{leftLine:r,rightLine:i,horizontalLine:n,text:l}=o;if("horizontal"===t)return e.top<=o.top+1?e.setCoords().set({y1:o.top+1,y2:o.top+1}):e.setCoords().set({y1:e.top,y2:e.top}),o.setCoords().set({height:e.top-o.top}),null==r||r.setCoords().set({y2:e.top}),null==i||i.setCoords().set({y2:e.top}),void l.setCoords().set({top:e.top+10});"left"===t&&(e.left>=i.left-1?e.setCoords().set({x1:i.left-1,x2:i.left-1}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({left:e.left+2,width:i.left-e.left-4}),n.setCoords().set({x1:e.left}),l.setCoords().set({left:e.left})),"right"===t&&(e.left<=r.left+1?e.setCoords().set({x1:r.left+1,x2:r.left+1}):e.setCoords().set({x1:e.left,x2:e.left}),o.setCoords().set({width:e.left-r.left-4}),n.setCoords().set({x2:e.left+2})),l.set("text",x(n.x1,n.x2))}))}function C(){Object.values(p).forEach((e=>{const{rect:t}=e;t&&(n.value.remove(t),n.value.remove(t.leftLine),n.value.remove(t.rightLine),n.value.remove(t.horizontalLine),n.value.remove(t.text),e.rect=null)})),v.line&&(n.value.remove(v.line),v.line.text&&n.value.remove(v.line.text),v.line=null)}return n.value.on("mouse:down",(e=>{if(1===e.button&&d.value){const{x:t=0,y:o=0}=e.pointer||{};v.origin={x:t,y:o},v.rendering=!0}})),n.value.on("mouse:up",(e=>{const{button:t}=e;1===t&&d.value&&setTimeout((()=>{d.value=!1,v.rendering=!1})),3===t&&C()})),n.value.on("mouse:move",(e=>{var t;if(1===e.button&&d.value&&v.rendering){const{x:i=0,y:l=0}=e.pointer||{};v.line&&n.value.remove(v.line),(null==(t=v.line)?void 0:t.text)&&n.value.remove(v.line.text);const{x:f,y:d}=v.origin;v.line=o([f,d,i,l],c);const p=-u(l-d).toFixed(2),m=1e3*s(i-f),x=r([i,l+2*a],{value:`${p}mv\n${m}ms`,...h});v.line.text=x,n.value.add(v.line,x)}})),{flag:d,useMeasureRuler:function(){d.value||(d.value=!0)},useCaliper:function(){m("caliper")},useCaliperRuler:function(){m("caliperRuler")}}}export{n as useMeasureInstrument};
@@ -1 +1 @@
1
- import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function g(g,y,h,k,x){const{computedX:L,computedY:P,getXValue:b,getYValue:w}=r(y),{xCellWidth:A,pointSelectionStyle:I,originX:C,endX:K,originY:j,endY:E,event:X,scaleValues:M,xAxis:T,startTime:V,timeXCell:Y,itemList:S,dialog:$}=y,F=new Map,O=new Set,D=p(M);let _=[],z=null;const N=new Set;l(g,y);const{getEqualXTypes:G,handleAddPrevent:J,setPrevAndNextPoint:q}=s(g,h,y),{pause:R,resume:W}=v((()=>{!function(){if(!N.size)return;for(const e of N)e.set("opacity",1===e.opacity?.5:1);g.value.renderAll()}()}),800);function B(){D.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=P(t.type,t.range,n),a=i([C,r,K,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});X.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${o} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),g.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:se()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function Q(e){$.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&g.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];F.set(e.key,[]),function(e,t){N.size&&[...N].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&N.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,x=u;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:I="",key:C,type:K="circle"}=x,j=ae(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],M={origin:{data:l,title:I,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...y.event.hovered?y.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:y.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...M}):e&&(M.leftLine=null,p=o(K,{left:e[0],top:e[1],...M}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){X.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),X.hovered&&le(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/A);if(a>l+A){if(0===_.length){te(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+A*c;if(_.every((e=>e.left!==u))){const t=b(u),n=w(f.type,s);_.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),te(e,[...e.prevPointer,u,s])}if(_.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+A*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-A))/A),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:b(t),value:w(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},_.splice(l,0,a),te(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=F.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=A/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?ee(e,"#999"):ee(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(_.length>0&&i<_[_.length-1].left){for(const e of O)e.left>i&&(e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of O)e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:b(e.left),value:w(t,e.top)}};if(g.value.discardActiveObject(),_.length>0){const l=D.find((e=>e.type===t));let r=-1;const a=_.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ie({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ne({...o,data:a,coincideIndex:r})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),ne(o,"change")}}))}(p),null==(d=F.get(u.key))||d.push(p))}(ae(l,n),l,c,e)})),Promise.all(F.get(e.key)).then((t=>{const n=f.filter((e=>e));q(t),g.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||N.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ee(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function te(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,O.add(l),g.value.add(r,l)}))}function ne(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=D.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}ie({dataIndex:s,scaleValue:f})}function ie(e){var t,n,i;if(O.size&&(null==(t=g.value)||t.remove(...oe([...O]))),O.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=g.value)||n.remove(...oe(F.get(o.key))),F.delete(o.key),Z(o,t,i)}else F.size&&(null==(i=g.value)||i.remove(...oe(se()))),F.clear(),B()}function oe(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)})),t}function le(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:w(i,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${b(e.left).slice(-5)}`],k.show=!0}function re(e){e.setCoords();const t=6e4/Y,n=e.prevPoint?e.prevPoint.left+t:C,i=K;e.top<j&&e.set("top",j),e.top>E&&e.set("top",E),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ae(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),i=P(t.type,t.range,e.value);return[n,i<j?j:i>E?E:i]}}function se(){return Array.from(F.values()).flat()}return e((()=>{R()})),B(),function(){if(!X.evented)return;let e=!1,i={x:0,y:0};g.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=C&&t<=K&&n>=j&&n<=E)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);se().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&x.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),S.forEach((n=>{G(se(),t,"key",2*A).includes(n.linkKey||n.key)||x.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===x.list.length&&(x.show=!1,J("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ne(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),g.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),g.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;z&&g.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...I,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:i,endPos:o.pointer},g.value.add(z)}))}(),{redrawPoints:ie,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),ne(n,"remove")):(Object.assign(n,{data:{time:b(e.pointer.x),value:w(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),ne({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:re,setPopup:le,updateData:ne,getGridPoints:se,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{g as useCenter};
1
+ import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:T,xAxis:V,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(T);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...X}):e&&(X.leftLine=null,p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(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)})),t}function re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(V.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as s}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function d(d,c,u,f,h,m,g,p,v){const{computedX:x,getXValue:k}=o(c),{getEqualXTypes:y,handleAddPrevent:X,isGridLimit:b}=r(d,u,c),{other:P,yCellHeight:w,xCellWidth:j,endX:z,originX:C,originY:E,endY:A,markHeight:L,event:M,topGridYCellHeight:S}=c,I=new Map,T=l(P);function H(){var o;if(!(null==(o=null==T?void 0:T.horizontal)?void 0:o.length))return;const n="horizontal";I.set(n,[]);const{horizontal:r}=T;let a=E+w/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:c={},textStyle:u={},data:f}=o;let h=null;f.forEach(((o,f)=>{const{time:m,value:g}=o,p=x(m);if(!B(p))return;const v=e(s,{...c,left:p,top:a}),k=p+v.width/2+2,y=i([k,a],{value:g,...u,originX:"left"}),X=new t.Group([v,y],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});Object.assign(X,{originLeft:p,iconHalfWidth:v.width/2,origin:{type:"other",key:n,dataIndex:r,index:f,data:o,title:l},limitX:{x1:C,x2:z-X.width}}),h&&(X.limitX.x1=h.left,h.limitX.x2=X.left,X.prevPoint=h,h.nextPoint=X),h=X,O(X),I.get(n).push(X),d.value.add(X)})),a+=w}))}function W(){var t;if(!(null==(t=null==T?void 0:T.vertical)?void 0:t.length))return;const i="vertical";I.set(i,[]);const{vertical:o}=T;o.forEach(((t,o)=>{const{textStyle:n={},data:r,time:a}=t,l=x(a);if(!B(l))return;let s=E+w/2;r.forEach(((t,r)=>{const a=e(String(t),{...n,lockMovementY:!0,left:l,originX:"left",top:s,origin:{type:"other",key:i,dataIndex:o,index:r,data:{value:t}}});s+=w,O(a),I.get(i).push(a),d.value.add(a)}));const c=I.get(i).filter((t=>t.origin.dataIndex===o)),u=Math.max(...c.map((t=>t.width))),f=l>z-u;c.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=u,f&&t.setCoords().set("originX","right")}))}))}function Y(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=T[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}V(t)}function V(t){var e;const{key:i}=t;switch(null==(e=d.value)||e.remove(...I.get(i)),I.delete(i),i){case"horizontal":H();break;case"vertical":W();break;case"mark":G()}}function G(){if(!(null==P?void 0:P.mark)||!L)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=P.mark,a=i([C-5,A+L/2],{value:t,...o,originX:"right"});d.value.add(a);const l=A+L,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=x(i);if(!B(r))return;let a=A;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),c=o.height;a+c<=l&&a>=A?(o.set("top",a+c/2),a+=c):(i||(a=A,i=!0),o.set("top",a-c/2),a-=c),s.push(o),O(o),d.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:C,x2:z};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function O(t){if(M.hovered&&(t.on("mouseover",(()=>{q(t)})),t.on("mouseout",(()=>{f.show=!1}))),!M.evented)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<E&&t.set("top",E);const e=A+L-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(m(t),function(t){const e=t.left+t.maxTextWidth>z?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),M.hovered&&q(t)})),t.on("mouseup",(n=>{var r;if(f.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=k(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};d.value.discardActiveObject(),u("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(h.point={x:t.left,y:t.top},h.show=!0,h.target=t,h.list=s.map((t=>({...t,renderItem:()=>t.label}))))}))}function q(t){f.point={x:t.left,y:"mark"===t.origin.key?t.top:t.top+S/2};const e=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left;f.list=[`时间 ${k(e).slice(-5)}`],"mark"===t.origin.key&&f.list.unshift(t.origin.data.name+" "),f.show=!0}function B(t){return t>=C&&t<=z}return function(){var t;if(!(null==(t=null==T?void 0:T.horizontal)?void 0:t.length))return;const{horizontal:i}=T,o=C-5;let n=E+w/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var c;(c=s).on("moving",(()=>{c.set("originX","center"),b(c)?q(c):f.show=!1})),c.on("mouseup:before",(t=>{if(f.show=!1,0===t.e.button&&b(c))if(y(I.get("horizontal"),c.left,"key",j).includes(c.origin.key))X("repeat"),console.log("重复节点");else{const t={data:{time:k(c.left),value:c.origin.defaultAddValue},...c.origin};u("add",t),Y(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(c)})),d.value.add(s),n+=w}))}(),H(),W(),G(),n.on((()=>{const t="horizontal",e=g(I.get(t));e.length>0?p((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return Object.keys(e).map((t=>{const i=e[t];return T.horizontal[t].data.splice(i[0].index,i.length),i})).flat()}(e);V({key:t}),u("remove",i)})):v()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};u(i,o),"remove"===i&&Y(o,i)}}}export{d as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as i}from"../useDraw.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import{bus as n}from"../useEvent.js";import{useCommon as r}from"../useCommon.js";import"vue";import{getIndex as a}from"../../utils/index.js";import{cloneDeep as l,flatten as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";function c(c,u,f,h,m,g,p,v,x){const{computedX:k,getXValue:y}=o(u),{getEqualXTypes:X,handleAddPrevent:b,isGridLimit:P}=r(c,f,u),{other:w,yCellHeight:j,xCellWidth:z,endX:C,originX:E,originY:A,endY:L,markHeight:M,event:S,topGridYCellHeight:I}=u,T=new Map,H=l(w);function W(){var o;if(!(null==(o=null==H?void 0:H.horizontal)?void 0:o.length))return;const n="horizontal";T.set(n,[]);const{horizontal:r}=H;let a=A+j/2;r.forEach(((o,r)=>{const{title:l,type:s,pointAttr:d={},textStyle:u={},data:f}=o;let h=null;f.forEach(((o,f)=>{const{time:m,value:g}=o,p=k(m);if(!D(p))return;const v=e(s,{...d,left:p,top:a}),x=p+v.width/2+2,y=i([x,a],{value:g,...u,originX:"left"}),X=new t.Group([v,y],{lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});Object.assign(X,{originLeft:p,iconHalfWidth:v.width/2,origin:{type:"other",key:n,dataIndex:r,index:f,data:o,title:l},limitX:{x1:E,x2:C-X.width}}),h&&(X.limitX.x1=h.left,h.limitX.x2=X.left,X.prevPoint=h,h.nextPoint=X),h=X,q(X),T.get(n).push(X),c.value.add(X)})),a+=j}))}function Y(){var t;if(!(null==(t=null==H?void 0:H.vertical)?void 0:t.length))return;const i="vertical";T.set(i,[]);const{vertical:o}=H;o.forEach(((t,o)=>{const{textStyle:n={},data:r,time:a}=t,l=k(a);if(!D(l))return;let s=A+j/2;r.forEach(((t,r)=>{const a=e(String(t),{...n,lockMovementY:!0,left:l,originX:"left",top:s,origin:{type:"other",key:i,dataIndex:o,index:r,data:{value:t}}});s+=j,q(a),T.get(i).push(a),c.value.add(a)}));const d=T.get(i).filter((t=>t.origin.dataIndex===o)),u=Math.max(...d.map((t=>t.width))),f=l>C-u;d.forEach(((t,e,i)=>{t.siblingPoints=i.filter((e=>e.origin.index!==t.origin.index)),t.maxTextWidth=u,f&&t.setCoords().set("originX","right")}))}))}function V(t,e="add"){const{dataIndex:i,data:o,index:n,key:r}=t,l=H[r],s=["mark"].includes(r)?l.dataList[i]:l[i];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=o;break;default:{const t=Array.isArray(o)?o[0].time:o.time,e=a(t,s.data),i=Array.isArray(o)?o:[o];s.data.splice(e,0,...i);break}}G(t)}function G(t){var e;const{key:i}=t;switch(null==(e=c.value)||e.remove(...T.get(i)),T.delete(i),i){case"horizontal":W();break;case"vertical":Y();break;case"mark":O()}}function O(){if(!(null==w?void 0:w.mark)||!M)return;const{title:t,titleStyle:o,pointAttr:n,dataList:r}=w.mark,a=i([E-5,L+M/2],{value:t,...o,originX:"right"});c.value.add(a);const l=L+M,s=[];r.forEach((t=>{const{time:i,list:o=[]}=t,r=k(i);if(!D(r))return;let a=L;o.forEach((t=>{let i=!1;const o=e("circleAndText",{...n,text:t.text,left:r,top:a,origin:{data:t,key:"mark",type:"other"}}),d=o.height;a+d<=l&&a>=L?(o.set("top",a+d/2),a+=d):(i||(a=L,i=!0),o.set("top",a-d/2),a-=d),s.push(o),q(o),c.value.add(o)}))})),function(t){const e=t=>{var e,i;return null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart},i=t.find((t=>e(t))),o=t.find((t=>!e(t)&&t.left>i.left)),n=t.filter((t=>!e(t)));t.forEach((t=>{const r={x1:E,x2:C};e(t)?(r.x2=o.left,t.otherPoints=n):(r.x1=i.left,t.startPoint=i),t.limitX=r}))}(s)}function q(t){if(S.hovered&&(t.on("mouseover",(()=>{B(t)})),t.on("mouseout",(()=>{h.show=!1}))),!S.evented)return;const{key:e}=t.origin,i=["mark","horizontal"].includes(e),o=["mark","vertical"].includes(e);t.on("moving",(()=>{i?function(t){const e=t.origin.key,i="horizontal"===e;t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1+(i?1:0));t.left>t.limitX.x2&&t.set("left",t.limitX.x2+(i?-1:0));if("mark"===e){t.top<A&&t.set("top",A);const e=L+M-t.height/2;t.top>e&&t.set("top",e)}i&&(t.originLeft=t.left+t.iconHalfWidth)}(t):(g(t),function(t){const e=t.left+t.maxTextWidth>C?"right":"left";t.setCoords().set({originX:e}),t.siblingPoints.forEach((i=>i.setCoords().set({originX:e,left:t.left})))}(t)),S.hovered&&B(t)})),t.on("mouseup",(n=>{var r;if(h.show=!1,1===n.button){i&&function(t){var e,i;if("mark"===t.origin.key){if((null==(i=null==(e=t.origin)?void 0:e.data)?void 0:i.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),i=Math.min(...e);t.startPoint.limitX.x2=i}return}t.prevPoint&&(t.prevPoint.limitX.x2=t.left);t.nextPoint&&(t.nextPoint.limitX.x1=t.left)}(t);const e=y(null!=(r=t.originLeft)?r:t.left),n={...t.origin,...o?{time:e}:{data:{...t.origin.data,time:e}}};c.value.discardActiveObject(),f("change",n)}3===n.button&&["horizontal","vertical"].includes(e)&&(m.point={x:t.left,y:t.top},m.show=!0,m.target=t,m.list=d.map((t=>({...t,renderItem:()=>t.label}))))}))}function B(t){h.point={x:t.left,y:"mark"===t.origin.key?t.top:t.top+I/2};const e=!t.origin.isMenu&&t.originLeft?t.originLeft:t.left;h.list=[`时间 ${y(e).slice(-5)}`],"mark"===t.origin.key&&h.list.unshift(t.origin.data.name+" "),h.show=!0}function D(t){return t>=E&&t<=C}return function(){var t;if(!(null==(t=null==H?void 0:H.horizontal)?void 0:t.length))return;const{horizontal:i}=H,o=E-5;let n=A+j/2;i.forEach(((t,i)=>{const{title:r,titleStyle:a={},defaultAddValue:l}=t,s=r&&e(r,{...a,originX:"right",left:o,top:n,origin:{defaultAddValue:l,dataIndex:i,type:"other",key:"horizontal",title:r,isMenu:!0},originLeft:o,originTop:n});var d;(d=s).on("moving",(()=>{d.set("originX","center"),P(d)?B(d):h.show=!1})),d.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&P(d))if(X(T.get("horizontal"),d.left,"key",z).includes(d.origin.key))b("repeat"),console.log("重复节点");else{const t={data:{time:y(d.left),value:d.origin.defaultAddValue},...d.origin};f("add",t),V(t)}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(d)})),c.value.add(s),n+=j}))}(),W(),Y(),O(),n.on((()=>{const t="horizontal",e=p(T.get(t));e.length>0?v((()=>{const i=function(t){const e=t.reduce(((t,e)=>{const{dataIndex:i}=e.origin;return t[i]=t[i]?t[i].concat(e.origin):[e.origin],t}),{});return s(Object.keys(e).map((t=>{const i=e[t];return H.horizontal[t].data.splice(i[0].index,i.length),i})))}(e);G({key:t}),f("remove",i)})):x()})),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:i}=t,o={...e.origin,type:"other"};f(i,o),"remove"===i&&V(o,i)}}}export{c as useOther};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as p}from"../../constants/index.js";import"@vueuse/core";import{useTop as m}from"./useTop.js";import{useLeft as v}from"./useLeft.js";import{useCenter as h}from"./useCenter.js";import{useOther as f}from"./useOther.js";function g(g,y,x,w,b,j){const C=n(),Y=e(),H=e(),S=e(),D=t((()=>y.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),A=t((()=>{var e;return null!=(e=y.data.left.width)?e:0})),M=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell})),T=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell})),X=t((()=>s(y.data.top.treeData))),G=t((()=>y.data.top.tree.cellHeight)),V=t((()=>G.value*X.value)),k=t((()=>ee($("drug")||"top"))),P=t((()=>k.value+V.value)),L=t((()=>{var e;return Date.parse((null==(e=y.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),N=t((()=>{const e=d(y.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(M.value/t+1).map((r=>0===r?e.startTime:u(new Date(L.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:A.value}})),O=function(){const e=d(y.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=y.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const o={top:t*r+k.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);o.height=a*r,e(i.children,l+1)}else o.width=A.value-o.left;Object.assign(i,o)}))}(e),e}(),E=t((()=>ee($("xAxis")||"center"))),W=t((()=>{var e;const{width:t,right:a}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),I=t((()=>ee($("intraoperatively")||"bottom"))),q=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=y.data.other)?void 0:e.mark)||{};return t&&a?a:0})),z=t((()=>I.value+(y.data.height-V.value-N.value.height-q.value))),B=t((()=>(W.value-A.value)/M.value)),F=t((()=>(z.value-I.value)/T.value)),J=t((()=>N.value.spaceTimeStamp/B.value)),K=t((()=>{const{scaleValues:e}=y.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),Q=t((()=>te("pulse"))),R=t((()=>te("temperature"))),U=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...o,...y.data.borderStyle},pointSelectionStyle:y.data.pointSelectionStyle||{},grid:y.data.grid,top:y.data.top,left:y.data.left,other:y.data.other,topGridYNumber:r(X),topGridYCellHeight:r(G),topGridOriginY:r(k),topGridEndY:r(P),treeData:O,xAxis:r(N),originYXAxis:r(E),startTime:r(L),timeXCell:r(J),gridXNumber:r(M),gridYNumber:r(T),xCellWidth:r(B),yCellHeight:r(F),originX:r(A),endX:r(W),originY:r(I),endY:r(z),markHeight:r(q),itemList:r(K),scaleValues:y.data.scaleValues,pulseYCell:r(Q),temperatureYCell:r(R),event:r(U),dialog:C});function $(e){let t="";return Object.entries(D.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function _(e){const t=D.value[e],a=N.value.height;switch(t){case"drug":return V.value;case"xAxis":return a;default:return y.data.height-V.value-a}}function ee(e){switch(e){case"top":return 0;case"center":return _("top");default:return _("top")+_("center")}}function te(e){const{scaleValues:t}=y.data,a=t.find((t=>t.type===e));return F.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),m(g,Z,x,b);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:n,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=h(g,Z,x,b,j);v(g,Z,x,b,a,r,i,n);const{clickMenu:d}=f(g,Z,x,b,j,a,o,u,s);H.value=e,S.value=e=>{const{item:a}=e;a.type&&p.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:Z,redrawPoints:H,select:Y,clickMenu:S}}export{g as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as f}from"./useOther.js";function y(y,x,w,b,j,C){const Y=n(),H=e(),S=e(),D=e(),A=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),T=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),G=t((()=>s(x.data.top.treeData))),V=t((()=>x.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const e=d(x.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=x.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const o={top:t*r+P.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);o.height=a*r,e(i.children,l+1)}else o.width=M.value-o.left;Object.assign(i,o)}))}(e),e}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(x.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=x.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...o,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:x.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return x.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),v(y,$,w,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:n,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=g(y,$,w,j,C);h(y,$,w,j,a,r,i,n);const{clickMenu:d}=f(y,$,w,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
@@ -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}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function w(w,k,S,Y,E,M,$,O,P,A){r(w,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(w,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:V,yCellHeight:z,originX:D,endX:F,originY:H,endY:_,itemList:W,event:q,vitalSignsOriginY:G,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 o;const l=ne.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&w.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])}}const o=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],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(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),Q.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([...t.flat()],{...r,originX:"center"});e.push(n),Q.add(n)}))}w.value.add(...e)}Q.add(l),w.value.add(l)}))}}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({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].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((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ie.add(e)}))}))}function se(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:Y=[],list:M=[]}=r,{type:O,textStyle:A,showConnectLine:C=!1}=b,I=[],T=[],R=[];null==(u=e.list)||u.forEach(((u,b)=>{const X=a(c)?Y.find((e=>e.key===u.key)):e,V=ue(u,r),D={};D.value=function(e,t,i){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=G.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 R.push(s),{obj:s,top:-z}}(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,k;if(t.noRise&&h.show){const t=L(h)?E(c,M,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});else{const i=t+2*z;j=s([e[0],t,i],{...h.style})}R.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),R.push(w));t.verified&&(k=l([e[0],e[1]-(m?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),R.push(k));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,M,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===N?"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*z,isFixed:L(h)},riseText:{obj:w,top:(m?-z:0)-5},verifiedText:{obj:k,top:(m?-z:0)-5},reducePoint:{obj:b,type:"reduce"}})}(V,u,X,D),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...M),r=Math.min(...M);let a,u,p;const{upArrowShow:d=!1,limitValueShow:f=!1}=i;if(d&&+t.value>180){let t=e[1]-2.5*z,i=[e[1]-z/2,t];t<G.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/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]+z/2+a.height:e[1]+z;u=l([e[0],t],i),R.push(u)}+t.value<r&&(u=l([e[0],e[1]-z],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*z;p=s([e[0],t,i],{...j.style})}R.push(p)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-z},belowMinValue:{obj:p,top:j.text?5:2*z,moveHide:!0}})}(V,u,X,D),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=ue(b,r),L=re(c,e.list[s].value),Y=j&&re(c,b.value);n&&j&&!l.breakpoint&&(!L&&!Y||C)&&n[0]!==j[0]&&(f=i([...n,...j],{...v}));const E=l.pacemakerShow&&"pulse"==c?y.value:L&&"number"===O?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,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...L?{selectable:!1,evented:!1,..."number"===O?A:{}}:{}};if(M){const e=M.get("y2");p=o(E,{left:M.get("x2"),top:L?e-5:e,...R})}else n&&(R.leftLine=null,p=o(E,{left:n[0],top:L?n[1]-5:n[1],...R}));T.push(f),p&&(g.includes("脉搏")?ee.add(p):te.add(p),function(e){q.hovered&&(e.on("mouseover",(()=>{ae(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?B:G;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&&(w.value.remove(i),delete e.otherObj.obj)))})),oe(e)}(e),q.hovered&&ae(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}};w.value.discardActiveObject(),S("change",n),pe(n,"change")}}))}(p),I.push(p),ie.add(p))}(V,u,b,X,D)})),"pulse"===c&&U.forEach((e=>{Z.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=>{w.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&&w.value.remove(e.leftLine),e.rightLine&&w.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;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)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const i="pain"===t.type?B:G;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=Y(e.time),o=E(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ce(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(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(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;de()}function de(){var e;ie.size&&(null==(e=w.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,F,t],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||se(t,i,e)}))})),oe(),le(),k.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=F&&n>=H&&n<=_){A.point={x:i,y:n},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],W.forEach((t=>{if(!C([...ie],i,"_type").includes(t.bigType)){const i=["pain"].includes(t.bigType)?B:G;n>=i.originY&&n<=i.endY&&A.list.push({renderItem:O?O(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=ce(i);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{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};S("change",r),pe(r,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ie}}function L(e){return"fixed"===e.position}export{w 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 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 +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 n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as p}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,S,b,w,Y){const C=15,x=e(),D=e(),j=e(),V=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),H=t((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||C)||0})),X=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),L=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),I=t((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),M=t((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),N=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+V.value[0]+V.value[2]})),O=t((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>O.value-V.value[2]*z.value)),$=t((()=>{const{top:e,left:t}=y.data;return e.titleWidth+A.value})),k=t((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),G=t((()=>k.value-V.value[2]*T.value)),R=t((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+X.value+L.value})),q=t((()=>R.value+V.value[0]*T.value)),z=t((()=>(O.value-$.value)/P.value)),T=t((()=>(k.value-R.value)/N.value)),A=t((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=y.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 n=$.value-z.value;const r=a.date.startDate||s(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{n+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:n,center:n+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:r(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{var e,t;const{left:a}=y.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})),_=t((()=>{const{grid:e}=y.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.endY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value),t})),te=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.originY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=y.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))})),le=t((()=>{var e;const{left:t,right:a}=y.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})),ue=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...u,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:X.value,operationDaysHeight:L.value,xScalevalueHeight:I.value,topList:ae.value,breathingHeight:M.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:N.value,iconsWidth:A.value,originX:$.value,originY:R.value,originYLimit:q.value,endX:O.value,endXLimit:W.value,endY:k.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:y.data.config||{},surplusCell:V.value});function ie(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:re,getXValue:oe,getYValue:se}=i(ue);return l((()=>f.value),(e=>{e&&function(){v(f,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=p(f,ue,S,ne,re,oe,se,y.addRenderItem,w,Y);D.value=l,j.value=u;const{drawScaleValue:r}=c(f,ue,S,e,w,ne,re,oe,se,t,a,i);h(f,ue,r),g(f,ue),m(f,ue,ne);const{select:o}=n(f,ue,S);x.value=o}()}),{immediate:!0}),{propItems:ue,redrawPoints:D,select:x,clickMenu:j}}export{f 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,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 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as i,defaultTextStyle as s}from"../useDraw.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m,surplusCell:S}=u;!function(){const w=[];g&&w.push(new t.Line([g,0,y,0],m));let x=0;v.forEach(((t,l)=>{if(l>0&&(x+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-S[1]-S[3])/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=i({width:d,height:u,...m},{value:c,...s,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,w,x),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=i({width:n-f,height:d,...m},{value:p.xScalevalue.title,...s,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=i({width:c,height:v,...m},{value:u.value,...s,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,w,x);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=i({width:n-f,height:a,...m},{value:t.title,...s,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=i({width:p,height:a,...m},{value:u,...s,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,w,x),w.push(e([f,x+o,a,x+o],m)),w.push(e([n,x,n,x+o],m))}}));const X=w.length>0?new t.Group([...w],{...l,objectCaching:!1}):null;X&&X.sendToBack(),X&&o.value.add(X)}()}export{o as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as i,defaultTextStyle as s}from"../useDraw.js";import"date-fns";import{flatten as o}from"lodash-es";import"../useEvent.js";import"vue";import"./useShadow.js";import"naive-ui";import"@vueuse/core";function u(u,h){const{grid:n,originX:r,endX:a,xCellWidth:c,gridXNumber:p,top:d,xScalevalueHeight:f,iconsWidth:v,topList:g,endXLimit:y,canvasWidth:m,borderStyle:S,surplusCell:w}=h;!function(){const x=[];y&&x.push(new t.Line([y,0,m,0],S));let X=0;g.forEach(((t,l)=>{if(l>0&&(X+=h[`${g[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=d.dayHeight;if(!u)return;l.push(e([r,o+u,a,o+u],S));const h=c*n.subSecondXCell,f=(p-w[1]-w[3])/n.subSecondXCell;for(let n=0;n<f;n++){const a=r+n*h,c=n%2==0?"上午":"下午",p=i({width:h,height:u,...S},{value:c,...s,...t.style||{}},{left:a,top:o});l.push(p),l.push(e([a+h,o,a+h,o+u],S))}}(t,x,X),function(t,l,u){var h;const p=d.xScalevalue.show&&null!=(h=d.dayHeight)?h:0,g=f-p;if(!g)return;l.push(e([v,u+f,a,u+f],S));const y=i({width:r-v,height:f,...S},{value:d.xScalevalue.title,...s,...t.style||{},...t.titleStyle||{}},{left:v,top:u});l.push(y),l.push(e([r,u,r,u+f],S));const m=[];for(let t=0;t<n.mainXCell;t++)m.push(d.xScalevalue.list);o(m).forEach(((o,h)=>{const n=r+h*c,a=i({width:c,height:g,...S},{value:o.value,...s,...t.style||{},...o.style||{}},{left:n,top:u+p});l.push(a),l.push(e([n+c,u+p,n+c,u+p+g],S))}))}(t,x,X);else{if(!h[`${t.key}Height`])return;const o=h[`${g[l].key}Height`];!function(t,l,o){const u=h[`${t.key}Height`],a=i({width:r-v,height:u,...S},{value:t.title,...s,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:v,top:o});l.push(a);const p=c*n.subXCell;t.list.forEach(((h,n)=>{const a=r+n*p,c=i({width:p,height:u,...S},{value:h,...s,...(null==t?void 0:t.style)||{}},{left:a,top:o});l.push(e([a+p,o,a+p,o+u],S)),l.push(c)}))}(t,x,X),x.push(e([v,X+o,a,X+o],S)),x.push(e([r,X,r,X+o],S))}}));const b=x.length>0?new t.Group([...x],{...l,objectCaching:!1}):null;b&&b.sendToBack(),b&&u.value.add(b)}()}export{u as useTop};
@@ -86,7 +86,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
86
86
  }>;
87
87
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
88
88
  scope: import("../../shared/types").AnyObject;
89
- annotation: import("../../shared/types").AnyObject;
89
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
90
+ annotationShortcuts: (string | {
91
+ label: string;
92
+ value: string;
93
+ })[] | undefined;
90
94
  consumer: boolean;
91
95
  uuid: string;
92
96
  lifeCycle: Partial<{
@@ -197,7 +201,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
197
201
  }>;
198
202
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
199
203
  scope: import("../../shared/types").AnyObject;
200
- annotation: import("../../shared/types").AnyObject;
204
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
205
+ annotationShortcuts: (string | {
206
+ label: string;
207
+ value: string;
208
+ })[] | undefined;
201
209
  consumer: boolean;
202
210
  uuid: string;
203
211
  lifeCycle: Partial<{
@@ -7470,7 +7478,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7470
7478
  default: () => {};
7471
7479
  };
7472
7480
  annotation: {
7473
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
7481
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
7482
+ };
7483
+ annotationShortcuts: {
7484
+ type: import("vue").PropType<(string | {
7485
+ label: string;
7486
+ value: string;
7487
+ })[] | undefined>;
7474
7488
  };
7475
7489
  consumer: {
7476
7490
  type: BooleanConstructor;
@@ -7626,7 +7640,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7626
7640
  default: () => {};
7627
7641
  };
7628
7642
  annotation: {
7629
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
7643
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
7644
+ };
7645
+ annotationShortcuts: {
7646
+ type: import("vue").PropType<(string | {
7647
+ label: string;
7648
+ value: string;
7649
+ })[] | undefined>;
7630
7650
  };
7631
7651
  consumer: {
7632
7652
  type: BooleanConstructor;
@@ -7820,7 +7840,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
7820
7840
  }>;
7821
7841
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
7822
7842
  scope: import("../../shared/types").AnyObject;
7823
- annotation: import("../../shared/types").AnyObject;
7843
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
7844
+ annotationShortcuts: (string | {
7845
+ label: string;
7846
+ value: string;
7847
+ })[] | undefined;
7824
7848
  consumer: boolean;
7825
7849
  uuid: string;
7826
7850
  lifeCycle: Partial<{
@@ -8118,7 +8142,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8118
8142
  default: () => {};
8119
8143
  };
8120
8144
  annotation: {
8121
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
8145
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
8146
+ };
8147
+ annotationShortcuts: {
8148
+ type: import("vue").PropType<(string | {
8149
+ label: string;
8150
+ value: string;
8151
+ })[] | undefined>;
8122
8152
  };
8123
8153
  consumer: {
8124
8154
  type: BooleanConstructor;
@@ -8383,7 +8413,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8383
8413
  }>;
8384
8414
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
8385
8415
  scope: import("../../shared/types").AnyObject;
8386
- annotation: import("../../shared/types").AnyObject;
8416
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
8417
+ annotationShortcuts: (string | {
8418
+ label: string;
8419
+ value: string;
8420
+ })[] | undefined;
8387
8421
  consumer: boolean;
8388
8422
  uuid: string;
8389
8423
  lifeCycle: Partial<{
@@ -8485,7 +8519,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
8485
8519
  }>;
8486
8520
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
8487
8521
  scope: import("../../shared/types").AnyObject;
8488
- annotation: import("../../shared/types").AnyObject;
8522
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
8523
+ annotationShortcuts: (string | {
8524
+ label: string;
8525
+ value: string;
8526
+ })[] | undefined;
8489
8527
  consumer: boolean;
8490
8528
  uuid: string;
8491
8529
  lifeCycle: Partial<{
@@ -13853,7 +13891,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
13853
13891
  default: () => {};
13854
13892
  };
13855
13893
  annotation: {
13856
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
13894
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
13895
+ };
13896
+ annotationShortcuts: {
13897
+ type: import("vue").PropType<(string | {
13898
+ label: string;
13899
+ value: string;
13900
+ })[] | undefined>;
13857
13901
  };
13858
13902
  consumer: {
13859
13903
  type: BooleanConstructor;
@@ -14009,7 +14053,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14009
14053
  default: () => {};
14010
14054
  };
14011
14055
  annotation: {
14012
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
14056
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
14057
+ };
14058
+ annotationShortcuts: {
14059
+ type: import("vue").PropType<(string | {
14060
+ label: string;
14061
+ value: string;
14062
+ })[] | undefined>;
14013
14063
  };
14014
14064
  consumer: {
14015
14065
  type: BooleanConstructor;
@@ -14203,7 +14253,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14203
14253
  }>;
14204
14254
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
14205
14255
  scope: import("../../shared/types").AnyObject;
14206
- annotation: import("../../shared/types").AnyObject;
14256
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
14257
+ annotationShortcuts: (string | {
14258
+ label: string;
14259
+ value: string;
14260
+ })[] | undefined;
14207
14261
  consumer: boolean;
14208
14262
  uuid: string;
14209
14263
  lifeCycle: Partial<{
@@ -14501,7 +14555,13 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14501
14555
  default: () => {};
14502
14556
  };
14503
14557
  annotation: {
14504
- type: import("vue").PropType<import("../../shared/types").AnyObject>;
14558
+ type: import("vue").PropType<Record<string, import("../annotation-edit/src/type").AnnotationItem>>;
14559
+ };
14560
+ annotationShortcuts: {
14561
+ type: import("vue").PropType<(string | {
14562
+ label: string;
14563
+ value: string;
14564
+ })[] | undefined>;
14505
14565
  };
14506
14566
  consumer: {
14507
14567
  type: BooleanConstructor;
@@ -14656,7 +14716,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14656
14716
  }>;
14657
14717
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
14658
14718
  scope: import("../../shared/types").AnyObject;
14659
- annotation: import("../../shared/types").AnyObject;
14719
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
14720
+ annotationShortcuts: (string | {
14721
+ label: string;
14722
+ value: string;
14723
+ })[] | undefined;
14660
14724
  consumer: boolean;
14661
14725
  uuid: string;
14662
14726
  lifeCycle: Partial<{
@@ -14929,7 +14993,11 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
14929
14993
  }>;
14930
14994
  components: Record<string, import("vue").Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions> | import("vue").FunctionalComponent<{}, {}>>;
14931
14995
  scope: import("../../shared/types").AnyObject;
14932
- annotation: import("../../shared/types").AnyObject;
14996
+ annotation: Record<string, import("../annotation-edit/src/type").AnnotationItem>;
14997
+ annotationShortcuts: (string | {
14998
+ label: string;
14999
+ value: string;
15000
+ })[] | undefined;
14933
15001
  consumer: boolean;
14934
15002
  uuid: string;
14935
15003
  lifeCycle: Partial<{