cnhis-design-vue 3.2.7-beta.3 → 3.2.7-beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) 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/useBirthProcessChart.d.ts +8 -3
  6. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  7. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +9 -6
  8. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  9. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.d.ts +0 -2
  10. package/es/components/fabric-chart/src/hooks/newBirthProcess/useNewBirthProcessChart.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +8 -3
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.d.ts +8 -3
  15. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  16. package/es/components/fabric-chart/src/interface.d.ts +11 -1
  17. package/es/components/field-set/src/FieldSet.vue.d.ts +1 -1
  18. package/es/components/iho-chat/index.d.ts +23 -0
  19. package/es/components/iho-chat/src/Index.vue.d.ts +23 -0
  20. package/es/components/iho-chat/src/Index.vue2.js +1 -1
  21. package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
  22. package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
  23. package/es/components/iho-chat/style/index.css +1 -1
  24. package/es/components/index.css +1 -1
  25. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  26. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  27. package/es/env.d.ts +25 -25
  28. package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
  29. package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
  30. package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
  31. package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
  32. package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
  33. package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
  34. package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
  35. package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
  36. package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
  37. package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
  38. package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
  39. package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
  40. package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
  41. package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
  42. package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
  43. package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
  44. package/es/shared/assets/img/failure.png.js +1 -1
  45. package/es/shared/assets/img/no-permission.png.js +1 -1
  46. package/es/shared/assets/img/nodata.png.js +1 -1
  47. package/es/shared/assets/img/notfound.png.js +1 -1
  48. package/es/shared/assets/img/qr.png.js +1 -1
  49. package/es/shared/assets/img/success.png.js +1 -1
  50. package/es/shared/assets/img/table_style_2.png.js +1 -1
  51. package/es/shared/assets/img/video.png.js +1 -1
  52. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  53. package/es/shared/assets/img/xb_big.png.js +1 -1
  54. package/es/shared/assets/img/xb_small.png.js +1 -1
  55. package/es/shared/package.json.js +1 -1
  56. package/package.json +2 -2
  57. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  58. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  59. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  60. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  61. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  62. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  63. 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};
@@ -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};
@@ -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):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};
@@ -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
  };
