cnhis-design-vue 3.1.45-release.1 → 3.1.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +87 -87
  2. package/es/components/annotation-edit/src/AnnotationEdit.js +1 -1
  3. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  4. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  6. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  7. package/es/components/fabric-chart/index.d.ts +40 -5
  8. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +40 -5
  9. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  10. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -0
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -0
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -0
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +20 -0
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -0
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -0
  18. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useRight.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -1
  23. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -1
  25. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  26. package/es/components/fabric-chart/src/interface.d.ts +13 -0
  27. package/es/components/fabric-chart/src/utils/index.d.ts +2 -1
  28. package/es/components/fabric-chart/src/utils/index.js +1 -1
  29. package/es/components/field-set/index.d.ts +157 -38
  30. package/es/components/field-set/src/FieldSet.vue.d.ts +160 -23
  31. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  32. package/es/components/field-set/src/components/Row.vue.d.ts +132 -0
  33. package/es/components/field-set/src/components/Row.vue.js +1 -0
  34. package/es/components/field-set/src/components/Row.vue2.js +1 -0
  35. package/es/components/field-set/src/types/index.d.ts +1 -0
  36. package/es/components/field-set/src/utils/index.d.ts +7 -0
  37. package/es/components/field-set/src/utils/index.js +1 -0
  38. package/es/components/field-set/style/index.css +1 -1
  39. package/es/components/form-config/index.d.ts +3534 -21
  40. package/es/components/form-config/src/FormConfig.vue.d.ts +3534 -21
  41. package/es/components/form-config/src/FormConfig.vue2.js +1 -1
  42. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +31 -4
  43. package/es/components/form-config/src/components/FormConfigDragDisplay.vue2.js +1 -1
  44. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +33 -4
  45. package/es/components/form-config/src/components/FormConfigMaterialItem.d.ts +11 -1
  46. package/es/components/form-config/src/components/FormConfigMaterialItem.js +1 -1
  47. package/es/components/form-config/src/components/renderer/DefaultNode.vue.d.ts +2 -0
  48. package/es/components/form-config/src/components/renderer/DefaultNode.vue2.js +1 -1
  49. package/es/components/form-config/src/constants/index.d.ts +1 -0
  50. package/es/components/form-config/src/constants/index.js +1 -1
  51. package/es/components/form-config/src/hooks/useSortalbeConfig.js +1 -1
  52. package/es/components/form-config/src/types/index.d.ts +2 -0
  53. package/es/components/form-config/style/index.css +1 -1
  54. package/es/components/form-render/index.d.ts +31 -4
  55. package/es/components/form-render/src/FormRender.vue.d.ts +31 -4
  56. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  57. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +31 -4
  58. package/es/components/form-render/src/components/renderer/combination.d.ts +5 -5
  59. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  60. package/es/components/form-render/src/components/renderer/jsonCombination/index.d.ts +5 -5
  61. package/es/components/form-render/src/components/renderer/jsonCombination/index.js +1 -1
  62. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  63. package/es/components/form-render/src/constants/index.d.ts +2 -0
  64. package/es/components/form-render/src/constants/index.js +1 -1
  65. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  66. package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +1 -1
  67. package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -1
  68. package/es/components/form-render/src/hooks/useFormContext.js +1 -1
  69. package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +3 -1
  70. package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +1 -1
  71. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  72. package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
  73. package/es/components/form-render/src/types/index.d.ts +2 -0
  74. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +1 -1
  75. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  76. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  77. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/hooks/useAutoFocus.js +1 -1
  78. package/es/components/index.css +1 -1
  79. package/es/components/info-header/index.d.ts +72 -10
  80. package/es/components/info-header/src/InfoHeader.vue.d.ts +72 -10
  81. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +31 -4
  82. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +31 -4
  83. package/es/components/keyboard/index.d.ts +1 -1
  84. package/es/components/keyboard/src/Keyboard.vue.d.ts +1 -1
  85. package/es/components/recommend-search/index.d.ts +2 -2
  86. package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +2 -2
  87. package/es/components/recommend-search/src/components/BaseSearch.d.ts +1 -1
  88. package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +1 -1
  89. package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +1 -1
  90. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  91. package/es/components/search-cascader/index.d.ts +16 -3
  92. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +16 -3
  93. package/es/components/search-cascader/src/SearchCascader.vue2.js +1 -1
  94. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  95. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  96. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  97. package/es/components/shortcut-setter/index.d.ts +31 -4
  98. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +31 -4
  99. package/es/env.d.ts +25 -25
  100. package/es/shared/assets/img/failure.png.js +1 -1
  101. package/es/shared/assets/img/no-permission.png.js +1 -1
  102. package/es/shared/assets/img/nodata.png.js +1 -1
  103. package/es/shared/assets/img/notfound.png.js +1 -1
  104. package/es/shared/assets/img/qr.png.js +1 -1
  105. package/es/shared/assets/img/success.png.js +1 -1
  106. package/es/shared/assets/img/video.png.js +1 -1
  107. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  108. package/es/shared/assets/img/xb_big.png.js +1 -1
  109. package/es/shared/assets/img/xb_small.png.js +1 -1
  110. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  111. package/es/shared/hooks/useAsyncQueue.d.ts +3 -1
  112. package/es/shared/hooks/useAsyncQueue.js +1 -1
  113. package/es/shared/package.json.js +1 -1
  114. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  115. package/es/shared/utils/tapable/index.d.ts +139 -0
  116. package/package.json +2 -2
  117. package/es/components/search-cascader/src/hooks/index.d.ts +0 -1
  118. package/es/components/search-cascader/src/hooks/index.js +0 -1
  119. package/es/components/search-cascader/src/hooks/useCssVariable.d.ts +0 -3
  120. package/es/components/search-cascader/src/hooks/useCssVariable.js +0 -1
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
+ ```
@@ -1 +1 @@
1
- import{defineComponent as e,computed as o,ref as a,onDeactivated as t,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),b=o({get:()=>T.value,async set(e){T.value=e,!e&&k.value&&(await new Promise((e=>setTimeout(e,200))),k.value=!1)}}),k=a(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),b.value&&k.value?b.value=!1:u(x)||(y=setTimeout((()=>{k.value=b.value=!0}),200))}function M(e){e.stopPropagation(),clearTimeout(y),u(x)&&(b.value=!0,k.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(x)&&(b.value=!0)}function j(e){e.stopPropagation(),clearTimeout(_),u(x)&&!k.value&&(_=setTimeout((()=>{b.value=!1}),300))}return t((()=>{b.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(x)}],style:{"--icon-right":"-5",...w.value},"annotation-hover-show":!u(x)&&!k.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:b.value,"onUpdate:show":e=>b.value=e,trigger:"manual",duration:100},{default:function(){return l("section",{onMouseleave:j,onMouseenter:R},[l("div",null,[k.value?l(h,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:x.value,"onUpdate:value":e=>x.value=e},null):l("span",null,[u(x)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:j,onMouseenter:R,onDblclick:M,onClick:P},[l(V,{component:u(x)?d:v},null)])}})])}}});export{g as default};
1
+ import{defineComponent as e,computed as o,ref as a,onDeactivated as t,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),k=o({get:()=>T.value,async set(e){T.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=a(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),k.value&&b.value?k.value=!1:u(x)||(y=setTimeout((()=>{b.value=k.value=!0}),200))}function M(e){e.stopPropagation(),clearTimeout(y),u(x)&&(k.value=!0,b.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(x)&&(k.value=!0)}function j(e){e.stopPropagation(),clearTimeout(_),u(x)&&!b.value&&(_=setTimeout((()=>{k.value=!1}),300))}return t((()=>{k.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(x)}],style:{"--icon-right":"-5",...w.value},"annotation-hover-show":!u(x)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:k.value,"onUpdate:show":e=>k.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:j,onMouseenter:R},[l("div",null,[b.value?l(h,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:x.value,"onUpdate:value":e=>x.value=e},null):l("span",null,[u(x)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:j,onMouseenter:R,onDblclick:M,onClick:P},[l(V,{component:u(x)?d:v},null)])}})])}}});export{g as default};
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/Viewer';
@@ -0,0 +1 @@
1
+ declare module 'bpmn-js/lib/features/modeling';
@@ -0,0 +1 @@
1
+ declare module 'diagram-js/lib/navigation/movecanvas';
@@ -35,13 +35,48 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
35
35
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
36
36
  canvas: import("vue").Ref<any>;
37
37
  propItems: any;
38
- redrawPoints: any;
39
- select: any;
40
- pointTipProps: any;
41
- pointMenuProps: any;
42
- clickMenu: any;
38
+ redrawPoints: import("vue").Ref<any>;
39
+ select: import("vue").Ref<any>;
40
+ pointTipProps: {
41
+ show: boolean;
42
+ point: {
43
+ x: number;
44
+ y: number;
45
+ };
46
+ list: string[];
47
+ };
48
+ pointMenuProps: {
49
+ show: boolean;
50
+ point: {
51
+ x: number;
52
+ y: number;
53
+ };
54
+ list: any[];
55
+ target: any;
56
+ };
57
+ clickMenu: import("vue").Ref<any>;
43
58
  init: () => {
44
59
  propItems: any;
60
+ redrawPoints: import("vue").Ref<any>;
61
+ select: import("vue").Ref<any>;
62
+ pointTipProps: {
63
+ show: boolean;
64
+ point: {
65
+ x: number;
66
+ y: number;
67
+ };
68
+ list: string[];
69
+ };
70
+ pointMenuProps: {
71
+ show: boolean;
72
+ point: {
73
+ x: number;
74
+ y: number;
75
+ };
76
+ list: any[];
77
+ target: any;
78
+ };
79
+ clickMenu: import("vue").Ref<any>;
45
80
  };
46
81
  PopupTip: import("vue").DefineComponent<{
47
82
  show: {
@@ -37,13 +37,48 @@ declare const _default: import("vue").DefineComponent<{
37
37
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
38
38
  canvas: import("vue").Ref<any>;
39
39
  propItems: any;
40
- redrawPoints: any;
41
- select: any;
42
- pointTipProps: any;
43
- pointMenuProps: any;
44
- clickMenu: any;
40
+ redrawPoints: import("vue").Ref<any>;
41
+ select: import("vue").Ref<any>;
42
+ pointTipProps: {
43
+ show: boolean;
44
+ point: {
45
+ x: number;
46
+ y: number;
47
+ };
48
+ list: string[];
49
+ };
50
+ pointMenuProps: {
51
+ show: boolean;
52
+ point: {
53
+ x: number;
54
+ y: number;
55
+ };
56
+ list: any[];
57
+ target: any;
58
+ };
59
+ clickMenu: import("vue").Ref<any>;
45
60
  init: () => {
46
61
  propItems: any;
62
+ redrawPoints: import("vue").Ref<any>;
63
+ select: import("vue").Ref<any>;
64
+ pointTipProps: {
65
+ show: boolean;
66
+ point: {
67
+ x: number;
68
+ y: number;
69
+ };
70
+ list: string[];
71
+ };
72
+ pointMenuProps: {
73
+ show: boolean;
74
+ point: {
75
+ x: number;
76
+ y: number;
77
+ };
78
+ list: any[];
79
+ target: any;
80
+ };
81
+ clickMenu: import("vue").Ref<any>;
47
82
  };
48
83
  PopupTip: import("vue").DefineComponent<{
49
84
  show: {
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as n,drawText as o,defaultTextStyle as i,drawPoint as r,defaultStyle as l,defaultRectStyle as s}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as c,drawScaleNumber as f,drawScaleLine as d}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as h,isEffectiveNode as g}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as m}from"lodash-es";import{format as v}from"date-fns";function y(y,k,w,x,b){const{cumputedX:T,cumputedY:j,getXValue:S,getYValue:C}=u(k),{getEqualXTypes:M,handleAddPrevent:P}=p(y,w),{xAxis:E,grid:G,originX:L,originY:Y,xCellWidth:X,endY:A,startTime:H,leftAddAreaWidth:I,leftScales:D,rightScales:O,yCellHeight:W,endX:V,scaleValues:N,canvasWidth:R,borderStyle:$,rightAddAreaWidth:B,event:F,originYCervix:q,other:z,canvasHeight:J}=k,K=m(N),Q=new Set;function U(){K.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:b,type:T="circle",childbirthStyle:j={}}=e,M=e.data[d+1],P=ne(M,e);if(s&&P&&!f.breakpoint)h=t([...s,...P],{...m});else if(s&&!P&&!f.breakpoint){const n=ne(M,e);h=n?t([...s,...n],{...m}):null}let E,G;if(f.childbirth){const e=s[1]+W;E=n([s[0],s[1],e],j),c.push(E),G=o([s[0]+X/2,e-W/2],{value:String(f.childbirth),...i,originX:"left",originY:"center",...j}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:v,key:b||"",dataIndex:l,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:k.event};L?p=r(T,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=r(T,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(e){F.hovered&&(e.on("mouseover",(()=>{te(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ee(e),function(e){var t,n,o,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),null==(o=e.arrowGroup)||o.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+X/2,top:e.top+W/2})}(e),F.hovered&&te(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{key:t}=e.origin,n={...e.origin,data:{...e.origin.data,time:S(e.left),value:C(t,e.top)}};y.value.discardActiveObject(),w("change",n),Z(n,"change")}}))}(p),a.push(p),Q.add(p))}(ne(s,e),s,f)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let n=null;e=e.filter((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(c).then((n=>{y.value.add(...t,...e,...n),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function Z(e,t="add"){const{dataIndex:n,data:o,index:i,key:r}=e,l=K.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const e=h(o.time,l.data);l.data.splice(e,0,o);break}}_()}function _(){var e;Q.size&&(null==(e=y.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),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...Q]))),Q.clear(),U()}function ee(e){const t=e.prevPoint?e.prevPoint.left:L,n=e.nextPoint?e.nextPoint.left:V;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<q&&e.set("top",q),e.top<Y&&e.set("top",Y),e.top>A&&e.set("top",A),e.left<t&&e.set("left",t),e.left>n&&e.set("left",n)}function te(e,t="moving"){const{title:n,key:o,data:i}=e.origin;x.point={x:e.left,y:e.top},x.list=[`${n} ${"hover"===t?i.value:C(o,e.top)}`,`时间 ${S(e.left).slice(-5)}`],x.show=!0}function ne(e,t){if(g(e)&&function(e){const t=H+864e5,n=new Date(e).getTime();return n>=H&&n<=t}(e.time)){const n=T(e.time),o=j(t.key,t.range,e.value);return[n,o<Y?Y:o>A?A:o]}}function oe(e,t){return e+1>t[1]?t[0]:e+1}return a(y,k,!0),function(){const t=new e.Rect({...$,width:R-I-B-1,height:A-1,left:I,top:0,fill:"transparent"});y.value.add(t)}(),function(){function t(t,n="left"){let r="left"===n?I:V;t.forEach(((t,n)=>{const{range:a,spaceValue:u,width:p,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],T=[],j=r+p/2,S=function(e,t){const n=[],[o,i]=e;for(let e=o;t>0?e<=i:e>=i;e+=t)n.push(e);return n}(a,u),C=S.length;S.forEach(((e,n)=>{const{lineXMain:o,lineXSub:i,textLeft:l}=c(v,r,p),s=A-n*W*k,a=0===n?A-8:n!==S.length-1||Y||q&&"FHR"!==m?s:Y+8;!w||(0===n||n===C-1)&&!x||b.push(f(String(e),t,l,a)),T.push(...d(t,n,o,i,s,W,Y,C))}));const M=new e.Rect({...s,strokeWidth:.5,width:p,height:A,left:j,top:A/2}),P=o([j,Y>0?Y-W/2:W/2],{value:String(h),...i,...g}),E=new e.Group([...T,...b,M,...P?[P]:[]],{objectCaching:!1,...l});y.value.add(E),E.sendToBack(),r+=p}))}t(D),t(O,"right")}(),function(){const{show:t,startTime:n,range:r=[0,23],position:s="top",style:a}=E.time,{show:u,range:c=[0,23],position:f,style:d}=E.processTime;if(t||u){const p=[],h=[],g=[],m=[],v=L+X/2,k=W/2;for(let e=0;e<G.mainXCell;e++){if(t){const t=0===e?+n.slice(11,13):oe(p.at(-1),r);p.push(t);const l="top"===s?Y-k:A+k;g.push(o([v+e*X,l],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const n="top"===f?k:J-k;m.push(o([v+e*X,n],{value:String(t),...i,...d||{}}))}}const w=new e.Group([...g,...m],{objectCaching:!1,...l});y.value.add(w),y.value.sendToBack(w)}}(),function(){var e;const n=Object.values(z),o=[],i={},r=K.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:n,range:o}=r||{},i=j(n,o,10),l=[0,t],s=[-t/e,0],a=[(A-i-t)/e,A-i],u=[V-L,e*(V-L)+t];let c=[],f=[];function d([n,o]){return Math.abs(o-e*n-t)<=1}function p([e,t]){const[n,o]=[...h([e,t])];return n>=L&&n<=V&&o>=i&&o<=A}function h([e,t]){return[L+e,A-t]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}n.forEach((e=>{if(!e.show)return;const{key:n}=e;switch(n){case"fetalPresentation":{const{range:i,show:r}=K.find((e=>e.key===n));if(r){const r=j(n,i,0);o.push(t([L,r,V,r],{...e}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:v(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[T(l.time)-L,A-j(n,a,l.value)],[p,h]=[T(c.time)-L,A-j(n,a,c.value)],g=(h-d)/(p-f),m=d-f*g,y=s(g,m);y.length>0&&(o.push(t(y,{...e})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(T(v(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-T(l.time))*n);u.length>0&&o.push(t(u,{...e}))}}})),y.value.add(...o)}(),U(),function(){function e(e,t){const n=K.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:n,key:e.key},pointer:t}}k.event.evented&&y.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:o=0}=t.pointer||{};n>=L&&n<=V&&o>=Y&&o<=A&&(b.point={x:n,y:o},b.show=!0,t.target?(b.target=t.target,b.list=["删除节点"],y.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&b.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(b.target=null,b.list=["新增节点"],K.filter((e=>e.show)).forEach((i=>{if(!M(n,"key",X).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;b.list.push(e(i,t.pointer))}})),1===b.list.length&&(b.show=!1,P("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=R-B/2;function n(t,n){if(!t.length)return;let l=Y;const s=[];t.forEach((t=>{const o=t.title.split("").join("\n"),a=N.findIndex((e=>e.key===t.key)),u=new e.Text(String(o),{...i,...t.titleStyle||{},originY:"top",left:n,top:l,lineHeight:1}),c=r(t.type,{left:n,top:l+u.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:a,key:t.key,isMenu:!0},originLeft:n,originTop:l+u.height+3,...k.event});l+=u.height+c.height+15,function(e){function t(e){const{left:t,top:n}=e;return t>=L&&t<=V&&n>=Y&&n<=A}e.on("moving",(()=>{e.set("originY","center"),t(e)?(ee(e),te(e)):x.show=!1})),e.on("mouseup:before",(n=>{if(x.show=!1,0===n.e.button&&t(e))if(M(e.left,"key",X).includes(e.origin.key))P("repeat");else{const t={data:{time:S(e.left),value:C(e.origin.key,e.top)},...e.origin};w("add",t),Z(t)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(e)}))}(c),s.push(u,c)})),o(s),y.value.add(...s)}function o(e){const t=e.at(-1),n=(A-Y)/2,o=(t.height+t.top-Y)/2;e.forEach((e=>{const t=e.top+n-o;e.set({top:t,originTop:t})}))}n(D,I/2),n(O,t)}(),{clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(w("remove",n),Z(n,"remove")):(Object.assign(n,{data:{time:S(e.pointer.x),value:C(e.origin.key,e.pointer.y)}}),w("add",n),Z(n))},redrawPoints:_}}export{y as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as n,drawText as o,defaultTextStyle as i,drawPoint as r,defaultStyle as l,defaultRectStyle as s}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as c,drawScaleNumber as f,drawScaleLine as d}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as h,isEffectiveNode as g}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as m}from"lodash-es";import{format as v}from"date-fns";function y(y,k,w,x,b){const{cumputedX:T,cumputedY:j,getXValue:S,getYValue:C}=u(k),{getEqualXTypes:M,handleAddPrevent:P}=p(y,w),{xAxis:E,grid:G,originX:L,originY:Y,xCellWidth:X,endY:A,startTime:H,leftAddAreaWidth:I,leftScales:D,rightScales:O,yCellHeight:W,endX:V,scaleValues:N,canvasWidth:R,borderStyle:$,rightAddAreaWidth:B,event:F,originYCervix:q,other:z,canvasHeight:J}=k,K=m(N),Q=new Set;function U(){K.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:b,type:T="circle",childbirthStyle:j={}}=e,M=e.data[d+1],P=ne(M,e);if(s&&P&&!f.breakpoint)h=t([...s,...P],{...m});else if(s&&!P&&!f.breakpoint){const n=ne(M,e);h=n?t([...s,...n],{...m}):null}let E,G;if(f.childbirth){const e=s[1]+W;E=n([s[0],s[1],e],j),c.push(E),G=o([s[0]+X/2,e-W/2],{value:String(f.childbirth),...i,originX:"left",originY:"center",...j}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:v,key:b||"",dataIndex:l,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:k.event};L?p=r(T,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=r(T,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(e){F.hovered&&(e.on("mouseover",(()=>{te(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ee(e),function(e){var t,n,o,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top}),null==(o=e.arrowGroup)||o.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+X/2,top:e.top+W/2})}(e),F.hovered&&te(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{key:t}=e.origin,n={...e.origin,data:{...e.origin.data,time:S(e.left),value:C(t,e.top)}};y.value.discardActiveObject(),w("change",n),Z(n,"change")}}))}(p),a.push(p),Q.add(p))}(ne(s,e),s,f)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let n=null;e=e.filter((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(c).then((n=>{y.value.add(...t,...e,...n),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function Z(e,t="add"){const{dataIndex:n,data:o,index:i,key:r}=e,l=K.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const e=h(o.time,l.data);l.data.splice(e,0,o);break}}_()}function _(){var e;Q.size&&(null==(e=y.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),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...Q]))),Q.clear(),U()}function ee(e){const t=e.prevPoint?e.prevPoint.left:L,n=e.nextPoint?e.nextPoint.left:V;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<q&&e.set("top",q),e.top<Y&&e.set("top",Y),e.top>A&&e.set("top",A),e.left<t&&e.set("left",t),e.left>n&&e.set("left",n)}function te(e,t="moving"){const{title:n,key:o,data:i}=e.origin;x.point={x:e.left,y:e.top},x.list=[`${n} ${"hover"===t?i.value:C(o,e.top)}`,`时间 ${S(e.left).slice(-5)}`],x.show=!0}function ne(e,t){if(g(e)&&function(e){const t=H+864e5,n=new Date(e).getTime();return n>=H&&n<=t}(e.time)){const n=T(e.time),o=j(t.key,t.range,e.value);return[n,o<Y?Y:o>A?A:o]}}function oe(e,t){return e+1>t[1]?t[0]:e+1}return a(y,k),function(){const t=new e.Rect({...$,width:R-I-B-1,height:A-1,left:I,top:0,fill:"transparent"});y.value.add(t)}(),function(){function t(t,n="left"){let r="left"===n?I:V;t.forEach(((t,n)=>{const{range:a,spaceValue:u,width:p,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],T=[],j=r+p/2,S=function(e,t){const n=[],[o,i]=e;for(let e=o;t>0?e<=i:e>=i;e+=t)n.push(e);return n}(a,u),C=S.length;S.forEach(((e,n)=>{const{lineXMain:o,lineXSub:i,textLeft:l}=c(v,r,p),s=A-n*W*k,a=0===n?A-8:n!==S.length-1||Y||q&&"FHR"!==m?s:Y+8;!w||(0===n||n===C-1)&&!x||b.push(f(String(e),t,l,a)),T.push(...d(t,n,o,i,s,W,Y,C))}));const M=new e.Rect({...s,strokeWidth:.5,width:p,height:A,left:j,top:A/2}),P=o([j,Y>0?Y-W/2:W/2],{value:String(h),...i,...g}),E=new e.Group([...T,...b,M,...P?[P]:[]],{objectCaching:!1,...l});y.value.add(E),E.sendToBack(),r+=p}))}t(D),t(O,"right")}(),function(){const{show:t,startTime:n,range:r=[0,23],position:s="top",style:a}=E.time,{show:u,range:c=[0,23],position:f,style:d}=E.processTime;if(t||u){const p=[],h=[],g=[],m=[],v=L+X/2,k=W/2;for(let e=0;e<G.mainXCell;e++){if(t){const t=0===e?+n.slice(11,13):oe(p.at(-1),r);p.push(t);const l="top"===s?Y-k:A+k;g.push(o([v+e*X,l],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const n="top"===f?k:J-k;m.push(o([v+e*X,n],{value:String(t),...i,...d||{}}))}}const w=new e.Group([...g,...m],{objectCaching:!1,...l});y.value.add(w),y.value.sendToBack(w)}}(),function(){var e;const n=Object.values(z),o=[],i={},r=K.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:n,range:o}=r||{},i=j(n,o,10),l=[0,t],s=[-t/e,0],a=[(A-i-t)/e,A-i],u=[V-L,e*(V-L)+t];let c=[],f=[];function d([n,o]){return Math.abs(o-e*n-t)<=1}function p([e,t]){const[n,o]=[...h([e,t])];return n>=L&&n<=V&&o>=i&&o<=A}function h([e,t]){return[L+e,A-t]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}n.forEach((e=>{if(!e.show)return;const{key:n}=e;switch(n){case"fetalPresentation":{const{range:i,show:r}=K.find((e=>e.key===n));if(r){const r=j(n,i,0);o.push(t([L,r,V,r],{...e}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:v(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[T(l.time)-L,A-j(n,a,l.value)],[p,h]=[T(c.time)-L,A-j(n,a,c.value)],g=(h-d)/(p-f),m=d-f*g,y=s(g,m);y.length>0&&(o.push(t(y,{...e})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(T(v(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-T(l.time))*n);u.length>0&&o.push(t(u,{...e}))}}})),y.value.add(...o)}(),U(),function(){function e(e,t){const n=K.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:n,key:e.key},pointer:t}}k.event.evented&&y.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:o=0}=t.pointer||{};n>=L&&n<=V&&o>=Y&&o<=A&&(b.point={x:n,y:o},b.show=!0,t.target?(b.target=t.target,b.list=["删除节点"],y.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&b.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(b.target=null,b.list=["新增节点"],K.filter((e=>e.show)).forEach((i=>{if(!M(n,"key",X).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;b.list.push(e(i,t.pointer))}})),1===b.list.length&&(b.show=!1,P("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=R-B/2;function n(t,n){if(!t.length)return;let l=Y;const s=[];t.forEach((t=>{const o=t.title.split("").join("\n"),a=N.findIndex((e=>e.key===t.key)),u=new e.Text(String(o),{...i,...t.titleStyle||{},originY:"top",left:n,top:l,lineHeight:1}),c=r(t.type,{left:n,top:l+u.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:a,key:t.key,isMenu:!0},originLeft:n,originTop:l+u.height+3,...k.event});l+=u.height+c.height+15,function(e){function t(e){const{left:t,top:n}=e;return t>=L&&t<=V&&n>=Y&&n<=A}e.on("moving",(()=>{e.set("originY","center"),t(e)?(ee(e),te(e)):x.show=!1})),e.on("mouseup:before",(n=>{if(x.show=!1,0===n.e.button&&t(e))if(M(e.left,"key",X).includes(e.origin.key))P("repeat");else{const t={data:{time:S(e.left),value:C(e.origin.key,e.top)},...e.origin};w("add",t),Z(t)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(e)}))}(c),s.push(u,c)})),o(s),y.value.add(...s)}function o(e){const t=e.at(-1),n=(A-Y)/2,o=(t.height+t.top-Y)/2;e.forEach((e=>{const t=e.top+n-o;e.set({top:t,originTop:t})}))}n(D,I/2),n(O,t)}(),{clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(w("remove",n),Z(n,"remove")):(Object.assign(n,{data:{time:S(e.pointer.x),value:C(e.origin.key,e.pointer.y)}}),w("add",n),Z(n))},redrawPoints:_}}export{y as useBirthProcess};
@@ -0,0 +1,2 @@
1
+ export * from './useTop';
2
+ export * from './useCenter';
@@ -0,0 +1 @@
1
+ export{useTop}from"./useTop.js";export{useCenter}from"./useCenter.js";
@@ -0,0 +1,4 @@
1
+ import { type Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject): void;
@@ -0,0 +1 @@
1
+ import"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import"../temperature/useShadow.js";function e(e,o){r(e,o)}export{e as useCenter};
@@ -3,4 +3,24 @@ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
4
  export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
5
5
  propItems: any;
6
+ redrawPoints: Ref<any>;
7
+ select: Ref<any>;
8
+ pointTipProps: {
9
+ show: boolean;
10
+ point: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ list: string[];
15
+ };
16
+ pointMenuProps: {
17
+ show: boolean;
18
+ point: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ list: any[];
23
+ target: any;
24
+ };
25
+ clickMenu: Ref<any>;
6
26
  };
@@ -1 +1 @@
1
- import{ref as t,reactive as r}from"vue";import{defaultBorderStyle as e}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"../temperature/useShadow.js";function o(o,a,i,s){t(),t(),t(),r({show:!1,point:{x:0,y:0},list:[]}),r({show:!1,point:{x:0,y:0},list:[],target:null});return{propItems:r({canvasWidth:a.data.width,canvasHeight:a.data.height,borderStyle:{...e,...a.data.borderStyle||{}},grid:a.data.grid,other:a.data.other})}}export{o as useSurgicalAnesthesiaChart};
1
+ import{ref as t,reactive as e,onMounted as i,nextTick as r}from"vue";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as n}from"date-fns";import{getChildrenSize as a}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as s,range as l}from"lodash-es";import"../temperature/useShadow.js";import{useTop as d}from"./useTop.js";import{useCenter as p}from"./useCenter.js";function u(u,c,h,m){var g;const f=t(),x=t(),w=t(),b=e({show:!1,point:{x:0,y:0},list:[]}),y=e({show:!1,point:{x:0,y:0},list:[],target:null}),v=null!=(g=c.data.left.width)?g:0,Y=a(c.data.top.treeData),j=function(){const{xAxis:t}=c.data;return"top"===t.position?t.height:0}(),C=function(){console.log(v);const t=s(c.data.top.treeData);let e=0;const{cellWidth:i,cellHeight:r}=c.data.top.tree;return function t(o,n=0){o.forEach((o=>{var s;const l={top:e*r+j,left:n*i,width:i,height:r};if(e++,null==(s=o.children)?void 0:s.length){e--;const i=a(o.children);l.height=i*r,t(o.children,n+1)}else l.width=v-l.left;Object.assign(o,l)}))}(t),t}();console.log(C);const H=function(){const{grid:t}=c.data;return t.mainXCell*t.subXCell}(),D=c.data.top.tree.cellHeight,X=j+D*Y,A=function(){const t=s(c.data.xAxis),{position:e,startTime:i,spaceValue:r,spaceTimeStamp:o}=t,a=Date.parse(i),d=l(H/r+1).map((t=>0===t?i:n(new Date(a+t*o),"yyyy-MM-dd HH:mm:ss")));return{...t,list:d,left:v,top:"top"===e?0:X}}(),G=function(){const{grid:t}=c.data;return t.mainYCell*t.subYCell}(),M=function(){var t;const{width:e,right:i}=c.data;if(!i)return e;return e-(null!=(t=i.width)?t:0)}(),S=c.data.xAxis.height+D*Y,T=function(){var t;const{bottom:e=null,height:i}=c.data;if(!e)return i;return i-(null!=(t=e.height)?t:0)}(),N=(M-v)/H,P=(T-S)/G,W=e({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...o,...c.data.borderStyle||{}},grid:c.data.grid,top:c.data.top,other:c.data.other,topGridYNumber:Y,topGridYCellHeight:D,topGridOriginY:j,topGridEndY:X,treeData:C,xAxis:A,gridXNumber:H,gridYNumber:G,xCellWidth:N,yCellHeight:P,originX:v,endX:M,originY:S,endY:T});return i((async()=>{await r(),d(u,W),p(u,W)})),{propItems:W,redrawPoints:x,select:f,pointTipProps:b,pointMenuProps:y,clickMenu:w}}export{u as useSurgicalAnesthesiaChart};
@@ -0,0 +1,4 @@
1
+ import { type Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
+ export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: AnyObject): void;
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as o}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"../temperature/useShadow.js";function r(r,i){const{grid:s,originX:a,endX:n,xCellWidth:u,gridXNumber:p,top:c,topList:l,canvasWidth:d,borderStyle:h,treeData:m,xAxis:f}=i;!function(){const{height:i,list:s,left:a,top:n,spaceValue:p}=f,c=[],l=n+i/2;s.forEach(((t,o)=>{const r=a+o*u*p;c.push(e([r,l],{value:t.slice(11,16)}))}));const d=c.length>0?new t.Group([...c],{...o,objectCaching:!1}):null;d&&r.value.add(d)}()}export{r as useTop};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultTextStyle as e,defaultStyle as i,drawPoint as n,drawTextGroup as o}from"../useDraw.js";import"date-fns";import{getType as l,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as s,drawScaleNumber as a,drawScaleLine as u}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,c,d,f,y,m,v,w,S,b){var Y,x;const{getEqualXTypes:j,handleAddPrevent:T}=h(g,c),{originY:X,endY:C,originX:N,endX:V,xCellWidth:L,yCellHeight:M,left:k,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:W,canvasWidth:R,canvasHeight:_,getRightInfo:B,borderStyle:J}=p;function $(n){var l;if(!(null==n?void 0:n.length))return;const{layout:r}=n[0];let h=G,p=N;"right"===r&&(h=V,p=V+(null!=(l=null==W?void 0:W.width)?l:0));const c=[],d=A&&"right"!==r?n.length-1:n.length,f=(p-h)/d,y=f+(p-h)%d;n.forEach(((n,l)=>{if("pain"===n.type)return void function(i){const{list:n=[],spaceGridNumber:l=5,showScale:r,showNumber:u,position:h,showMaxMinNumber:p,style:c,title:d}=i,f=o({width:N-G,height:A,...J},{value:`${d}`,...e,...c||{}},{left:G,top:I.originY}),y=[];if(r||u){const{lineXMain:e,textLeft:o}=s(h,G,N-G),g=n.length;n.forEach(((n,s)=>{let h=I.endY-s*M*l;if(0===s&&(h=C-5),!u||(0===s||s===g-1)&&!p||y.push(a(n,i,o,h)),r&&0!==s){const[i,n]=e,o=new t.Line([i,h,n,h],{...J,...c});y.push(o)}}))}g.value.add(f,...y),f.sendToBack()}(n);const p=[],d=0===l?y:f,m=0===l?h:y+h+(l-1)*f,v="right"===r?0:E.originY,w="right"===r?_:E.endY,S=l>0?new t.Line([m,v,m,w],{...J}):null;S&&p.push(S);const b=m+d/2,{list:Y=[],spaceGridNumber:x=5,showScale:j,showNumber:T,position:X,showMaxMinNumber:V}=n;if(j||T){const{lineXMain:t,lineXSub:e,textLeft:i}=s(X,m,d),o=Y.length;Y.forEach(((l,r)=>{const s=E.endY-r*M*x;if(T&&(!(0===r||r===o-1)||V)){const t=0==r?s-5:s,e=a(l,n,i,t),o=E.originY+e.height/2;t<o&&e.set({top:o}),p.push(e)}p.push(...u(n,r,t,e,s,M,E.originY))}))}let L=n.title||"";n.unit&&(L+="\n"+n.unit),L&&p.push(new t.Text(String(L),{...e,left:b,top:E.originY+M*x/2,textAlign:"center",...n.style}));const k=new t.Group(p,{...i,objectCaching:!1});c.push(k)}));const m=c.length>0?new t.Group([...c],{...i,objectCaching:!1}):null;m&&g.value.add(m),m&&m.sendToBack()}function q(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=C}G&&function(){const e=JSON.parse(JSON.stringify(H));let o=C;const s=G-k.icons.marginRight;e.reverse().forEach((e=>{o-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...i,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:s-(e.pointAttr.width||10)-5,top:o,lineHeight:1,fontSize:12}),h=n(e.type,{left:s,top:o-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:l(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:s,originTop:o-(u.height||30)/2-1,...p.event});var y;o-=u.height||30,(y=h).on("moving",(()=>{y.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(y),q(y)?d(y):f.show=!1})),y.on("mouseup:before",(t=>{if(f.show=!1,0===t.e.button&&q(y)){const t=j(y.left,"_type",L).includes(y.origin._type),e=S(y.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:v(y.left),value:w(y.origin.type,y.top),...r(y.origin.type)?{key:y.origin.key}:{}},...y.origin};c("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(y)})),g.value.add(u,h)}))}();const z=k.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==W?void 0:W.width)&&"left"===(null==(Y=null==W?void 0:W.yScaleValue)?void 0:Y.layout)&&(null==(x=null==W?void 0:W.yScaleValue)?void 0:x.show)&&z.push(B),O>0&&k.yScaleValue[O].show){const t=k.yScaleValue[O];0===O&&k.yScaleValue.length>1&&z.unshift(t),O==k.yScaleValue.length-1&&z.push(t)}const D=z.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),P=z[D];return D>-1&&z.splice(D,0,{...P,title:(null==P?void 0:P.doubleTitle)||(null==P?void 0:P.title)}),$(z),g.value.add(new t.Rect({left:G,top:0,width:R-G-1,height:_-1,fill:"transparent",...J})),{drawScaleValue:$}}export{g as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o,drawTextGroup as l}from"../useDraw.js";import"date-fns";import{getType as r,isOneLine as s}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as a,drawScaleNumber as u,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as g}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function p(p,c,d,f,y,m,v,w,S,b,Y){var x,j;const{getEqualXTypes:C,handleAddPrevent:T}=g(p,d),{originY:X,endY:k,originX:N,endX:V,xCellWidth:M,yCellHeight:L,left:W,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:R,canvasWidth:_,canvasHeight:B,getRightInfo:J,borderStyle:$}=c;function q(o){var r;if(!(null==o?void 0:o.length))return;const{layout:s}=o[0];let g=G,c=N;"right"===s&&(g=V,c=V+(null!=(r=null==R?void 0:R.width)?r:0));const d=[],f=A&&"right"!==s?o.length-1:o.length,y=(c-g)/f,m=y+(c-g)%f;o.forEach(((o,r)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:r=5,showScale:s,showNumber:h,position:g,showMaxMinNumber:c,style:d,title:f}=n,y=l({width:N-G,height:A,...$},{value:`${f}`,...i,...d||{}},{left:G,top:I.originY}),m=e([G,I.originY,N,I.originY],$),v=[];if(s||h){const{lineXMain:e,textLeft:i}=a(g,G,N-G),l=o.length;o.forEach(((o,a)=>{let g=I.endY-a*L*r;if(0===a&&(g=k-5),!h||(0===a||a===l-1)&&!c||v.push(u(o,n,i,g)),s&&0!==a){const[i,n]=e,o=new t.Line([i,g,n,g],{...$,...d});v.push(o)}}))}p.value.add(m,y,...v),y.sendToBack()}(o);const c=[],f=0===r?m:y,v=0===r?g:m+g+(r-1)*y,w="right"===s?0:E.originY,S="right"===s?B:E.endY,b=r>0?e([v,w,v,S],{objectCaching:!1,...$}):null;b&&c.push(b);const Y=v+f/2,{list:x=[],spaceGridNumber:j=5,showScale:C,showNumber:T,position:X,showMaxMinNumber:V}=o;if(C||T){const{lineXMain:t,lineXSub:e,textLeft:i}=a(X,v,f),n=x.length;x.forEach(((l,r)=>{const s=E.endY-r*L*j;if(T&&(!(0===r||r===n-1)||V)){const t=0==r?s-5:s,e=u(l,o,i,t),n=E.originY+e.height/2;t<n&&e.set({top:n}),c.push(e)}c.push(...h(o,r,t,e,s,L,E.originY))}))}let M=o.title||"";o.unit&&(M+="\n"+o.unit),M&&c.push(new t.Text(String(M),{...i,left:Y,top:E.originY+L*j/2,textAlign:"center",...o.style}));const W=new t.Group(c,{...n,objectCaching:!1});d.push(W)}));const v=d.length>0?new t.Group([...d],{...n,objectCaching:!1}):null;v&&p.value.add(v),v&&v.sendToBack()}function z(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=k}G&&function(){const e=JSON.parse(JSON.stringify(H));let i=k;const l=G-W.icons.marginRight;e.reverse().forEach((e=>{i-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...n,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:i,lineHeight:1,fontSize:12}),h=o(e.type,{left:l,top:i-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:r(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:i-(u.height||30)/2-1,...c.event});var g;i-=u.height||30,(g=h).on("moving",(()=>{g.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(g),z(g)?f(g):y.show=!1})),g.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&z(g)){const t=C(g.left,"_type",M).includes(g.origin._type),e=b(g.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:w(g.left),value:S(g.origin.type,g.top),...s(g.origin.type)?{key:g.origin.key}:{}},...g.origin};d("add",t),Y(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(g)})),p.value.add(u,h)}))}();const D=W.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==R?void 0:R.width)&&"left"===(null==(x=null==R?void 0:R.yScaleValue)?void 0:x.layout)&&(null==(j=null==R?void 0:R.yScaleValue)?void 0:j.show)&&D.push(J),O>0&&W.yScaleValue[O].show){const t=W.yScaleValue[O];0===O&&W.yScaleValue.length>1&&D.unshift(t),O==W.yScaleValue.length-1&&D.push(t)}const P=D.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),F=D[P];return P>-1&&D.splice(P,0,{...F,title:(null==F?void 0:F.doubleTitle)||(null==F?void 0:F.title)}),q(D),p.value.add(new t.Rect({left:G,top:0,width:_-G-$.strokeWidth,height:B-$.strokeWidth,fill:"transparent",...$})),{drawScaleValue:q}}export{p as useLeft};
@@ -1 +1 @@
1
- import{fabric as l}from"../../../../../shared/utils/fabricjs/index.js";function e(e,i,t){var o,n;const{left:d,right:u,getRightInfo:a,canvasWidth:s,endY:h,endX:r,originY:f,borderStyle:v}=i,c=d.yScaleValue.filter((l=>"right"===l.layout&&l.show));(null==u?void 0:u.width)&&"right"===(null==(o=null==u?void 0:u.yScaleValue)?void 0:o.layout)&&(null==(n=null==u?void 0:u.yScaleValue)?void 0:n.show)&&c.push(a);const w=c.findIndex((l=>"pulse"===l.type&&l.show&&l.doubleShow)),g=c[w];if(w>-1&&c.splice(w,0,{...g,title:(null==g?void 0:g.doubleTitle)||(null==g?void 0:g.title)}),(null==u?void 0:u.width)||c.length>0){const i=new l.Line([s-1,0,s-1,h],v),t=new l.Line([r+1,f,s-1,f],{...v,stroke:"#fff"});e.value.add(i,t)}t(c)}export{e as useRight};
1
+ function l(l,o,t){var e,i;const{left:u,right:n,getRightInfo:d}=o,h=u.yScaleValue.filter((l=>"right"===l.layout&&l.show));(null==n?void 0:n.width)&&"right"===(null==(e=null==n?void 0:n.yScaleValue)?void 0:e.layout)&&(null==(i=null==n?void 0:n.yScaleValue)?void 0:i.show)&&h.push(d);const a=h.findIndex((l=>"pulse"===l.type&&l.show&&l.doubleShow)),s=h[a];a>-1&&h.splice(a,0,{...s,title:(null==s?void 0:s.doubleTitle)||(null==s?void 0:s.title)}),t(h)}export{l as useRight};
@@ -1 +1 @@
1
- import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as n}from"../useCumputedPoint.js";import{useEvent as r,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import"date-fns";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as h}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,Y,S){const b=15,w=e(),C=e(),x=e(),j=t({show:!1,point:{x:0,y:0},list:[]}),D=t({show:!1,point:{x:0,y:0},list:[],target:null}),V=a((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||b)||0})),X=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||b)||0})),H=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||b)||0})),L=a((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||b)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=a((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),$=a((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),I=a((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),N=a((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),T=a((()=>{const{grid:e}=y.data;return N.value-e.surplusXCell*M.value})),O=a((()=>{const{top:e,left:t}=y.data;return e.titleWidth+q.value})),W=a((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),k=a((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||b)||0;return V.value+a+l+X.value+H.value})),G=a((()=>{const{grid:e}=y.data;return k.value+e.surplusYCell*R.value})),M=a((()=>(N.value-O.value)/$.value)),R=a((()=>(W.value-k.value)/I.value)),q=a((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),z=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=O.value-M.value;function r(e){const[t="2022",a="01",l="01"]=String(e).match(/\d+/g)||[];return`20${t}`.slice(-4)+"-"+`00${a}`.slice(-2)+"-"+`00${l}`.slice(-2)}return u.map((e=>i.map((t=>{n+=M.value;const a=new Date(`${r(e)} ${t.start}`).getTime(),l=new Date(`${r(e)} ${t.end}`).getTime();return{start:a,end:l,left:n,center:n+M.value/2,scaleCell:(l-a)/M.value}})))).flat()})),A=a((()=>le("breathe"))),B=a((()=>le("pulse"))),E=a((()=>le("temperature"))),F=a((()=>le("pain"))),J=a((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),K=a((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Q=a((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),U=a((()=>{const{grid:e}=y.data;return-1===Q.value?0:R.value*e.subYCell})),Z=a((()=>{const{left:e}=y.data,t={originY:W.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value,t.endY=G.value+U.value):Q.value===e.yScaleValue.length-1&&(t.originY=W.value-U.value,t.endY=W.value),t})),_=a((()=>{const{left:e}=y.data,t={originY:k.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value+U.value,t.endY=W.value):Q.value===e.yScaleValue.length-1&&(t.originY=G.value,t.endY=W.value-U.value),t})),ee=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),te=a((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ae=t({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...i,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:V.value,hospitalDaysHeight:X.value,operationDaysHeight:H.value,xScalevalueHeight:L.value,topList:ee.value,breathingHeight:P.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:$.value,gridYNumber:I.value,iconsWidth:q.value,originX:O.value,originY:k.value,originYLimit:G.value,endX:N.value,endXLimit:T.value,endY:W.value,xCellWidth:M.value,yCellHeight:R.value,xScaleList:z.value,breatheYCell:A.value,pulseYCell:B.value,temperatureYCell:E.value,painYCell:F.value,event:J.value,itemList:K.value,getRightInfo:te.value,config:y.data.config||{}});function le(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?R.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ue,cumputedY:ie,getXValue:ne,getYValue:re}=n(ae);return l((()=>{u((()=>{v(f,ae);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=h(f,ae,Y,ue,ie,ne,re,y.addRenderItem,j,D);C.value=l,x.value=u;const{drawScaleValue:i}=c(f,ae,Y,e,j,ue,ie,ne,re,t,a);p(f,ae,i),g(f,ae),m(f,ae,ue),r(S.value);const{select:n}=o(f,ae,Y);w.value=n}))})),{propItems:ae,redrawPoints:C,select:w,pointTipProps:j,pointMenuProps:D,clickMenu:x}}export{f as useTemperatureChart};
1
+ import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import{useTop as p}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w){const C=15,x=e(),D=e(),j=e(),V=t({show:!1,point:{x:0,y:0},list:[]}),X=t({show:!1,point:{x:0,y:0},list:[],target:null}),H=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),P=a((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),I=a((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=a((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=a((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=a((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*q.value})),k=a((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=a((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=a((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+L.value+M.value})),T=a((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*z.value})),q=a((()=>(W.value-k.value)/N.value)),z=a((()=>(G.value-R.value)/O.value)),A=a((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=a((()=>{var e,t;const{top:a,grid:l}=S.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let r=k.value-q.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=q.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+q.value/2,scaleCell:(l-a)/q.value}})))).flat()})),E=a((()=>ie("breathe"))),F=a((()=>ie("pulse"))),J=a((()=>ie("temperature"))),K=a((()=>ie("pain"))),Q=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=a((()=>{const{left:e}=S.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=a((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=a((()=>{const{grid:e}=S.data;return-1===Z.value?0:z.value*e.subYCell})),ee=a((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value,t.endY=T.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=a((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=T.value,t.endY=G.value-_.value),t})),ae=a((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=a((()=>{var e;const{left:t,right:a}=S.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ue=t({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:P.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:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:T.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?z.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{p(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,V,X);D.value=l,j.value=u;const{drawScaleValue:i}=h(Y,ue,b,e,V,re,ne,oe,se,t,a);g(Y,ue,i),f(Y,ue),y(Y,ue,re),n(w.value);const{select:r}=o(Y,ue,b);x.value=r}))})),{propItems:ue,redrawPoints:D,select:x,pointTipProps:V,pointMenuProps:X,clickMenu:j}}export{Y as useTemperatureChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawTextGroup as l,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,s){const{grid:u,originX:h,xCellWidth:n,gridXNumber:a,top:c,xScalevalueHeight:r,iconsWidth:d,topList:p,endXLimit:f,canvasWidth:v,borderStyle:g}=s;!function(){const y=[];f&&y.push(new t.Line([f,0,v,0],g));let m=0;p.forEach(((t,e)=>{e>0&&(m+=s[`${p[e-1].key}Height`]),"xScalevalue"==t.key?(function(t,e,o){if(!c.dayHeight)return!1;const s=c.dayHeight,r=n*u.subSecondXCell,d=(a-u.surplusXCell)/u.subSecondXCell;for(let u=0;u<d;u++){const n=h+u*r,a=u%2==0?"上午":"下午",c=l({width:r,height:s,...g},{value:a,...i,...t.style||{}},{left:n,top:o});e.push(c)}}(t,y,m),function(t,e,o){var s;const a=c.xScalevalue.show&&null!=(s=c.dayHeight)?s:0,p=r-a,f=l({width:h-d,height:r,...g},{value:c.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:d,top:o});e.push(f);const v=[];for(let t=0;t<u.mainXCell;t++)v.push(c.xScalevalue.list);v.flat().forEach(((s,u)=>{const c=h+u*n,r=l({width:n,height:p,...g},{value:s.value,...i,...t.style||{},...s.style||{}},{left:c,top:o+a});e.push(r)}))}(t,y,m)):s[`${t.key}Height`]&&function(t,e,o){const a=s[`${t.key}Height`],c=l({width:h-d,height:a,...g},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:d,top:o});e.push(c);const r=n*u.subXCell;t.list.forEach(((s,u)=>{const n=h+u*r,c=l({width:r,height:a,...g},{value:s,...i,...(null==t?void 0:t.style)||{}},{left:n,top:o});e.push(c)}))}(t,y,m)}));const S=y.length>0?new t.Group([...y],{...e,objectCaching:!1}):null;S&&S.sendToBack(),S&&o.value.add(S)}()}export{o as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,defaultStyle as l,drawTextGroup as s,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,u){const{grid:h,originX:n,endX:a,xCellWidth:c,gridXNumber:r,top:p,xScalevalueHeight:d,iconsWidth:f,topList:v,endXLimit:g,canvasWidth:y,borderStyle:m}=u;!function(){const S=[];g&&S.push(new t.Line([g,0,y,0],m));let w=0;v.forEach(((t,l)=>{if(l>0&&(w+=u[`${v[l-1].key}Height`]),"xScalevalue"==t.key)!function(t,l,o){const u=p.dayHeight;if(!u)return;l.push(e([n,o+u,a,o+u],m));const d=c*h.subSecondXCell,f=(r-h.surplusXCell)/h.subSecondXCell;for(let h=0;h<f;h++){const a=n+h*d,c=h%2==0?"上午":"下午",r=s({width:d,height:u,...m},{value:c,...i,...t.style||{}},{left:a,top:o});l.push(r),l.push(e([a+d,o,a+d,o+u],m))}}(t,S,w),function(t,l,o){var u;const r=p.xScalevalue.show&&null!=(u=p.dayHeight)?u:0,v=d-r;if(!v)return;l.push(e([f,o+d,a,o+d],m));const g=s({width:n-f,height:d,...m},{value:p.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:f,top:o});l.push(g),l.push(e([n,o,n,o+d],m));const y=[];for(let t=0;t<h.mainXCell;t++)y.push(p.xScalevalue.list);y.flat().forEach(((u,h)=>{const a=n+h*c,p=s({width:c,height:v,...m},{value:u.value,...i,...t.style||{},...u.style||{}},{left:a,top:o+r});l.push(p),l.push(e([a+c,o+r,a+c,o+r+v],m))}))}(t,S,w);else{if(!u[`${t.key}Height`])return;const o=u[`${v[l].key}Height`];!function(t,l,o){const a=u[`${t.key}Height`],r=s({width:n-f,height:a,...m},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:f,top:o});l.push(r);const p=c*h.subXCell;t.list.forEach(((u,h)=>{const c=n+h*p,r=s({width:p,height:a,...m},{value:u,...i,...(null==t?void 0:t.style)||{}},{left:c,top:o});l.push(e([c+p,o,c+p,o+a],m)),l.push(r)}))}(t,S,w),S.push(e([f,w+o,a,w+o],m)),S.push(e([n,w,n,w+o],m))}}));const X=S.length>0?new t.Group([...S],{...l,objectCaching:!1}):null;X&&X.sendToBack(),X&&o.value.add(X)}()}export{o as useTop};
@@ -42,5 +42,5 @@ export declare const defaultTextStyle: {
42
42
  export declare function drawLine(points: number[], style: Partial<ILineOptions>): fabric.Line;
43
43
  export declare function drawText([x, y]: [x: number, y: number], style: ITextOptions): fabric.Text;
44
44
  export declare function drawArrow([x, y1, y2]: [x: number, y1: number, y2: number], style: ITextOptions | any, type?: string): fabric.Group;
45
- export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>): fabric.Group;
45
+ export declare function drawTextGroup(rectStyle: Partial<fabric.IRectOptions>, fontStyle: Partial<ITextOptions>, groupStyle: Partial<fabric.IGroupOptions>, showRect?: boolean): fabric.Group;
46
46
  export declare function drawPoint(type: string | undefined, style: any): fabric.Object;
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,...t},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],...t},n={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,...t};function c(t,r){return new e.Line(t,{...i,...r})}function s([t,r],i){return new e.Text(String(i.value),{...o,left:t,top:r,...i})}function l([r,i,n],o,l="down"){const a=c([r,i,r,n],{strokeWidth:1,stroke:o.fill}),u=s([r+.5,"up"===l?n-3:n+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===l?180:0,...o});return new e.Group([a,u],{...t,originX:"center",originY:"top"})}function a(r,i,c){const s=new e.Rect({...n,...r,strokeWidth:.5}),{value:l="标题",textAlign:a="center",verticalAlign:u="center"}=i,g=r.width/2,h=r.height/2,d=new e.Text(String(l),{...o,...i,..."left"==a||"right"==a?{originX:a,left:"left"==a?-g:g}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function u(t="circle",r){const i={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},n=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...i});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...i});case"image":return new e.Image(r.element,{...i,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),i={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},n=new e.Line([0,t/2,t,t/2],i),o=new e.Line([t/2,0,t/2,t],i);return new e.Group([n,o])};return new e.Group([n(),t()],{scale:1,...i})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([n(),o],{scale:1,...i})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...i})}}export{r as defaultBorderStyle,i as defaultLineStyle,n as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,l as drawArrow,c as drawLine,u as drawPoint,s as drawText,a as drawTextGroup};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,...t},n={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],...t},i={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,...t};function c(t,r){return new e.Line(t,{...n,...r})}function s([t,r],n){return new e.Text(String(n.value),{...o,left:t,top:r,...n})}function l([r,n,i],o,l="down"){const a=c([r,n,r,i],{strokeWidth:1,stroke:o.fill}),u=s([r+.5,"up"===l?i-3:i+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===l?180:0,...o});return new e.Group([a,u],{...t,originX:"center",originY:"top"})}function a(r,n,c,s=!1){const l=new e.Rect({...i,...r,...s?{}:{stroke:"transparent"}}),{value:a="标题",textAlign:u="center",verticalAlign:g="center"}=n,h=r.width/2,d=r.height/2,f=new e.Text(String(a),{...o,...n,..."left"==u||"right"==u?{originX:u,left:"left"==u?-h:h}:{},..."top"==g||"bottom"==g?{originY:g,top:"top"==g?-d:d}:{}});return new e.Group([l,f],{objectCaching:!1,...t,...c})}function u(t="circle",r){const n={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},i=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...n});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...n});case"image":return new e.Image(r.element,{...n,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),n={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},i=new e.Line([0,t/2,t,t/2],n),o=new e.Line([t/2,0,t/2,t],n);return new e.Group([i,o])};return new e.Group([i(),t()],{scale:1,...n})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([i(),o],{scale:1,...n})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...n})}}export{r as defaultBorderStyle,n as defaultLineStyle,i as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,l as drawArrow,c as drawLine,u as drawPoint,s as drawText,a as drawTextGroup};
@@ -1,4 +1,4 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../es/shared/types';
4
- export declare function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject, isBirthProcess?: boolean): void;
4
+ export declare function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject): void;
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as n,defaultStyle as l}from"./useDraw.js";function i(i,s,t=!1){var o,r,u,d;const{gridYNumber:a,originY:c,grid:S,originX:b,endX:y,xCellWidth:m,yCellHeight:p,gridXNumber:f,endY:g,borderStyle:h}=s,v=[],C=[],L=new Set;for(let e=0;e<=a;e++){const l=c+parseInt(String(p*(a-e)));if(t){const e=n([b,l,y,l],{...h,...(null==(o=S.mainLineStyle)?void 0:o.x)||{}});v.push(e)}else{const i=e%S.subYCell==0?(null==(r=S.mainLineStyle)?void 0:r.x)||{}:S.subLineStyle||{},s=n([b,l,y,l],i);e%S.subYCell==0?L.add(s):v.push(s)}}for(let e=0;e<=f;e++){const l=b+parseInt(String(m*e));if(t){const e=n([l,c,l,g],{...h,...(null==(u=S.mainLineStyle)?void 0:u.y)||{}});C.push(e)}else{let i=S.subLineStyle||{};e%S.subSecondXCell==0&&(i=S.subSecondLineStyle||{}),e%S.subXCell==0&&(i=0!==e&&e!==f?(null==(d=S.mainLineStyle)?void 0:d.y)||{}:h);const s=n([l,c,l,g],i);e%S.subXCell==0&&0!==e&&e!==f?L.add(s):C.push(s)}}const X=new e.Group([...C,...v,...L],l);i.value.add(X),i.value.sendToBack(X)}export{i as useGrid};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as s}from"./useDraw.js";function n(n,i){var u,o;const{gridYNumber:t,originY:d,grid:r,originX:b,endX:a,xCellWidth:c,yCellHeight:C,gridXNumber:X,endY:g,borderStyle:S}=i,m=[],y=[],Y=new Set,f=(null==(u=r.mainLineStyle)?void 0:u.x)||{},j=(null==(o=r.mainLineStyle)?void 0:o.y)||{},p=r.subLineStyle||{},h=r.subSecondLineStyle||{};for(let e=0;e<=t;e++){const s=d+~~(C*(t-e)),n={...S,...f};r.subYCell&&e%r.subYCell!=0&&Object.assign(n,p);const i=l([b,s,a,s],n);r.subYCell&&e%r.subYCell==0?Y.add(i):m.push(i)}for(let e=0;e<=X;e++){const s=b+~~(c*e),n={...S,...r.subXCell?p:j};r.subXCell&&e%r.subXCell==0?Object.assign(n,{...0!==e&&e!==X?j:S}):r.subSecondXCell&&e%r.subSecondXCell==0&&Object.assign(n,h);const i=l([s,d,s,g],n);r.subXCell&&e%r.subXCell==0?Y.add(i):y.push(i)}const v=new e.Group([...m,...y,...Y],s);n.value.add(v),n.value.sendToBack(v)}export{n as useGrid};
@@ -7,6 +7,19 @@ interface IEvent {
7
7
  evented: boolean;
8
8
  hovered: boolean;
9
9
  }
10
+ export declare type ITreeItem = Partial<{
11
+ title: string;
12
+ totle: number;
13
+ data: Array<{
14
+ time: string[];
15
+ value: AnyObject;
16
+ }>;
17
+ children: ITreeItem[];
18
+ top: number;
19
+ left: number;
20
+ width: number;
21
+ height: number;
22
+ }>;
10
23
  interface ImainLineStyle {
11
24
  x: fabric.ILineOptions;
12
25
  y: fabric.ILineOptions;
@@ -1,4 +1,4 @@
1
- import { IPoint } from '../interface';
1
+ import { IPoint, ITreeItem } from '../interface';
2
2
  import { AnyObject } from '../../../../../es/shared/types';
3
3
  export declare function isEffectiveNode(node: IPoint): string | number | boolean;
4
4
  export declare function deleteProperty(data: AnyObject, list: AnyObject[]): {};
@@ -14,3 +14,4 @@ export declare function getType(type: string): string;
14
14
  export declare function isValidValue(value: number | string): boolean;
15
15
  export declare function isOverlapPoint(pointObj1: any, pointObj2: any): boolean;
16
16
  export declare function getFloorNumber(value: number, n?: number): number;
17
+ export declare function getChildrenSize(treeData: ITreeItem[]): number;