cnhis-design-vue 3.1.48-beta.14 → 3.1.48-beta.16

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 (59) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/index.d.ts +13 -0
  3. package/es/components/base-search/src/index.vue.d.ts +13 -0
  4. package/es/components/base-search/src/index.vue2.js +1 -1
  5. package/es/components/card-reader-sdk/src/cardReaderSDK.d.ts +5 -1
  6. package/es/components/card-reader-sdk/src/cardReaderSDK.js +1 -1
  7. package/es/components/card-reader-sdk/src/components/readCardDialog.vue.d.ts +19 -0
  8. package/es/components/card-reader-sdk/src/components/readCardDialog.vue2.js +1 -1
  9. package/es/components/card-reader-sdk/src/utils/readHealthCard.d.ts +6 -1
  10. package/es/components/card-reader-sdk/src/utils/readHealthCard.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
  13. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +7 -1
  14. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  17. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  19. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -1
  22. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -1
  25. package/es/components/scale-view/index.d.ts +2 -0
  26. package/es/components/scale-view/src/ScaleView.vue.d.ts +2 -0
  27. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  28. package/es/components/scale-view/src/components/EvaluateCountdown.vue.d.ts +2 -0
  29. package/es/components/scale-view/src/components/EvaluateCountdown.vue2.js +1 -1
  30. package/es/components/scale-view/src/components/formitem/r-datetime.js +1 -1
  31. package/es/components/scale-view/src/hooks/scaleview-init.js +1 -1
  32. package/es/components/scale-view/src/hooks/scaleview-submit.js +1 -1
  33. package/es/components/scale-view/src/utils/judge-types.d.ts +9 -1
  34. package/es/components/scale-view/src/utils/judge-types.js +1 -1
  35. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  36. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  37. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  38. package/es/env.d.ts +25 -25
  39. package/es/shared/assets/img/failure.png.js +1 -1
  40. package/es/shared/assets/img/no-permission.png.js +1 -1
  41. package/es/shared/assets/img/nodata.png.js +1 -1
  42. package/es/shared/assets/img/notfound.png.js +1 -1
  43. package/es/shared/assets/img/qr.png.js +1 -1
  44. package/es/shared/assets/img/success.png.js +1 -1
  45. package/es/shared/assets/img/video.png.js +1 -1
  46. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  47. package/es/shared/assets/img/xb_big.png.js +1 -1
  48. package/es/shared/assets/img/xb_small.png.js +1 -1
  49. package/es/shared/package.json.js +1 -1
  50. package/package.json +2 -2
  51. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  52. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  53. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  54. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  55. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  56. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  57. package/es/shared/utils/tapable/index.d.ts +0 -139
  58. package/es/shared/utils/tapableLess.d.ts +0 -28
  59. package/es/shared/utils/tapableLess.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
