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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +87 -87
  2. package/es/components/base-search/style/index.css +1 -1
  3. package/es/components/classification/index.d.ts +4 -2
  4. package/es/components/classification/src/components/search-filter/index.vue.d.ts +4 -2
  5. package/es/components/classification/src/components/set-classification/index.vue.d.ts +4 -2
  6. package/es/components/classification/src/index.vue.d.ts +4 -2
  7. package/es/components/date-picker/index.d.ts +2 -1
  8. package/es/components/date-picker/src/DatePicker.vue.d.ts +2 -1
  9. package/es/components/date-picker/src/DatePicker.vue2.js +1 -1
  10. package/es/components/expand-field/index.d.ts +1630 -0
  11. package/es/components/expand-field/index.js +1 -0
  12. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.d.ts +54 -0
  13. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue.js +1 -0
  14. package/es/components/expand-field/src/components/FormBatchOptionsModal.vue2.js +1 -0
  15. package/es/components/expand-field/src/components/FormItemPerson.vue.d.ts +841 -0
  16. package/es/components/expand-field/src/components/FormItemPerson.vue.js +1 -0
  17. package/es/components/expand-field/src/components/FormItemPerson.vue2.js +1 -0
  18. package/es/components/expand-field/src/components/PersonModal.vue.d.ts +777 -0
  19. package/es/components/expand-field/src/components/PersonModal.vue.js +1 -0
  20. package/es/components/expand-field/src/components/PersonModal.vue2.js +1 -0
  21. package/es/components/expand-field/src/components/form.vue.d.ts +1502 -0
  22. package/es/components/expand-field/src/components/form.vue.js +1 -0
  23. package/es/components/expand-field/src/components/form.vue2.js +1 -0
  24. package/es/components/expand-field/src/constants/index.d.ts +3 -0
  25. package/es/components/expand-field/src/constants/index.js +1 -0
  26. package/es/components/expand-field/src/hooks/useAsyncData.d.ts +6 -0
  27. package/es/components/expand-field/src/hooks/useAsyncData.js +1 -0
  28. package/es/components/expand-field/src/index.vue.d.ts +1632 -0
  29. package/es/components/expand-field/src/index.vue.js +1 -0
  30. package/es/components/expand-field/src/index.vue2.js +1 -0
  31. package/es/components/expand-field/src/types/index.d.ts +1 -0
  32. package/es/components/expand-field/src/types/index.js +1 -0
  33. package/es/components/expand-field/src/utils/constant.d.ts +17 -0
  34. package/es/components/expand-field/src/utils/constant.js +1 -0
  35. package/es/components/expand-field/src/utils/index.d.ts +6 -0
  36. package/es/components/expand-field/src/utils/index.js +1 -0
  37. package/es/components/expand-field/src/utils/tool.d.ts +2 -0
  38. package/es/components/expand-field/src/utils/tool.js +1 -0
  39. package/es/components/expand-field/style/expand-field-iconfont.ttf +0 -0
  40. package/es/components/expand-field/style/index.css +1 -0
  41. package/es/components/fabric-chart/src/components/PopupMenu.js +1 -1
  42. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +5 -1
  43. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -1
  44. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.d.ts +2 -1
  45. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useLeft.js +1 -1
  46. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useOther.js +1 -1
  47. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
  48. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
  49. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
  50. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  51. package/es/components/field-set/index.d.ts +127 -7
  52. package/es/components/field-set/src/FieldSet.vue.d.ts +127 -7
  53. package/es/components/field-set/src/FieldSet.vue2.js +1 -1
  54. package/es/components/field-set/src/components/Row.vue.d.ts +110 -6
  55. package/es/components/field-set/src/components/Row.vue2.js +1 -1
  56. package/es/components/field-set/src/types/index.d.ts +1 -1
  57. package/es/components/field-set/src/utils/index.js +1 -1
  58. package/es/components/form-config/index.d.ts +1 -1
  59. package/es/components/form-config/src/FormConfig.vue.d.ts +1 -1
  60. package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +29 -29
  61. package/es/components/form-config/src/components/FormConfigCreator.vue2.js +1 -1
  62. package/es/components/form-config/src/hooks/useConfigurationField.js +1 -1
  63. package/es/components/form-render/index.js +1 -1
  64. package/es/components/form-render/src/FormRender.vue2.js +1 -1
  65. package/es/components/form-render/src/components/renderer/complex.js +1 -1
  66. package/es/components/form-render/src/components/renderer/date.js +1 -1
  67. package/es/components/form-render/src/components/renderer/inputNumber.js +1 -1
  68. package/es/components/form-render/src/components/renderer/radio_checkbox.js +1 -1
  69. package/es/components/form-render/src/components/renderer/remoteSearch.js +1 -1
  70. package/es/components/form-render/src/components/renderer/searchCascade.js +1 -1
  71. package/es/components/form-render/src/components/renderer/select.js +1 -1
  72. package/es/components/form-render/src/components/renderer/switch.js +1 -1
  73. package/es/components/form-render/src/components/renderer/textarea.js +1 -1
  74. package/es/components/form-render/src/hooks/useAnchor.js +1 -1
  75. package/es/components/form-render/src/hooks/useBusinessBinding.js +1 -1
  76. package/es/components/form-render/src/hooks/useComplexOptions.js +1 -1
  77. package/es/components/form-render/src/hooks/useFieldListAdaptor.js +1 -1
  78. package/es/components/form-render/src/hooks/useFormItemDeps.js +1 -1
  79. package/es/components/form-render/src/hooks/useFormValidator.js +1 -1
  80. package/es/components/form-render/src/hooks/usePresetScope.js +1 -1
  81. package/es/components/form-render/src/utils/index.d.ts +1 -0
  82. package/es/components/form-render/src/utils/index.js +1 -1
  83. package/es/components/form-render/style/index.css +1 -1
  84. package/es/components/iho-table/src/plugins/filterDaterangeRenderPlugin/filter.vue.d.ts +2 -1
  85. package/es/components/iho-table/src/plugins/filterRenderPlugin/filter.vue2.js +1 -1
  86. package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.d.ts +1 -0
  87. package/es/components/iho-table/src/plugins/filterVisibleEventPlugin.js +1 -0
  88. package/es/components/iho-table/src/plugins/index.js +1 -1
  89. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/editDate.vue.d.ts +2 -1
  90. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/numberRendererPlugin.js +1 -1
  91. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.d.ts +21 -0
  92. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/editSelect.js +1 -1
  93. package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/selectRendererPlugin/selectUtils.js +1 -1
  94. package/es/components/iho-table/src/types/index.d.ts +1 -0
  95. package/es/components/iho-table/style/index.css +1 -1
  96. package/es/components/index.css +1 -1
  97. package/es/components/index.d.ts +2 -1
  98. package/es/components/index.js +1 -1
  99. package/es/components/quick-search/style/index.css +1 -1
  100. package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
  101. package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
  102. package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
  103. package/es/components/select-person/src/SelectPerson.vue2.js +1 -1
  104. package/es/components/select-person/style/index.css +1 -1
  105. package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +0 -3
  106. package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +4 -2
  107. package/es/components/table-filter/src/components/classify-filter/components/Date.vue.d.ts +2 -1
  108. package/es/components/table-filter/src/components/classify-filter/components/DateRange.vue.d.ts +2 -1
  109. package/es/components/table-filter/src/components/classify-filter/components/index.d.ts +4 -2
  110. package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +4 -2
  111. package/es/components/table-filter/src/components/render-widget/components/DateInner.vue.d.ts +2 -1
  112. package/es/components/table-filter/src/components/render-widget/components/DateOut.vue.d.ts +2 -1
  113. package/es/components/table-filter/src/components/render-widget/components/DateRangeInner.vue.d.ts +2 -1
  114. package/es/components/table-filter/src/components/render-widget/components/DateRangeOut.vue.d.ts +2 -1
  115. package/es/components/table-filter/src/components/render-widget/components/index.d.ts +8 -4
  116. package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +8 -4
  117. package/es/components/table-filter/src/hooks/useAdvanced.js +1 -1
  118. package/es/env.d.ts +25 -25
  119. package/es/shared/assets/img/failure.png.js +1 -1
  120. package/es/shared/assets/img/no-permission.png.js +1 -1
  121. package/es/shared/assets/img/nodata.png.js +1 -1
  122. package/es/shared/assets/img/notfound.png.js +1 -1
  123. package/es/shared/assets/img/qr.png.js +1 -1
  124. package/es/shared/assets/img/success.png.js +1 -1
  125. package/es/shared/assets/img/video.png.js +1 -1
  126. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  127. package/es/shared/assets/img/xb_big.png.js +1 -1
  128. package/es/shared/assets/img/xb_small.png.js +1 -1
  129. package/es/shared/components/InputNumberSlash/InputNumberSlash.d.ts +40 -0
  130. package/es/shared/components/InputNumberSlash/InputNumberSlash.js +1 -0
  131. package/es/shared/components/InputNumberSlash/index.d.ts +2 -0
  132. package/es/shared/components/InputNumberSlash/index.js +1 -0
  133. package/es/shared/hooks/useDateTime.d.ts +1 -0
  134. package/es/shared/hooks/useDateTime.js +1 -1
  135. package/es/shared/package.json.js +1 -1
  136. package/es/shared/utils/anime.d.ts +2 -1
  137. package/es/shared/utils/anime.js +1 -1
  138. package/package.json +2 -2
  139. package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
  140. package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
  141. package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
  142. package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
  143. package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
  144. package/es/shared/utils/fabricjs/index.d.ts +0 -6823
  145. package/es/shared/utils/tapable/index.d.ts +0 -139
