cnhis-design-vue 3.2.7-release.0 → 3.2.7-release.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/README.md +87 -87
  2. package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
  3. package/es/components/fabric-chart/src/constants/index.d.ts +3 -1
  4. package/es/components/fabric-chart/src/constants/index.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  6. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.d.ts +8 -3
  7. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  8. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  9. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcess.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  12. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
  18. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/useScaleColumn.d.ts +1 -1
  20. package/es/components/fabric-chart/src/hooks/useScaleColumn.js +1 -1
  21. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  22. package/es/components/form-config/index.d.ts +3 -3
  23. package/es/components/form-config/src/FormConfig.vue.d.ts +3 -3
  24. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -3
  25. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  26. package/es/components/form-render/src/types/fieldItem.d.ts +2 -1
  27. package/es/components/iho-chat/index.d.ts +51 -2
  28. package/es/components/iho-chat/src/Index.vue.d.ts +51 -2
  29. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  30. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  31. package/es/components/iho-chat/src/components/ChatMain.vue.d.ts +29 -2
  32. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  33. package/es/components/iho-chat/src/components/ChatRecord.vue2.js +1 -1
  34. package/es/components/iho-chat/src/components/ContextMenu.d.ts +15 -2
  35. package/es/components/iho-chat/src/components/ContextMenu.js +1 -1
  36. package/es/components/iho-chat/src/hooks/useScrollLoading.d.ts +1 -1
  37. package/es/components/iho-chat/src/hooks/useScrollLoading.js +1 -1
  38. package/es/components/iho-chat/style/index.css +1 -1
  39. package/es/components/index.css +1 -1
  40. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  41. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  42. package/es/components/shortcut-setter/index.d.ts +1 -1
  43. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -1
  44. package/es/env.d.ts +25 -25
  45. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  46. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  47. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  48. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  49. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  50. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  51. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  52. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  53. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  54. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  55. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  56. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  57. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  58. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  59. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  60. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  61. package/es/shared/assets/img/failure.png.js +1 -1
  62. package/es/shared/assets/img/no-permission.png.js +1 -1
  63. package/es/shared/assets/img/nodata.png.js +1 -1
  64. package/es/shared/assets/img/notfound.png.js +1 -1
  65. package/es/shared/assets/img/qr.png.js +1 -1
  66. package/es/shared/assets/img/success.png.js +1 -1
  67. package/es/shared/assets/img/table_style_2.png.js +1 -1
  68. package/es/shared/assets/img/video.png.js +1 -1
  69. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  70. package/es/shared/assets/img/xb_big.png.js +1 -1
  71. package/es/shared/assets/img/xb_small.png.js +1 -1
  72. package/es/shared/package.json.js +1 -1
  73. package/package.json +2 -2
  74. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  75. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  76. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  77. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  78. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  79. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  80. package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md CHANGED
