cnhis-design-vue 3.1.44-beta.0 → 3.1.44-beta.10

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 (97) hide show
  1. package/es/components/base-search/index.d.ts +1 -0
  2. package/es/components/base-search/src/index.vue.d.ts +1 -0
  3. package/es/components/base-search/src/index.vue.js +1 -1
  4. package/es/components/base-search/style/index.css +1 -1
  5. package/es/components/classification/index.d.ts +6 -2
  6. package/es/components/classification/src/components/search-filter/index.vue.d.ts +6 -2
  7. package/es/components/classification/src/components/set-classification/index.vue.d.ts +6 -2
  8. package/es/components/classification/src/index.vue.d.ts +6 -2
  9. package/es/components/fabric-chart/index.d.ts +4 -2
  10. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +4 -2
  11. package/es/components/fabric-chart/src/FabricChart.vue.js +1 -1
  12. package/es/components/fabric-chart/src/hooks/useBirthProcess.d.ts +2 -2
  13. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +1 -1
  14. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +1 -1
  15. package/es/components/fabric-chart/src/hooks/useBottom.js +1 -1
  16. package/es/components/fabric-chart/src/hooks/useCenter.d.ts +3 -3
  17. package/es/components/fabric-chart/src/hooks/useCenter.js +1 -1
  18. package/es/components/fabric-chart/src/hooks/useCommon.d.ts +2 -4
  19. package/es/components/fabric-chart/src/hooks/useCommon.js +1 -1
  20. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  21. package/es/components/fabric-chart/src/hooks/useDraw.d.ts +1 -0
  22. package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
  23. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  24. package/es/components/fabric-chart/src/hooks/useLeft.d.ts +1 -1
  25. package/es/components/fabric-chart/src/hooks/useLeft.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/useRight.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/useTop.d.ts +1 -1
  29. package/es/components/fabric-chart/src/hooks/useTop.js +1 -1
  30. package/es/components/fabric-chart/src/utils/utils.d.ts +2 -0
  31. package/es/components/fabric-chart/src/utils/utils.js +1 -1
  32. package/es/components/form-config/index.d.ts +5 -0
  33. package/es/components/form-config/src/FormConfig.vue.d.ts +5 -0
  34. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +3 -0
  35. package/es/components/form-render/src/components/renderer/combination.d.ts +10 -1
  36. package/es/components/form-render/src/components/renderer/combination.js +1 -1
  37. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  38. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  39. package/es/components/form-render/src/hooks/useNuiThemeOverrides.js +1 -1
  40. package/es/components/form-render/src/types/fieldItem.d.ts +2 -0
  41. package/es/components/form-render/style/index.css +1 -1
  42. package/es/components/iho-select-label/index.d.ts +15 -4
  43. package/es/components/iho-select-label/src/LabelFormContent.vue.d.ts +5 -2
  44. package/es/components/iho-select-label/src/SelectLabel.vue.d.ts +10 -2
  45. package/es/components/iho-select-label/src/SelectLabel.vue.js +1 -1
  46. package/es/components/iho-select-label/src/components/label-classify.vue.d.ts +5 -2
  47. package/es/components/iho-select-label/src/components/label-classify.vue.js +1 -1
  48. package/es/components/iho-select-label/style/index.css +1 -1
  49. package/es/components/iho-table/src/IhoTable.vue.js +1 -1
  50. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/inputRendererPlugin.js +1 -1
  51. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  52. package/es/components/iho-table/src/types/index.d.ts +1 -0
  53. package/es/components/index.css +1 -1
  54. package/es/components/quick-search/index.d.ts +1 -0
  55. package/es/components/quick-search/src/index.vue.d.ts +1 -0
  56. package/es/components/quick-search/style/index.css +1 -1
  57. package/es/components/search-cascader/src/components/SearchMenu.js +1 -1
  58. package/es/components/search-cascader/style/index.css +1 -1
  59. package/es/components/shortcut-setter/index.d.ts +1 -0
  60. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
  61. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +6 -2
  62. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +6 -2
  63. package/es/components/table-filter/src/components/render-widget/basicData.js +1 -1
  64. package/es/components/table-filter/src/components/render-widget/components/Date.vue.d.ts +39 -1
  65. package/es/components/table-filter/src/components/render-widget/components/Date.vue.js +1 -1
  66. package/es/components/table-filter/src/components/render-widget/components/{DateRange.vue.d.ts → DateRangeInner.vue.d.ts} +42 -15
  67. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.js +1 -0
  68. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +141 -0
  69. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.js +1 -0
  70. package/es/components/table-filter/src/components/render-widget/components/InputNumberGroup.vue.js +1 -1
  71. package/es/components/table-filter/src/components/render-widget/components/Label.vue.d.ts +70 -0
  72. package/es/components/table-filter/src/components/render-widget/components/Label.vue.js +1 -0
  73. package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +1 -1
  74. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.d.ts +56 -0
  75. package/es/components/table-filter/src/components/render-widget/components/SelectLabel.vue.js +1 -0
  76. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +5 -2
  77. package/es/components/table-filter/src/components/render-widget/components/index.js +1 -1
  78. package/es/components/table-filter/src/components/render-widget/enums.d.ts +28 -7
  79. package/es/components/table-filter/src/components/render-widget/enums.js +1 -1
  80. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +1 -0
  81. package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +1 -1
  82. package/es/components/table-filter/src/components/render-widget/index.vue.js +1 -1
  83. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +377 -16
  84. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +1 -1
  85. package/es/components/table-filter/src/directive/resize.d.ts +4 -0
  86. package/es/components/table-filter/src/directive/resize.js +1 -0
  87. package/es/components/table-filter/src/hooks/useAdvanced.d.ts +1 -0
  88. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  89. package/es/components/table-filter/src/hooks/useRenderWidget.js +1 -1
  90. package/es/components/table-filter/src/tool/resizeSensor.d.ts +16 -0
  91. package/es/components/table-filter/src/tool/resizeSensor.js +1 -0
  92. package/es/components/table-filter/src/types/enums.d.ts +6 -2
  93. package/es/components/table-filter/src/types/enums.js +1 -1
  94. package/es/components/table-filter/src/types/index.d.ts +14 -0
  95. package/es/shared/package.json.js +1 -1
  96. package/package.json +2 -2
  97. package/es/components/table-filter/src/components/render-widget/components/DateRange.vue.js +0 -1
@@ -50,6 +50,7 @@ declare const CBaseSearch: SFCWithInstall<import("vue").DefineComponent<{
50
50
  multiple: boolean;
51
51
  manualMapping: boolean | null | undefined;
52
52
  dynamicOptionInfo: import("..").dynamicOptionInfoType | {} | undefined;
53
+ classifyStr: string | undefined;
53
54
  };
54
55
  rangeFilter: boolean | undefined;
55
56
  title: string;
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  multiple: boolean;
52
52
  manualMapping: boolean | null | undefined;
53
53
  dynamicOptionInfo: import("../../../../es/components/table-filter/src/types").dynamicOptionInfoType | {} | undefined;
54
+ classifyStr: string | undefined;
54
55
  };
55
56
  rangeFilter: boolean | undefined;