@@ -0,0 +1 @@
1
+ import e from"./index.vue2.js";import r from"../../../_virtual/_plugin-vue_export-helper.js";var i=r(e,[["__file","index.vue"]]);export{i as default};
@@ -0,0 +1 @@
1
+ import{defineComponent as t,provide as e,ref as l,openBlock as a,createElementBlock as i,createElementVNode as n,createCommentVNode as o,createVNode as s,unref as r,withCtx as d,Fragment as c,renderList as u,createTextVNode as m,toDisplayString as p,createBlock as f,withModifiers as v}from"vue";import{useMessage as h,NGrid as _,NGridItem as g,NTooltip as y,NIcon as k,NPopconfirm as C,NButton as x}from"naive-ui";import{Brush as D}from"@vicons/ionicons5";import w from"./components/form.vue.js";import I from"./hooks/useAsyncData.js";import{InjectionExpandFieldApiConfig as N}from"./constants/index.js";const b={class:"tableset-expand-field"},M={class:"list"},z={class:"table-modal-list"},A={class:"list-content"},S=n("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 32 32"},[n("path",{d:"M12 12h2v12h-2z",fill:"currentColor"}),n("path",{d:"M18 12h2v12h-2z",fill:"currentColor"}),n("path",{d:"M4 6v2h2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8h2V6zm4 22V8h16v20z",fill:"currentColor"}),n("path",{d:"M12 2h8v2h-8z",fill:"currentColor"})],-1),j={class:"footer"};var F=t({__name:"index",props:{id:{type:String,default:""},expandFieldApiConfig:{type:Object},tableData:{type:Array,default:()=>[]},orgId:{type:String,default:""}},emits:["closeModal"],setup(t,{emit:F}){const O=t,V=h(),{deleteExtendFieldById:B}=I();e(N,O.expandFieldApiConfig);const E=[{title:"字段标题",columnName:"name",span:3},{title:"字段键名",columnName:"code",span:3},{title:"字段类型",columnName:"html_type",span:3},{title:"问号提示",columnName:"remark",span:4},{title:"创建时间",columnName:"createdDate",span:4},{title:"修改时间",columnName:"updatedDate",span:4},{title:"操作",columnName:"operator",span:3}],P=l(!1),L=l("add"),U=l({});function q(){F("closeModal")}function G(){P.value=!0,L.value="add",U.value={}}function H(){P.value=!1}return(e,l)=>(a(),i("div",b,[n("div",M,[n("div",z,[o(' <div class="list-title">\r\n\t\t\t\t\t<span class="list-title-item" v-for="titleItem in filedList" :key="titleItem.columnName">\r\n\t\t\t\t\t\t{{ titleItem.title }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</div> '),s(r(_),{cols:24,class:"list-title"},{default:d((()=>[(a(),i(c,null,u(E,(t=>s(r(g),{span:t.span,class:"list-title-item",key:t.columnName},{default:d((()=>[m(p(t.title),1)])),_:2},1032,["span"]))),64))])),_:1}),n("div",A,[(a(!0),i(c,null,u(t.tableData,((t,e)=>(a(),f(r(_),{key:e,class:"list-content-block"},{default:d((()=>[s(r(g),{span:3,title:t.name,class:"list-content-item"},{default:d((()=>[m(p(t.name),1)])),_:2},1032,["title"]),s(r(g),{span:3,title:t.code,class:"list-content-item"},{default:d((()=>[m(p(t.code),1)])),_:2},1032,["title"]),s(r(g),{span:3,title:t.html_type,class:"list-content-item"},{default:d((()=>[m(p(t.html_type),1)])),_:2},1032,["title"]),s(r(g),{span:4,title:t.remark,class:"list-content-item"},{default:d((()=>[m(p(t.remark),1)])),_:2},1032,["title"]),s(r(g),{span:4,title:t.createdDate,class:"list-content-item"},{default:d((()=>[m(p(t.createdDate),1)])),_:2},1032,["title"]),s(r(g),{span:4,title:t.updatedDate,class:"list-content-item"},{default:d((()=>[m(p(t.updatedDate),1)])),_:2},1032,["title"]),s(r(g),{span:3,class:"list-content-item"},{default:d((()=>[s(r(y),{duration:0},{trigger:d((()=>[s(r(k),{component:r(D),onClick:v((e=>{return l=t,P.value=!0,L.value="edit",void(U.value={...l});var l}),["prevent","stop"])},null,8,["component","onClick"])])),default:d((()=>[m(" 编辑 ")])),_:2},1024),s(r(y),{duration:0},{trigger:d((()=>[s(r(C),{onPositiveClick:e=>async function(t){try{const e=await B(t,O.expandFieldApiConfig);if("SUCCESS"!==(null==e?void 0:e.result))return void V.error((null==e?void 0:e.resultMsg)||"删除失败");V.success("删除成功")}catch(t){V.error(t)}}(t)},{trigger:d((()=>[s(r(k),null,{default:d((()=>[S])),_:1})])),default:d((()=>[m(" 是否确认删除? ")])),_:2},1032,["onPositiveClick"])])),default:d((()=>[m(" 删除 ")])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])]),n("div",j,[s(r(x),{onClick:q},{default:d((()=>[m("取消")])),_:1}),s(r(x),{type:"info",onClick:G},{default:d((()=>[m("增加字段")])),_:1})])]),s(w,{visible:P.value,formItemData:U.value,formOntype:L.value,id:t.id,orgId:t.orgId,onCancelModal:H},null,8,["visible","formItemData","formOntype","id","orgId"])]))}});export{F as default};
@@ -0,0 +1 @@
1
+ export declare type IExpandFieldItemType = Record<'code' | 'createdDate' | 'html_type' | 'id' | 'name' | 'remark' | 'setting' | 'updatedDate', string>;
@@ -0,0 +1,17 @@
1
+ export declare const HtmlType: {
2
+ INPUT: string;
3
+ TEXTAREA: string;
4
+ DIGITAL: string;
5
+ DATE: string;
6
+ RADIO: string;
7
+ RADIO_BLOCK: string;
8
+ CHECKBOX: string;
9
+ CHECKBOX_BLOCK: string;
10
+ SELECT: string;
11
+ MULTI_SELECT: string;
12
+ CANDIDATE_COMPONENTS: string;
13
+ };
14
+ export declare const HtmlTypeList: {
15
+ value: string;
16
+ label: string;
17
+ }[];
@@ -0,0 +1 @@
1
+ const l={INPUT:"INPUT",TEXTAREA:"TEXTAREA",DIGITAL:"DIGITAL",DATE:"DATE",RADIO:"RADIO",RADIO_BLOCK:"RADIO_BLOCK",CHECKBOX:"CHECKBOX",CHECKBOX_BLOCK:"CHECKBOX_BLOCK",SELECT:"SELECT",MULTI_SELECT:"MULTI_SELECT",CANDIDATE_COMPONENTS:"CANDIDATE_COMPONENTS"},E=[{value:l.INPUT,label:"文本框"},{value:l.TEXTAREA,label:"文本域"},{value:l.DIGITAL,label:"数字框"},{value:l.DATE,label:"日期"},{value:l.RADIO,label:"横向单选"},{value:l.RADIO_BLOCK,label:"纵向单选"},{value:l.CHECKBOX,label:"横向多选"},{value:l.CHECKBOX_BLOCK,label:"纵向多选"},{value:l.SELECT,label:"下拉框"},{value:l.MULTI_SELECT,label:"下拉多选框"},{value:l.CANDIDATE_COMPONENTS,label:"选人组件"}];export{l as HtmlType,E as HtmlTypeList};
@@ -0,0 +1,6 @@
1
+ export declare function isTextarea(current: string): boolean;
2
+ export declare function isNumber(current: string): boolean;
3
+ export declare function isDate(current: string): boolean;
4
+ export declare function isShowOptions(current: string): boolean;
5
+ export declare function isCandidate(current: string): boolean;
6
+ export declare function isMulti(current: string): boolean;
@@ -0,0 +1 @@
1
+ import{HtmlType as n}from"./constant.js";function t(t){return t===n.TEXTAREA}function C(t){return t===n.DIGITAL}function r(t){return t===n.DATE}function E(t){return[n.RADIO,n.RADIO_BLOCK,n.CHECKBOX,n.CHECKBOX_BLOCK,n.SELECT,n.MULTI_SELECT].includes(t)}function u(t){return t===n.CANDIDATE_COMPONENTS}function O(t){return[n.CHECKBOX,n.CHECKBOX_BLOCK,n.MULTI_SELECT].includes(t)}export{u as isCandidate,r as isDate,O as isMulti,C as isNumber,E as isShowOptions,t as isTextarea};
@@ -0,0 +1,2 @@
1
+ export declare function isJSON(str: string): boolean;
2
+ export declare function isValidDate(val: any): boolean;
@@ -0,0 +1 @@
1
+ function t(t){if("string"==typeof t)try{const r=JSON.parse(t);return!("object"!=typeof r||!r)}catch(t){return!1}return!1}function r(t){var r,e;return(r="Date",function(t){return"[object "+r+"]"===Object.prototype.toString.call(t)})(t)&&!isNaN((e=t,e.getTime()))}export{t as isJSON,r as isValidDate};
@@ -0,0 +1 @@
1
+ @font-face{font-family:expand-field-iconfont;src:url(expand-field-iconfont.ttf?t=1689038151631) format("truetype")}.iconfont-expand-field{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:expand-field-iconfont!important;font-size:14px;font-style:normal}.icon-expand-field-help:before{content:"\e6b6"}.icon-expand-field-menzhenyishengzhanxitongtubiaoguanbi:before{content:"\e76e"}.icon-expand-field-menzhenyishengzhanxitongtubiaozuixiaohua2:before{content:"\e778"}.icon-expand-field-menzhenyishengzhanxitongtubiaozuidahua:before{content:"\e779"}.tableset-expand-field{height:100%}.tableset-expand-field .list{background:transparent;display:flex;flex-direction:column;height:100%}.tableset-expand-field .list .table-modal-list{flex:1;overflow-y:auto}.tableset-expand-field .list .table-modal-list .list-title{background-color:#f2f2f4;border:1px solid #e1dfdf;height:52px;line-height:52px}.tableset-expand-field .list .table-modal-list .list-title .list-title-item{font-weight:700;text-align:center}.tableset-expand-field .list .table-modal-list .list-content{margin:0;padding:0}.tableset-expand-field .list .table-modal-list .list-content .list-content-block{border-bottom:1px solid #e1dfdf;height:50px;line-height:50px}.tableset-expand-field .list .table-modal-list .list-content .list-content-block .list-content-item{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}.tableset-expand-field .list .table-modal-list .list-content .list-content-block .list-content-item .n-icon{cursor:pointer;margin-right:8px}.tableset-expand-field .list .table-modal-list .list-content .list-content-block:last-child{border:none}.tableset-expand-field .list .footer{border-top:1px solid #d5d5d5;padding-top:12px}.tableset-expand-field .list .footer .n-button:first-child{margin-right:8px}.expand-field-modal-block.expand-person-modal{overflow-y:hidden}.expand-field-modal-block .n-card-header .svg-wrap .iconfont-expand-field{cursor:pointer;font-size:18px}.expand-field-modal-block .n-card-header .svg-wrap .iconfont-expand-field:last-child{margin-left:16px}.expand-field-modal-block .n-card-header .svg-wrap .n-icon{cursor:pointer}.expand-field-modal-block .n-card__content{overflow-y:auto}.expand-field-modal-block .n-card__content .options-title .iconfont-expand-field{cursor:pointer;font-size:16px;margin-left:5px}.expand-field-modal-block .n-card__content .options-title .batch-span{color:#2d7aff;cursor:pointer;margin-left:8px}.expand-field-modal-block .n-card__content .options-item{border:1px solid #ccc;border-radius:5px;padding:8px 12px;width:100%}.expand-field-modal-block .n-card__content .options-item .flex-center{align-items:center;display:flex}.expand-field-modal-block .n-card__content .options-item .flex-center .n-icon{cursor:pointer}.expand-field-modal-block .n-card__content .options-item.options-item-err{border-color:#f5222d}.expand-field-modal-block .n-card__content .date-time-button{padding:0;width:56px}.expand-field-modal-block .n-card__content .date-time-button .n-button__content{justify-content:center;position:relative;width:100%}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker{position:absolute;width:100%}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input{background:transparent}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__input-el{color:transparent;cursor:pointer}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__placeholder{color:transparent}.expand-field-modal-block .n-card__content .date-time-button .n-button__content .n-time-picker .n-input .n-input__suffix{display:none}.expand-field-modal-block .n-card__content .people-wrap .inner-content{border:1px solid #e0e0e6;display:flex;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagSpanClass{display:flex;flex:1;flex-wrap:nowrap;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagSpanClass .n-tag{margin:2px 0 0 5px}.expand-field-modal-block .n-card__content .people-wrap .inner-content .tagClearAll{align-items:center;cursor:pointer;display:flex;flex-basis:30px;justify-content:center}.expand-field-modal-block .n-card__content .validate_tip{color:#f5222d;font-size:12px;margin-top:2px}.expand-field-modal-block .flex_right{display:flex;justify-content:flex-end}.expand-field-modal-block .flex_right .n-button:first-child{margin-right:15px}.expand-field-modal-block .mgb-10{margin-bottom:10px}
@@ -1 +1 @@
1
- import{defineComponent as e,ref as t,watch as l,createVNode as a,Teleport as o,withDirectives as r,vShow as n}from"vue";import{NSpace as u,NInputNumber as i}from"naive-ui";import s from"./useStyle.js";import{useEventListener as p,onClickOutside as c}from"@vueuse/core";var f=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:f,slots:m,emit:d}){let v=!1;const h=t(null);p(h,"contextmenu",(e=>(e.preventDefault(),!1))),c(h,(e=>{!v&&d("update:show",!1),v=!1}));const{left:y}=e.propItems,b=s(e);function g(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function w(t){var l;if("string"==typeof t)return t;if("boolean"==typeof t.value)return t.label;if(t.renderItem)return t.renderItem();const o=+((null==(l=y.yScaleValue.find((t=>t.type===e.target.origin.type)))?void 0:l.list[0])||0);return a(u,{inline:!0,align:"center"},{default:()=>[a("span",null,[t.label]),a(i,{style:"width: 110px",size:"small",value:t.value,"onUpdate:value":e=>t.value=e,clearable:!0,placeholder:"请输入数值",max:e.target.origin.data.value,min:o,showButton:!1,onFocus:()=>d("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&(v=!0,e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)})))})),()=>a(o,{to:".c-fabric-chart"},{default:()=>[r(a("ul",{ref:h,class:"c-fabric-chart-popup-menu",style:b.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":g(t)},onClick:l=>function(t,l){g(l)||""===(null==t?void 0:t.target.className)&&(d("update:show",!1),d("clickMenu",{item:l,target:e.target}))}(l,t)},[w(t)]):null))]),[[n,e.show]])]})}});export{f as default};
1
+ import{defineComponent as e,ref as t,watch as l,createVNode as a,Teleport as o,withDirectives as r,vShow as n}from"vue";import{NSpace as u,NInputNumber as i}from"naive-ui";import s from"./useStyle.js";import{useEventListener as p,onClickOutside as c}from"@vueuse/core";var f=e({name:"PopupMenu",inheritAttrs:!1,props:{show:{type:Boolean,default:!1},list:{type:Array,default:()=>[]},point:{type:Object},propItems:{type:Object},target:{type:Object}},emits:["update:show","clickMenu"],setup(e,{attrs:f,slots:m,emit:d}){const v=t(null);p(v,"contextmenu",(e=>(e.preventDefault(),!1))),c(v,(e=>{d("update:show",!1)}));const{left:h}=e.propItems,y=s(e);function b(e){if("string"==typeof e&&(e.startsWith("新增")||e.startsWith("删除")))return!0}function g(t){var l;if("string"==typeof t)return t;if("boolean"==typeof t.value)return t.label;if(t.renderItem)return t.renderItem();const o=+((null==(l=h.yScaleValue.find((t=>t.type===e.target.origin.type)))?void 0:l.list[0])||0);return a(u,{inline:!0,align:"center"},{default:()=>[a("span",null,[t.label]),a(i,{style:"width: 110px",size:"small",value:t.value,"onUpdate:value":e=>t.value=e,clearable:!0,placeholder:"请输入数值",max:e.target.origin.data.value,min:o,showButton:!1,onFocus:()=>d("update:show",!0)},null)]})}return l((()=>e.show),(t=>{t&&e.list.forEach((e=>{"object"==typeof e&&Reflect.has(e,"value")&&"boolean"!=typeof e.value&&(e.value=void 0)}))})),()=>a(o,{to:".c-fabric-chart"},{default:()=>[r(a("ul",{ref:v,class:"c-fabric-chart-popup-menu",style:y.value},[e.list.map((t=>e.show?a("li",{class:{"no-click":b(t)},onClick:l=>function(t,l){b(l)||""===(null==t?void 0:t.target.className)&&(d("update:show",!1),d("clickMenu",{item:l,target:e.target}))}(l,t)},[g(t)]):null))]),[[n,e.show]])]})}});export{f as default};
@@ -1,11 +1,15 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- import { IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ import { IObject, IPointTipProps, IPointMenuProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
5
  export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, pointMenuProps: IPointMenuProps): {
6
6
  redrawPoints: (ItemObj?: AnyObject) => void;
7
7
  clickMenu: ({ item, target }: {
8
8
  item: any;
9
9
  target: any;
10
10
  }) => void;
11
+ moveLimit: (point: IObject) => void;
12
+ setPopup: (point: any, status?: string) => void;
13
+ updateData: (params: AnyObject, mode?: string) => void;
14
+ getGridPoints: () => IObject[];
11
15
  };
@@ -1 +1 @@
1
- import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as o}from"../useCommon.js";import"vue";import{getPointRange as l,getIndex as r,isEffectiveNode as a,getTime as s}from"../../utils/index.js";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function u(u,p,c,d,m){const{cumputedX:v,cumputedY:g,getXValue:h,getYValue:y}=i(p),{xCellWidth:L,yCellHeight:x,originX:k,endX:b,originY:P,endY:A,event:w,scaleValues:j,xAxis:C,startTime:I,timeXCell:T,itemList:X}=p,E=new Map,M=new Set,Y=f(j);let _=[];n(u,p);const{getEqualXTypes:O,handleAddPrevent:V}=o(u,c,p);function $(){Y.forEach((e=>{e.dataList.forEach(((t,n)=>{S(t,n,e)}))})),function(){if(!w.evented)return;function e(e,t,n){Object.assign(m,{point:e,show:!0,target:t,list:n})}u.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:i=0}=t.pointer||{};if(n>=k&&n<=b&&i>=P&&i<=A)if(t.target){if("main"!==t.target.__type)return;e(t.pointer,t.target,["删除节点"]);const{minLeft:n,maxLeft:i,minTop:o,maxTop:r}=l(t.target);H().forEach((e=>{"main"===e.__type&&e.left>n&&e.left<i&&e.top>o&&e.top<r&&m.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})})),1===m.list.length&&(m.show=!1,console.log("当前时间段内无可删除节点"))}else e(t.pointer,null,["新增节点"]),X.forEach((e=>{O(H(),n,"key").includes(e.key)||m.list.push({renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,type:e.bigType,dataIndex:e.dataIndex,key:e.key},pointer:t.pointer})})),1===m.list.length&&(m.show=!1,V("repeat"),console.log("当前时间段内无可新增节点"))}}))}()}function S(n,i,o){var l;const{type:r,unit:a,dataList:s=[]}=o,f=[];E.set(n.key,[]),null==(l=n.list)||l.forEach(((l,s)=>{!function(n,l,s,m){var v;let g,x;const{pointAttr:j={},lineAttr:C={},title:I="",key:X,type:Y="circle"}=m,O=G(m.list[s+1],o);n&&O&&!l.breakpoint&&n[0]!==O[0]&&(x=e([...n,...O],C));const V=f[s-1],$={origin:{data:l,title:I,key:X||"",unit:a,type:r,dataIndex:i,index:s,lineAttr:C},__type:"main",leftLine:V,rightLine:x,...j,...p.event.hovered?p.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:p.event};V?g=t(Y,{left:V.get("x2"),top:V.get("y2"),...$}):n&&($.leftLine=null,g=t(Y,{left:n[0],top:n[1],...$}));f.push(x),g&&(g.originLeft=g.left,g.originTop=g.top,function(e){w.hovered&&(e.on("mouseover",(()=>{q(e,"hover")})),e.on("mouseout",(()=>{d.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t=6e4/T,n=e.prevPoint?e.prevPoint.left+t:k,i=e.nextPoint?e.nextPoint.left-t:b;e.top<P&&e.set("top",P),e.top>A&&e.set("top",A),e.left<n&&e.set("left",n),e.left>i&&e.set("left",i)}(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),w.hovered&&q(e),function(e){const{originLeft:t,originTop:n,left:i,top:o,origin:l}=e,r=~~((i-t)/L);if(i>t+L&&!e.nextPoint){if(0===_.length){z(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const i=t+L*r;if(_.every((e=>e.left!==i))){const t=h(i),n=y(l.type,o);_.push({data:{time:t,value:n},left:i,top:o}),z(e,[...e.prevPointer,i,o])}_.length<r&&function(e,t){const{originLeft:n,originTop:i,origin:o}=e;let l=1;for(;l<=t;){const t=n+L*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-L))/L),u=(r.top-s.top)/f;a.top=s.top+u,a.left=t,a.data={time:h(t),value:y(o.type,a.top)},_.splice(l,0,a),z(e,[s.left,s.top,a.left,a.top])}}l++}}(e,r)}if(_.length>0&&i<_[_.length-1].left){for(const e of M)e.left>i&&(e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e));if(_=_.filter((e=>e.left<=i)),0===_.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of M)e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e)}if(_.length>0){const t=_.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(d.show=!1,1===t.button){const{key:t,type:n}=e.origin,i={...e.origin,data:{...e.origin.data,time:h(e.left),value:y(n,e.top)}};if(u.value.discardActiveObject(),_.length>0){const e=_.map((e=>e.data));c("add",{...i,data:e}),D({...i,data:e})}else c("change",i),D(i,"change")}}))}(g),null==(v=E.get(X))||v.push(g))}(G(l,o),l,s,n)})),Promise.all(E.get(n.key)).then((e=>{const t=f.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),u.value.add(...t,...e)}))}function z(t,n){const[i,o,l,r]=n;t.clone((i=>{i.set({left:l,top:r}),t.prevPointer=[l,r];const o=e(n,t.origin.lineAttr);i.leftLine=o,M.add(i),u.value.add(o,i)}))}function D(e,t="add"){const{dataIndex:n,data:i,index:o,key:l,type:a}=e,s=Y.find((e=>e.type===a)),f=s.dataList.find((e=>e.key===l));switch(t){case"remove":f.list.splice(o,1);break;case"change":f.list[o]=i;break;default:{const e=Array.isArray(i)?i[0].time:i.time,t=r(e,f.list),n=Array.isArray(i)?i:[i];f.list.splice(t,0,...n);break}}J({dataIndex:n,scaleValue:s})}function J(e){var t,n,i;if(M.size&&(null==(t=u.value)||t.remove(...N([...M]))),M.clear(),_=[],e){const{dataIndex:t,scaleValue:i}=e,o=i.dataList[t];null==(n=u.value)||n.remove(...N(E.get(o.key))),E.delete(o.key),S(o,t,i)}else E.size&&(null==(i=u.value)||i.remove(...N(H()))),E.clear(),$()}function N(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine)})),t}function q(e,t="moving"){const{title:n,type:i,data:o,unit:l}=e.origin;d.point={x:e.left,y:e.top};const r=`${"hover"===t?o.value:y(i,e.top)}`;d.list=[`${n} ${r}${l||""}`,`时间 ${h(e.left).slice(-5)}`],d.show=!0}function G(e,t){if(a(e)&&function(e){const t=Date.parse(C.list.at(-1)),n=s(e);return n>=I&&n<=t}(e.time)){const n=v(e.time),i=g(t.type,t.range,e.value);return[n,i<P?P:i>A?A:i]}}function H(){return Array.from(E.values()).flat()}return $(),{redrawPoints:J,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(c("remove",n),D(n,"remove")):(Object.assign(n,{data:{time:h(e.pointer.x),value:y(e.origin.type,e.pointer.y)}}),c("add",n),D(n))}}}export{u as useCenter};
1
+ import{drawLine as e,drawPoint as t}from"../useDraw.js";import{useGrid as n}from"../useGrid.js";import{useBirthProcessCumputedPoint as o}from"../useCumputedPoint.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCommon as i}from"../useCommon.js";import"vue";import{getPointRange as l,getIndex as r,isEffectiveNode as s,getTime as a}from"../../utils/index.js";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function u(u,p,c,d,m){const{cumputedX:v,cumputedY:g,getXValue:h,getYValue:y}=o(p),{xCellWidth:L,yCellHeight:x,originX:k,endX:w,originY:P,endY:b,event:A,scaleValues:j,xAxis:C,startTime:M,timeXCell:X,itemList:I}=p,T=new Map,$=new Set,E=f(j);let Y=[];n(u,p);const{getEqualXTypes:V,handleAddPrevent:_}=i(u,c,p);function O(){E.forEach((t=>{t.dataList.forEach(((n,o)=>{n.show&&(!function(t,n){const{max:o={},min:i={}}=t.panicValue||{};function l({show:t=!1,value:o,name:i,lineStyle:l}){if(!t||!o)return;const r=g(n.type,n.range,o),s=e([k,r,w,r],{...l,evented:!0,lockMovementX:!0,lockMovementY:!0,hoverCursor:"pointer"});A.hovered&&i&&(s.on("mousemove",(({pointer:e})=>{d.point={...e||{x:s.left,y:s.top}},d.list=[`${i} ${o}${n.unit||""}`],d.show=!0})),s.on("mouseout",(()=>{d.show=!1}))),u.value.add(s)}l(o),l(i)}(n,t),S(n,o,t))}))})),function(){if(!A.evented)return;function e(e,t,n){Object.assign(m,{point:e,show:!0,target:t,list:n})}u.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:o=0}=t.pointer||{};if(n>=k&&n<=w&&o>=P&&o<=b)if(t.target){if("main"!==t.target.__type)return;e(t.pointer,t.target,["删除节点"]);const{minLeft:n,maxLeft:o,minTop:i,maxTop:r}=l(t.target);W().forEach((e=>{"main"===e.__type&&e.left>n&&e.left<o&&e.top>i&&e.top<r&&m.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})})),1===m.list.length&&(m.show=!1,console.log("当前时间段内无可删除节点"))}else e(t.pointer,null,["新增节点"]),I.forEach((e=>{V(W(),n,"key",2*L).includes(e.key)||m.list.push({renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,type:e.bigType,dataIndex:e.dataIndex,key:e.key},pointer:t.pointer})})),1===m.list.length&&(m.show=!1,_("repeat"),console.log("当前时间段内无可新增节点"))}}))}()}function S(n,o,i){var l;const{type:r,unit:s,dataList:a=[]}=i,f=[];T.set(n.key,[]),null==(l=n.list)||l.forEach(((l,a)=>{!function(n,l,a,m){var v;let g,x;const{pointAttr:k={},lineAttr:w={},title:P="",key:b,type:j="circle"}=m,C=H(m.list[a+1],i);n&&C&&!l.breakpoint&&n[0]!==C[0]&&(x=e([...n,...C],w));const M=f[a-1],X={origin:{data:l,title:P,key:b||"",unit:s,type:r,dataIndex:o,index:a,lineAttr:w},__type:"main",leftLine:M,rightLine:x,...k,...p.event.hovered?p.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:p.event};M?g=t(j,{left:M.get("x2"),top:M.get("y2"),...X}):n&&(X.leftLine=null,g=t(j,{left:n[0],top:n[1],...X}));f.push(x),g&&(g.originLeft=g.left,g.originTop=g.top,function(e){A.hovered&&(e.on("mouseover",(()=>{N(e,"hover")})),e.on("mouseout",(()=>{d.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{q(e),function(e){var t,n;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(n=e.rightLine)||n.setCoords().set({x1:e.left,y1:e.top})}(e),A.hovered&&N(e),function(e){const{originLeft:t,originTop:n,left:o,top:i,origin:l}=e,r=~~((o-t)/L);if(o>t+L&&!e.nextPoint){if(0===Y.length){D(e,[...e.leftLine?[e.leftLine.x1,e.leftLine.y1]:[t,n],t,n]),e.leftLine&&e.leftLine.set({stroke:"transparent"})}const o=t+L*r;if(Y.every((e=>e.left!==o))){const t=h(o),n=y(l.type,i);Y.push({data:{time:t,value:n},left:o,top:i}),D(e,[...e.prevPointer,o,i])}Y.length<r&&function(e,t){const{originLeft:n,originTop:o,origin:i}=e;let l=1;for(;l<=t;){const t=n+L*l,r=Y.some((e=>Math.abs(e.left-t)<=1));if(!r){let l=0;const r=Y.find(((e,n)=>(e.left>t&&(l=n),e.left>t)));if(r){const s=JSON.parse(JSON.stringify(r)),a=Y[l-1]||{left:n,top:o},f=~~((r.left-(t-L))/L),u=(r.top-a.top)/f;s.top=a.top+u,s.left=t,s.data={time:h(t),value:y(i.type,s.top)},Y.splice(l,0,s),D(e,[a.left,a.top,s.left,s.top])}}l++}}(e,r)}if(Y.length>0&&o<Y[Y.length-1].left){for(const e of $)e.left>o&&(e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e));if(Y=Y.filter((e=>e.left<=o)),0===Y.length){e.leftLine&&e.leftLine.set(e.origin.lineAttr);for(const e of $)e.leftLine&&u.value.remove(e.leftLine),u.value.remove(e)}if(Y.length>0){const t=Y.at(-1);e.prevPointer=[t.left,t.top]}}}(e)})),e.on("mouseup",(t=>{if(d.show=!1,1===t.button){const{key:t,type:n}=e.origin,o={...e.origin,data:{...e.origin.data,time:h(e.left),value:y(n,e.top)}};if(u.value.discardActiveObject(),Y.length>0){const e=Y.map((e=>e.data));c("add",{...o,data:e}),z({...o,data:e})}else c("change",o),z(o,"change")}}))}(g),null==(v=T.get(b))||v.push(g))}(H(l,i),l,a,n)})),Promise.all(T.get(n.key)).then((e=>{const t=f.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),u.value.add(...t,...e)}))}function D(t,n){const[o,i,l,r]=n;t.clone((o=>{o.set({left:l,top:r}),t.prevPointer=[l,r];const i=e(n,t.origin.lineAttr);o.leftLine=i,$.add(o),u.value.add(i,o)}))}function z(e,t="add"){const{dataIndex:n,data:o,index:i,key:l,type:s}=e,a=E.find((e=>e.type===s)),f=a.dataList.find((e=>e.key===l));switch(t){case"remove":f.list.splice(i,1);break;case"change":f.list[i]=o;break;default:{const e=Array.isArray(o)?o[0].time:o.time,t=r(e,f.list),n=Array.isArray(o)?o:[o];f.list.splice(t,0,...n);break}}G({dataIndex:n,scaleValue:a})}function G(e){var t,n,o;if($.size&&(null==(t=u.value)||t.remove(...J([...$]))),$.clear(),Y=[],e){const{dataIndex:t,scaleValue:o}=e,i=o.dataList[t];null==(n=u.value)||n.remove(...J(T.get(i.key))),T.delete(i.key),S(i,t,o)}else T.size&&(null==(o=u.value)||o.remove(...J(W()))),T.clear(),O()}function J(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 N(e,t="moving"){const{title:n,type:o,data:i,unit:l}=e.origin;d.point={x:e.left,y:e.top};const r=`${"hover"===t?i.value:y(o,e.top)}`;d.list=[`${n} ${r}${l||""}`,`时间 ${h(e.left).slice(-5)}`],d.show=!0}function q(e){e.setCoords();const t=6e4/X,n=e.prevPoint?e.prevPoint.left+t:k,o=e.nextPoint?e.nextPoint.left-t:w;e.top<P&&e.set("top",P),e.top>b&&e.set("top",b),e.left<n&&e.set("left",n),e.left>o&&e.set("left",o)}function H(e,t){if(s(e)&&function(e){const t=Date.parse(C.list.at(-1)),n=a(e);return n>=M&&n<=t}(e.time)){const n=v(e.time),o=g(t.type,t.range,e.value);return[n,o<P?P:o>b?b:o]}}function W(){return Array.from(T.values()).flat()}return O(),{redrawPoints:G,clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(c("remove",n),z(n,"remove")):(Object.assign(n,{data:{time:h(e.pointer.x),value:y(e.origin.type,e.pointer.y)}}),c("add",n),z(n))},moveLimit:q,setPopup:N,updateData:z,getGridPoints:W}}export{u as useCenter};
@@ -1,4 +1,5 @@
1
1
  import { type Ref } from 'vue';
