cnhis-design-vue 3.2.12-release.1 → 3.2.13-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +10 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +11 -1
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.d.ts +6 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -1
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatMain.js +1 -1
- package/es/components/ai-chat/src/types/index.d.ts +4 -1
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +29 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +3 -0
- 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/temperature/useCenter.js +1 -1
- package/es/components/fabric-chart/src/hooks/useDraw.js +1 -1
- package/es/components/iho-chat/src/components/ChatFooter.vue2.js +1 -1
- package/es/components/iho-chat/src/components/ChatMain.vue2.js +1 -1
- package/es/components/iho-chat/src/components/PersonProfile.vue2.js +1 -1
- package/es/components/iho-table/index.d.ts +29 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +30 -0
- package/es/components/iho-table/src/IhoTable.vue2.js +1 -1
- package/es/components/iho-table/src/plugins/crossHeaderPlugin.d.ts +1 -0
- package/es/components/iho-table/src/plugins/crossHeaderPlugin.js +1 -0
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/widgets/defaultRendererPlugin.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.d.ts +5 -5
- package/es/components/iho-table/src/plugins/verticalTablePlugin/src/utils.js +1 -1
- package/es/components/iho-table/src/types/index.d.ts +14 -0
- 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/scale-view/src/ScaleView.vue2.js +1 -1
- package/es/components/select-label/src/LabelFormContent.vue2.js +1 -1
- package/es/components/template-render/index.d.ts +60 -0
- package/es/components/template-render/index.js +1 -0
- package/es/components/template-render/src/TemplateRender.vue.d.ts +62 -0
- package/es/components/template-render/src/TemplateRender.vue.js +1 -0
- package/es/components/template-render/src/TemplateRender.vue2.js +1 -0
- package/es/components/template-render/src/components/Box.vue.d.ts +44 -0
- package/es/components/template-render/src/components/Box.vue.js +1 -0
- package/es/components/template-render/src/components/Box.vue2.js +1 -0
- package/es/components/template-render/src/components/Button.vue.d.ts +49 -0
- package/es/components/template-render/src/components/Button.vue.js +1 -0
- package/es/components/template-render/src/components/Button.vue2.js +1 -0
- package/es/components/template-render/src/components/Divider.vue.d.ts +26 -0
- package/es/components/template-render/src/components/Divider.vue.js +1 -0
- package/es/components/template-render/src/components/Divider.vue2.js +1 -0
- package/es/components/template-render/src/components/Field.vue.d.ts +56 -0
- package/es/components/template-render/src/components/Field.vue.js +1 -0
- package/es/components/template-render/src/components/Field.vue2.js +1 -0
- package/es/components/template-render/src/components/FieldGroup.vue.d.ts +50 -0
- package/es/components/template-render/src/components/FieldGroup.vue.js +1 -0
- package/es/components/template-render/src/components/FieldGroup.vue2.js +1 -0
- package/es/components/template-render/src/components/Image.vue.d.ts +52 -0
- package/es/components/template-render/src/components/Image.vue.js +1 -0
- package/es/components/template-render/src/components/Image.vue2.js +1 -0
- package/es/components/template-render/src/components/Label.vue.d.ts +42 -0
- package/es/components/template-render/src/components/Label.vue.js +1 -0
- package/es/components/template-render/src/components/Label.vue2.js +1 -0
- package/es/components/template-render/src/components/Row.vue.d.ts +47 -0
- package/es/components/template-render/src/components/Row.vue.js +1 -0
- package/es/components/template-render/src/components/Row.vue2.js +1 -0
- package/es/components/template-render/src/components/Slot.d.ts +27 -0
- package/es/components/template-render/src/components/Slot.js +1 -0
- package/es/components/template-render/src/components/Text.vue.d.ts +40 -0
- package/es/components/template-render/src/components/Text.vue.js +1 -0
- package/es/components/template-render/src/components/Text.vue2.js +1 -0
- package/es/components/template-render/src/components/index.d.ts +529 -0
- package/es/components/template-render/src/components/index.js +1 -0
- package/es/components/template-render/src/constants/index.d.ts +16 -0
- package/es/components/template-render/src/constants/index.js +1 -0
- package/es/components/template-render/src/hooks/useCommon.d.ts +10 -0
- package/es/components/template-render/src/hooks/useCommon.js +1 -0
- package/es/components/template-render/src/utils/index.d.ts +6 -0
- package/es/components/template-render/src/utils/index.js +1 -0
- package/es/components/template-render/style/index.css +1 -0
- package/es/env.d.ts +25 -25
- package/es/shared/assets/img/ai__avatar.png.js +1 -1
- package/es/shared/assets/img/defaultCover/10review_successful.png.js +1 -1
- package/es/shared/assets/img/defaultCover/11review_fail.png.js +1 -1
- package/es/shared/assets/img/defaultCover/12no_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/13no_menu_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/14no_call_setting.png.js +1 -1
- package/es/shared/assets/img/defaultCover/15no_use_tag.png.js +1 -1
- package/es/shared/assets/img/defaultCover/16no_table_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/1location.png.js +1 -1
- package/es/shared/assets/img/defaultCover/2notfound.png.js +1 -1
- package/es/shared/assets/img/defaultCover/3loading.png.js +1 -1
- package/es/shared/assets/img/defaultCover/4no_permission.png.js +1 -1
- package/es/shared/assets/img/defaultCover/5no_data.png.js +1 -1
- package/es/shared/assets/img/defaultCover/6no_network.png.js +1 -1
- package/es/shared/assets/img/defaultCover/7no_doctor.png.js +1 -1
- package/es/shared/assets/img/defaultCover/8system_error.png.js +1 -1
- package/es/shared/assets/img/defaultCover/9system_upgrade.png.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/logo.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/table_style_2.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/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/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
|
+
```
|
@@ -33,6 +33,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
33
33
|
queryPrompt: {
|
34
34
|
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
35
35
|
};
|
36
|
+
patientInfo: {
|
37
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
38
|
+
};
|
36
39
|
}, {
|
37
40
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
38
41
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -69,6 +72,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
69
72
|
queryPrompt: {
|
70
73
|
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
71
74
|
};
|
75
|
+
patientInfo: {
|
76
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
77
|
+
};
|
72
78
|
}>> & {
|
73
79
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
74
80
|
}>>;
|
@@ -108,6 +114,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
108
114
|
children?: any[] | undefined;
|
109
115
|
}[]>;
|
110
116
|
showPrompt: import("vue").Ref<boolean>;
|
117
|
+
currentShortcutId: import("vue").Ref<string>;
|
111
118
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
112
119
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
113
120
|
recorderStart: () => Promise<void>;
|
@@ -210,6 +217,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
210
217
|
queryPrompt: {
|
211
218
|
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
212
219
|
};
|
220
|
+
patientInfo: {
|
221
|
+
type: import("vue").PropType<import("../../shared/types").AnyObject>;
|
222
|
+
};
|
213
223
|
}>> & {
|
214
224
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
215
225
|
}, {
|
@@ -35,6 +35,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
35
35
|
queryPrompt: {
|
36
36
|
type: PropType<QueryPrompt>;
|
37
37
|
};
|
38
|
+
patientInfo: {
|
39
|
+
type: PropType<AnyObject>;
|
40
|
+
};
|
38
41
|
}, {
|
39
42
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
40
43
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -71,6 +74,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
71
74
|
queryPrompt: {
|
72
75
|
type: PropType<QueryPrompt>;
|
73
76
|
};
|
77
|
+
patientInfo: {
|
78
|
+
type: PropType<AnyObject>;
|
79
|
+
};
|
74
80
|
}>> & {
|
75
81
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
76
82
|
}>>;
|
@@ -85,7 +91,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
85
91
|
} | {}>;
|
86
92
|
ChatFooter: import("vue").DefineComponent<{}, {
|
87
93
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
88
|
-
audioSdk: import("
|
94
|
+
audioSdk: import("../../../components/index").CAudioSDK;
|
89
95
|
emit: (event: string, ...args: any[]) => void;
|
90
96
|
shortcutList: any;
|
91
97
|
state: any;
|
@@ -110,6 +116,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
110
116
|
children?: any[] | undefined;
|
111
117
|
}[]>;
|
112
118
|
showPrompt: import("vue").Ref<boolean>;
|
119
|
+
currentShortcutId: import("vue").Ref<string>;
|
113
120
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
114
121
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
115
122
|
recorderStart: () => Promise<void>;
|
@@ -212,6 +219,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
212
219
|
queryPrompt: {
|
213
220
|
type: PropType<QueryPrompt>;
|
214
221
|
};
|
222
|
+
patientInfo: {
|
223
|
+
type: PropType<AnyObject>;
|
224
|
+
};
|
215
225
|
}>> & {
|
216
226
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
217
227
|
}, {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as
|
1
|
+
import{defineComponent as e,reactive as t,provide as o,toRefs as r,computed as s,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as p,createVNode as u,createBlock as d,createCommentVNode as l}from"vue";import c from"./components/ChatMain.js";import h from"./components/ChatFooter.vue.js";import{useTheme as y}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import{useFormRequest as f}from"../../../shared/hooks/useFormRequest/index.js";import{uuidGenerator as j}from"../../../shared/utils/index.js";import"@vueuse/shared";import"../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import"naive-ui";import"../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as v,InjectionAIChatEmits as x}from"./types/index.js";import S from"axios";import"../../index.js";const g=["id"];var k=e({__name:"Index",props:{userAvatar:{type:String},defaultShortcutList:{type:Array},shortcutList:{type:Array},queryData:{type:Function,reuired:!0},queryRecord:{type:Function,reuired:!0},hideInput:{type:Boolean},uiStyle:{type:String},audioTimed:{type:Number,default:10},commandList:{type:Array},queryPrompt:{type:Function},patientInfo:{type:Object}},emits:["button-click"],setup(e,{expose:k,emit:C}){const F=e;f().registGlobHttpInstance(S.create());const I=y(),b=t({id:"ai-chat-"+j(),loading:!1,sending:!1,sendContent:"",selectedCommand:null,selectedPrompt:null,externalData:null});return o(v,{...r(F),state:b,isSmall:s((()=>"small"===F.uiStyle))}),o(x,C),k({pushMessage:e=>{b.externalData=e}}),(t,o)=>(i(),a("div",{id:b.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(p(I))},[u(p(c)),e.hideInput?l("v-if",!0):(i(),d(h,{key:0}))],14,g))}});export{k as default};
|
@@ -5,11 +5,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
type: PropType<MessageItem>;
|
6
6
|
default: () => {};
|
7
7
|
};
|
8
|
+
instructionId: {
|
9
|
+
type: StringConstructor;
|
10
|
+
};
|
8
11
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
9
12
|
msgItem: {
|
10
13
|
type: PropType<MessageItem>;
|
11
14
|
default: () => {};
|
12
15
|
};
|
16
|
+
instructionId: {
|
17
|
+
type: StringConstructor;
|
18
|
+
};
|
13
19
|
}>> & {
|
14
20
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
15
21
|
}, {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as t,
|
1
|
+
import{defineComponent as e,inject as t,ref as n,createVNode as i}from"vue";import{NButton as o}from"naive-ui";import{InjectionAIChat as l}from"../types/index.js";import"../../../index.js";import{isArray as a}from"lodash-es";import s from"../../../form-render/index.js";import r from"../../../template-render/index.js";var d=e({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},instructionId:{type:String}},emits:["button-click"],setup(e,{attrs:d,slots:u,emit:c}){const{patientInfo:m,state:p}=t(l),f=n([]),g=n();function v(e){try{return JSON.parse(e),!0}catch(e){return!1}}const y=e.msgItem.content;function b(e){const{eventName:t,data:n}=e;t&&c("button-click",{fieldItem:n,isBI:!0})}function h(e){y.data[e.id+"Disabled"]=!0,c("button-click")}return y.needConfirms&&(f.value=(y.body.items||[]).map((t=>{var n,i;const o={html_type:t.type,val_key:t.code,name:t.name,elem_width:12,default_val:t.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=t.labelField)?n:"label"},option:[],is_null:t.required?"0":"1"};return"SELECT"===o.html_type&&(o.option=t.options,"fixed"===t.dataSourceType&&(null==(i=t.options)?void 0:i.length)||(o.html_type="REMOTE_SEARCH",Object.assign(o.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{instructionId:e.instructionId,code:t.code,configs:m},dependKey:[]}),a(t.dependencies)&&t.dependencies.length&&(o.urlConfig.dependKey=t.dependencies))),o}))),()=>{var t;return i("div",{class:"card"},[y.needConfirms?[i("p",null,[y.title||y.header.title]),i(s,{disabled:e.msgItem.disabled,column:12,ref:g,"field-list":f.value},null),y.footer.buttons.map((t=>function(t){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},l=y.needConfirms?{...n,marginTop:"0"}:n;return i(o,{style:l,secondary:!0,class:"gradient",disabled:e.msgItem.disabled,onClick:async function(){if(y.needConfirms){if(!g.value)return;const e=g.value.getFormValues();try{await g.value.validate(),p.loading=!0,c("button-click",{values:e,buttonInfo:t,isForm:!0})}catch(e){}}else c("button-click")}},{default:()=>[y.needConfirms?null==t?void 0:t.text:y.buttonName]})}(t)))]:i(r,{config:v(null==(t=y.settings)?void 0:t.setting)?JSON.parse(y.settings.setting):null,data:y.data,"onModule-click":b,"onButton-click":h},null)])}}});export{d as default};
|
@@ -28,6 +28,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
28
28
|
children?: any[] | undefined;
|
29
29
|
}[]>;
|
30
30
|
showPrompt: import("vue").Ref<boolean>;
|
31
|
+
currentShortcutId: import("vue").Ref<string>;
|
31
32
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
32
33
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
33
34
|
recorderStart: () => Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as l,ref as t,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as u,normalizeClass as r,unref as i,Fragment as d,renderList as c,createBlock as v,withCtx as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,createVNode as k,createElementVNode as y,withModifiers as g,getCurrentInstance as w}from"vue";import{NButton as b,NPopover as x,NInput as C,NTag as _,NIcon as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{SparklesSharp as T,PaperPlane as K,ChevronBack as M,ChevronForward as D}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as R}from"../types/index.js";import U from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as P,last as E}from"lodash-es";import{useTheme as L}from"../../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"../../../../shared/utils/index.js";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"../../../../shared/hooks/useScrollLoading.js";import B from"./ChatPrompt.vue.js";const F={key:0,class:"menu-box fillet-8"},W={class:"input-wrapper fillet-10"},H=y("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[y("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),y("path",{d:"M384 208v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32",fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),y("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),y("path",{d:"M256 64a63.68 63.68 0 0 0-64 64v111c0 35.2 29 65 64 65s64-29 64-65V128c0-36-28-64-64-64z",fill:"none",stroke:"#4972EF","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"})],-1),N={class:"btn-box"},V=["disabled"],q={class:"command-box"},G={class:"command-box__header"},J={key:0,class:"title"},O={class:"command-box__menu"},Q=["onMouseover","onClick"],X={class:"label"},Y={class:"remark"};var Z=e({__name:"ChatFooter",setup(e){const Z=L(),$=U.create(),ee=l(S),{shortcutList:le,state:te,isSmall:oe,audioTimed:ne,commandList:ae}=l(R),se=t(),ue=t(""),re=t(!1),ie=t([]),de=t(A(ae.value||[])),ce=t(!1),ve=t(""),me=o((()=>!ue.value.replace(/( |\s|<br>)+/g,""))),pe=o((()=>{var e;return!ue.value&&!(null==(e=se.value)?void 0:e.activated.value)}));async function he(){try{const e=await $.start(w(),{allowPunctuationMark:!1,timed:ne.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:l}=e.data;ue.value=l}catch(e){console.log(e)}}function fe(e){var l;if(P(e))return e;const{content:t}=(null==(l=null==e?void 0:e.contents)?void 0:l[0])||{};return t.instructionName}function ke(){re.value=!1,de.value=A(ae.value||[]),ie.value=[],ae.value.length&&(re.value=!0,ve.value=de.value[0].shortcutId)}function ye(e){if("Slash"!==e.code||te.selectedCommand||ue.value)if("Backspace"===e.key)re.value=!1,!ue.value.startsWith("/")&&!ue.value.startsWith("、")||2!==ue.value.length||te.selectedCommand?!ue.value&&te.selectedCommand&&(e.preventDefault(),te.selectedCommand=null,ue.value="/",ke()):ke();else if(re.value&&["ArrowUp","ArrowDown"].includes(e.key)){const l=de.value.findIndex((e=>e.shortcutId===ve.value));if("ArrowUp"===e.key){const e=l>0?l-1:de.value.length-1;ve.value=de.value[e].shortcutId}else if("ArrowDown"===e.key){const e=l<de.value.length-1?l+1:0;ve.value=de.value[e].shortcutId}}else if(["Enter"].includes(e.key)){if(!function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e))if(e.preventDefault(),re.value){be(de.value.find((e=>e.shortcutId===ve.value)))}else we()}else re.value=!1;else ke()}function ge(e){!e&&te.selectedPrompt&&(te.selectedPrompt=null)}function we(){me.value||(te.sending=!0,te.loading=!0,te.sendContent=ue.value,ue.value="")}function be(e){var l;ve.value=e.shortcutId,se.value.focus(),(null==(l=e.children)?void 0:l.length)?(de.value=e.children,ve.value=de.value[0].shortcutId,ie.value.push(e)):(te.selectedCommand=e||{},re.value=!1,ue.value="")}function xe(){var e;ie.value.pop(),de.value=E(ie.value)?null==(e=E(ie.value))?void 0:e.children:A(ae.value||[]),ve.value=de.value[0].shortcutId,se.value.focus()}return n((()=>te.sendContent),(e=>{e&&!te.sending&&(ue.value=e)})),a((()=>{$.destroy()})),(e,l)=>(s(),u("section",{class:r(["chat-footer",i(te).loading?"disabled":""])},[i(le)&&i(le).length>0?(s(),u("div",F,[(s(!0),u(d,null,c(i(le),(e=>(s(),v(i(b),{secondary:"",size:"small",round:i(oe),key:fe(e),onClick:()=>function(e){var l;if(P(e))ue.value=e;else{const t=null==(l=null==e?void 0:e.contents)?void 0:l[0];ee("button-click",{msgItem:t,item:e})}}(e)},{default:m((()=>[p(h(fe(e)),1)])),_:2},1032,["round","onClick"])))),128))])):f("v-if",!0),k(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:re.value,onClickoutside:l[4]||(l[4]=e=>re.value=!1)},{trigger:m((()=>[y("div",W,[i(oe)?(s(),v(i(C),{key:0,ref_key:"inputRef",ref:se,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(te).loading,value:ue.value,"onUpdate:value":l[1]||(l[1]=e=>ue.value=e),onKeydownCapture:ye,onInput:ge},{prefix:m((()=>[i(te).selectedCommand&&i(te).selectedCommand.shortcutTitle?(s(),v(i(_),{key:0,bordered:!1,color:{textColor:i(Z)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(i(te).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(pe)?(s(),v(i(b),{key:1,text:"",onClick:l[0]||(l[0]=()=>ce.value=!0)},{default:m((()=>[k(i(I),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:m((()=>[k(i(b),{text:"",disabled:i(te).loading,onClick:he},{icon:m((()=>[k(i(I),{size:"30"},{default:m((()=>[H])),_:1})])),_:1},8,["disabled"]),k(i(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(me),onClick:we},{icon:m((()=>[k(i(I),{color:"#fff",size:"20",component:i(K)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),u(d,{key:1},[k(i(C),{ref_key:"inputRef",ref:se,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:i(te).loading,autosize:{minRows:2,maxRows:7},value:ue.value,"onUpdate:value":l[3]||(l[3]=e=>ue.value=e),onKeydownCapture:ye,onInput:ge},{prefix:m((()=>[i(te).selectedCommand&&i(te).selectedCommand.shortcutTitle?(s(),v(i(_),{key:0,bordered:!1,color:{textColor:i(Z)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=i(te).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(pe)?(s(),v(i(b),{key:1,text:"",onClick:l[2]||(l[2]=()=>ce.value=!0)},{default:m((()=>[k(i(I),{color:"#8f66f7",size:"18",component:i(T)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),y("div",N,[y("span",{class:r(["btn-send","gradient","fillet-8",i(me)?"disabled":""]),disabled:i(me),onClick:we},[k(i(I),{color:"#fff",size:"22",component:i(K)},null,8,["component"])],10,V)])],64))])])),default:m((()=>[y("div",q,[y("div",G,[0===ie.value.length?(s(),u("span",J,"推荐指令")):(s(),u(d,{key:1},[k(i(b),{text:"",onClick:xe},{default:m((()=>[k(i(I),{color:"#999",size:"20",component:i(M)},null,8,["component"])])),_:1}),k(i(j),null,{default:m((()=>[(s(!0),u(d,null,c(ie.value,(e=>(s(),v(i(z),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),y("div",O,[(s(!0),u(d,null,c(de.value,(e=>(s(),u("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable",ve.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:g((()=>ve.value=e.shortcutId),["stop"]),onClick:()=>be(e)},[y("span",X,h(e.shortcutTitle),1),y("span",Y,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(i(I),{key:0,color:"#999",size:"20",component:i(D)},null,8,["component"])):f("v-if",!0)],42,Q)))),128))])])])),_:1},8,["show"]),k(B,{show:ce.value,"onUpdate:show":l[5]||(l[5]=e=>ce.value=e)},null,8,["show"])],2))}});export{Z as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as a,createVNode as s,createTextVNode as r,
|
1
|
+
import{defineComponent as e,inject as t,ref as n,computed as l,watch as o,nextTick as a,createVNode as s,createTextVNode as r,isVNode as u}from"vue";import{NAvatar as i,NSpin as c,NSpace as d,NButton as m}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as p}from"../types/index.js";import f from"../../../../shared/assets/img/ai__avatar.png.js";import g from"../../../../shared/assets/img/logo.png.js";import{isArray as h,isFunction as b}from"lodash-es";import"../../../../shared/utils/index.js";import"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import"@vicons/ionicons5";import{useScrollLoading as y}from"../../../../shared/hooks/useScrollLoading.js";import x from"./ChatCard.js";function C(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var j=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:j,emit:k}){const T=t(v),{userAvatar:E,queryData:I,state:w,queryRecord:z,defaultShortcutList:S,hideInput:M=!1,isSmall:A}=t(p),D=n(null),q=n([]),H=n(!1),L=l((()=>A.value?g:f)),O={page:0,hasMore:!0};async function _(e=!1){if(!O.hasMore)return;O.page++,1==O.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:O.page});h(n)&&q.value.length<=+t&&(q.value=O.page>1?[...q.value,...n]:n,B(),q.value.length>=+t&&(e&&(H.value=!0),O.hasMore=!1,console.log("没有更多消息了")))}function B(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function P(e,t){const{contentType:n,content:l}=t;return"json"===n&&l?s(x,{instructionId:e.instructionId,msgItem:t,"onButton-click":(n={})=>function(e){const{item:t,msgItem:n}=e;if(n)return T("button-click",e),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.sendContent="确定",w.sending=!0,w.loading=!0)}({item:e,msgItem:t,...n})},null):null}function R(e,t){const{contents:n=[],buttonType:l=""}=e,o=P(e,n[t]);if(o)return o;return[n[t].content.replace(/\\n|\n|\r\n/g,"<br>").split("<br>").filter((e=>!!e)).map(((e,t,n)=>[e,t===n.length-1?null:s("br",null,null)]))]}function F({role:e=""}){return"user"===e}function G(){let e;return s("div",{class:"message-item"},[s(i,{round:!0,size:A.value?64:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content fillet-10 default"},[s("h2",null,[r("Hi,我是你的AI助理")]),s("p",null,[r("我汇集了医生站/护士站各项智能服务,可以向我进行提问哦 ~ "),s("br",null,null),r("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),h(S.value)&&S.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[r("你可以试着问我:")]),s(d,{"wrap-item":!1},C(e=S.value.map((e=>s(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.loading},C(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return y(D,(()=>{_()}),M.value?"bottom":"top"),_(!0),o((()=>w.externalData),(e=>{var t,n;e&&(t=e,q.value.unshift(t),null==(n=D.value)||n.scrollTo({top:0,behavior:"auto"}),B(),w.loading=!1,w.externalData=null)})),o((()=>w.sending),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=D.value)||t.scrollTo({top:0,behavior:"auto"}),B();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null;const o=await I.value({content:w.sendContent,contentType:"text",command:e,prompt:l});h(null==o?void 0:o.contents)&&(q.value.unshift(o),await a(),null==(n=D.value)||n.scrollTo({top:0,behavior:"auto"})),w.sending=!1,w.loading=!1,w.sendContent=""}})),()=>s("section",{class:"chat-main",ref:D,style:{"flex-direction":M.value?"column":"column-reverse"}},[[w.loading?s("div",{class:"message-item"},[[A.value?null:s(i,{round:!0,size:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(c,{size:22,stroke:"#4170EE"},null),s("span",null,[r("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>s("div",{class:"message-item"},[[A.value?null:s(i,{round:!0,size:40,src:F(t)?E.value:L.value},null),s("div",{class:["content-box",F(t)?"mine":""]},[s("div",{class:"content"},[b(t.render)?t.render():R(e,n)])])]]))))),H.value?G():null]])}});export{j as default};
|
@@ -4,7 +4,8 @@ export declare const InjectionAIChat: InjectionKey<AnyObject>;
|
|
4
4
|
export declare const InjectionAIChatEmits: InjectionKey<(event: string, ...args: any[]) => void>;
|
5
5
|
export type MessageItem = {
|
6
6
|
role: string;
|
7
|
-
|
7
|
+
contentType: 'json' | 'text';
|
8
|
+
content: AnyObject | string;
|
8
9
|
render?: () => VNodeChild;
|
9
10
|
[key: string]: any;
|
10
11
|
};
|
@@ -16,6 +17,8 @@ export type MessageList = Array<{
|
|
16
17
|
export type QueryData = (props: {
|
17
18
|
content: string;
|
18
19
|
contentType: string;
|
20
|
+
command: any;
|
21
|
+
prompt: any;
|
19
22
|
}) => Promise<Array<{
|
20
23
|
contents: MessageItem[];
|
21
24
|
buttonType?: string;
|
@@ -1 +1 @@
|
|
1
|
-
.c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;position:relative;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content .card .patient-info{border-top:1px solid #e5e5e5;margin-top:5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item{margin:5px 0 0 5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item:last-child{margin-bottom:0}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:first-child{font-weight:700}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:last-child{color:#888}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{background:#
|
1
|
+
.c-recording-wrapper{align-items:center;background-color:#fff;border-radius:10px;bottom:100px;display:flex;height:350px;justify-content:center;left:calc(50% - 250px);position:fixed;width:500px}@keyframes toScale{0%{transform:translateX(-50%) translateY(-50%) scale(1)}to{transform:translateX(-50%) translateY(-50%) scale(1.5)}}.c-recording-wrapper .content{font-size:18px;position:absolute;text-align:center;top:20px}.c-recording-wrapper .animation{animation:toScale 1s infinite;background-color:#5585f54d;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%) scale(1);z-index:-1}.c-recording-wrapper .animation,.c-recording-wrapper .icon-box{align-items:center;border-radius:50%;display:flex;height:90px;justify-content:center;width:90px}.c-recording-wrapper .icon-box{background-color:#5585f5;cursor:pointer}.c-recording-wrapper .tip{bottom:20px;position:absolute}.ai-chat{background:linear-gradient(135deg,#c9dbfb,#c9dbfb 20%,rgba(237,237,253,.5) 70%,rgba(151,97,251,.2));display:flex;flex-flow:column nowrap;font-size:14px;height:100%;padding:45px 0 60px;position:relative;width:100%}.ai-chat,.ai-chat *{box-sizing:border-box}.ai-chat .fillet-10{border-radius:10px}.ai-chat .fillet-8{border-radius:8px}.ai-chat .n-avatar{background-color:var(--c-primary-color)}.ai-chat .gradient{background:linear-gradient(178deg,#8f66f7,#4170ee);color:#fff}.ai-chat .gradient:active,.ai-chat .gradient:focus,.ai-chat .gradient:hover{color:#fff}.ai-chat .chat-main{display:flex;flex:1;flex-flow:column-reverse nowrap;overflow-y:auto;padding:0 130px 0 82px;row-gap:16px}.ai-chat .chat-main::-webkit-scrollbar{width:5px}.ai-chat .chat-main::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-main::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-main .message-item{column-gap:8px;display:flex;flex-flow:row nowrap}.ai-chat .chat-main .message-item:first-child{margin-bottom:auto}.ai-chat .chat-main .message-item .n-avatar{flex-shrink:0}.ai-chat .chat-main .message-item .content-box .content{background:#fff;border-radius:10px;flex:unset;padding:10px 12px}.ai-chat .chat-main .message-item .content-box .content .card{width:236px}.ai-chat .chat-main .message-item .content-box .content .card>p{font-size:14px;line-height:19px}.ai-chat .chat-main .message-item .content-box .content .card .link-btn{display:flex;flex-flow:row wrap;font-size:14px;justify-content:space-between;margin-top:10px;width:100%}.ai-chat .chat-main .message-item .content-box .content .card .link-btn .n-button__content{display:unset;flex:1;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-main .message-item .content-box .content .card .card-body{border:1px solid #d5d5d5;border-radius:8px;margin-top:5px;overflow:hidden}.ai-chat .chat-main .message-item .content-box .content .card .card-body__head{background:rgba(65,112,238,.14);line-height:36px;padding:0 15px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content{padding:10px 6px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div{display:flex;font-size:12px}.ai-chat .chat-main .message-item .content-box .content .card .card-body__content>div .label{flex:0 0 60px;text-align:right}.ai-chat .chat-main .message-item .content-box .content .card .patient-info{border-top:1px solid #e5e5e5;margin-top:5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item{margin:5px 0 0 5px}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item:last-child{margin-bottom:0}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:first-child{font-weight:700}.ai-chat .chat-main .message-item .content-box .content .card .patient-info .patient-item p:last-child{color:#888}.ai-chat .chat-main .message-item .content-box .content .card .n-form{margin-top:10px}.ai-chat .chat-main .message-item .content-box .content .card .n-form .form-render__formItemLabel{color:#888}.ai-chat .chat-main .message-item .content-box .content.default h2{font-size:22px;font-weight:500;margin:10px 0}.ai-chat .chat-main .message-item .content-box .content.loading{align-items:center;color:#999;column-gap:10px;display:flex}.ai-chat .chat-main .message-item .content-box.mine .content{background:hsla(0,0%,100%,.48);border-radius:8px}.ai-chat .chat-footer{padding:30px 130px 0}.ai-chat .chat-footer.disabled{cursor:not-allowed}.ai-chat .chat-footer .menu-box{background:#fff;column-gap:8px;display:flex;margin-bottom:8px;overflow-x:auto;padding:10px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{width:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .chat-footer .menu-box::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .chat-footer .menu-box::-webkit-scrollbar{height:5px}.ai-chat .chat-footer .input-wrapper{background:#fff;box-shadow:0 3px 4px 0 rgba(0,0,0,.1);padding:15px 20px}.ai-chat .chat-footer .input-wrapper .n-input__border,.ai-chat .chat-footer .input-wrapper .n-input__state-border{border:none}.ai-chat .chat-footer .input-wrapper .n-input:not(.n-input--disabled).n-input--focus .n-input__state-border{box-shadow:unset}.ai-chat .chat-footer .input-wrapper .btn-box{display:flex;justify-content:flex-end}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send{align-items:center;cursor:pointer;display:flex;height:46px;justify-content:center;width:58px}.ai-chat .chat-footer .input-wrapper .btn-box .btn-send.disabled{cursor:not-allowed;opacity:.5}.ai-chat .chat-footer .command-box{display:flex;flex-flow:column nowrap;height:100%}.ai-chat .chat-footer .command-box__header{display:flex}.ai-chat .chat-footer .command-box__header .title{color:#999}.ai-chat .chat-footer .command-box__menu{flex:1;overflow-y:auto}.ai-chat .chat-footer .command-box__menu .menu-item{align-items:center;display:flex;padding:8px 0 8px 5px}.ai-chat .chat-footer .command-box__menu .menu-item .remark{color:#999;flex:1;font-size:12px;margin-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-chat .chat-footer .command-box__menu .menu-item .n-icon{margin-left:auto}.ai-chat .chat-footer .command-box__menu .menu-item:hover{cursor:default}.ai-chat .chat-footer .command-box__menu .menu-item.selected{background:#f2f2f2;border-radius:5px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable{position:relative}.ai-chat .chat-footer .command-box__menu .menu-item.selectable .label{color:var(--c-primary-color);margin-left:30px}.ai-chat .chat-footer .command-box__menu .menu-item.selectable:before{background:#e5e5e5;border-radius:5px;content:"/";height:20px;left:5px;line-height:20px;position:absolute;text-align:center;top:10px;width:20px}.ai-chat--small{padding:20px 0 44px}.ai-chat--small .chat-main{padding:0 20px 10px}.ai-chat--small .chat-main .message-item{display:unset}.ai-chat--small .chat-main .message-item .n-avatar{background:transparent}.ai-chat--small .chat-main .message-item .content-box{display:flex;flex-flow:row nowrap}.ai-chat--small .chat-main .message-item .content-box .content{border-radius:3px 14px 14px;max-width:calc(100% - 55px)}.ai-chat--small .chat-main .message-item .content-box .content.default{border-radius:4px 16px 16px}.ai-chat--small .chat-main .message-item .content-box.mine{flex-flow:row-reverse nowrap}.ai-chat--small .chat-main .message-item .content-box.mine .content{background:#5874dc;border-radius:14px 0 14px 14px;color:#fff}.ai-chat--small .chat-footer{padding:10px 20px 0}.ai-chat--small .chat-footer .menu-box{background:none;padding:0}.ai-chat--small .chat-footer .menu-box .n-button{background:#fff}.ai-chat--small .chat-footer .input-wrapper{border-radius:24px;box-shadow:0 0 6px 0 hsla(240,9%,85%,.74);padding:0}.ai-chat .prompt-wrapper{background:linear-gradient(135deg,#ecf3ff,#ecf3ff 20%,rgba(237,237,253,.5) 70%,rgba(203,175,255,.3))}.ai-chat .prompt-wrapper .n-drawer-header{padding:15px}.ai-chat .prompt-wrapper .n-drawer-header__main{width:100%}.ai-chat .prompt-wrapper .n-drawer-header__main .title{display:flex;font-size:14px}.ai-chat .prompt-wrapper .n-drawer-header__main .title .n-button{margin-left:auto}.ai-chat .prompt-wrapper .n-drawer-header__main .n-input{margin-top:10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper{padding:0 10px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper{align-content:flex-start;display:flex;flex-wrap:wrap;height:100%;overflow-y:auto}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar{width:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-thumb{background:rgba(0,0,0,.25);border-radius:5px}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper::-webkit-scrollbar-track-piece{background-color:unset}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item{background:#fff;border-radius:10px;box-sizing:border-box;break-inside:avoid;cursor:pointer;margin:5px;padding:10px;width:calc(50% - 10px)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item:hover{background-image:linear-gradient(#ecf3ff,#fff 40%,#fff)}.ai-chat .prompt-wrapper .n-drawer-body-content-wrapper .list-wrapper .item p:last-child{color:#999;font-size:12px}
|
@@ -4238,6 +4238,20 @@ export declare const CallbackMaps: Map<string, {
|
|
4238
4238
|
} | undefined;
|
4239
4239
|
tableRowHeight?: string | number | undefined;
|
4240
4240
|
tableHeaderRowHeight?: string | number | undefined;
|
4241
|
+
crossColumnSetting?: {
|
4242
|
+
columnWidth?: number | undefined;
|
4243
|
+
rowHeight?: number | undefined;
|
4244
|
+
fixedColumnList?: {
|
4245
|
+
setting: {
|
4246
|
+
name: string;
|
4247
|
+
option: {
|
4248
|
+
text: string;
|
4249
|
+
value?: string | undefined;
|
4250
|
+
}[];
|
4251
|
+
};
|
4252
|
+
columnWidth?: number | undefined;
|
4253
|
+
}[] | undefined;
|
4254
|
+
} | undefined;
|
4241
4255
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
4242
4256
|
onScroll?: ((params: import("vxe-table").VxeTableDefines.ScrollEventParams) => void) | undefined;
|
4243
4257
|
onKeydown?: ((params: import("vxe-table").VxeTableDefines.KeydownEventParams) => void) | undefined;
|
@@ -4306,6 +4320,7 @@ export declare const CallbackMaps: Map<string, {
|
|
4306
4320
|
}>;
|
4307
4321
|
updateConfigRefDebounced: () => void;
|
4308
4322
|
updateConfigRef: () => void;
|
4323
|
+
themeOverrides: import("vue").ComputedRef<import("naive-ui").GlobalThemeOverrides>;
|
4309
4324
|
fieldListRef: import("vue").Ref<{
|
4310
4325
|
[x: string]: any;
|
4311
4326
|
property?: string | undefined;
|
@@ -7816,6 +7831,20 @@ export declare const CallbackMaps: Map<string, {
|
|
7816
7831
|
} | undefined;
|
7817
7832
|
tableRowHeight?: string | number | undefined;
|
7818
7833
|
tableHeaderRowHeight?: string | number | undefined;
|
7834
|
+
crossColumnSetting?: {
|
7835
|
+
columnWidth?: number | undefined;
|
7836
|
+
rowHeight?: number | undefined;
|
7837
|
+
fixedColumnList?: {
|
7838
|
+
setting: {
|
7839
|
+
name: string;
|
7840
|
+
option: {
|
7841
|
+
text: string;
|
7842
|
+
value?: string | undefined;
|
7843
|
+
}[];
|
7844
|
+
};
|
7845
|
+
columnWidth?: number | undefined;
|
7846
|
+
}[] | undefined;
|
7847
|
+
} | undefined;
|
7819
7848
|
onFormChange?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
7820
7849
|
onSettingClick?: (() => void) | undefined;
|
7821
7850
|
onFormClick?: ((payload_0: import("../../../../../components/iho-table").IhoTableFormChangePayload) => void) | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as f,drawScaleNumber as d,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:z,endY:V,startTime:B,leftAddAreaWidth:F,leftScales:R,rightScales:$,yCellHeight:q,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],f=[],{pointAttr:d={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:d={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v=n(c,{left:p,top:r[1],...u,...i}),m=r[1]+v.height/2,y="dystocia"===s?o([p,m+q,m],h,"up"):null;g&&(f.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),v&&(f.push(v),a[s]={obj:v,left:p-r[0]}),y&&(f.push(y),a[s+"Arrow"]={obj:y,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=de(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=de(E,e);S=o?t([...a,...o],{...h}):null}const O={};if("cervix"===g){let e,t;if(y.childbirth){const{type:s="arrow",style:c={}}=m;if("arrow"===s){const t=a[1]+q;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+z/2,a[1]+q/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",fill:c.stroke||c.fill,fontSize:c.fontSize||l.fontSize}),e&&(f.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(f.push(t),Object.assign(O,{childbirthText:{obj:t,left:z/2,top:q/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...d,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{fe(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&fe(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(de(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(f).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),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}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>V&&e.set("top",V),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function fe(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function de(e,t){if(v(e)&&function(e){const t=B+864e5,o=m(e);return o>=B&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>V?V:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-F-Z-1,left:F}:{width:J-N-($.length?0:1),left:N},o=new e.Rect({...U,height:V-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?F:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=f(m,n,u);E.forEach(((e,o)=>{const n=V-o*q*b,i=0===o?V-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(d(String(e),t,L,i)),C.push(...h(t,o,O,A,n,q,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:V-ie[0],left:P,top:ie[0]+(V-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-q/2:q/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t(R),t($,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:f,style:d={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=q/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?z/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const f="top"===s?W-m:V+m;g.push(r([c+e*z,f],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,f],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=d,o=N+("center"===t?z/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===f?m:oe-m;v.push(r([n+e*z,i],{value:String(p[e]),...l,...d})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(V-i-t)/e,V-i],c=[J-N,e*(J-N)+t];let u=[],f=[];function d([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=V}function p([e,t]){return[N+e,V-t]}return d(l)&&h(l)&&(u=p(l)),d(s)&&h(s)&&(u=p(s)),d(a)&&h(a)&&(f=p(a)),d(c)&&h(c)&&(f=p(c)),[...u,...f]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[f,d]=[X(l.time)-N,V-O(o,a,l.value)],[h,p]=[X(u.time)-N,V-O(o,a,u.value)],g=(p-d)/(h-f),v=d-f*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=V&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),fe(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(V-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t(R,F/2),t($,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
1
|
+
import{fabric as e}from"../../../../../shared/utils/fabricjs/index.js";import{drawLine as t,drawArrow as o,drawPoint as n,defaultStyle as i,drawText as r,defaultTextStyle as l,drawTextAndIconGroup as s,defaultRectStyle as a}from"../useDraw.js";import{useGrid as c}from"../useGrid.js";import{useBirthProcessCumputedPoint as u}from"../useCumputedPoint.js";import"../useEvent.js";import{getScaleInfo as d,drawScaleNumber as f,drawScaleLine as h}from"../useScaleColumn.js";import{useCommon as p}from"../useCommon.js";import"vue";import{getIndex as g,isEffectiveNode as v,getTime as m,getScaleNumberList as y}from"../../utils/index.js";import{cloneDeep as b,last as k,range as j}from"lodash-es";import"../temperature/useShadow.js";import"@vueuse/shared";import{format as w}from"date-fns";import"naive-ui";import"@vueuse/core";function x(x,S,C,P,E){const{computedX:X,computedY:O,getXValue:A,getYValue:L}=u(S),{getEqualXTypes:M,handleAddPrevent:Y,isGridLimit:H,setPrevAndNextPoint:T,getPointEventProps:I}=p(x,C,S),{xAxis:D,grid:G,originX:N,originY:W,xCellWidth:V,endY:B,startTime:F,leftAddAreaWidth:R,leftScales:$,rightScales:q,yCellHeight:z,endX:J,scaleValues:K,canvasWidth:Q,borderStyle:U,rightAddAreaWidth:Z,event:_,originYCervix:ee,other:te,canvasHeight:oe,scalebarBorder:ne,padding:ie}=S,re=b(K),le=new Set;function se(){re.filter((({showData:e=!0})=>e)).forEach(((e,s)=>{var a;const c=[],u=[],d=[],{pointAttr:f={},lineAttr:h={},title:p="",key:g,type:v="circle",childbirthStyle:m={},surgicalDeliveryStyle:y={},dystociaStyle:b={}}=e;function k(r,l,s,a){if(l[s]){const{type:c="circle",style:u={},arrowStyle:f={}}=e[s+"Style"],p=X(l[s]),g=t([...r,p,r[1]],{...h,strokeDashArray:[4,2],...i}),v="dystocia"===s&&r[1]-W>=z?r[1]-z:r[1],m=n(c,{left:p,top:v,...u,...i}),y=v+m.height/2,b="dystocia"===s?o([p,y+z,y],h,"up"):null;g&&(d.push(g),a[s+"Line"]={obj:g,type:"line",left:p-r[0]}),m&&(d.push(m),a[s]={obj:m,left:p-r[0]}),b&&(d.push(b),a[s+"Arrow"]={obj:b,left:p-r[0],moveHide:!0})}}null==(a=e.data)||a.forEach(((a,y)=>{!function(a,y,b){let j,S;const E=e.data[b+1],X=fe(E,e);if(a&&X&&!y.breakpoint)S=t([...a,...X],{...h});else if(a&&!X&&!y.breakpoint){const o=fe(E,e);S=o?t([...a,...o],{...h}):null}const O={};if(["fetalPresentation","cervix"].includes(g)){let e,t;if(y.childbirth){const{type:s="arrow",style:c={},textStyle:u={}}=m;if("arrow"===s){const t=a[1]+z;e=o([a[0],a[1],t],c)}else e=n(s,{left:a[0],top:a[1],...c,...i,hoverCursor:"default"});t=r([a[0]+V/2,a[1]+z/2],{value:String(y.childbirth),...l,originX:"left",originY:"center",...u}),e&&(d.push(e),Object.assign(O,{childbirthIcon:{obj:e,type:s}})),t&&(d.push(t),Object.assign(O,{childbirthText:{obj:t,left:V/2,top:z/2}}))}}"fetalPresentation"===g&&(k(a,y,"surgicalDelivery",O),k(a,y,"dystocia",O));const M=u[b-1],Y={origin:{data:y,title:p,key:g||"",dataIndex:s,index:b},leftLine:M,rightLine:S,otherObj:O,...f,...I()};a&&(M||(Y.leftLine=null),j=n(v,{left:a[0],top:a[1],...Y}));u.push(S),j&&(!function(e){_.hovered&&(e.on("mouseover",(()=>{de(e,"hover")})),e.on("mouseout",(()=>{P.show=!1})));if(e.lockMovementX&&e.lockMovementY)return;e.on("moving",(()=>{ue(e),function(e){var t,o;null==(t=e.leftLine)||t.setCoords().set({x2:e.left,y2:e.top}),null==(o=e.rightLine)||o.setCoords().set({x1:e.left,y1:e.top}),Object.values(e.otherObj).forEach((t=>{const{obj:o,top:n=0,left:i=0,type:r="",moveHide:l}=t||{};o&&("line"===r?o.setCoords().set({x1:e.left,y1:e.top,x2:e.left+i,y2:e.top}):o.setCoords().set({left:e.left+i,top:e.top+n}),l&&(x.value.remove(o),delete e.otherObj.obj))}))}(e),_.hovered&&de(e)})),e.on("mouseup",(t=>{if(P.show=!1,1===t.button){const{key:t}=e.origin,o={...e.origin,data:{...e.origin.data,time:A(e.left),value:L(t,e.top)}};["surgicalDelivery","dystocia"].some((t=>{var n;(null==(n=e.otherObj[t])?void 0:n.obj)&&(o.data[t]=w(new Date(A(e.left+e.otherObj[t].left)),"yyyy-MM-dd HH:mm"))})),x.value.discardActiveObject(),C("change",o),ae(o,"change")}}))}(j),c.push(j),le.add(j))}(fe(a,e),a,y)})),Promise.all(c).then((e=>{const t=u.filter((e=>e));T(e),Promise.all(d).then((o=>{x.value.add(...t,...e,...o),e.forEach((e=>{null==e||e.bringToFront();const{childbirthIcon:t}=e.otherObj||{};(null==t?void 0:t.obj)&&"arrow"!==(null==t?void 0:t.type)&&t.obj.bringToFront()}))}))}))}))}function ae(e,t="add"){const{dataIndex:o,data:n,index:i,key:r}=e,l=re.find((e=>e.key===r));switch(t){case"remove":l.data.splice(i,1);break;case"change":l.data[i]=n;break;default:{const e=g(n.time,l.data);l.data.splice(e,0,n);break}}ce()}function ce(){var e;le.size&&(null==(e=x.value)||e.remove(...function(e){const t=[];return e.forEach((e=>{e&&t.push(e),(null==e?void 0:e.leftLine)&&t.push(null==e?void 0:e.leftLine),(null==e?void 0:e.rightLine)&&t.push(null==e?void 0:e.rightLine),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}([...le]))),le.clear(),se()}function ue(e){const t=e.prevPoint?e.prevPoint.left:N,o=e.nextPoint?e.nextPoint.left:J;e.setCoords(),["cervix","fetalPresentation"].includes(e.origin.key)&&e.top<ee&&e.set("top",ee),e.top<W&&e.set("top",W),e.top>B&&e.set("top",B),e.left<t&&e.set("left",t),e.left>o&&e.set("left",o)}function de(e,t="moving"){const{title:o,key:n,data:i}=e.origin;P.point={x:e.left,y:e.top},P.list=[`${o} ${"hover"===t?i.value:L(n,e.top)}`,`时间 ${A(e.left).slice(-5)}`],P.show=!0}function fe(e,t){if(v(e)&&function(e){const t=F+864e5,o=m(e);return o>=F&&o<=t}(e.time)){const o=X(e.time),n=O(t.key,t.range,e.value);return[o,n<W?W:n>B?B:n]}}function he(e,t){return e+1>t[1]?t[0]:e+1}return c(x,S),function(){const t=ne?{width:Q-R-Z-1,left:R}:{width:J-N-(q.length?0:1),left:N},o=new e.Rect({...U,height:B-ie[0]-1,top:ie[0],fill:"transparent",...t});x.value.add(o)}(),function(){function t(t,o="left"){let n="left"===o?R:J;t.forEach(((t,o)=>{const{range:s,spaceValue:c,width:u,title:p,titleStyle:g,key:v,position:m="center",spaceGridNumber:b=1,showNumber:k=!0,showMaxMinNumber:j=!0,showName:w=!0}=t,S=[],C=[],P=n+u/2,E=y(s,c),X=E.length,{lineXMain:O,lineXSub:A,textLeft:L}=d(m,n,u);E.forEach(((e,o)=>{const n=B-o*z*b,i=0===o?B-8:o!==E.length-1||!ie[0]||ee&&"FHR"!==v?n:W+8;!k||(0===o||o===X-1)&&!j||S.push(f(String(e),t,L,i)),C.push(...h(t,o,O,A,n,z,W,X,1))}));const M=[],Y=ne?new e.Rect({...a,strokeWidth:.5,width:u,height:B-ie[0],left:P,top:ie[0]+(B-ie[0])/2}):null;if(Y&&M.push(Y),w){const e=r([P,W-ie[0]>0?W-z/2:z/2],{value:String(p),...l,...g});e&&M.push(e)}const H=new e.Group([...C,...S,...M],{objectCaching:!1,...i});x.value.add(H),H.sendToBack(),n+=u}))}t($),t(q,"right")}(),function(){const{show:t,startTime:o,range:n=[0,23],position:s="top",style:a}=D.time,{show:c,range:u=[0,23],position:d,style:f={}}=D.processTime;if(t||c){const h=[],p=j(u[0],u[1]+1),g=[],v=[],m=z/2;for(let e=0;e<G.mainXCell;e++){if(t){const{textAlign:t="center"}=a,i=N+("center"===t?V/2:0),c=0===e&&"center"!==t?i+5:i,u=0===e?+o.slice(11,13):he(k(h),n);h.push(u);const d="top"===s?W-m:B+m;g.push(r([c+e*V,d],{value:String(u),...l,...a})),e===G.mainXCell-1&&"center"!==t&&g.push(r([J-1,d],{value:String(he(k(h),n)),...l,...a,originX:"center"!==t?"right":"center"}))}if(c&&e<=p.length){const{textAlign:t="center"}=f,o=N+("center"===t?V/2:0),n=0===e&&"center"!==t?o+5:o,i="top"===d?m:oe-m;v.push(r([n+e*V,i],{value:String(p[e]),...l,...f})),e===G.mainXCell-1&&"center"!==t&&v.push(r([J-1,i],{value:String(k(p)),...l,...a,originX:"center"!==t?"right":"center"}))}}const y=new e.Group([...g,...v],{objectCaching:!1,...i});x.value.add(y),x.value.sendToBack(y)}}(),function(){var e;const o=Object.values(te),n=[],i={},r=re.find((e=>"cervix"===e.key&&e.show)),l=null==(e=null==r?void 0:r.data)?void 0:e.find((e=>3==+e.value));function s(e,t){const{key:o,range:n}=r||{},i=O(o,n,10),l=[0,t],s=[-t/e,0],a=[(B-i-t)/e,B-i],c=[J-N,e*(J-N)+t];let u=[],d=[];function f([o,n]){return Math.abs(n-e*o-t)<=1}function h([e,t]){const[o,n]=[...p([e,t])];return o>=N&&o<=J&&n>=i&&n<=B}function p([e,t]){return[N+e,B-t]}return f(l)&&h(l)&&(u=p(l)),f(s)&&h(s)&&(u=p(s)),f(a)&&h(a)&&(d=p(a)),f(c)&&h(c)&&(d=p(c)),[...u,...d]}o.forEach((e=>{if(!e.show)return;const{key:o}=e;switch(o){case"fetalPresentation":{const{range:i,show:r}=re.find((e=>e.key===o));if(r){const r=O(o,i,0);n.push(t([N,r,J,r],{...e}))}break}case"alert":if(l){const{key:o,range:a}=r||{},c=216e5,u={time:w(new Date(m(l.time)+c),"yyyy-MM-dd HH:mm"),value:10},[d,f]=[X(l.time)-N,B-O(o,a,l.value)],[h,p]=[X(u.time)-N,B-O(o,a,u.value)],g=(p-f)/(h-d),v=f-d*g,y=s(g,v);y.length>0&&(n.push(t(y,{...e})),Object.assign(i,{k:g,b:v}))}break;case"handling":if(l){const{k:o,b:r}=i,a=144e5,c=s(o,r-(X(w(new Date(m(l.time)+a),"yyyy-MM-dd HH:mm"))-X(l.time))*o);c.length>0&&n.push(t(c,{...e}))}}})),x.value.add(...n)}(),se(),function(){function e(e,t){const o=re.findIndex((t=>t.key===e.key));return{renderItem:()=>e.title,origin:{title:e.title,unit:e.unit,dataIndex:o,key:e.key},pointer:t}}S.event.evented&&x.value.on("mouse:up",(t=>{if(3===t.button){const{x:o=0,y:n=0}=t.pointer||{};o>=N&&o<=J&&n>=W&&n<=B&&(E.point={x:o,y:n},E.show=!0,t.target?(E.target=t.target,E.list=["删除节点"],[...le].forEach((e=>{e.origin&&e.left===t.target.left&&e.top===t.target.top&&E.list.push({renderItem:()=>e.origin.title,origin:{...e.origin},mode:"remove",pointer:t.pointer})}))):(E.target=null,E.list=["新增节点"],re.filter((e=>e.show)).forEach((i=>{if(!M([...le],o,"key").includes(i.key)){if(["cervix","fetalPresentation"].includes(i.key)&&n<ee)return;E.list.push(e(i,t.pointer))}})),1===E.list.length&&(E.show=!1,Y("repeat"),console.log("当前时间段内无可新增节点"))))}}))}(),function(){const e=Q-Z/2;function t(e,t){if(!e.length)return;let n=W;const i=[];e.forEach((e=>{const o=(e.alias||e.title).split("").join("\n"),a=K.findIndex((t=>t.key===e.key));if(e.alias){const s=r([t,n],{value:o,...l,originY:"top",...e.titleStyle});o&&(n+=s.height+15,i.push(s))}else{const{text:r,icon:l}=s(o,e,{text:{originX:"center",originY:"top",left:t,top:n},icon:{left:t,topY:n,originX:"center",originY:"top",origin:{type:e.type,dataIndex:a},...S.event}},"vertical");n+=r.height+l.height+15,(c=l).on("moving",(()=>{c.set("originY","center"),H(c)?(ue(c),de(c)):P.show=!1})),c.on("mouseup:before",(e=>{if(P.show=!1,0===e.e.button&&H(c))if(M([...le],c.left,"key").includes(c.origin.key))Y("repeat");else{const e={data:{time:A(c.left),value:L(c.origin.key,c.top)},...c.origin};C("add",e),ae(e)}!function(e){e.setCoords().set({originY:"top",left:e.originLeft,top:e.originTop})}(c)})),i.push(r,l)}var c})),o(i),x.value.add(...i)}function o(e){const t=k(e),o=(B-W)/2,n=(t.height+t.top-W)/2;e.forEach((e=>{const t=e.top+o-n;e.set({top:t,originTop:t})}))}t($,R/2),t(q,e)}(),{clickMenu:function({item:e,target:t}){const o={...e.origin};"remove"===e.mode?(C("remove",o),ae(o,"remove")):(Object.assign(o,{data:{time:A(e.pointer.x),value:L(e.origin.key,e.pointer.y)}}),C("add",o),ae(o))},redrawPoints:ce}}export{x as useBirthProcess};
|
@@ -1 +1 @@
|
|
1
|
-
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),
|
1
|
+
import{reactive as e,computed as a,watch as t,toRefs as l}from"vue";import{defaultBorderStyle as r}from"../useDraw.js";import"../../../../../shared/utils/fabricjs/index.js";import"date-fns";import{getTime as u}from"../../utils/index.js";import"lodash-es";import"../useEvent.js";import"../temperature/useShadow.js";import"@vueuse/shared";import"naive-ui";import"@vueuse/core";import{useBirthProcess as i}from"./useBirthProcess.js";function n(n,d,s,o,v,c){const h=e({select:null,redrawPoints:null,clickMenu:null}),m=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"left"===e&&a)))),p=a((()=>d.data.scaleValues.map((e=>{var a;return{...e,width:null!=(a=e.width)?a:60}})).filter((({layout:e="left",show:a=!0})=>"right"===e&&a)))),f=a((()=>{var e;return(null==(e=p.value)?void 0:e.length)?30:0})),g=a((()=>{var e;return 30+(null==(e=m.value)?void 0:e.reduce(((e,a)=>e+=a.width),0))})),w=a((()=>{var e;const{width:a}=d.data,t=null==(e=p.value)?void 0:e.reduce(((e,a)=>e+=a.width),0);return a-f.value-t})),x=a((()=>d.data.grid.mainXCell)),y=a((()=>{const e=d.data.grid.mainYCell||14;return d.data.scaleValues.find((e=>e.show&&"FHR"===e.key))||14!==e?e:10})),V=a((()=>(w.value-g.value)/x.value)),b=a((()=>{const e=d.data.padding||[5,5],a=B("top"),t=B("bottom");return[a?0:e[0],t?0:e[1]]})),k=a((()=>{const{height:e}=d.data,a=B();return(e-b.value.reduce(((e,a)=>e+a),0))/(y.value+a)})),C=a((()=>{const e=B("top");return k.value*e+b.value[0]})),j=a((()=>{var e;const{scaleValues:a}=d.data;if(!(null==(e=a.find((e=>"FHR"===e.key)))?void 0:e.show)&&!C.value)return C.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 A.value-b.value[0]-l*r*k.value})),A=a((()=>{const{height:e}=d.data,a=B("bottom");return e-k.value*a-b.value[1]})),Y=a((()=>u(d.data.xAxis.time.startTime))),S=a((()=>36e5/V.value)),H=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"cervix"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),P=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"FHR"===e.key));return k.value/((null==a?void 0:a.spaceValue)||10)})),R=a((()=>{const{scaleValues:e}=d.data,a=e.find((e=>"fetalPresentation"===e.key));return k.value/((null==a?void 0:a.spaceValue)||1)})),X=a((()=>{var e;return(null==(e=d.data.grid)?void 0:e.event)||{selectable:!0,evented:!0,hovered:!0}}));function B(e){const{xAxis:a}=d.data;return Object.values(a).reduce(((a,t)=>(t.show&&(!e||e&&t.position===e)&&a++,a)),0)}const F=e({canvasWidth:d.data.width,canvasHeight:d.data.height,borderStyle:{...r,...d.data.borderStyle||{}},selectionStyle:d.data.selectionStyle||{},grid:d.data.grid,other:d.data.other,originX:g.value,endX:w.value,originY:C.value,endY:A.value,xCellWidth:V.value,yCellHeight:k.value,gridXNumber:x.value,gridYNumber:y.value,xAxis:d.data.xAxis,leftScales:m.value,rightScales:p.value,leftAddAreaWidth:30,rightAddAreaWidth:f.value,startTime:Y.value,timeXCell:S.value,cervixYCell:H.value,FHRYCell:P.value,fetalPresentationYCell:R.value,scaleValues:d.data.scaleValues,event:X.value,originYCervix:j.value,scalebarBorder:!Reflect.has(d.data,"scalebarBorder")||d.data.scalebarBorder,padding:b.value});return t((()=>n.value),(e=>{e&&function(){const{clickMenu:e,redrawPoints:a}=i(n,F,s,v,c);h.redrawPoints=a,h.clickMenu=e}()}),{immediate:!0}),{propItems:F,...l(h)}}export{n as useBirthProcessChart};
|