cnhis-design-vue 3.1.44 → 3.1.45-3.1.45-release.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/es/components/button-print/src/ButtonPrint.vue2.js +1 -1
  2. package/es/components/fabric-chart/index.d.ts +5 -41
  3. package/es/components/fabric-chart/src/FabricChart.vue.d.ts +5 -41
  4. package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
  5. package/es/components/fabric-chart/src/hooks/{useBirthProcess.d.ts → birthProcess/useBirthProcess.d.ts} +2 -2
  6. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -0
  7. package/es/components/fabric-chart/src/hooks/{useBirthProcessChart.d.ts → birthProcess/useBirthProcessChart.d.ts} +3 -3
  8. package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -0
  9. package/es/components/fabric-chart/src/hooks/index.d.ts +5 -7
  10. package/es/components/fabric-chart/src/hooks/index.js +1 -1
  11. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +6 -0
  12. package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -0
  13. package/es/components/fabric-chart/src/hooks/temperature/index.d.ts +6 -0
  14. package/es/components/fabric-chart/src/hooks/temperature/index.js +1 -0
  15. package/es/components/fabric-chart/src/hooks/temperature/useBottom.d.ts +4 -0
  16. package/es/components/fabric-chart/src/hooks/temperature/useBottom.js +1 -0
  17. package/es/components/fabric-chart/src/hooks/{useCenter.d.ts → temperature/useCenter.d.ts} +3 -3
  18. package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -0
  19. package/es/components/fabric-chart/src/hooks/{useLeft.d.ts → temperature/useLeft.d.ts} +3 -3
  20. package/es/components/fabric-chart/src/hooks/temperature/useLeft.js +1 -0
  21. package/es/components/fabric-chart/src/hooks/temperature/useOther.d.ts +4 -0
  22. package/es/components/fabric-chart/src/hooks/temperature/useOther.js +1 -0
  23. package/es/components/fabric-chart/src/hooks/temperature/useRight.d.ts +4 -0
  24. package/es/components/fabric-chart/src/hooks/temperature/useRight.js +1 -0
  25. package/es/components/fabric-chart/src/hooks/{useShadow.d.ts → temperature/useShadow.d.ts} +1 -1
  26. package/es/components/fabric-chart/src/hooks/temperature/useShadow.js +1 -0
  27. package/es/components/fabric-chart/src/hooks/{useTemperatureChart.d.ts → temperature/useTemperatureChart.d.ts} +3 -3
  28. package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -0
  29. package/es/components/fabric-chart/src/hooks/temperature/useTop.d.ts +4 -0
  30. package/es/components/fabric-chart/src/hooks/temperature/useTop.js +1 -0
  31. package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -1
  32. package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
  33. package/es/components/fabric-chart/src/interface.d.ts +1 -1
  34. package/es/components/form-render/src/components/renderer/levelSearchCascader.js +1 -1
  35. package/es/components/index.css +1 -1
  36. package/es/components/steps-wheel/src/StepsWheel.vue2.js +1 -1
  37. package/es/components/steps-wheel/style/index.css +1 -1
  38. package/es/components/table-filter/src/components/render-widget/components/LabelInner.vue2.js +1 -1
  39. package/es/components/table-filter/src/components/render-widget/components/LabelOut.vue2.js +1 -1
  40. package/es/shared/assets/img/failure.png.js +1 -1
  41. package/es/shared/assets/img/no-permission.png.js +1 -1
  42. package/es/shared/assets/img/nodata.png.js +1 -1
  43. package/es/shared/assets/img/notfound.png.js +1 -1
  44. package/es/shared/assets/img/qr.png.js +1 -1
  45. package/es/shared/assets/img/success.png.js +1 -1
  46. package/es/shared/assets/img/video.png.js +1 -1
  47. package/es/shared/assets/img/video_default_cover.png.js +1 -1
  48. package/es/shared/assets/img/xb_big.png.js +1 -1
  49. package/es/shared/assets/img/xb_small.png.js +1 -1
  50. package/es/shared/package.json.js +1 -1
  51. package/package.json +2 -2
  52. package/es/components/fabric-chart/src/hooks/useBirthProcess.js +0 -1
  53. package/es/components/fabric-chart/src/hooks/useBirthProcessChart.js +0 -1
  54. package/es/components/fabric-chart/src/hooks/useBottom.d.ts +0 -4
  55. package/es/components/fabric-chart/src/hooks/useBottom.js +0 -1
  56. package/es/components/fabric-chart/src/hooks/useCenter.js +0 -1
  57. package/es/components/fabric-chart/src/hooks/useLeft.js +0 -1
  58. package/es/components/fabric-chart/src/hooks/useOther.d.ts +0 -4
  59. package/es/components/fabric-chart/src/hooks/useOther.js +0 -1
  60. package/es/components/fabric-chart/src/hooks/useRight.d.ts +0 -4
  61. package/es/components/fabric-chart/src/hooks/useRight.js +0 -1
  62. package/es/components/fabric-chart/src/hooks/useShadow.js +0 -1
  63. package/es/components/fabric-chart/src/hooks/useTemperatureChart.js +0 -1
  64. package/es/components/fabric-chart/src/hooks/useTop.d.ts +0 -4
  65. package/es/components/fabric-chart/src/hooks/useTop.js +0 -1
  66. package/es/shared/assets/img/failure.d.ts +0 -2
  67. package/es/shared/assets/img/failure.js +0 -1
  68. package/es/shared/assets/img/icon-asc.d.ts +0 -2
  69. package/es/shared/assets/img/icon-asc.js +0 -1
  70. package/es/shared/assets/img/icon-desc.d.ts +0 -2
  71. package/es/shared/assets/img/icon-desc.js +0 -1
  72. package/es/shared/assets/img/no-permission.d.ts +0 -2
  73. package/es/shared/assets/img/no-permission.js +0 -1
  74. package/es/shared/assets/img/nodata.d.ts +0 -2
  75. package/es/shared/assets/img/nodata.js +0 -1
  76. package/es/shared/assets/img/notfound.d.ts +0 -2
  77. package/es/shared/assets/img/notfound.js +0 -1
  78. package/es/shared/assets/img/qr.d.ts +0 -2
  79. package/es/shared/assets/img/qr.js +0 -1
  80. package/es/shared/assets/img/success.d.ts +0 -2
  81. package/es/shared/assets/img/success.js +0 -1
  82. package/es/shared/assets/img/video.d.ts +0 -2
  83. package/es/shared/assets/img/video.js +0 -1
  84. package/es/shared/assets/img/video_default_cover.d.ts +0 -2
  85. package/es/shared/assets/img/video_default_cover.js +0 -1
  86. package/es/shared/assets/img/video_hover.d.ts +0 -2
  87. package/es/shared/assets/img/video_hover.js +0 -1
  88. package/es/shared/assets/img/video_play_hover.d.ts +0 -2
  89. package/es/shared/assets/img/video_play_hover.js +0 -1
  90. package/es/shared/assets/img/xb_big.d.ts +0 -2
  91. package/es/shared/assets/img/xb_big.js +0 -1
  92. package/es/shared/assets/img/xb_small.d.ts +0 -2
  93. package/es/shared/assets/img/xb_small.js +0 -1
  94. /package/es/components/fabric-chart/src/{hooks/constant.d.ts → constants/index.d.ts} +0 -0
  95. /package/es/components/fabric-chart/src/{hooks/constant.js → constants/index.js} +0 -0
