cnhis-design-vue 3.2.12-release.1 → 3.2.13-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -87
- package/es/components/ai-chat/index.d.ts +83 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +84 -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 +59 -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/components/ChatPatient.vue.d.ts +58 -0
- package/es/components/ai-chat/src/components/ChatPatient.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatPatient.vue2.js +1 -0
- package/es/components/ai-chat/src/types/index.d.ts +6 -3
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/button-print/src/components/NewPrintComponent.vue2.js +1 -1
- package/es/components/button-print/src/utils/print.js +1 -1
- package/es/components/callback/src/components/render/popupMaps.d.ts +31 -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/useCommon.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 +31 -0
- package/es/components/iho-table/src/IhoTable.vue.d.ts +32 -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/headerPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/index.js +1 -1
- package/es/components/iho-table/src/plugins/rendererPlugins/editableWidgets/timeRendererPlugin/editTime.vue2.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 +15 -0
- package/es/components/iho-table/style/index.css +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +1 -1
- package/es/components/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 +50 -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 +530 -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,14 @@ 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<Partial<{
|
38
|
+
info: import("../../shared/types").AnyObject;
|
39
|
+
queryPatient: (props: {
|
40
|
+
keyword: string;
|
41
|
+
}) => Promise<import("../../shared/types").AnyObject[]>;
|
42
|
+
}>>;
|
43
|
+
};
|
36
44
|
}, {
|
37
45
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
38
46
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -69,6 +77,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
69
77
|
queryPrompt: {
|
70
78
|
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
71
79
|
};
|
80
|
+
patientInfo: {
|
81
|
+
type: import("vue").PropType<Partial<{
|
82
|
+
info: import("../../shared/types").AnyObject;
|
83
|
+
queryPatient: (props: {
|
84
|
+
keyword: string;
|
85
|
+
}) => Promise<import("../../shared/types").AnyObject[]>;
|
86
|
+
}>>;
|
87
|
+
};
|
72
88
|
}>> & {
|
73
89
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
74
90
|
}>>;
|
@@ -108,8 +124,11 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
108
124
|
children?: any[] | undefined;
|
109
125
|
}[]>;
|
110
126
|
showPrompt: import("vue").Ref<boolean>;
|
127
|
+
currentShortcutId: import("vue").Ref<string>;
|
128
|
+
showPatient: import("vue").Ref<boolean>;
|
111
129
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
112
130
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
131
|
+
patient: import("vue").ComputedRef<string>;
|
113
132
|
recorderStart: () => Promise<void>;
|
114
133
|
isValidJSON: (str: string) => boolean;
|
115
134
|
getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
|
@@ -132,6 +151,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
132
151
|
ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
133
152
|
ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
134
153
|
SparklesSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
154
|
+
PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
135
155
|
ChatPrompt: import("vue").DefineComponent<{
|
136
156
|
show: {
|
137
157
|
type: BooleanConstructor;
|
@@ -175,6 +195,61 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
175
195
|
}, {
|
176
196
|
show: boolean;
|
177
197
|
}>;
|
198
|
+
ChatPatient: import("vue").DefineComponent<{
|
199
|
+
show: {
|
200
|
+
type: BooleanConstructor;
|
201
|
+
};
|
202
|
+
}, {
|
203
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
204
|
+
show: {
|
205
|
+
type: BooleanConstructor;
|
206
|
+
};
|
207
|
+
}>> & {
|
208
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
209
|
+
}>>;
|
210
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
211
|
+
patientInfo: any;
|
212
|
+
state: any;
|
213
|
+
formValue: {
|
214
|
+
businessType: null;
|
215
|
+
vaa01: null;
|
216
|
+
vaa07: string;
|
217
|
+
};
|
218
|
+
rules: {
|
219
|
+
businessType: {
|
220
|
+
required: boolean;
|
221
|
+
trigger: string;
|
222
|
+
message: string;
|
223
|
+
};
|
224
|
+
vaa01: {
|
225
|
+
required: boolean;
|
226
|
+
trigger: string[];
|
227
|
+
message: string;
|
228
|
+
};
|
229
|
+
};
|
230
|
+
options: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
231
|
+
formRef: import("vue").Ref<any>;
|
232
|
+
renderLabel: (option: import("../../shared/types").AnyObject) => string;
|
233
|
+
handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
|
234
|
+
handleSearch: (keyword: string) => Promise<void>;
|
235
|
+
handleValidateClick: (e: MouseEvent) => void;
|
236
|
+
NDrawer: any;
|
237
|
+
NDrawerContent: any;
|
238
|
+
NForm: any;
|
239
|
+
NFormItem: any;
|
240
|
+
NButton: any;
|
241
|
+
NRadioGroup: any;
|
242
|
+
NRadio: any;
|
243
|
+
NSelect: any;
|
244
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
245
|
+
show: {
|
246
|
+
type: BooleanConstructor;
|
247
|
+
};
|
248
|
+
}>> & {
|
249
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
250
|
+
}, {
|
251
|
+
show: boolean;
|
252
|
+
}>;
|
178
253
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
179
254
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
180
255
|
userAvatar: {
|
@@ -210,6 +285,14 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
210
285
|
queryPrompt: {
|
211
286
|
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
212
287
|
};
|
288
|
+
patientInfo: {
|
289
|
+
type: import("vue").PropType<Partial<{
|
290
|
+
info: import("../../shared/types").AnyObject;
|
291
|
+
queryPatient: (props: {
|
292
|
+
keyword: string;
|
293
|
+
}) => Promise<import("../../shared/types").AnyObject[]>;
|
294
|
+
}>>;
|
295
|
+
};
|
213
296
|
}>> & {
|
214
297
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
215
298
|
}, {
|
@@ -35,6 +35,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
35
35
|
queryPrompt: {
|
36
36
|
type: PropType<QueryPrompt>;
|
37
37
|
};
|
38
|
+
patientInfo: {
|
39
|
+
type: PropType<Partial<{
|
40
|
+
info: AnyObject;
|
41
|
+
queryPatient: (props: {
|
42
|
+
keyword: string;
|
43
|
+
}) => Promise<AnyObject[]>;
|
44
|
+
}>>;
|
45
|
+
};
|
38
46
|
}, {
|
39
47
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
40
48
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -71,6 +79,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
71
79
|
queryPrompt: {
|
72
80
|
type: PropType<QueryPrompt>;
|
73
81
|
};
|
82
|
+
patientInfo: {
|
83
|
+
type: PropType<Partial<{
|
84
|
+
info: AnyObject;
|
85
|
+
queryPatient: (props: {
|
86
|
+
keyword: string;
|
87
|
+
}) => Promise<AnyObject[]>;
|
88
|
+
}>>;
|
89
|
+
};
|
74
90
|
}>> & {
|
75
91
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
76
92
|
}>>;
|
@@ -85,7 +101,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
85
101
|
} | {}>;
|
86
102
|
ChatFooter: import("vue").DefineComponent<{}, {
|
87
103
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
88
|
-
audioSdk: import("
|
104
|
+
audioSdk: import("../../../components/index").CAudioSDK;
|
89
105
|
emit: (event: string, ...args: any[]) => void;
|
90
106
|
shortcutList: any;
|
91
107
|
state: any;
|
@@ -110,8 +126,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
110
126
|
children?: any[] | undefined;
|
111
127
|
}[]>;
|
112
128
|
showPrompt: import("vue").Ref<boolean>;
|
129
|
+
currentShortcutId: import("vue").Ref<string>;
|
130
|
+
showPatient: import("vue").Ref<boolean>;
|
113
131
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
114
132
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
133
|
+
patient: import("vue").ComputedRef<string>;
|
115
134
|
recorderStart: () => Promise<void>;
|
116
135
|
isValidJSON: (str: string) => boolean;
|
117
136
|
getShortcutName: (item: string | AnyObject) => any;
|
@@ -134,6 +153,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
134
153
|
ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
135
154
|
ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
136
155
|
SparklesSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
156
|
+
PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
137
157
|
ChatPrompt: import("vue").DefineComponent<{
|
138
158
|
show: {
|
139
159
|
type: BooleanConstructor;
|
@@ -177,6 +197,61 @@ declare const _default: import("vue").DefineComponent<{
|
|
177
197
|
}, {
|
178
198
|
show: boolean;
|
179
199
|
}>;
|
200
|
+
ChatPatient: import("vue").DefineComponent<{
|
201
|
+
show: {
|
202
|
+
type: BooleanConstructor;
|
203
|
+
};
|
204
|
+
}, {
|
205
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
206
|
+
show: {
|
207
|
+
type: BooleanConstructor;
|
208
|
+
};
|
209
|
+
}>> & {
|
210
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
211
|
+
}>>;
|
212
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
213
|
+
patientInfo: any;
|
214
|
+
state: any;
|
215
|
+
formValue: {
|
216
|
+
businessType: null;
|
217
|
+
vaa01: null;
|
218
|
+
vaa07: string;
|
219
|
+
};
|
220
|
+
rules: {
|
221
|
+
businessType: {
|
222
|
+
required: boolean;
|
223
|
+
trigger: string;
|
224
|
+
message: string;
|
225
|
+
};
|
226
|
+
vaa01: {
|
227
|
+
required: boolean;
|
228
|
+
trigger: string[];
|
229
|
+
message: string;
|
230
|
+
};
|
231
|
+
};
|
232
|
+
options: import("vue").Ref<AnyObject[]>;
|
233
|
+
formRef: import("vue").Ref<any>;
|
234
|
+
renderLabel: (option: AnyObject) => string;
|
235
|
+
handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
|
236
|
+
handleSearch: (keyword: string) => Promise<void>;
|
237
|
+
handleValidateClick: (e: MouseEvent) => void;
|
238
|
+
NDrawer: any;
|
239
|
+
NDrawerContent: any;
|
240
|
+
NForm: any;
|
241
|
+
NFormItem: any;
|
242
|
+
NButton: any;
|
243
|
+
NRadioGroup: any;
|
244
|
+
NRadio: any;
|
245
|
+
NSelect: any;
|
246
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
247
|
+
show: {
|
248
|
+
type: BooleanConstructor;
|
249
|
+
};
|
250
|
+
}>> & {
|
251
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
252
|
+
}, {
|
253
|
+
show: boolean;
|
254
|
+
}>;
|
180
255
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
181
256
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
182
257
|
userAvatar: {
|
@@ -212,6 +287,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
212
287
|
queryPrompt: {
|
213
288
|
type: PropType<QueryPrompt>;
|
214
289
|
};
|
290
|
+
patientInfo: {
|
291
|
+
type: PropType<Partial<{
|
292
|
+
info: AnyObject;
|
293
|
+
queryPatient: (props: {
|
294
|
+
keyword: string;
|
295
|
+
}) => Promise<AnyObject[]>;
|
296
|
+
}>>;
|
297
|
+
};
|
215
298
|
}>> & {
|
216
299
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
217
300
|
}, {
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,reactive as t,provide as o,toRefs as
|
1
|
+
import{defineComponent as e,reactive as t,provide as o,toRefs as s,computed as r,openBlock as i,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as p,createVNode as u,createBlock as l,createCommentVNode as d}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,selectedPatient:null});return o(v,{...s(F),state:b,isSmall:r((()=>"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?d("v-if",!0):(i(),l(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 t,inject as e,ref as n,computed as o,createVNode as i}from"vue";import{NButton as l}from"naive-ui";import{InjectionAIChat as a}from"../types/index.js";import"../../../index.js";import{isArray as r}from"lodash-es";import s from"../../../form-render/index.js";import u from"../../../template-render/index.js";var d=t({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})},instructionId:{type:String}},emits:["button-click"],setup(t,{attrs:d,slots:c,emit:m}){const{patientInfo:p,state:f}=e(a),v=n([]),g=n(),b=o((()=>{var e,n;return!!(null==(n=null==(e=t.msgItem)?void 0:e.content)?void 0:n.body)}));function y(t){try{return JSON.parse(t),!0}catch(t){return!1}}const h=t.msgItem.content;function I(t){const{eventName:e,data:n}=t;e&&m("button-click",{buttonInfo:n,isBI:!0})}function x(t){h.data[t.button.id+"Disabled"]=!0,m("button-click",{buttonInfo:t.button})}return b.value&&(v.value=(h.body.items||[]).map((e=>{var n,o;const i={html_type:e.type,val_key:e.code,name:e.name,elem_width:12,default_val:e.value,lazyRequest:!0,requestCache:!0,urlConfig:{nameKey:null!=(n=e.labelField)?n:"label"},option:[],is_null:e.required?"0":"1"};return"SELECT"===i.html_type&&(i.option=e.options,"fixed"===e.dataSourceType&&(null==(o=e.options)?void 0:o.length)||(i.html_type="REMOTE_SEARCH",Object.assign(i.urlConfig,{url:"/flow/api/instruction/parameter/getOptionsValues",method:"post",params:{instructionId:t.instructionId,code:e.code,configs:p.value.info},dependKey:[]}),r(e.dependencies)&&e.dependencies.length&&(i.urlConfig.dependKey=e.dependencies))),i}))),()=>{var e;return i("div",{class:"card"},[b.value?[i("p",null,[h.title||h.header.title]),i(s,{disabled:t.msgItem.disabled,column:12,ref:g,"field-list":v.value},null),h.footer.buttons.map((e=>function(e){const n={width:"100%","--n-height":"36px",fontSize:"15px",marginTop:"10px"},o=b.value?{...n,marginTop:"0"}:n;return i(l,{style:o,secondary:!0,class:"gradient",disabled:t.msgItem.disabled,onClick:async function(){if(b.value){if(!g.value)return;const t=g.value.getFormValues();try{await g.value.validate(),h.body.items.forEach((e=>{t[e.code]&&(e.value=t[e.code])})),f.loading=!0,m("button-click",{values:t,buttonInfo:e,isForm:!0})}catch(t){}}else m("button-click")}},{default:()=>[b.value?null==e?void 0:e.text:h.buttonName]})}(e)))]:i(u,{config:y(null==(e=h.settings)?void 0:e.setting)?JSON.parse(h.settings.setting):null,data:h.data,"onModule-click":I,"onButton-click":x},null)])}}});export{d as default};
|
@@ -28,8 +28,11 @@ 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>;
|
32
|
+
showPatient: import("vue").Ref<boolean>;
|
31
33
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
32
34
|
showMagicWand: import("vue").ComputedRef<boolean>;
|
35
|
+
patient: import("vue").ComputedRef<string>;
|
33
36
|
recorderStart: () => Promise<void>;
|
34
37
|
isValidJSON: (str: string) => boolean;
|
35
38
|
getShortcutName: (item: string | AnyObject) => any;
|
@@ -52,6 +55,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
52
55
|
ChevronBack: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
53
56
|
ChevronForward: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
54
57
|
SparklesSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
58
|
+
PeopleOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
55
59
|
ChatPrompt: import("vue").DefineComponent<{
|
56
60
|
show: {
|
57
61
|
type: BooleanConstructor;
|
@@ -95,5 +99,60 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
95
99
|
}, {
|
96
100
|
show: boolean;
|
97
101
|
}>;
|
102
|
+
ChatPatient: import("vue").DefineComponent<{
|
103
|
+
show: {
|
104
|
+
type: BooleanConstructor;
|
105
|
+
};
|
106
|
+
}, {
|
107
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
108
|
+
show: {
|
109
|
+
type: BooleanConstructor;
|
110
|
+
};
|
111
|
+
}>> & {
|
112
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
113
|
+
}>>;
|
114
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
115
|
+
patientInfo: any;
|
116
|
+
state: any;
|
117
|
+
formValue: {
|
118
|
+
businessType: null;
|
119
|
+
vaa01: null;
|
120
|
+
vaa07: string;
|
121
|
+
};
|
122
|
+
rules: {
|
123
|
+
businessType: {
|
124
|
+
required: boolean;
|
125
|
+
trigger: string;
|
126
|
+
message: string;
|
127
|
+
};
|
128
|
+
vaa01: {
|
129
|
+
required: boolean;
|
130
|
+
trigger: string[];
|
131
|
+
message: string;
|
132
|
+
};
|
133
|
+
};
|
134
|
+
options: import("vue").Ref<AnyObject[]>;
|
135
|
+
formRef: import("vue").Ref<any>;
|
136
|
+
renderLabel: (option: AnyObject) => string;
|
137
|
+
handleUpdateValue: (value: string, option: import("naive-ui").SelectOption) => void;
|
138
|
+
handleSearch: (keyword: string) => Promise<void>;
|
139
|
+
handleValidateClick: (e: MouseEvent) => void;
|
140
|
+
NDrawer: any;
|
141
|
+
NDrawerContent: any;
|
142
|
+
NForm: any;
|
143
|
+
NFormItem: any;
|
144
|
+
NButton: any;
|
145
|
+
NRadioGroup: any;
|
146
|
+
NRadio: any;
|
147
|
+
NSelect: any;
|
148
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
149
|
+
show: {
|
150
|
+
type: BooleanConstructor;
|
151
|
+
};
|
152
|
+
}>> & {
|
153
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
154
|
+
}, {
|
155
|
+
show: boolean;
|
156
|
+
}>;
|
98
157
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
99
158
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as
|
1
|
+
import{defineComponent as e,inject as l,ref as o,computed as t,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as r,normalizeClass as u,unref as i,createElementVNode as c,createBlock as d,withCtx as v,createVNode as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,Fragment as k,renderList as y,withModifiers as w,getCurrentInstance as g}from"vue";import{NButton as b,NIcon as C,NPopover as x,NInput as _,NTag as I,NBreadcrumb as j,NBreadcrumbItem as z}from"naive-ui";import{PeopleOutline as T,SparklesSharp as K,PaperPlane as M,ChevronBack as P,ChevronForward as D}from"@vicons/ionicons5";import{InjectionAIChatEmits as S,InjectionAIChat as U}from"../types/index.js";import R from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as A,isString as E,last as L}from"lodash-es";import{useTheme as B}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 F from"./ChatPrompt.vue.js";import W from"./ChatPatient.vue.js";const $={class:"menu-box fillet-8"},q={class:"input-wrapper fillet-10"},H=c("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),c("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"}),c("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),c("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"],G={class:"command-box"},J={class:"command-box__header"},O={key:0,class:"title"},Q={class:"command-box__menu"},X=["onMouseover","onClick"],Y={class:"label"},Z={class:"remark"};var ee=e({__name:"ChatFooter",setup(e){const ee=B(),le=R.create(),oe=l(S),{shortcutList:te,state:ne,isSmall:ae,audioTimed:se,commandList:re}=l(U),ue=o(),ie=o(""),ce=o(!1),de=o([]),ve=o(A(re.value||[])),me=o(!1),pe=o(""),he=o(!1),fe=t((()=>!ie.value.replace(/( |\s|<br>)+/g,""))),ke=t((()=>{var e;return!ie.value&&!(null==(e=ue.value)?void 0:e.activated.value)})),ye=t((()=>{if(!ne.selectedPatient)return"选择患者";const{bcq04b:e,vaa05:l}=ne.selectedPatient;return`${e}床/${l}`}));async function we(){try{const e=await le.start(g(),{allowPunctuationMark:!1,timed:se.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:l}=e.data;ie.value=l}catch(e){console.log(e)}}function ge(e){var l;if(E(e))return e;const{content:o}=(null==(l=null==e?void 0:e.contents)?void 0:l[0])||{};return o.instructionName}function be(){var e;ce.value=!1,ve.value=A(re.value||[]),de.value=[],(null==(e=re.value)?void 0:e.length)&&(ce.value=!0,pe.value=ve.value[0].shortcutId)}function Ce(e){if("Slash"!==e.code||ne.selectedCommand||ie.value)if("Backspace"===e.key)ce.value=!1,!ie.value.startsWith("/")&&!ie.value.startsWith("、")||2!==ie.value.length||ne.selectedCommand?!ie.value&&ne.selectedCommand&&(e.preventDefault(),ne.selectedCommand=null,ie.value="/",be()):be();else if(ce.value&&["ArrowUp","ArrowDown"].includes(e.key)){const l=ve.value.findIndex((e=>e.shortcutId===pe.value));if("ArrowUp"===e.key){const e=l>0?l-1:ve.value.length-1;pe.value=ve.value[e].shortcutId}else if("ArrowDown"===e.key){const e=l<ve.value.length-1?l+1:0;pe.value=ve.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(),ce.value){Ie(ve.value.find((e=>e.shortcutId===pe.value)))}else _e()}else ce.value=!1;else be()}function xe(e){!e&&ne.selectedPrompt&&(ne.selectedPrompt=null)}function _e(){fe.value||(ne.sending=!0,ne.loading=!0,ne.sendContent=ie.value,ie.value="")}function Ie(e){var l;pe.value=e.shortcutId,ue.value.focus(),(null==(l=e.children)?void 0:l.length)?(ve.value=e.children,pe.value=ve.value[0].shortcutId,de.value.push(e)):(ne.selectedCommand=e||{},ce.value=!1,ie.value="")}function je(){var e;de.value.pop(),ve.value=L(de.value)?null==(e=L(de.value))?void 0:e.children:A(re.value||[]),pe.value=ve.value[0].shortcutId,ue.value.focus()}return n((()=>ne.sendContent),(e=>{e&&!ne.sending&&(ie.value=e)})),a((()=>{le.destroy()})),(e,l)=>(s(),r("section",{class:u(["chat-footer",i(ne).loading?"disabled":""])},[c("div",$,[i(ae)?f("v-if",!0):(s(),d(i(b),{key:0,secondary:"",size:"small",onClick:l[0]||(l[0]=()=>he.value=!0)},{icon:v((()=>[m(i(C),{color:i(ee)["--c-primary-color"],size:"20",component:i(T)},null,8,["color","component"])])),default:v((()=>[p(" "+h(i(ye)),1)])),_:1})),i(te)&&i(te).length>0?(s(!0),r(k,{key:1},y(i(te),(e=>(s(),d(i(b),{secondary:"",size:"small",round:i(ae),key:ge(e),onClick:()=>function(e){var l;if(E(e))ie.value=e;else{const o=null==(l=null==e?void 0:e.contents)?void 0:l[0];oe("button-click",{msgItem:o,item:e})}}(e)},{default:v((()=>[p(h(ge(e)),1)])),_:2},1032,["round","onClick"])))),128)):f("v-if",!0)]),m(i(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ce.value,onClickoutside:l[5]||(l[5]=e=>ce.value=!1)},{trigger:v((()=>[c("div",q,[i(ae)?(s(),d(i(_),{key:0,ref_key:"inputRef",ref:ue,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:i(ne).loading,value:ie.value,"onUpdate:value":l[2]||(l[2]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>[p(" /"+h(i(ne).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[1]||(l[1]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:v((()=>[m(i(b),{text:"",disabled:i(ne).loading,onClick:we},{icon:v((()=>[m(i(C),{size:"30"},{default:v((()=>[H])),_:1})])),_:1},8,["disabled"]),m(i(b),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:i(fe),onClick:_e},{icon:v((()=>[m(i(C),{color:"#fff",size:"20",component:i(M)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),r(k,{key:1},[m(i(_),{ref_key:"inputRef",ref:ue,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:i(ne).loading,autosize:{minRows:2,maxRows:7},value:ie.value,"onUpdate:value":l[4]||(l[4]=e=>ie.value=e),onKeydownCapture:Ce,onInput:xe},{prefix:v((()=>[i(ne).selectedCommand&&i(ne).selectedCommand.shortcutTitle?(s(),d(i(I),{key:0,bordered:!1,color:{textColor:i(ee)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:v((()=>{var e;return[p(" /"+h(null==(e=i(ne).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):i(ke)?(s(),d(i(b),{key:1,text:"",onClick:l[3]||(l[3]=()=>me.value=!0)},{default:v((()=>[m(i(C),{color:"#8f66f7",size:"18",component:i(K)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),c("div",N,[c("span",{class:u(["btn-send","gradient","fillet-8",i(fe)?"disabled":""]),disabled:i(fe),onClick:_e},[m(i(C),{color:"#fff",size:"22",component:i(M)},null,8,["component"])],10,V)])],64))])])),default:v((()=>[c("div",G,[c("div",J,[0===de.value.length?(s(),r("span",O,"推荐指令")):(s(),r(k,{key:1},[m(i(b),{text:"",onClick:je},{default:v((()=>[m(i(C),{color:"#999",size:"20",component:i(P)},null,8,["component"])])),_:1}),m(i(j),null,{default:v((()=>[(s(!0),r(k,null,y(de.value,(e=>(s(),d(i(z),{key:e.shortcutId},{default:v((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),c("div",Q,[(s(!0),r(k,null,y(ve.value,(e=>(s(),r("div",{class:u(["menu-item",e.children&&e.children.length?"":"selectable",pe.value===e.shortcutId?"selected":""]),key:e.shortcutId,onMouseover:w((()=>pe.value=e.shortcutId),["stop"]),onClick:()=>Ie(e)},[c("span",Y,h(e.shortcutTitle),1),c("span",Z,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),d(i(C),{key:0,color:"#999",size:"20",component:i(D)},null,8,["component"])):f("v-if",!0)],42,X)))),128))])])])),_:1},8,["show"]),m(F,{show:me.value,"onUpdate:show":l[6]||(l[6]=e=>me.value=e)},null,8,["show"]),m(W,{show:he.value,"onUpdate:show":l[7]||(l[7]=e=>he.value=e)},null,8,["show"])],2))}});export{ee as default};
|