cnhis-design-vue 3.1.57-release.3 → 3.2.1-alpha.0

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 (200) hide show
  1. package/README.md +87 -87
  2. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  3. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
  4. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
  5. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
  6. package/es/components/button-print/index.d.ts +1 -0
  7. package/es/components/button-print/src/ButtonPrint.vue.d.ts +1 -0
  8. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  9. package/es/components/button-print/src/utils/print.d.ts +15 -3
  10. package/es/components/button-print/src/utils/print.js +1 -1
  11. package/es/components/calendar/index.d.ts +24 -13
  12. package/es/components/calendar/src/Calendar.vue.d.ts +24 -13
  13. package/es/components/calendar/src/Calendar.vue2.js +1 -1
  14. package/es/components/callback/src/components/render/popupMaps.d.ts +294 -2
  15. package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
  16. package/es/components/classification/src/index.vue.d.ts +3 -3
  17. package/es/components/drag-scroll/index.d.ts +2 -0
  18. package/es/components/drag-scroll/index.js +1 -0
  19. package/es/components/drag-scroll/src/index.d.ts +4 -0
  20. package/es/components/drag-scroll/src/index.js +1 -0
  21. package/es/components/drag-scroll/src/types.d.ts +24 -0
  22. package/es/components/drag-scroll/src/types.js +1 -0
  23. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  24. package/es/components/fabric-chart/src/constants/index.d.ts +2 -1
  25. package/es/components/fabric-chart/src/constants/index.js +1 -1
  26. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  27. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  28. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  29. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  30. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  34. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  35. package/es/components/fabric-chart/src/utils/index.js +1 -1
  36. package/es/components/field-set/index.d.ts +1 -1
  37. package/es/components/field-set/src/FieldColor.vue.d.ts +2 -1
  38. package/es/components/field-set/src/FieldSet.vue.d.ts +2 -1
  39. package/es/components/field-set/src/Index.vue.d.ts +1 -1
  40. package/es/components/field-set/src/Index.vue2.js +1 -1
  41. package/es/components/field-set/src/TableStyle.vue.d.ts +71 -0
  42. package/es/components/field-set/src/TableStyle.vue.js +1 -0
  43. package/es/components/field-set/src/TableStyle.vue2.js +1 -0
  44. package/es/components/field-set/src/components/Row.vue.d.ts +2 -1
  45. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  46. package/es/components/field-set/src/types/index.d.ts +1 -1
  47. package/es/components/field-set/style/index.css +1 -1
  48. package/es/components/form-config/index.d.ts +45 -4
  49. package/es/components/form-config/src/FormConfig.vue.d.ts +45 -4
  50. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +16 -2
  51. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +22 -2
  52. package/es/components/form-render/index.d.ts +16 -2
  53. package/es/components/form-render/index.js +1 -1
  54. package/es/components/form-render/src/FormRender.vue.d.ts +15 -1
  55. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  56. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +16 -2
  57. package/es/components/form-render/src/FormRenderWrapper.vue2.js +1 -1
  58. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  59. package/es/components/form-render/src/components/renderer/index.js +1 -1
  60. package/es/components/form-render/src/components/renderer/select.d.ts +2 -0
  61. package/es/components/form-render/src/components/renderer/select.js +1 -1
  62. package/es/components/form-render/src/components/renderer/simpleComponent.js +1 -1
  63. package/es/components/form-render/src/components/renderer/time.d.ts +7 -0
  64. package/es/components/form-render/src/components/renderer/time.js +1 -0
  65. package/es/components/form-render/src/hooks/index.d.ts +1 -0
  66. package/es/components/form-render/src/hooks/index.js +1 -1
  67. package/es/components/form-render/src/hooks/useAutoHidden.d.ts +1 -1
  68. package/es/components/form-render/src/hooks/useAutoHidden.js +1 -1
  69. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  70. package/es/components/form-render/src/hooks/useFieldNormalize.d.ts +6 -4
  71. package/es/components/form-render/src/hooks/useFieldNormalize.js +1 -1
  72. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  73. package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
  74. package/es/components/form-render/src/hooks/useSelectedSetting.d.ts +5 -0
  75. package/es/components/form-render/src/hooks/useSelectedSetting.js +1 -0
  76. package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
  77. package/es/components/form-render/src/types/index.d.ts +2 -0
  78. package/es/components/form-render/src/utils/business.d.ts +1 -1
  79. package/es/components/form-render/src/utils/business.js +1 -1
  80. package/es/components/form-render/src/utils/index.d.ts +1 -0
  81. package/es/components/form-render/src/utils/index.js +1 -1
  82. package/es/components/iho-table/index.d.ts +278 -0
  83. package/es/components/iho-table/src/IhoTable.vue.d.ts +278 -0
  84. package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
  85. package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +1 -5
  86. package/es/components/iho-table/src/hooks/tapHooks/index.js +1 -1
  87. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.d.ts +2 -1
  88. package/es/components/iho-table/src/hooks/tapHooks/useDataHooks.js +1 -1
  89. package/es/components/iho-table/src/plugins/{bindEventSettingPlugin/index.d.ts → bindEventSettingPlugin.d.ts} +1 -1
  90. package/es/components/iho-table/src/plugins/bindEventSettingPlugin.js +1 -0
  91. package/es/components/iho-table/src/plugins/{defaultConfigPlugin/index.d.ts → defaultConfigPlugin.d.ts} +1 -1
  92. package/es/components/iho-table/src/plugins/defaultConfigPlugin.js +1 -0
  93. package/es/components/iho-table/src/plugins/dragScrollPlugin.d.ts +1 -0
  94. package/es/components/iho-table/src/plugins/dragScrollPlugin.js +1 -0
  95. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue.d.ts +1 -1
  96. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  97. package/es/components/iho-table/src/plugins/filterRenderPlugin/index.js +1 -1
  98. package/es/components/iho-table/src/plugins/headerPlugin.js +1 -1
  99. package/es/components/iho-table/src/plugins/index.js +1 -1
  100. package/es/components/iho-table/src/plugins/{keyboardEventPlugin/index.d.ts → keyboardEventPlugin.d.ts} +1 -1
  101. package/es/components/iho-table/src/plugins/keyboardEventPlugin.js +1 -0
  102. package/es/components/iho-table/src/plugins/{lowCodeFieldAdaptorPlugin/index.d.ts → lowCodeFieldAdaptorPlugin.d.ts} +1 -1
  103. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin.js +1 -0
  104. package/es/components/iho-table/src/plugins/{operationalFormPlugin/index.d.ts → operationalFormPlugin.d.ts} +1 -1
  105. package/es/components/iho-table/src/plugins/operationalFormPlugin.js +1 -0
  106. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +31 -1
  107. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue2.js +1 -1
  108. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/index.js +1 -1
  109. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/index.js +1 -1
  110. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/levelSearchCascadePlugin/levelSearchCascade.vue.d.ts +1 -1
  111. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  112. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  113. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/index.js +1 -1
  114. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/separateRendererPlugin/index.js +1 -1
  115. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +15 -12
  116. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  117. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/index.js +1 -1
  118. package/es/components/iho-table/src/plugins/rowClickPlugin.d.ts +1 -0
  119. package/es/components/iho-table/src/plugins/rowClickPlugin.js +1 -0
  120. package/es/components/iho-table/src/plugins/rowDragPlugin.d.ts +1 -0
  121. package/es/components/iho-table/src/plugins/rowDragPlugin.js +1 -0
  122. package/es/components/iho-table/src/plugins/{varialbleHeightPlugin/index.d.ts → varialbleHeightPlugin.d.ts} +1 -1
  123. package/es/components/iho-table/src/plugins/varialbleHeightPlugin.js +1 -0
  124. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.d.ts +1 -0
  125. package/es/components/iho-table/src/plugins/verticalTablePlugin/constants.js +1 -0
  126. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.d.ts +1 -0
  127. package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -0
  128. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.d.ts +6 -0
  129. package/es/components/iho-table/src/plugins/verticalTablePlugin/renderer.js +1 -0
  130. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.d.ts +12 -0
  131. package/es/components/iho-table/src/plugins/verticalTablePlugin/types.js +1 -0
  132. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.d.ts +28 -0
  133. package/es/components/iho-table/src/plugins/verticalTablePlugin/utils.js +1 -0
  134. package/es/components/iho-table/src/plugins/{virtualTreePlugin/index.d.ts → virtualTreePlugin.d.ts} +1 -1
  135. package/es/components/iho-table/src/plugins/virtualTreePlugin.js +1 -0
  136. package/es/components/iho-table/src/types/index.d.ts +11 -1
  137. package/es/components/iho-table/src/types/pluginType.d.ts +3 -1
  138. package/es/components/iho-table/src/utils/index.d.ts +5 -7
  139. package/es/components/iho-table/src/utils/index.js +1 -1
  140. package/es/components/index.css +1 -1
  141. package/es/components/index.d.ts +1 -0
  142. package/es/components/index.js +1 -1
  143. package/es/components/info-header/index.d.ts +37 -4
  144. package/es/components/info-header/src/InfoHeader.vue.d.ts +37 -4
  145. package/es/components/info-header/src/components/infoDescription/DescriptionItem.vue.d.ts +1 -0
  146. package/es/components/info-header/src/components/infoDescription/DescriptionList.vue.d.ts +1 -0
  147. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +17 -2
  148. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +16 -2
  149. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  150. package/es/components/search-cascader/index.d.ts +1 -1
  151. package/es/components/search-cascader/src/SearchCascader.vue.d.ts +1 -1
  152. package/es/components/search-cascader/src/components/SearchMenu.d.ts +1 -1
  153. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  154. package/es/components/select-person/src/SearchMultiple.vue.d.ts +0 -6
  155. package/es/components/shortcut-setter/index.d.ts +17 -2
  156. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +17 -2
  157. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  158. package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -1
  159. package/es/components/table-export-field/style/index.css +1 -1
  160. package/es/components/table-export-field/style/table-export-field-iconfont.ttf +0 -0
  161. package/es/env.d.ts +25 -25
  162. package/es/shared/assets/img/failure.png.js +1 -1
  163. package/es/shared/assets/img/no-permission.png.js +1 -1
  164. package/es/shared/assets/img/nodata.png.js +1 -1
  165. package/es/shared/assets/img/notfound.png.js +1 -1
  166. package/es/shared/assets/img/qr.png.js +1 -1
  167. package/es/shared/assets/img/success.png.js +1 -1
  168. package/es/shared/assets/img/table_style_1.png.js +1 -0
  169. package/es/shared/assets/img/table_style_2.png.js +1 -0
  170. package/es/shared/assets/img/table_style_3.png.js +1 -0
  171. package/es/shared/assets/img/table_style_4.png.js +1 -0
  172. package/es/shared/assets/img/video.png.js +1 -1
  173. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  174. package/es/shared/assets/img/xb_big.png.js +1 -1
  175. package/es/shared/assets/img/xb_small.png.js +1 -1
  176. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -1
  177. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +86 -0
  178. package/es/shared/hooks/selectHooks/useOptionFiltered.d.ts +3 -1
  179. package/es/shared/hooks/selectHooks/useOptionFiltered.js +1 -1
  180. package/es/shared/hooks/selectHooks/useSearchContent.d.ts +1 -1
  181. package/es/shared/hooks/selectHooks/useSearchContent.js +1 -1
  182. package/es/shared/package.json.js +1 -1
  183. package/es/shared/types/business.d.ts +15 -6
  184. package/es/shared/utils/business.d.ts +1 -1
  185. package/es/shared/utils/fabricjs/index.d.ts +6823 -0
  186. package/es/shared/utils/index.d.ts +2 -1
  187. package/es/shared/utils/index.js +1 -1
  188. package/es/shared/utils/tapable/index.d.ts +139 -0
  189. package/package.json +16 -15
  190. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +0 -1
  191. package/es/components/iho-table/src/plugins/defaultConfigPlugin/index.js +0 -1
  192. package/es/components/iho-table/src/plugins/keyboardEventPlugin/index.js +0 -1
  193. package/es/components/iho-table/src/plugins/lowCodeFieldAdaptorPlugin/index.js +0 -1
  194. package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +0 -1
  195. package/es/components/iho-table/src/plugins/rowClickPlugin/index.d.ts +0 -1
  196. package/es/components/iho-table/src/plugins/rowClickPlugin/index.js +0 -1
  197. package/es/components/iho-table/src/plugins/rowDragPlugin/index.d.ts +0 -1
  198. package/es/components/iho-table/src/plugins/rowDragPlugin/index.js +0 -1
  199. package/es/components/iho-table/src/plugins/varialbleHeightPlugin/index.js +0 -1
  200. package/es/components/iho-table/src/plugins/virtualTreePlugin/index.js +0 -1
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as l,defaultStyle as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k}from"lodash-es";import"../temperature/useShadow.js";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,b,j,C,P){const{computedX:S,computedY:E,getXValue:G,getYValue:M}=c(b),{getEqualXTypes:T,handleAddPrevent:Y,isGridLimit:L,setPrevAndNextPoint:X}=h(x,j,b),{xAxis:A,grid:I,originX:H,originY:W,xCellWidth:N,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:R,rightScales:$,yCellHeight:B,endX:F,scaleValues:q,canvasWidth:z,borderStyle:J,rightAddAreaWidth:K,event:Q,originYCervix:U,other:Z,canvasHeight:_}=b,ee=k(q),te=new Set;function oe(){ee.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,d)=>{!function(s,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=se(P,e);if(s&&S&&!d.breakpoint)h=t([...s,...S],{...v});else if(s&&!S&&!d.breakpoint){const o=se(P,e);h=o?t([...s,...o],{...v}):null}let E,T;if(d.childbirth){const e=s[1]+B;E=o([s[0],s[1],e],w),c.push(E),T=n([s[0]+N/2,e-B/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(T)}const Y=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:l,index:f},leftLine:Y,rightLine:h,arrowGroup:E,arrowGroupText:T,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};Y?p=r(k,{left:Y.get("x2"),top:Y.get("y2"),...L}):s&&(L.leftLine=null,p=r(k,{left:s[0],top:s[1],...L}));u.push(h),p&&(!function(e){Q.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+N/2,top:e.top+B/2})}(e),Q.hovered&&le(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:G(e.left),value:M(t,e.top)}};x.value.discardActiveObject(),j("change",o),ne(o,"change")}}))}(p),a.push(p),te.add(p))}(se(s,e),s,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));X(e),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function ne(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=ee.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ie()}function ie(){var e;te.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...te]))),te.clear(),oe()}function re(e){const t=e.prevPoint?e.prevPoint.left:H,o=e.nextPoint?e.nextPoint.left:F;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<U&&e.set("top",U),e.top<W&&e.set("top",W),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function le(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:M(n,e.top)}`,`时间 ${G(e.left).slice(-5)}`],C.show=!0}function se(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=E(t.key,t.range,e.value);return[o,n<W?W:n>O?O:n]}}function ae(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...J,width:z-D-K-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:F;t.forEach(((t,o)=>{const{range:l,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(l,u),E=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:l}=d(m,r,c),s=O-o*B*k,a=0===o?O-8:o!==S.length-1||W||U&&"FHR"!==v?s:W+8;!w||(0===o||o===E-1)&&!b||j.push(f(String(e),t,l,a)),C.push(...p(t,o,n,i,s,B,W,E))}));const G=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),M=n([P,W>0?W-B/2:B/2],{value:String(h),...i,...g}),T=new e.Group([...C,...j,G,...M?[M]:[]],{objectCaching:!1,...s});x.value.add(T),T.sendToBack(),r+=c}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:l="top",style:a}=A.time,{show:u,range:c=[0,23],position:d,style:f}=A.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=H+N/2,y=B/2;for(let e=0;e<I.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):ae(p.at(-1),r);p.push(t);const s="top"===l?W-y:O+y;g.push(n([m+e*N,s],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:_-y;v.push(n([m+e*N,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...s});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(Z),n=[],i={},r=ee.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=E(o,n,10),l=[0,t],s=[-t/e,0],a=[(O-i-t)/e,O-i],u=[F-H,e*(F-H)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=H&&o<=F&&n>=i&&n<=O}function h([e,t]){return[H+e,O-t]}return f(l)&&p(l)&&(c=h(l)),f(s)&&p(s)&&(c=h(s)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=ee.find((e=>e.key===o));if(r){const r=E(o,i,0);n.push(t([H,r,F,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(l.time)-H,O-E(o,a,l.value)],[p,h]=[S(c.time)-H,O-E(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,u=s(o,r-(S(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),oe(),function(){function e(e,t){const o=ee.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=H&&o<=F&&n>=W&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...te].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],ee.filter((e=>e.show)).forEach((i=>{if(!T([...te],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<U)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=z-K/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=q.findIndex((t=>t.key===e.key)),{text:s,icon:a}=l(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=s.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(re(u),le(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(T([...te],u.left,"key").includes(u.origin.key))Y("repeat");else{const e={data:{time:G(u.left),value:M(u.origin.key,u.top)},...u.origin};j("add",e),ne(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(s,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,D/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),ne(o,"remove")):(Object.assign(o,{data:{time:G(e.pointer.x),value:M(e.origin.key,e.pointer.y)}}),j("add",o),ne(o))},redrawPoints:ie}}export{x as useBirthProcess};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawText as n,defaultTextStyle as i,drawPoint as r,drawTextAndIconGroup as s,defaultStyle as l,defaultRectStyle as a}from"../useDraw.js";import{useGrid as u}from"../useGrid.js";import{useBirthProcessCumputedPoint as c}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as p}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as k}from"lodash-es";import"../temperature/useShadow.js";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,b,j,C,P){const{computedX:S,computedY:E,getXValue:G,getYValue:M}=c(b),{getEqualXTypes:T,handleAddPrevent:Y,isGridLimit:L,setPrevAndNextPoint:X}=h(x,j,b),{xAxis:A,grid:I,originX:H,originY:W,xCellWidth:N,endY:O,startTime:V,leftAddAreaWidth:D,leftScales:R,rightScales:$,yCellHeight:B,endX:F,scaleValues:q,canvasWidth:z,borderStyle:J,rightAddAreaWidth:K,event:Q,originYCervix:U,other:Z,canvasHeight:_}=b,ee=k(q),te=new Set;function oe(){ee.filter((e=>e.show)).forEach(((e,s)=>{var l;const a=[],u=[],c=[];null==(l=e.data)||l.forEach(((l,d)=>{!function(l,d,f){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:k="circle",childbirthStyle:w={}}=e,P=e.data[f+1],S=le(P,e);if(l&&S&&!d.breakpoint)h=t([...l,...S],{...v});else if(l&&!S&&!d.breakpoint){const o=le(P,e);h=o?t([...l,...o],{...v}):null}let E,T;if(d.childbirth){const e=l[1]+B;E=o([l[0],l[1],e],w),c.push(E),T=n([l[0]+N/2,e-B/2],{value:String(d.childbirth),...i,originX:"left",originY:"center",...w}),c.push(T)}const Y=u[f-1],L={origin:{data:d,title:m,key:y||"",dataIndex:s,index:f},leftLine:Y,rightLine:h,arrowGroup:E,arrowGroupText:T,...g,...b.event.hovered?b.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:b.event};l&&(Y||(L.leftLine=null),p=r(k,{left:l[0],top:l[1],...L}));u.push(h),p&&(!function(e){Q.hovered&&(e.on("mouseover",(()=>{se(e,"hover")})),e.on("mouseout",(()=>{C.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(e),function(e){var t,o,n,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),null==(n=e.arrowGroup)||n.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+N/2,top:e.top+B/2})}(e),Q.hovered&&se(e)})),e.on("mouseup",(t=>{if(C.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:G(e.left),value:M(t,e.top)}};x.value.discardActiveObject(),j("change",o),ne(o,"change")}}))}(p),a.push(p),te.add(p))}(le(l,e),l,d)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));X(e),Promise.all(c).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function ne(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,s=ee.find((e=>e.key===r));switch(t){case"remove":s.data.splice(i,1);break;case"change":s.data[i]=n;break;default:{const e=g(n.time,s.data);s.data.splice(e,0,n);break}}ie()}function ie(){var e;te.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...te]))),te.clear(),oe()}function re(e){const t=e.prevPoint?e.prevPoint.left:H,o=e.nextPoint?e.nextPoint.left:F;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<U&&e.set("top",U),e.top<W&&e.set("top",W),e.top>O&&e.set("top",O),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function se(e,t="moving"){const{title:o,key:n,data:i}=e.origin;C.point={x:e.left,y:e.top},C.list=[`${o} ${"hover"===t?i.value:M(n,e.top)}`,`时间 ${G(e.left).slice(-5)}`],C.show=!0}function le(e,t){if(v(e)&&function(e){const t=V+864e5,o=m(e);return o>=V&&o<=t}(e.time)){const o=S(e.time),n=E(t.key,t.range,e.value);return[o,n<W?W:n>O?O:n]}}function ae(e,t){return e+1>t[1]?t[0]:e+1}return u(x,b),function(){const t=new e.Rect({...J,width:z-D-K-1,height:O-1,left:D,top:0,fill:"transparent"});x.value.add(t)}(),function(){function t(t,o="left"){let r="left"===o?D:F;t.forEach(((t,o)=>{const{range:s,spaceValue:u,width:c,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:b}=t,j=[],C=[],P=r+c/2,S=y(s,u),E=S.length;S.forEach(((e,o)=>{const{lineXMain:n,lineXSub:i,textLeft:s}=d(m,r,c),l=O-o*B*k,a=0===o?O-8:o!==S.length-1||W||U&&"FHR"!==v?l:W+8;!w||(0===o||o===E-1)&&!b||j.push(f(String(e),t,s,a)),C.push(...p(t,o,n,i,l,B,W,E))}));const G=new e.Rect({...a,strokeWidth:.5,width:c,height:O,left:P,top:O/2}),M=n([P,W>0?W-B/2:B/2],{value:String(h),...i,...g}),T=new e.Group([...C,...j,G,...M?[M]:[]],{objectCaching:!1,...l});x.value.add(T),T.sendToBack(),r+=c}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:r=[0,23],position:s="top",style:a}=A.time,{show:u,range:c=[0,23],position:d,style:f}=A.processTime;if(t||u){const p=[],h=[],g=[],v=[],m=H+N/2,y=B/2;for(let e=0;e<I.mainXCell;e++){if(t){const t=0===e?+o.slice(11,13):ae(p.at(-1),r);p.push(t);const l="top"===s?W-y:O+y;g.push(n([m+e*N,l],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const o="top"===d?y:_-y;v.push(n([m+e*N,o],{value:String(t),...i,...f||{}}))}}const k=new e.Group([...g,...v],{objectCaching:!1,...l});x.value.add(k),x.value.sendToBack(k)}}(),function(){var e;const o=Object.values(Z),n=[],i={},r=ee.find((e=>"cervix"===e.key&&e.show)),s=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function l(e,t){const{key:o,range:n}=r||{},i=E(o,n,10),s=[0,t],l=[-t/e,0],a=[(O-i-t)/e,O-i],u=[F-H,e*(F-H)+t];let c=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function p([e,t]){const[o,n]=[...h([e,t])];return o>=H&&o<=F&&n>=i&&n<=O}function h([e,t]){return[H+e,O-t]}return f(s)&&p(s)&&(c=h(s)),f(l)&&p(l)&&(c=h(l)),f(a)&&p(a)&&(d=h(a)),f(u)&&p(u)&&(d=h(u)),[...c,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=ee.find((e=>e.key===o));if(r){const r=E(o,i,0);n.push(t([H,r,F,r],{...e}))}break}case"alert":if(s){const{key:o,range:a}=r||{},u=216e5,c={time:w(new Date(m(s.time)+u),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[S(s.time)-H,O-E(o,a,s.value)],[p,h]=[S(c.time)-H,O-E(o,a,c.value)],g=(h-f)/(p-d),v=f-d*g,y=l(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(s){const{k:o,b:r}=i,a=144e5,u=l(o,r-(S(w(new Date(m(s.time)+a),"yyyy-MM-dd HH:mm"))-S(s.time))*o);u.length>0&&n.push(t(u,{...e}))}}})),x.value.add(...n)}(),oe(),function(){function e(e,t){const o=ee.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}b.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=H&&o<=F&&n>=W&&n<=O&&(P.point={x:o,y:n},P.show=!0,t.target?(P.target=t.target,P.list=["删除节点"],[...te].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&P.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(P.target=null,P.list=["新增节点"],ee.filter((e=>e.show)).forEach((i=>{if(!T([...te],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<U)return;P.list.push(e(i,t.pointer))}})),1===P.list.length&&(P.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=z-K/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=e.title.split("").join("\n"),r=q.findIndex((t=>t.key===e.key)),{text:l,icon:a}=s(o,e,{text:{originY:"top",left:t,top:n},icon:{left:t,topY:n,originY:"top",origin:{type:e.type,dataIndex:r},...b.event}},"vertical");var u;n+=l.height+a.height+15,(u=a).on("moving",(()=>{u.set("originY","center"),L(u)?(re(u),se(u)):C.show=!1})),u.on("mouseup:before",(e=>{if(C.show=!1,0===e.e.button&&L(u))if(T([...te],u.left,"key").includes(u.origin.key))Y("repeat");else{const e={data:{time:G(u.left),value:M(u.origin.key,u.top)},...u.origin};j("add",e),ne(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(u)})),i.push(l,a)})),o(i),x.value.add(...i)}function o(e){const t=e.at(-1),o=(O-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,D/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(j("remove",o),ne(o,"remove")):(Object.assign(o,{data:{time:G(e.pointer.x),value:M(e.origin.key,e.pointer.y)}}),j("add",o),ne(o))},redrawPoints:ie}}export{x as useBirthProcess};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as i}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as a}from"../../constants/index.js";import"naive-ui";function l(l,d,u){const{computedX:m,computedY:c}=s(d),{borderStyle:h,originX:f,originY:g,xCellWidth:L,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:N,gridYNumber:C,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w}=d,j=new Set,R=new Set;function y(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:i,y:n,rowIdx:s}=r.origin,l=~~(r.data.length/N),h=r.data.reduce(((e,r,i)=>{const s=o<a.MAXLINENUMBER-1&&i>=t&&i<=t+l||o===a.MAXLINENUMBER-1?[{x:m(e.length+1),y:c(-+r)+n}]:[];return e.concat(s)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:i,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(A(f,{...d.config,...d,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>u.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):R.add(f),arguments.length)return;const g=new e.Text(String(r.title),{...w,left:i+L,top:n,originX:"left",originY:"bottom"});R.add(g)}));const r=arguments.length?[...j]:[...j,...R];l.value.add(...r)}function A(e,t){o(e,t)}n(l,{...d,gridXNumber:b*a.SMALLCELLNUMBER,gridYNumber:C*a.SMALLCELLNUMBER,xCellWidth:L/a.SMALLCELLNUMBER,yCellHeight:p/a.SMALLCELLNUMBER,grid:{...d.grid,subXCell:a.SMALLCELLNUMBER,subYCell:a.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=E/N,t=[];r(N).forEach((r=>{if(r+1>=N)return;const o=(r+1)*e,n=i([o,0,o,M],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),y();return{updatePolyline:t((t=>{if(1===N)return;const r=v[v.length-1].data.length,o=~~(r/N),i=t/100*r-o/2,n=i+o>r?r-o:Math.max(0,i);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===n)return;[...j].forEach((e=>l.value.remove(e))),j.clear()}y(n)}))}),150)}}export{l as useElectrocardiogram};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useThrottleFn as t}from"@vueuse/core";import{range as r}from"lodash-es";import{useDetailEvent as o}from"./hooks/useDetailEvent.js";import{drawLine as n}from"../useDraw.js";import{useGrid as i}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{ECG as l}from"../../constants/index.js";import"naive-ui";function s(s,u,d){const{computedX:c,computedY:m}=a(u),{borderStyle:h,originX:f,originY:L,xCellWidth:g,yCellHeight:p,canvasWidth:E,canvasHeight:M,dataList:v,columnNumber:C,gridYNumber:N,gridXNumber:b,rowNumber:x,lineStyle:S,titleStyle:w,config:A}=u,j=new Set,X=new Set;function R(e=[]){return~~(e.length/C)*(A.mainXCellValue/l.DEFAULTMAINXCELLVALUE)}function U(t=0){v.forEach(((r,o)=>{if(o===v.length-1&&arguments.length)return;const{x:n,y:i,rowIdx:a}=r.origin,s=R(r.data),h=r.data.reduce(((e,r,n)=>{const a=o<l.MAXLINENUMBER-1&&n>=t&&n<=t+s||o===l.MAXLINENUMBER-1?[{x:c(e.length+1),y:m(-+r)+i}]:[];return e.concat(a)}),[]),f=new e.Polyline(h,{...S,fill:"transparent",strokeWidth:1,left:n,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0,evented:!0,selectable:!0});if(y(f,{...u.config,...u,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>d.value&&Promise.reject()}),f.startIdx=t,o<v.length-1?j.add(f):X.add(f),arguments.length)return;const L=new e.Text(String(r.title),{...w,left:n+g,top:i,originX:"left",originY:"bottom"});X.add(L)}));const r=arguments.length?[...j]:[...j,...X];s.value.add(...r)}function y(e,t){o(e,t)}i(s,{...u,gridXNumber:b*l.SMALLCELLNUMBER,gridYNumber:N*l.SMALLCELLNUMBER,xCellWidth:g/l.SMALLCELLNUMBER,yCellHeight:p/l.SMALLCELLNUMBER,grid:{...u.grid,subXCell:l.SMALLCELLNUMBER,subYCell:l.SMALLCELLNUMBER}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:E-t,height:M-t,left:f,top:L,fill:"transparent"});s.value.add(r)}(),function(){const e=E/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const o=(r+1)*e,i=n([o,0,o,M],{stroke:"#000"});t.push(i)})),s.value.add(...t)}(),U();return{updatePolyline:t((t=>{const r=R(v[v.length-1].data);if(r===v[0].data.length)return;const o=v[v.length-1].data.length,n=t/100*o-r/2,i=n+r>o?o-r:Math.max(0,n);e.util.requestAnimFrame((()=>{if(j.size){const[e]=[...j];if(e.startIdx===i)return;[...j].forEach((e=>s.value.remove(e))),j.clear()}U(i)}))}),150)}}export{s as useElectrocardiogram};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as o}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as d}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function m(m,v,c,g,h,p){const N=e(),f=e(),b=e(),M=e(),L=t((()=>v.data.width)),y=t((()=>v.data.height)),S=t((()=>(L.value-0)/C.value)),w=t((()=>(y.value-0)/E.value)),C=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data.length/t.hz;return Math.ceil(a/t.mainXCellValue)})),E=t((()=>{const{config:e,grid:t,dataList:a}=v.data;if(t.gridYNumber)return t.gridYNumber;const r=a.length;return Math.ceil(x.value*r*2/e.mainYCellValue)})),x=t((()=>{const{dataList:e,config:t}=v.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),j=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=v.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{rowNumber:e}=R.value,{dataList:t}=v.data,a=t.length;return Math.round(E.value/(e+(a===o.MAXLINENUMBER?1:0)))})),X=t((()=>{const{dataList:e,width:t,config:a,grid:r}=v.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length;return e.map(((e,t)=>{const a=o.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(o.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+w.value*Math.ceil(I.value/2),rowIdx:a}}}))})),U=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...l,...v.data.borderStyle},lineStyle:{...i,...v.data.lineStyle},titleStyle:{...n,...v.data.titleStyle},measureLineStyle:{...i,...v.data.measureLineStyle},measureTextStyle:{...n,...v.data.measureTextStyle},grid:v.data.grid,originX:0,endX:L.value,originY:0,endY:y.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:X.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:v.data.config});return u((()=>m.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(m,U),{updatePolyline:u}=d(m,U,t);f.value=e,b.value=a,M.value=r,N.value=u}()}),{immediate:!0}),{propItems:U,updatePolyline:N,useMeasureRuler:f,useCaliper:b,useCaliperRuler:M,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:o.SMALLCELLNUMBER}}}}export{m as useElectrocardiogramChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,watch as u}from"vue";import{defaultBorderStyle as l,defaultLineStyle as i,defaultTextStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{isNumber as o}from"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{ECG as d}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as m}from"./useElectrocardiogram.js";import{useMeasureInstrument as s}from"./useMeasureInstrument.js";function v(v,c,g,h,f,p){const N=e(),M=e(),b=e(),L=e(),y=t((()=>c.data.width)),x=t((()=>c.data.height)),S=t((()=>(y.value-0)/C.value)),w=t((()=>(x.value-0)/E.value)),C=t((()=>{const{dataList:e,config:t,grid:a}=c.data;if(o(a.gridXNumber))return a.gridXNumber;const r=e[e.length-1].data.length/t.hz;return Math.ceil(r/t.mainXCellValue)})),E=t((()=>{const{config:e,grid:t,dataList:a}=c.data;if(o(t.gridYNumber))return t.gridYNumber;const r=a.length;return Math.ceil(X.value*r*2/e.mainYCellValue)})),X=t((()=>{const{dataList:e,config:t}=c.data,a=e[e.length-1].data,r=Math.max(...a)-Math.min(...a);return"uv"===t.valueUnit?.001*r:"v"===t.valueUnit?1e3*r:r})),j=t((()=>{var e;return(null==(e=c.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),R=t((()=>{const{mode:e="2-6"}=c.data,[t,a]=e.split("-").map((e=>+e));return{columnNumber:t,rowNumber:a}})),I=t((()=>{const{rowNumber:e}=R.value,{dataList:t}=c.data,a=t.length;return Math.round(E.value/(e+(a===d.MAXLINENUMBER?1:0)))})),U=t((()=>{const{dataList:e,width:t,config:a,grid:r}=c.data,{columnNumber:u,rowNumber:l}=R.value,i=t/u,n=e.length,o=Math.ceil(I.value/2),m=function(){const{valueUnit:t,mainYCellValue:r}=a,l=e[0].data,i=d(Math.max(...l));if(2!==u)return i;const n=e[6].data,o=d(Math.max(...n));return Math.max(i,o);function d(e){return("uv"===t?.001*e:"v"===t?1e3*e:e)/r*w.value}}(),s=w.value*o,v=1===u||s<m?w.value*Math.ceil(m/w.value):s;return e.map(((e,t)=>{const a=d.MAXLINENUMBER===n&&t===n-1?l:t%l;return{...e,origin:{x:(d.MAXLINENUMBER===n&&t===n-1?0:Math.floor(t/l))*i,y:a*(w.value*I.value)+v,rowIdx:a}}}))})),Y=a({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...l,...c.data.borderStyle},lineStyle:{...i,...c.data.lineStyle},titleStyle:{...n,...c.data.titleStyle},measureLineStyle:{...i,...c.data.measureLineStyle},measureTextStyle:{...n,...c.data.measureTextStyle},grid:c.data.grid,originX:0,endX:y.value,originY:0,endY:x.value,xCellWidth:S.value,yCellHeight:w.value,gridXNumber:C.value,gridYNumber:E.value,event:j.value,dataList:U.value,columnNumber:r(R).columnNumber,rowNumber:r(R).rowNumber,config:c.data.config});return u((()=>v.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:t,useCaliper:a,useCaliperRuler:r}=s(v,Y),{updatePolyline:u}=m(v,Y,t);M.value=e,b.value=a,L.value=r,N.value=u}()}),{immediate:!0}),{propItems:Y,updatePolyline:N,useMeasureRuler:M,useCaliper:b,useCaliperRuler:L,getGridInfo:function(){return{cellWidth:S.value,cellHeight:w.value,smallCellNumber:d.SMALLCELLNUMBER}}}}export{v as useElectrocardiogramChart};
@@ -1 +1 @@
1
- import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:T,xAxis:V,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(T);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...X}):e&&(X.leftLine=null,p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(V.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
1
+ import{onUnmounted as e}from"vue";import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as n,drawLine as i,drawPoint as o}from"../useDraw.js";import{useGrid as l}from"../useGrid.js";import{useBirthProcessCumputedPoint as r}from"../useCumputedPoint.js";import{bus as a}from"../useEvent.js";import{useCommon as s}from"../useCommon.js";import{getPointRange as f,getIndex as c,isEffectiveNode as u,getTime as d}from"../../utils/index.js";import{cloneDeep as p,omit as m,flatten as v}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as g}from"@vueuse/core";function y(y,h,k,x,L){const{computedX:P,computedY:b,getXValue:w,getYValue:A}=r(h),{xCellWidth:I,pointSelectionStyle:C,originX:K,endX:j,originY:E,endY:X,event:M,scaleValues:V,xAxis:T,startTime:Y,timeXCell:S,itemList:$,dialog:F}=h,O=new Map,D=new Set,_=p(V);let z=[],N=null;const G=new Set;l(y,h);const{getEqualXTypes:J,handleAddPrevent:q,setPrevAndNextPoint:R}=s(y,k,h),{pause:W,resume:B}=g((()=>{!function(){if(!G.size)return;for(const e of G)e.set("opacity",1===e.opacity?.5:1);y.value.renderAll()}()}),800);function H(){_.forEach((e=>{const{range:t=[],spaceValue:n}=e;n&&(t[0]||t[1])&&e.dataList.forEach(((t,n)=>{t.show&&(!function(e,t){const{max:n={},min:o={}}=e.panicValue||{},{max:l={},min:r={}}=e.diffValue||{};function a({show:e=!1,value:n,name:o,lineStyle:l}){if(!e||!n)return;const r=b(t.type,t.range,n),a=i([K,r,j,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});M.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{x.point={...e||{x:a.left,y:a.top}},x.list=[`${o} ${n}${t.unit||""}`],x.show=!0})),a.on("mouseout",(()=>{x.show=!1}))),y.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),ee(t,n,e))}))}))}function Q(e=[]){if(!(null==N?void 0:N.areaPos))return[];const{startPos:t,endPos:n}=N.areaPos,[i,o]=[t.x,n.x].sort(((e,t)=>e-t)),[l,r]=[t.y,n.y].sort(((e,t)=>e-t));return(e.length?e:fe()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function U(e){F.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),Z()},onNegativeClick:()=>Z(),onClose:()=>Z()})}function Z(){N&&y.value.remove(N),N=null}function ee(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];O.set(e.key,[]),function(e,t){G.size&&[...G].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&G.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,g=u;l.key&&(g=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:b="",key:C,type:K="circle"}=g,j=se(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],X={origin:{data:l,title:b,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...h.event.hovered?h.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:h.event};e&&(E||(X.leftLine=null),p=o(K,{left:e[0],top:e[1],...X}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){M.hovered&&(e.on("mouseover",(()=>{re(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ae(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),M.hovered&&re(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/I);if(a>l+I){if(0===z.length){ne(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[l,r],l,r]),null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,"stroke","transparent"),null==(o=null==(i=e.rightLine)?void 0:i.set)||o.call(i,"stroke","transparent")}const u=l+I*c;if(z.every((e=>e.left!==u))){const t=w(u),n=A(f.type,s);z.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),ne(e,[...e.prevPointer,u,s])}if(z.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+I*l,r=z.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=z.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=z[l-1]||{left:n,top:i},f=~~((r.left-(t-I))/I),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:w(t),value:A(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},z.splice(l,0,a),ne(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=O.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=I/2,r=e.findIndex((e=>Math.abs(n-e.left)<l&&Math.abs(i-e.top)<l&&o.index!==e.origin.index));r>-1?(t.set({scaleX:2.5,scaleY:2.5}),t.coincidePoint=e[r]):t.set({scaleX:t.scale,scaleY:t.scale})}(t,e),null==t||t.forEach((e=>{e.left<=l||f.index===e.origin.index||(e.left<a?te(e,"#999"):te(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(z.length>0&&i<z[z.length-1].left){for(const e of D)e.left>i&&(e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e));if(z=z.filter((e=>e.left<=i)),0===z.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of D)e.leftLine&&y.value.remove(e.leftLine),y.value.remove(e)}if(z.length>0){const t=z.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:w(e.left),value:A(t,e.top)}};if(y.value.discardActiveObject(),z.length>0){const l=_.find((e=>e.type===t));let r=-1;const a=z.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void oe({dataIndex:i,scaleValue:l});const t=e.coincidePoint.origin,n=t.data;r=t.index;const o=a.findIndex((e=>e.time===n.time));o>-1?a[o].value=n.value:a.push({...a.at(-1),time:n.time,value:n.value})}const s=l.dataList.findIndex((e=>e.key===n));k("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ie({...o,data:a,coincideIndex:r})}else k("change",{...m(o,["selfKey","lineAttr"]),key:n}),ie(o,"change")}}))}(p),null==(d=O.get(u.key))||d.push(p))}(se(l,n),l,c,e)})),Promise.all(O.get(e.key)).then((t=>{const n=f.filter((e=>e));R(t),y.value.add(...n,...t),function(e,t){const{max:n={},min:i={}}=t.panicValue||{},{max:o={},min:l={}}=t.diffValue||{};function r({show:t=!1,value:n,flickerable:i},o){!t&&n&&i&&e.forEach((e=>{const t=e.origin.data.value;"max"===o&&t<n||"min"===o&&t>n||G.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function te(e,t){["stroke","fill"].forEach((n=>{const i=e[n];i&&!["transparent","#fff","#ffffff","#FFFFFF"].includes(i)&&i!==t&&e.set(n,t)})),e.rightLine&&e.rightLine.stroke!==t&&e.rightLine.set("stroke",t)}function ne(e,t){const[,,n,o]=t;e.clone((l=>{l.set({left:n,top:o,scaleX:1,scaleY:1}),e.prevPointer=[n,o];const r=i(t,e.origin.lineAttr);l.leftLine=r,D.add(l),y.value.add(r,l)}))}function ie(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=_.find((e=>e.type===r)),u=f.dataList.find(((e,t)=>(s=t,e.key===l)));switch(t){case"remove":u.list.splice(o,n),u.list[o-1]&&(u.list[o-1].breakpoint=!0);break;case"change":u.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=c(e,u.list),n=Array.isArray(i)?i:[i];u.list.splice(t,a>-1?a-t+1:0,...n);break}}oe({dataIndex:s,scaleValue:f})}function oe(e){var t,n,i;if(D.size&&(null==(t=y.value)||t.remove(...le([...D]))),D.clear(),z=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=y.value)||n.remove(...le(O.get(o.key))),O.delete(o.key),ee(o,t,i)}else O.size&&(null==(i=y.value)||i.remove(...le(fe()))),O.clear(),H()}function le(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function re(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;x.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:A(i,e.top)}`;x.list=[`${n} ${r}${l||""}`,`时间 ${w(e.left).slice(-5)}`],x.show=!0}function ae(e){e.setCoords();const t=6e4/S,n=e.prevPoint?e.prevPoint.left+t:K,i=j;e.top<E&&e.set("top",E),e.top>X&&e.set("top",X),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function se(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=Y&&n<=t}(e.time)){const n=P(e.time),i=b(t.type,t.range,e.value);return[n,i<E?E:i>X?X:i]}}function fe(){return v(Array.from(O.values()))}return e((()=>{W()})),H(),function(){if(!M.evented)return;let e=!1,i={x:0,y:0};y.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=K&&t<=j&&n>=E&&n<=X)if(e.target){if("main"!==e.target.__type)return;i(e.pointer,e.target,["删除节点"]);const{minLeft:t,maxLeft:n,minTop:o,maxTop:l}=f(e.target);fe().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&L.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===L.list.length&&(L.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),$.forEach((n=>{J(fe(),t,"key",2*I).includes(n.linkKey||n.key)||L.list.push({renderItem:()=>n.title,origin:{title:n.title,unit:n.unit,type:n.bigType,dataIndex:n.dataIndex,key:n.key,linkKey:n.linkKey},pointer:e.pointer})})),1===L.list.length&&(L.show=!1,q("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(L,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=Q();t.length>0?U((()=>{const e=function(e){const t=e.reduce(((e,t)=>{const{key:n}=t.origin;return e[n]=e[n]?e[n].concat(t.origin):[t.origin],e}),{});return Object.keys(t).map((e=>{const n=t[e].sort(((e,t)=>Date.parse(e.data.time)-Date.parse(t.data.time)));return ie(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);k("remove",e)})):a.emit(N)}})),y.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),y.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;N&&y.value.remove(N),N=new t.Rect({...n,fill:"#CAF982",opacity:.4,...C,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),N.areaPos={startPos:i,endPos:o.pointer},y.value.add(N)}))}(),{redrawPoints:oe,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(k("remove",n),ie(n,"remove")):(Object.assign(n,{data:{time:w(e.pointer.x),value:A(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),k("add",n),ie({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:ae,setPopup:re,updateData:ie,getGridPoints:fe,getContainPoints:Q,showDialog:U,removeCurrentSelection:Z}}export{y as useCenter};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function p(p,h,f,m,g,v,y,k){const{getYValue:w,getXValue:j}=s(h),{getEqualXTypes:x,handleAddPrevent:b,isGridLimit:W}=u(p,f,h),{originY:X,endY:C,borderStyle:E,left:S,itemList:Y,scaleValues:K,originX:L,endX:V,yCellHeight:G,markHeight:H,canvasWidth:N,canvasHeight:T,xCellWidth:M}=h;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:C-X+H,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:X},!0);p.value.add(n)}(),K.forEach(((e,i)=>{var o,s;const u="left"===e.layout?L-5:V+5,{range:c,spaceValue:h,title:f,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:y,showMaxMinNumber:k}=e,w=[],j=d(c,h),x=j.length;j.forEach(((t,i)=>{const o=0===i?C-5:C-i*G*v;!y||(0===i||i===x-1)&&!k||w.push(a(String(t),{...e,position:e.layout},u,o))}));const b=f&&n(["left"===e.layout?S.width/2:V+(N-V)/2,(null!=(s=null==(o=w.at(-1))?void 0:o.top)?s:330)-G],{value:`${f}${m?"\n"+m:""}`,...r,...g}),W=new t.Group([...w,...b?[b]:[]],{objectCaching:!1,...l});p.value.add(W),W.sendToBack()})),function(){const e=new t.Rect({width:L-S.titleWidth,height:C-X+H,left:S.titleWidth,top:X,...i,originX:"left",originY:"top",...E});p.value.add(e);const n=c(Y),r=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0})));let l=C;const s=S.titleWidth+15;r.concat(n.reverse()).forEach((t=>{l-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:s,top:l},icon:{leftX:s,topY:l,...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;l-=i.height||30,(r=n).on("moving",(()=>{r.set("originX","center"),W(r)?(g(r),v(r)):m.show=!1})),r.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&W(r)){const t=r.origin.linkKey||r.origin.key;if(x(k(),r.left,"key",2*M).includes(t))b("repeat");else{const e={data:{time:j(r.left),value:w(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};f("add",e),y({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),p.value.add(i,n)}))}(),p.value.add(new t.Rect({left:0,top:0,width:N-E.strokeWidth,height:T-E.strokeWidth,fill:"transparent",...E}))}export{p as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as r,defaultStyle as l}from"../useDraw.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import{drawScaleNumber as s}from"../useScaleColumn.js";import{useCommon as u}from"../useCommon.js";import"vue";import{getScaleNumberList as d}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function f(f,p,g,h,m,v,y,k){const{getYValue:w,getXValue:j}=a(p),{getEqualXTypes:x,handleAddPrevent:b,isGridLimit:X}=u(f,g,p),{originY:W,endY:C,borderStyle:E,left:S,itemList:Y,scaleValues:K,originX:L,endX:M,yCellHeight:N,markHeight:V,canvasWidth:G,canvasHeight:H,xCellWidth:T}=p;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:C-W+V,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:W},!0);f.value.add(n)}(),K.forEach(((e,i)=>{var o,a;const{range:u,spaceValue:c,title:p,unit:g,titleStyle:h,spaceGridNumber:m=1,showNumber:v,showMaxMinNumber:y,titleMargin:k=[5,30],margin:w=5}=e,j="left"===e.layout?L-w:M+w,x=[],b=d(u,c),X=b.length;b.forEach(((t,i)=>{const o=0===i?C-5:C-i*N*m;!v||(0===i||i===X-1)&&!y||x.push(s(String(t),{...e,position:e.layout},j,o))}));const W="left"===e.layout?"right":"left",E=p&&n(["left"===e.layout?L-k[0]:M+k[0],(null!=(a=null==(o=x.at(-1))?void 0:o.top)?a:330)-N-k[1]],{value:`${p}${g?"\n"+g:""}`,...r,...h,textAlign:W,originX:W,originY:"bottom"}),S=new t.Group([...x,...E?[E]:[]],{objectCaching:!1,...l});f.value.add(S),S.sendToBack()})),function(){const e=new t.Rect({width:L-S.titleWidth,height:C-W+V,left:S.titleWidth,top:W,...i,originX:"left",originY:"top",...E});f.value.add(e);const n=c(Y),r=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0}))),{projectNameMargin:l=[5,30],titleWidth:a=20}=S;let s=C+V-l[0];const u=a+l[1];r.concat(n.reverse()).forEach((t=>{s-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:u,top:s},icon:{leftX:u,topY:s,originX:"center",...t.isExternal?{evented:!1,selectable:!1}:{},origin:{linkKey:t.linkKey}}});var r;s-=i.height||30,n.set("left",n.left+n.width/2),(r=n).on("moving",(()=>{r.set("originX","center"),X(r)?(m(r),v(r)):h.show=!1})),r.on("mouseup:before",(t=>{if(h.show=!1,0===t.e.button&&X(r)){const t=r.origin.linkKey||r.origin.key;if(x(k(),r.left,"key",2*T).includes(t))b("repeat");else{const e={data:{time:j(r.left),value:w(r.origin.type,r.top),...r.origin.linkKey?{key:r.origin.key}:{}},...r.origin};g("add",e),y({...e,key:t})}}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(r)})),f.value.add(i,n)}))}(),f.value.add(new t.Rect({left:0,top:0,width:G-E.strokeWidth,height:H-E.strokeWidth,fill:"transparent",...E}))}export{f as useLeft};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{useDialog as n}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as g}from"./useCenter.js";import{useOther as f}from"./useOther.js";function y(y,x,w,b,j,C){const Y=n(),H=e(),S=e(),D=e(),A=t((()=>x.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=x.data.left.width)?e:0})),T=t((()=>{const{grid:e}=x.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=x.data;return e.mainYCell*e.subYCell})),G=t((()=>s(x.data.top.treeData))),V=t((()=>x.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=x.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(x.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const e=d(x.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=x.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const o={top:t*r+P.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);o.height=a*r,e(i.children,l+1)}else o.width=M.value-o.left;Object.assign(i,o)}))}(e),e}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=x.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=x.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(x.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=x.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=x.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:x.data.width,canvasHeight:x.data.height,borderStyle:{...o,...x.data.borderStyle},pointSelectionStyle:x.data.pointSelectionStyle||{},grid:x.data.grid,top:x.data.top,left:x.data.left,other:x.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:x.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return x.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=x.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),v(y,$,w,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:n,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=g(y,$,w,j,C);h(y,$,w,j,a,r,i,n);const{clickMenu:d}=f(y,$,w,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as n}from"vue";import{useDialog as l}from"naive-ui";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import"../useEvent.js";import{cloneDeep as d,range as c,flatten as p}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as m}from"../../constants/index.js";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useCenter as f}from"./useCenter.js";import{useOther as g}from"./useOther.js";function y(y,w,x,b,j,C){const Y=l(),H=e(),S=e(),D=e(),A=t((()=>w.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),M=t((()=>{var e;return null!=(e=w.data.left.width)?e:0})),T=t((()=>{const{grid:e}=w.data;return e.mainXCell*e.subXCell})),X=t((()=>{const{grid:e}=w.data;return e.mainYCell*e.subYCell})),G=t((()=>{const{treeData:e=[],show:t=!0}=w.data.top;return t?s(e):0})),V=t((()=>w.data.top.tree.cellHeight)),k=t((()=>V.value*G.value)),P=t((()=>te(_("drug")||"top"))),L=t((()=>P.value+k.value)),N=t((()=>{var e;return Date.parse((null==(e=w.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),O=t((()=>{const e=d(w.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=c(T.value/t+1).map((r=>0===r?e.startTime:u(new Date(N.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:M.value}})),E=function(){const{show:e=!0}=w.data.top;if(!e)return[];const t=d(w.data.top.treeData);let a=0;const{cellWidth:r,cellHeight:i}=w.data.top.tree;return function e(t,n=0){t.forEach((t=>{var l;const o={top:a*i+P.value,left:n*r,width:r,height:i};if(a++,null==(l=t.children)?void 0:l.length){a--;const r=s(t.children);o.height=r*i,e(t.children,n+1)}else o.width=M.value-o.left;Object.assign(t,o)}))}(t),t}(),W=t((()=>te(_("xAxis")||"center"))),I=t((()=>{var e;const{width:t,right:a}=w.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),q=t((()=>te(_("intraoperatively")||"bottom"))),z=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=w.data.other)?void 0:e.mark)||{};return t&&a?a:0})),B=t((()=>q.value+(w.data.height-k.value-O.value.height-z.value))),F=t((()=>(I.value-M.value)/T.value)),J=t((()=>(B.value-q.value)/X.value)),K=t((()=>O.value.spaceTimeStamp/F.value)),Q=t((()=>{const{scaleValues:e}=w.data;return p(e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))))})),R=t((()=>ae("pulse"))),U=t((()=>ae("temperature"))),Z=t((()=>{var e;return(null==(e=w.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),$=a({canvasWidth:w.data.width,canvasHeight:w.data.height,borderStyle:{...o,...w.data.borderStyle},pointSelectionStyle:w.data.pointSelectionStyle||{},grid:w.data.grid,top:w.data.top,left:w.data.left,other:w.data.other,topGridYNumber:r(G),topGridYCellHeight:r(V),topGridOriginY:r(P),topGridEndY:r(L),treeData:E,xAxis:r(O),originYXAxis:r(W),startTime:r(N),timeXCell:r(K),gridXNumber:r(T),gridYNumber:r(X),xCellWidth:r(F),yCellHeight:r(J),originX:r(M),endX:r(I),originY:r(q),endY:r(B),markHeight:r(z),itemList:r(Q),scaleValues:w.data.scaleValues,pulseYCell:r(R),temperatureYCell:r(U),event:r(Z),dialog:Y});function _(e){let t="";return Object.entries(A.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function ee(e){const t=A.value[e],a=O.value.height;switch(t){case"drug":return k.value;case"xAxis":return a;default:return w.data.height-k.value-a}}function te(e){switch(e){case"top":return 0;case"center":return ee("top");default:return ee("top")+ee("center")}}function ae(e){const{scaleValues:t}=w.data,a=t.find((t=>t.type===e));return J.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await n(),v(y,$,x,j);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:l,getContainPoints:o,showDialog:u,removeCurrentSelection:s}=f(y,$,x,j,C);h(y,$,x,j,a,r,i,l);const{clickMenu:d}=g(y,$,x,j,C,a,o,u,s);S.value=e,D.value=e=>{const{item:a}=e;a.type&&m.map((e=>e.type)).includes(a.type)?d(e):t(e)}})),{propItems:$,redrawPoints:S,select:H,clickMenu:D}}export{y as useSurgicalAnesthesiaChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function c(c,u,d,m,h){const{computedX:p,getXValue:v}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const f=E(n,e,i);n&&(n.set(f),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:f,halfY:c}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:c};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,c],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),p=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,$(p),p}function $(t){I.hovered&&(t.on("mouseover",(()=>{W(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&W(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function W(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=v(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(c,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a}=S;if(!l)return;const f=[],u=X+l/2;r.forEach(((t,i)=>{const n=s+i*L*a;f.push(e([n,u],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&c.value.add(d);const m=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y}),h=e([x+(w-x)/2,u],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(m,h)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,v={value:h,...r};(null==(n=i.children)?void 0:n.length)?(v.value=h.split("").join("\n"),t(i.children)):(v.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=f(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:f,continue:c}=t,[u,d]=f,m=u&&p(u),h=d&&p(d),v=M({...r,x:m},{isCustomIcon:!h&&!c,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!c});let X;if((v||m<g)&&(L||h>x)){X=l([v?m:g,o,L?h:x,o],e)}const C={startLine:v,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),v&&z.add(v),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&c.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},v,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&c.value.add(a),z.size&&c.value.add(...z)}()}export{c as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function c(c,u,d,m,h){const{computedX:v,getXValue:p}=a(u),{originX:g,endX:x,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:w,borderStyle:Y,treeData:y,xAxis:S,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=u,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{textStyle:l}=C.data||{},{startLine:s,endLine:a}=e;n=r(o,{fontSize:12,...l,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const f=E(n,e,i);n&&(n.set(f),n.origin={data:t},$(n),s&&(s.text=n),a&&(a.text=n))}return n}function E(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function M(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:f,halfY:c}=e;if(!s||s<g||s>x)return;const{lineStyle:u}=C.data||{};let d;const m={left:s,top:c};d=i?r("circle",{fill:u.stroke,...m}):n?r(">",{fill:u.stroke,...m,fontSize:18}):l([s,a,s,c],u);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),v=new t.Group([d,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return v.isLeft=o,v.isCustomIcon=i,$(v),v}function $(t){I.hovered&&(t.on("mouseover",(()=>{W(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=E(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&W(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};d("change",e)}})))}function W(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=p(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(c,{...u,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a}=S;if(!l)return;const f=[],u=X+l/2;r.forEach(((t,i)=>{const n=s+i*L*a;f.push(e([n,u],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&c.value.add(d);const m=new t.Rect({width:w,height:l,left:0,top:X,...n,originX:"left",originY:"top",...Y});c.value.add(m);const{show:h=!0}=C;if(!h)return;const v=e([x+(w-x)/2,u],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(v)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:u,left:d,top:m,title:h=""}=i,p={value:h,...r};(null==(n=i.children)?void 0:n.length)?(p.value=h.split("").join("\n"),t(i.children)):(p.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e}=C.data||{},i=t.top,n=i+k,o=n-k/2,r={y1:i,y2:n,halfY:o};let s=null;const a=f(t);delete a.data,t.data.forEach(((t,i,n)=>{const{time:f,continue:c}=t,[u,d]=f,m=u&&v(u),h=d&&v(d),p=M({...r,x:m},{isCustomIcon:!h&&!c,isContinue:!1,isLeft:!0}),L=M({...r,x:h},{isCustomIcon:!1,isContinue:!!c});let X;if((p||m<g)&&(L||h>x)){X=l([p?m:g,o,L?h:x,o],e)}const C={startLine:p,centerLine:X,endLine:L};let w,Y;!function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e,{startLine:r,endLine:s}=t||{};if(n){n.origin=i;const t={x1:g,x2:l?l.left:x};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:g,x2:x};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(s,C,Object.assign({},a,{data:t,index:i})),s&&(w=A(n[i-1],s,o)),i===n.length-1&&(Y=A(t,C,o)),s=C,X&&z.add(X),p&&z.add(p),L&&z.add(L),w&&z.add(w),Y&&z.add(Y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=x+(w-x)/2,l=e([o,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle}),r=w-Y.strokeWidth;o+l.width>r&&l.set({originX:"right",left:r});l&&c.value.add(l)}(i)),s.push(o({width:a,height:u,...Y},p,{left:d,top:m},!0))}))}(y);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&c.value.add(a),z.size&&c.value.add(...z)}()}export{c as useTop};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as d,setOtherType as p,isEffectiveNode as f,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"../useEvent.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m,flatten as x}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as b,PAIN_MENU as j,OVERLAP as w}from"../../constants/index.js";function L(L,S,Y,E,M,$,O,C,P,A){r(L,S);const{getEqualXTypes:I,handleAddPrevent:R}=y(L,Y,S),{createShadowLines:T}=t(),{left:V,xScaleList:X,xCellWidth:z,yCellHeight:D,originX:F,endX:H,originY:_,endY:W,itemList:q,event:G,vitalSignsOriginY:B,painOriginY:J,hospitalizationDate:K,config:N,canvasHeight:Q}=S,U=new Set,Z=["xinmai","mai"],ee=new Map,te=new Set,ie=new Set,ne=new Set,oe=m(V.yScaleValue);function le(t){var o;const l=oe.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(U.size&&L.value.remove(...U),U.clear(),ee.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=ee.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of ee)t.push(e[1]),e[0]===Z[0]&&e[1].forEach((e=>{(ee.get(Z[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],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(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(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...T(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),U.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...x(t)],{...r,originX:"center"});e.push(n),U.add(n)}))}L.value.add(...e)}U.add(l),L.value.add(l)}))}}function se(){var e;const t=oe.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,V.overlap||{}),l=[];te.size&&[...te].forEach((e=>{[...ie].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},belowMinValueStyle:j={},dataList:w=[],list:E=[]}=r,{type:$,textStyle:C,showConnectLine:A=!1}=b,I=[],R=[],T=[];null==(u=e.list)||u.forEach(((u,b)=>{const V=a(c)?w.find((e=>e.key===u.key)):e,X=ce(u,r),F={};F.value=function(e,t,i){if(!(null==e?void 0:e.length)||!N.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=B.originY+D?e[1]+D:e[1]-D,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-D}}(X,u,V),function(e,t,r,a){var u,p;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:y={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&h.show){const t=k(h)?M(c,E,35):e[1];if(h.text)j=l([e[0],k(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style});else{const i=t+2*D;j=s([e[0],t,i],{...h.style})}T.push(j)}t.rise&&f.show&&f.text&&(w=l([e[0],e[1]-(m?D:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style}),T.push(w));t.verified&&(L=l([e[0],e[1]-(m?D:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(L));if(d(t.physicsReduce)||d(t.drugReduce)){const l=M(c,E,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==N?void 0:N.hypothermyViewCustom)?e[0]+z/2:e[0];x=i([...e,s,l],{...y,...g.line,...n}),b=o((null==(p=null==g?void 0:g.point)?void 0:p.type)||"circle",{left:s,top:l,...g.point,...n,originY:l===Q?"bottom":"center"}),x&&T.push(x),b&&T.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:h.text?5:2*D,isFixed:k(h)},riseText:{obj:w,top:(m?-D:0)-5},verifiedText:{obj:L,top:(m?-D:0)-5},reducePoint:{obj:b,type:"reduce"}})}(X,u,V,F),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...E),r=Math.min(...E);let a,u,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*D,i=[e[1]-D/2,t];t<B.originY&&(t=e[1]+2.5*D,i=[t,e[1]+D/2]),a=s([e[0],i[0],i[1]],m,"up"),T.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>o){const t=a?e[1]+D/2+a.height:e[1]+D;u=l([e[0],t],i),T.push(u)}+t.value<r&&(u=l([e[0],e[1]-D],i),T.push(u))}if(j.show&&+t.value<r){const t=e[1];if(j.text)d=l([e[0],e[1]+5],{value:j.text.split("").join("\n"),originY:"top",...j.style});else{const i=t+2*D;d=s([e[0],t,i],{...j.style})}T.push(d)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-D},belowMinValue:{obj:d,top:j.text?5:2*D,moveHide:!0}})}(X,u,V,F),function(n,l,s,a,u){let d,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,b=e.list[s+1],j=ce(b,r),w=ae(c,e.list[s].value),k=j&&ae(c,b.value);if(n&&j&&!l.breakpoint&&(!w&&!k||A)&&n[0]!==j[0]){f=i([...n,...j],{...v});const{obj:e}=(null==u?void 0:u.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==N?void 0:N.hypothermyViewCustom)){const t=i([e.left,e.top,...j],{...v});T.unshift(t),Object.assign(u,{reduceRightLine:{obj:t,type:"reduce"}}),f.set("stroke","transparent")}}const E=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===$?0:x,M=R[s-1],V={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:p(g,c),dataIndex:t,index:s},leftLine:M,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...S.event.hovered?S.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:S.event,...w?{selectable:!1,evented:!1,..."number"===$?C:{}}:{}};if(M){const e=M.get("y2");d=o(E,{left:M.get("x2"),top:w?e-5:e,...V})}else n&&(V.leftLine=null,d=o(E,{left:n[0],top:w?n[1]-5:n[1],...V}));R.push(f),d&&(g.includes("脉搏")?te.add(d):ie.add(d),function(e){G.hovered&&(e.on("mouseover",(()=>{ue(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?J:B;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(L.value.remove(i),delete e.otherObj.obj)))})),le(e)}(e),G.hovered&&ue(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=O(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};L.value.discardActiveObject(),Y("change",n),pe(n,"change")}}))}(d),I.push(d),ne.add(d))}(X,u,b,V,F)})),"pulse"===c&&Z.forEach((e=>{ee.set(e,I.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(I).then((e=>{const t=R.filter((e=>e));Promise.all(T).then((i=>{L.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&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function ae(e,t){return"pain"===e&&0==t}function ue(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:O(o,e.top);if(d(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(d(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||$(e.left)).slice(-5)}`],P.show=!0}function ce(e,t){const i="pain"===t.type?J:B;if(!f(e)||!function(e){const[t]=X,i=X.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time))return;const n=E(e.time),o=M(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function de(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${$(e)}:00`);return K&&l<h(K)?(R("exceedMin"),!1):!(l>o)||(R("exceedMax"),!1)}function pe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=oe.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;fe()}function fe(){var e;ne.size&&(null==(e=L.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}([...ne]))),ee.clear(),ne.clear(),te.clear(),ie.clear(),oe.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se()}return ee.clear(),te.clear(),ie.clear(),oe.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=M(e.type,e.list,e.positionLine.value),n=i([F,t,H,t],e.positionLine);L.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||re(t,i,e)}))})),le(),se(),L.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!S.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=F&&e<=H&&t>=_&&t<=W){A.point={x:e,y:t},A.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...b]),"pain"===o&&(A.list=[...j]),A.target=i;else{A.target=null,A.list=["新增节点"],q.forEach((i=>{if(!I([...ne],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?J:B;t>=e.originY&&t<=e.endY&&A.list.push({renderItem:C?C(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:u(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=de(e);i&&1!==A.list.length||(A.show=!1,1===A.list.length&&i&&R("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=F&&e<=H&&t>0&&t<Q&&Y("click:grid",{x:e,y:t,time:$(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...b,...j]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};Y("change",r),pe(r,"change")}else{const t={data:{time:$(e.pointer.x),value:O(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};Y("add",t),pe(t)}},setPopup:ue,isAddPoint:de,updateData:pe,redrawPoints:fe,gridPoints:ne}}function k(e){return"fixed"===e.position}export{L as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,getFloorNumber as d,isValidValue as p,setOtherType as f,isEffectiveNode as h,getTime as v,getIndex as g,deleteProperty as y}from"../../utils/index.js";import"../useEvent.js";import{useCommon as m}from"../useCommon.js";import"vue";import{cloneDeep as x,flatten as b}from"lodash-es";import"naive-ui";import"@vueuse/core";import{TEMPERATURE_MENU as j,PAIN_MENU as w,OVERLAP as L}from"../../constants/index.js";function k(k,Y,E,M,$,O,C,P,A,I){r(k,Y);const{getEqualXTypes:R,handleAddPrevent:T}=m(k,E,Y),{createShadowLines:V}=t(),{left:X,xScaleList:z,xCellWidth:D,yCellHeight:F,originX:H,endX:_,originY:W,endY:q,itemList:G,event:B,vitalSignsOriginY:J,painOriginY:K,hospitalizationDate:N,config:Q,canvasHeight:U}=Y,Z=new Set,ee=["xinmai","mai"],te=new Map,ie=new Set,ne=new Set,oe=new Set,le=x(X.yScaleValue);function se(t){var o;const l=le.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Z.size&&k.value.remove(...Z),Z.clear(),te.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=te.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}const o=function(){const e=[],t=[],i=[];for(const e of te)t.push(e[1]),e[0]===ee[0]&&e[1].forEach((e=>{(te.get(ee[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],d=n[i+1],p=o[r-1],f=o[r+1];if(c&&p){if(c[0]!==p[0]){const e=Math.max(c[0],p[0]);l.push([c,p].find((t=>t[0]===e)))}}else c?l.push(c):p&&s.push(p);const h=Math.min(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(d&&f){if(d[0]!==f[0]){const e=Math.min(d[0],f[0]);l.push([d,f].find((t=>t[0]===e))),g()}}else d?(l.push(d),g()):f?(s.push(f),g()):g()})),e}(),{mode:s,style:r={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...n,...r,strokeWidth:1});if(["slash","line"].includes(s)){l.set({fill:"transparent",stroke:r.stroke||"#f00"});const e=[];if(["slash"].includes(s))e.push(...V(t,r._angle,r.space)),e.forEach((e=>{Object.assign(e,{...n,...r}),Z.add(e)}));else{const n=function(e){const t=e.reduce(((e,t)=>{const i=Math.trunc(t[0]);return e[i]=e[i]?e[i].concat([t]):[t],e}),{}),i=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return i}(t);n.forEach((t=>{const n=i([...b(t)],{...r,originX:"center"});e.push(n),Z.add(n)}))}k.value.add(...e)}Z.add(l),k.value.add(l)}))}}function re(){var e;const t=le.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},L,X.overlap||{}),l=[];ie.size&&[...ie].forEach((e=>{[...ne].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{k.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),oe.add(e)}))}))}function ae(e,t,r){var u;const{type:c,riseStyle:h={},noRiseStyle:v={},verifiedStyle:g={},reduceStyle:y={},pacemaker:m={},upArrowStyle:x={},limitValueStyle:b={},nonePainPointStyle:j={},belowMinValueStyle:w={},dataList:L=[],list:M=[]}=r,{type:O,textStyle:P,showConnectLine:I=!1}=j,R=[],T=[],V=[];let X=null;if(null==(u=e.list)||u.forEach(((u,j)=>{const z=a(c)?L.find((e=>e.key===u.key)):e,H=de(u,r),_=e.list[j+1],W=_?de(_,r):void 0,q=_?a(c)?L.find((e=>e.key===_.key)):e:{},{title:G=""}=z;if("脉搏"===G&&"脉搏"!==q.title||"脉搏"!==G&&"脉搏"===q.title||!H||!W||d(H[0],1)!==d(W[0],1))H&&X&&(H[0]=X),X=null;else{const e=H[0]-D/2;H[0]=e+D/4,W[0]=X=H[0]+D/2}const N={};N.value=function(e,t,i){if(!(null==e?void 0:e.length)||!Q.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=J.originY+F?e[1]+F:e[1]-F,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return V.push(s),{obj:s,top:-F}}(H,u,z),function(e,t,r,a){var u,d;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:f={}}=r,{value:m}=a;let x,b,j,w,L;if(t.noRise&&v.show){const t=S(v)?$(c,M,35):e[1];if(v.text)j=l([e[0],S(v)?t:t+5],{value:v.text.split("").join("\n"),originY:"top",...v.style});else{const i=t+2*F;j=s([e[0],t,i],{...v.style})}V.push(j)}t.rise&&h.show&&h.text&&(w=l([e[0],e[1]-(m?F:0)-5],{value:h.text.split("").join("\n"),originY:"bottom",...h.style}),V.push(w));t.verified&&(L=l([e[0],e[1]-(m?F:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),V.push(L));if(p(t.physicsReduce)||p(t.drugReduce)){const l=$(c,M,null!=(u=t.physicsReduce)?u:t.drugReduce),s=l<e[1]&&(null==Q?void 0:Q.hypothermyViewCustom)?e[0]+D/2:e[0];x=i([...e,s,l],{...f,...y.line,...n}),b=o((null==(d=null==y?void 0:y.point)?void 0:d.type)||"circle",{left:s,top:l,...y.point,...n,originY:l===U?"bottom":"center"}),x&&V.push(x),b&&V.push(b)}Object.assign(a,{reduceLine:{obj:x,type:"line"},noRiseText:{obj:j,top:v.text?5:2*F,isFixed:S(v)},riseText:{obj:w,top:(m?-F:0)-5},verifiedText:{obj:L,top:(m?-F:0)-5},reducePoint:{obj:b,type:"reduce"}})}(H,u,z,N),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;const o=Math.max(...M),r=Math.min(...M);let a,u,d;const{upArrowShow:p=!1,limitValueShow:f=!1}=i;if(p&&+t.value>180){let t=e[1]-2.5*F,i=[e[1]-F/2,t];t<J.originY&&(t=e[1]+2.5*F,i=[t,e[1]+F/2]),a=s([e[0],i[0],i[1]],x,"up"),V.push(a)}if(f){const i={value:t.value,originX:"center",originY:"center",...b};if(+t.value>o){const t=a?e[1]+F/2+a.height:e[1]+F;u=l([e[0],t],i),V.push(u)}+t.value<r&&(u=l([e[0],e[1]-F],i),V.push(u))}if(w.show&&+t.value<r){const t=e[1];if(w.text)d=l([e[0],e[1]+5],{value:w.text.split("").join("\n"),originY:"top",...w.style});else{const i=t+2*F;d=s([e[0],t,i],{...w.style})}V.push(d)}Object.assign(n,{upArrow:{obj:a},limitValue:{obj:u,top:-F},belowMinValue:{obj:d,top:w.text?5:2*F,moveHide:!0}})}(H,u,z,N),function(n,l,s,a,u,d){let p,h;const{pointAttr:v={},lineAttr:g={},title:y="",key:x,type:b="circle"}=u,j=e.list[a+1],w=ue(c,e.list[a].value),L=l&&ue(c,j.value);if(n&&l&&!s.breakpoint&&(!w&&!L||I)){h=i([...n,...l],{...g});const{obj:e}=(null==d?void 0:d.reducePoint)||{};if((null==e?void 0:e.top)<n[1]&&(null==Q?void 0:Q.hypothermyViewCustom)){const t=i([e.left,e.top,...l],{...g});V.unshift(t),Object.assign(d,{reduceRightLine:{obj:t,type:"reduce"}}),h.set("stroke","transparent")}}const S=s.pacemakerShow&&"pulse"==c?m.value:w&&"number"===O?0:b,M=T[a-1],$={origin:{data:s,title:y,key:x||"",unit:r.unit,type:c,_type:f(y,c),dataIndex:t,index:a},leftLine:M,rightLine:h,otherObj:d,lockMovementX:!0,...s.pacemakerShow&&"pulse"==c?m.style:v,...Y.event.hovered?Y.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:Y.event,...w?{selectable:!1,evented:!1,..."number"===O?P:{}}:{}};n&&(M?$.leftLine.set("x2",n[0]):$.leftLine=null,p=o(S,{left:n[0],top:w?n[1]-5:n[1],...$}));T.push(h),p&&(y.includes("脉搏")?ie.add(p):ne.add(p),function(e){B.hovered&&(e.on("mouseover",(()=>{ce(e,"hover")})),e.on("mouseout",(()=>{A.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?K:J;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0,isFixed:l,moveHide:s=!1}=t||{};"reduce"!==n&&i&&("line"===n?i.setCoords().set({x1:e.left,y1:e.top}):(l||i.setCoords().set({left:e.left,top:e.top+o}),s&&(k.value.remove(i),delete e.otherObj.obj)))})),se(e)}(e),B.hovered&&ce(e)})),e.on("mouseup",(t=>{if(A.show=!1,1===t.button){const{type:t}=e.origin,i=C(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};k.value.discardActiveObject(),E("change",n),fe(n,"change")}}))}(p),R.push(p),oe.add(p))}(H,W,u,j,z,N)})),"pulse"===c){const e={};ee.forEach((t=>{e[t]=R.filter((e=>{var i;return(null==(i=e.origin)?void 0:i.key)===t}))}));let t=null;ee.forEach((i=>{te.set(i,e[i].map(((e,i,n)=>{var o,l;const s=n[i+1];if(s&&d(e.left,1)===d(s.left,1)){const i=e.left-D/2;e.set("left",i+D/4),null==(o=e.rightLine)||o.set("x1",e.left),t=e.left+D/2,s.set("left",t)}else t&&(null==(l=e.leftLine)||l.set("x2",t),e.set("left",t)),t=null;return[e.left,e.top]})))}))}Promise.all(R).then((e=>{const t=T.filter((e=>e));Promise.all(V).then((i=>{k.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&&k.value.remove(e.leftLine),e.rightLine&&k.value.remove(e.rightLine))}}(t,e)}))}))}))}function ue(e,t){return"pain"===e&&0==t}function ce(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;A.point={x:e.left,y:e.top},A.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:C(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||O(e.left)).slice(-5)}`],A.show=!0}function de(e,t){const i="pain"===t.type?K:J;if(!h(e)||!function(e){const[t]=z,i=z.at(-1),n=t.start,o=i.end,l=v(e);return l>=n&&l<=o}(e.time))return;const n=M(e.time),o=$(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}function pe(e){const t=new Date,i=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0"),o=v(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=v(`${O(e)}:00`);return N&&l<v(N)?(T("exceedMin"),!1):!(l>o)||(T("exceedMax"),!1)}function fe(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=le.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=g(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;he()}function he(){var e;oe.size&&(null==(e=k.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}([...oe]))),te.clear(),oe.clear(),ie.clear(),ne.clear(),le.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||ae(t,i,e)}))})),se(),re()}return te.clear(),ie.clear(),ne.clear(),le.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=$(e.type,e.list,e.positionLine.value),n=i([H,t,_,t],e.positionLine);k.value.add(n)}(e),e.dataList.forEach(((t,i)=>{!t.show||a(e.type)&&!t.enable||ae(t,i,e)}))})),se(),re(),k.value.on("mouse:up",(e=>{const{button:t,target:i,pointer:n={}}=e;if(3===t){if(!Y.event.evented)return;const{x:e=0,y:t=0}=n;if(e>=H&&e<=_&&t>=W&&t<=q){I.point={x:e,y:t},I.show=!0;const{type:o}=(null==i?void 0:i.origin)||{};if(i&&["temperature","pain"].includes(o))"temperature"===o&&(I.list=[...j]),"pain"===o&&(I.list=[...w]),I.target=i;else{I.target=null,I.list=["新增节点"],G.forEach((i=>{if(!R([...oe],e,"_type").includes(i.bigType)){const e=["pain"].includes(i.bigType)?K:J;t>=e.originY&&t<=e.endY&&I.list.push({renderItem:P?P(i):()=>i.title,origin:{title:i.title,unit:i.unit,type:u(i.bigType),dataIndex:i.dataIndex,key:i.key},pointer:n})}}));const i=pe(e);i&&1!==I.list.length||(I.show=!1,1===I.list.length&&i&&T("repeat"))}}}if(1===t){if(i)return;const{x:e=0,y:t=0}=n;e>=H&&e<=_&&t>0&&t<U&&E("click:grid",{x:e,y:t,time:O(e)})}})),{clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=y(i,[...j,...w]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};E("change",r),fe(r,"change")}else{const t={data:{time:O(e.pointer.x),value:C(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};E("add",t),fe(t)}},setPopup:ce,isAddPoint:pe,updateData:fe,redrawPoints:he,gridPoints:oe}}function S(e){return"fixed"===e.position}export{k as useCenter};
@@ -175,5 +175,5 @@ export declare type IPointMenuProps = Pick<IPointTipProps, 'show' | 'point'> & {
175
175
  target: any;
176
176
  };
177
177
  export declare type IFabricChartMainParam = [Ref<fabric.Canvas>, any, any, Ref<any>, IPointTipProps, IPointMenuProps];
178
- export declare type IPonter = [number, number];
178
+ export declare type IPointer = [number, number];
179
179
  export {};
@@ -1 +1 @@
1
- import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>p(t.time)>p(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function p(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function d(n,t){const e=[],[r,u]=n;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}function h(n){const{width:t,height:e,left:r,top:u}=n,o=t/2,i=e/2;return{minLeft:r-o,maxLeft:r+o,minTop:u-i,maxTop:u+i}}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,h as getPointRange,d as getScaleNumberList,p as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
1
+ import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>p(t.time)>p(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function p(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}function d(n,t){const e=[],[r,u]=n;t=t||1;for(let n=r;t>0?n<=u:n>=u;n+=t)e.push(n);return e}function h(n){const{width:t,height:e,left:r,top:u}=n,o=t/2,i=e/2;return{minLeft:r-o,maxLeft:r+o,minTop:u-i,maxTop:u+i}}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,h as getPointRange,d as getScaleNumberList,p as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
@@ -61,7 +61,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
61
61
  }[]>;
62
62
  onSave: () => void;
63
63
  setRef: (e: any, id: string) => void;
64
- getTableFields: (type?: "field" | "fieldColor" | "highlightRow" | undefined) => any;
64
+ getTableFields: (type?: "field" | "fieldColor" | "highlightRow" | "tableStyle" | undefined) => any;
65
65
  NTabs: any;
66
66
  NTabPane: import("vue").DefineComponent<{
67
67
  readonly tab: import("vue").PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
@@ -351,6 +351,7 @@ declare const _default: import("vue").DefineComponent<{
351
351
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
352
352
  TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
353
353
  CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
354
+ HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
354
355
  isFunction: (value: any) => value is (...args: any[]) => any;
355
356
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
356
357
  element: {
@@ -456,9 +457,9 @@ declare const _default: import("vue").DefineComponent<{
456
457
  requiredDisable: boolean;
457
458
  hide: boolean;
458
459
  }>;
459
- isHighlightRow: boolean;
460
460
  idx: number;
461
461
  isHighlight: boolean;
462
+ isHighlightRow: boolean;
462
463
  }>;
463
464
  EditDialog: import("vue").DefineComponent<{
464
465
  visible: {
@@ -469,6 +469,7 @@ declare const _default: import("vue").DefineComponent<{
469
469
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
470
470
  TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
471
471
  CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
472
+ HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
472
473
  isFunction: (value: any) => value is (...args: any[]) => any;
473
474
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
474
475
  element: {
@@ -574,9 +575,9 @@ declare const _default: import("vue").DefineComponent<{
574
575
  requiredDisable: boolean;
575
576
  hide: boolean;
576
577
  }>;
577
- isHighlightRow: boolean;
578
578
  idx: number;
579
579
  isHighlight: boolean;
580
+ isHighlightRow: boolean;
580
581
  }>;
581
582
  isArray: {
582
583
  (value?: any): value is any[];
@@ -59,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{
59
59
  }[]>;
60
60
  onSave: () => void;
61
61
  setRef: (e: any, id: string) => void;
62
- getTableFields: (type?: 'field' | 'fieldColor' | 'highlightRow') => any;
62
+ getTableFields: (type?: 'field' | 'fieldColor' | 'highlightRow' | 'tableStyle') => any;
63
63
  NTabs: any;
64
64
  NTabPane: import("vue").DefineComponent<{
65
65
  readonly tab: PropType<string | number | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
@@ -1 +1 @@
1
- import{defineComponent as e,provide as t,reactive as l,ref as i,computed as o,openBlock as a,createElementBlock as r,normalizeStyle as s,unref as d,createBlock as n,withCtx as f,Fragment as m,renderList as u,resolveDynamicComponent as h,mergeProps as p,createSlots as b,renderSlot as v,h as g}from"vue";import{useThemeVars as y,NTabs as c,NTabPane as F}from"naive-ui";import C from"./FieldSet.vue.js";import w from"./FieldColor.vue.js";import{InjectionFieldList as L,InjectionQueryWordbookData as T}from"./constants/index.js";var _=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function}},emits:["save"],setup(e,{expose:_,emit:$}){const k=e;t(L,k.fieldList),t(T,k.queryWordbookData);const x=l({}),R=i(y().value.primaryColor),j=o((()=>[{name:"field",tab:"字段设置",render:()=>g(C,{rowHeight:52})},{name:"fieldColor",tab:"字段颜色",render:()=>g(w,{isFieldColor:!0,defaultList:k.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>g(w,{isFieldColor:!1,defaultList:k.highlightRowColorList})}].filter((e=>k.showTabNames.includes(e.name)))));function A(){var e,t,l;$("save",{tableFields:null==(e=x.field)?void 0:e.getTableFields(),tableFieldColors:null==(t=x.fieldColor)?void 0:t.getTableFields(),tableHighlightRows:null==(l=x.highlightRow)?void 0:l.getTableFields()})}function S(e,t){x[t]=e}return _({getTableFields:function(e){var t;return null==(t=x[e||"field"])?void 0:t.getTableFields()}}),(e,t)=>(a(),r("div",{class:"c-field-set",style:s({"--row-height":"52px","--primary-color":R.value})},[d(j).length>1?(a(),n(d(c),{key:0,type:"line",naimated:""},{default:f((()=>[(a(!0),r(m,null,u(d(j),(t=>(a(),n(d(F),{key:t.name,name:t.name,tab:t.tab,"display-directive":"show"},{default:f((()=>[(a(),n(h(t.render()),p(e.$attrs,{ref_for:!0,ref:e=>S(e,t.name),onSave:A}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[v(e.$slots,l)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(a(),n(h(d(j)[0].render()),p({key:1},e.$attrs,{ref:e=>S(e,d(j)[0].name),onSave:A}),b({_:2},[u(e.$slots,((t,l)=>({name:l,fn:f((()=>[v(e.$slots,l)]))})))]),1040))],4))}});export{_ as default};
1
+ import{defineComponent as e,provide as l,reactive as t,ref as i,computed as o,openBlock as a,createElementBlock as r,normalizeStyle as s,unref as d,createBlock as n,withCtx as f,Fragment as m,renderList as u,resolveDynamicComponent as b,mergeProps as y,createSlots as h,renderSlot as p,h as v}from"vue";import{useThemeVars as g,NTabs as c,NTabPane as F}from"naive-ui";import C from"./FieldSet.vue.js";import w from"./FieldColor.vue.js";import T from"./TableStyle.vue.js";import{InjectionFieldList as L,InjectionQueryWordbookData as S}from"./constants/index.js";var _=e({__name:"Index",props:{showTabNames:{type:Array,default:()=>["field"]},fieldColorList:{type:Array,default:()=>[]},highlightRowColorList:{type:Array,default:()=>[]},fieldList:{type:Object},queryWordbookData:{type:Function}},emits:["save"],setup(e,{expose:_,emit:$}){const j=e;l(L,j.fieldList),l(S,j.queryWordbookData);const k=t({}),x=i(g().value.primaryColor),R=o((()=>[{name:"field",tab:"字段设置",render:()=>v(C,{rowHeight:52})},{name:"fieldColor",tab:"字段颜色",render:()=>v(w,{isFieldColor:!0,defaultList:j.fieldColorList})},{name:"highlightRow",tab:"高亮行",render:()=>v(w,{isFieldColor:!1,defaultList:j.highlightRowColorList})},{name:"tableStyle",tab:"表格样式",render:()=>v(T)}].filter((e=>j.showTabNames.includes(e.name)))));function A(){var e,l,t,i;$("save",{tableFields:null==(e=k.field)?void 0:e.getTableFields(),tableFieldColors:null==(l=k.fieldColor)?void 0:l.getTableFields(),tableHighlightRows:null==(t=k.highlightRow)?void 0:t.getTableFields(),tableStyle:null==(i=k.tableStyle)?void 0:i.getTableFields()})}function q(e,l){k[l]=e}return _({getTableFields:function(e){var l;return null==(l=k[e||"field"])?void 0:l.getTableFields()}}),(e,l)=>(a(),r("div",{class:"c-field-set",style:s({"--row-height":"52px","--primary-color":x.value})},[d(R).length>1?(a(),n(d(c),{key:0,type:"line",naimated:""},{default:f((()=>[(a(!0),r(m,null,u(d(R),(l=>(a(),n(d(F),{key:l.name,name:l.name,tab:l.tab,"display-directive":"show"},{default:f((()=>[(a(),n(b(l.render()),y(e.$attrs,{ref_for:!0,ref:e=>q(e,l.name),onSave:A}),h({_:2},[u(e.$slots,((l,t)=>({name:t,fn:f((()=>[p(e.$slots,t)]))})))]),1040))])),_:2},1032,["name","tab"])))),128))])),_:3})):(a(),n(b(d(R)[0].render()),y({key:1},e.$attrs,{ref:e=>q(e,d(R)[0].name),onSave:A}),h({_:2},[u(e.$slots,((l,t)=>({name:t,fn:f((()=>[p(e.$slots,t)]))})))]),1040))],4))}});export{_ as default};
@@ -0,0 +1,71 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ tableStyleConfig: {
4
+ type: PropType<Partial<{
5
+ stripe: boolean;
6
+ border: boolean;
7
+ }>>;
8
+ default: () => {
9
+ stripe: boolean;
10
+ border: boolean;
11
+ };
12
+ };
13
+ }, {
14
+ props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
15
+ tableStyleConfig: {
16
+ type: PropType<Partial<{
17
+ stripe: boolean;
18
+ border: boolean;
19
+ }>>;
20
+ default: () => {
21
+ stripe: boolean;
22
+ border: boolean;
23
+ };
24
+ };
25
+ }>> & {
26
+ onSave?: ((...args: any[]) => any) | undefined;
27
+ onClose?: ((...args: any[]) => any) | undefined;
28
+ }>>;
29
+ tableDemoList: import("vue").Ref<{
30
+ title: string;
31
+ label: string;
32
+ border: boolean;
33
+ }[]>;
34
+ tableStyle: {
35
+ stripe?: boolean | undefined;
36
+ border?: boolean | undefined;
37
+ };
38
+ emit: (event: "close" | "save", ...args: any[]) => void;
39
+ getTableStyle: (border: boolean) => string;
40
+ toggle: (border: boolean) => void;
41
+ onCancle: () => void;
42
+ onSave: () => void;
43
+ getTableFields: () => {
44
+ stripe?: boolean | undefined;
45
+ border?: boolean | undefined;
46
+ };
47
+ NSwitch: any;
48
+ NIcon: any;
49
+ NButton: any;
50
+ CheckmarkCircle: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
51
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save")[], "close" | "save", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
52
+ tableStyleConfig: {
53
+ type: PropType<Partial<{
54
+ stripe: boolean;
55
+ border: boolean;
56
+ }>>;
57
+ default: () => {
58
+ stripe: boolean;
59
+ border: boolean;
60
+ };
61
+ };
62
+ }>> & {
63
+ onSave?: ((...args: any[]) => any) | undefined;
64
+ onClose?: ((...args: any[]) => any) | undefined;
65
+ }, {
66
+ tableStyleConfig: Partial<{
67
+ stripe: boolean;
68
+ border: boolean;
69
+ }>;
70
+ }>;
71
+ export default _default;
@@ -0,0 +1 @@
1
+ import e from"./TableStyle.vue2.js";import l from"../../../_virtual/_plugin-vue_export-helper.js";var r=l(e,[["__file","TableStyle.vue"]]);export{r as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as e,ref as t,reactive as r,watch as l,openBlock as s,createElementBlock as a,createElementVNode as i,createVNode as o,unref as n,Fragment as d,renderList as p,toDisplayString as b,normalizeClass as m,withDirectives as c,vShow as u,withCtx as v,createTextVNode as f}from"vue";import{NSwitch as g,NIcon as y,NButton as _}from"naive-ui";import{CheckmarkCircle as C}from"@vicons/ionicons5";import h from"../../../shared/assets/img/table_style_1.png.js";import S from"../../../shared/assets/img/table_style_2.png.js";import j from"../../../shared/assets/img/table_style_3.png.js";import k from"../../../shared/assets/img/table_style_4.png.js";const x={class:"main-wrapper"},w={class:"set-item"},z=i("span",{style:{"margin-right":"20px"}},"开启斑马线",-1),T={class:"set-item table-item"},F=["onClickCapture"],O={class:"table-bg"},U=["src"],q={class:"table-style__desc"},A={class:"circle"},B={class:"main-wrapper__table-footer"};var D=e({__name:"TableStyle",props:{tableStyleConfig:{type:Object,default:()=>({stripe:!1,border:!0})}},emits:["save","close"],setup(e,{expose:D,emit:E}){var G,H;const I=e,J=t([{title:"样式一",label:"无列分割线",border:!(null==(G=I.tableStyleConfig)?void 0:G.border)},{title:"样式二",label:"列分割线",border:!!(null==(H=I.tableStyleConfig)?void 0:H.border)}]),K=r(I.tableStyleConfig);function L(){E("close")}function M(){E("save")}return l((()=>I.tableStyleConfig),(e=>{const{stripe:t=!1,border:r=!0}=e;K.stripe=t,K.border=r}),{immediate:!0,deep:!0}),D({getTableFields:function(){return K}}),(e,t)=>(s(),a("div",x,[i("div",w,[z,o(n(g),{value:K.stripe,"onUpdate:value":t[0]||(t[0]=e=>K.stripe=e),size:"small"},null,8,["value"])]),i("div",T,[(s(!0),a(d,null,p(J.value,((e,t)=>{return s(),a(d,{key:t},[i("h4",null,b(e.title),1),i("div",{class:m(["table-style",{active:e.border===K.border}]),onClickCapture:()=>{return t=e.border,void(K.border=t);var t}},[i("div",O,[i("img",{src:(r=e.border,K.stripe?r?h:j:r?S:k),alt:""},null,8,U)]),i("div",q,[c(o(n(y),{size:20,component:n(C)},null,8,["component"]),[[u,e.border===K.border]]),c(i("i",A,null,512),[[u,e.border!==K.border]]),i("span",null,b(e.label),1)])],42,F)],64);var r})),128))]),i("div",B,[o(n(_),{style:{"margin-right":"8px"},onClick:L},{default:v((()=>[f("取消")])),_:1}),o(n(_),{type:"primary",onClick:M},{default:v((()=>[f("保存")])),_:1})])]))}});export{D as default};
@@ -176,6 +176,7 @@ declare const _default: import("vue").DefineComponent<{
176
176
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
177
177
  TrashOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
178
178
  CreateOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
179
+ HelpCircleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
179
180
  isFunction: (value: any) => value is (...args: any[]) => any;
180
181
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("edit" | "updateChecked")[], "edit" | "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
181
182
  element: {
@@ -281,8 +282,8 @@ declare const _default: import("vue").DefineComponent<{
281
282
  requiredDisable: boolean;
282
283
  hide: boolean;
283
284
  }>;
284
- isHighlightRow: boolean;
285
285
  idx: number;
286
286
  isHighlight: boolean;
287
+ isHighlightRow: boolean;
287
288
  }>;
288
289
  export default _default;
@@ -1 +1 @@
1
- import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as a,unref as o,createBlock as r,withCtx as d,createVNode as u,createCommentVNode as c,createElementVNode as s,normalizeClass as f,toDisplayString as m,withDirectives as p,vShow as v,resolveDynamicComponent as y,createTextVNode as h}from"vue";import{NTooltip as g,NIcon as b,NCheckbox as k,NSelect as x,NColorPicker as w,NInput as N,NInputNumber as U,NPopconfirm as S}from"naive-ui";import{setStyle as _,setColorInfo as C,isDisable as H}from"../utils/index.js";import{ReorderTwoOutline as E,CreateOutline as O,TrashOutline as P}from"@vicons/ionicons5";import{isFunction as R,range as j}from"lodash-es";import{COLOR_MAP as D}from"../constants/index.js";const M={class:"row"},A=["title"],F=s("span",null,"拖拽调整顺序",-1);var B=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1}},emits:["updateChecked","edit"],setup(e,{emit:B}){const T=e,V=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],W=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],q=[{label:"字体",value:"font"},{label:"背景",value:"background"}],G=Object.entries(D).map((([e])=>e));function I(){T.data.splice(T.index,1)}function L(){B("edit",T.element)}function z(e){switch(e.field){case"fixedWay":return V;case"sortDirection":return W;case"sortPriority":return function(){const e=j(1,T.data.length+1).map((e=>({label:e.toString(),value:e}))),l=T.data.filter((e=>!!e.sortPriority&&e.uuid!==T.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();case"colorScope":return q;default:return[]}}function J(e){var l;if(1==T.element.defaultMark||"color"===e.type&&T.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!T.element[e.field]&&(null==(l=T.data.filter((l=>l[e.field])))?void 0:l.length)===e.fieldShowMaxValue:H(T.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:t}=T.element;return!t||"NONE"===t}function K(e){return["title","result"].includes(e.field)&&T.element.style||{}}return(H,j)=>(l(),t("div",M,[(l(!0),t(i,null,n(e.columns,((n,H)=>{return l(),t(i,{key:H},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:a(o(_)(n,H))},["text"===n.type?(l(),t(i,{key:0},[0===H?(l(),r(o(g),{key:0,trigger:"hover"},{trigger:d((()=>[u(o(b),{style:{"margin-right":"5px",top:"2px"},component:o(E)},null,8,["component"])])),default:d((()=>[F])),_:1})):c("v-if",!0),s("span",{class:f([e.isHighlight&&"title"===n.field?"highlight":""]),style:a(K(n))},m("seq"===n.field?e.idx:e.element[n.field]),7)],64)):c("v-if",!0),"checkbox"===n.type?p((l(),r(o(k),{key:1,disabled:J(n),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){B("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,(D=e.element,M=n.field,"isShowHeaderFilter"===M?D.isConfiguredHeaderFilter&&"0001"!=T.element.id:"0001"!=T.element.id)]]):c("v-if",!0),"select"===n.type?p((l(),r(o(x),{key:2,clearable:"",disabled:J(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(T.element.sortPriority=null),"colorScope"===l.field&&C(T.element)}(e,n)],options:z(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):c("v-if",!0),"color"===n.type?(l(),r(o(w),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:J(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,j[0]||(j[0]=l=>o(C)(e.element))],"show-preview":"",modes:["hex"],swatches:o(G)},null,8,["disabled","value","onUpdate:value","swatches"])):c("v-if",!0),"input"===n.type?p((l(),r(o(N),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):c("v-if",!0),"inputNumber"===n.type?(l(),r(o(U),{key:5,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):c("v-if",!0),"custom"===n.type&&o(R)(n.contentRender)?(l(),r(y((()=>n.contentRender(n,e.element))),{key:6})):c("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(l(),t(i,{key:7},[u(o(g),{trigger:"hover"},{trigger:d((()=>[u(o(b),{component:o(O),onClick:L},null,8,["component"])])),default:d((()=>[h(" 编辑 ")])),_:1}),u(o(S),{onPositiveClick:I},{trigger:d((()=>[u(o(g),{trigger:"hover"},{trigger:d((()=>[u(o(b),{component:o(P)},null,8,["component"])])),default:d((()=>[h(" 删除 ")])),_:1})])),default:d((()=>[h(" 是否确认删除? ")])),_:1})],64)):c("v-if",!0)],12,A)):c("v-if",!0)],64);var D,M})),128))]))}});export{B as default};
1
+ import{defineComponent as e,openBlock as l,createElementBlock as t,Fragment as i,renderList as n,normalizeStyle as o,unref as a,createVNode as r,withCtx as d,createBlock as u,createElementVNode as c,toDisplayString as s,createCommentVNode as f,normalizeClass as p,withDirectives as m,vShow as v,resolveDynamicComponent as y,createTextVNode as h}from"vue";import{NTooltip as g,NIcon as b,NCheckbox as k,NSelect as x,NColorPicker as w,NInput as N,NInputNumber as U,NPopconfirm as S}from"naive-ui";import{setStyle as _,setColorInfo as C,isDisable as H}from"../utils/index.js";import{ReorderTwoOutline as D,HelpCircleOutline as E,CreateOutline as O,TrashOutline as P}from"@vicons/ionicons5";import{isFunction as R,range as j}from"lodash-es";import{COLOR_MAP as M}from"../constants/index.js";const A={class:"row"},F=["title"],B=c("span",null,"拖拽调整顺序",-1);var T=e({__name:"Row",props:{element:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},idx:{type:Number,default:1},data:{type:Array,default:()=>[]},isHighlight:{type:Boolean},index:{type:Number,default:0},isHighlightRow:{type:Boolean,default:!1}},emits:["updateChecked","edit"],setup(e,{emit:T}){const V=e,W=[{label:"不固定",value:"NONE"},{label:"左固定",value:"LEFT"},{label:"右固定",value:"RIGHT"}],q=[{label:"不排序",value:"NONE"},{label:"升序",value:"ASC"},{label:"降序",value:"DESC"}],G=[{label:"字体",value:"font"},{label:"背景",value:"background"}],I=Object.entries(M).map((([e])=>e));function L(){V.data.splice(V.index,1)}function z(){T("edit",V.element)}function J(e){switch(e.field){case"fixedWay":return W;case"sortDirection":return q;case"sortPriority":return function(){const e=j(1,V.data.length+1).map((e=>({label:e.toString(),value:e}))),l=V.data.filter((e=>!!e.sortPriority&&e.uuid!==V.element.uuid)).map((e=>e.sortPriority));return e.filter((e=>!l.includes(e.value)))}();case"colorScope":return G;default:return[]}}function K(e){var l;if(1==V.element.defaultMark||"color"===e.type&&V.isHighlightRow)return!0;if("checkbox"===e.type)return"show"===e.field&&e.fieldShowMaxValue?!V.element[e.field]&&(null==(l=V.data.filter((l=>l[e.field])))?void 0:l.length)===e.fieldShowMaxValue:H(V.element,e.field);if("sortPriority"!==e.field)return!1;const{sortDirection:t}=V.element;return!t||"NONE"===t}function Q(e){return["title","result"].includes(e.field)&&V.element.style||{}}return(H,j)=>(l(),t("div",A,[(l(!0),t(i,null,n(e.columns,((n,H)=>{return l(),t(i,{key:H},[n.isShow?(l(),t("span",{key:0,class:"table-cell",title:e.element[n.field],style:o(a(_)(n,H))},["text"===n.type?(l(),t(i,{key:0},[0===H?(l(),t(i,{key:0},[r(a(g),{trigger:"hover"},{trigger:d((()=>[r(a(b),{style:{"margin-right":"5px",top:"2px"},component:a(D)},null,8,["component"])])),default:d((()=>[B])),_:1}),"title"===n.field&&e.element.feildDescribe?(l(),u(a(g),{key:0,trigger:"hover"},{trigger:d((()=>[r(a(b),{style:{"margin-right":"5px",top:"2px"},component:a(E)},null,8,["component"])])),default:d((()=>[c("span",null,s(e.element.feildDescribe),1)])),_:1})):f("v-if",!0)],64)):f("v-if",!0),c("span",{class:p([e.isHighlight&&"title"===n.field?"highlight":""]),style:o(Q(n))},s("seq"===n.field?e.idx:e.element[n.field]),7)],64)):f("v-if",!0),"checkbox"===n.type?m((l(),u(a(k),{key:1,disabled:K(n),checked:e.element[n.field],"onUpdate:checked":[l=>e.element[n.field]=l,e=>function(e,l){T("updateChecked",{checked:e,column:l})}(e,n)]},null,8,["disabled","checked","onUpdate:checked"])),[[v,(M=e.element,A=n.field,"isShowHeaderFilter"===A?M.isConfiguredHeaderFilter&&"0001"!=V.element.id:"0001"!=V.element.id)]]):f("v-if",!0),"select"===n.type?m((l(),u(a(x),{key:2,clearable:"",disabled:K(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,e=>function(e,l){"sortDirection"===l.field&&"NONE"===e&&(V.element.sortPriority=null),"colorScope"===l.field&&C(V.element)}(e,n)],options:J(n)},null,8,["disabled","value","onUpdate:value","options"])),[[v,"fixedWay"===n.field||"0001"!=e.element.id]]):f("v-if",!0),"color"===n.type?(l(),u(a(w),{key:3,class:"c-field-set__color-picker",clearable:"",disabled:K(n),value:e.element[n.field],"onUpdate:value":[l=>e.element[n.field]=l,j[0]||(j[0]=l=>a(C)(e.element))],"show-preview":"",modes:["hex"],swatches:a(I)},null,8,["disabled","value","onUpdate:value","swatches"])):f("v-if",!0),"input"===n.type?m((l(),u(a(N),{key:4,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l,clearable:""},null,8,["value","onUpdate:value"])),[[v,"0001"!=e.element.id]]):f("v-if",!0),"inputNumber"===n.type?(l(),u(a(U),{key:5,value:e.element[n.field],"onUpdate:value":l=>e.element[n.field]=l},null,8,["value","onUpdate:value"])):f("v-if",!0),"custom"===n.type&&a(R)(n.contentRender)?(l(),u(y((()=>n.contentRender(n,e.element))),{key:6})):f("v-if",!0),"custom"===n.type&&"opt"===n.field&&1!=e.element.defaultMark?(l(),t(i,{key:7},[r(a(g),{trigger:"hover"},{trigger:d((()=>[r(a(b),{component:a(O),onClick:z},null,8,["component"])])),default:d((()=>[h(" 编辑 ")])),_:1}),r(a(S),{onPositiveClick:L},{trigger:d((()=>[r(a(g),{trigger:"hover"},{trigger:d((()=>[r(a(b),{component:a(P)},null,8,["component"])])),default:d((()=>[h(" 删除 ")])),_:1})])),default:d((()=>[h(" 是否确认删除? ")])),_:1})],64)):f("v-if",!0)],12,F)):f("v-if",!0)],64);var M,A})),128))]))}});export{T as default};
@@ -30,7 +30,7 @@ export declare type FieldSetColumnItem = {
30
30
  contentRender?: (column: AnyObject, row: AnyObject) => VNode | String;
31
31
  [key: string]: any;
32
32
  };
33
- export declare type FieldSetTab = 'field' | 'fieldColor' | 'highlightRow';
33
+ export declare type FieldSetTab = 'field' | 'fieldColor' | 'highlightRow' | 'tableStyle';
34
34
  export declare type ColorSetItem = {
35
35
  name: string;
36
36
  columnName?: string;
@@ -1 +1 @@
1
- .c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .main-wrapper{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set .main-wrapper__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .main-wrapper .item{background:#fff}.c-field-set .main-wrapper .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .main-wrapper .item:focus{background-color:#f2f2f2}.c-field-set .main-wrapper .item.disabled{cursor:not-allowed}.c-field-set .main-wrapper .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:5px 0}.c-field-set .main-wrapper .table-cell{box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .main-wrapper .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set .main-wrapper .table-cell .c-field-set__color-picker{display:block}.c-field-set .main-wrapper__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;height:52px}.c-field-set .main-wrapper__table-header .n-checkbox.n-checkbox--disabled .n-checkbox__label{color:var(--n-text-color)}.c-field-set .main-wrapper__table-body{flex:1;overflow-y:auto}.c-field-set .main-wrapper__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}.c-field-set__color-block{display:inline-block;margin-left:20px;position:relative}.c-field-set__color-block:before{background-color:var(--color);border-radius:2px;content:"";height:14px;left:-20px;position:absolute;top:3px;width:14px}.c-field-set__space{width:100%}.c-field-set__space>div:first-child{width:80%}.c-field-set__space .filter-btn{color:var(--c-primary-color);cursor:pointer}.c-field-set__condition .opt-btn{cursor:pointer;display:inline-flex}.c-field-set__condition .condition-wrapper__item{align-items:center;display:flex;margin-top:10px}.c-field-set__condition .condition-wrapper__item .item-index{margin-right:10px}.c-field-set__condition .condition-wrapper__item>.n-date-picker,.c-field-set__condition .condition-wrapper__item>.n-input,.c-field-set__condition .condition-wrapper__item>.n-input-number,.c-field-set__condition .condition-wrapper__item>.n-select{margin-right:10px;width:20%}.c-field-set__condition .sql-expression-wrapper{margin-top:10px}
1
+ .c-field-set{height:100%;width:100%}.c-field-set__color-picker .n-color-picker-trigger__value{display:none}.c-field-set .main-wrapper{display:flex;flex-flow:column nowrap;height:100%;width:100%}.c-field-set .main-wrapper__search-wrapper.n-input{margin-bottom:12px;width:50%}.c-field-set .main-wrapper .item{background:#fff}.c-field-set .main-wrapper .item:active{background:#f2f2f2;box-shadow:0 0 10px 0 #d5d5d5}.c-field-set .main-wrapper .item:focus{background-color:#f2f2f2}.c-field-set .main-wrapper .item.disabled{cursor:not-allowed}.c-field-set .main-wrapper .item .row{align-items:center;border-bottom:1px solid #e8e8e8;display:flex;height:var(--row-height);padding:5px 0}.c-field-set .main-wrapper .table-cell{box-sizing:border-box;color:inherit;display:inline-block;padding:0 5px}.c-field-set .main-wrapper .table-cell .highlight{background-color:var(--primary-color);color:#fff}.c-field-set .main-wrapper .table-cell .c-field-set__color-picker{display:block}.c-field-set .main-wrapper__table-header{align-items:center;background:#f2f2f4;border:1px solid #f2f2f2;display:flex;height:52px}.c-field-set .main-wrapper__table-header .n-checkbox.n-checkbox--disabled .n-checkbox__label{color:var(--n-text-color)}.c-field-set .main-wrapper__table-body{flex:1;overflow-y:auto}.c-field-set .main-wrapper__table-footer{border-top:1px solid #d5d5d5;padding:12px 0}.c-field-set .main-wrapper .set-item{padding:10px 0}.c-field-set .main-wrapper .set-item.table-item{border-top:1px solid #e8e8e8;width:50%}.c-field-set .main-wrapper .set-item.table-item h4{font-size:16px;font-weight:400;margin-bottom:12px}.c-field-set .main-wrapper .set-item.table-item .table-style{background:#e5e5e5;border:2px solid #cfcfcf;border-radius:4px;cursor:pointer;margin-bottom:10px;padding:20px 0 0}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg{background:#fff;border-radius:5px;margin:0 20px 20px;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style .table-bg img{width:100%}.c-field-set .main-wrapper .set-item.table-item .table-style__desc{align-items:center;background:#fff;display:flex;padding:10px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .n-icon{color:var(--c-primary-color);font-size:20px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc .circle{border:1px solid #d5d5d5;border-radius:50%;display:inline-block;height:18px;width:18px}.c-field-set .main-wrapper .set-item.table-item .table-style__desc span{margin-left:5px}.c-field-set .main-wrapper .set-item.table-item .table-style.active{background:#e2ebfa;border:2px solid var(--c-primary-color)}.c-field-set__color-block{display:inline-block;margin-left:20px;position:relative}.c-field-set__color-block:before{background-color:var(--color);border-radius:2px;content:"";height:14px;left:-20px;position:absolute;top:3px;width:14px}.c-field-set__space{width:100%}.c-field-set__space>div:first-child{width:80%}.c-field-set__space .filter-btn{color:var(--c-primary-color);cursor:pointer}.c-field-set__condition .opt-btn{cursor:pointer;display:inline-flex}.c-field-set__condition .condition-wrapper__item{align-items:center;display:flex;margin-top:10px}.c-field-set__condition .condition-wrapper__item .item-index{margin-right:10px}.c-field-set__condition .condition-wrapper__item>.n-date-picker,.c-field-set__condition .condition-wrapper__item>.n-input,.c-field-set__condition .condition-wrapper__item>.n-input-number,.c-field-set__condition .condition-wrapper__item>.n-select{margin-right:10px;width:20%}.c-field-set__condition .sql-expression-wrapper{margin-top:10px}