cnhis-design-vue 3.1.46-beta.3 → 3.1.46-beta.5
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.
- package/README.md +87 -87
- package/es/components/fabric-chart/src/FabricChart.vue2.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcessChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/temperature/useTemperatureChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/useCumputedPoint.js +1 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +1 -0
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.d.ts +1 -1
- package/es/components/iho-table/src/hooks/tapHooks/useSetupHooks.js +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/quick-search/src/index.vue2.js +1 -1
- package/es/components/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/select-person/src/SearchMultiple.vue.d.ts +6 -0
- package/es/components/table-export-field/index.d.ts +967 -0
- package/es/components/table-export-field/index.js +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.d.ts +192 -0
- package/es/components/table-export-field/src/components/ExportModal.vue.js +1 -0
- package/es/components/table-export-field/src/components/ExportModal.vue2.js +1 -0
- package/es/components/table-export-field/src/components/SaveProjectModal.vue.d.ts +687 -0
- package/es/components/table-export-field/src/components/SaveProjectModal.vue.js +1 -0
- package/es/components/table-export-field/src/components/SaveProjectModal.vue2.js +1 -0
- package/es/components/table-export-field/src/constants/index.d.ts +3 -0
- package/es/components/table-export-field/src/constants/index.js +1 -0
- package/es/components/table-export-field/src/hooks/useAsyncData.d.ts +6 -0
- package/es/components/table-export-field/src/hooks/useAsyncData.js +1 -0
- package/es/components/table-export-field/src/index.vue.d.ts +968 -0
- package/es/components/table-export-field/src/index.vue.js +1 -0
- package/es/components/table-export-field/src/index.vue2.js +1 -0
- package/es/components/table-export-field/src/types/index.d.ts +6 -0
- package/es/components/table-export-field/src/types/index.js +1 -0
- package/es/components/table-export-field/style/index.css +1 -0
- package/es/components/table-filter/src/components/render-widget/components/DateQuickBtn/index.vue2.js +1 -1
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.js +1 -1
- package/package.json +2 -2
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/form-render/src/components/renderer/dist/levelSearchCascader.d.ts +0 -77
- package/es/components/form-render/src/components/renderer/dist/searchCascade.d.ts +0 -93
- package/es/components/iho-table/src/plugins/dist/highLightSetPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/filterRenderPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/dateRendererPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/defaultRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/dist/seqRendererPlugin.d.ts +0 -3
- package/es/components/iho-table/src/plugins/varialbleHeightPlugin/dist/index.d.ts +0 -3
- package/es/components/iho-table/src/utils/dist/index.d.ts +0 -44
- package/es/components/scale-view/src/components/formitem/dist/r-address.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/r-sign.d.ts +0 -36
- package/es/components/scale-view/src/components/formitem/dist/standard-modal.d.ts +0 -82
- package/es/components/search-cascader/src/components/dist/SearchMenu.d.ts +0 -57
- package/es/components/search-cascader/src/components/dist/SearchMenu1.d.ts +0 -57
- package/es/shared/components/VueDraggable/src/vuedraggable.d.ts +0 -86
- package/es/shared/utils/fabricjs/index.d.ts +0 -6823
- package/es/shared/utils/tapable/index.d.ts +0 -139
package/README.md
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
# 安装
|
|
2
|
-
|
|
3
|
-
```shell
|
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
|
5
|
-
# or
|
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## 1.全局引入
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
// main.ts
|
|
13
|
-
import { createApp } from 'vue';
|
|
14
|
-
import App from './App.vue';
|
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
-
import cui from 'cnhis-design-vue';
|
|
17
|
-
|
|
18
|
-
const app = createApp(App);
|
|
19
|
-
app.use(cui).mount('#app');
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## 2. 按需引入
|
|
23
|
-
|
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
-
|
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
-
|
|
28
|
-
```shell
|
|
29
|
-
# 安装自动导入样式的插件
|
|
30
|
-
npm i -d vite-plugin-style-import
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
// vite.config.ts
|
|
35
|
-
import { defineConfig } from 'vite';
|
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
-
|
|
38
|
-
export default defineConfig({
|
|
39
|
-
plugins: [
|
|
40
|
-
// ...otherPlugins
|
|
41
|
-
createStyleImportPlugin({
|
|
42
|
-
libs: [
|
|
43
|
-
{
|
|
44
|
-
libraryName: 'cnhis-design-vue',
|
|
45
|
-
esModule: true,
|
|
46
|
-
ensureStyleFile: true,
|
|
47
|
-
resolveStyle: name => {
|
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
});
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
// main.ts
|
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## 3.FAQ
|
|
65
|
-
|
|
66
|
-
### 3.1 项目打包后样式丢失
|
|
67
|
-
|
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
// vite.config.ts
|
|
72
|
-
import { defineConfig } from 'vite';
|
|
73
|
-
|
|
74
|
-
export default defineConfig({
|
|
75
|
-
build: {
|
|
76
|
-
rollupOptions: {
|
|
77
|
-
// ..otherOptions
|
|
78
|
-
output: {
|
|
79
|
-
dir: './dist',
|
|
80
|
-
manualChunks: {
|
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
```
|
|
1
|
+
# 安装
|
|
2
|
+
|
|
3
|
+
```shell
|
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
|
5
|
+
# or
|
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1.全局引入
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// main.ts
|
|
13
|
+
import { createApp } from 'vue';
|
|
14
|
+
import App from './App.vue';
|
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
|
16
|
+
import cui from 'cnhis-design-vue';
|
|
17
|
+
|
|
18
|
+
const app = createApp(App);
|
|
19
|
+
app.use(cui).mount('#app');
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 2. 按需引入
|
|
23
|
+
|
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
|
25
|
+
|
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# 安装自动导入样式的插件
|
|
30
|
+
npm i -d vite-plugin-style-import
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// vite.config.ts
|
|
35
|
+
import { defineConfig } from 'vite';
|
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
|
37
|
+
|
|
38
|
+
export default defineConfig({
|
|
39
|
+
plugins: [
|
|
40
|
+
// ...otherPlugins
|
|
41
|
+
createStyleImportPlugin({
|
|
42
|
+
libs: [
|
|
43
|
+
{
|
|
44
|
+
libraryName: 'cnhis-design-vue',
|
|
45
|
+
esModule: true,
|
|
46
|
+
ensureStyleFile: true,
|
|
47
|
+
resolveStyle: name => {
|
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
// main.ts
|
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## 3.FAQ
|
|
65
|
+
|
|
66
|
+
### 3.1 项目打包后样式丢失
|
|
67
|
+
|
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// vite.config.ts
|
|
72
|
+
import { defineConfig } from 'vite';
|
|
73
|
+
|
|
74
|
+
export default defineConfig({
|
|
75
|
+
build: {
|
|
76
|
+
rollupOptions: {
|
|
77
|
+
// ..otherOptions
|
|
78
|
+
output: {
|
|
79
|
+
dir: './dist',
|
|
80
|
+
manualChunks: {
|
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
```
|
|
@@ -1 +1 @@
|
|
|
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:
|
|
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:g}){const C=e,j=r(null),P=r(),{propItems:y,redrawPoints:b,select:I,pointTipProps:M,pointMenuProps:T,clickMenu:x}=function(){const e=[P,C,g,j];switch(C.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,allowTouchScrolling:!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(T),{show:c(T).show,"onUpdate:show":r[0]||(r[0]=e=>c(T).show=e),onClickMenu:c(x)}),null,16,["propItems","show","onClickMenu"])):l("v-if",!0)],64))}});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as e,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,getTime as v}from"../../utils/index.js";import"../temperature/useShadow.js";import{cloneDeep as m}from"lodash-es";import{format as y}from"date-fns";function k(k,w,x,b,j){const{cumputedX:S,cumputedY:C,getXValue:T,getYValue:M}=u(w),{getEqualXTypes:P,handleAddPrevent:E}=p(k,x),{xAxis:G,grid:L,originX:Y,originY:X,xCellWidth:A,endY:H,startTime:I,leftAddAreaWidth:O,leftScales:W,rightScales:V,yCellHeight:D,endX:N,scaleValues:R,canvasWidth:$,borderStyle:B,rightAddAreaWidth:F,event:q,originYCervix:z,other:J,canvasHeight:K}=w,Q=m(R),U=new Set;function Z(){Q.filter((t=>t.show)).forEach(((t,l)=>{var s;const a=[],u=[],c=[];null==(s=t.data)||s.forEach(((s,f)=>{!function(s,f,d){let p,h;const{pointAttr:g={},lineAttr:v={},title:m="",key:y,type:j="circle",childbirthStyle:S={}}=t,C=t.data[d+1],P=ot(C,t);if(s&&P&&!f.breakpoint)h=e([...s,...P],{...v});else if(s&&!P&&!f.breakpoint){const n=ot(C,t);h=n?e([...s,...n],{...v}):null}let E,G;if(f.childbirth){const t=s[1]+D;E=n([s[0],s[1],t],S),c.push(E),G=o([s[0]+A/2,t-D/2],{value:String(f.childbirth),...i,originX:"left",originY:"center",...S}),c.push(G)}const L=u[d-1],Y={origin:{data:f,title:m,key:y||"",dataIndex:l,index:d},leftLine:L,rightLine:h,arrowGroup:E,arrowGroupText:G,...g,...w.event.hovered?w.event.evented?{selectable:!0}:{selectable:!0,lockMovementX:!0,lockMovementY:!0}:w.event};L?p=r(j,{left:L.get("x2"),top:L.get("y2"),...Y}):s&&(Y.leftLine=null,p=r(j,{left:s[0],top:s[1],...Y}));u.push(h),p&&(!function(t){q.hovered&&(t.on("mouseover",(()=>{nt(t,"hover")})),t.on("mouseout",(()=>{b.show=!1})));if(t.lockMovementX&&t.lockMovementY)return;t.on("moving",(()=>{et(t),function(t){var e,n,o,i;null==(e=t.leftLine)||e.setCoords().set({x2:t.left,y2:t.top}),null==(n=t.rightLine)||n.setCoords().set({x1:t.left,y1:t.top}),null==(o=t.arrowGroup)||o.setCoords().set({left:t.left,top:t.top}),null==(i=t.arrowGroupText)||i.setCoords().set({left:t.left+A/2,top:t.top+D/2})}(t),q.hovered&&nt(t)})),t.on("mouseup",(e=>{if(b.show=!1,1===e.button){const{key:e}=t.origin,n={...t.origin,data:{...t.origin.data,time:T(t.left),value:M(e,t.top)}};k.value.discardActiveObject(),x("change",n),_(n,"change")}}))}(p),a.push(p),U.add(p))}(ot(s,t),s,f)})),Promise.all(a).then((t=>{const e=u.filter((t=>t));let n=null;t=t.filter((t=>(t&&n&&(n.nextPoint=t,t.prevPoint=n),n=t||n,t))),Promise.all(c).then((n=>{k.value.add(...e,...t,...n),t.forEach((t=>{null==t||t.bringToFront()}))}))}))}))}function _(t,e="add"){const{dataIndex:n,data:o,index:i,key:r}=t,l=Q.find((t=>t.key===r));switch(e){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=o;break;default:{const t=h(o.time,l.data);l.data.splice(t,0,o);break}}tt()}function tt(){var t;U.size&&(null==(t=k.value)||t.remove(...function(t){const e=[];return t.forEach((t=>{t&&e.push(t),(null==t?void 0:t.leftLine)&&e.push(null==t?void 0:t.leftLine),(null==t?void 0:t.rightLine)&&e.push(null==t?void 0:t.rightLine),(null==t?void 0:t.arrowGroup)&&e.push(null==t?void 0:t.arrowGroup),(null==t?void 0:t.arrowGroupText)&&e.push(null==t?void 0:t.arrowGroupText)})),e}([...U]))),U.clear(),Z()}function et(t){const e=t.prevPoint?t.prevPoint.left:Y,n=t.nextPoint?t.nextPoint.left:N;t.setCoords(),["cervix","fetalPresentation"].includes(t.origin.key)&&t.top<z&&t.set("top",z),t.top<X&&t.set("top",X),t.top>H&&t.set("top",H),t.left<e&&t.set("left",e),t.left>n&&t.set("left",n)}function nt(t,e="moving"){const{title:n,key:o,data:i}=t.origin;b.point={x:t.left,y:t.top},b.list=[`${n} ${"hover"===e?i.value:M(o,t.top)}`,`时间 ${T(t.left).slice(-5)}`],b.show=!0}function ot(t,e){if(g(t)&&function(t){const e=I+864e5,n=v(t);return n>=I&&n<=e}(t.time)){const n=S(t.time),o=C(e.key,e.range,t.value);return[n,o<X?X:o>H?H:o]}}function it(t,e){return t+1>e[1]?e[0]:t+1}return a(k,w),function(){const e=new t.Rect({...B,width:$-O-F-1,height:H-1,left:O,top:0,fill:"transparent"});k.value.add(e)}(),function(){function e(e,n="left"){let r="left"===n?O:N;e.forEach(((e,n)=>{const{range:a,spaceValue:u,width:p,title:h,titleStyle:g,key:v,position:m="center",spaceGridNumber:y=1,showNumber:w,showMaxMinNumber:x}=e,b=[],j=[],S=r+p/2,C=function(t,e){const n=[],[o,i]=t;for(let t=o;e>0?t<=i:t>=i;t+=e)n.push(t);return n}(a,u),T=C.length;C.forEach(((t,n)=>{const{lineXMain:o,lineXSub:i,textLeft:l}=c(m,r,p),s=H-n*D*y,a=0===n?H-8:n!==C.length-1||X||z&&"FHR"!==v?s:X+8;!w||(0===n||n===T-1)&&!x||b.push(f(String(t),e,l,a)),j.push(...d(e,n,o,i,s,D,X,T))}));const M=new t.Rect({...s,strokeWidth:.5,width:p,height:H,left:S,top:H/2}),P=o([S,X>0?X-D/2:D/2],{value:String(h),...i,...g}),E=new t.Group([...j,...b,M,...P?[P]:[]],{objectCaching:!1,...l});k.value.add(E),E.sendToBack(),r+=p}))}e(W),e(V,"right")}(),function(){const{show:e,startTime:n,range:r=[0,23],position:s="top",style:a}=G.time,{show:u,range:c=[0,23],position:f,style:d}=G.processTime;if(e||u){const p=[],h=[],g=[],v=[],m=Y+A/2,y=D/2;for(let t=0;t<L.mainXCell;t++){if(e){const e=0===t?+n.slice(11,13):it(p.at(-1),r);p.push(e);const l="top"===s?X-y:H+y;g.push(o([m+t*A,l],{value:String(e),...i,...a||{}}))}if(u){const e=0===t?c[0]:h.at(-1)+1;h.push(e);const n="top"===f?y:K-y;v.push(o([m+t*A,n],{value:String(e),...i,...d||{}}))}}const w=new t.Group([...g,...v],{objectCaching:!1,...l});k.value.add(w),k.value.sendToBack(w)}}(),function(){var t;const n=Object.values(J),o=[],i={},r=Q.find((t=>"cervix"===t.key&&t.show)),l=null==(t=null==r?void 0:r.data)?void 0:t.find((t=>3==+t.value));function s(t,e){const{key:n,range:o}=r||{},i=C(n,o,10),l=[0,e],s=[-e/t,0],a=[(H-i-e)/t,H-i],u=[N-Y,t*(N-Y)+e];let c=[],f=[];function d([n,o]){return Math.abs(o-t*n-e)<=1}function p([t,e]){const[n,o]=[...h([t,e])];return n>=Y&&n<=N&&o>=i&&o<=H}function h([t,e]){return[Y+t,H-e]}return d(l)&&p(l)&&(c=h(l)),d(s)&&p(s)&&(c=h(s)),d(a)&&p(a)&&(f=h(a)),d(u)&&p(u)&&(f=h(u)),[...c,...f]}n.forEach((t=>{if(!t.show)return;const{key:n}=t;switch(n){case"fetalPresentation":{const{range:i,show:r}=Q.find((t=>t.key===n));if(r){const r=C(n,i,0);o.push(e([Y,r,N,r],{...t}))}break}case"alert":if(l){const{key:n,range:a}=r||{},u=216e5,c={time:y(new Date(v(l.time)+u),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[S(l.time)-Y,H-C(n,a,l.value)],[p,h]=[S(c.time)-Y,H-C(n,a,c.value)],g=(h-d)/(p-f),m=d-f*g,k=s(g,m);k.length>0&&(o.push(e(k,{...t})),Object.assign(i,{k:g,b:m}))}break;case"handling":if(l){const{k:n,b:r}=i,a=144e5,u=s(n,r-(S(y(new Date(v(l.time)+a),"yyyy-MM-dd HH:mm"))-S(l.time))*n);u.length>0&&o.push(e(u,{...t}))}}})),k.value.add(...o)}(),Z(),function(){function t(t,e){const n=Q.findIndex((e=>e.key===t.key));return{renderItem:()=>t.title,origin:{title:t.title,unit:t.unit,dataIndex:n,key:t.key},pointer:e}}w.event.evented&&k.value.on("mouse:up",(e=>{if(3===e.button){const{x:n=0,y:o=0}=e.pointer||{};n>=Y&&n<=N&&o>=X&&o<=H&&(j.point={x:n,y:o},j.show=!0,e.target?(j.target=e.target,j.list=["删除节点"],k.value.forEachObject((t=>{t.origin&&t.left===e.target.left&&t.top===e.target.top&&j.list.push({renderItem:()=>t.origin.title,origin:{...t.origin},mode:"remove",pointer:e.pointer})}))):(j.target=null,j.list=["新增节点"],Q.filter((t=>t.show)).forEach((i=>{if(!P(n,"key",A).includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&o<z)return;j.list.push(t(i,e.pointer))}})),1===j.list.length&&(j.show=!1,E("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=$-F/2;function n(e,n){if(!e.length)return;let l=X;const s=[];e.forEach((e=>{const o=e.title.split("").join("\n"),a=R.findIndex((t=>t.key===e.key)),u=new t.Text(String(o),{...i,...e.titleStyle||{},originY:"top",left:n,top:l,lineHeight:1}),c=r(e.type,{left:n,top:l+u.height+3,...e.pointAttr,originY:"top",origin:{title:e.title,unit:e.unit,type:e.type,dataIndex:a,key:e.key,isMenu:!0},originLeft:n,originTop:l+u.height+3,...w.event});l+=u.height+c.height+15,function(t){function e(t){const{left:e,top:n}=t;return e>=Y&&e<=N&&n>=X&&n<=H}t.on("moving",(()=>{t.set("originY","center"),e(t)?(et(t),nt(t)):b.show=!1})),t.on("mouseup:before",(n=>{if(b.show=!1,0===n.e.button&&e(t))if(P(t.left,"key",A).includes(t.origin.key))E("repeat");else{const e={data:{time:T(t.left),value:M(t.origin.key,t.top)},...t.origin};x("add",e),_(e)}!function(t){t.setCoords().set({originY:"top",left:t.originLeft,top:t.originTop})}(t)}))}(c),s.push(u,c)})),o(s),k.value.add(...s)}function o(t){const e=t.at(-1),n=(H-X)/2,o=(e.height+e.top-X)/2;t.forEach((t=>{const e=t.top+n-o;t.set({top:e,originTop:e})}))}n(W,O/2),n(V,e)}(),{clickMenu:function({item:t,target:e}){const n={...t.origin};"remove"===t.mode?(x("remove",n),_(n,"remove")):(Object.assign(n,{data:{time:T(t.pointer.x),value:M(t.origin.key,t.pointer.y)}}),x("add",n),_(n))},redrawPoints:tt}}export{k as useBirthProcess};
|
|
@@ -1 +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"
|
|
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{getTime as i}from"../../utils/index.js";import{useEvent as s,useCanvasEvent as n}from"../useEvent.js";import"../temperature/useShadow.js";import"lodash-es";import{useBirthProcess as o}from"./useBirthProcess.js";function d(d,v,c,h){const p=e(),m=e(),f=e(),x=a({show:!1,point:{x:0,y:0},list:[]}),g=a({show:!1,point:{x:0,y:0},list:[],target:null}),w=t((()=>v.data.scaleValues.filter((e=>"left"===e.layout&&e.show)))),y=t((()=>v.data.scaleValues.filter((e=>"right"===e.layout&&e.show)))),V=t((()=>{var e;return(null==(e=y.value)?void 0:e.length)?30:0})),b=t((()=>{var e;return 30+(null==(e=w.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),j=t((()=>{var e;const{width:a}=v.data,t=null==(e=y.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-V.value-t})),A=t((()=>v.data.grid.mainXCell)),C=t((()=>{const e=v.data.grid.mainYCell||14;return v.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),k=t((()=>(j.value-b.value)/A.value)),Y=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&e++,e)),0);return a/(C.value+t)})),P=t((()=>{const{xAxis:e}=v.data,a=Object.values(e).reduce(((e,a)=>(a.show&&"top"===a.position&&e++,e)),0);return Y.value*a})),S=t((()=>{var e;const{scaleValues:a}=v.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!P.value)return P.value;const t=a.find((e=>"cervix"===e.key)),[,l]=(null==t?void 0:t.range)||[0,10],r=(null==t?void 0:t.spaceValue)||1;return H.value-l*r*Y.value})),H=t((()=>{const{xAxis:e,height:a}=v.data,t=Object.values(e).reduce(((e,a)=>(a.show&&"bottom"===a.position&&e++,e)),0);return a-Y.value*t})),X=t((()=>i(v.data.xAxis.time.startTime))),F=t((()=>36e5/k.value)),R=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"cervix"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),W=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"FHR"===e.key));return((null==a?void 0:a.spaceValue)||10)/Y.value})),M=t((()=>{const{scaleValues:e}=v.data,a=e.find((e=>"fetalPresentation"===e.key));return((null==a?void 0:a.spaceValue)||1)/Y.value})),O=t((()=>{var e;return(null==(e=v.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),T=a({canvasWidth:v.data.width,canvasHeight:v.data.height,borderStyle:{...u,...v.data.borderStyle||{}},selectionStyle:v.data.selectionStyle||{},grid:v.data.grid,other:v.data.other,originX:b.value,endX:j.value,originY:P.value,endY:H.value,xCellWidth:k.value,yCellHeight:Y.value,gridXNumber:A.value,gridYNumber:C.value,xAxis:v.data.xAxis,leftScales:w.value,rightScales:y.value,leftAddAreaWidth:30,rightAddAreaWidth:V.value,startTime:X.value,timeXCell:F.value,cervixYCell:R.value,FHRYCell:W.value,fetalPresentationYCell:M.value,scaleValues:v.data.scaleValues,event:O.value,originYCervix:S.value});return l((()=>{r((()=>{const{clickMenu:e,redrawPoints:a}=o(d,T,c,x,g);m.value=a,f.value=e,s(h.value);const{select:t}=n(d,T,c);p.value=t}))})),{propItems:T,redrawPoints:m,select:p,pointTipProps:x,pointMenuProps:g,clickMenu:f}}export{d as useBirthProcessChart};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as t,reactive as e,onMounted as i,nextTick as r}from"vue";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as
|
|
1
|
+
import{ref as t,reactive as e,onMounted as i,nextTick as r}from"vue";import{defaultBorderStyle as o}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{format as a}from"date-fns";import{getChildrenSize as n}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as s,range as d}from"lodash-es";import"../temperature/useShadow.js";import{useTop as l}from"./useTop.js";import{useCenter as p}from"./useCenter.js";function u(u,h,c,m){var f,g;const x=t(),w=t(),y=t(),b=e({show:!1,point:{x:0,y:0},list:[]}),v=e({show:!1,point:{x:0,y:0},list:[],target:null}),C=null!=(f=h.data.left.width)?f:0,H=n(h.data.top.treeData),Y=function(){const{xAxis:t}=h.data;return"top"===t.position?t.height:0}(),j=function(){const t=s(h.data.top.treeData);let e=0;const{cellWidth:i,cellHeight:r}=h.data.top.tree;return function t(o,a=0){o.forEach((o=>{var s;const d={top:e*r+Y,left:a*i,width:i,height:r};if(e++,null==(s=o.children)?void 0:s.length){e--;const i=n(o.children);d.height=i*r,t(o.children,a+1)}else d.width=C-d.left;Object.assign(o,d)}))}(t),t}();console.log(j);const D=function(){const{grid:t}=h.data;return t.mainXCell*t.subXCell}(),M=h.data.top.tree.cellHeight,T=Y+M*H,X=function(){const t=s(h.data.xAxis),{position:e,startTime:i,spaceValue:r,spaceTimeStamp:o}=t,n=Date.parse(i),l=d(D/r+1).map((t=>0===t?i:a(new Date(n+t*o),"yyyy-MM-dd HH:mm:ss")));return{...t,list:l,left:C,top:"top"===e?0:T}}(),A=function(){const{grid:t}=h.data;return t.mainYCell*t.subYCell}(),G=function(){var t;const{width:e,right:i}=h.data;if(!i)return e;return e-(null!=(t=i.width)?t:0)}(),S=h.data.xAxis.height+M*H,N=function(){var t;const{bottom:e=null,height:i}=h.data;if(!e)return i;return i-(null!=(t=e.height)?t:0)}(),P=(G-C)/D,W=(N-S)/A,E=Date.parse((null==(g=h.data.xAxis)?void 0:g.startTime)||a(new Date,"yyyy-MM-dd HH:mm:ss")),O=36e5/P,k=e({canvasWidth:h.data.width,canvasHeight:h.data.height,borderStyle:{...o,...h.data.borderStyle||{}},grid:h.data.grid,top:h.data.top,other:h.data.other,topGridYNumber:H,topGridYCellHeight:M,topGridOriginY:Y,topGridEndY:T,treeData:j,xAxis:X,startTime:E,timeXCell:O,gridXNumber:D,gridYNumber:A,xCellWidth:P,yCellHeight:W,originX:C,endX:G,originY:S,endY:N});return i((async()=>{await r(),l(u,k),p(u,k)})),{propItems:k,redrawPoints:w,select:x,pointTipProps:b,pointMenuProps:v,clickMenu:y}}export{u as useSurgicalAnesthesiaChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as o}from"../useDraw.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"../temperature/useShadow.js";function
|
|
1
|
+
import{fabric as t}from"../../../../../shared/utils/fabricjs/index.js";import{drawText as e,defaultStyle as i,drawTextGroup as o}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"vue";import"../temperature/useShadow.js";function n(n,l){const{grid:d,originX:s,endX:u,xCellWidth:a,gridXNumber:h,top:p,topList:c,canvasWidth:g,borderStyle:f,treeData:m,xAxis:v,topGridYNumber:j,topGridOriginY:b,topGridYCellHeight:x,topGridEndY:G}=l;r(n,{...l,gridYNumber:j,originY:b,yCellHeight:x,endY:G}),function(){const{height:o,list:r,left:l,top:d,spaceValue:s}=v,u=[],h=d+o/2;r.forEach(((t,i)=>{const o=l+i*a*s;u.push(e([o,h],{value:t.slice(11,16)}))}));const p=u.length>0?new t.Group([...u],{...i,objectCaching:!1}):null;p&&n.value.add(p)}(),function(){var e;const r=(null==(e=null==p?void 0:p.tree)?void 0:e.textStyle)||{},l=[];!function t(e){e.forEach((e=>{var i;const{width:n,height:d,left:s,top:u,title:a=""}=e,h={value:a,...r};(null==(i=e.children)?void 0:i.length)?(h.value=a.split("").join("\n"),t(e.children)):h.textAlign="left",l.push(o({width:n,height:d,...f},h,{left:s,top:u},!0))}))}(m);const d=l.length>0?new t.Group([...l],{...i,objectCaching:!1}):null;d&&n.value.add(d)}()}export{n as useTop};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{useShadow as t}from"./useShadow.js";import{drawLine as i,defaultStyle as n,drawPoint as o,drawText as l,drawArrow as s}from"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import{isOneLine as a,getType as u,isOverlapPoint as c,isValidValue as 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
|
+
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,getTime as h,getIndex as v,deleteProperty as g}from"../../utils/index.js";import"@vueuse/core";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 w}from"../../constants/index.js";function j(j,L,k,Y,S,E,$,M,P,O){r(j,L);const{getEqualXTypes:T,handleAddPrevent:A}=y(j,k),{createShadowLines:I}=t(),{left:C,xScaleList:R,xCellWidth:X,yCellHeight:z,originX:D,endX:V,originY:F,endY:_,itemList:G,event:H,vitalSignsOriginY:q,painOriginY:W,hospitalizationDate:B,config:J,canvasHeight:K}=L,N=new Set,Q=["xinmai","mai"],U=new Map,Z=new Set,ee=new Set,te=new Set,ie=m(C.yScaleValue);function ne(t){var i;const o=ie.find((e=>"pulse"===e.type));if(o&&(null==(i=o.dataList)?void 0:i.length)&&(N.size&&j.value.remove(...N),N.clear(),U.size>1)){if(t){const{type:e,key:i}=t.origin||{};if("pulse"===e){const e=U.get(i),n=null==e?void 0:e.findIndex((e=>e[0]===t.left));e.splice(n,1,[t.left,t.top])}}(function(){const e=[],t=[],i=[];for(const e of U)t.push(e[1]),e[0]===Q[0]&&e[1].forEach((e=>{(U.get(Q[1])||[]).findIndex((t=>t[0]===e[0]))>-1&&i.push(e[0])}));const[n,o]=t;let l=[],s=[];return i.forEach((t=>{const i=n.findIndex((e=>e[0]===t)),r=o.findIndex((e=>e[0]===t)),a=n[i],u=o[r],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=I(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)||{}}),N.add(e)})),j.value.add(...e)}N.add(p),j.value.add(p)}))}}function oe(){var e;const t=ie.find((e=>"pulse"===e.type));if(!t||!(null==(e=t.dataList)?void 0:e.length))return;if(!t.dataList.some((e=>e.title.includes("脉搏"))))return;const i=Object.assign({},w,C.overlap||{}),l=[];Z.size&&[...Z].forEach((e=>{[...ee].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((()=>{j.value.add(...l),l.forEach((e=>{null==e||e.bringToFront(),te.add(e)}))}))}function le(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:w=[]}=r,Y=[],E=[],M=[];null==(u=e.list)||u.forEach(((u,O)=>{const T=a(c)?w.find((e=>e.key===u.key)):e,A=ae(u,r),I={};I.value=function(e,t,i){if(!(null==e?void 0:e.length)||!J.showValue)return;const{lineAttr:n={}}=i,o=e[1]<=q.originY+z?e[1]+z:e[1]-z,s=l([e[0],o],{value:t.value,originX:"center",originY:"center",fill:n.stroke||"#000"});return M.push(s),{obj:s,top:-z}}(A,u,T),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,Y;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||{}}),M.push(j);else{const t=e[1]+2*z;L=s([e[0],e[1],t],h.style||{}),M.push(L)}t.rise&&f.show&&f.text&&(k=l([e[0],e[1]-(x?z:0)-5],{value:f.text.split("").join("\n"),originY:"bottom",...f.style||{}}),M.push(k));t.verified&&(Y=l([e[0],e[1]-(x?z:0)-5],{value:"v",originX:"center",originY:"bottom",...v}),M.push(Y));if(p(t.physicsReduce)||p(t.drugReduce)){const l=S(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===K?"bottom":"center"}),b&&M.push(b),w&&M.push(w)}Object.assign(u,{reduceLine:{obj:b,type:"line"},noRiseText:{obj:j,top:5},arrowGroup:{obj:L,top:2*z},riseText:{obj:k,top:(x?-z:0)-5},verifiedText:{obj:Y,top:(x?-z:0)-5},reducePoint:{obj:w,type:"reduce"}})}(A,u,T,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*z,i=[e[1]-z/2,t];t<q.originY&&(t=e[1]+2.5*z,i=[t,e[1]+z/2]),o=s([e[0],i[0],i[1]],m,"up"),M.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]+z/2+o.height:e[1]+z;a=l([e[0],t],i),M.push(a)}+t.value<Math.min(...r.list)&&(a=l([e[0],e[1]-z],i),M.push(a))}Object.assign(n,{upArrow:{obj:o},limitValue:{obj:a,top:-z}})}(A,u,T,I),function(n,l,s,a,u){let p,f;const{pointAttr:h={},lineAttr:v={},title:g="",key:m,type:x="circle"}=a,w=e.list[s+1],S=ae(w,r),M=se(c,e.list[s].value),O=S&&se(c,w.value);!n||!S||l.breakpoint||M||O||n[0]===S[0]||(f=i([...n,...S],{...v}));const T=l.pacemakerShow&&"pulse"==c?y.value:M?0:x,A=E[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,...L.event.hovered?L.event.evented?{selectable:!0}:{selectable:!0,lockMovementY:!0}:L.event,...M?{selectable:!1,evented:!1,...b}:{}};if(A){const e=A.get("y2");p=o(T,{left:A.get("x2"),top:M?e-5:e,...I})}else n&&(I.leftLine=null,p=o(T,{left:n[0],top:M?n[1]-5:n[1],...I}));E.push(f),p&&(g.includes("脉搏")?Z.add(p):ee.add(p),function(e){H.hovered&&(e.on("mouseover",(()=>{re(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?W:q;e.top<t.originY&&e.set("top",t.originY);e.top>t.endY&&e.set("top",t.endY)}(e),function(e){var t,i;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(i=e.rightLine)||i.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:i,type:n="",top:o=0}=t||{};"reduce"!==n&&("line"===n?null==i||i.setCoords().set({x1:e.left,y1:e.top}):null==i||i.setCoords().set({left:e.left,top:e.top+o}))})),ne(e)}(e),H.hovered&&re(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{type:t}=e.origin,i=$(t,e.top),n={...e.origin,data:{...e.origin.data,value:i}};j.value.discardActiveObject(),k("change",n),ce(n,"change")}}))}(p),Y.push(p),te.add(p))}(A,u,O,T,I)})),"pulse"===c&&Q.forEach((e=>{U.set(e,Y.filter((t=>{var i;return(null==(i=t.origin)?void 0:i.key)===e})).map((e=>[e.left,e.top])))})),Promise.all(Y).then((e=>{const t=E.filter((e=>e));let i=null;e=e.map((e=>(e&&i&&(i.nextPoint=e,e.prevPoint=i),i=e||i,e))),Promise.all(M).then((i=>{j.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&&j.value.remove(e.leftLine),e.rightLine&&j.value.remove(e.rightLine))}}(t,e)}))}))}))}function se(e,t){return"pain"===e&&0==t}function re(e,t="moving"){const{title:i,unit:n,type:o,data:l}=e.origin;P.point={x:e.left,y:e.top},P.list=[function(){const{drugReduce:s,physicsReduce:r}=l||{},a="hover"===t?l.value:$(o,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)||E(e.left)).slice(-5)}`],P.show=!0}function ae(e,t){const i="pain"===t.type?W:q;if(f(e)&&function(e){const[t]=R,i=R.at(-1),n=t.start,o=i.end,l=h(e);return l>=n&&l<=o}(e.time)){const n=Y(e.time),o=S(t.type,t.list,e.value);return[n,o<i.originY?i.originY:o>i.endY?i.endY:o]}}function ue(e){const t=new Date,i=`00${t.getMonth()+1}`.slice(-2),n=`00${t.getDate()}`.slice(-2),o=h(`${t.getFullYear()}-${i}-${n} 23:59:59`),l=h(`${E(e)}:00`);return B&&l<h(B)?(A("exceedMin"),!1):!(l>o)||(A("exceedMax"),!1)}function ce(e,t="add"){const{type:i,dataIndex:n,index:o,data:l,key:s}=e,r=ie.find((e=>e.type===i));if("add"===t){const e=a(i)?r.dataList.find((e=>e.enable)):r.dataList[n],t=v(l.time,e.list);e.list.splice(t,0,l)}else r.dataList[n].list[o]=l;pe()}function pe(){var e;te.size&&(null==(e=j.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),Object.values((null==e?void 0:e.otherObj)||{}).forEach((e=>{(null==e?void 0:e.obj)&&t.push(null==e?void 0:e.obj)}))})),t}([...te]))),U.clear(),te.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe()}return U.clear(),Z.clear(),ee.clear(),ie.forEach((e=>{!function(e){if("temperature"!==e.type||!e.positionLine)return;const t=S(e.type,e.list,e.positionLine.value),n=i([D,t,V,t],e.positionLine);j.value.add(n)}(e),e.dataList.forEach(((t,i)=>{a(e.type)&&!t.enable||le(t,i,e)}))})),ne(),oe(),L.event.evented&&j.value.on("mouse:up",(e=>{var t;if(3===e.button){const{x:i=0,y:n=0}=e.pointer||{};if(i>=D&&i<=V&&n>=F&&n<=_){O.point={x:i,y:n},O.show=!0;const{type:o}=(null==(t=e.target)?void 0:t.origin)||{};if(e.target&&["temperature","pain"].includes(o))"temperature"===o&&(O.list=[...x]),"pain"===o&&(O.list=[...b]),O.target=e.target;else{O.target=null,O.list=["新增节点"],G.forEach((t=>{if(!T(i,"_type",X).includes(t.bigType)){const i=["pain"].includes(t.bigType)?W:q;n>=i.originY&&n<=i.endY&&O.list.push({renderItem:M?M(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=ue(i);t&&1!==O.list.length||(O.show=!1,1===O.list.length&&t&&A("repeat"))}}}})),{pointTipProps:P,pointMenuProps:O,clickMenu:function({item:e,target:t}){if(t){const{data:i,type:n,dataIndex:o,index:l}=t.origin,s=g(i,[...x,...b]);s[`${e.type}`]=e.value,a(n)&&(s.key=t.origin.key);const r={...t.origin,data:s};k("change",r),ce(r,"change")}else{const t={data:{time:E(e.pointer.x),value:$(e.origin.type,e.pointer.y),...a(e.origin.type)?{key:e.origin.key}:{}},...e.origin};k("add",t),ce(t)}},setPopup:re,isAddPoint:ue,updateData:ce,redrawPoints:pe}}export{j as useCenter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as e,reactive as t,computed as a,onMounted as l,nextTick as u}from"vue";import{defaultBorderStyle as i}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import{useCumputedPoint as r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import{useTop as p}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w){const C=15,x=e(),D=e(),j=e(),V=t({show:!1,point:{x:0,y:0},list:[]}),X=t({show:!1,point:{x:0,y:0},list:[],target:null}),H=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),P=a((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),I=a((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=a((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=a((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=a((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*q.value})),k=a((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=a((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=a((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+L.value+M.value})),T=a((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*z.value})),q=a((()=>(W.value-k.value)/N.value)),z=a((()=>(G.value-R.value)/O.value)),A=a((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=a((()=>{var e,t;const{top:a,grid:l}=S.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 r=k.value-q.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=q.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+q.value/2,scaleCell:(l-a)/q.value}})))).flat()})),E=a((()=>ie("breathe"))),F=a((()=>ie("pulse"))),J=a((()=>ie("temperature"))),K=a((()=>ie("pain"))),Q=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=a((()=>{const{left:e}=S.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()})),Z=a((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=a((()=>{const{grid:e}=S.data;return-1===Z.value?0:z.value*e.subYCell})),ee=a((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value,t.endY=T.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=a((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=T.value,t.endY=G.value-_.value),t})),ae=a((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=a((()=>{var e;const{left:t,right:a}=S.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})),ue=t({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:P.value,topList:ae.value,breathingHeight:I.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:T.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?z.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{p(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,V,X);D.value=l,j.value=u;const{drawScaleValue:i}=h(Y,ue,b,e,V,re,ne,oe,se,t,a);g(Y,ue,i),f(Y,ue),y(Y,ue,re),n(w.value);const{select:r}=o(Y,ue,b);x.value=r}))})),{propItems:ue,redrawPoints:D,select:x,pointTipProps:V,pointMenuProps:X,clickMenu:j}}export{Y as useTemperatureChart};
|
|
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 r}from"../useCumputedPoint.js";import{useEvent as n,useCanvasEvent as o}from"../useEvent.js";import{setOtherType as s,getFloorNumber as d}from"../../utils/index.js";import"lodash-es";import{format as v,addDays as c}from"date-fns";import{useTop as p}from"./useTop.js";import{useLeft as h}from"./useLeft.js";import{useRight as g}from"./useRight.js";import{useCenter as m}from"./useCenter.js";import{useBottom as f}from"./useBottom.js";import{useOther as y}from"./useOther.js";function Y(Y,S,b,w){const C=15,x=e(),D=e(),j=e(),V=t({show:!1,point:{x:0,y:0},list:[]}),X=t({show:!1,point:{x:0,y:0},list:[],target:null}),H=a((()=>{const{top:e}=S.data;return e.date.show&&(e.date.height||C)||0})),L=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.hospitalDays)?void 0:e.show)&&(t.hospitalDays.height||C)||0})),M=a((()=>{var e;const{top:t}=S.data;return(null==(e=t.operationDays)?void 0:e.show)&&(t.operationDays.height||C)||0})),P=a((()=>{var e,t,a;const{top:l}=S.data;return((null==(e=l.xScalevalue)?void 0:e.show)&&(l.xScalevalue.height||C)||0)+((null==(t=l.xScalevalue)?void 0:t.show)&&null!=(a=l.dayHeight)?a:0)})),I=a((()=>{var e;const{bottom:t}=S.data;return(null==(e=null==t?void 0:t.breathing)?void 0:e.show)&&(t.breathing.height||30)||0})),N=a((()=>{const{grid:e}=S.data;return e.mainXCell*e.subXCell+e.surplusXCell})),O=a((()=>{const{grid:e}=S.data;return e.mainYCell*e.subYCell+e.surplusYCell})),W=a((()=>{var e;const{width:t,right:a=null,top:l}=S.data;if(!a)return t;return t-(null!=(e=a.width)?e:0)})),$=a((()=>{const{grid:e}=S.data;return W.value-e.surplusXCell*q.value})),k=a((()=>{const{top:e,left:t}=S.data;return e.titleWidth+A.value})),G=a((()=>{const{bottom:e=null,height:t}=S.data;if(!e)return t;return t-(e.height||30)})),R=a((()=>{var e;const{top:t}=S.data,a=t.xScalevalue.show&&(null!=(e=t.dayHeight)?e:0)||0,l=t.xScalevalue.show&&(t.xScalevalue.height||C)||0;return H.value+a+l+L.value+M.value})),T=a((()=>{const{grid:e}=S.data;return R.value+e.surplusYCell*z.value})),q=a((()=>(W.value-k.value)/N.value)),z=a((()=>(G.value-R.value)/O.value)),A=a((()=>{var e,t;const{left:a}=S.data;return(null==(e=a.icons)?void 0:e.show)&&((null==(t=a.icons)?void 0:t.width)||100)||0})),B=a((()=>{var e,t;const{top:a,grid:l}=S.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 r=k.value-q.value;const n=a.date.startDate||v(new Date,"yyyy-MM-dd");return u.reduce(((e,t,a)=>0===a?e.concat(n):e.concat(v(c(new Date(n.replace(/-/g,"/")),a),"yyyy-MM-dd"))),[]).map((e=>i.map((t=>{r+=q.value;const a=Date.parse(`${e} ${t.start}`),l=Date.parse(`${e} ${t.end}`);return{start:a,end:l,left:r,center:r+q.value/2,scaleCell:(l-a)/q.value}})))).flat()})),E=a((()=>ie("breathe"))),F=a((()=>ie("pulse"))),J=a((()=>ie("temperature"))),K=a((()=>ie("pain"))),Q=a((()=>{var e;return(null==(e=S.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}})),U=a((()=>{const{left:e}=S.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()})),Z=a((()=>{const{left:e}=S.data;return e.yScaleValue.findIndex((e=>"pain"===e.type))})),_=a((()=>{const{grid:e}=S.data;return-1===Z.value?0:z.value*e.subYCell})),ee=a((()=>{const{left:e}=S.data,t={originY:G.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value,t.endY=T.value+_.value):Z.value===e.yScaleValue.length-1&&(t.originY=G.value-_.value,t.endY=G.value),t})),te=a((()=>{const{left:e}=S.data,t={originY:R.value,endY:G.value};return 0===Z.value&&e.yScaleValue.length>1?(t.originY=T.value+_.value,t.endY=G.value):Z.value===e.yScaleValue.length-1&&(t.originY=T.value,t.endY=G.value-_.value),t})),ae=a((()=>{var e,t;const{top:a,grid:l}=S.data,u=[];for(const i in a)a[i].show&&u.push({...a[i],list:(null==(t=null==(e=a[i].list)?void 0:e.slice)?void 0:t.call(e,0,l.mainXCell))||[],key:i});return u.sort(((e,t)=>e.seq-t.seq))})),le=a((()=>{var e;const{left:t,right:a}=S.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})),ue=t({canvasWidth:S.data.width,canvasHeight:S.data.height,borderStyle:{...i,...S.data.borderStyle||{}},selectionStyle:S.data.selectionStyle||{},dateHeight:H.value,hospitalDaysHeight:L.value,operationDaysHeight:M.value,xScalevalueHeight:P.value,topList:ae.value,breathingHeight:I.value,hospitalizationDate:S.data.hospitalizationDate,grid:S.data.grid,top:S.data.top,left:S.data.left,right:S.data.right,bottom:S.data.bottom,other:S.data.other,painIndex:Z.value,painHeight:_.value,painOriginY:ee.value,vitalSignsOriginY:te.value,gridXNumber:N.value,gridYNumber:O.value,iconsWidth:A.value,originX:k.value,originY:R.value,originYLimit:T.value,endX:W.value,endXLimit:$.value,endY:G.value,xCellWidth:q.value,yCellHeight:z.value,xScaleList:B.value,breatheYCell:E.value,pulseYCell:F.value,temperatureYCell:J.value,painYCell:K.value,event:Q.value,itemList:U.value,getRightInfo:le.value,config:S.data.config||{}});function ie(e){const{yScaleValue:t}=S.data.left,a=t.find((t=>t.type===e)),l=(null==a?void 0:a.list)||[];return l.length?z.value/((l[1]-l[0])/a.spaceGridNumber):0}const{cumputedX:re,cumputedY:ne,getXValue:oe,getYValue:se}=r(ue);return l((()=>{u((()=>{p(Y,ue);const{setPopup:e,isAddPoint:t,updateData:a,redrawPoints:l,clickMenu:u}=m(Y,ue,b,re,ne,oe,se,S.addRenderItem,V,X);D.value=l,j.value=u;const{drawScaleValue:i}=h(Y,ue,b,e,V,re,ne,oe,se,t,a);g(Y,ue,i),f(Y,ue),y(Y,ue,re),n(w.value);const{select:r}=o(Y,ue,b);x.value=r}))})),{propItems:ue,redrawPoints:D,select:x,pointTipProps:V,pointMenuProps:X,clickMenu:j}}export{Y as useTemperatureChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{format as n}from"date-fns";import{getFloorNumber as e}from"../utils/index.js";function
|
|
1
|
+
import{format as n}from"date-fns";import{getTime as t,getFloorNumber as e}from"../utils/index.js";function i(i){const{xScaleList:r,xCellWidth:u,left:l,vitalSignsOriginY:c,painOriginY:o,canvasWidth:d}=i;return{cumputedX:function(n,e=!1){const i=t(n),[u]=r,l=r.at(-1);if(i<u.start)return 0;if(i>l.end)return d;const c=r.findIndex((n=>n.end>=i));if(c>-1){return r[c].center}},cumputedY:function(n,t,e){const r=i[`${n}YCell`],u=+e-Math.min(...t);return("pain"===n?o.endY:c.endY)-r*u},getXValue:function(t){const e=r.findIndex((n=>n.left+u>=t));if(e>-1){const i=r[e],u=t-i.left,l=i.scaleCell*u,c=i.start+l;return n(new Date(c),"yyyy-MM-dd HH:mm")}},getYValue:function(n,t){var r;const u=i[`${n}YCell`],d=(null==(r=l.yScaleValue.find((t=>t.type===n)))?void 0:r.list)||[],a=d.length?Math.min(...d):0,f="pain"===n?o.endY:c.endY;return e((f-t)/u+a)}}}function r(i){const{xAxis:r,originX:u,originY:l,xCellWidth:c,endY:o,timeXCell:d,startTime:a,scaleValues:f}=i;return{cumputedX:function(n){return(t(n)-a)/d+u},cumputedY:function(n,t,e){const[r]=t;return o-(+e-r)/i[`${n}YCell`]},getXValue:function(t){return n(new Date((t-u)*d+a),"yyyy-MM-dd HH:mm")},getYValue:function(n,t){const r=f.find((t=>n===t.key)),[u]=(null==r?void 0:r.range)||[0],l=(o-t)*i[`${n}YCell`]+u;return e(l)}}}export{r as useBirthProcessCumputedPoint,i as useCumputedPoint};
|
|
@@ -15,3 +15,4 @@ export declare function isValidValue(value: number | string): boolean;
|
|
|
15
15
|
export declare function isOverlapPoint(pointObj1: any, pointObj2: any): boolean;
|
|
16
16
|
export declare function getFloorNumber(value: number, n?: number): number;
|
|
17
17
|
export declare function getChildrenSize(treeData: ITreeItem[]): number;
|
|
18
|
+
export declare function getTime(value: number | string): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNull as n}from"lodash-es";function
|
|
1
|
+
import{isNull as n,isNumber as t}from"lodash-es";function e(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function r(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function u(n,t){const e=t.findIndex((t=>d(t.time)>d(n)));return~e?e:t.length}function o(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function l(n){return n.includes("_other")?n.split("_")[0]:n}function c(t){return!Number.isNaN(+t)&&!n(t)}function f(n,t){return a(n.left,1)===a(t.left,1)&&Math.abs(a(n.top,1)-a(t.top,1))<=2}function a(n,t=100){return Math.floor(n*t)/t}function s(n){let t=0;return n.forEach((n=>{var e;(null==(e=n.children)?void 0:e.length)?t+=s(n.children):t++})),t}function d(n){return n?t(n)?new Date(n).getTime():Date.parse(n.replace(/-/g,"/")):Date.now()}export{r as deleteProperty,s as getChildrenSize,a as getFloorNumber,u as getIndex,d as getTime,l as getType,e as isEffectiveNode,o as isOneLine,f as isOverlapPoint,c as isValidValue,i as setOtherType};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyncHook } from '../../../../../../es/shared/utils/tapable';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import { AbstractSetupHooks, IhoTableConfig, IhoTableFieldItem, IhoTableHandlerContext } from '../../../../../../es/components/iho-table';
|
|
3
|
+
import { AbstractSetupHooks, IhoTableConfig, IhoTableFieldItem, IhoTableHandlerContext } from '../../../../../../es/components/iho-table/src/types';
|
|
4
4
|
declare class SetupHooks extends AbstractSetupHooks {
|
|
5
5
|
readonly setup: SyncHook<[Ref<IhoTableConfig>, Ref<IhoTableFieldItem[]>, IhoTableHandlerContext<true>], void, import("../../../../../../es/shared/utils/tapable").UnsetAdditionalOptions>;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import s from"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import
|
|
1
|
+
import s from"../../../../../shared/utils/tapable/SyncHook.js";import"../../../../../shared/utils/tapable/SyncBailHook.js";import"../../../../../shared/utils/tapable/SyncWaterfallHook.js";import"../../../../../shared/utils/tapable/SyncLoopHook.js";import"../../../../../shared/utils/tapable/AsyncParallelHook.js";import"../../../../../shared/utils/tapable/AsyncParallelBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesBailHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js";import"../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js";import{AbstractSetupHooks as t}from"../../types/pluginType.js";class e extends t{constructor(){super(...arguments),this.setup=new s(["config","fieldList","context"])}}function o(){return{create:function(){return new e}}}export{o as useSetupHooks};
|