@@ -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{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,Y,b,w,C){const x=15,D=e(),j=e(),V=e(),H=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~_.value?e:[0,0]})),X=a((()=>{var e,a;const t=(null==(a=null==(e=S.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===_.value?t[0]=t[0]+H.value[1]:_.value>0&&(t[2]=t[2]+H.value[0]),t})),L=a((()=>0===_.value?[H.value[0],X.value[1],X.value[2],X.value[3]]:_.value>0?[X.value[0],X.value[1],H.value[1],X.value[3]]:X.value)),P=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),I=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),M=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),N=a((()=>{var e,a,t;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),O=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),R=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+X.value[1]+X.value[3]})),W=a((()=>{const{grid:e}=S.data,a=_.value>0?H.value[1]:H.value[0];return e.mainYCell*e.subYCell+X.value[0]+X.value[2]+a})),$=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),k=a((()=>$.value-X.value[1]*T.value)),G=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+B.value})),q=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),z=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return P.value+t+l+I.value+M.value})),T=a((()=>($.value-G.value)/R.value)),A=a((()=>(q.value-z.value)/W.value)),B=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),E=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=G.value-T.value;const r=t.date.startDate||s(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=T.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+T.value/2,scaleCell:(l-t)/T.value}}))));return v(o)})),F=a((()=>ne("breathe"))),J=a((()=>ne("pulse"))),K=a((()=>ne("temperature"))),Q=a((()=>ne("pain"))),U=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Z=a((()=>{const{left:e}=S.data;return v(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),_=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),ee=a((()=>{const{grid:e}=S.data;return-1===_.value?0:A.value*e.subYCell})),ae=a((()=>{const{left:e}=S.data,a={originY:z.value+H.value[0]*A.value,endY:q.value-H.value[1]*A.value};return 0===_.value&&e.yScaleValue.length>1?a.endY=a.originY+ee.value:_.value===e.yScaleValue.length-1&&(a.originY=a.endY-ee.value),a})),te=a((()=>{const{left:e}=S.data,a={originY:z.value+X.value[0]*A.value,endY:q.value-X.value[2]*A.value};return 0===_.value&&e.yScaleValue.length>1?a.originY=ae.value.endY+X.value[0]*A.value:_.value===e.yScaleValue.length-1&&(a.endY=ae.value.originY-X.value[2]*A.value),a})),le=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),ue=a((()=>{var e;const{left:a,right:t}=S.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ie=t({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:P.value,hospitalDaysHeight:I.value,operationDaysHeight:M.value,xScalevalueHeight:N.value,topList:le.value,breathingHeight:O.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:_.value,painHeight:ee.value,painOriginY:ae.value,vitalSignsOriginY:te.value,gridXNumber:R.value,gridYNumber:W.value,iconsWidth:B.value,originX:G.value,originY:z.value,endX:$.value,endXLimit:k.value,endY:q.value,xCellWidth:T.value,yCellHeight:A.value,xScaleList:E.value,breatheYCell:F.value,pulseYCell:J.value,temperatureYCell:K.value,painYCell:Q.value,event:U.value,itemList:Z.value,getRightInfo:ue.value,config:S.data.config||{},surplusCell:X.value,painSurplusCell:H.value,mainSurplusCell:L.value});function ne(e){const{yScaleValue:a}=S.data.left,t=a.find((a=>a.type===e)),l=(null==t?void 0:t.list)||[];return l.length?A.value/((l[1]-l[0])/t.spaceGridNumber):0}const{computedX:re,computedY:oe,getXValue:ve,getYValue:se}=i(ie);return l((()=>y.value),(e=>{e&&function(){c(y,ie);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=g(y,ie,Y,re,oe,ve,se,S.addRenderItem,w,C);j.value=l,V.value=u;const{drawScaleValue:o}=p(y,ie,Y,e,w,re,oe,ve,se,a,t,i);h(y,ie,o),m(y,ie),f(y,ie,Y,re,oe,r);const{select:v}=n(y,ie,Y);D.value=v}()}),{immediate:!0}),{propItems:ie,redrawPoints:j,select:D,clickMenu:V}}export{y as useTemperatureChart};
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{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import{flatten as v}from"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as c}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as g}from"./useCenter.js";import{useBottom as m}from"./useBottom.js";import{useOther as f}from"./useOther.js";function y(y,S,Y,w,b,C){const x=15,D=e({select:null,redrawPoints:null,clickMenu:null}),j=a((()=>{const{painSurplusCell:e=[0,0]}=S.data.grid||{};return~U.value?e:[0,0]})),V=a((()=>{var e,a;const t=(null==(a=null==(e=S.data.grid)?void 0:e.surplusCell)?void 0:a.slice())||[0,0,0,0];return 0===U.value?t[0]=t[0]+j.value[1]:U.value>0&&(t[2]=t[2]+j.value[0]),t})),H=a((()=>0===U.value?[j.value[0],V.value[1],V.value[2],V.value[3]]:U.value>0?[V.value[0],V.value[1],j.value[1],V.value[3]]:V.value)),X=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||x)||0})),L=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.hospitalDays)?void 0:e.show)&&(a.hospitalDays.height||x)||0})),P=a((()=>{var e;const{top:a}=S.data;return(null==(e=a.operationDays)?void 0:e.show)&&(a.operationDays.height||x)||0})),M=a((()=>{var e,a,t;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||x)||0)+((null==(a=l.xScalevalue)?void 0:a.show)&&null!=(t=l.dayHeight)?t:0)})),I=a((()=>{var e;const{bottom:a}=S.data;return(null==(e=null==a?void 0:a.breathing)?void 0:e.show)&&(a.breathing.height||30)||0})),N=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),k=a((()=>{const{grid:e}=S.data,a=U.value>0?j.value[1]:j.value[0];return e.mainYCell*e.subYCell+V.value[0]+V.value[2]+a})),O=a((()=>{var e;const{width:a,right:t=null,top:l}=S.data;if(!t)return a;return a-(null!=(e=t.width)?e:0)})),R=a((()=>O.value-V.value[1]*q.value)),W=a((()=>{const{top:e,left:a}=S.data;return e.titleWidth+T.value})),$=a((()=>{const{bottom:e=null,height:a}=S.data;if(!e)return a;return a-(e.height||30)})),G=a((()=>{var e;const{top:a}=S.data,t=a.xScalevalue.show&&(null!=(e=a.dayHeight)?e:0)||0,l=a.xScalevalue.show&&(a.xScalevalue.height||x)||0;return X.value+t+l+L.value+P.value})),q=a((()=>(O.value-W.value)/N.value)),z=a((()=>($.value-G.value)/k.value)),T=a((()=>{var e,a;const{left:t}=S.data;return(null==(e=t.icons)?void 0:e.show)&&((null==(a=t.icons)?void 0:a.width)||100)||0})),A=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=(null==(a=null==(e=t.date.list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],i=t.xScalevalue.times;let n=W.value-q.value;const r=t.date.startDate||s(new Date,"yyyy-MM-dd"),o=u.reduce(((e,a,t)=>0===t?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),t),"yyyy-MM-dd"))),[]).map((e=>i.map((a=>{n+=q.value;const t=Date.parse(`${e} ${a.start}`),l=Date.parse(`${e} ${a.end}`);return{start:t,end:l,left:n,center:n+q.value/2,scaleCell:(l-t)/q.value}}))));return v(o)})),B=a((()=>ue("breathe"))),E=a((()=>ue("pulse"))),F=a((()=>ue("temperature"))),J=a((()=>ue("pain"))),K=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Q=a((()=>{const{left:e}=S.data;return v(e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((a,t)=>({...a,bigType:r(a.title,e.type),unit:e.unit,dataIndex:t}))))))})),U=a((()=>{var e,a;const{left:t}=S.data,l=t.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(a=null==(e=t.yScaleValue[l].dataList)?void 0:e[0])?void 0:a.show)?l:-1})),Z=a((()=>{const{grid:e}=S.data;return-1===U.value?0:z.value*e.subYCell})),_=a((()=>{const{left:e}=S.data,a={originY:G.value+j.value[0]*z.value,endY:$.value-j.value[1]*z.value};return 0===U.value&&e.yScaleValue.length>1?a.endY=a.originY+Z.value:U.value===e.yScaleValue.length-1&&(a.originY=a.endY-Z.value),a})),ee=a((()=>{const{left:e}=S.data,a={originY:G.value+V.value[0]*z.value,endY:$.value-V.value[2]*z.value};return 0===U.value&&e.yScaleValue.length>1?a.originY=_.value.endY+V.value[0]*z.value:U.value===e.yScaleValue.length-1&&(a.endY=_.value.originY-V.value[2]*z.value),a})),ae=a((()=>{var e,a;const{top:t,grid:l}=S.data,u=[];for(const i in t)t[i].show&&u.push({...t[i],list:(null==(a=null==(e=t[i].list)?void 0:e.slice)?void 0:a.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,a)=>e.seq-a.seq))})),te=a((()=>{var e;const{left:a,right:t}=S.data,l=a.yScaleValue.find((e=>"temperature"===e.type)),u=(null==t?void 0:t.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const a=e[e.length-1];return a?e.concat([a+1,a+2]):e.concat([92])}),[]):[],a=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:a,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),le=e({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...u,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:X.value,hospitalDaysHeight:L.value,operationDaysHeight:P.value,xScalevalueHeight:M.value,topList:ae.value,breathingHeight:I.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:U.value,painHeight:Z.value,painOriginY:_.value,vitalSignsOriginY:ee.value,gridXNumber:N.value,gridYNumber:k.value,iconsWidth:T.value,originX:W.value,originY:G.value,endX:O.value,endXLimit:R.value,endY:$.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:A.value,breatheYCell:B.value,pulseYCell:E.value,temperatureYCell:F.value,painYCell:J.value,event:K.value,itemList:Q.value,getRightInfo:te.value,config:S.data.config||{},surplusCell:V.value,painSurplusCell:j.value,mainSurplusCell:H.value});function ue(e){const{yScaleValue:a}=S.data.left,t=a.find((a=>a.type===e)),l=(null==t?void 0:t.list)||[];return l.length?z.value/((l[1]-l[0])/t.spaceGridNumber):0}const{computedX:ie,computedY:ne,getXValue:re,getYValue:oe}=i(le);return t((()=>y.value),(e=>{e&&function(){c(y,le);const{setPopup:e,isAddPoint:a,updateData:t,redrawPoints:l,clickMenu:u,gridPoints:i,fixedNoRisePoints:r}=g(y,le,Y,ie,ne,re,oe,S.addRenderItem,b,C);D.redrawPoints=l,D.clickMenu=u;const{drawScaleValue:o}=p(y,le,Y,e,b,ie,ne,re,oe,a,t,i);h(y,le,o),m(y,le),f(y,le,Y,ie,ne,r);const{select:v}=n(y,le,Y);D.select=v}()}),{immediate:!0}),{propItems:le,...l(D)}}export{y as useTemperatureChart};
@@ -1,6 +1,6 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../shared/utils/fabricjs';
3
- import { AnyObject } from '../../../shared/types';
3
+ import { AnyObject, AnyFn } from '../../../shared/types';
4
4
  export type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | 'electrocardiogram' | 'newBirthProcess' | undefined;
5
5
  export type ILineCoordinate = [number, number, number, number];
6
6
  interface IEvent {
@@ -180,4 +180,14 @@ export type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
180
180
  };
181
181
  export type IFabricChartMainParam = [Ref<fabric.Canvas>, any, any, Ref<any>, IPointTipProps, IPointMenuProps];
182
182
  export type IPointer = [number, number];
183
+ export type IexposeMethods = Partial<{
184
+ select: AnyFn | null;
185
+ redrawPoints: AnyFn | null;
186
+ clickMenu: AnyFn | null;
187
+ updatePolyline: AnyFn | null;
188
+ useMeasureRuler: AnyFn | null;
189
+ useCaliper: AnyFn | null;
190
+ useCaliperRuler: AnyFn | null;
191
+ useRectRuler: AnyFn | null;
192
+ }>;
183
193
  export {};
@@ -725,8 +725,8 @@ declare const _default: import("vue").DefineComponent<{
725
725
  showSeq: boolean;
726
726
  footerFlag: boolean;
727
727
  fieldDescribeMode: "column" | "tooltip";
728
- showSearch: boolean;
729
728
  customColumns: FieldSetColumnItem[];
729
+ showSearch: boolean;
730
730
  showSortPriority: boolean;
731
731
  showHeadFilter: boolean;
732
732
  }>;
@@ -16,6 +16,13 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
16
16
  type: StringConstructor;
17
17
  default: string;
18
18
  };
19
+ chatBox: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ defaultSessionKey: {
24
+ type: StringConstructor;
25
+ };
19
26
  }, {
20
27
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
21
28
  token: {
@@ -34,6 +41,13 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
34
41
  type: StringConstructor;
35
42
  default: string;
36
43
  };
44
+ chatBox: {
45
+ type: BooleanConstructor;
46
+ default: boolean;
47
+ };
48
+ defaultSessionKey: {
49
+ type: StringConstructor;
50
+ };
37
51
  }>> & {
38
52
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
39
53
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
@@ -73,6 +87,7 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
73
87
  handleUserSearch: () => Promise<void>;
74
88
  initWebSocket: () => void;
75
89
  subscribeSessionList: () => void;
90
+ handleDefaultSession: () => void;
76
91
  subscribeGroupMessage: () => void;
77
92
  subscribeMessage: () => void;
78
93
  handleMessage: (messageVo: import("../../shared/types").AnyObject, chatType: string) => Promise<void>;
@@ -1217,10 +1232,18 @@ declare const IhoChat: SFCWithInstall<import("vue").DefineComponent<{
1217
1232
  type: StringConstructor;
1218
1233
  default: string;
1219
1234
  };
1235
+ chatBox: {
1236
+ type: BooleanConstructor;
1237
+ default: boolean;
1238
+ };
1239
+ defaultSessionKey: {
1240
+ type: StringConstructor;
1241
+ };
1220
1242
  }>> & {
1221
1243
  "onTemplate-click"?: ((...args: any[]) => any) | undefined;
1222
1244
  "onUnread-message-update"?: ((...args: any[]) => any) | undefined;
1223
1245
  }, {
1224
1246
  baseURL: string;
1247
+ chatBox: boolean;
1225
1248
  }>>;
1226
1249
  export default IhoChat;