cnhis-design-vue 3.1.45-beta.5 → 3.1.45-beta.7
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/annotation-edit/src/AnnotationEdit.js +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/fabric-chart/index.d.ts +40 -5
- package/es/components/fabric-chart/src/FabricChart.vue.d.ts +40 -5
- package/es/components/fabric-chart/src/hooks/birthProcess/useBirthProcess.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.d.ts +2 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/index.js +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useCenter.js +1 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts +20 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js +1 -1
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.d.ts +4 -0
- package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useTop.js +1 -0
- package/es/components/fabric-chart/src/hooks/useGrid.d.ts +1 -1
- package/es/components/fabric-chart/src/hooks/useGrid.js +1 -1
- package/es/components/fabric-chart/src/interface.d.ts +4 -0
- package/es/components/fabric-chart/src/utils/index.d.ts +2 -1
- package/es/components/fabric-chart/src/utils/index.js +1 -1
- package/es/components/form-config/index.d.ts +56 -2
- package/es/components/form-config/src/FormConfig.vue.d.ts +56 -2
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +28 -1
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +28 -1
- package/es/components/form-render/index.d.ts +28 -1
- package/es/components/form-render/src/FormRender.vue.d.ts +28 -1
- package/es/components/form-render/src/FormRender.vue2.js +1 -1
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +28 -1
- package/es/components/form-render/src/constants/index.d.ts +2 -0
- package/es/components/form-render/src/constants/index.js +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormAsyncQueue.js +1 -1
- package/es/components/form-render/src/hooks/useFormContext.js +1 -1
- package/es/components/form-render/src/hooks/useFormRenderLifeCycle.d.ts +3 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.d.ts +1 -1
- package/es/components/form-render/src/hooks/useFormRenderOptions.js +1 -1
- package/es/components/form-render/src/types/index.d.ts +2 -0
- package/es/components/info-header/index.d.ts +64 -2
- package/es/components/info-header/src/InfoHeader.vue.d.ts +64 -2
- package/es/components/info-header/src/components/infoDescription/index.vue.d.ts +28 -1
- package/es/components/info-header/src/components/patientInfo/index.vue.d.ts +28 -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 +0 -6
- package/es/components/shortcut-setter/index.d.ts +28 -1
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +28 -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/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/hooks/useAsyncQueue.d.ts +3 -1
- package/es/shared/hooks/useAsyncQueue.js +1 -1
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
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,computed as o,ref as a,onDeactivated as t,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),
|
|
1
|
+
import{defineComponent as e,computed as o,ref as a,onDeactivated as t,createVNode as l,unref as u,createTextVNode as n}from"vue";import{useTheme as i}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import{isString as r,isObject as s,isFunction as m}from"lodash-es";import{FileTrayFull as d,FileTray as v}from"@vicons/ionicons5";import{NPopover as c,NDivider as p,NEllipsis as f,NIcon as V,NInput as h}from"naive-ui";var g=e({props:{modelValue:{type:[String,Object],default:""}},emits:["update:modelValue"],setup(e,{emit:g}){const w=i(),x=o({get:()=>r(e.modelValue)?e.modelValue:s(e.modelValue)&&e.modelValue.content||"",set(o){let a=o;s(e.modelValue)&&(a={...e.modelValue,content:o}),g("update:modelValue",a)}}),T=a(!1),k=o({get:()=>T.value,async set(e){T.value=e,!e&&b.value&&(await new Promise((e=>setTimeout(e,200))),b.value=!1)}}),b=a(!1);let y,_;function P(e){e.stopPropagation(),clearTimeout(y),k.value&&b.value?k.value=!1:u(x)||(y=setTimeout((()=>{b.value=k.value=!0}),200))}function M(e){e.stopPropagation(),clearTimeout(y),u(x)&&(k.value=!0,b.value=!0)}function R(e){e.stopPropagation(),clearTimeout(_),u(x)&&(k.value=!0)}function j(e){e.stopPropagation(),clearTimeout(_),u(x)&&!b.value&&(_=setTimeout((()=>{k.value=!1}),300))}return t((()=>{k.value=!1})),function(){return l("section",{class:["annotation-edit",{"is-active":!!u(x)}],style:{"--icon-right":"-5",...w.value},"annotation-hover-show":!u(x)&&!b.value},[l(c,{"keep-alive-on-hover":!0,style:{maxWidth:"360px",wordBreak:"break-all"},show:k.value,"onUpdate:show":e=>k.value=e,trigger:"manual",duration:100,onClickoutside:P},{default:function(){return l("section",{onMouseleave:j,onMouseenter:R},[l("div",null,[b.value?l(h,{resizable:!1,autosize:{minRows:3,maxRows:5},"show-count":!0,class:"annotation-edit__textarea",type:"textarea",value:x.value,"onUpdate:value":e=>x.value=e},null):l("span",null,[u(x)])]),s(e.modelValue)?[l(p,{style:{margin:"4px 0",minWidth:"360px"}},null),l("section",{class:"annotation-edit__footer"},[m(e.modelValue.footerRender)?e.modelValue.footerRender(e.modelValue):[l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.authorLabel)?o:"质控人",n(": "),e.modelValue.author]}}),l(f,null,{default:()=>{var o;return[null!=(o=e.modelValue.dateLabel)?o:"质控时间",n(": "),e.modelValue.date]}})]])]:null])},trigger:function(){return l("div",{class:"annotation-edit__icon",onMouseleave:j,onMouseenter:R,onDblclick:M,onClick:P},[l(V,{component:u(x)?d:v},null)])}})])}}});export{g as default};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/Viewer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'bpmn-js/lib/features/modeling';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module 'diagram-js/lib/navigation/movecanvas';
|
|
@@ -35,13 +35,48 @@ declare const FabricChart: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
35
35
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
|
36
36
|
canvas: import("vue").Ref<any>;
|
|
37
37
|
propItems: any;
|
|
38
|
-
redrawPoints: any
|
|
39
|
-
select: any
|
|
40
|
-
pointTipProps:
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
redrawPoints: import("vue").Ref<any>;
|
|
39
|
+
select: import("vue").Ref<any>;
|
|
40
|
+
pointTipProps: {
|
|
41
|
+
show: boolean;
|
|
42
|
+
point: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
};
|
|
46
|
+
list: string[];
|
|
47
|
+
};
|
|
48
|
+
pointMenuProps: {
|
|
49
|
+
show: boolean;
|
|
50
|
+
point: {
|
|
51
|
+
x: number;
|
|
52
|
+
y: number;
|
|
53
|
+
};
|
|
54
|
+
list: any[];
|
|
55
|
+
target: any;
|
|
56
|
+
};
|
|
57
|
+
clickMenu: import("vue").Ref<any>;
|
|
43
58
|
init: () => {
|
|
44
59
|
propItems: any;
|
|
60
|
+
redrawPoints: import("vue").Ref<any>;
|
|
61
|
+
select: import("vue").Ref<any>;
|
|
62
|
+
pointTipProps: {
|
|
63
|
+
show: boolean;
|
|
64
|
+
point: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
};
|
|
68
|
+
list: string[];
|
|
69
|
+
};
|
|
70
|
+
pointMenuProps: {
|
|
71
|
+
show: boolean;
|
|
72
|
+
point: {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
};
|
|
76
|
+
list: any[];
|
|
77
|
+
target: any;
|
|
78
|
+
};
|
|
79
|
+
clickMenu: import("vue").Ref<any>;
|
|
45
80
|
};
|
|
46
81
|
PopupTip: import("vue").DefineComponent<{
|
|
47
82
|
show: {
|
|
@@ -37,13 +37,48 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
37
|
canvasRef: import("vue").Ref<HTMLCanvasElement | null>;
|
|
38
38
|
canvas: import("vue").Ref<any>;
|
|
39
39
|
propItems: any;
|
|
40
|
-
redrawPoints: any
|
|
41
|
-
select: any
|
|
42
|
-
pointTipProps:
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
redrawPoints: import("vue").Ref<any>;
|
|
41
|
+
select: import("vue").Ref<any>;
|
|
42
|
+
pointTipProps: {
|
|
43
|
+
show: boolean;
|
|
44
|
+
point: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
list: string[];
|
|
49
|
+
};
|
|
50
|
+
pointMenuProps: {
|
|
51
|
+
show: boolean;
|
|
52
|
+
point: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
};
|
|
56
|
+
list: any[];
|
|
57
|
+
target: any;
|
|
58
|
+
};
|
|
59
|
+
clickMenu: import("vue").Ref<any>;
|
|
45
60
|
init: () => {
|
|
46
61
|
propItems: any;
|
|
62
|
+
redrawPoints: import("vue").Ref<any>;
|
|
63
|
+
select: import("vue").Ref<any>;
|
|
64
|
+
pointTipProps: {
|
|
65
|
+
show: boolean;
|
|
66
|
+
point: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
};
|
|
70
|
+
list: string[];
|
|
71
|
+
};
|
|
72
|
+
pointMenuProps: {
|
|
73
|
+
show: boolean;
|
|
74
|
+
point: {
|
|
75
|
+
x: number;
|
|
76
|
+
y: number;
|
|
77
|
+
};
|
|
78
|
+
list: any[];
|
|
79
|
+
target: any;
|
|
80
|
+
};
|
|
81
|
+
clickMenu: import("vue").Ref<any>;
|
|
47
82
|
};
|
|
48
83
|
PopupTip: import("vue").DefineComponent<{
|
|
49
84
|
show: {
|
|
@@ -1 +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:
|
|
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:P,handleAddPrevent:M}=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,P=e.data[d+1],M=ne(P,e);if(s&&M&&!f.breakpoint)h=t([...s,...M],{...m});else if(s&&!M&&!f.breakpoint){const n=ne(P,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,"birthProcess"),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 P=new e.Rect({...s,strokeWidth:.5,width:p,height:A,left:j,top:A/2}),M=o([j,Y>0?Y-W/2:W/2],{value:String(h),...i,...g}),E=new e.Group([...T,...b,P,...M?[M]:[]],{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(!P(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,M("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(P(e.left,"key",X).includes(e.origin.key))M("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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useTop}from"./useTop.js";export{useCenter}from"./useCenter.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../useDraw.js";import{useGrid as r}from"../useGrid.js";import"date-fns";import"lodash-es";import"@vueuse/core";import"../../../../../shared/utils/fabricjs/index.js";import"vue";import"../temperature/useShadow.js";function e(e,o){r(e,o)}export{e as useCenter};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.d.ts
CHANGED
|
@@ -3,4 +3,24 @@ import { fabric } from '../../../../../../es/shared/utils/fabricjs';
|
|
|
3
3
|
import { AnyObject } from '../../../../../../es/shared/types';
|
|
4
4
|
export declare function useSurgicalAnesthesiaChart(canvas: Ref<fabric.Canvas>, props: AnyObject, emits: Function, canvasRef: Ref<HTMLCanvasElement | null>): {
|
|
5
5
|
propItems: any;
|
|
6
|
+
redrawPoints: Ref<any>;
|
|
7
|
+
select: Ref<any>;
|
|
8
|
+
pointTipProps: {
|
|
9
|
+
show: boolean;
|
|
10
|
+
point: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
list: string[];
|
|
15
|
+
};
|
|
16
|
+
pointMenuProps: {
|
|
17
|
+
show: boolean;
|
|
18
|
+
point: {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
};
|
|
22
|
+
list: any[];
|
|
23
|
+
target: any;
|
|
24
|
+
};
|
|
25
|
+
clickMenu: Ref<any>;
|
|
6
26
|
};
|
package/es/components/fabric-chart/src/hooks/surgicalAnesthesia/useSurgicalAnesthesiaChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ref as t,reactive as e,
|
|
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 n}from"date-fns";import{getChildrenSize as a}from"../../utils/index.js";import"@vueuse/core";import{cloneDeep as s,range as l}from"lodash-es";import"../temperature/useShadow.js";import{useCenter as d}from"./useCenter.js";function u(u,c,h,p){var m;const g=t(),f=t(),x=t(),w=e({show:!1,point:{x:0,y:0},list:[]}),b=e({show:!1,point:{x:0,y:0},list:[],target:null}),y=null!=(m=c.data.left.width)?m:0,v=a(c.data.top.treeData),Y=function(){const{xAxis:t}=c.data;return"top"===t.position?t.height:0}(),C=function(){console.log(y);const t=s(c.data.top.treeData);let e=0;const{cellWidth:i,cellHeight:r}=c.data.top.tree;return function t(o,n=0){o.forEach((o=>{var s;const l={top:e*r+Y,left:n*i,width:i,height:r};if(e++,null==(s=o.children)?void 0:s.length){e--;const i=a(o.children);l.height=i*r,t(o.children,n+1)}else l.width=y-l.left;Object.assign(o,l)}))}(t),t}();console.log(C);const j=function(){const{grid:t}=c.data;return t.mainXCell*t.subXCell}(),H=c.data.top.tree.cellHeight,D=Y+H*v,X=function(){const t=s(c.data.xAxis),{position:e,startTime:i,spaceValue:r,spaceTimeStamp:o}=t,a=Date.parse(i),d=l(j/r+1).map((t=>0===t?i:n(new Date(a+t*o),"yyyy-MM-dd HH:mm:ss")));return{...t,list:d,left:y,top:"top"===e?0:D}}(),A=function(){const{grid:t}=c.data;return t.mainYCell*t.subYCell}(),G=function(){var t;const{width:e,right:i}=c.data;if(!i)return e;return e-(null!=(t=i.width)?t:0)}(),M=c.data.xAxis.height+H*v,S=function(){var t;const{bottom:e=null,height:i}=c.data;if(!e)return i;return i-(null!=(t=e.height)?t:0)}(),N=(G-y)/j,P=(S-M)/A,T=e({canvasWidth:c.data.width,canvasHeight:c.data.height,borderStyle:{...o,...c.data.borderStyle||{}},grid:c.data.grid,other:c.data.other,topGridYNumber:v,topGridYCellHeight:H,topGridOriginY:Y,topGridEndY:D,treeData:C,xAxis:X,gridXNumber:j,gridYNumber:A,xCellWidth:N,yCellHeight:P,originX:y,endX:G,originY:M,endY:S});return i((async()=>{await r(),d(u,T)})),{propItems:T,redrawPoints:f,select:g,pointTipProps:w,pointMenuProps:b,clickMenu:x}}export{u as useSurgicalAnesthesiaChart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(o,n){console.log("top")}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 declare function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject,
|
|
4
|
+
export declare function useGrid(canvas: Ref<fabric.Canvas>, propItems: AnyObject, type?: string): void;
|
|
@@ -1 +1 @@
|
|
|
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
|
+
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="temperature"){var r,o,u,d;const{gridYNumber:a,originY:c,grid:b,originX:S,endX:m,xCellWidth:p,yCellHeight:y,gridXNumber:h,endY:f,borderStyle:g}=s,v=[],C=[],L=new Set;for(let e=0;e<=a;e++){const l=c+parseInt(String(y*(a-e)));if("birthProcess"===t){const e=n([S,l,m,l],{...g,...(null==(r=b.mainLineStyle)?void 0:r.x)||{}});v.push(e)}else{const i=e%b.subYCell==0?(null==(o=b.mainLineStyle)?void 0:o.x)||{}:b.subLineStyle||{},s=n([S,l,m,l],i);e%b.subYCell==0?L.add(s):v.push(s)}}for(let e=0;e<=h;e++){const l=S+parseInt(String(p*e));if("birthProcess"===t){const e=n([l,c,l,f],{...g,...(null==(u=b.mainLineStyle)?void 0:u.y)||{}});C.push(e)}else{let i=b.subLineStyle||{};e%b.subSecondXCell==0&&(i=b.subSecondLineStyle||{}),e%b.subXCell==0&&(i=0!==e&&e!==h?(null==(d=b.mainLineStyle)?void 0:d.y)||{}:g);const s=n([l,c,l,f],i);e%b.subXCell==0&&0!==e&&e!==h?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,4 +1,4 @@
|
|
|
1
|
-
import { IPoint } from '../interface';
|
|
1
|
+
import { IPoint, ITreeItem } from '../interface';
|
|
2
2
|
import { AnyObject } from '../../../../../es/shared/types';
|
|
3
3
|
export declare function isEffectiveNode(node: IPoint): string | number | boolean;
|
|
4
4
|
export declare function deleteProperty(data: AnyObject, list: AnyObject[]): {};
|
|
@@ -14,3 +14,4 @@ export declare function getType(type: string): string;
|
|
|
14
14
|
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
|
+
export declare function getChildrenSize(treeData: ITreeItem[]): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isNull as n}from"lodash-es";function t(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function e(n,t){const e={};for(const
|
|
1
|
+
import{isNull as n}from"lodash-es";function t(n){return(null==n?void 0:n.time)&&((null==n?void 0:n.value)||0===(null==n?void 0:n.value))}function e(n,t){const e={};for(const r in n)t.map((n=>n.type)).includes(r)||(e[r]=n[r]);return e}function r(n,t){const e=t.findIndex((t=>new Date(t.time).getTime()>new Date(n).getTime()));return~e?e:t.length}function u(n){return["temperature","pulse"].includes(n)}function i(n,t){return n.includes("心率")?"pulse_other":t}function o(n){return n.includes("_other")?n.split("_")[0]:n}function l(t){return!Number.isNaN(+t)&&!n(t)}function c(n,t){return f(n.left,1)===f(t.left,1)&&Math.abs(f(n.top,1)-f(t.top,1))<=2}function f(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}export{e as deleteProperty,s as getChildrenSize,f as getFloorNumber,r as getIndex,o as getType,t as isEffectiveNode,u as isOneLine,c as isOverlapPoint,l as isValidValue,i as setOtherType};
|