cnhis-design-vue 3.1.54 → 3.1.55-beta.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 (135) hide show
  1. package/README.md +87 -87
  2. package/es/components/body-select/src/hooks/renderCanvas.js +1 -1
  3. package/es/components/body-select/src/index.vue2.js +1 -1
  4. package/es/components/button-print/index.d.ts +13 -0
  5. package/es/components/button-print/src/ButtonPrint.vue.d.ts +13 -0
  6. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  7. package/es/components/callback/src/components/render/popupMaps.d.ts +13 -6
  8. package/es/components/chat-sdk/index.d.ts +2 -0
  9. package/es/components/chat-sdk/index.js +1 -0
  10. package/es/components/chat-sdk/src/chatSDK.d.ts +24 -0
  11. package/es/components/chat-sdk/src/chatSDK.js +1 -0
  12. package/es/components/chat-sdk/src/components/recordingDialog.vue.d.ts +26 -0
  13. package/es/components/chat-sdk/src/components/recordingDialog.vue.js +1 -0
  14. package/es/components/chat-sdk/src/components/recordingDialog.vue2.js +1 -0
  15. package/es/components/chat-sdk/src/utils/recordingDialog.d.ts +8 -0
  16. package/es/components/chat-sdk/src/utils/recordingDialog.js +1 -0
  17. package/es/components/chat-sdk/style/index.css +1 -0
  18. package/es/components/classification/index.d.ts +486 -1
  19. package/es/components/classification/src/components/search-filter/index.vue.d.ts +473 -1
  20. package/es/components/classification/src/components/search-filter/index.vue2.js +1 -1
  21. package/es/components/classification/src/components/set-classification/index.vue.d.ts +473 -1
  22. package/es/components/classification/src/index.vue.d.ts +486 -1
  23. package/es/components/classification/src/index.vue2.js +1 -1
  24. package/es/components/classification/style/index.css +1 -1
  25. package/es/components/expand-field/src/components/form.vue2.js +1 -1
  26. package/es/components/fabric-chart/index.d.ts +1 -0
  27. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +1 -0
  28. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  29. package/es/components/fabric-chart/src/constants/index.d.ts +1 -0
  30. package/es/components/fabric-chart/src/constants/index.js +1 -1
  31. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
  32. package/es/components/fabric-chart/src/hooks/electrocardiogram/hooks/useDetailEvent.js +1 -1
  33. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogram.js +1 -1
  34. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.d.ts +5 -0
  35. package/es/components/fabric-chart/src/hooks/electrocardiogram/useElectrocardiogramChart.js +1 -1
  36. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  37. package/es/components/fabric-chart/src/hooks/temperature/useCenter.d.ts +1 -1
  38. package/es/components/fabric-chart/src/hooks/temperature/useLeft.d.ts +1 -1
  39. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
  40. package/es/components/fabric-chart/src/hooks/useCumputedPoint.d.ts +3 -3
  41. package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
  42. package/es/components/form-config/index.d.ts +71 -57
  43. package/es/components/form-config/src/FormConfig.vue.d.ts +71 -57
  44. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +13 -6
  45. package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +28 -21
  46. package/es/components/form-config/src/components/FormConfigEventSetting.vue.d.ts +5 -5
  47. package/es/components/form-render/index.d.ts +13 -6
  48. package/es/components/form-render/index.js +1 -1
  49. package/es/components/form-render/src/FormRender.vue.d.ts +13 -6
  50. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  51. package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +13 -6
  52. package/es/components/form-render/src/components/renderer/formItem.js +1 -1
  53. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  54. package/es/components/form-render/src/components/renderer/select.js +1 -1
  55. package/es/components/form-render/src/hooks/index.d.ts +20 -9
  56. package/es/components/form-render/src/hooks/index.js +1 -1
  57. package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +1 -1
  58. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  59. package/es/components/form-render/src/hooks/useFieldVisitor.js +1 -1
  60. package/es/components/form-render/src/hooks/useFormEvent.d.ts +14 -3
  61. package/es/components/form-render/src/hooks/useFormEvent.js +1 -1
  62. package/es/components/form-render/src/hooks/useFormItemDeps.d.ts +1 -1
  63. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  64. package/es/components/form-render/src/hooks/useOperationalForm.d.ts +3 -2
  65. package/es/components/form-render/src/hooks/useOperationalForm.js +1 -1
  66. package/es/components/form-render/src/hooks/useWordbookSetting.d.ts +13 -4
  67. package/es/components/form-render/src/hooks/useWordbookSetting.js +1 -1
  68. package/es/components/form-render/src/types/index.d.ts +10 -5
  69. package/es/components/iho-table/src/plugins/bindEventSettingPlugin/index.js +1 -1
  70. package/es/components/iho-table/src/plugins/operationalFormPlugin/index.js +1 -1
  71. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  72. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue.d.ts +7 -3
  73. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.js +1 -1
  74. package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
  75. package/es/components/index.css +1 -1
  76. package/es/components/index.d.ts +1 -0
  77. package/es/components/index.js +1 -1
  78. package/es/components/info-header/index.d.ts +26 -12
  79. package/es/components/info-header/src/InfoHeader.vue.d.ts +26 -12
  80. package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +13 -6
  81. package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +13 -6
  82. package/es/components/quick-search/style/index.css +1 -1
  83. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  84. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  85. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  86. package/es/components/shortcut-setter/index.d.ts +18 -11
  87. package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +18 -11
  88. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  89. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.d.ts +320 -0
  90. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue.js +1 -0
  91. package/es/components/table-filter/src/components/bi-filter/ValueCfg.vue2.js +1 -0
  92. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.d.ts +127 -0
  93. package/es/components/table-filter/src/components/bi-filter/components/Date.vue.js +1 -0
  94. package/es/components/table-filter/src/components/bi-filter/components/Date.vue2.js +1 -0
  95. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.d.ts +41 -0
  96. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue.js +1 -0
  97. package/es/components/table-filter/src/components/bi-filter/components/InputFilter.vue2.js +1 -0
  98. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.d.ts +28 -0
  99. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue.js +1 -0
  100. package/es/components/table-filter/src/components/bi-filter/components/InputNumber.vue2.js +1 -0
  101. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.d.ts +51 -0
  102. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue.js +1 -0
  103. package/es/components/table-filter/src/components/bi-filter/components/SelectFilter.vue2.js +1 -0
  104. package/es/components/table-filter/src/components/bi-filter/components/index.d.ts +244 -0
  105. package/es/components/table-filter/src/components/bi-filter/components/index.js +1 -0
  106. package/es/components/table-filter/src/components/bi-filter/helpers/options.d.ts +14 -0
  107. package/es/components/table-filter/src/components/bi-filter/helpers/options.js +1 -0
  108. package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.d.ts +13 -0
  109. package/es/components/table-filter/src/components/bi-filter/hooks/useBiConditions.js +1 -0
  110. package/es/components/table-filter/src/components/bi-filter/index.vue.d.ts +474 -0
  111. package/es/components/table-filter/src/components/bi-filter/index.vue.js +1 -0
  112. package/es/components/table-filter/src/components/bi-filter/index.vue2.js +1 -0
  113. package/es/components/table-filter/src/constants/index.d.ts +1 -0
  114. package/es/components/table-filter/src/constants/index.js +1 -1
  115. package/es/env.d.ts +25 -25
  116. package/es/shared/assets/img/failure.png.js +1 -1
  117. package/es/shared/assets/img/no-permission.png.js +1 -1
  118. package/es/shared/assets/img/nodata.png.js +1 -1
  119. package/es/shared/assets/img/notfound.png.js +1 -1
  120. package/es/shared/assets/img/qr.png.js +1 -1
  121. package/es/shared/assets/img/success.png.js +1 -1
  122. package/es/shared/assets/img/video.png.js +1 -1
  123. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  124. package/es/shared/assets/img/xb_big.png.js +1 -1
  125. package/es/shared/assets/img/xb_small.png.js +1 -1
  126. package/es/shared/package.json.js +1 -1
  127. package/es/shared/utils/business.js +1 -1
  128. package/package.json +3 -2
  129. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  130. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  131. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  132. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  133. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  134. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  135. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -1 +1 @@
