cnhis-design-vue 3.2.12-release.0 → 3.2.12-release.1
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 +56 -0
- package/es/components/ai-chat/src/Index.vue.d.ts +57 -1
- package/es/components/ai-chat/src/Index.vue2.js +1 -1
- package/es/components/ai-chat/src/components/ChatCard.d.ts +18 -0
- package/es/components/ai-chat/src/components/ChatCard.js +1 -0
- package/es/components/ai-chat/src/components/ChatFooter.vue.d.ts +47 -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/ChatPrompt.vue.d.ts +45 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue.js +1 -0
- package/es/components/ai-chat/src/components/ChatPrompt.vue2.js +1 -0
- package/es/components/ai-chat/src/types/index.d.ts +7 -0
- package/es/components/ai-chat/style/index.css +1 -1
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +1 -0
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +1 -0
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +1 -0
- package/es/components/classification/src/components/table-modal/index.vue.d.ts +0 -3
- package/es/components/field-set/src/FieldColor.vue.d.ts +1 -1
- package/es/components/field-set/src/components/edit-dialog.vue.d.ts +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/src/plugins/dynamicFilterRenderPlugin/index.js +1 -1
- package/es/components/iho-table/src/plugins/filterRenderPlugin/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/types/index.d.ts +1 -0
- package/es/components/index.css +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/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/components/VueDraggable/src/vuedraggable.d.ts +86 -0
- package/es/shared/package.json.js +1 -1
- package/es/shared/utils/fabricjs/index.d.ts +6823 -0
- package/es/shared/utils/tapable/index.d.ts +139 -0
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,87 +1,87 @@
|
|
1
|
-
# 安装
|
2
|
-
|
3
|
-
```shell
|
4
|
-
npm i cnhis-design-vue@[版本号]
|
5
|
-
# or
|
6
|
-
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
-
```
|
8
|
-
|
9
|
-
## 1.全局引入
|
10
|
-
|
11
|
-
```typescript
|
12
|
-
// main.ts
|
13
|
-
import { createApp } from 'vue';
|
14
|
-
import App from './App.vue';
|
15
|
-
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
-
import cui from 'cnhis-design-vue';
|
17
|
-
|
18
|
-
const app = createApp(App);
|
19
|
-
app.use(cui).mount('#app');
|
20
|
-
```
|
21
|
-
|
22
|
-
## 2. 按需引入
|
23
|
-
|
24
|
-
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
-
|
26
|
-
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
-
|
28
|
-
```shell
|
29
|
-
# 安装自动导入样式的插件
|
30
|
-
npm i -d vite-plugin-style-import
|
31
|
-
```
|
32
|
-
|
33
|
-
```typescript
|
34
|
-
// vite.config.ts
|
35
|
-
import { defineConfig } from 'vite';
|
36
|
-
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
-
|
38
|
-
export default defineConfig({
|
39
|
-
plugins: [
|
40
|
-
// ...otherPlugins
|
41
|
-
createStyleImportPlugin({
|
42
|
-
libs: [
|
43
|
-
{
|
44
|
-
libraryName: 'cnhis-design-vue',
|
45
|
-
esModule: true,
|
46
|
-
ensureStyleFile: true,
|
47
|
-
resolveStyle: name => {
|
48
|
-
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
]
|
52
|
-
})
|
53
|
-
]
|
54
|
-
});
|
55
|
-
```
|
56
|
-
|
57
|
-
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
-
|
59
|
-
```typescript
|
60
|
-
// main.ts
|
61
|
-
import 'cnhis-design-vue/es/components/index.css';
|
62
|
-
```
|
63
|
-
|
64
|
-
## 3.FAQ
|
65
|
-
|
66
|
-
### 3.1 项目打包后样式丢失
|
67
|
-
|
68
|
-
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
-
|
70
|
-
```typescript
|
71
|
-
// vite.config.ts
|
72
|
-
import { defineConfig } from 'vite';
|
73
|
-
|
74
|
-
export default defineConfig({
|
75
|
-
build: {
|
76
|
-
rollupOptions: {
|
77
|
-
// ..otherOptions
|
78
|
-
output: {
|
79
|
-
dir: './dist',
|
80
|
-
manualChunks: {
|
81
|
-
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
});
|
87
|
-
```
|
1
|
+
# 安装
|
2
|
+
|
3
|
+
```shell
|
4
|
+
npm i cnhis-design-vue@[版本号]
|
5
|
+
# or
|
6
|
+
yarn add cnhis-design-vue@[版本号] #推荐
|
7
|
+
```
|
8
|
+
|
9
|
+
## 1.全局引入
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
// main.ts
|
13
|
+
import { createApp } from 'vue';
|
14
|
+
import App from './App.vue';
|
15
|
+
import 'cnhis-design-vue/es/packages/index.css';
|
16
|
+
import cui from 'cnhis-design-vue';
|
17
|
+
|
18
|
+
const app = createApp(App);
|
19
|
+
app.use(cui).mount('#app');
|
20
|
+
```
|
21
|
+
|
22
|
+
## 2. 按需引入
|
23
|
+
|
24
|
+
组件现在支持了自动按需引入, 但是样式文件需要额外的处理
|
25
|
+
|
26
|
+
### 2.1 样式处理方式1 (按需引入样式)
|
27
|
+
|
28
|
+
```shell
|
29
|
+
# 安装自动导入样式的插件
|
30
|
+
npm i -d vite-plugin-style-import
|
31
|
+
```
|
32
|
+
|
33
|
+
```typescript
|
34
|
+
// vite.config.ts
|
35
|
+
import { defineConfig } from 'vite';
|
36
|
+
import { createStyleImportPlugin } from 'vite-plugin-style-import';
|
37
|
+
|
38
|
+
export default defineConfig({
|
39
|
+
plugins: [
|
40
|
+
// ...otherPlugins
|
41
|
+
createStyleImportPlugin({
|
42
|
+
libs: [
|
43
|
+
{
|
44
|
+
libraryName: 'cnhis-design-vue',
|
45
|
+
esModule: true,
|
46
|
+
ensureStyleFile: true,
|
47
|
+
resolveStyle: name => {
|
48
|
+
return `cnhis-design-vue/es/components/${ name.slice(2) }/style/index.css`;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
})
|
53
|
+
]
|
54
|
+
});
|
55
|
+
```
|
56
|
+
|
57
|
+
### 2.2 样式处理方式2 (全局引入样式)
|
58
|
+
|
59
|
+
```typescript
|
60
|
+
// main.ts
|
61
|
+
import 'cnhis-design-vue/es/components/index.css';
|
62
|
+
```
|
63
|
+
|
64
|
+
## 3.FAQ
|
65
|
+
|
66
|
+
### 3.1 项目打包后样式丢失
|
67
|
+
|
68
|
+
处理方法, 将 cnhis-design-vue 从 vendor 包中移除 (没有出现此问题则不需要)
|
69
|
+
|
70
|
+
```typescript
|
71
|
+
// vite.config.ts
|
72
|
+
import { defineConfig } from 'vite';
|
73
|
+
|
74
|
+
export default defineConfig({
|
75
|
+
build: {
|
76
|
+
rollupOptions: {
|
77
|
+
// ..otherOptions
|
78
|
+
output: {
|
79
|
+
dir: './dist',
|
80
|
+
manualChunks: {
|
81
|
+
'cnhis-vendor': ['cnhis-design-vue']
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
});
|
87
|
+
```
|
@@ -30,6 +30,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
30
30
|
commandList: {
|
31
31
|
type: import("vue").PropType<import("./src/types").CommandItem[]>;
|
32
32
|
};
|
33
|
+
queryPrompt: {
|
34
|
+
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
35
|
+
};
|
33
36
|
}, {
|
34
37
|
cssVars: import("vue").ComputedRef<import("../../shared/types").AnyObject>;
|
35
38
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -63,6 +66,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
63
66
|
commandList: {
|
64
67
|
type: import("vue").PropType<import("./src/types").CommandItem[]>;
|
65
68
|
};
|
69
|
+
queryPrompt: {
|
70
|
+
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
71
|
+
};
|
66
72
|
}>> & {
|
67
73
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
68
74
|
}>>;
|
@@ -101,7 +107,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
101
107
|
shortcutDescription?: string | undefined;
|
102
108
|
children?: any[] | undefined;
|
103
109
|
}[]>;
|
110
|
+
showPrompt: import("vue").Ref<boolean>;
|
104
111
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
112
|
+
showMagicWand: import("vue").ComputedRef<boolean>;
|
105
113
|
recorderStart: () => Promise<void>;
|
106
114
|
isValidJSON: (str: string) => boolean;
|
107
115
|
getShortcutName: (item: string | import("../../shared/types").AnyObject) => any;
|
@@ -109,6 +117,7 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
109
117
|
resetCurrentCommand: () => void;
|
110
118
|
handleKeyDown: (event: KeyboardEvent) => void;
|
111
119
|
isWrap: (event: KeyboardEvent) => boolean;
|
120
|
+
handleInput: (value: string) => void;
|
112
121
|
handleSend: () => void;
|
113
122
|
clickMenu: (menu: import("./src/types").CommandItem) => void;
|
114
123
|
handleBack: () => void;
|
@@ -122,6 +131,50 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
122
131
|
PaperPlane: 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<{}>>, {}>;
|
123
132
|
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<{}>>, {}>;
|
124
133
|
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
|
+
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<{}>>, {}>;
|
135
|
+
ChatPrompt: import("vue").DefineComponent<{
|
136
|
+
show: {
|
137
|
+
type: BooleanConstructor;
|
138
|
+
};
|
139
|
+
}, {
|
140
|
+
pageInfo: {
|
141
|
+
page: number;
|
142
|
+
hasMore: boolean;
|
143
|
+
};
|
144
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
145
|
+
show: {
|
146
|
+
type: BooleanConstructor;
|
147
|
+
};
|
148
|
+
}>> & {
|
149
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
150
|
+
}>>;
|
151
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
152
|
+
queryPrompt: any;
|
153
|
+
state: any;
|
154
|
+
listRef: import("vue").Ref<any>;
|
155
|
+
keyword: import("vue").Ref<string>;
|
156
|
+
list: import("vue").Ref<import("../../shared/types").AnyObject[]>;
|
157
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
158
|
+
handleInput: () => void;
|
159
|
+
handleSearch: () => Promise<void>;
|
160
|
+
resetAndSearch: () => void;
|
161
|
+
select: (item: import("../../shared/types").AnyObject) => void;
|
162
|
+
NDrawer: any;
|
163
|
+
NDrawerContent: any;
|
164
|
+
NIcon: any;
|
165
|
+
NInput: any;
|
166
|
+
NButton: any;
|
167
|
+
CloseOutline: 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<{}>>, {}>;
|
168
|
+
SearchOutline: 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<{}>>, {}>;
|
169
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
170
|
+
show: {
|
171
|
+
type: BooleanConstructor;
|
172
|
+
};
|
173
|
+
}>> & {
|
174
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
175
|
+
}, {
|
176
|
+
show: boolean;
|
177
|
+
}>;
|
125
178
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
126
179
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
127
180
|
userAvatar: {
|
@@ -154,6 +207,9 @@ declare const AiChat: SFCWithInstall<import("vue").DefineComponent<{
|
|
154
207
|
commandList: {
|
155
208
|
type: import("vue").PropType<import("./src/types").CommandItem[]>;
|
156
209
|
};
|
210
|
+
queryPrompt: {
|
211
|
+
type: import("vue").PropType<import("./src/types").QueryPrompt>;
|
212
|
+
};
|
157
213
|
}>> & {
|
158
214
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
159
215
|
}, {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { type PropType } from 'vue';
|
2
|
-
import { QueryData, QueryRecord, CommandItem } from './types';
|
2
|
+
import { QueryData, QueryRecord, CommandItem, QueryPrompt } from './types';
|
3
3
|
import { AnyObject } from '../../../shared/types';
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
5
5
|
userAvatar: {
|
@@ -32,6 +32,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
32
32
|
commandList: {
|
33
33
|
type: PropType<CommandItem[]>;
|
34
34
|
};
|
35
|
+
queryPrompt: {
|
36
|
+
type: PropType<QueryPrompt>;
|
37
|
+
};
|
35
38
|
}, {
|
36
39
|
cssVars: import("vue").ComputedRef<AnyObject>;
|
37
40
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
@@ -65,6 +68,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
65
68
|
commandList: {
|
66
69
|
type: PropType<CommandItem[]>;
|
67
70
|
};
|
71
|
+
queryPrompt: {
|
72
|
+
type: PropType<QueryPrompt>;
|
73
|
+
};
|
68
74
|
}>> & {
|
69
75
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
70
76
|
}>>;
|
@@ -103,7 +109,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
103
109
|
shortcutDescription?: string | undefined;
|
104
110
|
children?: any[] | undefined;
|
105
111
|
}[]>;
|
112
|
+
showPrompt: import("vue").Ref<boolean>;
|
106
113
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
114
|
+
showMagicWand: import("vue").ComputedRef<boolean>;
|
107
115
|
recorderStart: () => Promise<void>;
|
108
116
|
isValidJSON: (str: string) => boolean;
|
109
117
|
getShortcutName: (item: string | AnyObject) => any;
|
@@ -111,6 +119,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
111
119
|
resetCurrentCommand: () => void;
|
112
120
|
handleKeyDown: (event: KeyboardEvent) => void;
|
113
121
|
isWrap: (event: KeyboardEvent) => boolean;
|
122
|
+
handleInput: (value: string) => void;
|
114
123
|
handleSend: () => void;
|
115
124
|
clickMenu: (menu: CommandItem) => void;
|
116
125
|
handleBack: () => void;
|
@@ -124,6 +133,50 @@ declare const _default: import("vue").DefineComponent<{
|
|
124
133
|
PaperPlane: 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<{}>>, {}>;
|
125
134
|
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<{}>>, {}>;
|
126
135
|
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
|
+
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<{}>>, {}>;
|
137
|
+
ChatPrompt: import("vue").DefineComponent<{
|
138
|
+
show: {
|
139
|
+
type: BooleanConstructor;
|
140
|
+
};
|
141
|
+
}, {
|
142
|
+
pageInfo: {
|
143
|
+
page: number;
|
144
|
+
hasMore: boolean;
|
145
|
+
};
|
146
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
147
|
+
show: {
|
148
|
+
type: BooleanConstructor;
|
149
|
+
};
|
150
|
+
}>> & {
|
151
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
152
|
+
}>>;
|
153
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
154
|
+
queryPrompt: any;
|
155
|
+
state: any;
|
156
|
+
listRef: import("vue").Ref<any>;
|
157
|
+
keyword: import("vue").Ref<string>;
|
158
|
+
list: import("vue").Ref<AnyObject[]>;
|
159
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
160
|
+
handleInput: () => void;
|
161
|
+
handleSearch: () => Promise<void>;
|
162
|
+
resetAndSearch: () => void;
|
163
|
+
select: (item: AnyObject) => void;
|
164
|
+
NDrawer: any;
|
165
|
+
NDrawerContent: any;
|
166
|
+
NIcon: any;
|
167
|
+
NInput: any;
|
168
|
+
NButton: any;
|
169
|
+
CloseOutline: 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<{}>>, {}>;
|
170
|
+
SearchOutline: 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<{}>>, {}>;
|
171
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
172
|
+
show: {
|
173
|
+
type: BooleanConstructor;
|
174
|
+
};
|
175
|
+
}>> & {
|
176
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
177
|
+
}, {
|
178
|
+
show: boolean;
|
179
|
+
}>;
|
127
180
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
128
181
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "button-click"[], "button-click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
129
182
|
userAvatar: {
|
@@ -156,6 +209,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
156
209
|
commandList: {
|
157
210
|
type: PropType<CommandItem[]>;
|
158
211
|
};
|
212
|
+
queryPrompt: {
|
213
|
+
type: PropType<QueryPrompt>;
|
214
|
+
};
|
159
215
|
}>> & {
|
160
216
|
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
161
217
|
}, {
|
@@ -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 i,openBlock as s,createElementBlock as a,normalizeClass as n,normalizeStyle as m,unref as u,createVNode as p,createBlock as d,createCommentVNode as l}from"vue";import c from"./components/ChatMain.js";import y from"./components/ChatFooter.vue.js";import{useTheme as h}from"../../../shared/hooks/useTheme.js";import"@vueuse/core";import"date-fns";import"lodash-es";import"@vue/shared";import{uuidGenerator as f}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 S}from"./types/index.js";const j=["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}},emits:["button-click"],setup(e,{emit:k}){const C=e,g=h(),x=t({id:"ai-chat-"+f(),beingSent:!1,sendContent:"",selectedCommand:null,selectedPrompt:null});return o(v,{...r(C),state:x,isSmall:i((()=>"small"===C.uiStyle))}),o(S,k),(t,o)=>(s(),a("div",{id:x.id,class:n(["ai-chat","small"===e.uiStyle?"ai-chat--small":""]),style:m(u(g))},[p(u(c)),e.hideInput?l("v-if",!0):(s(),d(y,{key:0}))],14,j))}});export{k as default};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { PropType } from 'vue';
|
2
|
+
import { MessageItem } from '../types';
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
4
|
+
msgItem: {
|
5
|
+
type: PropType<MessageItem>;
|
6
|
+
default: () => {};
|
7
|
+
};
|
8
|
+
}, () => 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
|
+
msgItem: {
|
10
|
+
type: PropType<MessageItem>;
|
11
|
+
default: () => {};
|
12
|
+
};
|
13
|
+
}>> & {
|
14
|
+
"onButton-click"?: ((...args: any[]) => any) | undefined;
|
15
|
+
}, {
|
16
|
+
msgItem: MessageItem;
|
17
|
+
}>;
|
18
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as t,createVNode as e,createTextVNode as n}from"vue";import{NButton as a,NIcon as i}from"naive-ui";import{ChevronForward as l}from"@vicons/ionicons5";var s=t({name:"ChatCard",inheritAttrs:!1,props:{msgItem:{type:Object,default:()=>({})}},emits:["button-click"],setup(t,{attrs:s,slots:o,emit:c}){function d(t){const{patientName:i,patientAge:l,patientBedNumber:s}=t;return[e("p",null,[`${i}/${l}/${s}`]),e("div",{class:"patient-info"},[[t.fields.slice(0,10).map((t=>e("div",{class:"patient-item"},[e("p",null,[`[${t.classifyName}]${t.ruleName}`]),e("p",null,[t.remark])]))),t.fields.length>10?e(a,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",onClick:()=>c("button-click")},{default:()=>[n("更多")]}):null]])]}const{content:p="{}"}=t.msgItem,r=JSON.parse(p),m=["journaling","dashboard"].includes(r.buttonType);return()=>e("div",{class:"card"},["patientScore"===r.buttonType?d(r):[e("p",null,[r.title]),m?r.fields.map((t=>e(a,{class:"link-btn",style:"--n-height: 36px",secondary:!0,"icon-placement":"right",onClick:()=>c("button-click",t)},{default:()=>t.name,icon:()=>e(i,{component:l},null)}))):[e("div",{class:"card-body"},[e("p",{class:"card-body__head"},[r.instructionName]),e("div",{class:"card-body__content"},[r.fields.map((t=>e("div",null,[e("span",{class:"label"},[t.name]),n(":"),e("span",null,[t.value])])))])]),e(a,{style:"margin-top: 10px;width: 100%;--n-height: 36px;font-size: 15px",secondary:!0,class:"gradient",disabled:t.msgItem.disabled,onClick:()=>c("button-click")},{default:()=>[r.buttonName]})]]])}});export{s as default};
|
@@ -27,7 +27,9 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
27
27
|
shortcutDescription?: string | undefined;
|
28
28
|
children?: any[] | undefined;
|
29
29
|
}[]>;
|
30
|
+
showPrompt: import("vue").Ref<boolean>;
|
30
31
|
btnDisabled: import("vue").ComputedRef<boolean>;
|
32
|
+
showMagicWand: import("vue").ComputedRef<boolean>;
|
31
33
|
recorderStart: () => Promise<void>;
|
32
34
|
isValidJSON: (str: string) => boolean;
|
33
35
|
getShortcutName: (item: string | AnyObject) => any;
|
@@ -35,6 +37,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
35
37
|
resetCurrentCommand: () => void;
|
36
38
|
handleKeyDown: (event: KeyboardEvent) => void;
|
37
39
|
isWrap: (event: KeyboardEvent) => boolean;
|
40
|
+
handleInput: (value: string) => void;
|
38
41
|
handleSend: () => void;
|
39
42
|
clickMenu: (menu: CommandItem) => void;
|
40
43
|
handleBack: () => void;
|
@@ -48,5 +51,49 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
48
51
|
PaperPlane: 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<{}>>, {}>;
|
49
52
|
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<{}>>, {}>;
|
50
53
|
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
|
+
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<{}>>, {}>;
|
55
|
+
ChatPrompt: import("vue").DefineComponent<{
|
56
|
+
show: {
|
57
|
+
type: BooleanConstructor;
|
58
|
+
};
|
59
|
+
}, {
|
60
|
+
pageInfo: {
|
61
|
+
page: number;
|
62
|
+
hasMore: boolean;
|
63
|
+
};
|
64
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
65
|
+
show: {
|
66
|
+
type: BooleanConstructor;
|
67
|
+
};
|
68
|
+
}>> & {
|
69
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
70
|
+
}>>;
|
71
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
72
|
+
queryPrompt: any;
|
73
|
+
state: any;
|
74
|
+
listRef: import("vue").Ref<any>;
|
75
|
+
keyword: import("vue").Ref<string>;
|
76
|
+
list: import("vue").Ref<AnyObject[]>;
|
77
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
78
|
+
handleInput: () => void;
|
79
|
+
handleSearch: () => Promise<void>;
|
80
|
+
resetAndSearch: () => void;
|
81
|
+
select: (item: AnyObject) => void;
|
82
|
+
NDrawer: any;
|
83
|
+
NDrawerContent: any;
|
84
|
+
NIcon: any;
|
85
|
+
NInput: any;
|
86
|
+
NButton: any;
|
87
|
+
CloseOutline: 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<{}>>, {}>;
|
88
|
+
SearchOutline: 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<{}>>, {}>;
|
89
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
90
|
+
show: {
|
91
|
+
type: BooleanConstructor;
|
92
|
+
};
|
93
|
+
}>> & {
|
94
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
95
|
+
}, {
|
96
|
+
show: boolean;
|
97
|
+
}>;
|
51
98
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
52
99
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as l,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as i,normalizeClass as r,unref as u,Fragment as
|
1
|
+
import{defineComponent as e,inject as t,ref as l,computed as o,watch as n,onBeforeUnmount as a,openBlock as s,createElementBlock as i,normalizeClass as r,unref as u,Fragment as c,renderList as d,createBlock as v,withCtx as m,createTextVNode as p,toDisplayString as h,createCommentVNode as f,createVNode as k,createElementVNode as b,getCurrentInstance as y}from"vue";import{NButton as g,NPopover as x,NInput as C,NTag as w,NIcon as _,NBreadcrumb as S,NBreadcrumbItem as j}from"naive-ui";import{SparklesSharp as z,PaperPlane as T,ChevronBack as K,ChevronForward as I}from"@vicons/ionicons5";import{InjectionAIChatEmits as M,InjectionAIChat as R}from"../types/index.js";import D from"../../../audio-sdk/src/audioSDK.js";import{cloneDeep as P,isString as E,last as L}from"lodash-es";import{useTheme as N}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 U from"./ChatPrompt.vue.js";const B={key:0,class:"menu-box fillet-8"},F={class:"input-wrapper fillet-10"},J=b("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"},[b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 448h128"}),b("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"}),b("path",{fill:"none",stroke:"black","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 368v80"}),b("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),O={class:"btn-box"},W=["disabled"],H={class:"command-box"},V={class:"command-box__header"},q={key:0,class:"title"},A={class:"command-box__menu"},G=["onClick"],Q={class:"label"},X={class:"remark"};var Y=e({__name:"ChatFooter",setup(e){const Y=N(),Z=D.create(),$=t(M),{shortcutList:ee,state:te,isSmall:le,audioTimed:oe,commandList:ne}=t(R),ae=l(),se=l(""),ie=l(!1),re=l([]),ue=l(P(ne.value||[])),ce=l(!1),de=o((()=>!se.value.replace(/( |\s|<br>)+/g,""))),ve=o((()=>{var e;return!se.value&&!(null==(e=ae.value)?void 0:e.activated.value)}));async function me(){try{const e=await Z.start(y(),{allowPunctuationMark:!1,timed:oe.value||10,realTimeRecognition:!0});if("success"!==(null==e?void 0:e.result))return;const{text:t}=e.data;se.value=t}catch(e){console.log(e)}}function pe(e){var t,l;if(E(e))return e;const o=null==(l=null==(t=null==e?void 0:e.contents)?void 0:t[0])?void 0:l.content;return(function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(o)?JSON.parse(o):{}).instructionName}function he(){var e;ue.value=P(ne.value||[]),re.value=[],(null==(e=ne.value)?void 0:e.length)>0&&(ie.value=!0)}function fe(e){ie.value=!1,"Slash"!==e.code||te.selectedCommand||se.value||he(),"Backspace"===e.key&&(!se.value.startsWith("/")&&!se.value.startsWith("、")||2!==se.value.length||te.selectedCommand?!se.value&&te.selectedCommand&&(e.preventDefault(),te.selectedCommand=null,se.value="/",he()):he()),["Enter"].includes(e.key)&&(function(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}(e)||(e.preventDefault(),be()))}function ke(e){!e&&te.selectedPrompt&&(te.selectedPrompt=null)}function be(){de.value||(te.beingSent=!0,te.sendContent=se.value,se.value="")}function ye(){var e;re.value.pop(),ue.value=L(re.value)?null==(e=L(re.value))?void 0:e.children:P(ne.value||[])}return n((()=>te.sendContent),(e=>{e&&!te.beingSent&&(se.value=e)})),a((()=>{Z.destroy()})),(e,t)=>(s(),i("section",{class:r(["chat-footer",u(te).beingSent?"disabled":""])},[u(ee)&&u(ee).length>0?(s(),i("div",B,[(s(!0),i(c,null,d(u(ee),(e=>(s(),v(u(g),{secondary:"",size:"small",round:u(le),key:pe(e),onClick:()=>function(e){var t;if(E(e))se.value=e;else{const l=null==(t=null==e?void 0:e.contents)?void 0:t[0];$("button-click",{msgItem:l,item:e})}}(e)},{default:m((()=>[p(h(pe(e)),1)])),_:2},1032,["round","onClick"])))),128))])):f("v-if",!0),k(u(x),{"content-style":"height: 400px",placement:"top-start",trigger:"manual",width:"trigger","show-arrow":!1,to:!1,show:ie.value,onClickoutside:t[4]||(t[4]=e=>ie.value=!1)},{trigger:m((()=>[b("div",F,[u(le)?(s(),v(u(C),{key:0,ref_key:"inputRef",ref:ae,style:{"--n-height":"48px"},round:"",placeholder:"",disabled:u(te).beingSent,value:se.value,"onUpdate:value":t[1]||(t[1]=e=>se.value=e),onKeydown:fe,onInput:ke},{prefix:m((()=>[u(te).selectedCommand&&u(te).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Y)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>[p(" /"+h(u(te).selectedCommand.shortcutTitle),1)])),_:1},8,["color"])):u(ve)?(s(),v(u(g),{key:1,text:"",onClick:t[0]||(t[0]=()=>ce.value=!0)},{default:m((()=>[k(u(_),{color:"#8f66f7",size:"18",component:u(z)},null,8,["component"])])),_:1})):f("v-if",!0)])),suffix:m((()=>[k(u(g),{text:"",disabled:u(te).beingSent,onClick:me},{icon:m((()=>[k(u(_),{size:"30"},{default:m((()=>[J])),_:1})])),_:1},8,["disabled"]),k(u(g),{circle:"",class:"gradient",style:{"margin-left":"10px"},disabled:u(de),onClick:be},{icon:m((()=>[k(u(_),{color:"#fff",size:"20",component:u(T)},null,8,["component"])])),_:1},8,["disabled"])])),_:1},8,["disabled","value"])):(s(),i(c,{key:1},[k(u(C),{ref_key:"inputRef",ref:ae,type:"textarea",placeholder:"请向我提问,Shift+Enter换行",disabled:u(te).beingSent,autosize:{minRows:2,maxRows:7},value:se.value,"onUpdate:value":t[3]||(t[3]=e=>se.value=e),onKeydown:fe,onInput:ke},{prefix:m((()=>[u(te).selectedCommand&&u(te).selectedCommand.shortcutTitle?(s(),v(u(w),{key:0,bordered:!1,color:{textColor:u(Y)["--c-primary-color"]},style:{"--n-border-radius":"5px"}},{default:m((()=>{var e;return[p(" /"+h(null==(e=u(te).selectedCommand)?void 0:e.shortcutTitle),1)]})),_:1},8,["color"])):u(ve)?(s(),v(u(g),{key:1,text:"",onClick:t[2]||(t[2]=()=>ce.value=!0)},{default:m((()=>[k(u(_),{color:"#8f66f7",size:"18",component:u(z)},null,8,["component"])])),_:1})):f("v-if",!0)])),_:1},8,["disabled","value"]),b("div",O,[b("span",{class:r(["btn-send","gradient","fillet-8",u(de)?"disabled":""]),disabled:u(de),onClick:be},[k(u(_),{color:"#fff",size:"22",component:u(T)},null,8,["component"])],10,W)])],64))])])),default:m((()=>[b("div",H,[b("div",V,[0===re.value.length?(s(),i("span",q,"推荐指令")):(s(),i(c,{key:1},[k(u(g),{text:"",onClick:ye},{default:m((()=>[k(u(_),{color:"#999",size:"20",component:u(K)},null,8,["component"])])),_:1}),k(u(S),null,{default:m((()=>[(s(!0),i(c,null,d(re.value,(e=>(s(),v(u(j),{key:e.shortcutId},{default:m((()=>[p(h(e.shortcutTitle),1)])),_:2},1024)))),128))])),_:1})],64))]),b("div",A,[(s(!0),i(c,null,d(ue.value,(e=>(s(),i("div",{class:r(["menu-item",e.children&&e.children.length?"":"selectable"]),key:e.shortcutId,onClick:()=>{var t,l;(null==(l=(t=e).children)?void 0:l.length)?(ue.value=t.children,re.value.push(t)):(te.selectedCommand=t||{},ie.value=!1,se.value="",ae.value.focus())}},[b("span",Q,h(e.shortcutTitle),1),b("span",X,h(e.shortcutDescription),1),e.children&&e.children.length?(s(),v(u(_),{key:0,color:"#999",size:"20",component:u(I)},null,8,["component"])):f("v-if",!0)],10,G)))),128))])])])),_:1},8,["show"]),k(U,{show:ce.value,"onUpdate:show":t[5]||(t[5]=e=>ce.value=e)},null,8,["show"])],2))}});export{Y as default};
|
@@ -1 +1 @@
|
|
1
|
-
import{defineComponent as e,inject as t,ref as n,computed as l,watch as
|
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,mergeProps as i,isVNode as u}from"vue";import{NAvatar as c,NSpin as d,NButton as m,NSpace as p}from"naive-ui";import{InjectionAIChatEmits as v,InjectionAIChat as f}from"../types/index.js";import g from"../../../../shared/assets/img/ai__avatar.png.js";import h from"../../../../shared/assets/img/logo.png.js";import{isArray as b,isFunction as y}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 C}from"../../../../shared/hooks/useScrollLoading.js";import k from"./ChatCard.js";function j(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!u(e)}var x=e({name:"ChatMain",inheritAttrs:!1,props:{},emits:[],setup(e,{attrs:u,slots:x,emit:S}){const I=t(v),{userAvatar:E,queryData:T,state:w,queryRecord:z,defaultShortcutList:M,hideInput:A=!1,isSmall:O}=t(f),_=n(null),q=n([]),H=n(!1),L=l((()=>O.value?h:g)),B={page:0,hasMore:!0};async function D(e=!1){if(!B.hasMore)return;B.page++,1==B.page&&(q.value=[]);const{records:t,rows:n}=await z.value({page:B.page});b(n)&&q.value.length<=+t&&(q.value=B.page>1?[...q.value,...n]:n,J(),q.value.length>=+t&&(e&&(H.value=!0),B.hasMore=!1,console.log("没有更多消息了")))}function J(){q.value.forEach((e=>{e.buttonType&&(e.disabled=!0),e.contents.forEach((e=>e.disabled=!0))}))}function N(e){const{item:t,msgItem:n,fieldItem:l}=e;if(n)return I("button-click",{item:t,msgItem:n,fieldItem:l}),void q.value.forEach((e=>e.contents.forEach((e=>e.disabled=!0))));q.value.forEach((e=>e.buttonType&&(e.disabled=!0))),t.link||(w.beingSent=!0,w.sendContent="确定")}function P(e,t){const{contentType:n,content:l=""}=t;return"json"===n&&function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(l)?s(k,{msgItem:t,"onButton-click":n=>N({item:e,msgItem:t,...n?{fieldItem: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)])),l&&0===t?[s("br",null,null),s(m,i({style:"margin-top: 5px",secondary:!0,class:"gradient",disabled:e.disabled},e.link?{tag:"a",href:e.link,target:"_blank"}:{},{onClick:()=>N({item:e})}),{default:()=>[r("确定")]})]:null]}function F({role:e=""}){return"user"===e}function G(){let e;return s("div",{class:"message-item"},[s(c,{round:!0,size:O.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("你的反馈助我成长,期待我们一起探索未来!下次可以在首页和应用页找到我~")]),b(M.value)&&M.value.length>0?[s("p",{style:"margin: 5px 0 5px"},[r("你可以试着问我:")]),s(p,{"wrap-item":!1},j(e=M.value.map((e=>s(m,{size:"large",secondary:!0,onClick:()=>w.sendContent=e,disabled:w.beingSent},j(e)?e:{default:()=>[e]}))))?e:{default:()=>[e]})]:null])])])}return C(_,(()=>{D()}),A.value?"bottom":"top"),D(!0),o((()=>w.beingSent),(async e=>{var t,n;if(e){q.value.unshift({contents:[{role:"user",content:w.sendContent}]}),null==(t=_.value)||t.scrollTo({top:0,behavior:"auto"}),J();const e=w.selectedCommand,l=w.selectedPrompt;w.selectedCommand=null;const o=await T.value({content:w.sendContent,contentType:"text",command:e,prompt:l});b(null==o?void 0:o.contents)&&(q.value.unshift(o),await a(),null==(n=_.value)||n.scrollTo({top:0,behavior:"auto"})),w.beingSent=!1,w.sendContent=""}})),()=>s("section",{class:"chat-main",ref:_,style:{"flex-direction":A.value?"column":"column-reverse"}},[[w.beingSent?s("div",{class:"message-item"},[[O.value?null:s(c,{round:!0,size:40,src:L.value},null),s("div",{class:"content-box"},[s("div",{class:"content loading"},[s(d,{size:22,stroke:"#4170EE"},null),s("span",null,[r("正在加载中,请稍等...")])])])]]):null,q.value.map((e=>e.contents.map(((t,n)=>s("div",{class:"message-item"},[[O.value?null:s(c,{round:!0,size:40,src:F(t)?E.value:L.value},null),s("div",{class:["content-box",F(t)?"mine":""]},[s("div",{class:"content"},[y(t.render)?t.render():R(e,n)])])]]))))),H.value?G():null]])}});export{x as default};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { AnyObject } from '../../../../shared/types';
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
3
|
+
show: {
|
4
|
+
type: BooleanConstructor;
|
5
|
+
};
|
6
|
+
}, {
|
7
|
+
pageInfo: {
|
8
|
+
page: number;
|
9
|
+
hasMore: boolean;
|
10
|
+
};
|
11
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
12
|
+
show: {
|
13
|
+
type: BooleanConstructor;
|
14
|
+
};
|
15
|
+
}>> & {
|
16
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
17
|
+
}>>;
|
18
|
+
emit: (event: "update:show", ...args: any[]) => void;
|
19
|
+
queryPrompt: any;
|
20
|
+
state: any;
|
21
|
+
listRef: import("vue").Ref<any>;
|
22
|
+
keyword: import("vue").Ref<string>;
|
23
|
+
list: import("vue").Ref<AnyObject[]>;
|
24
|
+
showNoData: import("vue").ComputedRef<boolean>;
|
25
|
+
handleInput: () => void;
|
26
|
+
handleSearch: () => Promise<void>;
|
27
|
+
resetAndSearch: () => void;
|
28
|
+
select: (item: AnyObject) => void;
|
29
|
+
NDrawer: any;
|
30
|
+
NDrawerContent: any;
|
31
|
+
NIcon: any;
|
32
|
+
NInput: any;
|
33
|
+
NButton: any;
|
34
|
+
CloseOutline: 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<{}>>, {}>;
|
35
|
+
SearchOutline: 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<{}>>, {}>;
|
36
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:show"[], "update:show", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
37
|
+
show: {
|
38
|
+
type: BooleanConstructor;
|
39
|
+
};
|
40
|
+
}>> & {
|
41
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
42
|
+
}, {
|
43
|
+
show: boolean;
|
44
|
+
}>;
|
45
|
+
export default _default;
|
@@ -0,0 +1 @@
|
|
1
|
+
import r from"./ChatPrompt.vue2.js";import t from"../../../../_virtual/_plugin-vue_export-helper.js";var e=t(r,[["__file","ChatPrompt.vue"]]);export{e as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
import{defineComponent as e,inject as o,ref as t,computed as a,watch as s,openBlock as r,createBlock as l,unref as n,withCtx as p,createVNode as u,createElementVNode as i,createElementBlock as c,Fragment as m,renderList as d,toDisplayString as h,withDirectives as v,vShow as f}from"vue";import{NDrawer as w,NDrawerContent as g,NButton as k,NIcon as C,NInput as y}from"naive-ui";import{CloseOutline as _,SearchOutline as j}from"@vicons/ionicons5";import{isFunction as x}from"lodash-es";import"../../../../shared/utils/index.js";import{useDebounceFn as M}from"@vueuse/core";import"date-fns";import"@vue/shared";import"@vueuse/shared";import"../../../../shared/hooks/selectHooks/useSearchContent.js";import{useScrollLoading as b}from"../../../../shared/hooks/useScrollLoading.js";import{InjectionAIChat as P}from"../types/index.js";const R={class:"title"},S=i("span",null,"发现提示词",-1),U=["onClick"];var q=e({__name:"ChatPrompt",props:{show:{type:Boolean}},emits:["update:show"],setup(e,{emit:q}){const z=e,B={page:0,hasMore:!0},{queryPrompt:H,state:I}=o(P),L=t(),O=t(""),T=t([]),$=a((()=>!T.value.length&&!!(O.value||"").replace(/^\s+|\s+$/g,""))),A=M(E,500);async function D(){try{if(!B.hasMore||!x(H.value))return;B.page++,1==B.page&&(T.value=[]);const e=await H.value({keyword:O.value,page:B.page});T.value.length<=+e.records&&(T.value=B.page>1?T.value.concat(e.rows):e.rows,T.value.length>=+e.records&&(B.hasMore=!1))}catch(e){}}function E(){Object.assign(B,{page:0,hasMore:!0}),D()}return b(L,(()=>{D()})),s((()=>z.show),(e=>{e&&(O.value="",E())})),(o,t)=>(r(),l(n(w),{placement:"bottom",height:"70%","trap-focus":!1,to:"#"+n(I).id,show:e.show,"content-class":"prompt-wrapper",onMaskClick:t[2]||(t[2]=()=>q("update:show",!1))},{default:p((()=>[u(n(g),null,{header:p((()=>[i("div",R,[S,u(n(k),{text:"",onClick:t[0]||(t[0]=()=>q("update:show",!1))},{default:p((()=>[u(n(C),{size:"20",component:n(_)},null,8,["component"])])),_:1})]),u(n(y),{ref:"inputRef",clearable:"",autofocus:"",value:O.value,"onUpdate:value":[t[1]||(t[1]=e=>O.value=e),n(A)]},{prefix:p((()=>[u(n(C),{component:n(j)},null,8,["component"])])),_:1},8,["value","onUpdate:value"])])),default:p((()=>[i("div",{class:"list-wrapper",ref_key:"listRef",ref:L},[(r(!0),c(m,null,d(T.value,(e=>(r(),c("div",{class:"item",key:e.promptId,onClick:()=>function(e){q("update:show",!1),I.selectedPrompt=e,I.sendContent=e.promptContent}(e)},[i("p",null,h(e.promptTitle),1),i("p",null,h(e.promptContent),1)],8,U)))),128)),v(i("div",null,"找不到相关的结果",512),[[f,n($)]])],512)])),_:1})])),_:1},8,["to","show"]))}});export{q as default};
|