@@ -1,87 +1,87 @@
1
- # 安装
2
-
3
- ```shell
4
- npm i cnhis-design-vue@[版本号]
5
- # or
6
- yarn add cnhis-design-vue@[版本号] #推荐
7
- ```
8
-
9
- ## 1.全局引入
10
-
11
- ```typescript
12
- // main.ts
13
- import { createApp } from 'vue';
14
- import App from './App.vue';
15
- import 'cnhis-design-vue/es/packages/index.css';
16
- import cui from 'cnhis-design-vue';
17
-
18
- const app = createApp(App);
19
- app.use(cui).mount('#app');
20
- ```
21
-
22
- ## 2. 按需引入
23
-
24
- 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
-
26
- ### 2.1 样式处理方式1 (按需引入样式)
27
-
28
- ```shell
29
- # 安装自动导入样式的插件
30
- npm i -d vite-plugin-style-import
31
- ```
32
-
33
- ```typescript
34
- // vite.config.ts
35
- import { defineConfig } from 'vite';
36
- import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
-
38
- export default defineConfig({
39
- plugins: [
40
- // ...otherPlugins
41
- createStyleImportPlugin({
42
- libs: [
43
- {
44
- libraryName: 'cnhis-design-vue',
45
- esModule: true,
46
- ensureStyleFile: true,
47
- resolveStyle: name => {
48
- return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
- }
50
- }
51
- ]
52
- })
53
- ]
54
- });
55
- ```
56
-
57
- ### 2.2 样式处理方式2 (全局引入样式)
58
-
59
- ```typescript
60
- // main.ts
61
- import 'cnhis-design-vue/es/components/index.css';
62
- ```
63
-
64
- ## 3.FAQ
65
-
66
- ### 3.1 项目打包后样式丢失
67
-
68
- 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
-
70
- ```typescript
71
- // vite.config.ts
72
- import { defineConfig } from 'vite';
73
-
74
- export default defineConfig({
75
- build: {
76
- rollupOptions: {
77
- // ..otherOptions
78
- output: {
79
- dir: './dist',
80
- manualChunks: {
81
- 'cnhis-vendor': ['cnhis-design-vue']
82
- }
83
- }
84
- }
85
- }
86
- });
87
- ```
1
+ # 安装
2
+
3
+ ```shell
4
+ npm i cnhis-design-vue@[版本号]
5
+ # or
6
+ yarn add cnhis-design-vue@[版本号] #推荐
7
+ ```
8
+
9
+ ## 1.全局引入
10
+
11
+ ```typescript
12
+ // main.ts
13
+ import { createApp } from 'vue';
14
+ import App from './App.vue';
15
+ import 'cnhis-design-vue/es/packages/index.css';
16
+ import cui from 'cnhis-design-vue';
17
+
18
+ const app = createApp(App);
19
+ app.use(cui).mount('#app');
20
+ ```
21
+
22
+ ## 2. 按需引入
23
+
24
+ 组件现在支持了自动按需引入, 但是样式文件需要额外的处理
25
+
26
+ ### 2.1 样式处理方式1 (按需引入样式)
27
+
28
+ ```shell
29
+ # 安装自动导入样式的插件
30
+ npm i -d vite-plugin-style-import
31
+ ```
32
+
33
+ ```typescript
34
+ // vite.config.ts
35
+ import { defineConfig } from 'vite';
36
+ import { createStyleImportPlugin } from 'vite-plugin-style-import';
37
+
38
+ export default defineConfig({
39
+ plugins: [
40
+ // ...otherPlugins
41
+ createStyleImportPlugin({
42
+ libs: [
43
+ {
44
+ libraryName: 'cnhis-design-vue',
45
+ esModule: true,
46
+ ensureStyleFile: true,
47
+ resolveStyle: name => {
48
+ return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
49
+ }
50
+ }
51
+ ]
52
+ })
53
+ ]
54
+ });
55
+ ```
56
+
57
+ ### 2.2 样式处理方式2 (全局引入样式)
58
+
59
+ ```typescript
60
+ // main.ts
61
+ import 'cnhis-design-vue/es/components/index.css';
62
+ ```
63
+
64
+ ## 3.FAQ
65
+
66
+ ### 3.1 项目打包后样式丢失
67
+
68
+ 处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
69
+
70
+ ```typescript
71
+ // vite.config.ts
72
+ import { defineConfig } from 'vite';
73
+
74
+ export default defineConfig({
75
+ build: {
76
+ rollupOptions: {
77
+ // ..otherOptions
78
+ output: {
79
+ dir: './dist',
80
+ manualChunks: {
81
+ 'cnhis-vendor': ['cnhis-design-vue']
82
+ }
83
+ }
84
+ }
85
+ }
86
+ });
87
+ ```
@@ -175,6 +175,9 @@ declare const _default: import("vue").DefineComponent<{
175
175
  modelValue: unknown[];
176
176
  componentData: Record<string, any>;
177
177
  } & {
178
+ /**
179
+ * 改变弹窗大小
180
+ */
178
181
  itemKey?: string | Function | undefined;
179
182
  }>, {
180
183
  move: Function;
@@ -46,7 +46,9 @@ export declare const OVERLAP: {
46
46
  };
47
47
  humai: {
48
48
  radius: number;
49
- fill: string;
49
+ radiusCircle: number;
50
+ stroke: string;
51
+ fillCircle: string;
50
52
  };
51
53
  ermai: {
52
54
  stroke: string;
@@ -1 +1 @@
1
- const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:r},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};var d=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(d||{});export{d as ECG,l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
1
+ const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,radiusCircle:3,stroke:a,fillCircle:r},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};var d=(e=>(e[e.SMALLCELLNUMBER=5]="SMALLCELLNUMBER",e[e.MAXLINENUMBER=13]="MAXLINENUMBER",e[e.DEFAULTMAINXCELLVALUE=.2]="DEFAULTMAINXCELLVALUE",e))(d||{});export{d as ECG,l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as m,getTime as v,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k,last as w}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as x}from"date-fns";import"naive-ui";import"@vueuse/core";function b(b,j,P,C,E){const{computedX:S,computedY:G,getXValue:T,getYValue:L}=c(j),{getEqualXTypes:Y,handleAddPrevent:M,isGridLimit:A,setPrevAndNextPoint:X,getPointEventProps:I}=h(b,P,j),{xAxis:H,grid:W,originX:N,originY:O,xCellWidth:V,endY:D,startTime:R,leftAddAreaWidth:$,leftScales:B,rightScales:F,yCellHeight:q,endX:z,scaleValues:J,canvasWidth:K,borderStyle:Q,rightAddAreaWidth:U,event:Z,originYCervix:_,other:tt,canvasHeight:et}=j,ot=k(J),nt=new Set;function it(){ot.filter((t=>t.show)).forEach(((t,s)=>{var l;const a=[],u=[],c=[];null==(l=t.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:y,type:k="circle",childbirthStyle:w={}}=t,x=t.data[f+1],j=ut(x,t);if(l&&j&&!d.breakpoint)h=e([...l,...j],{...m});else if(l&&!j&&!d.breakpoint){const o=ut(x,t);h=o?e([...l,...o],{...m}):null}let E,S;if(d.childbirth){const t=l[1]+q;E=o([l[0],l[1],t],w),c.push(E),S=n([l[0]+V/2,t-q/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(S)}const G=u[f-1],Y={origin:{data:d,title:v,key:y||"",dataIndex:s,index:f},leftLine:G,rightLine:h,arrowGroup:E,arrowGroupText:S,...g,...I()};l&&(G||(Y.leftLine=null),p=r(k,{left:l[0],top:l[1],...Y}));u.push(h),p&&(!function(t){Z.hovered&&(t.on("mouseover",(()=>{at(t,"hover")})),t.on("mouseout",(()=>{C.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{lt(t),function(t){var e,o,n,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(o=t.rightLine)||o.setCoords().set({x1:t.left,y1:t.top}),null==(n=t.arrowGroup)||n.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+V/2,top:t.top+q/2})}(t),Z.hovered&&at(t)})),t.on("mouseup",(e=>{if(C.show=!1,1===e.button){const{key:e}=t.origin,o={...t.origin,data:{...t.origin.data,time:T(t.left),value:L(e,t.top)}};b.value.discardActiveObject(),P("change",o),rt(o,"change")}}))}(p),a.push(p),nt.add(p))}(ut(l,t),l,d)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));X(t),Promise.all(c).then((o=>{b.value.add(...e,...t,...o),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function rt(t,e="add"){const{dataIndex:o,data:n,index:i,key:r}=t,s=ot.find((t=>t.key===r));switch(e){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const t=g(n.time,s.data);s.data.splice(t,0,n);break}}st()}function st(){var t;nt.size&&(null==(t=b.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...nt]))),nt.clear(),it()}function lt(t){const e=t.prevPoint?t.prevPoint.left:N,o=t.nextPoint?t.nextPoint.left:z;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<_&&t.set("top",_),t.top<O&&t.set("top",O),t.top>D&&t.set("top",D),t.left<e&&t.set("left",e),t.left>o&&t.set("left",o)}function at(t,e="moving"){const{title:o,key:n,data:i}=t.origin;C.point={x:t.left,y:t.top},C.list=[`${o} ${"hover"===e?i.value:L(n,t.top)}`,`时间 ${T(t.left).slice(-5)}`],C.show=!0}function ut(t,e){if(m(t)&&function(t){const e=R+864e5,o=v(t);return o>=R&&o<=e}(t.time)){const o=S(t.time),n=G(e.key,e.range,t.value);return[o,n<O?O:n>D?D:n]}}function ct(t,e){return t+1>e[1]?e[0]:t+1}return u(b,j),function(){const e=new t.Rect({...Q,width:K-$-U-1,height:D-1,left:$,top:0,fill:"transparent"});b.value.add(e)}(),function(){function e(e,o="left"){let r="left"===o?$:z;e.forEach(((e,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=e,j=[],P=[],C=r+c/2,E=y(s,u),S=E.length,{lineXMain:G,lineXSub:T,textLeft:L}=d(v,r,c);E.forEach(((t,o)=>{const n=D-o*q*k,i=0===o?D-8:o!==E.length-1||O||_&&"FHR"!==m?n:O+8;!w||(0===o||o===S-1)&&!x||j.push(f(String(t),e,L,i)),P.push(...p(e,o,G,T,n,q,O,S,1))}));const Y=new t.Rect({...a,strokeWidth:.5,width:c,height:D,left:C,top:D/2}),M=n([C,O>0?O-q/2:q/2],{value:String(h),...i,...g}),A=new t.Group([...P,...j,Y,...M?[M]:[]],{objectCaching:!1,...l});b.value.add(A),A.sendToBack(),r+=c}))}e(B),e(F,"right")}(),function(){const{show:e,startTime:o,range:r=[0,23],position:s="top",style:a}=H.time,{show:u,range:c=[0,23],position:d,style:f}=H.processTime;if(e||u){const p=[],h=[],g=[],m=[],v=N+V/2,y=q/2;for(let t=0;t<W.mainXCell;t++){if(e){const e=0===t?+o.slice(11,13):ct(w(p),r);p.push(e);const l="top"===s?O-y:D+y;g.push(n([v+t*V,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:w(h)+1;h.push(e);const o="top"===d?y:et-y;m.push(n([v+t*V,o],{value:String(e),...i,...f||{}}))}}const k=new t.Group([...g,...m],{objectCaching:!1,...l});b.value.add(k),b.value.sendToBack(k)}}(),function(){var t;const o=Object.values(tt),n=[],i={},r=ot.find((t=>"cervix"===t.key&&t.show)),s=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function l(t,e){const{key:o,range:n}=r||{},i=G(o,n,10),s=[0,e],l=[-e/t,0],a=[(D-i-e)/t,D-i],u=[z-N,t*(z-N)+e];let c=[],d=[];function f([o,n]){return Math.abs(n-t*o-e)<=1}function p([t,e]){const[o,n]=[...h([t,e])];return o>=N&&o<=z&&n>=i&&n<=D}function h([t,e]){return[N+t,D-e]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((t=>{if(!t.show)return;const{key:o}=t;switch(o){case"fetalPresentation":{const{range:i,show:r}=ot.find((t=>t.key===o));if(r){const r=G(o,i,0);n.push(e([N,r,z,r],{...t}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:x(new Date(v(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-N,D-G(o,a,s.value)],[p,h]=[S(c.time)-N,D-G(o,a,c.value)],g=(h-f)/(p-d),m=f-d*g,y=l(g,m);y.length>0&&(n.push(e(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(x(new Date(v(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(e(u,{...t}))}}})),b.value.add(...n)}(),it(),function(){function t(t,e){const o=ot.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:o,key:t.key},pointer:e}}j.event.evented&&b.value.on("mouse:up",(e=>{if(3===e.button){const{x:o=0,y:n=0}=e.pointer||{};o>=N&&o<=z&&n>=O&&n<=D&&(E.point={x:o,y:n},E.show=!0,e.target?(E.target=e.target,E.list=["删除节点"],[...nt].forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&E.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(E.target=null,E.list=["新增节点"],ot.filter((t=>t.show)).forEach((i=>{if(!Y([...nt],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<_)return;E.list.push(t(i,e.pointer))}})),1===E.list.length&&(E.show=!1,M("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=K-U/2;function e(t,e){if(!t.length)return;let n=O;const i=[];t.forEach((t=>{const o=t.title.split("").join("\n"),r=J.findIndex((e=>e.key===t.key)),{text:l,icon:a}=s(o,t,{text:{originY:"top",left:e,top:n},icon:{left:e,topY:n,originY:"top",origin:{type:t.type,dataIndex:r},...j.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),A(u)?(lt(u),at(u)):C.show=!1})),u.on("mouseup:before",(t=>{if(C.show=!1,0===t.e.button&&A(u))if(Y([...nt],u.left,"key").includes(u.origin.key))M("repeat");else{const t={data:{time:T(u.left),value:L(u.origin.key,u.top)},...u.origin};P("add",t),rt(t)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(u)})),i.push(l,a)})),o(i),b.value.add(...i)}function o(t){const e=w(t),o=(D-O)/2,n=(e.height+e.top-O)/2;t.forEach((t=>{const e=t.top+o-n;t.set({top:e,originTop:e})}))}e(B,$/2),e(F,t)}(),{clickMenu:function({item:t,target:e}){const o={...t.origin};"remove"===t.mode?(P("remove",o),rt(o,"remove")):(Object.assign(o,{data:{time:T(t.pointer.x),value:L(t.origin.key,t.pointer.y)}}),P("add",o),rt(o))},redrawPoints:st}}export{b as useBirthProcess};
@@ -3,8 +3,13 @@ import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
5
  export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
7
+ redrawPoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
8
+ clickMenu?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
9
+ updatePolyline?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
10
+ useMeasureRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
11
+ useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
+ useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
+ useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
6
14
  propItems: any;
7
- redrawPoints: Ref<any>;
8
- select: Ref<any>;
9
- clickMenu: Ref<any>;
10
15
  };
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import{useCanvasEvent as i}from"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as s}from"./useBirthProcess.js";function d(d,n,o,v,c,h){const m=e(),f=e(),p=e(),g=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),x=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return(null==(e=x.value)?void 0:e.length)?30:0})),y=a((()=>{var e;return 30+(null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),V=a((()=>{var e;const{width:a}=n.data,t=null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-w.value-t})),b=a((()=>n.data.grid.mainXCell)),j=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),A=a((()=>(V.value-y.value)/b.value)),C=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),k=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return C.value*a})),Y=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!k.value)return k.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*C.value})),S=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-C.value*t})),H=a((()=>r(n.data.xAxis.time.startTime))),P=a((()=>36e5/A.value)),X=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),F=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return C.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return C.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=t({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:y.value,endX:V.value,originY:k.value,endY:S.value,xCellWidth:A.value,yCellHeight:C.value,gridXNumber:b.value,gridYNumber:j.value,xAxis:n.data.xAxis,leftScales:g.value,rightScales:x.value,leftAddAreaWidth:30,rightAddAreaWidth:w.value,startTime:H.value,timeXCell:P.value,cervixYCell:X.value,FHRYCell:F.value,fetalPresentationYCell:R.value,scaleValues:n.data.scaleValues,event:W.value,originYCervix:Y.value});return l((()=>d.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=s(d,O,o,c,h);f.value=a,p.value=e;const{select:t}=i(d,O,o);m.value=t}()}),{immediate:!0}),{propItems:O,redrawPoints:f,select:m,clickMenu:p}}export{d as useBirthProcessChart};
1
+ import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as r}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function s(s,n,d,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>n.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),p=a((()=>n.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),f=a((()=>{var e;return(null==(e=p.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),x=a((()=>{var e;const{width:a}=n.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),w=a((()=>n.data.grid.mainXCell)),y=a((()=>{const e=n.data.grid.mainYCell||14;return n.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(x.value-g.value)/w.value)),b=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(y.value+t)})),j=a((()=>{const{xAxis:e}=n.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return b.value*a})),A=a((()=>{var e;const{scaleValues:a}=n.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!j.value)return j.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return k.value-l*u*b.value})),k=a((()=>{const{xAxis:e,height:a}=n.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-b.value*t})),C=a((()=>r(n.data.xAxis.time.startTime))),Y=a((()=>36e5/V.value)),S=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"cervix"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),H=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"FHR"===e.key));return b.value/((null==a?void 0:a.spaceValue)||10)})),P=a((()=>{const{scaleValues:e}=n.data,a=e.find((e=>"fetalPresentation"===e.key));return b.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=n.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),F=e({canvasWidth:n.data.width,canvasHeight:n.data.height,borderStyle:{...u,...n.data.borderStyle||{}},selectionStyle:n.data.selectionStyle||{},grid:n.data.grid,other:n.data.other,originX:g.value,endX:x.value,originY:j.value,endY:k.value,xCellWidth:V.value,yCellHeight:b.value,gridXNumber:w.value,gridYNumber:y.value,xAxis:n.data.xAxis,leftScales:m.value,rightScales:p.value,leftAddAreaWidth:30,rightAddAreaWidth:f.value,startTime:C.value,timeXCell:Y.value,cervixYCell:S.value,FHRYCell:H.value,fetalPresentationYCell:P.value,scaleValues:n.data.scaleValues,event:X.value,originYCervix:A.value});return t((()=>s.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(s,F,d,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{s as useBirthProcessChart};
@@ -4,15 +4,18 @@ import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
5
  import { ECG } from '../../../../../components/fabric-chart/src/constants';
6
6
  export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
7
- propItems: any;
8
- updatePolyline: Ref<any>;
9
- useMeasureRuler: Ref<any>;
10
- useCaliper: Ref<any>;
11
- useCaliperRuler: Ref<any>;
12
- useRectRuler: Ref<any>;
13
7
  getGridInfo: () => {
14
8
  cellWidth: number;
15
9
  cellHeight: number;
16
10
  smallCellNumber: ECG;
17
11
  };
12
+ select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
+ redrawPoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
14
+ clickMenu?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
15
+ updatePolyline?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
16
+ useMeasureRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
17
+ useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
18
+ useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
19
+ useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
20
+ propItems: any;
18
21
  };
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,unref as u,watch as r}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{cloneDeep as o,isNumber as d,last as v}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as s}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as c}from"./useMeasureInstrument.js";function g(g,h,f,p,N,b){const M=e(),y=e(),L=e(),x=e(),C=e(),R=a((()=>h.data.width)),S=a((()=>h.data.height)),w=a((()=>{const{dataList:e=[],config:a={}}=h.data,t=o(e),u=t.find((e=>a.lastDataKey&&e.key===a.lastDataKey));return u?[...t,u]:t})),E=a((()=>(R.value-0)/Y.value)),X=a((()=>(S.value-0)/j.value)),Y=a((()=>{var e,a,t;const{config:u,grid:r}=h.data;if(d(r.gridXNumber))return r.gridXNumber;const l=(null!=(t=null==(a=null==(e=v(w.value))?void 0:e.data)?void 0:a.length)?t:0)/u.hz;return Math.ceil(l/u.mainXCellValue)})),j=a((()=>{const{config:e,grid:a}=h.data;if(d(a.gridYNumber))return a.gridYNumber;const t=w.value.length;return Math.ceil(I.value*t*2/e.mainYCellValue)})),I=a((()=>{var e;const{config:a}=h.data,t=null==(e=v(w.value))?void 0:e.data,u=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),U=a((()=>{var e;return(null==(e=h.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),A=a((()=>{const{mode:e="2-6"}=h.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),B=a((()=>{const{rowNumber:e}=A.value,a=w.value.length;return Math.round(j.value/(e+(a===s.MAXLINENUMBER?1:0)))})),H=a((()=>{const{width:e,config:a,grid:t}=h.data,{columnNumber:u,rowNumber:r}=A.value,l=e/u,i=w.value.length,n=Math.ceil(B.value/2),o=function(){const{valueUnit:e,mainYCellValue:t}=a,r=w.value[0].data,l=o(Math.max(...r));if(2!==u)return l;const i=w.value[6].data,n=o(Math.max(...i));return Math.max(l,n);function o(a){return("uv"===e?.001*a:"v"===e?1e3*a:a)/t*X.value}}(),d=X.value*n,v=1===u||d<o?X.value*Math.ceil(o/X.value):d,m=4===u?0:E.value;return w.value.map(((e,a)=>{const t=s.MAXLINENUMBER===i&&a===i-1?r:a%r;return{...e,origin:{x:(s.MAXLINENUMBER===i&&a===i-1?0:Math.floor(a/r))*l+m,y:t*(X.value*B.value)+v,rowIdx:t}}}))})),V=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=h.data)?void 0:e.config)||{};return a?X.value*a:t?X.value/t:X.value})),D=t({canvasWidth:h.data.width,canvasHeight:h.data.height,borderStyle:{...l,...h.data.borderStyle},lineStyle:{...i,...h.data.lineStyle},titleStyle:{...n,...h.data.titleStyle},measureLineStyle:{...i,...h.data.measureLineStyle},measureTextStyle:{...n,...h.data.measureTextStyle},grid:h.data.grid,originX:0,endX:R.value,originY:0,endY:S.value,xCellWidth:E.value,yCellHeight:X.value,gridXNumber:Y.value,gridYNumber:j.value,event:U.value,dataList:H.value,columnNumber:u(A).columnNumber,rowNumber:u(A).rowNumber,config:h.data.config,calibrationLineHeight:u(V)});return r((()=>g.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:u,useRectRuler:r}=c(g,D),{updatePolyline:l}=m(g,D,a);y.value=e,L.value=t,x.value=u,M.value=l,C.value=r}()}),{immediate:!0}),{propItems:D,updatePolyline:M,useMeasureRuler:y,useCaliper:L,useCaliperRuler:x,useRectRuler:C,getGridInfo:function(){return{cellWidth:E.value,cellHeight:X.value,smallCellNumber:s.SMALLCELLNUMBER}}}}export{g as useElectrocardiogramChart};
1
+ import{reactive as e,computed as a,unref as t,watch as u,toRefs as l}from"vue";import{defaultBorderStyle as r,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{cloneDeep as o,isNumber as d,last as s}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as v}from"../../constants/index.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as c}from"./useMeasureInstrument.js";function g(g,h,p,f,N,b){const M=e({updatePolyline:null,useMeasureRuler:null,useCaliper:null,useCaliperRuler:null,useRectRuler:null}),y=a((()=>h.data.width)),R=a((()=>h.data.height)),C=a((()=>{const{dataList:e=[],config:a={}}=h.data,t=o(e),u=t.find((e=>a.lastDataKey&&e.key===a.lastDataKey));return u?[...t,u]:t})),L=a((()=>(y.value-0)/S.value)),x=a((()=>(R.value-0)/w.value)),S=a((()=>{var e,a,t;const{config:u,grid:l}=h.data;if(d(l.gridXNumber))return l.gridXNumber;const r=(null!=(t=null==(a=null==(e=s(C.value))?void 0:e.data)?void 0:a.length)?t:0)/u.hz;return Math.ceil(r/u.mainXCellValue)})),w=a((()=>{const{config:e,grid:a}=h.data;if(d(a.gridYNumber))return a.gridYNumber;const t=C.value.length;return Math.ceil(E.value*t*2/e.mainYCellValue)})),E=a((()=>{var e;const{config:a}=h.data,t=null==(e=s(C.value))?void 0:e.data,u=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),X=a((()=>{var e;return(null==(e=h.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),Y=a((()=>{const{mode:e="2-6"}=h.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),j=a((()=>{const{rowNumber:e}=Y.value,a=C.value.length;return Math.round(w.value/(e+(a===v.MAXLINENUMBER?1:0)))})),I=a((()=>{const{width:e,config:a,grid:t}=h.data,{columnNumber:u,rowNumber:l}=Y.value,r=e/u,i=C.value.length,n=Math.ceil(j.value/2),o=function(){const{valueUnit:e,mainYCellValue:t}=a,l=C.value[0].data,r=o(Math.max(...l));if(2!==u)return r;const i=C.value[6].data,n=o(Math.max(...i));return Math.max(r,n);function o(a){return("uv"===e?.001*a:"v"===e?1e3*a:a)/t*x.value}}(),d=x.value*n,s=1===u||d<o?x.value*Math.ceil(o/x.value):d,m=4===u?0:L.value;return C.value.map(((e,a)=>{const t=v.MAXLINENUMBER===i&&a===i-1?l:a%l;return{...e,origin:{x:(v.MAXLINENUMBER===i&&a===i-1?0:Math.floor(a/l))*r+m,y:t*(x.value*j.value)+s,rowIdx:t}}}))})),U=a((()=>{var e;const{calibrationLineGridYNumber:a,mainYCellValue:t}=(null==(e=h.data)?void 0:e.config)||{};return a?x.value*a:t?x.value/t:x.value})),A=e({canvasWidth:h.data.width,canvasHeight:h.data.height,borderStyle:{...r,...h.data.borderStyle},lineStyle:{...i,...h.data.lineStyle},titleStyle:{...n,...h.data.titleStyle},measureLineStyle:{...i,...h.data.measureLineStyle},measureTextStyle:{...n,...h.data.measureTextStyle},grid:h.data.grid,originX:0,endX:y.value,originY:0,endY:R.value,xCellWidth:L.value,yCellHeight:x.value,gridXNumber:S.value,gridYNumber:w.value,event:X.value,dataList:I.value,columnNumber:t(Y).columnNumber,rowNumber:t(Y).rowNumber,config:h.data.config,calibrationLineHeight:t(U)});return u((()=>g.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:u,useRectRuler:l}=c(g,A),{updatePolyline:r}=m(g,A,a);M.useMeasureRuler=e,M.useCaliper=t,M.useCaliperRuler=u,M.updatePolyline=r,M.useRectRuler=l}()}),{immediate:!0}),{propItems:A,...l(M),getGridInfo:function(){return{cellWidth:L.value,cellHeight:x.value,smallCellNumber:v.SMALLCELLNUMBER}}}}export{g as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import{useBirthProcessCumputedPoint as l}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import{isEffectiveNode as d,getTime as h,getScaleNumberList as f}from"../../utils/index.js";import{cloneDeep as p,last as m}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function v(v,g,x,y,b){const{computedX:w,computedY:S,getXValue:E,getYValue:L}=l(g),{getEqualXTypes:j,handleAddPrevent:k,isGridLimit:X,setPrevAndNextPoint:P,getPointEventProps:A}=c(v,x,g),{xAxis:C,grid:T,originX:G,originY:Y,xCellWidth:N,endY:V,startTime:H,leftScales:M,rightScales:$,yCellHeight:B,endX:W,scaleValues:q,canvasWidth:z,borderStyle:D,event:F,other:I,timeXAxisHeight:R,canvasHeight:J,extraTimeXAxisList:K}=g,O=p(q),Q=new Set;function U(){O.filter((t=>t.show)).forEach(((t,r)=>{var l;const s=[],u=[],a=[];null==(l=t.data)||l.forEach(((l,c)=>{!function(l,c,d){if(!l&&!c.childbirth||!(null==c?void 0:c.time)||!tt(c.time))return;let h,f;const{pointAttr:v={},lineAttr:g={},title:x="",key:b,type:S="circle",childbirthStyle:j={}}=t,k=p(t.data[d+1]);k&&!k.value&&k.childbirth&&(k.value=c.value);const X=_(k,t);l&&X&&!c.breakpoint&&(f=Z([...l,...X],g));if(c.childbirth){const t=l?l[0]:w(c.time),n=l?l[1]:m(s).top,o=n+B/2,r=Z([t,n,t,o],g);a.push(r);const u=e([t,o],{value:String(c.childbirth),...i,...j,backgroundColor:"#fff"});a.push(u)}const P=u[d-1],C={origin:{data:c,title:x,key:b||"",dataIndex:r,index:d},leftLine:P,rightLine:f,...v,...A(),...n};l&&(P||(C.leftLine=null),h=o(S,{left:l[0],top:l[1],...C}));f&&u.push(f),h&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{!function(t,e="moving"){const{title:i,key:n,data:o}=t.origin;y.point={x:t.left,y:t.top},y.list=[`${i} ${"hover"===e?o.value:L(n,t.top)}`,`时间 ${E(t.left).slice(-5)}`],y.show=!0}(t,"hover")})),t.on("mouseout",(()=>{y.show=!1})))}(h),s.push(h),Q.add(h))}(_(l,t),l,c)})),Promise.all(s).then((t=>{P(t),Promise.all(a).then((e=>{v.value.add(...u,...t,...e),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z([e,i,o,r],l){return new t.Polyline([{x:e,y:i},{x:o,y:i},{x:o,y:r}],{...l,fill:"transparent",...n})}function _(t,e){if(d(t)&&tt(t.time)){const i=w(t.time),n=S(e.key,e.range,t.value);return[i,n<Y?Y:n>V?V:n]}}function tt(t){var e,i;const n=(null==(i=null==(e=null==C?void 0:C.time)?void 0:e.range)?void 0:i[1])||20,o=H+60*n*60*1e3,r=h(t);return r>=H&&r<=o}return r(v,g),function(){const e=new t.Rect({...D,width:W-G,height:V-Y,left:G,top:Y,fill:"transparent"});v.value.add(e)}(),function(){function o(o,r="left"){const l=10;let c="left"===r?0:W;o.forEach(((o,r)=>{const{range:d,spaceValue:h,width:p,title:m,titleStyle:g,unit:x,key:y,position:b="center",spaceGridNumber:w=1,showNumber:S,showMaxMinNumber:E}=o,L=[],j=[],k=f(d,h),X=k.length,{lineXMain:P,lineXSub:A,textLeft:C}=s(b,c,p);k.forEach(((t,e)=>{const i=V-e*B*w;!S||(0===e||e===X-1)&&!E||L.push(u(String(t),o,C,i)),j.push(...a(o,e,P,A,i,B,Y,X,1))}));const T=e([c+l,Y+(V-Y)/2],{value:String(m+"("+x+")"),...i,originX:"center",angle:-90,...g}),G=new t.Group([...j,...L,...T?[T]:[]],{objectCaching:!1,...n});v.value.add(G),G.sendToBack(),c+=p}))}o(M),o($,"right")}(),function(){const{show:o,range:r=[0,20],position:l="top",style:s,spaceGridNumber:u=2,spaceValue:a=2}=C.time;if(o){const o=[],c=B/2;f(r,a).forEach(((t,n)=>{const r="top"===l?Y-c:V+R+c;o.push(e([G+n*N*u,r],{value:0===n?"Admission":String(t),...i,...s}))}));const d=new t.Group(o,{objectCaching:!1,...n});v.value.add(d),v.value.sendToBack(d)}!function(){if((null==K?void 0:K.length)>0){const t=[];K.forEach((n=>{const o=w(n),r=V+R;t.push(e([o,r],{value:String(n.slice(11,16)),...i,originY:"bottom"}))})),v.value.add(...t)}}()}(),function(){const{alertLineList:t=[],alertLineTitle:n="入院时宫颈扩张不同情况"}=I;if(t.length<1)return;const o=e([W,0],{value:n,...i,originX:"right",originY:"top"});v.value.add(o),t.forEach((t=>{const{style:i,data:n=[]}=t;if(n.length<1)return;const o=[],r=O.find((t=>"cervix"===t.key));n.map((t=>({...t,time:H+60*t.time*60*1e3}))).forEach(((t,n,l)=>{const s=_(t,r),u=_(l[n+1],r);s&&!u&&o.push(e([s[0],Y-10],{value:l[0].value+(r.unit||"cm"),fill:i.stroke||"#000"})),s&&u&&o.push(Z([...s,...u],i))})),v.value.add(...o)}))}(),U(),{redrawPoints:function(){var t;Q.size&&(null==(t=v.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine)})),e}([...Q]))),Q.clear(),U()}}}export{v as useNewBirthProcess};
@@ -5,6 +5,4 @@ import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabri
5
5
  export declare function useNewBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
6
  propItems: any;
7
7
  redrawPoints: Ref<any>;
8
- select: Ref<any>;
9
- clickMenu: Ref<any>;
10
8
  };
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=e(),f=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),b=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=a((()=>{var e;return null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),j=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=b.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),A=a((()=>v.data.grid.mainXCell||20)),M=a((()=>v.data.grid.mainYCell||8)),S=a((()=>(j.value-y.value)/A.value)),V=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-H.value)/(M.value+i+(r?1:0))})),X=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return V.value*(l||i?1:0)})),C=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-V.value*t-H.value})),H=a((()=>{const e=w.value.concat(b.value);return(null==e?void 0:e.length)>0?20:0})),L=a((()=>u(v.data.xAxis.time.startTime))),Y=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(S.value*a)})),N=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=w.value.concat(b.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=Y.value*S.value,v=s(1,A.value+1).reduce(((e,a,t)=>e.concat(L.value+a*d)),[L.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),I=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return V.value/((null==a?void 0:a.spaceValue)||1)})),O=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),P=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:y.value,endX:j.value,originY:X.value,endY:C.value,xCellWidth:S.value,yCellHeight:V.value,gridXNumber:A.value,gridYNumber:M.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:b.value,startTime:L.value,timeXCell:Y.value,cervixYCell:I.value,scaleValues:v.data.scaleValues,timeXAxisHeight:H.value,extraTimeXAxisList:N.value,event:O.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,P,c,h);g.value=e}()}),{immediate:!0}),{propItems:P,redrawPoints:g,select:p,clickMenu:f}}export{d as useNewBirthProcessChart};
1
+ import{ref as e,computed as a,reactive as t,watch as l}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as r}from"date-fns";import{getTime as u}from"../../utils/index.js";import{range as s,last as n}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useNewBirthProcess as o}from"./useNewBirthProcess.js";function d(d,v,c,m,h,x){const p=e(),g=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),f=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),w=a((()=>{var e;return null==(e=g.value)?void 0:e.reduce(((e,a)=>e+=a.width),0)})),b=a((()=>{var e;const{width:a}=v.data;return a-((null==(e=f.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))||15)})),y=a((()=>v.data.grid.mainXCell||20)),j=a((()=>v.data.grid.mainYCell||8)),A=a((()=>(b.value-w.value)/y.value)),M=a((()=>{var e;const{xAxis:a,height:t,other:l}=v.data,i=Object.values(a).reduce(((e,a)=>(a.show&&e++,e)),0),r=(null!=(e=null==l?void 0:l.alertLineList.length)?e:0)>0;return(t-X.value)/(j.value+i+(r?1:0))})),S=a((()=>{var e;const{xAxis:a,other:t}=v.data,l=Object.values(a).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0),i=(null!=(e=null==t?void 0:t.alertLineList.length)?e:0)>0;return M.value*(l||i?1:0)})),V=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-M.value*t-X.value})),X=a((()=>{const e=g.value.concat(f.value);return(null==e?void 0:e.length)>0?20:0})),C=a((()=>u(v.data.xAxis.time.startTime))),H=a((()=>{const{spaceValue:e,spaceGridNumber:a}=v.data.xAxis.time||{};return 60*e*60*1e3/(A.value*a)})),L=a((()=>{var e,a,t;const l=null==(t=null==(a=null==(e=g.value.concat(f.value))?void 0:e[0])?void 0:a.data)?void 0:t.map((e=>u(e.time))),i=Math.min(...l);let o=Math.min(Math.max(...l));const d=H.value*A.value,v=s(1,y.value+1).reduce(((e,a,t)=>e.concat(C.value+a*d)),[C.value]);o=Math.min(o,n(v));const c=v.findIndex((e=>Math.abs(e-i)<d)),m=v.findIndex((e=>Math.abs(e-o)<d))+1;return v.filter(((e,a)=>a>=c&&a<=m)).map((e=>r(new Date(e),"yyyy-MM-dd HH:mm:ss")))})),Y=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return M.value/((null==a?void 0:a.spaceValue)||1)})),N=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),I=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...i,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:w.value,endX:b.value,originY:S.value,endY:V.value,xCellWidth:A.value,yCellHeight:M.value,gridXNumber:y.value,gridYNumber:j.value,xAxis:v.data.xAxis,leftScales:g.value,rightScales:f.value,startTime:C.value,timeXCell:H.value,cervixYCell:Y.value,scaleValues:v.data.scaleValues,timeXAxisHeight:X.value,extraTimeXAxisList:L.value,event:N.value});return l((()=>d.value),(e=>{e&&function(){const{redrawPoints:e}=o(d,I,c,h);p.value=e}()}),{immediate:!0}),{propItems:I,redrawPoints:p}}export{d as useNewBirthProcessChart};
@@ -3,8 +3,13 @@ import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
5
5
  export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps, isPopupTipRender: boolean): {
6
+ select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
7
+ redrawPoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
8
+ clickMenu?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
9
+ updatePolyline?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
10
+ useMeasureRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
11
+ useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
+ useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
+ useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
6
14
  propItems: any;
7
- redrawPoints: Ref<any>;
8
- select: Ref<any>;
9
- clickMenu: Ref<any>;
10
15
  };
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as l,watch as n}from"vue";import{useDialog as u}from"naive-ui";import{defaultBorderStyle as s}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as d}from"date-fns";import{getChildrenSize as c}from"../../utils/index.js";import{cloneDeep as p,range as m,flatten as v}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as h}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as f}from"./useTop.js";import{useLeft as g}from"./useLeft.js";import{useCenter as w}from"./useCenter.js";import{useOther as y}from"./useOther.js";function b(b,x,j,C,Y,H,S){var T;const D=u(),A=e(),M=e(),X=e(),k=e();let G=null;const N=c((null==(T=x.data.top)?void 0:T.treeData)||[]),P=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),V=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),L=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),O=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),E=t((()=>{const{show:e=!0,tree:t={}}=x.data.top;if(!e)return 0;const{rowNumber:a=N}=t;return N<a?a:N})),W=t((()=>x.data.top.tree.cellHeight)),I=t((()=>W.value*E.value)),F=t((()=>ue(le("drug")||"top"))),q=t((()=>F.value+I.value)),z=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||d(new Date,"yyyy-MM-dd HH:mm:ss"))})),B=t((()=>{const e=p(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=m(L.value/t+1).map((r=>0===r?e.startTime:d(new Date(z.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:V.value}})),J=function(){const{show:e=!0,tree:t={}}=x.data.top;if(!e)return[];const a=p(x.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=x.data.top.tree,{rowNumber:l=N}=t;N<l&&a.push(...m(l-N).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+F.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=c(t.children);n.height=i*o,e(t.children,a+1)}else n.width=V.value-n.left;Object.assign(t,n)}))}(a),a}(),K=t((()=>ue(le("xAxis")||"center"))),Q=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),R=t((()=>ue(le("intraoperatively")||"bottom"))),U=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),Z=t((()=>R.value+(x.data.height-I.value-B.value.height-U.value))),$=t((()=>(Q.value-V.value)/L.value)),_=t((()=>(Z.value-R.value)/O.value)),ee=t((()=>B.value.spaceTimeStamp/$.value)),te=t((()=>{const{scaleValues:e}=x.data;return v(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),ae=t((()=>se("pulse"))),re=t((()=>se("temperature"))),ie=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),oe=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...s,...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(E),topGridYCellHeight:r(W),topGridOriginY:r(F),topGridEndY:r(q),treeData:J,xAxis:r(B),originYXAxis:r(K),startTime:r(z),timeXCell:r(ee),gridXNumber:r(L),gridYNumber:r(O),xCellWidth:r($),yCellHeight:r(_),originX:r(V),endX:r(Q),originY:r(R),endY:r(Z),markHeight:r(U),itemList:r(te),scaleValues:x.data.scaleValues,pulseYCell:r(ae),temperatureYCell:r(re),event:r(ie),dialog:D});function le(e){let t="";return Object.entries(P.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ne(e){const t=P.value[e],a=B.value.height;switch(t){case"drug":return I.value;case"xAxis":return a;default:return x.data.height-I.value-a}}function ue(e){switch(e){case"top":return 0;case"center":return ne("top");default:return ne("top")+ne("center")}}function se(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return _.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),f(b,oe,j,Y);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s,pauseFlickerPoint:d}=w(b,oe,j,Y,H,S);k.value=d,g(b,oe,j,Y,a,r,i,l);const{clickMenu:c}=y(b,oe,j,Y,H,a,n,u,s);M.value=e,X.value=e=>{const{item:a}=e;a.type&&h.map((e=>e.type)).includes(a.type)?c(e):t(e)}})),l((()=>{k.value()})),S&&n((()=>null==Y?void 0:Y.point),(()=>{Y.movable?(Y.show=!0,G&&clearTimeout(G),G=setTimeout((()=>{Y.show=!1,Y.movable=!1}),3e3)):G&&clearTimeout(G)}),{deep:!0}),{propItems:oe,redrawPoints:M,select:A,clickMenu:X}}export{b as useSurgicalAnesthesiaChart};
1
+ import{reactive as e,ref as t,computed as a,unref as r,onMounted as i,nextTick as o,onBeforeUnmount as l,watch as n,toRefs as u}from"vue";import{useDialog as s}from"naive-ui";import{defaultBorderStyle as d}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as c}from"date-fns";import{getChildrenSize as p}from"../../utils/index.js";import{cloneDeep as m,range as v,flatten as h}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{OTHER_MENU as f}from"../../constants/index.js";import"@vueuse/shared";import"@vueuse/core";import{useTop as g}from"./useTop.js";import{useLeft as w}from"./useLeft.js";import{useCenter as y}from"./useCenter.js";import{useOther as b}from"./useOther.js";function x(x,j,C,Y,H,S,T){var D;const M=s(),k=e({redrawPoints:null,clickMenu:null}),A=t();let P=null;const X=p((null==(D=j.data.top)?void 0:D.treeData)||[]),G=a((()=>j.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),N=a((()=>{var e;return null!=(e=j.data.left.width)?e:0})),V=a((()=>{const{grid:e}=j.data;return e.mainXCell*e.subXCell})),L=a((()=>{const{grid:e}=j.data;return e.mainYCell*e.subYCell})),O=a((()=>{const{show:e=!0,tree:t={}}=j.data.top;if(!e)return 0;const{rowNumber:a=X}=t;return X<a?a:X})),E=a((()=>j.data.top.tree.cellHeight)),W=a((()=>E.value*O.value)),I=a((()=>ne(oe("drug")||"top"))),F=a((()=>I.value+W.value)),q=a((()=>{var e;return Date.parse((null==(e=j.data.xAxis)?void 0:e.startTime)||c(new Date,"yyyy-MM-dd HH:mm:ss"))})),z=a((()=>{const e=m(j.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=v(V.value/t+1).map((r=>0===r?e.startTime:c(new Date(q.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:N.value}})),B=function(){const{show:e=!0,tree:t={}}=j.data.top;if(!e)return[];const a=m(j.data.top.treeData);let r=0;const{cellWidth:i,cellHeight:o}=j.data.top.tree,{rowNumber:l=X}=t;X<l&&a.push(...v(l-X).map((()=>({}))));return function e(t,a=0){t.forEach((t=>{var l;const n={top:r*o+I.value,left:a*i,width:i,height:o};if(r++,null==(l=t.children)?void 0:l.length){r--;const i=p(t.children);n.height=i*o,e(t.children,a+1)}else n.width=N.value-n.left;Object.assign(t,n)}))}(a),a}(),J=a((()=>ne(oe("xAxis")||"center"))),K=a((()=>{var e;const{width:t,right:a}=j.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),Q=a((()=>ne(oe("intraoperatively")||"bottom"))),R=a((()=>{var e;const{show:t=!0,height:a}=(null==(e=j.data.other)?void 0:e.mark)||{};return t&&a?a:0})),U=a((()=>Q.value+(j.data.height-W.value-z.value.height-R.value))),Z=a((()=>(K.value-N.value)/V.value)),$=a((()=>(U.value-Q.value)/L.value)),_=a((()=>z.value.spaceTimeStamp/Z.value)),ee=a((()=>{const{scaleValues:e}=j.data;return h(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),te=a((()=>ue("pulse"))),ae=a((()=>ue("temperature"))),re=a((()=>{var e;return(null==(e=j.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),ie=e({canvasWidth:j.data.width,canvasHeight:j.data.height,borderStyle:{...d,...j.data.borderStyle},pointSelectionStyle:j.data.pointSelectionStyle||{},grid:j.data.grid,top:j.data.top,left:j.data.left,other:j.data.other,topGridYNumber:r(O),topGridYCellHeight:r(E),topGridOriginY:r(I),topGridEndY:r(F),treeData:B,xAxis:r(z),originYXAxis:r(J),startTime:r(q),timeXCell:r(_),gridXNumber:r(V),gridYNumber:r(L),xCellWidth:r(Z),yCellHeight:r($),originX:r(N),endX:r(K),originY:r(Q),endY:r(U),markHeight:r(R),itemList:r(ee),scaleValues:j.data.scaleValues,pulseYCell:r(te),temperatureYCell:r(ae),event:r(re),dialog:M});function oe(e){let t="";return Object.entries(G.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function le(e){const t=G.value[e],a=z.value.height;switch(t){case"drug":return W.value;case"xAxis":return a;default:return j.data.height-W.value-a}}function ne(e){switch(e){case"top":return 0;case"center":return le("top");default:return le("top")+le("center")}}function ue(e){const{scaleValues:t}=j.data,a=t.find((t=>t.type===e));return $.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await o(),g(x,ie,C,H);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:n,showDialog:u,removeCurrentSelection:s,pauseFlickerPoint:d}=y(x,ie,C,H,S,T);A.value=d,w(x,ie,C,H,a,r,i,l);const{clickMenu:c}=b(x,ie,C,H,S,a,n,u,s);k.redrawPoints=e,k.clickMenu=e=>{const{item:a}=e;a.type&&f.map((e=>e.type)).includes(a.type)?c(e):t(e)}})),l((()=>{A.value()})),T&&n((()=>null==H?void 0:H.point),(()=>{H.movable?(H.show=!0,P&&clearTimeout(P),P=setTimeout((()=>{H.show=!1,H.movable=!1}),3e3)):P&&clearTimeout(P)}),{deep:!0}),{propItems:ie,...u(k)}}export{x 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{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as y,getIndex as m}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,$,O,T,V,P,C,A,R,I){r(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:z}=t(),{left:F,xScaleList:_,xCellWidth:W,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie}=$,ne=new Set,oe=["xinmai","mai"],le=new Map,se=new Set,re=new Set,ue=new Set,ae=x(F.yScaleValue),ce=new Set;function de(t){var o;const l=ae.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ne.size&&E.value.remove(...ne),ne.clear(),le.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=le.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 le)t.push(e[1]),e[0]===oe[0]&&e[1].forEach((e=>{(le.get(oe[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)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(ue).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===oe[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{t>0&&e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{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(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),ne.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([...b(t)],{...r,originX:"center"});e.push(n),ne.add(n)}))}E.value.add(...e)}ne.add(l),E.value.add(l)}))}}function pe(e,t,r){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},respiratorStyle:k={},dataList:L=[],list:S=[]}=r,{type:Y,textStyle:$,showConnectLine:P=!1}=j,A=[],I=[],X=[];let D=null;const z=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ve(e.time);if(null==(u=e.list)||u.forEach(((u,j)=>{const F=d(a)?L.find((e=>e.key===u.key)):e,_=ge(z(u)?{...u,value:k.fixedValue}:u,r),G=e.list[j+1],N=G?ge(z(G)?{...G,value:k.fixedValue}:G,r):void 0,B=G?d(a)?L.find((e=>e.key===G.key)):e:{},{title:J=""}=F;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!_||!N||f(_[0],1)!==f(N[0],1))_&&D&&(_[0]=D),D=null;else{const e=_[0]-W/2;_[0]=e+W/4,N[0]=D=_[0]+W/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,s=l([e[0],o],{value:z(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(s),{obj:s,top:-q}}(_,u,F),function(e,t,r,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ve(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=r,{value:m}=u,x=T(t.time);let b,j,w,L,Y,E;if(t.noRise&&p.show){const i=M(p,t)?V(a,S,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||ue.add(w);else if(t.value){w=s([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&ce.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(m?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(Y=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(Y)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,S,null!=(d=t.physicsReduce)?d:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+W/2:x;b=i([...e,s,l],{...v,...y.line,...n}),j=o((null==(f=null==y?void 0:y.point)?void 0:f.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(E=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(E))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(m?-q:0)-5},verifiedText:{obj:Y,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:E,top:(m?-q:0)-5}})}(_,u,F,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...S),r=Math.min(...S);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=s([e[0],i[0],i[1]],x,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<r&&(c=l([e[0],e[1]-q],i),X.push(c))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*q;d=s([e[0],t,i],{...w.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:w.text?5:2*q,moveHide:!0}})}(_,u,F,K),function(n,l,s,u,c,d){let p,f;const{pointAttr:h={},lineAttr:g={},title:y="",key:x,type:b="circle"}=c,j=e.list[u+1],w=fe(a,e.list[u].value),L=l&&fe(a,j.value),S=()=>"pulse"==a&&s.pacemakerShow?m.value:z(s)?k.type:w&&"number"===Y?0:b;if(n&&l&&!s.breakpoint&&(!w&&!L||P)){f=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const M=S(),T=I[u-1],V={origin:{data:z(s)?{...s,value:k.fixedValue}:s,title:y,key:x||"",unit:r.unit,type:a,_type:v(y,a),dataIndex:t,index:u},leftLine:T,rightLine:f,otherObj:d,...s.pacemakerShow&&"pulse"==a?m.style:z(s)?k.style:h,lockMovementX:!0,...H(),...w?{selectable:!1,evented:!1,..."number"===Y?$:{}}:{}};n&&(T?V.leftLine.set("x2",n[0]):V.leftLine=null,p=o(M,{left:n[0],top:w?n[1]-5:n[1],...V}));I.push(f),p&&(x===oe[1]?se.add(p):re.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{he(e,"hover")})),e.on("mouseout",(()=>{R.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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&&(E.value.remove(i),delete e.otherObj.obj)))})),de(e)}(e),Q.hovered&&he(e)})),e.on("mouseup",(t=>{if(R.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),me(n,"change")}}))}(p),A.push(p),ue.add(p))}(_,N,u,j,F,K)})),"pulse"===a){const{key:t}=e;let i=null;le.set(t,A.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&f(e.left,1)===f(s.left,1)){const t=e.left-W/2;e.set("left",t+W/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+W/2,s.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const F=I.filter((e=>e));E.value.add(...F,...A,...X)}function fe(e,t){return"pain"===e&&0==t}function he(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;R.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;R.list=[function(){const{drugReduce:r,physicsReduce:u}=l||{},a="hover"===t?l.value:C(o,e.top);if(h(r))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(h(u))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),s],R.show=!0}function ve(e){const[t]=_,i=j(_),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function ge(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ve(e.time))return;const n=T(e.time),o=V(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function ye(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function me(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ae.find((e=>e.type===i));if("add"===t){const e=d(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;xe()}function xe(){var e;ue.size&&(null==(e=E.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}([...ue]))),ue.clear(),be()}function be(e){le.clear(),ue.clear(),se.clear(),ce.clear(),re.clear(),ae.forEach((t=>{null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||pe(e,i,t)}))})),de(),[...ue].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ae.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({},S,F.overlap||{}),l=[];se.size&&[...se].forEach((e=>{[...re].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ue.add(e)}))}))}()}return be((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.list,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...k]),"pain"===o&&(I.list=[...L]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...ue],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ye(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...k,...L]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),d(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};O("change",r),me(r,"change")}else{const t={data:{time:P(e.pointer.x),value:C(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),me(t)}},setPopup:he,isAddPoint:ye,updateData:me,redrawPoints:xe,gridPoints:ue,fixedNoRisePoints:ce}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E 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{format as u}from"date-fns";import{getType as a,getTime as c,isOneLine as d,isOverlapPoint as p,getFloorNumber as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,deleteProperty as y,getIndex as m}from"../../utils/index.js";import{cloneDeep as x,flatten as b,last as j}from"lodash-es";import"../useEvent.js";import{useCommon as w}from"../useCommon.js";import"vue";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as k,PAIN_MENU as L,OVERLAP as S}from"../../constants/index.js";import{promiseTimeout as Y}from"@vueuse/shared";function E(E,$,O,T,V,P,C,A,R,I){r(E,$);const{getEqualXTypes:X,handleAddPrevent:D,getPointEventProps:H}=w(E,O,$),{createShadowLines:z}=t(),{left:F,xScaleList:_,xCellWidth:W,yCellHeight:q,originX:G,endX:N,originY:B,endY:J,itemList:K,event:Q,vitalSignsOriginY:U,painOriginY:Z,hospitalizationDate:ee,config:te,canvasHeight:ie}=$,ne=new Set,oe=["xinmai","mai"],le=new Map,se=new Set,re=new Set,ue=new Set,ae=x(F.yScaleValue),ce=new Set;function de(t){var o;const l=ae.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(ne.size&&E.value.remove(...ne),ne.clear(),le.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=le.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 le)t.push(e[1]),e[0]===oe[0]&&e[1].forEach((e=>{(le.get(oe[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)),u=n[i],a=o[r],c=n[i-1],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(u[1],a[1]);l.push([u,a].find((e=>e[1]===h)));const v=Math.max(u[1],a[1]);s.push([u,a].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=j(t);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}();o.length>0&&function(e){Y(0).then((()=>{e.forEach((e=>{const t=[],i=[];Array.from(ue).forEach((n=>{var o,l;"pulse"===(null==(o=null==n?void 0:n.origin)?void 0:o.type)&&e.find((e=>Math.abs(n.left-e[0])<=1&&Math.abs(n.top-e[1])<=1))&&((null==(l=null==n?void 0:n.origin)?void 0:l.key)===oe[0]?t.push(n):i.push(n))})),[t,i].forEach((e=>{1!==(null==e?void 0:e.length)&&e.sort(((e,t)=>e.left-t.left)).forEach(((e,t)=>{t>0&&e.leftLine&&E.value.remove(e.leftLine)}))}))}))}))}(o);const{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(...z(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),ne.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([...b(t)],{...r,originX:"center"});e.push(n),ne.add(n)}))}E.value.add(...e)}ne.add(l),E.value.add(l)}))}}function pe(e,t,r){var u;const{type:a,riseStyle:c={},noRiseStyle:p={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},respiratorStyle:k={},dataList:L=[],list:S=[]}=r,{type:Y,textStyle:$,showConnectLine:P=!1}=j,A=[],I=[],X=[];let D=null;const z=e=>"breathe"==a&&e.respirator&&k.type&&k.fixedValue&&!e.value&&ve(e.time);if(null==(u=e.list)||u.forEach(((u,j)=>{const F=d(a)?L.find((e=>e.key===u.key)):e,_=ge(z(u)?{...u,value:k.fixedValue}:u,r),G=e.list[j+1],N=G?ge(z(G)?{...G,value:k.fixedValue}:G,r):void 0,B=G?d(a)?L.find((e=>e.key===G.key)):e:{},{title:J=""}=F;if("脉搏"===J&&"脉搏"!==B.title||"脉搏"!==J&&"脉搏"===B.title||!_||!N||f(_[0],1)!==f(N[0],1))_&&D&&(_[0]=D),D=null;else{const e=_[0]-W/2;_[0]=e+W/4,N[0]=D=_[0]+W/2}const K={};K.value=function(e,t,i){if(!(null==e?void 0:e.length)||!te.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=U.originY+q?e[1]+q:e[1]-q,s=l([e[0],o],{value:z(t)?k.fixedValue:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return X.push(s),{obj:s,top:-q}}(_,u,F),function(e,t,r,u){var d,f;if(!["temperature","pain","breathe"].includes(a))return;if(!(null==e?void 0:e.length)&&"temperature"===a&&!ve(t.time))return;if(!(null==e?void 0:e.length)&&"pain"===a)return;if(!t.value&&"breathe"===a)return;const{lineAttr:v={}}=r,{value:m}=u,x=T(t.time);let b,j,w,L,Y,E;if(t.noRise&&p.show){const i=M(p,t)?V(a,S,35):(null==e?void 0:e[1])||0;if(p.text)w=l([x,M(p,t)?i:i+5],{value:p.text.split("").join("\n"),originY:"top",...p.style}),t.value||ue.add(w);else if(t.value){w=s([x,i,i+2*q],{...p.style})}w&&X.push(w),w&&M(p,t)&&ce.add(w)}if(null==e?void 0:e[1]){if(t.rise&&c.show&&c.text&&(L=l([x,e[1]-(m?q:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style}),X.push(L)),t.verified&&(Y=l([x,e[1]-(m?q:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),X.push(Y)),h(t.physicsReduce)||h(t.drugReduce)){const l=V(a,S,null!=(d=t.physicsReduce)?d:t.drugReduce),s=l<e[1]&&(null==te?void 0:te.hypothermyViewCustom)?x+W/2:x;b=i([...e,s,l],{...v,...y.line,...n}),j=o((null==(f=null==y?void 0:y.point)?void 0:f.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===ie?"bottom":"center"}),b&&X.push(b),j&&X.push(j)}t.respirator&&(E=o(k.type,{left:x,top:e[1]-(m?q:0)-5,originX:"center",originY:"bottom",...k.style}),X.push(E))}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:w,top:p.text?5:2*q,isFixed:M(p,t)},riseText:{obj:L,top:(m?-q:0)-5},verifiedText:{obj:Y,top:(m?-q:0)-5},reducePoint:{obj:j,type:"reduce"},respirator:{obj:E,top:(m?-q:0)-5}})}(_,u,F,K),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(a))return;const o=Math.max(...S),r=Math.min(...S);let u,c,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*q,i=[e[1]-q/2,t];t<U.originY&&(t=e[1]+2.5*q,i=[t,e[1]+q/2]),u=s([e[0],i[0],i[1]],x,"up"),X.push(u)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=u?e[1]+q/2+u.height:e[1]+q;c=l([e[0],t],i),X.push(c)}+t.value<r&&(c=l([e[0],e[1]-q],i),X.push(c))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*q;d=s([e[0],t,i],{...w.style})}X.push(d)}Object.assign(n,{upArrow:{obj:u},limitValue:{obj:c,top:-q},belowMinValue:{obj:d,top:w.text?5:2*q,moveHide:!0}})}(_,u,F,K),function(n,l,s,u,c,d){let p,f;const{pointAttr:h={},lineAttr:g={},title:y="",key:x,type:b="circle"}=c,j=e.list[u+1],w=fe(a,e.list[u].value),L=l&&fe(a,j.value),S=()=>"pulse"==a&&s.pacemakerShow?m.value:z(s)?k.type:w&&"number"===Y?0:b;if(n&&l&&!s.breakpoint&&(!w&&!L||P)){f=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==te?void 0:te.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});X.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const M=S(),T=I[u-1],V={origin:{data:z(s)?{...s,value:k.fixedValue}:s,title:y,key:x||"",unit:r.unit,type:a,_type:v(y,a),dataIndex:t,index:u},leftLine:T,rightLine:f,otherObj:d,...s.pacemakerShow&&"pulse"==a?m.style:z(s)?k.style:h,lockMovementX:!0,...H(),...w?{selectable:!1,evented:!1,..."number"===Y?$:{}}:{}};n&&(T?V.leftLine.set("x2",n[0]):V.leftLine=null,p=o(M,{left:n[0],top:w?n[1]-5:n[1],...V}));I.push(f),p&&(x===oe[1]?se.add(p):z(s)||re.add(p),function(e){Q.hovered&&(e.on("mouseover",(()=>{he(e,"hover")})),e.on("mouseout",(()=>{R.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?Z:U;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&&(E.value.remove(i),delete e.otherObj.obj)))})),de(e)}(e),Q.hovered&&he(e)})),e.on("mouseup",(t=>{if(R.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};E.value.discardActiveObject(),O("change",n),me(n,"change")}}))}(p),A.push(p),ue.add(p))}(_,N,u,j,F,K)})),"pulse"===a){const{key:t}=e;let i=null;le.set(t,A.map(((e,t,n)=>{var o,l;const s=n[t+1];if(s&&f(e.left,1)===f(s.left,1)){const t=e.left-W/2;e.set("left",t+W/4),null==(o=e.rightLine)||o.set("x1",e.left),i=e.left+W/2,s.set("left",i)}else i&&(null==(l=e.leftLine)||l.set("x2",i),e.set("left",i)),i=null;return[e.left,e.top]})))}const F=I.filter((e=>e));E.value.add(...F,...A,...X)}function fe(e,t){return"pain"===e&&0==t}function he(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;R.point={x:e.left,y:e.top};let s=`时间 ${((null==l?void 0:l.time)||P(e.left)).slice(-5)}`;R.list=[function(){const{drugReduce:r,physicsReduce:u}=l||{},a="hover"===t?l.value:C(o,e.top);if(h(r))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;if(h(u))return s+=(null==l?void 0:l.changeTime)?"—>"+(null==l?void 0:l.changeTime.slice(-5)):"",`物理降${"pain"==o?"痛":"温"} ${a}—>${u}${n||""}`;return`${i} ${a}${n||""}`}(),s],R.show=!0}function ve(e){const[t]=_,i=j(_),n=t.start,o=i.end,l=c(e);return l>=n&&l<=o}function ge(e,t){const i="pain"===t.type?Z:U;if(!g(e)||!ve(e.time))return;const n=T(e.time),o=V(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function ye(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=c(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=c(`${P(e)}:00`);return ee&&l<c(ee)?(D("exceedMin"),!1):!(l>o)||(D("exceedMax"),!1)}function me(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ae.find((e=>e.type===i));if("add"===t){const e=d(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=m(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;xe()}function xe(){var e;ue.size&&(null==(e=E.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}([...ue]))),ue.clear(),be()}function be(e){le.clear(),ue.clear(),se.clear(),ce.clear(),re.clear(),ae.forEach((t=>{null==e||e(t),t.dataList.forEach(((e,i)=>{!e.show||d(t.type)&&!e.enable||pe(e,i,t)}))})),de(),[...ue].forEach((e=>{null==e||e.bringToFront()})),function(){var e;const t=ae.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({},S,F.overlap||{}),l=[];se.size&&[...se].forEach((e=>{[...re].forEach((t=>{if(t.origin&&p(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),l.push(o(r,{...i[e],...s}))}}}))})),setTimeout((()=>{E.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ue.add(e)}))}))}()}return be((e=>function(e){if("temperature"!==e.type||!e.positionLine)return;const t=V(e.type,e.list,e.positionLine.value),n=i([G,t,N,t],e.positionLine);E.value.add(n)}(e))),E.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!$.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=G&&e<=N&&t>=B&&t<=J){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...k]),"pain"===o&&(I.list=[...L]),I.target=i;else{I.target=null,I.list=["新增节点"],K.forEach((i=>{if(!X([...ue],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?Z:U;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:A?A(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:a(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=ye(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&D("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=G&&e<=N&&t>0&&t<ie&&O("click:grid",{x:e,y:t,time:P(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...k,...L]);s[`${e.type}`]=e.value,s.changeTime=u(new Date,"yyyy-MM-dd HH:mm"),d(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};O("change",r),me(r,"change")}else{const t={data:{time:P(e.pointer.x),value:C(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};O("add",t),me(t)}},setPopup:he,isAddPoint:ye,updateData:me,redrawPoints:xe,gridPoints:ue,fixedNoRisePoints:ce}}function M(e,t){return e.fixed||!t.value&&0!==t.value}export{E as useCenter};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import{getScaleInfo as u,drawScaleNumber as a,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as c}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,d,g,f,m,v,y,w,S,b,Y,x){var j,C;const{getEqualXTypes:X,handleAddPrevent:N,isGridLimit:T}=c(p,g,d),{originY:V,endY:L,originX:k,endX:E,xCellWidth:M,yCellHeight:W,left:G,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:I,painIndex:_,right:B,canvasWidth:J,canvasHeight:$,getRightInfo:q,borderStyle:D,surplusCell:P,painSurplusCell:z}=d;function F(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let c=H,d=k;"right"===r&&(c=E,d=E+(null!=(s=null==B?void 0:B.width)?s:0));const g=[],f=A&&"right"!==r?o.length-1:o.length,m=(d-c)/f,v=m+(d-c)%f;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:h,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=R.originY-z[0]*W,v=l({width:k-H,height:A+(z[0]+z[1])*W,...D},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,k,m],D),w=[];if(r||h){const{lineXMain:t,textLeft:i}=u(c,H,k-H),l=o.length;o.forEach(((o,u)=>{let c=R.endY-u*W*s;if(0===u&&0===z[1]&&(c=L-5),h&&(!(0===u||u===l-1)||d||0===u&&z[1]>0||u===l-1&&z[0]>0)&&w.push(a(o,n,i,c)),r&&(0!==u||z[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...D,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const d=[],f=0===s?v:m,y=0===s?c:v+c+(s-1)*m,w="right"===r?0:O.originY,S="right"===r?$:O.endY,b=s>0?t([y,w,y,S],{objectCaching:!1,...D}):null;b&&d.push(b);const Y=y+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:X,position:N,showMaxMinNumber:T,detailedList:E=[],showdetailedScale:M,showRange:G=[]}=o;if(C||X){const[e,t]=G,{lineXMain:i,lineXSub:n,textLeft:l}=u(N,y,f),s=(x[1]-x[0])/2,r=M&&!E.length?x.reduce(((e,t,i)=>{const n=e[e.length-1];return 0===i?[t]:e.concat([n+s,n+2*s])}),[]):M&&(null==E?void 0:E.length)?E:x,c=r.length;r.forEach(((s,r)=>{if(e&&+s<e)return;if(t&&+s>t)return;const u=O.endY-r*W*(M?j/2:j);if(X&&(!(0===r||r===c-1)||T)&&e!==+s){const e=0==r?u-5:u,t=a(s,o,l,e),i=O.originY+t.height/2;e<i&&t.set({top:i}),d.push(t)}d.push(...h(o,r,i,n,u,W,O.originY))}))}let I=o.title||"";o.unit&&(I+="\n"+o.unit);let B=O.originY+W;0!==_&&P[0]>1&&(B=V+W*P[0]/2),I&&d.push(new e.Text(String(I),{...i,left:Y,top:B,textAlign:"center",...o.style}));const J=new e.Group(d,{...n,objectCaching:!1});g.push(J)}));const y=g.length>0?new e.Group([...g],{...n,objectCaching:!1}):null;y&&p.value.add(y),y&&y.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(I));let t=L;const i=H-G.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...d.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=k&&e.left<=E){e.setCoords();const t="pain"===e.origin.type?R:O;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),T(a)?f(a):m.show=!1})),a.on("mouseup:before",(e=>{if(m.show=!1,0===e.e.button&&T(a)){const e=X([...x],a.left,"_type").includes(a.origin._type),t=b(a.left);if(!t||e)e&&t&&N("repeat");else{const e={data:{time:w(a.left),value:S(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};g("add",e),Y(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),p.value.add(l,u)}))}();const K=G.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==B?void 0:B.width)&&"left"===(null==(j=null==B?void 0:B.yScaleValue)?void 0:j.layout)&&(null==(C=null==B?void 0:B.yScaleValue)?void 0:C.show)&&K.push(q),_>0&&G.yScaleValue[_].show){const e=G.yScaleValue[_];0===_&&G.yScaleValue.length>1&&K.unshift(e),_==G.yScaleValue.length-1&&K.push(e)}const Q=K.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),U=K[Q];return Q>-1&&K.splice(Q,0,{...U,title:(null==U?void 0:U.doubleTitle)||(null==U?void 0:U.title)}),F(K),p.value.add(new e.Rect({left:H,top:0,width:J-H-D.strokeWidth,height:$-D.strokeWidth,fill:"transparent",...D})),{drawScaleValue:F}}export{p as useLeft};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,defaultTextStyle as i,defaultStyle as n,drawTextAndIconGroup as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as s,isOneLine as r}from"../../utils/index.js";import{last as u}from"lodash-es";import"../useEvent.js";import{getScaleInfo as a,drawScaleNumber as h,drawScaleLine as c}from"../useScaleColumn.js";import{useCommon as d}from"../useCommon.js";import"vue";import"./useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";function p(p,g,f,m,v,y,w,S,b,Y,x,j){var C,X;const{getEqualXTypes:N,handleAddPrevent:T,isGridLimit:V}=d(p,f,g),{originY:L,endY:k,originX:E,endX:M,xCellWidth:W,yCellHeight:G,left:I,vitalSignsOriginY:O,painOriginY:R,painHeight:A,iconsWidth:H,itemList:_,painIndex:B,right:J,canvasWidth:$,canvasHeight:q,getRightInfo:D,borderStyle:P,surplusCell:z,painSurplusCell:F}=g;function K(o){var s;if(!(null==o?void 0:o.length))return;const{layout:r}=o[0];let d=H,g=E;"right"===r&&(d=M,g=M+(null!=(s=null==J?void 0:J.width)?s:0));const f=[],m=A&&"right"!==r?o.length-1:o.length,v=(g-d)/m,y=v+(g-d)%m;o.forEach(((o,s)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:s=5,showScale:r,showNumber:u,position:c,showMaxMinNumber:d,style:g,title:f}=n,m=R.originY-F[0]*G,v=l({width:E-H,height:A+(F[0]+F[1])*G,...P},{value:`${f}`,...i,...g||{}},{left:H,top:m}),y=t([H,m,E,m],P),w=[];if(r||u){const{lineXMain:t,textLeft:i}=a(c,H,E-H),l=o.length;o.forEach(((o,a)=>{let c=R.endY-a*G*s;if(0===a&&0===F[1]&&(c=k-5),u&&(!(0===a||a===l-1)||d||0===a&&F[1]>0||a===l-1&&F[0]>0)&&w.push(h(o,n,i,c)),r&&(0!==a||F[1]>0)){const[i,n]=t,o=new e.Line([i,c,n,c],{...P,...g});w.push(o)}}))}p.value.add(y,v,...w),v.sendToBack()}(o);const g=[],m=0===s?y:v,w=0===s?d:y+d+(s-1)*v,S="right"===r?0:O.originY,b="right"===r?q:O.endY,Y=s>0?t([w,S,w,b],{objectCaching:!1,...P}):null;Y&&g.push(Y);const x=w+m/2,{list:j=[],spaceGridNumber:C=5,showScale:X,showNumber:N,position:T,showMaxMinNumber:V,detailedList:M=[],showdetailedScale:W,showRange:I=[]}=o;if(X||N){const{lineXMain:e,lineXSub:t,textLeft:i}=a(T,w,m),n=(j[1]-j[0])/2,l=W&&!M.length?j.reduce(((e,t,i)=>{const o=e[e.length-1];return 0===i?[t]:e.concat([o+n,o+2*n])}),[]):W&&(null==M?void 0:M.length)?M:j,[s=l[0],r=u(l)]=I;l.forEach(((n,u)=>{if(s&&+n<+s)return;if(r&&+n>+r)return;const a=O.endY-u*G*(W?C/2:C),d=[s,r].includes(n);if(N&&(!d||V)){const e=0==u?a-5:a,t=h(n,o,i,e),l=O.originY+t.height/2;e<l&&t.set({top:l}),g.push(t)}g.push(...c(o,u,e,t,a,G,O.originY,l.findIndex((e=>e==r))+1))}))}let _=o.title||"";o.unit&&(_+="\n"+o.unit);let J=O.originY+G;0!==B&&z[0]>1&&(J=L+G*z[0]/2),_&&g.push(new e.Text(String(_),{...i,left:x,top:J,textAlign:"center",...o.style}));const $=new e.Group(g,{...n,objectCaching:!1});f.push($)}));const w=f.length>0?new e.Group([...f],{...n,objectCaching:!1}):null;w&&p.value.add(w),w&&w.sendToBack()}H&&function(){const e=JSON.parse(JSON.stringify(_));let t=k;const i=H-I.icons.marginRight;e.reverse().forEach((e=>{t-=10;let n=e.title.replace(/(.{2})/g,"$1\n");n.endsWith("\n")&&(n=n.slice(0,n.length-1));const{text:l,icon:u}=o(n,e,{text:{left:i-(e.pointAttr.width||10)-5,top:t,originX:"right"},icon:{originX:"right",left:i,topY:t,origin:{type:s(e.bigType),_type:e.bigType},...g.event}});var a;t-=l.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(e){if(e.left>=E&&e.left<=M){e.setCoords();const t="pain"===e.origin.type?R:O;e.top<t.originY&&e.set("top",t.originY),e.top>t.endY&&e.set("top",t.endY)}}(a),V(a)?m(a):v.show=!1})),a.on("mouseup:before",(e=>{if(v.show=!1,0===e.e.button&&V(a)){const e=N([...j],a.left,"_type").includes(a.origin._type),t=Y(a.left);if(!t||e)e&&t&&T("repeat");else{const e={data:{time:S(a.left),value:b(a.origin.type,a.top),...r(a.origin.type)?{key:a.origin.key}:{}},...a.origin};f("add",e),x(e)}}!function(e){e.setCoords().set({originX:"right",left:e.originLeft,top:e.originTop})}(a)})),p.value.add(l,u)}))}();const Q=I.yScaleValue.filter((e=>"left"===e.layout&&"pain"!==e.type&&e.show));if((null==J?void 0:J.width)&&"left"===(null==(C=null==J?void 0:J.yScaleValue)?void 0:C.layout)&&(null==(X=null==J?void 0:J.yScaleValue)?void 0:X.show)&&Q.push(D),B>0&&I.yScaleValue[B].show){const e=I.yScaleValue[B];0===B&&I.yScaleValue.length>1&&Q.unshift(e),B==I.yScaleValue.length-1&&Q.push(e)}const U=Q.findIndex((e=>"pulse"===e.type&&e.show&&e.doubleShow)),Z=Q[U];return U>-1&&Q.splice(U,0,{...Z,title:(null==Z?void 0:Z.doubleTitle)||(null==Z?void 0:Z.title)}),K(Q),p.value.add(new e.Rect({left:H,top:0,width:$-H-P.strokeWidth,height:q-P.strokeWidth,fill:"transparent",...P})),{drawScaleValue:K}}export{p as useLeft};
@@ -3,8 +3,13 @@ import { fabric } from '../../../../../shared/utils/fabricjs';
3
3
  import { IPointTipProps, IPointMenuProps } from '../../../../../components/fabric-chart/src/interface';
4
4
  import { AnyObject } from '../../../../../shared/types';
5
5
  export declare function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ select?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
7
+ redrawPoints?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
8
+ clickMenu?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
9
+ updatePolyline?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
10
+ useMeasureRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
11
+ useCaliper?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
12
+ useCaliperRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
13
+ useRectRuler?: Ref<import("../../../../../shared/types").AnyFn | null | undefined> | undefined;
6
14
  propItems: any;
7
- redrawPoints: Ref<any>;
8
- select: Ref<any>;
9
- clickMenu: Ref<any>;
10
15
  };