@@ -1 +1 @@
1
- import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as o,createElementBlock as s,Fragment as l,createVNode as m,unref as p,withCtx as d,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as P,NButton as I,NIcon as h}from"naive-ui";import{ChevronDown as F}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as j}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var E;const L=t,N=g();let M;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:L.printText,key:"printText"},{label:L.previewText,key:"previewText"},{label:L.pdfLoadText,key:"downloadPdf"},{label:L.formatEditText,key:"formatEditText"},...(null==(E=L.externalOptionConfig)?void 0:E.options)||[]]),U=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),B=r((()=>{var t;return(null==(t=U.value)?void 0:t.name)||"格式选择"})),J=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),A=async t=>{if(L.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},R=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),q=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:J.value};O("success",t,r)},_=t=>{O("error",t),b(t)&&"notInstalledApp"===t.type&&N.error(t.message)},z=()=>{O("error",{message:"前置条件执行错误"})},H=(t=0)=>{var e;const r=(null==(e=L.printParams)?void 0:e.length)?L.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...L.token?{token:L.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&q(e,"print")}catch(t){console.log("error",t)}};L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t={formatId:C.currentFormatId,templateId:J.value,printdlgshow:L.printdlgshow};if("MULTI"===L.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),M.printDirect({...t,params:H(r)},e,_);else M.printDirect({...t,params:$()},(t=>{q(t,"print")}),_)})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,params:t,btnprint:L.btnprint};M.preview(e,(t=>{q(t,"preview")}),_)})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{C.identityVerification.visible=!0})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{L.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===L.strategy?H():$(),e={formatId:C.currentFormatId,templateId:J.value,print:{print:"1",type:"1"},params:t};M.downloadPDF(e,(t=>q(t,"preview")),_)})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:L.token})}else null==(a=null==(r=L.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,O("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{let r=t.defaultValue||"",a=e;return"NUMBER"===t.type&&(a=Number(e)||0),"DATE"===t.type&&(a=e?x(e,"YYYY-MM-DD"):""),"DATETIME"===t.type&&(a=e?x(e,"YYYY-MM-DD HH:mm:ss"):""),r||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await j({templateId:t[0].templateId},{token:L.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return N.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:B.value,key:"format",children:t})})();let r=null==(e=await L.queryTemplateParams())?void 0:e.obj;if(!r||!J.value)return N.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,L.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(M)return!1;M=new w})();const t=await L.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await L.clickPrevFn())if(null==(e=L.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else N.warning(L.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,L.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return q(null,"edit");const e={formatId:C.currentFormatId,templateId:J.value,params:H(),token:t};M.editPrintFormat(e,(t=>{q(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==M||M.destroy()})),i((()=>L.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),D({directPrint:it}),(e,r)=>(o(),s(l,null,[m(p(P),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":R},{default:d((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(p(I),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>A("button")),["stop"]))},{default:d((()=>[f(v(t.btnText)+" ",1),m(p(h),{component:p(F),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>A("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:p(J),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};
1
+ import{defineComponent as t,reactive as e,computed as r,onMounted as a,onUnmounted as n,watch as i,openBlock as o,createElementBlock as s,Fragment as l,createVNode as m,unref as d,withCtx as p,renderSlot as u,withModifiers as c,createTextVNode as f,toDisplayString as v,mergeProps as y}from"vue";import{isObject as b}from"@vue/shared";import{useMessage as g,NDropdown as P,NButton as I,NIcon as h}from"naive-ui";import{ChevronDown as F}from"@vicons/ionicons5";import{Print as w}from"./utils/print.js";import{isIReport as k}from"./utils/browserPrint.js";import T from"./components/IdentityVerification.vue.js";import{format as x}from"date-fns";import{savePrivateFormatApi as S,getPrivateFormatApi as j}from"./api.js";var D=t({__name:"ButtonPrint",props:{printParams:{type:Array},params:{default:()=>[],type:Array},btnText:{default:"打印",type:String},printText:{default:"直接打印",type:String},previewText:{default:"打印预览",type:String},pdfLoadText:{default:"下载pdf",type:String},formatEditText:{default:"格式编辑",type:String},prevFn:{default:()=>Promise.resolve(),type:Function},queryPrintFormatByNumber:{default:()=>Promise.resolve({}),type:Function},queryTemplateParams:{default:()=>Promise.resolve({}),type:Function},strategy:{default:"MULTI",type:String},clickPrevFn:{default:()=>Promise.resolve(!0),type:Function},noDataMsg:{default:"请选中需要打印的数据",type:String},token:{type:String},printdlgshow:{default:"0",type:String},btnprint:{type:String,default:"1"},directPrint:{type:Boolean,default:!1},externalOptionConfig:{type:Object,default:()=>({})}},emits:["success","error","clickoutside"],setup(t,{expose:D,emit:O}){var L;const E=t,M=g();let N;const V={},C=e({spinning:!1,visible:!1,formatList:[],templateParams:{},printParams:[],currentFormatId:"",identityVerification:{visible:!1},isInited:!1,watchPrintParamsReformatFn:null,spinTimer:null}),Y=e([{label:E.printText,key:"printText"},{label:E.previewText,key:"previewText"},{label:E.pdfLoadText,key:"downloadPdf"},{label:E.formatEditText,key:"formatEditText"},...(null==(L=E.externalOptionConfig)?void 0:L.options)||[]]),J=r((()=>{if(!C.currentFormatId)return{};let t=C.currentFormatId;return C.formatList.find((e=>e.id===t))})),U=r((()=>{var t;return(null==(t=J.value)?void 0:t.name)||"格式选择"})),A=r((()=>{let t=C.formatList.find((t=>t.id===C.currentFormatId));return null==t?void 0:t.templateId})),B=async t=>{if(E.directPrint){if(C.spinning)return;return"button"===t?void await it():rt()}return rt()},q=t=>m("span",{class:{active:t.key===C.currentFormatId}},[t.label]),R=(t,e)=>{let r={type:e,formatId:C.currentFormatId,templateId:A.value};O("success",t,r)},_=t=>{O("error",t),b(t)&&"notInstalledApp"===t.type&&M.error(t.message)},z=()=>{O("error",{message:"前置条件执行错误"})},H=(t=0)=>{var e;const r=(null==(e=E.printParams)?void 0:e.length)?E.printParams[t]:C.printParams[t];return JSON.stringify({...r||{},...E.token?{token:E.token}:{}})},$=()=>{var t,e;let r={},a={};if(null==(t=C.templateParams.customizeDataset)?void 0:t.length){const t=(null==(e=Object.keys(C.printParams[0].datasetData||{}))?void 0:e[0])||"",r=JSON.stringify(C.printParams.map((e=>JSON.parse(e.datasetData[t]))));a={datasetData:{}},a.datasetData[t]=r}else Object.keys(C.printParams[0]).forEach((t=>{a[t]=[],C.printParams.forEach((e=>{a[t].push(e[t])})),a[t]=a[t].join(",")}));return r=Object.assign({},JSON.parse(H(0)),a),JSON.stringify(r)},G=()=>{let t=C.printParams.length;const e=async e=>{try{--t<=0&&R(e,"print")}catch(t){console.log("error",t)}};E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t={formatId:C.currentFormatId,templateId:A.value,printdlgshow:E.printdlgshow};if("MULTI"===E.strategy)for(let r=0;r<C.printParams.length;r++)r>0&&(t.printdlgshow="0"),N.printDirect({...t,params:H(r)},e,_);else N.printDirect({...t,params:$()},(t=>{R(t,"print")}),_)})).finally((()=>{C.visible=!1}))},K=async(t,e)=>{var r,a;switch(t){case"printText":G();break;case"previewText":(async()=>{E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===E.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,params:t,btnprint:E.btnprint};N.preview(e,(t=>{R(t,"preview")}),_)})).finally((()=>{C.visible=!1}))})();break;case"formatEditText":E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{C.identityVerification.visible=!0})).finally((()=>{C.visible=!1}));break;case"downloadPdf":(async()=>{E.prevFn().catch((()=>(z(),Promise.reject()))).then((()=>{const t="MULTI"===E.strategy?H():$(),e={formatId:C.currentFormatId,templateId:A.value,print:{print:"1",type:"1"},params:t};N.downloadPDF(e,(t=>R(t,"preview")),_)})).finally((()=>{C.visible=!1}))})();break;default:{C.visible=!1;const n=C.formatList.find((e=>e.id===t))||{};if(Object.keys(n).length>0){C.currentFormatId=t;const[e]=Y;e.label=(null==n?void 0:n.name)||e.label,await S({formatForms:[{...n}],name:V.name||n.templateName,number:V.number||n.number,templateId:V.templateId||n.templateId,...V.id?{id:V.id}:{}},{token:E.token})}else null==(a=null==(r=E.externalOptionConfig)?void 0:r.onSelect)||a.call(r,t,e);break}}},Q=()=>{C.visible=!1,O("clickoutside")},W=()=>(C.isInited=!1,C.spinning=!1,setTimeout((()=>{C.visible=!1}),0),!1),X=(t,e,r)=>{const a={};return e.forEach((e=>{let n=((t,e)=>{const r={DATE:"YYYY-MM-DD",DATETIME:"YYYY-MM-DD HH:mm:ss"};let a=e;return Object.keys(r).includes(t.type)&&e&&(a=x(e,r[t.type])),(null==t?void 0:t.defaultValue)||a})(e,t[e[r]]);t[e[r]]&&n&&(a[e[r]]=n)})),a},Z=({customizeDataset:t=[],param:e=[]},r=[])=>r.map((r=>{let a={};return t.forEach((t=>{const e=t.dataSetting[0].selectFieldList;a.datasetData={[t.name]:JSON.stringify(X(r,e,"fieldName"))}})),a=Object.assign({},a,X(r,e,"key")),a})),tt=async t=>{var e;if(C.formatList=t?(t=>{let e=[];return t&&t.forEach((t=>{if(!t.format)return!1;e.push(...t.format.map((e=>Object.assign({},e,{templateName:t.name}))))})),e})(t.obj):[],C.currentFormatId=await(async(t,e)=>{var r;if(!(null==t?void 0:t.length))return"";const{data:a}=await j({templateId:t[0].templateId},{token:E.token});if("SUCCESS"===a.result){const{formatForms:e=[]}=a.map||{};Object.assign(V,a.map||{});const n=null==(r=null==e?void 0:e[0])?void 0:r.id;if(n&&t.map((t=>t.id)).includes(n))return n}const n=t.find((t=>1==t[e]));return(null==n?void 0:n.id)||t[0].id})(C.formatList,"defaultFlag"),!C.currentFormatId)return M.error("获取打印格式失败,请联系管理员!"),W();(()=>{const t=C.formatList.map((t=>({label:t.name,key:t.id})));Y.unshift({label:U.value,key:"format",children:t})})();let r=null==(e=await E.queryTemplateParams())?void 0:e.obj;if(!r||!A.value)return M.error("获取打印模板失败,请联系管理员!"),W();C.templateParams=r,C.printParams=Z(C.templateParams,E.params)},et=async()=>{if(C.isInited)return!0;C.isInited=!0,C.spinning=!0,(()=>{if(N)return!1;N=new w})();const t=await E.queryPrintFormatByNumber();return await tt(t),C.spinning=!1,!0},rt=async(t=!0)=>{var e;if(await E.clickPrevFn())if(null==(e=E.params)?void 0:e.length){if(!C.visible){if(!await et())return!1}t&&(C.visible=!C.visible)}else M.warning(E.noDataMsg)},at=()=>{C.watchPrintParamsReformatFn&&C.watchPrintParamsReformatFn(),C.isInited?C.printParams=Z(C.templateParams,E.params):C.watchPrintParamsReformatFn=()=>i((()=>C.isInited),(t=>{if(!t)return!1;at()}))},nt=t=>{if(C.identityVerification.visible=!1,k(C.currentFormatId))return R(null,"edit");const e={formatId:C.currentFormatId,templateId:A.value,params:H(),token:t};N.editPrintFormat(e,(t=>{R(t,"edit")}),_)};async function it(){await rt(!1),G()}return a((()=>{C.isInited=!1})),n((()=>{null==N||N.destroy()})),i((()=>E.params),(t=>{if(!(null==t?void 0:t.length))return!1;at()}),{deep:!0}),D({directPrint:it}),(e,r)=>(o(),s(l,null,[m(d(P),{class:"c-dropdown",placement:"bottom-start",trigger:"click",show:C.visible,onClickoutside:Q,options:Y,onSelect:K,"render-label":q},{default:p((()=>[u(e.$slots,"button",{handleClickPrintBtn:rt,printSpinning:C.spinning,printbtnText:t.btnText,printVisible:C.visible},(()=>[m(d(I),{class:"dropdown-button",onClick:r[1]||(r[1]=c((()=>B("button")),["stop"]))},{default:p((()=>[f(v(t.btnText)+" ",1),m(d(h),{component:d(F),style:{"margin-left":"5px"},onClick:r[0]||(r[0]=c((()=>B("icon")),["stop"]))},null,8,["component"])])),_:1})]))])),_:3},8,["show","options"]),m(T,y(e.$attrs,{modelValue:C.identityVerification.visible,"onUpdate:modelValue":r[2]||(r[2]=t=>C.identityVerification.visible=t),formatId:C.currentFormatId,templateId:d(A),onSuccess:nt}),null,16,["modelValue","formatId","templateId"])],64))}});export{D as default};
@@ -32,52 +32,16 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
32
32
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
33
33
  }>>;
34
34
  emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
35
- isTemperature: import("vue").ComputedRef<boolean>;
36
35
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
37
36
  canvas: import("vue").Ref<any>;
38
37
  propItems: any;
39
- redrawPoints: import("vue").Ref<any>;
40
- select: import("vue").Ref<any>;
41
- pointTipProps: {
42
- show: boolean;
43
- point: {
44
- x: number;
45
- y: number;
46
- };
47
- list: string[];
48
- };
49
- pointMenuProps: {
50
- show: boolean;
51
- point: {
52
- x: number;
53
- y: number;
54
- };
55
- list: any[];
56
- target: any;
57
- };
58
- clickMenu: import("vue").Ref<any>;
38
+ redrawPoints: any;
39
+ select: any;
40
+ pointTipProps: any;
41
+ pointMenuProps: any;
42
+ clickMenu: any;
59
43
  init: () => {
60
44
  propItems: any;
61
- redrawPoints: import("vue").Ref<any>;
62
- select: import("vue").Ref<any>;
63
- pointTipProps: {
64
- show: boolean;
65
- point: {
66
- x: number;
67
- y: number;
68
- };
69
- list: string[];
70
- };
71
- pointMenuProps: {
72
- show: boolean;
73
- point: {
74
- x: number;
75
- y: number;
76
- };
77
- list: any[];
78
- target: any;
79
- };
80
- clickMenu: import("vue").Ref<any>;
81
45
  };