1
- @font-face{font-family:classification-iconfont;src:url(classification-iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:classification-iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter{cursor:pointer;font-size:18px}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter:last-child{margin-left:16px}.classification-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.classification-modal-block .n-card__content{overflow-y:auto}.classification-modal-block .n-card__content .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-title .list-title-item{font-weight:700;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content{padding:0}.classification-modal-block .n-card__content .table-modal-list .list-content li{display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item{align-items:center;display:flex;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item .n-icon{cursor:pointer;margin-right:8px}.classification-modal-block .n-card__content .table-modal-list .list-content li.checked,.classification-modal-block .n-card__content .table-modal-list .list-content li.checked .text{background-color:#f2f2f2}.classification-modal-block .n-card__content .table-modal-list .list-content li .text{background-color:#fff;display:inline-block;padding:0 10px;position:relative}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line{position:relative;text-align:center;width:75%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line:before{border:1px solid #e8e8e8;content:"";left:0;margin-top:20px;position:absolute;width:100%}.classification-modal-block .n-card__content .table-modal-list .list-title-item{margin-left:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item{border-bottom:1px solid #e1dfdf;margin-left:-1px;margin-top:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch{height:16px;min-width:28px;width:28px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch:after{height:12px;width:12px}.classification-modal-block .n-card__content .table-modal-list .list-content-radio,.classification-modal-block .n-card__content .table-modal-list .list-content-switch{text-align:center}.classification-modal-block .n-card__content .table-modal-list .anticon+.anticon{margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .item-name{display:flex;height:32px;line-height:32px;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .item-name .label{text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .item-name .addAction{align-items:center;cursor:pointer;display:flex}.classification-modal-block .n-card__content .class-filter-content .item-name .blue{color:#2d7aff;margin-right:8px}.classification-modal-block .n-card__content .class-filter-content .n-form-item-label{width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content{align-items:center;display:flex;flex-wrap:wrap;line-height:32px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .label{display:inline-block;height:32px;line-height:32px;margin-bottom:10px;text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn-dashed{border-color:#a6a6a6;color:#a6a6a6}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .parent-name{align-items:center;display:flex}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .parent-input{margin-bottom:10px;margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag{align-items:center;background-color:rgba(45,122,255,.1);border:1px solid #2d7aff;border-radius:3px;box-sizing:border-box;color:#2d7aff;display:flex;justify-content:center;margin-bottom:10px;margin-right:10px;max-width:120px;padding:0 10px;position:relative}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .anticon-close{color:#2d7aff;cursor:pointer;display:flex;justify-content:center;line-height:1;width:18px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select,.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .ant-input-disabled{background-color:#2d7aff;color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .anticon-close{color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn{margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list{border-top:1px solid #e6e6e6;margin-bottom:6px;margin-top:16px;padding-top:12px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li{align-items:center;display:flex;list-style:none;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .index-span{display:inline-block;width:30px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item{margin-right:10px;width:120px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item.n-date-picker{width:auto}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper{display:flex}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper .form-item{margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .delete-item-icon{color:red;cursor:pointer;font-size:18px;margin-left:8px}.classification-modal-block .n-card__footer{padding-top:10px}.classification-modal-block .n-card__footer .flex_between{display:flex;justify-content:space-between}.classification-modal-block .n-card__footer .flex_right{display:flex;justify-content:right}.classification-modal-block .n-card__footer .n-button{margin-left:8px}.classification-block .tree-type{border:1px solid #d5d5d5;border-radius:4px;height:100%;line-height:32px;margin-top:0;padding-bottom:80px;width:150px}.classification-block .tree-type .header{border-bottom:1px solid #e6eaef;display:flex;font-size:14px;justify-content:space-between;padding:0 10px}.classification-block .tree-type .header .header-1{align-items:center;cursor:pointer;display:flex}.classification-block .tree-type .tree{height:calc(100% - 32px);line-height:32px;margin:0;overflow:auto;padding-left:0}.classification-block .tree-type .tree::-webkit-scrollbar{width:5px}.classification-block .tree-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer}.classification-block .tree-type .tree .tree-item.tree-header{box-sizing:border-box;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .tree-type .tree .tree-item .header-item{box-sizing:border-box;line-height:1.4}.classification-block .tree-type .tree .tree-item .header-item.selected,.classification-block .tree-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children{align-items:center;display:flex;height:32px;padding-left:23px;padding-right:10px}.classification-block .tree-type .tree .tree-item .children .child-item{align-items:center;border-bottom:1px solid transparent;color:#7c7c7c;display:flex;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .tree-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-content{align-items:center;display:flex}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item .digital-span{flex:1;margin-left:5px;text-align:left}.classification-block .tree-type .tree .tree-item:last-child{border-bottom:none}.classification-block .tree-type .tree-type-footer{border-top:1px solid #d5d5d5;bottom:0;height:80px;line-height:20px;padding-left:16px;position:absolute;width:100%}.classification-block .tree-type .tree-type-footer .selected-num{margin:10px}.classification-block .tree-type .tree-type-footer .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;justify-content:center;margin-left:0}.classification-block .tile-type{border:1px solid #d5d5d5;border-radius:4px;margin-bottom:8px;padding:0 17px}.classification-block .tile-type .header{align-items:center;border-bottom:1px solid #d5d5d5;display:inline-flex;justify-content:space-between;line-height:44px;width:100%}.classification-block .tile-type .header .all-data{border-bottom:1px solid transparent;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:500;line-height:1.4;margin-right:auto}.classification-block .tile-type .header .all-data:hover{color:#2d7aff}.classification-block .tile-type .header .all-data:active{border-color:transparent;color:#000}.classification-block .tile-type .header .selected{color:#2d7aff}.classification-block .tile-type .header .right-setting{display:flex}.classification-block .tile-type .header .right-setting .setting-1{align-items:center;cursor:pointer;display:flex}.classification-block .tile-type .header .right-setting .setting-1 .n-icon{margin-right:6px}.classification-block .tile-type .header .right-setting .upack-up-btn{color:#2d7aff}.classification-block .tile-type .tile{border-bottom:1px solid #d5d5d5;margin:0;padding:9px 0}.classification-block .tile-type .tile .tile-item{cursor:pointer;display:flex;line-height:38px}.classification-block .tile-type .tile .tile-item .parent{box-sizing:border-box;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:600;max-width:135px;padding-right:16px;width:135px}.classification-block .tile-type .tile .tile-item .children{flex:1}.classification-block .tile-type .tile .tile-item .children .child-item{border-bottom:1px solid transparent;border-radius:4px;color:#7c7c7c;display:inline-block;font-size:14px;line-height:1.5;margin:0 5px;padding:1px 6px}.classification-block .tile-type .tile .tile-item .children .child-item.selected,.classification-block .tile-type .tile .tile-item .children .child-item:hover{background-color:rgba(45,122,255,.1);color:#2d7aff}.classification-block .tile-type .tile .tile-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tile-type .tile .tile-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tile-type .tile .tile-item .child-item.selected{color:#2d7aff}.classification-block .tile-type .selected-list{align-items:center;display:flex;padding:12px 6px}.classification-block .tile-type .selected-list .selected-num{font-size:14px;line-height:20px;margin-right:8px}.classification-block .tile-type .selected-list .selected-item{align-items:center;background-color:rgba(45,122,255,.1);border-radius:4px;color:#2d7aff;cursor:pointer;display:flex;margin-left:8px;padding:1px 8px}.classification-block .tile-type .selected-list .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;font-size:14px;line-height:20px;margin-left:22px}.classification-block .select-type{height:32px;line-height:32px;margin-bottom:8px;margin-right:8px;position:relative;width:100px}.classification-block .select-type .title{align-items:center;border:1px solid #d5d5d5;border-radius:4px;box-sizing:border-box;color:#969696;cursor:pointer;display:flex;font-size:12px;height:100%;justify-content:space-between;padding:0 8px;width:100%}.classification-block .select-type .title>.name{color:#212121;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .main-wrapper{background-color:#fff;border:1px solid #d5d5d5;border-radius:4px;min-width:270px;position:absolute;top:39px;width:100%;z-index:3000}.classification-block .select-type .main-wrapper::-webkit-scrollbar{width:5px}.classification-block .select-type .tree{margin:0;max-height:300px;overflow:auto;padding:32px 0}.classification-block .select-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer;line-height:32px}.classification-block .select-type .tree .tree-item.tree-header{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;height:40px;padding:0 10px;position:absolute;top:0;width:100%;z-index:1}.classification-block .select-type .tree .tree-item .tree-footer{align-items:center;color:rgba(0,0,0,.6);display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon{align-items:center;cursor:pointer;display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon .n-icon{margin-right:6px}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon:first-child{margin-right:16px}.classification-block .select-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .select-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .select-type .tree .tree-item .header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6);flex:1}.classification-block .select-type .tree .tree-item .header-item.selected,.classification-block .select-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children{align-items:center;display:flex;height:32px;line-height:32px;padding-left:23px;padding-right:10px}.classification-block .select-type .tree .tree-item .children .child-item{border-bottom:1px solid transparent;color:#7c7c7c;display:inline-block;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .tree .tree-item .children .child-item.child-header{padding:0 10px}.classification-block .select-type .tree .tree-item .children .child-item.header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6)}.classification-block .select-type .tree .tree-item .children .child-item.header-item.selected,.classification-block .select-type .tree .tree-item .children .child-item.header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .select-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .select-type .tree .tree-item:last-child{border-bottom:0}.classification-block .select-type .select-type-footer{align-items:center;background-color:#fff;border-top:1px solid #d5d5d5;bottom:0;display:flex;height:40px;justify-content:space-between;padding:0 12px;position:absolute;width:100%}.classification-block .select-type .select-type-footer .selected-num{color:rgba(0,0,0,.6)}.classification-block .select-type .select-type-footer .selected-item-del{color:#2474ff;cursor:pointer}
1
+ @font-face{font-family:classification-iconfont;src:url(classification-iconfont.ttf) format("truetype")}.iconfont-table-filter{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:classification-iconfont!important;font-size:14px;font-style:normal}.icon-table-filter-menzhenyishengzhananniuqingchu:before{content:"\e74e"}.icon-table-filter-menzhenyishengzhananniushanchu2:before{content:"\e757"}.icon-table-filter-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-table-filter-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.icon-table-filter-reset:before{content:"\e611"}.icon-table-filter-shaixuan:before{content:"\e64b"}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter{cursor:pointer;font-size:18px}.classification-modal-block .n-card-header .svg-wrap .iconfont-table-filter:last-child{margin-left:16px}.classification-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.classification-modal-block .n-card__content{overflow-y:auto}.classification-modal-block .n-card__content .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-title .list-title-item{font-weight:700;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content{padding:0}.classification-modal-block .n-card__content .table-modal-list .list-content li{display:flex;height:52px;line-height:52px}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item{align-items:center;display:flex;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:25%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-item .n-icon{cursor:pointer;margin-right:8px}.classification-modal-block .n-card__content .table-modal-list .list-content li.checked,.classification-modal-block .n-card__content .table-modal-list .list-content li.checked .text{background-color:#f2f2f2}.classification-modal-block .n-card__content .table-modal-list .list-content li .text{background-color:#fff;display:inline-block;padding:0 10px;position:relative}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line{position:relative;text-align:center;width:75%}.classification-modal-block .n-card__content .table-modal-list .list-content li .list-content-line:before{border:1px solid #e8e8e8;content:"";left:0;margin-top:20px;position:absolute;width:100%}.classification-modal-block .n-card__content .table-modal-list .list-title-item{margin-left:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item{border-bottom:1px solid #e1dfdf;margin-left:-1px;margin-top:-1px;padding:0 10px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch{height:16px;min-width:28px;width:28px}.classification-modal-block .n-card__content .table-modal-list .list-content-item .ant-switch:after{height:12px;width:12px}.classification-modal-block .n-card__content .table-modal-list .list-content-radio,.classification-modal-block .n-card__content .table-modal-list .list-content-switch{text-align:center}.classification-modal-block .n-card__content .table-modal-list .anticon+.anticon{margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .item-name{display:flex;height:32px;line-height:32px;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .item-name .label{text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .item-name .addAction{align-items:center;cursor:pointer;display:flex}.classification-modal-block .n-card__content .class-filter-content .item-name .blue{color:#2d7aff;margin-right:8px}.classification-modal-block .n-card__content .class-filter-content .n-form-item-label{width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content{align-items:center;display:flex;flex-wrap:wrap;line-height:32px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .label{display:inline-block;height:32px;line-height:32px;margin-bottom:10px;text-align:right;width:120px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn-dashed{border-color:#a6a6a6;color:#a6a6a6}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .parent-name{align-items:center;display:flex}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .parent-input{margin-bottom:10px;margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag{align-items:center;background-color:rgba(45,122,255,.1);border:1px solid #2d7aff;border-radius:3px;box-sizing:border-box;color:#2d7aff;display:flex;justify-content:center;margin-bottom:10px;margin-right:10px;max-width:120px;padding:0 10px;position:relative}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .anticon-close{color:#2d7aff;cursor:pointer;display:flex;justify-content:center;line-height:1;width:18px}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag .s-content{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select,.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .ant-input-disabled{background-color:#2d7aff;color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .edit-tag.edit-tag-select .anticon-close{color:#fff}.classification-modal-block .n-card__content .class-filter-content .quickSearch-content .ant-btn{margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list{border-top:1px solid #e6e6e6;margin-bottom:6px;margin-top:16px;padding:12px 0 0}.classification-modal-block .n-card__content .class-filter-content .select-item-list li{align-items:center;display:flex;list-style:none;margin-bottom:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .index-span{display:inline-block;width:30px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item{margin-right:10px;width:120px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .form-item.n-date-picker{width:auto}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper{display:flex}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .value-cfg_wrapper .form-item{margin-right:10px}.classification-modal-block .n-card__content .class-filter-content .select-item-list li .delete-item-icon{color:red;cursor:pointer;font-size:18px;margin-left:8px}.classification-modal-block .n-card__content .class-filter-content .filter-expression{display:flex;flex-direction:column}.classification-modal-block .n-card__content .class-filter-content .filter-expression .textarea{margin-top:6px}.classification-modal-block .n-card__footer{padding-top:10px}.classification-modal-block .n-card__footer .flex_between{display:flex;justify-content:space-between}.classification-modal-block .n-card__footer .flex_right{display:flex;justify-content:right}.classification-modal-block .n-card__footer .n-button{margin-left:8px}.classification-block .tree-type{border:1px solid #d5d5d5;border-radius:4px;height:100%;line-height:32px;margin-top:0;padding-bottom:80px;width:150px}.classification-block .tree-type .header{border-bottom:1px solid #e6eaef;display:flex;font-size:14px;justify-content:space-between;padding:0 10px}.classification-block .tree-type .header .header-1{align-items:center;cursor:pointer;display:flex}.classification-block .tree-type .tree{height:calc(100% - 32px);line-height:32px;margin:0;overflow:auto;padding-left:0}.classification-block .tree-type .tree::-webkit-scrollbar{width:5px}.classification-block .tree-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer}.classification-block .tree-type .tree .tree-item.tree-header{box-sizing:border-box;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .tree-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .tree-type .tree .tree-item .header-item{box-sizing:border-box;line-height:1.4}.classification-block .tree-type .tree .tree-item .header-item.selected,.classification-block .tree-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children{align-items:center;display:flex;height:32px;padding-left:23px;padding-right:10px}.classification-block .tree-type .tree .tree-item .children .child-item{align-items:center;border-bottom:1px solid transparent;color:#7c7c7c;display:flex;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .tree-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .tree-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tree-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-content{align-items:center;display:flex}.classification-block .tree-type .tree .tree-item .children .child-item .child-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .tree-type .tree .tree-item .children .child-item .digital-span{flex:1;margin-left:5px;text-align:left}.classification-block .tree-type .tree .tree-item:last-child{border-bottom:none}.classification-block .tree-type .tree-type-footer{border-top:1px solid #d5d5d5;bottom:0;height:80px;line-height:20px;padding-left:16px;position:absolute;width:100%}.classification-block .tree-type .tree-type-footer .selected-num{margin:10px}.classification-block .tree-type .tree-type-footer .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;justify-content:center;margin-left:0}.classification-block .tile-type{border:1px solid #d5d5d5;border-radius:4px;margin-bottom:8px;padding:0 17px}.classification-block .tile-type .header{align-items:center;border-bottom:1px solid #d5d5d5;display:inline-flex;justify-content:space-between;line-height:44px;width:100%}.classification-block .tile-type .header .all-data{border-bottom:1px solid transparent;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:500;line-height:1.4;margin-right:auto}.classification-block .tile-type .header .all-data:hover{color:#2d7aff}.classification-block .tile-type .header .all-data:active{border-color:transparent;color:#000}.classification-block .tile-type .header .selected{color:#2d7aff}.classification-block .tile-type .header .right-setting{display:flex}.classification-block .tile-type .header .right-setting .setting-1{align-items:center;cursor:pointer;display:flex}.classification-block .tile-type .header .right-setting .setting-1 .n-icon{margin-right:6px}.classification-block .tile-type .header .right-setting .upack-up-btn{color:#2d7aff}.classification-block .tile-type .tile{border-bottom:1px solid #d5d5d5;margin:0;padding:9px 0}.classification-block .tile-type .tile .tile-item{cursor:pointer;display:flex;line-height:38px}.classification-block .tile-type .tile .tile-item .parent{box-sizing:border-box;font-family:PingFangSC-Medium,PingFang SC;font-size:14px;font-weight:600;max-width:135px;padding-right:16px;width:135px}.classification-block .tile-type .tile .tile-item .children{flex:1}.classification-block .tile-type .tile .tile-item .children .child-item{border-bottom:1px solid transparent;border-radius:4px;color:#7c7c7c;display:inline-block;font-size:14px;line-height:1.5;margin:0 5px;padding:1px 6px}.classification-block .tile-type .tile .tile-item .children .child-item.selected,.classification-block .tile-type .tile .tile-item .children .child-item:hover{background-color:rgba(45,122,255,.1);color:#2d7aff}.classification-block .tile-type .tile .tile-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .tile-type .tile .tile-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .tile-type .tile .tile-item .child-item.selected{color:#2d7aff}.classification-block .tile-type .selected-list{align-items:center;display:flex;padding:12px 6px}.classification-block .tile-type .selected-list .selected-num{font-size:14px;line-height:20px;margin-right:8px}.classification-block .tile-type .selected-list .selected-item{align-items:center;background-color:rgba(45,122,255,.1);border-radius:4px;color:#2d7aff;cursor:pointer;display:flex;margin-left:8px;padding:1px 8px}.classification-block .tile-type .selected-list .selected-item-del{align-items:center;color:#2474ff;cursor:pointer;display:flex;font-size:14px;line-height:20px;margin-left:22px}.classification-block .select-type{height:32px;line-height:32px;margin-bottom:8px;margin-right:8px;position:relative;width:100px}.classification-block .select-type .title{align-items:center;border:1px solid #d5d5d5;border-radius:4px;box-sizing:border-box;color:#969696;cursor:pointer;display:flex;font-size:12px;height:100%;justify-content:space-between;padding:0 8px;width:100%}.classification-block .select-type .title>.name{color:#212121;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .main-wrapper{background-color:#fff;border:1px solid #d5d5d5;border-radius:4px;min-width:270px;position:absolute;top:39px;width:100%;z-index:3000}.classification-block .select-type .main-wrapper::-webkit-scrollbar{width:5px}.classification-block .select-type .tree{margin:0;max-height:300px;overflow:auto;padding:32px 0}.classification-block .select-type .tree .tree-item{border-bottom:1px solid #d5d5d5;cursor:pointer;line-height:32px}.classification-block .select-type .tree .tree-item.tree-header{align-items:center;background-color:#fff;box-sizing:border-box;display:flex;height:40px;padding:0 10px;position:absolute;top:0;width:100%;z-index:1}.classification-block .select-type .tree .tree-item .tree-footer{align-items:center;color:rgba(0,0,0,.6);display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon{align-items:center;cursor:pointer;display:flex}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon .n-icon{margin-right:6px}.classification-block .select-type .tree .tree-item .tree-footer .tree-footer-icon:first-child{margin-right:16px}.classification-block .select-type .tree .tree-item .parent{align-items:center;display:flex;font-weight:600;justify-content:space-between;padding:0 10px}.classification-block .select-type .tree .tree-item .parent.open{background-color:#f2f2f2;border-bottom:1px solid #d5d5d5}.classification-block .select-type .tree .tree-item .header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6);flex:1}.classification-block .select-type .tree .tree-item .header-item.selected,.classification-block .select-type .tree .tree-item .header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children{align-items:center;display:flex;height:32px;line-height:32px;padding-left:23px;padding-right:10px}.classification-block .select-type .tree .tree-item .children .child-item{border-bottom:1px solid transparent;color:#7c7c7c;display:inline-block;line-height:1.5;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.classification-block .select-type .tree .tree-item .children .child-item.child-header{padding:0 10px}.classification-block .select-type .tree .tree-item .children .child-item.header-item{border-bottom:1px solid transparent;color:rgba(0,0,0,.6)}.classification-block .select-type .tree .tree-item .children .child-item.header-item.selected,.classification-block .select-type .tree .tree-item .children .child-item.header-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.header-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item:hover{color:#2d7aff}.classification-block .select-type .tree .tree-item .children .child-item.selected{align-items:center;color:#2d7aff;display:flex;justify-content:space-between;width:100%}.classification-block .select-type .tree .tree-item .children .child-item:active{border-color:transparent;color:#000}.classification-block .select-type .tree .tree-item .children .child-item.disabled{color:rgba(0,0,0,.2)}.classification-block .select-type .tree .tree-item:last-child{border-bottom:0}.classification-block .select-type .select-type-footer{align-items:center;background-color:#fff;border-top:1px solid #d5d5d5;bottom:0;display:flex;height:40px;justify-content:space-between;padding:0 12px;position:absolute;width:100%}.classification-block .select-type .select-type-footer .selected-num{color:rgba(0,0,0,.6)}.classification-block .select-type .select-type-footer .selected-item-del{color:#2474ff;cursor:pointer}
@@ -1 +1 @@
1
- import{defineComponent as e,ref as l,inject as a,computed as t,watch as u,openBlock as n,createBlock as i,unref as o,normalizeClass as v,isRef as d,withCtx as r,createVNode as s,normalizeStyle as p,createElementVNode as f,createTextVNode as m,createCommentVNode as c,createElementBlock as y,Fragment as h,renderList as _,withDirectives as g,withKeys as b,withModifiers as x,vShow as k,toDisplayString as M}from"vue";import{useMessage as w,NModal as H,NCard as C,NButton as U,NForm as S,NFormItem as j,NInput as O,NTooltip as I,NSelect as z,NGrid as T,NGridItem as N,NIcon as Y,NInputNumber as $,NPopover as L,NDatePicker as V,NTimePicker as B,NSwitch as D}from"naive-ui";import{isMulti as F,isShowOptions as P,isNumber as q,isDate as A,isCandidate as E,isTextarea as J}from"../utils/index.js";import K from"moment";import{InjectionExpandFieldApiConfig as R}from"../constants/index.js";import W from"../hooks/useAsyncData.js";import{HtmlTypeList as X}from"../utils/constant.js";import{isJSON as G,isValidDate as Q}from"../utils/tool.js";import Z from"./FormBatchOptionsModal.vue.js";import ee from"./FormItemPerson.vue.js";const le={class:"svg-wrap"},ae={class:"flex_right"},te={class:"options-title"},ue=f("span",null,"字段键名",-1),ne=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ie={class:"options-title"},oe=f("span",null,"字段问号提示",-1),ve=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),de={class:"options-title"},re=f("span",null,"选项值",-1),se=f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[f("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),f("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),pe={class:"options-title"},fe=f("span",null,"默认值",-1),me=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ce={style:{display:"flex","align-items":"center"}},ye=f("span",null,"选择",-1),he={style:{width:"100%"}},_e={key:0,class:"validate_tip"};var ge=e({__name:"form",props:{visible:{type:Boolean,default:!1},formOntype:{type:String,default:"add"},formItemData:{type:Object,default:()=>({})},id:{type:String,default:""},orgId:{type:String,default:""},conditionList:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},emits:["cancelModal"],setup(e,{emit:ge}){const be=e,xe=w(),ke="请输入默认值",Me={name:[{required:!0,message:"请输入字段标题",trigger:["input","blur"]}],html_type:[{required:!0,message:"请选择字段类型",trigger:["input","blur"]}]},we=[{value:"yyyy-MM-dd HH:mm:ss",label:"年-月-日 时:分:秒"},{value:"yyyy-MM-dd HH:mm",label:"年-月-日 时:分"},{value:"yyyy-MM-dd",label:"年-月-日"},{value:"yyyy-MM",label:"年-月"},{value:"MM-dd HH:mm",label:"月-日 时:分"},{value:"MM-dd",label:"月-日"},{value:"HH:mm:ss",label:"时:分:秒"},{value:"HH:mm",label:"时:分"}],He=[{value:"12",label:"整行"},{value:"6",label:"半行"},{value:"4",label:"1/3行"},{value:"8",label:"2/3行"},{value:"3",label:"1/4行"},{value:"9",label:"3/4行"},{value:"2",label:"1/6行"},{value:"10",label:"5/6行"},{value:"1.5",label:"1/8行"},{value:"10.5",label:"7/8行"}],Ce=l(!1),Ue=l("860px");let Se=l({maxHeight:"496px",height:"496px"});const{saveOrUpdateExtendField:je}=W(),Oe=a(R),Ie=l(null),ze=l({name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}),Te=l([{text:void 0,value:void 0}]),Ne=l({format:"yyyy-MM-dd HH:mm:ss",dateType:"date",mode:"date",value:null,showTime:!0,open:!1,componentType:"datetime"}),Ye=l({obj_type:"",vali_obj:"",event_obj:"",max_length:"",min_length:"",min_value:"",max_value:""}),$e=l({value_key:"",levelSetting:[],search_key:[],level_num:void 0,render_key:[],name:"",level_key:"",id:"",type:"",primary_key:"",sqlExpression:"",conObj:"",add_btn:"",setting:{cascading:[]}}),Le=l(!1),Ve=l(!1),Be=l(void 0),De=l(!1),Fe=l(!1);l(!1);const Pe=l(!1),qe=l(""),Ae=t((()=>"edit"===be.formOntype)),Ee=t((()=>ze.value.html_type||""));t((()=>"TEXTAREA"===Ee.value?1e3:255));const Je=t((()=>Te.value.filter((e=>e.value&&e.text)))),Ke=t((()=>F(Ee.value))),Re=t((()=>"date"===Ne.value.dateType));function We(e){Pe.value=e}function Xe(e){let l=e;"string"!=typeof e&&(l=JSON.stringify(e)),ze.value.default_val=l}function Ge(e){Ne.value.value=null,ze.value.default_val=void 0,il(e)}function Qe(){Ce.value=!Ce.value;let e=document.body.clientHeight;"860px"===Ue.value?(Ue.value="100%",Se.value.maxHeight=`${e}px`,Se.value.height=`${e}px`):(Ue.value="860px",Se.value.maxHeight="496px",Se.value.height="")}function Ze(e){return["HH:mm:ss","HH:mm"].includes(e)}function el(e,l){switch(e){case"isNull":Le.value=l,ze.value.is_null=l?"0":"1";break;case"isMultiSelect":Ve.value=l,ze.value.isMultiSelect=l?"1":"0"}}function ll(){if("add"===be.formOntype)return;let e=Object.assign({},be.formItemData),l=e.setting;l&&G(l)&&(l=JSON.parse(l),delete e.setting,Object.assign(e,{...l})),e.key=e.code,delete e.code,A(e.html_type)&&function(e){il(e.date_format);let l=e.default_val;l&&!l.startsWith("${")&&(Ze(e.date_format)&&(l=`${K().format("YYYY-MM-dd")} ${l}`),Q(new Date(l))&&(Ne.value.value=K(l)))}(e),F(e.html_type)&&(e.default_val=function(e){let l=e.default_val;return l?l.split(",").filter(Boolean):[]}(e)),Le.value="0"==e.is_null,Ve.value="1"==e.isMultiSelect,Ye.value=Object.assign(Ye.value,e.validate||{}),$e.value=Object.assign($e.value,e.wordbook||{}),ze.value=Object.assign(ze.value,e||{}),P(e.html_type)&&function(e){let l=(null==e?void 0:e.optionValue)||[];l.length||l.push({text:void 0,value:void 0}),Te.value=[...l],delete e.optionValue}(e)}function al(e){ze.value.html_type=e,Te.value=[{text:void 0,value:void 0}];let l=function(){if(F(Ee.value))return[]}();ze.value.default_val=l,A(e)?ze.value.date_format="yyyy-MM-dd HH:mm:ss":ze.value.date_format=""}function tl(){Te.value.push({value:"",text:""})}function ul(e){let l=e;(e<0||0===e)&&(l=0),e>5&&(l=5),Be.value=0===l?l:l||void 0}function nl(e){Te.value=e}function il(e){let l=e||"yyyy-MM-dd HH:mm:ss",a=Ze(l)?"time":"date",t="yyyy-MM"===l?"month":"date";let u=function(e){return["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)}(l),n="";["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)&&(n="datetime"),["yyyy-MM-dd","MM-dd"].includes(e)&&(n="date"),Object.assign(Ne.value,{format:l,dateType:a,mode:t,showTime:u,componentType:n})}function ol(e,l){if(e)return l&&(l.includes("yyyy")&&(l=l.replace("yyyy","YYYY")),l.includes("dd")&&(l=l.replace("dd","DD"))),K(e).format(l)}function vl(){Ne.value.open=!Ne.value.open}function dl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function rl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l,Ne.value.format.includes("HH:mm")||vl()}function sl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function pl(){ge("cancelModal"),Ue.value="860px",Se.value={height:"496px",maxHeight:"496px"},Ce.value=!1,ze.value={name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}}function fl(){var e;null==(e=Ie.value)||e.validate((async e=>{if(e)return;let l=Object.assign({},ze.value);if(l.validate={...Ye.value},l.extendId=be.id,P(Ee.value)){let e=function(){let e={validate:!1,message:"请完善选项配置"};if(!Te.value||!Te.value.length)return e;let l,a,t,u=0,n=Te.value.length,i=!1;for(;u<n;u++){if(l=Te.value[u],a=l.value?l.value.trim():l.value,t=l.text?l.text.trim():l.text,!a||!t){i=!0;break}l.value=a,l.text=t}return[...new Set(Te.value.map((e=>e.value)))].length!==Te.value.length?(e.message="选项值不能重复",e):(!i&&(e.validate=!0),e)}();if(!e.validate)return De.value=!0,void xe.warning(e.message);De.value=!1,l.option=[...Te.value]}if(q(Ee.value)?l.default_val=function(e){let l=e.default_val;if(void 0===Be.value)return l;if(!l)return l;let a=String(l).split(".")[1];return a&&a.length!==Be.value?Number(l.toFixed(Be.value)):l}(l):F(Ee.value)&&(l.default_val=l.default_val.join(",")),!E(Ee.value)||function(e){let{default_val:l}=e;qe.value="",l&&G(l)&&(l=JSON.parse(l));let a=function(e,l){if(!e)return;if("string"!=typeof e)return;if(!(e=e.trim()))return!0;if(!e.startsWith("${"))return ml(l,"请输入有效系统变量"),"error";let a=/\${sys.(.*?)\}/g.exec(e);if(!a||!a[1])return ml(l,"请输入有效系统变量"),"error";return!0}(l,e);if(a)return"error"!==a;if(console.log("saveOjb.isMultiSelect>>>",e.isMultiSelect),console.log("default_val?.length>>>",null==l?void 0:l.length),"0"===e.isMultiSelect&&(null==l?void 0:l.length)>1)return console.log("进入到判断里面了>>>>>"),ml(e,"选人组件为单选"),!1;return!0}(l)){for(let e in l){let a=l[e];"string"==typeof a&&(l[e]=null==a?void 0:a.trim())}console.log("saveOjb>>>",l),await async function(e={}){Fe.value=!0;try{const l=await je(e,Oe);if(Fe.value=!1,"SUCCESS"!==(null==l?void 0:l.result))return void xe.error((null==l?void 0:l.resultMsg)||"保存失败");pl()}catch(e){Fe.value=!1}}(l)}}))}function ml(e,l){qe.value=l}return u((()=>be.visible),(e=>{e&&ll()})),(l,a)=>(n(),i(o(H),{class:v(["expand-field-modal-block",{"modal-screen":Ce.value}]),show:e.visible,"onUpdate:show":a[22]||(a[22]=e=>d(visible)?visible.value=e:null),maskClosable:!1,width:Ue.value,bodyStyle:o(Se),closable:!1,centered:"",onPositiveClick:fl,onNegativeClick:pl},{default:r((()=>[s(o(C),{style:p({width:Ue.value,...o(Se)}),title:"add"===be.formOntype?"新增拓展字段":"编辑拓展字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":r((()=>[f("div",le,[f("i",{onClick:Qe,class:v(["iconfont-expand-field",Ce.value?"icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),f("i",{onClick:pl,class:"iconfont-expand-field icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:r((()=>[f("div",ae,[s(o(U),{onClick:pl},{default:r((()=>[m("取消")])),_:1}),s(o(U),{type:"info",onClick:fl},{default:r((()=>[m("保存")])),_:1})])])),default:r((()=>[s(o(S),{ref_key:"formRef",ref:Ie,model:ze.value,rules:Me},{default:r((()=>[s(o(j),{path:"name",label:"字段标题","require-mark-placement":"left"},{default:r((()=>[s(o(O),{value:ze.value.name,"onUpdate:value":a[0]||(a[0]=e=>ze.value.name=e),maxlength:100,clearable:"",placeholder:"请输入"},null,8,["value"])])),_:1}),s(o(j),{path:"key"},{label:r((()=>[f("div",te,[ue,s(o(I),{duration:0},{trigger:r((()=>[ne])),default:r((()=>[m(" 数据库字段键名,不填写时由系统生成,填写则以填写为准 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.key,"onUpdate:value":a[1]||(a[1]=e=>ze.value.key=e),maxlength:32,disabled:o(Ae),clearable:"",placeholder:"数据库字段键名,不填写时由系统生成,填写则以填写为准"},null,8,["value","disabled"])])),_:1}),s(o(j),{path:"html_type",label:"字段类型","require-mark-placement":"left"},{default:r((()=>[s(o(z),{value:ze.value.html_type,"onUpdate:value":[a[2]||(a[2]=e=>ze.value.html_type=e),al],placeholder:"请选择字段类型",clearable:"",filterable:"",options:o(X)},null,8,["value","options"])])),_:1}),s(o(j),{path:"remark",label:"字段问号提示"},{label:r((()=>[f("div",ie,[oe,s(o(I),{duration:0},{trigger:r((()=>[ve])),default:r((()=>[m(" 设置后该字段旁会有问号图标,鼠标悬浮展示“问号提示”内容,常用于告诉用户该字段的含义 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.remark,"onUpdate:value":a[3]||(a[3]=e=>ze.value.remark=e),placeholder:"请输入",type:"textarea",clearable:"",maxlength:255,rows:3},null,8,["value"])])),_:1}),c(" 选项值>>>>>类型对应关系 "),o(P)(o(Ee))?(n(),i(o(j),{key:0},{label:r((()=>[f("div",de,[re,f("span",{class:"batch-span",onClick:tl},"添加选项"),f("span",{class:"batch-span",onClick:a[4]||(a[4]=()=>We(!0))},"批量编辑")])])),default:r((()=>[f("div",{class:v(["options-item",{"options-item-err":De.value}])},[(n(!0),y(h,null,_(Te.value,((e,l)=>(n(),i(o(T),{class:"mgb-10",key:l,cols:24,"x-gap":8,"y-gap":8},{default:r((()=>[s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.value,"onUpdate:value":l=>e.value=l,maxLength:100,allowClear:"",placeholder:"选项值"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.text,"onUpdate:value":l=>e.text=l,maxLength:100,allowClear:"",placeholder:"选项文本"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:2,class:"flex-center"},{default:r((()=>[Te.value.length>1?(n(),i(o(Y),{key:0,onClick:a=>function(e,l){Te.value.splice(l,1);let a=ze.value.default_val;if(F(Ee.value)){if(!a||!a.length)return;let l=a.findIndex((l=>l===e.value));l||a.splice(l,1)}else{if(!a)return;a===e.value&&(a=void 0)}ze.value.default_val=a}(e,l)},{default:r((()=>[se])),_:2},1032,["onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1024)))),128))],2)])),_:1})):c("v-if",!0),o(q)(o(Ee))?(n(),i(o(j),{key:1,path:"decimal_length",label:"小数位"},{default:r((()=>[s(o($),{style:{width:"100%"},min:0,max:5,placeholder:"请输入",precision:0,clearable:"",value:ze.value.decimal_length,"onUpdate:value":[a[5]||(a[5]=e=>ze.value.decimal_length=e),ul]},null,8,["value"])])),_:1})):c("v-if",!0),o(A)(o(Ee))?(n(),i(o(j),{key:2,path:"date_format",label:"日期格式"},{default:r((()=>[s(o(z),{style:{width:"100%"},value:ze.value.date_format,"onUpdate:value":[a[6]||(a[6]=e=>ze.value.date_format=e),Ge],placeholder:"请选择",options:we},null,8,["value"])])),_:1})):c("v-if",!0),c(" 默认值>>>>>类型对应关系 "),s(o(j),{path:"default_val",label:"默认值"},{label:r((()=>[f("div",pe,[fe,o(E)(o(Ee))?(n(),i(o(I),{key:0,duration:0},{trigger:r((()=>[me])),default:r((()=>[m(" 支持输入系统变量当前操作人${sys.userId},也支持选择一个人 ")])),_:1})):c("v-if",!0)])])),default:r((()=>[o(J)(o(Ee))?(n(),i(o(O),{key:0,value:ze.value.default_val,"onUpdate:value":a[7]||(a[7]=e=>ze.value.default_val=e),placeholder:ke,type:"textarea",clearable:"",maxlength:1e3,rows:3},null,8,["value"])):o(q)(o(Ee))?(n(),y(h,{key:1},[c(" 数字框 "),s(o($),{style:{width:"100%"},clearable:"",placeholder:ke,precision:Be.value,value:ze.value.default_val,"onUpdate:value":a[8]||(a[8]=e=>ze.value.default_val=e)},null,8,["precision","value"])],2112)):o(P)(o(Ee))?(n(),y(h,{key:2},[c(" 下拉框、横向单选、纵向单选、横向多选、纵向多选、下拉多选框 "),s(o(z),{style:{width:"100%"},multiple:o(Ke),clearable:"",value:ze.value.default_val,"onUpdate:value":a[9]||(a[9]=e=>ze.value.default_val=e),"label-field":"text",placeholder:ke,options:o(Je)},null,8,["multiple","value","options"])],2112)):o(A)(o(Ee))?(n(),y(h,{key:3},[c(" 日期 "),f("div",ce,[s(o(O),{clearable:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[10]||(a[10]=e=>ze.value.default_val=e),placeholder:ke},null,8,["value"]),o(Re)?(n(),y(h,{key:0},["month"===Ne.value.mode?(n(),i(o(L),{key:0,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[11]||(a[11]=e=>Ne.value.value=e),dl],type:"month","input-readonly":"",clearable:"",onConfirm:vl},null,8,["value"])])),_:1},8,["show"])):(n(),i(o(L),{key:1,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[12]||(a[12]=e=>Ne.value.value=e),rl],format:Ne.value.format,type:Ne.value.componentType,"input-readonly":"",clearable:"",onConfirm:vl},null,8,["value","format","type"])])),_:1},8,["show"]))],64)):(n(),y(h,{key:1},[c(' <n-input\n allowClear\n :maxLength="255"\n v-model:value="dateInfo.value"\n @keydown.enter.prevent\n :placeholder="defaultPlaceholder"\n /> '),s(o(U),{type:"info",class:"date-time-button"},{default:r((()=>[ye,s(o(B),{value:Ne.value.value,"onUpdate:value":[a[13]||(a[13]=e=>Ne.value.value=e),sl],format:Ne.value.format,"input-readonly":"",clearable:""},null,8,["value","format"])])),_:1}),c(' <n-popover trigger="click">\n <template #trigger>\n <n-button type="info">选择</n-button>\n </template>\n <n-time-picker\n panel\n v-model:value="dateInfo.value"\n :format="dateInfo.format"\n input-readonly\n clearable\n @update:value="timeChange"\n >\n <template v-slot:icon>111</template>\n\n </n-time-picker>\n </n-popover> ')],64))])],2112)):o(E)(o(Ee))?(n(),y(h,{key:4},[c(" 选人组件(增加一个选人组件) "),f("div",he,[g(s(o(O),{allowClear:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[14]||(a[14]=e=>ze.value.default_val=e),onKeydown:a[15]||(a[15]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:ke},null,8,["value"]),[[k,!1]]),c(' 点击弹出选人组件弹窗 :mainForm="this" '),s(ee,{orgId:e.orgId,defaultValue:ze.value.default_val,onCheckPerson:Xe},null,8,["orgId","defaultValue"]),qe.value?(n(),y("span",_e,M(qe.value),1)):c("v-if",!0),c(' <n-button type="info">选择</n-button> ')])],2112)):(n(),y(h,{key:5},[c(" 其他 "),s(o(O),{value:ze.value.default_val,"onUpdate:value":a[16]||(a[16]=e=>ze.value.default_val=e),onKeydown:a[17]||(a[17]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:"请输入默认值"},null,8,["value"])],2112))])),_:1}),s(o(j),{path:"elem_width",label:"宽度"},{default:r((()=>[s(o(z),{value:ze.value.elem_width,"onUpdate:value":a[18]||(a[18]=e=>ze.value.elem_width=e),placeholder:"请选择宽度",options:He},null,8,["value"])])),_:1}),s(o(j),{path:"isNull",label:"是否必填","label-placement":"left"},{default:r((()=>[s(o(D),{value:Le.value,"onUpdate:value":[a[19]||(a[19]=e=>Le.value=e),a[20]||(a[20]=e=>el("isNull",e))]},null,8,["value"])])),_:1}),o(E)(o(Ee))?(n(),i(o(j),{key:3,"label-placement":"left",path:"isMultiSelect",label:"是否多选"},{default:r((()=>[s(o(D),{value:Ve.value,"onUpdate:value":a[21]||(a[21]=e=>el("isMultiSelect",e))},null,8,["value"])])),_:1})):c("v-if",!0)])),_:1},8,["model"]),s(Z,{visible:Pe.value,options:Te.value,onHandleSaveBatch:nl,onTriggerBatch:We},null,8,["visible","options"])])),_:1},8,["style","title"])])),_:1},8,["class","show","width","bodyStyle"]))}});export{ge as default};
1
+ import{defineComponent as e,ref as l,inject as a,computed as t,watch as u,openBlock as n,createBlock as i,unref as o,normalizeClass as v,isRef as d,withCtx as r,createVNode as s,normalizeStyle as p,createElementVNode as f,createTextVNode as m,createCommentVNode as c,createElementBlock as y,Fragment as h,renderList as _,withDirectives as g,withKeys as b,withModifiers as x,vShow as k,toDisplayString as M}from"vue";import{useMessage as w,NModal as H,NCard as C,NButton as U,NForm as S,NFormItem as j,NInput as O,NTooltip as I,NSelect as z,NGrid as T,NGridItem as N,NIcon as Y,NInputNumber as $,NPopover as L,NDatePicker as V,NTimePicker as B,NSwitch as D}from"naive-ui";import{isMulti as F,isShowOptions as P,isNumber as q,isDate as A,isCandidate as E,isTextarea as J}from"../utils/index.js";import K from"moment";import{InjectionExpandFieldApiConfig as R}from"../constants/index.js";import W from"../hooks/useAsyncData.js";import{HtmlTypeList as X}from"../utils/constant.js";import{isJSON as G,isValidDate as Q}from"../utils/tool.js";import Z from"./FormBatchOptionsModal.vue.js";import ee from"./FormItemPerson.vue.js";const le={class:"svg-wrap"},ae={class:"flex_right"},te={class:"options-title"},ue=f("span",null,"字段键名",-1),ne=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ie={class:"options-title"},oe=f("span",null,"字段问号提示",-1),ve=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),de={class:"options-title"},re=f("span",null,"选项值",-1),se=f("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[f("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),f("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),f("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),pe={class:"options-title"},fe=f("span",null,"默认值",-1),me=f("i",{class:"iconfont-expand-field icon-expand-field-help"},null,-1),ce={style:{display:"flex","align-items":"center"}},ye=f("span",null,"选择",-1),he={style:{width:"100%"}},_e={key:0,class:"validate_tip"};var ge=e({__name:"form",props:{visible:{type:Boolean,default:!1},formOntype:{type:String,default:"add"},formItemData:{type:Object,default:()=>({})},id:{type:String,default:""},orgId:{type:String,default:""},conditionList:{type:Array,default:()=>[]},searchFieldList:{type:Array,default:()=>[]}},emits:["cancelModal"],setup(e,{emit:ge}){const be=e,xe=w(),ke="请输入默认值",Me={name:[{required:!0,message:"请输入字段标题",trigger:["input","blur"]}],html_type:[{required:!0,message:"请选择字段类型",trigger:["input","blur"]}]},we=[{value:"yyyy-MM-dd HH:mm:ss",label:"年-月-日 时:分:秒"},{value:"yyyy-MM-dd HH:mm",label:"年-月-日 时:分"},{value:"yyyy-MM-dd",label:"年-月-日"},{value:"yyyy-MM",label:"年-月"},{value:"MM-dd HH:mm",label:"月-日 时:分"},{value:"MM-dd",label:"月-日"},{value:"HH:mm:ss",label:"时:分:秒"},{value:"HH:mm",label:"时:分"}],He=[{value:"12",label:"整行"},{value:"6",label:"半行"},{value:"4",label:"1/3行"},{value:"8",label:"2/3行"},{value:"3",label:"1/4行"},{value:"9",label:"3/4行"},{value:"2",label:"1/6行"},{value:"10",label:"5/6行"},{value:"1.5",label:"1/8行"},{value:"10.5",label:"7/8行"}],Ce=l(!1),Ue=l("860px");let Se=l({maxHeight:"496px",height:"496px"});const{saveOrUpdateExtendField:je}=W(),Oe=a(R),Ie=l(null),ze=l({name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}),Te=l([{text:void 0,value:void 0}]),Ne=l({format:"yyyy-MM-dd HH:mm:ss",dateType:"date",mode:"date",value:null,showTime:!0,open:!1,componentType:"datetime"}),Ye=l({obj_type:"",vali_obj:"",event_obj:"",max_length:"",min_length:"",min_value:"",max_value:""}),$e=l({value_key:"",levelSetting:[],search_key:[],level_num:void 0,render_key:[],name:"",level_key:"",id:"",type:"",primary_key:"",sqlExpression:"",conObj:"",add_btn:"",setting:{cascading:[]}}),Le=l(!1),Ve=l(!1),Be=l(void 0),De=l(!1),Fe=l(!1);l(!1);const Pe=l(!1),qe=l(""),Ae=t((()=>"edit"===be.formOntype)),Ee=t((()=>ze.value.html_type||""));t((()=>"TEXTAREA"===Ee.value?1e3:255));const Je=t((()=>Te.value.filter((e=>e.value&&e.text)))),Ke=t((()=>F(Ee.value))),Re=t((()=>"date"===Ne.value.dateType));function We(e){Pe.value=e}function Xe(e){let l=e;"string"!=typeof e&&(l=JSON.stringify(e)),ze.value.default_val=l}function Ge(e){Ne.value.value=null,ze.value.default_val=void 0,il(e)}function Qe(){Ce.value=!Ce.value;let e=document.body.clientHeight;"860px"===Ue.value?(Ue.value="100%",Se.value.maxHeight=`${e}px`,Se.value.height=`${e}px`):(Ue.value="860px",Se.value.maxHeight="496px",Se.value.height="")}function Ze(e){return["HH:mm:ss","HH:mm"].includes(e)}function el(e,l){switch(e){case"isNull":Le.value=l,ze.value.is_null=l?"0":"1";break;case"isMultiSelect":Ve.value=l,ze.value.isMultiSelect=l?"1":"0"}}function ll(){if("add"===be.formOntype)return;let e=Object.assign({},be.formItemData),l=e.setting;l&&G(l)&&(l=JSON.parse(l),delete e.setting,Object.assign(e,{...l})),e.key=e.code,delete e.code,A(e.html_type)&&function(e){il(e.date_format);let l=e.default_val;l&&!l.startsWith("${")&&(Ze(e.date_format)&&(l=`${K().format("YYYY-MM-dd")} ${l}`),Q(new Date(l))&&(Ne.value.value=K(l)))}(e),F(e.html_type)&&(e.default_val=function(e){let l=e.default_val;return l?l.split(",").filter(Boolean):[]}(e)),Le.value="0"==e.is_null,Ve.value="1"==e.isMultiSelect,Ye.value=Object.assign(Ye.value,e.validate||{}),$e.value=Object.assign($e.value,e.wordbook||{}),ze.value=Object.assign(ze.value,e||{}),P(e.html_type)&&function(e){let l=(null==e?void 0:e.optionValue)||[];l.length||l.push({text:void 0,value:void 0}),Te.value=[...l],delete e.optionValue}(e)}function al(e){ze.value.html_type=e,Te.value=[{text:void 0,value:void 0}];let l=function(){if(F(Ee.value))return[]}();ze.value.default_val=l,A(e)?ze.value.date_format="yyyy-MM-dd HH:mm:ss":ze.value.date_format=""}function tl(){Te.value.push({value:"",text:""})}function ul(e){let l=e;(e<0||0===e)&&(l=0),e>5&&(l=5),Be.value=0===l?l:l||void 0}function nl(e){Te.value=e}function il(e){let l=e||"yyyy-MM-dd HH:mm:ss",a=Ze(l)?"time":"date",t="yyyy-MM"===l?"month":"date";let u=function(e){return["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)}(l),n="";["yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","MM-dd HH:mm"].includes(e)&&(n="datetime"),["yyyy-MM-dd","MM-dd"].includes(e)&&(n="date"),Object.assign(Ne.value,{format:l,dateType:a,mode:t,showTime:u,componentType:n})}function ol(e,l){if(e)return l&&(l.includes("yyyy")&&(l=l.replace("yyyy","YYYY")),l.includes("dd")&&(l=l.replace("dd","DD"))),K(e).format(l)}function vl(){Ne.value.open=!Ne.value.open}function dl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function rl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l,Ne.value.format.includes("HH:mm")||vl()}function sl(e){let l=ol(e,Ne.value.format);ze.value.default_val=l}function pl(){ge("cancelModal"),Ue.value="860px",Se.value={height:"496px",maxHeight:"496px"},Ce.value=!1,ze.value={name:void 0,remark:void 0,is_edit:"1",is_null:"1",is_show:"1",key:"",val_key:void 0,validate:{},html_type:"INPUT",name_i18n:void 0,elem_width:"12",default_val:void 0,label_type:void 0,isMultiSelect:"0",decimal_length:void 0,date_format:""}}function fl(){var e;null==(e=Ie.value)||e.validate((async e=>{if(e)return;let l=Object.assign({},ze.value);if(l.validate={...Ye.value},l.extendId=be.id,P(Ee.value)){let e=function(){let e={validate:!1,message:"请完善选项配置"};if(!Te.value||!Te.value.length)return e;let l,a,t,u=0,n=Te.value.length,i=!1;for(;u<n;u++){if(l=Te.value[u],a=l.value?l.value.trim():l.value,t=l.text?l.text.trim():l.text,!a||!t){i=!0;break}l.value=a,l.text=t}return[...new Set(Te.value.map((e=>e.value)))].length!==Te.value.length?(e.message="选项值不能重复",e):(!i&&(e.validate=!0),e)}();if(!e.validate)return De.value=!0,void xe.warning(e.message);De.value=!1,l.option=[...Te.value]}if(q(Ee.value)?l.default_val=function(e){let l=e.default_val;if(void 0===Be.value)return l;if(!l)return l;let a=String(l).split(".")[1];return a&&a.length!==Be.value?Number(l.toFixed(Be.value)):l}(l):F(Ee.value)&&(l.default_val=l.default_val.join(",")),!E(Ee.value)||function(e){let{default_val:l}=e;qe.value="",l&&G(l)&&(l=JSON.parse(l));let a=function(e,l){if(!e)return;if("string"!=typeof e)return;if(!(e=e.trim()))return!0;if(!e.startsWith("${"))return ml(l,"请输入有效系统变量"),"error";let a=/\${sys.(.*?)\}/g.exec(e);if(!a||!a[1])return ml(l,"请输入有效系统变量"),"error";return!0}(l,e);if(a)return"error"!==a;if(console.log("saveOjb.isMultiSelect>>>",e.isMultiSelect),console.log("default_val?.length>>>",null==l?void 0:l.length),"0"===e.isMultiSelect&&(null==l?void 0:l.length)>1)return console.log("进入到判断里面了>>>>>"),ml(e,"选人组件为单选"),!1;return!0}(l)){for(let e in l){let a=l[e];"string"==typeof a&&(l[e]=null==a?void 0:a.trim())}console.log("saveOjb>>>",l),await async function(e={}){Fe.value=!0;try{const l=await je(e,Oe);if(Fe.value=!1,"SUCCESS"!==(null==l?void 0:l.result))return void xe.error((null==l?void 0:l.resultMsg)||"保存失败");pl()}catch(e){Fe.value=!1}}(l)}}))}function ml(e,l){qe.value=l}return u((()=>be.visible),(e=>{e&&ll()})),(l,a)=>(n(),i(o(H),{class:v(["expand-field-modal-block",{"modal-screen":Ce.value}]),show:e.visible,"onUpdate:show":a[22]||(a[22]=e=>d(visible)?visible.value=e:null),maskClosable:!1,width:Ue.value,bodyStyle:o(Se),closable:!1,centered:"",onPositiveClick:fl,onNegativeClick:pl},{default:r((()=>[s(o(C),{style:p({width:Ue.value,...o(Se)}),title:"add"===be.formOntype?"新增拓展字段":"编辑拓展字段",bordered:!1,size:"huge",role:"dialog","aria-modal":"true"},{"header-extra":r((()=>[f("div",le,[f("i",{onClick:Qe,class:v(["iconfont-expand-field",Ce.value?"icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2":"icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua"])},null,2),f("i",{onClick:pl,class:"iconfont-expand-field icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi"})])])),footer:r((()=>[f("div",ae,[s(o(U),{onClick:pl},{default:r((()=>[m("取消")])),_:1}),s(o(U),{type:"info",onClick:fl},{default:r((()=>[m("保存")])),_:1})])])),default:r((()=>[s(o(S),{ref_key:"formRef",ref:Ie,model:ze.value,rules:Me},{default:r((()=>[s(o(j),{path:"name",label:"字段标题","require-mark-placement":"left"},{default:r((()=>[s(o(O),{value:ze.value.name,"onUpdate:value":a[0]||(a[0]=e=>ze.value.name=e),maxlength:100,clearable:"",placeholder:"请输入"},null,8,["value"])])),_:1}),s(o(j),{path:"key"},{label:r((()=>[f("div",te,[ue,s(o(I),{duration:0},{trigger:r((()=>[ne])),default:r((()=>[m(" 数据库字段键名,不填写时由系统生成,填写则以填写为准 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.key,"onUpdate:value":a[1]||(a[1]=e=>ze.value.key=e),maxlength:32,disabled:o(Ae),clearable:"",placeholder:"数据库字段键名,不填写时由系统生成,填写则以填写为准"},null,8,["value","disabled"])])),_:1}),s(o(j),{path:"html_type",label:"字段类型","require-mark-placement":"left"},{default:r((()=>[s(o(z),{value:ze.value.html_type,"onUpdate:value":[a[2]||(a[2]=e=>ze.value.html_type=e),al],placeholder:"请选择字段类型",clearable:"",filterable:"",options:o(X)},null,8,["value","options"])])),_:1}),s(o(j),{path:"remark",label:"字段问号提示"},{label:r((()=>[f("div",ie,[oe,s(o(I),{duration:0},{trigger:r((()=>[ve])),default:r((()=>[m(" 设置后该字段旁会有问号图标,鼠标悬浮展示“问号提示”内容,常用于告诉用户该字段的含义 ")])),_:1})])])),default:r((()=>[s(o(O),{value:ze.value.remark,"onUpdate:value":a[3]||(a[3]=e=>ze.value.remark=e),placeholder:"请输入",type:"textarea",clearable:"",maxlength:255,rows:3},null,8,["value"])])),_:1}),c(" 选项值>>>>>类型对应关系 "),o(P)(o(Ee))?(n(),i(o(j),{key:0},{label:r((()=>[f("div",de,[re,f("span",{class:"batch-span",onClick:tl},"添加选项"),f("span",{class:"batch-span",onClick:a[4]||(a[4]=()=>We(!0))},"批量编辑")])])),default:r((()=>[f("div",{class:v(["options-item",{"options-item-err":De.value}])},[(n(!0),y(h,null,_(Te.value,((e,l)=>(n(),i(o(T),{class:"mgb-10",key:l,cols:24,"x-gap":8,"y-gap":8},{default:r((()=>[s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.value,"onUpdate:value":l=>e.value=l,maxLength:100,allowClear:"",placeholder:"选项值"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:11},{default:r((()=>[s(o(O),{value:e.text,"onUpdate:value":l=>e.text=l,maxLength:100,allowClear:"",placeholder:"选项文本"},null,8,["value","onUpdate:value"])])),_:2},1024),s(o(N),{span:2,class:"flex-center"},{default:r((()=>[Te.value.length>1?(n(),i(o(Y),{key:0,onClick:a=>function(e,l){Te.value.splice(l,1);let a=ze.value.default_val;if(F(Ee.value)){if(!a||!a.length)return;let l=a.findIndex((l=>l===e.value));l||a.splice(l,1)}else{if(!a)return;a===e.value&&(a=void 0)}ze.value.default_val=a}(e,l)},{default:r((()=>[se])),_:2},1032,["onClick"])):c("v-if",!0)])),_:2},1024)])),_:2},1024)))),128))],2)])),_:1})):c("v-if",!0),o(q)(o(Ee))?(n(),i(o(j),{key:1,path:"decimal_length",label:"小数位"},{default:r((()=>[s(o($),{style:{width:"100%"},min:0,max:5,placeholder:"请输入",precision:0,clearable:"",value:ze.value.decimal_length,"onUpdate:value":[a[5]||(a[5]=e=>ze.value.decimal_length=e),ul]},null,8,["value"])])),_:1})):c("v-if",!0),o(A)(o(Ee))?(n(),i(o(j),{key:2,path:"date_format",label:"日期格式"},{default:r((()=>[s(o(z),{style:{width:"100%"},value:ze.value.date_format,"onUpdate:value":[a[6]||(a[6]=e=>ze.value.date_format=e),Ge],placeholder:"请选择",options:we},null,8,["value"])])),_:1})):c("v-if",!0),c(" 默认值>>>>>类型对应关系 "),s(o(j),{path:"default_val",label:"默认值"},{label:r((()=>[f("div",pe,[fe,o(E)(o(Ee))?(n(),i(o(I),{key:0,duration:0},{trigger:r((()=>[me])),default:r((()=>[m(" 支持输入系统变量当前操作人${sys.userId},也支持选择一个人 ")])),_:1})):c("v-if",!0)])])),default:r((()=>[o(J)(o(Ee))?(n(),i(o(O),{key:0,value:ze.value.default_val,"onUpdate:value":a[7]||(a[7]=e=>ze.value.default_val=e),placeholder:ke,type:"textarea",clearable:"",maxlength:1e3,rows:3},null,8,["value"])):o(q)(o(Ee))?(n(),y(h,{key:1},[c(" 数字框 "),s(o($),{style:{width:"100%"},clearable:"",placeholder:ke,precision:Be.value,value:ze.value.default_val,"onUpdate:value":a[8]||(a[8]=e=>ze.value.default_val=e)},null,8,["precision","value"])],2112)):o(P)(o(Ee))?(n(),y(h,{key:2},[c(" 下拉框、横向单选、纵向单选、横向多选、纵向多选、下拉多选框 "),s(o(z),{style:{width:"100%"},multiple:o(Ke),clearable:"",value:ze.value.default_val,"onUpdate:value":a[9]||(a[9]=e=>ze.value.default_val=e),"label-field":"text",placeholder:ke,options:o(Je)},null,8,["multiple","value","options"])],2112)):o(A)(o(Ee))?(n(),y(h,{key:3},[c(" 日期 "),f("div",ce,[s(o(O),{clearable:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[10]||(a[10]=e=>ze.value.default_val=e),placeholder:ke},null,8,["value"]),o(Re)?(n(),y(h,{key:0},["month"===Ne.value.mode?(n(),i(o(L),{key:0,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[11]||(a[11]=e=>Ne.value.value=e),dl],type:"month","input-readonly":"",clearable:"",onConfirm:vl},null,8,["value"])])),_:1},8,["show"])):(n(),i(o(L),{key:1,trigger:"click",show:Ne.value.open},{trigger:r((()=>[s(o(U),{type:"info",onClick:vl},{default:r((()=>[m("选择")])),_:1})])),default:r((()=>[s(o(V),{panel:"",value:Ne.value.value,"onUpdate:value":[a[12]||(a[12]=e=>Ne.value.value=e),rl],format:Ne.value.format,type:Ne.value.componentType,"input-readonly":"",clearable:"",onConfirm:vl},null,8,["value","format","type"])])),_:1},8,["show"]))],64)):(n(),y(h,{key:1},[c(' <n-input\r\n allowClear\r\n :maxLength="255"\r\n v-model:value="dateInfo.value"\r\n @keydown.enter.prevent\r\n :placeholder="defaultPlaceholder"\r\n /> '),s(o(U),{type:"info",class:"date-time-button"},{default:r((()=>[ye,s(o(B),{value:Ne.value.value,"onUpdate:value":[a[13]||(a[13]=e=>Ne.value.value=e),sl],format:Ne.value.format,"input-readonly":"",clearable:""},null,8,["value","format"])])),_:1}),c(' <n-popover trigger="click">\r\n <template #trigger>\r\n <n-button type="info">选择</n-button>\r\n </template>\r\n <n-time-picker\r\n panel\r\n v-model:value="dateInfo.value"\r\n :format="dateInfo.format"\r\n input-readonly\r\n clearable\r\n @update:value="timeChange"\r\n >\r\n <template v-slot:icon>111</template>\r\n\r\n </n-time-picker>\r\n </n-popover> ')],64))])],2112)):o(E)(o(Ee))?(n(),y(h,{key:4},[c(" 选人组件(增加一个选人组件) "),f("div",he,[g(s(o(O),{allowClear:"",maxLength:255,value:ze.value.default_val,"onUpdate:value":a[14]||(a[14]=e=>ze.value.default_val=e),onKeydown:a[15]||(a[15]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:ke},null,8,["value"]),[[k,!1]]),c(' 点击弹出选人组件弹窗 :mainForm="this" '),s(ee,{orgId:e.orgId,defaultValue:ze.value.default_val,onCheckPerson:Xe},null,8,["orgId","defaultValue"]),qe.value?(n(),y("span",_e,M(qe.value),1)):c("v-if",!0),c(' <n-button type="info">选择</n-button> ')])],2112)):(n(),y(h,{key:5},[c(" 其他 "),s(o(O),{value:ze.value.default_val,"onUpdate:value":a[16]||(a[16]=e=>ze.value.default_val=e),onKeydown:a[17]||(a[17]=b(x((()=>{}),["prevent"]),["enter"])),placeholder:"请输入默认值"},null,8,["value"])],2112))])),_:1}),s(o(j),{path:"elem_width",label:"宽度"},{default:r((()=>[s(o(z),{value:ze.value.elem_width,"onUpdate:value":a[18]||(a[18]=e=>ze.value.elem_width=e),placeholder:"请选择宽度",options:He},null,8,["value"])])),_:1}),s(o(j),{path:"isNull",label:"是否必填","label-placement":"left"},{default:r((()=>[s(o(D),{value:Le.value,"onUpdate:value":[a[19]||(a[19]=e=>Le.value=e),a[20]||(a[20]=e=>el("isNull",e))]},null,8,["value"])])),_:1}),o(E)(o(Ee))?(n(),i(o(j),{key:3,"label-placement":"left",path:"isMultiSelect",label:"是否多选"},{default:r((()=>[s(o(D),{value:Ve.value,"onUpdate:value":a[21]||(a[21]=e=>el("isMultiSelect",e))},null,8,["value"])])),_:1})):c("v-if",!0)])),_:1},8,["model"]),s(Z,{visible:Pe.value,options:Te.value,onHandleSaveBatch:nl,onTriggerBatch:We},null,8,["visible","options"])])),_:1},8,["style","title"])])),_:1},8,["class","show","width","bodyStyle"]))}});export{ge as default};
@@ -64,6 +64,7 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
64
64
  useCaliper: any;
65
65
  useCaliperRuler: any;
66
66
  updatePolyline: any;
67
+ getGridInfo: any;
67
68
  init: () => import("../../../es/shared/types").AnyObject;
68
69
  PopupTip: import("vue").DefineComponent<{
69
70
  show: {
@@ -66,6 +66,7 @@ declare const _default: import("vue").DefineComponent<{
66
66
  useCaliper: any;
67
67
  useCaliperRuler: any;
68
68
  updatePolyline: any;
69
+ getGridInfo: any;
69
70
  init: () => AnyObject;
70
71
  PopupTip: import("vue").DefineComponent<{
71
72
  show: {
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,reactive as t,computed as s,onMounted as o,onBeforeUnmount as a,openBlock as l,createElementBlock as i,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as m,createCommentVNode as d}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import w from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as g}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:j,emit:P}){const x=e,b=r(null),M=r(),R=t({show:!1,point:{x:0,y:0},list:[]}),I=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=s((()=>{var e;return null==(e=M.value)?void 0:e.wrapperEl})),E=s((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:$,useCaliper:q,useCaliperRuler:B,updatePolyline:D}=function(){const e=[M,x,P,b,R,I];switch(x.type){case"birthProcess":return g(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return o((()=>{M.value=new f.Canvas(b.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,s;null==(r=null==(e=M.value)?void 0:e.off)||r.call(e),null==(s=null==(t=M.value)?void 0:t.clear)||s.call(t)})),j({redrawPoints:T,select:_,canvas:M,useMeasureRuler:$,useCaliper:q,useCaliperRuler:B,updatePolyline:D}),(e,r)=>(l(),i("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:b},null,512),n(A)?(l(),i(c,{key:0},[h(v,m({propItems:n(S)},R),null,16,["propItems"]),h(n(w),m({propItems:n(S)},I,{show:I.show,"onUpdate:show":r[0]||(r[0]=e=>I.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):d("v-if",!0)],4))}});export{j as default};
1
+ import{defineComponent as e,ref as r,reactive as t,computed as o,onMounted as s,onBeforeUnmount as a,openBlock as i,createElementBlock as l,normalizeStyle as u,unref as n,createElementVNode as p,Fragment as c,createVNode as h,mergeProps as m,createCommentVNode as d}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import v from"./components/PopupTip.vue.js";import g from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"./hooks/useEvent.js";import{useBirthProcessChart as w}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as C}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";import{useElectrocardiogramChart as y}from"./hooks/electrocardiogram/useElectrocardiogramChart.js";var j=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:j,emit:P}){const x=e,I=r(null),b=r(),M=t({show:!1,point:{x:0,y:0},list:[]}),R=t({show:!1,point:{x:0,y:0},list:[],target:null}),A=o((()=>{var e;return null==(e=b.value)?void 0:e.wrapperEl})),E=o((()=>({width:`${x.data.width||800}px`,height:`${x.data.height||500}px`}))),{propItems:S,redrawPoints:T,select:_,clickMenu:F,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}=function(){const e=[b,x,P,I,M,R];switch(x.type){case"birthProcess":return w(...e);case"surgicalAnesthesia":return k(...e);case"electrocardiogram":return y(...e);default:return C(...e)}}();return s((()=>{b.value=new f.Canvas(I.value,{width:S.canvasWidth,height:S.canvasHeight,backgroundColor:"#fff",selection:!1,stopContextMenu:!0,fireRightClick:!0,allowTouchScrolling:!0})})),a((()=>{var e,r,t,o;null==(r=null==(e=b.value)?void 0:e.off)||r.call(e),null==(o=null==(t=b.value)?void 0:t.clear)||o.call(t)})),j({redrawPoints:T,select:_,canvas:b,useMeasureRuler:G,useCaliper:$,useCaliperRuler:q,updatePolyline:B,getGridInfo:D}),(e,r)=>(i(),l("div",{class:"c-fabric-chart",style:u(n(E))},[p("canvas",{ref_key:"canvasRef",ref:I},null,512),n(A)?(i(),l(c,{key:0},[h(v,m({propItems:n(S)},M),null,16,["propItems"]),h(n(g),m({propItems:n(S)},R,{show:R.show,"onUpdate:show":r[0]||(r[0]=e=>R.show=e),onClickMenu:n(F)}),null,16,["propItems","show","onClickMenu"])],64)):d("v-if",!0)],4))}});export{j as default};
@@ -56,3 +56,4 @@ export declare const OVERLAP: {
56
56
  fillCircle: string;
57
57
  };
58
58
  };
59
+ export declare const SMALLCELLNUMBER = 5;
@@ -1 +1 @@
1
- const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}};export{l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,e as TEMPERATURE_MENU};
1
+ const e=[{label:"升温",value:!0,type:"rise"},{label:"药物降温",value:void 0,type:"drugReduce"},{label:"物理降温",value:void 0,type:"physicsReduce"},{label:"不升",value:!0,type:"noRise"}],i=[{label:"药物降痛",value:void 0,type:"drugReduce"},{label:"物理降痛",value:void 0,type:"physicsReduce"}],l=[{label:"修改",type:"change"},{label:"删除",type:"remove"}],r="#2563F4",a="#FF1818",s={yemai:{stroke:a,strokeX:r,strokeWidth:1,strokeWidthX:1,radius:6,angle:45},koumai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r},gangmai:{radius:6,radiusCircle:3,stroke:r,fillCircle:a},xinmai:{radius:6,radiusCircle:3,stroke:a,fillCircle:a},humai:{radius:6,fill:"green"},ermai:{stroke:a,strokeWidth:1,radius:6,radiusCircle:3,fillCircle:r}},d=5;export{l as OTHER_MENU,s as OVERLAP,i as PAIN_MENU,d as SMALLCELLNUMBER,e as TEMPERATURE_MENU};
@@ -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"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,b,j,C,P){const{computedX:S,cumputedY: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 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"../temperature/useShadow.js";import{cloneDeep as k}from"lodash-es";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 +1 @@
1
- import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:s,endY:u,endX:a,showScaleText:f,showNumberText:p,detailRadius:c,points:y,lineStartIndex:d,xCellWidth:h,yCellHeight:m,grid:w={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let x=null;const{computedX:g,cumputedY:v,getYValue:b}=o(i);function S(e){return g(e)*l}function k(e){return v(e)*l}function L(e){return b(e/l)}const j=h*l,G=m*l;function T(){var e;x&&(null==(e=r.canvas)||e.remove(x)),x=null}r.on("mousedown",(async o=>{var i,h;if(await(null==s?void 0:s()),1!==o.button||!o.target||!o.pointer)return;const m=o.target;if(!m.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-m.left)/m.width*m.points.length)+d;let M=b-c,C=b+c;M<=0?(M=0,C=Math.min(2*c,y.length-1)):C>=y.length-1&&(C=y.length-1,M=Math.max(y.length-2*c,0));const W=y.slice(M,C).map(((e,t)=>({x:M+S(t),y:k(e)}))),Y=b-M;let $=0,E=0;W.forEach(((e,t)=>{e.y>W[$].y&&($=t),e.y<W[E].y&&(E=t)}));const X=S(2*c-1),z=W[$].y-W[E].y-1,A=z+30+70,D={x:a-g<=X?g-X:g,y:u-v<=A?v-A:v};T(),x=new e.Group;const P=[new e.Rect({...n,left:D.x,top:D.y,width:X,height:A,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),function(){const n=e=>e%5?w.subLineStyle:null,o=Math.ceil(A/G*5),r=new e.Group(t(o).map((t=>{const o=t*G/5;return new e.Line([0,o,X,o],{...w.mainLineStyle.y,...n(t)})}))),i=Math.ceil(X/j*5),l=new e.Group(t(i).map((t=>{const o=t*j/5;return new e.Line([o,0,o,A],{...w.mainLineStyle.x,...n(t)})})));return new e.Group([l,r],{left:D.x,top:D.y})}(),(I=W.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(I,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:D.x,top:D.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:D.y},i=new e.Line(u(t[$]),{...n,...r,left:D.x+$/t.length*X,stroke:"red"}),l=new e.Line(u(t[E]),{...n,...r,stroke:"blue",left:D.x+E/t.length*X}),s=new e.Line(u(t[o]),{...n,...r,stroke:"green",left:D.x+o/t.length*X});return new e.Group([i,l,s]);function u(e){return[e.x,e.y,e.x,e.y-A]}}(W,Y),(R=W,H=Y,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:D.x+H/R.length*X-5,top:D.y+(R[H].y-R[$].y)/(R[E].y-R[$].y)*z-5+30}))];var R,H,I;f&&P.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:D.x+10,top:D.y+A-30})),p&&P.push(function(t,o){const r={fontSize:16,left:D.x+X/2+10},i=new e.Text(`最大: ${L(t[$].y)} mv`,{...n,...r,fill:"red",top:D.y+A-20}),l=new e.Text(`最小: ${L(t[E].y)} mv`,{...n,...r,fill:"blue",top:D.y+A-40}),s=new e.Text(`当前: ${L(t[o].y)} mv`,{...n,...r,fill:"green",top:D.y+A-60});return new e.Group([i,l,s])}(W,Y)),x.add(...P).addWithUpdate(),null==(i=r.canvas)||i.add(x),null==(h=r.canvas)||h.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==s?void 0:s()),1===e.button&&T()}))}export{r as useDetailEvent};
1
+ import{fabric as e}from"../../../../../../shared/utils/fabricjs/index.js";import{range as t}from"lodash-es";import{defaultStyle as n}from"../../useDraw.js";import{useElectrocardiogramCumputedPoint as o}from"../../useCumputedPoint.js";import"../../useEvent.js";import"vue";import"date-fns";import"../../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";function r(r,i){const{scale:l,beforeEvent:a,endY:s,endX:u,showScaleText:c,showNumberText:y,detailRadius:f,points:p,lineStartIndex:h,xCellWidth:d,yCellHeight:m,grid:x={subLineStyle:{},mainLineStyle:{x:{},y:{}}}}=i;let w=null;const{computedX:g,computedY:v,getYValue:b}=o(i);function S(e){return g(e)*l}function L(e){return v(e)*l}function k(e){return b(e/l)}const M=m*l;function j(){var e;w&&(null==(e=r.canvas)||e.remove(w)),w=null}r.on("mousedown",(async o=>{var i,d;if(await(null==a?void 0:a()),1!==o.button||!o.target||!o.pointer)return;const m=o.target;if(!m.points)return;const{x:g,y:v}=o.pointer,b=Math.floor((g-m.left)/m.width*m.points.length)+h;let G=b-f,T=b+f;G<=0?(G=0,T=Math.min(2*f,p.length-1)):T>=p.length-1&&(T=p.length-1,G=Math.max(p.length-2*f,0));const C=p.slice(G,T).map(((e,t)=>({x:G+S(t),y:L(e)}))),W=b-G;let Y=0,$=0;C.forEach(((e,t)=>{e.y>C[Y].y&&(Y=t),e.y<C[$].y&&($=t)}));const E=S(2*f-1),X=C[Y].y-C[$].y-1,z=X+30+70,A={x:u-g<=E?g-E:g,y:s-v<=z?v-z:v};j(),w=new e.Group;const D=[new e.Rect({...n,left:A.x,top:A.y,width:E,height:z,stroke:"transparent",fill:"#fff",shadow:new e.Shadow({color:"rgba(0, 0, 0, 0.3)",blur:15,offsetX:8,offsetY:8})}),function(n,o){const r=e=>e%5?x.subLineStyle:null,i=M/5,l=30+n[Y].y/Math.abs(n[Y].y-n[$].y)*X,a=Math.ceil(l/i),s=Math.ceil((z-l)/i);function u(t,n){return new e.Line([A.x,A.y+t,A.x+E,A.y+t],{...x.mainLineStyle.x,...r(n)})}const c=new e.Group([...t(s).map((e=>u(e*i+l,e))),...t(a).map((e=>u(-e*i+l,e)))]),y=o/n.length*E,f=Math.ceil(y/i),p=Math.ceil((E-y)/i);function h(t,n){return new e.Line([A.x+t,A.y,A.x+t,A.y+z],{...x.mainLineStyle.y,...0===n?x.subLineStyle:r(n)})}const d=new e.Group([...t(p).map((e=>h(e*i+y,e))),...t(f).map((e=>h(-e*i+y,e)))]);return new e.Group([d,c])}(C,W),(H=C.map((({x:e,y:t})=>({x:e,y:-t}))),new e.Polyline(H,{...n,fill:"transparent",stroke:"red",strokeWidth:1,left:A.x,top:A.y+30})),function(t,o){const r={strokeDashArray:[3,4],width:3,top:A.y},i=new e.Line(s(t[Y]),{...n,...r,left:A.x+Y/t.length*E,stroke:"red"}),l=new e.Line(s(t[$]),{...n,...r,stroke:"blue",left:A.x+$/t.length*E}),a=new e.Line(s(t[o]),{...n,...r,stroke:"green",left:A.x+o/t.length*E});return new e.Group([i,l,a]);function s(e){return[e.x,e.y,e.x,e.y-z]}}(C,W),(P=C,R=W,new e.Circle({...n,radius:5,fill:"transparent",stroke:"green",strokeWidth:1,left:A.x+R/P.length*E-5,top:A.y+30+(P[Y].y-P[R].y)/Math.abs(P[Y].y-P[$].y)*X-5}))];var P,R,H;c&&D.push(new e.Text(`x${l}`,{...n,fill:"black",fontSize:20,left:A.x+10,top:A.y+z-30})),y&&D.push(function(t,o){const r={fontSize:16,left:A.x+E/2+10},i=new e.Text(`最大: ${k(t[Y].y)} mv`,{...n,...r,fill:"red",top:A.y+z-20}),l=new e.Text(`最小: ${k(t[$].y)} mv`,{...n,...r,fill:"blue",top:A.y+z-40}),a=new e.Text(`当前: ${k(t[o].y)} mv`,{...n,...r,fill:"green",top:A.y+z-60});return new e.Group([i,l,a])}(C,W)),w.add(...D).addWithUpdate(),null==(i=r.canvas)||i.add(w),null==(d=r.canvas)||d.discardActiveObject()})),r.on("mouseup",(async e=>{await(null==a?void 0:a()),1===e.button&&j()}))}export{r as useDetailEvent};
@@ -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{defaultTextStyle as n,drawLine as i}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as s}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";function l(l,u,d){const{computedX:c,cumputedY:m}=s(u),{borderStyle:h,originX:f,originY:g,xCellWidth:p,yCellHeight:v,canvasWidth:x,canvasHeight:b,dataList:j,columnNumber:w,gridYNumber:C,gridXNumber:k}=u,y=new Set,S=new Set;function E(t=0){j.forEach(((r,o)=>{if(o===j.length-1&&arguments.length)return;const{x:i,y:a}=r.origin,s=~~(r.data.length/w),l=r.data.reduce(((e,r,n)=>{const i=o<12&&n>=t&&n<=t+s||12===o?[{x:c(e.length+1),y:m(-+r)}]:[];return e.concat(i)}),[]),h=new e.Polyline(l,{fill:"transparent",stroke:"red",strokeWidth:1,left:i,top:a,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0});if(N(h,{...u.config,...u,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>d.value&&Promise.reject()}),h.startIdx=t,o<j.length-1?y.add(h):S.add(h),arguments.length)return;const f=new e.Text(String(r.title),{...n,left:i+p,top:a});S.add(f)}));const r=arguments.length?[...y]:[...y,...S];l.value.add(...r)}function N(e,t){o(e,t)}a(l,{...u,gridXNumber:5*k,gridYNumber:5*C,xCellWidth:p/5,yCellHeight:v/5,grid:{...u.grid,subXCell:5,subYCell:5}}),function(){const{strokeWidth:t}=h,r=new e.Rect({...h,width:x-t,height:b-t,left:f,top:g,fill:"transparent"});l.value.add(r)}(),function(){const e=x/w,t=[];r(w).forEach((r=>{if(r+1>=w)return;const o=(r+1)*e,n=i([o,0,o,b],{stroke:"#000"});t.push(n)})),l.value.add(...t)}(),E();return{updatePolyline:t((t=>{if(1===w)return;const r=j[j.length-1].data.length,o=~~(r/w),n=t/100*r-o/2,i=n+o>r?r-o:Math.max(0,n);e.util.requestAnimFrame((()=>{if(y.size){const[e]=[...y];if(e.startIdx===i)return;[...y].forEach((e=>l.value.remove(e))),y.clear()}E(i)}))}),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{defaultTextStyle as n,drawLine as i}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useElectrocardiogramCumputedPoint as a}from"../useCumputedPoint.js";import"../useEvent.js";import"vue";import"date-fns";import"../temperature/useShadow.js";import{SMALLCELLNUMBER as l}from"../../constants/index.js";import"naive-ui";function d(d,u,c){const{computedX:m,computedY:h}=a(u),{borderStyle:f,originX:p,originY:g,xCellWidth:v,yCellHeight:x,canvasWidth:b,canvasHeight:j,dataList:w,columnNumber:C,gridYNumber:k,gridXNumber:y}=u,S=new Set,E=new Set;function N(t=0){w.forEach(((r,o)=>{if(o===w.length-1&&arguments.length)return;const{x:i,y:s}=r.origin,a=~~(r.data.length/C),l=r.data.reduce(((e,r,n)=>{const i=o<12&&n>=t&&n<=t+a||12===o?[{x:m(e.length+1),y:h(-+r)}]:[];return e.concat(i)}),[]),d=new e.Polyline(l,{fill:"transparent",stroke:"red",strokeWidth:1,left:i,top:s,hasControls:!1,hasBorders:!1,hoverCursor:"default",lockMovementX:!0,lockMovementY:!0,objectCaching:!0});if(X(d,{...u.config,...u,lineStartIndex:t,points:r.data,scale:4,showScaleText:!0,showNumberText:!0,detailRadius:370,beforeEvent:()=>c.value&&Promise.reject()}),d.startIdx=t,o<w.length-1?S.add(d):E.add(d),arguments.length)return;const f=new e.Text(String(r.title),{...n,left:i+v,top:s});E.add(f)}));const r=arguments.length?[...S]:[...S,...E];d.value.add(...r)}function X(e,t){o(e,t)}s(d,{...u,gridXNumber:y*l,gridYNumber:k*l,xCellWidth:v/l,yCellHeight:x/l,grid:{...u.grid,subXCell:l,subYCell:l}}),function(){const{strokeWidth:t}=f,r=new e.Rect({...f,width:b-t,height:j-t,left:p,top:g,fill:"transparent"});d.value.add(r)}(),function(){const e=b/C,t=[];r(C).forEach((r=>{if(r+1>=C)return;const o=(r+1)*e,n=i([o,0,o,j],{stroke:"#000"});t.push(n)})),d.value.add(...t)}(),N();return{updatePolyline:t((t=>{if(1===C)return;const r=w[w.length-1].data.length,o=~~(r/C),n=t/100*r-o/2,i=n+o>r?r-o:Math.max(0,n);e.util.requestAnimFrame((()=>{if(S.size){const[e]=[...S];if(e.startIdx===i)return;[...S].forEach((e=>d.value.remove(e))),S.clear()}N(i)}))}),150)}}export{d as useElectrocardiogram};
@@ -8,4 +8,9 @@ export declare function useElectrocardiogramChart(canvas: Ref<fabric.Canvas>, pr
8
8
  useMeasureRuler: Ref<any>;
9
9
  useCaliper: Ref<any>;
10
10
  useCaliperRuler: Ref<any>;
11
+ getGridInfo: () => {
12
+ cellWidth: number;
13
+ cellHeight: number;
14
+ smallCellNumber: number;
15
+ };
11
16
  };
@@ -1 +1 @@
1
- import{ref as e,computed as a,reactive as t,unref as u,watch as r}from"vue";import{defaultBorderStyle as l}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as i}from"./useElectrocardiogram.js";import{useMeasureInstrument as n}from"./useMeasureInstrument.js";function o(o,d,s,m,v,c){const g=e(),h=e(),p=e(),f=e(),b=a((()=>d.data.width)),C=a((()=>d.data.height)),M=a((()=>(b.value-0)/j.value)),N=a((()=>(C.value-0)/w.value)),j=a((()=>{const{dataList:e,config:a}=d.data,t=e[e.length-1].data.length/a.hz;return Math.ceil(t/a.mainXCellValue)})),w=a((()=>{const{config:e}=d.data;return Math.ceil((13*y.value+2*e.mainYCellValue)/e.mainYCellValue)})),y=a((()=>{const{dataList:e,config:a}=d.data,t=e[e.length-1].data,u=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*u:"v"===a.valueUnit?1e3*u:u})),Y=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),x=a((()=>{const{mode:e="2-6"}=d.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),L=a((()=>{const{dataList:e,width:a,config:t}=d.data,{columnNumber:u,rowNumber:r}=x.value,l=a/u,i=y.value/t.mainYCellValue*N.value+N.value,n=N.value;return e.map(((a,t)=>{const u=t===e.length-1?r:t%r;return{...a,origin:{x:(t===e.length-1?0:Math.floor(t/r))*l,y:u*i+n}}}))})),R=t({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...l,...d.data.borderStyle||{}},grid:d.data.grid,originX:0,endX:b.value,originY:0,endY:C.value,xCellWidth:M.value,yCellHeight:N.value,gridXNumber:j.value,gridYNumber:w.value,event:Y.value,dataList:L.value,columnNumber:u(x).columnNumber,config:d.data.config});return r((()=>o.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:u}=n(o,R),{updatePolyline:r}=i(o,R,a);h.value=e,p.value=t,f.value=u,g.value=r}()}),{immediate:!0}),{propItems:R,updatePolyline:g,useMeasureRuler:h,useCaliper:p,useCaliperRuler:f}}export{o as useElectrocardiogramChart};
1
+ import{ref as e,computed as a,reactive as t,unref as l,watch as u}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import{SMALLCELLNUMBER as i}from"../../constants/index.js";import"naive-ui";import"@vueuse/core";import{useElectrocardiogram as n}from"./useElectrocardiogram.js";import{useMeasureInstrument as o}from"./useMeasureInstrument.js";function s(s,d,m,v,c,g){const h=e(),p=e(),f=e(),b=e(),C=a((()=>d.data.width)),N=a((()=>d.data.height)),j=a((()=>(C.value-0)/w.value)),M=a((()=>(N.value-0)/x.value)),w=a((()=>{const{dataList:e,config:a}=d.data,t=e[e.length-1].data.length/a.hz;return Math.ceil(t/a.mainXCellValue)})),x=a((()=>{const{config:e}=d.data;return Math.ceil((13*y.value+2*e.mainYCellValue)/e.mainYCellValue)})),y=a((()=>{const{dataList:e,config:a}=d.data,t=e[e.length-1].data,l=Math.max(...t)-Math.min(...t);return"uv"===a.valueUnit?.001*l:"v"===a.valueUnit?1e3*l:l})),Y=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0}})),L=a((()=>{const{mode:e="2-6"}=d.data,[a,t]=e.split("-").map((e=>+e));return{columnNumber:a,rowNumber:t}})),R=a((()=>{const{dataList:e,width:a,config:t}=d.data,{columnNumber:l,rowNumber:u}=L.value,r=a/l,i=y.value/t.mainYCellValue*M.value+M.value,n=M.value;return e.map(((a,t)=>{const l=t===e.length-1?u:t%u;return{...a,origin:{x:(t===e.length-1?0:Math.floor(t/u))*r,y:l*i+n}}}))})),V=t({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},grid:d.data.grid,originX:0,endX:C.value,originY:0,endY:N.value,xCellWidth:j.value,yCellHeight:M.value,gridXNumber:w.value,gridYNumber:x.value,event:Y.value,dataList:R.value,columnNumber:l(L).columnNumber,config:d.data.config});return u((()=>s.value),(e=>{e&&function(){const{useMeasureRuler:e,flag:a,useCaliper:t,useCaliperRuler:l}=o(s,V),{updatePolyline:u}=n(s,V,a);p.value=e,f.value=t,b.value=l,h.value=u}()}),{immediate:!0}),{propItems:V,updatePolyline:h,useMeasureRuler:p,useCaliper:f,useCaliperRuler:b,getGridInfo:function(){return{cellWidth:j.value,cellHeight:M.value,smallCellNumber:i}}}}export{s 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}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function g(g,y,h,k,x){const{computedX:L,cumputedY:P,getXValue:b,getYValue:w}=r(y),{xCellWidth:A,pointSelectionStyle:I,originX:C,endX:K,originY:j,endY:E,event:X,scaleValues:M,xAxis:T,startTime:V,timeXCell:Y,itemList:S,dialog:$}=y,F=new Map,O=new Set,D=p(M);let _=[],z=null;const N=new Set;l(g,y);const{getEqualXTypes:G,handleAddPrevent:J,setPrevAndNextPoint:q}=s(g,h,y),{pause:R,resume:W}=v((()=>{!function(){if(!N.size)return;for(const e of N)e.set("opacity",1===e.opacity?.5:1);g.value.renderAll()}()}),800);function B(){D.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=P(t.type,t.range,n),a=i([C,r,K,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});X.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${o} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),g.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.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:se()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function Q(e){$.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&g.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];F.set(e.key,[]),function(e,t){N.size&&[...N].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&N.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,x=u;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:I="",key:C,type:K="circle"}=x,j=ae(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],M={origin:{data:l,title:I,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...y.event.hovered?y.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:y.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...M}):e&&(M.leftLine=null,p=o(K,{left:e[0],top:e[1],...M}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){X.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(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),X.hovered&&le(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/A);if(a>l+A){if(0===_.length){te(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+A*c;if(_.every((e=>e.left!==u))){const t=b(u),n=w(f.type,s);_.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),te(e,[...e.prevPointer,u,s])}if(_.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+A*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-A))/A),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:b(t),value:w(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},_.splice(l,0,a),te(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=F.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=A/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?ee(e,"#999"):ee(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(_.length>0&&i<_[_.length-1].left){for(const e of O)e.left>i&&(e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of O)e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:b(e.left),value:w(t,e.top)}};if(g.value.discardActiveObject(),_.length>0){const l=D.find((e=>e.type===t));let r=-1;const a=_.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ie({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));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ne({...o,data:a,coincideIndex:r})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),ne(o,"change")}}))}(p),null==(d=F.get(u.key))||d.push(p))}(ae(l,n),l,c,e)})),Promise.all(F.get(e.key)).then((t=>{const n=f.filter((e=>e));q(t),g.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||N.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ee(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 te(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,O.add(l),g.value.add(r,l)}))}function ne(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=D.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}}ie({dataIndex:s,scaleValue:f})}function ie(e){var t,n,i;if(O.size&&(null==(t=g.value)||t.remove(...oe([...O]))),O.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=g.value)||n.remove(...oe(F.get(o.key))),F.delete(o.key),Z(o,t,i)}else F.size&&(null==(i=g.value)||i.remove(...oe(se()))),F.clear(),B()}function oe(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 le(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:w(i,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${b(e.left).slice(-5)}`],k.show=!0}function re(e){e.setCoords();const t=6e4/Y,n=e.prevPoint?e.prevPoint.left+t:C,i=K;e.top<j&&e.set("top",j),e.top>E&&e.set("top",E),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ae(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),i=P(t.type,t.range,e.value);return[n,i<j?j:i>E?E:i]}}function se(){return Array.from(F.values()).flat()}return e((()=>{R()})),B(),function(){if(!X.evented)return;let e=!1,i={x:0,y:0};g.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=C&&t<=K&&n>=j&&n<=E)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);se().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&x.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),S.forEach((n=>{G(se(),t,"key",2*A).includes(n.linkKey||n.key)||x.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===x.list.length&&(x.show=!1,J("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{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 ne(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),g.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),g.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;z&&g.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...I,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:i,endPos:o.pointer},g.value.add(z)}))}(),{redrawPoints:ie,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),ne(n,"remove")):(Object.assign(n,{data:{time:b(e.pointer.x),value:w(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),ne({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:re,setPopup:le,updateData:ne,getGridPoints:se,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{g 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}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import"naive-ui";import{useIntervalFn as v}from"@vueuse/core";function g(g,y,h,k,x){const{computedX:L,computedY:P,getXValue:b,getYValue:w}=r(y),{xCellWidth:A,pointSelectionStyle:I,originX:C,endX:K,originY:j,endY:E,event:X,scaleValues:M,xAxis:T,startTime:V,timeXCell:Y,itemList:S,dialog:$}=y,F=new Map,O=new Set,D=p(M);let _=[],z=null;const N=new Set;l(g,y);const{getEqualXTypes:G,handleAddPrevent:J,setPrevAndNextPoint:q}=s(g,h,y),{pause:R,resume:W}=v((()=>{!function(){if(!N.size)return;for(const e of N)e.set("opacity",1===e.opacity?.5:1);g.value.renderAll()}()}),800);function B(){D.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=P(t.type,t.range,n),a=i([C,r,K,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});X.hovered&&o&&(a.on("mousemove",(({pointer:e})=>{k.point={...e||{x:a.left,y:a.top}},k.list=[`${o} ${n}${t.unit||""}`],k.show=!0})),a.on("mouseout",(()=>{k.show=!1}))),g.value.add(a)}a(n),a(o),a(l),a(r)}(t,e),Z(t,n,e))}))}))}function H(e=[]){if(!(null==z?void 0:z.areaPos))return[];const{startPos:t,endPos:n}=z.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:se()).filter((e=>e.left>=i&&e.left<=o&&e.top>=l&&e.top<=r))}function Q(e){$.warning({maskClosable:!1,closeOnEsc:!1,title:"警告",content:"确认删除当前选中的节点?",positiveText:"确定",negativeText:"取消",onPositiveClick:()=>{e(),U()},onNegativeClick:()=>U(),onClose:()=>U()})}function U(){z&&g.value.remove(z),z=null}function Z(e,t,n){var l;const{type:r,unit:a,dataList:s=[]}=n,f=[];F.set(e.key,[]),function(e,t){N.size&&[...N].forEach((n=>{const{dataIndex:i,type:o}=n.origin;i===t&&o===e&&N.delete(n)}))}(r,t),null==(l=e.list)||l.forEach(((l,c)=>{!function(e,l,c,u){var d;let p,v,x=u;l.key&&(x=s.find((e=>e.key===l.key)));const{pointAttr:L={},lineAttr:P={},title:I="",key:C,type:K="circle"}=x,j=ae(u.list[c+1],n);e&&j&&!l.breakpoint&&e[0]!==j[0]&&(v=i([...e,...j],P));const E=f[c-1],M={origin:{data:l,title:I,key:u.key,selfKey:C,unit:a,type:r,dataIndex:t,index:c,lineAttr:P},__type:"main",leftLine:E,rightLine:v,...L,...y.event.hovered?y.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:y.event};E?p=o(K,{left:E.get("x2"),top:E.get("y2"),...M}):e&&(M.leftLine=null,p=o(K,{left:e[0],top:e[1],...M}));f.push(v),p&&(p.originLeft=p.left,p.originTop=p.top,function(e){X.hovered&&(e.on("mouseover",(()=>{le(e,"hover")})),e.on("mouseout",(()=>{k.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{re(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),X.hovered&&le(e),function(e){var t,n,i,o;const{originLeft:l,originTop:r,left:a,top:s,origin:f}=e,c=~~((a-l)/A);if(a>l+A){if(0===_.length){te(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+A*c;if(_.every((e=>e.left!==u))){const t=b(u),n=w(f.type,s);_.push({data:{time:t,value:n,...f.selfKey!==f.key?{key:f.selfKey}:{}},left:u,top:s}),te(e,[...e.prevPointer,u,s])}if(_.length<c&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+A*l,r=_.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=_.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const a=JSON.parse(JSON.stringify(r)),s=_[l-1]||{left:n,top:i},f=~~((r.left-(t-A))/A),c=(r.top-s.top)/f;a.top=s.top+c,a.left=t,a.data={time:b(t),value:w(o.type,a.top),...o.selfKey!==o.key?{key:o.selfKey}:{}},_.splice(l,0,a),te(e,[s.left,s.top,a.left,a.top])}}l++}}(e,c),e.nextPoint){const t=F.get(f.key);!function(e,t){const{left:n,top:i,origin:o}=t,l=A/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?ee(e,"#999"):ee(e,e.origin.lineAttr.stroke))}))}}!function(e){var t,n;const{left:i}=e;if(_.length>0&&i<_[_.length-1].left){for(const e of O)e.left>i&&(e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){null==(n=null==(t=e.leftLine)?void 0:t.set)||n.call(t,e.origin.lineAttr);for(const e of O)e.leftLine&&g.value.remove(e.leftLine),g.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)}(e)})),e.on("mouseup",(t=>{if(k.show=!1,1===t.button){const{type:t,selfKey:n,dataIndex:i}=e.origin,o={...e.origin,data:{...e.origin.data,time:b(e.left),value:w(t,e.top)}};if(g.value.discardActiveObject(),_.length>0){const l=D.find((e=>e.type===t));let r=-1;const a=_.map((e=>e.data));if(e.nextPoint){if(2.5!==e.scaleX)return void ie({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));h("add",{...m(o,["index","selfKey","lineAttr"]),dataIndex:s,key:n,data:a}),ne({...o,data:a,coincideIndex:r})}else h("change",{...m(o,["selfKey","lineAttr"]),key:n}),ne(o,"change")}}))}(p),null==(d=F.get(u.key))||d.push(p))}(ae(l,n),l,c,e)})),Promise.all(F.get(e.key)).then((t=>{const n=f.filter((e=>e));q(t),g.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||N.add(e)}))}r(n,"max"),r(i,"min"),r(o,"max"),r(l,"min")}(t,e)}))}function ee(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 te(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,O.add(l),g.value.add(r,l)}))}function ne(e,t="add",n=1){const{data:i,index:o,key:l,type:r,coincideIndex:a}=e;let{dataIndex:s}=e;const f=D.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}}ie({dataIndex:s,scaleValue:f})}function ie(e){var t,n,i;if(O.size&&(null==(t=g.value)||t.remove(...oe([...O]))),O.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=g.value)||n.remove(...oe(F.get(o.key))),F.delete(o.key),Z(o,t,i)}else F.size&&(null==(i=g.value)||i.remove(...oe(se()))),F.clear(),B()}function oe(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 le(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;k.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:w(i,e.top)}`;k.list=[`${n} ${r}${l||""}`,`时间 ${b(e.left).slice(-5)}`],k.show=!0}function re(e){e.setCoords();const t=6e4/Y,n=e.prevPoint?e.prevPoint.left+t:C,i=K;e.top<j&&e.set("top",j),e.top>E&&e.set("top",E),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}function ae(e,t){if(u(e)&&function(e){const t=Date.parse(T.list.at(-1)),n=d(e);return n>=V&&n<=t}(e.time)){const n=L(e.time),i=P(t.type,t.range,e.value);return[n,i<j?j:i>E?E:i]}}function se(){return Array.from(F.values()).flat()}return e((()=>{R()})),B(),function(){if(!X.evented)return;let e=!1,i={x:0,y:0};g.value.on("mouse:up",(t=>{if(3===t.button&&function(e){const{x:t=0,y:n=0}=e.pointer||{};if(t>=C&&t<=K&&n>=j&&n<=E)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);se().forEach((i=>{"main"===i.__type&&i.left>t&&i.left<n&&i.top>o&&i.top<l&&x.list.push({renderItem:()=>i.origin.title,origin:{...i.origin},mode:"remove",pointer:e.pointer})})),1===x.list.length&&(x.show=!1,console.log("当前时间段内无可删除节点"))}else i(e.pointer,null,["新增节点"]),S.forEach((n=>{G(se(),t,"key",2*A).includes(n.linkKey||n.key)||x.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===x.list.length&&(x.show=!1,J("repeat"),console.log("当前时间段内无可新增节点"));function i(e,t,n){Object.assign(x,{point:e,show:!0,target:t,list:n})}}(t),1===t.button&&e){e=!1;const t=H();t.length>0?Q((()=>{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 ne(n[0],"remove",n.length),n.map((e=>({...m(e,["selfKey","lineAttr"]),key:e.selfKey})))}))}(t);h("remove",e)})):a.emit(z)}})),g.value.on("mouse:down",(t=>{1!==t.button||t.target||(e=!0,i=t.pointer)})),g.value.on("mouse:move",(o=>{if(!e)return;const{x:l,y:r}=i,{x:a,y:s}=o.pointer;z&&g.value.remove(z),z=new t.Rect({...n,fill:"#CAF982",opacity:.4,...I,left:l,top:r,width:a-l,height:s-r,objectCaching:!0}),z.areaPos={startPos:i,endPos:o.pointer},g.value.add(z)}))}(),{redrawPoints:ie,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(h("remove",n),ne(n,"remove")):(Object.assign(n,{data:{time:b(e.pointer.x),value:w(e.origin.type,e.pointer.y),...e.origin.linkKey?{key:e.origin.key}:{}}}),h("add",n),ne({...n,key:e.origin.linkKey||e.origin.key}))},moveLimit:re,setPopup:le,updateData:ne,getGridPoints:se,getContainPoints:H,showDialog:Q,removeCurrentSelection:U}}export{g as useCenter};
@@ -2,7 +2,7 @@ import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { IObject, IPropItems, IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
4
4
  import { AnyObject } from '../../../../../../es/shared/types';
5
- export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, computedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
5
+ export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, computedX: Function, computedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
6
  clickMenu: ({ item, target }: {
7
7
  item: any;
8
8
  target: any;
@@ -1,6 +1,6 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { IPropItems, IPointTipProps, IObject } from '../../../../../../es/components/fabric-chart/src/interface';
4
- export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, setPopup: Function, pointTipProps: IPointTipProps, computedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function, gridPoints: Set<IObject>): {
4
+ export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, setPopup: Function, pointTipProps: IPointTipProps, computedX: Function, computedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function, gridPoints: Set<IObject>): {
5
5
  drawScaleValue: (yScaleValueList: any[]) => void;
6
6
  };
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as p}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,S,b,w,Y){const C=15,x=e(),D=e(),j=e(),V=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),H=t((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||C)||0})),X=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),L=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),I=t((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),M=t((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),N=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+V.value[0]+V.value[2]})),O=t((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>O.value-V.value[2]*z.value)),$=t((()=>{const{top:e,left:t}=y.data;return e.titleWidth+A.value})),k=t((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),G=t((()=>k.value-V.value[2]*T.value)),R=t((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+X.value+L.value})),q=t((()=>R.value+V.value[0]*T.value)),z=t((()=>(O.value-$.value)/P.value)),T=t((()=>(k.value-R.value)/N.value)),A=t((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=$.value-z.value;const r=a.date.startDate||s(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{n+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:n,center:n+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:r(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{var e,t;const{left:a}=y.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),_=t((()=>{const{grid:e}=y.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.endY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value),t})),te=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.originY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ue=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...u,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:X.value,operationDaysHeight:L.value,xScalevalueHeight:I.value,topList:ae.value,breathingHeight:M.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:N.value,iconsWidth:A.value,originX:$.value,originY:R.value,originYLimit:q.value,endX:O.value,endXLimit:W.value,endY:k.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:y.data.config||{},surplusCell:V.value});function ie(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,cumputedY:re,getXValue:oe,getYValue:se}=i(ue);return l((()=>f.value),(e=>{e&&function(){v(f,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=p(f,ue,S,ne,re,oe,se,y.addRenderItem,w,Y);D.value=l,j.value=u;const{drawScaleValue:r}=c(f,ue,S,e,w,ne,re,oe,se,t,a,i);h(f,ue,r),g(f,ue),m(f,ue,ne);const{select:o}=n(f,ue,S);x.value=o}()}),{immediate:!0}),{propItems:ue,redrawPoints:D,select:x,clickMenu:j}}export{f as useTemperatureChart};
1
+ import{ref as e,computed as t,reactive as a,watch as l}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as i}from"../useCumputedPoint.js";import{useCanvasEvent as n}from"../useEvent.js";import{setOtherType as r,getFloorNumber as o}from"../../utils/index.js";import"lodash-es";import{format as s,addDays as d}from"date-fns";import"naive-ui";import"@vueuse/core";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as h}from"./useRight.js";import{useCenter as p}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,S,b,w,Y){const C=15,x=e(),D=e(),j=e(),V=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.surplusCell)||[0,0,0,0]})),H=t((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||C)||0})),X=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),L=t((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),I=t((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),M=t((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),P=t((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+V.value[1]+V.value[3]})),N=t((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+V.value[0]+V.value[2]})),O=t((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>O.value-V.value[2]*z.value)),$=t((()=>{const{top:e,left:t}=y.data;return e.titleWidth+A.value})),k=t((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),G=t((()=>k.value-V.value[2]*T.value)),R=t((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+X.value+L.value})),q=t((()=>R.value+V.value[0]*T.value)),z=t((()=>(O.value-$.value)/P.value)),T=t((()=>(k.value-R.value)/N.value)),A=t((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=$.value-z.value;const r=a.date.startDate||s(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(r):e.concat(s(d(new Date(r.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{n+=z.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:n,center:n+z.value/2,scaleCell:(l-a)/z.value}})))).flat()})),E=t((()=>ie("breathe"))),F=t((()=>ie("pulse"))),J=t((()=>ie("temperature"))),K=t((()=>ie("pain"))),Q=t((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=t((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:r(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Z=t((()=>{var e,t;const{left:a}=y.data,l=a.yScaleValue.findIndex((e=>"pain"===e.type));return l>-1&&(null==(t=null==(e=a.yScaleValue[l].dataList)?void 0:e[0])?void 0:t.show)?l:-1})),_=t((()=>{const{grid:e}=y.data;return-1===Z.value?0:T.value*e.subYCell})),ee=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.endY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value),t})),te=t((()=>{const{left:e}=y.data,t={originY:q.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?t.originY=q.value+_.value:Z.value===e.yScaleValue.length-1&&(t.endY=G.value-_.value),t})),ae=t((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=t((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};if(null==(e=null==l?void 0:l.list)?void 0:e.length){const e=(null==u?void 0:u.showdetailedScale)?l.list.reduce((e=>{const t=e[e.length-1];return t?e.concat([t+1,t+2]):e.concat([92])}),[]):[],t=l.list.map((e=>o(1.8*e+32)));Object.assign(u,{list:t,detailedList:e,spaceGridNumber:l.spaceGridNumber})}return u})),ue=a({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...u,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:X.value,operationDaysHeight:L.value,xScalevalueHeight:I.value,topList:ae.value,breathingHeight:M.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:P.value,gridYNumber:N.value,iconsWidth:A.value,originX:$.value,originY:R.value,originYLimit:q.value,endX:O.value,endXLimit:W.value,endY:k.value,xCellWidth:z.value,yCellHeight:T.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:y.data.config||{},surplusCell:V.value});function ie(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?T.value/((l[1]-l[0])/a.spaceGridNumber):0}const{computedX:ne,computedY:re,getXValue:oe,getYValue:se}=i(ue);return l((()=>f.value),(e=>{e&&function(){v(f,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u,gridPoints:i}=p(f,ue,S,ne,re,oe,se,y.addRenderItem,w,Y);D.value=l,j.value=u;const{drawScaleValue:r}=c(f,ue,S,e,w,ne,re,oe,se,t,a,i);h(f,ue,r),g(f,ue),m(f,ue,ne);const{select:o}=n(f,ue,S);x.value=o}()}),{immediate:!0}),{propItems:ue,redrawPoints:D,select:x,clickMenu:j}}export{f as useTemperatureChart};
@@ -2,19 +2,19 @@ import { IPointType } from '../interface';
2
2
  import { AnyObject } from '../../../../../es/shared/types';
3
3
  export declare function useCumputedPoint(propItems: AnyObject): {
4
4
  computedX: (value: number | string, setAllCenter?: boolean) => any;
5
- cumputedY: (type: IPointType, scaleValueList: number[], value: number | string) => number;
5
+ computedY: (type: IPointType, scaleValueList: number[], value: number | string) => number;
6
6
  getXValue: (pointX: number) => string | undefined;
7
7
  getYValue: (type: IPointType, pointY: number) => number;
8
8
  };
9
9
  export declare function useBirthProcessCumputedPoint(propItems: AnyObject): {
10
10
  computedX: (value: number | string) => any;
11
- cumputedY: (key: string, range: [number, number], value: number | string) => number;
11
+ computedY: (key: string, range: [number, number], value: number | string) => number;
12
12
  getXValue: (pointX: number) => string;
13
13
  getYValue: (key: string, pointY: number) => number;
14
14
  };
15
15
  export declare function useElectrocardiogramCumputedPoint(propItems: AnyObject): {
16
16
  computedX: (index: number) => number;
17
- cumputedY: (value: number) => number;
17
+ computedY: (value: number) => number;
18
18
  getXValue: (pointX: number) => number;
19
19
  getYValue: (pointY: number) => number;
20
20
  };
@@ -1 +1 @@
1
- import{format as n}from"date-fns";import{getTime as t,getFloorNumber as e}from"../utils/index.js";function i(i){const{xScaleList:u,xCellWidth:l,left:r,vitalSignsOriginY:c,painOriginY:o,canvasWidth:a}=i;return{computedX:function(n,e=!1){const i=t(n),[l]=u,r=u.at(-1);if(i<l.start)return 0;if(i>r.end)return a;const c=u.findIndex((n=>n.end>=i));if(c>-1){return u[c].center}},cumputedY:function(n,t,e){const u=i[`${n}YCell`],l=+e-Math.min(...t);return("pain"===n?o.endY:c.endY)-u*l},getXValue:function(t){const e=u.findIndex((n=>n.left+l>=t));if(e>-1){const i=u[e],l=t-i.left,r=i.scaleCell*l,c=i.start+r;return n(new Date(c),"yyyy-MM-dd HH:mm")}},getYValue:function(n,t){var u;const l=i[`${n}YCell`],a=(null==(u=r.yScaleValue.find((t=>t.type===n)))?void 0:u.list)||[],d=a.length?Math.min(...a):0,f="pain"===n?o.endY:c.endY;return e((f-t)/l+d)}}}function u(i){const{xAxis:u,originX:l,originY:r,xCellWidth:c,endY:o,timeXCell:a,startTime:d,scaleValues:f}=i;return{computedX:function(n){return(t(n)-d)/a+l},cumputedY:function(n,t,e){const[u]=t;return o-(+e-u)*i[`${n}YCell`]},getXValue:function(t){return n(new Date((t-l)*a+d),"yyyy-MM-dd HH:mm")},getYValue:function(n,t){const u=f.find((t=>[t.key,t.type||""].includes(n))),[l]=(null==u?void 0:u.range)||[0],r=(o-t)/i[`${n}YCell`]+l;return e(r)}}}function l(n){const{config:t,xCellWidth:i,yCellHeight:u}=n,{hz:l,mainXCellValue:r,valueUnit:c,mainYCellValue:o}=t;return{computedX:function(n){return n/l/r*i},cumputedY:function(n){return("uv"===c?.001*n:"v"===c?1e3*n:n)/o*u},getXValue:function(n){return e(r/i*n)},getYValue:function(n){return e(o/u*n)}}}export{u as useBirthProcessCumputedPoint,i as useCumputedPoint,l as useElectrocardiogramCumputedPoint};
1
+ import{format as n}from"date-fns";import{getTime as t,getFloorNumber as e}from"../utils/index.js";function i(i){const{xScaleList:u,xCellWidth:l,left:r,vitalSignsOriginY:o,painOriginY:c,canvasWidth:a}=i;return{computedX:function(n,e=!1){const i=t(n),[l]=u,r=u.at(-1);if(i<l.start)return 0;if(i>r.end)return a;const o=u.findIndex((n=>n.end>=i));if(o>-1){return u[o].center}},computedY:function(n,t,e){const u=i[`${n}YCell`],l=+e-Math.min(...t);return("pain"===n?c.endY:o.endY)-u*l},getXValue:function(t){const e=u.findIndex((n=>n.left+l>=t));if(e>-1){const i=u[e],l=t-i.left,r=i.scaleCell*l,o=i.start+r;return n(new Date(o),"yyyy-MM-dd HH:mm")}},getYValue:function(n,t){var u;const l=i[`${n}YCell`],a=(null==(u=r.yScaleValue.find((t=>t.type===n)))?void 0:u.list)||[],d=a.length?Math.min(...a):0,f="pain"===n?c.endY:o.endY;return e((f-t)/l+d)}}}function u(i){const{xAxis:u,originX:l,originY:r,xCellWidth:o,endY:c,timeXCell:a,startTime:d,scaleValues:f}=i;return{computedX:function(n){return(t(n)-d)/a+l},computedY:function(n,t,e){const[u]=t;return c-(+e-u)*i[`${n}YCell`]},getXValue:function(t){return n(new Date((t-l)*a+d),"yyyy-MM-dd HH:mm")},getYValue:function(n,t){const u=f.find((t=>[t.key,t.type||""].includes(n))),[l]=(null==u?void 0:u.range)||[0],r=(c-t)/i[`${n}YCell`]+l;return e(r)}}}function l(n){const{config:t,xCellWidth:i,yCellHeight:u}=n,{hz:l,mainXCellValue:r,valueUnit:o,mainYCellValue:c}=t;return{computedX:function(n){return n/l/r*i},computedY:function(n){return("uv"===o?.001*n:"v"===o?1e3*n:n)/c*u},getXValue:function(n){return e(r/i*n)},getYValue:function(n){return e(c/u*n)}}}export{u as useBirthProcessCumputedPoint,i as useCumputedPoint,l as useElectrocardiogramCumputedPoint};