2
2
  import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../../es/shared/types';
4
- export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function): void;
4
+ import { IPointTipProps } from '../../../../../../es/components/fabric-chart/src/interface';
5
+ export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: IPointTipProps, moveLimit: Function, setPopup: Function, updateData: Function, getGridPoints: Function): void;
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as l,defaultTextStyle as n,defaultStyle as r}from"../useDraw.js";import"date-fns";import{getScaleNumberList as a}from"../../utils/index.js";import{drawScaleNumber as s}from"../useScaleColumn.js";import"vue";import"lodash-es";import"../temperature/useShadow.js";function d(d,h,u){const{originY:c,endY:p,borderStyle:f,left:m,itemList:g,scaleValues:v,originX:w,endX:j,yCellHeight:y,markHeight:S,canvasWidth:W,canvasHeight:b}=h;!function(){if(!m)return;const{title:t,titleWidth:i,titleStyle:o}=m,l=e({width:i,height:p-c+S,...f},{value:t.split("").join("\n"),...o||{}},{left:0,top:c},!0);d.value.add(l)}(),v.forEach(((e,i)=>{var o,h;const u="left"===e.layout?w-5:j+5,{range:c,spaceValue:f,title:g,unit:v,titleStyle:S,spaceGridNumber:b=1,showNumber:x,showMaxMinNumber:N}=e,k=[],X=a(c,f),Y=X.length;X.forEach(((t,i)=>{const o=0===i?p-5:p-i*y*b;!x||(0===i||i===Y-1)&&!N||k.push(s(String(t),{...e,position:e.layout},u,o))}));const C=g&&l(["left"===e.layout?m.width/2:j+(W-j)/2,(null!=(h=null==(o=k.at(-1))?void 0:o.top)?h:330)-y],{value:`${g}${v?"\n"+v:""}`,...n,...S}),E=new t.Group([...k,...C?[C]:[]],{objectCaching:!1,...r});d.value.add(E),E.sendToBack()})),function(){const e=new t.Rect({width:w-m.titleWidth,height:p-c+S,left:m.titleWidth,top:c,...i,originX:"left",originY:"top",...f});d.value.add(e);const l=JSON.parse(JSON.stringify(g));let n=p;const r=m.titleWidth+15;l.reverse().forEach((t=>{n-=10;const e=t.title,{text:i,icon:l}=o(e,t,{text:{left:r,top:n},icon:{leftX:r,topY:n}});n-=i.height||30,d.value.add(i,l)}))}(),d.value.add(new t.Rect({left:0,top:0,width:W-f.strokeWidth,height:b-f.strokeWidth,fill:"transparent",...f}))}export{d as useLeft};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultRectStyle as i,drawTextAndIconGroup as o,drawText as n,defaultTextStyle as l,defaultStyle as r}from"../useDraw.js";import{useBirthProcessCumputedPoint as s}from"../useCumputedPoint.js";import{drawScaleNumber as a}from"../useScaleColumn.js";import{useCommon as d}from"../useCommon.js";import"vue";import{getScaleNumberList as u}from"../../utils/index.js";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function h(h,f,p,m,g,v,w,y){const{getYValue:j,getXValue:x}=s(f),{getEqualXTypes:b,handleAddPrevent:W,isGridLimit:X}=d(h,p,f),{originY:C,endY:k,borderStyle:E,left:S,itemList:Y,scaleValues:L,originX:V,endX:G,yCellHeight:H,markHeight:N,canvasWidth:T,canvasHeight:M,xCellWidth:P}=f;!function(){if(!S)return;const{title:t,titleWidth:i,titleStyle:o}=S,n=e({width:i,height:k-C+N,...E},{value:t.split("").join("\n"),...o||{}},{left:0,top:C},!0);h.value.add(n)}(),L.forEach(((e,i)=>{var o,s;const d="left"===e.layout?V-5:G+5,{range:c,spaceValue:f,title:p,unit:m,titleStyle:g,spaceGridNumber:v=1,showNumber:w,showMaxMinNumber:y}=e,j=[],x=u(c,f),b=x.length;x.forEach(((t,i)=>{const o=0===i?k-5:k-i*H*v;!w||(0===i||i===b-1)&&!y||j.push(a(String(t),{...e,position:e.layout},d,o))}));const W=p&&n(["left"===e.layout?S.width/2:G+(T-G)/2,(null!=(s=null==(o=j.at(-1))?void 0:o.top)?s:330)-H],{value:`${p}${m?"\n"+m:""}`,...l,...g}),X=new t.Group([...j,...W?[W]:[]],{objectCaching:!1,...r});h.value.add(X),X.sendToBack()})),function(){const e=new t.Rect({width:V-S.titleWidth,height:k-C+N,left:S.titleWidth,top:C,...i,originX:"left",originY:"top",...E});h.value.add(e);const n=c(Y),l=c(S.externalIconList||[]).map((t=>({...t,isExternal:!0})));let r=k;const s=S.titleWidth+15;l.concat(n.reverse()).forEach((t=>{r-=10;const e=t.title,{text:i,icon:n}=o(e,t,{text:{left:s,top:r},icon:{leftX:s,topY:r,...t.isExternal?{evented:!1,selectable:!1}:{}}});var l;r-=i.height||30,(l=n).on("moving",(()=>{l.set("originX","center"),X(l)?(g(l),v(l)):m.show=!1})),l.on("mouseup:before",(t=>{if(m.show=!1,0===t.e.button&&X(l))if(b(y(),l.left,"key",2*P).includes(l.origin.key))W("repeat");else{const t={data:{time:x(l.left),value:j(l.origin.type,l.top)},...l.origin};p("add",t),w(t)}!function(t){t.setCoords().set({originX:"left",left:t.originLeft,top:t.originTop})}(l)})),h.value.add(i,n)}))}(),h.value.add(new t.Rect({left:0,top:0,width:T-E.strokeWidth,height:M-E.strokeWidth,fill:"transparent",...E}))}export{h as useLeft};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"vue";import"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as n}from"../../constants/index.js";function r(r,l,a,s,u){const{cumputedX:c,getXValue:f}=i(l),{other:d,yCellHeight:m,endX:h,originX:p,originY:v,endY:g,markHeight:x,event:y,topGridYCellHeight:X}=l;function k(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1}))),y.evented&&t.on("mouseup",(e=>{s.show=!1,3===e.button&&(u.point={x:t.left,y:t.top},u.show=!0,u.target=t,u.list=n.map((t=>({...t,renderItem:()=>t.label}))))}))}function _(t){s.point={x:t.left,y:"mark"===t.__type?t.top:t.top+X/2},s.list=[`时间 ${f(t.left).slice(-5)}`],"mark"===t.__type&&s.list.unshift(t.origin.name+" "),s.show=!0}function S(t){return t>=p&&t<=h}return function(){if(!(null==d?void 0:d.horizontal))return;const{horizontal:i}=d,n=p-5;let l=v+m/2;i.forEach(((i,a)=>{const{title:s,titleStyle:u={},type:f,pointAttr:d={},textStyle:h={},data:p}=i,v=s&&e(s,{...u,originX:"right",left:n,top:l});r.value.add(v),p.forEach(((i,n)=>{const{time:u,value:m}=i,p=c(u);if(!S(p))return;const v=e(f,{...d,left:p,top:l}),g=p+v.width/2+2,x=o([g,l],{value:m,...h,originX:"left"}),y=new t.Group([v,x],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});y.__type="other",y.origin={__type:"other",key:"horizontal",dataIndex:a,index:n,data:i,title:s},k(y),r.value.add(y)})),l+=m}))}(),function(){if(!(null==d?void 0:d.vertical))return;const{vertical:t}=d;t.forEach(((t,o)=>{const{textStyle:i={},data:n,time:l}=t,a=c(l);if(!S(a))return;let s=v+m/2;n.forEach(((t,n)=>{const u=e(String(t),{...i,lockMovementX:!0,lockMovementY:!0,left:a,originX:"left",top:s,__type:"other",origin:{key:"vertical",dataIndex:o,index:n,data:{time:l,value:t}}});s+=m,k(u),r.value.add(u)}))}))}(),function(){if(!(null==d?void 0:d.mark)||!x)return;const{title:t,titleStyle:i,pointAttr:n,dataList:l}=d.mark,u=o([p-5,g+x/2],{value:t,...i,originX:"right"});r.value.add(u);const m=g+x,X=[];l.forEach((t=>{const{time:o,list:i=[]}=t,l=c(o);if(!S(l))return;let u=g;i.forEach((t=>{let o=!1;const i=e("circleAndText",{...n,text:t.text,left:l,top:u,origin:t,__type:"mark"}),c=i.height;u+c<=m&&u>=g?(i.set("top",u+c/2),u+=c):(o||(u=g,o=!0),i.set("top",u-c/2),u-=c),X.push(i),function(t){y.hovered&&(t.on("mouseover",(()=>{_(t)})),t.on("mouseout",(()=>{s.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<v&&t.set("top",v);const e=g+x-t.height/2;t.top>e&&t.set("top",e)}(t),y.hovered&&_(t)})),t.on("mouseup",(e=>{if(s.show=!1,1===e.button){!function(t){var e;if((null==(e=t.origin)?void 0:e.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left));console.log(e);const o=Math.min(...e);console.log(o,t.startPoint),t.startPoint.limitX.x2=o}}(t);const e={type:"mark",time:f(t.left),data:t.origin};r.value.discardActiveObject(),a("change",e)}}))}(i),r.value.add(i)}))})),function(t){const e=t.find((t=>{var e;return null==(e=t.origin)?void 0:e.isStart})),o=t.find((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)&&t.left>e.left})),i=t.filter((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)}));t.forEach((t=>{var n;const r={x1:p,x2:h};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=o.left,t.otherPoints=i):(r.x1=e.left,t.startPoint=e),t.limitX=r}))}(X)}(),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o}=t;a(o,{...e.origin,type:"other"})}}}export{r as useOther};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawPoint as e,drawText as o}from"../useDraw.js";import{useBirthProcessCumputedPoint as i}from"../useCumputedPoint.js";import"vue";import{cloneDeep as n}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";import{OTHER_MENU as r}from"../../constants/index.js";function a(a,l,s,u,c){const{cumputedX:d,getXValue:f}=i(l),{other:m,yCellHeight:h,endX:v,originX:p,originY:g,endY:x,markHeight:k,event:y,topGridYCellHeight:X}=l,w=new Map,_=n(m);function S(){var i;if(!(null==(i=null==_?void 0:_.horizontal)?void 0:i.length))return;const n="horizontal";w.set(n,[]);const{horizontal:r}=_,l=p-5;let s=g+h/2;r.forEach(((i,r)=>{const{title:u,titleStyle:c={},type:f,pointAttr:m={},textStyle:v={},data:p}=i,g=u&&e(u,{...c,originX:"right",left:l,top:s});a.value.add(g),p.forEach(((i,l)=>{const{time:c,value:h}=i,p=d(c);if(!P(p))return;const g=e(f,{...m,left:p,top:s}),x=p+g.width/2+2,k=o([x,s],{value:h,...v,originX:"left"}),y=new t.Group([g,k],{lockMovementX:!0,lockMovementY:!0,objectCaching:!1,hasControls:!1,hasBorders:!1,hoverCursor:"pointer"});y.__type="other",y.origin={__type:"other",key:n,dataIndex:r,index:l,data:i,title:u},M(y),w.get(n).push(y),a.value.add(y)})),s+=h}))}function b(){var t;if(!(null==(t=null==_?void 0:_.vertical)?void 0:t.length))return;const o="vertical";w.set(o,[]);const{vertical:i}=_;i.forEach(((t,i)=>{const{textStyle:n={},data:r,time:l}=t,s=d(l);if(!P(s))return;let u=g+h/2;r.forEach(((t,r)=>{const c=e(String(t),{...n,lockMovementX:!0,lockMovementY:!0,left:s,originX:"left",top:u,__type:"other",origin:{key:o,dataIndex:i,index:r,data:{time:l,value:t}}});u+=h,M(c),w.get(o).push(c),a.value.add(c)}))}))}function M(t){y.hovered&&(t.on("mouseover",(()=>{E(t)})),t.on("mouseout",(()=>{u.show=!1}))),y.evented&&t.on("mouseup",(e=>{u.show=!1,3===e.button&&(c.point={x:t.left,y:t.top},c.show=!0,c.target=t,c.list=r.map((t=>({...t,renderItem:()=>t.label}))))}))}function j(){if(!(null==m?void 0:m.mark)||!k)return;const{title:t,titleStyle:i,pointAttr:n,dataList:r}=m.mark,l=o([p-5,x+k/2],{value:t,...i,originX:"right"});a.value.add(l);const c=x+k,h=[];r.forEach((t=>{const{time:o,list:i=[]}=t,r=d(o);if(!P(r))return;let l=x;i.forEach((t=>{let o=!1;const i=e("circleAndText",{...n,text:t.text,left:r,top:l,origin:{...t,key:"mark"},__type:"mark"}),d=i.height;l+d<=c&&l>=x?(i.set("top",l+d/2),l+=d):(o||(l=x,o=!0),i.set("top",l-d/2),l-=d),h.push(i),function(t){y.hovered&&(t.on("mouseover",(()=>{E(t)})),t.on("mouseout",(()=>{u.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2);t.top<g&&t.set("top",g);const e=x+k-t.height/2;t.top>e&&t.set("top",e)}(t),y.hovered&&E(t)})),t.on("mouseup",(e=>{if(u.show=!1,1===e.button){!function(t){var e;if((null==(e=t.origin)?void 0:e.isStart)&&t.otherPoints)t.otherPoints.forEach((e=>{e.limitX.x1=t.left}));else{const e=t.startPoint.otherPoints.map((t=>t.left)),o=Math.min(...e);t.startPoint.limitX.x2=o}}(t);const e={type:"mark",time:f(t.left),data:t.origin};a.value.discardActiveObject(),s("change",e)}}))}(i),a.value.add(i)}))})),function(t){const e=t.find((t=>{var e;return null==(e=t.origin)?void 0:e.isStart})),o=t.find((t=>{var o;return!(null==(o=t.origin)?void 0:o.isStart)&&t.left>e.left})),i=t.filter((t=>{var e;return!(null==(e=t.origin)?void 0:e.isStart)}));t.forEach((t=>{var n;const r={x1:p,x2:v};(null==(n=t.origin)?void 0:n.isStart)?(r.x2=o.left,t.otherPoints=i):(r.x1=e.left,t.startPoint=e),t.limitX=r}))}(h)}function E(t){u.point={x:t.left,y:"mark"===t.__type?t.top:t.top+X/2},u.list=[`时间 ${f(t.left).slice(-5)}`],"mark"===t.__type&&u.list.unshift(t.origin.name+" "),u.show=!0}function P(t){return t>=p&&t<=v}return S(),b(),j(),{clickMenu:function({item:t,target:e}){if(!e)return;const{type:o}=t,i={...e.origin,type:"other"};s(o,i),"remove"===o&&function(t,e="add"){const{dataIndex:o,data:i,index:n,key:r}=t,l=_[r],s=["mark"].includes(r)?l.dataList[o]:l[o];switch(e){case"remove":s.data.splice(n,1);break;case"change":s.data[n]=i}!function(t){var e;const{key:o}=t;switch(null==(e=a.value)||e.remove(...w.get(o)),w.delete(o),o){case"horizontal":S();break;case"vertical":b();break;case"mark":j()}}(t)}(i,o)}}}export{a as useOther};
@@ -1 +1 @@
1
- import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{cloneDeep as o,range as d}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as c}from"../../constants/index.js";import{useTop as p}from"./useTop.js";import{useLeft as m}from"./useLeft.js";import{useCenter as h}from"./useCenter.js";import{useOther as v}from"./useOther.js";function f(f,g,y,x,w,b){const j=e(),Y=e(),C=e(),H=t((()=>g.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),A=t((()=>{var e;return null!=(e=g.data.left.width)?e:0})),D=t((()=>{const{grid:e}=g.data;return e.mainXCell*e.subXCell})),M=t((()=>{const{grid:e}=g.data;return e.mainYCell*e.subYCell})),T=t((()=>s(g.data.top.treeData))),X=t((()=>g.data.top.tree.cellHeight)),V=t((()=>X.value*T.value)),k=t((()=>$(U("drug")||"top"))),G=t((()=>k.value+V.value)),S=t((()=>{var e;return Date.parse((null==(e=g.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),N=t((()=>{const e=o(g.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=d(D.value/t+1).map((r=>0===r?e.startTime:u(new Date(S.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:A.value}})),O=function(){const e=o(g.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=g.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const u={top:t*r+k.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);u.height=a*r,e(i.children,l+1)}else u.width=A.value-u.left;Object.assign(i,u)}))}(e),e}(),L=t((()=>$(U("xAxis")||"center"))),W=t((()=>{var e;const{width:t,right:a}=g.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),E=t((()=>$(U("intraoperatively")||"bottom"))),I=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=g.data.other)?void 0:e.mark)||{};return t&&a?a:0})),P=t((()=>E.value+(g.data.height-V.value-N.value.height-I.value))),q=t((()=>(W.value-A.value)/D.value)),z=t((()=>(P.value-E.value)/M.value)),B=t((()=>N.value.spaceTimeStamp/q.value)),F=t((()=>{const{scaleValues:e}=g.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),J=t((()=>_("pulse"))),K=t((()=>_("temperature"))),Q=t((()=>{var e;return(null==(e=g.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),R=a({canvasWidth:g.data.width,canvasHeight:g.data.height,borderStyle:{...n,...g.data.borderStyle||{}},grid:g.data.grid,top:g.data.top,left:g.data.left,other:g.data.other,topGridYNumber:r(T),topGridYCellHeight:r(X),topGridOriginY:r(k),topGridEndY:r(G),treeData:O,xAxis:r(N),originYXAxis:r(L),startTime:r(S),timeXCell:r(B),gridXNumber:r(D),gridYNumber:r(M),xCellWidth:r(q),yCellHeight:r(z),originX:r(A),endX:r(W),originY:r(E),endY:r(P),markHeight:r(I),itemList:r(F),scaleValues:g.data.scaleValues,pulseYCell:r(J),temperatureYCell:r(K),event:r(Q)});function U(e){let t="";return Object.entries(H.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function Z(e){const t=H.value[e],a=N.value.height;switch(t){case"drug":return V.value;case"xAxis":return a;default:return g.data.height-V.value-a}}function $(e){switch(e){case"top":return 0;case"center":return Z("top");default:return Z("top")+Z("center")}}function _(e){const{scaleValues:t}=g.data,a=t.find((t=>t.type===e));return z.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),p(f,R,y,w),m(f,R);const{clickMenu:e}=v(f,R,y,w,b),{redrawPoints:t,clickMenu:a}=h(f,R,y,w,b);Y.value=t,C.value=t=>{const{item:r}=t;r.type&&c.map((e=>e.type)).includes(r.type)?e(t):a(t)}})),{propItems:R,redrawPoints:Y,select:j,clickMenu:C}}export{f as useSurgicalAnesthesiaChart};
1
+ import{ref as e,computed as t,reactive as a,unref as r,onMounted as i,nextTick as l}from"vue";import{defaultBorderStyle as n}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as u}from"date-fns";import{getChildrenSize as s}from"../../utils/index.js";import{cloneDeep as o,range as d}from"lodash-es";import"../temperature/useShadow.js";import{OTHER_MENU as c}from"../../constants/index.js";import{useTop as p}from"./useTop.js";import{useLeft as m}from"./useLeft.js";import{useCenter as h}from"./useCenter.js";import{useOther as v}from"./useOther.js";function f(f,g,y,x,w,b){const j=e(),Y=e(),C=e(),H=t((()=>g.data.layout||{top:"drug",center:"xAxis",bottom:"intraoperatively"})),D=t((()=>{var e;return null!=(e=g.data.left.width)?e:0})),A=t((()=>{const{grid:e}=g.data;return e.mainXCell*e.subXCell})),M=t((()=>{const{grid:e}=g.data;return e.mainYCell*e.subYCell})),T=t((()=>s(g.data.top.treeData))),X=t((()=>g.data.top.tree.cellHeight)),G=t((()=>X.value*T.value)),V=t((()=>$(U("drug")||"top"))),k=t((()=>V.value+G.value)),S=t((()=>{var e;return Date.parse((null==(e=g.data.xAxis)?void 0:e.startTime)||u(new Date,"yyyy-MM-dd HH:mm:ss"))})),L=t((()=>{const e=o(g.data.xAxis),{spaceValue:t,spaceTimeStamp:a}=e,r=d(A.value/t+1).map((r=>0===r?e.startTime:u(new Date(S.value+r*t*a),"yyyy-MM-dd HH:mm:ss")));return{...e,list:r,left:D.value}})),N=function(){const e=o(g.data.top.treeData);let t=0;const{cellWidth:a,cellHeight:r}=g.data.top.tree;return function e(i,l=0){i.forEach((i=>{var n;const u={top:t*r+V.value,left:l*a,width:a,height:r};if(t++,null==(n=i.children)?void 0:n.length){t--;const a=s(i.children);u.height=a*r,e(i.children,l+1)}else u.width=D.value-u.left;Object.assign(i,u)}))}(e),e}(),O=t((()=>$(U("xAxis")||"center"))),P=t((()=>{var e;const{width:t,right:a}=g.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),W=t((()=>$(U("intraoperatively")||"bottom"))),E=t((()=>{var e;const{show:t=!0,height:a}=(null==(e=g.data.other)?void 0:e.mark)||{};return t&&a?a:0})),I=t((()=>W.value+(g.data.height-G.value-L.value.height-E.value))),q=t((()=>(P.value-D.value)/A.value)),z=t((()=>(I.value-W.value)/M.value)),B=t((()=>L.value.spaceTimeStamp/q.value)),F=t((()=>{const{scaleValues:e}=g.data;return e.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:e.type,unit:e.unit,dataIndex:a}))))).flat()})),J=t((()=>_("pulse"))),K=t((()=>_("temperature"))),Q=t((()=>{var e;return(null==(e=g.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),R=a({canvasWidth:g.data.width,canvasHeight:g.data.height,borderStyle:{...n,...g.data.borderStyle||{}},grid:g.data.grid,top:g.data.top,left:g.data.left,other:g.data.other,topGridYNumber:r(T),topGridYCellHeight:r(X),topGridOriginY:r(V),topGridEndY:r(k),treeData:N,xAxis:r(L),originYXAxis:r(O),startTime:r(S),timeXCell:r(B),gridXNumber:r(A),gridYNumber:r(M),xCellWidth:r(q),yCellHeight:r(z),originX:r(D),endX:r(P),originY:r(W),endY:r(I),markHeight:r(E),itemList:r(F),scaleValues:g.data.scaleValues,pulseYCell:r(J),temperatureYCell:r(K),event:r(Q)});function U(e){let t="";return Object.entries(H.value).some((([a,r])=>{if(r===e)return t=a,!0})),t}function Z(e){const t=H.value[e],a=L.value.height;switch(t){case"drug":return G.value;case"xAxis":return a;default:return g.data.height-G.value-a}}function $(e){switch(e){case"top":return 0;case"center":return Z("top");default:return Z("top")+Z("center")}}function _(e){const{scaleValues:t}=g.data,a=t.find((t=>t.type===e));return z.value*(a.spaceGridNumber||1)/(a.spaceValue||1)}return i((async()=>{await l(),p(f,R,y,w);const{redrawPoints:e,clickMenu:t,moveLimit:a,setPopup:r,updateData:i,getGridPoints:n}=h(f,R,y,w,b);m(f,R,y,w,a,r,i,n);const{clickMenu:u}=v(f,R,y,w,b);Y.value=e,C.value=e=>{const{item:a}=e;a.type&&c.map((e=>e.type)).includes(a.type)?u(e):t(e)}})),{propItems:R,redrawPoints:Y,select:j,clickMenu:C}}export{f as useSurgicalAnesthesiaChart};
@@ -1 +1 @@
1
- import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as f}from"../useCumputedPoint.js";import"vue";import{cloneDeep as c}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function a(a,d,u,m,h){const{cumputedX:p,getXValue:x}=f(d),{originX:L,endX:g,xCellWidth:v,originYXAxis:X,top:C,topList:w,canvasWidth:y,borderStyle:Y,treeData:S,xAxis:j,topGridYNumber:b,topGridOriginY:k,topGridYCellHeight:G,topGridEndY:I,event:z}=d,A=new Set;function M(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:f}=C.data||{},{startLine:c,centerLine:a,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=$(n,e,i);n&&(n.set(u),n.origin={data:t},D(n),c&&(c.text=n),d&&(d.text=n))}return n}function $(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function E(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:f,y2:c,halfY:a}=e;if(!s||s<L||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:a};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,f,s,a],d);const h=new t.Rect({width:v,height:G,fill:"transparent",left:s-v/2,top:f}),p=new t.Group([u,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,D(p),p}function D(t){z.hovered&&(t.on("mouseover",(()=>{H(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=$(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),z.hovered&&H(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};u("change",e)}})))}function H(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=x(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(a,{...d,gridYNumber:b,originY:k,yCellHeight:G,endY:I}),function(){const{height:o,list:l,left:r,spaceValue:s}=j;if(!o)return;const f=[],c=X+o/2;l.forEach(((t,i)=>{const n=r+i*v*s;f.push(e([n,c],{value:t.slice(11,16)}))}));const d=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;d&&a.value.add(d);const u=new t.Rect({width:y,height:o,left:0,top:X,...n,originX:"left",originY:"top",...Y});a.value.add(u)}(),function(){var e;const n=(null==(e=null==C?void 0:C.tree)?void 0:e.textStyle)||{},r=[];!function t(e){e.forEach((e=>{var i;const{width:s,height:f,left:a,top:d,title:u=""}=e,m={value:u,...n};(null==(i=e.children)?void 0:i.length)?(m.value=u.split("").join("\n"),t(e.children)):(m.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+G,s=r-G/2,f={y1:o,y2:r,halfY:s},a=[],d=c(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[c,u]=o,m=c&&p(c),h=u&&p(u),x=E({...f,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),v=E({...f,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,w;if((x||m<L)&&(v||h>g)){X=l([x?m:L,s,v?h:g,s],e)}a.push({startLine:x,centerLine:X,endLine:v}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:L,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:L,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,a,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=M(n[i-1],a[i-1],s)),i===n.length-1&&(w=M(t,a[i],s)),X&&A.add(X),x&&A.add(x),v&&A.add(v),C&&A.add(C),w&&A.add(w)}))}(e)),r.push(o({width:s,height:f,...Y},m,{left:a,top:d},!0))}))}(S);const s=r.length>0?new t.Group([...r],{...i,objectCaching:!1}):null;s&&a.value.add(s),A.size&&a.value.add(...A)}()}export{a as useTop};
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,defaultRectStyle as n,drawTextGroup as o,drawLine as l,drawPoint as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import{useBirthProcessCumputedPoint as a}from"../useCumputedPoint.js";import"vue";import{cloneDeep as f}from"lodash-es";import"date-fns";import"../temperature/useShadow.js";function c(c,d,u,m,h){const{cumputedX:p,getXValue:v}=a(d),{originX:x,endX:g,xCellWidth:L,originYXAxis:X,top:C,canvasWidth:y,borderStyle:w,treeData:S,xAxis:Y,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:k,topGridEndY:G,event:I}=d,z=new Set;function A(t,e,i){let n;const{content:o}=t.value||{};if(o){const{lineStyle:l,textStyle:s,totalStyle:a}=C.data||{},{startLine:f,centerLine:c,endLine:d}=e;n=r(o,{fontSize:12,...s,backgroundColor:"#fff",lockMovementX:!0,lockMovementY:!0});const u=M(n,e,i);n&&(n.set(u),n.origin={data:t},E(n),f&&(f.text=n),d&&(d.text=n))}return n}function M(t,e,i){const n=t.width+1,{startLine:o,centerLine:l,endLine:r}=e,s={top:i,originX:"center",originY:"center"};return l&&n<=l.width?s.left=l.x1+l.width/2:r&&n<=r.limitX.x2-r.left?(s.originX="left",s.left=r.left+1):o&&!r&&n<=o.limitX.x2-o.left?(s.originX="left",s.left=o.left+(o.isCustomIcon?5:1)):o&&n<=o.left-o.limitX.x1?(s.originX="right",s.left=o.left-(o.isCustomIcon?5:1)):l?(s.originY="top",s.left=l.x1+l.width/2,s.top=i+1,s.fontSize=10):o&&(s.originX="left",s.originY="top",s.fontSize=10,s.left=o.left,s.top=i+1),s}function $(e,{isCustomIcon:i,isContinue:n,isLeft:o}){const{x:s,y1:a,y2:f,halfY:c}=e;if(!s||s<x||s>g)return;const{lineStyle:d}=C.data||{};let u;const m={left:s,top:c};u=i?r("circle",{fill:d.stroke,...m}):n?r(">",{fill:d.stroke,...m,fontSize:18}):l([s,a,s,c],d);const h=new t.Rect({width:L,height:k,fill:"transparent",left:s-L/2,top:a}),p=new t.Group([u,h],{originX:"center",originY:"center",hasControls:!1,hasBorders:!1,objectCaching:!1,hoverCursor:"pointer",lockMovementY:!0});return p.isLeft=o,p.isCustomIcon=i,E(p),p}function E(t){I.hovered&&(t.on("mouseover",(()=>{D(t,"hover")})),t.on("mouseout",(()=>{m.show=!1}))),t.lockMovementX&&t.lockMovementY||(t.on("moving",(()=>{!function(t){t.setCoords(),t.left<t.limitX.x1&&t.set("left",t.limitX.x1);t.left>t.limitX.x2&&t.set("left",t.limitX.x2)}(t),function(t){if(t.centerLine){const e=t.isLeft?{x1:t.left}:{x2:t.left};t.centerLine.setCoords().set(e)}if(t.text){const e=M(t.text,{startLine:t.isLeft?t:t.nearLine,centerLine:t.centerLine,endLine:t.isLeft?t.nearLine:t},t.top);t.text.setCoords().set(e)}}(t),I.hovered&&D(t)})),t.on("mouseup",(e=>{if(1===e.button){!function(t){t.isLeft?(t.prevLine&&(t.prevLine.limitX.x2=t.left),t.nearLine&&(t.nearLine.limitX.x1=t.left)):(t.nextLine&&(t.nextLine.limitX.x1=t.left),t.nearLine&&(t.nearLine.limitX.x2=t.left))}(t);const e={type:"tree",...t.origin};u("change",e)}})))}function D(t,e="moving"){var i,n,o;const{data:l}=t.origin;m.point={x:t.left,y:t.top};let[r="",s=""]=l.time||[];if("moving"===e){const e=v(t.left);t.isLeft?r=e:s=e,l.time=[r,s],t.text&&(t.text.origin.data.time=[r,s])}m.list=[`开始时间 ${r}`,`结束时间 ${s}`,`流速 ${(null==(i=l.value)?void 0:i.currentSpeed)||""}`,`浓度 ${(null==(n=l.value)?void 0:n.consistence)||""}`,`总量 ${(null==(o=l.value)?void 0:o.total)||""}`],m.show=!0}s(c,{...d,gridYNumber:j,originY:b,yCellHeight:k,endY:G}),function(){var o;const{height:l,list:r,left:s,spaceValue:a}=Y;if(!l)return;const f=[],d=X+l/2;r.forEach(((t,i)=>{const n=s+i*L*a;f.push(e([n,d],{value:t.slice(11,16)}))}));const u=f.length>0?new t.Group([...f],{...i,objectCaching:!1}):null;u&&c.value.add(u);const m=new t.Rect({width:y,height:l,left:0,top:X,...n,originX:"left",originY:"top",...w}),h=e([g+(y-g)/2,d],{value:"总量",...null==(o=C.data)?void 0:o.totalStyle});c.value.add(m,h)}(),function(){var n;const r=(null==(n=null==C?void 0:C.tree)?void 0:n.textStyle)||{},s=[];!function t(i){i.forEach((i=>{var n;const{width:a,height:d,left:u,top:m,title:h=""}=i,v={value:h,...r};(null==(n=i.children)?void 0:n.length)?(v.value=h.split("").join("\n"),t(i.children)):(v.textAlign="left",function(t){if(!(null==t?void 0:t.data)||!Array.isArray(t.data))return;const{lineStyle:e,textStyle:i,totalStyle:n}=C.data||{},o=t.top,r=o+k,s=r-k/2,a={y1:o,y2:r,halfY:s},c=[],d=f(t);delete d.data,t.data.forEach(((t,i,n)=>{const{time:o,continue:r}=t,[f,u]=o,m=f&&p(f),h=u&&p(u),v=$({...a,x:m},{isCustomIcon:!h&&!r,isContinue:!1,isLeft:!0}),L=$({...a,x:h},{isCustomIcon:!1,isContinue:!!r});let X,C,y;if((v||m<x)&&(L||h>g)){X=l([v?m:x,s,L?h:g,s],e)}c.push({startLine:v,centerLine:X,endLine:L}),function(t,e,i){const{startLine:n,centerLine:o,endLine:l}=e[t],{startLine:r,endLine:s}=e[t-1]||{};if(n){n.origin=i;const t={x1:x,x2:l?l.left:g};s?(t.x1=s.left,s.limitX.x2=n.left,n.prevLine=s,s.nextLine=n):r&&(t.x1=r.left,r.limitX.x2=n.left,n.prevLine=r,r.nextLine=n),n.limitX=t,o&&(n.centerLine=o)}if(l){l.origin=i;const t={x1:n?n.left:x,x2:g};l.limitX=t,o&&(l.centerLine=o)}n&&l&&(n.nearLine=l,l.nearLine=n)}(i,c,Object.assign({},d,{data:t,index:i})),n[i-1]&&(C=A(n[i-1],c[i-1],s)),i===n.length-1&&(y=A(t,c[i],s)),X&&z.add(X),v&&z.add(v),L&&z.add(L),C&&z.add(C),y&&z.add(y)}))}(i),function(t){var i;if(!(null==t?void 0:t.total))return;const n=t.top+k/2,o=e([g+(y-g)/2,n],{value:t.total,...null==(i=C.data)?void 0:i.totalStyle});o&&c.value.add(o)}(i)),s.push(o({width:a,height:d,...w},v,{left:u,top:m},!0))}))}(S);const a=s.length>0?new t.Group([...s],{...i,objectCaching:!1}):null;a&&c.value.add(a),z.size&&c.value.add(...z)}()}export{c as useTop};
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as n,defaultStyle as i,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as g,deleteProperty as v}from"../../utils/index.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,k,S,Y,E,M,$,O,P,A){s(L,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(L,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ne=new Set,ie=m(R.yScaleValue);function oe(t){var o;const l=ie.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&L.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:n}=t.origin||{};if("pulse"===e){const e=Z.get(n),i=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(i,1,[t.left,t.top])}}const o=function(){const e=[],t=[],n=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&n.push(e[0])}));const[i,o]=t;let l=[],r=[];return n.forEach((t=>{const n=i.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=i[n],u=o[s],c=i[n-1],p=i[n+1],d=o[s-1],f=o[s+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[n]=t,i=t.at(-1);n[0]===i[0]&&n[1]===i[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...T(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...i,...s}),Q.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const n=Math.trunc(t[0]);return e[n]=e[n]?e[n].concat(t):[t],e}),{}),n=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return n}(t);i.forEach((t=>{const i=n([...t.flat()],{...s,originX:"center"});e.push(i),Q.add(i)}))}L.value.add(...e)}Q.add(l),L.value.add(l)}))}}function le(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const n=Object.assign({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...i,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...n[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M,showConnectLine:O=!1}=b,A=[],C=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,R=ue(u,s),X={};X.value=function(e,t,n){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:i={}}=n,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:i.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(R,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,k,S,Y;if(t.noRise&&h.show){const t=w(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],w(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const n=t+2*z;k=r([e[0],t,n],h.style||{}),I.push(k)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=n([...e,e[0],l],{...m,...v.line,...i}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...i,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:w(h)},arrowGroup:{obj:k,top:2*z,isFixed:w(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(R,u,T,X,s),function(e,t,n,i){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=n;if(u&&+t.value>180){let t=e[1]-2.5*z,n=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,n=[t,e[1]+z/2]),o=r([e[0],n[0],n[1]],m,"up"),I.push(o)}if(p){const n={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],n),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],n),I.push(a))}Object.assign(i,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(R,u,T,X),function(i,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),w=se(c,e.list[r].value),E=j&&se(c,b.value);i&&j&&!l.breakpoint&&(!w&&!E||O)&&i[0]!==j[0]&&(f=n([...i,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===Y?0:x,T=C[r-1],R={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...w?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:w?e-5:e,...R})}else i&&(R.leftLine=null,p=o(I,{left:i[0],top:w?i[1]-5:i[1],...R}));C.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(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}),Object.values(e.otherObj).forEach((t=>{const{obj:n,type:i="",top:o=0,isFixed:l}=t||{};"reduce"!==i&&("line"===i?null==n||n.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==n||n.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,n=$(t,e.top),i={...e.origin,data:{...e.origin.data,value:n}};L.value.discardActiveObject(),S("change",i),pe(i,"change")}}))}(p),A.push(p),ne.add(p))}(R,u,b,T,X)})),"pulse"===c&&U.forEach((e=>{Z.set(e,A.filter((t=>{var n;return(null==(n=t.origin)?void 0:n.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(A).then((e=>{const t=C.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(I).then((n=>{L.value.add(...t,...e,...n),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:n,unit:i,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${i||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${i||""}`;return`${n} ${a}${i||""}`}(),`时间 ${((null==l?void 0:l.time)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const n="pain"===t.type?B:q;if(f(e)&&function(e){const[t]=X,n=X.at(-1),i=t.start,o=n.end,l=h(e);return l>=i&&l<=o}(e.time)){const i=Y(e.time),o=E(t.type,t.list,e.value);return[i,o<n.originY?n.originY:o>n.endY?n.endY:o]}}function ce(e){const t=new Date,n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${n}-${i} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:n,dataIndex:i,index:o,data:l,key:r}=e,s=ie.find((e=>e.type===n));if("add"===t){const e=a(n)?s.dataList.find((e=>e.enable)):s.dataList[i],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[i].list[o]=l;de()}function de(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),Z.clear(),ne.clear(),ee.clear(),te.clear(),ie.forEach((e=>{e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),i=n([D,t,V,t],e.positionLine);L.value.add(i)}(e),e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le(),k.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};if(n>=D&&n<=V&&i>=_&&i<=G){A.point={x:n,y:i},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!C([...ne],n,"_type").includes(t.bigType)){const n=["pain"].includes(t.bigType)?B:q;i>=n.originY&&i<=n.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(n);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:n,type:i,dataIndex:o,index:l}=t.origin,r=v(n,[...x,...b]);r[`${e.type}`]=e.value,a(i)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ne}}function w(e){return"fixed"===e.position}export{L as useCenter};
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as n,defaultStyle as i,drawPoint as o,drawText as l,drawArrow as r}from"../useDraw.js";import{useGrid as s}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getTime as h,getIndex as g,deleteProperty as v}from"../../utils/index.js";import{useCommon as y}from"../useCommon.js";import"vue";import{cloneDeep as m}from"lodash-es";import{TEMPERATURE_MENU as x,PAIN_MENU as b,OVERLAP as j}from"../../constants/index.js";function L(L,k,S,Y,E,M,$,O,P,A){s(L,k);const{getEqualXTypes:C,handleAddPrevent:I}=y(L,S,k),{createShadowLines:T}=t(),{left:R,xScaleList:X,xCellWidth:F,yCellHeight:z,originX:D,endX:V,originY:_,endY:G,itemList:H,event:W,vitalSignsOriginY:q,painOriginY:B,hospitalizationDate:J,config:K,canvasHeight:N}=k,Q=new Set,U=["xinmai","mai"],Z=new Map,ee=new Set,te=new Set,ne=new Set,ie=m(R.yScaleValue);function oe(t){var o;const l=ie.find((e=>"pulse"===e.type));if(l&&(null==(o=l.dataList)?void 0:o.length)&&(Q.size&&L.value.remove(...Q),Q.clear(),Z.size>1)){if(t){const{type:e,key:n}=t.origin||{};if("pulse"===e){const e=Z.get(n),i=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(i,1,[t.left,t.top])}}const o=function(){const e=[],t=[],n=[];for(const e of Z)t.push(e[1]),e[0]===U[0]&&e[1].forEach((e=>{(Z.get(U[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&n.push(e[0])}));const[i,o]=t;let l=[],r=[];return n.forEach((t=>{const n=i.findIndex((e=>e[0]===t)),s=o.findIndex((e=>e[0]===t)),a=i[n],u=o[s],c=i[n-1],p=i[n+1],d=o[s-1],f=o[s+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&r.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const g=Math.max(a[1],u[1]);r.push([a,u].find((e=>e[1]===g)));const v=()=>{const t=[...l,...r.reverse()],[n]=t,i=t.at(-1);n[0]===i[0]&&n[1]===i[1]&&t.splice(-1,1),e.push(t),l=[],r=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),v()}}else p?(l.push(p),v()):f?(r.push(f),v()):v()})),e}(),{mode:r,style:s={}}=l.shadow||{};o.forEach((t=>{const o=t.map((e=>({x:e[0],y:e[1]}))),l=new e.Polygon(o,{...i,...s,strokeWidth:1});if(["slash","line"].includes(r)){l.set({fill:"transparent",stroke:s.stroke||"#f00"});const e=[];if(["slash"].includes(r))e.push(...T(t,s._angle,s.space)),e.forEach((e=>{Object.assign(e,{...i,...s}),Q.add(e)}));else{const i=function(e){const t=e.reduce(((e,t)=>{const n=Math.trunc(t[0]);return e[n]=e[n]?e[n].concat([t]):[t],e}),{}),n=Object.values(t).filter((e=>2===e.length&&Math.trunc(e[0][1])!==Math.trunc(e[1][1])));return n}(t);i.forEach((t=>{const i=n([...t.flat()],{...s,originX:"center"});e.push(i),Q.add(i)}))}L.value.add(...e)}Q.add(l),L.value.add(l)}))}}function le(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const n=Object.assign({},j,R.overlap||{}),l=[];ee.size&&[...ee].forEach((e=>{[...te].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const r={left:t.left,top:t.top,...i,hoverCursor:"default"};let s="koumai";"yemai"===e&&(s=e),"humai"===e&&(s="circle"),l.push(o(s,{...n[e]||{},...r}))}}}))})),setTimeout((()=>{L.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ne.add(e)}))}))}function re(e,t,s){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:g={},reduceStyle:v={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:j=[]}=s,{type:Y,textStyle:M,showConnectLine:O=!1}=b,A=[],C=[],I=[];null==(u=e.list)||u.forEach(((u,b)=>{const T=a(c)?j.find((e=>e.key===u.key)):e,R=ue(u,s),X={};X.value=function(e,t,n){if(!(null==e?void 0:e.length)||!K.showValue)return;const{lineAttr:i={}}=n,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,r=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:i.stroke||"#000"});return I.push(r),{obj:r,top:-z}}(R,u,T),function(e,t,s,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=s,{value:x}=a;let b,j,L,k,S,Y;if(t.noRise&&h.show){const t=w(h)?E(u.type,u.list,35):e[1];if(h.text)L=l([e[0],w(h)?t:t+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),I.push(L);else{const n=t+2*z;k=r([e[0],t,n],h.style||{}),I.push(k)}}t.rise&&f.show&&f.text&&(S=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),I.push(S));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...g}),I.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=E(c,u.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=n([...e,e[0],l],{...m,...v.line,...i}),j=o((null==(y=null==v?void 0:v.point)?void 0:y.type)||"circle",{left:e[0],top:l,...v.point,...i,originY:l===N?"bottom":"center"}),b&&I.push(b),j&&I.push(j)}Object.assign(a,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:L,top:5,isFixed:w(h)},arrowGroup:{obj:k,top:2*z,isFixed:w(h)},riseText:{obj:S,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:j,type:"reduce"}})}(R,u,T,X,s),function(e,t,n,i){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=n;if(u&&+t.value>180){let t=e[1]-2.5*z,n=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,n=[t,e[1]+z/2]),o=r([e[0],n[0],n[1]],m,"up"),I.push(o)}if(p){const n={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...s.list)){const t=o?e[1]+z/2+o.height:e[1]+z;a=l([e[0],t],n),I.push(a)}+t.value<Math.min(...s.list)&&(a=l([e[0],e[1]-z],n),I.push(a))}Object.assign(i,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(R,u,T,X),function(i,l,r,a,u){let p,f;const{pointAttr:h={},lineAttr:g={},title:v="",key:m,type:x="circle"}=a,b=e.list[r+1],j=ue(b,s),w=se(c,e.list[r].value),E=j&&se(c,b.value);i&&j&&!l.breakpoint&&(!w&&!E||O)&&i[0]!==j[0]&&(f=n([...i,...j],{...g}));const I=l.pacemakerShow&&"pulse"==c?y.value:w&&"number"===Y?0:x,T=C[r-1],R={origin:{data:l,title:v,key:m||"",unit:s.unit,type:c,_type:d(v,c),dataIndex:t,index:r},leftLine:T,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:k.event,...w?{selectable:!1,evented:!1,..."number"===Y?M:{}}:{}};if(T){const e=T.get("y2");p=o(I,{left:T.get("x2"),top:w?e-5:e,...R})}else i&&(R.leftLine=null,p=o(I,{left:i[0],top:w?i[1]-5:i[1],...R}));C.push(f),p&&(v.includes("脉搏")?ee.add(p):te.add(p),function(e){W.hovered&&(e.on("mouseover",(()=>{ae(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?B:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(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}),Object.values(e.otherObj).forEach((t=>{const{obj:n,type:i="",top:o=0,isFixed:l}=t||{};"reduce"!==i&&("line"===i?null==n||n.setCoords().set({x1:e.left,y1:e.top}):!l&&(null==n||n.setCoords().set({left:e.left,top:e.top+o})))})),oe(e)}(e),W.hovered&&ae(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,n=$(t,e.top),i={...e.origin,data:{...e.origin.data,value:n}};L.value.discardActiveObject(),S("change",i),pe(i,"change")}}))}(p),A.push(p),ne.add(p))}(R,u,b,T,X)})),"pulse"===c&&U.forEach((e=>{Z.set(e,A.filter((t=>{var n;return(null==(n=t.origin)?void 0:n.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(A).then((e=>{const t=C.filter((e=>e));let n=null;e=e.map((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(I).then((n=>{L.value.add(...t,...e,...n),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&L.value.remove(e.leftLine),e.rightLine&&L.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function ae(e,t="moving"){const{title:n,unit:i,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:r,physicsReduce:s}=l||{},a="hover"===t?l.value:$(o,e.top);if(p(r))return`药物降${"pain"==o?"痛":"温"} ${a}—>${r}${i||""}`;if(p(s))return`物理降${"pain"==o?"痛":"温"} ${a}—>${s}${i||""}`;return`${n} ${a}${i||""}`}(),`时间 ${((null==l?void 0:l.time)||M(e.left)).slice(-5)}`],P.show=!0}function ue(e,t){const n="pain"===t.type?B:q;if(f(e)&&function(e){const[t]=X,n=X.at(-1),i=t.start,o=n.end,l=h(e);return l>=i&&l<=o}(e.time)){const i=Y(e.time),o=E(t.type,t.list,e.value);return[i,o<n.originY?n.originY:o>n.endY?n.endY:o]}}function ce(e){const t=new Date,n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=h(`${t.getFullYear()}-${n}-${i} 23:59:59`),l=h(`${M(e)}:00`);return J&&l<h(J)?(I("exceedMin"),!1):!(l>o)||(I("exceedMax"),!1)}function pe(e,t="add"){const{type:n,dataIndex:i,index:o,data:l,key:r}=e,s=ie.find((e=>e.type===n));if("add"===t){const e=a(n)?s.dataList.find((e=>e.enable)):s.dataList[i],t=g(l.time,e.list);e.list.splice(t,0,l)}else s.dataList[i].list[o]=l;de()}function de(){var e;ne.size&&(null==(e=L.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ne]))),Z.clear(),ne.clear(),ee.clear(),te.clear(),ie.forEach((e=>{e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le()}return Z.clear(),ee.clear(),te.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=E(e.type,e.list,e.positionLine.value),i=n([D,t,V,t],e.positionLine);L.value.add(i)}(e),e.dataList.forEach(((t,n)=>{a(e.type)&&!t.enable||re(t,n,e)}))})),oe(),le(),k.event.evented&&L.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:n=0,y:i=0}=e.pointer||{};if(n>=D&&n<=V&&i>=_&&i<=G){A.point={x:n,y:i},A.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(A.list=[...x]),"pain"===o&&(A.list=[...b]),A.target=e.target;else{A.target=null,A.list=["新增节点"],H.forEach((t=>{if(!C([...ne],n,"_type").includes(t.bigType)){const n=["pain"].includes(t.bigType)?B:q;i>=n.originY&&i<=n.endY&&A.list.push({renderItem:O?O(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ce(n);t&&1!==A.list.length||(A.show=!1,1===A.list.length&&t&&I("repeat"))}}}})),{clickMenu:function({item:e,target:t}){if(t){const{data:n,type:i,dataIndex:o,index:l}=t.origin,r=v(n,[...x,...b]);r[`${e.type}`]=e.value,a(i)&&(r.key=t.origin.key);const s={...t.origin,data:r};S("change",s),pe(s,"change")}else{const t={data:{time:M(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};S("add",t),pe(t)}},setPopup:ae,isAddPoint:ce,updateData:pe,redrawPoints:de,gridPoints:ne}}function w(e){return"fixed"===e.position}export{L as useCenter};
@@ -9,7 +9,7 @@ interface IEvent {
9
9
  }
10
10
  export declare type ITreeItem = Partial<{
11
11
  title: string;
12
- totle: number;
12
+ total: number;
13
13
  data: Array<{
14
14
  time: string[];
15
15
  value: AnyObject;
@@ -1,3 +1,4 @@
1
+ /// <reference types="lodash" />
1
2
  import { SFCWithInstall } from '../../../es/shared/types';
2
3
  export * from './src/types';
3
4
  declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
@@ -44,6 +45,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
44
45
  type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
45
46
  default: () => never[];
46
47
  };
48
+ showSeq: {
49
+ type: BooleanConstructor;
50
+ default: boolean;
51
+ };
47
52
  }, {
48
53
  fieldsMapping: Record<string, string>;
49
54
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
@@ -90,6 +95,10 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
90
95
  type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
91
96
  default: () => never[];
92
97
  };
98
+ showSeq: {
99
+ type: BooleanConstructor;
100
+ default: boolean;
101
+ };
93
102
  }>> & {
94
103
  onReset?: ((...args: any[]) => any) | undefined;
95
104
  onClose?: ((...args: any[]) => any) | undefined;
@@ -112,7 +121,7 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
112
121
  isShowColumn: (column: import("../../../es/shared/types").AnyObject) => boolean;
113
122
  initFields: () => import("../../../es/shared/types").AnyObject[];
114
123
  handleGroup: (fields: import("../../../es/shared/types").AnyObject[]) => import("../../../es/shared/types").AnyObject[];
115
- getTableFields: () => import("../../../es/shared/types").AnyObject[];
124
+ getTableFields: () => import("lodash").Omit<never, "uuid">[];
116
125
  handleAllCheck: (checked: boolean, field: string) => void;
117
126
  handleCheck: ({ checked, column }: {
118
127
  checked: boolean;
@@ -123,6 +132,8 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
123
132
  NButton: any;
124
133
  NCheckbox: any;
125
134
  NPopconfirm: any;
135
+ NIcon: any;
136
+ NTooltip: any;
126
137
  Draggable: import("vue").DefineComponent<{
127
138
  list: {
128
139
  type: ArrayConstructor;
@@ -198,10 +209,35 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
198
209
  }>;
199
210
  Row: import("vue").DefineComponent<{
200
211
  element: {
201
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
212
+ type: import("vue").PropType<Partial<{
213
+ [key: string]: any;
214
+ id: string;
215
+ name: string;
216
+ show: boolean;
217
+ sort: boolean;
218
+ sortDirection: "NONE" | "ASC" | "DESC";
219
+ title: string;
220
+ alias: string;
221
+ fixedShow: boolean;
222
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
223
+ columnWidth: number | null;
224
+ editable: boolean;
225
+ editableDisable: boolean;
226
+ required: boolean;
227
+ requiredDisable: boolean;
228
+ hide: boolean;
229
+ }>>;
202
230
  default: () => {};
203
231
  };
204
232
  columns: {
233
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
234
+ default: () => never[];
235
+ };
236
+ idx: {
237
+ type: NumberConstructor;
238
+ default: number;
239
+ };
240
+ fieldList: {
205
241
  type: import("vue").PropType<Partial<{
206
242
  [key: string]: any;
207
243
  id: string;
@@ -233,10 +269,35 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
233
269
  }[];
234
270
  props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
235
271
  element: {
236
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
272
+ type: import("vue").PropType<Partial<{
273
+ [key: string]: any;
274
+ id: string;
275
+ name: string;
276
+ show: boolean;
277
+ sort: boolean;
278
+ sortDirection: "NONE" | "ASC" | "DESC";
279
+ title: string;
280
+ alias: string;
281
+ fixedShow: boolean;
282
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
283
+ columnWidth: number | null;
284
+ editable: boolean;
285
+ editableDisable: boolean;
286
+ required: boolean;
287
+ requiredDisable: boolean;
288
+ hide: boolean;
289
+ }>>;
237
290
  default: () => {};
238
291
  };
239
292
  columns: {
293
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
294
+ default: () => never[];
295
+ };
296
+ idx: {
297
+ type: NumberConstructor;
298
+ default: number;
299
+ };
300
+ fieldList: {
240
301
  type: import("vue").PropType<Partial<{
241
302
  [key: string]: any;
242
303
  id: string;
@@ -261,11 +322,20 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
261
322
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
262
323
  }>>;
263
324
  emit: (event: "updateChecked", ...args: any[]) => void;
264
- setOptions: (column: import("../../../es/shared/types").AnyObject) => {
325
+ getSortPriorityOptions: () => {
326
+ label: string;
327
+ value: number;
328
+ }[];
329
+ getOptions: (column: import("../../../es/shared/types").AnyObject) => {
265
330
  label: string;
266
331
  value: string;
332
+ }[] | {
333
+ label: string;
334
+ value: number;
267
335
  }[];
336
+ setDisabled: (column: import("../../../es/shared/types").AnyObject) => boolean;
268
337
  onUpdateChecked: (checked: boolean, column: import("../../../es/shared/types").AnyObject) => void;
338
+ handleUpdateSelect: (value: string, column: import("../../../es/shared/types").AnyObject) => void;
269
339
  NCheckbox: any;
270
340
  NSelect: any;
271
341
  NInput: any;
@@ -277,10 +347,35 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
277
347
  ReorderTwoOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
278
348
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "updateChecked"[], "updateChecked", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
279
349
  element: {
280
- type: import("vue").PropType<import("../../../es/shared/types").AnyObject>;
350
+ type: import("vue").PropType<Partial<{
351
+ [key: string]: any;
352
+ id: string;
353
+ name: string;
354
+ show: boolean;
355
+ sort: boolean;
356
+ sortDirection: "NONE" | "ASC" | "DESC";
357
+ title: string;
358
+ alias: string;
359
+ fixedShow: boolean;
360
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
361
+ columnWidth: number | null;
362
+ editable: boolean;
363
+ editableDisable: boolean;
364
+ required: boolean;
365
+ requiredDisable: boolean;
366
+ hide: boolean;
367
+ }>>;
281
368
  default: () => {};
282
369
  };
283
370
  columns: {
371
+ type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
372
+ default: () => never[];
373
+ };
374
+ idx: {
375
+ type: NumberConstructor;
376
+ default: number;
377
+ };
378
+ fieldList: {
284
379
  type: import("vue").PropType<Partial<{
285
380
  [key: string]: any;
286
381
  id: string;
@@ -304,7 +399,27 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
304
399
  }>> & {
305
400
  onUpdateChecked?: ((...args: any[]) => any) | undefined;
306
401
  }, {
307
- columns: Partial<{
402
+ columns: import("./src/types").FieldSetColumnItem[];
403
+ element: Partial<{
404
+ [key: string]: any;
405
+ id: string;
406
+ name: string;
407
+ show: boolean;
408
+ sort: boolean;
409
+ sortDirection: "NONE" | "ASC" | "DESC";
410
+ title: string;
411
+ alias: string;
412
+ fixedShow: boolean;
413
+ fixedWay: "NONE" | "LEFT" | "RIGHT";
414
+ columnWidth: number | null;
415
+ editable: boolean;
416
+ editableDisable: boolean;
417
+ required: boolean;
418
+ requiredDisable: boolean;
419
+ hide: boolean;
420
+ }>;
421
+ idx: number;
422
+ fieldList: Partial<{
308
423
  [key: string]: any;
309
424
  id: string;
310
425
  name: string;
@@ -322,13 +437,13 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
322
437
  requiredDisable: boolean;
323
438
  hide: boolean;
324
439
  }>[];
325
- element: import("../../../es/shared/types").AnyObject;
326
440
  }>;
327
441
  isArray: {
328
442
  (value?: any): value is any[];
329
443
  <T>(value?: any): value is any[];
330
444
  };
331
445
  setStyle: typeof import("./src/utils").setStyle;
446
+ HelpCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
332
447
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "save" | "reset")[], "close" | "save" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
333
448
  fields: {
334
449
  type: import("vue").PropType<Partial<{
@@ -373,12 +488,17 @@ declare const FieldSet: SFCWithInstall<import("vue").DefineComponent<{
373
488
  type: import("vue").PropType<import("./src/types").FieldSetColumnItem[]>;
374
489
  default: () => never[];
375
490
  };
491
+ showSeq: {
492
+ type: BooleanConstructor;
493
+ default: boolean;
494
+ };
376
495
  }>> & {
377
496
  onReset?: ((...args: any[]) => any) | undefined;
378
497
  onClose?: ((...args: any[]) => any) | undefined;
379
498
  onSave?: ((...args: any[]) => any) | undefined;
380
499
  }, {
381
500
  type: string;
501
+ showSeq: boolean;
382
502
  fields: Partial<{
383
503
  [key: string]: any;
384
504
  id: string;