56
57
  title: string;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,computed as i,watch as l,openBlock as a,createElementBlock as n,createElementVNode as r,createCommentVNode as o,renderSlot as s,unref as u,createVNode as c,withCtx as f,createTextVNode as d,toDisplayString as h,Fragment as m,renderList as p}from"vue";import v from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import b from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as y,NIcon as k}from"naive-ui";import{Search as S}from"@vicons/ionicons5";import{cloneDeep as j}from"lodash-es";import x from"../../../_virtual/plugin-vue_export-helper.js";const q={class:"base-search-block"},R={class:"base-container"},_={class:"bease-left"},A={class:"base-ul"},O={key:0,class:"baseli showQuickBtn"},F=r("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),I={key:0,class:"qqConObjCount"},Q={key:1,class:"baseli"},V={key:2,class:"baseli"},w=r("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var B=x(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,{emit:x}){const B=e,{outQuickSearchFn:E}=g(),{isRender:D,getRenderSearchConObj:L,isExistDefValByRenderWidget:N,resetRenderWidgetValue:P}=C(),{transformData:W,transformParams:U}=b(),$=t([]),z=t(!1),M=t([]),T=i((()=>H("hideQuickSearch"))),G=i((()=>H("hideResetBtn")));function H(e){return 0==B.showSettings[e]}function J(){x("foldQuickSearch",!0)}function K(e={}){const t=Y()||[];!function(e,t,i=!1,l={}){let a=[];M.value.length>0&&(a=j(M.value));x("onFilterSearch",e,t,i,a,l)}(t,U(t),!0,e)}function X(e,t){M.value.forEach((i=>{i._frontId===e&&(i.widgetCfg.isInit=t)}))}function Y(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let i=0;i<e.length;i++){let l=e[i];const a=L(l);a&&t.push(a)}return t.filter((e=>e.value))}(M.value)}function Z(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{P(e)})),E.handlerInitSearchItem(e)}(M.value),x("handleReset",{targetType:"outQuickSearchReset"})}return l((()=>B.searchFieldList),(e=>{e&&e.length>0&&function(){M.value=[];let e=j(W(B.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));M.value=e,E.handlerInitSearchItem(M.value),M.value.some((e=>D(e)?N(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),l((()=>B.qqConObjCount),(e=>{const t=$.value.length||0;z.value=t+Number(e)>0&&G.value}),{immediate:!0}),l((()=>M),(()=>{$.value=Y()||[];const e=U($.value);z.value=$.value.length+Number(B.qqConObjCount)>0&&G.value,x("getFilterParam",$.value,e)}),{immediate:!0,deep:!0}),(t,i)=>(a(),n("div",q,[r("div",R,[r("div",_,[r("ul",A,[o(" 筛选分类插槽 "),s(t.$slots,"classification"),u(T)?(a(),n("li",O,[c(u(y),{class:"search-default",type:"default",onClick:J},{default:f((()=>[F,d(" 筛选"),e.qqConObjCount?(a(),n("span",I,"("+h(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(a(!0),n(m,null,p(M.value,(t=>(a(),n(m,null,[t.isRender?(a(),n("li",{class:"baseli outQuickSearch-li",key:t._frontId},[c(v,{cfg:t,modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,filterApiConfig:e.filterApiConfig,onOutFilterChange:K,onChangeInit:X},null,8,["cfg","modelValue","onUpdate:modelValue","filterApiConfig"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),M.value&&M.value.length>0?(a(),n("li",Q,[c(u(y),{type:"primary",onClick:K},{default:f((()=>[c(u(k),{component:u(S),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),d(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),z.value?(a(),n("li",V,[c(u(y),{onClick:Z},{default:f((()=>[w,d(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),s(t.$slots,"buttons")])])])]))}}),[["__file","index.vue"]]);export{B as default};
1
+ import{defineComponent as e,ref as t,computed as i,watch as l,openBlock as a,createElementBlock as n,createElementVNode as r,createCommentVNode as o,renderSlot as s,unref as u,createVNode as c,withCtx as f,createTextVNode as d,toDisplayString as h,Fragment as m,renderList as p}from"vue";import v from"../../table-filter/src/components/render-widget/index.vue.js";import g from"../../table-filter/src/hooks/useMixins.js";import b from"../../table-filter/src/hooks/useAdvanced.js";import C from"../../table-filter/src/hooks/useRenderWidget.js";import{NButton as y,NIcon as k}from"naive-ui";import{Search as S}from"@vicons/ionicons5";import{cloneDeep as j}from"lodash-es";import x from"../../../_virtual/plugin-vue_export-helper.js";const q={class:"base-search-block"},R={class:"base-container"},_={class:"bease-left"},A={class:"base-ul"},O={key:0,class:"baseli showQuickBtn"},F=r("i",{class:"iconfont-table-filter icon-table-filter-shaixuan",style:{color:"inherit","margin-right":"6px"}},null,-1),I={key:0,class:"qqConObjCount"},Q={key:1,class:"baseli"},V={key:2,class:"baseli"},w=r("i",{class:"iconfont-table-filter icon-table-filter-reset",style:{"margin-right":"6px"}},null,-1);var B=x(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:x,emit:B}){const E=e,{outQuickSearchFn:D}=g(),{isRender:L,getRenderSearchConObj:N,isExistDefValByRenderWidget:P,resetRenderWidgetValue:W}=C(),{transformData:U,transformParams:$}=b(),z=t([]),M=t(!1),T=t([]),G=i((()=>J("hideQuickSearch"))),H=i((()=>J("hideResetBtn")));function J(e){return 0==E.showSettings[e]}function K(){B("foldQuickSearch",!0)}function X(e={}){const t=Z()||[];!function(e,t,i=!1,l={}){let a=[];T.value.length>0&&(a=j(T.value));B("onFilterSearch",e,t,i,a,l)}(t,$(t),!0,e)}function Y(e,t){T.value.forEach((i=>{i._frontId===e&&(i.widgetCfg.isInit=t)}))}function Z(){return function(e){if(!Array.isArray(e))return[];let t=[];for(let i=0;i<e.length;i++){let l=e[i];const a=N(l);a&&t.push(a)}return t.filter((e=>e.value))}(T.value)}function ee(){!function(e){if(!Array.isArray(e))return;e.forEach((e=>{W(e)})),D.handlerInitSearchItem(e)}(T.value),B("handleReset",{targetType:"outQuickSearchReset"})}return l((()=>E.searchFieldList),(e=>{e&&e.length>0&&function(){T.value=[];let e=j(U(E.searchFieldList)).filter((e=>1==e.isShowSearch&&1==e.filterExplicit));T.value=e,D.handlerInitSearchItem(T.value),T.value.some((e=>L(e)?P(e):!!e.explicitDefaultVal))}()}),{immediate:!0,deep:!0}),l((()=>E.qqConObjCount),(e=>{const t=z.value.length||0;M.value=t+Number(e)>0&&H.value}),{immediate:!0}),l((()=>T),(()=>{z.value=Z()||[];const e=$(z.value);M.value=z.value.length+Number(E.qqConObjCount)>0&&H.value,B("getFilterParam",z.value,e)}),{immediate:!0,deep:!0}),x({handleReset:ee}),(t,i)=>(a(),n("div",q,[r("div",R,[r("div",_,[r("ul",A,[o(" 筛选分类插槽 "),s(t.$slots,"classification"),u(G)?(a(),n("li",O,[c(u(y),{class:"search-default",type:"default",onClick:K},{default:f((()=>[F,d(" 筛选"),e.qqConObjCount?(a(),n("span",I,"("+h(e.qqConObjCount)+")",1)):o("v-if",!0)])),_:1})])):o("v-if",!0),o(" start--筛选外显--start "),(a(!0),n(m,null,p(T.value,(t=>(a(),n(m,null,[t.isRender?(a(),n("li",{class:"baseli outQuickSearch-li",key:t._frontId},[c(v,{cfg:t,modelValue:t.value,"onUpdate:modelValue":e=>t.value=e,filterApiConfig:e.filterApiConfig,onOutFilterChange:X,onChangeInit:Y},null,8,["cfg","modelValue","onUpdate:modelValue","filterApiConfig"])])):o("v-if",!0)],64)))),256)),o(" end--筛选外显--end "),o(" 查询按钮 "),T.value&&T.value.length>0?(a(),n("li",Q,[c(u(y),{type:"primary",onClick:X},{default:f((()=>[c(u(k),{component:u(S),size:"16",style:{"margin-right":"6px"}},null,8,["component"]),d(" 查询 ")])),_:1})])):o("v-if",!0),o(" 重置按钮 "),M.value?(a(),n("li",V,[c(u(y),{onClick:ee},{default:f((()=>[w,d(" 重置 ")])),_:1})])):o("v-if",!0),o(" 业务按钮插槽 "),s(t.$slots,"buttons")])])])]))}}),[["__file","index.vue"]]);export{B as default};
@@ -1 +1 @@
1
- @font-face{font-family:base-search-iconfont;src:url(base-search-iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:base-search-iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.render-widget-input-number-group{align-items:center;display:flex}.render-widget-input-number-group .divider{text-align:center;width:24px}.n-base-select-option__content{width:100%}.n-base-select-option__content .select-widget-dynamic-option{display:flex;flex-wrap:nowrap;width:100%}.n-base-select-option__content .select-widget-dynamic-option .select-widget-dynamic-item{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.render-widget-date-range{align-items:center;display:flex;flex-wrap:nowrap;width:100%}.render-widget-date-range .radio-date-group{border:1px solid #d9d9d9;display:flex}.render-widget-date-range .radio-date-group .radio-date-item{border-left:1px solid #d9d9d9;cursor:pointer;height:30px;line-height:30px;padding:0 8px}.render-widget-date-range .radio-date-group .radio-date-item:first-child{border:none}.render-widget-date-range .radio-date-group .radio-date-item.radio-date-item-active{background:#3e65cf;border-color:#3e65cf;color:#fff}.render-widget-date-range .select-date-left{margin-left:16px}.render-widget-date-range .select-date-right{margin-right:16px}.render-widget-date-range .date-detail-range{display:flex;flex-wrap:nowrap}.render-widget-date-range .date-detail-range .divider{text-align:center;width:10px}.base-search-block .base-container{display:flex;justify-content:space-between;text-align:left}.base-search-block .base-container .bease-left{align-items:flex-start;display:flex;flex:1;justify-content:flex-start}.base-search-block .base-container .bease-left .base-ul{align-items:center;display:flex;flex-wrap:wrap;margin-top:0}.base-search-block .base-container .bease-left .base-ul .baseli{display:flex;margin-bottom:8px;margin-right:8px}.base-search-block .base-container .bease-left .base-ul .baseli .search-default{height:32px;line-height:32px}
1
+ @font-face{font-family:base-search-iconfont;src:url(base-search-iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:base-search-iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.render-widget-input-number-group{align-items:center;display:flex}.render-widget-input-number-group .divider{text-align:center;width:24px}.n-base-select-option__content{width:100%}.n-base-select-option__content .select-widget-dynamic-option{display:flex;flex-wrap:nowrap;width:100%}.n-base-select-option__content .select-widget-dynamic-option .select-widget-dynamic-item{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.render-widget-date-range{align-items:center;display:flex;flex-wrap:nowrap;width:100%}.render-widget-date-range .radio-date-group{border:1px solid #d9d9d9;display:flex;min-width:720px}.render-widget-date-range .radio-date-group .radio-date-item{border-left:1px solid #d9d9d9;cursor:pointer;height:30px;line-height:30px;padding:0 8px}.render-widget-date-range .radio-date-group .radio-date-item:first-child{border:none}.render-widget-date-range .radio-date-group .radio-date-item.radio-date-item-active{background:#3e65cf;border-color:#3e65cf;color:#fff}.render-widget-date-range .select-date-left{margin-left:16px}.render-widget-date-range .select-date-right{margin-right:16px}.render-widget-date-range .date-detail-range{display:flex;flex-wrap:nowrap}.render-widget-date-range .date-detail-range .divider{text-align:center;width:10px}.label-attr-filter-container .edit-f-label{font-size:14px;line-height:32px;padding-left:0}.label-attr-filter-container .edit-f-content.label-select-height{flex:none;height:74px;overflow:hidden}.label-attr-filter-container .edit-f-content .label-f-content{display:flex;flex-wrap:wrap}.label-attr-filter-container .edit-f-content .label-f-content .n-tag{border:1px solid #e0e0e6;height:32px;margin:0 8px 8px 0;max-width:108px;text-align:center}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content{align-items:center;display:inline-flex}.label-attr-filter-container .edit-f-content .label-f-content .n-tag .n-tag__content span{display:inline-block;height:100%;line-height:30px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:80px}.label-attr-filter-container .label-f-unfold-btn{margin:8px 0}.label-attr-filter-container .label-f-unfold-btn .operate-btn{align-items:center;cursor:pointer;display:flex}.label-attr-filter-container .label-f-unfold-btn .operate-btn .n-icon{margin-left:6px}.base-search-block .base-container{display:flex;justify-content:space-between;text-align:left}.base-search-block .base-container .bease-left{align-items:flex-start;display:flex;flex:1;justify-content:flex-start}.base-search-block .base-container .bease-left .base-ul{align-items:center;display:flex;flex-wrap:wrap;margin-top:0}.base-search-block .base-container .bease-left .base-ul .baseli{display:flex;margin-bottom:8px;margin-right:8px}.base-search-block .base-container .bease-left .base-ul .baseli .search-default{height:32px;line-height:32px}
@@ -767,8 +767,12 @@ declare const CClassification: SFCWithInstall<import("vue").DefineComponent<{
767
767
  DATE_TIME: string;
768
768
  CHECKBOX_GROUP: string;
769
769
  INPUTNUMBER_RANGE: string;
770
- DATE_RANGE: string;
771
- DATETIME_RANGE: string;
770
+ DATE_RANGE_OUT: string;
771
+ DATE_RANGE_INNER: string;
772
+ DATETIME_RANGE_OUT: string;
773
+ DATETIME_RANGE_INNER: string;
774
+ LABEL: string;
775
+ SELECTLABEL: string;
772
776
  };
773
777
  WidgetValEnums: {
774
778
  CUSTOM: string;
@@ -237,8 +237,12 @@ declare const _default: import("vue").DefineComponent<{
237
237
  DATE_TIME: string;
238
238
  CHECKBOX_GROUP: string;
239
239
  INPUTNUMBER_RANGE: string;
240
- DATE_RANGE: string;
241
- DATETIME_RANGE: string;
240
+ DATE_RANGE_OUT: string;
241
+ DATE_RANGE_INNER: string;
242
+ DATETIME_RANGE_OUT: string;
243
+ DATETIME_RANGE_INNER: string;
244
+ LABEL: string;
245
+ SELECTLABEL: string;
242
246
  };
243
247
  WidgetValEnums: {
244
248
  CUSTOM: string;
@@ -554,8 +554,12 @@ declare const _default: import("vue").DefineComponent<{
554
554
  DATE_TIME: string;
555
555
  CHECKBOX_GROUP: string;
556
556
  INPUTNUMBER_RANGE: string;
557
- DATE_RANGE: string;
558
- DATETIME_RANGE: string;
557
+ DATE_RANGE_OUT: string;
558
+ DATE_RANGE_INNER: string;
559
+ DATETIME_RANGE_OUT: string;
560
+ DATETIME_RANGE_INNER: string;
561
+ LABEL: string;
562
+ SELECTLABEL: string;
559
563
  };
560
564
  WidgetValEnums: {
561
565
  CUSTOM: string;
@@ -768,8 +768,12 @@ declare const _default: import("vue").DefineComponent<{
768
768
  DATE_TIME: string;
769
769
  CHECKBOX_GROUP: string;
770
770
  INPUTNUMBER_RANGE: string;
771
- DATE_RANGE: string;
772
- DATETIME_RANGE: string;
771
+ DATE_RANGE_OUT: string;
772
+ DATE_RANGE_INNER: string;
773
+ DATETIME_RANGE_OUT: string;
774
+ DATETIME_RANGE_INNER: string;
775
+ LABEL: string;
776
+ SELECTLABEL: string;
773
777
  };
774
778
  WidgetValEnums: {
775
779
  CUSTOM: string;
@@ -29,8 +29,9 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
29
29
  onSelect?: ((...args: any[]) => any) | undefined;
30
30
  onAdd?: ((...args: any[]) => any) | undefined;
31
31
  onRemove?: ((...args: any[]) => any) | undefined;
32
+ "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
32
33
  }>>;
33
- emits: (event: "select" | "add" | "change" | "remove", ...args: any[]) => void;
34
+ emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
34
35
  isTemperature: import("vue").ComputedRef<boolean>;
35
36
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
36
37
  canvas: import("vue").Ref<any>;
@@ -182,7 +183,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
182
183
  show: boolean;
183
184
  list: unknown[];
184
185
  }>;
185
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove")[], "remove" | "select" | "add" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
186
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove" | "add:prevent")[], "remove" | "select" | "add" | "change" | "add:prevent", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
186
187
  type: {
187
188
  type: import("vue").PropType<import("./src/interface").IType>;
188
189
  default: string;
@@ -199,6 +200,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
199
200
  onSelect?: ((...args: any[]) => any) | undefined;
200
201
  onAdd?: ((...args: any[]) => any) | undefined;
201
202
  onRemove?: ((...args: any[]) => any) | undefined;
203
+ "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
202
204
  }, {
203
205
  type: import("./src/interface").IType;
204
206
  }>>;
@@ -31,8 +31,9 @@ declare const _default: import("vue").DefineComponent<{
31
31
  onSelect?: ((...args: any[]) => any) | undefined;
32
32
  onAdd?: ((...args: any[]) => any) | undefined;
33
33
  onRemove?: ((...args: any[]) => any) | undefined;
34
+ "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
34
35
  }>>;
35
- emits: (event: "select" | "add" | "change" | "remove", ...args: any[]) => void;
36
+ emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
36
37
  isTemperature: import("vue").ComputedRef<boolean>;
37
38
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
38
39
  canvas: import("vue").Ref<any>;
@@ -184,7 +185,7 @@ declare const _default: import("vue").DefineComponent<{
184
185
  show: boolean;
185
186
  list: unknown[];
186
187
  }>;
187
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove")[], "remove" | "select" | "add" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
188
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "add" | "change" | "remove" | "add:prevent")[], "remove" | "select" | "add" | "change" | "add:prevent", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
188
189
  type: {
189
190
  type: PropType<IType>;
190
191
  default: string;
@@ -201,6 +202,7 @@ declare const _default: import("vue").DefineComponent<{
201
202
  onSelect?: ((...args: any[]) => any) | undefined;
202
203
  onAdd?: ((...args: any[]) => any) | undefined;
203
204
  onRemove?: ((...args: any[]) => any) | undefined;
205
+ "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
204
206
  }, {
205
207
  type: IType;
206
208
  }>;
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,ref as r,onMounted as o,openBlock as s,createElementBlock as n,Fragment as p,createElementVNode as a,createBlock as i,mergeProps as u,unref as l,createCommentVNode as c}from"vue";import{fabric as m}from"./utils/index.js";import f from"./components/PopupTip.vue.js";import h from"./components/PopupMenu.js";import v from"./hooks/useTemperatureChart.js";import d from"./hooks/useBirthProcessChart.js";import k from"../../../_virtual/plugin-vue_export-helper.js";var C=k(e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select"],setup(e,{expose:k,emit:C}){const w=e,y=t((()=>"temperature"===w.type)),g=r(null),j=r(),{propItems:P,redrawPoints:_,select:I,pointTipProps:b,pointMenuProps:M,clickMenu:x}=function(){const e=[j,w,C,g];return y.value?v(...e):d(...e)}();return o((()=>{j.value=new m.Canvas(g.value,{width:P.canvasWidth,height:P.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0})})),k({redrawPoints:_,select:I,canvas:j}),(e,t)=>(s(),n(p,null,[a("canvas",{ref_key:"canvasRef",ref:g},null,512),j.value?(s(),i(f,u({key:0,propItems:l(P)},l(b)),null,16,["propItems"])):c("v-if",!0),j.value?(s(),i(l(h),u({key:1,propItems:l(P)},l(M),{show:l(M).show,"onUpdate:show":t[0]||(t[0]=e=>l(M).show=e),onClickMenu:l(x)}),null,16,["propItems","show","onClickMenu"])):c("v-if",!0)],64))}}),[["__file","FabricChart.vue"]]);export{C as default};
1
+ import{defineComponent as e,computed as t,ref as r,onMounted as o,onBeforeUnmount as a,openBlock as s,createElementBlock as n,Fragment as p,createElementVNode as i,createBlock as u,mergeProps as l,unref as c,createCommentVNode as m}from"vue";import{fabric as f}from"./utils/index.js";import v from"./components/PopupTip.vue.js";import h from"./components/PopupMenu.js";import d from"./hooks/useTemperatureChart.js";import k from"./hooks/useBirthProcessChart.js";import C from"../../../_virtual/plugin-vue_export-helper.js";var w=C(e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:C,emit:w}){const y=e,g=t((()=>"temperature"===y.type)),j=r(null),P=r(),{propItems:_,redrawPoints:I,select:b,pointTipProps:M,pointMenuProps:x,clickMenu:F}=function(){const e=[P,y,w,j];return g.value?d(...e):k(...e)}();return o((()=>{P.value=new f.Canvas(j.value,{width:_.canvasWidth,height:_.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0})})),a((()=>{P.value.off(),P.value.clear()})),C({redrawPoints:I,select:b,canvas:P}),(e,t)=>(s(),n(p,null,[i("canvas",{ref_key:"canvasRef",ref:j},null,512),P.value?(s(),u(v,l({key:0,propItems:c(_)},c(M)),null,16,["propItems"])):m("v-if",!0),P.value?(s(),u(c(h),l({key:1,propItems:c(_)},c(x),{show:c(x).show,"onUpdate:show":t[0]||(t[0]=e=>c(x).show=e),onClickMenu:c(F)}),null,16,["propItems","show","onClickMenu"])):m("v-if",!0)],64))}}),[["__file","FabricChart.vue"]]);export{w as default};
@@ -1,7 +1,7 @@
1
- import { Ref } from 'vue';
1
+ import { type Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { AnyObject } from '../../../../../es/shared/types';
4
- export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: AnyObject, pointMenuProps: AnyObject, commonFunc: AnyObject): {
4
+ export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: AnyObject, pointMenuProps: AnyObject): {
5
5
  clickMenu: ({ item, target }: {
6
6
  item: any;
7
7
  target: any;
@@ -1 +1 @@
1
- import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{getScaleInfo as u,drawScaleNumber as c,drawScaleLine as f}from"./useScaleColumn.js";import{fabric as p}from"../utils/index.js";import{getIndex as d,isEffectiveNode as h}from"../utils/utils.js";import{cloneDeep as g}from"lodash-es";import{format as v}from"date-fns";function m(m,y,k,w,x,b){const{cumputedX:T,cumputedY:S,getXValue:j,getYValue:C}=t(y),{getEqualXTypes:M,repeatTip:P}=b,{xAxis:E,grid:G,originX:L,originY:Y,xCellWidth:X,endY:A,startTime:H,leftAddAreaWidth:I,leftScales:D,rightScales:O,yCellHeight:V,endX:W,scaleValues:N,canvasWidth:R,borderStyle:$,rightAddAreaWidth:B,event:F,originYCervix:q,other:z,canvasHeight:J}=y,K=g(N),Q=new Set;function U(){K.filter((t=>t.show)).forEach(((t,e)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,p){let d,h;const{pointAttr:g={},lineAttr:v={},title:x="",key:b,type:T="circle",childbirthStyle:S={}}=t,M=t.data[p+1],P=nt(M,t);if(s&&P&&!f.breakpoint)h=n([...s,...P],{...v});else if(s&&!P&&!f.breakpoint){const e=nt(M,t);h=e?n([...s,...e],{...v}):null}let E,G;if(f.childbirth){const t=s[1]+V;E=o([s[0],s[1],t],S),c.push(E),G=i([s[0]+X/2,t-V/2],{value:String(f.childbirth),...r,originX:"left",originY:"center",...S}),c.push(G)}const L=u[p-1],Y={origin:{data:f,title:x,key:b||"",dataIndex:e,index:p},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...y.event.hovered?y.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:y.event};L?d=l(T,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,d=l(T,{left:s[0],top:s[1],...Y}));u.push(h),d&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{et(t)})),t.on("mouseout",(()=>{w.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{tt(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+X/2,top:t.top+V/2})}(t),F.hovered&&et(t)})),t.on("mouseup",(e=>{if(w.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:j(t.left),value:C(e,t.top)}};m.value.discardActiveObject(),k("change",n),Z(n,"change")}}))}(d),a.push(d),Q.add(d))}(nt(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{m.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=K.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=d(o.time,l.data);l.data.splice(t,0,o);break}}_()}function _(){var t;Q.size&&(null==(t=m.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...Q]))),Q.clear(),U()}function tt(t){const e=t.prevPoint?t.prevPoint.left:L,n=t.nextPoint?t.nextPoint.left:W;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<q&&t.set("top",q),t.top<Y&&t.set("top",Y),t.top>A&&t.set("top",A),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function et(t){const{title:e,key:n}=t.origin;w.point={x:t.left,y:t.top},w.list=[`${e} ${C(n,t.top)}`,`时间 ${j(t.left).slice(-5)}`],w.show=!0}function nt(t,e){if(h(t)&&function(t){const e=H+864e5,n=new Date(t).getTime();return n>=H&&n<=e}(t.time)){const n=T(t.time),o=S(e.key,e.range,t.value);return[n,o<Y?Y:o>A?A:o]}}function ot(t,e){return t+1>e[1]?e[0]:t+1}return e(m,y,!0),function(){const t=new p.Rect({...$,width:R-I-B-1,height:A-1,left:I,top:0,fill:"transparent"});m.value.add(t)}(),function(){function t(t,e="left"){let n="left"===e?I:W;t.forEach(((t,e)=>{const{range:o,spaceValue:l,width:d,title:h,titleStyle:g,key:v,position:y="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],T=[],S=n+d/2,j=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(o,l),C=j.length;j.forEach(((e,o)=>{const{lineXMain:i,lineXSub:r,textLeft:l}=u(y,n,d),s=A-o*V*k,a=0===o?A-8:o!==j.length-1||Y||q&&"FHR"!==v?s:Y+8;!w||(0===o||o===C-1)&&!x||b.push(c(String(e),t,l,a)),T.push(...f(t,o,i,r,s,V,Y,C))}));const M=new p.Rect({...a,width:d,height:A,left:S,top:A/2}),P=i([S,Y>0?Y-V/2:V/2],{value:String(h),...r,...g}),E=new p.Group([...T,...b,M,...P?[P]:[]],{objectCaching:!1,...s});m.value.add(E),E.sendToBack(),n+=d}))}t(D),t(O,"right")}(),function(){const{show:t,startTime:e,range:n=[0,23],position:o="top",style:l}=E.time,{show:a,range:u=[0,23],position:c,style:f}=E.processTime;if(t||a){const d=[],h=[],g=[],v=[],y=L+X/2,k=V/2;for(let s=0;s<G.mainXCell;s++){if(t){const t=0===s?+e.slice(11,13):ot(d.at(-1),n);d.push(t);const a="top"===o?Y-k:A+k;g.push(i([y+s*X,a],{value:String(t),...r,...l||{}}))}if(a){const t=0===s?u[0]:h.at(-1)+1;h.push(t);const e="top"===c?k:J-k;v.push(i([y+s*X,e],{value:String(t),...r,...f||{}}))}}const w=new p.Group([...g,...v],{objectCaching:!1,...s});m.value.add(w),m.value.sendToBack(w)}}(),function(){var t;const e=Object.values(z),o=[],i={},r=K.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=S(n,o,10),l=[0,e],s=[-e/t,0],a=[(A-i-e)/t,A-i],u=[W-L,t*(W-L)+e];let c=[],f=[];function p([n,o]){return Math.abs(o-t*n-e)<=1}function d([t,e]){const[n,o]=[...h([t,e])];return n>=L&&n<=W&&o>=i&&o<=A}function h([t,e]){return[L+t,A-e]}return p(l)&&d(l)&&(c=h(l)),p(s)&&d(s)&&(c=h(s)),p(a)&&d(a)&&(f=h(a)),p(u)&&d(u)&&(f=h(u)),[...c,...f]}e.forEach((t=>{if(!t.show)return;const{key:e}=t;switch(e){case"fetalPresentation":{const{range:i,show:r}=K.find((t=>t.key===e));if(r){const r=S(e,i,0);o.push(n([L,r,W,r],{...t}))}break}case"alert":if(l){const{key:e,range:a}=r||{},u=216e5,c={time:v(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,p]=[T(l.time)-L,A-S(e,a,l.value)],[d,h]=[T(c.time)-L,A-S(e,a,c.value)],g=(h-p)/(d-f),m=p-f*g,y=s(g,m);y.length>0&&(o.push(n(y,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:e,b:r}=i,a=144e5,u=s(e,r-(T(v(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-T(l.time))*e);u.length>0&&o.push(n(u,{...t}))}}})),m.value.add(...o)}(),U(),function(){function t(t,e){const n=K.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}y.event.evented&&m.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=L&&n<=W&&o>=Y&&o<=A&&(x.point={x:n,y:o},x.show=!0,e.target?(x.target=e.target,x.list=["删除节点"],m.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&x.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(x.target=null,x.list=["新增节点"],K.filter((t=>t.show)).forEach((i=>{if(!M(n,"key",X).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;x.list.push(t(i,e.pointer))}})),1===x.list.length&&(x.show=!1,P(),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=R-B/2;function e(t,e){if(!t.length)return;let o=Y;const i=[];t.forEach((t=>{const n=t.title.split("").join("\n"),s=N.findIndex((e=>e.key===t.key)),a=new p.Text(String(n),{...r,...t.titleStyle||{},originY:"top",left:e,top:o,lineHeight:1}),u=l(t.type,{left:e,top:o+a.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:s,key:t.key,isMenu:!0},originLeft:e,originTop:o+a.height+3,...y.event});o+=a.height+u.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=L&&e<=W&&n>=Y&&n<=A}t.on("moving",(()=>{t.set("originY","center"),e(t)?(tt(t),et(t)):w.show=!1})),t.on("mouseup:before",(n=>{if(w.show=!1,0===n.e.button&&e(t))if(M(t.left,"key",X).includes(t.origin.key))P();else{const e={data:{time:j(t.left),value:C(t.origin.key,t.top)},...t.origin};k("add",e),Z(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(u),i.push(a,u)})),n(i),m.value.add(...i)}function n(t){const e=t.at(-1),n=(A-Y)/2,o=(e.height+e.top-Y)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}e(D,I/2),e(O,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(k("remove",n),Z(n,"remove")):(Object.assign(n,{data:{time:j(t.pointer.x),value:C(t.origin.key,t.pointer.y)}}),k("add",n),Z(n))},redrawPoints:_}}export{m as useBirthProcess};
1
+ import{useBirthProcessCumputedPoint as t}from"./useCumputedPoint.js";import e from"./useGrid.js";import{drawLine as n,drawArrow as o,drawText as i,defaultTextStyle as r,drawPoint as l,defaultStyle as s,defaultRectStyle as a}from"./useDraw.js";import{getScaleInfo as u,drawScaleNumber as c,drawScaleLine as f}from"./useScaleColumn.js";import{fabric as d}from"../utils/index.js";import{useCommon as p}from"./useCommon.js";import{getIndex as h,isEffectiveNode as g}from"../utils/utils.js";import{cloneDeep as v}from"lodash-es";import{format as m}from"date-fns";function y(y,k,w,x,b){const{cumputedX:T,cumputedY:j,getXValue:C,getYValue:S}=t(k),{getEqualXTypes:M,handleAddPrevent:P}=p(y,w),{xAxis:E,grid:G,originX:L,originY:Y,xCellWidth:X,endY:A,startTime:H,leftAddAreaWidth:I,leftScales:D,rightScales:O,yCellHeight:V,endX:W,scaleValues:N,canvasWidth:R,borderStyle:$,rightAddAreaWidth:B,event:F,originYCervix:q,other:z,canvasHeight:J}=k,K=v(N),Q=new Set;function U(){K.filter((t=>t.show)).forEach(((t,e)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:b,type:T="circle",childbirthStyle:j={}}=t,M=t.data[d+1],P=nt(M,t);if(s&&P&&!f.breakpoint)h=n([...s,...P],{...v});else if(s&&!P&&!f.breakpoint){const e=nt(M,t);h=e?n([...s,...e],{...v}):null}let E,G;if(f.childbirth){const t=s[1]+V;E=o([s[0],s[1],t],j),c.push(E),G=i([s[0]+X/2,t-V/2],{value:String(f.childbirth),...r,originX:"left",originY:"center",...j}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:m,key:b||"",dataIndex:e,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:k.event};L?p=l(T,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=l(T,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(t){F.hovered&&(t.on("mouseover",(()=>{et(t,"hover")})),t.on("mouseout",(()=>{x.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{tt(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+X/2,top:t.top+V/2})}(t),F.hovered&&et(t)})),t.on("mouseup",(e=>{if(x.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:C(t.left),value:S(e,t.top)}};y.value.discardActiveObject(),w("change",n),Z(n,"change")}}))}(p),a.push(p),Q.add(p))}(nt(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{y.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function Z(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=K.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=h(o.time,l.data);l.data.splice(t,0,o);break}}_()}function _(){var t;Q.size&&(null==(t=y.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...Q]))),Q.clear(),U()}function tt(t){const e=t.prevPoint?t.prevPoint.left:L,n=t.nextPoint?t.nextPoint.left:W;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<q&&t.set("top",q),t.top<Y&&t.set("top",Y),t.top>A&&t.set("top",A),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function et(t,e="moving"){const{title:n,key:o,data:i}=t.origin;x.point={x:t.left,y:t.top},x.list=[`${n} ${"hover"===e?i.value:S(o,t.top)}`,`时间 ${C(t.left).slice(-5)}`],x.show=!0}function nt(t,e){if(g(t)&&function(t){const e=H+864e5,n=new Date(t).getTime();return n>=H&&n<=e}(t.time)){const n=T(t.time),o=j(e.key,e.range,t.value);return[n,o<Y?Y:o>A?A:o]}}function ot(t,e){return t+1>e[1]?e[0]:t+1}return e(y,k,!0),function(){const t=new d.Rect({...$,width:R-I-B-1,height:A-1,left:I,top:0,fill:"transparent"});y.value.add(t)}(),function(){function t(t,e="left"){let n="left"===e?I:W;t.forEach(((t,e)=>{const{range:o,spaceValue:l,width:p,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],T=[],j=n+p/2,C=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(o,l),S=C.length;C.forEach(((e,o)=>{const{lineXMain:i,lineXSub:r,textLeft:l}=u(m,n,p),s=A-o*V*k,a=0===o?A-8:o!==C.length-1||Y||q&&"FHR"!==v?s:Y+8;!w||(0===o||o===S-1)&&!x||b.push(c(String(e),t,l,a)),T.push(...f(t,o,i,r,s,V,Y,S))}));const M=new d.Rect({...a,width:p,height:A,left:j,top:A/2}),P=i([j,Y>0?Y-V/2:V/2],{value:String(h),...r,...g}),E=new d.Group([...T,...b,M,...P?[P]:[]],{objectCaching:!1,...s});y.value.add(E),E.sendToBack(),n+=p}))}t(D),t(O,"right")}(),function(){const{show:t,startTime:e,range:n=[0,23],position:o="top",style:l}=E.time,{show:a,range:u=[0,23],position:c,style:f}=E.processTime;if(t||a){const p=[],h=[],g=[],v=[],m=L+X/2,k=V/2;for(let s=0;s<G.mainXCell;s++){if(t){const t=0===s?+e.slice(11,13):ot(p.at(-1),n);p.push(t);const a="top"===o?Y-k:A+k;g.push(i([m+s*X,a],{value:String(t),...r,...l||{}}))}if(a){const t=0===s?u[0]:h.at(-1)+1;h.push(t);const e="top"===c?k:J-k;v.push(i([m+s*X,e],{value:String(t),...r,...f||{}}))}}const w=new d.Group([...g,...v],{objectCaching:!1,...s});y.value.add(w),y.value.sendToBack(w)}}(),function(){var t;const e=Object.values(z),o=[],i={},r=K.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=j(n,o,10),l=[0,e],s=[-e/t,0],a=[(A-i-e)/t,A-i],u=[W-L,t*(W-L)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=L&&n<=W&&o>=i&&o<=A}function h([t,e]){return[L+t,A-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}e.forEach((t=>{if(!t.show)return;const{key:e}=t;switch(e){case"fetalPresentation":{const{range:i,show:r}=K.find((t=>t.key===e));if(r){const r=j(e,i,0);o.push(n([L,r,W,r],{...t}))}break}case"alert":if(l){const{key:e,range:a}=r||{},u=216e5,c={time:m(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[T(l.time)-L,A-j(e,a,l.value)],[p,h]=[T(c.time)-L,A-j(e,a,c.value)],g=(h-d)/(p-f),v=d-f*g,y=s(g,v);y.length>0&&(o.push(n(y,{...t})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:e,b:r}=i,a=144e5,u=s(e,r-(T(m(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-T(l.time))*e);u.length>0&&o.push(n(u,{...t}))}}})),y.value.add(...o)}(),U(),function(){function t(t,e){const n=K.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}k.event.evented&&y.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=L&&n<=W&&o>=Y&&o<=A&&(b.point={x:n,y:o},b.show=!0,e.target?(b.target=e.target,b.list=["删除节点"],y.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&b.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(b.target=null,b.list=["新增节点"],K.filter((t=>t.show)).forEach((i=>{if(!M(n,"key",X).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;b.list.push(t(i,e.pointer))}})),1===b.list.length&&(b.show=!1,P("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=R-B/2;function e(t,e){if(!t.length)return;let o=Y;const i=[];t.forEach((t=>{const n=t.title.split("").join("\n"),s=N.findIndex((e=>e.key===t.key)),a=new d.Text(String(n),{...r,...t.titleStyle||{},originY:"top",left:e,top:o,lineHeight:1}),u=l(t.type,{left:e,top:o+a.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:s,key:t.key,isMenu:!0},originLeft:e,originTop:o+a.height+3,...k.event});o+=a.height+u.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=L&&e<=W&&n>=Y&&n<=A}t.on("moving",(()=>{t.set("originY","center"),e(t)?(tt(t),et(t)):x.show=!1})),t.on("mouseup:before",(n=>{if(x.show=!1,0===n.e.button&&e(t))if(M(t.left,"key",X).includes(t.origin.key))P("repeat");else{const e={data:{time:C(t.left),value:S(t.origin.key,t.top)},...t.origin};w("add",e),Z(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(u),i.push(a,u)})),n(i),y.value.add(...i)}function n(t){const e=t.at(-1),n=(A-Y)/2,o=(e.height+e.top-Y)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}e(D,I/2),e(O,t)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(w("remove",n),Z(n,"remove")):(Object.assign(n,{data:{time:C(t.pointer.x),value:S(t.origin.key,t.pointer.y)}}),w("add",n),Z(n))},redrawPoints:_}}export{y as useBirthProcess};
@@ -1 +1 @@
1
- import{ref as e,reactive as a,computed as t,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"../utils/index.js";import"lodash-es";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as o}from"./useBirthProcess.js";import{useCommon as n}from"./useCommon.js";function d(d,v,c,h){const m=e(),p=e(),f=e(),g=a({show:!1,point:{x:0,y:0},list:[]}),x=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=t((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=t((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=t((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),A=t((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),C=t((()=>{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})),b=t((()=>v.data.grid.mainXCell)),j=t((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=t((()=>(C.value-A.value)/b.value)),Y=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),P=t((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),S=t((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!P.value)return P.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return H.value-l*u*Y.value})),H=t((()=>{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=t((()=>new Date(v.data.xAxis.time.startTime).getTime())),F=t((()=>36e5/k.value)),R=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),T=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/Y.value})),W=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),M=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),O=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...r,...v.data.borderStyle},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:A.value,endX:C.value,originY:P.value,endY:H.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:b.value,gridYNumber:j.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:T.value,fetalPresentationYCell:W.value,scaleValues:v.data.scaleValues,event:M.value,originYCervix:S.value}),D=n(d);return l((()=>{u((()=>{const{clickMenu:e,redrawPoints:a}=o(d,O,c,g,x,D);p.value=a,f.value=e,i(h.value);const{select:t}=s(d,O,c);m.value=t}))})),{propItems:O,redrawPoints:p,select:m,pointTipProps:g,pointMenuProps:x,clickMenu:f}}export{d as default};
1
+ import{ref as e,reactive as a,computed as t,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as r}from"./useDraw.js";import"date-fns";import"lodash-es";import"../utils/index.js";import"./useShadow.js";import{useEvent as i,useCanvasEvent as s}from"./useEvent.js";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,d,v,c){const h=e(),p=e(),m=e(),g=a({show:!1,point:{x:0,y:0},list:[]}),f=a({show:!1,point:{x:0,y:0},list:[],target:null}),x=t((()=>d.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),w=t((()=>d.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=t((()=>{var e;return(null==(e=w.value)?void 0:e.length)?30:0})),V=t((()=>{var e;return 30+(null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),A=t((()=>{var e;const{width:a}=d.data,t=null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-y.value-t})),b=t((()=>d.data.grid.mainXCell)),C=t((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),j=t((()=>(A.value-V.value)/b.value)),k=t((()=>{const{xAxis:e,height:a}=d.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),Y=t((()=>{const{xAxis:e}=d.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return k.value*a})),P=t((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!Y.value)return Y.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],u=(null==t?void 0:t.spaceValue)||1;return S.value-l*u*k.value})),S=t((()=>{const{xAxis:e,height:a}=d.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-k.value*t})),H=t((()=>new Date(d.data.xAxis.time.startTime).getTime())),X=t((()=>36e5/j.value)),F=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/k.value})),R=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/k.value})),T=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/k.value})),W=t((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),M=a({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:V.value,endX:A.value,originY:Y.value,endY:S.value,xCellWidth:j.value,yCellHeight:k.value,gridXNumber:b.value,gridYNumber:C.value,xAxis:d.data.xAxis,leftScales:x.value,rightScales:w.value,leftAddAreaWidth:30,rightAddAreaWidth:y.value,startTime:H.value,timeXCell:X.value,cervixYCell:F.value,FHRYCell:R.value,fetalPresentationYCell:T.value,scaleValues:d.data.scaleValues,event:W.value,originYCervix:P.value});return l((()=>{u((()=>{const{clickMenu:e,redrawPoints:a}=n(o,M,v,g,f);p.value=a,m.value=e,i(c.value);const{select:t}=s(o,M,v);h.value=t}))})),{propItems:M,redrawPoints:p,select:h,pointTipProps:g,pointMenuProps:f,clickMenu:m}}export{o as default};
@@ -1 +1 @@
1
- import{fabric as t}from"../utils/index.js";import{defaultBorderStyle as e,drawTextGroup as n,defaultTextStyle as i,defaultRectStyle as o,defaultStyle as l}from"./useDraw.js";function s(s,a){const{xScaleList:c,originX:h,endX:r,endY:d,xCellWidth:u,canvasWidth:g,canvasHeight:f,bottom:p,breathingHeight:v,iconsWidth:m}=a;!function(){var a,g,f;if(!v||!p){const n=new t.Line([m,d-1,r,d-1],{...e});return s.value.add(n),n.sendToBack(),!1}const b=v,w=(null==(a=p.breathing)?void 0:a.list)||[],x=[];let j=!0;c.forEach(((t,e)=>{const l=h+e*u;let s="";w.forEach(((e,n)=>{const i=new Date(e.time).getTime();i>=t&&i<+t+t.scaleCell&&(s=e.value)}));const a=j?{top:-(b/2-10)}:{top:b/2-10};s&&(j=!j);const c=n({width:u,height:b,...o},Object.assign({},{text:String(s),...i},s?a:{}),{left:l,top:d});x.push(c)}));const S=n({width:r,height:b,...o},{text:String((null==(g=p.breathing)?void 0:g.title)+(null==(f=p.breathing)?void 0:f.unit)),...i,left:-(r-h)/2},{left:0,top:d});x.push(S);const T=x.length>0?new t.Group([...x],{...l}):null;T&&T.sendToBack(),T&&s.value.add(T)}()}export{s as useBottom};
1
+ import{fabric as t}from"../utils/index.js";import{drawTextGroup as e,defaultTextStyle as n,defaultStyle as i}from"./useDraw.js";function o(o,l){const{xScaleList:s,originX:a,endX:c,endY:r,xCellWidth:h,canvasWidth:d,canvasHeight:u,bottom:g,breathingHeight:f,iconsWidth:p,borderStyle:v}=l;!function(){var l,d,u;if(!f||!g){const e=new t.Line([p,r-1,c,r-1],v);return o.value.add(e),e.sendToBack(),!1}const b=f,m=(null==(l=g.breathing)?void 0:l.list)||[],w=[];let x=!0;s.forEach(((t,i)=>{const o=a+i*h;let l="";m.forEach(((e,n)=>{const i=new Date(e.time).getTime();i>=t&&i<+t+t.scaleCell&&(l=e.value)}));const s=x?{top:-(b/2-10)}:{top:b/2-10};l&&(x=!x);const c=e({width:h,height:b,...v},Object.assign({},{text:String(l),...n},l?s:{}),{left:o,top:r});w.push(c)}));const S=e({width:c,height:b,...v},{text:String((null==(d=g.breathing)?void 0:d.title)+(null==(u=g.breathing)?void 0:u.unit)),...n,left:-(c-a)/2},{left:0,top:r});w.push(S);const j=w.length>0?new t.Group([...w],{...i}):null;j&&j.sendToBack(),j&&o.value.add(j)}()}export{o as useBottom};
@@ -2,15 +2,15 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { IPropItems } from '../interface';
4
4
  import { AnyObject } from '../../../../../es/shared/types';
5
- export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: AnyObject, pointMenuProps: AnyObject, commonFunc: AnyObject): {
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: AnyObject, pointMenuProps: AnyObject): {
6
6
  pointTipProps: AnyObject;
7
7
  pointMenuProps: AnyObject;
8
8
  clickMenu: ({ item, target }: {
9
9
  item: any;
10
10
  target: any;
11
11
  }) => void;
12
- setPopup: (point: any) => void;
12
+ setPopup: (point: any, status?: string) => void;
13
13
  isAddPoint: (x: number) => boolean;
14
- updateData: (params: any, mode?: string) => void;
14
+ updateData: (params: AnyObject, mode?: string) => void;
15
15
  redrawPoints: () => void;
16
16
  };
@@ -1 +1 @@
1
- import{fabric as e}from"../utils/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"./useDraw.js";import s from"./useGrid.js";import{useShadow as r}from"./useShadow.js";import{TEMPERATURE_MENU as a,PAIN_MENU as u,OVERLAP as p}from"./constant.js";import{cloneDeep as c}from"lodash-es";import{isOneLine as d,getType as f,isValidValue as h,setOtherType as v,isEffectiveNode as g,getIndex as y,deleteProperty as m}from"../utils/utils.js";function b(b,x,w,L,j,k,Y,S,E,$,T){s(b,x);const{getEqualXTypes:M,repeatTip:P,maxLimitTip:O,minLimitTip:I}=T,{createShadowLines:A}=r(),{left:D,xScaleList:R,xCellWidth:C,yCellHeight:X,originX:z,endX:V,originY:F,endY:_,itemList:G,event:H,vitalSignsOriginY:q,painOriginY:W,hospitalizationDate:B,config:J,canvasHeight:K}=x,N=new Set,Q=["xinmai","mai"],U=new Map,Z=new Set,ee=new Set,te=new Set,ie=c(D.yScaleValue);function ne(t){var n;const o=ie.find((e=>"pulse"===e.type));if(o&&(null==(n=o.dataList)?void 0:n.length)&&(N.size&&b.value.remove(...N),N.clear(),U.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=U.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of U)t.push(e[1]),e[0]===Q[0]&&e[1].forEach((e=>{(U.get(Q[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],p=n[i-1],c=n[i+1],d=o[r-1],f=o[r+1];if(p&&d){if(p[0]!==d[0]){const e=Math.max(p[0],d[0]);l.push([p,d].find((t=>t[0]===e)))}}else p?l.push(p):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(c&&f){if(c[0]!==f[0]){const e=Math.min(c[0],f[0]);l.push([c,f].find((t=>t[0]===e))),g()}}else c?(l.push(c),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var n,l,s,r,a,u;const p=t.map((e=>({x:e[0],y:e[1]}))),c=new e.Polygon(p,{...i,...(null==(n=o.shadow)?void 0:n.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){c.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=A(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...i,...(null==(t=o.shadow)?void 0:t.style)||{}}),N.add(e)})),b.value.add(...e)}N.add(c),b.value.add(c)}))}}function oe(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const o=Object.assign({},p,D.overlap||{}),l=[];Z.size&&[...Z].forEach((e=>{[...ee].forEach((t=>{if(t.origin&&e.left===t.left&&e.top===t.top){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(n(r,{...o[e]||{},...s}))}}}))})),setTimeout((()=>{b.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),te.add(e)}))}))}function le(e,s,r){var a;const{type:u,riseStyle:p={},noRiseStyle:c={},verifiedStyle:f={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:L={},nonePainPointStyle:k={},dataList:S=[]}=r,$=[],T=[],M=[];null==(a=e.list)||a.forEach(((a,P)=>{const O=d(u)?S.find((e=>e.key===a.key)):e,I=ae(a,r),A={};A.value=function(e,t,i){if(!(null==e?void 0:e.length)||!J.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=q.originY+X?e[1]+X:e[1]-X,s=o([e[0],l],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return M.push(s),{obj:s,top:-X}}(I,a,O),function(e,s,a,d){var v,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(u))return;const{lineAttr:m={}}=a,{value:b}=d;let x,w,L,k,Y,S;if(s.noRise&&c.show)if(c.text)L=o([e[0],e[1]+5],{value:c.text.split("").join("\n"),originY:"top",...c.style||{}}),M.push(L);else{const t=e[1]+2*X;k=l([e[0],e[1],t],c.style||{}),M.push(k)}s.rise&&p.show&&p.text&&(Y=o([e[0],e[1]-(b?X:0)-5],{value:p.text.split("").join("\n"),originY:"bottom",...p.style||{}}),M.push(Y));s.verified&&(S=o([e[0],e[1]-(b?X:0)-5],{value:"v",originX:"center",originY:"bottom",...f}),M.push(S));if(h(s.physicsReduce)||h(s.drugReduce)){const o=j(u,r.list,null!=(v=s.physicsReduce)?v:s.drugReduce);x=t([...e,e[0],o],{...m,...g.line,...i}),w=n((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:o,...g.point,...i,originY:o===K?"bottom":"center"}),x&&M.push(x),w&&M.push(w)}Object.assign(d,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:L,top:5},arrowGroup:{obj:k,top:2*X},riseText:{obj:Y,top:(b?-X:0)-5},verifiedText:{obj:S,top:(b?-X:0)-5},reducePoint:{obj:w,type:"reduce"}})}(I,a,O,A),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;let s,a;const{upArrowShow:p=!1,limitValueShow:c=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*X,i=[e[1]-X/2,t];t<q.originY&&(t=e[1]+2.5*X,i=[t,e[1]+X/2]),s=l([e[0],i[0],i[1]],m,"up"),M.push(s)}if(c){const i={value:t.value,originX:"center",originY:"center",...L};if(+t.value>Math.max(...r.list)){const t=s?e[1]+X/2+s.height:e[1]+X;a=o([e[0],t],i),M.push(a)}+t.value<Math.min(...r.list)&&(a=o([e[0],e[1]-X],i),M.push(a))}Object.assign(n,{upArrow:{obj:s},limitValue:{obj:a,top:-X}})}(I,a,O,A),function(i,o,l,a,p){let c,d;const{pointAttr:f={},lineAttr:h={},title:g="",key:m,type:L="circle"}=a,j=e.list[l+1],S=ae(j,r),M=se(u,e.list[l].value),P=S&&se(u,j.value);!i||!S||o.breakpoint||M||P||i[0]===S[0]||(d=t([...i,...S],{...h}));const O=o.pacemakerShow&&"pulse"==u?y.value:M?0:L,I=T[l-1],A={origin:{data:o,title:g,key:m||"",unit:r.unit,type:u,_type:v(g,u),dataIndex:s,index:l},leftLine:I,rightLine:d,otherObj:p,lockMovementX:!0,...o.pacemakerShow&&"pulse"==u?y.style:f,...x.event.hovered?x.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:x.event,...M?{selectable:!1,evented:!1,...k}:{}};if(I){const e=I.get("y2");c=n(O,{left:I.get("x2"),top:M?e-5:e,...A})}else i&&(A.leftLine=null,c=n(O,{left:i[0],top:M?i[1]-5:i[1],...A}));T.push(d),c&&(g.includes("脉搏")?Z.add(c):ee.add(c),function(e){H.hovered&&(e.on("mouseover",(()=>{re(e)})),e.on("mouseout",(()=>{E.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?W:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):null==i||i.setCoords().set({left:e.left,top:e.top+o}))})),ne(e)}(e),H.hovered&&re(e)})),e.on("mouseup",(t=>{if(E.show=!1,1===t.button){const{type:t}=e.origin,i=Y(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};b.value.discardActiveObject(),w("change",n),pe(n,"change")}}))}(c),$.push(c),te.add(c))}(I,a,P,O,A)})),"pulse"===u&&Q.forEach((e=>{U.set(e,$.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all($).then((e=>{const t=T.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(M).then((i=>{b.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&b.value.remove(e.leftLine),e.rightLine&&b.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function re(e){const{title:t,unit:i,type:n,data:o}=e.origin;E.point={x:e.left,y:e.top},E.list=[function(){const{drugReduce:l,physicsReduce:s}=o||{},r=Y(n,e.top);if(h(l))return`药物降${"pain"==n?"痛":"温"} ${r}—>${l}${i||""}`;if(h(s))return`物理降${"pain"==n?"痛":"温"} ${r}—>${s}${i||""}`;return`${t} ${r}${i||""}`}(),`时间 ${((null==o?void 0:o.time)||k(e.left)).slice(-5)}`],E.show=!0}function ae(e,t){const i="pain"===t.type?W:q;if(g(e)&&function(e){const[t]=R,i=R.at(-1),n=t.start,o=i.end,l=new Date(e).getTime();return l>=n&&l<=o}(e.time)){const n=L(e.time),o=j(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ue(e){const t=new Date,i=`00${t.getMonth()+1}`.slice(-2),n=`00${t.getDate()}`.slice(-2),o=new Date(`${t.getFullYear()}-${i}-${n} 23:59:59`).getTime(),l=new Date(`${k(e)}:00`).getTime();return B&&l<new Date(B).getTime()?(I(),!1):!(l>o)||(O(),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ie.find((e=>e.type===i));if("add"===t){const e=d(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=y(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;te.size&&(null==(e=b.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...te]))),U.clear(),te.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{e.dataList.forEach(((t,i)=>{d(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe()}return U.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const i=j(e.type,e.list,e.positionLine.value),n=t([z,i,V,i],e.positionLine);b.value.add(n)}(e),e.dataList.forEach(((t,i)=>{d(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe(),x.event.evented&&b.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=z&&i<=V&&n>=F&&n<=_){$.point={x:i,y:n},$.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&($.list=[...a]),"pain"===o&&($.list=[...u]),$.target=e.target;else{$.target=null,$.list=["新增节点"],G.forEach((t=>{if(!M(i,"_type",C).includes(t.bigType)){const i=["pain"].includes(t.bigType)?W:q;n>=i.originY&&n<=i.endY&&$.list.push({renderItem:S?S(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:f(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ue(i);t&&1!==$.list.length||($.show=!1,1===$.list.length&&t&&P())}}}})),{pointTipProps:E,pointMenuProps:$,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=m(i,[...a,...u]);s[`${e.type}`]=e.value,d(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};w("change",r),pe(r,"change")}else{const t={data:{time:k(e.pointer.x),value:Y(e.origin.type,e.pointer.y),...d(e.origin.type)?{key:e.origin.key}:{}},...e.origin};w("add",t),pe(t)}},setPopup:re,isAddPoint:ue,updateData:pe,redrawPoints:ce}}export{b as useCenter};
1
+ import{fabric as e}from"../utils/index.js";import{drawLine as t,defaultStyle as i,drawPoint as n,drawText as o,drawArrow as l}from"./useDraw.js";import s from"./useGrid.js";import{useShadow as r}from"./useShadow.js";import{useCommon as a}from"./useCommon.js";import{TEMPERATURE_MENU as u,PAIN_MENU as c,OVERLAP as p}from"./constant.js";import{cloneDeep as d}from"lodash-es";import{isOneLine as f,getType as h,isOverlapPoint as v,isValidValue as g,setOtherType as y,isEffectiveNode as m,getIndex as x,deleteProperty as b}from"../utils/utils.js";function w(w,j,L,k,Y,S,E,$,M,T){s(w,j);const{getEqualXTypes:P,handleAddPrevent:O}=a(w,L),{createShadowLines:A}=r(),{left:I,xScaleList:C,xCellWidth:D,yCellHeight:R,originX:X,endX:z,originY:V,endY:F,itemList:_,event:G,vitalSignsOriginY:H,painOriginY:q,hospitalizationDate:W,config:B,canvasHeight:J}=j,K=new Set,N=["xinmai","mai"],Q=new Map,U=new Set,Z=new Set,ee=new Set,te=d(I.yScaleValue);function ie(t){var n;const o=te.find((e=>"pulse"===e.type));if(o&&(null==(n=o.dataList)?void 0:n.length)&&(K.size&&w.value.remove(...K),K.clear(),Q.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Q.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Q)t.push(e[1]),e[0]===N[0]&&e[1].forEach((e=>{(Q.get(N[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var n,l,s,r,a,u;const c=t.map((e=>({x:e[0],y:e[1]}))),p=new e.Polygon(c,{...i,...(null==(n=o.shadow)?void 0:n.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){p.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=A(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...i,...(null==(t=o.shadow)?void 0:t.style)||{}}),K.add(e)})),w.value.add(...e)}K.add(p),w.value.add(p)}))}}function ne(){var e;const t=te.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const o=Object.assign({},p,I.overlap||{}),l=[];U.size&&[...U].forEach((e=>{[...Z].forEach((t=>{if(t.origin&&v(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...i,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(n(r,{...o[e]||{},...s}))}}}))})),setTimeout((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ee.add(e)}))}))}function oe(e,s,r){var a;const{type:u,riseStyle:c={},noRiseStyle:p={},verifiedStyle:d={},reduceStyle:h={},pacemaker:v={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:k=[]}=r,S=[],$=[],T=[];null==(a=e.list)||a.forEach(((a,P)=>{const O=f(u)?k.find((e=>e.key===a.key)):e,A=re(a,r),I={};I.value=function(e,t,i){if(!(null==e?void 0:e.length)||!B.showValue)return;const{lineAttr:n={}}=i,l=e[1]<=H.originY+R?e[1]+R:e[1]-R,s=o([e[0],l],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-R}}(A,a,O),function(e,s,a,f){var v,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(u))return;const{lineAttr:m={}}=a,{value:x}=f;let b,w,j,L,k,S;if(s.noRise&&p.show)if(p.text)j=o([e[0],e[1]+5],{value:p.text.split("").join("\n"),originY:"top",...p.style||{}}),T.push(j);else{const t=e[1]+2*R;L=l([e[0],e[1],t],p.style||{}),T.push(L)}s.rise&&c.show&&c.text&&(k=o([e[0],e[1]-(x?R:0)-5],{value:c.text.split("").join("\n"),originY:"bottom",...c.style||{}}),T.push(k));s.verified&&(S=o([e[0],e[1]-(x?R:0)-5],{value:"v",originX:"center",originY:"bottom",...d}),T.push(S));if(g(s.physicsReduce)||g(s.drugReduce)){const o=Y(u,r.list,null!=(v=s.physicsReduce)?v:s.drugReduce);b=t([...e,e[0],o],{...m,...h.line,...i}),w=n((null==(y=null==h?void 0:h.point)?void 0:y.type)||"circle",{left:e[0],top:o,...h.point,...i,originY:o===J?"bottom":"center"}),b&&T.push(b),w&&T.push(w)}Object.assign(f,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5},arrowGroup:{obj:L,top:2*R},riseText:{obj:k,top:(x?-R:0)-5},verifiedText:{obj:S,top:(x?-R:0)-5},reducePoint:{obj:w,type:"reduce"}})}(A,a,O,I),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(u))return;let s,a;const{upArrowShow:c=!1,limitValueShow:p=!1}=i;if(c&&+t.value>180){let t=e[1]-2.5*R,i=[e[1]-R/2,t];t<H.originY&&(t=e[1]+2.5*R,i=[t,e[1]+R/2]),s=l([e[0],i[0],i[1]],m,"up"),T.push(s)}if(p){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=s?e[1]+R/2+s.height:e[1]+R;a=o([e[0],t],i),T.push(a)}+t.value<Math.min(...r.list)&&(a=o([e[0],e[1]-R],i),T.push(a))}Object.assign(n,{upArrow:{obj:s},limitValue:{obj:a,top:-R}})}(A,a,O,I),function(i,o,l,a,c){let p,d;const{pointAttr:f={},lineAttr:h={},title:g="",key:m,type:x="circle"}=a,k=e.list[l+1],Y=re(k,r),T=le(u,e.list[l].value),P=Y&&le(u,k.value);!i||!Y||o.breakpoint||T||P||i[0]===Y[0]||(d=t([...i,...Y],{...h}));const O=o.pacemakerShow&&"pulse"==u?v.value:T?0:x,A=$[l-1],I={origin:{data:o,title:g,key:m||"",unit:r.unit,type:u,_type:y(g,u),dataIndex:s,index:l},leftLine:A,rightLine:d,otherObj:c,lockMovementX:!0,...o.pacemakerShow&&"pulse"==u?v.style:f,...j.event.hovered?j.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:j.event,...T?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");p=n(O,{left:A.get("x2"),top:T?e-5:e,...I})}else i&&(I.leftLine=null,p=n(O,{left:i[0],top:T?i[1]-5:i[1],...I}));$.push(d),p&&(g.includes("脉搏")?U.add(p):Z.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{se(e,"hover")})),e.on("mouseout",(()=>{M.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?q:H;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):null==i||i.setCoords().set({left:e.left,top:e.top+o}))})),ie(e)}(e),G.hovered&&se(e)})),e.on("mouseup",(t=>{if(M.show=!1,1===t.button){const{type:t}=e.origin,i=E(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};w.value.discardActiveObject(),L("change",n),ue(n,"change")}}))}(p),S.push(p),ee.add(p))}(A,a,P,O,I)})),"pulse"===u&&N.forEach((e=>{Q.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(T).then((i=>{w.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&w.value.remove(e.leftLine),e.rightLine&&w.value.remove(e.rightLine))}}(t,e)}))}))}))}function le(e,t){return"pain"===e&&0==t}function se(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;M.point={x:e.left,y:e.top},M.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:E(o,e.top);if(g(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(g(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||S(e.left)).slice(-5)}`],M.show=!0}function re(e,t){const i="pain"===t.type?q:H;if(m(e)&&function(e){const[t]=C,i=C.at(-1),n=t.start,o=i.end,l=new Date(e).getTime();return l>=n&&l<=o}(e.time)){const n=k(e.time),o=Y(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ae(e){const t=new Date,i=`00${t.getMonth()+1}`.slice(-2),n=`00${t.getDate()}`.slice(-2),o=new Date(`${t.getFullYear()}-${i}-${n} 23:59:59`).getTime(),l=new Date(`${S(e)}:00`).getTime();return W&&l<new Date(W).getTime()?(O("exceedMin"),!1):!(l>o)||(O("exceedMax"),!1)}function ue(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=te.find((e=>e.type===i));if("add"===t){const e=f(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=x(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;ee.size&&(null==(e=w.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ee]))),Q.clear(),ee.clear(),U.clear(),Z.clear(),te.forEach((e=>{e.dataList.forEach(((t,i)=>{f(e.type)&&!t.enable||oe(t,i,e)}))})),ie(),ne()}return Q.clear(),U.clear(),Z.clear(),te.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const i=Y(e.type,e.list,e.positionLine.value),n=t([X,i,z,i],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{f(e.type)&&!t.enable||oe(t,i,e)}))})),ie(),ne(),j.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=X&&i<=z&&n>=V&&n<=F){T.point={x:i,y:n},T.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...u]),"pain"===o&&(T.list=[...c]),T.target=e.target;else{T.target=null,T.list=["新增节点"],_.forEach((t=>{if(!P(i,"_type",D).includes(t.bigType)){const i=["pain"].includes(t.bigType)?q:H;n>=i.originY&&n<=i.endY&&T.list.push({renderItem:$?$(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:h(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ae(i);t&&1!==T.list.length||(T.show=!1,1===T.list.length&&t&&O("repeat"))}}}})),{pointTipProps:M,pointMenuProps:T,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=b(i,[...u,...c]);s[`${e.type}`]=e.value,f(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};L("change",r),ue(r,"change")}else{const t={data:{time:S(e.pointer.x),value:E(e.origin.type,e.pointer.y),...f(e.origin.type)?{key:e.origin.key}:{}},...e.origin};L("add",t),ue(t)}},setPopup:se,isAddPoint:ae,updateData:ue,redrawPoints:ce}}export{w as useCenter};
@@ -1,8 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
- export declare function useCommon(canvas: Ref<fabric.Canvas>): {
3
+ export declare function useCommon(canvas: Ref<fabric.Canvas>, emits: Function): {
4
4
  getEqualXTypes: (pointX: number, field: string, range?: number) => string[];
5
- repeatTip: () => void;
6
- maxLimitTip: () => void;
7
- minLimitTip: () => void;
5
+ handleAddPrevent: (type: 'repeat' | 'exceedMax' | 'exceedMin') => void;
8
6
  };
@@ -1 +1 @@
1
- import{useMessage as n}from"naive-ui";function i(i){const t=n();return{getEqualXTypes:function(n,t,e=6){const r=[],o=e/2;return i.value.forEachObject((i=>{i.origin&&!i.origin.isMenu&&i.left>=n-o&&i.left<=n+o&&r.push(i.origin[t])})),[...new Set(r)]},repeatTip:function(){t.warning("该时段已存在数值不能新增")},maxLimitTip:function(){t.warning("未来时间不允许录入")},minLimitTip:function(){t.warning("不允许小于入院时间")}}}export{i as useCommon};
1
+ const e={repeat:"该时段已存在数值不能新增",exceedMax:"未来时间不允许录入",exceedMin:"不允许小于入院时间"};function n(n,t){return{getEqualXTypes:function(e,t,r=6){const i=[],o=r/2;return n.value.forEachObject((n=>{n.origin&&!n.origin.isMenu&&n.left>=e-o&&n.left<=e+o&&i.push(n.origin[t])})),[...new Set(i)]},handleAddPrevent:function(n){t("add:prevent",{type:n,message:e[n]})}}}export{n as useCommon};
@@ -1 +1 @@
1
- import{format as n}from"date-fns";function t(t){const{xScaleList:e,originX:i,endY:l,xCellWidth:r,left:u,vitalSignsOriginY:o,painOriginY:a,canvasWidth:c}=t;return{cumputedX:function(n,t=!1){const i=new Date(n).getTime(),[l]=e,r=e.at(-1);if(i<l.start)return 0;if(i>r.end)return c;const u=e.findIndex((n=>n.end>=i));if(u>-1){return e[u].center}},cumputedY:function(n,e,i){const l=t[`${n}YCell`],r=+i-Math.min(...e);return("pain"===n?a.endY:o.endY)-l*r},getXValue:function(t){const i=e.findIndex((n=>n.left+r>=t));if(i>-1){const l=e[i],r=t-l.left,u=l.scaleCell*r,o=l.start+u;return n(new Date(o),"yyyy-MM-dd HH:mm")}},getYValue:function(n,e){var i;const l=t[`${n}YCell`],r=(null==(i=u.yScaleValue.find((t=>t.type===n)))?void 0:i.list)||[],c=r.length?Math.min(...r):0,d=(("pain"===n?a.endY:o.endY)-e)/l+c,f=Math.floor(100*d)/100,s=f.toString().split(".");return!(null==s?void 0:s[1])||+s[1]<99?f:+s[0]+1}}}function e(t){const{xAxis:e,originX:i,originY:l,xCellWidth:r,endY:u,timeXCell:o,startTime:a,scaleValues:c}=t;return{cumputedX:function(n){return(new Date(n).getTime()-a)/o+i},cumputedY:function(n,e,i){const[l]=e;return u-(+i-l)/t[`${n}YCell`]},getXValue:function(t){return n(new Date((t-i)*o+a),"yyyy-MM-dd HH:mm")},getYValue:function(n,e){const i=c.find((t=>n===t.key)),[l]=(null==i?void 0:i.range)||[0],r=(u-e)*t[`${n}YCell`]+l;return Math.floor(100*r)/100}}}export{e as useBirthProcessCumputedPoint,t as useCumputedPoint};
1
+ import{format as n}from"date-fns";import{getFloorNumber as t}from"../utils/utils.js";function e(e){const{xScaleList:i,originX:r,endY:u,xCellWidth:l,left:c,vitalSignsOriginY:o,painOriginY:a,canvasWidth:d}=e;return{cumputedX:function(n,t=!1){const e=new Date(n).getTime(),[r]=i,u=i.at(-1);if(e<r.start)return 0;if(e>u.end)return d;const l=i.findIndex((n=>n.end>=e));if(l>-1){return i[l].center}},cumputedY:function(n,t,i){const r=e[`${n}YCell`],u=+i-Math.min(...t);return("pain"===n?a.endY:o.endY)-r*u},getXValue:function(t){const e=i.findIndex((n=>n.left+l>=t));if(e>-1){const r=i[e],u=t-r.left,l=r.scaleCell*u,c=r.start+l;return n(new Date(c),"yyyy-MM-dd HH:mm")}},getYValue:function(n,i){var r;const u=e[`${n}YCell`],l=(null==(r=c.yScaleValue.find((t=>t.type===n)))?void 0:r.list)||[],d=l.length?Math.min(...l):0,s="pain"===n?a.endY:o.endY;return t((s-i)/u+d)}}}function i(e){const{xAxis:i,originX:r,originY:u,xCellWidth:l,endY:c,timeXCell:o,startTime:a,scaleValues:d}=e;return{cumputedX:function(n){return(new Date(n).getTime()-a)/o+r},cumputedY:function(n,t,i){const[r]=t;return c-(+i-r)/e[`${n}YCell`]},getXValue:function(t){return n(new Date((t-r)*o+a),"yyyy-MM-dd HH:mm")},getYValue:function(n,i){const r=d.find((t=>n===t.key)),[u]=(null==r?void 0:r.range)||[0],l=(c-i)*e[`${n}YCell`]+u;return t(l)}}}export{i as useBirthProcessCumputedPoint,e as useCumputedPoint};
@@ -25,6 +25,7 @@ export declare const defaultRectStyle: {
25
25
  strokeWidth: number;
26
26
  originX: string;
27
27
  originY: string;
28
+ objectCaching: boolean;
28
29
  };
29
30
  export declare const defaultTextStyle: {
30
31
  evented: boolean;
@@ -1 +1 @@
1
- import{fabric as e}from"../utils/index.js";const t={evented:!1,selectable:!1},r={stroke:"#999",strokeWidth:1,...t},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],...t},n={fill:"transparent",stroke:"#999",strokeWidth:1,originX:"center",originY:"center",...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,...t};function c(t,r){return new e.Line(t,{...i,...r})}function s([t,r],i){return new e.Text(String(i.value),{...o,left:t,top:r,...i})}function l([r,i,n],o,l="down"){const a=c([r,i,r,n],{strokeWidth:1,stroke:o.fill}),u=s([r+.5,"up"===l?n-3:n+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===l?180:0,...o});return new e.Group([a,u],{...t,originX:"center",originY:"top"})}function a(r,i,c){const s=new e.Rect({...n,...r}),{value:l="标题",textAlign:a="center",verticalAlign:u="center"}=i,g=r.width/2,h=r.height/2,d=new e.Text(String(l),{...o,...i,..."left"==a||"right"==a?{originX:a,left:"left"==a?-g:g}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function u(t="circle",r){const i={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},n=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...i});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...i});case"image":return new e.Image(r.element,{...i,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),i={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},n=new e.Line([0,t/2,t,t/2],i),o=new e.Line([t/2,0,t/2,t],i);return new e.Group([n,o])};return new e.Group([n(),t()],{scale:1,...i})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([n(),o],{scale:1,...i})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...i})}}export{r as defaultBorderStyle,i as defaultLineStyle,n as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,l as drawArrow,c as drawLine,u as drawPoint,s as drawText,a as drawTextGroup};
1
+ import{fabric as e}from"../utils/index.js";const t={evented:!1,selectable:!1},r={stroke:"#000",strokeWidth:1,...t},i={stroke:"#000",strokeWidth:1,strokeDashArray:[0,0],...t},n={fill:"transparent",stroke:"#000",strokeWidth:1,originX:"center",originY:"center",objectCaching:!1,...t},o={fontFamily:"微软雅黑",fontSize:12,fill:"#000",centeredRotation:!0,originX:"center",originY:"center",lineHeight:1,objectCaching:!1,...t};function c(t,r){return new e.Line(t,{...i,...r})}function s([t,r],i){return new e.Text(String(i.value),{...o,left:t,top:r,...i})}function l([r,i,n],o,l="down"){const a=c([r,i,r,n],{strokeWidth:1,stroke:o.fill}),u=s([r+.5,"up"===l?n-3:n+3],{value:"v",originX:"center",originY:"bottom",fontSize:16,angle:"up"===l?180:0,...o});return new e.Group([a,u],{...t,originX:"center",originY:"top"})}function a(r,i,c){const s=new e.Rect({...n,...r,strokeWidth:.5}),{value:l="标题",textAlign:a="center",verticalAlign:u="center"}=i,g=r.width/2,h=r.height/2,d=new e.Text(String(l),{...o,...i,..."left"==a||"right"==a?{originX:a,left:"left"==a?-g:g}:{},..."top"==u||"bottom"==u?{originY:u,top:"top"==u?-h:h}:{}});return new e.Group([s,d],{objectCaching:!1,...t,...c})}function u(t="circle",r){const i={originX:"center",originY:"center",hasControls:!1,hasBorders:!1,hoverCursor:"pointer",objectCaching:!1,...r},n=()=>new e.Circle({objectCaching:!1,strokeWidth:r.strokeWidth||1,stroke:r.stroke||"red",radius:r.radius||5,fill:"#fff"});switch(t){case"triangle":return new e.Triangle({width:20,height:20,strokeWidth:1,scale:1,...i});case"circle":return new e.Circle({objectCaching:!1,strokeWidth:1,radius:5,scale:1,...i});case"image":return new e.Image(r.element,{...i,scale:1});case"yemai":{const t=()=>{const t=2*((r.radius||5)+(r.strokeWidth||1)),i={stroke:r.strokeX||"blue",strokeWidth:r.strokeWidthX||1,originX:"center",originY:"center"},n=new e.Line([0,t/2,t,t/2],i),o=new e.Line([t/2,0,t/2,t],i);return new e.Group([n,o])};return new e.Group([n(),t()],{scale:1,...i})}case"koumai":{const t=(r.radius||5)+(r.strokeWidth||1),o=new e.Circle({objectCaching:!1,radius:r.radiusCircle||2,fill:r.fillCircle||"#000",originX:"center",originY:"center",left:t,top:t});return new e.Group([n(),o],{scale:1,...i})}default:return r&&Reflect.deleteProperty(r,"stroke"),new e.Text(String(t),{fontFamily:"微软雅黑",scale:1,fontSize:14,fill:"#000",...i})}}export{r as defaultBorderStyle,i as defaultLineStyle,n as defaultRectStyle,t as defaultStyle,o as defaultTextStyle,l as drawArrow,c as drawLine,u as drawPoint,s as drawText,a as drawTextGroup};
@@ -1 +1 @@
1
- import{fabric as e}from"../utils/index.js";import{drawLine as l,defaultBorderStyle as n}from"./useDraw.js";function i(i,t,s=!1){var o,u,d,r;const{gridYNumber:a,originY:c,grid:S,originX:b,endX:m,xCellWidth:p,yCellHeight:y,gridXNumber:f,endY:g}=t,v=[],C=[],L=new Set;for(let e=0;e<=a;e++){const i=c+parseInt(String(y*(a-e)));if(s){const e=l([b,i,m,i],{...n,...(null==(o=S.mainLineStyle)?void 0:o.x)||{}});v.push(e)}else{const n=e%S.subYCell==0?(null==(u=S.mainLineStyle)?void 0:u.x)||{}:S.subLineStyle||{},t=l([b,i,m,i],n);e%S.subYCell==0?L.add(t):v.push(t)}}for(let e=0;e<=f;e++){const i=b+parseInt(String(p*e));if(s){const e=l([i,c,i,g],{...n,...(null==(d=S.mainLineStyle)?void 0:d.y)||{}});C.push(e)}else{let t=S.subLineStyle||{};e%S.subSecondXCell==0&&(t=S.subSecondLineStyle||{}),e%S.subXCell==0&&(t=0!==e&&e!==f?(null==(r=S.mainLineStyle)?void 0:r.y)||{}:n);const s=l([i,c,i,g],t);e%S.subXCell==0&&0!==e&&e!==f?L.add(s):C.push(s)}}const h=new e.Group([...C,...v,...L],{evented:!1,selectable:!1});i.value.add(h),i.value.sendToBack(h)}export{i as default};
1
+ import{fabric as e}from"../utils/index.js";import{drawLine as l,defaultStyle as n}from"./useDraw.js";function i(i,t,s=!1){var o,u,r,d;const{gridYNumber:a,originY:S,grid:c,originX:b,endX:y,xCellWidth:m,yCellHeight:p,gridXNumber:f,endY:g,borderStyle:v}=t,C=[],L=[],h=new Set;for(let e=0;e<=a;e++){const n=S+parseInt(String(p*(a-e)));if(s){const e=l([b,n,y,n],{...v,...(null==(o=c.mainLineStyle)?void 0:o.x)||{}});C.push(e)}else{const i=e%c.subYCell==0?(null==(u=c.mainLineStyle)?void 0:u.x)||{}:c.subLineStyle||{},t=l([b,n,y,n],i);e%c.subYCell==0?h.add(t):C.push(t)}}for(let e=0;e<=f;e++){const n=b+parseInt(String(m*e));if(s){const e=l([n,S,n,g],{...v,...(null==(r=c.mainLineStyle)?void 0:r.y)||{}});L.push(e)}else{let i=c.subLineStyle||{};e%c.subSecondXCell==0&&(i=c.subSecondLineStyle||{}),e%c.subXCell==0&&(i=0!==e&&e!==f?(null==(d=c.mainLineStyle)?void 0:d.y)||{}:v);const t=l([n,S,n,g],i);e%c.subXCell==0&&0!==e&&e!==f?h.add(t):L.push(t)}}const X=new e.Group([...L,...C,...h],n);i.value.add(X),i.value.sendToBack(X)}export{i as default};
@@ -2,6 +2,6 @@ import { Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { IPropItems } from '../interface';
4
4
  import { AnyObject } from '../../../../../es/shared/types';
5
- export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, setPopup: Function, pointTipProps: AnyObject, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function, useCommon: AnyObject): {
5
+ export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, setPopup: Function, pointTipProps: AnyObject, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function): {
6
6
  drawScaleValue: (yScaleValueList: any[]) => void;
7
7
  };
@@ -1 +1 @@
1
- import{fabric as t}from"../utils/index.js";import{defaultBorderStyle as e,defaultTextStyle as i,defaultStyle as n,drawPoint as o,drawTextGroup as l,defaultRectStyle as r}from"./useDraw.js";import{getScaleInfo as s,drawScaleNumber as u,drawScaleLine as a}from"./useScaleColumn.js";import{getType as h,isOneLine as g}from"../utils/utils.js";function c(c,p,d,f,y,w,v,m,S,Y,b,x){var T,X;const{getEqualXTypes:C,repeatTip:N}=x,{originY:V,endY:j,originX:L,endX:M,xCellWidth:k,yCellHeight:E,left:I,vitalSignsOriginY:G,painOriginY:H,painHeight:O,iconsWidth:W,itemList:A,painIndex:R,right:_,canvasWidth:B,canvasHeight:J,getRightInfo:$}=p;function q(o){var h;if(!(null==o?void 0:o.length))return;const{layout:g}=o[0];let p=W,d=L;"right"===g&&(p=M,d=M+(null!=(h=null==_?void 0:_.width)?h:0));const f=[],y=O&&"right"!==g?o.length-1:o.length,w=(d-p)/y,v=w+(d-p)%y;o.forEach(((o,h)=>{if("pain"===o.type)return void function(n){const{list:o=[],spaceGridNumber:a=5,showScale:h,showNumber:g,position:p,showMaxMinNumber:d,style:f,title:y}=n,w=l({width:L-W,height:O,...r},{value:`${y}`,...i,...f||{}},{left:W,top:H.originY}),v=[];if(h||g){const{lineXMain:i,textLeft:l}=s(p,W,L-W),r=o.length;o.forEach(((o,s)=>{let c=H.endY-s*E*a;if(0===s&&(c=j-5),!g||(0===s||s===r-1)&&!d||v.push(u(o,n,l,c)),h&&0!==s){const[n,o]=i,l=new t.Line([n,c,o,c],{...e,...f});v.push(l)}}))}c.value.add(w,...v),w.sendToBack()}(o);const d=[],y=0===h?v:w,m=0===h?p:v+p+(h-1)*w,S="right"===g?0:G.originY,Y="right"===g?J:G.endY,b=h>0?new t.Line([m,S,m,Y],{...e}):null;b&&d.push(b);const x=m+y/2,{list:T=[],spaceGridNumber:X=5,showScale:C,showNumber:N,position:V,showMaxMinNumber:M}=o;if(C||N){const{lineXMain:t,lineXSub:e,textLeft:i}=s(V,m,y),n=T.length;T.forEach(((l,r)=>{const s=G.endY-r*E*X;if(N&&(!(0===r||r===n-1)||M)){const t=0==r?s-5:s,e=u(l,o,i,t),n=G.originY+e.height/2;t<n&&e.set({top:n}),d.push(e)}d.push(...a(o,r,t,e,s,E,G.originY))}))}let k=o.title||"";o.unit&&(k+="\n"+o.unit),k&&d.push(new t.Text(String(k),{...i,left:x,top:G.originY+E*X/2,textAlign:"center",...o.style}));const I=new t.Group(d,{...n,objectCaching:!1});f.push(I)}));const m=f.length>0?new t.Group([...f],{...n,objectCaching:!1}):null;m&&c.value.add(m),m&&m.sendToBack()}function z(t){return t.left>=L&&t.left<M&&t.top>=V&&t.top<=j}W&&function(){const e=JSON.parse(JSON.stringify(A));let i=j;const l=W-I.icons.marginRight;e.reverse().forEach((e=>{i-=10;let r=e.title.replace(/(.{2})/g,"$1\n");r.endsWith("\n")&&(r=r.slice(0,r.length-1));const s=new t.Text(String(r),{...n,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:i,lineHeight:1,fontSize:12}),u=o(e.type,{left:l,top:i-(s.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:h(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:i-(s.height||30)/2-1,...p.event});var a;i-=s.height||30,(a=u).on("moving",(()=>{a.set("originX","center"),function(t){if(t.left>=L&&t.left<=M){t.setCoords();const e="pain"===t.origin.type?H:G;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(a),z(a)?f(a):y.show=!1})),a.on("mouseup:before",(t=>{if(y.show=!1,0===t.e.button&&z(a)){const t=C(a.left,"_type",k).includes(a.origin._type),e=Y(a.left);if(!e||t)t&&e&&N();else{const t={data:{time:m(a.left),value:S(a.origin.type,a.top),...g(a.origin.type)?{key:a.origin.key}:{}},...a.origin};d("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(a)})),c.value.add(s,u)}))}();const D=I.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==_?void 0:_.width)&&"left"===(null==(T=null==_?void 0:_.yScaleValue)?void 0:T.layout)&&(null==(X=null==_?void 0:_.yScaleValue)?void 0:X.show)&&D.push($),R>0&&I.yScaleValue[R].show){const t=I.yScaleValue[R];0===R&&I.yScaleValue.length>1&&D.unshift(t),R==I.yScaleValue.length-1&&D.push(t)}const F=D.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),K=D[F];return F>-1&&D.splice(F,0,{...K,title:(null==K?void 0:K.doubleTitle)||(null==K?void 0:K.title)}),q(D),c.value.add(new t.Rect({left:W,top:0,width:B-W-1,height:J-1,fill:"transparent",...e})),{drawScaleValue:q}}export{c as useLeft};
1
+ import{fabric as t}from"../utils/index.js";import{defaultTextStyle as e,defaultStyle as i,drawPoint as n,drawTextGroup as o}from"./useDraw.js";import{useCommon as l}from"./useCommon.js";import{getScaleInfo as r,drawScaleNumber as s,drawScaleLine as u}from"./useScaleColumn.js";import{getType as a,isOneLine as h}from"../utils/utils.js";function g(g,c,p,d,f,y,w,v,m,S,b){var Y,x;const{getEqualXTypes:T,handleAddPrevent:X}=l(g,p),{originY:C,endY:j,originX:N,endX:V,xCellWidth:L,yCellHeight:M,left:k,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:W,canvasWidth:R,canvasHeight:_,getRightInfo:B,borderStyle:J}=c;function $(n){var l;if(!(null==n?void 0:n.length))return;const{layout:a}=n[0];let h=G,c=N;"right"===a&&(h=V,c=V+(null!=(l=null==W?void 0:W.width)?l:0));const p=[],d=A&&"right"!==a?n.length-1:n.length,f=(c-h)/d,y=f+(c-h)%d;n.forEach(((n,l)=>{if("pain"===n.type)return void function(i){const{list:n=[],spaceGridNumber:l=5,showScale:u,showNumber:a,position:h,showMaxMinNumber:c,style:p,title:d}=i,f=o({width:N-G,height:A,...J},{value:`${d}`,...e,...p||{}},{left:G,top:I.originY}),y=[];if(u||a){const{lineXMain:e,textLeft:o}=r(h,G,N-G),g=n.length;n.forEach(((n,r)=>{let h=I.endY-r*M*l;if(0===r&&(h=j-5),!a||(0===r||r===g-1)&&!c||y.push(s(n,i,o,h)),u&&0!==r){const[i,n]=e,o=new t.Line([i,h,n,h],{...J,...p});y.push(o)}}))}g.value.add(f,...y),f.sendToBack()}(n);const c=[],d=0===l?y:f,w=0===l?h:y+h+(l-1)*f,v="right"===a?0:E.originY,m="right"===a?_:E.endY,S=l>0?new t.Line([w,v,w,m],{...J}):null;S&&c.push(S);const b=w+d/2,{list:Y=[],spaceGridNumber:x=5,showScale:T,showNumber:X,position:C,showMaxMinNumber:V}=n;if(T||X){const{lineXMain:t,lineXSub:e,textLeft:i}=r(C,w,d),o=Y.length;Y.forEach(((l,r)=>{const a=E.endY-r*M*x;if(X&&(!(0===r||r===o-1)||V)){const t=0==r?a-5:a,e=s(l,n,i,t),o=E.originY+e.height/2;t<o&&e.set({top:o}),c.push(e)}c.push(...u(n,r,t,e,a,M,E.originY))}))}let L=n.title||"";n.unit&&(L+="\n"+n.unit),L&&c.push(new t.Text(String(L),{...e,left:b,top:E.originY+M*x/2,textAlign:"center",...n.style}));const k=new t.Group(c,{...i,objectCaching:!1});p.push(k)}));const w=p.length>0?new t.Group([...p],{...i,objectCaching:!1}):null;w&&g.value.add(w),w&&w.sendToBack()}function q(t){return t.left>=N&&t.left<V&&t.top>=C&&t.top<=j}G&&function(){const e=JSON.parse(JSON.stringify(H));let o=j;const l=G-k.icons.marginRight;e.reverse().forEach((e=>{o-=10;let r=e.title.replace(/(.{2})/g,"$1\n");r.endsWith("\n")&&(r=r.slice(0,r.length-1));const s=new t.Text(String(r),{...i,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:l-(e.pointAttr.width||10)-5,top:o,lineHeight:1,fontSize:12}),u=n(e.type,{left:l,top:o-(s.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:a(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:l,originTop:o-(s.height||30)/2-1,...c.event});var y;o-=s.height||30,(y=u).on("moving",(()=>{y.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(y),q(y)?d(y):f.show=!1})),y.on("mouseup:before",(t=>{if(f.show=!1,0===t.e.button&&q(y)){const t=T(y.left,"_type",L).includes(y.origin._type),e=S(y.left);if(!e||t)t&&e&&X("repeat");else{const t={data:{time:v(y.left),value:m(y.origin.type,y.top),...h(y.origin.type)?{key:y.origin.key}:{}},...y.origin};p("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(y)})),g.value.add(s,u)}))}();const z=k.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==W?void 0:W.width)&&"left"===(null==(Y=null==W?void 0:W.yScaleValue)?void 0:Y.layout)&&(null==(x=null==W?void 0:W.yScaleValue)?void 0:x.show)&&z.push(B),O>0&&k.yScaleValue[O].show){const t=k.yScaleValue[O];0===O&&k.yScaleValue.length>1&&z.unshift(t),O==k.yScaleValue.length-1&&z.push(t)}const D=z.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),P=z[D];return D>-1&&z.splice(D,0,{...P,title:(null==P?void 0:P.doubleTitle)||(null==P?void 0:P.title)}),$(z),g.value.add(new t.Rect({left:G,top:0,width:R-G-1,height:_-1,fill:"transparent",...J})),{drawScaleValue:$}}export{g as useLeft};
@@ -1 +1 @@
1
- import{fabric as l}from"../utils/index.js";import{defaultBorderStyle as i}from"./useDraw.js";function e(e,o,t){var n,u;const{left:d,right:s,getRightInfo:a,canvasWidth:h,endY:r,endX:f,originY:v}=o,c=d.yScaleValue.filter((l=>"right"===l.layout&&l.show));(null==s?void 0:s.width)&&"right"===(null==(n=null==s?void 0:s.yScaleValue)?void 0:n.layout)&&(null==(u=null==s?void 0:s.yScaleValue)?void 0:u.show)&&c.push(a);const w=c.findIndex((l=>"pulse"===l.type&&l.show&&l.doubleShow)),g=c[w];if(w>-1&&c.splice(w,0,{...g,title:(null==g?void 0:g.doubleTitle)||(null==g?void 0:g.title)}),(null==s?void 0:s.width)||c.length>0){const o=new l.Line([h-1,0,h-1,r],i),t=new l.Line([f+1,v,h-1,v],{...i,stroke:"#fff"});e.value.add(o,t)}t(c)}export{e as useRight};
1
+ import{fabric as l}from"../utils/index.js";function e(e,i,t){var o,n;const{left:d,right:u,getRightInfo:a,canvasWidth:h,endY:s,endX:r,originY:v,borderStyle:f}=i,c=d.yScaleValue.filter((l=>"right"===l.layout&&l.show));(null==u?void 0:u.width)&&"right"===(null==(o=null==u?void 0:u.yScaleValue)?void 0:o.layout)&&(null==(n=null==u?void 0:u.yScaleValue)?void 0:n.show)&&c.push(a);const w=c.findIndex((l=>"pulse"===l.type&&l.show&&l.doubleShow)),g=c[w];if(w>-1&&c.splice(w,0,{...g,title:(null==g?void 0:g.doubleTitle)||(null==g?void 0:g.title)}),(null==u?void 0:u.width)||c.length>0){const i=new l.Line([h-1,0,h-1,s],f),t=new l.Line([r+1,v,h-1,v],{...f,stroke:"#fff"});e.value.add(i,t)}t(c)}export{e as useRight};
@@ -1 +1 @@
1
- import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"./useDraw.js";import{useCumputedPoint as n}from"./useCumputedPoint.js";import{useTop as r}from"./useTop.js";import{useLeft as o}from"./useLeft.js";import{useRight as s}from"./useRight.js";import{useCenter as d}from"./useCenter.js";import{useBottom as v}from"./useBottom.js";import{useOther as c}from"./useOther.js";import{useEvent as p,useCanvasEvent as h}from"./useEvent.js";import"../utils/index.js";import{setOtherType as g}from"../utils/utils.js";import"lodash-es";import"date-fns";import{useCommon as m}from"./useCommon.js";function f(f,y,Y,S){const w=15,b=e(),C=e(),x=e(),j=t({show:!1,point:{x:0,y:0},list:[]}),D=t({show:!1,point:{x:0,y:0},list:[],target:null}),V=a((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||w)||0})),X=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||w)||0})),H=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||w)||0})),L=a((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||w)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=a((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),$=a((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),I=a((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),N=a((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),T=a((()=>{const{grid:e}=y.data;return N.value-e.surplusXCell*G.value})),M=a((()=>{const{top:e,left:t}=y.data;return e.titleWidth+q.value})),O=a((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),W=a((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||w)||0;return V.value+a+l+X.value+H.value})),k=a((()=>{const{grid:e}=y.data;return W.value+e.surplusYCell*R.value})),G=a((()=>(N.value-M.value)/$.value)),R=a((()=>(O.value-W.value)/I.value)),q=a((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),z=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=M.value-G.value;function r(e){const[t="2022",a="01",l="01"]=String(e).match(/\d+/g)||[];return`20${t}`.slice(-4)+"-"+`00${a}`.slice(-2)+"-"+`00${l}`.slice(-2)}return u.map((e=>i.map((t=>{n+=G.value;const a=new Date(`${r(e)} ${t.start}`).getTime(),l=new Date(`${r(e)} ${t.end}`).getTime();return{start:a,end:l,left:n,center:n+G.value/2,scaleCell:(l-a)/G.value}})))).flat()})),A=a((()=>le("breathe"))),B=a((()=>le("pulse"))),E=a((()=>le("temperature"))),F=a((()=>le("pain"))),J=a((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),K=a((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:g(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Q=a((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),U=a((()=>{const{grid:e}=y.data;return-1===Q.value?0:R.value*e.subYCell})),Z=a((()=>{const{left:e}=y.data,t={originY:O.value,endY:O.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=k.value,t.endY=k.value+U.value):Q.value===e.yScaleValue.length-1&&(t.originY=O.value-U.value,t.endY=O.value),t})),_=a((()=>{const{left:e}=y.data,t={originY:W.value,endY:O.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=k.value+U.value,t.endY=O.value):Q.value===e.yScaleValue.length-1&&(t.originY=k.value,t.endY=O.value-U.value),t})),ee=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),te=a((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>Math.floor(100*(1.8*e+32))/100)),spaceGridNumber:l.spaceGridNumber}),u})),ae=t({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:y.data.borderStyle||i,selectionStyle:y.data.selectionStyle||{},dateHeight:V.value,hospitalDaysHeight:X.value,operationDaysHeight:H.value,xScalevalueHeight:L.value,topList:ee.value,breathingHeight:P.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:$.value,gridYNumber:I.value,iconsWidth:q.value,originX:M.value,originY:W.value,originYLimit:k.value,endX:N.value,endXLimit:T.value,endY:O.value,xCellWidth:G.value,yCellHeight:R.value,xScaleList:z.value,breatheYCell:A.value,pulseYCell:B.value,temperatureYCell:E.value,painYCell:F.value,event:J.value,itemList:K.value,getRightInfo:te.value,config:y.data.config||{}});function le(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?R.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ue,cumputedY:ie,getXValue:ne,getYValue:re}=n(ae),oe=m(f);return l((()=>{u((()=>{r(f,ae);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=d(f,ae,Y,ue,ie,ne,re,y.addRenderItem,j,D,oe);C.value=l,x.value=u;const{drawScaleValue:i}=o(f,ae,Y,e,j,ue,ie,ne,re,t,a,oe);s(f,ae,i),v(f,ae),c(f,ae,ue),p(S.value);const{select:n}=h(f,ae,Y);b.value=n}))})),{propItems:ae,redrawPoints:C,select:b,pointTipProps:j,pointMenuProps:D,clickMenu:x}}export{f as default};
1
+ import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"./useDraw.js";import{useCumputedPoint as n}from"./useCumputedPoint.js";import{useTop as r}from"./useTop.js";import{useLeft as o}from"./useLeft.js";import{useRight as s}from"./useRight.js";import{useCenter as d}from"./useCenter.js";import{useBottom as v}from"./useBottom.js";import{useOther as c}from"./useOther.js";import{useEvent as p,useCanvasEvent as h}from"./useEvent.js";import"../utils/index.js";import{setOtherType as g,getFloorNumber as m}from"../utils/utils.js";import"lodash-es";import"date-fns";function f(f,y,Y,S){const w=15,b=e(),C=e(),x=e(),j=t({show:!1,point:{x:0,y:0},list:[]}),D=t({show:!1,point:{x:0,y:0},list:[],target:null}),V=a((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||w)||0})),X=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||w)||0})),H=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||w)||0})),L=a((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||w)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=a((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),$=a((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),I=a((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),N=a((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),T=a((()=>{const{grid:e}=y.data;return N.value-e.surplusXCell*M.value})),O=a((()=>{const{top:e,left:t}=y.data;return e.titleWidth+q.value})),W=a((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),k=a((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||w)||0;return V.value+a+l+X.value+H.value})),G=a((()=>{const{grid:e}=y.data;return k.value+e.surplusYCell*R.value})),M=a((()=>(N.value-O.value)/$.value)),R=a((()=>(W.value-k.value)/I.value)),q=a((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),z=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=O.value-M.value;function r(e){const[t="2022",a="01",l="01"]=String(e).match(/\d+/g)||[];return`20${t}`.slice(-4)+"-"+`00${a}`.slice(-2)+"-"+`00${l}`.slice(-2)}return u.map((e=>i.map((t=>{n+=M.value;const a=new Date(`${r(e)} ${t.start}`).getTime(),l=new Date(`${r(e)} ${t.end}`).getTime();return{start:a,end:l,left:n,center:n+M.value/2,scaleCell:(l-a)/M.value}})))).flat()})),A=a((()=>le("breathe"))),B=a((()=>le("pulse"))),E=a((()=>le("temperature"))),F=a((()=>le("pain"))),J=a((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),K=a((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:g(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Q=a((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),U=a((()=>{const{grid:e}=y.data;return-1===Q.value?0:R.value*e.subYCell})),Z=a((()=>{const{left:e}=y.data,t={originY:W.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value,t.endY=G.value+U.value):Q.value===e.yScaleValue.length-1&&(t.originY=W.value-U.value,t.endY=W.value),t})),_=a((()=>{const{left:e}=y.data,t={originY:k.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value+U.value,t.endY=W.value):Q.value===e.yScaleValue.length-1&&(t.originY=G.value,t.endY=W.value-U.value),t})),ee=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),te=a((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>m(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ae=t({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...i,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:V.value,hospitalDaysHeight:X.value,operationDaysHeight:H.value,xScalevalueHeight:L.value,topList:ee.value,breathingHeight:P.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:$.value,gridYNumber:I.value,iconsWidth:q.value,originX:O.value,originY:k.value,originYLimit:G.value,endX:N.value,endXLimit:T.value,endY:W.value,xCellWidth:M.value,yCellHeight:R.value,xScaleList:z.value,breatheYCell:A.value,pulseYCell:B.value,temperatureYCell:E.value,painYCell:F.value,event:J.value,itemList:K.value,getRightInfo:te.value,config:y.data.config||{}});function le(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?R.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ue,cumputedY:ie,getXValue:ne,getYValue:re}=n(ae);return l((()=>{u((()=>{r(f,ae);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=d(f,ae,Y,ue,ie,ne,re,y.addRenderItem,j,D);C.value=l,x.value=u;const{drawScaleValue:i}=o(f,ae,Y,e,j,ue,ie,ne,re,t,a);s(f,ae,i),v(f,ae),c(f,ae,ue),p(S.value);const{select:n}=h(f,ae,Y);b.value=n}))})),{propItems:ae,redrawPoints:C,select:b,pointTipProps:j,pointMenuProps:D,clickMenu:x}}export{f as default};
@@ -1,4 +1,4 @@
1
- import { Ref } from 'vue';
1
+ import { type Ref } from 'vue';
2
2
  import { fabric } from '../utils';
3
3
  import { IPropItems } from '../interface';
4
4
  export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
@@ -1 +1 @@
1
- import{fabric as t}from"../utils/index.js";import{defaultBorderStyle as e,defaultStyle as l,drawTextGroup as i,defaultTextStyle as o,defaultRectStyle as n}from"./useDraw.js";function s(s,h){const{grid:u,originX:a,xCellWidth:c,gridXNumber:d,top:r,xScalevalueHeight:f,iconsWidth:p,topList:g,endXLimit:v,canvasWidth:y}=h;!function(){const w=[];v&&w.push(new t.Line([v,0,y,0],e));let S=0;g.forEach(((t,e)=>{e>0&&(S+=h[`${g[e-1].key}Height`]),"xScalevalue"==t.key?(function(t,e,l){if(!r.dayHeight)return!1;const n=r.dayHeight,s=c*u.subSecondXCell,h=(d-u.surplusXCell)/u.subSecondXCell;for(let u=0;u<h;u++){const h=a+u*s,c=i({width:s,height:n},{value:u%2==0?"上午":"下午",...o,...t.style||{}},{left:h,top:l});e.push(c)}}(t,w,S),function(t,e,l){var s;const h=r.xScalevalue.show&&null!=(s=r.dayHeight)?s:0,d=f-h,g=i({width:a-p,height:f,...n},{value:r.xScalevalue.title,...o,...t.style||{},...t.titleStyle||{}},{left:p,top:l});e.push(g);const v=[];for(let t=0;t<u.mainXCell;t++)v.push(r.xScalevalue.list);v.flat().forEach(((n,s)=>{const u=a+s*c,r=i({width:c,height:d},{value:n.value,...o,...t.style||{},...n.style||{}},{left:u,top:l+h});e.push(r)}))}(t,w,S)):h[`${t.key}Height`]&&function(t,e,l){const s=h[`${t.key}Height`],d=i({width:a-p,height:s,...n},{value:t.title,...o,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:p,top:l});e.push(d);const r=c*u.subXCell;t.list.forEach(((n,h)=>{const u=a+h*r,c=i({width:r,height:s},{value:n,...o,...(null==t?void 0:t.style)||{}},{left:u,top:l});e.push(c)}))}(t,w,S)}));const x=w.length>0?new t.Group([...w],{...l,objectCaching:!1}):null;x&&x.sendToBack(),x&&s.value.add(x)}()}export{s as useTop};
1
+ import{fabric as t}from"../utils/index.js";import{defaultStyle as e,drawTextGroup as l,defaultTextStyle as i}from"./useDraw.js";function o(o,n){const{grid:s,originX:h,xCellWidth:u,gridXNumber:a,top:c,xScalevalueHeight:d,iconsWidth:r,topList:f,endXLimit:p,canvasWidth:g,borderStyle:v}=n;!function(){const y=[];p&&y.push(new t.Line([p,0,g,0],v));let S=0;f.forEach(((t,e)=>{e>0&&(S+=n[`${f[e-1].key}Height`]),"xScalevalue"==t.key?(function(t,e,o){if(!c.dayHeight)return!1;const n=c.dayHeight,d=u*s.subSecondXCell,r=(a-s.surplusXCell)/s.subSecondXCell;for(let s=0;s<r;s++){const u=h+s*d,a=s%2==0?"上午":"下午",c=l({width:d,height:n,...v},{value:a,...i,...t.style||{}},{left:u,top:o});e.push(c)}}(t,y,S),function(t,e,o){var n;const a=c.xScalevalue.show&&null!=(n=c.dayHeight)?n:0,f=d-a,p=l({width:h-r,height:d,...v},{value:c.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:r,top:o});e.push(p);const g=[];for(let t=0;t<s.mainXCell;t++)g.push(c.xScalevalue.list);g.flat().forEach(((n,s)=>{const c=h+s*u,d=l({width:u,height:f,...v},{value:n.value,...i,...t.style||{},...n.style||{}},{left:c,top:o+a});e.push(d)}))}(t,y,S)):n[`${t.key}Height`]&&function(t,e,o){const a=n[`${t.key}Height`],c=l({width:h-r,height:a,...v},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:r,top:o});e.push(c);const d=u*s.subXCell;t.list.forEach(((n,s)=>{const u=h+s*d,c=l({width:d,height:a,...v},{value:n,...i,...(null==t?void 0:t.style)||{}},{left:u,top:o});e.push(c)}))}(t,y,S)}));const w=y.length>0?new t.Group([...y],{...e,objectCaching:!1}):null;w&&w.sendToBack(),w&&o.value.add(w)}()}export{o as useTop};