82
46
  PopupTip: import("vue").DefineComponent<{
83
47
  show: {
@@ -34,52 +34,16 @@ declare const _default: import("vue").DefineComponent<{
34
34
  "onAdd:prevent"?: ((...args: any[]) => any) | undefined;
35
35
  }>>;
36
36
  emits: (event: "select" | "add" | "change" | "remove" | "add:prevent", ...args: any[]) => void;
37
- isTemperature: import("vue").ComputedRef<boolean>;
38
37
  canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
39
38
  canvas: import("vue").Ref<any>;
40
39
  propItems: any;
41
- redrawPoints: import("vue").Ref<any>;
42
- select: import("vue").Ref<any>;
43
- pointTipProps: {
44
- show: boolean;
45
- point: {
46
- x: number;
47
- y: number;
48
- };
49
- list: string[];
50
- };
51
- pointMenuProps: {
52
- show: boolean;
53
- point: {
54
- x: number;
55
- y: number;
56
- };
57
- list: any[];
58
- target: any;
59
- };
60
- clickMenu: import("vue").Ref<any>;
40
+ redrawPoints: any;
41
+ select: any;
42
+ pointTipProps: any;
43
+ pointMenuProps: any;
44
+ clickMenu: any;
61
45
  init: () => {
62
46
  propItems: any;
63
- redrawPoints: import("vue").Ref<any>;
64
- select: import("vue").Ref<any>;
65
- pointTipProps: {
66
- show: boolean;
67
- point: {
68
- x: number;
69
- y: number;
70
- };
71
- list: string[];
72
- };
73
- pointMenuProps: {
74
- show: boolean;
75
- point: {
76
- x: number;
77
- y: number;
78
- };
79
- list: any[];
80
- target: any;
81
- };
82
- clickMenu: import("vue").Ref<any>;
83
47
  };
84
48
  PopupTip: import("vue").DefineComponent<{
85
49
  show: {
@@ -1 +1 @@
1
- import{defineComponent as e,computed as t,ref as r,onMounted as o,onBeforeUnmount as s,openBlock as a,createElementBlock as n,Fragment as p,createElementVNode as i,createBlock as u,mergeProps as c,unref as l,createCommentVNode as m}from"vue";import{fabric as f}from"../../../shared/utils/fabricjs/index.js";import h from"./components/PopupTip.vue.js";import v from"./components/PopupMenu.js";import d from"./hooks/useTemperatureChart.js";import k from"./hooks/useBirthProcessChart.js";var w=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:w,emit:C}){const y=e,j=t((()=>"temperature"===y.type)),P=r(null),g=r(),{propItems:I,redrawPoints:b,select:M,pointTipProps:x,pointMenuProps:R,clickMenu:T}=function(){const e=[g,y,C,P];return j.value?d(...e):k(...e)}();return o((()=>{g.value=new f.Canvas(P.value,{width:I.canvasWidth,height:I.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0})})),s((()=>{g.value.off(),g.value.clear()})),w({redrawPoints:b,select:M,canvas:g}),(e,t)=>(a(),n(p,null,[i("canvas",{ref_key:"canvasRef",ref:P},null,512),g.value?(a(),u(h,c({key:0,propItems:l(I)},l(x)),null,16,["propItems"])):m("v-if",!0),g.value?(a(),u(l(v),c({key:1,propItems:l(I)},l(R),{show:l(R).show,"onUpdate:show":t[0]||(t[0]=e=>l(R).show=e),onClickMenu:l(T)}),null,16,["propItems","show","onClickMenu"])):m("v-if",!0)],64))}});export{w as default};
1
+ import{defineComponent as e,ref as r,onMounted as t,onBeforeUnmount as s,openBlock as o,createElementBlock as a,Fragment as i,createElementVNode as n,createBlock as p,mergeProps as u,unref as c,createCommentVNode as l}from"vue";import{fabric as m}from"../../../shared/utils/fabricjs/index.js";import h from"./components/PopupTip.vue.js";import f from"./components/PopupMenu.js";import"./hooks/useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import{useBirthProcessChart as d}from"./hooks/birthProcess/useBirthProcessChart.js";import{useTemperatureChart as v}from"./hooks/temperature/useTemperatureChart.js";import{useSurgicalAnesthesiaChart as k}from"./hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js";var w=e({__name:"FabricChart",props:{type:{type:String,default:"temperature"},data:{type:Object,required:!0},addRenderItem:{type:Function}},emits:["change","add","remove","select","add:prevent"],setup(e,{expose:w,emit:C}){const g=e,j=r(null),P=r(),{propItems:y,redrawPoints:b,select:I,pointTipProps:M,pointMenuProps:x,clickMenu:A}=function(){const e=[P,g,C,j];switch(g.type){case"birthProcess":return d(...e);case"surgicalAnesthesia":return k(...e);default:return v(...e)}}();return t((()=>{P.value=new m.Canvas(j.value,{width:y.canvasWidth,height:y.canvasHeight,backgroundColor:"#fff",selection:!1,containerClass:"c-fabric-chart",fireRightClick:!0})})),s((()=>{P.value.off(),P.value.clear()})),w({redrawPoints:b,select:I,canvas:P}),(e,r)=>(o(),a(i,null,[n("canvas",{ref_key:"canvasRef",ref:j},null,512),P.value?(o(),p(h,u({key:0,propItems:c(y)},c(M)),null,16,["propItems"])):l("v-if",!0),P.value?(o(),p(c(f),u({key:1,propItems:c(y)},c(x),{show:c(x).show,"onUpdate:show":r[0]||(r[0]=e=>c(x).show=e),onClickMenu:c(A)}),null,16,["propItems","show","onClickMenu"])):l("v-if",!0)],64))}});export{w as default};
@@ -1,6 +1,6 @@
1
1
  import { type Ref } from 'vue';