+ ```
@@ -18,6 +18,10 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
18
18
  filterApiConfig: {
19
19
  type: ObjectConstructor;
20
20
  };
21
+ appendValueConfig: {
22
+ type: ObjectConstructor;
23
+ default: () => {};
24
+ };
21
25
  }, {
22
26
  outQuickSearchFn: {
23
27
  handlerInitSearchItem(arr: import("..").ISearchType[]): void;
@@ -87,6 +91,10 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
87
91
  filterApiConfig: {
88
92
  type: ObjectConstructor;
89
93
  };
94
+ appendValueConfig: {
95
+ type: ObjectConstructor;
96
+ default: () => {};
97
+ };
90
98
  }>> & {
91
99
  onFoldQuickSearch?: ((...args: any[]) => any) | undefined;
92
100
  onOnFilterSearch?: ((...args: any[]) => any) | undefined;
@@ -199,6 +207,10 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
199
207
  filterApiConfig: {
200
208
  type: ObjectConstructor;
201
209
  };
210
+ appendValueConfig: {
211
+ type: ObjectConstructor;
212
+ default: () => {};
213
+ };
202
214
  }>> & {
203
215
  onFoldQuickSearch?: ((...args: any[]) => any) | undefined;
204
216
  onOnFilterSearch?: ((...args: any[]) => any) | undefined;
@@ -208,5 +220,6 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
208
220
  showSettings: import("..").IsettingsType;
209
221
  searchFieldList: import("..").IApiServerType[];
210
222
  qqConObjCount: number;
223
+ appendValueConfig: Record<string, any>;
211
224
  }>>;
212
225
  export default CBaseSearch;
@@ -19,6 +19,10 @@ declare const _default: import("vue").DefineComponent<{
19
19
  filterApiConfig: {
20
20
  type: ObjectConstructor;
21
21
  };
22
+ appendValueConfig: {
23
+ type: ObjectConstructor;
24
+ default: () => {};
25
+ };
22
26
  }, {
23
27
  outQuickSearchFn: {
24
28
  handlerInitSearchItem(arr: ISearchType[]): void;
@@ -88,6 +92,10 @@ declare const _default: import("vue").DefineComponent<{
88
92
  filterApiConfig: {
89
93
  type: ObjectConstructor;
90
94
  };
95
+ appendValueConfig: {
96
+ type: ObjectConstructor;
97
+ default: () => {};
98
+ };
91
99
  }>> & {
92
100
  onFoldQuickSearch?: ((...args: any[]) => any) | undefined;
93
101
  onOnFilterSearch?: ((...args: any[]) => any) | undefined;
@@ -200,6 +208,10 @@ declare const _default: import("vue").DefineComponent<{
200
208
  filterApiConfig: {
201
209
  type: ObjectConstructor;
202
210
  };
211
+ appendValueConfig: {
212
+ type: ObjectConstructor;
213
+ default: () => {};
214
+ };
203
215
  }>> & {
204
216
  onFoldQuickSearch?: ((...args: any[]) => any) | undefined;
205
217
  onOnFilterSearch?: ((...args: any[]) => any) | undefined;
@@ -209,5 +221,6 @@ declare const _default: import("vue").DefineComponent<{
209
221
  showSettings: IsettingsType;
210
222
  searchFieldList: IApiServerType[];
211
223
  qqConObjCount: number;
224
+ appendValueConfig: Record<string, any>;
212
225
  }>;
213
226
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,provide as l,computed as i,watch as a,openBlock as n,createElementBlock as r,createElementVNode as s,createCommentVNode as o,renderSlot as u,unref as c,createVNode as f,withCtx as d,createTextVNode as h,toDisplayString as m,Fragment as p,renderList as v}from"vue";import b from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import y from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as S}from"naive-ui";import{Search as j}from"@vicons/ionicons5";import{cloneDeep as x}from"lodash-es";import{InjectionFilterApiConfig as q,InjectionFilterSearchConfig as R}from"../../table-filter/src/constants/index.js";const A={class:"base-search-block"},O={class:"base-container"},F={class:"bease-left"},Q={class:"base-ul"},V={key:0,class:"baseli showQuickBtn"},_=s("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),w={key:0,class:"qqConObjCount"},I={key:1,class:"baseli"},B={key:2,class:"baseli"},D=s("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var E=e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0,hideResetBtn:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0},filterApiConfig:{type:Object}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{expose:E,emit:L}){const N=e,{outQuickSearchFn:P}=g(),{isRender:W,getRenderSearchConObj:U,isExistDefValByRenderWidget:$,resetRenderWidgetValue:z}=C(),{transformData:M,transformParams:T}=y(),G=t([]),H=t(!1),J=t([]);l(q,N.filterApiConfig),l(R,J);const K=i((()=>Y("hideQuickSearch"))),X=i((()=>Y("hideResetBtn")));function Y(e){return 0==N.showSettings[e]}function Z(){L("foldQuickSearch",!0)}function ee(e={}){const t=te()||[];!function(e,t,l=!1,i={}){let a=[];J.value.length>0&&(a=x(J.value));L("onFilterSearch",e,t,l,a,i)}(t,T(t),!0,e)}function te(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let i=e[l];const a=U(i);a&&t.push(a)}return t.filter((e=>e.value))}(J.value)}function le(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{z(e)})),P.handlerInitSearchItem(e)}(J.value),L("handleReset",{targetType:"outQuickSearchReset"})}return a((()=>N.searchFieldList),(e=>{e&&e.length>0&&function(){J.value=[];let e=x(M(N.searchFieldList,{_filterApiConfig:N.filterApiConfig})).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));J.value=e,P.handlerInitSearchItem(J.value),J.value.some((e=>W(e)?$(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),a((()=>N.qqConObjCount),(e=>{const t=G.value.length||0;H.value=t+Number(e)>0&&X.value}),{immediate:!0}),a((()=>J),(()=>{G.value=te()||[];const e=T(G.value);H.value=G.value.length+Number(N.qqConObjCount)>0&&X.value,L("getFilterParam",G.value,e)}),{immediate:!0,deep:!0}),E({handleReset:le}),(t,l)=>(n(),r("div",A,[s("div",O,[s("div",F,[s("ul",Q,[o(" 筛选分类插槽 "),u(t.$slots,"classification"),c(K)?(n(),r("li",V,[f(c(k),{class:"search-default",type:"default",onClick:Z},{default:d((()=>[_,h(" 筛选"),e.qqConObjCount?(n(),r("span",w,"("+m(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(n(!0),r(p,null,v(J.value,(e=>(n(),r(p,null,[e.isRender?(n(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[f(b,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:ee},null,8,["cfg","modelValue","onUpdate:modelValue"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),J.value&&J.value.length>0?(n(),r("li",I,[f(c(k),{type:"primary",onClick:ee},{default:d((()=>[f(c(S),{component:c(j),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),h(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),H.value?(n(),r("li",B,[f(c(k),{onClick:le},{default:d((()=>[D,h(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),u(t.$slots,"buttons")])])])]))}});export{E as default};
1
+ import{defineComponent as e,ref as t,provide as l,computed as i,watch as a,openBlock as n,createElementBlock as r,createElementVNode as s,createCommentVNode as o,renderSlot as u,unref as c,createVNode as f,withCtx as d,createTextVNode as m,toDisplayString as h,Fragment as p,renderList as v}from"vue";import b from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import y from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as k,NIcon as j}from"naive-ui";import{Search as S}from"@vicons/ionicons5";import{isObject as x,cloneDeep as O}from"lodash-es";import{InjectionFilterApiConfig as q,InjectionFilterSearchConfig as R}from"../../table-filter/src/constants/index.js";const A={class:"base-search-block"},F={class:"base-container"},V={class:"bease-left"},Q={class:"base-ul"},_={key:0,class:"baseli showQuickBtn"},w=s("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),I={key:0,class:"qqConObjCount"},N={key:1,class:"baseli"},B={key:2,class:"baseli"},E=s("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var D=e({__name:"index",props:{showSettings:{type:Object,default:()=>({hideQuickSearch:0,hideResetBtn:0})},searchFieldList:{type:Array,default:()=>[]},qqConObjCount:{type:Number,default:0},filterApiConfig:{type:Object},appendValueConfig:{type:Object,default:()=>({})}},emits:["foldQuickSearch","onFilterSearch","handleReset","getFilterParam"],setup(e,{expose:D,emit:L}){const P=e,{outQuickSearchFn:W}=g(),{isRender:U,getRenderSearchConObj:$,isExistDefValByRenderWidget:z,resetRenderWidgetValue:M}=C(),{transformData:T,transformParams:G}=y(),H=t([]),J=t(!1),K=t([]);l(q,P.filterApiConfig),l(R,K);const X=i((()=>Z("hideQuickSearch"))),Y=i((()=>Z("hideResetBtn")));function Z(e){return 0==P.showSettings[e]}function ee(){L("foldQuickSearch",!0)}function te(e={}){const t=le()||[];!function(e,t,l=!1,i={}){let a=[];K.value.length>0&&(a=O(K.value));L("onFilterSearch",e,t,l,a,i)}(t,G(t),!0,e)}function le(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let l=0;l<e.length;l++){let i=e[l];const a=$(i);a&&t.push(a)}return t.filter((e=>e.value))}(K.value)}function ie(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{M(e)})),W.handlerInitSearchItem(e)}(K.value),L("handleReset",{targetType:"outQuickSearchReset"})}return a((()=>P.searchFieldList),(e=>{e&&e.length>0&&function(){K.value=[];let e=O(T(P.searchFieldList,{_filterApiConfig:P.filterApiConfig})).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));K.value=e,W.handlerInitSearchItem(K.value),K.value.some((e=>U(e)?z(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),a((()=>P.qqConObjCount),(e=>{const t=H.value.length||0;J.value=t+Number(e)>0&&Y.value}),{immediate:!0}),a((()=>K),(()=>{H.value=le()||[];const e=G(H.value);J.value=H.value.length+Number(P.qqConObjCount)>0&&Y.value,L("getFilterParam",H.value,e)}),{immediate:!0,deep:!0}),a((()=>P.appendValueConfig),(e=>{if(x(e)&&Object.keys(e).length>0){const t=Object.keys(e);K.value.forEach((l=>{t.includes(l.columnName)&&(l.value=e[l.columnName])}))}}),{immediate:!0,deep:!0}),D({handleReset:ie}),(t,l)=>(n(),r("div",A,[s("div",F,[s("div",V,[s("ul",Q,[o(" 筛选分类插槽 "),u(t.$slots,"classification"),c(X)?(n(),r("li",_,[f(c(k),{class:"search-default",type:"default",onClick:ee},{default:d((()=>[w,m(" 筛选"),e.qqConObjCount?(n(),r("span",I,"("+h(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(n(!0),r(p,null,v(K.value,(e=>(n(),r(p,null,[e.isRender?(n(),r("li",{class:"baseli outQuickSearch-li",key:e._frontId},[f(b,{cfg:e,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,onOutFilterChange:te},null,8,["cfg","modelValue","onUpdate:modelValue"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),K.value&&K.value.length>0?(n(),r("li",N,[f(c(k),{type:"primary",onClick:te},{default:d((()=>[f(c(j),{component:c(S),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),m(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),J.value?(n(),r("li",B,[f(c(k),{onClick:ie},{default:d((()=>[E,m(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),u(t.$slots,"buttons")])])])]))}});export{D as default};
@@ -1,3 +1,4 @@
1
+ import { AnyObject } from '../../../../es/shared/types';
1
2
  import { ComponentInternalInstance } from 'vue';
2
3
  import { TRANS_CMD } from './constants';
3
4
  import { InsuranceType } from './types';
@@ -14,7 +15,10 @@ export default class CardReaderSDK {
14
15
  private createParams;
15
16
  private checkLoading;
16
17
  private checkResCodeAndLoading;
17
- readHealthCard(instance?: ComponentInternalInstance): Promise<string>;
18
+ readHealthCard(instance?: ComponentInternalInstance, options?: {
19
+ inputProps?: AnyObject;
20
+ modalProps?: AnyObject;
21
+ }): Promise<string>;
18
22
  readIdCard(params?: InsuranceType.CardReadParams): Promise<Partial<{
19
23
  personinfo: Record<"sex" | "age" | "address" | "birthday" | "location" | "cardnum" | "cardpwd" | "folk" | "idnumber" | "ownpay" | "ptname" | "pttype" | "recordid" | "updateflag", string>;
20
24
  cardinfo: Partial<Record<"name" | "sex" | "age" | "address" | "birthday" | "idnumber" | "cardno" | "cardid" | "sex_code" | "nation_name" | "nation_code" | "idtype" | "issuer" | "issuedate" | "expirydate" | "hasphoto" | "telphone" | "companyname" | "age_code" | "age_name" | "ages", string>>;
@@ -1 +1 @@
1
- import{isFunction as e}from"lodash-es";import{TRANS_CMD as a}from"./constants/index.js";import t from"./insuranceSDK.js";import{ReadHealthCard as r}from"./utils/readHealthCard.js";const s=class{constructor(e){this.options=e,this.loading=!1,this.readHealthCardDialog=new r,this.insurance=new t}get basicParamsRes(){return e(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(e={}){return new s(e)}destroy(){this.insurance.destroy()}createParams(e,a,t){var r,s;const{operatorname:n,operatorcode:i,...c}=this.basicParamsRes||{};return{transcmd:e,operatorname:null!=(r=a.operatorname)?r:n,operatorcode:null!=(s=a.operatorcode)?s:i,...c,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(e){try{this.loading=!0;const a=await e;return 3===a.returncode?Promise.reject(`${a.returnmsg||"操作失败"}`):a.returndata}finally{this.loading=!1}}async readHealthCard(e){return await this.checkLoading(),this.readHealthCardDialog.show(e)}async readIdCard(e={}){await this.checkLoading();const t=this.createParams(a.ID_CARD_READ,e,{transtype:"IDCARD",interfaceid:"0",transdata:{readtype:"2"}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readMemberCard(e={}){await this.checkLoading();const t=this.createParams(a.MEMBER_CARD_READ,e,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",transdata:{readtype:"1"}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async writeMemberCard(e={}){await this.checkLoading();const t=this.createParams(a.MEMBER_CARD_WRITE,e,{transsystem:"10",transtype:"IDCARD",interfaceid:"0"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readInsuranceCard(e={}){await this.checkLoading();const t=this.createParams(a.NS_GETPERSONALINFO,e,{transchannel:"101",interfaceid:e.interfaceid,transtype:"YB0000"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async generalRequest(e={}){await this.checkLoading();const t=this.createParams(a.NS_GETPERSONALINFO,e);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}};let n=s;n.TRANS_CMD=a;export{n as default};
1
+ import{isFunction as e}from"lodash-es";import{TRANS_CMD as a}from"./constants/index.js";import t from"./insuranceSDK.js";import{ReadHealthCard as r}from"./utils/readHealthCard.js";const s=class{constructor(e){this.options=e,this.loading=!1,this.readHealthCardDialog=new r,this.insurance=new t}get basicParamsRes(){return e(this.options.basicParams)?this.options.basicParams():this.options.basicParams}static create(e={}){return new s(e)}destroy(){this.insurance.destroy()}createParams(e,a,t){var r,s;const{operatorname:n,operatorcode:i,...c}=this.basicParamsRes||{};return{transcmd:e,operatorname:null!=(r=a.operatorname)?r:n,operatorcode:null!=(s=a.operatorcode)?s:i,...c,...t}}checkLoading(){if(this.loading)return Promise.reject("请勿重复操作")}async checkResCodeAndLoading(e){try{this.loading=!0;const a=await e;return 3===a.returncode?Promise.reject(`${a.returnmsg||"操作失败"}`):a.returndata}finally{this.loading=!1}}async readHealthCard(e,a){return await this.checkLoading(),this.readHealthCardDialog.show({instance:e,...a})}async readIdCard(e={}){await this.checkLoading();const t=this.createParams(a.ID_CARD_READ,e,{transtype:"IDCARD",interfaceid:"0",transdata:{readtype:"2"}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readMemberCard(e={}){await this.checkLoading();const t=this.createParams(a.MEMBER_CARD_READ,e,{transsystem:"10",transtype:"IDCARD",interfaceid:"0",transdata:{readtype:"1"}});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async writeMemberCard(e={}){await this.checkLoading();const t=this.createParams(a.MEMBER_CARD_WRITE,e,{transsystem:"10",transtype:"IDCARD",interfaceid:"0"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async readInsuranceCard(e={}){await this.checkLoading();const t=this.createParams(a.NS_GETPERSONALINFO,e,{transchannel:"101",interfaceid:e.interfaceid,transtype:"YB0000"});return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}async generalRequest(e={}){await this.checkLoading();const t=this.createParams(a.NS_GETPERSONALINFO,e);return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(t))}};let n=s;n.TRANS_CMD=a;export{n as default};
@@ -1,11 +1,22 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
1
2
  declare const _default: import("vue").DefineComponent<{
2
3
  show: {
3
4
  type: BooleanConstructor;
4
5
  required: true;
5
6
  };
7
+ inputProps: {
8
+ type: null;
9
+ required: true;
10
+ };
11
+ modalProps: {
12
+ type: null;
13
+ required: true;
14
+ };
6
15
  }, {
7
16
  props: {
8
17
  show: boolean;
18
+ inputProps: AnyObject;
19
+ modalProps: AnyObject;
9
20
  };
10
21
  inputRef: import("vue").Ref<{
11
22
  focus: () => void;
@@ -21,6 +32,14 @@ declare const _default: import("vue").DefineComponent<{
21
32
  type: BooleanConstructor;
22
33
  required: true;
23
34
  };
35
+ inputProps: {
36
+ type: null;
37
+ required: true;
38
+ };
39
+ modalProps: {
40
+ type: null;
41
+ required: true;
42
+ };
24
43
  }>> & {
25
44
  onClose?: ((...args: any[]) => any) | undefined;
26
45
  onConfirm?: ((...args: any[]) => any) | undefined;
@@ -1 +1 @@
1
- import{defineComponent as e,watch as o,nextTick as t,ref as a,openBlock as s,createBlock as l,unref as i,withCtx as n,createVNode as u}from"vue";import{NModal as r,NInput as c}from"naive-ui";var p=e({__name:"readCardDialog",props:{show:{type:Boolean}},emits:["update:show","confirm","close"],setup(e,{emit:p}){const v=e;o((()=>v.show),(async e=>{var o;e&&(await t(),null==(o=f.value)||o.focus())}));const f=a(),m=a("");function w(){p("update:show",!1),p("close")}function d(){p("confirm",m.value)}return(o,t)=>(s(),l(i(r),{preset:"dialog",title:"扫码电子健康卡",show:e.show,"close-on-esc":!1,"show-icon":!1,"positive-text":"确认",onClose:w,onPositiveClick:d},{default:n((()=>[u(i(c),{value:m.value,"onUpdate:value":t[0]||(t[0]=e=>m.value=e),ref_key:"inputRef",ref:f},null,8,["value"])])),_:1},8,["show"]))}});export{p as default};
1
+ import{defineComponent as o,watch as e,nextTick as l,ref as a,openBlock as s,createBlock as t,unref as n,mergeProps as u,withCtx as i,createVNode as r}from"vue";import{NModal as p,NInput as c}from"naive-ui";var v=o({__name:"readCardDialog",props:{show:{type:Boolean},inputProps:null,modalProps:null},emits:["update:show","confirm","close"],setup(o,{emit:v}){const f=o;e((()=>f.show),(async o=>{var e;o&&(await l(),null==(e=d.value)||e.focus())}));const d=a(),m=a("");function h(){v("update:show",!1),v("close")}function w(){v("confirm",m.value)}return(e,l)=>(s(),t(n(p),u({preset:"dialog",title:"扫码电子健康卡",show:o.show,"close-on-esc":!1,"show-icon":!1,"positive-text":"确认"},o.modalProps,{onClose:h,onPositiveClick:w}),{default:i((()=>[r(n(c),u({value:m.value,"onUpdate:value":l[0]||(l[0]=o=>m.value=o),ref_key:"inputRef",ref:d,placeholder:"请输入健康卡号"},o.inputProps),null,16,["value"])])),_:1},16,["show"]))}});export{v as default};
@@ -1,6 +1,11 @@
1
+ import { AnyObject } from '../../../../../es/shared/types';
1
2
  import { ComponentInternalInstance } from 'vue';
2
3
  export declare class ReadHealthCard {
3
4
  rendered: boolean;
4
5
  static createMsg(message: string): string;
5
- show(instance?: ComponentInternalInstance): Promise<string>;
6
+ show({ instance, inputProps, modalProps }?: {
7
+ instance?: ComponentInternalInstance;
8
+ inputProps?: AnyObject;
9
+ modalProps?: AnyObject;
10
+ }): Promise<string>;
6
11
  }
@@ -1 +1 @@
1
- import{ref as e,render as r,createVNode as t,withCtx as n,nextTick as o}from"vue";import{createProviderWrapper as a}from"../../../../shared/utils/index.js";import s from"../components/readCardDialog.vue.js";class d{constructor(){this.rendered=!1}static createMsg(e){return`[ReadHealthCardDialog] ${e}`}show(i){return this.rendered?Promise.reject(d.createMsg("请勿重复打开弹窗")):new Promise(((l,u)=>{this.rendered=!0;const c=document.createElement("div"),m=e(!1),h=a(i);var f;function p(){u(d.createMsg("弹窗关闭"))}function v(e){l(e),m.value=!1}r(t(h,null,{default:n((()=>t(s,{show:m.value,"onUpdate:show":e=>m.value=e,onConfirm:v,onClose:p,onAfterLeave:()=>function(e){if(!e.parentElement)return;C.rendered=!1,e.parentElement.removeChild(e)}(c)},null)),i)}),c),f=c,document.body.appendChild(f),o((()=>m.value=!0));const C=this}))}}export{d as ReadHealthCard};
1
+ import{ref as e,render as r,createVNode as t,withCtx as n,mergeProps as o,nextTick as s}from"vue";import{createProviderWrapper as a}from"../../../../shared/utils/index.js";import d from"../components/readCardDialog.vue.js";class i{constructor(){this.rendered=!1}static createMsg(e){return`[ReadHealthCardDialog] ${e}`}show({instance:l,inputProps:u,modalProps:c}={}){return this.rendered?Promise.reject(i.createMsg("请勿重复打开弹窗")):new Promise(((m,p)=>{this.rendered=!0;const h=document.createElement("div"),f=e(!1),v=a(l);var C;function P(){p(i.createMsg("弹窗关闭"))}function g(e){m(e),f.value=!1}r(t(v,null,{default:n((()=>t(d,o({show:f.value,"onUpdate:show":e=>f.value=e,onConfirm:g,onClose:P,onAfterLeave:()=>function(e){if(!e.parentElement)return;w.rendered=!1,e.parentElement.removeChild(e)}(h)},{inputProps:u,modalProps:c}),null)),l)}),h),C=h,document.body.appendChild(C),s((()=>f.value=!0));const w=this}))}}export{i as ReadHealthCard};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";import"../../../../../shared/utils/index.js";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:W,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+W/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+W/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.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}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>O?O:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=O-o*$*k,a=0===o?O-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+W/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:O+y;g.push(n([m+e*W,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*W,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.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:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(O-i-t)/e,O-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=O}function h([e,t]){return[I+e,O-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,O-G(o,a,l.value)],[p,h]=[S(c.time)-I,O-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...ee].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y([...ee],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y([...ee],u.left,"key").includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";function x(x,b,j,C,P){const{cumputedX:S,cumputedY:G,getXValue:M,getYValue:T}=c(b),{getEqualXTypes:Y,handleAddPrevent:E,isGridLimit:L}=h(x,j,b),{xAxis:X,grid:A,originX:I,originY:H,xCellWidth:W,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:N,rightScales:R,yCellHeight:$,endX:B,scaleValues:F,canvasWidth:q,borderStyle:z,rightAddAreaWidth:J,event:K,originYCervix:Q,other:U,canvasHeight:Z}=b,_=k(F),ee=new Set;function te(){_.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...s,...o],{...v}):null}let G,Y;if(d.childbirth){const e=s[1]+$;G=o([s[0],s[1],e],w),c.push(G),Y=n([s[0]+W/2,e-$/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(Y)}const E=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:E,rightLine:h,arrowGroup:G,arrowGroupText:Y,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};E?p=r(k,{left:E.get("x2"),top:E.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){K.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ie(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+W/2,top:e.top+$/2})}(e),K.hovered&&re(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:M(e.left),value:T(t,e.top)}};x.value.discardActiveObject(),j("change",o),oe(o,"change")}}))}(p),a.push(p),ee.add(p))}(le(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let o=null;e=e.filter((e=>(e&&o&&(o.nextPoint=e,e.prevPoint=o),o=e||o,e))),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function oe(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=_.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ne()}function ne(){var e;ee.size&&(null==(e=x.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}([...ee]))),ee.clear(),te()}function ie(e){const t=e.prevPoint?e.prevPoint.left:I,o=e.nextPoint?e.nextPoint.left:B;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<Q&&e.set("top",Q),e.top<H&&e.set("top",H),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function re(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:T(n,e.top)}`,`时间 ${M(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=G(t.key,t.range,e.value);return[o,n<H?H:n>O?O:n]}}function se(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...z,width:q-D-J-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:B;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),G=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=O-o*$*k,a=0===o?O-8:o!==S.length-1||H||Q&&"FHR"!==v?s:H+8;!w||(0===o||o===G-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,$,H,G))}));const M=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),T=n([P,H>0?H-$/2:$/2],{value:String(h),...i,...g}),Y=new e.Group([...C,...j,M,...T?[T]:[]],{objectCaching:!1,...s});x.value.add(Y),Y.sendToBack(),r+=c}))}t(N),t(R,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=X.time,{show:u,range:c=[0,23],position:d,style:f}=X.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=I+W/2,y=$/2;for(let e=0;e<A.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):se(p.at(-1),r);p.push(t);const s="top"===l?H-y:O+y;g.push(n([m+e*W,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:Z-y;v.push(n([m+e*W,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(U),n=[],i={},r=_.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:o,range:n}=r||{},i=G(o,n,10),l=[0,t],s=[-t/e,0],a=[(O-i-t)/e,O-i],u=[B-I,e*(B-I)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=I&&o<=B&&n>=i&&n<=O}function h([e,t]){return[I+e,O-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=_.find((e=>e.key===o));if(r){const r=G(o,i,0);n.push(t([I,r,B,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-I,O-G(o,a,l.value)],[p,h]=[S(c.time)-I,O-G(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),te(),function(){function e(e,t){const o=_.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=I&&o<=B&&n>=H&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...ee].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],_.filter((e=>e.show)).forEach((i=>{if(!Y([...ee],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<Q)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=q-J/2;function t(e,t){if(!e.length)return;let n=H;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=F.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(ie(u),re(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(Y([...ee],u.left,"key").includes(u.origin.key))E("repeat");else{const e={data:{time:M(u.left),value:T(u.origin.key,u.top)},...u.origin};j("add",e),oe(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-H)/2,n=(t.height+t.top-H)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(N,D/2),t(R,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),oe(o,"remove")):(Object.assign(o,{data:{time:M(e.pointer.x),value:T(e.origin.key,e.pointer.y)}}),j("add",o),oe(o))},redrawPoints:ne}}export{x as useBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as d}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import"../../../../../shared/utils/index.js";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,v,c,h,m,f){const p=e(),x=e(),g=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=a((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),j=a((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),b=a((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=a((()=>v.data.grid.mainXCell)),C=a((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=a((()=>(b.value-j.value)/A.value)),Y=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),S=a((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),H=a((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!S.value)return S.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return P.value-l*r*Y.value})),P=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-Y.value*t})),X=a((()=>i(v.data.xAxis.time.startTime))),F=a((()=>36e5/k.value)),R=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||10)})),O=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),M=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:j.value,endX:b.value,originY:S.value,endY:P.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:O.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:H.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=n(o,N,c,m,f);x.value=a,g.value=e,s(h.value);const{select:t}=d(o,N,c);p.value=t}))})),{propItems:N,redrawPoints:x,select:p,clickMenu:g}}export{o as useBirthProcessChart};
1
+ import{ref as e,computed as a,reactive as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as d}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,v,c,h,m,f){const g=e(),p=e(),x=e(),w=a((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=a((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=a((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),b=a((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),j=a((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=a((()=>v.data.grid.mainXCell)),C=a((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=a((()=>(j.value-b.value)/A.value)),Y=a((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),S=a((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),H=a((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!S.value)return S.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return P.value-l*r*Y.value})),P=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-Y.value*t})),X=a((()=>i(v.data.xAxis.time.startTime))),F=a((()=>36e5/k.value)),R=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),W=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||10)})),O=a((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return Y.value/((null==a?void 0:a.spaceValue)||1)})),M=a((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),N=t({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:b.value,endX:j.value,originY:S.value,endY:P.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:O.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:H.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=n(o,N,c,m,f);p.value=a,x.value=e,s(h.value);const{select:t}=d(o,N,c);g.value=t}))})),{propItems:N,redrawPoints:p,select:g,clickMenu:x}}export{o as useBirthProcessChart};
@@ -2,4 +2,10 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
4
  import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
- export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): void;
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
+ redrawPoints: (ItemObj?: AnyObject) => void;
7
+ clickMenu: ({ item, target }: {
8
+ item: any;
9
+ target: any;
10
+ }) => void;
11
+ };
@@ -1 +1 @@
1
- import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import{getIndex as o,isEffectiveNode as l,getTime as r}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{uuidGenerator as a}from"../../../../../shared/utils/index.js";function f(f,u,c,p,d){const{cumputedX:v,cumputedY:m,getXValue:g,getYValue:h}=i(u),{xCellWidth:y,yCellHeight:L,originX:x,endX:k,originY:A,endY:P,event:b,scaleValues:j,xAxis:w,startTime:C,timeXCell:X}=u,M=new Map,Y=new Set,V=s(j);let $=[];function E(){V.forEach((e=>{e.dataList.forEach(((t,n)=>{I(t,n,e)}))}))}function I(n,i,o){var l;const{type:r,unit:s,dataList:d=[]}=o,v=[],m=a();M.set(m,[]),null==(l=n.list)||l.forEach(((l,a)=>{!function(n,l,a,d){var L;let j,w;const{pointAttr:C={},lineAttr:V={},title:E="",key:I,type:T="circle"}=d,J=D(d.list[a+1],o);n&&J&&!l.breakpoint&&n[0]!==J[0]&&(w=e([...n,...J],V));const N=v[a-1],G={origin:{data:l,title:E,key:I||"",unit:s,type:r,dataIndex:i,index:a,lineAttr:V},uuid:m,leftLine:N,rightLine:w,...C,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};N?j=t(T,{left:N.get("x2"),top:N.get("y2"),...G}):n&&(G.leftLine=null,j=t(T,{left:n[0],top:n[1],...G}));v.push(w),j&&(j.originLeft=j.left,j.originTop=j.top,function(e){b.hovered&&(e.on("mouseover",(()=>{z(e,"hover")})),e.on("mouseout",(()=>{p.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/X,n=e.prevPoint?e.prevPoint.left+t:x,i=e.nextPoint?e.nextPoint.left-t:k;e.top<A&&e.set("top",A),e.top>P&&e.set("top",P),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),b.hovered&&z(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/y);if(i>t+y&&!e.nextPoint){if(0===$.length){O(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+y*r;if($.every((e=>e.left!==i))){const t=g(i),n=h(l.type,o);$.push({data:{time:t,value:n},left:i,top:o}),O(e,[...e.prevPointer,i,o])}$.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+y*l,r=$.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=$.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=$[l-1]||{left:n,top:i},f=~~((r.left-(t-y))/y),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:g(t),value:h(o.type,s.top)},$.splice(l,0,s),O(e,[a.left,a.top,s.left,s.top])}}l++}}(e,r)}if($.length>0&&i<$[$.length-1].left){for(const e of Y)e.left>i&&(e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e));if($=$.filter((e=>e.left<=i)),0===$.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of Y)e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e)}if($.length>0){const t=$.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(p.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:g(e.left),value:h(n,e.top)}};f.value.discardActiveObject();const o=Object.assign({},i,{uuid:e.uuid});if($.length>0){const e=$.map((e=>e.data));c("add",{...i,data:e}),S({...o,data:e},"add")}else c("change",i),S(o,"change")}}))}(j),null==(L=M.get(m))||L.push(j))}(D(l,o),l,a,n)})),Promise.all(M.get(m)).then((e=>{const t=v.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),f.value.add(...t,...e)}))}function O(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,Y.add(i),f.value.add(o,i)}))}function S(e,t="add"){const{dataIndex:n,data:i,index:l,key:r,type:s,uuid:a}=e,u=V.find((e=>e.type===s)),c=u.dataList.find((e=>e.key===r));switch(t){case"remove":c.list.splice(l,1);break;case"change":c.list[l]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=o(e,c.list),n=Array.isArray(i)?i:[i];c.list.splice(t,0,...n);break}}!function(e){var t,n,i;if(Y.size&&(null==(t=f.value)||t.remove(...T([...Y]))),Y.clear(),$=[],e){const{uuid:t,item:i,dataIndex:o,scaleValue:l}=e;null==(n=f.value)||n.remove(...T(M.get(t))),M.delete(t),I(i,o,l)}else{const e=Array.from(M.values()).flat();M.size&&(null==(i=f.value)||i.remove(...T(e))),M.clear(),E()}}({item:c,dataIndex:n,scaleValue:u,uuid:a})}function T(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function z(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;p.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:h(i,e.top)}`;p.list=[`${n} ${r}${l||""}`,`时间 ${g(e.left).slice(-5)}`],p.show=!0}function D(e,t){if(l(e)&&function(e){const t=Date.parse(w.list.at(-1)),n=r(e);return n>=C&&n<=t}(e.time)){const n=v(e.time),i=m(t.type,t.range,e.value);return[n,i<A?A:i>P?P:i]}}n(f,u),E()}export{f as useCenter};
1
+ import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as o}from"../useCommon.js";import"vue";import{getIndex as l,isEffectiveNode as r,getTime as a}from"../../utils/index.js";import{cloneDeep as s}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function f(f,u,p,c,d){const{cumputedX:v,cumputedY:m,getXValue:g,getYValue:h}=i(u),{xCellWidth:y,yCellHeight:L,originX:x,endX:k,originY:P,endY:b,event:A,scaleValues:w,xAxis:j,startTime:C,timeXCell:I,itemList:X}=u,E=new Map,M=new Set,T=s(w);let Y=[];n(f,u);const{getEqualXTypes:V,handleAddPrevent:$}=o(f,p,u);function O(){T.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))})),function(){if(!A.evented)return;f.value.on("mouse:up",(e=>{if(3===e.button){const{x:t=0,y:n=0}=e.pointer||{};t>=x&&t<=k&&n>=P&&n<=b&&(d.point={x:t,y:n},d.show=!0,e.target?(d.target=e.target,d.list=["删除节点"],H().forEach((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&d.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(d.target=null,d.list=["新增节点"],X.forEach((n=>{V(H(),t,"key").includes(n.key)||d.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key},pointer:e.pointer})})),1===d.list.length&&(d.show=!1,$("repeat"),console.log("当前时间段内无可新增节点"))))}}))}()}function S(n,i,o){var l;const{type:r,unit:a,dataList:s=[]}=o,d=[];E.set(n.key,[]),null==(l=n.list)||l.forEach(((l,s)=>{!function(n,l,s,v){var m;let L,w;const{pointAttr:j={},lineAttr:C={},title:X="",key:T,type:V="circle"}=v,$=G(v.list[s+1],o);n&&$&&!l.breakpoint&&n[0]!==$[0]&&(w=e([...n,...$],C));const O=d[s-1],S={origin:{data:l,title:X,key:T||"",unit:a,type:r,dataIndex:i,index:s,lineAttr:C},leftLine:O,rightLine:w,...j,...u.event.hovered?u.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:u.event};O?L=t(V,{left:O.get("x2"),top:O.get("y2"),...S}):n&&(S.leftLine=null,L=t(V,{left:n[0],top:n[1],...S}));d.push(w),L&&(L.originLeft=L.left,L.originTop=L.top,function(e){A.hovered&&(e.on("mouseover",(()=>{q(e,"hover")})),e.on("mouseout",(()=>{c.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/I,n=e.prevPoint?e.prevPoint.left+t:x,i=e.nextPoint?e.nextPoint.left-t:k;e.top<P&&e.set("top",P),e.top>b&&e.set("top",b),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),A.hovered&&q(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/y);if(i>t+y&&!e.nextPoint){if(0===Y.length){z(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+y*r;if(Y.every((e=>e.left!==i))){const t=g(i),n=h(l.type,o);Y.push({data:{time:t,value:n},left:i,top:o}),z(e,[...e.prevPointer,i,o])}Y.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+y*l,r=Y.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=Y.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=Y[l-1]||{left:n,top:i},f=~~((r.left-(t-y))/y),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:g(t),value:h(o.type,a.top)},Y.splice(l,0,a),z(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(Y.length>0&&i<Y[Y.length-1].left){for(const e of M)e.left>i&&(e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e));if(Y=Y.filter((e=>e.left<=i)),0===Y.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of M)e.leftLine&&f.value.remove(e.leftLine),f.value.remove(e)}if(Y.length>0){const t=Y.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(c.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:g(e.left),value:h(n,e.top)}};if(f.value.discardActiveObject(),Y.length>0){const e=Y.map((e=>e.data));p("add",{...i,data:e}),D({...i,data:e})}else p("change",i),D(i,"change")}}))}(L),null==(m=E.get(T))||m.push(L))}(G(l,o),l,s,n)})),Promise.all(E.get(n.key)).then((e=>{const t=d.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),f.value.add(...t,...e)}))}function z(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,M.add(i),f.value.add(o,i)}))}function D(e,t="add"){const{dataIndex:n,data:i,index:o,key:r,type:a}=e,s=T.find((e=>e.type===a)),f=s.dataList.find((e=>e.key===r));switch(t){case"remove":f.list.splice(o,1);break;case"change":f.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=l(e,f.list),n=Array.isArray(i)?i:[i];f.list.splice(t,0,...n);break}}J({dataIndex:n,scaleValue:s})}function J(e){var t,n,i;if(M.size&&(null==(t=f.value)||t.remove(...N([...M]))),M.clear(),Y=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=f.value)||n.remove(...N(E.get(o.key))),E.delete(o.key),S(o,t,i)}else E.size&&(null==(i=f.value)||i.remove(...N(H()))),E.clear(),O()}function N(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function q(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;c.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:h(i,e.top)}`;c.list=[`${n} ${r}${l||""}`,`时间 ${g(e.left).slice(-5)}`],c.show=!0}function G(e,t){if(r(e)&&function(e){const t=Date.parse(j.list.at(-1)),n=a(e);return n>=C&&n<=t}(e.time)){const n=v(e.time),i=m(t.type,t.range,e.value);return[n,i<P?P:i>b?b:i]}}function H(){return Array.from(E.values()).flat()}return O(),{redrawPoints:J,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(p("remove",n),D(n,"remove")):(Object.assign(n,{data:{time:g(e.pointer.x),value:h(e.origin.type,e.pointer.y)}}),p("add",n),D(n))}}}export{f as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as s}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as a}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function d(d,u,h){const{originY:c,endY:p,borderStyle:f,left:m,itemList:g,scaleValues:v,originX:w,endX:j,yCellHeight:y,markHeight:S,canvasWidth:x,canvasHeight:W}=u;!function(){if(!m)return;const{title:t,titleWidth:i,titleStyle:o}=m,l=e({width:i,height:p-c+S,...f},{value:t.split("").join("\n"),...o||{}},{left:0,top:c},!0);d.value.add(l)}(),v.forEach(((e,i)=>{var o,u;const h="left"===e.layout?w-5:j+5,{range:c,spaceValue:f,title:g,unit:v,titleStyle:S,spaceGridNumber:W=1,showNumber:b,showMaxMinNumber:N}=e,k=[],X=s(c,f),Y=X.length;X.forEach(((t,i)=>{const o=0===i?p-5:p-i*y*W;!b||(0===i||i===Y-1)&&!N||k.push(a(String(t),{...e,position:e.layout},h,o))}));const C=g&&l(["left"===e.layout?m.width/2:j+(x-j)/2,(null!=(u=null==(o=k.at(-1))?void 0:o.top)?u:330)-y],{value:`${g}${v?"\n"+v:""}`,...n,...S}),E=new t.Group([...k,...C?[C]:[]],{objectCaching:!1,...r});d.value.add(E),E.sendToBack()})),function(){const e=new t.Rect({width:w-m.titleWidth,height:p-c+S,left:m.titleWidth,top:c,...i,originX:"left",originY:"top",...f});d.value.add(e);const l=JSON.parse(JSON.stringify(g));let n=p;const r=m.titleWidth+15;l.reverse().forEach((t=>{n-=10;const e=t.title,{text:i,icon:l}=o(e,t,{text:{left:r,top:n},icon:{leftX:r,topY:n}});n-=i.height||30,d.value.add(i,l)}))}(),d.value.add(new t.Rect({left:0,top:0,width:x-f.strokeWidth,height:W-f.strokeWidth,fill:"transparent",...f}))}export{d as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as a}from"../../utils/index.js";import"@vueuse/core";import{drawScaleNumber as s}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";function u(u,d,h){const{originY:c,endY:p,borderStyle:f,left:m,itemList:g,scaleValues:v,originX:w,endX:j,yCellHeight:y,markHeight:S,canvasWidth:W,canvasHeight:b}=d;!function(){if(!m)return;const{title:t,titleWidth:i,titleStyle:o}=m,l=e({width:i,height:p-c+S,...f},{value:t.split("").join("\n"),...o||{}},{left:0,top:c},!0);u.value.add(l)}(),v.forEach(((e,i)=>{var o,d;const h="left"===e.layout?w-5:j+5,{range:c,spaceValue:f,title:g,unit:v,titleStyle:S,spaceGridNumber:b=1,showNumber:x,showMaxMinNumber:N}=e,k=[],X=a(c,f),Y=X.length;X.forEach(((t,i)=>{const o=0===i?p-5:p-i*y*b;!x||(0===i||i===Y-1)&&!N||k.push(s(String(t),{...e,position:e.layout},h,o))}));const C=g&&l(["left"===e.layout?m.width/2:j+(W-j)/2,(null!=(d=null==(o=k.at(-1))?void 0:o.top)?d:330)-y],{value:`${g}${v?"\n"+v:""}`,...n,...S}),E=new t.Group([...k,...C?[C]:[]],{objectCaching:!1,...r});u.value.add(E),E.sendToBack()})),function(){const e=new t.Rect({width:w-m.titleWidth,height:p-c+S,left:m.titleWidth,top:c,...i,originX:"left",originY:"top",...f});u.value.add(e);const l=JSON.parse(JSON.stringify(g));let n=p;const r=m.titleWidth+15;l.reverse().forEach((t=>{n-=10;const e=t.title,{text:i,icon:l}=o(e,t,{text:{left:r,top:n},icon:{leftX:r,topY:n}});n-=i.height||30,u.value.add(i,l)}))}(),u.value.add(new t.Rect({left:0,top:0,width:W-f.strokeWidth,height:b-f.strokeWidth,fill:"transparent",...f}))}export{u as useLeft};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as o,drawText as e}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function n(n,r,l,s){const{cumputedX:a,getXValue:u}=i(r),{other:c,yCellHeight:f,endX:d,originX:m,originY:h,endY:v,markHeight:p,event:g}=r;function x(t){const{name:o}=t.origin;s.point={x:t.left,y:t.top},s.list=[`${o}`,`时间 ${u(t.left).slice(-5)}`],s.show=!0}function X(t){return t>=m&&t<=d}!function(){if(!(null==c?void 0:c.horizontal))return;const{horizontal:i}=c,r=m-5;let l=h+f/2;i.forEach((i=>{const{title:s,titleStyle:u={},type:c,pointAttr:d={},textStyle:m={},data:h}=i,v=s&&o(s,{...u,originX:"right",left:r,top:l});n.value.add(v),h.forEach((i=>{const{time:r,value:s}=i,u=a(r);if(!X(u))return;const f=o(c,{...d,left:u,top:l}),h=u+f.width/2+2,v=e([h,l],{value:s,...m,originX:"left"}),p=new t.Group([f,v],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});n.value.add(p)})),l+=f}))}(),function(){if(!(null==c?void 0:c.vertical))return;const{vertical:t}=c;t.forEach((t=>{const{textStyle:e={},data:i,time:r}=t,l=a(r);if(!X(l))return;let s=h+f/2;i.forEach((t=>{const i=o(String(t),{...e,lockMovementX:!0,lockMovementY:!0,left:l,originX:"left",top:s});s+=f,n.value.add(i)}))}))}(),function(){if(!(null==c?void 0:c.mark)||!p)return;const{title:t,titleStyle:i,pointAttr:r,dataList:f}=c.mark,S=e([m-5,v+p/2],{value:t,...i,originX:"right"});n.value.add(S);const k=v+p,P=[];f.forEach((t=>{const{time:e,list:i=[]}=t,c=a(e);if(!X(c))return;let f=v;i.forEach((t=>{let e=!1;const i=o("circleAndText",{...r,text:t.text,left:c,top:f,origin:t}),a=i.height;f+a<=k&&f>=v?(i.set("top",f+a/2),f+=a):(e||(f=v,e=!0),i.set("top",f-a/2),f-=a),P.push(i),function(t){g.hovered&&(t.on("mouseover",(()=>{x(t)})),t.on("mouseout",(()=>{s.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<h&&t.set("top",h);const o=v+p-t.height/2;t.top>o&&t.set("top",o)}(t),g.hovered&&x(t)})),t.on("mouseup",(o=>{if(s.show=!1,1===o.button){!function(t){var o;if((null==(o=t.origin)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((o=>{o.limitX.x1=t.left}));else{const o=t.startPoint.otherPoints.map((t=>t.left));console.log(o);const e=Math.min(...o);console.log(e,t.startPoint),t.startPoint.limitX.x2=e}}(t);const o={type:"mark",time:u(t.left),data:t.origin};n.value.discardActiveObject(),l("change",o)}}))}(i),n.value.add(i)}))})),function(t){const o=t.find((t=>{var o;return null==(o=t.origin)?void 0:o.isStart})),e=t.find((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)&&t.left>o.left})),i=t.filter((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)}));t.forEach((t=>{var n;const r={x1:m,x2:d};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=e.left,t.otherPoints=i):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(P)}()}export{n as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as o,drawText as e}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";function n(n,r,l,s){const{cumputedX:a,getXValue:u}=i(r),{other:c,yCellHeight:f,endX:m,originX:d,originY:h,endY:v,markHeight:p,event:g}=r;function x(t){const{name:o}=t.origin;s.point={x:t.left,y:t.top},s.list=[`${o}`,`时间 ${u(t.left).slice(-5)}`],s.show=!0}function X(t){return t>=d&&t<=m}!function(){if(!(null==c?void 0:c.horizontal))return;const{horizontal:i}=c,r=d-5;let l=h+f/2;i.forEach((i=>{const{title:s,titleStyle:u={},type:c,pointAttr:m={},textStyle:d={},data:h}=i,v=s&&o(s,{...u,originX:"right",left:r,top:l});n.value.add(v),h.forEach((i=>{const{time:r,value:s}=i,u=a(r);if(!X(u))return;const f=o(c,{...m,left:u,top:l}),h=u+f.width/2+2,v=e([h,l],{value:s,...d,originX:"left"}),p=new t.Group([f,v],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});n.value.add(p)})),l+=f}))}(),function(){if(!(null==c?void 0:c.vertical))return;const{vertical:t}=c;t.forEach((t=>{const{textStyle:e={},data:i,time:r}=t,l=a(r);if(!X(l))return;let s=h+f/2;i.forEach((t=>{const i=o(String(t),{...e,lockMovementX:!0,lockMovementY:!0,left:l,originX:"left",top:s});s+=f,n.value.add(i)}))}))}(),function(){if(!(null==c?void 0:c.mark)||!p)return;const{title:t,titleStyle:i,pointAttr:r,dataList:f}=c.mark,S=e([d-5,v+p/2],{value:t,...i,originX:"right"});n.value.add(S);const k=v+p,P=[];f.forEach((t=>{const{time:e,list:i=[]}=t,c=a(e);if(!X(c))return;let f=v;i.forEach((t=>{let e=!1;const i=o("circleAndText",{...r,text:t.text,left:c,top:f,origin:t}),a=i.height;f+a<=k&&f>=v?(i.set("top",f+a/2),f+=a):(e||(f=v,e=!0),i.set("top",f-a/2),f-=a),P.push(i),function(t){g.hovered&&(t.on("mouseover",(()=>{x(t)})),t.on("mouseout",(()=>{s.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<h&&t.set("top",h);const o=v+p-t.height/2;t.top>o&&t.set("top",o)}(t),g.hovered&&x(t)})),t.on("mouseup",(o=>{if(s.show=!1,1===o.button){!function(t){var o;if((null==(o=t.origin)?void 0:o.isStart)&&t.otherPoints)t.otherPoints.forEach((o=>{o.limitX.x1=t.left}));else{const o=t.startPoint.otherPoints.map((t=>t.left));console.log(o);const e=Math.min(...o);console.log(e,t.startPoint),t.startPoint.limitX.x2=e}}(t);const o={type:"mark",time:u(t.left),data:t.origin};n.value.discardActiveObject(),l("change",o)}}))}(i),n.value.add(i)}))})),function(t){const o=t.find((t=>{var o;return null==(o=t.origin)?void 0:o.isStart})),e=t.find((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)&&t.left>o.left})),i=t.filter((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)}));t.forEach((t=>{var n;const r={x1:d,x2:m};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=e.left,t.otherPoints=i):(r.x1=o.left,t.startPoint=o),t.limitX=r}))}(P)}()}export{n as useOther};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as n}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as o,range as d}from"lodash-es";import"../temperature/useShadow.js";import{useTop as c}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useCenter as m}from"./useCenter.js";import{useOther as h}from"./useOther.js";function v(v,f,g,x,y,w){const b=e(),Y=e(),j=e(),C=t((()=>f.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),H=t((()=>{var e;return null!=(e=f.data.left.width)?e:0})),A=t((()=>{const{grid:e}=f.data;return e.mainXCell*e.subXCell})),D=t((()=>{const{grid:e}=f.data;return e.mainYCell*e.subYCell})),T=t((()=>s(f.data.top.treeData))),X=t((()=>f.data.top.tree.cellHeight)),V=t((()=>X.value*T.value)),G=t((()=>Z(R("drug")||"top"))),M=t((()=>G.value+V.value)),S=t((()=>{var e;return Date.parse((null==(e=f.data.xAxis)?void 0:e.startTime)||n(new Date,"yyyy-MM-dd HH:mm:ss"))})),N=t((()=>{const e=o(f.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=d(A.value/t+1).map((r=>0===r?e.startTime:n(new Date(S.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:H.value}})),O=function(){const e=o(f.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=f.data.top.tree;return function e(i,l=0){i.forEach((i=>{var u;const n={top:t*r+G.value,left:l*a,width:a,height:r};if(t++,null==(u=i.children)?void 0:u.length){t--;const a=s(i.children);n.height=a*r,e(i.children,l+1)}else n.width=H.value-n.left;Object.assign(i,n)}))}(e),e}(),k=t((()=>Z(R("xAxis")||"center"))),L=t((()=>{var e;const{width:t,right:a}=f.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>Z(R("intraoperatively")||"bottom"))),E=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=f.data.other)?void 0:e.mark)||{};return t&&a?a:0})),I=t((()=>W.value+(f.data.height-V.value-N.value.height-E.value))),P=t((()=>(L.value-H.value)/A.value)),q=t((()=>(I.value-W.value)/D.value)),z=t((()=>N.value.spaceTimeStamp/P.value)),B=t((()=>{const{scaleValues:e}=f.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),F=t((()=>$("pulse"))),J=t((()=>$("temperature"))),K=t((()=>{var e;return(null==(e=f.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),Q=a({canvasWidth:f.data.width,canvasHeight:f.data.height,borderStyle:{...u,...f.data.borderStyle||{}},grid:f.data.grid,top:f.data.top,left:f.data.left,other:f.data.other,topGridYNumber:r(T),topGridYCellHeight:r(X),topGridOriginY:r(G),topGridEndY:r(M),treeData:O,xAxis:r(N),originYXAxis:r(k),startTime:r(S),timeXCell:r(z),gridXNumber:r(A),gridYNumber:r(D),xCellWidth:r(P),yCellHeight:r(q),originX:r(H),endX:r(L),originY:r(W),endY:r(I),markHeight:r(E),itemList:r(B),scaleValues:f.data.scaleValues,pulseYCell:r(F),temperatureYCell:r(J),event:r(K)});function R(e){let t="";return Object.entries(C.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function U(e){const t=C.value[e],a=N.value.height;switch(t){case"drug":return V.value;case"xAxis":return a;default:return f.data.height-V.value-a}}function Z(e){switch(e){case"top":return 0;case"center":return U("top");default:return U("top")+U("center")}}function $(e){const{scaleValues:t}=f.data,a=t.find((t=>t.type===e));return q.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),c(v,Q,g,y),p(v,Q),h(v,Q,g,y),m(v,Q,g,y)})),{propItems:Q,redrawPoints:Y,select:b,clickMenu:j}}export{v as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as n}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{useEvent as o}from"../useEvent.js";import{cloneDeep as d,range as c}from"lodash-es";import"../temperature/useShadow.js";import{useTop as m}from"./useTop.js";import{useLeft as p}from"./useLeft.js";import{useCenter as v}from"./useCenter.js";import{useOther as h}from"./useOther.js";function f(f,g,x,y,w,b){const j=e(),Y=e(),C=e(),H=t((()=>g.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),A=t((()=>{var e;return null!=(e=g.data.left.width)?e:0})),D=t((()=>{const{grid:e}=g.data;return e.mainXCell*e.subXCell})),T=t((()=>{const{grid:e}=g.data;return e.mainYCell*e.subYCell})),X=t((()=>s(g.data.top.treeData))),M=t((()=>g.data.top.tree.cellHeight)),V=t((()=>M.value*X.value)),G=t((()=>$(U("drug")||"top"))),S=t((()=>G.value+V.value)),k=t((()=>{var e;return Date.parse((null==(e=g.data.xAxis)?void 0:e.startTime)||n(new Date,"yyyy-MM-dd HH:mm:ss"))})),N=t((()=>{const e=d(g.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(D.value/t+1).map((r=>0===r?e.startTime:n(new Date(k.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:A.value}})),O=function(){const e=d(g.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=g.data.top.tree;return function e(i,l=0){i.forEach((i=>{var u;const n={top:t*r+G.value,left:l*a,width:a,height:r};if(t++,null==(u=i.children)?void 0:u.length){t--;const a=s(i.children);n.height=a*r,e(i.children,l+1)}else n.width=A.value-n.left;Object.assign(i,n)}))}(e),e}(),E=t((()=>$(U("xAxis")||"center"))),L=t((()=>{var e;const{width:t,right:a}=g.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>$(U("intraoperatively")||"bottom"))),I=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=g.data.other)?void 0:e.mark)||{};return t&&a?a:0})),P=t((()=>W.value+(g.data.height-V.value-N.value.height-I.value))),q=t((()=>(L.value-A.value)/D.value)),z=t((()=>(P.value-W.value)/T.value)),B=t((()=>N.value.spaceTimeStamp/q.value)),F=t((()=>{const{scaleValues:e}=g.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),J=t((()=>_("pulse"))),K=t((()=>_("temperature"))),Q=t((()=>{var e;return(null==(e=g.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),R=a({canvasWidth:g.data.width,canvasHeight:g.data.height,borderStyle:{...u,...g.data.borderStyle||{}},grid:g.data.grid,top:g.data.top,left:g.data.left,other:g.data.other,topGridYNumber:r(X),topGridYCellHeight:r(M),topGridOriginY:r(G),topGridEndY:r(S),treeData:O,xAxis:r(N),originYXAxis:r(E),startTime:r(k),timeXCell:r(B),gridXNumber:r(D),gridYNumber:r(T),xCellWidth:r(q),yCellHeight:r(z),originX:r(A),endX:r(L),originY:r(W),endY:r(P),markHeight:r(I),itemList:r(F),scaleValues:g.data.scaleValues,pulseYCell:r(J),temperatureYCell:r(K),event:r(Q)});function U(e){let t="";return Object.entries(H.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function Z(e){const t=H.value[e],a=N.value.height;switch(t){case"drug":return V.value;case"xAxis":return a;default:return g.data.height-V.value-a}}function $(e){switch(e){case"top":return 0;case"center":return Z("top");default:return Z("top")+Z("center")}}function _(e){const{scaleValues:t}=g.data,a=t.find((t=>t.type===e));return z.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),m(f,R,x,w),p(f,R),h(f,R,x,w);const{redrawPoints:e,clickMenu:t}=v(f,R,x,w,b);Y.value=e,C.value=t,o(y.value)})),{propItems:R,redrawPoints:Y,select:j,clickMenu:C}}export{f as useSurgicalAnesthesiaChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as f}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"../../../../../shared/utils/index.js";function a(a,d,u,m,h){const{cumputedX:p,getXValue:x}=f(d),{originX:L,endX:g,xCellWidth:v,originYXAxis:X,top:C,topList:w,canvasWidth:y,borderStyle:Y,treeData:S,xAxis:j,topGridYNumber:b,topGridOriginY:k,topGridYCellHeight:G,topGridEndY:I,event:z}=d,A=new Set;function M(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:f}=C.data||{},{startLine:c,centerLine:a,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=$(n,e,i);n&&(n.set(u),n.origin={data:t},D(n),c&&(c.text=n),d&&(d.text=n))}return n}function $(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function E(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:f,y2:c,halfY:a}=e;if(!s||s<L||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:a};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,f,s,a],d);const h=new t.Rect({width:v,height:G,fill:"transparent",left:s-v/2,top:f}),p=new t.Group([u,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,D(p),p}function D(t){z.hovered&&(t.on("mouseover",(()=>{H(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=$(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),z.hovered&&H(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};u("change",e)}})))}function H(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=x(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(a,{...d,gridYNumber:b,originY:k,yCellHeight:G,endY:I}),function(){const{height:o,list:l,left:r,spaceValue:s}=j;if(!o)return;const f=[],c=X+o/2;l.forEach(((t,i)=>{const n=r+i*v*s;f.push(e([n,c],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&a.value.add(d);const u=new t.Rect({width:y,height:o,left:0,top:X,...n,originX:"left",originY:"top",...Y});a.value.add(u)}(),function(){var e;const n=(null==(e=null==C?void 0:C.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:f,left:a,top:d,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+G,s=r-G/2,f={y1:o,y2:r,halfY:s},a=[],d=c(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[c,u]=o,m=c&&p(c),h=u&&p(u),x=E({...f,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),v=E({...f,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,w;if((x||m<L)&&(v||h>g)){X=l([x?m:L,s,v?h:g,s],e)}a.push({startLine:x,centerLine:X,endLine:v}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:L,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:L,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,a,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=M(n[i-1],a[i-1],s)),i===n.length-1&&(w=M(t,a[i],s)),X&&A.add(X),x&&A.add(x),v&&A.add(v),C&&A.add(C),w&&A.add(w)}))}(e)),r.push(o({width:s,height:f,...Y},m,{left:a,top:d},!0))}))}(S);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&a.value.add(s),A.size&&a.value.add(...A)}()}export{a as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as f}from"../useCumputedPoint.js";import"@vueuse/core";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,u,d,m,h){const{cumputedX:p,getXValue:x}=f(u),{originX:L,endX:g,xCellWidth:v,originYXAxis:X,top:C,topList:w,canvasWidth:y,borderStyle:Y,treeData:S,xAxis:j,topGridYNumber:b,topGridOriginY:k,topGridYCellHeight:G,topGridEndY:I,event:z}=u,A=new Set;function M(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:f}=C.data||{},{startLine:c,centerLine:a,endLine:u}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const d=$(n,e,i);n&&(n.set(d),n.origin={data:t},D(n),c&&(c.text=n),u&&(u.text=n))}return n}function $(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function E(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:f,y2:c,halfY:a}=e;if(!s||s<L||s>g)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:a};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,f,s,a],u);const h=new t.Rect({width:v,height:G,fill:"transparent",left:s-v/2,top:f}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,D(p),p}function D(t){z.hovered&&(t.on("mouseover",(()=>{H(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=$(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),z.hovered&&H(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function H(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=x(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(a,{...u,gridYNumber:b,originY:k,yCellHeight:G,endY:I}),function(){const{height:o,list:l,left:r,spaceValue:s}=j;if(!o)return;const f=[],c=X+o/2;l.forEach(((t,i)=>{const n=r+i*v*s;f.push(e([n,c],{value:t.slice(11,16)}))}));const u=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;u&&a.value.add(u);const d=new t.Rect({width:y,height:o,left:0,top:X,...n,originX:"left",originY:"top",...Y});a.value.add(d)}(),function(){var e;const n=(null==(e=null==C?void 0:C.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:f,left:a,top:u,title:d=""}=e,m={value:d,...n};(null==(i=e.children)?void 0:i.length)?(m.value=d.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+G,s=r-G/2,f={y1:o,y2:r,halfY:s},a=[],u=c(t);delete u.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[c,d]=o,m=c&&p(c),h=d&&p(d),x=E({...f,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),v=E({...f,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,w;if((x||m<L)&&(v||h>g)){X=l([x?m:L,s,v?h:g,s],e)}a.push({startLine:x,centerLine:X,endLine:v}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:L,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:L,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,a,Object.assign({},u,{data:t,index:i})),n[i-1]&&(C=M(n[i-1],a[i-1],s)),i===n.length-1&&(w=M(t,a[i],s)),X&&A.add(X),x&&A.add(x),v&&A.add(v),C&&A.add(C),w&&A.add(w)}))}(e)),r.push(o({width:s,height:f,...Y},m,{left:a,top:u},!0))}))}(S);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&a.value.add(s),A.size&&a.value.add(...A)}()}export{a as useTop};