2
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- import { AnyObject } from '../../../../../es/shared/types';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
4
  export declare function useBirthProcess(canvas: Ref<fabric.Canvas>, propItems: AnyObject, emits: Function, pointTipProps: AnyObject, pointMenuProps: AnyObject): {
5
5
  clickMenu: ({ item, target }: {
6
6
  item: any;
@@ -0,0 +1 @@
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as n,drawText as o,defaultTextStyle as i,drawPoint as r,defaultStyle as l,defaultRectStyle as s}from"../useDraw.js";import{useGrid as a}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"@vueuse/core";import{getScaleInfo as c,drawScaleNumber as f,drawScaleLine as d}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as h,isEffectiveNode as g}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as m}from"lodash-es";import{format as v}from"date-fns";function y(y,k,w,x,b){const{cumputedX:T,cumputedY:j,getXValue:S,getYValue:C}=u(k),{getEqualXTypes:M,handleAddPrevent:P}=p(y,w),{xAxis:E,grid:G,originX:L,originY:Y,xCellWidth:X,endY:A,startTime:H,leftAddAreaWidth:I,leftScales:D,rightScales:O,yCellHeight:W,endX:V,scaleValues:N,canvasWidth:R,borderStyle:$,rightAddAreaWidth:B,event:F,originYCervix:q,other:z,canvasHeight:J}=k,K=m(N),Q=new Set;function U(){K.filter((e=>e.show)).forEach(((e,l)=>{var s;const a=[],u=[],c=[];null==(s=e.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:m={},title:v="",key:b,type:T="circle",childbirthStyle:j={}}=e,M=e.data[d+1],P=ne(M,e);if(s&&P&&!f.breakpoint)h=t([...s,...P],{...m});else if(s&&!P&&!f.breakpoint){const n=ne(M,e);h=n?t([...s,...n],{...m}):null}let E,G;if(f.childbirth){const e=s[1]+W;E=n([s[0],s[1],e],j),c.push(E),G=o([s[0]+X/2,e-W/2],{value:String(f.childbirth),...i,originX:"left",originY:"center",...j}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:v,key:b||"",dataIndex:l,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...k.event.hovered?k.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:k.event};L?p=r(T,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=r(T,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(e){F.hovered&&(e.on("mouseover",(()=>{te(e,"hover")})),e.on("mouseout",(()=>{x.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ee(e),function(e){var t,n,o,i;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}),null==(o=e.arrowGroup)||o.setCoords().set({left:e.left,top:e.top}),null==(i=e.arrowGroupText)||i.setCoords().set({left:e.left+X/2,top:e.top+W/2})}(e),F.hovered&&te(e)})),e.on("mouseup",(t=>{if(x.show=!1,1===t.button){const{key:t}=e.origin,n={...e.origin,data:{...e.origin.data,time:S(e.left),value:C(t,e.top)}};y.value.discardActiveObject(),w("change",n),Z(n,"change")}}))}(p),a.push(p),Q.add(p))}(ne(s,e),s,f)})),Promise.all(a).then((e=>{const t=u.filter((e=>e));let n=null;e=e.filter((e=>(e&&n&&(n.nextPoint=e,e.prevPoint=n),n=e||n,e))),Promise.all(c).then((n=>{y.value.add(...t,...e,...n),e.forEach((e=>{null==e||e.bringToFront()}))}))}))}))}function Z(e,t="add"){const{dataIndex:n,data:o,index:i,key:r}=e,l=K.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const e=h(o.time,l.data);l.data.splice(e,0,o);break}}_()}function _(){var e;Q.size&&(null==(e=y.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),(null==e?void 0:e.arrowGroup)&&t.push(null==e?void 0:e.arrowGroup),(null==e?void 0:e.arrowGroupText)&&t.push(null==e?void 0:e.arrowGroupText)})),t}([...Q]))),Q.clear(),U()}function ee(e){const t=e.prevPoint?e.prevPoint.left:L,n=e.nextPoint?e.nextPoint.left:V;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<q&&e.set("top",q),e.top<Y&&e.set("top",Y),e.top>A&&e.set("top",A),e.left<t&&e.set("left",t),e.left>n&&e.set("left",n)}function te(e,t="moving"){const{title:n,key:o,data:i}=e.origin;x.point={x:e.left,y:e.top},x.list=[`${n} ${"hover"===t?i.value:C(o,e.top)}`,`时间 ${S(e.left).slice(-5)}`],x.show=!0}function ne(e,t){if(g(e)&&function(e){const t=H+864e5,n=new Date(e).getTime();return n>=H&&n<=t}(e.time)){const n=T(e.time),o=j(t.key,t.range,e.value);return[n,o<Y?Y:o>A?A:o]}}function oe(e,t){return e+1>t[1]?t[0]:e+1}return a(y,k,!0),function(){const t=new e.Rect({...$,width:R-I-B-1,height:A-1,left:I,top:0,fill:"transparent"});y.value.add(t)}(),function(){function t(t,n="left"){let r="left"===n?I:V;t.forEach(((t,n)=>{const{range:a,spaceValue:u,width:p,title:h,titleStyle:g,key:m,position:v="center",spaceGridNumber:k=1,showNumber:w,showMaxMinNumber:x}=t,b=[],T=[],j=r+p/2,S=function(e,t){const n=[],[o,i]=e;for(let e=o;t>0?e<=i:e>=i;e+=t)n.push(e);return n}(a,u),C=S.length;S.forEach(((e,n)=>{const{lineXMain:o,lineXSub:i,textLeft:l}=c(v,r,p),s=A-n*W*k,a=0===n?A-8:n!==S.length-1||Y||q&&"FHR"!==m?s:Y+8;!w||(0===n||n===C-1)&&!x||b.push(f(String(e),t,l,a)),T.push(...d(t,n,o,i,s,W,Y,C))}));const M=new e.Rect({...s,strokeWidth:.5,width:p,height:A,left:j,top:A/2}),P=o([j,Y>0?Y-W/2:W/2],{value:String(h),...i,...g}),E=new e.Group([...T,...b,M,...P?[P]:[]],{objectCaching:!1,...l});y.value.add(E),E.sendToBack(),r+=p}))}t(D),t(O,"right")}(),function(){const{show:t,startTime:n,range:r=[0,23],position:s="top",style:a}=E.time,{show:u,range:c=[0,23],position:f,style:d}=E.processTime;if(t||u){const p=[],h=[],g=[],m=[],v=L+X/2,k=W/2;for(let e=0;e<G.mainXCell;e++){if(t){const t=0===e?+n.slice(11,13):oe(p.at(-1),r);p.push(t);const l="top"===s?Y-k:A+k;g.push(o([v+e*X,l],{value:String(t),...i,...a||{}}))}if(u){const t=0===e?c[0]:h.at(-1)+1;h.push(t);const n="top"===f?k:J-k;m.push(o([v+e*X,n],{value:String(t),...i,...d||{}}))}}const w=new e.Group([...g,...m],{objectCaching:!1,...l});y.value.add(w),y.value.sendToBack(w)}}(),function(){var e;const n=Object.values(z),o=[],i={},r=K.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:n,range:o}=r||{},i=j(n,o,10),l=[0,t],s=[-t/e,0],a=[(A-i-t)/e,A-i],u=[V-L,e*(V-L)+t];let c=[],f=[];function d([n,o]){return Math.abs(o-e*n-t)<=1}function p([e,t]){const[n,o]=[...h([e,t])];return n>=L&&n<=V&&o>=i&&o<=A}function h([e,t]){return[L+e,A-t]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}n.forEach((e=>{if(!e.show)return;const{key:n}=e;switch(n){case"fetalPresentation":{const{range:i,show:r}=K.find((e=>e.key===n));if(r){const r=j(n,i,0);o.push(t([L,r,V,r],{...e}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:v(new Date(new Date(l.time).getTime()+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[T(l.time)-L,A-j(n,a,l.value)],[p,h]=[T(c.time)-L,A-j(n,a,c.value)],g=(h-d)/(p-f),m=d-f*g,y=s(g,m);y.length>0&&(o.push(t(y,{...e})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(T(v(new Date(new Date(l.time).getTime()+a),"yyyy-MM-dd HH:mm"))-T(l.time))*n);u.length>0&&o.push(t(u,{...e}))}}})),y.value.add(...o)}(),U(),function(){function e(e,t){const n=K.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:n,key:e.key},pointer:t}}k.event.evented&&y.value.on("mouse:up",(t=>{if(3===t.button){const{x:n=0,y:o=0}=t.pointer||{};n>=L&&n<=V&&o>=Y&&o<=A&&(b.point={x:n,y:o},b.show=!0,t.target?(b.target=t.target,b.list=["删除节点"],y.value.forEachObject((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&b.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(b.target=null,b.list=["新增节点"],K.filter((e=>e.show)).forEach((i=>{if(!M(n,"key",X).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<q)return;b.list.push(e(i,t.pointer))}})),1===b.list.length&&(b.show=!1,P("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const t=R-B/2;function n(t,n){if(!t.length)return;let l=Y;const s=[];t.forEach((t=>{const o=t.title.split("").join("\n"),a=N.findIndex((e=>e.key===t.key)),u=new e.Text(String(o),{...i,...t.titleStyle||{},originY:"top",left:n,top:l,lineHeight:1}),c=r(t.type,{left:n,top:l+u.height+3,...t.pointAttr,originY:"top",origin:{title:t.title,unit:t.unit,type:t.type,dataIndex:a,key:t.key,isMenu:!0},originLeft:n,originTop:l+u.height+3,...k.event});l+=u.height+c.height+15,function(e){function t(e){const{left:t,top:n}=e;return t>=L&&t<=V&&n>=Y&&n<=A}e.on("moving",(()=>{e.set("originY","center"),t(e)?(ee(e),te(e)):x.show=!1})),e.on("mouseup:before",(n=>{if(x.show=!1,0===n.e.button&&t(e))if(M(e.left,"key",X).includes(e.origin.key))P("repeat");else{const t={data:{time:S(e.left),value:C(e.origin.key,e.top)},...e.origin};w("add",t),Z(t)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(e)}))}(c),s.push(u,c)})),o(s),y.value.add(...s)}function o(e){const t=e.at(-1),n=(A-Y)/2,o=(t.height+t.top-Y)/2;e.forEach((e=>{const t=e.top+n-o;e.set({top:t,originTop:t})}))}n(D,I/2),n(O,t)}(),{clickMenu:function({item:e,target:t}){const n={...e.origin};"remove"===e.mode?(w("remove",n),Z(n,"remove")):(Object.assign(n,{data:{time:S(e.pointer.x),value:C(e.origin.key,e.pointer.y)}}),w("add",n),Z(n))},redrawPoints:_}}export{y as useBirthProcess};
@@ -1,7 +1,7 @@
1
1
  import { Ref } from 'vue';
2
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- import { AnyObject } from '../../../../../es/shared/types';
4
- export default function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
+ export declare function useBirthProcessChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
5
5
  propItems: any;
6
6
  redrawPoints: Ref<any>;
7
7
  select: Ref<any>;
@@ -0,0 +1 @@
1
+ import{ref as e,reactive as a,computed as t,onMounted as l,nextTick as r}from"vue";import{defaultBorderStyle as u}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import{useEvent as i,useCanvasEvent as s}from"../useEvent.js";import"../temperature/useShadow.js";import{useBirthProcess as n}from"./useBirthProcess.js";function o(o,d,v,c){const h=e(),p=e(),m=e(),g=a({show:!1,point:{x:0,y:0},list:[]}),f=a({show:!1,point:{x:0,y:0},list:[],target:null}),x=t((()=>d.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),w=t((()=>d.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),y=t((()=>{var e;return(null==(e=w.value)?void 0:e.length)?30:0})),V=t((()=>{var e;return 30+(null==(e=x.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),b=t((()=>{var e;const{width:a}=d.data,t=null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-y.value-t})),A=t((()=>d.data.grid.mainXCell)),j=t((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),C=t((()=>(b.value-V.value)/A.value)),k=t((()=>{const{xAxis:e,height:a}=d.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(j.value+t)})),Y=t((()=>{const{xAxis:e}=d.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return k.value*a})),P=t((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!Y.value)return Y.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return S.value-l*r*k.value})),S=t((()=>{const{xAxis:e,height:a}=d.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-k.value*t})),H=t((()=>new Date(d.data.xAxis.time.startTime).getTime())),X=t((()=>36e5/C.value)),F=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/k.value})),R=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/k.value})),T=t((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/k.value})),W=t((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),M=a({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...u,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:V.value,endX:b.value,originY:Y.value,endY:S.value,xCellWidth:C.value,yCellHeight:k.value,gridXNumber:A.value,gridYNumber:j.value,xAxis:d.data.xAxis,leftScales:x.value,rightScales:w.value,leftAddAreaWidth:30,rightAddAreaWidth:y.value,startTime:H.value,timeXCell:X.value,cervixYCell:F.value,FHRYCell:R.value,fetalPresentationYCell:T.value,scaleValues:d.data.scaleValues,event:W.value,originYCervix:P.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=n(o,M,v,g,f);p.value=a,m.value=e,i(c.value);const{select:t}=s(o,M,v);h.value=t}))})),{propItems:M,redrawPoints:p,select:h,pointTipProps:g,pointMenuProps:f,clickMenu:m}}export{o as useBirthProcessChart};
@@ -1,11 +1,9 @@
1
1
  export * from './useDraw';
2
+ export * from './useGrid';
2
3
  export * from './useCumputedPoint';
3
- export * from './useTop';
4
- export * from './useLeft';
5
- export * from './useRight';
6
- export * from './useCenter';
7
- export * from './useBottom';
8
- export * from './useOther';
9
4
  export * from './useEvent';
10
- export * from './useBirthProcess';
5
+ export * from './useScaleColumn';
11
6
  export * from './useCommon';
7
+ export * from './birthProcess/useBirthProcessChart';
8
+ export * from './temperature/useTemperatureChart';
9
+ export * from './surgicalAnesthesia/useSurgicalAnesthesiaChart';
@@ -1 +1 @@
1
- export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextGroup}from"./useDraw.js";export{useBirthProcessCumputedPoint,useCumputedPoint}from"./useCumputedPoint.js";export{useTop}from"./useTop.js";export{useLeft}from"./useLeft.js";export{useRight}from"./useRight.js";export{useCenter}from"./useCenter.js";export{useBottom}from"./useBottom.js";export{useOther}from"./useOther.js";export{useCanvasEvent,useEvent}from"./useEvent.js";export{useBirthProcess}from"./useBirthProcess.js";export{useCommon}from"./useCommon.js";
1
+ export{defaultBorderStyle,defaultLineStyle,defaultRectStyle,defaultStyle,defaultTextStyle,drawArrow,drawLine,drawPoint,drawText,drawTextGroup}from"./useDraw.js";export{useGrid}from"./useGrid.js";export{useBirthProcessCumputedPoint,useCumputedPoint}from"./useCumputedPoint.js";export{useCanvasEvent,useEvent}from"./useEvent.js";export{drawScaleLine,drawScaleNumber,getScaleInfo}from"./useScaleColumn.js";export{useCommon}from"./useCommon.js";export{useBirthProcessChart}from"./birthProcess/useBirthProcessChart.js";export{useTemperatureChart}from"./temperature/useTemperatureChart.js";export{useSurgicalAnesthesiaChart}from"./surgicalAnesthesia/useSurgicalAnesthesiaChart.js";
@@ -0,0 +1,6 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
+ export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
5
+ propItems: any;
6
+ };
@@ -0,0 +1 @@
1
+ import{ref as t,reactive as r}from"vue";import{defaultBorderStyle as e}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"../temperature/useShadow.js";function o(o,a,i,s){t(),t(),t(),r({show:!1,point:{x:0,y:0},list:[]}),r({show:!1,point:{x:0,y:0},list:[],target:null});return{propItems:r({canvasWidth:a.data.width,canvasHeight:a.data.height,borderStyle:{...e,...a.data.borderStyle||{}},grid:a.data.grid,other:a.data.other})}}export{o as useSurgicalAnesthesiaChart};
@@ -0,0 +1,6 @@
1
+ export * from './useTop';
2
+ export * from './useLeft';
3
+ export * from './useRight';
4
+ export * from './useCenter';
5
+ export * from './useBottom';
6
+ export * from './useOther';
@@ -0,0 +1 @@
1
+ export{useTop}from"./useTop.js";export{useLeft}from"./useLeft.js";export{useRight}from"./useRight.js";export{useCenter}from"./useCenter.js";export{useBottom}from"./useBottom.js";export{useOther}from"./useOther.js";
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ export declare function useBottom(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawTextGroup as e,defaultTextStyle as i,defaultStyle as n}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,s){const{xScaleList:r,originX:a,endX:l,endY:c,xCellWidth:h,canvasWidth:d,canvasHeight:u,bottom:p,breathingHeight:g,iconsWidth:f,borderStyle:m}=s;!function(){var s,d,u;if(!g||!p){const e=new t.Line([f,c-1,l,c-1],m);return o.value.add(e),e.sendToBack(),!1}const v=g,b=(null==(s=p.breathing)?void 0:s.list)||[],w=[];let x=!0;r.forEach(((t,n)=>{const o=a+n*h;let s="";b.forEach(((e,i)=>{const n=new Date(e.time).getTime();n>=t&&n<+t+t.scaleCell&&(s=e.value)}));const r=x?{top:-(v/2-10)}:{top:v/2-10};s&&(x=!x);const l=e({width:h,height:v,...m},Object.assign({},{text:String(s),...i},s?r:{}),{left:o,top:c});w.push(l)}));const j=e({width:l,height:v,...m},{text:String((null==(d=p.breathing)?void 0:d.title)+(null==(u=p.breathing)?void 0:u.unit)),...i,left:-(l-a)/2},{left:0,top:c});w.push(j);const S=w.length>0?new t.Group([...w],{...n}):null;S&&S.sendToBack(),S&&o.value.add(S)}()}export{o as useBottom};
@@ -1,7 +1,7 @@
1
1
  import { type Ref } from 'vue';
2
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- import { IPropItems } from '../interface';
4
- import { AnyObject } from '../../../../../es/shared/types';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ import { AnyObject } from '../../../../../../es/shared/types';
5
5
  export declare function useCenter(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, addRenderItem: Function | undefined, pointTipProps: AnyObject, pointMenuProps: AnyObject): {
6
6
  pointTipProps: AnyObject;
7
7
  pointMenuProps: AnyObject;
@@ -0,0 +1 @@
1
+ import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as p,setOtherType as d,isEffectiveNode as f,getIndex as h,deleteProperty as v}from"../../utils/index.js";import"@vueuse/core";import{useCommon as g}from"../useCommon.js";import"vue";import{cloneDeep as y}from"lodash-es";import{TEMPERATURE_MENU as m,PAIN_MENU as x,OVERLAP as b}from"../../constants/index.js";function w(w,j,L,k,Y,S,E,$,M,T){r(w,j);const{getEqualXTypes:P,handleAddPrevent:O}=g(w,L),{createShadowLines:A}=t(),{left:I,xScaleList:C,xCellWidth:D,yCellHeight:R,originX:X,endX:z,originY:V,endY:F,itemList:_,event:G,vitalSignsOriginY:H,painOriginY:q,hospitalizationDate:W,config:B,canvasHeight:J}=j,K=new Set,N=["xinmai","mai"],Q=new Map,U=new Set,Z=new Set,ee=new Set,te=y(I.yScaleValue);function ie(t){var i;const o=te.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(K.size&&w.value.remove(...K),K.clear(),Q.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=Q.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of Q)t.push(e[1]),e[0]===N[0]&&e[1].forEach((e=>{(Q.get(N[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],c=n[i-1],p=n[i+1],d=o[r-1],f=o[r+1];if(c&&d){if(c[0]!==d[0]){const e=Math.max(c[0],d[0]);l.push([c,d].find((t=>t[0]===e)))}}else c?l.push(c):d&&s.push(d);const h=Math.min(a[1],u[1]);l.push([a,u].find((e=>e[1]===h)));const v=Math.max(a[1],u[1]);s.push([a,u].find((e=>e[1]===v)));const g=()=>{const t=[...l,...s.reverse()],[i]=t,n=t.at(-1);i[0]===n[0]&&i[1]===n[1]&&t.splice(-1,1),e.push(t),l=[],s=[]};if(p&&f){if(p[0]!==f[0]){const e=Math.min(p[0],f[0]);l.push([p,f].find((t=>t[0]===e))),g()}}else p?(l.push(p),g()):f?(s.push(f),g()):g()})),e})().forEach((t=>{var i,l,s,r,a,u;const c=t.map((e=>({x:e[0],y:e[1]}))),p=new e.Polygon(c,{...n,...(null==(i=o.shadow)?void 0:i.style)||{}});if("slash"==(null==(l=o.shadow)?void 0:l.mode)){p.set({fill:"transparent",stroke:(null==(r=null==(s=o.shadow)?void 0:s.style)?void 0:r.stroke)||"#f00"});const e=A(t,null==(a=o.shadow)?void 0:a.style._angle,null==(u=o.shadow)?void 0:u.style.space);e.forEach((e=>{var t;Object.assign(e,{...n,...(null==(t=o.shadow)?void 0:t.style)||{}}),K.add(e)})),w.value.add(...e)}K.add(p),w.value.add(p)}))}}function ne(){var e;const t=te.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},b,I.overlap||{}),l=[];U.size&&[...U].forEach((e=>{[...Z].forEach((t=>{if(t.origin&&c(e,t)){const e=t.origin.key;if(e){const s={left:t.left,top:t.top,...n,hoverCursor:"default"};let r="koumai";"yemai"===e&&(r=e),"humai"===e&&(r="circle"),l.push(o(r,{...i[e]||{},...s}))}}}))})),setTimeout((()=>{w.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),ee.add(e)}))}))}function oe(e,t,r){var u;const{type:c,riseStyle:f={},noRiseStyle:h={},verifiedStyle:v={},reduceStyle:g={},pacemaker:y={},upArrowStyle:m={},limitValueStyle:x={},nonePainPointStyle:b={},dataList:k=[]}=r,S=[],$=[],T=[];null==(u=e.list)||u.forEach(((u,P)=>{const O=a(c)?k.find((e=>e.key===u.key)):e,A=re(u,r),I={};I.value=function(e,t,i){if(!(null==e?void 0:e.length)||!B.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=H.originY+R?e[1]+R:e[1]-R,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return T.push(s),{obj:s,top:-R}}(A,u,O),function(e,t,a,u){var d,y;if(!(null==e?void 0:e.length)||!["temperature","pain"].includes(c))return;const{lineAttr:m={}}=a,{value:x}=u;let b,w,j,L,k,S;if(t.noRise&&h.show)if(h.text)j=l([e[0],e[1]+5],{value:h.text.split("").join("\n"),originY:"top",...h.style||{}}),T.push(j);else{const t=e[1]+2*R;L=s([e[0],e[1],t],h.style||{}),T.push(L)}t.rise&&f.show&&f.text&&(k=l([e[0],e[1]-(x?R:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),T.push(k));t.verified&&(S=l([e[0],e[1]-(x?R:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),T.push(S));if(p(t.physicsReduce)||p(t.drugReduce)){const l=Y(c,r.list,null!=(d=t.physicsReduce)?d:t.drugReduce);b=i([...e,e[0],l],{...m,...g.line,...n}),w=o((null==(y=null==g?void 0:g.point)?void 0:y.type)||"circle",{left:e[0],top:l,...g.point,...n,originY:l===J?"bottom":"center"}),b&&T.push(b),w&&T.push(w)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5},arrowGroup:{obj:L,top:2*R},riseText:{obj:k,top:(x?-R:0)-5},verifiedText:{obj:S,top:(x?-R:0)-5},reducePoint:{obj:w,type:"reduce"}})}(A,u,O,I),function(e,t,i,n){if(!(null==e?void 0:e.length)||!["pulse"].includes(c))return;let o,a;const{upArrowShow:u=!1,limitValueShow:p=!1}=i;if(u&&+t.value>180){let t=e[1]-2.5*R,i=[e[1]-R/2,t];t<H.originY&&(t=e[1]+2.5*R,i=[t,e[1]+R/2]),o=s([e[0],i[0],i[1]],m,"up"),T.push(o)}if(p){const i={value:t.value,originX:"center",originY:"center",...x};if(+t.value>Math.max(...r.list)){const t=o?e[1]+R/2+o.height:e[1]+R;a=l([e[0],t],i),T.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-R],i),T.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-R}})}(A,u,O,I),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,k=e.list[s+1],Y=re(k,r),T=le(c,e.list[s].value),P=Y&&le(c,k.value);!n||!Y||l.breakpoint||T||P||n[0]===Y[0]||(f=i([...n,...Y],{...v}));const O=l.pacemakerShow&&"pulse"==c?y.value:T?0:x,A=$[s-1],I={origin:{data:l,title:g,key:m||"",unit:r.unit,type:c,_type:d(g,c),dataIndex:t,index:s},leftLine:A,rightLine:f,otherObj:u,lockMovementX:!0,...l.pacemakerShow&&"pulse"==c?y.style:h,...j.event.hovered?j.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:j.event,...T?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");p=o(O,{left:A.get("x2"),top:T?e-5:e,...I})}else n&&(I.leftLine=null,p=o(O,{left:n[0],top:T?n[1]-5:n[1],...I}));$.push(f),p&&(g.includes("脉搏")?U.add(p):Z.add(p),function(e){G.hovered&&(e.on("mouseover",(()=>{se(e,"hover")})),e.on("mouseout",(()=>{M.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{!function(e){e.setCoords();const t="pain"===e.origin.type?q:H;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):null==i||i.setCoords().set({left:e.left,top:e.top+o}))})),ie(e)}(e),G.hovered&&se(e)})),e.on("mouseup",(t=>{if(M.show=!1,1===t.button){const{type:t}=e.origin,i=E(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};w.value.discardActiveObject(),L("change",n),ue(n,"change")}}))}(p),S.push(p),ee.add(p))}(A,u,P,O,I)})),"pulse"===c&&N.forEach((e=>{Q.set(e,S.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(S).then((e=>{const t=$.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(T).then((i=>{w.value.add(...t,...e,...i),e.forEach((t=>{null==t||t.bringToFront(),function(e,t){if("pulse"===e.origin.type){t.filter((t=>t.left===e.left&&"pulse"===t.origin.type)).length>1&&(e.leftLine&&w.value.remove(e.leftLine),e.rightLine&&w.value.remove(e.rightLine))}}(t,e)}))}))}))}function le(e,t){return"pain"===e&&0==t}function se(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;M.point={x:e.left,y:e.top},M.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:E(o,e.top);if(p(s))return`药物降${"pain"==o?"痛":"温"} ${a}—>${s}${n||""}`;if(p(r))return`物理降${"pain"==o?"痛":"温"} ${a}—>${r}${n||""}`;return`${i} ${a}${n||""}`}(),`时间 ${((null==l?void 0:l.time)||S(e.left)).slice(-5)}`],M.show=!0}function re(e,t){const i="pain"===t.type?q:H;if(f(e)&&function(e){const[t]=C,i=C.at(-1),n=t.start,o=i.end,l=new Date(e).getTime();return l>=n&&l<=o}(e.time)){const n=k(e.time),o=Y(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ae(e){const t=new Date,i=`00${t.getMonth()+1}`.slice(-2),n=`00${t.getDate()}`.slice(-2),o=new Date(`${t.getFullYear()}-${i}-${n} 23:59:59`).getTime(),l=new Date(`${S(e)}:00`).getTime();return W&&l<new Date(W).getTime()?(O("exceedMin"),!1):!(l>o)||(O("exceedMax"),!1)}function ue(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=te.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=h(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;ce()}function ce(){var e;ee.size&&(null==(e=w.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...ee]))),Q.clear(),ee.clear(),U.clear(),Z.clear(),te.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||oe(t,i,e)}))})),ie(),ne()}return Q.clear(),U.clear(),Z.clear(),te.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=Y(e.type,e.list,e.positionLine.value),n=i([X,t,z,t],e.positionLine);w.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||oe(t,i,e)}))})),ie(),ne(),j.event.evented&&w.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=X&&i<=z&&n>=V&&n<=F){T.point={x:i,y:n},T.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(T.list=[...m]),"pain"===o&&(T.list=[...x]),T.target=e.target;else{T.target=null,T.list=["新增节点"],_.forEach((t=>{if(!P(i,"_type",D).includes(t.bigType)){const i=["pain"].includes(t.bigType)?q:H;n>=i.originY&&n<=i.endY&&T.list.push({renderItem:$?$(t):()=>t.title,origin:{title:t.title,unit:t.unit,type:u(t.bigType),dataIndex:t.dataIndex,key:t.key},pointer:e.pointer})}}));const t=ae(i);t&&1!==T.list.length||(T.show=!1,1===T.list.length&&t&&O("repeat"))}}}})),{pointTipProps:M,pointMenuProps:T,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=v(i,[...m,...x]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};L("change",r),ue(r,"change")}else{const t={data:{time:S(e.pointer.x),value:E(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};L("add",t),ue(t)}},setPopup:se,isAddPoint:ae,updateData:ue,redrawPoints:ce}}export{w as useCenter};
@@ -1,7 +1,7 @@
1
1
  import { Ref } from 'vue';
2
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- import { IPropItems } from '../interface';
4
- import { AnyObject } from '../../../../../es/shared/types';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ import { AnyObject } from '../../../../../../es/shared/types';
5
5
  export declare function useLeft(canvas: Ref<fabric.Canvas>, propItems: IPropItems, emits: Function, setPopup: Function, pointTipProps: AnyObject, cumputedX: Function, cumputedY: Function, getXValue: Function, getYValue: Function, isAddPoint: Function, updateData: Function): {
6
6
  drawScaleValue: (yScaleValueList: any[]) => void;
7
7
  };
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultTextStyle as e,defaultStyle as i,drawPoint as n,drawTextGroup as o}from"../useDraw.js";import"date-fns";import{getType as l,isOneLine as r}from"../../utils/index.js";import"@vueuse/core";import{getScaleInfo as s,drawScaleNumber as a,drawScaleLine as u}from"../useScaleColumn.js";import{useCommon as h}from"../useCommon.js";import"vue";import"lodash-es";import"./useShadow.js";function g(g,p,c,d,f,y,m,v,w,S,b){var Y,x;const{getEqualXTypes:j,handleAddPrevent:T}=h(g,c),{originY:X,endY:C,originX:N,endX:V,xCellWidth:L,yCellHeight:M,left:k,vitalSignsOriginY:E,painOriginY:I,painHeight:A,iconsWidth:G,itemList:H,painIndex:O,right:W,canvasWidth:R,canvasHeight:_,getRightInfo:B,borderStyle:J}=p;function $(n){var l;if(!(null==n?void 0:n.length))return;const{layout:r}=n[0];let h=G,p=N;"right"===r&&(h=V,p=V+(null!=(l=null==W?void 0:W.width)?l:0));const c=[],d=A&&"right"!==r?n.length-1:n.length,f=(p-h)/d,y=f+(p-h)%d;n.forEach(((n,l)=>{if("pain"===n.type)return void function(i){const{list:n=[],spaceGridNumber:l=5,showScale:r,showNumber:u,position:h,showMaxMinNumber:p,style:c,title:d}=i,f=o({width:N-G,height:A,...J},{value:`${d}`,...e,...c||{}},{left:G,top:I.originY}),y=[];if(r||u){const{lineXMain:e,textLeft:o}=s(h,G,N-G),g=n.length;n.forEach(((n,s)=>{let h=I.endY-s*M*l;if(0===s&&(h=C-5),!u||(0===s||s===g-1)&&!p||y.push(a(n,i,o,h)),r&&0!==s){const[i,n]=e,o=new t.Line([i,h,n,h],{...J,...c});y.push(o)}}))}g.value.add(f,...y),f.sendToBack()}(n);const p=[],d=0===l?y:f,m=0===l?h:y+h+(l-1)*f,v="right"===r?0:E.originY,w="right"===r?_:E.endY,S=l>0?new t.Line([m,v,m,w],{...J}):null;S&&p.push(S);const b=m+d/2,{list:Y=[],spaceGridNumber:x=5,showScale:j,showNumber:T,position:X,showMaxMinNumber:V}=n;if(j||T){const{lineXMain:t,lineXSub:e,textLeft:i}=s(X,m,d),o=Y.length;Y.forEach(((l,r)=>{const s=E.endY-r*M*x;if(T&&(!(0===r||r===o-1)||V)){const t=0==r?s-5:s,e=a(l,n,i,t),o=E.originY+e.height/2;t<o&&e.set({top:o}),p.push(e)}p.push(...u(n,r,t,e,s,M,E.originY))}))}let L=n.title||"";n.unit&&(L+="\n"+n.unit),L&&p.push(new t.Text(String(L),{...e,left:b,top:E.originY+M*x/2,textAlign:"center",...n.style}));const k=new t.Group(p,{...i,objectCaching:!1});c.push(k)}));const m=c.length>0?new t.Group([...c],{...i,objectCaching:!1}):null;m&&g.value.add(m),m&&m.sendToBack()}function q(t){return t.left>=N&&t.left<V&&t.top>=X&&t.top<=C}G&&function(){const e=JSON.parse(JSON.stringify(H));let o=C;const s=G-k.icons.marginRight;e.reverse().forEach((e=>{o-=10;let a=e.title.replace(/(.{2})/g,"$1\n");a.endsWith("\n")&&(a=a.slice(0,a.length-1));const u=new t.Text(String(a),{...i,objectCaching:!1,...e.titleStyle||{},originX:"right",originY:"bottom",left:s-(e.pointAttr.width||10)-5,top:o,lineHeight:1,fontSize:12}),h=n(e.type,{left:s,top:o-(u.height||30)/2-1,...e.pointAttr,originY:"center",originX:"right",origin:{title:e.title,unit:e.unit,type:l(e.bigType),_type:e.bigType,dataIndex:e.dataIndex,key:e.key,isMenu:!0},originLeft:s,originTop:o-(u.height||30)/2-1,...p.event});var y;o-=u.height||30,(y=h).on("moving",(()=>{y.set("originX","center"),function(t){if(t.left>=N&&t.left<=V){t.setCoords();const e="pain"===t.origin.type?I:E;t.top<e.originY&&t.set("top",e.originY),t.top>e.endY&&t.set("top",e.endY)}}(y),q(y)?d(y):f.show=!1})),y.on("mouseup:before",(t=>{if(f.show=!1,0===t.e.button&&q(y)){const t=j(y.left,"_type",L).includes(y.origin._type),e=S(y.left);if(!e||t)t&&e&&T("repeat");else{const t={data:{time:v(y.left),value:w(y.origin.type,y.top),...r(y.origin.type)?{key:y.origin.key}:{}},...y.origin};c("add",t),b(t)}}!function(t){t.setCoords().set({originX:"right",left:t.originLeft,top:t.originTop})}(y)})),g.value.add(u,h)}))}();const z=k.yScaleValue.filter((t=>"left"===t.layout&&"pain"!==t.type&&t.show));if((null==W?void 0:W.width)&&"left"===(null==(Y=null==W?void 0:W.yScaleValue)?void 0:Y.layout)&&(null==(x=null==W?void 0:W.yScaleValue)?void 0:x.show)&&z.push(B),O>0&&k.yScaleValue[O].show){const t=k.yScaleValue[O];0===O&&k.yScaleValue.length>1&&z.unshift(t),O==k.yScaleValue.length-1&&z.push(t)}const D=z.findIndex((t=>"pulse"===t.type&&t.show&&t.doubleShow)),P=z[D];return D>-1&&z.splice(D,0,{...P,title:(null==P?void 0:P.doubleTitle)||(null==P?void 0:P.title)}),$(z),g.value.add(new t.Rect({left:G,top:0,width:R-G-1,height:_-1,fill:"transparent",...J})),{drawScaleValue:$}}export{g as useLeft};
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ export declare function useOther(canvas: Ref<fabric.Canvas>, propItems: IPropItems, cumputedX: Function): void;
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function i(i,n,o){const{other:r,vitalSignsOriginY:l,xCellWidth:s,yCellHeight:a,endX:c}=n;let u=0;function h(i,n,o){const r=[];String(i.value).split("").forEach(((n,o)=>{const l=new t.Text(n,{left:0,top:a*o,originX:"center",...e,objectCaching:!1,...i.style||{}});u=(a-(l.height||0))/2,r.push(l)}));const l={originX:"center",left:n,top:o+u,baseTop:(i.baseTop||0)*a,trueLeft:n,trueHeight:r.length*a,objectCaching:!1};return new t.Group(r,l)}!function(){if(!(null==r?void 0:r.list))return!1;const n=[],u=[];r.list.forEach(((t,e)=>{const i=0===e?"vertical":t.align||"vertical",n=o(t.time,!0);if(n>c)return;const r=u.find((t=>t.left==n));if(r)r[i].push(t);else{const e={left:n,vertical:[],horizontal:[]};e[i].push(t),u.push(e)}})),u.forEach((t=>{let e=l.originY,i=t.left;t.vertical.forEach(((o,r)=>{var c,u;const f=(o.baseTop||0)*a,g=(null==(c=n.at(-1))?void 0:c.left)||0;0===r&&t.left<=g&&(i=g+s);if(n.filter((t=>t.trueLeft===i)).length){const t=String(o.value).length*a,r=(null==(u=n.at(-1))?void 0:u.trueHeight)||0;e+=r,e+t+f>l.endY&&(e=l.originY,i+=s)}e+=f,String(o.value).length&&n.push(h(o,i,e))})),t.horizontal.forEach(((e,o)=>{var r;const c=l.originY+(e.baseTop||0)*a,u=(null==(r=n.at(-1))?void 0:r.left)||0;t.left<=u&&(i=u+s),String(e.value).length&&n.push(h(e,i,c))}))}));const f=n.length>0?new t.Group([...n],{...e,objectCaching:!1}):null;f&&i.value.add(f)}()}export{i as useOther};
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ export declare function useRight(canvas: Ref<fabric.Canvas>, propItems: IPropItems, drawScaleValue: Function): void;
@@ -0,0 +1 @@
1
+ import{fabric as l}from"../../../../../shared/utils/fabricjs/index.js";function e(e,i,t){var o,n;const{left:d,right:u,getRightInfo:a,canvasWidth:s,endY:h,endX:r,originY:f,borderStyle:v}=i,c=d.yScaleValue.filter((l=>"right"===l.layout&&l.show));(null==u?void 0:u.width)&&"right"===(null==(o=null==u?void 0:u.yScaleValue)?void 0:o.layout)&&(null==(n=null==u?void 0:u.yScaleValue)?void 0:n.show)&&c.push(a);const w=c.findIndex((l=>"pulse"===l.type&&l.show&&l.doubleShow)),g=c[w];if(w>-1&&c.splice(w,0,{...g,title:(null==g?void 0:g.doubleTitle)||(null==g?void 0:g.title)}),(null==u?void 0:u.width)||c.length>0){const i=new l.Line([s-1,0,s-1,h],v),t=new l.Line([r+1,f,s-1,f],{...v,stroke:"#fff"});e.value.add(i,t)}t(c)}export{e as useRight};
@@ -1,4 +1,4 @@
1
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
1
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
2
2
  declare type Point = [number, number];
3
3
  export declare function useShadow(): {
4
4
  createShadowLines: (coordinates: Point[], angle?: number, space?: number) => fabric.Line[];
@@ -0,0 +1 @@
1
+ import{useMemoize as t}from"@vueuse/core";import{fabric as n}from"../../../../../shared/utils/fabricjs/index.js";const r=t((t=>+Math.tan(t*Math.PI/180)));function e(){return{createShadowLines:function(e,o=45,u=10){const a=[];var c;if(c=o,0===(o=c=(c=(c%=360)<0?180-c:c)>=180?c-180:c))return a;const i=Math.min(...e.map((([t])=>t))),s=Math.max(...e.map((([t])=>t))),h=Math.min(...e.map((([,t])=>t))),f=Math.max(...e.map((([,t])=>t))),m=(f-h)/r(o);let p=i,M=s;return o>0&&o<90||o>180&&o<270?M+=m:p+=m,function(t,n){const r=[l([t,h])];for(;t<n;)t+=u,r.push(l([t,h]));return r}(p,M).forEach((r=>{let o=[];var u,c,i,s,h,f;if((u=e,u.reduce(((t,n,r)=>{const e=u[r+1]||u[0];return t.push([n,e]),t}),[])).forEach((n=>{const e=function(n,r,e,o){const u=(r[1]-n[1])*(o[0]-e[0])-(n[0]-r[0])*(e[1]-o[1]);if(0===u)return!1;const a=((r[0]-n[0])*(o[0]-e[0])*(e[1]-n[1])+(r[1]-n[1])*(o[0]-e[0])*n[0]-(o[1]-e[1])*(r[0]-n[0])*e[0])/u,c=-((r[1]-n[1])*(o[1]-e[1])*(e[0]-n[0])+(r[0]-n[0])*(o[1]-e[1])*n[1]-(o[0]-e[0])*(r[1]-n[1])*e[1])/u;if(((a-n[0])*(a-r[0])<0||t(a,n[0])||t(a,r[0]))&&((c-n[1])*(c-r[1])<0||t(c,n[1])||t(c,r[1]))&&((a-e[0])*(a-o[0])<0||t(a,e[0])||t(a,o[0]))&&((c-e[1])*(c-o[1])<0||t(c,e[1])||t(c,o[1])))return[a,c];return!1}(r[0],r[1],n[0],n[1]);e&&o.push(e)})),c=function(n){return n.reduce(((t,n)=>(r(t,n)||t.push(n),t)),[]);function r(n,r){return n.some((n=>t(n[0],r[0])&&t(n[1],r[1])))}}(o),o=c.sort(((t,n)=>t[1]-n[1])),o.length>=2)for(let t=0;t<o.length;t++)o[t+1]&&(h=o[t],f=o[t+1],function(t,n){let r,e,o,u=0;const a=n.length;e=n[0];for(let c=1;c<=a;c++)o=n[c%a],t[0]>Math.min(e[0],o[0])&&t[0]<=Math.max(e[0],o[0])&&t[1]<=Math.max(e[1],o[1])&&e[0]!=o[0]&&(r=(t[0]-e[0])*(o[1]-e[1])/(o[0]-e[0])+e[1],(e[1]==o[1]||t[1]<=r)&&u++),e=o;return u%2!=0}([(h[0]+f[0])/2,(h[1]+f[1])/2],e))&&a.push((i=o[t],s=o[t+1],new n.Line([i[0],i[1],s[0],s[1]])))})),a;function l(t){return[t,[t[0]-m,f]]}}};function t(t,n){return Math.abs(t-n)<=1e-4}}export{e as useShadow};
@@ -1,7 +1,7 @@
1
1
  import { type Ref } from 'vue';
2
- import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
- import { AnyObject } from '../../../../../es/shared/types';
4
- export default function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { AnyObject } from '../../../../../../es/shared/types';
4
+ export declare function useTemperatureChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
5
5
  propItems: any;
6
6
  redrawPoints: Ref<any>;
7
7
  select: Ref<any>;
@@ -0,0 +1 @@
1
+ import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as n}from"../useCumputedPoint.js";import{useEvent as r,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import"date-fns";import{useTop as v}from"./useTop.js";import{useLeft as c}from"./useLeft.js";import{useRight as p}from"./useRight.js";import{useCenter as h}from"./useCenter.js";import{useBottom as g}from"./useBottom.js";import{useOther as m}from"./useOther.js";function f(f,y,Y,S){const b=15,w=e(),C=e(),x=e(),j=t({show:!1,point:{x:0,y:0},list:[]}),D=t({show:!1,point:{x:0,y:0},list:[],target:null}),V=a((()=>{const{top:e}=y.data;return e.date.show&&(e.date.height||b)||0})),X=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||b)||0})),H=a((()=>{var e;const{top:t}=y.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||b)||0})),L=a((()=>{var e,t,a;const{top:l}=y.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||b)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),P=a((()=>{var e;const{bottom:t}=y.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),$=a((()=>{const{grid:e}=y.data;return e.mainXCell*e.subXCell+e.surplusXCell})),I=a((()=>{const{grid:e}=y.data;return e.mainYCell*e.subYCell+e.surplusYCell})),N=a((()=>{var e;const{width:t,right:a=null,top:l}=y.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),T=a((()=>{const{grid:e}=y.data;return N.value-e.surplusXCell*M.value})),O=a((()=>{const{top:e,left:t}=y.data;return e.titleWidth+q.value})),W=a((()=>{const{bottom:e=null,height:t}=y.data;if(!e)return t;return t-(e.height||30)})),k=a((()=>{var e;const{top:t}=y.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||b)||0;return V.value+a+l+X.value+H.value})),G=a((()=>{const{grid:e}=y.data;return k.value+e.surplusYCell*R.value})),M=a((()=>(N.value-O.value)/$.value)),R=a((()=>(W.value-k.value)/I.value)),q=a((()=>{var e,t;const{left:a}=y.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),z=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=(null==(t=null==(e=a.date.list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],i=a.xScalevalue.times;let n=O.value-M.value;function r(e){const[t="2022",a="01",l="01"]=String(e).match(/\d+/g)||[];return`20${t}`.slice(-4)+"-"+`00${a}`.slice(-2)+"-"+`00${l}`.slice(-2)}return u.map((e=>i.map((t=>{n+=M.value;const a=new Date(`${r(e)} ${t.start}`).getTime(),l=new Date(`${r(e)} ${t.end}`).getTime();return{start:a,end:l,left:n,center:n+M.value/2,scaleCell:(l-a)/M.value}})))).flat()})),A=a((()=>le("breathe"))),B=a((()=>le("pulse"))),E=a((()=>le("temperature"))),F=a((()=>le("pain"))),J=a((()=>{var e;return(null==(e=y.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),K=a((()=>{const{left:e}=y.data;return e.yScaleValue.map((e=>e.dataList.filter((e=>e.show)).map(((t,a)=>({...t,bigType:s(t.title,e.type),unit:e.unit,dataIndex:a}))))).flat()})),Q=a((()=>{const{left:e}=y.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),U=a((()=>{const{grid:e}=y.data;return-1===Q.value?0:R.value*e.subYCell})),Z=a((()=>{const{left:e}=y.data,t={originY:W.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value,t.endY=G.value+U.value):Q.value===e.yScaleValue.length-1&&(t.originY=W.value-U.value,t.endY=W.value),t})),_=a((()=>{const{left:e}=y.data,t={originY:k.value,endY:W.value};return 0===Q.value&&e.yScaleValue.length>1?(t.originY=G.value+U.value,t.endY=W.value):Q.value===e.yScaleValue.length-1&&(t.originY=G.value,t.endY=W.value-U.value),t})),ee=a((()=>{var e,t;const{top:a,grid:l}=y.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),te=a((()=>{var e;const{left:t,right:a}=y.data,l=t.yScaleValue.find((e=>"temperature"===e.type)),u=(null==a?void 0:a.yScaleValue)||{};return(null==(e=null==l?void 0:l.list)?void 0:e.length)&&Object.assign(u,{list:l.list.map((e=>d(1.8*e+32))),spaceGridNumber:l.spaceGridNumber}),u})),ae=t({canvasWidth:y.data.width,canvasHeight:y.data.height,borderStyle:{...i,...y.data.borderStyle||{}},selectionStyle:y.data.selectionStyle||{},dateHeight:V.value,hospitalDaysHeight:X.value,operationDaysHeight:H.value,xScalevalueHeight:L.value,topList:ee.value,breathingHeight:P.value,hospitalizationDate:y.data.hospitalizationDate,grid:y.data.grid,top:y.data.top,left:y.data.left,right:y.data.right,bottom:y.data.bottom,other:y.data.other,painIndex:Q.value,painHeight:U.value,painOriginY:Z.value,vitalSignsOriginY:_.value,gridXNumber:$.value,gridYNumber:I.value,iconsWidth:q.value,originX:O.value,originY:k.value,originYLimit:G.value,endX:N.value,endXLimit:T.value,endY:W.value,xCellWidth:M.value,yCellHeight:R.value,xScaleList:z.value,breatheYCell:A.value,pulseYCell:B.value,temperatureYCell:E.value,painYCell:F.value,event:J.value,itemList:K.value,getRightInfo:te.value,config:y.data.config||{}});function le(e){const{yScaleValue:t}=y.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?R.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:ue,cumputedY:ie,getXValue:ne,getYValue:re}=n(ae);return l((()=>{u((()=>{v(f,ae);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=h(f,ae,Y,ue,ie,ne,re,y.addRenderItem,j,D);C.value=l,x.value=u;const{drawScaleValue:i}=c(f,ae,Y,e,j,ue,ie,ne,re,t,a);p(f,ae,i),g(f,ae),m(f,ae,ue),r(S.value);const{select:n}=o(f,ae,Y);w.value=n}))})),{propItems:ae,redrawPoints:C,select:w,pointTipProps:j,pointMenuProps:D,clickMenu:x}}export{f as useTemperatureChart};
@@ -0,0 +1,4 @@
1
+ import { type Ref } from 'vue';
2
+ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
3
+ import { IPropItems } from '../../../../../../es/components/fabric-chart/src/interface';
4
+ export declare function useTop(canvas: Ref<fabric.Canvas>, propItems: IPropItems): void;
@@ -0,0 +1 @@
1
+ import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{defaultStyle as e,drawTextGroup as l,defaultTextStyle as i}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"./useShadow.js";function o(o,s){const{grid:u,originX:h,xCellWidth:n,gridXNumber:a,top:c,xScalevalueHeight:r,iconsWidth:d,topList:p,endXLimit:f,canvasWidth:v,borderStyle:g}=s;!function(){const y=[];f&&y.push(new t.Line([f,0,v,0],g));let m=0;p.forEach(((t,e)=>{e>0&&(m+=s[`${p[e-1].key}Height`]),"xScalevalue"==t.key?(function(t,e,o){if(!c.dayHeight)return!1;const s=c.dayHeight,r=n*u.subSecondXCell,d=(a-u.surplusXCell)/u.subSecondXCell;for(let u=0;u<d;u++){const n=h+u*r,a=u%2==0?"上午":"下午",c=l({width:r,height:s,...g},{value:a,...i,...t.style||{}},{left:n,top:o});e.push(c)}}(t,y,m),function(t,e,o){var s;const a=c.xScalevalue.show&&null!=(s=c.dayHeight)?s:0,p=r-a,f=l({width:h-d,height:r,...g},{value:c.xScalevalue.title,...i,...t.style||{},...t.titleStyle||{}},{left:d,top:o});e.push(f);const v=[];for(let t=0;t<u.mainXCell;t++)v.push(c.xScalevalue.list);v.flat().forEach(((s,u)=>{const c=h+u*n,r=l({width:n,height:p,...g},{value:s.value,...i,...t.style||{},...s.style||{}},{left:c,top:o+a});e.push(r)}))}(t,y,m)):s[`${t.key}Height`]&&function(t,e,o){const a=s[`${t.key}Height`],c=l({width:h-d,height:a,...g},{value:t.title,...i,...(null==t?void 0:t.style)||{},...t.titleStyle||{}},{left:d,top:o});e.push(c);const r=n*u.subXCell;t.list.forEach(((s,u)=>{const n=h+u*r,c=l({width:r,height:a,...g},{value:s,...i,...(null==t?void 0:t.style)||{}},{left:n,top:o});e.push(c)}))}(t,y,m)}));const S=y.length>0?new t.Group([...y],{...e,objectCaching:!1}):null;S&&S.sendToBack(),S&&o.value.add(S)}()}export{o as useTop};
@@ -1,4 +1,4 @@
1
1
  import { Ref } from 'vue';
2
2
  import { fabric } from '../../../../../es/shared/utils/fabricjs';
3
3
  import { AnyObject } from '../../../../../es/shared/types';
4
- export default function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject, isBirthProcess?: boolean): void;
4
+ export declare function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject, isBirthProcess?: boolean): void;
@@ -1 +1 @@
1
- import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as l,defaultStyle as n}from"./useDraw.js";function i(i,s,t=!1){var o,r,u,d;const{gridYNumber:a,originY:c,grid:S,originX:b,endX:y,xCellWidth:m,yCellHeight:p,gridXNumber:f,endY:g,borderStyle:h}=s,v=[],C=[],L=new Set;for(let e=0;e<=a;e++){const n=c+parseInt(String(p*(a-e)));if(t){const e=l([b,n,y,n],{...h,...(null==(o=S.mainLineStyle)?void 0:o.x)||{}});v.push(e)}else{const i=e%S.subYCell==0?(null==(r=S.mainLineStyle)?void 0:r.x)||{}:S.subLineStyle||{},s=l([b,n,y,n],i);e%S.subYCell==0?L.add(s):v.push(s)}}for(let e=0;e<=f;e++){const n=b+parseInt(String(m*e));if(t){const e=l([n,c,n,g],{...h,...(null==(u=S.mainLineStyle)?void 0:u.y)||{}});C.push(e)}else{let i=S.subLineStyle||{};e%S.subSecondXCell==0&&(i=S.subSecondLineStyle||{}),e%S.subXCell==0&&(i=0!==e&&e!==f?(null==(d=S.mainLineStyle)?void 0:d.y)||{}:h);const s=l([n,c,n,g],i);e%S.subXCell==0&&0!==e&&e!==f?L.add(s):C.push(s)}}const X=new e.Group([...C,...v,...L],n);i.value.add(X),i.value.sendToBack(X)}export{i as default};
1
+ import{fabric as e}from"../../../../shared/utils/fabricjs/index.js";import{drawLine as n,defaultStyle as l}from"./useDraw.js";function i(i,s,t=!1){var o,r,u,d;const{gridYNumber:a,originY:c,grid:S,originX:b,endX:y,xCellWidth:m,yCellHeight:p,gridXNumber:f,endY:g,borderStyle:h}=s,v=[],C=[],L=new Set;for(let e=0;e<=a;e++){const l=c+parseInt(String(p*(a-e)));if(t){const e=n([b,l,y,l],{...h,...(null==(o=S.mainLineStyle)?void 0:o.x)||{}});v.push(e)}else{const i=e%S.subYCell==0?(null==(r=S.mainLineStyle)?void 0:r.x)||{}:S.subLineStyle||{},s=n([b,l,y,l],i);e%S.subYCell==0?L.add(s):v.push(s)}}for(let e=0;e<=f;e++){const l=b+parseInt(String(m*e));if(t){const e=n([l,c,l,g],{...h,...(null==(u=S.mainLineStyle)?void 0:u.y)||{}});C.push(e)}else{let i=S.subLineStyle||{};e%S.subSecondXCell==0&&(i=S.subSecondLineStyle||{}),e%S.subXCell==0&&(i=0!==e&&e!==f?(null==(d=S.mainLineStyle)?void 0:d.y)||{}:h);const s=n([l,c,l,g],i);e%S.subXCell==0&&0!==e&&e!==f?L.add(s):C.push(s)}}const X=new e.Group([...C,...v,...L],l);i.value.add(X),i.value.sendToBack(X)}export{i as useGrid};
@@ -1,7 +1,7 @@
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 type IType = 'temperature' | 'birthProcess' | undefined;
4
+ export declare type IType = 'temperature' | 'birthProcess' | 'surgicalAnesthesia' | undefined;
5
5
  interface IEvent {
6
6
  selectable: boolean;
7
7
  evented: boolean;
@@ -1 +1 @@
1
- import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as i,isString as l,isEmpty as s,isFunction as c,omit as d}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as p}from"../../constants/index.js";import{useCommonInjection as v}from"../../hooks/useCommonInjection.js";import{formRenderLog as f}from"../../utils/index.js";import{connect as m,mapProps as y}from"@formily/vue";import h from"../../../../search-cascader/index.js";import k from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as j,createVisitedSetter as _}from"../../utils/schema.js";import{useFormField as w}from"../../hooks/useFormField.js";import{useFormRequest as b}from"../../hooks/useFormRequest.js";const g=m(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:m}){const y=u(e,"value",m),j=r(!1),g=r([]),{field:F,fieldKey:K}=w(),O=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),q=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),S=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),x=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),C=o(p),{getSearchRequestInfo:L}=b();async function V(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!l(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e)),o=await async function(r){if(!L().primaryKeyUrl)return[];try{return await C.addAsync(t(e.wordbook,e.autograph,r,K.value))}catch(e){l(e)&&f(e)}function t(r,t,o,a){const n=L();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=x.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[q.value]===r))}}(o,t);return await V(a),s(a.children)?(y.value=function(e,r){return r.map((r=>e.find((e=>e[q.value]===r))))}(o,t),j.value=!1,Promise.reject()):(g.value=n,a)}{const n=await C.addAsync(function(r,o,a,n,u){const i={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[q.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(i).reduce(((e,[t,o])=>(e[t]=l(o)?r[o]:c(o)?o():void 0,e)),{});return{...L(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,F.value,r,K.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,x.value)))}else g.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[O.value]=e[S.value||O.value]||e[O.value]);return e}(e,t)))}}catch(e){l(e)&&f(e)}function o(e){return y.value=function(e){const r=[];let t=e;for(;t;)r.unshift(d(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),j.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{i(r,t)||(g.value=[],r&&(y.value||!e.lazyRequest)&&V())}),{immediate:!0});const{injectValueValidate:A,injectValueWatchFromEmpty:I,injectValueBindKey:P}=v();I(y,V),A(y);const R=P(y);return()=>n(h,{value:y.value,"onUpdate:value":e=>y.value=e,show:j.value,"onUpdate:show":e=>j.value=e,options:g.value,key:R.value,labelKey:O.value,valueKey:q.value,search:V,onFocus:_(F)},{empty:()=>n(k,null,null)})}}),y({dataSource:"options"},j));export{g as LEVEL_SEARCH_CASCADER};
1
+ import{defineComponent as e,ref as r,computed as t,inject as o,watch as a,createVNode as n}from"vue";import{useVModel as u}from"@vueuse/core";import{isEqual as l,isString as i,isNumber as s,isEmpty as c,isFunction as d,omit as p}from"lodash-es";import"../../../index.js";import{InjectionAsyncQueue as v}from"../../constants/index.js";import{useCommonInjection as f}from"../../hooks/useCommonInjection.js";import{formRenderLog as m}from"../../utils/index.js";import{connect as y,mapProps as h}from"@formily/vue";import k from"../../../../search-cascader/index.js";import j from"../../../../../shared/components/no-data/NoData.vue.js";import{assignUpdateValue as _,createVisitedSetter as w}from"../../utils/schema.js";import{useFormField as b}from"../../hooks/useFormField.js";import{useFormRequest as g}from"../../hooks/useFormRequest.js";const F=y(e({name:"FormSearchCascade",props:{options:{type:Array,default:()=>[]},labelField:{type:String,default:"text"},valueField:{type:String,default:"value"},autograph:{type:String,required:!0},lazyRequest:{type:Boolean,default:!0},requestCache:{type:Boolean,default:!0},wordbook:{type:Object,required:!0},onChange:{},value:{type:[String,Array]}},emits:["update:value"],setup(e,{emit:y}){const h=u(e,"value",y),_=r(!1),F=r([]),{field:K,fieldKey:O}=b(),q=t((()=>{var r,t,o;return null!=(o=null==(t=null==(r=e.wordbook)?void 0:r.show_key)?void 0:t[0])?o:e.labelField})),S=t((()=>{var r,t;return null!=(t=null==(r=e.wordbook)?void 0:r.value_key)?t:e.valueField})),x=t((()=>{var r,t;return null==(t=null==(r=e.wordbook)?void 0:r.render_key)?void 0:t[0]})),C=t((()=>{var r;return(null==(r=e.wordbook)?void 0:r.level_num)||1/0})),L=o(v),{getSearchRequestInfo:V}=g();async function A(r,t){try{if(r&&!r.__keyword&&r.isLeaf)return o(r);if(null==r?void 0:r.__keyword){if(!i(r.id_link))return Promise.reject();const t=r.id_link.split("_").filter((e=>e));s(C.value)&&C.value!==1/0&&t.splice(C.value);const o=await async function(r){if(!V().primaryKeyUrl)return[];try{return await L.addAsync(t(e.wordbook,e.autograph,r,O.value))}catch(e){i(e)&&m(e)}function t(r,t,o,a){const n=V();return{key:a,params:{autograph:t,tableId:r.id,primaryKeyValue:o.join(","),page:1},...n,url:n.primaryKeyUrl,cache:e.requestCache}}}(t);if(!o)return Promise.reject();const{lastOption:a,options:n}=function(e,r){let t=e[0];return{options:r.reduce(((r,a,n)=>{const u=o(e,a);return 0===n?(t=u,[u]):(Object.assign(u,{parent:t,isLeaf:n+1>=C.value}),t.children=[u],t=u,r)}),[]),lastOption:t};function o(e,r){return e.find((e=>e[S.value]===r))}}(o,t);return n.length<C.value&&(await A(a),c(a.children))?(h.value=function(e,r){return r.map((r=>e.find((e=>e[S.value]===r))))}(o,t),_.value=!1,Promise.reject()):(F.value=n,a)}{const n=await L.addAsync(function(r,o,a,n,u){const l={autograph:()=>o,wordbookId:"id",wordbookType:"type",fieldKeys:()=>r.search_key?JSON.stringify(r.search_key):void 0,conObj:()=>JSON.stringify(function(e,r,t){return r?e.conObj||[]:t?[{con:"EQ",is_compare_field:!1,field_key:e.level_key,value:t[S.value]}]:e.conObjFirstLevel||[]}(r,t,n)),primaryKey:"primary_key",levelKey:"level_key",keyword:()=>t,page:()=>1},s=Object.entries(l).reduce(((e,[t,o])=>(e[t]=i(o)?r[o]:d(o)?o():void 0,e)),{});return{...V(),params:s,key:u,cache:e.requestCache}}(e.wordbook,e.autograph,K.value,r,O.value));if(r){if(!n.length)return o(r);r.children=n.map((e=>function(e,r,t){return{...e,parent:r,isLeaf:a(r)+1>=t}}(e,r,C.value)))}else F.value=n.map((e=>function(e,r){e.__keyword=!!r,e.isLeaf=!!r,r&&(e[q.value]=e[x.value||q.value]||e[q.value]);return e}(e,t)))}}catch(e){i(e)&&m(e)}function o(e){return h.value=function(e){const r=[];let t=e;for(;t;)r.unshift(p(t,["parent","isLeaf","__keyword","children"])),t=t.parent;return r}(e),_.value=!1,Promise.reject()}function a(e){let r=1,t=e.parent;for(;t;)r++,t=t.parent;return r}}a((()=>e.wordbook),((r,t)=>{l(r,t)||(F.value=[],r&&(h.value||!e.lazyRequest)&&A())}),{immediate:!0});const{injectValueValidate:I,injectValueWatchFromEmpty:P,injectValueBindKey:R}=f();P(h,A),I(h);const U=R(h);return()=>n(k,{value:h.value,"onUpdate:value":e=>h.value=e,show:_.value,"onUpdate:show":e=>_.value=e,options:F.value,key:U.value,labelKey:q.value,valueKey:S.value,search:A,onFocus:w(K)},{empty:()=>n(j,null,null)})}}),h({dataSource:"options"},_));export{F as LEVEL_SEARCH_CASCADER};